com.amanotes.gdk 0.2.65-1 → 0.2.65-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Editor/Extra/GDKLocalBuild.cs +24 -57
- package/Editor/Extra/SDKVersionTracking.AirTable.cs +73 -0
- package/Editor/Extra/SDKVersionTracking.AirTable.cs.meta +3 -0
- package/Editor/Extra/SDKVersionTracking.cs +232 -0
- package/Editor/Extra/SDKVersionTracking.cs.meta +11 -0
- package/Extra/AmaGDKInstaller.unitypackage +0 -0
- package/Extra/CheckDiskSpace.unitypackage +0 -0
- package/Extra/ForceUpdate.unitypackage +0 -0
- package/Extra/GoogleCMP.unitypackage +0 -0
- package/Extra/PostProcessor.unitypackage +0 -0
- package/Extra/SDKVersionTracking.unitypackage +0 -0
- package/Packages/AmaGDKConfig.unitypackage +0 -0
- package/Packages/AmaGDKExample.unitypackage +0 -0
- package/Packages/AmaGDKTest.unitypackage +0 -0
- package/Packages/AppsFlyerAdapter.PurchaseConnector.unitypackage +0 -0
- package/Packages/AppsFlyerAdapter.unitypackage +0 -0
- package/Packages/FirebaseAnalyticsAdapter.unitypackage +0 -0
- package/Packages/FirebaseRemoteConfigAdapter.unitypackage +0 -0
- package/Packages/IronSourceAdapter.unitypackage +0 -0
- package/Packages/RevenueCatAdapter.unitypackage +0 -0
- package/Packages/SqliteAnalyticsAdapter.unitypackage +0 -0
- package/Runtime/AmaGDK.Analytics.cs +11 -4
- package/Runtime/AmaGDK.Mono.cs +0 -2
- package/Runtime/AmaGDK.RemoteConfig.cs +3 -4
- package/Runtime/AmaGDK.UserProfile.cs +1 -1
- package/Runtime/AmaGDK.cs +6 -1
- package/Runtime/AudioToolkit/AmaGDK.Audio.Latency.cs +165 -0
- package/Runtime/AudioToolkit/AmaGDK.Audio.Latency.cs.meta +11 -0
- package/Runtime/AudioToolkit/AmaGDK.Audio.cs +158 -0
- package/Runtime/AudioToolkit/AmaGDK.Audio.cs.meta +11 -0
- package/Runtime/AudioToolkit/Plugins/Android/AudioDeviceDetector.java +321 -0
- package/Runtime/AudioToolkit/Plugins/Android/AudioDeviceDetector.java.meta +32 -0
- package/Runtime/AudioToolkit/Plugins/Android.meta +8 -0
- package/Runtime/AudioToolkit/Plugins/AudioDeviceDetector.cs +204 -0
- package/Runtime/AudioToolkit/Plugins/AudioDeviceDetector.cs.meta +3 -0
- package/Runtime/AudioToolkit/Plugins/iOS/AudioDeviceDetector.mm +163 -0
- package/Runtime/AudioToolkit/Plugins/iOS/AudioDeviceDetector.mm.meta +33 -0
- package/Runtime/AudioToolkit/Plugins/iOS.meta +8 -0
- package/Runtime/AudioToolkit/Plugins.meta +8 -0
- package/Runtime/AudioToolkit/Resources/device-latency.txt +256 -0
- package/Runtime/AudioToolkit/Resources/device-latency.txt.meta +7 -0
- package/Runtime/AudioToolkit/Resources.meta +8 -0
- package/Runtime/AudioToolkit.meta +3 -0
- package/Runtime/Internal/AmaGDK.Internal.cs +1 -1
- package/Runtime/Internal/AmaGDK.Utils.cs +61 -21
- package/Runtime/Internal/ForceQuitMonitor.cs +111 -0
- package/Runtime/Internal/ForceQuitMonitor.cs.meta +3 -0
- package/package.json +1 -1
|
@@ -148,34 +148,7 @@ namespace Amanotes.Editor
|
|
|
148
148
|
{
|
|
149
149
|
var buildDir = new DirectoryInfo(buildFolder);
|
|
150
150
|
if (!buildDir.Exists) Directory.CreateDirectory(buildDir.FullName);
|
|
151
|
-
|
|
152
|
-
// Check for existed build with the same name
|
|
153
|
-
if (info.overwrite == false)
|
|
154
|
-
{
|
|
155
|
-
if (info.target == BuildTarget.Android)
|
|
156
|
-
{
|
|
157
|
-
string[] apkNames = info.GetAPKNames(buildFolder);
|
|
158
|
-
for (var i = 0; i < apkNames.Length; i++)
|
|
159
|
-
{
|
|
160
|
-
string item = apkNames[i];
|
|
161
|
-
if (!File.Exists(item)) continue;
|
|
162
|
-
Debug.LogWarning("Exporting file existed! " + item);
|
|
163
|
-
|
|
164
|
-
// return;
|
|
165
|
-
}
|
|
166
|
-
} else
|
|
167
|
-
{
|
|
168
|
-
string fullBuildPath = info.fullBuildPath(buildFolder);
|
|
169
|
-
if (Directory.Exists(fullBuildPath))
|
|
170
|
-
{
|
|
171
|
-
Debug.LogWarning("Exporting target existed! " + fullBuildPath);
|
|
172
|
-
EditorUtility.RevealInFinder(fullBuildPath);
|
|
173
|
-
|
|
174
|
-
// return;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
151
|
+
|
|
179
152
|
RemoveUnusedAssets();
|
|
180
153
|
if (info.target == BuildTarget.Android) keystore.Write();
|
|
181
154
|
|
|
@@ -322,9 +295,9 @@ namespace Amanotes.Editor
|
|
|
322
295
|
public Texture2D buildIcon;
|
|
323
296
|
public BuildTarget target;
|
|
324
297
|
|
|
325
|
-
public bool isAAB;
|
|
326
|
-
public bool splitAPK = true;
|
|
327
|
-
public bool overwrite = true;
|
|
298
|
+
// public bool isAAB;
|
|
299
|
+
// public bool splitAPK = true;
|
|
300
|
+
// public bool overwrite = true;
|
|
328
301
|
public string buildVersion;
|
|
329
302
|
public int buildNumber;
|
|
330
303
|
|
|
@@ -348,10 +321,10 @@ namespace Amanotes.Editor
|
|
|
348
321
|
if (isAndroid)
|
|
349
322
|
{
|
|
350
323
|
PlayerSettings.Android.bundleVersionCode = buildNumber;
|
|
351
|
-
PlayerSettings.Android.buildApkPerCpuArchitecture = splitAPK;
|
|
324
|
+
PlayerSettings.Android.buildApkPerCpuArchitecture = false;//splitAPK;
|
|
352
325
|
PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARM64 | AndroidArchitecture.ARMv7;
|
|
353
|
-
|
|
354
|
-
EditorUserBuildSettings.buildAppBundle = isAAB;
|
|
326
|
+
|
|
327
|
+
EditorUserBuildSettings.buildAppBundle = false;//isAAB;
|
|
355
328
|
EditorUserBuildSettings.exportAsGoogleAndroidProject = false;
|
|
356
329
|
|
|
357
330
|
#if UNITY_2021_1_OR_NEWER
|
|
@@ -368,7 +341,7 @@ namespace Amanotes.Editor
|
|
|
368
341
|
string tempName = apkName.Replace(buildName, Application.productName);
|
|
369
342
|
|
|
370
343
|
if (File.Exists(tempName)) File.Delete(tempName); // always delete temp file no matter what
|
|
371
|
-
if (
|
|
344
|
+
if (File.Exists(apkName)) File.Delete(apkName);
|
|
372
345
|
}
|
|
373
346
|
|
|
374
347
|
return;
|
|
@@ -377,8 +350,6 @@ namespace Amanotes.Editor
|
|
|
377
350
|
if (isIOS)
|
|
378
351
|
{
|
|
379
352
|
PlayerSettings.iOS.buildNumber = buildNumber.ToString();
|
|
380
|
-
if (!overwrite) return;
|
|
381
|
-
|
|
382
353
|
string path = fullBuildPath(buildFolder);
|
|
383
354
|
if (Directory.Exists(path)) Directory.Delete(path, true);
|
|
384
355
|
return;
|
|
@@ -392,17 +363,17 @@ namespace Amanotes.Editor
|
|
|
392
363
|
var buildDir = new DirectoryInfo(buildFolder);
|
|
393
364
|
string fullName = buildDir.FullName;
|
|
394
365
|
|
|
395
|
-
if (isAAB)
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
if (splitAPK)
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
366
|
+
// if (isAAB)
|
|
367
|
+
// return new[]
|
|
368
|
+
// {
|
|
369
|
+
// Path.Combine(fullName, buildName + ".aab")
|
|
370
|
+
// };
|
|
371
|
+
//
|
|
372
|
+
// if (splitAPK)
|
|
373
|
+
// return new[]
|
|
374
|
+
// {
|
|
375
|
+
// Path.Combine(fullName, buildName + ".arm64-v8a.apk"), Path.Combine(fullName, buildName + ".armeabi-v7a.apk")
|
|
376
|
+
// };
|
|
406
377
|
|
|
407
378
|
return new[]
|
|
408
379
|
{
|
|
@@ -413,7 +384,7 @@ namespace Amanotes.Editor
|
|
|
413
384
|
public void PostProcessBuild(string buildFolder)
|
|
414
385
|
{
|
|
415
386
|
if (target != BuildTarget.Android) return;
|
|
416
|
-
if (isAAB) return;
|
|
387
|
+
// if (isAAB) return;
|
|
417
388
|
|
|
418
389
|
// var productName = Application.productName;
|
|
419
390
|
string[] listAPKNames = GetAPKNames(buildFolder);
|
|
@@ -439,8 +410,8 @@ namespace Amanotes.Editor
|
|
|
439
410
|
|
|
440
411
|
if (isAndroid)
|
|
441
412
|
{
|
|
442
|
-
if (isAAB) return Path.Combine(buildDir.FullName, buildName + ".aab");
|
|
443
|
-
if (splitAPK) return buildDir.FullName;
|
|
413
|
+
// if (isAAB) return Path.Combine(buildDir.FullName, buildName + ".aab");
|
|
414
|
+
// if (splitAPK) return buildDir.FullName;
|
|
444
415
|
return Path.Combine(buildDir.FullName, buildName + ".apk");
|
|
445
416
|
}
|
|
446
417
|
|
|
@@ -737,15 +708,11 @@ namespace Amanotes.Editor
|
|
|
737
708
|
{
|
|
738
709
|
new GDKLocalBuild.BuildInfo
|
|
739
710
|
{
|
|
740
|
-
target = BuildTarget.Android
|
|
741
|
-
}.Read(),
|
|
742
|
-
new GDKLocalBuild.BuildInfo
|
|
743
|
-
{
|
|
744
|
-
target = BuildTarget.Android, isAAB = true, splitAPK = true
|
|
711
|
+
target = BuildTarget.Android
|
|
745
712
|
}.Read(),
|
|
746
713
|
new GDKLocalBuild.BuildInfo
|
|
747
714
|
{
|
|
748
|
-
target = BuildTarget.iOS
|
|
715
|
+
target = BuildTarget.iOS
|
|
749
716
|
}.Read()
|
|
750
717
|
};
|
|
751
718
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
using System.Net.Http;
|
|
3
|
+
using System.Text;
|
|
4
|
+
using System.Threading.Tasks;
|
|
5
|
+
using Amanotes.Core.Internal;
|
|
6
|
+
using UnityEditor;
|
|
7
|
+
using UnityEditor.Callbacks;
|
|
8
|
+
using UnityEngine;
|
|
9
|
+
|
|
10
|
+
namespace Amanotes.Editor
|
|
11
|
+
{
|
|
12
|
+
public partial class SDKVersionTracking
|
|
13
|
+
{
|
|
14
|
+
private const string AUTH_TOKEN = "pat1CmLr9XozLt6ZE";
|
|
15
|
+
private const string URL = "https://gdk.amanotes.io/gdkVersionTracking";
|
|
16
|
+
|
|
17
|
+
[PostProcessBuild(999)]
|
|
18
|
+
public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
|
|
19
|
+
{
|
|
20
|
+
var rawData = AllVersions;
|
|
21
|
+
rawData["UnityVersion"] = Application.unityVersion;
|
|
22
|
+
#if UNITY_ANDROID
|
|
23
|
+
rawData["Platform"] = "Android";
|
|
24
|
+
rawData["Permissions"] = GetAllAndroidPermissions();
|
|
25
|
+
rawData["APILevel"] = (int)PlayerSettings.Android.targetSdkVersion;
|
|
26
|
+
#elif UNITY_IOS
|
|
27
|
+
rawData["SKAdNetwork"] = GetSkAdNetworkCount($"{pathToBuiltProject}/Info.plist");
|
|
28
|
+
rawData["Platform"] = "iOS";
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
var buildInfo = new Dictionary<string, object>
|
|
32
|
+
{
|
|
33
|
+
{"GameName", Application.productName},
|
|
34
|
+
{"BuildVersion", PlayerSettings.bundleVersion},
|
|
35
|
+
{"BuildNumber", GetBuildNumber()},
|
|
36
|
+
{"BuildTime", GetBuildTime()},
|
|
37
|
+
{"AppId", PlayerSettings.applicationIdentifier },
|
|
38
|
+
{"RawData", rawData }
|
|
39
|
+
};
|
|
40
|
+
string json = JsonUtils.DictionaryToJson(buildInfo, false, false);
|
|
41
|
+
SendDataToAirTable(json);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private static async Task SendDataToAirTable(string payload)
|
|
45
|
+
{
|
|
46
|
+
Debug.Log("AmaGDK | [SDKVersionTracking]: SendDataToAirTable ");
|
|
47
|
+
try
|
|
48
|
+
{
|
|
49
|
+
var client = new HttpClient();
|
|
50
|
+
var request = new HttpRequestMessage(HttpMethod.Post, URL);
|
|
51
|
+
request.Headers.Add("Authorization", AUTH_TOKEN);
|
|
52
|
+
request.Content = new StringContent(payload, Encoding.UTF8, "application/json");
|
|
53
|
+
|
|
54
|
+
var response = await client.SendAsync(request);
|
|
55
|
+
if (response.IsSuccessStatusCode)
|
|
56
|
+
{
|
|
57
|
+
string responseData = await response.Content.ReadAsStringAsync();
|
|
58
|
+
Debug.Log("AmaGDK | [SDKVersionTracking]: done " + responseData);
|
|
59
|
+
}
|
|
60
|
+
else
|
|
61
|
+
{
|
|
62
|
+
Debug.LogError("AmaGDK | [SDKVersionTracking] Error: " + response.StatusCode);
|
|
63
|
+
string errorData = await response.Content.ReadAsStringAsync();
|
|
64
|
+
Debug.LogError("AmaGDK | [SDKVersionTracking] Error Response: " + errorData);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (HttpRequestException e)
|
|
68
|
+
{
|
|
69
|
+
Debug.LogError("AmaGDK | [SDKVersionTracking] Request Exception: " + e.Message);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.IO;
|
|
4
|
+
using System.Linq;
|
|
5
|
+
using System.Text;
|
|
6
|
+
using System.Xml;
|
|
7
|
+
using UnityEditor;
|
|
8
|
+
using UnityEditor.Build;
|
|
9
|
+
using UnityEditor.Build.Reporting;
|
|
10
|
+
using UnityEngine;
|
|
11
|
+
|
|
12
|
+
#if UNITY_IOS
|
|
13
|
+
using UnityEditor.iOS.Xcode;
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
namespace Amanotes.Editor
|
|
17
|
+
{
|
|
18
|
+
public partial class SDKVersionTracking
|
|
19
|
+
{
|
|
20
|
+
private static Func<Dictionary<string, object>> _getExtraSDKVersion;
|
|
21
|
+
public static void SetSDKVersionHook(Func<Dictionary<string, object>> hook)
|
|
22
|
+
{
|
|
23
|
+
_getExtraSDKVersion = hook;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
public partial class SDKVersionTracking : IPreprocessBuildWithReport
|
|
28
|
+
{
|
|
29
|
+
public static Dictionary<string, object> AllVersions
|
|
30
|
+
{
|
|
31
|
+
get
|
|
32
|
+
{
|
|
33
|
+
return _dicThirdPartyVersion
|
|
34
|
+
.Concat(_dicExtraVersion)
|
|
35
|
+
.Concat(_dicIronSourceAdapterVersion)
|
|
36
|
+
.ToDictionary(x => x.Key, x => x.Value);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
private const int MAX_VERSION_KEY_LENGTH = 30;
|
|
41
|
+
private static Dictionary<string, object> _dicThirdPartyVersion = new Dictionary<string, object>();
|
|
42
|
+
private static Dictionary<string, object> _dicExtraVersion = new Dictionary<string, object>();
|
|
43
|
+
private static Dictionary<string, object> _dicIronSourceAdapterVersion = new Dictionary<string, object>();
|
|
44
|
+
|
|
45
|
+
private static string GetBuildNumber()
|
|
46
|
+
{
|
|
47
|
+
#if UNITY_ANDROID
|
|
48
|
+
return PlayerSettings.Android.bundleVersionCode.ToString();
|
|
49
|
+
#elif UNITY_IOS
|
|
50
|
+
return PlayerSettings.iOS.buildNumber;
|
|
51
|
+
#else
|
|
52
|
+
return string.Empty;
|
|
53
|
+
#endif
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private static string GetBuildTime()
|
|
57
|
+
{
|
|
58
|
+
return DateTime.Now.ToString("dd/MM/yyyy HH:mm");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public static int GetSkAdNetworkCount(string infoPlistPath)
|
|
62
|
+
{
|
|
63
|
+
int count = 0;
|
|
64
|
+
#if UNITY_IOS
|
|
65
|
+
if (!File.Exists(infoPlistPath))
|
|
66
|
+
{
|
|
67
|
+
Debug.LogWarning($"AmaGDK | [SDKVersionTracking] InfoPlist file is not exist!\n{infoPlistPath}\n");
|
|
68
|
+
return count;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
PlistDocument plist = new PlistDocument();
|
|
72
|
+
plist.ReadFromString(File.ReadAllText(infoPlistPath));
|
|
73
|
+
PlistElementDict rootDict = plist.root;
|
|
74
|
+
if (!rootDict.values.ContainsKey("SKAdNetworkItems"))
|
|
75
|
+
return count;
|
|
76
|
+
|
|
77
|
+
count = rootDict.values["SKAdNetworkItems"].AsArray().values.Count;
|
|
78
|
+
return count;
|
|
79
|
+
#else
|
|
80
|
+
return count;
|
|
81
|
+
#endif
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public static List<string> GetAllAndroidPermissions()
|
|
85
|
+
{
|
|
86
|
+
#if UNITY_ANDROID
|
|
87
|
+
StringBuilder permissions = new StringBuilder();
|
|
88
|
+
string projectPath = Application.dataPath.Substring(0, Application.dataPath.Length - "Assets".Length);
|
|
89
|
+
|
|
90
|
+
List<string> manifestPaths = new List<string>();
|
|
91
|
+
GetAllManifestPaths(projectPath, manifestPaths);
|
|
92
|
+
|
|
93
|
+
HashSet<string> uniquePermissions = new HashSet<string>();
|
|
94
|
+
|
|
95
|
+
HashSet<string> removePermission = new HashSet<string>();
|
|
96
|
+
|
|
97
|
+
foreach (var path in manifestPaths)
|
|
98
|
+
{
|
|
99
|
+
XmlDocument xmlDoc = GetXML(path);
|
|
100
|
+
var permissionNodes = xmlDoc.SelectNodes("manifest/uses-permission");
|
|
101
|
+
|
|
102
|
+
if (permissionNodes == null)
|
|
103
|
+
continue;
|
|
104
|
+
|
|
105
|
+
foreach (XmlNode node in permissionNodes)
|
|
106
|
+
{
|
|
107
|
+
if (node.Attributes == null)
|
|
108
|
+
continue;
|
|
109
|
+
if(node.Attributes["android:name"] == null)
|
|
110
|
+
continue;
|
|
111
|
+
|
|
112
|
+
string permissionName = node.Attributes["android:name"].Value;
|
|
113
|
+
|
|
114
|
+
XmlAttribute attribute = node.Attributes["tools:node"];
|
|
115
|
+
|
|
116
|
+
if (attribute != null && attribute.Value.Trim().Equals("remove")) removePermission.Add(permissionName);
|
|
117
|
+
|
|
118
|
+
uniquePermissions.Add(permissionName);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
uniquePermissions.ExceptWith(removePermission);
|
|
123
|
+
|
|
124
|
+
List<string> permissionList = uniquePermissions.ToList();
|
|
125
|
+
permissionList.Sort();
|
|
126
|
+
return permissionList;
|
|
127
|
+
#else
|
|
128
|
+
return new List<string>();
|
|
129
|
+
#endif
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
private static void GetAllManifestPaths(string directory, List<string> manifestPaths)
|
|
133
|
+
{
|
|
134
|
+
string[] manifestFiles = Directory.GetFiles(directory, "AndroidManifest.xml", SearchOption.AllDirectories);
|
|
135
|
+
manifestPaths.AddRange(manifestFiles);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
private static XmlDocument GetXML(string path)
|
|
139
|
+
{
|
|
140
|
+
XmlDocument xmlDoc = new XmlDocument();
|
|
141
|
+
try
|
|
142
|
+
{
|
|
143
|
+
if (File.Exists(path))
|
|
144
|
+
{
|
|
145
|
+
xmlDoc.LoadXml(File.ReadAllText(path));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch (Exception exception)
|
|
149
|
+
{
|
|
150
|
+
Debug.LogError("Can't parse xml: " + path + "\n" + exception.Message);
|
|
151
|
+
}
|
|
152
|
+
return xmlDoc;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
private static void AppendVersion(StringBuilder sb, string sectionName, Dictionary<string,object> dict)
|
|
156
|
+
{
|
|
157
|
+
if (dict == null || dict.Count == 0) return;
|
|
158
|
+
AppendVersion(sb, sectionName, dict
|
|
159
|
+
.Where(kvp=>kvp.Value != null)
|
|
160
|
+
.Select(kvp=> (kvp.Key, kvp.Value))
|
|
161
|
+
.OrderBy(kvp=>kvp.Key)
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
private static void AppendVersion(StringBuilder sb, string sectionName, IEnumerable<(string, object)> list)
|
|
166
|
+
{
|
|
167
|
+
if (list == null) return;
|
|
168
|
+
sb.Append($"\n// {sectionName}\n");
|
|
169
|
+
sb.Append("//----------------------------------------------------\n");
|
|
170
|
+
|
|
171
|
+
foreach ((string key, object value) in list)
|
|
172
|
+
{
|
|
173
|
+
sb.Append($"{key, -MAX_VERSION_KEY_LENGTH}\t=\t{value.ToString().Replace("'", "")}\n");
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
public static List<(string, object)> GetBuildInfo()
|
|
178
|
+
{
|
|
179
|
+
return new List<(string, object)>()
|
|
180
|
+
{
|
|
181
|
+
("Version", Application.version),
|
|
182
|
+
("BuildNumber", GetBuildNumber()),
|
|
183
|
+
("BuildTime", GetBuildTime()),
|
|
184
|
+
("UnityVersion", Application.unityVersion)
|
|
185
|
+
#if UNITY_ANDROID
|
|
186
|
+
,("API Level", (int)PlayerSettings.Android.targetSdkVersion)
|
|
187
|
+
#endif
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
private static void WriteToStreamingAssets()
|
|
192
|
+
{
|
|
193
|
+
try
|
|
194
|
+
{
|
|
195
|
+
StringBuilder sb = new StringBuilder();
|
|
196
|
+
sb.Append("// Automatically generated by AmaGDK after every build\n");
|
|
197
|
+
|
|
198
|
+
AppendVersion(sb, "BUILD INFO", GetBuildInfo());
|
|
199
|
+
AppendVersion(sb, "THIRD PARTY", _dicThirdPartyVersion);
|
|
200
|
+
AppendVersion(sb, "IS ADAPTER", _dicIronSourceAdapterVersion);
|
|
201
|
+
AppendVersion(sb, "EXTRA", _dicExtraVersion);
|
|
202
|
+
|
|
203
|
+
string folderPath = Application.streamingAssetsPath;
|
|
204
|
+
string filePath = Path.Combine(folderPath, "SDKVersion.txt");
|
|
205
|
+
|
|
206
|
+
if (!Directory.Exists(folderPath))
|
|
207
|
+
{
|
|
208
|
+
Directory.CreateDirectory(folderPath);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
File.WriteAllText(filePath, sb.ToString());
|
|
212
|
+
Debug.Log("AmaGDK | [SDKVersionTracking] The third-party version logs have been written to: " + filePath);
|
|
213
|
+
AssetDatabase.Refresh();
|
|
214
|
+
}
|
|
215
|
+
catch (Exception e)
|
|
216
|
+
{
|
|
217
|
+
Debug.LogError("AmaGDK | [SDKVersionTracking] Exception encountered while logging local third-party versions: " + e);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
public int callbackOrder { get; }
|
|
222
|
+
public void OnPreprocessBuild(BuildReport report)
|
|
223
|
+
{
|
|
224
|
+
_dicThirdPartyVersion = AmaGDKExtra.GetThirdPartyVersions();
|
|
225
|
+
_dicIronSourceAdapterVersion = AmaGDKExtra.GetIronSourceAdapterVersions();
|
|
226
|
+
_dicExtraVersion = _getExtraSDKVersion?.Invoke() ?? _dicExtraVersion;
|
|
227
|
+
|
|
228
|
+
WriteToStreamingAssets();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
}
|
|
232
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -439,6 +439,7 @@ namespace Amanotes.Core
|
|
|
439
439
|
m.LogEvent(eventNameToSend, eventParams.parameters);
|
|
440
440
|
inUseAdapterIDs?.Add(m.adapterId);
|
|
441
441
|
}
|
|
442
|
+
ForceQuit.OnLogEvent(eventNameToSend, eventParams.parameters);
|
|
442
443
|
|
|
443
444
|
return (eventNameToSend, inUseAdapterIDs);
|
|
444
445
|
}
|
|
@@ -1099,8 +1100,14 @@ namespace Amanotes.Core.Internal
|
|
|
1099
1100
|
[HideInNormalInspector] public bool checkMigrationIntegrity = true;
|
|
1100
1101
|
[HideInNormalInspector] public bool migrateAccumulatedCount = true;
|
|
1101
1102
|
[HideInNormalInspector] public bool enableEventStat;
|
|
1102
|
-
[
|
|
1103
|
-
|
|
1103
|
+
[HideInInspector] public List<string> immediatelyLoggedEvents = new List<string>()
|
|
1104
|
+
{
|
|
1105
|
+
"ad_impression",
|
|
1106
|
+
"ad_impression_ama",
|
|
1107
|
+
"fullads_impression",
|
|
1108
|
+
"videoads_impression",
|
|
1109
|
+
};
|
|
1110
|
+
public AnalyticQualityConfig quality = new AnalyticQualityConfig();
|
|
1104
1111
|
}
|
|
1105
1112
|
|
|
1106
1113
|
[Serializable]
|
|
@@ -1125,8 +1132,8 @@ namespace Amanotes.Core.Internal
|
|
|
1125
1132
|
|
|
1126
1133
|
public abstract class AnalyticsAdapter : Adapter2
|
|
1127
1134
|
{
|
|
1128
|
-
[
|
|
1129
|
-
[
|
|
1135
|
+
[HideInInspector] public List<string> NeverSend = new List<string>();
|
|
1136
|
+
[HideInInspector] public List<string> AlwaysSend = new List<string>();
|
|
1130
1137
|
protected abstract bool SendEventByDefault { get; }
|
|
1131
1138
|
|
|
1132
1139
|
public bool IsForbidden(string eventName)
|
package/Runtime/AmaGDK.Mono.cs
CHANGED
|
@@ -39,9 +39,8 @@ namespace Amanotes.Core
|
|
|
39
39
|
{
|
|
40
40
|
get
|
|
41
41
|
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return _cacheExisted.GetValueOrDefault();
|
|
42
|
+
_cacheExisted ??= GDKFileUtils.Exist(fileName);
|
|
43
|
+
return _cacheExisted.Value;
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
|
|
@@ -195,7 +194,7 @@ namespace Amanotes.Core
|
|
|
195
194
|
}
|
|
196
195
|
|
|
197
196
|
_fetchState = FetchState.Fetch;
|
|
198
|
-
adapter.FetchConfig(HasCache, (isSuccess, result) =>
|
|
197
|
+
adapter.FetchConfig(!HasCache, (isSuccess, result) =>
|
|
199
198
|
{
|
|
200
199
|
if (!isSuccess)
|
|
201
200
|
{
|
package/Runtime/AmaGDK.cs
CHANGED
|
@@ -17,14 +17,16 @@ namespace Amanotes.Core
|
|
|
17
17
|
{
|
|
18
18
|
public partial class AmaGDK : MonoBehaviour
|
|
19
19
|
{
|
|
20
|
-
public const string VERSION = "0.2.
|
|
20
|
+
public const string VERSION = "0.2.65-3";
|
|
21
21
|
|
|
22
22
|
internal static Status _status = Status.None;
|
|
23
23
|
private static ConfigAsset _config = null;
|
|
24
24
|
internal static readonly GDKGeoLocation GeoLocation = new GDKGeoLocation();
|
|
25
25
|
internal static readonly GDKServerTime ServerTime = new GDKServerTime();
|
|
26
|
+
private static readonly ForceQuitMonitor ForceQuit = new ForceQuitMonitor();
|
|
26
27
|
|
|
27
28
|
internal static bool _allowInit = false;
|
|
29
|
+
|
|
28
30
|
public bool autoInit = true;
|
|
29
31
|
|
|
30
32
|
internal static partial class Event
|
|
@@ -100,6 +102,7 @@ namespace Amanotes.Core
|
|
|
100
102
|
Ads.InitModule();
|
|
101
103
|
IAP.InitModule();
|
|
102
104
|
RemoteConfig.InitModule();
|
|
105
|
+
Audio.InitModule();
|
|
103
106
|
}
|
|
104
107
|
Profiler.EndSample();
|
|
105
108
|
}
|
|
@@ -186,6 +189,8 @@ namespace Amanotes.Core
|
|
|
186
189
|
ServerTime.UpdateTime();
|
|
187
190
|
}
|
|
188
191
|
|
|
192
|
+
ForceQuit.Init();
|
|
193
|
+
|
|
189
194
|
_status = Status.Ready;
|
|
190
195
|
dispatcher.Dispatch(Event.GDK_READY);
|
|
191
196
|
|