From 1e12e76233e4fc7189dbf6e82e72f370398f8197 Mon Sep 17 00:00:00 2001 From: Aykhan Date: Thu, 10 Oct 2024 12:49:08 +0400 Subject: [PATCH] Bump GMS version to 24.38.64 --- build.gradle | 4 +- gradle.properties | 5 +- play-services-core/build.gradle | 2 + .../src/main/res/layout/about_root.xml | 2 + .../src/main/res/layout/self_check_entry.xml | 3 - .../src/main/res/layout/self_check_group.xml | 2 - .../src/main/res/values-in/strings.xml | 54 +++++ .../src/main/res/values/strings.xml | 2 +- .../src/main/AndroidManifest.xml | 4 +- .../microg/gms/auth/login/LoginActivity.java | 16 +- .../org/microg/gms/ui/AskPushPermission.java | 68 +++--- .../gms/accountsettings/ui/MainActivity.kt | 9 +- .../gms/accountsettings/ui/extensions.kt | 1 + .../main/res/layout/ask_push_notification.xml | 88 +++----- .../src/main/res/layout/login_assistant.xml | 5 +- .../res/layout/login_assistant_loading.xml | 2 +- .../layout/preference_material_card_view.xml | 10 +- .../res/layout/preference_material_switch.xml | 1 - .../layout/preference_material_switch_bar.xml | 1 - .../main/res/layout/signin_account_row.xml | 1 - .../src/main/res/values-ar/strings.xml | 210 +++++++++--------- .../src/main/res/values-in/plurals.xml | 28 +++ .../src/main/res/values-in/strings.xml | 194 ++++++++++++++++ .../src/main/res/values-it/plurals.xml | 31 +++ .../src/main/res/values-it/strings.xml | 201 +++++++++++++++++ .../src/main/res/values-v27/themes.xml | 2 + .../src/main/res/values/themes.xml | 19 +- 27 files changed, 726 insertions(+), 239 deletions(-) create mode 100644 play-services-core/microg-ui-tools/src/main/res/values-in/strings.xml create mode 100644 play-services-core/src/main/res/values-in/plurals.xml create mode 100644 play-services-core/src/main/res/values-in/strings.xml create mode 100644 play-services-core/src/main/res/values-it/plurals.xml create mode 100644 play-services-core/src/main/res/values-it/strings.xml diff --git a/build.gradle b/build.gradle index 25544e0..afaafe0 100644 --- a/build.gradle +++ b/build.gradle @@ -82,8 +82,8 @@ allprojects { apply plugin: 'idea' group = 'org.microg.gms' - ext.appVersionName = "1.1" - ext.appVersionCode = 243136000 + ext.appVersionName = 2.0 + ext.appVersionCode = 243864000 ext.baseVersion = ext.appVersionCode.toString()[0..1] + '.' + ext.appVersionCode.toString()[2..3] + '.' + ext.appVersionCode.toString()[4..5] version = ext.appVersionName+" GMS-"+ext.baseVersion.replaceAll("\\.", "") ext.isReleaseVersion = false diff --git a/gradle.properties b/gradle.properties index 1f9fe5b..56d8420 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,5 @@ android.useAndroidX=true org.gradle.jvmargs=-Xmx4096m -XX:+UseParallelGC --add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED -android.enableJetifier=true -android.experimental.legacyTransform.forceNonIncremental=true android.nonFinalResIds=false -android.nonTransitiveRClass=false \ No newline at end of file +android.nonTransitiveRClass=false +org.gradle.configuration-cache=true \ No newline at end of file diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index 7a8aec7..2eeece8 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -23,6 +23,8 @@ dependencies { implementation "androidx.mediarouter:mediarouter:$mediarouterVersion" implementation "androidx.preference:preference-ktx:$preferenceVersion" implementation "androidx.webkit:webkit:$webkitVersion" + + // Material Components implementation "com.google.android.material:material:$materialVersion" // Navigation diff --git a/play-services-core/microg-ui-tools/src/main/res/layout/about_root.xml b/play-services-core/microg-ui-tools/src/main/res/layout/about_root.xml index 9c17f9a..c3d09bb 100644 --- a/play-services-core/microg-ui-tools/src/main/res/layout/about_root.xml +++ b/play-services-core/microg-ui-tools/src/main/res/layout/about_root.xml @@ -28,6 +28,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" + android:importantForAccessibility="no" android:src="@android:drawable/sym_def_app_icon" /> \ No newline at end of file diff --git a/play-services-core/microg-ui-tools/src/main/res/layout/self_check_entry.xml b/play-services-core/microg-ui-tools/src/main/res/layout/self_check_entry.xml index 57e5527..5f6f508 100644 --- a/play-services-core/microg-ui-tools/src/main/res/layout/self_check_entry.xml +++ b/play-services-core/microg-ui-tools/src/main/res/layout/self_check_entry.xml @@ -30,11 +30,8 @@ android:layout_height="match_parent" android:layout_weight="1" android:gravity="center_vertical" - android:layout_marginStart="8dp" - android:layout_marginEnd="8dp" android:orientation="vertical" android:baselineAligned="false" - android:layout_marginRight="8dp" android:layout_marginTop="8dp" android:layout_marginBottom="8dp"> diff --git a/play-services-core/microg-ui-tools/src/main/res/layout/self_check_group.xml b/play-services-core/microg-ui-tools/src/main/res/layout/self_check_group.xml index 5fc454c..b068b61 100644 --- a/play-services-core/microg-ui-tools/src/main/res/layout/self_check_group.xml +++ b/play-services-core/microg-ui-tools/src/main/res/layout/self_check_group.xml @@ -26,8 +26,6 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="16dp" - android:layout_marginStart="8dp" - android:layout_marginEnd="8dp" android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingLeft="?attr/listPreferredItemPaddingLeft" android:paddingTop="16dp" diff --git a/play-services-core/microg-ui-tools/src/main/res/values-in/strings.xml b/play-services-core/microg-ui-tools/src/main/res/values-in/strings.xml new file mode 100644 index 0000000..2b11492 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/res/values-in/strings.xml @@ -0,0 +1,54 @@ + + + + + Alat UI MicroG + Lisensi Apache 2.0, Tim microG + + Versi %1$s + %1$s %2$s + Semua hak dilindungi undang-undang + + Pengaturan + + Pemeriksaan Mandiri + Periksa apakah sistem sudah disiapkan dengan benar untuk menggunakan MicroG + + Izin yang diberikan + Izin untuk %1$s: + Sentuh di sini untuk memberikan izin. Tidak memberikan izin dapat menyebabkan aplikasi tidak berfungsi dengan baik + + Demo UI MicroG + Ringkasan + Versi v0.1.0 + Library yang disertakan + + Library Dukungan v4 + Library Dukungan appcompat v7 + Library Dukungan preferensi v7 + Lisensi Apache 2.0, Proyek Sumber Terbuka Android + + + + Periksa pembaruan + Versi baru tersedia! + Anda sudah menggunakan versi terbaru + Tidak dapat memeriksa pembaruan + + Kesalahan koneksi: + Kesalahan: + diff --git a/play-services-core/microg-ui-tools/src/main/res/values/strings.xml b/play-services-core/microg-ui-tools/src/main/res/values/strings.xml index 3543c74..a411463 100644 --- a/play-services-core/microg-ui-tools/src/main/res/values/strings.xml +++ b/play-services-core/microg-ui-tools/src/main/res/values/strings.xml @@ -44,7 +44,7 @@ - 1.1 + 2.0 diff --git a/play-services-core/src/main/AndroidManifest.xml b/play-services-core/src/main/AndroidManifest.xml index d062314..ace9d84 100644 --- a/play-services-core/src/main/AndroidManifest.xml +++ b/play-services-core/src/main/AndroidManifest.xml @@ -264,7 +264,7 @@ @@ -426,7 +426,7 @@ android:name="org.microg.gms.ui.AskPushPermission" android:excludeFromRecents="true" android:process=":ui" - android:theme="@style/AppTheme.Dialog" /> + android:theme="@style/AppThemeTransparent" /> = 29) { if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK)) { - WebSettingsCompat.setForceDark(webView.getSettings(), appIsDark ? WebSettingsCompat.FORCE_DARK_ON : WebSettingsCompat.FORCE_DARK_OFF); + WebSettingsCompat.setForceDark(webView.getSettings(), systemIsDark ? WebSettingsCompat.FORCE_DARK_ON : WebSettingsCompat.FORCE_DARK_OFF); } } diff --git a/play-services-core/src/main/java/org/microg/gms/ui/AskPushPermission.java b/play-services-core/src/main/java/org/microg/gms/ui/AskPushPermission.java index 6293694..122de88 100644 --- a/play-services-core/src/main/java/org/microg/gms/ui/AskPushPermission.java +++ b/play-services-core/src/main/java/org/microg/gms/ui/AskPushPermission.java @@ -1,13 +1,19 @@ package org.microg.gms.ui; import android.app.Activity; +import android.content.DialogInterface; +import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.graphics.Typeface; import android.os.Bundle; import android.os.ResultReceiver; +import android.text.Html; import android.text.Spannable; import android.text.SpannableString; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.SpannedString; import android.text.style.StyleSpan; import android.view.View; import android.widget.TextView; @@ -18,6 +24,11 @@ import com.google.android.gms.R; import org.microg.gms.gcm.GcmDatabase; +import org.microg.gms.gcm.PushRegisterService; + +import static org.microg.gms.gcm.GcmConstants.EXTRA_APP; +import static org.microg.gms.gcm.GcmConstants.EXTRA_KID; +import static org.microg.gms.gcm.GcmConstants.EXTRA_PENDING_INTENT; public class AskPushPermission extends FragmentActivity { public static final String EXTRA_REQUESTED_PACKAGE = "package"; @@ -51,10 +62,8 @@ public void onCreate(Bundle savedInstanceState) { return; } - View gcmView = getLayoutInflater().inflate(R.layout.ask_push_notification, null); - - // Create and show the AlertDialog try { + View view = getLayoutInflater().inflate(R.layout.ask_push_notification, null); PackageManager pm = getPackageManager(); final ApplicationInfo info = pm.getApplicationInfo(packageName, 0); String label = pm.getApplicationLabel(info).toString(); @@ -62,36 +71,29 @@ public void onCreate(Bundle savedInstanceState) { SpannableString s = new SpannableString(raw); s.setSpan(new StyleSpan(Typeface.BOLD), raw.indexOf(label), raw.indexOf(label) + label.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE); - AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this); - alertDialogBuilder.setCancelable(false); // Disable canceling the dialog by tapping outside or pressing the back button - alertDialogBuilder.setView(gcmView); - ((TextView) gcmView.findViewById(R.id.permission_message)).setText(s); - gcmView.findViewById(R.id.permission_allow_button).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (answered) return; - database.noteAppKnown(packageName, true); - answered = true; - Bundle bundle = new Bundle(); - bundle.putBoolean(EXTRA_EXPLICIT, true); - resultReceiver.send(Activity.RESULT_OK, bundle); - finish(); - } - }); - gcmView.findViewById(R.id.permission_deny_button).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (answered) return; - database.noteAppKnown(packageName, false); - answered = true; - Bundle bundle = new Bundle(); - bundle.putBoolean(EXTRA_EXPLICIT, true); - resultReceiver.send(Activity.RESULT_CANCELED, bundle); - finish(); - } - }); - AlertDialog alertDialog = alertDialogBuilder.create(); - alertDialog.show(); + ((TextView) view.findViewById(R.id.permission_message)).setText(s); + UtilsKt.buildAlertDialog(this) + .setView(view) + .setPositiveButton(R.string.allow, (dialog, which) -> { + if (answered) return; + database.noteAppKnown(packageName, true); + answered = true; + Bundle bundle = new Bundle(); + bundle.putBoolean(EXTRA_EXPLICIT, true); + resultReceiver.send(Activity.RESULT_OK, bundle); + finish(); + }) + .setNegativeButton(R.string.deny, (dialog, which) -> { + if (answered) return; + database.noteAppKnown(packageName, false); + answered = true; + Bundle bundle = new Bundle(); + bundle.putBoolean(EXTRA_EXPLICIT, true); + resultReceiver.send(Activity.RESULT_CANCELED, bundle); + finish(); + }) + .create() + .show(); } catch (PackageManager.NameNotFoundException e) { finish(); } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/MainActivity.kt b/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/MainActivity.kt index db66700..fedc4f8 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/MainActivity.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/MainActivity.kt @@ -7,7 +7,9 @@ package org.microg.gms.accountsettings.ui import android.accounts.Account import android.accounts.AccountManager +import android.annotation.SuppressLint import android.os.Bundle +import android.text.TextUtils import android.util.Log import android.view.View import android.webkit.WebView @@ -35,6 +37,7 @@ private val SCREEN_ID_TO_URL = hashMapOf( 214 to "https://myaccount.google.com/dashboard", 215 to "https://takeout.google.com", 216 to "https://myaccount.google.com/inactive", + 218 to "https://myaccount.google.com/profile-picture?interop=o", 219 to "https://myactivity.google.com/myactivity", 220 to "https://www.google.com/maps/timeline", 224 to "https://myactivity.google.com/activitycontrols?settings=search", @@ -129,6 +132,8 @@ class MainActivity : AppCompatActivity() { super.onCreate(savedInstanceState) val screenId = intent?.getIntExtra(EXTRA_SCREEN_ID, -1).takeIf { it != -1 } ?: ACTION_TO_SCREEN_ID[intent.action] ?: 1 + val product = intent?.getStringExtra(EXTRA_SCREEN_MY_ACTIVITY_PRODUCT) + val screenOptions = intent.extras?.keySet().orEmpty() .filter { it.startsWith(EXTRA_SCREEN_OPTIONS_PREFIX) } .map { it.substring(EXTRA_SCREEN_OPTIONS_PREFIX.length) to intent.getStringExtra(it) } @@ -148,6 +153,7 @@ class MainActivity : AppCompatActivity() { } if (screenId in SCREEN_ID_TO_URL) { + val screenUrl = SCREEN_ID_TO_URL[screenId]?.run { if (screenId == 547 && !product.isNullOrEmpty()) { replace("search", product) } else { this } } val layout = RelativeLayout(this) layout.addView(ProgressBar(this).apply { layoutParams = RelativeLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT).apply { @@ -162,7 +168,7 @@ class MainActivity : AppCompatActivity() { } layout.addView(webView) setContentView(layout) - WebViewHelper(this, webView, ALLOWED_WEB_PREFIXES).openWebView(SCREEN_ID_TO_URL[screenId], accountName) + WebViewHelper(this, webView, ALLOWED_WEB_PREFIXES).openWebView(screenUrl, accountName) setResult(RESULT_OK) } else { Log.w(TAG, "Unknown screen id, can't open corresponding web page") @@ -175,6 +181,7 @@ class MainActivity : AppCompatActivity() { super.onDestroy() } + @SuppressLint("MissingSuperCall") override fun onBackPressed() { if (this::webView.isInitialized && webView.canGoBack()) { webView.goBack() diff --git a/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/extensions.kt b/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/extensions.kt index 5ca88fe..ddf9f1f 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/extensions.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/extensions.kt @@ -19,5 +19,6 @@ const val EXTRA_SCREEN_OPTIONS_PREFIX = "extra.screen." const val EXTRA_FALLBACK_URL = "extra.fallbackUrl" const val EXTRA_FALLBACK_AUTH = "extra.fallbackAuth" const val EXTRA_THEME_CHOICE = "extra.themeChoice" +const val EXTRA_SCREEN_MY_ACTIVITY_PRODUCT = "extra.screen.myactivityProduct" const val OPTION_SCREEN_FLAVOR = "screenFlavor" \ No newline at end of file diff --git a/play-services-core/src/main/res/layout/ask_push_notification.xml b/play-services-core/src/main/res/layout/ask_push_notification.xml index dc45524..1b3ad57 100644 --- a/play-services-core/src/main/res/layout/ask_push_notification.xml +++ b/play-services-core/src/main/res/layout/ask_push_notification.xml @@ -1,4 +1,5 @@ - - - + + + + + - - - - - - - - - - - -