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.
- package/Plugins/iOS/GADUAdNetworkExtras.h +10 -0
- package/{GoogleMobileAds/GoogleMobileAds.iOS.dll.meta → Plugins/iOS/GADUAdNetworkExtras.h.meta} +19 -19
- package/Plugins/iOS/NativeTemplates/GADTMediumTemplateView.xib +192 -0
- package/{GoogleMobileAds/GoogleMobileAds.Ump.Android.dll.meta → Plugins/iOS/NativeTemplates/GADTMediumTemplateView.xib.meta} +21 -21
- package/Plugins/iOS/NativeTemplates/GADTSmallTemplateView.xib +119 -0
- package/{GoogleMobileAds/GoogleMobileAds.Android.dll.meta → Plugins/iOS/NativeTemplates/GADTSmallTemplateView.xib.meta} +21 -21
- package/{GoogleMobileAds/Editor/Resources.meta → Plugins/iOS/NativeTemplates.meta} +1 -1
- package/Plugins/iOS/unity-plugin-library.a +0 -0
- package/{GoogleMobileAds/GoogleMobileAds.Unity.dll.meta → Plugins/iOS/unity-plugin-library.a.meta} +19 -19
- package/{GoogleMobileAds.meta → Plugins/iOS.meta} +1 -1
- package/package.json +1 -1
- package/GoogleMobileAds/CHANGELOG.md +0 -1517
- package/GoogleMobileAds/CHANGELOG.md.meta +0 -81
- package/GoogleMobileAds/Editor/AndroidBuildPreProcessor.cs +0 -191
- package/GoogleMobileAds/Editor/AndroidBuildPreProcessor.cs.meta +0 -7
- package/GoogleMobileAds/Editor/BuildPreProcessor.cs +0 -55
- package/GoogleMobileAds/Editor/BuildPreProcessor.cs.meta +0 -17
- package/GoogleMobileAds/Editor/EditorLocalization.cs +0 -177
- package/GoogleMobileAds/Editor/EditorLocalization.cs.meta +0 -17
- package/GoogleMobileAds/Editor/EditorLocalizationData.cs +0 -11
- package/GoogleMobileAds/Editor/EditorLocalizationData.cs.meta +0 -17
- package/GoogleMobileAds/Editor/EditorPathUtils.cs +0 -57
- package/GoogleMobileAds/Editor/EditorPathUtils.cs.meta +0 -17
- package/GoogleMobileAds/Editor/GoogleMobileAds.Editor.asmdef +0 -20
- package/GoogleMobileAds/Editor/GoogleMobileAds.Editor.asmdef.meta +0 -12
- package/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml +0 -27
- package/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml.meta +0 -12
- package/GoogleMobileAds/Editor/GoogleMobileAdsSKAdNetworkItems.xml +0 -55
- package/GoogleMobileAds/Editor/GoogleMobileAdsSKAdNetworkItems.xml.meta +0 -12
- package/GoogleMobileAds/Editor/GoogleMobileAdsSettings.cs +0 -116
- package/GoogleMobileAds/Editor/GoogleMobileAdsSettings.cs.meta +0 -17
- package/GoogleMobileAds/Editor/GoogleMobileAdsSettingsEditor.cs +0 -164
- package/GoogleMobileAds/Editor/GoogleMobileAdsSettingsEditor.cs.meta +0 -17
- package/GoogleMobileAds/Editor/GoogleUmpDependencies.xml +0 -16
- package/GoogleMobileAds/Editor/GoogleUmpDependencies.xml.meta +0 -12
- package/GoogleMobileAds/Editor/GradleProcessor.cs +0 -99
- package/GoogleMobileAds/Editor/GradleProcessor.cs.meta +0 -17
- package/GoogleMobileAds/Editor/ManifestProcessor.cs +0 -251
- package/GoogleMobileAds/Editor/ManifestProcessor.cs.meta +0 -17
- package/GoogleMobileAds/Editor/PListProcessor.cs +0 -232
- package/GoogleMobileAds/Editor/PListProcessor.cs.meta +0 -17
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/1024x768.png +0 -0
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/1024x768.png.meta +0 -103
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/300x250.png +0 -0
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/300x250.png.meta +0 -103
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/320x100.png +0 -0
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/320x100.png.meta +0 -103
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/320x480.png +0 -0
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/320x480.png.meta +0 -103
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/320x50.png +0 -0
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/320x50.png.meta +0 -103
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/468x60.png +0 -0
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/468x60.png.meta +0 -103
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/480x320.png +0 -0
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/480x320.png.meta +0 -103
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/728x90.png +0 -0
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/728x90.png.meta +0 -103
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/768x1024.png +0 -0
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/768x1024.png.meta +0 -103
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/AdInspectorHome.png +0 -0
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/AdInspectorHome.png.meta +0 -131
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages.meta +0 -8
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdInspector/768x1024.prefab +0 -504
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdInspector/768x1024.prefab.meta +0 -12
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AdInspector.meta +0 -8
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AppOpen/1024x768.prefab +0 -472
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AppOpen/1024x768.prefab.meta +0 -12
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AppOpen/768x1024.prefab +0 -472
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AppOpen/768x1024.prefab.meta +0 -12
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/AppOpen.meta +0 -8
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/ADAPTIVE.prefab +0 -292
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/ADAPTIVE.prefab.meta +0 -13
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/BANNER.prefab +0 -217
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/BANNER.prefab.meta +0 -13
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/CENTER.prefab +0 -292
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/CENTER.prefab.meta +0 -13
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/FULL_BANNER.prefab +0 -217
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/FULL_BANNER.prefab.meta +0 -13
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/LARGE_BANNER.prefab +0 -217
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/LARGE_BANNER.prefab.meta +0 -13
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/LEADERBOARD.prefab +0 -217
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/LEADERBOARD.prefab.meta +0 -13
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/MEDIUM_RECTANGLE.prefab +0 -217
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/MEDIUM_RECTANGLE.prefab.meta +0 -13
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/SMART_BANNER.prefab +0 -292
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners/SMART_BANNER.prefab.meta +0 -13
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Banners.meta +0 -8
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Interstitials/1024x768.prefab +0 -472
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Interstitials/1024x768.prefab.meta +0 -13
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Interstitials/768x1024.prefab +0 -472
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Interstitials/768x1024.prefab.meta +0 -13
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Interstitials.meta +0 -8
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Rewarded/1024x768.prefab +0 -547
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Rewarded/1024x768.prefab.meta +0 -13
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Rewarded/768x1024.prefab +0 -547
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Rewarded/768x1024.prefab.meta +0 -13
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds/Rewarded.meta +0 -8
- package/GoogleMobileAds/Editor/Resources/PlaceholderAds.meta +0 -8
- package/GoogleMobileAds/Editor/Resources/Ump/ConsentForm.png +0 -0
- package/GoogleMobileAds/Editor/Resources/Ump/ConsentForm.png.meta +0 -145
- package/GoogleMobileAds/Editor/Resources/Ump/ConsentForm.prefab +0 -525
- package/GoogleMobileAds/Editor/Resources/Ump/ConsentForm.prefab.meta +0 -12
- package/GoogleMobileAds/Editor/Resources/Ump.meta +0 -8
- package/GoogleMobileAds/Editor/Utils.cs +0 -91
- package/GoogleMobileAds/Editor/Utils.cs.meta +0 -17
- package/GoogleMobileAds/Editor.meta +0 -8
- package/GoogleMobileAds/GoogleMobileAds.Android.dll +0 -0
- package/GoogleMobileAds/GoogleMobileAds.Common.dll +0 -0
- package/GoogleMobileAds/GoogleMobileAds.Common.dll.meta +0 -11
- package/GoogleMobileAds/GoogleMobileAds.Core.dll +0 -0
- package/GoogleMobileAds/GoogleMobileAds.Core.dll.meta +0 -11
- package/GoogleMobileAds/GoogleMobileAds.Ump.Android.dll +0 -0
- package/GoogleMobileAds/GoogleMobileAds.Ump.Unity.dll +0 -0
- package/GoogleMobileAds/GoogleMobileAds.Ump.Unity.dll.meta +0 -81
- package/GoogleMobileAds/GoogleMobileAds.Ump.dll +0 -0
- package/GoogleMobileAds/GoogleMobileAds.Ump.dll.meta +0 -11
- package/GoogleMobileAds/GoogleMobileAds.Ump.iOS.dll +0 -0
- package/GoogleMobileAds/GoogleMobileAds.Ump.iOS.dll.meta +0 -81
- package/GoogleMobileAds/GoogleMobileAds.Unity.dll +0 -0
- package/GoogleMobileAds/GoogleMobileAds.dll +0 -0
- package/GoogleMobileAds/GoogleMobileAds.dll.meta +0 -11
- package/GoogleMobileAds/GoogleMobileAds.iOS.dll +0 -0
- package/GoogleMobileAds/GoogleMobileAds_version-10.7.0_manifest.txt +0 -78
- package/GoogleMobileAds/GoogleMobileAds_version-10.7.0_manifest.txt.meta +0 -10
- package/GoogleMobileAds/LICENSE +0 -202
- package/GoogleMobileAds/LICENSE.meta +0 -81
- package/GoogleMobileAds/Resources/gma_settings_editor_localization_data.json +0 -72
- package/GoogleMobileAds/Resources/gma_settings_editor_localization_data.json.meta +0 -12
- package/GoogleMobileAds/Resources.meta +0 -8
- package/GoogleMobileAds/link.xml +0 -18
- package/GoogleMobileAds/link.xml.meta +0 -11
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
// Copyright (C) 2020 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
|
-
#if UNITY_ANDROID
|
|
16
|
-
using System.Collections.Generic;
|
|
17
|
-
using System.IO;
|
|
18
|
-
using System.Linq;
|
|
19
|
-
using System.Xml.Linq;
|
|
20
|
-
|
|
21
|
-
using UnityEditor;
|
|
22
|
-
using UnityEditor.Build;
|
|
23
|
-
#if UNITY_2018_1_OR_NEWER
|
|
24
|
-
using UnityEditor.Build.Reporting;
|
|
25
|
-
#endif
|
|
26
|
-
using UnityEngine;
|
|
27
|
-
using GoogleMobileAds.Editor;
|
|
28
|
-
|
|
29
|
-
#if UNITY_2018_1_OR_NEWER
|
|
30
|
-
public class ManifestProcessor : IPreprocessBuildWithReport
|
|
31
|
-
#else
|
|
32
|
-
public class ManifestProcessor : IPreprocessBuild
|
|
33
|
-
#endif
|
|
34
|
-
{
|
|
35
|
-
private const string MANIFEST_RELATIVE_PATH =
|
|
36
|
-
"Plugins/Android/GoogleMobileAdsPlugin.androidlib/AndroidManifest.xml";
|
|
37
|
-
|
|
38
|
-
private const string PROPERTIES_RELATIVE_PATH =
|
|
39
|
-
"Plugins/Android/GoogleMobileAdsPlugin.androidlib/project.properties";
|
|
40
|
-
|
|
41
|
-
private const string METADATA_APPLICATION_ID =
|
|
42
|
-
"com.google.android.gms.ads.APPLICATION_ID";
|
|
43
|
-
|
|
44
|
-
private const string METADATA_DELAY_APP_MEASUREMENT_INIT =
|
|
45
|
-
"com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT";
|
|
46
|
-
|
|
47
|
-
private const string METADATA_OPTIMIZE_INITIALIZATION =
|
|
48
|
-
"com.google.android.gms.ads.flag.OPTIMIZE_INITIALIZATION";
|
|
49
|
-
|
|
50
|
-
private const string METADATA_OPTIMIZE_AD_LOADING =
|
|
51
|
-
"com.google.android.gms.ads.flag.OPTIMIZE_AD_LOADING";
|
|
52
|
-
|
|
53
|
-
// LINT.IfChange
|
|
54
|
-
private const string METADATA_UNITY_VERSION = "com.google.unity.ads.UNITY_VERSION";
|
|
55
|
-
// LINT.ThenChange(//depot/google3/javatests/com/google/android/gmscore/integ/modules/admob/tests/robolectric/src/com/google/android/gms/ads/nonagon/signals/StaticDeviceSignalSourceTest.java)
|
|
56
|
-
|
|
57
|
-
private XNamespace ns = "http://schemas.android.com/apk/res/android";
|
|
58
|
-
|
|
59
|
-
public int callbackOrder { get { return 0; } }
|
|
60
|
-
|
|
61
|
-
#if UNITY_2018_1_OR_NEWER
|
|
62
|
-
public void OnPreprocessBuild(BuildReport report)
|
|
63
|
-
#else
|
|
64
|
-
public void OnPreprocessBuild(BuildTarget target, string path)
|
|
65
|
-
#endif
|
|
66
|
-
{
|
|
67
|
-
return;
|
|
68
|
-
|
|
69
|
-
string manifestPath = Path.Combine(Application.dataPath, MANIFEST_RELATIVE_PATH);
|
|
70
|
-
string propertiesPath = Path.Combine(Application.dataPath, PROPERTIES_RELATIVE_PATH);
|
|
71
|
-
|
|
72
|
-
/*
|
|
73
|
-
* Handle importing GMA via Unity Package Manager.
|
|
74
|
-
*/
|
|
75
|
-
EditorPathUtils pathUtils =
|
|
76
|
-
ScriptableObject.CreateInstance<EditorPathUtils>();
|
|
77
|
-
if (pathUtils.IsPackageRootPath())
|
|
78
|
-
{
|
|
79
|
-
// pathUtils.GetParentDirectoryAssetPath() returns "Packages/.../GoogleMobileAds" but
|
|
80
|
-
// Plugins is at the same level of GoogleMobileAds so we go up one directory before
|
|
81
|
-
// appending MANIFEST_RELATIVE_PATH.
|
|
82
|
-
string packagesPathPrefix =
|
|
83
|
-
Path.GetDirectoryName(pathUtils.GetParentDirectoryAssetPath());
|
|
84
|
-
manifestPath = Path.Combine(packagesPathPrefix, MANIFEST_RELATIVE_PATH);
|
|
85
|
-
propertiesPath = Path.Combine(packagesPathPrefix, PROPERTIES_RELATIVE_PATH);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (AssetDatabase.IsValidFolder("Packages/com.google.ads.mobile"))
|
|
89
|
-
{
|
|
90
|
-
manifestPath = Path.Combine("Packages/com.google.ads.mobile", MANIFEST_RELATIVE_PATH);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (!File.Exists(manifestPath))
|
|
94
|
-
{
|
|
95
|
-
manifestPath = Path.Combine(Path.GetDirectoryName(manifestPath), "src", "main",
|
|
96
|
-
"AndroidManifest.xml");
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
XDocument manifest = null;
|
|
100
|
-
try
|
|
101
|
-
{
|
|
102
|
-
manifest = XDocument.Load(manifestPath);
|
|
103
|
-
}
|
|
104
|
-
#pragma warning disable 0168
|
|
105
|
-
catch (IOException e)
|
|
106
|
-
#pragma warning restore 0168
|
|
107
|
-
{
|
|
108
|
-
StopBuildWithMessage("AndroidManifest.xml is missing. Try re-importing the plugin.");
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
XElement elemManifest = manifest.Element("manifest");
|
|
112
|
-
if (elemManifest == null)
|
|
113
|
-
{
|
|
114
|
-
StopBuildWithMessage("AndroidManifest.xml is not valid. Try re-importing the plugin.");
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
XElement elemApplication = elemManifest.Element("application");
|
|
118
|
-
if (elemApplication == null)
|
|
119
|
-
{
|
|
120
|
-
StopBuildWithMessage("AndroidManifest.xml is not valid. Try re-importing the plugin.");
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
GoogleMobileAdsSettings instance = GoogleMobileAdsSettings.LoadInstance();
|
|
124
|
-
string appId = instance.GoogleMobileAdsAndroidAppId.Trim();
|
|
125
|
-
|
|
126
|
-
if (appId.Length == 0)
|
|
127
|
-
{
|
|
128
|
-
StopBuildWithMessage(
|
|
129
|
-
"Android Google Mobile Ads app ID is empty. Please enter a valid app ID to run ads properly.");
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
IEnumerable<XElement> metas = elemApplication.Descendants()
|
|
133
|
-
.Where( elem => elem.Name.LocalName.Equals("meta-data"));
|
|
134
|
-
|
|
135
|
-
SetMetadataElement(elemApplication,
|
|
136
|
-
metas,
|
|
137
|
-
METADATA_APPLICATION_ID,
|
|
138
|
-
appId);
|
|
139
|
-
|
|
140
|
-
SetMetadataElement(elemApplication,
|
|
141
|
-
metas,
|
|
142
|
-
METADATA_OPTIMIZE_INITIALIZATION,
|
|
143
|
-
!instance.DisableOptimizeInitialization,
|
|
144
|
-
true);
|
|
145
|
-
|
|
146
|
-
SetMetadataElement(elemApplication,
|
|
147
|
-
metas,
|
|
148
|
-
METADATA_OPTIMIZE_AD_LOADING,
|
|
149
|
-
!instance.DisableOptimizeAdLoading,
|
|
150
|
-
true);
|
|
151
|
-
|
|
152
|
-
SetMetadataElement(elemApplication,
|
|
153
|
-
metas,
|
|
154
|
-
METADATA_UNITY_VERSION,
|
|
155
|
-
Application.unityVersion);
|
|
156
|
-
|
|
157
|
-
elemManifest.Save(manifestPath);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
private XElement CreateMetaElement(string name, object value)
|
|
161
|
-
{
|
|
162
|
-
return new XElement("meta-data",
|
|
163
|
-
new XAttribute(ns + "name", name), new XAttribute(ns + "value", value));
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
private XElement GetMetaElement(IEnumerable<XElement> metas, string metaName)
|
|
167
|
-
{
|
|
168
|
-
foreach (XElement elem in metas)
|
|
169
|
-
{
|
|
170
|
-
IEnumerable<XAttribute> attrs = elem.Attributes();
|
|
171
|
-
foreach (XAttribute attr in attrs)
|
|
172
|
-
{
|
|
173
|
-
if (attr.Name.Namespace.Equals(ns)
|
|
174
|
-
&& attr.Name.LocalName.Equals("name") && attr.Value.Equals(metaName))
|
|
175
|
-
{
|
|
176
|
-
return elem;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return null;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/// <summary>
|
|
184
|
-
/// Utility for setting a metadata element
|
|
185
|
-
/// </summary>
|
|
186
|
-
/// <param name="elemApplication">application element</param>
|
|
187
|
-
/// <param name="metas">all metadata elements</param>
|
|
188
|
-
/// <param name="metadataName">name of the element to set</param>
|
|
189
|
-
/// <param name="metadataValue">value to set</param>
|
|
190
|
-
private void SetMetadataElement(XElement elemApplication,
|
|
191
|
-
IEnumerable<XElement> metas,
|
|
192
|
-
string metadataName,
|
|
193
|
-
string metadataValue)
|
|
194
|
-
{
|
|
195
|
-
XElement element = GetMetaElement(metas, metadataName);
|
|
196
|
-
if (element == null)
|
|
197
|
-
{
|
|
198
|
-
elemApplication.Add(CreateMetaElement(metadataName, metadataValue));
|
|
199
|
-
}
|
|
200
|
-
else
|
|
201
|
-
{
|
|
202
|
-
element.SetAttributeValue(ns + "value", metadataValue);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/// <summary>
|
|
207
|
-
/// Utility for setting a metadata element
|
|
208
|
-
/// </summary>
|
|
209
|
-
/// <param name="elemApplication">application element</param>
|
|
210
|
-
/// <param name="metas">all metadata elements</param>
|
|
211
|
-
/// <param name="metadataName">name of the element to set</param>
|
|
212
|
-
/// <param name="metadataValue">value to set</param>
|
|
213
|
-
/// <param name="defaultValue">If metadataValue is default, node will be removed.</param>
|
|
214
|
-
private void SetMetadataElement(XElement elemApplication,
|
|
215
|
-
IEnumerable<XElement> metas,
|
|
216
|
-
string metadataName,
|
|
217
|
-
bool metadataValue,
|
|
218
|
-
bool defaultValue = false)
|
|
219
|
-
{
|
|
220
|
-
XElement element = GetMetaElement(metas, metadataName);
|
|
221
|
-
if (metadataValue != defaultValue)
|
|
222
|
-
{
|
|
223
|
-
if (element == null)
|
|
224
|
-
{
|
|
225
|
-
elemApplication.Add(CreateMetaElement(metadataName, metadataValue));
|
|
226
|
-
}
|
|
227
|
-
else
|
|
228
|
-
{
|
|
229
|
-
element.SetAttributeValue(ns + "value", metadataValue);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
else
|
|
233
|
-
{
|
|
234
|
-
if (element != null)
|
|
235
|
-
{
|
|
236
|
-
element.Remove();
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
private void StopBuildWithMessage(string message)
|
|
242
|
-
{
|
|
243
|
-
string prefix = "[GoogleMobileAds] ";
|
|
244
|
-
#if UNITY_2017_1_OR_NEWER
|
|
245
|
-
throw new BuildPlayerWindow.BuildMethodException(prefix + message);
|
|
246
|
-
#else
|
|
247
|
-
throw new OperationCanceledException(prefix + message);
|
|
248
|
-
#endif
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
#endif
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: c9ee5d47594eb43a19e795c834fdc044
|
|
3
|
-
labels:
|
|
4
|
-
- gvh
|
|
5
|
-
- gvh_version-10.7.0
|
|
6
|
-
- gvhp_exportpath-GoogleMobileAds/Editor/ManifestProcessor.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,232 +0,0 @@
|
|
|
1
|
-
// Copyright (C) 2020 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
|
-
#if UNITY_IPHONE || UNITY_IOS
|
|
16
|
-
using System;
|
|
17
|
-
using System.Collections.Generic;
|
|
18
|
-
using System.IO;
|
|
19
|
-
using System.Xml;
|
|
20
|
-
|
|
21
|
-
using UnityEditor;
|
|
22
|
-
using UnityEditor.Callbacks;
|
|
23
|
-
using UnityEditor.iOS.Xcode;
|
|
24
|
-
using UnityEngine;
|
|
25
|
-
|
|
26
|
-
using GoogleMobileAds.Editor;
|
|
27
|
-
|
|
28
|
-
public static class PListProcessor
|
|
29
|
-
{
|
|
30
|
-
private const string KEY_SK_ADNETWORK_ITEMS = "SKAdNetworkItems";
|
|
31
|
-
|
|
32
|
-
private const string KEY_SK_ADNETWORK_ID = "SKAdNetworkIdentifier";
|
|
33
|
-
|
|
34
|
-
private const string SKADNETWORKS_RELATIVE_PATH = "GoogleMobileAds/Editor/GoogleMobileAdsSKAdNetworkItems.xml";
|
|
35
|
-
|
|
36
|
-
private const string SKADNETWORKS_FILE_NAME = "GoogleMobileAdsSKAdNetworkItems.xml";
|
|
37
|
-
|
|
38
|
-
[PostProcessBuild]
|
|
39
|
-
public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
|
|
40
|
-
{
|
|
41
|
-
string plistPath = Path.Combine(path, "Info.plist");
|
|
42
|
-
PlistDocument plist = new PlistDocument();
|
|
43
|
-
plist.ReadFromFile(plistPath);
|
|
44
|
-
|
|
45
|
-
GoogleMobileAdsSettings instance = GoogleMobileAdsSettings.LoadInstance();
|
|
46
|
-
string appId = instance.GoogleMobileAdsIOSAppId.Trim();
|
|
47
|
-
if (appId.Length == 0)
|
|
48
|
-
{
|
|
49
|
-
NotifyBuildFailure(
|
|
50
|
-
"iOS Google Mobile Ads app ID is empty. Please enter a valid app ID to run ads properly.");
|
|
51
|
-
}
|
|
52
|
-
else
|
|
53
|
-
{
|
|
54
|
-
plist.root.SetString("GADApplicationIdentifier", appId);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
string userTrackingDescription = instance.UserTrackingUsageDescription;
|
|
58
|
-
if (!string.IsNullOrEmpty(userTrackingDescription))
|
|
59
|
-
{
|
|
60
|
-
plist.root.SetString("NSUserTrackingUsageDescription", userTrackingDescription);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
List<string> skNetworkIds = ReadSKAdNetworkIdentifiersFromXML();
|
|
64
|
-
if (skNetworkIds.Count > 0)
|
|
65
|
-
{
|
|
66
|
-
AddSKAdNetworkIdentifier(plist, skNetworkIds);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
string unityVersion = Application.unityVersion;
|
|
70
|
-
if (!string.IsNullOrEmpty(unityVersion))
|
|
71
|
-
{
|
|
72
|
-
plist.root.SetString("GADUUnityVersion", unityVersion);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
File.WriteAllText(plistPath, plist.WriteToString());
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
private static PlistElementArray GetSKAdNetworkItemsArray(PlistDocument document)
|
|
79
|
-
{
|
|
80
|
-
PlistElementArray array;
|
|
81
|
-
if (document.root.values.ContainsKey(KEY_SK_ADNETWORK_ITEMS))
|
|
82
|
-
{
|
|
83
|
-
try
|
|
84
|
-
{
|
|
85
|
-
PlistElement element;
|
|
86
|
-
document.root.values.TryGetValue(KEY_SK_ADNETWORK_ITEMS, out element);
|
|
87
|
-
array = element.AsArray();
|
|
88
|
-
}
|
|
89
|
-
#pragma warning disable 0168
|
|
90
|
-
catch (Exception e)
|
|
91
|
-
#pragma warning restore 0168
|
|
92
|
-
{
|
|
93
|
-
// The element is not an array type.
|
|
94
|
-
array = null;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
else
|
|
98
|
-
{
|
|
99
|
-
array = document.root.CreateArray(KEY_SK_ADNETWORK_ITEMS);
|
|
100
|
-
}
|
|
101
|
-
return array;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
private static List<string> ReadSKAdNetworkIdentifiersFromXML()
|
|
105
|
-
{
|
|
106
|
-
List<string> skAdNetworkItems = new List<string>();
|
|
107
|
-
|
|
108
|
-
string path = Path.Combine(Application.dataPath, SKADNETWORKS_RELATIVE_PATH);
|
|
109
|
-
|
|
110
|
-
/*
|
|
111
|
-
* Handle importing GMA via Unity Package Manager.
|
|
112
|
-
*/
|
|
113
|
-
EditorPathUtils pathUtils = ScriptableObject.CreateInstance<EditorPathUtils>();
|
|
114
|
-
if (pathUtils.IsPackageRootPath())
|
|
115
|
-
{
|
|
116
|
-
string parentDirectoryPath = pathUtils.GetDirectoryAssetPath();
|
|
117
|
-
path = Path.Combine(parentDirectoryPath, SKADNETWORKS_FILE_NAME);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
try
|
|
121
|
-
{
|
|
122
|
-
if (!File.Exists(path))
|
|
123
|
-
{
|
|
124
|
-
throw new FileNotFoundException();
|
|
125
|
-
}
|
|
126
|
-
using (FileStream fs = File.OpenRead(path))
|
|
127
|
-
{
|
|
128
|
-
XmlDocument document = new XmlDocument();
|
|
129
|
-
document.Load(fs);
|
|
130
|
-
|
|
131
|
-
XmlNode root = document.FirstChild;
|
|
132
|
-
|
|
133
|
-
XmlNodeList nodes = root.SelectNodes(KEY_SK_ADNETWORK_ID);
|
|
134
|
-
foreach (XmlNode node in nodes)
|
|
135
|
-
{
|
|
136
|
-
skAdNetworkItems.Add(node.InnerText);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
#pragma warning disable 0168
|
|
141
|
-
catch (FileNotFoundException e)
|
|
142
|
-
#pragma warning restore 0168
|
|
143
|
-
{
|
|
144
|
-
NotifyBuildFailure("GoogleMobileAdsSKAdNetworkItems.xml not found", false);
|
|
145
|
-
}
|
|
146
|
-
catch (IOException e)
|
|
147
|
-
{
|
|
148
|
-
NotifyBuildFailure("Failed to read GoogleMobileAdsSKAdNetworkIds.xml: " + e.Message, false);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
return skAdNetworkItems;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
private static void AddSKAdNetworkIdentifier(PlistDocument document, List<string> skAdNetworkIds)
|
|
155
|
-
{
|
|
156
|
-
PlistElementArray array = GetSKAdNetworkItemsArray(document);
|
|
157
|
-
if (array != null)
|
|
158
|
-
{
|
|
159
|
-
foreach (string id in skAdNetworkIds)
|
|
160
|
-
{
|
|
161
|
-
if (!ContainsSKAdNetworkIdentifier(array, id))
|
|
162
|
-
{
|
|
163
|
-
PlistElementDict added = array.AddDict();
|
|
164
|
-
added.SetString(KEY_SK_ADNETWORK_ID, id);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
else
|
|
169
|
-
{
|
|
170
|
-
NotifyBuildFailure("SKAdNetworkItems element already exists in Info.plist, but is not an array.", false);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
private static bool ContainsSKAdNetworkIdentifier(PlistElementArray skAdNetworkItemsArray, string id)
|
|
175
|
-
{
|
|
176
|
-
foreach (PlistElement elem in skAdNetworkItemsArray.values)
|
|
177
|
-
{
|
|
178
|
-
try
|
|
179
|
-
{
|
|
180
|
-
PlistElementDict elemInDict = elem.AsDict();
|
|
181
|
-
PlistElement value;
|
|
182
|
-
bool identifierExists = elemInDict.values.TryGetValue(KEY_SK_ADNETWORK_ID, out value);
|
|
183
|
-
|
|
184
|
-
if (identifierExists && value.AsString().Equals(id))
|
|
185
|
-
{
|
|
186
|
-
return true;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
#pragma warning disable 0168
|
|
190
|
-
catch (Exception e)
|
|
191
|
-
#pragma warning restore 0168
|
|
192
|
-
{
|
|
193
|
-
// Do nothing
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
return false;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
private static void NotifyBuildFailure(string message, bool showOpenSettingsButton = true)
|
|
201
|
-
{
|
|
202
|
-
string dialogTitle = "Google Mobile Ads";
|
|
203
|
-
string dialogMessage = "Error: " + message;
|
|
204
|
-
|
|
205
|
-
if (showOpenSettingsButton)
|
|
206
|
-
{
|
|
207
|
-
bool openSettings = EditorUtility.DisplayDialog(
|
|
208
|
-
dialogTitle, dialogMessage, "Open Settings", "Close");
|
|
209
|
-
if (openSettings)
|
|
210
|
-
{
|
|
211
|
-
GoogleMobileAdsSettingsEditor.OpenInspector();
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
else
|
|
215
|
-
{
|
|
216
|
-
EditorUtility.DisplayDialog(dialogTitle, dialogMessage, "Close");
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
ThrowBuildException("[GoogleMobileAds] " + message);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
private static void ThrowBuildException(string message)
|
|
223
|
-
{
|
|
224
|
-
#if UNITY_2017_1_OR_NEWER
|
|
225
|
-
throw new BuildPlayerWindow.BuildMethodException(message);
|
|
226
|
-
#else
|
|
227
|
-
throw new OperationCanceledException(message);
|
|
228
|
-
#endif
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
#endif
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: d1d26b084dc244c8c818f67662e51f6c
|
|
3
|
-
labels:
|
|
4
|
-
- gvh
|
|
5
|
-
- gvh_version-10.7.0
|
|
6
|
-
- gvhp_exportpath-GoogleMobileAds/Editor/PListProcessor.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:
|
|
Binary file
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 4c69db43dbd474a2987be5807129b4cc
|
|
3
|
-
labels:
|
|
4
|
-
- gvh
|
|
5
|
-
- gvh_version-10.7.0
|
|
6
|
-
- gvhp_exportpath-GoogleMobileAds/Editor/Resources/PlaceholderAds/AdImages/1024x768.png
|
|
7
|
-
timeCreated: 1480838400
|
|
8
|
-
TextureImporter:
|
|
9
|
-
internalIDToNameTable: []
|
|
10
|
-
externalObjects: {}
|
|
11
|
-
serializedVersion: 11
|
|
12
|
-
mipmaps:
|
|
13
|
-
mipMapMode: 0
|
|
14
|
-
enableMipMap: 0
|
|
15
|
-
sRGBTexture: 1
|
|
16
|
-
linearTexture: 0
|
|
17
|
-
fadeOut: 0
|
|
18
|
-
borderMipMap: 0
|
|
19
|
-
mipMapsPreserveCoverage: 0
|
|
20
|
-
alphaTestReferenceValue: 0.5
|
|
21
|
-
mipMapFadeDistanceStart: 1
|
|
22
|
-
mipMapFadeDistanceEnd: 3
|
|
23
|
-
bumpmap:
|
|
24
|
-
convertToNormalMap: 0
|
|
25
|
-
externalNormalMap: 0
|
|
26
|
-
heightScale: 0.25
|
|
27
|
-
normalMapFilter: 0
|
|
28
|
-
isReadable: 0
|
|
29
|
-
streamingMipmaps: 0
|
|
30
|
-
streamingMipmapsPriority: 0
|
|
31
|
-
grayScaleToAlpha: 0
|
|
32
|
-
generateCubemap: 6
|
|
33
|
-
cubemapConvolution: 0
|
|
34
|
-
seamlessCubemap: 0
|
|
35
|
-
textureFormat: 1
|
|
36
|
-
maxTextureSize: 2048
|
|
37
|
-
textureSettings:
|
|
38
|
-
serializedVersion: 2
|
|
39
|
-
filterMode: -1
|
|
40
|
-
aniso: -1
|
|
41
|
-
mipBias: -100
|
|
42
|
-
wrapU: 1
|
|
43
|
-
wrapV: 1
|
|
44
|
-
wrapW: 1
|
|
45
|
-
nPOTScale: 0
|
|
46
|
-
lightmap: 0
|
|
47
|
-
compressionQuality: 50
|
|
48
|
-
spriteMode: 1
|
|
49
|
-
spriteExtrude: 1
|
|
50
|
-
spriteMeshType: 1
|
|
51
|
-
alignment: 0
|
|
52
|
-
spritePivot:
|
|
53
|
-
x: 0.5
|
|
54
|
-
y: 0.5
|
|
55
|
-
spritePixelsToUnits: 100
|
|
56
|
-
spriteBorder:
|
|
57
|
-
x: 0
|
|
58
|
-
y: 0
|
|
59
|
-
z: 0
|
|
60
|
-
w: 0
|
|
61
|
-
spriteGenerateFallbackPhysicsShape: 1
|
|
62
|
-
alphaUsage: 1
|
|
63
|
-
alphaIsTransparency: 1
|
|
64
|
-
spriteTessellationDetail: -1
|
|
65
|
-
textureType: 8
|
|
66
|
-
textureShape: 1
|
|
67
|
-
singleChannelComponent: 0
|
|
68
|
-
maxTextureSizeSet: 0
|
|
69
|
-
compressionQualitySet: 0
|
|
70
|
-
textureFormatSet: 0
|
|
71
|
-
applyGammaDecoding: 0
|
|
72
|
-
platformSettings:
|
|
73
|
-
- serializedVersion: 3
|
|
74
|
-
buildTarget: DefaultTexturePlatform
|
|
75
|
-
maxTextureSize: 2048
|
|
76
|
-
resizeAlgorithm: 0
|
|
77
|
-
textureFormat: -1
|
|
78
|
-
textureCompression: 1
|
|
79
|
-
compressionQuality: 50
|
|
80
|
-
crunchedCompression: 0
|
|
81
|
-
allowsAlphaSplitting: 0
|
|
82
|
-
overridden: 0
|
|
83
|
-
androidETC2FallbackOverride: 0
|
|
84
|
-
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
85
|
-
spriteSheet:
|
|
86
|
-
serializedVersion: 2
|
|
87
|
-
sprites: []
|
|
88
|
-
outline: []
|
|
89
|
-
physicsShape: []
|
|
90
|
-
bones: []
|
|
91
|
-
spriteID: 5e97eb03825dee720800000000000000
|
|
92
|
-
internalID: 0
|
|
93
|
-
vertices: []
|
|
94
|
-
indices:
|
|
95
|
-
edges: []
|
|
96
|
-
weights: []
|
|
97
|
-
secondaryTextures: []
|
|
98
|
-
spritePackingTag:
|
|
99
|
-
pSDRemoveMatte: 0
|
|
100
|
-
pSDShowRemoveMatteOption: 0
|
|
101
|
-
userData:
|
|
102
|
-
assetBundleName:
|
|
103
|
-
assetBundleVariant:
|
|
Binary file
|