com.puzzlescapegames.admob_native 1.0.13 → 1.0.15

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.
Files changed (131) hide show
  1. package/Plugins/iOS/GADUAdNetworkExtras.h +10 -0
  2. package/{GoogleMobileAds/GoogleMobileAds.iOS.dll.meta → Plugins/iOS/GADUAdNetworkExtras.h.meta} +19 -19
  3. package/Plugins/iOS/NativeTemplates/GADTMediumTemplateView.xib +192 -0
  4. package/{GoogleMobileAds/GoogleMobileAds.Ump.Android.dll.meta → Plugins/iOS/NativeTemplates/GADTMediumTemplateView.xib.meta} +21 -21
  5. package/Plugins/iOS/NativeTemplates/GADTSmallTemplateView.xib +119 -0
  6. package/{GoogleMobileAds/GoogleMobileAds.Android.dll.meta → Plugins/iOS/NativeTemplates/GADTSmallTemplateView.xib.meta} +21 -21
  7. package/{GoogleMobileAds/Editor/Resources.meta → Plugins/iOS/NativeTemplates.meta} +1 -1
  8. package/Plugins/iOS/unity-plugin-library.a +0 -0
  9. package/{GoogleMobileAds/GoogleMobileAds.Unity.dll.meta → Plugins/iOS/unity-plugin-library.a.meta} +19 -19
  10. package/{GoogleMobileAds.meta → Plugins/iOS.meta} +1 -1
  11. package/package.json +1 -1
  12. package/GoogleMobileAds/CHANGELOG.md +0 -1517
  13. package/GoogleMobileAds/CHANGELOG.md.meta +0 -81
  14. package/GoogleMobileAds/Editor/AndroidBuildPreProcessor.cs +0 -191
  15. package/GoogleMobileAds/Editor/AndroidBuildPreProcessor.cs.meta +0 -7
  16. package/GoogleMobileAds/Editor/BuildPreProcessor.cs +0 -55
  17. package/GoogleMobileAds/Editor/BuildPreProcessor.cs.meta +0 -17
  18. package/GoogleMobileAds/Editor/EditorLocalization.cs +0 -177
  19. package/GoogleMobileAds/Editor/EditorLocalization.cs.meta +0 -17
  20. package/GoogleMobileAds/Editor/EditorLocalizationData.cs +0 -11
  21. package/GoogleMobileAds/Editor/EditorLocalizationData.cs.meta +0 -17
  22. package/GoogleMobileAds/Editor/EditorPathUtils.cs +0 -57
  23. package/GoogleMobileAds/Editor/EditorPathUtils.cs.meta +0 -17
  24. package/GoogleMobileAds/Editor/GoogleMobileAds.Editor.asmdef +0 -20
  25. package/GoogleMobileAds/Editor/GoogleMobileAds.Editor.asmdef.meta +0 -12
  26. package/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml +0 -27
  27. package/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml.meta +0 -12
  28. package/GoogleMobileAds/Editor/GoogleMobileAdsSKAdNetworkItems.xml +0 -55
  29. package/GoogleMobileAds/Editor/GoogleMobileAdsSKAdNetworkItems.xml.meta +0 -12
  30. package/GoogleMobileAds/Editor/GoogleMobileAdsSettings.cs +0 -116
  31. package/GoogleMobileAds/Editor/GoogleMobileAdsSettings.cs.meta +0 -17
  32. package/GoogleMobileAds/Editor/GoogleMobileAdsSettingsEditor.cs +0 -164
  33. package/GoogleMobileAds/Editor/GoogleMobileAdsSettingsEditor.cs.meta +0 -17
  34. package/GoogleMobileAds/Editor/GoogleUmpDependencies.xml +0 -16
  35. package/GoogleMobileAds/Editor/GoogleUmpDependencies.xml.meta +0 -12
  36. package/GoogleMobileAds/Editor/GradleProcessor.cs +0 -99
  37. package/GoogleMobileAds/Editor/GradleProcessor.cs.meta +0 -17
  38. package/GoogleMobileAds/Editor/ManifestProcessor.cs +0 -251
  39. package/GoogleMobileAds/Editor/ManifestProcessor.cs.meta +0 -17
  40. package/GoogleMobileAds/Editor/PListProcessor.cs +0 -232
  41. package/GoogleMobileAds/Editor/PListProcessor.cs.meta +0 -17
  42. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/1024x768.png +0 -0
  43. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/1024x768.png.meta +0 -103
  44. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/300x250.png +0 -0
  45. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/300x250.png.meta +0 -103
  46. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/320x100.png +0 -0
  47. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/320x100.png.meta +0 -103
  48. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/320x480.png +0 -0
  49. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/320x480.png.meta +0 -103
  50. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/320x50.png +0 -0
  51. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/320x50.png.meta +0 -103
  52. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/468x60.png +0 -0
  53. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/468x60.png.meta +0 -103
  54. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/480x320.png +0 -0
  55. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/480x320.png.meta +0 -103
  56. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/728x90.png +0 -0
  57. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/728x90.png.meta +0 -103
  58. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/768x1024.png +0 -0
  59. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/768x1024.png.meta +0 -103
  60. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/AdInspectorHome.png +0 -0
  61. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/AdInspectorHome.png.meta +0 -131
  62. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages.meta +0 -8
  63. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdInspector/768x1024.prefab +0 -504
  64. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdInspector/768x1024.prefab.meta +0 -12
  65. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdInspector.meta +0 -8
  66. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AppOpen/1024x768.prefab +0 -472
  67. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AppOpen/1024x768.prefab.meta +0 -12
  68. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AppOpen/768x1024.prefab +0 -472
  69. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AppOpen/768x1024.prefab.meta +0 -12
  70. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AppOpen.meta +0 -8
  71. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/ADAPTIVE.prefab +0 -292
  72. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/ADAPTIVE.prefab.meta +0 -13
  73. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/BANNER.prefab +0 -217
  74. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/BANNER.prefab.meta +0 -13
  75. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/CENTER.prefab +0 -292
  76. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/CENTER.prefab.meta +0 -13
  77. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/FULL_BANNER.prefab +0 -217
  78. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/FULL_BANNER.prefab.meta +0 -13
  79. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/LARGE_BANNER.prefab +0 -217
  80. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/LARGE_BANNER.prefab.meta +0 -13
  81. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/LEADERBOARD.prefab +0 -217
  82. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/LEADERBOARD.prefab.meta +0 -13
  83. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/MEDIUM_RECTANGLE.prefab +0 -217
  84. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/MEDIUM_RECTANGLE.prefab.meta +0 -13
  85. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/SMART_BANNER.prefab +0 -292
  86. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/SMART_BANNER.prefab.meta +0 -13
  87. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners.meta +0 -8
  88. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Interstitials/1024x768.prefab +0 -472
  89. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Interstitials/1024x768.prefab.meta +0 -13
  90. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Interstitials/768x1024.prefab +0 -472
  91. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Interstitials/768x1024.prefab.meta +0 -13
  92. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Interstitials.meta +0 -8
  93. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Rewarded/1024x768.prefab +0 -547
  94. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Rewarded/1024x768.prefab.meta +0 -13
  95. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Rewarded/768x1024.prefab +0 -547
  96. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Rewarded/768x1024.prefab.meta +0 -13
  97. package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Rewarded.meta +0 -8
  98. package/GoogleMobileAds/Editor/Resources/PlaceholderAds.meta +0 -8
  99. package/GoogleMobileAds/Editor/Resources/Ump/ConsentForm.png +0 -0
  100. package/GoogleMobileAds/Editor/Resources/Ump/ConsentForm.png.meta +0 -145
  101. package/GoogleMobileAds/Editor/Resources/Ump/ConsentForm.prefab +0 -525
  102. package/GoogleMobileAds/Editor/Resources/Ump/ConsentForm.prefab.meta +0 -12
  103. package/GoogleMobileAds/Editor/Resources/Ump.meta +0 -8
  104. package/GoogleMobileAds/Editor/Utils.cs +0 -91
  105. package/GoogleMobileAds/Editor/Utils.cs.meta +0 -17
  106. package/GoogleMobileAds/Editor.meta +0 -8
  107. package/GoogleMobileAds/GoogleMobileAds.Android.dll +0 -0
  108. package/GoogleMobileAds/GoogleMobileAds.Common.dll +0 -0
  109. package/GoogleMobileAds/GoogleMobileAds.Common.dll.meta +0 -11
  110. package/GoogleMobileAds/GoogleMobileAds.Core.dll +0 -0
  111. package/GoogleMobileAds/GoogleMobileAds.Core.dll.meta +0 -11
  112. package/GoogleMobileAds/GoogleMobileAds.Ump.Android.dll +0 -0
  113. package/GoogleMobileAds/GoogleMobileAds.Ump.Unity.dll +0 -0
  114. package/GoogleMobileAds/GoogleMobileAds.Ump.Unity.dll.meta +0 -81
  115. package/GoogleMobileAds/GoogleMobileAds.Ump.dll +0 -0
  116. package/GoogleMobileAds/GoogleMobileAds.Ump.dll.meta +0 -11
  117. package/GoogleMobileAds/GoogleMobileAds.Ump.iOS.dll +0 -0
  118. package/GoogleMobileAds/GoogleMobileAds.Ump.iOS.dll.meta +0 -81
  119. package/GoogleMobileAds/GoogleMobileAds.Unity.dll +0 -0
  120. package/GoogleMobileAds/GoogleMobileAds.dll +0 -0
  121. package/GoogleMobileAds/GoogleMobileAds.dll.meta +0 -11
  122. package/GoogleMobileAds/GoogleMobileAds.iOS.dll +0 -0
  123. package/GoogleMobileAds/GoogleMobileAds_version-10.7.0_manifest.txt +0 -78
  124. package/GoogleMobileAds/GoogleMobileAds_version-10.7.0_manifest.txt.meta +0 -10
  125. package/GoogleMobileAds/LICENSE +0 -202
  126. package/GoogleMobileAds/LICENSE.meta +0 -81
  127. package/GoogleMobileAds/Resources/gma_settings_editor_localization_data.json +0 -72
  128. package/GoogleMobileAds/Resources/gma_settings_editor_localization_data.json.meta +0 -12
  129. package/GoogleMobileAds/Resources.meta +0 -8
  130. package/GoogleMobileAds/link.xml +0 -18
  131. package/GoogleMobileAds/link.xml.meta +0 -11
