From 68ed09a837509db513c27f87394f62a77814a4bf Mon Sep 17 00:00:00 2001 From: wchen342 Date: Tue, 14 Jan 2020 18:38:02 -0500 Subject: [PATCH] Add ChromePublic target --- CHANGELOG.md | 71 ++++++++++--------- README.md | 19 ++--- android_flags.gn | 2 - build.sh | 6 +- misc/android_studio_setup.sh | 9 +-- patches/Unobtainium/kill-GCM.patch | 12 ++-- patches/series | 2 +- patches/src-fix/fix-extra-safe-browsing.patch | 52 ++++++++++++++ ...ng-macro-kSigninAllowedOnNextStartup.patch | 48 +++++++------ ...dependency-on-com.google.android.gcm.patch | 2 +- ...dynamic-com.google.android.gms.tasks.patch | 4 +- ...apps-com.google.android.gms.location.patch | 28 ++++---- ...ndency-on-com.google.android.gms.gcm.patch | 34 +-------- 13 files changed, 163 insertions(+), 126 deletions(-) create mode 100644 patches/src-fix/fix-extra-safe-browsing.patch diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c1eceb..b2855ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,47 +1,52 @@ -# 74.0.3729.169-1 -* First release +# 79.0.3945.117-2 +* Add ChromePublic target (API 19) +* Fix build failure for safe browsing +* Update `README` -# 75.0.3770.80-1 -* Reduce downloaded dependencies on gclient sync -* Prune more binaries -* Build gcm-client, eu-strip, closure-compiler from source; change error-prone to Maven version -* Domain substitution on all non-binary files +# 79.0.3945.117-1 +* Update NDK to r20b +* Remove split installer dependencies (Google Play), disable DFM +* Other source fixes +* Known issue: ~~some pages, including `chrome://flags`, `chrome://gpu` are not working~~ (Fixed) -# 75.0.3770.100-1 -* Change package name to avoid conflict with chromium +# 78.0.3904.97-1 +* Update scripts and patches to new version +* Merge patches from Bromite and Unobtainium +* New dependencies: nodejs binaries, lib files from ndk -# 75.0.3770.142-1 -* Fix [#3](https://github.com/wchen342/ungoogled-chromium-android/issues/3) -* Disable resource obfuscation -* Add arm build +# 77.0.3865.90-1 +* Update patches to new version +* Update GN to latest commit +* Minor fixes -# 75.0.3770.142-2 -* Remove all Google Play related libraries -* Uncheck "Send statistics" on first run +# 76.0.3809.132-1 +* No change + +# 76.0.3809.100-1 +* Change default setting of contextual search to false # 76.0.3809.87-1 * Add WebView builds * Since `aapt` no longer works, bundled `aapt2` will be used until a rebuild of SDK 29 exists * Minor bug fixes -# 76.0.3809.100-1 -* Change default setting of contextual search to false +# 75.0.3770.142-2 +* Remove all Google Play related libraries +* Uncheck "Send statistics" on first run -# 76.0.3809.132-1 -* No change +# 75.0.3770.142-1 +* Fix [#3](https://github.com/wchen342/ungoogled-chromium-android/issues/3) +* Disable resource obfuscation +* Add arm build -# 77.0.3865.90-1 -* Update patches to new version -* Update GN to latest commit -* Minor fixes +# 75.0.3770.100-1 +* Change package name to avoid conflict with chromium -# 78.0.3904.97-1 -* Update scripts and patches to new version -* Merge patches from Bromite and Unobtainium -* New dependencies: nodejs binaries, lib files from ndk +# 75.0.3770.80-1 +* Reduce downloaded dependencies on gclient sync +* Prune more binaries +* Build gcm-client, eu-strip, closure-compiler from source; change error-prone to Maven version +* Domain substitution on all non-binary files -# 79.0.3945.117-1 -* Update NDK to r20b -* Remove split installer dependencies (Google Play), disable DFM -* Other source fixes -* Known issue: ~~some pages, including `chrome://flags`, `chrome://gpu` are not working~~ (Fixed) \ No newline at end of file +# 74.0.3729.169-1 +* First release diff --git a/README.md b/README.md index 8efaaae..47bc2c4 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ For more information on `ungoogled-chromium`, please visit the original repo: [E ## Content Overview * [Differences from ungoogled-chromium](#differences-from-ungoogled-chromium) -* [Supported Platforms](#supported-platforms) +* [Platforms and Versions](#platforms-and-versions) * [Building Instructions](#building-instructions) * [Reporting and Contributing](#reporting-and-contributing) * [F-droid Repository](#f-droid-repository) @@ -29,20 +29,23 @@ For more information on `ungoogled-chromium`, please visit the original repo: [E * Android specific patches and fixes are applied. * Default configuration builds for `arm64` instead of `x64`. -## Supported Platforms +## Platforms and Versions -The current build has been tested on: -* cpu_arch: `x86`, `arm`, `arm64` -* OS: API 28 (Android 9.0), API 27 (Android 8.1), LineageOS 16.0 - -Theoretically it will run on any device with a minimum API of 24 (Nougat). +Pre-built apks are named as `{BUILD_TARGET}_{CPU_ARCH}.apk`, where: +* `{BUILD_TARGET}` is one of `ChromePublic`, `MonoChromePublic`, `SystemWebview`. + * `ChromePublic` is for API > 19 (Android 4.4) and only contains the browser. + * `MonoChromePublic` is for API > 24 (Android 7.0) and contains both the browser and the webview. + * `SystemWebview` is for API 21 - 23 (Android 5.0 - 6.0) and only contains the webview. +* `{CPU_ARCH}` is one of `x86`, `arm` (armeabi-v7a), `arm64` (arm64-v8a). +* Please also read this [important note](https://chromium.googlesource.com/chromium/src/+/HEAD/android_webview/docs/build-instructions.md#Important-notes-for-N_P) about Webview on Android N-P. +* The [Bromite Wiki](https://github.com/bromite/bromite/wiki/Installing-SystemWebView) can also be helpful. ## Building Instructions *This build is built from Sylvain Beucler's [libre Android rebuilds](https://android-rebuilds.beuc.net/) instead of SDK/NDK binaries from Google.* * Clone this repository -* If you want to enable proprietary codecs (h264, mp3, mp4, etc.), add `proprietary_codecs=true` to the end of `android_flags.gn` +* ~~If you want to enable proprietary codecs (h264, mp3, mp4, etc.), add `proprietary_codecs=true` to the end of `android_flags.gn`.~~ It is now the default, since `proprietary_codecs` does not add the actual codecs, only codes to handle those file types. * enter repo directory and run `./build.sh`. Build time dependencies can be roughly referred from [AUR](https://aur.archlinux.org/packages/ungoogled-chromium/). diff --git a/android_flags.gn b/android_flags.gn index dafc49b..298d1a0 100644 --- a/android_flags.gn +++ b/android_flags.gn @@ -1,6 +1,4 @@ android_channel="stable" -android32_ndk_api_level=21 -android64_ndk_api_level=21 android_ndk_root = "//third_party/android_ndk" android_ndk_version = "r20b" android_ndk_major_version = 20 diff --git a/build.sh b/build.sh index bca51fc..dde054a 100755 --- a/build.sh +++ b/build.sh @@ -3,8 +3,9 @@ set -eux -o pipefail chromium_version=79.0.3945.117 ungoogled_chromium_revision=1 +chrome_target=chrome_public_apk monochrome_target=monochrome_public_apk -monochrome_webview_target=system_webview_apk +webview_target=system_webview_apk # Required tools: python2, python3, ninja, git, clang, lld, llvm, curl, wget, npm # Assuming default python to be python2. This is true on most Linux distributions. @@ -218,6 +219,7 @@ patch -p1 --ignore-whitespace -i patches/ignore-aidl-assertion-error.patch --no- ## Build pushd src +/usr/bin/ninja -C out/Default ${chrome_target} /usr/bin/ninja -C out/Default ${monochrome_target} -/usr/bin/ninja -C out/Default ${monochrome_webview_target} +/usr/bin/ninja -C out/Default ${webview_target} popd diff --git a/misc/android_studio_setup.sh b/misc/android_studio_setup.sh index 7eeb6f7..e74e29f 100644 --- a/misc/android_studio_setup.sh +++ b/misc/android_studio_setup.sh @@ -2,8 +2,9 @@ set -eux -o pipefail chromium_version=79.0.3945.117 -target=monochrome_public_apk -#target=system_webview_apk +chrome_target=chrome_public_apk +monochrome_target=monochrome_public_apk +webview_target=system_webview_apk # Create symbol links to gn, depot-tools pushd src @@ -38,7 +39,7 @@ cat ../android_flags.debug.gn ../android_flags.gn > ${output_folder}/args.gn tools/gn/out/gn gen ${output_folder} --fail-on-unused-args # Compile apk -/usr/bin/ninja -C ${output_folder} ${target} +/usr/bin/ninja -C ${output_folder} ${monochrome_target} popd ### @@ -56,5 +57,5 @@ tools/gn/out/gn gen ${output_folder} --fail-on-unused-args pushd .. patch -p1 --ignore-whitespace -i patches/generate_gradle.patch --no-backup-if-mismatch popd -python build/android/gradle/generate_gradle.py --target //chrome/android:${target} --output-directory ${output_folder} +python build/android/gradle/generate_gradle.py --target //chrome/android:${monochrome_target} --output-directory ${output_folder} popd diff --git a/patches/Unobtainium/kill-GCM.patch b/patches/Unobtainium/kill-GCM.patch index cdbb130..fad81c3 100644 --- a/patches/Unobtainium/kill-GCM.patch +++ b/patches/Unobtainium/kill-GCM.patch @@ -11,7 +11,7 @@ Subject: kill GCM .../browser/services/gcm/GCMBackgroundTask.java | 2 +- .../gcm/InvalidationGcmUpstreamSender.java | 18 -- components/background_task_scheduler/BUILD.gn | 1 - - .../BackgroundTaskSchedulerGcmNetworkManager.java | 208 +-------------------- + .../BackgroundTaskSchedulerGcmNetworkManager.java | 206 +-------------------- components/gcm_driver/android/BUILD.gn | 1 - components/gcm_driver/instance_id/android/BUILD.gn | 1 - .../gcm_driver/instance_id/InstanceIDBridge.java | 52 +----- @@ -19,7 +19,7 @@ Subject: kill GCM third_party/cacheinvalidation/BUILD.gn | 6 - .../client/contrib/MultiplexingGcmListener.java | 91 +-------- .../android2/channel/AndroidNetworkChannel.java | 6 +- - 16 files changed, 10 insertions(+), 496 deletions(-) + 16 files changed, 10 insertions(+), 494 deletions(-) diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn --- a/chrome/android/BUILD.gn @@ -43,7 +43,7 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java "java/src/org/chromium/chrome/browser/ChromeBackupAgent.java", "java/src/org/chromium/chrome/browser/ChromeBackupWatcher.java", "java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java", -@@ -1438,11 +1437,6 @@ chrome_java_sources = [ +@@ -1437,11 +1436,6 @@ chrome_java_sources = [ "java/src/org/chromium/chrome/browser/services/AndroidEduAndChildAccountHelper.java", "java/src/org/chromium/chrome/browser/services/AndroidEduOwnerCheckCallback.java", "java/src/org/chromium/chrome/browser/services/GoogleServicesManager.java", @@ -354,7 +354,7 @@ diff --git a/components/background_task_scheduler/android/java/src/org/chromium/ import org.chromium.base.Log; import org.chromium.base.ThreadUtils; import org.chromium.base.VisibleForTesting; -@@ -43,212 +35,14 @@ class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedule +@@ -43,212 +35,16 @@ class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedule sClock = clock; } @@ -517,7 +517,7 @@ diff --git a/components/background_task_scheduler/android/java/src/org/chromium/ - return Task.NETWORK_STATE_ANY; - } - -- @Override + @Override public boolean schedule(Context context, @NonNull TaskInfo taskInfo) { ThreadUtils.assertOnUiThread(); @@ -541,7 +541,7 @@ diff --git a/components/background_task_scheduler/android/java/src/org/chromium/ + return false; } -- @Override + @Override public void cancel(Context context, int taskId) { ThreadUtils.assertOnUiThread(); - diff --git a/patches/series b/patches/series index e027e8d..06ff2ac 100644 --- a/patches/series +++ b/patches/series @@ -3,6 +3,7 @@ src-fix/fix-null-mInstanceID.patch src-fix/fix-unkown-warning-clang-9.patch src-fix/fix-safe-browsing-prefs.patch src-fix/fix-wrong-macro-kSigninAllowedOnNextStartup.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 @@ -12,7 +13,6 @@ 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-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 diff --git a/patches/src-fix/fix-extra-safe-browsing.patch b/patches/src-fix/fix-extra-safe-browsing.patch new file mode 100644 index 0000000..9604f29 --- /dev/null +++ b/patches/src-fix/fix-extra-safe-browsing.patch @@ -0,0 +1,52 @@ +From: Wengling Chen +Date: Mon, 13 Jan 2020 23:03:53 -0500 +Subject: Extra fix for build without safe browsing + +--- + chrome/android/BUILD.gn | 1 - + chrome/android/chrome_java_sources.gni | 1 - + .../src/org/chromium/chrome/browser/webshare/ShareServiceImpl.java | 3 +-- + 3 files changed, 1 insertion(+), 4 deletions(-) + +diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn +--- a/chrome/android/BUILD.gn ++++ b/chrome/android/BUILD.gn +@@ -2659,7 +2659,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/FileTypePolicies.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", +diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni +--- a/chrome/android/chrome_java_sources.gni ++++ b/chrome/android/chrome_java_sources.gni +@@ -1413,7 +1413,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/FileTypePolicies.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", +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webshare/ShareServiceImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/webshare/ShareServiceImpl.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/webshare/ShareServiceImpl.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/webshare/ShareServiceImpl.java +@@ -19,7 +19,6 @@ import org.chromium.base.task.AsyncTask; + import org.chromium.base.task.PostTask; + import org.chromium.base.task.TaskRunner; + import org.chromium.base.task.TaskTraits; +-import org.chromium.chrome.browser.safe_browsing.FileTypePolicies; + import org.chromium.chrome.browser.share.ShareHelper; + import org.chromium.chrome.browser.share.ShareParams; + import org.chromium.content_public.browser.WebContents; +@@ -196,7 +195,7 @@ public class ShareServiceImpl implements ShareService { + + for (SharedFile file : files) { + RecordHistogram.recordSparseHistogram( +- "WebShare.Unverified", FileTypePolicies.umaValueForFile(file.name)); ++ "WebShare.Unverified", 1); + } + + for (SharedFile file : files) { diff --git a/patches/src-fix/fix-wrong-macro-kSigninAllowedOnNextStartup.patch b/patches/src-fix/fix-wrong-macro-kSigninAllowedOnNextStartup.patch index 2c7034e..7cfbd58 100644 --- a/patches/src-fix/fix-wrong-macro-kSigninAllowedOnNextStartup.patch +++ b/patches/src-fix/fix-wrong-macro-kSigninAllowedOnNextStartup.patch @@ -3,52 +3,60 @@ Date: Fri, 10 Jan 2020 23:04:00 -0500 Subject: Fix wrong macro definition related to kSigninAllowedOnNextStartup --- - chrome/browser/policy/browser_signin_policy_handler.cc | 12 ------------ - .../policy/configuration_policy_handler_list_factory.cc | 6 ------ - 2 files changed, 18 deletions(-) + .../policy/browser_signin_policy_handler.cc | 23 ---------------------- + .../configuration_policy_handler_list_factory.cc | 10 ---------- + 2 files changed, 33 deletions(-) diff --git a/chrome/browser/policy/browser_signin_policy_handler.cc b/chrome/browser/policy/browser_signin_policy_handler.cc --- a/chrome/browser/policy/browser_signin_policy_handler.cc +++ b/chrome/browser/policy/browser_signin_policy_handler.cc -@@ -44,24 +44,12 @@ void BrowserSigninPolicyHandler::ApplyPolicySettings(const PolicyMap& policies, - FALLTHROUGH; - case BrowserSigninMode::kEnabled: - prefs->SetValue( +@@ -41,29 +41,6 @@ void BrowserSigninPolicyHandler::ApplyPolicySettings(const PolicyMap& policies, + #if !defined(OS_LINUX) + prefs->SetValue(prefs::kForceBrowserSignin, base::Value(true)); + #endif +- FALLTHROUGH; +- case BrowserSigninMode::kEnabled: +- prefs->SetValue( -#if defined(OS_ANDROID) - // The new kSigninAllowedOnNextStartup pref is only used on Desktop. - // Keep the old kSigninAllowed pref for Android until the policy is - // fully deprecated in M71 and can be removed. -#else - prefs::kSigninAllowedOnNextStartup, +- prefs::kSigninAllowedOnNextStartup, -#endif - base::Value(true)); - break; - case BrowserSigninMode::kDisabled: - prefs->SetValue( +- base::Value(true)); +- break; +- case BrowserSigninMode::kDisabled: +- prefs->SetValue( -#if defined(OS_ANDROID) - // The new kSigninAllowedOnNextStartup pref is only used on Desktop. - // Keep the old kSigninAllowed pref for Android until the policy is - // fully deprecated in M71 and can be removed. -#else - prefs::kSigninAllowedOnNextStartup, +- prefs::kSigninAllowedOnNextStartup, -#endif - base::Value(false)); - break; +- base::Value(false)); +- break; } + } + } diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc -@@ -1398,13 +1398,7 @@ std::unique_ptr BuildHandlerList( - base::Value::Type::BOOLEAN)); +@@ -1396,16 +1396,6 @@ std::unique_ptr BuildHandlerList( signin_legacy_policies.push_back(std::make_unique( - key::kSigninAllowed, + key::kForceBrowserSignin, prefs::kForceBrowserSignin, + base::Value::Type::BOOLEAN)); +- signin_legacy_policies.push_back(std::make_unique( +- key::kSigninAllowed, -#if defined(OS_ANDROID) - // The new kSigninAllowedOnNextStartup pref is only used on Desktop. - // Keep the old kSigninAllowed pref for Android until the policy is - // fully deprecated in M71 and can be removed. -#else - prefs::kSigninAllowedOnNextStartup, +- prefs::kSigninAllowedOnNextStartup, -#endif - base::Value::Type::BOOLEAN)); +- base::Value::Type::BOOLEAN)); handlers->AddHandler(std::make_unique( std::move(signin_legacy_policies), + std::make_unique(chrome_schema))); diff --git a/patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gcm.patch b/patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gcm.patch index 646593f..af55f72 100644 --- a/patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gcm.patch +++ b/patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gcm.patch @@ -123,7 +123,7 @@ diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ clientKey = ""; try { - registrationId = GCMRegistrar.getRegistrationId(context); -+ registrationId = null; ++ registrationId = null; } catch (RuntimeException exception) { // GCMRegistrar#getRegistrationId occasionally throws a runtime exception. Catching the // exception rather than crashing. diff --git a/patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.common-auth-signin-dynamic-com.google.android.gms.tasks.patch b/patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.common-auth-signin-dynamic-com.google.android.gms.tasks.patch index e0be058..14c2b50 100644 --- a/patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.common-auth-signin-dynamic-com.google.android.gms.tasks.patch +++ b/patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.common-auth-signin-dynamic-com.google.android.gms.tasks.patch @@ -210,7 +210,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/component_updat - || GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable( - ContextUtils.getApplicationContext()) - == ConnectionResult.SUCCESS; -+ return false; ++ return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M; } /* package */ void onStartTaskBeforeNativeLoaded(TaskFinishedCallback callback) { @@ -833,6 +833,6 @@ diff --git a/third_party/robolectric/BUILD.gn b/third_party/robolectric/BUILD.gn "//third_party/android_deps:android_support_v4_java", "//third_party/gson:gson_java", "//third_party/guava:guava_java", --- +-- 2.11.0 diff --git a/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 b/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 index f5718a9..db8a97c 100644 --- a/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 +++ b/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 @@ -7,7 +7,7 @@ Subject: Remove dependency on com.google.android.gms.fido, --- chrome/android/BUILD.gn | 5 - .../externalnav/ExternalNavigationHandler.java | 4 - - .../browser/instantapps/InstantAppsHandler.java | 59 +----------- + .../browser/instantapps/InstantAppsHandler.java | 57 +----------- components/gcm_driver/instance_id/android/BUILD.gn | 2 - .../instance_id/InstanceIDWithSubtype.java | 28 +----- device/BUILD.gn | 1 - @@ -16,7 +16,7 @@ Subject: Remove dependency on com.google.android.gms.fido, third_party/android_deps/BUILD.gn | 58 ------------ third_party/cacheinvalidation/BUILD.gn | 1 - .../client/android2/AndroidManifestUpdatedGcm.xml | 3 - - 11 files changed, 9 insertions(+), 256 deletions(-) + 11 files changed, 12 insertions(+), 251 deletions(-) diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn --- a/chrome/android/BUILD.gn @@ -131,22 +131,19 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/instantapps/Ins } /** -@@ -208,14 +164,6 @@ public class InstantAppsHandler { +@@ -208,9 +164,8 @@ public class InstantAppsHandler { return false; } - if (IntentUtils.safeGetBooleanExtra(intent, DO_NOT_LAUNCH_EXTRA, false) - || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O - && (intent.getFlags() & FLAG_DO_NOT_LAUNCH) != 0)) { -- maybeRecordFallbackStats(intent); -- Log.i(TAG, "Not handling with Instant Apps (DO_NOT_LAUNCH_EXTRA)"); -- return false; -- } -- - if (IntentUtils.safeGetBooleanExtra( - intent, IntentHandler.EXTRA_OPEN_NEW_INCOGNITO_TAB, false) - || IntentUtils.safeHasExtra(intent, ShortcutHelper.EXTRA_SOURCE) -@@ -240,7 +188,6 @@ public class InstantAppsHandler { ++ if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ++ && (intent.getFlags() & FLAG_DO_NOT_LAUNCH) != 0)) { + maybeRecordFallbackStats(intent); + Log.i(TAG, "Not handling with Instant Apps (DO_NOT_LAUNCH_EXTRA)"); + return false; +@@ -240,7 +195,6 @@ public class InstantAppsHandler { } Intent callbackIntent = new Intent(intent); @@ -154,7 +151,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/instantapps/Ins callbackIntent.putExtra(INSTANT_APP_START_TIME_EXTRA, startTime); return tryLaunchingInstantApp(context, intent, isCustomTabsIntent, callbackIntent); -@@ -343,12 +290,9 @@ public class InstantAppsHandler { +@@ -343,12 +297,9 @@ public class InstantAppsHandler { Intent iaIntent = data.getIntent(); if (data.getReferrer() != null) { iaIntent.putExtra(Intent.EXTRA_REFERRER, data.getReferrer()); @@ -167,11 +164,12 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/instantapps/Ins try { appContext.startActivity(iaIntent); -@@ -394,7 +338,6 @@ public class InstantAppsHandler { +@@ -394,7 +345,7 @@ public class InstantAppsHandler { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { return info.isInstantAppAvailable; } else if (info.activityInfo != null) { - return EPHEMERAL_INSTALLER_CLASS.equals(info.activityInfo.name); ++ return false; } return false; @@ -543,6 +541,6 @@ diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ --- +-- 2.11.0 diff --git a/patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.gcm.patch b/patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.gcm.patch index 008a8dc..b6cca3b 100644 --- a/patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.gcm.patch +++ b/patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.gcm.patch @@ -11,15 +11,13 @@ The snippets are already disabled in native codes, this will disable it on Java .../services/gcm/ChromeGcmListenerService.java | 57 +------------- components/background_task_scheduler/BUILD.gn | 3 - .../BackgroundTaskGcmTaskService.java | 63 +-------------- - .../BackgroundTaskSchedulerFactory.java | 6 +- - .../BackgroundTaskSchedulerGcmNetworkManager.java | 2 +- third_party/android_deps/BUILD.gn | 15 ---- third_party/cacheinvalidation/BUILD.gn | 1 - .../client/android2/AndroidManifestUpdatedGcm.xml | 20 ----- .../android2/channel/AndroidGcmController.java | 42 +--------- .../channel/AndroidInstanceIDListenerService.java | 13 +--- .../channel/GcmRegistrationTaskService.java | 89 +--------------------- - 14 files changed, 12 insertions(+), 366 deletions(-) + 12 files changed, 10 insertions(+), 360 deletions(-) diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn --- a/chrome/android/BUILD.gn @@ -357,34 +355,6 @@ diff --git a/components/background_task_scheduler/android/java/src/org/chromium/ @Override public void onInitializeTasks() { // Ignore the event on OSs supporting JobScheduler. -diff --git a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerFactory.java b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerFactory.java ---- a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerFactory.java -+++ b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerFactory.java -@@ -17,11 +17,7 @@ public final class BackgroundTaskSchedulerFactory { - private static BackgroundTaskFactory sBackgroundTaskFactory; - - static BackgroundTaskSchedulerDelegate getSchedulerDelegateForSdk(int sdkInt) { -- if (sdkInt >= Build.VERSION_CODES.M) { -- return new BackgroundTaskSchedulerJobService(); -- } else { -- return new BackgroundTaskSchedulerGcmNetworkManager(); -- } -+ return new BackgroundTaskSchedulerJobService(); /* minSDK is 24 */ - } - - /** -diff --git a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java ---- a/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java -+++ b/components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/BackgroundTaskSchedulerGcmNetworkManager.java -@@ -19,7 +19,7 @@ import java.util.concurrent.TimeUnit; - * An implementation of {@link BackgroundTaskSchedulerDelegate} that uses the Play Services - * {@link GcmNetworkManager} to schedule jobs. - */ --class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedulerDelegate { -+class BackgroundTaskSchedulerGcmNetworkManager { - private static final String TAG = "BkgrdTaskSchedGcmNM"; - - /** Delta time for expiration checks, after the end time. */ 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 @@ -669,6 +639,6 @@ diff --git a/third_party/cacheinvalidation/src/java/com/google/ipc/invalidation/ - } - } } --- +-- 2.11.0