Browse Source

Remove unused UI; fix GMS build error; update lists

master
wchen342 2 years ago
parent
commit
90fd3556b1
Signed by untrusted user: wchen342 GPG Key ID: 720B70365E800508
  1. 2
      build.sh
  2. 342
      domain_sub_2.list
  3. 4
      misc/android_studio_setup.sh
  4. 6
      patches/Bromite/Add-exit-menu-item.patch
  5. 4
      patches/Bromite/Add-option-to-not-persist-tabs-across-sessions.patch
  6. 4
      patches/Other/ungoogled-main-repo-fix.patch
  7. 9
      patches/Unobtainium/kill-Auth.patch
  8. 7
      patches/series
  9. 14
      patches/src-fix/fix-safe-browsing-prefs.patch
  10. 0
      patches/ungoogled-chromium-android/Change-package-name-chromium.patch
  11. 0
      patches/ungoogled-chromium-android/Enable-flag-process-sharing.patch
  12. 0
      patches/ungoogled-chromium-android/Enable-update-notification.patch
  13. 399
      patches/ungoogled-chromium-android/Remove-UI-elements.patch
  14. 92
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.auth.patch
  15. 68
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.common-auth-signin-dynamic-com.google.android.gms.tasks.patch
  16. 375
      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
  17. 95
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.vision-com.google.android.gms.clearcut-com.google.android.gms.phenotype.patch
  18. 1
      pruning_2.list

2
build.sh

@ -71,7 +71,7 @@ if [[ "$ARCH" != "arm64" ]] && [[ "$ARCH" != "arm" ]] && [[ "$ARCH" != "x86" ]];
exit 4
fi
if [[ "$TARGET" != "$chrome_target" ]] && [[ "$TARGET" != "$mono_target" ]] && [[ "$TARGET" != "$webview_target" ]]; then
if [[ "$TARGET" != "$modern_chrome_apk_target" ]] && [[ "$TARGET" != "$trichrome_chrome_bundle_target" ]] && [[ "$TARGET" != "$webview_target" ]]; then
echo "Wrong target"
exit 5
fi

342
domain_sub_2.list

File diff suppressed because it is too large

4
misc/android_studio_setup.sh

@ -69,7 +69,7 @@ popd
# Compile apk
pushd src
ninja -C ${output_folder} ${chrome_target}
ninja -C ${output_folder} ${modern_chrome_apk_target}
popd
###
@ -89,5 +89,5 @@ pushd ..
patch -p1 --ignore-whitespace -i patches/Other/generate_gradle.patch --no-backup-if-mismatch
popd
# patch -p1 --ignore-whitespace -i ../patches/src-fix/fix-unkown-warning-clang-9.patch --no-backup-if-mismatch
python build/android/gradle/generate_gradle.py --target //chrome/android:${chrome_target} --output-directory ${output_folder}
python build/android/gradle/generate_gradle.py --target //chrome/android:${modern_chrome_apk_target} --output-directory ${output_folder}
popd

6
patches/Bromite/Add-exit-menu-item.patch

@ -12,8 +12,8 @@ Corrected Exit functionality
--- a/chrome/android/java/res/menu/main_menu.xml
+++ b/chrome/android/java/res/menu/main_menu.xml
@@ -87,6 +87,8 @@
android:title="@string/menu_help" />
@@ -85,6 +85,8 @@
android:title="@string/menu_settings" />
<item android:id="@+id/enter_vr_id"
android:title="@string/enter_vr" />
+ <item android:id="@+id/exit_id"
@ -21,7 +21,7 @@ Corrected Exit functionality
</group>
<!-- Items shown only in the tab switcher -->
@@ -104,6 +106,8 @@
@@ -102,6 +104,8 @@
android:title="@string/menu_group_tabs" />
<item android:id="@id/preferences_id"
android:title="@string/menu_settings" />

4
patches/Bromite/Add-option-to-not-persist-tabs-across-sessions.patch

@ -76,7 +76,7 @@ Subject: Add option to not persist tabs across sessions
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
private static final String PREF_NETWORK_PREDICTIONS = "preload_pages";
private static final String PREF_SECURE_DNS = "secure_dns";
@@ -94,6 +97,10 @@ public class PrivacySettings
@@ -90,6 +93,10 @@ public class PrivacySettings
Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
} else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
PrivacyPreferencesManager.getInstance().setNetworkPredictionEnabled((boolean) newValue);
@ -87,7 +87,7 @@ Subject: Add option to not persist tabs across sessions
}
return true;
@@ -168,6 +175,11 @@ public class PrivacySettings
@@ -164,6 +171,11 @@ public class PrivacySettings
getPreferenceScreen().removePreference(usageStatsPref);
}
}

4
patches/Other/ungoogled-main-repo-fix.patch

@ -17,13 +17,13 @@ author: Wengling Chen <[email protected]>
build/android/stacktrace/java_deobfuscate.jar
build/android/tests/symbolize/liba.so
build/android/tests/symbolize/libb.so
@@ -15168,12 +15167,9 @@ third_party/hunspell/fuzz/bdict_corpus/en-US-7-1.bdic
@@ -15168,12 +15167,8 @@ third_party/hunspell/fuzz/bdict_corpus/en-US-7-1.bdic
third_party/hunspell/fuzz/bdict_corpus/en-US-8-0.bdic
third_party/hunspell/fuzz/bdict_corpus/f95048cdc0fc231dd712bad106578a9eeecd869b
third_party/hunspell/fuzz/bdict_corpus/fda69541054125551c41ab3e591e0482405ca2dc
-third_party/icu/android/icudtl.dat
-third_party/icu/android_small/icudtl.dat
third_party/icu/android_small/icudtl_extra.dat
-third_party/icu/android_small/icudtl_extra.dat
third_party/icu/cast/icudtl.dat
third_party/icu/chromeos/icudtl.dat
-third_party/icu/common/icudtb.dat

9
patches/Unobtainium/kill-Auth.patch

@ -4,8 +4,8 @@ Subject: kill Auth
---
chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java | 22 -----
components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java | 40 ----------
2 files changed, 3 insertions(+), 59 deletions(-)
components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java | 42 ----------
2 files changed, 4 insertions(+), 60 deletions(-)
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninHelper.java
@ -90,11 +90,12 @@ Subject: kill Auth
- // This case includes a UserRecoverableNotifiedException, but most clients will have
- // their own retry mechanism anyway.
- throw new AuthException(AuthException.NONTRANSIENT,
+ throw new AuthException(AuthException.NONTRANSIENT,
"Error while getting token for scope '" + authTokenScope + "'", ex);
- "Error while getting token for scope '" + authTokenScope + "'", ex);
- } catch (IOException ex) {
- throw new AuthException(AuthException.TRANSIENT, ex);
- }
+ throw new AuthException(AuthException.NONTRANSIENT,
+ "Error while getting token for scope '" + authTokenScope + "'");
}
@Override

7
patches/series

