com.amanotes.gdk 0.2.66-4 → 0.2.66-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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.66-5 - 2025-01-21]
4
+ - [Fix] Early validate IDFA, GAId and update pattern of AmaDeviceId
5
+ - [Fix] Send GDKVersionTracking only for Android/iOS
6
+
3
7
  ## [0.2.66-4 - 2024-12-03]
4
8
  - [Dev] Handle exception of FetchConfig
5
9
  - [Dev] Handle format exception in RemoteConfig
@@ -2,6 +2,7 @@ using System;
2
2
  using System.Collections.Generic;
3
3
  using System.IO;
4
4
  using System.Linq;
5
+ using System.Net;
5
6
  using System.Net.Http;
6
7
  using System.Text;
7
8
  using System.Xml;
@@ -241,6 +242,26 @@ namespace Amanotes.Editor
241
242
  [PostProcessBuild(999)]
242
243
  public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
243
244
  {
245
+ if (target != BuildTarget.Android && target != BuildTarget.iOS) return;
246
+
247
+ if (string.IsNullOrWhiteSpace(Application.productName) || Application.productName.ToLower() == "my project")
248
+ {
249
+ Debug.LogWarning("AmaGDK | [SDKVersionTracking] Please correct Application.productName");
250
+ return;
251
+ }
252
+
253
+ if (string.IsNullOrWhiteSpace(PlayerSettings.applicationIdentifier) || PlayerSettings.applicationIdentifier.ToLower().StartsWith("com.defaultcompany"))
254
+ {
255
+ Debug.LogWarning("AmaGDK | [SDKVersionTracking] Please correct PlayerSettings.applicationIdentifier");
256
+ return;
257
+ }
258
+
259
+ if (string.IsNullOrWhiteSpace(PlayerSettings.bundleVersion) || PlayerSettings.bundleVersion == "0")
260
+ {
261
+ Debug.LogWarning("AmaGDK | [SDKVersionTracking] Please correct PlayerSettings.bundleVersion");
262
+ return;
263
+ }
264
+
244
265
  var rawData = _dicThirdPartyVersion
245
266
  .Concat(_dicExtraVersion)
246
267
  .Concat(_dicIronSourceAdapterVersion.ToDictionary(kvp => kvp.Key, kvp => (object)("IS_" + kvp.Value)))
@@ -288,7 +309,12 @@ namespace Amanotes.Editor
288
309
  else
289
310
  {
290
311
  string errorData = await response.Content.ReadAsStringAsync();
291
- Debug.LogError($"AmaGDK | [SDKVersionTracking] Status code {response.StatusCode} Error Response: {errorData}");
312
+ string errorMessage = $"AmaGDK | [SDKVersionTracking] Status code {response.StatusCode} Error Response: {errorData}";
313
+ if ((int)response.StatusCode == 409)
314
+ {
315
+ throw new Exception(errorMessage);
316
+ }
317
+ Debug.LogError(errorMessage);
292
318
  }
293
319
  }
294
320
  catch (HttpRequestException e)
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -157,11 +157,7 @@ namespace Amanotes.Core
157
157
  get => _amaDeviceId;
158
158
  set
159
159
  {
160
- var pattern = ALPHANUMERIC_HYPHEN_PATTERN;
161
- #if UNITY_ANDROID && !UNITY_EDITOR_OSX
162
- pattern = ALPHANUMERIC_PATTERN;
163
- #endif
164
- if (!ValidateId(value, pattern))
160
+ if (!ValidateId(value, ALPHANUMERIC_OPTIONAL_HYPHEN_PATTERN))
165
161
  {
166
162
  Logging.LogError($"[UserProfile] Wrong format for AmaDeviceId. Value: {value}");
167
163
  return;
@@ -299,6 +295,7 @@ namespace Amanotes.Core
299
295
  [SerializeField]
300
296
  private string _country;
301
297
 
298
+ private const string ALPHANUMERIC_OPTIONAL_HYPHEN_PATTERN = @"^(?=.*\d)(?=.*[a-zA-Z])[a-zA-Z\d-]+$";
302
299
  private const string ALPHANUMERIC_HYPHEN_PATTERN = @"^(?=.*\d)(?=.*[a-zA-Z])(?=.*-).+$";
303
300
  private const string ALPHANUMERIC_PATTERN = @"^(?=.*\d)(?=.*[a-zA-Z])[a-zA-Z\d]+$";
304
301
  private const string NUMERIC_HYPHEN_PATTERN = @"^(?=.*\d)(?=.*-)[\d-]+$";
@@ -347,9 +344,19 @@ namespace Amanotes.Core
347
344
  switch (Application.platform)
348
345
  {
349
346
  case RuntimePlatform.IPhonePlayer:
347
+ if (!ValidateId(id, ALPHANUMERIC_HYPHEN_PATTERN))
348
+ {
349
+ Logging.LogWarning($"[UserProfile] Wrong format for IDFA. Value: {id}");
350
+ return;
351
+ }
350
352
  IDFA = id;
351
353
  break;
352
354
  case RuntimePlatform.Android:
355
+ if (!ValidateId(id, ALPHANUMERIC_HYPHEN_PATTERN))
356
+ {
357
+ Logging.LogWarning($"[UserProfile] Wrong format for GAId. Value: {id}");
358
+ return;
359
+ }
353
360
  GAId = id;
354
361
  break;
355
362
  }
package/Runtime/AmaGDK.cs CHANGED
@@ -17,7 +17,7 @@ namespace Amanotes.Core
17
17
  {
18
18
  public partial class AmaGDK : MonoBehaviour
19
19
  {
20
- public const string VERSION = "0.2.66-4";
20
+ public const string VERSION = "0.2.66-5";
21
21
 
22
22
  internal static Status _status = Status.None;
23
23
  private static ConfigAsset _config = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.66-4",
3
+ "version": "0.2.66-5",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",