Compare commits

...
Message SHA1
Auth: improve handling of network and timeout exceptions
https://github.com/microg/GmsCore/pull/3220
Signed-off-by: Cuynu <cuynu@proton.me>

Cuynu   commited 2026-05-01 14:46:20 +07:00
e8b5a02903
add lavender profile
cuynu   commited 2025-03-22 16:30:00 +07:00
843497509c
Revert "Add preference for play licensing microg@4ef2248"
cuynu   commited 2025-03-22 15:54:30 +07:00
b9ceaea14f
Revert "Add preference for play licensing microg@4ef2248"
This reverts commit 9a12599b

cuynu   commited 2025-03-22 15:51:40 +07:00
ef31eda600
make back to vanced+ option clickable
cuynu   commited 2025-03-22 15:48:45 +07:00
d55ee374ad
bump 25.09.34
cuynu   commited 2025-03-22 15:35:49 +07:00
d65e8c359c
up gradle 8.1
cuynu   commited 2025-03-22 15:34:55 +07:00
299785daaf
UI: Unify preferences "microg@d831bbc"
cuynu   commited 2024-10-02 23:46:17 +07:00
b96a8d4727
update play icon
cuynu   commited 2024-10-02 17:34:44 +07:00
97d91d8c45
Themes + Material3 improvements "microg@b62f089" "microg@4fc5b75"
cuynu   commited 2024-10-02 17:12:35 +07:00
3f7d3cb596
microG settings must be exported
cuynu   commited 2024-10-02 16:29:52 +07:00
46369ca844
No hardcoded application name in setting permission uses "microg@2b186fd"
cuynu   commited 2024-10-02 16:26:10 +07:00
82e7c9fd46
No hardcoded application name in setting permission names "microg@53c683a"
cuynu   commited 2024-10-02 16:25:30 +07:00
f52534c2be
Expose settings via signature level permission "microg@05ca063"
cuynu   commited 2024-10-02 16:23:18 +07:00
1bb77401e0
Add preference for play licensing microg@4ef2248
cuynu   commited 2024-10-02 16:18:37 +07:00
9a12599b40
move serial preference to other category
cuynu   commited 2024-09-27 00:00:54 +07:00
b3e0e54545
switch to monthly for now
cuynu   commited 2024-09-26 23:56:16 +07:00
7a5ae620b2
bump gms 24.38.32
cuynu   commited 2024-09-26 23:55:42 +07:00
34a0e32b2a
bump gradle 8.0.2
cuynu   commited 2024-09-26 23:54:18 +07:00
31955e783e
test compile with targetSdk 33
cuynu   commited 2024-09-26 23:21:02 +07:00
99177daf0f
set FLAG_IMMUTABLE flag
cuynu   commited 2024-09-26 23:20:33 +07:00
320320c24a
android id must be visible
cuynu   commited 2024-09-26 23:20:02 +07:00
81ea45af34
set FlAG_IMMUTABLE flag
cuynu   commited 2024-09-26 23:19:37 +07:00
5c93d71dba
show serial
cuynu   commited 2024-09-26 23:17:58 +07:00
195673c14b
add new profile
cuynu   commited 2024-09-26 23:17:21 +07:00
fccdc9c288
63 changed files with 1057 additions and 1024 deletions

View file

@ -28,7 +28,7 @@ buildscript {
ext.wireVersion = '4.8.0' ext.wireVersion = '4.8.0'
ext.androidBuildGradleVersion = '8.0.0' ext.androidBuildGradleVersion = '8.0.2'
ext.androidBuildVersionTools = '33.0.2' ext.androidBuildVersionTools = '33.0.2'
ext.androidMinSdk = 23 ext.androidMinSdk = 23
@ -48,7 +48,7 @@ buildscript {
} }
def gmsVersion = "24.28.34" def gmsVersion = "25.09.34"
def gmsVersionCode = Integer.parseInt(gmsVersion.replaceAll('\\.', '')) def gmsVersionCode = Integer.parseInt(gmsVersion.replaceAll('\\.', ''))
def ourVersionBase = "0.3.0" def ourVersionBase = "0.3.0"

Binary file not shown.

View file

@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

29
gradlew vendored
View file