@ -11,7 +11,7 @@ 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/Change-package-name-chromium.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
@ -28,10 +28,11 @@ ungoogled-chromium-android/Disable-prefetch.patch
ungoogled-chromium-android/Add-more-search-engines.patch
ungoogled-chromium-android/Add-folder-button-bookmark.patch
ungoogled-chromium-android/Mark-http-as-dangerous-mixed-content-warning.patch
ungoogled-chromium-android/flag-enable-process-sharing.patch
ungoogled-chromium-android/enable-update-notification.patch
ungoogled-chromium-android/Enable-flag-process-sharing.patch
ungoogled-chromium-android/Enable-update-notification.patch
ungoogled-chromium-android/Enable-ProactivelySwapBrowsingInstance.patch
ungoogled-chromium-android/Disable-homepage-by-default.patch
ungoogled-chromium-android/Remove-UI-elements.patch
Bromite/Add-exit-menu-item.patch
Bromite/Add-flag-to-disable-WebGL.patch
Bromite/Add-flags-to-disable-device-motion-orientation-APIs.patch

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

@ -8,10 +8,11 @@ Subject: Fix build error caused by the removal of safe_browsing_prefs.h
chrome/android/BUILD.gn | 1
chrome/android/java/src/org/chromium/chrome/browser/sync/settings/GoogleServicesSettings.java | 21 ----------
chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java | 19 +--------
chrome/browser/android/tab_web_contents_delegate_android.cc | 2
chrome/browser/preferences/BUILD.gn | 1
chrome/browser/safe_browsing/BUILD.gn | 1
weblayer/browser/browser_context_impl.cc | 2
8 files changed, 12 insertions(+), 45 deletions(-)
9 files changed, 12 insertions(+), 47 deletions(-)
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@ -214,3 +215,14 @@ Subject: Fix build error caused by the removal of safe_browsing_prefs.h
"//components/signin/public/base/signin_pref_names.cc",
"//components/translate/core/browser/translate_pref_names.cc",
]
--- a/chrome/browser/android/tab_web_contents_delegate_android.cc
+++ b/chrome/browser/android/tab_web_contents_delegate_android.cc
@@ -175,8 +175,6 @@ void TabWebContentsDelegateAndroid::Port
InfoBarService::CreateForWebContents(portal_contents);
PrefsTabHelper::CreateForWebContents(portal_contents);
DataReductionProxyTabHelper::CreateForWebContents(portal_contents);
- safe_browsing::SafeBrowsingNavigationObserver::MaybeCreateForWebContents(
- portal_contents);
}
void TabWebContentsDelegateAndroid::RunFileChooser(

0
patches/ungoogled-chromium-android/change-package-name-chromium.patch → patches/ungoogled-chromium-android/Change-package-name-chromium.patch

0
patches/ungoogled-chromium-android/flag-enable-process-sharing.patch → patches/ungoogled-chromium-android/Enable-flag-process-sharing.patch

0
patches/ungoogled-chromium-android/enable-update-notification.patch → patches/ungoogled-chromium-android/Enable-update-notification.patch

399
patches/ungoogled-chromium-android/Remove-UI-elements.patch

@ -0,0 +1,399 @@
---
chrome/android/features/start_surface/public/java/src/org/chromium/chrome/features/start_surface/StartSurfaceConfiguration.java | 2
chrome/android/java/res/menu/main_menu.xml | 2
chrome/android/java/res/menu/save_password_preferences_action_bar_menu.xml | 6 --
chrome/android/java/res/xml/main_preferences.xml | 15 ------
chrome/android/java/res/xml/privacy_preferences.xml | 4 -
chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java | 9 ---
chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java | 1
chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataTabsFragment.java | 5 --
chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabActivity.java | 2
chrome/android/java/src/org/chromium/chrome/browser/datareduction/settings/DataReductionPreferenceFragment.java | 4 -
chrome/android/java/src/org/chromium/chrome/browser/directactions/MenuDirectActionHandler.java | 2
chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java | 2
chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java | 4 -
chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java | 8 ---
chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java | 23 ----------
chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java | 5 --
chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsHelpClient.java | 2
chrome/android/java/src/org/chromium/chrome/browser/sync/settings/GoogleServicesSettings.java | 3 -
chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java | 3 -
chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java | 3 -
components/feed/core/shared_prefs/pref_names.cc | 4 -
21 files changed, 6 insertions(+), 103 deletions(-)
--- a/components/feed/core/shared_prefs/pref_names.cc
+++ b/components/feed/core/shared_prefs/pref_names.cc
@@ -19,8 +19,8 @@ const char kEnableSnippets[] = "ntp_snip
const char kArticlesListVisible[] = "ntp_snippets.list_visible";
void RegisterFeedSharedProfilePrefs(PrefRegistrySimple* registry) {
- registry->RegisterBooleanPref(kEnableSnippets, true);
- registry->RegisterBooleanPref(kArticlesListVisible, true);
+ registry->RegisterBooleanPref(kEnableSnippets, false);
+ registry->RegisterBooleanPref(kArticlesListVisible, false);
}
} // namespace prefs
--- a/chrome/android/features/start_surface/public/java/src/org/chromium/chrome/features/start_surface/StartSurfaceConfiguration.java
+++ b/chrome/android/features/start_surface/public/java/src/org/chromium/chrome/features/start_surface/StartSurfaceConfiguration.java
@@ -122,7 +122,7 @@ public class StartSurfaceConfiguration {
*/
public static boolean getFeedArticlesVisibility() {
return SharedPreferencesManager.getInstance().readBoolean(
- ChromePreferenceKeys.FEED_ARTICLES_LIST_VISIBLE, true);
+ ChromePreferenceKeys.FEED_ARTICLES_LIST_VISIBLE, false);
}
@VisibleForTesting
--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
@@ -213,11 +213,6 @@ public class SettingsActivity extends Ch
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
- // By default, every screen in Settings shows a "Help & feedback" menu item.
- MenuItem help = menu.add(
- Menu.NONE, R.id.menu_id_general_help, Menu.CATEGORY_SECONDARY, R.string.menu_help);
- help.setIcon(VectorDrawableCompat.create(
- getResources(), R.drawable.ic_help_and_feedback, getTheme()));
return true;
}
--- a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsHelpClient.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsHelpClient.java
@@ -17,7 +17,7 @@ import org.chromium.components.browser_u
public class ChromeSiteSettingsHelpClient implements SiteSettingsHelpClient {
@Override
public boolean isHelpAndFeedbackEnabled() {
- return true;
+ return false;
}
@Override
--- a/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataTabsFragment.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataTabsFragment.java
@@ -181,11 +181,6 @@ public class ClearBrowsingDataTabsFragme
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
menu.clear();
- MenuItem help =
- menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
- help.setIcon(VectorDrawableCompat.create(
- getResources(), R.drawable.ic_help_and_feedback, getActivity().getTheme()));
- help.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
}
@Override
--- a/chrome/android/java/src/org/chromium/chrome/browser/datareduction/settings/DataReductionPreferenceFragment.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/datareduction/settings/DataReductionPreferenceFragment.java
@@ -119,10 +119,6 @@ public class DataReductionPreferenceFrag
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
menu.clear();
- MenuItem help =
- menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
- help.setIcon(VectorDrawableCompat.create(
- getResources(), R.drawable.ic_help_and_feedback, getActivity().getTheme()));
}
@Override
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
@@ -73,15 +73,11 @@ public class PrivacySettings
Preference secureDnsPref = findPreference(PREF_SECURE_DNS);
secureDnsPref.setVisible(privacyPrefManager.isDnsOverHttpsUiEnabled());
- Preference syncAndServicesLink = findPreference(PREF_SYNC_AND_SERVICES_LINK);
NoUnderlineClickableSpan linkSpan = new NoUnderlineClickableSpan(getResources(), view -> {
SettingsLauncher settingsLauncher = new SettingsLauncherImpl();
settingsLauncher.launchSettingsActivity(getActivity(), SyncAndServicesSettings.class,
SyncAndServicesSettings.createArguments(false));
});
- syncAndServicesLink.setSummary(
- SpanApplier.applySpans(getString(R.string.privacy_sync_and_services_link),
- new SpanApplier.SpanInfo("<link>", "</link>", linkSpan)));
updateSummaries();
}
@@ -183,10 +179,6 @@ public class PrivacySettings
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
menu.clear();
- MenuItem help =
- menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
- help.setIcon(VectorDrawableCompat.create(
- getResources(), R.drawable.ic_help_and_feedback, getActivity().getTheme()));
}
@Override
--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/GoogleServicesSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/GoogleServicesSettings.java
@@ -130,9 +130,6 @@ public class GoogleServicesSettings
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
menu.clear();
- MenuItem help =
- menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
- help.setIcon(R.drawable.ic_help_and_feedback);
}
@Override
--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java
@@ -222,9 +222,6 @@ public class ManageSyncSettings extends
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
menu.clear();
- MenuItem help =
- menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
- help.setIcon(R.drawable.ic_help_and_feedback);
}
@Override
--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java
@@ -269,9 +269,6 @@ public class SyncAndServicesSettings ext
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
menu.clear();
- MenuItem help =
- menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
- help.setIcon(R.drawable.ic_help_and_feedback);
}
@Override
--- a/chrome/android/java/res/xml/main_preferences.xml
+++ b/chrome/android/java/res/xml/main_preferences.xml
@@ -6,20 +6,10 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:orderingFromXml="false">
- <PreferenceCategory
- android:key="account_section"
- android:order="0"
- android:title="@string/prefs_section_account"/>
<org.chromium.chrome.browser.sync.settings.SignInPreference
android:key="sign_in"
android:order="1"
android:title="@string/sign_in_to_chrome"/>
- <org.chromium.components.browser_ui.settings.ChromeBasePreference
- android:key="sync_and_services"
- android:order="2"
- android:layout="@layout/account_management_account_row"
- android:title="@string/prefs_sync_and_services"
- android:fragment="org.chromium.chrome.browser.sync.settings.SyncAndServicesSettings"/>
<PreferenceCategory
android:key="basics_section"
@@ -92,11 +82,6 @@
android:order="17"
android:title="@string/language_settings"/>
<org.chromium.components.browser_ui.settings.ChromeBasePreference
- android:fragment="org.chromium.chrome.browser.datareduction.settings.DataReductionPreferenceFragment"
- android:key="data_reduction"
- android:order="18"
- android:title="@string/data_reduction_title_lite_mode"/>
- <org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.chrome.browser.download.settings.DownloadSettings"
android:key="downloads"
android:order="19"
--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
@@ -151,7 +151,6 @@ public class MainSettings extends Prefer
updatePasswordsPreference();
setManagedPreferenceDelegateForPreference(PREF_SEARCH_ENGINE);
- setManagedPreferenceDelegateForPreference(PREF_DATA_REDUCTION);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// If we are on Android O+ the Notifications preference should lead to the Android
@@ -234,10 +233,6 @@ public class MainSettings extends Prefer
} else {
removePreferenceIfPresent(PREF_DEVELOPER);
}
-
- ChromeBasePreference dataReduction =
- (ChromeBasePreference) findPreference(PREF_DATA_REDUCTION);
- dataReduction.setSummary(DataReductionPreferenceFragment.generateSummary(getResources()));
}
private Preference addPreferenceIfAbsent(String key) {
@@ -252,10 +247,6 @@ public class MainSettings extends Prefer
}
private void updateSyncAndServicesPreference() {
- ChromeBasePreference syncAndServices =
- (ChromeBasePreference) findPreference(PREF_SYNC_AND_SERVICES);
- syncAndServices.setIcon(SyncSettingsUtils.getSyncStatusIcon(getActivity()));
- syncAndServices.setSummary(SyncSettingsUtils.getSyncStatusSummary(getActivity()));
}
private void updateSearchEnginePreference() {
@@ -303,12 +294,6 @@ public class MainSettings extends Prefer
}
private void onSignInPreferenceStateChanged() {
- // Remove "Account" section header if the personalized sign-in promo is shown.
- if (mSignInPreference.getState() == SignInPreference.State.PERSONALIZED_PROMO) {
- removePreferenceIfPresent(PREF_ACCOUNT_SECTION);
- } else {
- addPreferenceIfAbsent(PREF_ACCOUNT_SECTION);
- }
}
// TemplateUrlService.LoadListener implementation.
@@ -332,9 +317,6 @@ public class MainSettings extends Prefer
return new ChromeManagedPreferenceDelegate() {
@Override
public boolean isPreferenceControlledByPolicy(Preference preference) {
- if (PREF_DATA_REDUCTION.equals(preference.getKey())) {
- return DataReductionProxySettings.getInstance().isDataReductionProxyManaged();
- }
if (PREF_SEARCH_ENGINE.equals(preference.getKey())) {
return TemplateUrlServiceFactory.get().isDefaultSearchManaged();
}
@@ -343,11 +325,6 @@ public class MainSettings extends Prefer
@Override
public boolean isPreferenceClickDisabledByPolicy(Preference preference) {
- if (PREF_DATA_REDUCTION.equals(preference.getKey())) {
- DataReductionProxySettings settings = DataReductionProxySettings.getInstance();
- return settings.isDataReductionProxyManaged()
- && !settings.isDataReductionProxyEnabled();
- }
if (PREF_SEARCH_ENGINE.equals(preference.getKey())) {
return TemplateUrlServiceFactory.get().isDefaultSearchManaged();
}
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
@@ -32,7 +32,7 @@ public class FirstRunStatus {
*/
public static boolean getFirstRunFlowComplete() {
if (SharedPreferencesManager.getInstance().readBoolean(
- ChromePreferenceKeys.FIRST_RUN_FLOW_COMPLETE, false)) {
+ ChromePreferenceKeys.FIRST_RUN_FLOW_COMPLETE, true)) {
return true;
}
return CommandLine.getInstance().hasSwitch(
--- a/chrome/android/java/res/menu/main_menu.xml
+++ b/chrome/android/java/res/menu/main_menu.xml
@@ -83,8 +83,6 @@
android:icon="@drawable/reader_mode_prefs_icon" />
<item android:id="@+id/preferences_id"
android:title="@string/menu_settings" />
- <item android:id="@+id/help_id"
- android:title="@string/menu_help" />
<item android:id="@+id/enter_vr_id"
android:title="@string/enter_vr" />
</group>
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -1937,15 +1937,6 @@ public abstract class ChromeActivity<C e
final Tab currentTab = getActivityTab();
- if (id == R.id.help_id) {
- String url = currentTab != null ? currentTab.getUrlString() : "";
- Profile profile = mTabModelSelector.isIncognitoSelected()
- ? Profile.getLastUsedRegularProfile().getOffTheRecordProfile()
- : Profile.getLastUsedRegularProfile();
- startHelpAndFeedback(url, "MobileMenuFeedback", profile);
- return true;
- }
-
if (id == R.id.open_history_menu_id) {
// 'currentTab' could only be null when opening history from start surface, which is
// not available on tablet.
--- a/chrome/android/java/src/org/chromium/chrome/browser/directactions/MenuDirectActionHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/directactions/MenuDirectActionHandler.java
@@ -36,7 +36,6 @@ class MenuDirectActionHandler implements
map.put(ChromeDirectActionIds.RELOAD, R.id.reload_menu_id);
map.put(ChromeDirectActionIds.BOOKMARK_THIS_PAGE, R.id.bookmark_this_page_id);
map.put(ChromeDirectActionIds.DOWNLOADS, R.id.downloads_menu_id);
- map.put(ChromeDirectActionIds.HELP, R.id.help_id);
map.put(ChromeDirectActionIds.NEW_TAB, R.id.new_tab_menu_id);
map.put(ChromeDirectActionIds.OPEN_HISTORY, R.id.open_history_menu_id);
map.put(ChromeDirectActionIds.PREFERENCES, R.id.preferences_id);
@@ -92,7 +91,6 @@ class MenuDirectActionHandler implements
}
availableItemIds.add(R.id.downloads_menu_id);
- availableItemIds.add(R.id.help_id);
availableItemIds.add(R.id.new_tab_menu_id);
availableItemIds.add(R.id.preferences_id);
--- a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
@@ -343,7 +343,6 @@ public class KeyboardShortcuts {
if (tab != null && tab.canGoForward()) tab.goForward();
return true;
case CTRL | SHIFT | KeyEvent.KEYCODE_SLASH: // i.e. Ctrl+?
- activity.onMenuOrKeyboardAction(R.id.help_id, false);
return true;
}
}
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabActivity.java
@@ -533,7 +533,7 @@ public abstract class BaseCustomTabActiv
@Override
public boolean onMenuOrKeyboardAction(int id, boolean fromMenu) {
// Disable creating new tabs, bookmark, history, print, help, focus_url, etc.
- if (id == R.id.focus_url_bar || id == R.id.all_bookmarks_menu_id || id == R.id.help_id
+ if (id == R.id.focus_url_bar || id == R.id.all_bookmarks_menu_id
|| id == R.id.recent_tabs_menu_id || id == R.id.new_incognito_tab_menu_id
|| id == R.id.new_tab_menu_id || id == R.id.open_history_menu_id) {
return true;
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -32,8 +32,4 @@
android:title="@string/clear_browsing_data_title"
android:summary="@string/clear_browsing_data_summary"
android:fragment="org.chromium.chrome.browser.browsing_data.ClearBrowsingDataTabsFragment" />
- <org.chromium.components.browser_ui.settings.TextMessagePreference
- android:key="sync_and_services_link"
- android:summary="@string/privacy_sync_and_services_link"
- app:allowDividerBelow="false" />
</PreferenceScreen>
--- a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
@@ -92,7 +92,6 @@ public class PasswordSettings
private boolean mNoPasswords;
private boolean mNoPasswordExceptions;
- private MenuItem mHelpItem;
private MenuItem mSearchItem;
private String mSearchQuery;
@@ -163,7 +162,6 @@ public class PasswordSettings
menu.findItem(R.id.export_passwords).setEnabled(false);
mSearchItem = menu.findItem(R.id.menu_id_search);
mSearchItem.setVisible(true);
- mHelpItem = menu.findItem(R.id.menu_id_targeted_help);
SearchUtils.initializeSearchView(
mSearchItem, mSearchQuery, getActivity(), this::filterPasswords);
}
@@ -196,8 +194,6 @@ public class PasswordSettings
private void filterPasswords(String query) {
mSearchQuery = query;
- mHelpItem.setShowAsAction(mSearchQuery == null ? MenuItem.SHOW_AS_ACTION_IF_ROOM
- : MenuItem.SHOW_AS_ACTION_NEVER);
rebuildPasswordLists();
}
--- a/chrome/android/java/res/menu/save_password_preferences_action_bar_menu.xml
+++ b/chrome/android/java/res/menu/save_password_preferences_action_bar_menu.xml
@@ -14,12 +14,6 @@
app:actionViewClass="androidx.appcompat.widget.SearchView" />
<item
- android:id="@id/menu_id_targeted_help"
- android:icon="@drawable/ic_help_and_feedback"
- android:title="@string/menu_help"
- app:showAsAction="ifRoom"/>
-
- <item
android:id="@+id/export_passwords"
android:title="@string/password_settings_export_action_title"
android:contentDescription="@string/password_settings_export_action_description"

92
patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.auth.patch

@ -12,8 +12,10 @@ Subject: Remove dependency on com.google.android.gms.auth
content/public/android/java/src/org/chromium/content/browser/sms/SmsVerificationReceiver.java | 34 -------
content/public/android/java/src/org/chromium/content/browser/sms/Wrappers.java | 14 --
content/test/BUILD.gn | 1
remoting/android/java/src/org/chromium/chromoting/OAuthTokenConsumer.java | 9 -
remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java | 35 -------
third_party/android_deps/BUILD.gn | 47 ----------
10 files changed, 6 insertions(+), 173 deletions(-)
12 files changed, 6 insertions(+), 217 deletions(-)
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@ -380,3 +382,91 @@ Subject: Remove dependency on com.google.android.gms.auth
"$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",
--- a/remoting/android/java/src/org/chromium/chromoting/OAuthTokenConsumer.java
+++ b/remoting/android/java/src/org/chromium/chromoting/OAuthTokenConsumer.java
@@ -8,9 +8,6 @@ import android.content.Context;
import android.os.Handler;
import android.os.Looper;
-import com.google.android.gms.auth.GoogleAuthException;
-import com.google.android.gms.auth.GoogleAuthUtil;
-
import org.chromium.chromoting.base.OAuthTokenFetcher;
import java.io.IOException;
@@ -96,7 +93,6 @@ public class OAuthTokenConsumer {
public void revokeLatestToken(final OAuthTokenFetcher.Callback callback) {
OAuthTokenFetcher.TASK_RUNNER.postTask(() -> {
try {
- GoogleAuthUtil.clearToken(mContext, mLatestToken);
mLatestToken = null;
if (callback != null) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@@ -106,11 +102,6 @@ public class OAuthTokenConsumer {
}
});
}
- } catch (GoogleAuthException e) {
- if (callback != null) {
- handleErrorOnMainThread(callback, OAuthTokenFetcher.Error.UNEXPECTED);
- callback.onError(OAuthTokenFetcher.Error.UNEXPECTED);
- }
} catch (IOException e) {
if (callback != null) {
handleErrorOnMainThread(callback, OAuthTokenFetcher.Error.NETWORK);
--- a/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
+++ b/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
@@ -12,10 +12,6 @@ import android.os.Looper;
import androidx.annotation.IntDef;
-import com.google.android.gms.auth.GoogleAuthException;
-import com.google.android.gms.auth.GoogleAuthUtil;
-import com.google.android.gms.auth.UserRecoverableAuthException;
-
import org.chromium.base.task.PostTask;
import org.chromium.base.task.TaskRunner;
import org.chromium.base.task.TaskTraits;
@@ -107,21 +103,6 @@ public class OAuthTokenFetcher {
private void fetchImpl(final String expiredToken) {
TASK_RUNNER.postTask(() -> {
- try {
- if (expiredToken != null) {
- GoogleAuthUtil.clearToken(mContext, expiredToken);
- }
-
- Account account = new Account(mAccountName, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
- String token = GoogleAuthUtil.getToken(mContext, account, mTokenScope);
- handleTokenReceived(token);
- } catch (IOException ioException) {
- handleError(Error.NETWORK);
- } catch (UserRecoverableAuthException recoverableException) {
- handleRecoverableException(recoverableException);
- } catch (GoogleAuthException fatalException) {
- handleError(Error.UNEXPECTED);
- }
});
}
@@ -142,20 +123,4 @@ public class OAuthTokenFetcher {
}
});
}
-
- private void handleRecoverableException(final UserRecoverableAuthException exception) {
- if (!(mContext instanceof Activity)) {
- handleError(Error.UI);
- return;
- }
- handleError(Error.INTERRUPTED);
- final Activity activity = (Activity) mContext;
- activity.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- activity.startActivityForResult(exception.getIntent(),
- REQUEST_CODE_RECOVER_FROM_OAUTH_ERROR);
- }
- });
- }
}

68
patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.common-auth-signin-dynamic-com.google.android.gms.tasks.patch

@ -5,34 +5,35 @@ Subject: Remove dependency on
com.google.android.gms.tasks
---
chrome/android/BUILD.gn | 8
chrome/android/features/cablev2_authenticator/BUILD.gn | 2
chrome/android/features/media_router/BUILD.gn | 2
chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java | 7
chrome/android/java/AndroidManifest.xml | 9 -
chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java | 14 -
chrome/android/java/src/org/chromium/chrome/browser/ChromeVersionInfo.java | 12 -
chrome/android/java/src/org/chromium/chrome/browser/component_updater/UpdateScheduler.java | 8
chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java | 14 -
chrome/android/java/src/org/chromium/chrome/browser/externalauth/UserRecoverableErrorHandler.java | 7
chrome/android/java/src/org/chromium/chrome/browser/gcore/ChromeGoogleApiClientImpl.java | 25 ---
chrome/android/java/src/org/chromium/chrome/browser/gcore/GoogleApiClientHelper.java | 82 ----------
chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java | 10 -
chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordManagerLauncher.java | 4
chrome/test/android/BUILD.gn | 2
components/background_task_scheduler/BUILD.gn | 3
components/background_task_scheduler/internal/BUILD.gn | 6
components/signin/core/browser/android/BUILD.gn | 2
components/signin/core/browser/android/java/src/org/chromium/components/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
services/device/geolocation/BUILD.gn | 2
services/shape_detection/BUILD.gn | 2
third_party/cacheinvalidation/BUILD.gn | 1
27 files changed, 17 insertions(+), 224 deletions(-)
chrome/android/BUILD.gn | 8
chrome/android/features/cablev2_authenticator/BUILD.gn | 2
chrome/android/features/cablev2_authenticator/java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticator.java | 2
chrome/android/features/media_router/BUILD.gn | 2
chrome/android/features/media_router/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java | 7
chrome/android/java/AndroidManifest.xml | 9 -
chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java | 14 -
chrome/android/java/src/org/chromium/chrome/browser/ChromeVersionInfo.java | 12 -
chrome/android/java/src/org/chromium/chrome/browser/component_updater/UpdateScheduler.java | 8
chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java | 14 -
chrome/android/java/src/org/chromium/chrome/browser/externalauth/UserRecoverableErrorHandler.java | 7
chrome/android/java/src/org/chromium/chrome/browser/gcore/ChromeGoogleApiClientImpl.java | 25 ---
chrome/android/java/src/org/chromium/chrome/browser/gcore/GoogleApiClientHelper.java | 82 ----------
chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java | 10 -
chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordManagerLauncher.java | 4
chrome/test/android/BUILD.gn | 2
components/background_task_scheduler/BUILD.gn | 3
components/background_task_scheduler/internal/BUILD.gn | 6
components/signin/core/browser/android/BUILD.gn | 2
components/signin/core/browser/android/java/src/org/chromium/components/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
services/device/geolocation/BUILD.gn | 2
services/shape_detection/BUILD.gn | 2
third_party/cacheinvalidation/BUILD.gn | 1
28 files changed, 17 insertions(+), 226 deletions(-)
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@ -731,3 +732,14 @@ Subject: Remove dependency on
"//base:base_java",
"//base:jni_java",
"//chrome/android:chrome_java",
--- a/chrome/android/features/cablev2_authenticator/java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticator.java
+++ b/chrome/android/features/cablev2_authenticator/java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticator.java
@@ -12,8 +12,6 @@ import android.content.IntentSender;
import android.net.Uri;
import android.os.Bundle;
-import com.google.android.gms.tasks.Task;
-
import org.chromium.base.Log;
import java.util.ArrayList;

375
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

@ -5,23 +5,25 @@ Subject: Remove dependency on com.google.android.gms.fido,
com.google.android.gms.location
---
base/android/java/src/org/chromium/base/IntentUtils.java | 5
chrome/android/BUILD.gn | 5
chrome/android/features/cablev2_authenticator/BUILD.gn | 1
chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java | 6
chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java | 51 -
chrome/android/java/src/org/chromium/chrome/browser/webauth/Fido2CredentialRequest.java | 172 -----
chrome/android/java/src/org/chromium/chrome/browser/webauth/Fido2Helper.java | 335 ----------
components/gcm_driver/instance_id/android/BUILD.gn | 2
components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDWithSubtype.java | 28
device/BUILD.gn | 1
services/BUILD.gn | 1
services/device/geolocation/BUILD.gn | 1
services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderGmsCore.java | 103 ---
third_party/android_deps/BUILD.gn | 60 -
third_party/cacheinvalidation/BUILD.gn | 1
third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifestUpdatedGcm.xml | 3
16 files changed, 14 insertions(+), 761 deletions(-)
base/android/java/src/org/chromium/base/IntentUtils.java | 5
chrome/android/BUILD.gn | 5
chrome/android/features/cablev2_authenticator/BUILD.gn | 1
chrome/android/features/cablev2_authenticator/java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticator.java | 221 ------
chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java | 6
chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java | 51 -
chrome/android/java/src/org/chromium/chrome/browser/webauth/Fido2CredentialRequest.java | 181 -----
chrome/android/java/src/org/chromium/chrome/browser/webauth/Fido2Helper.java | 335 ----------
components/gcm_driver/instance_id/android/BUILD.gn | 2
components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDWithSubtype.java | 28
components/gcm_driver/instance_id/android/javatests/src/org/chromium/components/gcm_driver/instance_id/FakeInstanceIDWithSubtype.java | 14
device/BUILD.gn | 1
services/BUILD.gn | 1
services/device/geolocation/BUILD.gn | 1
services/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderGmsCore.java | 103 ---
third_party/android_deps/BUILD.gn | 60 -
third_party/cacheinvalidation/BUILD.gn | 1
third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/external/client/android2/AndroidManifestUpdatedGcm.xml | 3
18 files changed, 26 insertions(+), 993 deletions(-)
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@ -718,7 +720,7 @@ Subject: Remove dependency on com.google.android.gms.fido,
break;
case Activity.RESULT_OK:
processIntentResult(data);
@@ -296,30 +166,11 @@ public class Fido2CredentialRequest impl
@@ -296,62 +166,21 @@ public class Fido2CredentialRequest impl
default:
// Something went wrong.
Log.e(TAG, "Failed with result code" + resultCode);
@ -746,10 +748,18 @@ Subject: Remove dependency on com.google.android.gms.fido,
- Fido2Helper.toGetAssertionResponse(publicKeyCredential, mAppIdExtensionUsed));
- mCallback = null;
- }
- }
-
- private void processErrorResponse(AuthenticatorErrorResponse errorResponse) {
- Log.e(TAG,
- "Google Play Services FIDO2 API returned an error: "
- + errorResponse.getErrorMessage());
- int authenticatorStatus = Fido2Helper.convertError(
- errorResponse.getErrorCode(), errorResponse.getErrorMessage());
- returnErrorAndResetCallback(authenticatorStatus);
}
private void processErrorResponse(AuthenticatorErrorResponse errorResponse) {
@@ -335,23 +186,10 @@ public class Fido2CredentialRequest impl
private void processKeyResponse(Intent data) {
switch (mRequestStatus) {
case REGISTER_REQUEST:
Log.e(TAG, "Received a register response from Google Play Services FIDO2 API");
@ -774,7 +784,7 @@ Subject: Remove dependency on com.google.android.gms.fido,
break;
}
mCallback = null;
@@ -363,17 +201,11 @@ public class Fido2CredentialRequest impl
@@ -363,17 +192,11 @@ public class Fido2CredentialRequest impl
// [Attestation/Assertion/Error] Response.
if (data.hasExtra(FIDO2_KEY_CREDENTIAL_EXTRA)) {
processPublicKeyCredential(data);
@ -1206,3 +1216,326 @@ Subject: Remove dependency on com.google.android.gms.fido,
"$google_play_services_package:google_play_services_vision_common_java",
"$google_play_services_package:google_play_services_vision_java",
"//base:base_java",
--- a/components/gcm_driver/instance_id/android/javatests/src/org/chromium/components/gcm_driver/instance_id/FakeInstanceIDWithSubtype.java
+++ b/components/gcm_driver/instance_id/android/javatests/src/org/chromium/components/gcm_driver/instance_id/FakeInstanceIDWithSubtype.java
@@ -8,8 +8,6 @@ import android.os.Bundle;
import android.os.Looper;
import android.util.Pair;
-import com.google.android.gms.iid.InstanceID;
-
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
@@ -100,7 +98,7 @@ public class FakeInstanceIDWithSubtype e
// SharedPreferences. Since we can't override those static methods to simulate the strict
// mode violation in tests, check the thread here (which is only called from getInstance).
if (Looper.getMainLooper() == Looper.myLooper())
- throw new AssertionError(InstanceID.ERROR_MAIN_THREAD);
+ throw new AssertionError();
}
@Override
@@ -113,7 +111,7 @@ public class FakeInstanceIDWithSubtype e
// InstanceID.getId sometimes triggers a strict mode violation if it's called on the main
// thread, by reading from SharedPreferences.
if (Looper.getMainLooper() == Looper.myLooper())
- throw new AssertionError(InstanceID.ERROR_MAIN_THREAD);
+ throw new AssertionError();
if (mId == null) {
mCreationTime = System.currentTimeMillis();
@@ -127,7 +125,7 @@ public class FakeInstanceIDWithSubtype e
// InstanceID.getCreationTime sometimes triggers a strict mode violation if it's called on
// the main thread, by reading from SharedPreferences.
if (Looper.getMainLooper() == Looper.myLooper())
- throw new AssertionError(InstanceID.ERROR_MAIN_THREAD);
+ throw new AssertionError();
return mCreationTime;
}
@@ -142,7 +140,7 @@ public class FakeInstanceIDWithSubtype e
throws IOException {
// InstanceID.getToken enforces this.
if (Looper.getMainLooper() == Looper.myLooper()) {
- throw new IOException(InstanceID.ERROR_MAIN_THREAD);
+ throw new IOException();
}
String key = getSubtype() + ',' + authorizedEntity + ',' + scope;
@@ -159,7 +157,7 @@ public class FakeInstanceIDWithSubtype e
public void deleteToken(String authorizedEntity, String scope) throws IOException {
// InstanceID.deleteToken enforces this.
if (Looper.getMainLooper() == Looper.myLooper()) {
- throw new IOException(InstanceID.ERROR_MAIN_THREAD);
+ throw new IOException();
}
String key = getSubtype() + ',' + authorizedEntity + ',' + scope;
@@ -175,7 +173,7 @@ public class FakeInstanceIDWithSubtype e
// InstanceID.deleteInstanceID calls InstanceID.deleteToken which enforces this.
if (Looper.getMainLooper() == Looper.myLooper()) {
- throw new IOException(InstanceID.ERROR_MAIN_THREAD);
+ throw new IOException();
}
mTokens.clear();
--- a/chrome/android/features/cablev2_authenticator/java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticator.java
+++ b/chrome/android/features/cablev2_authenticator/java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticator.java
@@ -12,25 +12,6 @@ import android.content.IntentSender;
import android.net.Uri;
import android.os.Bundle;
-import com.google.android.gms.fido.Fido;
-import com.google.android.gms.fido.common.Transport;
-import com.google.android.gms.fido.fido2.Fido2PrivilegedApiClient;
-import com.google.android.gms.fido.fido2.api.common.Attachment;
-import com.google.android.gms.fido.fido2.api.common.AttestationConveyancePreference;
-import com.google.android.gms.fido.fido2.api.common.AuthenticatorAssertionResponse;
-import com.google.android.gms.fido.fido2.api.common.AuthenticatorAttestationResponse;
-import com.google.android.gms.fido.fido2.api.common.AuthenticatorErrorResponse;
-import com.google.android.gms.fido.fido2.api.common.AuthenticatorSelectionCriteria;
-import com.google.android.gms.fido.fido2.api.common.BrowserPublicKeyCredentialCreationOptions;
-import com.google.android.gms.fido.fido2.api.common.BrowserPublicKeyCredentialRequestOptions;
-import com.google.android.gms.fido.fido2.api.common.PublicKeyCredential;
-import com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialCreationOptions;
-import com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialDescriptor;
-import com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialParameters;
-import com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialRequestOptions;
-import com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialRpEntity;
-import com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialType;
-import com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialUserEntity;
import com.google.android.gms.tasks.Task;
import org.chromium.base.Log;
@@ -99,69 +80,8 @@ class CableAuthenticator {
// TODO: handle concurrent requests
assert mClientAddress == 0;
mClientAddress = clientAddress;
- Fido2PrivilegedApiClient client = Fido.getFido2PrivilegedApiClient(mContext);
- if (client == null) {
- Log.i(TAG, "getFido2PrivilegedApiClient failed");
- return;
- }
- Log.i(TAG, "have fido client");
-
- List<PublicKeyCredentialParameters> parameters = new ArrayList<>();
- for (int i = 0; i < algorithms.length; i++) {
- try {
- parameters.add(new PublicKeyCredentialParameters(
- PublicKeyCredentialType.PUBLIC_KEY.toString(), algorithms[i]));
- } catch (IllegalArgumentException e) {
- // The FIDO API will throw IllegalArgumentException for unrecognised algorithms.
- // Since an authenticator ignores unknown algorithms, this exception just needs to
- // be caught and ignored.
- }
- }
- // The GmsCore FIDO2 API does not actually support resident keys yet.
- AuthenticatorSelectionCriteria selection = new AuthenticatorSelectionCriteria.Builder()
- .setAttachment(Attachment.PLATFORM)
- .build();
- List<PublicKeyCredentialDescriptor> excludeCredentials =
- new ArrayList<PublicKeyCredentialDescriptor>();
- for (int i = 0; i < excludedCredentialIds.length; i++) {
- excludeCredentials.add(
- new PublicKeyCredentialDescriptor(PublicKeyCredentialType.PUBLIC_KEY.toString(),
- excludedCredentialIds[i], new ArrayList<Transport>()));
- }
- byte[] dummy = new byte[32];
- PublicKeyCredentialCreationOptions credentialCreationOptions =
- new PublicKeyCredentialCreationOptions.Builder()
- .setRp(new PublicKeyCredentialRpEntity(rpId, "", ""))
- .setUser(new PublicKeyCredentialUserEntity(userId, "", null, ""))
- .setChallenge(challenge)
- .setParameters(parameters)
- .setTimeoutSeconds(TIMEOUT_SECONDS)
- .setExcludeList(excludeCredentials)
- .setAuthenticatorSelection(selection)
- .setAttestationConveyancePreference(AttestationConveyancePreference.NONE)
- .build();
- BrowserPublicKeyCredentialCreationOptions browserRequestOptions =
- new BrowserPublicKeyCredentialCreationOptions.Builder()
- .setPublicKeyCredentialCreationOptions(credentialCreationOptions)
- .setOrigin(Uri.parse(origin))
- .build();
- Task<PendingIntent> result = client.getRegisterPendingIntent(browserRequestOptions);
- result.addOnSuccessListener(pedingIntent -> {
- Log.i(TAG, "got pending");
- try {
- mUi.startIntentSenderForResult(pedingIntent.getIntentSender(),
- REGISTER_REQUEST_CODE,
- null, // fillInIntent,
- 0, // flagsMask,
- 0, // flagsValue,
- 0, // extraFlags,
- Bundle.EMPTY);
- } catch (IntentSender.SendIntentException e) {
- Log.e(TAG, "intent failure");
- }
- }).addOnFailureListener(e -> { Log.e(TAG, "intent failure" + e); });
-
- Log.i(TAG, "op done");
+ Log.i(TAG, "getFido2PrivilegedApiClient failed");
+ return;
}
public void getAssertion(long clientAddress, String origin, String rpId, byte[] challenge,
@@ -170,54 +90,8 @@ class CableAuthenticator {
assert mClientAddress == 0;
mClientAddress = clientAddress;
- Fido2PrivilegedApiClient client = Fido.getFido2PrivilegedApiClient(mContext);
- if (client == null) {
- Log.i(TAG, "getFido2PrivilegedApiClient failed");
- return;
- }
- Log.i(TAG, "have fido client");
-
- List<PublicKeyCredentialDescriptor> allowCredentials =
- new ArrayList<PublicKeyCredentialDescriptor>();
- ArrayList<Transport> transports = new ArrayList<Transport>();
- transports.add(Transport.INTERNAL);
- for (int i = 0; i < allowedCredentialIds.length; i++) {
- allowCredentials.add(
- new PublicKeyCredentialDescriptor(PublicKeyCredentialType.PUBLIC_KEY.toString(),
- allowedCredentialIds[i], transports));
- }
-
- PublicKeyCredentialRequestOptions credentialRequestOptions =
- new PublicKeyCredentialRequestOptions.Builder()
- .setAllowList(allowCredentials)
- .setChallenge(challenge)
- .setRpId(rpId)
- .setTimeoutSeconds(TIMEOUT_SECONDS)
- .build();
-
- BrowserPublicKeyCredentialRequestOptions browserRequestOptions =
- new BrowserPublicKeyCredentialRequestOptions.Builder()
- .setPublicKeyCredentialRequestOptions(credentialRequestOptions)
- .setOrigin(Uri.parse(origin))
- .build();
-
- Task<PendingIntent> result = client.getSignPendingIntent(browserRequestOptions);
- result.addOnSuccessListener(pedingIntent -> {
- Log.i(TAG, "got pending");
- try {
- mUi.startIntentSenderForResult(pedingIntent.getIntentSender(),
- SIGN_REQUEST_CODE,
- null, // fillInIntent,
- 0, // flagsMask,
- 0, // flagsValue,
- 0, // extraFlags,
- Bundle.EMPTY);
- } catch (IntentSender.SendIntentException e) {
- Log.e(TAG, "intent failure");
- }
- }).addOnFailureListener(e -> { Log.e(TAG, "intent failure" + e); });
-
- Log.i(TAG, "op done");
+ Log.i(TAG, "getFido2PrivilegedApiClient failed");
+ return;
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
@@ -254,48 +128,7 @@ class CableAuthenticator {
return false;
}
Log.e(TAG, "OK.");
-
- if (data.hasExtra(Fido.FIDO2_KEY_ERROR_EXTRA)) {
- Log.e(TAG, "error extra");
- AuthenticatorErrorResponse error = AuthenticatorErrorResponse.deserializeFromBytes(
- data.getByteArrayExtra(Fido.FIDO2_KEY_ERROR_EXTRA));
- Log.i(TAG,
- "error response: " + error.getErrorMessage() + " "
- + String.valueOf(error.getErrorCodeAsInt()));
-
- // ErrorCode represents DOMErrors not CTAP status codes.
- // TODO: figure out translation of the remaining codes
- int ctap_status;
- switch (error.getErrorCode()) {
- case NOT_ALLOWED_ERR:
- ctap_status = CTAP2_ERR_OPERATION_DENIED;
- break;
- default:
- ctap_status = CTAP2_ERR_OTHER;
- break;
- }
- mBleHandler.onAuthenticatorAttestationResponse(
- mClientAddress, CTAP2_ERR_OTHER, null, null);
- return false;
- }
-
- if (!data.hasExtra(Fido.FIDO2_KEY_RESPONSE_EXTRA)
- || !data.hasExtra(Fido.FIDO2_KEY_CREDENTIAL_EXTRA)) {
- Log.e(TAG, "Missing FIDO2_KEY_RESPONSE_EXTRA or FIDO2_KEY_CREDENTIAL_EXTRA");
- mBleHandler.onAuthenticatorAttestationResponse(
- mClientAddress, CTAP2_ERR_OTHER, null, null);
- return false;
- }
-
- Log.e(TAG, "cred extra");
- PublicKeyCredential unusedPublicKeyCredential = PublicKeyCredential.deserializeFromBytes(
- data.getByteArrayExtra(Fido.FIDO2_KEY_CREDENTIAL_EXTRA));
- AuthenticatorAttestationResponse response =
- AuthenticatorAttestationResponse.deserializeFromBytes(
- data.getByteArrayExtra(Fido.FIDO2_KEY_RESPONSE_EXTRA));
- mBleHandler.onAuthenticatorAttestationResponse(mClientAddress, CTAP2_OK,
- response.getClientDataJSON(), response.getAttestationObject());
- return true;
+ return false;
}
public boolean onSignResponse(int resultCode, Intent data) {
@@ -306,49 +139,7 @@ class CableAuthenticator {
return false;
}
Log.e(TAG, "OK.");
-
- if (data.hasExtra(Fido.FIDO2_KEY_ERROR_EXTRA)) {
- Log.e(TAG, "error extra");
- AuthenticatorErrorResponse error = AuthenticatorErrorResponse.deserializeFromBytes(
- data.getByteArrayExtra(Fido.FIDO2_KEY_ERROR_EXTRA));
- Log.i(TAG,
- "error response: " + error.getErrorMessage() + " "
- + String.valueOf(error.getErrorCodeAsInt()));
-
- // ErrorCode represents DOMErrors not CTAP status codes.
- // TODO: figure out translation of the remaining codes
- int ctap_status;
- switch (error.getErrorCode()) {
- case NOT_ALLOWED_ERR:
- ctap_status = CTAP2_ERR_OPERATION_DENIED;
- break;
- default:
- ctap_status = CTAP2_ERR_OTHER;
- break;
- }
- mBleHandler.onAuthenticatorAssertionResponse(
- mClientAddress, ctap_status, null, null, null, null);
- return false;
- }
-
- if (!data.hasExtra(Fido.FIDO2_KEY_RESPONSE_EXTRA)
- || !data.hasExtra(Fido.FIDO2_KEY_CREDENTIAL_EXTRA)) {
- Log.e(TAG, "Missing FIDO2_KEY_RESPONSE_EXTRA or FIDO2_KEY_CREDENTIAL_EXTRA");
- mBleHandler.onAuthenticatorAssertionResponse(
- mClientAddress, CTAP2_ERR_OTHER, null, null, null, null);
- return false;
- }
-
- Log.e(TAG, "cred extra");
- PublicKeyCredential unusedPublicKeyCredential = PublicKeyCredential.deserializeFromBytes(
- data.getByteArrayExtra(Fido.FIDO2_KEY_CREDENTIAL_EXTRA));
- AuthenticatorAssertionResponse response =
- AuthenticatorAssertionResponse.deserializeFromBytes(
- data.getByteArrayExtra(Fido.FIDO2_KEY_RESPONSE_EXTRA));
- mBleHandler.onAuthenticatorAssertionResponse(mClientAddress, CTAP2_OK,
- response.getClientDataJSON(), response.getKeyHandle(),
- response.getAuthenticatorData(), response.getSignature());
- return true;
+ return false;
}
public void onQRCode(String value) {

95
patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.vision-com.google.android.gms.clearcut-com.google.android.gms.phenotype.patch

@ -4,17 +4,18 @@ Subject: Remove dependency on com.google.android.gms.vision,
com.google.android.gms.clearcut, com.google.android.gms.phenotype
---
chrome/android/BUILD.gn | 2
chrome/android/features/cablev2_authenticator/BUILD.gn | 2
chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/QrCodeScanMediator.java | 52 ----
services/BUILD.gn | 4
services/shape_detection/BUILD.gn | 2
services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java | 114 ---------
services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionProviderImpl.java | 22 -
services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java | 122 ----------
services/shape_detection/android/java/src/org/chromium/shape_detection/TextDetectionImpl.java | 60 ----
third_party/android_deps/BUILD.gn | 69 -----
10 files changed, 10 insertions(+), 439 deletions(-)
chrome/android/BUILD.gn | 2
chrome/android/features/cablev2_authenticator/BUILD.gn | 2
chrome/android/features/cablev2_authenticator/java/src/org/chromium/chrome/browser/webauth/authenticator/QRScanDialog.java | 50 ----
chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/scan_tab/QrCodeScanMediator.java | 52 ----
services/BUILD.gn | 4
services/shape_detection/BUILD.gn | 2
services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionImpl.java | 114 ---------
services/shape_detection/android/java/src/org/chromium/shape_detection/BarcodeDetectionProviderImpl.java | 22 -
services/shape_detection/android/java/src/org/chromium/shape_detection/FaceDetectionImplGmsCore.java | 122 ----------
services/shape_detection/android/java/src/org/chromium/shape_detection/TextDetectionImpl.java | 60 ----
third_party/android_deps/BUILD.gn | 69 -----
11 files changed, 10 insertions(+), 489 deletions(-)
--- a/services/BUILD.gn
+++ b/services/BUILD.gn
@ -676,3 +677,75 @@ Subject: Remove dependency on com.google.android.gms.vision,
+ return null;
}
}
--- a/chrome/android/features/cablev2_authenticator/java/src/org/chromium/chrome/browser/webauth/authenticator/QRScanDialog.java
+++ b/chrome/android/features/cablev2_authenticator/java/src/org/chromium/chrome/browser/webauth/authenticator/QRScanDialog.java
@@ -15,10 +15,6 @@ import android.view.ViewGroup;
import androidx.fragment.app.DialogFragment;
-import com.google.android.gms.vision.Frame;
-import com.google.android.gms.vision.barcode.Barcode;
-import com.google.android.gms.vision.barcode.BarcodeDetector;
-
import org.chromium.base.Log;
import org.chromium.base.ThreadUtils;
import org.chromium.base.task.PostTask;
@@ -45,7 +41,6 @@ public class QRScanDialog extends Dialog
public static interface Callback { void onQRCode(String value); }
private final Callback mCallback;
- private BarcodeDetector mQRScanner;
private CameraView mCameraView;
private ByteBuffer mBuffer;
private boolean mDismissed;
@@ -86,50 +81,5 @@ public class QRScanDialog extends Dialog
* {@link #mBuffer}. Runs on a background thread.
*/
private void findQRCodes(ByteBuffer buffer, Camera.Parameters cameraParams) {
- if (mQRScanner == null) {
- // This can trigger a load of GmsCore modules, which is too
- // much to do on the main thread.
- mQRScanner = new BarcodeDetector.Builder(getContext()).build();
- if (mQRScanner == null) {
- Log.i(TAG, "BarcodeDetector failed to load");
- PostTask.postTask(UiThreadTaskTraits.DEFAULT, this::dismiss);
- return;
- }
- }
-
- // From
- // https://developer.android.com/reference/android/hardware/Camera.PreviewCallback.html#onPreviewFrame(byte%5B%5D,%20android.hardware.Camera)
- // "If Camera.Parameters.setPreviewFormat(int) is never called, the default will be
- // the YCbCr_420_SP (NV21) format."
- Frame frame = new Frame.Builder()
- .setImageData(buffer, cameraParams.getPreviewSize().width,
- cameraParams.getPreviewSize().height, ImageFormat.NV21)
- .build();
- SparseArray<Barcode> barcodes = mQRScanner.detect(frame);
- PostTask.postTask(UiThreadTaskTraits.DEFAULT, () -> handleQRCodes(barcodes));
- }
-
- /**
- * Handles the results of QR detection. Runs on the UI thread.
- */
- private void handleQRCodes(SparseArray<Barcode> barcodes) {
- ThreadUtils.assertOnUiThread();
-
- // This dialog may have been dismissed while background QR detection was
- // running.
- if (mDismissed) {
- return;
- }
-
- for (int i = 0; i < barcodes.size(); i++) {
- String value = barcodes.valueAt(i).rawValue;
- if (value.startsWith(FIDO_QR_PREFIX)) {
- mCallback.onQRCode(value);
- dismiss();
- return;
- }
- }
-
- mCameraView.rearmCallback();
}
}

1
pruning_2.list

@ -11,6 +11,7 @@
./third_party/sqlite4java/lib/mac-x86_64/libsqlite4java.jnilib
./third_party/proguard/lib/proguard603.jar
./third_party/proguard/lib/retrace603.jar
./third_party/webpagereplay/bin/linux/x86_64/wpr
./chrome/browser/resource_coordinator/tab_ranker/example_preprocessor_config.pb
./chrome/browser/resource_coordinator/tab_ranker/pairwise_preprocessor_config.pb
./chrome/common/win/eventlog_messages.mc

Loading…
Cancel
Save