Skip to content

Commit

Permalink
Merge branch 'master' into fix_map_null_pointer_exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mar-v-in authored Nov 16, 2024
2 parents b6db859 + 56af897 commit 72c77ff
Show file tree
Hide file tree
Showing 98 changed files with 2,537 additions and 510 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="perm_ad_id_notification_label">إشعار معرّف الإعلان</string>
<string name="perm_ad_id_label">إذن معرّف الإعلان</string>
<string name="perm_ad_id_notification_description">يتيح للتطبيق تلقي إشعار عند تحديث معرّف الإعلان أو تحديد تفضيلات تتبع الإعلانات للمستخدم.</string>
<string name="perm_ad_id_description">يتيح لتطبيق الناشر بالوصول إلى معرف إعلان صالح بشكل مباشر أو غير مباشر.</string>
<string name="perm_ad_id_notification_label">إشعار مُعَرِّف الإعلان</string>
<string name="perm_ad_id_label">إذن مُعَرِّف الإعلان</string>
<string name="perm_ad_id_notification_description">يتيح للتطبيق تلقي إشعار عند تحديث مُعَرِّف الإعلان أو تحديد تفضيلات تتبع الإعلانات للمستخدم.</string>
<string name="perm_ad_id_description">يتيح لتطبيق الناشر بالوصول إلى مُعَرِّف إعلان صالح بشكل مباشر أو غير مباشر.</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<string name="perm_ad_id_label">Permiso de identificación publicitaria</string>
<string name="perm_ad_id_description">Permite que una aplicación de editor acceda directa o indirectamente a un ID de publicidad válido.</string>
<string name="perm_ad_id_notification_label">Notificación del ID de publicidad</string>
<string name="perm_ad_id_notification_description">Permite que una aplicación reciba una notificación cuando se actualiza el ID de publicidad o la preferencia de limitar el seguimiento de anuncios del usuario.</string>
<string name="perm_ad_id_notification_description">Permite que una aplicación reciba una notificación cuando se actualiza la preferencia de ID de publicidad o de seguimiento de anuncios del usuario.</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>
<resources>
<string name="perm_ad_id_label">Permission de l\'identifiant publicitaire</string>
<string name="perm_ad_id_description">Autorise une application affichant de la publicité à accéder directement ou indirectement à un identifiant publicitaire valide.</string>
<string name="perm_ad_id_notification_label">Notification de l\'identifiant publicitaire</string>
<string name="perm_ad_id_notification_description">Autorise une application à être notifiée de la modification de l\'identifiant publicitaire ou de la limitation du suivi publicitaire de l\'utilisateur.</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="perm_ad_id_label">อนุญาติรหัสประจำตัวของโฆษณา</string>
<string name="perm_ad_id_notification_label">การแจ้งเตือน รหัสประจำตัวของโฆษณา</string>
<string name="perm_ad_id_description">อนุญาตให้แอปผู้เผยแพร่เข้าถึง รหัสประจำตัวของโฆษณาที่ถูกต้องได้โดยตรงหรือโดยอ้อม</string>
<string name="perm_ad_id_notification_description">อนุญาตให้แอปรับการแจ้งเตือนเมื่อมีการอัปเดต รหัสประจำตัวของโฆษณา หรือ การตั้งค่าการติดตามโฆษณาของผู้ใช้</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="perm_ad_id_notification_description">Cho phép một ứng dụng nhận được thông báo khi ID quảng cáo hoặc giới hạn tùy chọn theo dõi quảng cáo của người dùng được cập nhật.</string>
<string name="perm_ad_id_label">Quyền của Mã Quảng cáo</string>
<string name="perm_ad_id_notification_label">Thông báo của Mã Quảng cáo</string>
<string name="perm_ad_id_description">Cho phép ứng dụng của nhà xuất bản truy cập trực tiếp hoặc gián tiếp vào một mã quảng cáo hợp lệ.</string>
<string name="perm_ad_id_notification_description">Cho phép ứng dụng nhận thông báo khi ID quảng cáo hoặc tùy chọn giới hạn theo dõi quảng cáo của người dùng được cập nhật.</string>
<string name="perm_ad_id_label">Quyền ID quảng cáo</string>
<string name="perm_ad_id_notification_label">Thông báo ID quảng cáo</string>
<string name="perm_ad_id_description">Cho phép ứng dụng của nhà xuất bản truy cập trực tiếp hoặc gián tiếp vào ID quảng cáo hợp lệ.</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>
<resources>
<string name="sms_user_consent_title">Autoriser <b>%s</b> à lire le message ci-dessous et saisir le code ?</string>
<string name="sms_user_consent_allow">Autoriser</string>
<string name="sms_user_consent_deny">Refuser</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="sms_user_consent_title">อนุญาตให้ <b>%s</b> อ่านข้อความด้านล่างและกรอกรหัส?</string>
<string name="sms_user_consent_allow">อนุญาต</string>
<string name="sms_user_consent_deny">ปฏิเสธ</string>
</resources>
8 changes: 7 additions & 1 deletion play-services-base/core/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
<!--
~ SPDX-FileCopyrightText: 2020, microG Project Team
~ SPDX-License-Identifier: Apache-2.0
--><resources>
--><resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="menu_advanced">Avancé</string>
<string name="list_no_item_none">Aucun</string>
<string name="service_status_disabled">Désactivé</string>
<string name="service_status_enabled">Activé</string>
<string name="service_status_automatic">Automatique</string>
<string name="service_status_manual">Manuel</string>
<string name="foreground_service_notification_title">Actif en arrière-plan</string>
<string name="open_app">Ouvrir</string>
<string name="foreground_service_notification_big_text">Exclure <xliff:g example="microG Services">%1$s</xliff:g> de l\'optimisation de la batterie ou modifier les paramètres des notifications pour désactiver cette notification.</string>
<string name="service_status_enabled_short">Act.</string>
<string name="service_status_disabled_short">Désact.</string>
<string name="list_item_see_all">Tout voir</string>
<string name="foreground_service_notification_text"><xliff:g example="Exposure Notification">%1$s</xliff:g> fonctionne en arrière-plan.</string>
</resources>
2 changes: 1 addition & 1 deletion play-services-base/core/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<string name="service_status_automatic">自動</string>
<string name="service_status_manual">手動</string>
<string name="service_status_enabled_short">On</string>
<string name="service_status_disabled_short">Off</string>
<string name="service_status_disabled_short">オフ</string>
<string name="foreground_service_notification_title">バックグラウンドで有効</string>
<string name="foreground_service_notification_text"><xliff:g example="Exposure Notification">%1$s</xliff:g> をバックグラウンドで実行しています。</string>
<string name="foreground_service_notification_big_text"><xliff:g example="microG Services">%1$s</xliff:g> をバッテリー最適化から除外するか、通知設定でこの通知を非表示にしてください。</string>
Expand Down
16 changes: 16 additions & 0 deletions play-services-base/core/src/main/res/values-th/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="foreground_service_notification_title">ทำงานในพื้นหลัง</string>
<string name="foreground_service_notification_text"><xliff:g example="การแจ้งเตือนการสัมผัส">%1$s</xliff:g> กำลังทำงานอยู่ในพื้นหลัง</string>
<string name="foreground_service_notification_big_text">ไม่รวม <xliff:g example="บริการ microG">%1$s</xliff:g> จากการเพิ่มประสิทธิภาพแบตเตอรี่หรือเปลี่ยนการตั้งค่าการแจ้งเตือนเพื่อซ่อนการแจ้งเตือนนี้</string>
<string name="menu_advanced">ขั้นสูง</string>
<string name="list_no_item_none">ไม่มี</string>
<string name="list_item_see_all">ดูทั้งหมด</string>
<string name="open_app">เปิด</string>
<string name="service_status_disabled">ปิดการทำงาน</string>
<string name="service_status_enabled">เปิดใช้งานแล้ว</string>
<string name="service_status_automatic">อัตโนมัติ</string>
<string name="service_status_manual">คู่มือ</string>
<string name="service_status_enabled_short">เปิด</string>
<string name="service_status_disabled_short">ปิด</string>
</resources>
6 changes: 3 additions & 3 deletions play-services-base/core/src/main/res/values-vi/strings.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="foreground_service_notification_big_text">Loại trừ <xliff:g example="microG Services">1%1$s</xliff:g> từ Tối ưu hoá pin hoặc thay đổi cài đặt của thông báo để ẩn thông báo này.</string>
<string name="foreground_service_notification_big_text">Bạn có thể loại trừ <xliff:g example="microG Services">%1$s</xliff:g> khỏi tính năng tối ưu hóa pin hoặc thay đổi cài đặt ứng dụng để ẩn thông báo này.</string>
<string name="menu_advanced">Nâng cao</string>
<string name="list_item_see_all">Xem tất cả</string>
<string name="service_status_automatic">Tự động</string>
<string name="list_no_item_none">Không</string>
<string name="open_app">Mở</string>
<string name="service_status_disabled">Tắt</string>
<string name="service_status_enabled">Bật</string>
<string name="service_status_disabled">Đã tắt</string>
<string name="service_status_enabled">Đã bật</string>
<string name="service_status_disabled_short">Tắt</string>
<string name="foreground_service_notification_title">Hoạt động trong nền</string>
<string name="service_status_manual">Thủ công</string>
Expand Down
3 changes: 3 additions & 0 deletions play-services-core/src/huawei/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
<meta-data
android:name="org.microg.gms.settings.vending_licensing"
android:value="true" />
<meta-data
android:name="org.microg.gms.settings.vending_licensing_purchase_free_apps"
android:value="true" />
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,19 @@ class GamesConfigurationService : Service() {
}

