You've already forked Commercialization.topon
update 1.1.25
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: c90e2c073a7dcd04b9e3d7fff73a14df
|
guid: 72c5f7ab43ab2534f91498d7b13d3c3c
|
||||||
PluginImporter:
|
PluginImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@@ -45,7 +45,18 @@ namespace Topon_Adapter.Editor
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if UNITY_2019_3_OR_NEWER
|
||||||
|
var resXmlPath = Path.Combine(path, "src/main/res/xml");
|
||||||
|
#else
|
||||||
|
var resXmlPath = Path.Combine(path, "unityLibrary/src/main/res/xml");
|
||||||
|
#endif
|
||||||
|
if (!Directory.Exists(resXmlPath))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(resXmlPath);
|
||||||
|
}
|
||||||
|
// var fromScriptableObject = MonoScript.FromScriptableObject(this);
|
||||||
|
var xmlPath = GetScriptsPath("AD_BuildAndroidProcess");
|
||||||
|
saveFile($"{xmlPath}/alex_tt_file_path.xml", resXmlPath);
|
||||||
|
|
||||||
// Get the `manifest` element.
|
// Get the `manifest` element.
|
||||||
var elementManifest = manifest.Element ("manifest");
|
var elementManifest = manifest.Element ("manifest");
|
||||||
@@ -88,19 +99,37 @@ namespace Topon_Adapter.Editor
|
|||||||
var elementlauncherManifest = launcherManifest.Element ("manifest");
|
var elementlauncherManifest = launcherManifest.Element ("manifest");
|
||||||
var elementlauncherApplication = elementlauncherManifest.Element ("application");
|
var elementlauncherApplication = elementlauncherManifest.Element ("application");
|
||||||
|
|
||||||
var csjElements = elementlauncherApplication.Descendants ().Where (element => element.Name.LocalName.Equals ("provider"));
|
var launcherElements = elementlauncherApplication.Descendants ().Where (element => element.Name.LocalName.Equals ("provider"));
|
||||||
XElement csjElement = GetElementByName (csjElements, "com.bytedance.sdk.openadsdk.TTFileProvider");
|
XElement launcherElement = GetElementByName (launcherElements, "com.bytedance.sdk.openadsdk.TTFileProvider");
|
||||||
if (csjElement == null)
|
if (launcherElement == null)
|
||||||
{
|
{
|
||||||
//增加穿山甲配置
|
//增加穿山甲配置
|
||||||
elementlauncherApplication.Add (CreateCSJGromore ());
|
elementlauncherApplication.Add (CreateCSJGromore ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var elementMainManifest = manifest.Element ("manifest");
|
||||||
|
var elementMainApplication = elementMainManifest.Element ("application");
|
||||||
|
|
||||||
|
var mainElements = elementMainApplication.Descendants ().Where (element => element.Name.LocalName.Equals ("provider"));
|
||||||
|
XElement mainElement = GetElementByName (mainElements, "com.bytedance.sdk.openadsdk.TTFileProvider");
|
||||||
|
if (mainElement == null)
|
||||||
|
{
|
||||||
|
//增加穿山甲配置
|
||||||
|
elementMainApplication.Add (CreateCSJGromore ());
|
||||||
|
}
|
||||||
|
|
||||||
// Save the updated manifest file.
|
// Save the updated manifest file.
|
||||||
manifest.Save (manifestPath);
|
manifest.Save (manifestPath);
|
||||||
launcherManifest.Save (launcherManifestPath);
|
launcherManifest.Save (launcherManifestPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void saveFile(string filePathName , string toFilesPath)
|
||||||
|
{
|
||||||
|
FileInfo file = new FileInfo(filePathName);
|
||||||
|
string newFileName = file.Name;
|
||||||
|
file.CopyTo(toFilesPath + "/" + newFileName, true);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 增加微信开放平台的适配
|
/// 增加微信开放平台的适配
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -141,6 +170,18 @@ namespace Topon_Adapter.Editor
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetScriptsPath (string scriptName)
|
||||||
|
{
|
||||||
|
string[] path = UnityEditor.AssetDatabase.FindAssets(scriptName);
|
||||||
|
if(path.Length >1)
|
||||||
|
{
|
||||||
|
// Debug.LogError("有同名文件"+_scriptName+"获取路径失败");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
//将字符串中得脚本名字和后缀统统去除掉
|
||||||
|
string _path = AssetDatabase.GUIDToAssetPath(path[0]).Replace((@"/" +scriptName +".cs"),"");
|
||||||
|
return _path;
|
||||||
|
}
|
||||||
|
|
||||||
public static XElement CreateCSJGromore ()
|
public static XElement CreateCSJGromore ()
|
||||||
{
|
{
|
||||||
|
|||||||
20
Assets/Topon_Adapter/Editor/alex_tt_file_path.xml
Normal file
20
Assets/Topon_Adapter/Editor/alex_tt_file_path.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
|
||||||
|
<paths>
|
||||||
|
<cache-path
|
||||||
|
name="tt_internal_cache_download"
|
||||||
|
path="Download" />
|
||||||
|
<external-files-path
|
||||||
|
name="tt_external_files_download"
|
||||||
|
path="Download" />
|
||||||
|
<external-path
|
||||||
|
name="tt_external_root"
|
||||||
|
path="." />
|
||||||
|
<external-path
|
||||||
|
name="tt_external_download"
|
||||||
|
path="Download" />
|
||||||
|
<files-path
|
||||||
|
name="tt_internal_file_download"
|
||||||
|
path="Download" />
|
||||||
|
</paths>
|
||||||
7
Assets/Topon_Adapter/Editor/alex_tt_file_path.xml.meta
Normal file
7
Assets/Topon_Adapter/Editor/alex_tt_file_path.xml.meta
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cd96bdfb7bbaca546883078c9e274137
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Reference in New Issue
Block a user