Browse Source

Update Android-specific patches for v78; introduce patches from Bromite and Unobtainium

Switch to standard patch format for new/updated patches
tags/78.0.3904.97-1
csagan5 1 year ago
parent
commit
8d4c281f1e
19 changed files with 2525 additions and 1341 deletions
  1. +104
    -0
      patches/Bromite/Remove-SMS-integration.patch
  2. +481
    -0
      patches/Bromite/Remove-play-dependency-for-module-installer.patch
  3. +161
    -0
      patches/Unobtainium/kill-Auth.patch
  4. +1055
    -0
      patches/Unobtainium/kill-GCM.patch
  5. +48
    -0
      patches/Unobtainium/kill-Location-fall-back-to-system.patch
  6. +48
    -0
      patches/Unobtainium/kill-TOS-and-metrics-opt-out.patch
  7. +31
    -0
      patches/Unobtainium/kill-Translate.patch
  8. +128
    -0
      patches/Unobtainium/kill-Vision.patch
  9. +18
    -10
      patches/series
  10. +132
    -0
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gcm.patch
  11. +30
    -178
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.auth.patch
  12. +37
    -33
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.cast.patch
  13. +59
    -49
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.common-auth-signin-dynamic-com.google.android.gms.tasks.patch
  14. +26
    -20
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.fido-com.google.android.gms.iid-com.google.android.gms.instantapps-com.google.android.gms.location.patch
  15. +11
    -6
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.flags-com.google.android.gms.location.places-com.google.android.gms.stats.patch
  16. +92
    -581
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.gcm.patch
  17. +52
    -132
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.vision-com.google.android.gms.clearcut-com.google.android.gms.phenotype.patch
  18. +12
    -8
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.play.patch
  19. +0
    -324
      patches/ungoogled-chromium-android/remove-gcm-client.patch

+ 104
- 0
patches/Bromite/Remove-SMS-integration.patch View File

@ -0,0 +1,104 @@
From: csagan5 <[email protected]>
Date: Sun, 3 Nov 2019 08:22:29 +0100
Subject: Remove SMS integration
---
content/public/android/BUILD.gn | 2 -
.../org/chromium/content/browser/sms/Wrappers.java | 74 ----------------------
2 files changed, 76 deletions(-)
delete mode 100644 content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn
--- a/content/public/android/BUILD.gn
+++ b/content/public/android/BUILD.gn
@@ -231,8 +231,6 @@ android_library("content_java") {
"java/src/org/chromium/content/browser/selection/SmartSelectionClient.java",
"java/src/org/chromium/content/browser/selection/SmartSelectionMetricsLogger.java",
"java/src/org/chromium/content/browser/selection/SmartSelectionProvider.java",
- "java/src/org/chromium/content/browser/sms/SmsReceiver.java",
- "java/src/org/chromium/content/browser/sms/Wrappers.java",
"java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java",
"java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java",
"java/src/org/chromium/content/common/ContentSwitchUtils.java",
diff --git a/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java b/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java
deleted file mode 100644
--- a/content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content.browser.sms;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.ContextWrapper;
-import android.content.Intent;
-import android.content.IntentFilter;
-
-import com.google.android.gms.auth.api.phone.SmsRetrieverClient;
-import com.google.android.gms.tasks.Task;
-
-class Wrappers {
- // Prevent instantiation.
- private Wrappers() {}
-
- /**
- * Wraps com.google.android.gms.auth.api.phone.SmsRetrieverClient.
- */
- static class SmsRetrieverClientWrapper {
- private final SmsRetrieverClient mSmsRetrieverClient;
- private SmsReceiverContext mContext;
-
- public SmsRetrieverClientWrapper(SmsRetrieverClient smsRetrieverClient) {
- mSmsRetrieverClient = smsRetrieverClient;
- }
-
- public void setContext(SmsReceiverContext context) {
- mContext = context;
- }
-
- public SmsReceiverContext getContext() {
- return mContext;
- }
-
- public Task<Void> startSmsRetriever() {
- return mSmsRetrieverClient.startSmsRetriever();
- }
- }
-
- /**
- * Extends android.content.ContextWrapper to store and retrieve the
- * registered BroadcastReceiver.
- */
- static class SmsReceiverContext extends ContextWrapper {
- private BroadcastReceiver mReceiver;
-
- public SmsReceiverContext(Context context) {
- super(context);
- }
-
- public BroadcastReceiver getRegisteredReceiver() {
- return mReceiver;
- }
-
- // ---------------------------------------------------------------------
- // Context overrides:
-
- @Override
- public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
- mReceiver = receiver;
- return super.registerReceiver(receiver, filter);
- }
-
- @Override
- public void unregisterReceiver(BroadcastReceiver receiver) {
- mReceiver = null;
- super.unregisterReceiver(receiver);
- }
- }
-}
--
2.11.0

+ 481
- 0
patches/Bromite/Remove-play-dependency-for-module-installer.patch View File

@ -0,0 +1,481 @@
From: csagan5 <[email protected]>
Date: Sat, 2 Nov 2019 16:27:51 +0100
Subject: Remove play dependency for module installer
---
.../FakeModuleInstallerBackend.java | 16 +-
.../module_installer/ModuleInstallerImpl.java | 150 ---------------
.../PlayCoreModuleInstallerBackend.java | 210 +--------------------
3 files changed, 10 insertions(+), 366 deletions(-)
diff --git a/components/module_installer/android/java/src/org/chromium/components/module_installer/FakeModuleInstallerBackend.java b/components/module_installer/android/java/src/org/chromium/components/module_installer/FakeModuleInstallerBackend.java
--- a/components/module_installer/android/java/src/org/chromium/components/module_installer/FakeModuleInstallerBackend.java
+++ b/components/module_installer/android/java/src/org/chromium/components/module_installer/FakeModuleInstallerBackend.java
@@ -7,9 +7,6 @@ package org.chromium.components.module_installer;
import android.content.Context;
import android.content.pm.PackageManager;
-import com.google.android.play.core.splitcompat.SplitCompat;
-import com.google.android.play.core.splitcompat.ingestion.Verifier;
-
import org.chromium.base.BuildInfo;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
@@ -132,18 +129,7 @@ class FakeModuleInstallerBackend extends ModuleInstallerBackend {
return false;
}
- // Check that the module's signature matches Chrome's.
- try {
- Verifier verifier = new Verifier(context);
- if (!verifier.verifySplits()) {
- return false;
- }
- } catch (IOException | PackageManager.NameNotFoundException e) {
- return false;
- }
-
- // Tell SplitCompat to do a full emulation of the module.
- return SplitCompat.fullInstall(context);
+ return false;
}
private File joinPaths(String... paths) {
diff --git a/components/module_installer/android/java/src/org/chromium/components/module_installer/ModuleInstallerImpl.java b/components/module_installer/android/java/src/org/chromium/components/module_installer/ModuleInstallerImpl.java
--- a/components/module_installer/android/java/src/org/chromium/components/module_installer/ModuleInstallerImpl.java
+++ b/components/module_installer/android/java/src/org/chromium/components/module_installer/ModuleInstallerImpl.java
@@ -11,9 +11,6 @@ import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Build;
import android.text.TextUtils;
-import com.google.android.play.core.splitcompat.SplitCompat;
-import com.google.android.play.core.splitinstall.SplitInstallManagerFactory;
-
import org.chromium.base.BuildInfo;
import org.chromium.base.CommandLine;
import org.chromium.base.ContextUtils;
@@ -57,152 +54,5 @@ import java.util.TreeSet;
sInstance = moduleInstaller;
}
- @Override
- public void init() {
- try (Timer ignored1 = new Timer()) {
- if (sAppContextSplitCompatted) return;
- // SplitCompat.install may copy modules into Chrome's internal folder or clean them up.
- try (StrictModeContext ignored = StrictModeContext.allowDiskWrites()) {
- SplitCompat.install(ContextUtils.getApplicationContext());
- sAppContextSplitCompatted = true;
- }
- // SplitCompat.install may add emulated modules. Thus, update crash keys.
- updateCrashKeys();
- }
- }
-
- @Override
- public void initActivity(Activity activity) {
- try (Timer ignored = new Timer()) {
- // SplitCompat#install should always be run for the application first before it is run
- // for any activities.
- init();
- SplitCompat.installActivity(activity);
- }
- }
-
- @Override
- public void recordModuleAvailability() {
- try (Timer ignored = new Timer()) {
- getBackend().recordModuleAvailability();
- }
- }
-
- @Override
- public void recordStartupTime() {
- getBackend().recordStartupTime(Timer.getTotalTime());
- }
-
- @Override
- public void updateCrashKeys() {
- try (Timer ignored = new Timer()) {
- Context context = ContextUtils.getApplicationContext();
-
- // Get modules that are fully installed as split APKs (excluding base which is always
- // installed). Tree set to have ordered and, thus, deterministic results.
- Set<String> fullyInstalledModules = new TreeSet<>();
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- // Split APKs are only supported on Android L+.
- try {
- PackageInfo packageInfo = context.getPackageManager().getPackageInfo(
- BuildInfo.getInstance().packageName, 0);
- if (packageInfo.splitNames != null) {
- fullyInstalledModules.addAll(Arrays.asList(packageInfo.splitNames));
- }
- } catch (NameNotFoundException e) {
- throw new RuntimeException(e);
- }
- }
-
- // Create temporary split install manager to retrieve both fully installed and emulated
- // modules. Then remove fully installed ones to get emulated ones only. Querying the
- // installed modules can only be done if splitcompat has already been called. Otherwise,
- // emulation of later modules won't work. If splitcompat has not been called no modules
- // are emulated. Therefore, use an empty set in that case.
- Set<String> emulatedModules = new TreeSet<>();
- if (sAppContextSplitCompatted) {
- emulatedModules.addAll(
- SplitInstallManagerFactory.create(context).getInstalledModules());
- emulatedModules.removeAll(fullyInstalledModules);
- }
-
- CrashKeys.getInstance().set(
- CrashKeyIndex.INSTALLED_MODULES, encodeCrashKeyValue(fullyInstalledModules));
- CrashKeys.getInstance().set(
- CrashKeyIndex.EMULATED_MODULES, encodeCrashKeyValue(emulatedModules));
- }
- }
-
- @Override
- public void install(String moduleName, OnModuleInstallFinishedListener onFinishedListener) {
- try (Timer ignored = new Timer()) {
- ThreadUtils.assertOnUiThread();
-
- if (!mModuleNameListenerMap.containsKey(moduleName)) {
- mModuleNameListenerMap.put(moduleName, new LinkedList<>());
- }
- List<OnModuleInstallFinishedListener> onFinishedListeners =
- mModuleNameListenerMap.get(moduleName);
- onFinishedListeners.add(onFinishedListener);
- if (onFinishedListeners.size() > 1) {
- // Request is already running.
- return;
- }
- getBackend().install(moduleName);
- }
- }
-
- @Override
- public void installDeferred(String moduleName) {
- try (Timer ignored = new Timer()) {
- ThreadUtils.assertOnUiThread();
- getBackend().installDeferred(moduleName);
- }
- }
-
- private void onFinished(boolean success, List<String> moduleNames) {
- // Add timer to this private method since it is passed as a callback.
- try (Timer ignored = new Timer()) {
- ThreadUtils.assertOnUiThread();
-
- mActivityObserver.onModuleInstalled();
-
- for (String moduleName : moduleNames) {
- List<OnModuleInstallFinishedListener> onFinishedListeners =
- mModuleNameListenerMap.get(moduleName);
- if (onFinishedListeners == null) continue;
-
- for (OnModuleInstallFinishedListener listener : onFinishedListeners) {
- listener.onFinished(success);
- }
- mModuleNameListenerMap.remove(moduleName);
- }
-
- if (mModuleNameListenerMap.isEmpty()) {
- mBackend.close();
- mBackend = null;
- }
-
- updateCrashKeys();
- }
- }
-
- private ModuleInstallerBackend getBackend() {
- if (mBackend == null) {
- ModuleInstallerBackend.OnFinishedListener listener = this::onFinished;
- mBackend = CommandLine.getInstance().hasSwitch(FAKE_FEATURE_MODULE_INSTALL)
- ? new FakeModuleInstallerBackend(listener)
- : new PlayCoreModuleInstallerBackend(listener);
- }
- return mBackend;
- }
-
- private String encodeCrashKeyValue(Set<String> moduleNames) {
- if (moduleNames.isEmpty()) return "<none>";
- // Values with dots are interpreted as URLs. Some module names have dots in them. Make sure
- // they don't get sanitized.
- return TextUtils.join(",", moduleNames).replace('.', '$');
- }
-
private ModuleInstallerImpl() {}
}
diff --git a/components/module_installer/android/java/src/org/chromium/components/module_installer/PlayCoreModuleInstallerBackend.java b/components/module_installer/android/java/src/org/chromium/components/module_installer/PlayCoreModuleInstallerBackend.java
--- a/components/module_installer/android/java/src/org/chromium/components/module_installer/PlayCoreModuleInstallerBackend.java
+++ b/components/module_installer/android/java/src/org/chromium/components/module_installer/PlayCoreModuleInstallerBackend.java
@@ -7,15 +7,6 @@ package org.chromium.components.module_installer;
import android.content.SharedPreferences;
import android.util.SparseLongArray;
-import com.google.android.play.core.splitinstall.SplitInstallException;
-import com.google.android.play.core.splitinstall.SplitInstallManager;
-import com.google.android.play.core.splitinstall.SplitInstallManagerFactory;
-import com.google.android.play.core.splitinstall.SplitInstallRequest;
-import com.google.android.play.core.splitinstall.SplitInstallSessionState;
-import com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener;
-import com.google.android.play.core.splitinstall.model.SplitInstallErrorCode;
-import com.google.android.play.core.splitinstall.model.SplitInstallSessionStatus;
-
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.metrics.CachedMetrics.EnumeratedHistogramSample;
@@ -33,14 +24,13 @@ import java.util.Set;
* Backend that uses the Play Core SDK to download a module from Play and install it subsequently.
*/
/* package */ class PlayCoreModuleInstallerBackend
- extends ModuleInstallerBackend implements SplitInstallStateUpdatedListener {
+ extends ModuleInstallerBackend {
private static class InstallTimes {
public final boolean mIsCached;
public final SparseLongArray mInstallTimes = new SparseLongArray();
public InstallTimes(boolean isCached) {
mIsCached = isCached;
- mInstallTimes.put(SplitInstallSessionStatus.UNKNOWN, System.currentTimeMillis());
}
}
@@ -50,7 +40,6 @@ import java.util.Set;
private static final String KEY_MODULES_DEFERRED_REQUESTED_PREVIOUSLY =
"key_modules_deferred_requested_previously";
private final Map<String, InstallTimes> mInstallTimesMap = new HashMap<>();
- private final SplitInstallManager mManager;
private boolean mIsClosed;
// FeatureModuleInstallStatus defined in //tools/metrics/histograms/enums.xml.
@@ -90,183 +79,31 @@ import java.util.Set;
// Keep this one at the end and increment appropriately when adding new status.
private static final int AVAILABILITY_STATUS_COUNT = 3;
- /** Records via UMA all modules that have been requested and are currently installed. */
- @Override
- /* package */ void recordModuleAvailability() {
- SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
- Set<String> requestedModules = new HashSet<>();
- requestedModules.addAll(
- prefs.getStringSet(KEY_MODULES_ONDEMAND_REQUESTED_PREVIOUSLY, new HashSet<>()));
- requestedModules.addAll(
- prefs.getStringSet(KEY_MODULES_DEFERRED_REQUESTED_PREVIOUSLY, new HashSet<>()));
- Set<String> installedModules = mManager.getInstalledModules();
-
- for (String name : requestedModules) {
- EnumeratedHistogramSample sample = new EnumeratedHistogramSample(
- "Android.FeatureModules.AvailabilityStatus." + name, AVAILABILITY_STATUS_COUNT);
- if (installedModules.contains(name)) {
- sample.record(AVAILABILITY_STATUS_INSTALLED_REQUESTED);
- } else {
- sample.record(AVAILABILITY_STATUS_REQUESTED);
- }
- }
-
- for (String name : installedModules) {
- if (!requestedModules.contains(name)) {
- // Module appeared without being requested. Weird.
- EnumeratedHistogramSample sample = new EnumeratedHistogramSample(
- "Android.FeatureModules.AvailabilityStatus." + name,
- AVAILABILITY_STATUS_COUNT);
- sample.record(AVAILABILITY_STATUS_INSTALLED_UNREQUESTED);
- }
- }
- }
-
- @Override
- /* package */ void recordStartupTime(long durationMs) {
- TimesHistogramSample sample =
- new TimesHistogramSample("Android.FeatureModules.StartupTime");
- sample.record(durationMs);
- }
-
/* package */ PlayCoreModuleInstallerBackend(OnFinishedListener listener) {
super(listener);
- // MUST call init before creating a SplitInstallManager.
- ModuleInstaller.getInstance().init();
- mManager = SplitInstallManagerFactory.create(ContextUtils.getApplicationContext());
- mManager.registerListener(this);
}
@Override
- public void install(String moduleName) {
+ public void close() {
assert !mIsClosed;
-
- // Record start time in order to later report the install duration via UMA. We want to make
- // a difference between modules that have been requested first before and after the last
- // Chrome start. Modules that have been requested before may install quicker as they may be
- // installed form cache. To do this, we use shared prefs to track modules previously
- // requested. Additionally, storing requested modules helps us to record module install
- // status at next Chrome start.
- assert !mInstallTimesMap.containsKey(moduleName);
- mInstallTimesMap.put(moduleName,
- new InstallTimes(storeModuleRequested(
- moduleName, KEY_MODULES_ONDEMAND_REQUESTED_PREVIOUSLY)));
-
- SplitInstallRequest request =
- SplitInstallRequest.newBuilder().addModule(moduleName).build();
-
- mManager.startInstall(request).addOnFailureListener(exception -> {
- int status = exception instanceof SplitInstallException
- ? getHistogramCode(((SplitInstallException) exception).getErrorCode())
- : INSTALL_STATUS_UNKNOWN_REQUEST_ERROR;
- Log.e(TAG, "Failed to request module '%s': error code %s", moduleName, status);
- // If we reach this error condition |onStateUpdate| won't be called. Thus, call
- // |onFinished| here.
- finish(false, Collections.singletonList(moduleName), status);
- });
+ mIsClosed = true;
}
@Override
- public void installDeferred(String moduleName) {
- assert !mIsClosed;
- mManager.deferredInstall(Collections.singletonList(moduleName));
- storeModuleRequested(moduleName, KEY_MODULES_DEFERRED_REQUESTED_PREVIOUSLY);
+ /* package */ void recordModuleAvailability() {
+ SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
}
@Override
- public void close() {
- assert !mIsClosed;
- mManager.unregisterListener(this);
- mIsClosed = true;
+ /* package */ void recordStartupTime(long durationMs) {
}
@Override
- public void onStateUpdate(SplitInstallSessionState state) {
- assert !mIsClosed;
- Log.i(TAG, "Status for modules '%s' updated to %d", state.moduleNames(), state.status());
- switch (state.status()) {
- case SplitInstallSessionStatus.DOWNLOADING:
- case SplitInstallSessionStatus.INSTALLING:
- case SplitInstallSessionStatus.INSTALLED:
- for (String name : state.moduleNames()) {
- mInstallTimesMap.get(name).mInstallTimes.put(
- state.status(), System.currentTimeMillis());
- }
- if (state.status() == SplitInstallSessionStatus.INSTALLED) {
- finish(true, state.moduleNames(), INSTALL_STATUS_SUCCESS);
- }
- break;
- // DOWNLOADED only gets sent if SplitCompat is not enabled. That's an error.
- // SplitCompat should always be enabled.
- case SplitInstallSessionStatus.DOWNLOADED:
- case SplitInstallSessionStatus.CANCELED:
- case SplitInstallSessionStatus.FAILED:
- int status;
- if (state.status() == SplitInstallSessionStatus.DOWNLOADED) {
- status = INSTALL_STATUS_NO_SPLITCOMPAT;
- } else if (state.status() == SplitInstallSessionStatus.CANCELED) {
- status = INSTALL_STATUS_CANCELLATION;
- } else {
- status = getHistogramCode(state.errorCode());
- }
- Log.e(TAG, "Failed to install modules '%s': error code %s", state.moduleNames(),
- status);
- finish(false, state.moduleNames(), status);
- break;
- }
- }
-
- private void finish(boolean success, List<String> moduleNames, int eventId) {
- for (String name : moduleNames) {
- RecordHistogram.recordEnumeratedHistogram(
- "Android.FeatureModules.InstallStatus." + name, eventId, INSTALL_STATUS_COUNT);
- if (success) {
- recordInstallTimes(name);
- }
- }
- onFinished(success, moduleNames);
+ public void install(String moduleName) {
}
- /**
- * Gets the UMA code based on a SplitInstall error code
- * @param errorCode The error code
- * @return int The User Metric Analysis code
- */
- private int getHistogramCode(@SplitInstallErrorCode int errorCode) {
- switch (errorCode) {
- case SplitInstallErrorCode.ACCESS_DENIED:
- return INSTALL_STATUS_ACCESS_DENIED;
- case SplitInstallErrorCode.ACTIVE_SESSIONS_LIMIT_EXCEEDED:
- return INSTALL_STATUS_ACTIVE_SESSIONS_LIMIT_EXCEEDED;
- case SplitInstallErrorCode.API_NOT_AVAILABLE:
- return INSTALL_STATUS_API_NOT_AVAILABLE;
- case SplitInstallErrorCode.INCOMPATIBLE_WITH_EXISTING_SESSION:
- return INSTALL_STATUS_INCOMPATIBLE_WITH_EXISTING_SESSION;
- case SplitInstallErrorCode.INSUFFICIENT_STORAGE:
- return INSTALL_STATUS_INSUFFICIENT_STORAGE;
- case SplitInstallErrorCode.INVALID_REQUEST:
- return INSTALL_STATUS_INVALID_REQUEST;
- case SplitInstallErrorCode.MODULE_UNAVAILABLE:
- return INSTALL_STATUS_MODULE_UNAVAILABLE;
- case SplitInstallErrorCode.NETWORK_ERROR:
- return INSTALL_STATUS_NETWORK_ERROR;
- case SplitInstallErrorCode.NO_ERROR:
- return INSTALL_STATUS_NO_ERROR;
- case SplitInstallErrorCode.SERVICE_DIED:
- return INSTALL_STATUS_SERVICE_DIED;
- case SplitInstallErrorCode.SESSION_NOT_FOUND:
- return INSTALL_STATUS_SESSION_NOT_FOUND;
- case SplitInstallErrorCode.SPLITCOMPAT_COPY_ERROR:
- return INSTALL_STATUS_SPLITCOMPAT_COPY_ERROR;
- case SplitInstallErrorCode.SPLITCOMPAT_EMULATION_ERROR:
- return INSTALL_STATUS_SPLITCOMPAT_EMULATION_ERROR;
- case SplitInstallErrorCode.SPLITCOMPAT_VERIFICATION_ERROR:
- return INSTALL_STATUS_SPLITCOMPAT_VERIFICATION_ERROR;
- case SplitInstallErrorCode.INTERNAL_ERROR:
- return INSTALL_STATUS_INTERNAL_ERROR;
- default:
- return INSTALL_STATUS_UNKNOWN_SPLITINSTALL_ERROR;
- }
+ @Override
+ public void installDeferred(String moduleName) {
}
/**
@@ -286,33 +123,4 @@ import java.util.Set;
editor.apply();
return modulesRequestedPreviously.contains(moduleName);
}
-
- /** Records via UMA module install times divided into install steps. */
- private void recordInstallTimes(String moduleName) {
- recordInstallTime(moduleName, "", SplitInstallSessionStatus.UNKNOWN,
- SplitInstallSessionStatus.INSTALLED);
- recordInstallTime(moduleName, ".PendingDownload", SplitInstallSessionStatus.UNKNOWN,
- SplitInstallSessionStatus.DOWNLOADING);
- recordInstallTime(moduleName, ".Download", SplitInstallSessionStatus.DOWNLOADING,
- SplitInstallSessionStatus.INSTALLING);
- recordInstallTime(moduleName, ".Installing", SplitInstallSessionStatus.INSTALLING,
- SplitInstallSessionStatus.INSTALLED);
- }
-
- private void recordInstallTime(
- String moduleName, String histogramSubname, int startKey, int endKey) {
- assert mInstallTimesMap.containsKey(moduleName);
- InstallTimes installTimes = mInstallTimesMap.get(moduleName);
- if (installTimes.mInstallTimes.get(startKey) == 0
- || installTimes.mInstallTimes.get(endKey) == 0) {
- // Time stamps for install times have not been stored. Don't record anything to not skew
- // data.
- return;
- }
- RecordHistogram.recordLongTimesHistogram(
- String.format("Android.FeatureModules.%sInstallDuration%s.%s",
- installTimes.mIsCached ? "Cached" : "Uncached", histogramSubname,
- moduleName),
- installTimes.mInstallTimes.get(endKey) - installTimes.mInstallTimes.get(startKey));
- }
}
--
2.11.0

+ 161
- 0
patches/Unobtainium/kill-Auth.patch View File

@ -0,0 +1,161 @@
From: thermatk <[email protected]>
Date: Fri, 22 Jun 2018 17:06:15 +0200
Subject: kill Auth
---
.../chrome/browser/signin/SigninHelper.java | 22 +---------
.../components/signin/AccountIdProvider.java | 9 +---
.../signin/SystemAccountManagerDelegate.java | 50 ++--------------------
3 files changed, 5 insertions(+), 76 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
@@ -10,10 +10,6 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.Nullable;
-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.VisibleForTesting;
@@ -74,23 +70,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);
}
}
diff --git a/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java b/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
--- a/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
+++ b/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
@@ -4,8 +4,6 @@
package org.chromium.components.signin;
-import com.google.android.gms.auth.GoogleAuthException;
-import com.google.android.gms.auth.GoogleAuthUtil;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
@@ -40,12 +38,7 @@ public class AccountIdProvider {
* @param accountName The email address of a Google account.
*/
public String getAccountId(String accountName) {
- try {
- return GoogleAuthUtil.getAccountId(ContextUtils.getApplicationContext(), accountName);
- } catch (IOException | GoogleAuthException ex) {
- Log.e("cr.AccountIdProvider", "AccountIdProvider.getAccountId", ex);
- return null;
- }
+ return null;
}
/**
diff --git 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
--- 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
@@ -24,9 +24,6 @@ import android.os.PatternMatcher;
import android.os.Process;
import android.os.SystemClock;
-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;
@@ -116,48 +113,18 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
// 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 AccountManagerFacade.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);
- }
+ return null;
}
@Override
- public void invalidateAuthToken(String authToken) throws AuthException {
- try {
- GoogleAuthUtil.clearToken(ContextUtils.getApplicationContext(), authToken);
- } catch (GooglePlayServicesAvailabilityException ex) {
- throw new AuthException(AuthException.NONTRANSIENT, ex);
- } catch (GoogleAuthException ex) {
- throw new AuthException(AuthException.NONTRANSIENT, ex);
- } catch (IOException ex) {
- throw new AuthException(AuthException.TRANSIENT, ex);
- }
+ public void invalidateAuthToken(String authToken) {
}
@Override
@@ -187,17 +154,6 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
@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
--
2.11.0

+ 1055
- 0
patches/Unobtainium/kill-GCM.patch
File diff suppressed because it is too large
View File


+ 48
- 0
patches/Unobtainium/kill-Location-fall-back-to-system.patch View File

@ -0,0 +1,48 @@
From: thermatk <[email protected]>
Date: Fri, 22 Jun 2018 17:05:17 +0200
Subject: kill Location, fall back to system
---
services/device/geolocation/BUILD.gn | 1 -
.../chromium/device/geolocation/LocationProviderFactory.java | 10 ++--------
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/services/device/geolocation/BUILD.gn b/services/device/geolocation/BUILD.gn
--- a/services/device/geolocation/BUILD.gn
+++ b/services/device/geolocation/BUILD.gn
@@ -136,7 +136,6 @@ if (is_android) {
"android/java/src/org/chromium/device/geolocation/LocationProviderAdapter.java",
"android/java/src/org/chromium/device/geolocation/LocationProviderAndroid.java",
"android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java",
- "android/java/src/org/chromium/device/geolocation/LocationProviderGmsCore.java",
]
deps = [
diff --git a/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java b/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java
--- a/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java
+++ b/services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderFactory.java
@@ -26,19 +26,13 @@ public class LocationProviderFactory {
@CalledByNative
public static void useGmsCoreLocationProvider() {
- sUseGmsCoreLocationProvider = true;
+ sUseGmsCoreLocationProvider = false;
}
public static LocationProvider create() {
if (sProviderImpl != null) return sProviderImpl;
- if (sUseGmsCoreLocationProvider
- && LocationProviderGmsCore.isGooglePlayServicesAvailable(
- ContextUtils.getApplicationContext())) {
- sProviderImpl = new LocationProviderGmsCore(ContextUtils.getApplicationContext());
- } else {
- sProviderImpl = new LocationProviderAndroid();
- }
+ sProviderImpl = new LocationProviderAndroid();
return sProviderImpl;
}
}
--
2.11.0

+ 48
- 0
patches/Unobtainium/kill-TOS-and-metrics-opt-out.patch View File

@ -0,0 +1,48 @@
From: thermatk <[email protected]>
Date: Fri, 22 Jun 2018 17:16:07 +0200
Subject: kill TOS and metrics opt-out
---
chrome/android/java/res/layout/fre_tosanduma.xml | 2 +-
chrome/android/java/res/values/dimens.xml | 1 -
.../src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java | 2 +-
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/chrome/android/java/res/layout/fre_tosanduma.xml b/chrome/android/java/res/layout/fre_tosanduma.xml
--- a/chrome/android/java/res/layout/fre_tosanduma.xml
+++ b/chrome/android/java/res/layout/fre_tosanduma.xml
@@ -62,7 +62,7 @@
android:layout_marginBottom="@dimen/fre_vertical_spacing"
android:gravity="center"
android:lineSpacingMultiplier="1.4"
- android:textAppearance="@style/TextAppearance.BlackBodyDefault" />
+ android:textAppearance="@style/TextAppearance.BlackBodyDefault" android:visibility="gone" />
<CheckBox
android:id="@+id/send_report_checkbox"
diff --git a/chrome/android/java/res/values/dimens.xml b/chrome/android/java/res/values/dimens.xml
--- a/chrome/android/java/res/values/dimens.xml
+++ b/chrome/android/java/res/values/dimens.xml
@@ -197,7 +197,6 @@
<dimen name="fre_button_padding">12dp</dimen>
<dimen name="fre_margin">24dp</dimen>
<dimen name="fre_image_height">120dp</dimen>
- <dimen name="fre_tos_checkbox_padding">12dp</dimen>
<!-- Account Signin dimensions -->
<!-- The Account Signin page appears in the First Run Experience (amongst other places), so uses
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java
@@ -38,7 +38,7 @@ public abstract class FirstRunActivityBase extends AsyncInitializationActivity {
static final String SHOW_SEARCH_ENGINE_PAGE = "ShowSearchEnginePage";
static final String SHOW_SIGNIN_PAGE = "ShowSignIn";
- public static final boolean DEFAULT_METRICS_AND_CRASH_REPORTING = true;
+ public static final boolean DEFAULT_METRICS_AND_CRASH_REPORTING = false;
private boolean mNativeInitialized;
--
2.11.0

+ 31
- 0
patches/Unobtainium/kill-Translate.patch View File

@ -0,0 +1,31 @@
From: thermatk <[email protected]>
Date: Fri, 22 Jun 2018 17:16:43 +0200
Subject: kill Translate
---
.../src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
@@ -24,6 +24,7 @@ import org.chromium.chrome.browser.datareduction.DataReductionProxyUma;
import org.chromium.chrome.browser.metrics.UmaUtils;
import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory;
+import org.chromium.chrome.browser.preferences.PrefServiceBridge;
import org.chromium.chrome.browser.searchwidget.SearchWidgetProvider;
import org.chromium.ui.base.LocalizationUtils;
@@ -137,6 +138,8 @@ public class FirstRunActivity extends FirstRunActivityBase implements FirstRunPa
if (mPostNativePageSequenceCreated) return;
mFirstRunFlowSequencer.onNativeInitialized(mFreProperties);
+ PrefServiceBridge.getInstance().setTranslateEnabled(false);
+
boolean notifyAdapter = false;
// An optional Data Saver page.
if (mFreProperties.getBoolean(SHOW_DATA_REDUCTION_PAGE)) {
--
2.11.0

+ 128
- 0
patches/Unobtainium/kill-Vision.patch View File

@ -0,0 +1,128 @@
From: thermatk <[email protected]>
Date: Fri, 22 Jun 2018 17:04:43 +0200
Subject: kill Vision
Barcode, face and text detection APIs
---
services/shape_detection/BUILD.gn | 6 ------
.../java/src/org/chromium/shape_detection/BitmapUtils.java | 12 ------------
.../chromium/shape_detection/FaceDetectionProviderImpl.java | 13 +------------
.../org/chromium/shape_detection/InterfaceRegistrar.java | 13 -------------
4 files changed, 1 insertion(+), 43 deletions(-)
diff --git a/services/shape_detection/BUILD.gn b/services/shape_detection/BUILD.gn
--- a/services/shape_detection/BUILD.gn
+++ b/services/shape_detection/BUILD.gn
@@ -84,14 +84,8 @@ if (is_android) {
android_library("shape_detection_java") {
java_files = [
- "android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java",
- "android/java/src/org/chromium/shape_detection/BarcodeDetectionProviderImpl.java",
- "android/java/src/org/chromium/shape_detection/FaceDetectionImpl.java",
- "android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java",
- "android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java",
"android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java",
"android/java/src/org/chromium/shape_detection/BitmapUtils.java",
- "android/java/src/org/chromium/shape_detection/TextDetectionImpl.java",
]
deps = [
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/BitmapUtils.java
@@ -6,8 +6,6 @@ package org.chromium.shape_detection;
import android.graphics.Bitmap;
-import com.google.android.gms.vision.Frame;
-
import org.chromium.mojo_base.BigBufferUtil;
import org.chromium.skia.mojom.ColorType;
@@ -44,14 +42,4 @@ public class BitmapUtils {
return bitmap;
}
-
- public static Frame convertToFrame(org.chromium.skia.mojom.Bitmap bitmapData) {
- Bitmap bitmap = convertToBitmap(bitmapData);
- if (bitmap == null) {
- return null;
- }
-
- // This constructor implies a pixel format conversion to YUV.
- return new Frame.Builder().setBitmap(bitmap).build();
- }
}
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionProviderImpl.java
@@ -4,9 +4,6 @@
package org.chromium.shape_detection;
-import com.google.android.gms.common.ConnectionResult;
-import com.google.android.gms.common.GoogleApiAvailability;
-
import org.chromium.base.ContextUtils;
import org.chromium.mojo.bindings.InterfaceRequest;
import org.chromium.mojo.system.MojoException;
@@ -23,16 +20,8 @@ public class FaceDetectionProviderImpl implements FaceDetectionProvider {
@Override
public void createFaceDetection(
InterfaceRequest<FaceDetection> request, FaceDetectorOptions options) {
- final boolean isGmsCoreSupported =
- GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
- ContextUtils.getApplicationContext())
- == ConnectionResult.SUCCESS;
- if (isGmsCoreSupported) {
- FaceDetection.MANAGER.bind(new FaceDetectionImplGmsCore(options), request);
- } else {
- FaceDetection.MANAGER.bind(new FaceDetectionImpl(options), request);
- }
+ FaceDetection.MANAGER.bind(new FaceDetectionImpl(options), request);
}
@Override
diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java b/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java
--- a/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java
+++ b/services/shape_detection/android/java/src/org/chromium/shape_detection/InterfaceRegistrar.java
@@ -8,9 +8,6 @@ import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.mojo.system.MessagePipeHandle;
import org.chromium.mojo.system.impl.CoreImpl;
-import org.chromium.shape_detection.mojom.BarcodeDetectionProvider;
-import org.chromium.shape_detection.mojom.FaceDetectionProvider;
-import org.chromium.shape_detection.mojom.TextDetection;
@JNINamespace("shape_detection")
class InterfaceRegistrar {
@@ -20,23 +17,13 @@ class InterfaceRegistrar {
@CalledByNative
static void bindBarcodeDetectionProvider(int nativeHandle) {
- BarcodeDetectionProvider impl = BarcodeDetectionProviderImpl.create();
- if (impl != null) {
- BarcodeDetectionProvider.MANAGER.bind(impl, messagePipeHandleFromNative(nativeHandle));
- }
}
@CalledByNative
static void bindFaceDetectionProvider(int nativeHandle) {
- FaceDetectionProvider.MANAGER.bind(
- new FaceDetectionProviderImpl(), messagePipeHandleFromNative(nativeHandle));
}
@CalledByNative
static void bindTextDetection(int nativeHandle) {
- TextDetection impl = TextDetectionImpl.create();
- if (impl != null) {
- TextDetection.MANAGER.bind(impl, messagePipeHandleFromNative(nativeHandle));
- }
}
}
--
2.11.0

+ 18
- 10
patches/series View File

@ -3,16 +3,24 @@ src-fix/fix-null-mInstanceID.patch
src-fix/fix-closure-compiler-minify-error.patch
Vanadium/0020-disable-media-router-media-remoting-by-default.patch
Vanadium/0021-disable-media-router-by-default.patch
Unobtainium/kill-Auth.patch
Unobtainium/kill-GCM.patch
Unobtainium/kill-Location-fall-back-to-system.patch
Unobtainium/kill-Vision.patch
Unobtainium/kill-Translate.patch
Unobtainium/kill-TOS-and-metrics-opt-out.patch
ungoogled-chromium-android/change-package-name-chromium.patch
ungoogled-chromium-android/linker-android-support-remove.patch
ungoogled-chromium-android/remove-gcm-client.patch
ungoogled-chromium-android/remove-gms-gcm.patch
ungoogled-chromium-android/remove-gms-auth.patch
ungoogled-chromium-android/remove-gms-cast.patch
ungoogled-chromium-android/remove-gms-fido-iid-instantapps-location.patch
ungoogled-chromium-android/remove-gms-vision-clearcut-phenotype.patch
ungoogled-chromium-android/remove-gms-flags-places-stats.patch
ungoogled-chromium-android/remove-gms-base-tasks.patch
ungoogled-chromium-android/remove-play-core.patch
ungoogled-chromium-android/Remove-dependency-on-com.google.android.gcm.patch
ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.gcm.patch
ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.auth.patch
ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.cast.patch
ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.fido-com.google.android.gms.iid-com.google.android.gms.instantapps-com.google.android.gms.location.patch
ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.vision-com.google.android.gms.clearcut-com.google.android.gms.phenotype.patch
ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.flags-com.google.android.gms.location.places-com.google.android.gms.stats.patch
ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.common-auth-signin-dynamic-com.google.android.gms.tasks.patch
ungoogled-chromium-android/Remove-dependency-on-com.google.android.play.patch
ungoogled-chromium-android/uncheck-fre-send-report.patch
ungoogled-chromium-android/disable-context-search-by-default.patch
ungoogled-chromium-android/disable-context-search-by-default.patch
Bromite/Remove-SMS-integration.patch
Bromite/Remove-play-dependency-for-module-installer.patch

+ 132
- 0
patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gcm.patch View File

@ -0,0 +1,132 @@
From: Wengling Chen <[email protected]>
Date: Sat, 2 Nov 2019 09:29:52 +0100
Subject: Remove dependency on com.google.android.gcm
---
third_party/android_sdk/BUILD.gn | 3 --
.../external/client/android2/AndroidManifest.xml | 35 ----------------------
.../channel/AndroidMessageReceiverService.java | 17 -----------
.../channel/AndroidMessageSenderService.java | 3 +-
4 files changed, 1 insertion(+), 57 deletions(-)
diff --git a/third_party/android_sdk/BUILD.gn b/third_party/android_sdk/BUILD.gn
--- a/third_party/android_sdk/BUILD.gn
+++ b/third_party/android_sdk/BUILD.gn
@@ -67,7 +67,4 @@ if (enable_java_templates) {
testonly = true
java_files = [ "//third_party/android_sdk/public/extras/chromium/support/src/org/chromium/android/support/PackageManagerWrapper.java" ]
}
- android_java_prebuilt("android_gcm_java") {
- jar_path = "//third_party/android_sdk/public/extras/google/gcm/gcm-client/dist/gcm.jar"
- }
}
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifest.xml b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifest.xml
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifest.xml
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifest.xml
@@ -4,10 +4,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.ipc.invalidation.client.android2">
- <!-- App receives GCM messages. -->
- <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
- <!-- GCM connects to Google Services. -->
- <uses-permission android:name="android.permission.INTERNET" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
@@ -16,40 +12,9 @@
<service android:exported="false"
android:name="com.google.ipc.invalidation.ticl.android2.TiclService"/>
- <!-- Ticl sender. -->
- <service android:exported="false"
- android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidMessageSenderService"/>
-
<!-- Receiver for scheduler alarms. -->
<receiver android:exported="false"
android:name="com.google.ipc.invalidation.ticl.android2.AndroidInternalScheduler$AlarmReceiver"/>
- <!-- GCM Broadcast Receiver -->
- <receiver android:exported="true"
- android:name="com.google.ipc.invalidation.external.client.contrib.MultiplexingGcmListener$GCMReceiver"
- android:permission="com.google.android.c2dm.permission.SEND">
- <intent-filter>
- <action android:name="com.google.android.c2dm.intent.RECEIVE" />
- <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
- <category android:name="com.google.ipc.invalidation.ticl.android2" />
- </intent-filter>
- </receiver>
-
- <!-- GCM multiplexer -->
- <service android:exported="false"
- android:name="com.google.ipc.invalidation.external.client.contrib.MultiplexingGcmListener">
- <meta-data android:name="sender_ids" android:value="[email protected]"/>
- </service>
-
- <!-- Invalidation service multiplexed GCM receiver -->
- <service android:exported="false"
- android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidMessageReceiverService"
- android:enabled="true"/>
- <receiver android:exported="false"
- android:name="com.google.ipc.invalidation.ticl.android2.channel.AndroidMessageReceiverService$Receiver">
- <intent-filter>
- <action android:name="com.google.ipc.invalidation.gcmmplex.EVENT" />
- </intent-filter>
- </receiver>
</application>
</manifest>
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageReceiverService.java b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageReceiverService.java
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageReceiverService.java
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageReceiverService.java
@@ -15,7 +15,6 @@
*/
package com.google.ipc.invalidation.ticl.android2.channel;
-import com.google.android.gcm.GCMRegistrar;
import com.google.ipc.invalidation.external.client.SystemResources.Logger;
import com.google.ipc.invalidation.external.client.android.service.AndroidLogger;
import com.google.ipc.invalidation.external.client.contrib.MultiplexingGcmListener;
@@ -126,20 +125,4 @@ public class AndroidMessageReceiverService extends MultiplexingGcmListener.Abstr
// now, there is nothing to do.
}
- /**
- * Initializes GCM as a convenience method for tests. In production, applications should handle
- * this.
- */
- public static void initializeGcmForTest(Context context, Logger logger, String senderId) {
- // Initialize GCM.
- GCMRegistrar.checkDevice(context);
- GCMRegistrar.checkManifest(context);
- String regId = GCMRegistrar.getRegistrationId(context);
- if (regId.isEmpty()) {
- logger.info("Not registered with GCM; registering");
- GCMRegistrar.register(context, senderId);
- } else {
- logger.fine("Already registered with GCM: %s", regId);
- }
- }
}
diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageSenderService.java b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageSenderService.java
--- a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageSenderService.java
+++ b/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ticl/android2/channel/AndroidMessageSenderService.java
@@ -15,7 +15,6 @@
*/
package com.google.ipc.invalidation.ticl.android2.channel;
-import com.google.android.gcm.GCMRegistrar;
import com.google.ipc.invalidation.common.GcmSharedConstants;
import com.google.ipc.invalidation.external.client.SystemResources.Logger;
import com.google.ipc.invalidation.external.client.android.service.AndroidLogger;
@@ -395,7 +394,7 @@ public class AndroidMessageSenderService extends IntentService {
// No client key when using old style registration id.
clientKey = "";
try {
- registrationId = GCMRegistrar.getRegistrationId(context);
+ registrationId = null;
} catch (RuntimeException exception) {
// GCMRegistrar#getRegistrationId occasionally throws a runtime exception. Catching the
// exception rather than crashing.
--
2.11.0

patches/ungoogled-chromium-android/remove-gms-auth.patch → patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.auth.patch View File

@ -1,23 +1,22 @@
Remove dependency on com.google.android.gms.auth (play-services-auth-15.0.1.aar, play-services-auth-api-phone-15.0.1.aar, play-services-auth-base-15.0.1.aar).
author: Wengling Chen <[email protected]>
From: Wengling Chen <[email protected]>
Date: Sat, 2 Nov 2019 09:22:31 +0100
Subject: Remove dependency on com.google.android.gms.auth
---
chrome/android/BUILD.gn | 1 -
.../chrome/browser/signin/SigninHelper.java | 21 ---------
components/background_task_scheduler/BUILD.gn | 1 -
components/signin/core/browser/android/BUILD.gn | 1 -
.../components/signin/AccountIdProvider.java | 19 +-------
.../signin/SystemAccountManagerDelegate.java | 52 ++--------------------
.../components/signin/AccountIdProvider.java | 7 +---
.../signin/SystemAccountManagerDelegate.java | 12 +-----
content/public/android/BUILD.gn | 1 -
.../org/chromium/content/browser/SmsReceiver.java | 37 +--------------
third_party/android_deps/BUILD.gn | 44 ------------------
.../chromium/content/browser/sms/SmsReceiver.java | 36 +-----------------
third_party/android_deps/BUILD.gn | 44 ----------------------
third_party/robolectric/BUILD.gn | 1 -
10 files changed, 6 insertions(+), 172 deletions(-)
8 files changed, 3 insertions(+), 100 deletions(-)
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -265,7 +265,6 @@ android_library("chrome_java") {
@@ -267,7 +267,6 @@ android_library("chrome_java") {
":thumbnail_cache_entry_proto_java",
":update_proto_java",
":usage_stats_proto_java",
@ -25,55 +24,6 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
"$google_play_services_package:google_play_services_cast_framework_java",
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
@@ -10,10 +10,6 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.Nullable;
-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.VisibleForTesting;
@@ -74,23 +70,6 @@ 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);
}
}
diff --git a/components/background_task_scheduler/BUILD.gn b/components/background_task_scheduler/BUILD.gn
--- a/components/background_task_scheduler/BUILD.gn
+++ b/components/background_task_scheduler/BUILD.gn
@@ -98,7 +98,6 @@ if (is_android) {
deps = [
":background_task_scheduler_java",
- "$google_play_services_package:google_play_services_auth_base_java",
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
"$google_play_services_package:google_play_services_tasks_java",
diff --git a/components/signin/core/browser/android/BUILD.gn b/components/signin/core/browser/android/BUILD.gn
--- a/components/signin/core/browser/android/BUILD.gn
+++ b/components/signin/core/browser/android/BUILD.gn
@ -88,33 +38,7 @@ diff --git a/components/signin/core/browser/android/BUILD.gn b/components/signin
diff --git a/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java b/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
--- a/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
+++ b/components/signin/core/browser/android/java/src/org/chromium/components/signin/AccountIdProvider.java
@@ -4,11 +4,6 @@
package org.chromium.components.signin;
-import com.google.android.gms.auth.GoogleAuthException;
-import com.google.android.gms.auth.GoogleAuthUtil;
-import com.google.android.gms.common.ConnectionResult;
-import com.google.android.gms.common.GoogleApiAvailability;
-
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.StrictModeContext;
@@ -40,12 +35,7 @@ public class AccountIdProvider {
* @param accountName The email address of a Google account.
*/
public String getAccountId(String accountName) {
- try {
- return GoogleAuthUtil.getAccountId(ContextUtils.getApplicationContext(), accountName);
- } catch (IOException | GoogleAuthException ex) {
- Log.e("cr.AccountIdProvider", "AccountIdProvider.getAccountId", ex);
- return null;
- }
+ return null;
}
/**
@@ -54,12 +44,7 @@ public class AccountIdProvider {
@@ -47,12 +47,7 @@ public class AccountIdProvider {
* Google Play services is available.
*/
public boolean canBeUsed() {
@ -131,20 +55,7 @@ diff --git a/components/signin/core/browser/android/java/src/org/chromium/compon
diff --git 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
--- 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
@@ -24,12 +24,6 @@ import android.os.PatternMatcher;
import android.os.Process;
import android.os.SystemClock;
-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;
import org.chromium.base.ContextUtils;
@@ -85,17 +79,7 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
@@ -82,17 +82,7 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
}
protected void checkCanUseGooglePlayServices() throws AccountManagerDelegateException {
@ -159,69 +70,10 @@ diff --git a/components/signin/core/browser/android/java/src/org/chromium/compon
- String.format("Can't use Google Play Services: %s",
- GoogleApiAvailability.getInstance().getErrorString(resultCode)),
- resultCode);
+ throw new GmsAvailabilityException("Can't use Google Play Services", 1); /*SERVICE_MISSING*/
+ throw new GmsAvailabilityException("Can't use Google Play Services", 1);
}
@Override
@@ -120,7 +104,7 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
return new Account[] {};
}
long now = SystemClock.elapsedRealtime();
- Account[] accounts = mAccountManager.getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
+ Account[] accounts = new Account[] {};
long elapsed = SystemClock.elapsedRealtime() - now;
recordElapsedTimeHistogram("Signin.AndroidGetAccountsTime_AccountManager", elapsed);
if (ThreadUtils.runningOnUiThread()) {
@@ -134,30 +118,11 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
public String getAuthToken(Account account, String authTokenScope) throws AuthException {
assert !ThreadUtils.runningOnUiThread();
assert AccountManagerFacade.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);
- }
+ return null;
}
@Override
public void invalidateAuthToken(String authToken) throws AuthException {
- try {
- GoogleAuthUtil.clearToken(ContextUtils.getApplicationContext(), authToken);
- } catch (GooglePlayServicesAvailabilityException ex) {
- throw new AuthException(AuthException.NONTRANSIENT, ex);
- } catch (GoogleAuthException ex) {
- throw new AuthException(AuthException.NONTRANSIENT, ex);
- } catch (IOException ex) {
- throw new AuthException(AuthException.TRANSIENT, ex);
- }
}
@Override
@@ -197,17 +162,6 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
@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
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn
--- a/content/public/android/BUILD.gn
+++ b/content/public/android/BUILD.gn
@ -233,33 +85,32 @@ diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
"$google_play_services_package:google_play_services_tasks_java",
diff --git a/content/public/android/java/src/org/chromium/content/browser/SmsReceiver.java b/content/public/android/java/src/org/chromium/content/browser/SmsReceiver.java
--- a/content/public/android/java/src/org/chromium/content/browser/SmsReceiver.java
+++ b/content/public/android/java/src/org/chromium/content/browser/SmsReceiver.java
@@ -9,12 +9,6 @@ import android.content.Context;
diff --git a/content/public/android/java/src/org/chromium/content/browser/sms/SmsReceiver.java b/content/public/android/java/src/org/chromium/content/browser/sms/SmsReceiver.java
--- a/content/public/android/java/src/org/chromium/content/browser/sms/SmsReceiver.java
+++ b/content/public/android/java/src/org/chromium/content/browser/sms/SmsReceiver.java
@@ -9,11 +9,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import com.google.android.gms.auth.api.phone.SmsRetriever;
-import com.google.android.gms.auth.api.phone.SmsRetrieverClient;
-import com.google.android.gms.common.api.CommonStatusCodes;
-import com.google.android.gms.common.api.Status;
-import com.google.android.gms.tasks.Task;
-
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.annotations.CalledByNative;
@@ -45,9 +39,6 @@ public class SmsReceiver extends BroadcastReceiver {
import org.chromium.base.VisibleForTesting;
@@ -50,9 +45,6 @@ public class SmsReceiver extends BroadcastReceiver {
// If this broadcast receiver becomes more heavyweight, we should make
// this registration expire after the SMS message is received.
if (DEBUG) Log.d(TAG, "Registering intent filters.");
- IntentFilter filter = new IntentFilter();
- filter.addAction(SmsRetriever.SMS_RETRIEVED_ACTION);
- context.registerReceiver(this, filter);
- mContext.registerReceiver(this, filter);
}
@CalledByNative
@@ -72,43 +63,17 @@ public class SmsReceiver extends BroadcastReceiver {
@@ -76,41 +68,15 @@ public class SmsReceiver extends BroadcastReceiver {
return;
}
@ -284,11 +135,11 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/SmsRec
- case CommonStatusCodes.SUCCESS:
- String message = intent.getExtras().getString(SmsRetriever.EXTRA_SMS_MESSAGE);
- if (DEBUG) Log.d(TAG, "Got message: %s!", message);
- nativeOnReceive(mSmsProviderAndroid, message);
- SmsReceiverJni.get().onReceive(mSmsProviderAndroid, message);
- break;
- case CommonStatusCodes.TIMEOUT:
- if (DEBUG) Log.d(TAG, "Timeout");
- nativeOnTimeout(mSmsProviderAndroid);
- SmsReceiverJni.get().onTimeout(mSmsProviderAndroid);
- break;
- }
+ if (DEBUG) Log.d(TAG, "Error getting parceable");
@ -296,9 +147,7 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/SmsRec
@CalledByNative
private void listen() {
final Context context = ContextUtils.getApplicationContext();
- SmsRetrieverClient client = SmsRetriever.getClient(context);
- Wrappers.SmsRetrieverClientWrapper client = getClient();
- Task<Void> task = client.startSmsRetriever();
-
if (DEBUG) Log.d(TAG, "Installed task");
@ -307,11 +156,10 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/SmsRec
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
--- a/third_party/android_deps/BUILD.gn
+++ b/third_party/android_deps/BUILD.gn
@@ -315,50 +315,6 @@ android_aar_prebuilt("com_android_support_support_v4_java") {
]
@@ -772,50 +772,6 @@ android_aar_prebuilt("com_android_support_viewpager_java") {
}
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
-android_aar_prebuilt("google_play_services_auth_java") {
- aar_path = "libs/com_google_android_gms_play_services_auth/play-services-auth-15.0.1.aar"
- info_path = "libs/com_google_android_gms_play_services_auth/com_google_android_gms_play_services_auth.info"
@ -355,9 +203,10 @@ diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.
- strip_drawables = true
-}
-
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
android_aar_prebuilt("google_play_services_base_java") {
aar_path = "libs/com_google_android_gms_play_services_base/play-services-base-15.0.1.aar"
info_path = "libs/com_google_android_gms_play_services_base/com_google_android_gms_play_services_base.info"
diff --git a/third_party/robolectric/BUILD.gn b/third_party/robolectric/BUILD.gn
--- a/third_party/robolectric/BUILD.gn
+++ b/third_party/robolectric/BUILD.gn
@ -369,3 +218,6 @@ diff --git a/third_party/robolectric/BUILD.gn b/third_party/robolectric/BUILD.gn
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
"//third_party/android_deps:android_support_v4_java",
--
2.11.0

patches/ungoogled-chromium-android/remove-gms-cast.patch → patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.cast.patch View File

@ -1,5 +1,6 @@
Remove dependency on com.google.android.gms.cast (play-services-cast-16.0.1.aar, play-services-cast-framework-16.0.1.aar).
author: Wengling Chen <[email protected]>
From: Wengling Chen <[email protected]>
Date: Sat, 2 Nov 2019 08:00:04 +0100
Subject: Remove dependency on com.google.android.gms.cast
---
chrome/android/BUILD.gn | 6 --
@ -28,33 +29,33 @@ author: Wengling Chen <[email protected]>
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -267,8 +267,6 @@ android_library("chrome_java") {
@@ -269,8 +269,6 @@ android_library("chrome_java") {
":usage_stats_proto_java",
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
- "$google_play_services_package:google_play_services_cast_framework_java",
- "$google_play_services_package:google_play_services_cast_java",
"$google_play_services_package:google_play_services_fido_java",
"$google_play_services_package:google_play_services_iid_java",
"$google_play_services_package:google_play_services_tasks_java",
@@ -671,8 +669,6 @@ junit_binary("chrome_junit_tests") {
"//base:base_java",
"//base:jni_java",
@@ -689,8 +687,6 @@ junit_binary("chrome_junit_tests") {
":partner_location_descriptor_proto_java",
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
- "$google_play_services_package:google_play_services_cast_framework_java",
- "$google_play_services_package:google_play_services_cast_java",
"$google_play_services_package:google_play_services_fido_java",
"//base:base_java",
"//base:base_java_test_support",
@@ -770,8 +766,6 @@ android_library("chrome_test_java") {
"//base:base_junit_test_support",
@@ -790,8 +786,6 @@ android_library("chrome_test_java") {
":partner_location_descriptor_proto_java",
"$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java",
- "$google_play_services_package:google_play_services_cast_framework_java",
- "$google_play_services_package:google_play_services_cast_java",
"$google_play_services_package:google_play_services_fido_java",
"$google_play_services_package:google_play_services_iid_java",
"$google_play_services_package:google_play_services_tasks_java",
"//base:base_java",
"//base:base_java_test_support",
diff --git a/chrome/android/features/media_router/BUILD.gn b/chrome/android/features/media_router/BUILD.gn
--- a/chrome/android/features/media_router/BUILD.gn
+++ b/chrome/android/features/media_router/BUILD.gn
@ -65,8 +66,8 @@ diff --git a/chrome/android/features/media_router/BUILD.gn b/chrome/android/feat
- "$google_play_services_package:google_play_services_cast_framework_java",
- "$google_play_services_package:google_play_services_cast_java",
"//base:base_java",
"//base:jni_java",
"//chrome/android:chrome_java",
"//services/media_session/public/cpp/android:media_session_java",
diff --git a/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/CastSessionUtil.java b/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/CastSessionUtil.java
--- a/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/CastSessionUtil.java
+++ b/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/CastSessionUtil.java
@ -771,11 +772,10 @@ diff --git a/chrome/android/features/media_router/java/src/org/chromium/chrome/b
import org.chromium.base.Log;
import org.chromium.chrome.browser.media.router.ChromeMediaRouter;
import org.chromium.chrome.browser.media.router.ClientRecord;
@@ -147,20 +145,6 @@ public class CafMediaRouteProvider extends CafBaseMediaRouteProvider {
return mMessageHandler;
@@ -148,20 +146,6 @@ public class CafMediaRouteProvider extends CafBaseMediaRouteProvider {
}
- @Override
@Override
- protected void handleSessionStart(CastSession session, String sessionId) {
- super.handleSessionStart(session, sessionId);
-
@ -789,9 +789,10 @@ diff --git a/chrome/android/features/media_router/java/src/org/chromium/chrome/b
- sessionController().getSession().getRemoteMediaClient().requestStatus();
- }
-
@Override
- @Override
protected void addRoute(
MediaRoute route, String origin, int tabId, int nativeRequestId, boolean wasLaunched) {
super.addRoute(route, origin, tabId, nativeRequestId, wasLaunched);
diff --git a/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/caf/CafMessageHandler.java b/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/caf/CafMessageHandler.java
--- a/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/caf/CafMessageHandler.java
+++ b/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/caf/CafMessageHandler.java
@ -1379,11 +1380,10 @@ diff --git a/chrome/android/features/media_router/java/src/org/chromium/chrome/b
import org.chromium.base.Log;
import org.chromium.chrome.browser.media.router.CastSessionUtil;
import org.chromium.chrome.browser.media.router.caf.BaseNotificationController;
@@ -33,19 +31,6 @@ public class RemotingSessionController extends BaseSessionController {
sInstance = new WeakReference<>(this);
@@ -34,19 +32,6 @@ public class RemotingSessionController extends BaseSessionController {
}
- @Override
@Override
- public void attachToCastSession(CastSession session) {
- super.attachToCastSession(session);
-
@ -1396,26 +1396,27 @@ diff --git a/chrome/android/features/media_router/java/src/org/chromium/chrome/b
- }
- }
-
@Override
- @Override
public void onSessionStarted() {
super.onSessionStarted();
@@ -53,12 +38,6 @@ public class RemotingSessionController extends BaseSessionController {
mFlingingControllerAdapter = new FlingingControllerAdapter(this, source.getMediaUrl());
RemotingMediaSource source = (RemotingMediaSource) getSource();
@@ -54,12 +39,6 @@ public class RemotingSessionController extends BaseSessionController {
}
- @Override
@Override
- protected void onStatusUpdated() {
- mFlingingControllerAdapter.onStatusUpdated();
- super.onStatusUpdated();
- }
-
@Override
- @Override
public FlingingControllerAdapter getFlingingController() {
return mFlingingControllerAdapter;
}
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -193,12 +193,6 @@ by a child template that "extends" this file.
@@ -184,12 +184,6 @@ by a child template that "extends" this file.
android:theme="@android:style/Theme.Material.Light.Dialog.Alert" />
{% endif %}
@ -1428,7 +1429,7 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro
<!-- Note: All activities directly or indirectly derived from ChromeActivity
must specify android:hardwareAccelerated="false".
@@ -835,16 +829,6 @@ by a child template that "extends" this file.
@@ -832,16 +826,6 @@ by a child template that "extends" this file.
</intent-filter>
</activity>
@ -1445,8 +1446,8 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/Andro
<!-- This activity is used to restart the main Chrome process. Should never be exported. -->
<activity android:name="org.chromium.chrome.browser.BrowserRestartActivity"
android:launchMode="singleInstance"
@@ -1237,18 +1221,6 @@ android:value="true" />
android:value="org.chromium.content_public.browser.SmartClipProvider"/>
@@ -1253,18 +1237,6 @@ android:value="true" />
{% endif %}
{% block extra_application_definitions %}
-
@ -1478,11 +1479,10 @@ diff --git a/chrome/test/android/cast_emulator/BUILD.gn b/chrome/test/android/ca
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
--- a/third_party/android_deps/BUILD.gn
+++ b/third_party/android_deps/BUILD.gn
@@ -341,38 +341,6 @@ android_aar_prebuilt("google_play_services_basement_java") {
input_jars_paths = [ "$android_sdk/optional/org.apache.http.legacy.jar" ]
@@ -798,38 +798,6 @@ android_aar_prebuilt("google_play_services_basement_java") {
}
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
-android_aar_prebuilt("google_play_services_cast_java") {
- aar_path = "libs/com_google_android_gms_play_services_cast/play-services-cast-16.0.1.aar"
- info_path = "libs/com_google_android_gms_play_services_cast/com_google_android_gms_play_services_cast.info"
@ -1514,6 +1514,10 @@ diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.
- strip_resources = true
-}
-
# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
android_aar_prebuilt("google_play_services_fido_java") {
aar_path = "libs/com_google_android_gms_play_services_fido/play-services-fido-15.0.1.aar"
-# This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
android_aar_prebuilt("google_play_services_tasks_java") {
aar_path = "libs/com_google_android_gms_play_services_tasks/play-services-tasks-15.0.1.aar"
info_path = "libs/com_google_android_gms_play_services_tasks/com_google_android_gms_play_services_tasks.info"
--
2.11.0

patches/ungoogled-chromium-android/remove-gms-base-tasks.patch → patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.common-auth-signin-dynamic-com.google.android.gms.tasks.patch View File

@ -1,5 +1,8 @@
Remove dependency on com.google.android.gms.common/auth/signin/dynamic, com.google.android.gms.tasks (play-services-base-15.0.1.aar, play-services-basement-15.0.1.aar, play-services-tasks-15.0.1.aar).
author: Wengling Chen <[email protected]>
From: Wengling Chen <[email protected]>
Date: Sat, 2 Nov 2019 08:58:19 +0100
Subject: Remove dependency on
com.google.android.gms.common/auth/signin/dynamic,
com.google.android.gms.tasks
---
chrome/android/BUILD.gn | 8 ---
@ -8,7 +11,7 @@ author: Wengling Chen <[email protected]>
chrome/android/java/AndroidManifest.xml | 9 ---
.../src/org/chromium/chrome/browser/AppHooks.java | 14 +---
.../chromium/chrome/browser/ChromeVersionInfo.java | 12 +---
.../browser/component_updater/UpdateScheduler.java | 8 +--
.../browser/component_updater/UpdateScheduler.java | 3 -
.../browser/externalauth/ExternalAuthUtils.java | 14 ++--
.../externalauth/UserRecoverableErrorHandler.java | 7 --
.../browser/gcore/ChromeGoogleApiClientImpl.java | 25 +------
@ -16,10 +19,11 @@ author: Wengling Chen <[email protected]>
.../chrome/browser/omaha/UpdateStatusProvider.java | 10 +--
.../browser/preferences/PreferencesLauncher.java | 5 +-
chrome/test/android/BUILD.gn | 2 -
components/background_task_scheduler/BUILD.gn | 9 ---
components/background_task_scheduler/BUILD.gn | 10 ---
components/signin/core/browser/android/BUILD.gn | 2 -
.../signin/GmsAvailabilityException.java | 4 +-
content/public/android/BUILD.gn | 3 -
content/test/BUILD.gn | 3 -
device/BUILD.gn | 2 -
remoting/android/client_java_tmpl.gni | 3 -
services/BUILD.gn | 4 --
@ -28,12 +32,12 @@ author: Wengling Chen <[email protected]>
third_party/android_deps/BUILD.gn | 38 ----------
third_party/cacheinvalidation/BUILD.gn | 1 -
third_party/robolectric/BUILD.gn | 2 -
26 files changed, 17 insertions(+), 260 deletions(-)
27 files changed, 16 insertions(+), 260 deletions(-)
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -265,9 +265,6 @@ android_library("chrome_java") {
@@ -267,9 +267,6 @@ android_library("chrome_java") {
":thumbnail_cache_entry_proto_java",
":update_proto_java",
":usage_stats_proto_java",
@ -43,7 +47,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
"//base:base_java",
"//base:jni_java",
"//chrome/android/features/keyboard_accessory:public_java",
@@ -665,8 +662,6 @@ junit_binary("chrome_junit_tests") {
@@ -685,8 +682,6 @@ junit_binary("chrome_junit_tests") {
":chrome_java",
":chrome_junit_test_support",
":partner_location_descriptor_proto_java",
@ -52,7 +56,7 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
"//base:base_java",
"//base:base_java_test_support",
"//base:base_junit_test_support",
@@ -761,9 +756,6 @@ android_library("chrome_test_java") {
@@ -784,9 +779,6 @@ android_library("chrome_test_java") {
":browser_java_test_support",
":chrome_test_util_java",
":partner_location_descriptor_proto_java",
@ -72,8 +76,8 @@ diff --git a/chrome/android/features/media_router/BUILD.gn b/chrome/android/feat
- "$google_play_services_package:google_play_services_base_java",
- "$google_play_services_package:google_play_services_basement_java",
"//base:base_java",
"//base:jni_java",
"//chrome/android:chrome_java",
"//services/media_session/public/cpp/android:media_session_java",
diff --git a/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java b/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java
--- a/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java
+++ b/chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java
@ -87,7 +91,7 @@ diff --git a/chrome/android/features/media_router/java/src/org/chromium/chrome/b
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.StrictModeContext;
@@ -42,9 +39,7 @@ public class ChromeMediaRouter implements MediaRouteManager {
@@ -43,9 +40,7 @@ public class ChromeMediaRouter implements MediaRouteManager {
int googleApiAvailabilityResult =
AppHooks.get().isGoogleApiAvailableWithMinApkVersion(
MIN_GOOGLE_PLAY_SERVICES_APK_VERSION);
@ -101,7 +105,7 @@ diff --git a/chrome/android/features/media_router/java/src/org/chromium/chrome/b
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -875,15 +875,6 @@ by a child template that "extends" this file.
@@ -889,15 +889,6 @@ by a child template that "extends" this file.
</intent-filter>
</activity>
@ -160,7 +164,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeVersionIn
import org.chromium.base.ContextUtils;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
@@ -88,7 +86,7 @@ public class ChromeVersionInfo {
@@ -95,7 +93,7 @@ public class ChromeVersionInfo {
public static String getGmsInfo() {
Context context = ContextUtils.getApplicationContext();
@ -169,7 +173,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeVersionIn
final long installedGmsVersion = getPlayServicesApkVersionNumber(context);
final String accessType;
@@ -105,12 +103,6 @@ public class ChromeVersionInfo {
@@ -112,12 +110,6 @@ public class ChromeVersionInfo {
}
private static long getPlayServicesApkVersionNumber(Context context) {
@ -196,18 +200,6 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/component_updat
import org.chromium.base.ContextUtils;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
@@ -35,10 +32,7 @@ public class UpdateScheduler {