com.amanotes.gdk 0.2.81 → 0.2.82-alpha.1

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.
@@ -251,6 +251,11 @@ namespace Amanotes.Editor
251
251
 
252
252
  public int callbackOrder { get; }
253
253
  public void OnPreprocessBuild(BuildReport report)
254
+ {
255
+ OnPreprocessBuild();
256
+ }
257
+
258
+ public void OnPreprocessBuild()
254
259
  {
255
260
  _dicThirdPartyVersion = AmaGDKExtra.GetThirdPartyVersions();
256
261
  _dicImportedGDKAdapter = GetImportedGDKAdapter();
@@ -269,10 +274,13 @@ namespace Amanotes.Editor
269
274
  [PostProcessBuild(999)]
270
275
  public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
271
276
  {
277
+ var maxAdapters = MaxEditorUtils.GetMaxAdapters().ToDictionary(kvp => $"{kvp.Key}-MaxAdapter", kvp => (object)kvp.Value);
278
+ var ironSourceAdapters = _dicIronSourceAdapterVersion.ToDictionary(kvp => $"{kvp.Key}-ISAdapter", kvp => kvp.Value);
272
279
  var rawData = _dicThirdPartyVersion
273
280
  .Concat(_dicExtraVersion)
274
- .Concat(_dicIronSourceAdapterVersion.ToDictionary(kvp => kvp.Key, kvp => (object)("IS_" + kvp.Value)))
275
281
  .ToDictionary(x => x.Key, x => x.Value);
282
+ rawData["MaxAdapters"] = maxAdapters;
283
+ rawData["IronSourceAdapters"] = ironSourceAdapters;
276
284
  rawData["UnityVersion"] = Application.unityVersion;
277
285
  string platform = "";
278
286
  #if UNITY_ANDROID
@@ -0,0 +1,113 @@
1
+ using System.Collections.Generic;
2
+ using System.IO;
3
+ using System.Linq;
4
+ using System.Xml.Linq;
5
+
6
+ namespace Amanotes.Editor
7
+ {
8
+ public class Versions
9
+ {
10
+ public string Unity;
11
+ public string Android;
12
+ public string Ios;
13
+ }
14
+
15
+ public class MaxEditorUtils
16
+ {
17
+ public static Dictionary<string, string> GetMaxAdapters()
18
+ {
19
+ var result = new Dictionary<string, string>();
20
+ string mediationPath = "Assets/MaxSdk/Mediation";
21
+ string[] adapterFolders = Directory.GetDirectories(mediationPath);
22
+
23
+ foreach (string adapterFolder in adapterFolders)
24
+ {
25
+ string adapterName = new DirectoryInfo(adapterFolder).Name;
26
+ string dependencyPath = Path.Combine(adapterFolder, "Editor/Dependencies.xml");
27
+ Versions version = GetCurrentVersions(dependencyPath);
28
+ result.Add(adapterName, $"android_{version.Android}_ios_{version.Ios}");
29
+ }
30
+
31
+ return result;
32
+ }
33
+
34
+ public static Versions GetCurrentVersions(string dependencyPath)
35
+ {
36
+ XDocument dependency;
37
+ try
38
+ {
39
+ dependency = XDocument.Load(dependencyPath);
40
+ }
41
+ #pragma warning disable 0168
42
+ catch (IOException exception)
43
+ #pragma warning restore 0168
44
+ {
45
+ // Couldn't find the dependencies file. The plugin is not installed.
46
+ return new Versions();
47
+ }
48
+
49
+ // <dependencies>
50
+ // <androidPackages>
51
+ // <androidPackage spec="com.applovin.mediation:network_name-adapter:1.2.3.4" />
52
+ // </androidPackages>
53
+ // <iosPods>
54
+ // <iosPod name="AppLovinMediationNetworkNameAdapter" version="2.3.4.5" />
55
+ // </iosPods>
56
+ // </dependencies>
57
+ string androidVersion = null;
58
+ string iosVersion = null;
59
+ var dependenciesElement = dependency.Element("dependencies");
60
+ if (dependenciesElement != null)
61
+ {
62
+ var androidPackages = dependenciesElement.Element("androidPackages");
63
+ if (androidPackages != null)
64
+ {
65
+ var adapterPackage = androidPackages.Descendants().FirstOrDefault(element => element.Name.LocalName.Equals("androidPackage")
66
+ && element.FirstAttribute.Name.LocalName.Equals("spec")
67
+ && element.FirstAttribute.Value.StartsWith("com.applovin"));
68
+ if (adapterPackage != null)
69
+ {
70
+ androidVersion = adapterPackage.FirstAttribute.Value.Split(':').Last();
71
+ // Hack alert: Some Android versions might have square brackets to force a specific version. Remove them if they are detected.
72
+ if (androidVersion.StartsWith("["))
73
+ {
74
+ androidVersion = androidVersion.Trim('[', ']');
75
+ }
76
+ }
77
+ }
78
+
79
+ var iosPods = dependenciesElement.Element("iosPods");
80
+ if (iosPods != null)
81
+ {
82
+ var adapterPod = iosPods.Descendants().FirstOrDefault(element => element.Name.LocalName.Equals("iosPod")
83
+ && element.FirstAttribute.Name.LocalName.Equals("name")
84
+ && element.FirstAttribute.Value.StartsWith("AppLovin"));
85
+ if (adapterPod != null)
86
+ {
87
+ iosVersion = adapterPod.Attributes().First(attribute => attribute.Name.LocalName.Equals("version")).Value;
88
+ }
89
+ }
90
+ }
91
+
92
+ var currentVersions = new Versions();
93
+ if (androidVersion != null && iosVersion != null)
94
+ {
95
+ currentVersions.Unity = string.Format("android_{0}_ios_{1}", androidVersion, iosVersion);
96
+ currentVersions.Android = androidVersion;
97
+ currentVersions.Ios = iosVersion;
98
+ }
99
+ else if (androidVersion != null)
100
+ {
101
+ currentVersions.Unity = string.Format("android_{0}", androidVersion);
102
+ currentVersions.Android = androidVersion;
103
+ }
104
+ else if (iosVersion != null)
105
+ {
106
+ currentVersions.Unity = string.Format("ios_{0}", iosVersion);
107
+ currentVersions.Ios = iosVersion;
108
+ }
109
+
110
+ return currentVersions;
111
+ }
112
+ }
113
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 28bb6d2b2f2049d99dc3b44815444965
3
+ timeCreated: 1746611840
@@ -361,20 +361,18 @@ namespace Amanotes.Editor
361
361
  internal static List<IronSourceSDKAdapter> IronSourceAdapter()
362
362
  {
363
363
  var listAdapter = new List<IronSourceSDKAdapter>();
364
- const string IRONSOURCE_PATH = "Assets/IronSource";
364
+ const string IRON_SOURCE_PATH = "Assets/IronSource";
365
+ const string LEVEL_PLAY_PATH = "Assets/LevelPlay";
365
366
 
366
- if (!Directory.Exists(IRONSOURCE_PATH))
367
- {
368
- return listAdapter;
369
- }
370
-
371
- string[] filesIRadapter = Directory.GetFiles(IRONSOURCE_PATH, "IS*AdapterDependencies.xml", SearchOption.AllDirectories);
367
+ var irsFiles = Directory.Exists(IRON_SOURCE_PATH) ? Directory.GetFiles(IRON_SOURCE_PATH, "IS*AdapterDependencies.xml", SearchOption.AllDirectories).ToList() : new List<string>();
368
+ var levelPlayFiles = Directory.Exists(LEVEL_PLAY_PATH) ? Directory.GetFiles(LEVEL_PLAY_PATH, "IS*AdapterDependencies.xml", SearchOption.AllDirectories).ToList() : new List<string>();
369
+
370
+ var adapterFiles = irsFiles.Concat(levelPlayFiles).ToList();
372
371
 
373
- if (filesIRadapter.Length <= 0) return listAdapter;
374
- for (var i = 0; i < filesIRadapter.Length; i++)
372
+ if (adapterFiles.Count <= 0) return listAdapter;
373
+ foreach (string filePath in adapterFiles)
375
374
  {
376
375
  var Xdoc = new XmlDocument();
377
- string filePath = filesIRadapter[i];
378
376
 
379
377
  Xdoc.Load(filePath);
380
378
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
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";
30
+ public const string VERSION = "0.2.82-alpha.1";
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",
3
+ "version": "0.2.82-alpha.1",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",