@ -83,10 +83,8 @@ done
# This is normally unused # This is normally unused
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum
@ -133,10 +131,13 @@ location of your Java installation."
fi fi
else else
JAVACMD=java JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #( case $MAX_FD in #(
max*) max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045 # shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) || MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit" warn "Could not query maximum file descriptor limit"
esac esac
@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #( '' | soft) :;; #(
*) *)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045 # shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" || ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD" warn "Could not set maximum file descriptor limit to $MAX_FD"
esac esac
@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done done
fi fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
# shell script including quotes and variable substitutions, so put them in DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded. # Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \

View file

@ -6,11 +6,18 @@
<manifest xmlns:tools="http://schemas.android.com/tools" <manifest xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"> xmlns:android="http://schemas.android.com/apk/res/android">
<permission android:name="${applicationId}.permission.WRITE_SETTINGS"
android:protectionLevel="normal" />
<permission android:name="${applicationId}.permission.WRITE_SETTINGS"
android:protectionLevel="normal" />
<application> <application>
<provider <provider
android:name="org.microg.gms.settings.SettingsProvider" android:name="org.microg.gms.settings.SettingsProvider"
android:authorities="${applicationId}.microg.settings" android:authorities="${applicationId}.microg.settings"
android:exported="false" /> android:exported="true"
android:readPermission="${applicationId}.permission.READ_SETTINGS"
android:writePermission="${applicationId}.permission.WRITE_SETTINGS" />
<provider <provider
android:name="org.microg.gms.profile.ProfileProvider" android:name="org.microg.gms.profile.ProfileProvider"

View file

@ -22,7 +22,6 @@ object SettingsContract {
const val SECURITY_TOKEN = "securityToken" const val SECURITY_TOKEN = "securityToken"
const val VERSION_INFO = "versionInfo" const val VERSION_INFO = "versionInfo"
const val DEVICE_DATA_VERSION_INFO = "deviceDataVersionInfo" const val DEVICE_DATA_VERSION_INFO = "deviceDataVersionInfo"
const val BRAND_SPOOF = "brandSpoof" const val BRAND_SPOOF = "brandSpoof"
const val HIDE_LAUNCHER_ICON = "hideLauncherIcon" const val HIDE_LAUNCHER_ICON = "hideLauncherIcon"

View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ SPDX-FileCopyrightText: 2023 microG Project Team
~ SPDX-License-Identifier: Apache-2.0
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:paddingStart="?attr/listPreferredItemPaddingStart"
android:paddingLeft="?attr/listPreferredItemPaddingLeft"
android:paddingTop="24dp"
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
android:paddingRight="?attr/listPreferredItemPaddingRight"
android:paddingBottom="16dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:id="@android:id/icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:antialias="true"
android:scaleType="fitCenter"
tools:src="@android:mipmap/sym_def_app_icon" />
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:ellipsize="marquee"
android:gravity="center"
android:singleLine="false"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="?android:attr/textColorPrimary"
android:textSize="20sp"
tools:text="@tools:sample/lorem" />
</LinearLayout>
</RelativeLayout>

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ SPDX-FileCopyrightText: 2020 microG Project Team
~ SPDX-License-Identifier: Apache-2.0
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:gravity="center"
android:orientation="horizontal"
android:paddingStart="?attr/listPreferredItemPaddingStart"
android:paddingLeft="?attr/listPreferredItemPaddingLeft"
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
android:paddingRight="?attr/listPreferredItemPaddingRight"
tools:background="?attr/colorControlActivated">
<TextView
android:id="@android:id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="2"
android:paddingStart="56dp"
android:paddingLeft="56dp"
android:textAppearance="?attr/textAppearanceListItem"
android:textColor="?android:attr/textColorPrimaryInverse"
tools:text="Enabled" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_widget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@null"
app:thumbTint="?android:attr/textColorPrimaryInverse"
app:trackTint="?android:attr/textColorSecondaryInverse"
tools:checked="true" />
</LinearLayout>

View file

@ -57,7 +57,7 @@ android {
defaultConfig { defaultConfig {
versionName version versionName version
versionCode appVersionCode versionCode appVersionCode
resConfigs 'xxhdpi' resourceConfigurations += ['xxhdpi']
minSdkVersion androidMinSdk minSdkVersion androidMinSdk
targetSdkVersion androidTargetSdk targetSdkVersion androidTargetSdk

View file

@ -3,7 +3,7 @@ package org.microg.tools.ui;
import android.os.Bundle; import android.os.Bundle;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.appcompat.widget.Toolbar;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
@ -19,6 +19,7 @@ public abstract class AbstractSettingsActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.settings_activity); setContentView(R.layout.settings_activity);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
if (showHomeAsUp) { if (showHomeAsUp) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} }

View file

@ -19,6 +19,14 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme" />
<org.microg.tools.ui.SwitchBar <org.microg.tools.ui.SwitchBar
android:id="@+id/switch_bar" android:id="@+id/switch_bar"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -25,14 +25,17 @@
android:name="${basePackageName}.android.c2dm.permission.RECEIVE" android:name="${basePackageName}.android.c2dm.permission.RECEIVE"
android:label="@string/perm_c2dm_receive_label" android:label="@string/perm_c2dm_receive_label"
android:permissionGroup="android.permission-group.NETWORK" android:permissionGroup="android.permission-group.NETWORK"
tools:node="remove"
android:protectionLevel="normal" /> android:protectionLevel="normal" />
<permission <permission
android:name="${basePackageName}.android.c2dm.permission.SEND" android:name="${basePackageName}.android.c2dm.permission.SEND"
android:label="@string/perm_c2dm_send_label" android:label="@string/perm_c2dm_send_label"
android:permissionGroup="android.permission-group.NETWORK" android:permissionGroup="android.permission-group.NETWORK"
tools:node="remove"
android:protectionLevel="privileged|signature" /> android:protectionLevel="privileged|signature" />
<permission <permission
android:name="${basePackageName}.android.gtalkservice.permission.GTALK_SERVICE" android:name="${basePackageName}.android.gtalkservice.permission.GTALK_SERVICE"
tools:node="remove"
android:label="@string/perm_gtalk_svc_label" android:label="@string/perm_gtalk_svc_label"
android:permissionGroup="android.permission-group.MESSAGES" android:permissionGroup="android.permission-group.MESSAGES"
android:protectionLevel="signature" /> android:protectionLevel="signature" />
@ -53,7 +56,7 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
@ -62,7 +65,8 @@
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /> <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" /> <uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" /> <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" /> <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" /> <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.READ_SYNC_STATS" /> <uses-permission android:name="android.permission.READ_SYNC_STATS" />
@ -90,7 +94,7 @@
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:multiArch="true" android:multiArch="true"
android:theme="@style/AppTheme" android:theme="@style/Theme.App"
android:networkSecurityConfig="@xml/network_security_config" android:networkSecurityConfig="@xml/network_security_config"
tools:targetApi="r"> tools:targetApi="r">
@ -101,7 +105,7 @@
<provider <provider
android:name="org.microg.gms.settings.SettingsProvider" android:name="org.microg.gms.settings.SettingsProvider"
android:authorities="${applicationId}.microg.settings" android:authorities="${applicationId}.microg.settings"
android:exported="false" /> android:exported="true" />
<!-- Services Framework --> <!-- Services Framework -->
@ -116,13 +120,15 @@
<!-- Device Checkin --> <!-- Device Checkin -->
<service android:name="org.microg.gms.checkin.CheckinService"> <service android:name="org.microg.gms.checkin.CheckinService"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="com.google.android.gms.checkin.BIND_TO_SERVICE" /> <action android:name="com.google.android.gms.checkin.BIND_TO_SERVICE" />
</intent-filter> </intent-filter>
</service> </service>
<receiver android:name="org.microg.gms.checkin.TriggerReceiver"> <receiver android:name="org.microg.gms.checkin.TriggerReceiver"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.AIRPLANE_MODE" /> <action android:name="android.intent.action.AIRPLANE_MODE" />
@ -150,6 +156,7 @@
<!-- Cloud Messaging --> <!-- Cloud Messaging -->
<service <service
android:name="org.microg.gms.gcm.PushRegisterService" android:name="org.microg.gms.gcm.PushRegisterService"
android:exported="true"
android:process=":persistent"> android:process=":persistent">
<intent-filter> <intent-filter>
<action android:name="${basePackageName}.android.c2dm.intent.REGISTER" /> <action android:name="${basePackageName}.android.c2dm.intent.REGISTER" />
@ -161,6 +168,7 @@
<receiver <receiver
android:name="org.microg.gms.gcm.PushRegisterReceiver" android:name="org.microg.gms.gcm.PushRegisterReceiver"
android:exported="true"
android:process=":persistent"> android:process=":persistent">
<intent-filter> <intent-filter>
<action android:name="${basePackageName}.iid.TOKEN_REQUEST" /> <action android:name="${basePackageName}.iid.TOKEN_REQUEST" />
@ -173,6 +181,7 @@
<receiver <receiver
android:name="org.microg.gms.gcm.SendReceiver" android:name="org.microg.gms.gcm.SendReceiver"
android:exported="true"
android:process=":persistent"> android:process=":persistent">
<intent-filter> <intent-filter>
<action android:name="com.google.android.gcm.intent.SEND" /> <action android:name="com.google.android.gcm.intent.SEND" />
@ -185,6 +194,7 @@
<receiver <receiver
android:name="org.microg.gms.gcm.TriggerReceiver" android:name="org.microg.gms.gcm.TriggerReceiver"
android:exported="true"
android:process=":persistent"> android:process=":persistent">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.intent.action.BOOT_COMPLETED" />
@ -208,6 +218,7 @@
<receiver <receiver
android:name="org.microg.gms.gcm.UnregisterReceiver" android:name="org.microg.gms.gcm.UnregisterReceiver"
android:exported="true"
android:process=":persistent"> android:process=":persistent">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.PACKAGE_DATA_CLEARED" /> <action android:name="android.intent.action.PACKAGE_DATA_CLEARED" />
@ -220,7 +231,8 @@
<!-- Auth --> <!-- Auth -->
<service android:name="org.microg.gms.auth.loginservice.GoogleLoginService"> <service android:name="org.microg.gms.auth.loginservice.GoogleLoginService"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.accounts.AccountAuthenticator" /> <action android:name="android.accounts.AccountAuthenticator" />
</intent-filter> </intent-filter>
@ -278,6 +290,7 @@
<activity <activity
android:name="org.microg.gms.auth.credentials.CredentialPickerActivity" android:name="org.microg.gms.auth.credentials.CredentialPickerActivity"
android:exported="true"
android:process=":ui"> android:process=":ui">
<intent-filter> <intent-filter>
<action android:name="com.google.android.gms.auth.api.credentials.PICKER" /> <action android:name="com.google.android.gms.auth.api.credentials.PICKER" />
@ -285,19 +298,22 @@
</intent-filter> </intent-filter>
</activity> </activity>
<service android:name="org.microg.gms.auth.credentials.CredentialsService"> <service android:name="org.microg.gms.auth.credentials.CredentialsService"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="com.google.android.gms.auth.api.credentials.service.START" /> <action android:name="com.google.android.gms.auth.api.credentials.service.START" />
</intent-filter> </intent-filter>
</service> </service>
<service android:name="org.microg.gms.auth.proxy.AuthProxyService"> <service android:name="org.microg.gms.auth.proxy.AuthProxyService"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="com.google.android.gms.auth.service.START" /> <action android:name="com.google.android.gms.auth.service.START" />
</intent-filter> </intent-filter>
</service> </service>
<service android:name="org.microg.gms.auth.appcert.AppCertService"> <service android:name="org.microg.gms.auth.appcert.AppCertService"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="com.google.android.gms.auth.be.appcert.AppCertService" /> <action android:name="com.google.android.gms.auth.be.appcert.AppCertService" />
</intent-filter> </intent-filter>
@ -305,7 +321,8 @@
<!-- microG Settings shown in Launcher --> <!-- microG Settings shown in Launcher -->
<activity <activity
android:name="org.microg.gms.ui.SettingsActivity" android:name="org.microg.gms.ui.MainSettingsActivity"
android:exported="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/gms_settings_name" android:label="@string/gms_settings_name"
android:process=":ui" android:process=":ui"
@ -322,7 +339,7 @@
<activity-alias <activity-alias
android:name="org.microg.gms.ui.SettingsActivityLauncher" android:name="org.microg.gms.ui.SettingsActivityLauncher"
android:targetActivity="org.microg.gms.ui.SettingsActivity" android:targetActivity="org.microg.gms.ui.MainSettingsActivity"
android:enabled="false" android:enabled="false"
android:exported="true"> android:exported="true">
@ -336,10 +353,11 @@
<!-- microG Settings embedded in System Settings on SDK 23 and newer --> <!-- microG Settings embedded in System Settings on SDK 23 and newer -->
<activity-alias <activity-alias
android:name="org.microg.gms.ui.SettingsActivityLink" android:name="org.microg.gms.ui.SettingsActivityLink"
android:exported="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/gms_settings_name" android:label="@string/gms_settings_name"
android:process=":ui" android:process=":ui"
android:targetActivity="org.microg.gms.ui.SettingsActivity" android:targetActivity="org.microg.gms.ui.MainSettingsActivity"
android:taskAffinity="org.microg.gms.settings" android:taskAffinity="org.microg.gms.settings"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<intent-filter> <intent-filter>
@ -362,7 +380,7 @@
android:name="com.google.android.gms.app.settings.GoogleSettingsLink" android:name="com.google.android.gms.app.settings.GoogleSettingsLink"
android:process=":ui" android:process=":ui"
android:exported="true" android:exported="true"
android:targetActivity="org.microg.gms.ui.SettingsActivity" android:targetActivity="org.microg.gms.ui.MainSettingsActivity"
android:taskAffinity="org.microg.gms.settings"> android:taskAffinity="org.microg.gms.settings">
</activity-alias> </activity-alias>
@ -380,7 +398,8 @@
<activity <activity
android:name="org.microg.gms.accountsettings.ui.MainActivity" android:name="org.microg.gms.accountsettings.ui.MainActivity"
android:process=":ui" android:process=":ui"
android:exported="false" android:exported="true"
android:enabled="true"
android:taskAffinity="org.microg.gms.settings" android:taskAffinity="org.microg.gms.settings"
android:theme="@style/Theme.LoginBlue.Base"> android:theme="@style/Theme.LoginBlue.Base">
<intent-filter> <intent-filter>
@ -409,14 +428,16 @@
<!-- Other --> <!-- Other -->
<service android:name="org.microg.gms.auth.SignInService"> <service android:name="org.microg.gms.auth.SignInService"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="com.google.android.gms.signin.service.START" /> <action android:name="com.google.android.gms.signin.service.START" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
</service> </service>
<service android:name="org.microg.gms.DummyService"> <service android:name="org.microg.gms.DummyService"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="com.google.android.gms.accounts.ACCOUNT_SERVICE" /> <action android:name="com.google.android.gms.accounts.ACCOUNT_SERVICE" />
<action android:name="com.google.android.gms.identity.service.BIND" /> <action android:name="com.google.android.gms.identity.service.BIND" />

View file

@ -25,9 +25,9 @@ import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE; import static android.view.View.VISIBLE;
import static android.view.inputmethod.InputMethodManager.SHOW_IMPLICIT; import static android.view.inputmethod.InputMethodManager.SHOW_IMPLICIT;
import static org.microg.gms.auth.AuthPrefs.isAuthVisible; import static org.microg.gms.auth.AuthPrefs.isAuthVisible;
import static org.microg.gms.checkin.CheckinPrefs.hideLauncherIcon; import static org.microg.gms.checkin.CheckinPreferences.hideLauncherIcon;
import static org.microg.gms.checkin.CheckinPrefs.isSpoofingEnabled; import static org.microg.gms.checkin.CheckinPreferences.isSpoofingEnabled;
import static org.microg.gms.checkin.CheckinPrefs.setSpoofingEnabled; import static org.microg.gms.checkin.CheckinPreferences.setSpoofingEnabled;
import static org.microg.gms.common.Constants.GMS_PACKAGE_NAME; import static org.microg.gms.common.Constants.GMS_PACKAGE_NAME;
import static org.microg.gms.common.Constants.GMS_VERSION_CODE; import static org.microg.gms.common.Constants.GMS_VERSION_CODE;

View file

@ -104,7 +104,7 @@ class AccountAuthenticator extends AbstractAccountAuthenticator {
} }
} catch (Exception e) { } catch (Exception e) {
Log.w(TAG, e); Log.w(TAG, e);
return null; throw new NetworkErrorException(e);
} }
return null; return null;
} }

