com.amanotes.gdk 0.2.81-a3 → 0.2.81-alpha.5
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/CHANGELOG.md +0 -9
- package/Editor/Extra/GDKCIBuildCommand.cs +57 -55
- package/Editor/Extra/GDKPostBuildAsset.cs +64 -30
- package/Extra/AmaGDKInstaller.unitypackage +0 -0
- package/Extra/AutoEventQC.unitypackage +0 -0
- package/Extra/CheckDiskSpace.unitypackage +0 -0
- package/Extra/Consent.unitypackage +0 -0
- package/Extra/CrashlyticHook.unitypackage +0 -0
- package/Extra/ForceUpdate.unitypackage +0 -0
- package/Extra/LegacyGDKUpdateHelper.unitypackage +0 -0
- package/Extra/PostProcessor.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.AdQuality.unitypackage +0 -0
- package/Packages/IronSourceAdapter.unitypackage +0 -0
- package/Packages/MaxAdNetworkAdapter.unitypackage +0 -0
- package/Packages/RevenueCatAdapter.unitypackage +0 -0
- package/Packages/SqliteAnalyticsAdapter.unitypackage +0 -0
- package/Runtime/Ad/AmaGDK.Ads.cs +1 -1
- package/Runtime/AmaGDK.Analytics.cs +3 -9
- package/Runtime/AmaGDK.Consent.cs +2 -2
- package/Runtime/AmaGDK.IAP.cs +1 -1
- package/Runtime/AmaGDK.UserProfile.cs +2 -2
- package/Runtime/AmaGDK.cs +1 -1
- package/Runtime/Core/GDKDebug.cs +13 -4
- package/Runtime/Internal/AmaGDK.Utils.cs +1 -1
- package/Runtime/Internal/ForceQuitMonitor.cs +1 -1
- package/Runtime/Utils/GDKFileUtils.cs +1 -1
- package/package.json +4 -4
- package/Runtime/GDKAudio/Plugins.meta +0 -8
- package/Runtime/GDKAudio.meta +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.2.81-a3] - 2024-11-21
|
|
4
|
-
- [Dev] Add GDKPostBuild for iOS
|
|
5
|
-
- [Dev] Improve GDK editor experience before config asset imported
|
|
6
|
-
- [Dev] Analytics save file in async
|
|
7
|
-
- [Dev] Move GDKFileUtils to a separated file
|
|
8
|
-
- [Dev] Update game ops model
|
|
9
|
-
- [Dev] Add ABLab
|
|
10
|
-
- [Dev] Move imported GDK Adapter from RawData to Modules
|
|
11
|
-
|
|
12
3
|
## [0.2.80] - 2024-11-13
|
|
13
4
|
- [Dev] Don't use obsolete functions
|
|
14
5
|
- [Dev] Add CrashlyticHook
|
|
@@ -17,22 +17,27 @@ namespace Amanotes.Core
|
|
|
17
17
|
private const string KEY_ALIAS_NAME = "KEY_ALIAS_NAME";
|
|
18
18
|
private const string KEYSTORE = "keystore.keystore";
|
|
19
19
|
private const string BUILD_OPTIONS_ENV_VAR = "BuildOptions";
|
|
20
|
-
private const string ANDROID_BUNDLE_VERSION_CODE = "VERSION_BUILD_VAR";
|
|
21
20
|
private const string ANDROID_APP_BUNDLE = "BUILD_APP_BUNDLE";
|
|
22
21
|
private const string SCRIPTING_BACKEND_ENV_VAR = "SCRIPTING_BACKEND";
|
|
23
22
|
private const string EXPORT_ANDROID_PROJECT = "EXPORT_ANDROID_PROJECT";
|
|
24
23
|
private const string VERSION_NUMBER_VAR = "VERSION_NUMBER_VAR";
|
|
25
|
-
private const string
|
|
24
|
+
private const string VERSION_BUILD_VAR = "VERSION_BUILD_VAR";
|
|
26
25
|
|
|
27
26
|
public static void InstallPod(EventHandler processExit, string buildPath = null)
|
|
28
27
|
{
|
|
29
28
|
try
|
|
30
29
|
{
|
|
31
|
-
|
|
30
|
+
string arguments = "";
|
|
32
31
|
if (Application.isBatchMode && TryGetEnv("CI_SCRIPT_DIR", out string scriptDir))
|
|
33
32
|
{
|
|
34
33
|
arguments = $"{scriptDir}/utils.sh pod-install";
|
|
35
34
|
}
|
|
35
|
+
else if (!Application.isBatchMode)
|
|
36
|
+
{
|
|
37
|
+
string podPath = "/usr/local/bin/pod";
|
|
38
|
+
if (!File.Exists(podPath)) podPath = "/opt/homebrew/bin/pod";
|
|
39
|
+
arguments = $"-c \"{podPath} install --project-directory={buildPath}\"";
|
|
40
|
+
}
|
|
36
41
|
|
|
37
42
|
// Configure process start info
|
|
38
43
|
var startInfo = new ProcessStartInfo
|
|
@@ -57,12 +62,6 @@ namespace Amanotes.Core
|
|
|
57
62
|
if (args.Data == null) return; // End of the stream
|
|
58
63
|
Debug.Log(args.Data);
|
|
59
64
|
};
|
|
60
|
-
|
|
61
|
-
// proc.ErrorDataReceived += (sender, args) =>
|
|
62
|
-
// {
|
|
63
|
-
// if (args.Data == null) return; // End of the stream
|
|
64
|
-
// Debug.LogError(args.Data);
|
|
65
|
-
// };
|
|
66
65
|
|
|
67
66
|
proc.Exited += processExit;
|
|
68
67
|
|
|
@@ -71,9 +70,6 @@ namespace Amanotes.Core
|
|
|
71
70
|
proc.BeginOutputReadLine();
|
|
72
71
|
proc.BeginErrorReadLine();
|
|
73
72
|
proc.WaitForExit();
|
|
74
|
-
|
|
75
|
-
// Log exit code
|
|
76
|
-
// Debug.LogWarning("Process exited with code: " + proc.ExitCode);
|
|
77
73
|
}
|
|
78
74
|
catch (Exception e)
|
|
79
75
|
{
|
|
@@ -245,20 +241,16 @@ namespace Amanotes.Core
|
|
|
245
241
|
var buildTarget = GetBuildTarget();
|
|
246
242
|
|
|
247
243
|
Console.WriteLine(":: Performing build");
|
|
248
|
-
if (TryGetEnv(VERSION_NUMBER_VAR, out
|
|
244
|
+
if (TryGetEnv(VERSION_NUMBER_VAR, out string bundleVersionNumber))
|
|
249
245
|
{
|
|
250
|
-
if (buildTarget == BuildTarget.iOS)
|
|
251
|
-
{
|
|
252
|
-
bundleVersionNumber = GetIosVersion();
|
|
253
|
-
}
|
|
254
246
|
Console.WriteLine($":: Setting bundleVersionNumber to '{bundleVersionNumber}' (Length: {bundleVersionNumber.Length})");
|
|
255
247
|
PlayerSettings.bundleVersion = bundleVersionNumber;
|
|
256
248
|
}
|
|
249
|
+
HandleBuildNumber(buildTarget);
|
|
257
250
|
|
|
258
251
|
if (buildTarget == BuildTarget.Android)
|
|
259
252
|
{
|
|
260
253
|
HandleAndroidAppBundle();
|
|
261
|
-
HandleAndroidBundleVersionCode();
|
|
262
254
|
HandleAndroidKeystore();
|
|
263
255
|
HandleDebugSymbols();
|
|
264
256
|
HandleExportAndroidProject();
|
|
@@ -276,6 +268,7 @@ namespace Amanotes.Core
|
|
|
276
268
|
if (buildReport.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded)
|
|
277
269
|
throw new Exception($"Build ended with {buildReport.summary.result} status");
|
|
278
270
|
|
|
271
|
+
BuildMetadata.Save(buildPath, buildTarget);
|
|
279
272
|
Console.WriteLine(":: Done with build");
|
|
280
273
|
}
|
|
281
274
|
|
|
@@ -299,18 +292,24 @@ namespace Amanotes.Core
|
|
|
299
292
|
}
|
|
300
293
|
}
|
|
301
294
|
|
|
302
|
-
private static void
|
|
295
|
+
private static void HandleBuildNumber(BuildTarget buildTarget)
|
|
303
296
|
{
|
|
304
|
-
if (TryGetEnv(
|
|
297
|
+
if (!TryGetEnv(VERSION_BUILD_VAR, out string value)) return;
|
|
298
|
+
if (int.TryParse(value, out int version))
|
|
305
299
|
{
|
|
306
|
-
if (
|
|
300
|
+
if (buildTarget == BuildTarget.Android)
|
|
307
301
|
{
|
|
308
|
-
PlayerSettings.Android.bundleVersionCode = version;
|
|
309
|
-
Console.WriteLine($":: {ANDROID_BUNDLE_VERSION_CODE} env var detected, set the bundle version code to {value}.");
|
|
302
|
+
PlayerSettings.Android.bundleVersionCode = version;
|
|
310
303
|
}
|
|
311
|
-
else
|
|
312
|
-
|
|
304
|
+
else if (buildTarget == BuildTarget.iOS)
|
|
305
|
+
{
|
|
306
|
+
PlayerSettings.iOS.buildNumber = version.ToString();
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
Console.WriteLine($":: {VERSION_BUILD_VAR} env var detected, set the bundle version code to {value}.");
|
|
313
310
|
}
|
|
311
|
+
else
|
|
312
|
+
Console.WriteLine($":: {VERSION_BUILD_VAR} env var detected but the version value \"{value}\" is not an integer.");
|
|
314
313
|
}
|
|
315
314
|
|
|
316
315
|
private static void HandleExportAndroidProject()
|
|
@@ -323,22 +322,6 @@ namespace Amanotes.Core
|
|
|
323
322
|
}
|
|
324
323
|
}
|
|
325
324
|
|
|
326
|
-
private static string GetIosVersion()
|
|
327
|
-
{
|
|
328
|
-
if (TryGetEnv(VERSION_iOS, out string value))
|
|
329
|
-
{
|
|
330
|
-
if (int.TryParse(value, out int version))
|
|
331
|
-
{
|
|
332
|
-
Console.WriteLine($":: {VERSION_iOS} env var detected, set the version to {value}.");
|
|
333
|
-
return version.ToString();
|
|
334
|
-
}
|
|
335
|
-
else
|
|
336
|
-
Console.WriteLine($":: {VERSION_iOS} env var detected but the version value \"{value}\" is not an integer.");
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
throw new ArgumentNullException(nameof(value), $":: Error finding {VERSION_iOS} env var");
|
|
340
|
-
}
|
|
341
|
-
|
|
342
325
|
private static void HandleAndroidKeystore()
|
|
343
326
|
{
|
|
344
327
|
#if UNITY_2019_1_OR_NEWER
|
|
@@ -394,6 +377,31 @@ namespace Amanotes.Core
|
|
|
394
377
|
}
|
|
395
378
|
}
|
|
396
379
|
|
|
380
|
+
[Serializable]
|
|
381
|
+
public class BuildMetadata
|
|
382
|
+
{
|
|
383
|
+
public string appVersion;
|
|
384
|
+
public string buildNumber;
|
|
385
|
+
public string buildTarget;
|
|
386
|
+
|
|
387
|
+
public static void Save(string buildPath, BuildTarget buildTarget)
|
|
388
|
+
{
|
|
389
|
+
string outputFile = Path.Combine(buildPath, "build_info.json");
|
|
390
|
+
|
|
391
|
+
var metadata = new BuildMetadata
|
|
392
|
+
{
|
|
393
|
+
appVersion = PlayerSettings.bundleVersion,
|
|
394
|
+
buildNumber = buildTarget == BuildTarget.Android ? PlayerSettings.Android.bundleVersionCode.ToString() : PlayerSettings.iOS.buildNumber,
|
|
395
|
+
buildTarget = buildTarget.ToString()
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
string json = JsonUtility.ToJson(metadata, prettyPrint: true);
|
|
399
|
+
File.WriteAllText(outputFile, json);
|
|
400
|
+
|
|
401
|
+
Console.WriteLine($":: Build information saved to {outputFile}");
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
397
405
|
public class GDKPreProcessBuild: IPreprocessBuildWithReport
|
|
398
406
|
{
|
|
399
407
|
public int callbackOrder
|
|
@@ -402,20 +410,14 @@ namespace Amanotes.Core
|
|
|
402
410
|
}
|
|
403
411
|
public void OnPreprocessBuild(BuildReport report)
|
|
404
412
|
{
|
|
405
|
-
if (report.summary.platform
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
EditorPrefs.SetString("GradlePath", envGradlePath);
|
|
414
|
-
Debug.Log("Update gradle path to: " + envGradlePath);
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
|
|
413
|
+
if (report.summary.platform != BuildTarget.Android) return;
|
|
414
|
+
// Change Gradle path when running in headless mode (CI Machine)
|
|
415
|
+
if (!Application.isBatchMode) return;
|
|
416
|
+
if (!GDKCIBuildCommand.TryGetEnv("GRADLE_PATH", out string envGradlePath)) return;
|
|
417
|
+
EditorPrefs.SetBool("GradleUseEmbedded", false);
|
|
418
|
+
EditorPrefs.SetString("GradlePath", envGradlePath);
|
|
419
|
+
Debug.Log("Update gradle path to: " + envGradlePath);
|
|
420
|
+
|
|
419
421
|
}
|
|
420
422
|
}
|
|
421
423
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
using System;
|
|
1
2
|
using UnityEngine;
|
|
2
3
|
using UnityEditor;
|
|
3
4
|
|
|
@@ -27,16 +28,27 @@ namespace Amanotes.Editor
|
|
|
27
28
|
[System.Serializable]
|
|
28
29
|
public class PodFramework
|
|
29
30
|
{
|
|
30
|
-
public string
|
|
31
|
+
public string podFrameworkName;
|
|
31
32
|
public bool enable;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
[System.Serializable]
|
|
35
|
-
public class
|
|
36
|
+
public class PlistEntry
|
|
36
37
|
{
|
|
38
|
+
public enum PlistValueType
|
|
39
|
+
{
|
|
40
|
+
String,
|
|
41
|
+
Boolean,
|
|
42
|
+
Integer,
|
|
43
|
+
Real,
|
|
44
|
+
Array,
|
|
45
|
+
Dictionary,
|
|
46
|
+
Date
|
|
47
|
+
}
|
|
48
|
+
|
|
37
49
|
public string key;
|
|
38
50
|
public string value;
|
|
39
|
-
public
|
|
51
|
+
public PlistValueType type;
|
|
40
52
|
public bool enable;
|
|
41
53
|
}
|
|
42
54
|
|
|
@@ -75,19 +87,23 @@ namespace Amanotes.Editor
|
|
|
75
87
|
[Header("Pod Frameworks to Add")]
|
|
76
88
|
public List<PodFramework> podFrameworks = new List<PodFramework>
|
|
77
89
|
{
|
|
78
|
-
new PodFramework {
|
|
79
|
-
new PodFramework {
|
|
90
|
+
new PodFramework { podFrameworkName = "AppLovinSDK", enable = true },
|
|
91
|
+
new PodFramework { podFrameworkName = "InMobiSDK", enable = true }
|
|
80
92
|
};
|
|
81
93
|
|
|
82
|
-
[Header("Info.plist
|
|
83
|
-
public List<
|
|
94
|
+
[Header("Info.plist Entries to Add")]
|
|
95
|
+
public List<PlistEntry> plistKeys = new List<PlistEntry>
|
|
84
96
|
{
|
|
85
|
-
new
|
|
86
|
-
new
|
|
87
|
-
new
|
|
88
|
-
new
|
|
89
|
-
new
|
|
90
|
-
new
|
|
97
|
+
new PlistEntry { key = "NSCalendarsUsageDescription", value = "App requires calendar access.", type = PlistEntry.PlistValueType.String, enable = true },
|
|
98
|
+
new PlistEntry { key = "NSCameraUsageDescription", value = "App requires camera access.", type = PlistEntry.PlistValueType.String, enable = true },
|
|
99
|
+
new PlistEntry { key = "NSPhotoLibraryUsageDescription", value = "App requires photo library access.", type = PlistEntry.PlistValueType.String, enable = true },
|
|
100
|
+
new PlistEntry { key = "NSMotionUsageDescription", value = "App requires motion control.", type = PlistEntry.PlistValueType.String, enable = true },
|
|
101
|
+
new PlistEntry { key = "NSLocationWhenInUseUsageDescription", value = "App requires location access.", type = PlistEntry.PlistValueType.String, enable = true },
|
|
102
|
+
new PlistEntry { key = "NSUserTrackingUsageDescription", value = "App requires user tracking permission.", type = PlistEntry.PlistValueType.String, enable = true },
|
|
103
|
+
|
|
104
|
+
new PlistEntry { key = "ITSAppUsesNonExemptEncryption", value = "false", type = PlistEntry.PlistValueType.Boolean, enable = true },
|
|
105
|
+
new PlistEntry { key = "FacebookAutoLogAppEventsEnabled", value = "true", type = PlistEntry.PlistValueType.Boolean, enable = true },
|
|
106
|
+
new PlistEntry { key = "FacebookAdvertiserIDCollectionEnabled", value = "true", type = PlistEntry.PlistValueType.Boolean, enable = true }
|
|
91
107
|
};
|
|
92
108
|
|
|
93
109
|
[Header("Build Properties to Set")]
|
|
@@ -160,14 +176,12 @@ namespace Amanotes.Editor
|
|
|
160
176
|
proj.WriteToFile(projectPath);
|
|
161
177
|
}, pathToBuildProject);
|
|
162
178
|
}
|
|
163
|
-
|
|
164
179
|
private void RemoveDeprecatedInfoPListKeys(string pathToBuildProject)
|
|
165
180
|
{
|
|
166
181
|
string plistPath = Path.Combine(pathToBuildProject, PLIST_FILE);
|
|
167
|
-
|
|
182
|
+
var plist = new PlistDocument();
|
|
168
183
|
plist.ReadFromString(File.ReadAllText(plistPath));
|
|
169
|
-
|
|
170
|
-
PlistElementDict rootDict = plist.root;
|
|
184
|
+
var rootDict = plist.root;
|
|
171
185
|
|
|
172
186
|
if (rootDict.values.ContainsKey(EXIST_ON_SUSPEND_KEY))
|
|
173
187
|
{
|
|
@@ -243,11 +257,11 @@ namespace Amanotes.Editor
|
|
|
243
257
|
foreach (var podFramework in podFrameworks)
|
|
244
258
|
{
|
|
245
259
|
if (!podFramework.enable) continue;
|
|
246
|
-
|
|
247
|
-
|
|
260
|
+
string frameworkPath = SearchForPodFramework(pathToBuildProject, podFramework.podFrameworkName);
|
|
261
|
+
|
|
248
262
|
if (string.IsNullOrEmpty(frameworkPath))
|
|
249
263
|
{
|
|
250
|
-
Debug.LogError($"Failed to find Pod framework for: {podFramework.
|
|
264
|
+
Debug.LogError($"Failed to find Pod framework for: {podFramework.podFrameworkName}");
|
|
251
265
|
continue;
|
|
252
266
|
}
|
|
253
267
|
|
|
@@ -291,20 +305,40 @@ namespace Amanotes.Editor
|
|
|
291
305
|
plist.ReadFromFile(plistPath);
|
|
292
306
|
var rootDict = plist.root;
|
|
293
307
|
|
|
294
|
-
foreach (var
|
|
308
|
+
foreach (var plistEntry in plistKeys)
|
|
295
309
|
{
|
|
296
|
-
if (!
|
|
310
|
+
if (!plistEntry.enable) continue;
|
|
297
311
|
|
|
298
|
-
|
|
312
|
+
switch (plistEntry.type)
|
|
299
313
|
{
|
|
300
|
-
|
|
314
|
+
case PlistEntry.PlistValueType.String:
|
|
315
|
+
rootDict.SetString(plistEntry.key, plistEntry.value);
|
|
316
|
+
break;
|
|
317
|
+
case PlistEntry.PlistValueType.Boolean:
|
|
318
|
+
rootDict.SetBoolean(plistEntry.key, bool.Parse(plistEntry.value));
|
|
319
|
+
break;
|
|
320
|
+
case PlistEntry.PlistValueType.Integer:
|
|
321
|
+
rootDict.SetInteger(plistEntry.key, int.Parse(plistEntry.value));
|
|
322
|
+
break;
|
|
323
|
+
case PlistEntry.PlistValueType.Real:
|
|
324
|
+
rootDict.SetReal(plistEntry.key, float.Parse(plistEntry.value));
|
|
325
|
+
break;
|
|
326
|
+
case PlistEntry.PlistValueType.Array:
|
|
327
|
+
var array = rootDict.CreateArray(plistEntry.key);
|
|
328
|
+
foreach (var item in plistEntry.value.Split(',')) array.AddString(item.Trim());
|
|
329
|
+
break;
|
|
330
|
+
case PlistEntry.PlistValueType.Dictionary:
|
|
331
|
+
var dict = rootDict.CreateDict(plistEntry.key);
|
|
332
|
+
foreach (var pair in plistEntry.value.Split(','))
|
|
333
|
+
{
|
|
334
|
+
var keyValue = pair.Split(':');
|
|
335
|
+
dict.SetString(keyValue[0].Trim(), keyValue[1].Trim());
|
|
336
|
+
}
|
|
337
|
+
break;
|
|
338
|
+
case PlistEntry.PlistValueType.Date:
|
|
339
|
+
rootDict.SetDate(plistEntry.key, DateTime.Parse(plistEntry.value));
|
|
340
|
+
break;
|
|
301
341
|
}
|
|
302
|
-
else if (bool.TryParse(plistKey.value, out bool boolValue))
|
|
303
|
-
{
|
|
304
|
-
rootDict.SetBoolean(plistKey.key, boolValue);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
Debug.Log($"Added/Updated Info.plist key: {plistKey.key}");
|
|
308
342
|
}
|
|
309
343
|
|
|
310
344
|
plist.WriteToFile(plistPath);
|
|
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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/Runtime/Ad/AmaGDK.Ads.cs
CHANGED
|
@@ -135,7 +135,7 @@ namespace Amanotes.Core
|
|
|
135
135
|
|
|
136
136
|
if (!localData._dirty) return;
|
|
137
137
|
localData._dirty = false;
|
|
138
|
-
localData.SaveJsonToFile(
|
|
138
|
+
localData.SaveJsonToFile();
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
public static IEventParamsBuilder LogFunnelEvent(string eventName, string signature = "")
|
|
@@ -314,7 +314,7 @@ namespace Amanotes.Core
|
|
|
314
314
|
internal static readonly GDKPool.Pool<EventParams> epPool = new GDKPool.Pool<EventParams>(1);
|
|
315
315
|
|
|
316
316
|
private static readonly Lazy<AnalyticsData> _localData = new Lazy<AnalyticsData>(
|
|
317
|
-
() => new AnalyticsData().
|
|
317
|
+
() => new AnalyticsData().LoadJsonFromFile().BuildCache());
|
|
318
318
|
internal static AnalyticsData localData => _localData.Value;
|
|
319
319
|
|
|
320
320
|
internal static readonly Dictionary<string, string> reservedPrefixes = new Dictionary<string, string>()
|
|
@@ -800,12 +800,6 @@ namespace Amanotes.Core
|
|
|
800
800
|
return this;
|
|
801
801
|
}
|
|
802
802
|
|
|
803
|
-
public AnalyticsData ReloadDataFromLocal()
|
|
804
|
-
{
|
|
805
|
-
this.LoadJsonFromFile().BuildCache();
|
|
806
|
-
return this;
|
|
807
|
-
}
|
|
808
|
-
|
|
809
803
|
internal EventDetail GetEventDetail(string eventName, bool autoNew = false)
|
|
810
804
|
{
|
|
811
805
|
if (string.IsNullOrEmpty(eventName)) return null;
|
|
@@ -849,7 +843,7 @@ namespace Amanotes.Core
|
|
|
849
843
|
if (!Config.analytics.autoFlushEventDetail) return;
|
|
850
844
|
if (!_dirty) return;
|
|
851
845
|
_dirty = false;
|
|
852
|
-
this.SaveJsonToFile(
|
|
846
|
+
this.SaveJsonToFile();
|
|
853
847
|
}
|
|
854
848
|
|
|
855
849
|
internal void UpdateMigrationLog()
|
|
@@ -66,7 +66,7 @@ namespace Amanotes.Core
|
|
|
66
66
|
ConsentHook.ATTRequest(isAllowed =>
|
|
67
67
|
{
|
|
68
68
|
data.att = isAllowed ? Status.Allowed : Status.NotAllowed;
|
|
69
|
-
data.SaveJsonToFile(
|
|
69
|
+
data.SaveJsonToFile();
|
|
70
70
|
onComplete?.Invoke(allowedATT);
|
|
71
71
|
});
|
|
72
72
|
}
|
|
@@ -107,7 +107,7 @@ namespace Amanotes.Core
|
|
|
107
107
|
if (successful)
|
|
108
108
|
{
|
|
109
109
|
data.cmp = !IsRequired ? Status.NotRequired : Status.Allowed;
|
|
110
|
-
data.SaveJsonToFile(
|
|
110
|
+
data.SaveJsonToFile();
|
|
111
111
|
}
|
|
112
112
|
onComplete?.Invoke(checkedCMP);
|
|
113
113
|
});
|
package/Runtime/AmaGDK.IAP.cs
CHANGED
|
@@ -306,7 +306,7 @@ namespace Amanotes.Core
|
|
|
306
306
|
subscriptionExpiredDate = _subscriptionExpiredDate?.ToString(DATE_FORMAT);
|
|
307
307
|
_unsubscribedDate = Adapter.GetUnsubscribedDate();
|
|
308
308
|
unsubscribedDate = _unsubscribedDate?.ToString(DATE_FORMAT);
|
|
309
|
-
this.SaveJsonToFile(
|
|
309
|
+
this.SaveJsonToFile();
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
}
|
|
@@ -33,14 +33,14 @@ namespace Amanotes.Core
|
|
|
33
33
|
private bool _dirty = false;
|
|
34
34
|
private void Save()
|
|
35
35
|
{
|
|
36
|
-
this.SaveJsonToFile(
|
|
36
|
+
this.SaveJsonToFile();
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
private void SaveIfDirty()
|
|
40
40
|
{
|
|
41
41
|
if (!_dirty) return;
|
|
42
42
|
_dirty = false;
|
|
43
|
-
this.SaveJsonToFile(
|
|
43
|
+
this.SaveJsonToFile();
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
package/Runtime/AmaGDK.cs
CHANGED
|
@@ -27,7 +27,7 @@ namespace Amanotes.Core
|
|
|
27
27
|
{
|
|
28
28
|
public partial class AmaGDK : MonoBehaviour
|
|
29
29
|
{
|
|
30
|
-
public const string VERSION = "0.2.
|
|
30
|
+
public const string VERSION = "0.2.80";
|
|
31
31
|
|
|
32
32
|
internal static Status _status = Status.None;
|
|
33
33
|
internal static ConfigAsset _config = null;
|
package/Runtime/Core/GDKDebug.cs
CHANGED
|
@@ -38,13 +38,16 @@ namespace Amanotes.Core
|
|
|
38
38
|
{
|
|
39
39
|
public static Action<string> logNonfatalErrorHook = null;
|
|
40
40
|
private static readonly HashSet<string> nonFatalDict = new HashSet<string>();
|
|
41
|
-
|
|
41
|
+
private static readonly HashSet<string> logWarningDict = new HashSet<string>();
|
|
42
42
|
|
|
43
43
|
public static void LogWarningOnce(string message, string key = null)
|
|
44
44
|
{
|
|
45
45
|
if (AmaGDK.logLevel < LogLevel.Warning) return;
|
|
46
46
|
if (string.IsNullOrEmpty(key)) key = message;
|
|
47
|
-
|
|
47
|
+
lock (logWarningDict)
|
|
48
|
+
{
|
|
49
|
+
if (!logWarningDict.Add(key)) return;
|
|
50
|
+
}
|
|
48
51
|
|
|
49
52
|
using (NoStackTrace.Warning)
|
|
50
53
|
{
|
|
@@ -71,14 +74,20 @@ namespace Amanotes.Core
|
|
|
71
74
|
|
|
72
75
|
if (GDKUtils.isOnMainThread) // Most of the time
|
|
73
76
|
{
|
|
74
|
-
|
|
77
|
+
lock (nonFatalDict)
|
|
78
|
+
{
|
|
79
|
+
if (!nonFatalDict.Add(message)) return;
|
|
80
|
+
}
|
|
75
81
|
logNonfatalErrorHook(message);
|
|
76
82
|
return;
|
|
77
83
|
}
|
|
78
84
|
|
|
79
85
|
GDKUtils.DoOnMainThread(() =>
|
|
80
86
|
{
|
|
81
|
-
|
|
87
|
+
lock (nonFatalDict)
|
|
88
|
+
{
|
|
89
|
+
if (!nonFatalDict.Add(message)) return; // LogOnce
|
|
90
|
+
}
|
|
82
91
|
logNonfatalErrorHook(message);
|
|
83
92
|
});
|
|
84
93
|
}
|
|
@@ -200,7 +200,7 @@ namespace Amanotes.Core.Internal
|
|
|
200
200
|
return GDKFileUtils.LoadJsonFromFile(instance);
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
internal static void SaveJsonToFile<T>(this T instance, bool immediately) where T: IJsonFile
|
|
203
|
+
internal static void SaveJsonToFile<T>(this T instance, bool immediately = true) where T: IJsonFile
|
|
204
204
|
{
|
|
205
205
|
GDKFileUtils.SaveJsonToFile(instance, immediately);
|
|
206
206
|
}
|
|
@@ -236,7 +236,7 @@ namespace Amanotes.Core.Internal
|
|
|
236
236
|
return instance;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
public static void SaveJsonToFile<T>(T instance, bool immediately)
|
|
239
|
+
public static void SaveJsonToFile<T>(T instance, bool immediately = true)
|
|
240
240
|
{
|
|
241
241
|
string fileName = instance.GetType().Name;
|
|
242
242
|
string json = JsonUtility.ToJson(instance);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "com.amanotes.gdk",
|
|
3
|
-
"version": "0.2.81-
|
|
3
|
+
"version": "0.2.81-alpha.5",
|
|
4
4
|
"displayName": "AmaGDK",
|
|
5
5
|
"description": "Amanotes Game Development Kit",
|
|
6
6
|
"unity": "2019.4",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"Amanotes",
|
|
9
9
|
"Amanotes GDK",
|
|
10
10
|
"vh-name:AmaGDK"
|
|
11
|
-
],
|
|
11
|
+
],
|
|
12
12
|
"author": {
|
|
13
13
|
"name": "Amanotes",
|
|
14
14
|
"email": "tech.support@amanotes.com",
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
},
|
|
17
17
|
"changelogUrl": "https://amagdk.notion.site/Change-Log-6dfd4b67d64f496bbd9eb04ccb4ef95a",
|
|
18
18
|
"documentationUrl": "https://amagdk.notion.site/amagdk/Ama-GDK-a73596617ab247b6a43c8f12a1581415",
|
|
19
|
-
"license": "MIT"
|
|
20
|
-
}
|
|
19
|
+
"license": "MIT"
|
|
20
|
+
}
|