MSG_GET_PLAYER -> {
val packageName = msg.data?.getString(MSG_DATA_PACKAGE_NAME)
val account = msg.data?.getParcelable<Account>(MSG_DATA_ACCOUNT)
val player = if (packageName != null && account != null) getPlayer(packageName, account) else null
val player = if (account != null) getPlayer(account) else null
bundleOf(
MSG_DATA_PACKAGE_NAME to packageName,
MSG_DATA_ACCOUNT to account,
MSG_DATA_PLAYER to player
)
}

MSG_SET_PLAYER -> {
val packageName = msg.data?.getString(MSG_DATA_PACKAGE_NAME)
val account = msg.data?.getParcelable<Account>(MSG_DATA_ACCOUNT)
val player = msg.data?.getString(MSG_DATA_PLAYER)
if (packageName != null && account != null) setPlayer(packageName, account, player)
if (account != null) setPlayer(account, player)
bundleOf(
MSG_DATA_PACKAGE_NAME to packageName,
MSG_DATA_ACCOUNT to account,
MSG_DATA_PLAYER to player
)
Expand Down Expand Up @@ -141,18 +137,18 @@ class GamesConfigurationService : Service() {
return getPackageNameSuffix(packageName) + ":" + account.name
}

private fun getPlayer(packageName: String, account: Account): String? {
val player = preferences.getString(PREF_PLAYER_PREFIX + getPackageAndAccountSuffix(packageName, account), null)
private fun getPlayer(account: Account): String? {
val player = preferences.getString(PREF_PLAYER_PREFIX + getPackageAndAccountSuffix(GAMES_PACKAGE_NAME, account), null)
if (player.isNullOrBlank()) return null
return player
}

private fun setPlayer(packageName: String, account: Account, player: String?) {
private fun setPlayer(account: Account, player: String?) {
val editor: SharedPreferences.Editor = preferences.edit()
if (player.isNullOrBlank()) {
editor.remove(PREF_PLAYER_PREFIX + getPackageAndAccountSuffix(packageName, account))
editor.remove(PREF_PLAYER_PREFIX + getPackageAndAccountSuffix(GAMES_PACKAGE_NAME, account))
} else {
editor.putString(PREF_PLAYER_PREFIX + getPackageAndAccountSuffix(packageName, account), player)
editor.putString(PREF_PLAYER_PREFIX + getPackageAndAccountSuffix(GAMES_PACKAGE_NAME, account), player)
}
editor.apply()
}
Expand Down Expand Up @@ -208,21 +204,19 @@ class GamesConfigurationService : Service() {
})
}

suspend fun getPlayer(context: Context, packageName: String, account: Account): String? {
suspend fun getPlayer(context: Context, account: Account): String? {
return singleRequest(context, Message.obtain().apply {
what = MSG_GET_PLAYER
data = bundleOf(
MSG_DATA_PACKAGE_NAME to packageName,
MSG_DATA_ACCOUNT to account
)
}).data?.getString(MSG_DATA_PLAYER)
}

suspend fun setPlayer(context: Context, packageName: String, account: Account, player: String?) {
suspend fun setPlayer(context: Context, account: Account, player: String?) {
singleRequest(context, Message.obtain().apply {
what = MSG_SET_PLAYER
data = bundleOf(
MSG_DATA_PACKAGE_NAME to packageName,
MSG_DATA_ACCOUNT to account,
MSG_DATA_PLAYER to player
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class GamesService : BaseService(TAG, GmsService.GAMES) {
return@launchWhenStarted sendSignInRequired()
}

val player = JSONObject(GamesConfigurationService.getPlayer(this@GamesService, packageName, account)).toPlayer()
val player = JSONObject(GamesConfigurationService.getPlayer(this@GamesService, account)).toPlayer()

callback.onPostInitCompleteWithConnectionInfo(
CommonStatusCodes.SUCCESS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ suspend fun performGamesSignIn(
val authManager = AuthManager(context, account.name, packageName, "oauth2:${realScopes.joinToString(" ")}")
if (realScopes.size == 1) authManager.setItCaveatTypes("2")
if (permitted) authManager.isPermitted = true
val authResponse = withContext(Dispatchers.IO) { authManager.requestAuthWithBackgroundResolution(true) }
var authResponse = withContext(Dispatchers.IO) { authManager.requestAuthWithBackgroundResolution(true) }
if (authResponse.auth == null) return false
if (authResponse.issueAdvice != "stored" || GamesConfigurationService.getPlayer(context, packageName, account) == null) {
if (authResponse.issueAdvice != "stored" || GamesConfigurationService.getPlayer(context, account) == null) {
suspend fun fetchSelfPlayer() = suspendCoroutine<JSONObject> { continuation ->
queue.add(
object : JsonObjectRequest(
Expand All @@ -237,39 +237,27 @@ suspend fun performGamesSignIn(
val result = try {
fetchSelfPlayer()
} catch (e: Exception) {
if (e is VolleyError && e.networkResponse?.statusCode == 404) {
registerForGames(context, account, queue)
fetchSelfPlayer()
if (e is VolleyError) {
val statusCode = e.networkResponse?.statusCode
when (statusCode) {
404 -> {
registerForGames(context, account, queue)
fetchSelfPlayer()
}
403 -> {
val gameAuthManager = AuthManager(context, account.name, GAMES_PACKAGE_NAME, authManager.service)
gameAuthManager.isPermitted = authManager.isPermitted
authResponse = withContext(Dispatchers.IO) { gameAuthManager.requestAuth(true) }
if (authResponse.auth == null) return false
fetchSelfPlayer()
}
else -> throw e
}
} else {
throw e
}
}
GamesConfigurationService.setPlayer(context, packageName, account, result.toString())
if (packageName != GAMES_PACKAGE_NAME) {
try {
suspendCoroutine { continuation ->
queue.add(object : Request<Unit>(Method.POST, "https://www.googleapis.com/games/v1/applications/played", {
continuation.resumeWithException(it)
}) {
override fun parseNetworkResponse(response: NetworkResponse): Response<Unit> {
if (response.statusCode == 204) return success(Unit, null)
return Response.error(VolleyError(response))
}

override fun deliverResponse(response: Unit) {
continuation.resume(response)
}

override fun getHeaders(): MutableMap<String, String> {
return mutableMapOf(
"Authorization" to "OAuth ${authResponse.auth}"
)
}
})
}
} catch (ignored: Exception) {
}
}
GamesConfigurationService.setPlayer(context, account, result.toString())
}
return true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
android:width="24dp"
android:height="24dp"
android:viewportWidth="225.27"
android:viewportHeight="225.27">
android:viewportHeight="225.27"
android:tint="?android:attr/colorControlNormal">
<group>
<path
android:pathData="m151.55,151.53a55,55 0,0 1,-66.39 8.74"
Expand Down
Loading

0 comments on commit 72c77ff

Please sign in to comment.