Browse Source

Fix preferences mismatch

master 80.0.3987.106-1
wchen342 2 years ago
parent
commit
9694300f4a
Signed by untrusted user: wchen342 GPG Key ID: 720B70365E800508
  1. 3
      CHANGELOG.md
  2. 2
      README.md
  3. 2
      patches/series
  4. 40
      patches/src-fix/fix-prefs.patch
  5. 126
      patches/src-fix/fix-safe-browsing-prefs.patch
  6. 31
      patches/ungoogled-chromium-android/Disable-prefetch.patch

3
CHANGELOG.md

@ -6,8 +6,9 @@
* use blank page as homepage
* setting for DNS-over-HTTPS (DoH)
* flag to disable pull-to-refresh
* Set contextual search to `false` in native code instead of Java
* Disable contextual search in native code instead of Java
* Disable lite mode prompt
* Disable download articles over Wi-fi
* Build time change (not affecting users):
* Exclude unit tests from domain substitution
* Using system JDK instead of bundled one. Requires both Java-8 and Java-10 on Arch Linux.

2
README.md

@ -1,5 +1,7 @@
# ungoogled-chromium-android
Please see [CHANGELOG](https://github.com/wchen342/ungoogled-chromium-android/blob/master/CHANGELOG.md) for newest updates.
*A lightweight approach to removing Google web service dependency*
*Note: this is an **Android** build. It is currently experimental.*

2
patches/series

@ -3,7 +3,6 @@ src-fix/fix-null-mInstanceID.patch
src-fix/fix-unkown-warning-clang-9.patch
src-fix/fix-safe-browsing-prefs.patch
src-fix/fix-prefs.patch
src-fix/fix-extra-safe-browsing.patch
Vanadium/0020-disable-media-router-media-remoting-by-default.patch
Vanadium/0021-disable-media-router-by-default.patch
Unobtainium/kill-Auth.patch
@ -25,6 +24,7 @@ ungoogled-chromium-android/Remove-dependency-on-com.google.android.play.patch
ungoogled-chromium-android/Remove-dependency-on-com.google.android.play.core.splitcompat-com.google.android.play.core.splitinstall.patch
ungoogled-chromium-android/Disable-contextual-search.patch
ungoogled-chromium-android/Disable-lite-mode-prompt.patch
ungoogled-chromium-android/Disable-prefetch.patch
Bromite/Add-flag-to-disable-WebGL.patch
Bromite/Add-flags-to-disable-device-motion-and-orientation-APIs.patch
Bromite/Add-option-to-not-persist-tabs-across-sessions.patch

40
patches/src-fix/fix-prefs.patch

@ -3,10 +3,11 @@ Date: Thu, 20 Feb 2020 22:24:35 -0500
Subject: fix build error with prefs.h
---
chrome/browser/android/preferences/prefs.h | 2 --
1 file changed, 2 deletions(-)
chrome/android/java/src/org/chromium/chrome/browser/signin/SigninFragmentBase.java | 2 +-
chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoUtil.java | 3 +--
chrome/browser/android/preferences/prefs.h | 3 ---
3 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/chrome/browser/android/preferences/prefs.h b/chrome/browser/android/preferences/prefs.h
--- a/chrome/browser/android/preferences/prefs.h
+++ b/chrome/browser/android/preferences/prefs.h
@@ -20,7 +20,6 @@
@ -17,7 +18,15 @@ diff --git a/chrome/browser/android/preferences/prefs.h b/chrome/browser/android
#include "components/translate/core/browser/translate_pref_names.h"
// A preference exposed to Java.
@@ -111,7 +110,6 @@ const char* const kPrefsExposedToJava[] = {
@@ -59,7 +58,6 @@ enum Pref {
OFFER_TRANSLATE_ENABLED,
NOTIFICATIONS_VIBRATE_ENABLED,
ALTERNATE_ERROR_PAGES_ENABLED,
- SYNC_LAST_ACCOUNT_NAME,
WEBKIT_PASSWORD_ECHO_ENABLED,
WEBKIT_FORCE_DARK_MODE_ENABLED,
HOME_PAGE,
@@ -109,7 +107,6 @@ const char* const kPrefsExposedToJava[]
prefs::kOfferTranslateEnabled,
prefs::kNotificationsVibrateEnabled,
prefs::kAlternateErrorPagesEnabled,
@ -25,3 +34,26 @@ diff --git a/chrome/browser/android/preferences/prefs.h b/chrome/browser/android
prefs::kWebKitPasswordEchoEnabled,
prefs::kWebKitForceDarkModeEnabled,
prefs::kHomePage,
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninFragmentBase.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninFragmentBase.java
@@ -437,7 +437,7 @@ public abstract class SigninFragmentBase
private void runStateMachineAndSignin(boolean settingsClicked) {
mConfirmSyncDataStateMachine = new ConfirmSyncDataStateMachine(getContext(),
getChildFragmentManager(),
- PrefServiceBridge.getInstance().getString(Pref.SYNC_LAST_ACCOUNT_NAME),
+ "",
mSelectedAccountName, new ConfirmImportSyncDataDialog.Listener() {
@Override
public void onConfirm(boolean wipeData) {
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoUtil.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninPromoUtil.java
@@ -42,8 +42,7 @@ public class SigninPromoUtil {
public static boolean launchSigninPromoIfNeeded(final Activity activity) {
ChromePreferenceManager preferenceManager = ChromePreferenceManager.getInstance();
int currentMajorVersion = ChromeVersionInfo.getProductMajorVersion();
- boolean wasSignedIn = TextUtils.isEmpty(
- PrefServiceBridge.getInstance().getString(Pref.SYNC_LAST_ACCOUNT_NAME));
+ boolean wasSignedIn = TextUtils.isEmpty("");
Supplier<Set<String>> accountNamesSupplier =
() -> new ArraySet<>(AccountManagerFacade.get().tryGetGoogleAccountNames());

126
patches/src-fix/fix-safe-browsing-prefs.patch

@ -3,12 +3,117 @@ Date: Fri, 10 Jan 2020 18:01:56 -0500
Subject: Fix build error caused by the removal of safe_browsing_prefs.h
---
android_webview/browser/aw_browser_context.cc | 2 +-
.../browser/safe_browsing/aw_safe_browsing_blocking_page.cc | 9 ++++-----
chrome/browser/android/preferences/pref_service_bridge.cc | 5 +----
weblayer/browser/profile_impl.cc | 2 --
4 files changed, 6 insertions(+), 12 deletions(-)
android_webview/browser/aw_browser_context.cc | 2 -
android_webview/browser/safe_browsing/aw_safe_browsing_blocking_page.cc | 8 ++--
chrome/android/BUILD.gn | 1
chrome/android/chrome_java_sources.gni | 1
chrome/android/java/src/org/chromium/chrome/browser/settings/sync/SyncAndServicesPreferences.java | 19 ++--------
chrome/android/java/src/org/chromium/chrome/browser/webshare/ShareServiceImpl.java | 3 -
chrome/browser/android/preferences/prefs.h | 2 -
weblayer/browser/profile_impl.cc | 2 -
8 files changed, 10 insertions(+), 28 deletions(-)
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -2780,7 +2780,6 @@ generate_jni("chrome_jni_headers") {
"java/src/org/chromium/chrome/browser/rappor/RapporServiceBridge.java",
"java/src/org/chromium/chrome/browser/rlz/RevenueStats.java",
"java/src/org/chromium/chrome/browser/rlz/RlzPingHandler.java",
- "java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingBridge.java",
"java/src/org/chromium/chrome/browser/search_engines/TemplateUrlServiceFactory.java",
"java/src/org/chromium/chrome/browser/send_tab_to_self/NotificationManager.java",
"java/src/org/chromium/chrome/browser/send_tab_to_self/SendTabToSelfAndroidBridge.java",
--- a/chrome/android/chrome_java_sources.gni
+++ b/chrome/android/chrome_java_sources.gni
@@ -1315,7 +1315,6 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/rappor/RapporServiceBridge.java",
"java/src/org/chromium/chrome/browser/rlz/RevenueStats.java",
"java/src/org/chromium/chrome/browser/rlz/RlzPingHandler.java",
- "java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingBridge.java",
"java/src/org/chromium/chrome/browser/search_engines/SearchEngineChoiceMetrics.java",
"java/src/org/chromium/chrome/browser/search_engines/SearchEngineChoiceNotification.java",
"java/src/org/chromium/chrome/browser/search_engines/TemplateUrlServiceFactory.java",
--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/sync/SyncAndServicesPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/sync/SyncAndServicesPreferences.java
@@ -45,7 +45,6 @@ import org.chromium.chrome.browser.metri
import org.chromium.chrome.browser.preferences.Pref;
import org.chromium.chrome.browser.preferences.PrefServiceBridge;
import org.chromium.chrome.browser.profiles.Profile;
-import org.chromium.chrome.browser.safe_browsing.SafeBrowsingBridge;
import org.chromium.chrome.browser.settings.ChromeBasePreference;
import org.chromium.chrome.browser.settings.ChromeSwitchPreference;
import org.chromium.chrome.browser.settings.ManagedPreferenceDelegate;
@@ -365,17 +364,9 @@ public class SyncAndServicesPreferences
PostTask.postTask(UiThreadTaskTraits.DEFAULT, this::updatePreferences);
} else if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
mPrefServiceBridge.setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) newValue);
- } else if (PREF_SAFE_BROWSING.equals(key)) {
- mPrefServiceBridge.setBoolean(Pref.SAFE_BROWSING_ENABLED, (boolean) newValue);
- // Toggling the safe browsing preference impacts the leak detection and the
- // safe browsing reporting preferences as well.
- PostTask.postTask(UiThreadTaskTraits.DEFAULT,
- this::updateLeakDetectionAndSafeBrowsingReportingPreferences);
} else if (PREF_PASSWORD_LEAK_DETECTION.equals(key)) {
mPrefServiceBridge.setBoolean(
Pref.PASSWORD_MANAGER_LEAK_DETECTION_ENABLED, (boolean) newValue);
- } else if (PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
- SafeBrowsingBridge.setSafeBrowsingExtendedReportingEnabled((boolean) newValue);
} else if (PREF_NAVIGATION_ERROR.equals(key)) {
mPrefServiceBridge.setBoolean(Pref.ALTERNATE_ERROR_PAGES_ENABLED, (boolean) newValue);
} else if (PREF_USAGE_AND_CRASH_REPORTING.equals(key)) {
@@ -601,7 +592,6 @@ public class SyncAndServicesPreferences
mSearchSuggestions.setChecked(mPrefServiceBridge.getBoolean(Pref.SEARCH_SUGGEST_ENABLED));
mNavigationError.setChecked(
mPrefServiceBridge.getBoolean(Pref.ALTERNATE_ERROR_PAGES_ENABLED));
- mSafeBrowsing.setChecked(mPrefServiceBridge.getBoolean(Pref.SAFE_BROWSING_ENABLED));
updateLeakDetectionAndSafeBrowsingReportingPreferences();
@@ -667,10 +657,9 @@ public class SyncAndServicesPreferences
* its appearance needs to be updated. The same goes for safe browsing reporting.
*/
private void updateLeakDetectionAndSafeBrowsingReportingPreferences() {
- boolean safe_browsing_enabled = mPrefServiceBridge.getBoolean(Pref.SAFE_BROWSING_ENABLED);
+ boolean safe_browsing_enabled = false;
mSafeBrowsingReporting.setEnabled(safe_browsing_enabled);
- mSafeBrowsingReporting.setChecked(safe_browsing_enabled
- && SafeBrowsingBridge.isSafeBrowsingExtendedReportingEnabled());
+ mSafeBrowsingReporting.setChecked(false);
if (mPasswordLeakDetection == null) return; // Early exit without leak detection to update.
@@ -700,10 +689,10 @@ public class SyncAndServicesPreferences
return mPrefServiceBridge.isManagedPreference(Pref.SEARCH_SUGGEST_ENABLED);
}
if (PREF_SAFE_BROWSING_SCOUT_REPORTING.equals(key)) {
- return SafeBrowsingBridge.isSafeBrowsingExtendedReportingManaged();
+ return false;
}
if (PREF_SAFE_BROWSING.equals(key)) {
- return mPrefServiceBridge.isManagedPreference(Pref.SAFE_BROWSING_ENABLED);
+ return false;
}
if (PREF_PASSWORD_LEAK_DETECTION.equals(key)) {
return mPrefServiceBridge.isManagedPreference(
--- a/chrome/android/java/src/org/chromium/chrome/browser/webshare/ShareServiceImpl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webshare/ShareServiceImpl.java
@@ -20,7 +20,6 @@ import org.chromium.base.task.PostTask;
import org.chromium.base.task.TaskRunner;
import org.chromium.base.task.TaskTraits;
import org.chromium.chrome.browser.ChromeActivity;
-import org.chromium.chrome.browser.safe_browsing.SafeBrowsingBridge;
import org.chromium.chrome.browser.share.ShareHelper;
import org.chromium.chrome.browser.share.ShareParams;
import org.chromium.content_public.browser.WebContents;
@@ -198,7 +197,7 @@ public class ShareServiceImpl implements
for (SharedFile file : files) {
RecordHistogram.recordSparseHistogram(
- "WebShare.Unverified", SafeBrowsingBridge.umaValueForFile(file.name));
+ "WebShare.Unverified", 1);
}
for (SharedFile file : files) {
--- a/android_webview/browser/aw_browser_context.cc
+++ b/android_webview/browser/aw_browser_context.cc
@@ -227,7 +227,7 @@ base::FilePath AwBrowserContext::GetCont
@ -56,3 +161,14 @@ Subject: Fix build error caused by the removal of safe_browsing_prefs.h
}
ProfileImpl* const profile_impl_;
--- a/chrome/browser/android/preferences/prefs.h
+++ b/chrome/browser/android/preferences/prefs.h
@@ -40,8 +40,6 @@ enum Pref {
AUTOFILL_CREDIT_CARD_ENABLED,
USAGE_STATS_ENABLED,
OFFLINE_PREFETCH_USER_SETTING_ENABLED,
- SAFE_BROWSING_EXTENDED_REPORTING_OPT_IN_ALLOWED,
- SAFE_BROWSING_ENABLED,
PASSWORD_MANAGER_ONBOARDING_STATE,
SEARCH_SUGGEST_ENABLED,
REMEMBER_PASSWORDS_ENABLED,

31
patches/ungoogled-chromium-android/Disable-prefetch.patch

@ -0,0 +1,31 @@
From: Wengling Chen <[email protected]>
Date: Sat, 22 Feb 2020 18:08:54 -0500
Subject: Disable prefetch over wifi
---
chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchPrefs.java | 2 +-
components/offline_pages/core/prefetch/prefetch_prefs.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchPrefs.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchPrefs.java
@@ -37,7 +37,7 @@ public class PrefetchPrefs {
*/
public static boolean getNotificationEnabled() {
return ContextUtils.getAppSharedPreferences().getBoolean(
- PREF_PREFETCH_NOTIFICATION_ENABLED, true);
+ PREF_PREFETCH_NOTIFICATION_ENABLED, false);
}
/**
--- a/components/offline_pages/core/prefetch/prefetch_prefs.cc
+++ b/components/offline_pages/core/prefetch/prefetch_prefs.cc
@@ -29,7 +29,7 @@ const char kBackoff[] = "offline_prefetc
void RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterListPref(kBackoff);
- registry->RegisterBooleanPref(kUserSettingEnabled, true);
+ registry->RegisterBooleanPref(kUserSettingEnabled, false);
registry->RegisterTimePref(kLimitlessPrefetchingEnabledTimePref,
base::Time());
registry->RegisterStringPref(kPrefetchTestingHeaderPref, std::string());
Loading…
Cancel
Save