Android build for ungoogled-chromium. https://uc.droidware.info
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

118 lines
5.5 KiB

From: thermatk <[email protected]>
Date: Fri, 22 Jun 2018 17:06:15 +0200
Subject: kill Auth
---
chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java | 22 -----
components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java | 42 ----------
2 files changed, 4 insertions(+), 60 deletions(-)
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
@@ -11,10 +11,6 @@ import android.content.Context;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
-import com.google.android.gms.auth.AccountChangeEvent;
-import com.google.android.gms.auth.GoogleAuthException;
-import com.google.android.gms.auth.GoogleAuthUtil;
-
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.task.AsyncTask;
@@ -62,23 +58,7 @@ public class SigninHelper {
@Override
public List<String> getAccountChangeEvents(
Context context, int index, String accountName) {
- try {
- List<AccountChangeEvent> list = GoogleAuthUtil.getAccountChangeEvents(
- context, index, accountName);
- List<String> result = new ArrayList<>(list.size());
- for (AccountChangeEvent e : list) {
- if (e.getChangeType() == GoogleAuthUtil.CHANGE_TYPE_ACCOUNT_RENAMED_TO) {
- result.add(e.getChangeData());
- } else {
- result.add(null);
- }
- }
- return result;
- } catch (IOException e) {
- Log.w(TAG, "Failed to get change events", e);
- } catch (GoogleAuthException e) {
- Log.w(TAG, "Failed to get change events", e);
- }
+
return new ArrayList<>(0);
}
}
--- a/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
+++ b/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
@@ -26,11 +26,6 @@ import android.os.SystemClock;
import androidx.annotation.Nullable;
-import com.google.android.gms.auth.GoogleAuthException;
-import com.google.android.gms.auth.GoogleAuthUtil;
-import com.google.android.gms.auth.GooglePlayServicesAvailabilityException;
-import com.google.android.gms.common.ConnectionResult;
-import com.google.android.gms.common.GoogleApiAvailability;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.Callback;
@@ -119,35 +114,15 @@ public class SystemAccountManagerDelegat
// so don't report any accounts if Google Play Services are out of date.
checkCanUseGooglePlayServices();
- if (!hasGetAccountsPermission()) {
- return new Account[] {};
- }
- long now = SystemClock.elapsedRealtime();
- Account[] accounts = mAccountManager.getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
- long elapsed = SystemClock.elapsedRealtime() - now;
- recordElapsedTimeHistogram("Signin.AndroidGetAccountsTime_AccountManager", elapsed);
- if (ThreadUtils.runningOnUiThread()) {
- recordElapsedTimeHistogram(
- "Signin.AndroidGetAccountsTimeUiThread_AccountManager", elapsed);
- }
- return accounts;
+ return new Account[] {};
}
@Override
public String getAuthToken(Account account, String authTokenScope) throws AuthException {
assert !ThreadUtils.runningOnUiThread();
assert AccountUtils.GOOGLE_ACCOUNT_TYPE.equals(account.type);
- try {
- return GoogleAuthUtil.getTokenWithNotification(
- ContextUtils.getApplicationContext(), account, authTokenScope, null);
- } catch (GoogleAuthException ex) {
- // This case includes a UserRecoverableNotifiedException, but most clients will have
- // their own retry mechanism anyway.
- throw new AuthException(AuthException.NONTRANSIENT,
- "Error while getting token for scope '" + authTokenScope + "'", ex);
- } catch (IOException ex) {
- throw new AuthException(AuthException.TRANSIENT, ex);
- }
+ throw new AuthException(AuthException.NONTRANSIENT,
+ "Error while getting token for scope '" + authTokenScope);
}
@Override
@@ -200,17 +175,6 @@ public class SystemAccountManagerDelegat
@SuppressLint("MissingPermission")
@Override
public void createAddAccountIntent(Callback<Intent> callback) {
- AccountManagerCallback<Bundle> accountManagerCallback = accountManagerFuture -> {
- try {
- Bundle bundle = accountManagerFuture.getResult();
- callback.onResult(bundle.getParcelable(AccountManager.KEY_INTENT));
- } catch (OperationCanceledException | IOException | AuthenticatorException e) {
- Log.e(TAG, "Error while creating an intent to add an account: ", e);
- callback.onResult(null);
- }
- };
- mAccountManager.addAccount(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE, null, null, null, null,
- accountManagerCallback, null);
}
// No permission is needed on 23+ and Chrome always has MANAGE_ACCOUNTS permission on lower APIs