Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Commit

Permalink
Combine patching into one step; bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wchen342 committed Aug 3, 2019
1 parent 55c44fd commit 2796466
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 36 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@

# 75.0.3770.142-2
* Remove all Google Play related libraries
* Uncheck "Send statistics" on first run
* Uncheck "Send statistics" on first run

# 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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ For more information on `ungoogled-chromium`, please visit the original repo: [E

*These are the differences between a Linux build of ungoogled-chromium and this Android build.*

* Current build still include proprietary libraries from Google. They are supposed to be removed in the future.
* Android specific fixes are applied.
* Android specific patches and fixes are applied.
* Default configuration builds for `arm64` instead of `x64`.

## Supported Platforms
Expand Down
9 changes: 2 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -eux -o pipefail

chromium_version=76.0.3809.87
target=monochrome_public_apk
#target=system_webview_apk

# Required tools: python2, python3, ninja, git, clang, lld, llvm, curl
# Assuming default python to be python2. This is true on most Linux distributions.
Expand Down Expand Up @@ -159,14 +160,8 @@ popd


# Additional Source Patches
# TODO use patches.py instead
## Extra fixes for Chromium source
#patch -p1 --ignore-whitespace -i patches/android-rlz-fix-missing-variable.patch --no-backup-if-mismatch # Fix an error in chrome/browser/android/rlz/rlz_ping_handler.cc
#patch -p1 --ignore-whitespace -i patches/fix-redefinition-error.patch --no-backup-if-mismatch # Fix a redefinition error
#patch -p1 --ignore-whitespace -i patches/change_package_name.patch --no-backup-if-mismatch # Change package/App name
#patch -p1 --ignore-whitespace -i patches/Vanadium/0020-disable-media-router-media-remoting-by-default.patch --no-backup-if-mismatch
#patch -p1 --ignore-whitespace -i patches/Vanadium/0021-disable-media-router-by-default.patch --no-backup-if-mismatch
#patch -p1 --ignore-whitespace -i patches/linker-android-support-remove.patch --no-backup-if-mismatch
python3 ungoogled-chromium/utils/patches.py apply src patches
#patch -p1 --ignore-whitespace -i patches/aapt2-param.patch --no-backup-if-mismatch
## Second pruning list
pruning_list_2="pruning_2.list"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Subject: [PATCH 20/30] disable media router media remoting by default

diff --git a/src/chrome/browser/profiles/profile.cc b/src/chrome/browser/profiles/profile.cc
index e56624c60f42..dc2479bc4ad0 100644
--- a/src/chrome/browser/profiles/profile.cc
+++ b/src/chrome/browser/profiles/profile.cc
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -210,7 +210,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
prefs::kMediaRouterFirstRunFlowAcknowledged,
false,
Expand Down
8 changes: 4 additions & 4 deletions patches/Vanadium/0021-disable-media-router-by-default.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Subject: [PATCH 21/30] disable media router by default

