com.amanotes.gdk 0.2.81-a3 → 0.2.81-a4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Changelog
2
2
 
3
- ## [0.2.81-a3] - 2024-11-21
3
+ ## [0.2.81-a4] - 2024-11-21
4
4
  - [Dev] Add GDKPostBuild for iOS
5
5
  - [Dev] Improve GDK editor experience before config asset imported
6
6
  - [Dev] Analytics save file in async
@@ -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 relativePath; // Only the framework name, e.g., "AppLovinSDK"
31
+ public string podFrameworkName;
31
32
  public bool enable;
32
33
  }
33
34
 
34
35
  [System.Serializable]
35
- public class PlistKey
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 bool isString;
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 { relativePath = "AppLovinSDK", enable = true },
79
- new PodFramework { relativePath = "InMobiSDK", enable = true }
90
+ new PodFramework { podFrameworkName = "AppLovinSDK", enable = true },
91
+ new PodFramework { podFrameworkName = "InMobiSDK", enable = true }
80
92
  };
81
93
 
82
- [Header("Info.plist Keys to Add")]
83
- public List<PlistKey> plistKeys = new List<PlistKey>
94
+ [Header("Info.plist Entries to Add")]
95
+ public List<PlistEntry> plistKeys = new List<PlistEntry>
84
96
  {
85
- new PlistKey { key = "NSCalendarsUsageDescription", value = "App requires calendar access.", isString = true, enable = true },
86
- new PlistKey { key = "NSCameraUsageDescription", value = "App requires camera access.", isString = true, enable = true },
87
- new PlistKey { key = "NSPhotoLibraryUsageDescription", value = "App requires photo library access.", isString = true, enable = true },
88
- new PlistKey { key = "NSMotionUsageDescription", value = "App requires motion control.", isString = true, enable = true },
89
- new PlistKey { key = "NSLocationWhenInUseUsageDescription", value = "App requires location access.", isString = true, enable = true },
90
- new PlistKey { key = "NSUserTrackingUsageDescription", value = "App requires user tracking permission.", isString = true, enable = true }
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
- PlistDocument plist = new PlistDocument();
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
- string frameworkPath = SearchForPodFramework(pathToBuildProject, podFramework.relativePath);
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.relativePath}");
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 plistKey in plistKeys)
308
+ foreach (var plistEntry in plistKeys)
295
309
  {
296
- if (!plistKey.enable) continue;
310
+ if (!plistEntry.enable) continue;
297
311
 
298
- if (plistKey.isString)
312
+ switch (plistEntry.type)
299
313
  {
300
- rootDict.SetString(plistKey.key, plistKey.value);
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);
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.81-a3";
30
+ public const string VERSION = "0.2.81-a4";
31
31
 
32
32
  internal static Status _status = Status.None;
33
33
  internal static ConfigAsset _config = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.81-a3",
3
+ "version": "0.2.81-a4",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",
@@ -1,8 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: 556517e393f149748cf9890d5d436491
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
@@ -1,8 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: 19f1c4b4ece54d438bb89c63b87846bf
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant: