diff --git a/AnyThinkAds/Plugins/Android/China/mediation/alex_adapter_gromore_mix_5.8.0.7.2.aar b/AnyThinkAds/Plugins/Android/China/mediation/alex_adapter_gromore_mix_5.8.0.7.2.aar deleted file mode 100644 index 3a3dd6b..0000000 Binary files a/AnyThinkAds/Plugins/Android/China/mediation/alex_adapter_gromore_mix_5.8.0.7.2.aar and /dev/null differ diff --git a/AnyThinkAds/Plugins/Android/China/mediation/alex_adapter_gromore_mix_5.8.0.7.aar b/AnyThinkAds/Plugins/Android/China/mediation/alex_adapter_gromore_mix_5.8.0.7.aar new file mode 100644 index 0000000..8fe9786 Binary files /dev/null and b/AnyThinkAds/Plugins/Android/China/mediation/alex_adapter_gromore_mix_5.8.0.7.aar differ diff --git a/AnyThinkAds/Plugins/Android/China/mediation/alex_adapter_gromore_mix_5.8.0.7.2.aar.meta b/AnyThinkAds/Plugins/Android/China/mediation/alex_adapter_gromore_mix_5.8.0.7.aar.meta similarity index 93% rename from AnyThinkAds/Plugins/Android/China/mediation/alex_adapter_gromore_mix_5.8.0.7.2.aar.meta rename to AnyThinkAds/Plugins/Android/China/mediation/alex_adapter_gromore_mix_5.8.0.7.aar.meta index c1ec896..e4e86c4 100644 --- a/AnyThinkAds/Plugins/Android/China/mediation/alex_adapter_gromore_mix_5.8.0.7.2.aar.meta +++ b/AnyThinkAds/Plugins/Android/China/mediation/alex_adapter_gromore_mix_5.8.0.7.aar.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c90e2c073a7dcd04b9e3d7fff73a14df +guid: 72c5f7ab43ab2534f91498d7b13d3c3c PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Topon_Adapter/Editor/AD_BuildAndroidProcess.cs b/Topon_Adapter/Editor/AD_BuildAndroidProcess.cs index 5df85ea..e3492f7 100644 --- a/Topon_Adapter/Editor/AD_BuildAndroidProcess.cs +++ b/Topon_Adapter/Editor/AD_BuildAndroidProcess.cs @@ -45,7 +45,18 @@ namespace Topon_Adapter.Editor 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. var elementManifest = manifest.Element ("manifest"); @@ -88,19 +99,37 @@ namespace Topon_Adapter.Editor var elementlauncherManifest = launcherManifest.Element ("manifest"); var elementlauncherApplication = elementlauncherManifest.Element ("application"); - var csjElements = elementlauncherApplication.Descendants ().Where (element => element.Name.LocalName.Equals ("provider")); - XElement csjElement = GetElementByName (csjElements, "com.bytedance.sdk.openadsdk.TTFileProvider"); - if (csjElement == null) + var launcherElements = elementlauncherApplication.Descendants ().Where (element => element.Name.LocalName.Equals ("provider")); + XElement launcherElement = GetElementByName (launcherElements, "com.bytedance.sdk.openadsdk.TTFileProvider"); + if (launcherElement == null) { //增加穿山甲配置 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. manifest.Save (manifestPath); 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); + } + /// /// 增加微信开放平台的适配 /// @@ -141,6 +170,18 @@ namespace Topon_Adapter.Editor 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 () { diff --git a/Topon_Adapter/Editor/alex_tt_file_path.xml b/Topon_Adapter/Editor/alex_tt_file_path.xml new file mode 100644 index 0000000..bc3bd63 --- /dev/null +++ b/Topon_Adapter/Editor/alex_tt_file_path.xml @@ -0,0 +1,20 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Topon_Adapter/Editor/alex_tt_file_path.xml.meta b/Topon_Adapter/Editor/alex_tt_file_path.xml.meta new file mode 100644 index 0000000..3ded6e9 --- /dev/null +++ b/Topon_Adapter/Editor/alex_tt_file_path.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cd96bdfb7bbaca546883078c9e274137 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: