Skip to content

Commit 2664d2d

Browse files
authored
Merge branch 'master' into fix_multi_game_sign_in
2 parents 1a03491 + 9b091ab commit 2664d2d

File tree

163 files changed

+3095
-420
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+3095
-420
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ buildscript {
3838

3939
ext.androidMinSdk = 19
4040
ext.androidTargetSdk = 29
41-
ext.androidCompileSdk = 34
41+
ext.androidCompileSdk = 35
4242

4343
ext.localProperties = new Properties()
4444

play-services-ads-identifier/core/src/main/res/values-ast/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
<string name="perm_ad_id_notification_label">Avisu d\'ID de publicidá</string>
55
<string name="perm_ad_id_description">Permite que l\'aplicación d\'un espublizador acceda in/direutamente a una ID de publicidá.</string>
66
<string name="perm_ad_id_label">Permisu d\'ID de publicidá</string>
7-
</resources>
7+
</resources>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="perm_ad_id_label">مجوز شناسه آگهی</string>
4+
<string name="perm_ad_id_description">به یک برنامه ناشر اجازه می‌دهد تا به شیوه مستقیم یا غیرمستقیم به یک شناسه آگهی معتبر دسترسی پیدا کند.</string>
5+
<string name="perm_ad_id_notification_label">آگاه‌ساز شناسه آگهی</string>
6+
<string name="perm_ad_id_notification_description">به یک برنامه اجازه می‌دهد تا هنگام به‌روزرسانی شناسه آگهی یا تنظیمات ردیابی محدود آگهی کاربر، آگاه‌ساز دریافت کند.</string>
7+
</resources>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="perm_ad_id_description">Memungkinkan aplikasi penerbit mengakses ID periklanan yang valid secara langsung atau tidak langsung.</string>
4+
<string name="perm_ad_id_label">Izin ID Periklanan</string>
5+
<string name="perm_ad_id_notification_label">Pemberitahuan ID periklanan</string>
6+
<string name="perm_ad_id_notification_description">Memungkinkan aplikasi menerima notifikasi ketika ID periklanan atau batas preferensi pelacakan iklan pengguna diperbarui.</string>
7+
</resources>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="perm_ad_id_label">Reklāmas identifikatora atļauja</string>
4+
<string name="perm_ad_id_description">Ļauj lietotnes izdevējam tieši vai netieši piekļūt derīgam reklāmas identifikatoram.</string>
5+
<string name="perm_ad_id_notification_label">Reklāmas identifikatora paziņojums</string>
6+
<string name="perm_ad_id_notification_description">Ļauj informēt lietotni, ja mainās reklāmas identifikators vai lietotāja ierobežotie, iestatītie reklāmu izsekošanas iestatījumi.</string>
7+
</resources>

play-services-ads/core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/ads/dynamite/ModuleDescriptor.java

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,70 @@
55

66
package com.google.android.gms.dynamite.descriptors.com.google.android.gms.ads.dynamite;
77

8+
import android.annotation.SuppressLint;
89
import android.content.Context;
910
import android.content.ContextWrapper;
10-
import android.webkit.WebSettings;
11+
import android.content.SharedPreferences;
12+
import android.util.Log;
1113
import androidx.annotation.Keep;
1214

15+
import java.util.Locale;
16+
17+
import static android.os.Build.DEVICE;
18+
import static android.os.Build.DISPLAY;
19+
import static android.os.Build.VERSION.RELEASE;
20+
1321
@Keep
1422
public class ModuleDescriptor {
1523
public static final String MODULE_ID = "com.google.android.gms.ads.dynamite";
1624
public static final int MODULE_VERSION = 230500001;
25+
private static final String TAG = "AdsDynamiteModule";
1726

1827
/**
1928
* The ads module might try to access the user agent, requiring initialization on the main thread,
2029
* which may result in deadlocks when invoked from any other thread. This only happens with microG,
2130
* because we don't use the highly privileged SELinux Sandbox that regular Play Services uses
2231
* (which allows apps to read the user-agent from Play Services instead of the WebView). To prevent
23-
* the issue we pre-emptively initialize the WebView.
32+
* the issue we pre-emptively write a user agent in the local storage of the app.
2433
*/
2534
public static void init(Context context) {
26-
if (context instanceof ContextWrapper) {
27-
context = ((ContextWrapper) context).getBaseContext();
35+
do {
36+
try {
37+
injectUserAgentSharedPreference(context);
38+
} catch (Exception e) {
39+
}
40+
if (context instanceof ContextWrapper) {
41+
Context baseContext = ((ContextWrapper) context).getBaseContext();
42+
if (context == baseContext) break;
43+
context = baseContext;
44+
} else {
45+
break;
46+
}
47+
} while (context != null);
48+
}
49+
50+
/**
51+
* @return A user-agent representing a browser on the current device.
52+
*/
53+
private static String buildDefaultUserAgent() {
54+
StringBuilder sb = new StringBuilder();
55+
sb.append("Mozilla/5.0 (Linux; U; Android");
56+
if (RELEASE != null) sb.append(" ").append(RELEASE);
57+
sb.append("; ").append(Locale.getDefault());
58+
if (DEVICE != null) {
59+
sb.append("; ").append(DEVICE);
60+
if (DISPLAY != null) sb.append(" Build/").append(DISPLAY);
61+
}
62+
sb.append(") AppleWebKit/533 Version/4.0 Safari/533");
63+
return sb.toString();
64+
}
65+
66+
@SuppressLint("ApplySharedPref")
67+
private static void injectUserAgentSharedPreference(Context context) {
68+
SharedPreferences preferences = context.getSharedPreferences("admob_user_agent", Context.MODE_PRIVATE);
69+
if (!preferences.contains("user_agent")) {
70+
preferences.edit().putString("user_agent", buildDefaultUserAgent()).commit();
71+
Log.d(TAG, "Injected admob_user_agent into package " + context.getPackageName());
2872
}
29-
WebSettings.getDefaultUserAgent(context);
3073
}
3174
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 microG Project Team
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package com.google.android.gms.wallet;
7+
8+
parcelable GetClientTokenRequest;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 microG Project Team
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package com.google.android.gms.wallet;
7+
8+
parcelable GetClientTokenResponse;

play-services-api/src/main/aidl/com/google/android/gms/wallet/internal/IOwService.aidl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package com.google.android.gms.wallet.internal;
22

33
import com.google.android.gms.wallet.internal.IWalletServiceCallbacks;
44
import com.google.android.gms.wallet.IsReadyToPayRequest;
5+
import com.google.android.gms.wallet.GetClientTokenRequest;
56

67
interface IOwService {
78
void isReadyToPay(in IsReadyToPayRequest request, in Bundle args, IWalletServiceCallbacks callbacks) = 13;
9+
void getClientToken(in GetClientTokenRequest getClientTokenRequest, in Bundle options, IWalletServiceCallbacks callbacks) = 14;
810
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.google.android.gms.wallet.internal;
22

33
import com.google.android.gms.common.api.Status;
4+
import com.google.android.gms.wallet.GetClientTokenResponse;
45

56
interface IWalletServiceCallbacks {
67
void onIsReadyToPayResponse(in Status status, boolean result, in Bundle args) = 8;
8+
void onClientTokenReceived(in Status status, in GetClientTokenResponse response, in Bundle extras) = 9;
79
}

0 commit comments

Comments
 (0)