You've already forked Commercialization.topon
升级sdk至 2.1.1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 01309b887f3fe4ece979fbb48275d06e
|
||||
guid: 74cd7d129c09b466a86bfa11ed6b16d1
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 290f0c123bbf64a6984427544e80839a
|
||||
guid: da98890a900e14accaef685984a61bd5
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c1cfce36f43447f9b2d114d262760e9
|
||||
guid: a3135f78bef1e464b80a119102c73984
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bc179ab55b7104f63a5ab4f284361fce
|
||||
guid: 0054580ab849d45198549eac7a372bc9
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 348edf87b5e4d4c648b81168c52d4c35
|
||||
guid: 41fd5ba357e7340aebe1ca236589f66a
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e1cd9f70cc444bda95630821b2db72b
|
||||
guid: f0b382f66e3504619885af1ed69ee1c1
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8defdf313c8954dbaa7ae6682d8f1a65
|
||||
guid: 7311500925e7344788fb99a2ef9e2e96
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3f3e2852ae7946e5b9daf2e27fa1011
|
||||
guid: 950e2794885244e8798ebc0ed47f8874
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ada836c19e1cb412e894751fbc3669d5
|
||||
guid: 31b5cf97768a140e298ddc29fc51435b
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,32 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd689cb07089a4ad58f9ea68d471251f
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d64ad1973dd54983b91cb1678c6d478
|
||||
guid: c58e18614454a415d8e2ad27964c04bf
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"name":"gdt","version":"4.562.1432","country":1,"path":"Assets/AnyThinkPlugin/AnyThinkAds\\Plugins/Android/China/mediation/gdt"}
|
||||
{"name":"gdt","version":"4.575.1445","country":1,"path":"Assets/AnyThinkPlugin/AnyThinkAds\\Plugins/Android/China/mediation/gdt"}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f3ba469b8da3d46898a264b6e8b8b008
|
||||
guid: 7addf8b7f1033463d9a2909737833d5c
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 45adbb2b2963347a989988cda4eab3e9
|
||||
guid: b56a274238fee48dcaa1ccae9a622dd7
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,32 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0e07b66260fa418884f4cc8e5a63bc5
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1 +1 @@
|
||||
{"name":"kuaishou","version":"3.3.59.1","country":1,"path":"Assets/AnyThinkPlugin/AnyThinkAds\\Plugins/Android/China/mediation/kuaishou"}
|
||||
{"name":"kuaishou","version":"3.3.63","country":1,"path":"Assets/AnyThinkPlugin/AnyThinkAds\\Plugins/Android/China/mediation/kuaishou"}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 38c1b7b371ecd45ba89127e91bee66ef
|
||||
guid: 0c8bdb20bc2814919a0fb316325ec587
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,32 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9dfc970c236d443c69c49bd7dd1a5049
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: af127e4ac3ee34f078cd4bb6d5163b24
|
||||
guid: 40954ebb3cfd04c9296425304103941e
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"name":"tap","version":"3.16.3.25","country":1,"path":"Assets/AnyThinkPlugin/AnyThinkAds\\Plugins/Android/China/mediation/tap"}
|
||||
{"name":"tap","version":"3.16.3.29","country":1,"path":"Assets/AnyThinkPlugin/AnyThinkAds\\Plugins/Android/China/mediation/tap"}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f8fbe67e9b4f64586b86daf28d4a8fff
|
||||
guid: 92a9540d6c4824102995e4688aea7989
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d12c55ddf05c24abd92b59cdaa090ab1
|
||||
guid: 6adb84ef6af8641e4b5a8d959f44d9d5
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dcb708d6d45d0f7419d7667d7ad9feba
|
||||
guid: 668ce08287b77354d9d17d91dc8e7399
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS/China.meta
Normal file
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS/China.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76dff0eaddf7c9e4db54ac483d4bd10c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS/China/core.meta
Normal file
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS/China/core.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76e1496423e6d4d039d9f0d051cc195d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1908b40a4f31848efb84232ead290fca
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><dependencies>
|
||||
<iosPods>
|
||||
<iosPod name="AnyThinkiOS" version="6.2.95" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: daf8b225bea19489bb7a89ca105900f9
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1 +0,0 @@
|
||||
{"curCountry":1,"china":{"android_version":"6.2.98","ios_version":"","enableAndroidX":true,"country":1,"android_admob_app_id":"","ios_admob_app_id":""},"nonchina":{"android_version":"","ios_version":"","enableAndroidX":true,"country":2,"android_admob_app_id":"","ios_admob_app_id":""}}
|
||||
8
AnyThinkPlugin/Resources/json/2.1.1.meta
Normal file
8
AnyThinkPlugin/Resources/json/2.1.1.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3f5d23b57baa75d4b851f776033a2b2a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1 @@
|
||||
{"curCountry":1,"china":{"android_version":"6.3.50","ios_version":"","androidXSetting":1,"country":1,"android_admob_app_id":"","ios_admob_app_id":""},"nonchina":{"android_version":"","ios_version":"","androidXSetting":0,"country":2,"android_admob_app_id":"","ios_admob_app_id":""}}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ebfbacc2a04216f4b8a3f359ee7db1df
|
||||
guid: 26d597193f8ac94428601791309d24ed
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -35,8 +35,9 @@ namespace AnyThink.Scripts.Editor
|
||||
#else
|
||||
var gradlePropertiesPath = Path.Combine(path, "gradle.properties");
|
||||
#endif
|
||||
|
||||
processGradleProperties(gradlePropertiesPath);
|
||||
if (!ATConfig.isDefaultAndroidX()) {
|
||||
processGradleProperties(gradlePropertiesPath);
|
||||
}
|
||||
processAndroidManifest(path);
|
||||
processNetworkConfigXml(path);
|
||||
ATProcessBuildGradleAndroid.processBuildGradle(path);
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
|
||||
public class ATConfig
|
||||
{
|
||||
public static string PLUGIN_VERSION = "2.1.0";
|
||||
public static string PLUGIN_VERSION = "2.1.1";
|
||||
public static bool isDebug = false;
|
||||
|
||||
public static int OS_ANDROID = 1;
|
||||
@@ -45,8 +45,8 @@ public static bool isDebug = false;
|
||||
//network json文件名
|
||||
public static string network_data_file_name = "network_data.json";
|
||||
//插件设置的数据
|
||||
private static string plugin_setting_data_path = $"{RootPath}/Resources/json/" + PLUGIN_VERSION;
|
||||
private static string plugin_setting_data_file_name = "plugin_setting_data.json";
|
||||
public static string plugin_setting_data_path = $"{RootPath}/Resources/json/" + PLUGIN_VERSION;
|
||||
public static string plugin_setting_data_file_name = "plugin_setting_data.json";
|
||||
|
||||
private static string _rootPath;
|
||||
|
||||
@@ -175,6 +175,7 @@ public static bool isDebug = false;
|
||||
//Android
|
||||
if (!string.IsNullOrEmpty(android_version)) {
|
||||
var networkPath = getAndroidNetworkPath(network);
|
||||
Directory.CreateDirectory(networkPath);
|
||||
ATLog.log("saveInstalledNetworkVersion() >>> android networkPath: " + networkPath + " exist: " + Directory.Exists(networkPath));
|
||||
if (Directory.Exists(networkPath)) {
|
||||
string fullPath = Path.Combine(networkPath, networkDataFileName);
|
||||
@@ -192,7 +193,8 @@ public static bool isDebug = false;
|
||||
var ios_version = installedVersions.Ios;
|
||||
if (!string.IsNullOrEmpty(ios_version)) {
|
||||
var networkPath = getIosNetworkPath(network);
|
||||
ATLog.log("saveInstalledNetworkVersion() >>> ios networkPath: " + networkPath);
|
||||
Directory.CreateDirectory(networkPath);
|
||||
ATLog.log("saveInstalledNetworkVersion() >>> ios networkPath: " + networkPath);
|
||||
if (Directory.Exists(networkPath)) {
|
||||
string fullPath = Path.Combine(networkPath, networkDataFileName);
|
||||
var networkData = new NetworkLocalData();
|
||||
@@ -332,7 +334,12 @@ public static bool isDebug = false;
|
||||
|
||||
public static bool enableAndroidX() {
|
||||
var pluginSettingData = getPluginSettingData();
|
||||
return pluginSettingData.getCountrySettingData().enableAndroidX;
|
||||
return pluginSettingData.getCountrySettingData().androidXSetting == 1;
|
||||
}
|
||||
|
||||
public static bool isDefaultAndroidX() {
|
||||
var pluginSettingData = getPluginSettingData();
|
||||
return pluginSettingData.getCountrySettingData().androidXSetting == 0;
|
||||
}
|
||||
|
||||
//获取默认选中的地区
|
||||
|
||||
@@ -297,7 +297,7 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
network.CurrentVersions = versions;
|
||||
|
||||
// await Task.Delay(1000);
|
||||
Thread.Sleep(1000);
|
||||
// Thread.Sleep(1000);
|
||||
//下面的逻辑会延迟一秒后执行,确保unitypackage先解压到本地
|
||||
ATConfig.saveInstalledNetworkVersion(network, os);
|
||||
ATLog.log("UpdateCurrentVersions() >>> AndroidVersion: " + versions.Android);
|
||||
@@ -339,25 +339,24 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
}
|
||||
|
||||
//获取AndroidX开关状态
|
||||
public bool enableAndroidX(PluginData pluginData) {
|
||||
public int getAndroidXSetting(PluginData pluginData) {
|
||||
if (pluginData == null) {
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
var pluginSettingData = pluginData.pluginSettingData;
|
||||
if (pluginSettingData == null) {
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
CountrySettingData countrySettingData = pluginSettingData.getCountrySettingData();
|
||||
|
||||
return countrySettingData.enableAndroidX;
|
||||
return countrySettingData.androidXSetting;
|
||||
}
|
||||
|
||||
//设置并保存AndroidX开关状态
|
||||
public void saveAndroidXSetting(PluginData pluginData, bool enable) {
|
||||
ATLog.log("saveAndroidXSetting() >>> enable: " + enable);
|
||||
public void saveAndroidXSetting(PluginData pluginData, int androidXSetting) {
|
||||
ATLog.log("saveAndroidXSetting() >>> androidXSetting: " + androidXSetting);
|
||||
var pluginSettingData = pluginData.pluginSettingData;
|
||||
CountrySettingData countrySettingData = pluginSettingData.getCountrySettingData();
|
||||
countrySettingData.enableAndroidX = enable;
|
||||
countrySettingData.androidXSetting = androidXSetting;
|
||||
|
||||
ATConfig.savePluginSettingData(pluginSettingData);
|
||||
}
|
||||
|
||||
@@ -126,6 +126,8 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
warningIcon.LoadImage(warningIconData);
|
||||
|
||||
loadPluginData();
|
||||
//热更新
|
||||
ATIntegrationHotFix.Instance.loadHotFixData();
|
||||
}
|
||||
|
||||
//这个方法在插件启动时会调用,然后脚本重新加载时也会重新调用,所以加载数据放在Awake中
|
||||
@@ -359,27 +361,30 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
|
||||
private void DrawAndroidXUI()
|
||||
{
|
||||
if (!ATConfig.isSelectedChina()) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool isChina = ATConfig.isSelectedChina();
|
||||
// if (!ATConfig.isSelectedChina()) {
|
||||
// return;
|
||||
// }
|
||||
EditorGUILayout.LabelField("AndroidX (Only for Android)", titleLabelStyle);
|
||||
GUILayout.Space(4);
|
||||
using (new EditorGUILayout.HorizontalScope("box"))
|
||||
{
|
||||
GUILayout.Space(5);
|
||||
|
||||
bool enableAndroidX = ATIntegrationManager.Instance.enableAndroidX(pluginData);
|
||||
string[] options = new string[] { "Disable", "Enable" };
|
||||
int androidXSetting = ATIntegrationManager.Instance.getAndroidXSetting(pluginData);
|
||||
string[] options = new string[] { "Default", "Enable", "Disable" };
|
||||
if (!isChina) {
|
||||
options = new string[] { "Default", "Enable" };
|
||||
}
|
||||
// 创建Dropdown组件
|
||||
int lastDropdownIndex = enableAndroidX ? 1 : 0;
|
||||
int lastDropdownIndex = androidXSetting;
|
||||
int curDropdownIndex = EditorGUILayout.Popup("Enable AndroidX:", lastDropdownIndex, options);
|
||||
|
||||
//变化才设置
|
||||
if (curDropdownIndex != lastDropdownIndex)
|
||||
{
|
||||
ATLog.log("DrawAndroidXUI() >>> curDropdownIndex: " + curDropdownIndex + " lastDropdownIndex: " + lastDropdownIndex);
|
||||
ATIntegrationManager.Instance.saveAndroidXSetting(pluginData, curDropdownIndex == 1);
|
||||
ATIntegrationManager.Instance.saveAndroidXSetting(pluginData, curDropdownIndex);
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEditor.PackageManager.Requests;
|
||||
using UnityEditor.PackageManager;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
|
||||
namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
{
|
||||
public class ATIntegrationHotFix {
|
||||
public static ATIntegrationHotFix Instance = new ATIntegrationHotFix();
|
||||
|
||||
private ATIntegrationHotFix()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private static string plugin_hot_fix_data_file_name = "plugin_hot_fix_data.json";
|
||||
|
||||
public void loadHotFixData()
|
||||
{
|
||||
var downloadUrl = ATNetInfo.getHotfixPluginDownloadUrl(ATConfig.PLUGIN_VERSION);
|
||||
ATLog.log("loadHotFixData() >>> downloadUrl: " + downloadUrl);
|
||||
ATEditorCoroutine.startCoroutine(loadHotFixDataWithIEnumerator(downloadUrl));
|
||||
}
|
||||
|
||||
private IEnumerator loadHotFixDataWithIEnumerator(string url) {
|
||||
var hotFixDataRequest = UnityWebRequest.Get(url);
|
||||
var webRequest = hotFixDataRequest.SendWebRequest();
|
||||
while (!webRequest.isDone)
|
||||
{
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
}
|
||||
|
||||
#if UNITY_2020_1_OR_NEWER
|
||||
if (hotFixDataRequest.result != UnityWebRequest.Result.Success)
|
||||
#elif UNITY_2017_2_OR_NEWER
|
||||
if (hotFixDataRequest.isNetworkError || hotFixDataRequest.isHttpError)
|
||||
#else
|
||||
if (hotFixDataRequest.isError)
|
||||
#endif
|
||||
{
|
||||
// Debug.Log("loadPluginData failed.");
|
||||
// callback(null);
|
||||
ATLog.log("load hotfix data failed.");
|
||||
}
|
||||
else
|
||||
{
|
||||
//解析热修复的数据
|
||||
try {
|
||||
string hotFixData = hotFixDataRequest.downloadHandler.text;
|
||||
var hotFixDataObj = JsonUtility.FromJson<HotfixPluginData>(hotFixData);
|
||||
ATLog.log("loadHotFixDataWithIEnumerator() >>> hotFixData: " + hotFixData);
|
||||
//判断status是否需要进行热更新
|
||||
if (hotFixDataObj.status != 1) {
|
||||
ATLog.log("loadHotFixDataWithIEnumerator() >>> 热更新被禁止");
|
||||
} else {
|
||||
var localHotFixDataObj = getHotfixPluginData();
|
||||
if (localHotFixDataObj == null) {
|
||||
//本地未曾下载过热更新
|
||||
ATLog.log("loadHotFixDataWithIEnumerator() >>> 本地未曾下载过热更新");
|
||||
ATEditorCoroutine.startCoroutine(loadHotFixPlugin(hotFixDataObj));
|
||||
} else {
|
||||
var compareVersionResult = ATDataUtil.CompareVersions(localHotFixDataObj.hot_fix_version, hotFixDataObj.hot_fix_version);
|
||||
ATLog.log("loadHotFixDataWithIEnumerator() >>> compareVersionResult: " + compareVersionResult);
|
||||
//本地版本比远端版本低,则需要更新
|
||||
if (compareVersionResult == VersionComparisonResult.Lesser) {
|
||||
ATEditorCoroutine.startCoroutine(loadHotFixPlugin(hotFixDataObj));
|
||||
} else {
|
||||
//不需要热更新
|
||||
saveHotfixData(hotFixData);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(Exception e) {
|
||||
ATLog.logError("parseNetworksJson() >>> failed: " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator loadHotFixPlugin(HotfixPluginData hotFixDataObj) {
|
||||
var path = Path.Combine(Application.temporaryCachePath, hotFixDataObj.file_name);
|
||||
ATLog.log("downloadPluginWithEnumerator() >>> path: " + path);
|
||||
#if UNITY_2017_2_OR_NEWER
|
||||
var downloadHandler = new DownloadHandlerFile(path);
|
||||
#else
|
||||
var downloadHandler = new ATDownloadHandler(path);
|
||||
#endif
|
||||
var downloadUrl = hotFixDataObj.download_url;
|
||||
UnityWebRequest downloadPluginRequest = new UnityWebRequest(downloadUrl)
|
||||
{ method = UnityWebRequest.kHttpVerbGET,
|
||||
downloadHandler = downloadHandler
|
||||
};
|
||||
|
||||
#if UNITY_2017_2_OR_NEWER
|
||||
var operation = downloadPluginRequest.SendWebRequest();
|
||||
#else
|
||||
var operation = downloadPluginRequest.Send();
|
||||
#endif
|
||||
while (!operation.isDone)
|
||||
{
|
||||
yield return new WaitForSeconds(0.1f); // Just wait till downloadPluginRequest is completed. Our coroutine is pretty rudimentary.
|
||||
if (operation.progress != 1 && operation.isDone)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_2020_1_OR_NEWER
|
||||
if (downloadPluginRequest.result != UnityWebRequest.Result.Success)
|
||||
#elif UNITY_2017_2_OR_NEWER
|
||||
if (downloadPluginRequest.isNetworkError || downloadPluginRequest.isHttpError)
|
||||
#else
|
||||
if (downloadPluginRequest.isError)
|
||||
#endif
|
||||
{
|
||||
ATLog.log(downloadPluginRequest.error);
|
||||
}
|
||||
else
|
||||
{
|
||||
AssetDatabase.ImportPackage(path, false);
|
||||
AssetDatabase.Refresh();
|
||||
|
||||
string hotFixData = JsonUtility.ToJson(hotFixDataObj);
|
||||
saveHotfixData(hotFixData);
|
||||
}
|
||||
downloadPluginRequest.Dispose();
|
||||
downloadPluginRequest = null;
|
||||
}
|
||||
|
||||
|
||||
private void saveHotfixData(string hotfixPluginData) {
|
||||
var directoryPath = ATConfig.plugin_setting_data_path;
|
||||
// 确保目标文件夹存在
|
||||
if (!Directory.Exists(directoryPath))
|
||||
{
|
||||
// 如果目录不存在,则创建它
|
||||
Directory.CreateDirectory(directoryPath);
|
||||
}
|
||||
string fullPath = Path.Combine(directoryPath, plugin_hot_fix_data_file_name);
|
||||
ATLog.log("saveHotfixData() >>> fullPath: " + fullPath + " hotfixPluginData: " + hotfixPluginData);
|
||||
File.WriteAllText(fullPath, hotfixPluginData);
|
||||
}
|
||||
|
||||
private HotfixPluginData getHotfixPluginData() {
|
||||
string fullPath = Path.Combine(ATConfig.plugin_setting_data_path, plugin_hot_fix_data_file_name);
|
||||
if (!File.Exists(fullPath)) {
|
||||
return null;
|
||||
}
|
||||
string json = File.ReadAllText(fullPath);
|
||||
if(json == "") {
|
||||
return null;
|
||||
}
|
||||
return JsonUtility.FromJson<HotfixPluginData>(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bad9077d375594a889ee0fbf3bf84b2a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +1,6 @@
|
||||
//菜单栏
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
// using DownloadManager;
|
||||
|
||||
namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
@@ -12,28 +10,29 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
#if AnyThinkSDKEditor
|
||||
/**
|
||||
* The special characters at the end represent a shortcut for this action.
|
||||
*
|
||||
*
|
||||
* % - ctrl on Windows, cmd on macOS
|
||||
* # - shift
|
||||
* & - alt
|
||||
*
|
||||
*
|
||||
* So, (shift + cmd/ctrl + t) will launch the integration manager
|
||||
*/
|
||||
[MenuItem ("AnyThink/SDK Manager %#t")]
|
||||
private static void IntegrationManager ()
|
||||
[MenuItem("AnyThink/SDK Manager %#t")]
|
||||
private static void IntegrationManager()
|
||||
{
|
||||
ATIntegrationManagerWindow.ShowManager ();
|
||||
|
||||
ATIntegrationManagerWindow.ShowManager();
|
||||
}
|
||||
|
||||
[MenuItem ("AnyThink/Documentation")]
|
||||
public static void Documentation ()
|
||||
[MenuItem("AnyThink/Documentation")]
|
||||
public static void Documentation()
|
||||
{
|
||||
// if (ATConfig.isSelectedChina()) {
|
||||
// Application.OpenURL("https://newdocs.toponad.com/docs/lgfbO4");
|
||||
// } else {
|
||||
// Application.OpenURL("https://docs.toponad.com/#/en-us/unity/unity_doc/unity_access_doc_new?id=_3-integration");
|
||||
// }
|
||||
Application.OpenURL ("https://newdocs.toponad.com/docs/lgfbO4");
|
||||
Application.OpenURL("https://newdocs.toponad.com/docs/lgfbO4");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
{
|
||||
return "https://topon-sdk-release.oss-cn-hangzhou.aliyuncs.com/Unity_Release/plugin/" + pluginVersion + "/" + getPluginFileName(pluginVersion);
|
||||
}
|
||||
|
||||
public static string getHotfixPluginDownloadUrl(string pluginVersion)
|
||||
{
|
||||
return "https://topon-sdk-release.oss-cn-hangzhou.aliyuncs.com/Unity_Release/plugin/" + pluginVersion + "/hotfix/hotfix_config.json";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
|
||||
public string ios_version; //当前已安装的iOS sdk的版本号
|
||||
|
||||
public bool enableAndroidX = false; //当前的AndroidX设置
|
||||
public int androidXSetting = 0; //当前的AndroidX设置,0=default; 1=修改为AndroidX;2=修改为非AndroidX
|
||||
|
||||
public int country;
|
||||
|
||||
@@ -180,9 +180,6 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
|
||||
public CountrySettingData(int country) {
|
||||
this.country = country;
|
||||
if (country == ATConfig.NONCHINA_COUNTRY) {
|
||||
this.enableAndroidX = true;
|
||||
}
|
||||
}
|
||||
|
||||
public string getAdmobAppId(int os) {
|
||||
@@ -210,4 +207,14 @@ namespace AnyThink.Scripts.IntegrationManager.Editor
|
||||
public int country;
|
||||
public string path;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class HotfixPluginData
|
||||
{
|
||||
public string plugin_version;
|
||||
public string hot_fix_version;
|
||||
public string download_url;
|
||||
public int status;
|
||||
public string file_name;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cdbad4cb68f85450db4d76d94f7e32a8
|
||||
guid: 5552c54c11d94016bcfe740f27df44a6
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.177
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.177/Google.IOSResolver.dll
|
||||
- gvhp_targets-editor
|
||||
timeCreated: 1480838400
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
@@ -28,6 +31,6 @@ PluginImporter:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6825d727c7fc54515a67f5c88a893763
|
||||
guid: 1f4f113972f04c3695341dfb3ba48d3b
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.177
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.177/Google.JarResolver.dll
|
||||
- gvhp_targets-editor
|
||||
timeCreated: 1480838400
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
@@ -28,6 +31,6 @@ PluginImporter:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eaa3f3ba5fb074092a8dc2523a55ee6e
|
||||
guid: 413ed4abd14645c38ebbd8c5ff26e9de
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.177
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.177/Google.PackageManagerResolver.dll
|
||||
- gvhp_targets-editor
|
||||
timeCreated: 1480838400
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
@@ -28,6 +31,6 @@ PluginImporter:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6cb6437754caa42a7b6e62ef2c63d2e1
|
||||
guid: 38d0b40a7b2d44c6a6a2362599bfc41e
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.177
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.177/Google.VersionHandlerImpl.dll
|
||||
- gvhp_targets-editor
|
||||
timeCreated: 1480838400
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
@@ -28,6 +31,6 @@ PluginImporter:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c409ab99e4f4317b2bec2f54be2a2fc
|
||||
guid: 86460262ea60447dbb6a62d21167790f
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.177
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/Google.VersionHandler.dll
|
||||
- gvhp_targets-editor
|
||||
timeCreated: 1480838400
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
@@ -28,6 +31,6 @@ PluginImporter:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36bce0d90658a447380074e3b9958ed0
|
||||
guid: 2764c5ea3b354f3cb7ca80028fd08da2
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_manifest
|
||||
- gvh_version-1.2.177
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.177_manifest.txt
|
||||
- gvhp_manifestname-0External Dependency Manager
|
||||
- gvhp_manifestname-play-services-resolver
|
||||
timeCreated: 1474401009
|
||||
licenseType: Pro
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
Reference in New Issue
Block a user