update 2.1.3

This commit is contained in:
2024-09-09 15:59:47 +08:00
parent 9a6c006139
commit 0f2acf4508
17 changed files with 158 additions and 96 deletions

View File

@@ -24,6 +24,7 @@ namespace AnyThink.Scripts.Editor
public class TopOnPostProcessBuildiOS
{
private static string mBuildPath;
private static readonly List<string> AtsRequiringNetworks = new List<string>
{
@@ -47,14 +48,53 @@ namespace AnyThink.Scripts.Editor
dynamicLibraryPathsToEmbed.Add(Path.Combine("Pods/", "StartAppSDK/StartApp.xcframework"));
dynamicLibraryPathsToEmbed.Add(Path.Combine("Pods/", "BigoADS/BigoADS/BigoADS.xcframework"));
dynamicLibraryPathsToEmbed.Add(Path.Combine("Pods/", "BigoADS/BigoADS/OMSDK_Bigosg.xcframework"));
dynamicLibraryPathsToEmbed.Add(Path.Combine("Pods/", "HyBid/PubnativeLite/PubnativeLite/OMSDK-1.3.29/OMSDK_Pubnativenet.xcframework"));
dynamicLibraryPathsToEmbed.Add(Path.Combine("Pods/", "Fyber_Marketplace_SDK/IASDKCore/IASDKCore.xcframework"));
dynamicLibraryPathsToEmbed.Add(Path.Combine("Pods/", "InMobiSDK/InMobiSDK.xcframework"));
//pubnative
dynamicLibraryPathsToEmbed.Add(Path.Combine("Pods/", "ATOM-Standalone/ATOM.xcframework"));
string pubNativePath = Path.Combine(mBuildPath, "Pods/HyBid/PubnativeLite/PubnativeLite");
if (Directory.Exists(pubNativePath)) {
// 获取所有以"OMSDK-"开头的子目录
string[] subDirectories = Directory.GetDirectories(pubNativePath, "OMSDK-*");
if (subDirectories.Length > 0) {
string versionDirectory= subDirectories[0];
string versionDirectoryName = Path.GetFileName(versionDirectory);
// ATLog.logError("DynamicLibraryPathsToEmbed() >>> pubNative versionDirectoryName: " + versionDirectoryName);
dynamicLibraryPathsToEmbed.Add(Path.Combine("Pods/", "HyBid/PubnativeLite/PubnativeLite/" + versionDirectoryName + "/OMSDK_Pubnativenet.xcframework"));
}
}
//applovin
string applovinPath = Path.Combine(mBuildPath, "Pods/AppLovinSDK");
if (Directory.Exists(applovinPath)) {
// 获取所有以"applovin-ios-sdk-"开头的子目录
string[] applovinSubDirectories = Directory.GetDirectories(applovinPath, "applovin-ios-sdk-*");
if (applovinSubDirectories.Length > 0) {
string applovinVersionDirectory = applovinSubDirectories[0];
string applovinVersionDirectoryName = Path.GetFileName(applovinVersionDirectory);
// ATLog.logError("DynamicLibraryPathsToEmbed() >>> applovinVersionDirectoryName: " + applovinVersionDirectoryName);
dynamicLibraryPathsToEmbed.Add(Path.Combine("Pods/", "AppLovinSDK/" + applovinVersionDirectoryName + "/AppLovinSDK.xcframework"));
}
}
return dynamicLibraryPathsToEmbed;
}
}
//读取本地已安装network的版本号:network_data.json
// private static string getNetworkVersion(string networkDataJsonFilePath)
// {
// if (!File.Exists(networkDataJsonFilePath)) {
// return "";
// }
// string jsonData = File.ReadAllText(networkDataJsonFilePath);
// var networkLocalData = JsonUtility.FromJson<NetworkLocalData>(a_json);
// if (networkLocalData != null) {
// return networkLocalData.version;
// }
// retrun "";
// }
private static List<string> BunldePathsToAdd {
get {
@@ -134,6 +174,8 @@ namespace AnyThink.Scripts.Editor
private static void EmbedDynamicLibrariesIfNeeded(string buildPath, PBXProject project, string targetGuid)
{
mBuildPath = buildPath;
ATLog.log("EmbedDynamicLibrariesIfNeeded() >>> buildPath: " + buildPath);
var dynamicLibraryPathsPresentInProject = DynamicLibraryPathsToEmbed.Where(dynamicLibraryPath => Directory.Exists(Path.Combine(buildPath, dynamicLibraryPath))).ToList();
if (dynamicLibraryPathsPresentInProject.Count <= 0) return;

View File

@@ -16,9 +16,10 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
public class ATConfig
{
public static string PLUGIN_VERSION = "2.1.1";
public static string PLUGIN_VERSION = "2.1.3";
public static bool isDebug = false;
public static int PLUGIN_TYPE = 1;
public static int OS_ANDROID = 1;
public static int OS_IOS = 2;
public static int CHINA_COUNTRY = 1;
@@ -328,48 +329,63 @@ public static bool isDebug = false;
//获取admob app id
public static string getAdmobAppIdByOs(int os) {
var pluginSettingData = getPluginSettingData();
if (pluginSettingData == null) {
return "";
}
var settingData = pluginSettingData.getCountrySettingData();
return settingData.getAdmobAppId(os);
}
public static bool enableAndroidX() {
var pluginSettingData = getPluginSettingData();
if (pluginSettingData == null) {
return false;
}
return pluginSettingData.getCountrySettingData().androidXSetting == 1;
}
public static bool isDefaultAndroidX() {
var pluginSettingData = getPluginSettingData();
if (pluginSettingData == null) {
return false;
}
return pluginSettingData.getCountrySettingData().androidXSetting == 0;
}
//获取默认选中的地区
public static int getDefCountry() {
string version = PLUGIN_VERSION;
int lastIndex = version.LastIndexOf('.');
// string version = PLUGIN_VERSION;
// int lastIndex = version.LastIndexOf('.');
if (lastIndex != -1)
{
//2.1.0是区分国内海外的插件2.1.01:后缀多了1是只有海外的插件
string lastPart = version.Substring(lastIndex + 1);
if (lastPart.Length == 2) {
return NONCHINA_COUNTRY;
}
// if (lastIndex != -1)
// {
// //2.1.0是区分国内海外的插件2.1.01:后缀多了1是只有海外的插件
// string lastPart = version.Substring(lastIndex + 1);
// if (lastPart.Length == 2) {
// return NONCHINA_COUNTRY;
// }
// }
if(PLUGIN_TYPE == 2) {
return NONCHINA_COUNTRY;
}
return CHINA_COUNTRY;
}
public static string[] getCountryArray() {
// new string[] { "ChinaMainland", "Overseas" }
string version = PLUGIN_VERSION;
int lastIndex = version.LastIndexOf('.');
// string version = PLUGIN_VERSION;
// int lastIndex = version.LastIndexOf('.');
if (lastIndex != -1)
{
//2.1.0是区分国内海外的插件2.1.01:后缀多了1是只有海外的插件
string lastPart = version.Substring(lastIndex + 1);
if (lastPart.Length == 2) {
return new string[] { "Overseas" };
}
// if (lastIndex != -1)
// {
// //2.1.0是区分国内海外的插件2.1.01:后缀多了1是只有海外的插件
// string lastPart = version.Substring(lastIndex + 1);
// if (lastPart.Length == 2) {
// return new string[] { "Overseas" };
// }
// }
if(PLUGIN_TYPE == 2) {
return new string[] { "Overseas" };
}
return new string[] { "ChinaMainland", "Overseas" };
}