@@ -1,81 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: 161c4904cd2045a1bf046453a58a9d7b
3
- labels:
4
- - gvh
5
- - gvh_version-10.7.0
6
- - gvhp_exportpath-GoogleMobileAds/CHANGELOG.md
7
- timeCreated: 1480838400
8
- PluginImporter:
9
- serializedVersion: 1
10
- iconMap: {}
11
- executionOrder: {}
12
- isPreloaded: 0
13
- platformData:
14
- Android:
15
- enabled: 0
16
- settings:
17
- CPU: AnyCPU
18
- Any:
19
- enabled: 0
20
- settings: {}
21
- Editor:
22
- enabled: 0
23
- settings:
24
- CPU: AnyCPU
25
- DefaultValueInitialized: true
26
- OS: AnyOS
27
- Linux:
28
- enabled: 0
29
- settings:
30
- CPU: None
31
- Linux64:
32
- enabled: 0
33
- settings:
34
- CPU: None
35
- LinuxUniversal:
36
- enabled: 0
37
- settings:
38
- CPU: None
39
- OSXIntel:
40
- enabled: 0
41
- settings:
42
- CPU: None
43
- OSXIntel64:
44
- enabled: 0
45
- settings:
46
- CPU: None
47
- OSXUniversal:
48
- enabled: 0
49
- settings:
50
- CPU: None
51
- Web:
52
- enabled: 0
53
- settings: {}
54
- WebStreamed:
55
- enabled: 0
56
- settings: {}
57
- Win:
58
- enabled: 0
59
- settings:
60
- CPU: None
61
- Win64:
62
- enabled: 0
63
- settings:
64
- CPU: None
65
- WindowsStoreApps:
66
- enabled: 0
67
- settings:
68
- CPU: AnyCPU
69
- iOS:
70
- enabled: 0
71
- settings:
72
- CompileFlags:
73
- FrameworkDependencies:
74
- tvOS:
75
- enabled: 0
76
- settings:
77
- CompileFlags:
78
- FrameworkDependencies:
79
- userData:
80
- assetBundleName:
81
- assetBundleVariant:
@@ -1,191 +0,0 @@
1
- #if UNITY_ANDROID
2
- #if UNITY_2022 || UNITY_2021_3_58 || UNITY_2021_3_57 || UNITY_2021_3_56 || UNITY_2021_3_55 || UNITY_2021_3_54 || UNITY_2021_3_53 || UNITY_2021_3_52 || UNITY_2021_3_51 || UNITY_2021_3_50 || UNITY_2021_3_49 || UNITY_2021_3_48 || UNITY_2021_3_47 || UNITY_2021_3_46 || UNITY_2021_3_45 || UNITY_2021_3_44 || UNITY_2021_3_43 || UNITY_2021_3_42 || UNITY_2021_3_41
3
- // 2021.3.41f1+ Gradle version 7.5.1+
4
- // https://docs.unity3d.com/2021.3/Documentation/Manual/android-gradle-overview.html
5
- #define ANDROID_GRADLE_BUILD_JETIFIER_ENTRY_ENABLED
6
- #endif
7
-
8
- #if UNITY_6000_0_OR_NEWER || UNITY_2023 || ANDROID_GRADLE_BUILD_JETIFIER_ENTRY_ENABLED
9
- #define ANDROID_GRADLE_BUILD_PRE_PROCESSOR_ENABLED
10
- #endif
11
-
12
- using System;
13
- using UnityEngine;
14
- using UnityEditor;
15
- using System.IO;
16
- using GooglePlayServices;
17
- using UnityEditor.Build;
18
- using UnityEditor.Build.Reporting;
19
-
20
- namespace GoogleMobileAds.Editor
21
- {
22
- /// <summary>
23
- /// This script will verify and configure your Android build settings to be compatible
24
- /// with the Google Mobile Ads SDK. This includes:
25
- /// - Verify the Android Google Mobile Ads app ID is set.
26
- /// - Throw an exception if the Android Google Mobile Ads app ID is not set.
27
- /// - Set minimum API level to 23 (the target API level may be automatically set, we should not
28
- /// hardcode it).
29
- /// - Enable Custom Main Gradle Template.
30
- /// - Update Custom Main Gradle Template with dependencies using the Play Services Resolver.
31
- /// - Enable Custom Gradle Properties Template.
32
- /// - Update Custom Gradle Properties Template with the Jetifier Ignorelist.
33
- /// </summary>
34
- public class AndroidBuildPreProcessor : IPreprocessBuildWithReport
35
- {
36
- const int MinimumAPILevel = 23;
37
- const string CustomGradlePropertiesTemplatesFileName = "gradleTemplate.properties";
38
- const string CustomMainGradleTemplateFileName = "mainTemplate.gradle";
39
- const string JetifierEntry =
40
- "android.jetifier.ignorelist=annotation-experimental-1.4.0.aar";
41
-
42
- // Set the callback order to be before EDM4U.
43
- // https://github.com/googlesamples/unity-jar-resolver/blob/master/source/AndroidResolver/src/PlayServicesPreBuild.cs#L39
44
- public int callbackOrder { get { return -1; } }
45
-
46
- public void OnPreprocessBuild(BuildReport report)
47
- {
48
- if(!GoogleMobileAdsSettings.LoadInstance().EnableGradleBuildPreProcessor)
49
- {
50
- return;
51
- }
52
- // For more details see, https://developers.google.com/admob/unity/android
53
- #if ANDROID_GRADLE_BUILD_PRE_PROCESSOR_ENABLED
54
- ApplyBuildSettings(report);
55
- #endif
56
- }
57
-
58
- private void ApplyBuildSettings(BuildReport report)
59
- {
60
- Debug.Log("Running Android Gradle Build Pre-Processor.");
61
-
62
- // Set Minimum Api Level.
63
- if (PlayerSettings.Android.minSdkVersion < (AndroidSdkVersions)MinimumAPILevel)
64
- {
65
- PlayerSettings.Android.minSdkVersion = (AndroidSdkVersions)MinimumAPILevel;
66
- Debug.Log($"Set minimum API Level to: {MinimumAPILevel}.");
67
- }
68
- else
69
- {
70
- Debug.Log($"Verified Minimum API Level is >= {MinimumAPILevel}.");
71
- }
72
-
73
- // Create Assets/Plugins folder.
74
- if (!AssetDatabase.IsValidFolder(Path.Combine("Assets", "Plugins")))
75
- {
76
- AssetDatabase.CreateFolder("Assets", "Plugins");
77
- AssetDatabase.Refresh();
78
- }
79
-
80
- // Create Assets/Plugins/Android folder.
81
- if (!AssetDatabase.IsValidFolder(Path.Combine("Assets", "Plugins", "Android")))
82
- {
83
- AssetDatabase.CreateFolder(Path.Combine("Assets", "Plugins"), "Android");
84
- AssetDatabase.Refresh();
85
- }
86
-
87
- // Ensure Custom Main Gradle Template.
88
- EnsureGradleFileExists(CustomMainGradleTemplateFileName);
89
-
90
- // Ensure Custom Gradle Properties Templates.
91
- EnsureGradleFileExists(CustomGradlePropertiesTemplatesFileName);
92
-
93
- #if ANDROID_GRADLE_BUILD_JETIFIER_ENTRY_ENABLED
94
- string customGradlePropertiesTemplatesFilePath = Path.Combine(
95
- Application.dataPath,
96
- "Plugins", "Android",
97
- CustomGradlePropertiesTemplatesFileName);
98
- if (File.Exists(customGradlePropertiesTemplatesFilePath))
99
- {
100
- var gradlePropertiesFileContent =
101
- File.ReadAllText(customGradlePropertiesTemplatesFilePath);
102
- if (!gradlePropertiesFileContent.Contains(JetifierEntry))
103
- {
104
- File.AppendAllText(
105
- customGradlePropertiesTemplatesFilePath,
106
- Environment.NewLine + JetifierEntry);
107
- Debug.Log($"Added Jetifier Entry.");
108
- }
109
- else
110
- {
111
- Debug.Log($"Verified Jetifier Entry exists.");
112
- }
113
- }
114
- else
115
- {
116
- Debug.LogError("Failed to add Jetifier Entry.");
117
- }
118
- #endif
119
-
120
- Debug.Log("Resolving Android Gradle dependencies.");
121
- PlayServicesResolver.ResolveSync(true);
122
- Debug.Log("Android Build Pre-Processor finished.");
123
- }
124
-
125
- /// <summary>
126
- /// Ensures that the given Gradle file exists.
127
- /// </summary>
128
- /// <param name="fileName">name of the given Gradle file.</param>
129
- private void EnsureGradleFileExists(string fileName)
130
- {
131
- bool foundTargetFile = false;
132
- bool foundDisabledFile = false;
133
-
134
- // Check for target file.
135
- string targetPath = Path.Combine(Application.dataPath, "Plugins", "Android", fileName);
136
- if (File.Exists(targetPath))
137
- {
138
- foundTargetFile = true;
139
- }
140
-
141
- // Check for the ".DISABLED" file.
142
- string disabledPath = Path.Combine(Application.dataPath, "Plugins", "Android",
143
- $"{fileName}.DISABLED");
144
- if (File.Exists(disabledPath))
145
- {
146
- foundDisabledFile = true;
147
- }
148
-
149
- // If DISABLED and target exist, delete DISABLED.
150
- if (foundTargetFile && foundDisabledFile)
151
- {
152
- File.Delete(disabledPath);
153
- Debug.Log($"Removed disabled {fileName}.");
154
- return;
155
- }
156
- // If DISABLED exists, move it to target.
157
- if (foundDisabledFile)
158
- {
159
- File.Move(disabledPath, targetPath);
160
- AssetDatabase.Refresh();
161
- Debug.Log($"Enabled {fileName}.");
162
- return;
163
- }
164
- // If target exists, return true.
165
- if (foundTargetFile)
166
- {
167
- Debug.Log($"Verified {fileName}.");
168
- return;
169
- }
170
-
171
- // If target does not exist, create it from source.
172
- var unityGradleTemplateDirectory = Path.Combine(
173
- PlayServicesResolver.AndroidPlaybackEngineDirectory,
174
- "Tools",
175
- "GradleTemplates");
176
- string sourceFileName = Path.Combine(unityGradleTemplateDirectory, fileName);
177
- if (!File.Exists(sourceFileName))
178
- {
179
- throw new BuildFailedException(
180
- "Android Build Pre-Processor failed. "+
181
- $"Unable to find source {sourceFileName}. Is your file system read-only?" +
182
- "If this issue persists, contact Google Mobile Ads Support "+
183
- "at https://developers.google.com/admob/support");
184
- }
185
- File.Copy(sourceFileName, targetPath);
186
- AssetDatabase.Refresh();
187
- Debug.Log($"Created {fileName}.");
188
- }
189
- }
190
- }
191
- #endif
@@ -1,7 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: c0080e86890c24abba53b3f4d2daf6db
3
- labels:
4
- - gvh
5
- - gvh_version-10.7.0
6
- - gvhp_exportpath-GoogleMobileAds/Editor/AndroidBuildPreProcessor.cs
7
- timeCreated: 1480838400
@@ -1,55 +0,0 @@
1
- using System;
2
- using UnityEngine;
3
- using UnityEditor;
4
- using System.IO;
5
- using GooglePlayServices;
6
- using UnityEditor.Build;
7
- using UnityEditor.Build.Reporting;
8
-
9
- namespace GoogleMobileAds.Editor
10
- {
11
- /// <summary>
12
- /// Pre-processor that performs common setup tasks for all platforms before a build.
13
- /// </summary>
14
- public class BuildPreProcessor : IPreprocessBuildWithReport
15
- {
16
- // Set the callback order to be before EDM4U.
17
- // https://github.com/googlesamples/unity-jar-resolver/blob/master/source/AndroidResolver/src/PlayServicesPreBuild.cs#L39
18
- public int callbackOrder { get { return -1; } }
19
-
20
- private readonly static string _linkXmlAssetsPath =
21
- Path.Combine(Application.dataPath, "GoogleMobileAds", "link.xml");
22
-
23
- public void OnPreprocessBuild(BuildReport report)
24
- {
25
- // Unity's managed code stripping process does not inherently process `link.xml` files
26
- // in UPM packages. This pre-processor copies the `link.xml` file from the UPM package
27
- // to the Unity project's `Assets/GoogleMobileAds` directory if it does not exist.
28
- if (!File.Exists(_linkXmlAssetsPath))
29
- {
30
- CopyLinkXml();
31
- }
32
- }
33
-
34
- private static void CopyLinkXml()
35
- {
36
- if (!AssetDatabase.IsValidFolder(Path.Combine("Assets", "GoogleMobileAds")))
37
- {
38
- AssetDatabase.CreateFolder("Assets", "GoogleMobileAds");
39
- }
40
- var pathUtils = ScriptableObject.CreateInstance<EditorPathUtils>();
41
- if (pathUtils.IsPackageRootPath())
42
- {
43
- string parentDirectoryPath = pathUtils.GetParentDirectoryAssetPath();
44
- string linkXmlPackagePath = Path.Combine(parentDirectoryPath, "link.xml");
45
- if(String.IsNullOrEmpty(linkXmlPackagePath))
46
- {
47
- Debug.LogWarning("link.xml not found in the package.");
48
- return;
49
- }
50
- AssetDatabase.CopyAsset(linkXmlPackagePath, _linkXmlAssetsPath);
51
- }
52
- AssetDatabase.Refresh();
53
- }
54
- }
55
- }
@@ -1,17 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: 79760efe9b6bb4736aa4ffd869e2ed0c
3
- labels:
4
- - gvh
5
- - gvh_version-10.7.0
6
- - gvhp_exportpath-GoogleMobileAds/Editor/BuildPreProcessor.cs
7
- timeCreated: 1480838400
8
- MonoImporter:
9
- externalObjects: {}
10
- serializedVersion: 2
11
- defaultReferences: []
12
- executionOrder: 0
13
- icon:
14
- instanceID: 0
15
- userData:
16
- assetBundleName:
17
- assetBundleVariant:
@@ -1,177 +0,0 @@
1
- using System;
2
- using System.Text.RegularExpressions;
3
- using System.Collections.Generic;
4
- using System.IO;
5
- using UnityEditor;
6
- using UnityEngine;
7
-
8
- namespace GoogleMobileAds.Editor
9
- {
10
- public class EditorLocalization
11
- {
12
- private const string LOCALIZATION_DATA_JSON_RELATIVE_PATH = "GoogleMobileAds/Editor";
13
- private const string LOCALIZATION_DATA_JSON_FILENAME =
14
- "gma_settings_editor_localization_data.json";
15
- private const string LOCALIZATIONS_JSON_KEY = "LocalizationsByKey";
16
- private const string LOCALIZATION_KEY_PREFIX = "KEY_";
17
-
18
- private readonly Lazy<EditorLocalizationData> _localizationData =
19
- new Lazy<EditorLocalizationData>(() => InitLocalizationDataOrThrow());
20
- private EditorLocalizationData GetLocalizationData() => _localizationData.Value;
21
-
22
- /**
23
- * Gets the default language for the settings editor.
24
- * We assume the default locale used belong to the list of supported cultures
25
- * (https://www.csharp-examples.net/culture-names/), and that each key has a default
26
- * localization provided.
27
- */
28
- public string GetDefaultLanguage()
29
- {
30
- return "en"; // English
31
- }
32
-
33
- /**
34
- * Checks that a localization key exists.
35
- */
36
- public bool HasKey(string key)
37
- {
38
- return GetLocalizationData().LocalizationsByKey.ContainsKey(key);
39
- }
40
-
41
- /**
42
- * Localizes a resource key based on a provided user language.
43
- * Returns the key name if the key could not be localized.
44
- */
45
- public string ForKey(string key)
46
- {
47
- key = key.ToUpper();
48
- // Accept both key syntaxes.
49
- if (key.StartsWith(LOCALIZATION_KEY_PREFIX))
50
- key = key.Replace(LOCALIZATION_KEY_PREFIX, "");
51
-
52
- if (GetLocalizationData().LocalizationsByKey.TryGetValue(key,
53
- out Dictionary<string, string> localizations))
54
- {
55
- // Key was found. Try to localize the key with the user language (e.g., "en" or "fr").
56
- // Else, use the default (fallback) language, if the localization key is missing for
57
- // the chosen language (or no language was selected).
58
- // The region is omitted purposely as we don't currently require this level of details.
59
- string userLanguage = GoogleMobileAdsSettings.LoadInstance().UserLanguage;
60
- if (localizations == null)
61
- {
62
- return null;
63
- }
64
- bool userLanguageExists = localizations.TryGetValue(userLanguage,
65
- out string userLocalization);
66
- bool userLocalizationIsValid = userLanguageExists &&
67
- !string.IsNullOrEmpty(userLocalization);
68
- return userLocalizationIsValid ? userLocalization: localizations[GetDefaultLanguage()];
69
- }
70
-
71
- // Error, key not found, no localization to return so let's fallback to the key name
72
- // to provide some sort of indication in the UI.
73
- Debug.LogError($"Localization key not found: {key}.");
74
- return key;
75
- }
76
-
77
- /**
78
- * Deserializes the localization data, encoded in json.
79
- * Returns the json deserialized to a EditorLocalizationData class instance.
80
- * Throws an ArgumentException if the json file cannot be deserialized.
81
- */
82
- private static EditorLocalizationData InitLocalizationDataOrThrow()
83
- {
84
- try
85
- {
86
- var localization = FindLocalization();
87
- string json = localization.text;
88
- var data = DeserializeFromJson(json);
89
- if (data.LocalizationsByKey == null)
90
- {
91
- throw new ArgumentNullException("LocalizationsByKey");
92
- }
93
- return data;
94
- }
95
- catch (Exception)
96
- {
97
- throw new ArgumentException(
98
- $"Exception thrown while retrieving localization data");
99
- }
100
- }
101
-
102
- private static TextAsset FindLocalization()
103
- {
104
- const string exactName = "gma_settings_editor_localization_data.json";
105
-
106
- var guids = AssetDatabase.FindAssets("gma_settings_editor_localization_data t:TextAsset");
107
- foreach (var guid in guids)
108
- {
109
- var path = AssetDatabase.GUIDToAssetPath(guid);
110
- if (path.EndsWith("/" + exactName))
111
- return AssetDatabase.LoadAssetAtPath<TextAsset>(path);
112
- }
113
- return null;
114
- }
115
-
116
- // We would like to handle the deserialization of the JSON file referenced above but without
117
- // leveraging any JSON library to avoid adding any dependency.
118
- private static EditorLocalizationData DeserializeFromJson(string json)
119
- {
120
- var data = new EditorLocalizationData();
121
- data.LocalizationsByKey = new Dictionary<string, Dictionary<string, string>>();
122
- // We match every field in the JSON. The order in which those matches are found is used to
123
- // deserialize the localization values.
124
- var regex = new Regex(@"""(?<val>[^""]+)""");
125
- var matches = regex.Matches(json);
126
- var currentKeys = new List<string>();
127
- var valueProcessed = false;
128
- foreach (Match match in matches)
129
- {
130
- var val = match.Groups["val"].Value;
131
- if (val.Equals(LOCALIZATIONS_JSON_KEY))
132
- {
133
- currentKeys.Clear();
134
- continue;
135
- }
136
-
137
- if (valueProcessed)
138
- {
139
- valueProcessed = false;
140
- if (val.StartsWith(LOCALIZATION_KEY_PREFIX))
141
- {
142
- // Start a new level.
143
- currentKeys.Clear();
144
- }
145
- else if (currentKeys.Count > 0)
146
- {
147
- // Go up one level by removing the latest key.
148
- currentKeys.RemoveAt(currentKeys.Count - 1);
149
- }
150
- }
151
-
152
- // The localization values are 2 levels deep.
153
- if (currentKeys.Count < 2)
154
- {
155
- currentKeys.Add(val);
156
- continue;
157
- }
158
-
159
- ProcessValue(data, currentKeys, val);
160
- valueProcessed = true;
161
- }
162
-
163
- return data;
164
- }
165
-
166
- private static void ProcessValue(EditorLocalizationData data, List<string> currentKeys,
167
- string val)
168
- {
169
- if (currentKeys.Count != 2)
170
- return;
171
- currentKeys[0] = currentKeys[0].Replace(LOCALIZATION_KEY_PREFIX, "");
172
- if (!data.LocalizationsByKey.ContainsKey(currentKeys[0]))
173
- data.LocalizationsByKey[currentKeys[0]] = new Dictionary<string, string>();
174
- data.LocalizationsByKey[currentKeys[0]][currentKeys[1]] = val;
175
- }
176
- }
177
- }
@@ -1,17 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: 1a843cb3b999a40ea9babd1f69e1232f
3
- labels:
4
- - gvh
5
- - gvh_version-10.7.0
6
- - gvhp_exportpath-GoogleMobileAds/Editor/EditorLocalization.cs
7
- timeCreated: 1480838400
8
- MonoImporter:
9
- externalObjects: {}
10
- serializedVersion: 2
11
- defaultReferences: []
12
- executionOrder: 0
13
- icon:
14
- instanceID: 0
15
- userData:
16
- assetBundleName:
17
- assetBundleVariant:
@@ -1,11 +0,0 @@
1
- using System.Collections.Generic;
2
-
3
- namespace GoogleMobileAds.Editor
4
- {
5
- public class EditorLocalizationData
6
- {
7
- // First key: the localization key. Second key: the language to lookup. Value: the resulting
8
- // localization.
9
- public Dictionary<string, Dictionary<string, string>> LocalizationsByKey { get; set; }
10
- }
11
- }
@@ -1,17 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: e7aaa882f59b8405d97e3042283cc034
3
- labels:
4
- - gvh
5
- - gvh_version-10.7.0
6
- - gvhp_exportpath-GoogleMobileAds/Editor/EditorLocalizationData.cs
7
- timeCreated: 1480838400
8
- MonoImporter:
9
- externalObjects: {}
10
- serializedVersion: 2
11
- defaultReferences: []
12
- executionOrder: 0
13
- icon:
14
- instanceID: 0
15
- userData:
16
- assetBundleName:
17
- assetBundleVariant:
@@ -1,57 +0,0 @@
1
- // Copyright (C) 2023 Google LLC
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- using System.IO;
16
- using UnityEditor;
17
- using UnityEngine;
18
-
19
- /*
20
- * EditorPathUtils class finds and processes the AssetPath for
21
- * EditorPathUtils.cs within unity asset database.
22
- */
23
- public class EditorPathUtils : ScriptableObject
24
- {
25
- /*
26
- * Returns the asset path of EditorPathUtils.cs
27
- */
28
- private string GetFilePath()
29
- {
30
- return AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this));
31
- }
32
-
33
- /*
34
- * Returns the asset directory path of EditorPathUtils.cs
35
- */
36
- public string GetDirectoryAssetPath()
37
- {
38
- return Path.GetDirectoryName(GetFilePath());
39
- }
40
-
41
- /*
42
- * Returns the parent asset directory path of EditorPathUtils.cs
43
- */
44
- public string GetParentDirectoryAssetPath()
45
- {
46
- return Path.GetDirectoryName(GetDirectoryAssetPath());
47
- }
48
-
49
- /*
50
- * Returns true if GMA import is done via unity package manager,
51
- * false otherwise.
52
- */
53
- public bool IsPackageRootPath()
54
- {
55
- return GetFilePath().StartsWith("Packages");
56
- }
57
- }
@@ -1,17 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: e1f0097ebfa3e416197e298c9135b6de
3
- labels:
4
- - gvh
5
- - gvh_version-10.7.0
6
- - gvhp_exportpath-GoogleMobileAds/Editor/EditorPathUtils.cs
7
- timeCreated: 1480838400
8
- MonoImporter:
9
- externalObjects: {}
10
- serializedVersion: 2
11
- defaultReferences: []
12
- executionOrder: 0
13
- icon:
14
- instanceID: 0
15
- userData:
16
- assetBundleName:
17
- assetBundleVariant:
@@ -1,20 +0,0 @@
1
- {
2
- "name": "GoogleMobileAds.Editor",
3
- "references": [
4
- "GoogleMobileAds",
5
- "GoogleMobileAds.Core",
6
- "GoogleMobileAds.Placement",
7
- "GoogleMobileAds.Placement.Core"
8
- ],
9
- "includePlatforms": [
10
- "Editor"
11
- ],
12
- "excludePlatforms": [],
13
- "allowUnsafeCode": false,
14
- "overrideReferences": false,
15
- "precompiledReferences": [],
16
- "autoReferenced": true,
17
- "defineConstraints": [],
18
- "versionDefines": [],
19
- "noEngineReferences": false
20
- }
@@ -1,12 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: cbb42e4cfd9484f52972c8f05e1c3252
3
- labels:
4
- - gvh
5
- - gvh_version-10.7.0
6
- - gvhp_exportpath-GoogleMobileAds/Editor/GoogleMobileAds.Editor.asmdef
7
- timeCreated: 1480838400
8
- AssemblyDefinitionImporter:
9
- externalObjects: {}
10
- userData:
11
- assetBundleName:
12
- assetBundleVariant: