mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2024-12-25 04:05:51 +01:00
commit
eb7795355f
@ -238,7 +238,7 @@ public abstract class AbstractGmsServiceBroker extends IGmsServiceBroker.Stub {
|
||||
request.gmsVersion = gmsVersion;
|
||||
request.packageName = packageName;
|
||||
request.extras = extras;
|
||||
request.account = accountName == null ? null : new Account(accountName, "com.google");
|
||||
request.account = accountName == null ? null : new Account(accountName, "com.mgoogle");
|
||||
request.scopes = scopes == null ? null : scopesFromStringArray(scopes);
|
||||
getService(callback, request);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class ChimeraSpoofProvider extends ContentProvider {
|
||||
@Nullable
|
||||
@Override
|
||||
public String getType(@NonNull Uri uri) {
|
||||
return "vnd.android.cursor.item/com.google.android.gms.chimera";
|
||||
return "vnd.android.cursor.item/com.mgoogle.android.gms.chimera";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -40,9 +40,8 @@ import static org.microg.gms.common.Constants.GMS_PACKAGE_SIGNATURE_SHA1;
|
||||
public class PackageUtils {
|
||||
|
||||
private static final String GOOGLE_PLATFORM_KEY = GMS_PACKAGE_SIGNATURE_SHA1;
|
||||
private static final String GOOGLE_APP_KEY = "24bb24c05e47e0aefa68a58a766179d9b613a600";
|
||||
private static final String GOOGLE_LEGACY_KEY = "58e1c4133f7441ec3d2c270270a14802da47ba0e"; // Seems to be no longer used.
|
||||
private static final String[] GOOGLE_PRIMARY_KEYS = {GOOGLE_PLATFORM_KEY, GOOGLE_APP_KEY};
|
||||
private static final String[] GOOGLE_PRIMARY_KEYS = {GOOGLE_PLATFORM_KEY, "24bb24c05e47e0aefa68a58a766179d9b613a600", "afb0fed5eeaebdd86f56a97742f4b6b33ef59875", "61226bdb57cc32c8a2a9ef71f7bc9548e95dcc0b", "3a82b5ee26bc46bf68113d920e610cd090198d4a"};
|
||||
|
||||
private static final Map<String, String> KNOWN_GOOGLE_PACKAGES;
|
||||
|
||||
@ -56,6 +55,10 @@ public class PackageUtils {
|
||||
KNOWN_GOOGLE_PACKAGES.put("com.google.android.contacts", "ee3e2b5d95365c5a1ccc2d8dfe48d94eb33b3ebe");
|
||||
KNOWN_GOOGLE_PACKAGES.put("com.google.android.wearable.app", "a197f9212f2fed64f0ff9c2a4edf24b9c8801c8c");
|
||||
KNOWN_GOOGLE_PACKAGES.put("com.google.android.apps.youtube.music", "afb0fed5eeaebdd86f56a97742f4b6b33ef59875");
|
||||
KNOWN_GOOGLE_PACKAGES.put("com.google.android.apps.youtube.unplugged", "3a82b5ee26bc46bf68113d920e610cd090198d4a");
|
||||
KNOWN_GOOGLE_PACKAGES.put("com.google.android.youtube.tv", "61226bdb57cc32c8a2a9ef71f7bc9548e95dcc0b");
|
||||
KNOWN_GOOGLE_PACKAGES.put("com.google.android.apps.photos", "24bb24c05e47e0aefa68a58a766179d9b613a600");
|
||||
KNOWN_GOOGLE_PACKAGES.put("com.google.android.youtube", "24bb24c05e47e0aefa68a58a766179d9b613a600");
|
||||
KNOWN_GOOGLE_PACKAGES.put("com.google.android.vr.home", "fc1edc68f7e3e4963c998e95fc38f3de8d1bfc96");
|
||||
KNOWN_GOOGLE_PACKAGES.put("com.google.vr.cyclops", "188c5ca3863fa121216157a5baa80755ceda70ab");
|
||||
KNOWN_GOOGLE_PACKAGES.put("com.waze", "35b438fe1bc69d975dc8702dc16ab69ebf65f26f");
|
||||
@ -99,7 +102,7 @@ public class PackageUtils {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return context.checkCallingPermission("org.microg.gms.EXTENDED_ACCESS") == PackageManager.PERMISSION_GRANTED;
|
||||
return context.checkCallingPermission("org.mgoogle.gms.EXTENDED_ACCESS") == PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
public static void checkPackageUid(Context context, String packageName, int callingUid) {
|
||||
@ -113,6 +116,18 @@ public class PackageUtils {
|
||||
|
||||
@Nullable
|
||||
public static String firstSignatureDigest(PackageManager packageManager, String packageName) {
|
||||
if (packageName.equals("com.google.android.apps.youtube.music") || packageName.contains("youtube.music")) {
|
||||
return "afb0fed5eeaebdd86f56a97742f4b6b33ef59875";
|
||||
}
|
||||
if (packageName.equals("com.google.android.apps.youtube.unplugged") || packageName.contains("youtube.unplugged")) {
|
||||
return "3a82b5ee26bc46bf68113d920e610cd090198d4a";
|
||||
}
|
||||
if (packageName.equals("com.google.android.youtube.tv") || packageName.contains("youtube.tv")) {
|
||||
return "61226bdb57cc32c8a2a9ef71f7bc9548e95dcc0b";
|
||||
}
|
||||
if (packageName.equals("com.google.android.apps.photos") || packageName.contains("apps.photos") || packageName.equals("com.google.android.youtube") || packageName.contains("youtube")) {
|
||||
return "24bb24c05e47e0aefa68a58a766179d9b613a600";
|
||||
}
|
||||
final PackageInfo info;
|
||||
try {
|
||||
info = packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES);
|
||||
|
@ -19,7 +19,6 @@ package org.microg.gms.common;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -23,5 +23,5 @@ public class AuthConstants {
|
||||
public static final String PROVIDER_METHOD_CLEAR_PASSWORD = "clear_password";
|
||||
public static final String PROVIDER_EXTRA_CLEAR_PASSWORD = "clear_password";
|
||||
public static final String PROVIDER_EXTRA_ACCOUNTS = "accounts";
|
||||
public static final String DEFAULT_ACCOUNT_TYPE = "com.google";
|
||||
public static final String DEFAULT_ACCOUNT_TYPE = "com.mgoogle";
|
||||
}
|
||||
|
@ -19,6 +19,6 @@ package org.microg.gms.common;
|
||||
public class Constants {
|
||||
public static final int MAX_REFERENCE_VERSION = 19420 * 1000;
|
||||
public static final String GMS_PACKAGE_NAME = "com.google.android.gms";
|
||||
public static final String GSF_PACKAGE_NAME = "com.google.android.gsf";
|
||||
public static final String GSF_PACKAGE_NAME = "com.mgoogle.android.gsf";
|
||||
public static final String GMS_PACKAGE_SIGNATURE_SHA1 = "38918a453d07199354f8b19af05ec6562ced5788";
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ public enum GmsService {
|
||||
AUDIO_MODEM(48, "com.google.android.gms.audiomodem.service.AudioModemService.START"),
|
||||
NEARBY_SHARING(49, "com.google.android.gms.nearby.sharing.service.NearbySharingService.START"),
|
||||
LIGHTWEIGHT_NETWORK_QUALITY(50, "com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START"),
|
||||
PHENOTYPE(51, "com.google.android.gms.phenotype.service.START"),
|
||||
PHENOTYPE(51, "com.mgoogle.android.gms.phenotype.service.START"),
|
||||
VOICE_UNLOCK(52, "com.google.android.gms.speech.service.START"),
|
||||
NEARBY_CONNECTIONS(54, "com.google.android.gms.nearby.connection.service.START"),
|
||||
FITNESS_SENSORS(55, "com.google.android.gms.fitness.SensorsApi"),
|
||||
|
@ -17,10 +17,10 @@
|
||||
package org.microg.gms.gcm;
|
||||
|
||||
public final class GcmConstants {
|
||||
public static final String ACTION_C2DM_RECEIVE = "com.google.android.c2dm.intent.RECEIVE";
|
||||
public static final String ACTION_C2DM_REGISTER = "com.google.android.c2dm.intent.REGISTER";
|
||||
public static final String ACTION_C2DM_REGISTRATION = "com.google.android.c2dm.intent.REGISTRATION";
|
||||
public static final String ACTION_C2DM_UNREGISTER = "com.google.android.c2dm.intent.UNREGISTER";
|
||||
public static final String ACTION_C2DM_RECEIVE = "com.mgoogle.android.c2dm.intent.RECEIVE";
|
||||
public static final String ACTION_C2DM_REGISTER = "com.mgoogle.android.c2dm.intent.REGISTER";
|
||||
public static final String ACTION_C2DM_REGISTRATION = "com.mgoogle.android.c2dm.intent.REGISTRATION";
|
||||
public static final String ACTION_C2DM_UNREGISTER = "com.mgoogle.android.c2dm.intent.UNREGISTER";
|
||||
public static final String ACTION_GCM_SEND = "com.google.android.gcm.intent.SEND";
|
||||
public static final String ACTION_NOTIFICATION_OPEN = "com.google.android.gms.gcm.NOTIFICATION_OPEN";
|
||||
public static final String ACTION_NOTIFICATION_DISMISS = "com.google.android.gms.gcm.NOTIFICATION_DISMISS";
|
||||
|
@ -16,52 +16,52 @@
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.google.android.gms">
|
||||
package="com.mgoogle.android.gms">
|
||||
|
||||
<permission
|
||||
android:name="com.google.android.c2dm.permission.RECEIVE"
|
||||
android:name="com.mgoogle.android.c2dm.permission.RECEIVE"
|
||||
android:label="@string/perm_c2dm_receive_label"
|
||||
android:permissionGroup="android.permission-group.NETWORK"
|
||||
android:protectionLevel="normal" />
|
||||
<permission
|
||||
android:name="com.google.android.c2dm.permission.SEND"
|
||||
android:name="com.mgoogle.android.c2dm.permission.SEND"
|
||||
android:label="@string/perm_c2dm_send_label"
|
||||
android:protectionLevel="signature" />
|
||||
<permission
|
||||
android:name="com.google.android.gtalkservice.permission.GTALK_SERVICE"
|
||||
android:name="com.mgoogle.android.gtalkservice.permission.GTALK_SERVICE"
|
||||
android:label="@string/perm_gtalk_svc_label"
|
||||
android:protectionLevel="signature" />
|
||||
|
||||
<permission-tree
|
||||
android:name="com.google.android.googleapps.permission.GOOGLE_AUTH"
|
||||
android:name="com.mgoogle.android.googleapps.permission.GOOGLE_AUTH"
|
||||
android:icon="@drawable/proprietary_auth_ic_scope_icon_default" />
|
||||
|
||||
<permission
|
||||
android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.cp"
|
||||
android:name="com.mgoogle.android.googleapps.permission.GOOGLE_AUTH.cp"
|
||||
android:description="@string/permission_service_cp_description"
|
||||
android:label="@string/permission_service_cp_label"
|
||||
android:protectionLevel="dangerous" />
|
||||
<permission
|
||||
android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.local"
|
||||
android:name="com.mgoogle.android.googleapps.permission.GOOGLE_AUTH.local"
|
||||
android:description="@string/permission_service_local_description"
|
||||
android:label="@string/permission_service_local_label"
|
||||
android:protectionLevel="dangerous" />
|
||||
<permission
|
||||
android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.mail"
|
||||
android:name="com.mgoogle.android.googleapps.permission.GOOGLE_AUTH.mail"
|
||||
android:description="@string/permission_service_mail_description"
|
||||
android:label="@string/permission_service_mail_label"
|
||||
android:protectionLevel="dangerous" />
|
||||
<permission
|
||||
android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.writely"
|
||||
android:name="com.mgoogle.android.googleapps.permission.GOOGLE_AUTH.writely"
|
||||
android:description="@string/permission_service_writely_description"
|
||||
android:label="@string/permission_service_writely_label"
|
||||
android:protectionLevel="dangerous" />
|
||||
<permission
|
||||
android:name="org.microg.gms.STATUS_BROADCAST"
|
||||
android:name="org.mgoogle.gms.STATUS_BROADCAST"
|
||||
android:label="@string/perm_status_broadcast_label"
|
||||
android:protectionLevel="normal" />
|
||||
<permission
|
||||
android:name="org.microg.gms.EXTENDED_ACCESS"
|
||||
android:name="org.mgoogle.gms.EXTENDED_ACCESS"
|
||||
android:label="@string/perm_extended_access_label"
|
||||
android:protectionLevel="dangerous" />
|
||||
|
||||
@ -86,11 +86,11 @@
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
|
||||
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
|
||||
<uses-permission android:name="com.google.android.c2dm.permission.SEND" />
|
||||
<uses-permission android:name="com.google.android.gtalkservice.permission.GTALK_SERVICE" />
|
||||
<uses-permission android:name="com.mgoogle.android.c2dm.permission.RECEIVE" />
|
||||
<uses-permission android:name="com.mgoogle.android.c2dm.permission.SEND" />
|
||||
<uses-permission android:name="com.mgoogle.android.gtalkservice.permission.GTALK_SERVICE" />
|
||||
|
||||
<uses-permission android:name="org.microg.gms.STATUS_BROADCAST" />
|
||||
<uses-permission android:name="org.mgoogle.gms.STATUS_BROADCAST" />
|
||||
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
@ -104,9 +104,9 @@
|
||||
|
||||
<application
|
||||
android:allowBackup="false"
|
||||
android:extractNativeLibs="false"
|
||||
android:extractNativeLibs="true"
|
||||
android:icon="@mipmap/ic_core_service_app"
|
||||
android:label="@string/gms_app_name">
|
||||
android:label="Vanced MicroG">
|
||||
<meta-data
|
||||
android:name="fake-signature"
|
||||
android:value="@string/fake_signature" />
|
||||
@ -156,15 +156,15 @@
|
||||
|
||||
<provider
|
||||
android:name="org.microg.gms.gservices.GServicesProvider"
|
||||
android:authorities="com.google.android.gsf.gservices"
|
||||
android:authorities="com.mgoogle.android.gsf.gservices"
|
||||
android:exported="true" />
|
||||
<provider
|
||||
android:name="org.microg.gms.settings.GoogleSettingsProvider"
|
||||
android:authorities="com.google.settings"
|
||||
android:authorities="com.mgoogle.settings"
|
||||
android:exported="true" />
|
||||
<provider
|
||||
android:name="org.microg.gms.feeds.SubscribedFeedsProvider"
|
||||
android:authorities="subscribedfeeds"
|
||||
android:authorities="mgooglesubscribedfeeds"
|
||||
android:exported="true"
|
||||
android:multiprocess="false"
|
||||
android:readPermission="android.permission.SUBSCRIBED_FEEDS_READ"
|
||||
@ -184,7 +184,7 @@
|
||||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
|
||||
<action android:name="com.mgoogle.android.c2dm.intent.RECEIVE" />
|
||||
|
||||
<category android:name="android.server.checkin.CHECKIN" />
|
||||
</intent-filter>
|
||||
@ -200,10 +200,10 @@
|
||||
<!-- Cloud Messaging -->
|
||||
<service
|
||||
android:name="org.microg.gms.gcm.PushRegisterService"
|
||||
android:permission="com.google.android.c2dm.permission.RECEIVE">
|
||||
android:permission="com.mgoogle.android.c2dm.permission.RECEIVE">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.c2dm.intent.REGISTER" />
|
||||
<action android:name="com.google.android.c2dm.intent.UNREGISTER" />
|
||||
<action android:name="com.mgoogle.android.c2dm.intent.REGISTER" />
|
||||
<action android:name="com.mgoogle.android.c2dm.intent.UNREGISTER" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
@ -211,7 +211,7 @@
|
||||
|
||||
<receiver android:name="org.microg.gms.gcm.PushRegisterReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.iid.TOKEN_REQUEST" />
|
||||
<action android:name="com.mgoogle.iid.TOKEN_REQUEST" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
@ -219,7 +219,7 @@
|
||||
|
||||
<receiver
|
||||
android:name="org.microg.gms.gcm.SendReceiver"
|
||||
android:permission="com.google.android.c2dm.permission.RECEIVE">
|
||||
android:permission="com.mgoogle.android.c2dm.permission.RECEIVE">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gcm.intent.SEND" />
|
||||
</intent-filter>
|
||||
@ -312,7 +312,7 @@
|
||||
<action android:name="android.accounts.AccountAuthenticator" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gsf.action.GET_GLS" />
|
||||
<action android:name="com.mgoogle.android.gsf.action.GET_GLS" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
@ -368,7 +368,7 @@
|
||||
|
||||
<provider
|
||||
android:name="org.microg.gms.auth.AccountContentProvider"
|
||||
android:authorities="com.google.android.gms.auth.accounts"
|
||||
android:authorities="com.mgoogle.android.gms.auth.accounts"
|
||||
android:exported="true" />
|
||||
|
||||
<!-- Games -->
|
||||
@ -400,7 +400,7 @@
|
||||
<!-- Chimera spoof -->
|
||||
<provider
|
||||
android:name="org.microg.gms.ChimeraSpoofProvider"
|
||||
android:authorities="com.google.android.gms.chimera"
|
||||
android:authorities="com.mgoogle.android.gms.chimera"
|
||||
android:exported="true" />
|
||||
|
||||
<!-- microG custom UI -->
|
||||
@ -412,11 +412,6 @@
|
||||
android:label="@string/gms_settings_name"
|
||||
android:roundIcon="@mipmap/ic_microg_settings"
|
||||
android:theme="@style/Theme.AppCompat.DayNight">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
@ -523,7 +518,7 @@
|
||||
|
||||
<provider
|
||||
android:name="org.microg.gms.phenotype.ConfigurationProvider"
|
||||
android:authorities="com.google.android.gms.phenotype"
|
||||
android:authorities="com.mgoogle.android.gms.phenotype"
|
||||
android:exported="true" />
|
||||
|
||||
<service
|
||||
@ -662,7 +657,7 @@
|
||||
<action android:name="com.google.android.gms.audiomodem.service.AudioModemService.START" />
|
||||
<action android:name="com.google.android.gms.nearby.sharing.service.NearbySharingService.START" />
|
||||
<action android:name="com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START" />
|
||||
<action android:name="com.google.android.gms.phenotype.service.START" />
|
||||
<action android:name="com.mgoogle.android.gms.phenotype.service.START" />
|
||||
<action android:name="com.google.android.gms.auth.api.credentials.service.START" />
|
||||
<action android:name="com.google.android.gms.gass.START" />
|
||||
</intent-filter>
|
||||
|
@ -38,7 +38,7 @@ import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
import com.squareup.wire.Wire;
|
||||
|
||||
import org.microg.gms.common.PackageUtils;
|
||||
|
@ -34,7 +34,7 @@ import static android.content.pm.ApplicationInfo.FLAG_UPDATED_SYSTEM_APP;
|
||||
public class AuthManager {
|
||||
|
||||
private static final String TAG = "GmsAuthManager";
|
||||
public static final String PERMISSION_TREE_BASE = "com.google.android.googleapps.permission.GOOGLE_AUTH.";
|
||||
public static final String PERMISSION_TREE_BASE = "com.mgoogle.android.googleapps.permission.GOOGLE_AUTH.";
|
||||
private static final String PREF_AUTH_TRUST_GOOGLE = "auth_manager_trust_google";
|
||||
public static final String PREF_AUTH_VISIBLE = "auth_manager_visible";
|
||||
public static final int ONE_HOUR_IN_SECONDS = 60 * 60;
|
||||
@ -51,6 +51,17 @@ public class AuthManager {
|
||||
public AuthManager(Context context, String accountName, String packageName, String service) {
|
||||
this.context = context;
|
||||
this.accountName = accountName;
|
||||
if (packageName.contains("youtube.music")) {
|
||||
packageName = "com.google.android.apps.youtube.music";
|
||||
} else if (packageName.contains("youtube.unplugged")) {
|
||||
packageName = "com.google.android.apps.youtube.unplugged";
|
||||
} else if (packageName.contains("youtube.tv")) {
|
||||
packageName = "com.google.android.youtube.tv";
|
||||
} else if (packageName.contains("youtube")) {
|
||||
packageName = "com.google.android.youtube";
|
||||
} else if (packageName.contains("apps.photos")) {
|
||||
packageName = "com.google.android.apps.photos";
|
||||
}
|
||||
this.packageName = packageName;
|
||||
this.service = service;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ import android.util.Log;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
|
||||
import com.google.android.auth.IAuthManagerService;
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
import com.google.android.gms.auth.AccountChangeEventsRequest;
|
||||
import com.google.android.gms.auth.AccountChangeEventsResponse;
|
||||
import com.google.android.gms.auth.TokenData;
|
||||
|
@ -28,7 +28,7 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
public abstract class AssistantActivity extends Activity {
|
||||
private static final int TITLE_MIN_HEIGHT = 64;
|
||||
|
@ -45,7 +45,7 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.microg.gms.auth.AuthConstants;
|
||||
|
@ -27,7 +27,7 @@ import android.os.Bundle;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import org.microg.gms.auth.AskPermissionActivity;
|
||||
import org.microg.gms.auth.AuthConstants;
|
||||
|
@ -43,7 +43,7 @@ public class CheckinManager {
|
||||
LastCheckinInfo info = LastCheckinInfo.read(context);
|
||||
if (!force && info.lastCheckin > System.currentTimeMillis() - MIN_CHECKIN_INTERVAL)
|
||||
return null;
|
||||
if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean(PREF_ENABLE_CHECKIN, false))
|
||||
if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean(PREF_ENABLE_CHECKIN, true))
|
||||
return null;
|
||||
List<CheckinClient.Account> accounts = new ArrayList<CheckinClient.Account>();
|
||||
AccountManager accountManager = AccountManager.get(context);
|
||||
|
@ -58,7 +58,7 @@ public class CheckinService extends IntentService {
|
||||
protected void onHandleIntent(Intent intent) {
|
||||
try {
|
||||
ForegroundServiceContext.completeForegroundService(this, intent, TAG);
|
||||
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(PREF_ENABLE_CHECKIN, false)) {
|
||||
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(PREF_ENABLE_CHECKIN, true)) {
|
||||
LastCheckinInfo info = CheckinManager.checkin(this, intent.getBooleanExtra(EXTRA_FORCE_CHECKIN, false));
|
||||
if (info != null) {
|
||||
Log.d(TAG, "Checked in as " + Long.toHexString(info.androidId));
|
||||
|
@ -27,7 +27,7 @@ import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
public class UpgradeActivity extends Activity {
|
||||
public static final String ACTION_PLAY_GAMES_UPGRADE = "com.google.android.gms.games.PLAY_GAMES_UPGRADE";
|
||||
|
@ -83,7 +83,7 @@ public class GcmPrefs implements SharedPreferences.OnSharedPreferenceChangeListe
|
||||
gcmLogEnabled = defaultPreferences.getBoolean(PREF_FULL_LOG, true);
|
||||
lastPersistedId = defaultPreferences.getString(PREF_LAST_PERSISTENT_ID, "");
|
||||
confirmNewApps = defaultPreferences.getBoolean(PREF_CONFIRM_NEW_APPS, false);
|
||||
gcmEnabled = defaultPreferences.getBoolean(PREF_ENABLE_GCM, false);
|
||||
gcmEnabled = defaultPreferences.getBoolean(PREF_ENABLE_GCM, true);
|
||||
|
||||
networkMobile = Integer.parseInt(defaultPreferences.getString(PREF_NETWORK_MOBILE, "0"));
|
||||
networkWifi = Integer.parseInt(defaultPreferences.getString(PREF_NETWORK_WIFI, "0"));
|
||||
|
@ -106,7 +106,7 @@ import static org.microg.gms.gcm.McsConstants.MSG_TEARDOWN;
|
||||
public class McsService extends Service implements Handler.Callback {
|
||||
private static final String TAG = "GmsGcmMcsSvc";
|
||||
|
||||
public static final String SELF_CATEGORY = "com.google.android.gsf.gtalkservice";
|
||||
public static final String SELF_CATEGORY = "com.mgoogle.android.gsf.gtalkservice";
|
||||
public static final String IDLE_NOTIFICATION = "IdleNotification";
|
||||
public static final String FROM_FIELD = "gcm@android.com";
|
||||
|
||||
|
@ -22,9 +22,9 @@ import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
|
||||
public class GServices {
|
||||
public static final Uri CONTENT_URI = Uri.parse("content://com.google.android.gsf.gservices");
|
||||
public static final Uri MAIN_URI = Uri.parse("content://com.google.android.gsf.gservices/main");
|
||||
public static final Uri OVERRIDE_URI = Uri.parse("content://com.google.android.gsf.gservices/override");
|
||||
public static final Uri CONTENT_URI = Uri.parse("content://com.mgoogle.android.gsf.gservices");
|
||||
public static final Uri MAIN_URI = Uri.parse("content://com.mgoogle.android.gsf.gservices/main");
|
||||
public static final Uri OVERRIDE_URI = Uri.parse("content://com.mgoogle.android.gsf.gservices/override");
|
||||
|
||||
public static int setString(ContentResolver resolver, String key, String value) {
|
||||
ContentValues values = new ContentValues();
|
||||
|
@ -38,7 +38,7 @@ import java.util.Set;
|
||||
* if certain "experiments" are enabled on the device.
|
||||
*/
|
||||
public class GServicesProvider extends ContentProvider {
|
||||
public static final Uri CONTENT_URI = Uri.parse("content://com.google.android.gsf.gservices/");
|
||||
public static final Uri CONTENT_URI = Uri.parse("content://com.mgoogle.android.gsf.gservices/");
|
||||
public static final Uri MAIN_URI = Uri.withAppendedPath(CONTENT_URI, "main");
|
||||
public static final Uri OVERRIDE_URI = Uri.withAppendedPath(CONTENT_URI, "override");
|
||||
public static final Uri PREFIX_URI = Uri.withAppendedPath(CONTENT_URI, "prefix");
|
||||
|
@ -18,7 +18,7 @@ package org.microg.gms.ui;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.google.android.gms.BuildConfig;
|
||||
import com.mgoogle.android.gms.BuildConfig;
|
||||
|
||||
import org.microg.tools.ui.AbstractAboutFragment;
|
||||
import org.microg.tools.ui.AbstractSettingsActivity;
|
||||
|
@ -16,58 +16,11 @@
|
||||
|
||||
package org.microg.gms.ui;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
|
||||
import org.microg.gms.auth.AuthConstants;
|
||||
import org.microg.gms.auth.AuthManager;
|
||||
import com.mgoogle.android.gms.R;
|
||||
import org.microg.tools.ui.AbstractSettingsActivity;
|
||||
import org.microg.tools.ui.ResourceSettingsFragment;
|
||||
|
||||
import static android.accounts.AccountManager.PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE;
|
||||
import static android.accounts.AccountManager.VISIBILITY_USER_MANAGED_NOT_VISIBLE;
|
||||
import static android.accounts.AccountManager.VISIBILITY_USER_MANAGED_VISIBLE;
|
||||
import static org.microg.gms.auth.AuthManager.PREF_AUTH_VISIBLE;
|
||||
|
||||
public class AccountSettingsActivity extends AbstractSettingsActivity {
|
||||
|
||||
@Override
|
||||
protected Fragment getFragment() {
|
||||
return new AccountSettingsFragment();
|
||||
public AccountSettingsActivity() {
|
||||
this.preferencesResource = R.xml.preferences_account;
|
||||
}
|
||||
|
||||
public static class AccountSettingsFragment extends ResourceSettingsFragment {
|
||||
public AccountSettingsFragment() {
|
||||
preferencesResource = R.xml.preferences_account;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(@Nullable Bundle savedInstanceState, String rootKey) {
|
||||
super.onCreatePreferences(savedInstanceState, rootKey);
|
||||
Preference pref = findPreference(PREF_AUTH_VISIBLE);
|
||||
if (pref != null) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||
pref.setVisible(false);
|
||||
} else {
|
||||
pref.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
if (newValue instanceof Boolean) {
|
||||
AccountManager am = AccountManager.get(getContext());
|
||||
for (Account account : am.getAccountsByType(AuthConstants.DEFAULT_ACCOUNT_TYPE)) {
|
||||
am.setAccountVisibility(account, PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE, (Boolean) newValue ? VISIBILITY_USER_MANAGED_VISIBLE : VISIBILITY_USER_MANAGED_NOT_VISIBLE);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -10,7 +10,7 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import org.microg.gms.gcm.GcmDatabase;
|
||||
import org.microg.gms.gcm.PushRegisterService;
|
||||
|
@ -21,7 +21,7 @@ import android.preference.PreferenceManager;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import org.microg.tools.ui.AbstractSettingsActivity;
|
||||
import org.microg.tools.ui.SwitchBarResourceSettingsFragment;
|
||||
@ -38,7 +38,7 @@ public class CheckinFragment extends SwitchBarResourceSettingsFragment {
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
switchBar.setChecked(PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean(PREF_ENABLE_CHECKIN, false));
|
||||
switchBar.setChecked(PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean(PREF_ENABLE_CHECKIN, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,7 +28,7 @@ import android.view.View;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import org.microg.gms.gcm.GcmPrefs;
|
||||
import org.microg.tools.ui.Condition;
|
||||
|
@ -23,7 +23,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import org.microg.gms.gcm.GcmPrefs;
|
||||
import org.microg.gms.gcm.McsService;
|
||||
|
@ -18,7 +18,7 @@ import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.SwitchPreference;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import org.microg.gms.gcm.GcmDatabase;
|
||||
import org.microg.gms.gcm.PushRegisterManager;
|
||||
|
@ -34,7 +34,7 @@ import androidx.preference.PreferenceGroup;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.PreferenceViewHolder;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import org.microg.gms.gcm.GcmDatabase;
|
||||
import org.microg.gms.gcm.GcmPrefs;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
package org.microg.gms.ui;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import org.microg.tools.ui.AbstractSettingsActivity;
|
||||
|
||||
|
@ -39,7 +39,7 @@ import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.view.MenuItemCompat;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
import com.google.android.gms.common.api.CommonStatusCodes;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.location.places.internal.PlaceImpl;
|
||||
|
@ -22,7 +22,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import org.microg.tools.ui.AbstractSettingsActivity;
|
||||
import org.microg.tools.ui.RadioButtonPreference;
|
||||
|
@ -25,7 +25,7 @@ import android.view.MenuItem;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import org.microg.gms.snet.SafetyNetPrefs;
|
||||
import org.microg.tools.ui.AbstractSettingsActivity;
|
||||
|
@ -23,7 +23,7 @@ import android.text.TextUtils;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import org.microg.gms.gcm.GcmDatabase;
|
||||
import org.microg.gms.gcm.GcmPrefs;
|
||||
@ -105,7 +105,7 @@ public class SettingsActivity extends AbstractDashboardActivity {
|
||||
// Preferences.splitBackendString(unifiedNlPrefs.getGeocoderBackends()).length;
|
||||
// findPreference(PREF_UNIFIEDNLP).setSummary(getResources().getQuantityString(R.plurals.pref_unifiednlp_summary, backendCount, backendCount));
|
||||
|
||||
boolean checkinEnabled = PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean(PREF_ENABLE_CHECKIN, false);
|
||||
boolean checkinEnabled = PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean(PREF_ENABLE_CHECKIN, true);
|
||||
findPreference(PREF_CHECKIN).setSummary(checkinEnabled ? R.string.service_status_enabled : R.string.service_status_disabled);
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ package org.microg.tools.selfcheck;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import org.microg.gms.common.Constants;
|
||||
import org.microg.gms.common.PackageUtils;
|
||||
|
@ -22,7 +22,7 @@ import android.content.pm.PackageManager;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import org.microg.gms.common.Constants;
|
||||
import org.microg.gms.common.PackageUtils;
|
||||
|
@ -25,7 +25,7 @@ import android.provider.Settings;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.google.android.gms.R;
|
||||
import com.mgoogle.android.gms.R;
|
||||
|
||||
import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Negative;
|
||||
import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Positive;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:accountPreferences="@xml/preferences_auth"
|
||||
android:accountType="com.google"
|
||||
android:accountType="com.mgoogle"
|
||||
android:customTokens="true"
|
||||
android:icon="@drawable/proprietary_auth_gls_ic_google_selected"
|
||||
android:smallIcon="@drawable/proprietary_auth_gls_ic_google_minitab_selected"
|
||||
|
@ -16,6 +16,6 @@
|
||||
-->
|
||||
|
||||
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:accountType="com.google"
|
||||
android:accountType="com.mgoogle"
|
||||
android:contentAuthority="com.android.contacts"
|
||||
android:userVisible="false"/>
|
@ -22,7 +22,7 @@
|
||||
android:title="@string/self_check_title">
|
||||
<intent
|
||||
android:targetClass="org.microg.gms.ui.SelfCheckFragment$AsActivity"
|
||||
android:targetPackage="com.google.android.gms"/>
|
||||
android:targetPackage="com.mgoogle.android.gms"/>
|
||||
</org.microg.tools.ui.TintIconPreference>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/prefcat_google_services">
|
||||
@ -32,7 +32,7 @@
|
||||
android:title="@string/pref_add_account_title">
|
||||
<intent
|
||||
android:targetClass="org.microg.gms.auth.login.LoginActivity"
|
||||
android:targetPackage="com.google.android.gms"/>
|
||||
android:targetPackage="com.mgoogle.android.gms"/>
|
||||
</org.microg.tools.ui.TintIconPreference>
|
||||
<org.microg.tools.ui.TintIconPreference
|
||||
android:icon="@drawable/device_login"
|
||||
@ -40,7 +40,7 @@
|
||||
android:title="@string/service_name_checkin">
|
||||
<intent
|
||||
android:targetClass="org.microg.gms.ui.CheckinFragment$AsActivity"
|
||||
android:targetPackage="com.google.android.gms"/>
|
||||
android:targetPackage="com.mgoogle.android.gms"/>
|
||||
</org.microg.tools.ui.TintIconPreference>
|
||||
<org.microg.tools.ui.TintIconPreference
|
||||
android:icon="@drawable/gcm_bell"
|
||||
@ -48,7 +48,7 @@
|
||||
android:title="@string/service_name_mcs">
|
||||
<intent
|
||||
android:targetClass="org.microg.gms.ui.GcmFragment$AsActivity"
|
||||
android:targetPackage="com.google.android.gms"/>
|
||||
android:targetPackage="com.mgoogle.android.gms"/>
|
||||
</org.microg.tools.ui.TintIconPreference>
|
||||
<org.microg.tools.ui.TintIconPreference
|
||||
android:icon="@drawable/certificate"
|
||||
@ -56,7 +56,7 @@
|
||||
android:title="@string/service_name_snet">
|
||||
<intent
|
||||
android:targetClass="org.microg.gms.ui.SafetyNetFragment$AsActivity"
|
||||
android:targetPackage="com.google.android.gms"/>
|
||||
android:targetPackage="com.mgoogle.android.gms"/>
|
||||
</org.microg.tools.ui.TintIconPreference>
|
||||
<org.microg.tools.ui.TintIconPreference
|
||||
android:icon="@drawable/dots_horizontal"
|
||||
@ -64,7 +64,7 @@
|
||||
android:title="@string/pref_more_settings">
|
||||
<intent
|
||||
android:targetClass="org.microg.gms.ui.GoogleMoreFragment$AsActivity"
|
||||
android:targetPackage="com.google.android.gms"/>
|
||||
android:targetPackage="com.mgoogle.android.gms"/>
|
||||
</org.microg.tools.ui.TintIconPreference>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/prefcat_configuration">
|
||||
@ -73,7 +73,7 @@
|
||||
android:title="UnifiedNlp">
|
||||
<intent
|
||||
android:targetClass="org.microg.nlp.ui.BackendSettingsActivity"
|
||||
android:targetPackage="com.google.android.gms"/>
|
||||
android:targetPackage="com.mgoogle.android.gms"/>
|
||||
</org.microg.tools.ui.TintIconPreference>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/prefcat_about">
|
||||
@ -82,7 +82,7 @@
|
||||
android:title="@string/pref_about_title">
|
||||
<intent
|
||||
android:targetClass="org.microg.gms.ui.AboutFragment$AsActivity"
|
||||
android:targetPackage="com.google.android.gms"/>
|
||||
android:targetPackage="com.mgoogle.android.gms"/>
|
||||
</org.microg.tools.ui.TintIconPreference>
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
|
@ -45,7 +45,7 @@ public class SharedTileProvider extends ContentProvider {
|
||||
|
||||
@Override
|
||||
public String getType(Uri uri) {
|
||||
return "vnd.android.cursor.item/org.microg.gms.map.tile";
|
||||
return "vnd.android.cursor.item/org.mgoogle.gms.map.tile";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user