Skip to content

Commit

Permalink
Bump GMS version to 24.38.64
Browse files Browse the repository at this point in the history
  • Loading branch information
AykhanUV committed Oct 10, 2024
1 parent 508e107 commit 1e12e76
Show file tree
Hide file tree
Showing 27 changed files with 726 additions and 239 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
android.nonTransitiveRClass=false
org.gradle.configuration-cache=true
2 changes: 2 additions & 0 deletions play-services-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" />

<TextView
Expand Down Expand Up @@ -87,6 +88,7 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:divider="@null"
android:nestedScrollingEnabled="true"
tools:listitem="@android:layout/simple_list_item_2" />
</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -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">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2013-2017 microG Project Team
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<resources>
<string name="lib_name">Alat UI MicroG</string>
<string name="lib_license">Lisensi Apache 2.0, Tim microG</string>

<string name="about_version_str">Versi %1$s</string>
<string name="about_name_version_str">%1$s %2$s</string>
<string name="about_default_license">Semua hak dilindungi undang-undang</string>

<string name="prefcat_setup">Pengaturan</string>

<string name="self_check_title">Pemeriksaan Mandiri</string>
<string name="self_check_desc">Periksa apakah sistem sudah disiapkan dengan benar untuk menggunakan MicroG</string>

<string name="self_check_cat_permissions">Izin yang diberikan</string>
<string name="self_check_name_permission">Izin untuk %1$s:</string>
<string name="self_check_resolution_permission">Sentuh di sini untuk memberikan izin. Tidak memberikan izin dapat menyebabkan aplikasi tidak berfungsi dengan baik</string>

<string name="about_root_title">Demo UI MicroG</string>
<string name="about_root_summary">Ringkasan</string>
<string name="about_root_version">Versi v0.1.0</string>
<string name="about_root_libraries">Library yang disertakan</string>

<string name="about_android_support_v4">Library Dukungan v4</string>
<string name="about_android_support_v7_appcompat">Library Dukungan appcompat v7</string>
<string name="about_android_support_v7_preference">Library Dukungan preferensi v7</string>
<string name="about_android_support_license">Lisensi Apache 2.0, Proyek Sumber Terbuka Android</string>

<!-- Updater strings-->

<string name="check_updates">Periksa pembaruan</string>
<string name="update_available">Versi baru tersedia!</string>
<string name="no_update_available">Anda sudah menggunakan versi terbaru</string>
<string name="check_updates_error">Tidak dapat memeriksa pembaruan</string>

<string name="error_connection">Kesalahan koneksi:</string>
<string name="error_others">Kesalahan:</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

<!-- UpdateChecker tag controller-->

<string name="github_tag_version">1.1</string>
<string name="github_tag_version">2.0</string>

<!-- Updater strings-->

Expand Down
4 changes: 2 additions & 2 deletions play-services-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@

<activity
android:name="org.microg.gms.auth.login.LoginActivity"
android:configChanges="keyboardHidden|keyboard|screenSize"
android:configChanges="uiMode|keyboardHidden|keyboard|screenSize"
android:exported="true"
android:process=":ui"
android:theme="@style/LoginTheme">
Expand Down Expand Up @@ -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" />

<activity
android:name="org.microg.gms.ui.SelfCheckFragment$AsActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import android.widget.TextView;

import androidx.annotation.StringRes;
import androidx.preference.PreferenceManager;
import androidx.webkit.WebSettingsCompat;
import androidx.webkit.WebViewClientCompat;
import androidx.webkit.WebViewFeature;
Expand Down Expand Up @@ -193,7 +192,6 @@ protected void onHuaweiButtonClicked() {
super.onHuaweiButtonClicked();
state++;
if (state == 1) {
PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean("pref_hide_launcher_icon", false).apply();
if (!isSpoofingEnabled(this)) {
LastCheckinInfo.clear(this);
setSpoofingEnabled(this, true);
Expand Down Expand Up @@ -231,19 +229,23 @@ private void init() {
}
}

private static boolean isSystemDarkTheme(Context context) {
int nightModeFlags = context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
return nightModeFlags == Configuration.UI_MODE_NIGHT_YES;
}

private static WebView createWebView(Context context) {
Context themedContext = new ContextThemeWrapper(context, R.style.LoginTheme);
boolean systemIsDark = isSystemDarkTheme(context);

WebView webView = new WebView(themedContext);
WebView webView = new WebView(context);
webView.setVisibility(View.INVISIBLE);
webView.setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
webView.setBackgroundColor(Color.TRANSPARENT);

boolean appIsDark = (themedContext.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;

// Apply dark theme to WebView based on system state
if (Build.VERSION.SDK_INT >= 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);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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";
Expand Down Expand Up @@ -51,47 +62,38 @@ 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();
String raw = getString(R.string.gcm_allow_app_popup, label);
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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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) }
Expand All @@ -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 {
Expand All @@ -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")
Expand All @@ -175,6 +181,7 @@ class MainActivity : AppCompatActivity() {
super.onDestroy()
}

@SuppressLint("MissingSuperCall")
override fun onBackPressed() {
if (this::webView.isInitialized && webView.canGoBack()) {
webView.goBack()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading

0 comments on commit 1e12e76

Please sign in to comment.