diff --git a/src/chrome/browser/media/router/media_router_feature.cc b/src/chrome/browser/media/router/media_router_feature.cc
index 9c42d30ecd22..e773dd54ad9e 100644
--- a/src/chrome/browser/media/router/media_router_feature.cc
+++ b/src/chrome/browser/media/router/media_router_feature.cc
--- a/chrome/browser/media/router/media_router_feature.cc
+++ b/chrome/browser/media/router/media_router_feature.cc
@@ -58,17 +58,16 @@ const PrefService::Preference* GetMediaRouterPref(

bool MediaRouterEnabled(content::BrowserContext* context) {
Expand Down Expand Up @@ -40,8 +40,8 @@ index 9c42d30ecd22..e773dd54ad9e 100644
#endif // defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/src/chrome/browser/profiles/profile_impl.cc b/src/chrome/browser/profiles/profile_impl.cc
index 86ffb0c6cfc3..e32f0e7b83fe 100644
--- a/src/chrome/browser/profiles/profile_impl.cc
+++ b/src/chrome/browser/profiles/profile_impl.cc
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -435,7 +435,7 @@ void ProfileImpl::RegisterProfilePrefs(
registry->RegisterStringPref(
prefs::kPrintPreviewDefaultDestinationSelectionRules, std::string());
Expand Down
8 changes: 4 additions & 4 deletions patches/series
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
src/android-rlz-fix-missing-variable.patch
src/fix-redefinition-error.patch
src/fix-null-mInstanceID.patch
ungoogled-chromium-android/change_package_name.patch
src-fix/android-rlz-fix-missing-variable.patch
src-fix/fix-redefinition-error.patch
src-fix/fix-null-mInstanceID.patch
Vanadium/0020-disable-media-router-media-remoting-by-default.patch
Vanadium/0021-disable-media-router-by-default.patch
ungoogled-chromium-android/change-package-name-chromium.patch
ungoogled-chromium-android/linker-android-support-remove.patch
ungoogled-chromium-android/remove-gcm-client.patch
ungoogled-chromium-android/remove-gms-gcm.patch
Expand Down
4 changes: 2 additions & 2 deletions patches/src-fix/android-rlz-fix-missing-variable.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
description: fix a missing variable
author: Wengling Chen <[email protected]>

--- a/src/chrome/browser/android/rlz/rlz_ping_handler.cc
+++ b/src/chrome/browser/android/rlz/rlz_ping_handler.cc
--- a/chrome/browser/android/rlz/rlz_ping_handler.cc
+++ b/chrome/browser/android/rlz/rlz_ping_handler.cc
@@ -76,7 +76,7 @@ void RlzPingHandler::Ping(
DCHECK_EQ(id.length(), 50u);

Expand Down
4 changes: 2 additions & 2 deletions patches/src-fix/fix-redefinition-error.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Fix a redefinition error in unnamed namespace.
author: Wengling Chen <[email protected]>

diff --git a/chrome/browser/android/favicon_helper.cc b/chrome/browser/android/favicon_helper.cc
--- a/src/chrome/browser/android/favicon_helper.cc
+++ b/src/chrome/browser/android/favicon_helper.cc
--- a/chrome/browser/android/favicon_helper.cc
+++ b/chrome/browser/android/favicon_helper.cc
@@ -80,17 +80,13 @@ void OnEnsureIconIsAvailableFinished(
env, j_availability_callback, newly_available);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
description: change package name to allow co-existence with original Chromium
author: Wengling Chen <[email protected]>

--- a/src/chrome/android/BUILD.gn
+++ b/src/chrome/android/BUILD.gn
@@ -42,8 +42,8 @@
---
chrome/android/BUILD.gn | 4 ++--
chrome/android/java/res_chromium/values/channel_constants.xml | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -42,8 +42,8 @@ if (dfmify_devtools) {
import("//chrome/android/features/devtools/devtools_module_tmpl.gni")
}

Expand All @@ -14,10 +20,9 @@ author: Wengling Chen <[email protected]>

chrome_public_jinja_variables = default_chrome_public_jinja_variables +
[ "manifest_package=$manifest_package" ]


--- a/src/chrome/android/java/res_chromium/values/channel_constants.xml
+++ b/src/chrome/android/java/res_chromium/values/channel_constants.xml
diff --git a/chrome/android/java/res_chromium/values/channel_constants.xml b/chrome/android/java/res_chromium/values/channel_constants.xml
--- a/chrome/android/java/res_chromium/values/channel_constants.xml
+++ b/chrome/android/java/res_chromium/values/channel_constants.xml
@@ -5,7 +5,7 @@

<resources xmlns:android="http://schemas.android.com/apk/res/android">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
description: remove linker flag -landroid_support. We build MonoChrome targets API 24+, which won't need support library anyway
author: Wengling Chen <[email protected]>

--- a/src/build/config/android/BUILD.gn
+++ b/src/build/config/android/BUILD.gn
--- a/build/config/android/BUILD.gn
+++ b/build/config/android/BUILD.gn
@@ -117,7 +117,7 @@
lib_dirs = [ android_libcpp_lib_dir ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ diff --git a/services/device/geolocation/android/java/src/org/chromium/device/ge
import org.chromium.components.location.LocationUtils;
@@ -27,126 +17,39 @@ import org.chromium.components.location.LocationUtils;
*
* https://developers.9oo91e.qjz9zk/android/reference/com/google/android/gms/location/package-summary
* https://developers.google.com/android/reference/com/google/android/gms/location/package-summary
*/
-public class LocationProviderGmsCore implements ConnectionCallbacks, OnConnectionFailedListener,
- LocationListener, LocationProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detect
- // The vision library will be downloaded the first time the API is used
- // on the device; this happens "fast", but it might have not completed,
- // bail in this case. Also, the API was disabled between and v.9.0 and
- // v.9.2, see https://developers.9oo91e.qjz9zk/android/guides/releases.
- // v.9.2, see https://developers.google.com/android/guides/releases.
- if (!mBarcodeDetector.isOperational()) {
- Log.e(TAG, "BarcodeDetector is not operational");
- callback.call(new BarcodeDetectionResult[0]);
Expand Down Expand Up @@ -409,7 +409,7 @@ diff --git a/services/shape_detection/android/java/src/org/chromium/shape_detect
- // The vision library will be downloaded the first time the API is used
- // on the device; this happens "fast", but it might have not completed,
- // bail in this case. Also, the API was disabled between and v.9.0 and
- // v.9.2, see https://developers.9oo91e.qjz9zk/android/guides/releases.
- // v.9.2, see https://developers.google.com/android/guides/releases.
- if (!mTextRecognizer.isOperational()) {
- Log.e(TAG, "TextDetector is not operational");
- callback.call(new TextDetectionResult[0]);
Expand Down

0 comments on commit 2796466

Please sign in to comment.