Merge pull request #4 from Oizaro/master

MicroG 0.2.10.19420
This commit is contained in:
KevinX8 2020-07-16 19:46:21 +03:00 committed by GitHub
commit c6aa6fad4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 11 deletions

View File

@ -55,10 +55,6 @@ 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");

View File

@ -323,7 +323,7 @@
android:value="1" />
</service>
<service android:name=".auth.FirebaseAuthService">
<service android:name="com.google.android.gms.auth.FirebaseAuthService">
<intent-filter>
<action android:name="com.google.firebase.auth.api.gms.service.START" />
</intent-filter>
@ -359,11 +359,11 @@
android:theme="@style/Theme.AppCompat.DayNight.Dialog" />
<service
android:name=".auth.GetToken"
android:name="com.google.android.gms.auth.GetToken"
android:exported="true" />
<activity
android:name=".auth.TokenActivity"
android:name="com.google.android.gms.auth.TokenActivity"
android:exported="true" />
<provider
@ -548,7 +548,7 @@
</intent-filter>
</service>
<service
android:name=".analytics.service.AnalyticsService"
android:name="com.google.android.gms.analytics.service.AnalyticsService"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.gms.analytics.service.START" />
@ -560,7 +560,7 @@
</intent-filter>
</service>
<service
android:name=".gcm.http.GoogleHttpService"
android:name="com.google.android.gms.gcm.http.GoogleHttpService"
android:exported="true" />
<service android:name="org.microg.gms.ads.GService">

View File

@ -16,11 +16,58 @@
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.mgoogle.android.gms.R;
import org.microg.gms.auth.AuthConstants;
import org.microg.gms.auth.AuthManager;
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 {
public AccountSettingsActivity() {
this.preferencesResource = R.xml.preferences_account;
@Override
protected Fragment getFragment() {
return new AccountSettingsFragment();
}
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;
});
}
}
}
}
}