View file

@ -16,7 +16,7 @@
package org.microg.gms.checkin; package org.microg.gms.checkin;
import static org.microg.gms.checkin.CheckinPrefs.isSpoofingEnabled; import static org.microg.gms.checkin.CheckinPreferences.isSpoofingEnabled;
import android.accounts.Account; import android.accounts.Account;
import android.accounts.AccountManager; import android.accounts.AccountManager;
@ -43,7 +43,7 @@ public class CheckinManager {
LastCheckinInfo info = LastCheckinInfo.read(context); LastCheckinInfo info = LastCheckinInfo.read(context);
if (!force && info.getLastCheckin() > System.currentTimeMillis() - MIN_CHECKIN_INTERVAL) if (!force && info.getLastCheckin() > System.currentTimeMillis() - MIN_CHECKIN_INTERVAL)
return null; return null;
if (!CheckinPrefs.isEnabled(context)) if (!CheckinPreferences.isEnabled(context))
return null; return null;
List<CheckinClient.Account> accounts = new ArrayList<>(); List<CheckinClient.Account> accounts = new ArrayList<>();
AccountManager accountManager = AccountManager.get(context); AccountManager accountManager = AccountManager.get(context);

View file

@ -80,7 +80,7 @@ public class CheckinService extends IntentService {
protected void onHandleIntent(Intent intent) { protected void onHandleIntent(Intent intent) {
try { try {
ForegroundServiceContext.completeForegroundService(this, intent, TAG); ForegroundServiceContext.completeForegroundService(this, intent, TAG);
if (CheckinPrefs.isEnabled(this)) { if (CheckinPreferences.isEnabled(this)) {
LastCheckinInfo info = CheckinManager.checkin(this, intent.getBooleanExtra(EXTRA_FORCE_CHECKIN, false)); LastCheckinInfo info = CheckinManager.checkin(this, intent.getBooleanExtra(EXTRA_FORCE_CHECKIN, false));
if (info != null) { if (info != null) {
Log.d(TAG, "Checked in as " + Long.toHexString(info.getAndroidId())); Log.d(TAG, "Checked in as " + Long.toHexString(info.getAndroidId()));
@ -124,7 +124,7 @@ public class CheckinService extends IntentService {
static void schedule(Context context) { static void schedule(Context context) {
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
PendingIntent pendingIntent = PendingIntent.getService(context, TriggerReceiver.class.getName().hashCode(), new Intent(context, TriggerReceiver.class), PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT); PendingIntent pendingIntent = PendingIntent.getService(context, TriggerReceiver.class.getName().hashCode(), new Intent(context, TriggerReceiver.class), PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);
alarmManager.set(AlarmManager.RTC, Math.max(LastCheckinInfo.read(context).getLastCheckin() + REGULAR_CHECKIN_INTERVAL, System.currentTimeMillis() + BACKUP_CHECKIN_DELAY), pendingIntent); alarmManager.set(AlarmManager.RTC, Math.max(LastCheckinInfo.read(context).getLastCheckin() + REGULAR_CHECKIN_INTERVAL, System.currentTimeMillis() + BACKUP_CHECKIN_DELAY), pendingIntent);
} }
} }

View file

@ -41,7 +41,7 @@ public class TriggerReceiver extends WakefulBroadcastReceiver {
try { try {
boolean force = "android.provider.Telephony.SECRET_CODE".equals(intent.getAction()); boolean force = "android.provider.Telephony.SECRET_CODE".equals(intent.getAction());
if (CheckinPrefs.isEnabled(context) || force) { if (CheckinPreferences.isEnabled(context) || force) {
if (LastCheckinInfo.read(context).getLastCheckin() > System.currentTimeMillis() - REGULAR_CHECKIN_INTERVAL && !force) { if (LastCheckinInfo.read(context).getLastCheckin() > System.currentTimeMillis() - REGULAR_CHECKIN_INTERVAL && !force) {
CheckinService.schedule(context); CheckinService.schedule(context);
return; return;

View file

@ -209,7 +209,7 @@ public class McsService extends Service implements Handler.Callback {
super.onCreate(); super.onCreate();
TriggerReceiver.register(this); TriggerReceiver.register(this);
database = new GcmDatabase(this); database = new GcmDatabase(this);
heartbeatIntent = PendingIntent.getService(this, 0, new Intent(ACTION_HEARTBEAT, null, this, McsService.class), 0); heartbeatIntent = PendingIntent.getService(this, 0, new Intent(ACTION_HEARTBEAT, null, this, McsService.class), PendingIntent.FLAG_IMMUTABLE);
alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE); alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
powerManager = (PowerManager) getSystemService(POWER_SERVICE); powerManager = (PowerManager) getSystemService(POWER_SERVICE);
if (checkSelfPermission("android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST") == PackageManager.PERMISSION_GRANTED) { if (checkSelfPermission("android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST") == PackageManager.PERMISSION_GRANTED) {
@ -300,7 +300,7 @@ public class McsService extends Service implements Handler.Callback {
AlarmManager alarmManager = (AlarmManager) context.getSystemService(ALARM_SERVICE); AlarmManager alarmManager = (AlarmManager) context.getSystemService(ALARM_SERVICE);
long delay = getCurrentDelay(); long delay = getCurrentDelay();
logd(context, "Scheduling reconnect in " + delay / 1000 + " seconds..."); logd(context, "Scheduling reconnect in " + delay / 1000 + " seconds...");
PendingIntent pi = PendingIntent.getBroadcast(context, 1, new Intent(ACTION_RECONNECT, null, context, TriggerReceiver.class), 0); PendingIntent pi = PendingIntent.getBroadcast(context, 1, new Intent(ACTION_RECONNECT, null, context, TriggerReceiver.class), PendingIntent.FLAG_IMMUTABLE);
alarmManager.setExactAndAllowWhileIdle(ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + delay, pi); alarmManager.setExactAndAllowWhileIdle(ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + delay, pi);
} }

View file

@ -30,7 +30,7 @@ import android.util.Log;
import androidx.legacy.content.WakefulBroadcastReceiver; import androidx.legacy.content.WakefulBroadcastReceiver;
import org.microg.gms.checkin.CheckinPrefs; import org.microg.gms.checkin.CheckinPreferences;
import org.microg.gms.checkin.LastCheckinInfo; import org.microg.gms.checkin.LastCheckinInfo;
import org.microg.gms.common.ForegroundServiceContext; import org.microg.gms.common.ForegroundServiceContext;
@ -67,7 +67,7 @@ public class TriggerReceiver extends WakefulBroadcastReceiver {
if (LastCheckinInfo.read(context).getAndroidId() == 0) { if (LastCheckinInfo.read(context).getAndroidId() == 0) {
Log.d(TAG, "Ignoring " + intent + ": need to checkin first."); Log.d(TAG, "Ignoring " + intent + ": need to checkin first.");
if (CheckinPrefs.isEnabled(context)) { if (CheckinPreferences.isEnabled(context)) {
// Do a check-in if we are not actually checked in, // Do a check-in if we are not actually checked in,
// but should be, e.g. cleared app data // but should be, e.g. cleared app data
Log.d(TAG, "Requesting check-in..."); Log.d(TAG, "Requesting check-in...");

View file

@ -0,0 +1,48 @@
package org.microg.gms.ui;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.navigation.NavController;
import androidx.navigation.fragment.NavHostFragment;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import com.mgoogle.android.gms.R;
import org.microg.gms.ui.settings.SettingsProvider;
import static org.microg.gms.ui.settings.SettingsProviderKt.getAllSettingsProviders;
public class MainSettingsActivity extends AppCompatActivity {
private AppBarConfiguration appBarConfiguration;
private NavController getNavController() {
return ((NavHostFragment)getSupportFragmentManager().findFragmentById(R.id.navhost)).getNavController();
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
for (SettingsProvider settingsProvider : getAllSettingsProviders(this)) {
settingsProvider.preProcessSettingsIntent(intent);
}
setContentView(R.layout.settings_root_activity);
for (SettingsProvider settingsProvider : getAllSettingsProviders(this)) {
settingsProvider.extendNavigation(getNavController());
}
appBarConfiguration = new AppBarConfiguration.Builder(getNavController().getGraph()).build();
NavigationUI.setupActionBarWithNavController(this, getNavController(), appBarConfiguration);
}
@Override
public boolean onSupportNavigateUp() {
return NavigationUI.navigateUp(getNavController(), appBarConfiguration) || super.onSupportNavigateUp();
}
}

Some files were not shown because too many files have changed in this diff Show more