From 8f65efd7f2523ad900a313745d413b48e9a5ece3 Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 20 Oct 2023 18:25:34 +0530 Subject: [PATCH 01/15] Browser: Remove send to your devices option --- ...rowser-Remove-send-to-devices-option.patch | 78 +++++++++++++++++++ build/e_patches_list.txt | 2 + 2 files changed, 80 insertions(+) create mode 100644 build/e_patches/0001-Browser-Remove-send-to-devices-option.patch diff --git a/build/e_patches/0001-Browser-Remove-send-to-devices-option.patch b/build/e_patches/0001-Browser-Remove-send-to-devices-option.patch new file mode 100644 index 00000000..da6935fc --- /dev/null +++ b/build/e_patches/0001-Browser-Remove-send-to-devices-option.patch @@ -0,0 +1,78 @@ +From 92cbf726cce7f13335141ab06dae3179334ae48b Mon Sep 17 00:00:00 2001 +From: althafvly +Date: Fri, 20 Oct 2023 18:23:09 +0530 +Subject: [PATCH] Browser: Remove send to devices option + +--- + ...omeProvidedSharingOptionsProviderBase.java | 28 ------------------- + 1 file changed, 28 deletions(-) + +diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/ChromeProvidedSharingOptionsProviderBase.java b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/ChromeProvidedSharingOptionsProviderBase.java +index 9a24cac51b093..6e6885f31ae1e 100644 +--- a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/ChromeProvidedSharingOptionsProviderBase.java ++++ b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/ChromeProvidedSharingOptionsProviderBase.java +@@ -253,7 +253,6 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { + // Only show a limited first party share selection for automotive + if (BuildInfo.getInstance().isAutomotive) { + mOrderedFirstPartyOptions.add(createCopyLinkFirstPartyOption()); +- maybeAddSendTabToSelfFirstPartyOption(); + maybeAddQrCodeFirstPartyOption(); + return; + } +@@ -261,7 +260,6 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { + maybeAddCopyFirstPartyOption(); + maybeAddLongScreenshotFirstPartyOption(); + maybeAddPrintFirstPartyOption(); +- maybeAddSendTabToSelfFirstPartyOption(); + maybeAddQrCodeFirstPartyOption(); + } else { + maybeAddWebStyleNotesFirstPartyOption(); +@@ -270,22 +268,12 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { + // Always show the copy link option as some entries does not offer the change for copy + // (e.g. feed card) + maybeAddCopyFirstPartyOption(); +- maybeAddSendTabToSelfFirstPartyOption(); + maybeAddQrCodeFirstPartyOption(); + maybeAddPrintFirstPartyOption(); + maybeAddDownloadImageFirstPartyOption(); + } + } + +- private void maybeAddSendTabToSelfFirstPartyOption() { +- Optional sendTabToSelfDisplayReason = +- SendTabToSelfAndroidBridge.getEntryPointDisplayReason(mProfile, mUrl); +- if (sendTabToSelfDisplayReason.isPresent() +- || !ChromeFeatureList.isEnabled(ChromeFeatureList.SEND_TAB_TO_SELF_SIGNIN_PROMO)) { +- mOrderedFirstPartyOptions.add(createSendTabToSelfFirstPartyOption()); +- } +- } +- + private void maybeAddQrCodeFirstPartyOption() { + } + +@@ -422,22 +410,6 @@ public abstract class ChromeProvidedSharingOptionsProviderBase { + .build(); + } + +- private FirstPartyOption createSendTabToSelfFirstPartyOption() { +- return new FirstPartyOptionBuilder( +- ContentType.LINK_PAGE_VISIBLE, ContentType.LINK_PAGE_NOT_VISIBLE, ContentType.IMAGE) +- .setDetailedContentTypesToDisableFor( +- DetailedContentType.WEB_NOTES, DetailedContentType.SCREENSHOT) +- .setIcon(R.drawable.send_tab, R.string.sharing_send_tab_to_self) +- .setFeatureNameForMetrics(USER_ACTION_SEND_TAB_TO_SELF_SELECTED) +- .setOnClickCallback((view) -> { +- SendTabToSelfCoordinator sttsCoordinator = new SendTabToSelfCoordinator( +- mActivity, mWindowAndroid, mUrl, mShareParams.getTitle(), +- mBottomSheetController, mProfile, mDeviceLockActivityLauncher); +- sttsCoordinator.show(); +- }) +- .build(); +- } +- + private FirstPartyOption createPrintingFirstPartyOption() { + return new FirstPartyOptionBuilder(ContentType.LINK_PAGE_VISIBLE) + .setIcon(R.drawable.sharing_print, R.string.print_share_activity_title) +-- +2.34.1 + diff --git a/build/e_patches_list.txt b/build/e_patches_list.txt index 037d4722..8f538b6b 100644 --- a/build/e_patches_list.txt +++ b/build/e_patches_list.txt @@ -56,3 +56,5 @@ 0002-Browser-Remove-some-preferences-from-UI.patch 0003-Browser-fix-adblock-rebranding.patch 0004-Browser-Avoid-using-cached-legacy-pref-value-for-tab.patch + +0001-Browser-Remove-send-to-devices-option.patch -- GitLab From c9fdcd75ebae8aa6699eef015eb1bffe77cbb4a0 Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 20 Oct 2023 19:04:30 +0530 Subject: [PATCH 02/15] Browser: enable webrtc by default --- ...001-Browser-Enable-webRTC-by-default.patch | 64 +++++++++++++++++++ build/e_patches_list.txt | 1 + 2 files changed, 65 insertions(+) create mode 100644 build/e_patches/0001-Browser-Enable-webRTC-by-default.patch diff --git a/build/e_patches/0001-Browser-Enable-webRTC-by-default.patch b/build/e_patches/0001-Browser-Enable-webRTC-by-default.patch new file mode 100644 index 00000000..ed215c48 --- /dev/null +++ b/build/e_patches/0001-Browser-Enable-webRTC-by-default.patch @@ -0,0 +1,64 @@ +From 0aa009541f303d6238c0c6be0e5c3b54e12886ca Mon Sep 17 00:00:00 2001 +From: althafvly +Date: Fri, 20 Oct 2023 18:49:36 +0530 +Subject: [PATCH] Browser: Enable webRTC by default + +--- + .../core/browser/bromite_content_settings/webrtc.inc | 2 +- + .../peerconnection/peer_connection_dependency_factory.cc | 2 +- + .../blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc | 2 +- + .../blink/renderer/modules/peerconnection/rtc_rtp_sender.cc | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/components/content_settings/core/browser/bromite_content_settings/webrtc.inc b/components/content_settings/core/browser/bromite_content_settings/webrtc.inc +index 69b2de0ff52fa..c4ce181e6c88c 100644 +--- a/components/content_settings/core/browser/bromite_content_settings/webrtc.inc ++++ b/components/content_settings/core/browser/bromite_content_settings/webrtc.inc +@@ -1,4 +1,4 @@ +- Register(ContentSettingsType::WEBRTC, "webrtc", CONTENT_SETTING_BLOCK, ++ Register(ContentSettingsType::WEBRTC, "webrtc", CONTENT_SETTING_ALLOW, + WebsiteSettingsInfo::SYNCABLE, + /*allowlisted_schemes=*/{}, + /*valid_settings=*/{CONTENT_SETTING_ALLOW, +diff --git a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc +index 12ea285049273..3bbbbeae32fd5 100644 +--- a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc ++++ b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc +@@ -743,7 +743,7 @@ PeerConnectionDependencyFactory::CreatePortAllocator( + WebRTCIPHandlingPolicy policy = + GetWebRTCIPHandlingPolicy(webrtc_ip_handling_policy); + blink::WebContentSettingsClient* settings = web_frame->GetContentSettingsClient(); +- if (settings && settings->AllowContentSetting(ContentSettingsType::WEBRTC, false)) { ++ if (settings && settings->AllowContentSetting(ContentSettingsType::WEBRTC, true)) { + policy = kDefault; + } + +diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc +index 280210171d68c..f0b38991069a6 100644 +--- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc ++++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc +@@ -261,7 +261,7 @@ RTCRtpCapabilities* RTCRtpReceiver::getCapabilities(ScriptState* state, + auto* web_frame = + static_cast(WebFrame::FromCoreFrame(window->GetFrame())); + blink::WebContentSettingsClient* settings = web_frame->GetContentSettingsClient(); +- if (settings && !settings->AllowContentSetting(ContentSettingsType::WEBRTC, false)) { ++ if (settings && !settings->AllowContentSetting(ContentSettingsType::WEBRTC, true)) { + return nullptr; + } + +diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc +index 6beddc4471207..5f6e70e91b318 100644 +--- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc ++++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc +@@ -956,7 +956,7 @@ RTCRtpCapabilities* RTCRtpSender::getCapabilities(ScriptState* state, + auto* web_frame = + static_cast(WebFrame::FromCoreFrame(window->GetFrame())); + blink::WebContentSettingsClient* settings = web_frame->GetContentSettingsClient(); +- if (settings && !settings->AllowContentSetting(ContentSettingsType::WEBRTC, false)) { ++ if (settings && !settings->AllowContentSetting(ContentSettingsType::WEBRTC, true)) { + return nullptr; + } + +-- +2.34.1 + diff --git a/build/e_patches_list.txt b/build/e_patches_list.txt index 8f538b6b..f783dd09 100644 --- a/build/e_patches_list.txt +++ b/build/e_patches_list.txt @@ -58,3 +58,4 @@ 0004-Browser-Avoid-using-cached-legacy-pref-value-for-tab.patch 0001-Browser-Remove-send-to-devices-option.patch +0001-Browser-Enable-webRTC-by-default.patch -- GitLab From ad0086dca32d179b8fd89ede5d3f347834b48d3e Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 20 Oct 2023 22:12:54 +0530 Subject: [PATCH 03/15] Browser: enable custom tabs properly --- ...rowser-Enable-custom-tabs-by-default.patch | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/build/e_patches/0006-Browser-Enable-custom-tabs-by-default.patch b/build/e_patches/0006-Browser-Enable-custom-tabs-by-default.patch index 00a60e7a..feaf1cfd 100644 --- a/build/e_patches/0006-Browser-Enable-custom-tabs-by-default.patch +++ b/build/e_patches/0006-Browser-Enable-custom-tabs-by-default.patch @@ -1,12 +1,13 @@ -From c5a19aeac5f3669d94192b22240929297c397b50 Mon Sep 17 00:00:00 2001 -From: Aayush Gupta +From 6d2690c354705021a4bdf3436cf9151a78d5b44f Mon Sep 17 00:00:00 2001 +From: althafvly Date: Mon, 29 Nov 2021 03:37:37 +0000 Subject: [PATCH 06/35] Browser: Enable custom tabs by default Signed-off-by: Aayush Gupta --- - chrome/android/java/res/xml/privacy_preferences.xml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + chrome/android/java/res/xml/privacy_preferences.xml | 2 +- + .../src/org/chromium/chrome/browser/LaunchIntentDispatcher.java | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml index df5221fd95327..16b037f14068c 100644 @@ -21,6 +22,19 @@ index df5221fd95327..16b037f14068c 100644 Date: Fri, 20 Oct 2023 22:14:21 +0530 Subject: [PATCH 04/15] Browser: Fix browser info icon crash --- .../0001-Browser-fix-help-icon-crash.patch | 43 +++++++++++++++++++ ...-Redirect-users-to-e-foundation-docs.patch | 18 +++++++- build/e_patches_list.txt | 1 + 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 build/e_patches/0001-Browser-fix-help-icon-crash.patch diff --git a/build/e_patches/0001-Browser-fix-help-icon-crash.patch b/build/e_patches/0001-Browser-fix-help-icon-crash.patch new file mode 100644 index 00000000..4a83481e --- /dev/null +++ b/build/e_patches/0001-Browser-fix-help-icon-crash.patch @@ -0,0 +1,43 @@ +From 8b0670ebd9c51730c95b1236e1a41a76f62a0fbd Mon Sep 17 00:00:00 2001 +From: althafvly +Date: Fri, 20 Oct 2023 21:49:42 +0530 +Subject: [PATCH] Browser: fix help icon crash + +--- + .../chrome/browser/feedback/FeedbackCollector.java | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/FeedbackCollector.java b/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/FeedbackCollector.java +index cea9d24efc3ec..0d0d94bbd0cac 100644 +--- a/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/FeedbackCollector.java ++++ b/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/FeedbackCollector.java +@@ -28,6 +28,7 @@ import org.chromium.components.signin.identitymanager.ConsentLevel; + import org.chromium.components.signin.identitymanager.IdentityManager; + + import java.util.HashMap; ++import java.util.ArrayList; + import java.util.List; + import java.util.Map; + +@@ -66,14 +67,14 @@ public abstract class FeedbackCollector implements Runnable { + Profile profile) { + // 1. Build all synchronous and asynchronous sources and determine the currently signed in + // account. +- mSynchronousSources = buildSynchronousFeedbackSources(activity, initParams); +- mAsynchronousSources = buildAsynchronousFeedbackSources(initParams); +- IdentityManager identityManager = ++ mSynchronousSources = new ArrayList<>(); ++ mAsynchronousSources = new ArrayList<>(); ++ /*IdentityManager identityManager = + IdentityServicesProvider.get().getIdentityManager(profile); + if (identityManager != null) { + mAccountInUse = CoreAccountInfo.getEmailFrom( + identityManager.getPrimaryAccountInfo(ConsentLevel.SIGNIN)); +- } ++ }*/ + + // Validation check in case a source is added to the wrong list. + for (FeedbackSource source : mSynchronousSources) { +-- +2.34.1 + diff --git a/build/e_patches/0009-Browser-Redirect-users-to-e-foundation-docs.patch b/build/e_patches/0009-Browser-Redirect-users-to-e-foundation-docs.patch index 52179731..b5ab75d4 100644 --- a/build/e_patches/0009-Browser-Redirect-users-to-e-foundation-docs.patch +++ b/build/e_patches/0009-Browser-Redirect-users-to-e-foundation-docs.patch @@ -1,4 +1,4 @@ -From 1b9edf64a5a93e7609b399f5aade235af7c27bf4 Mon Sep 17 00:00:00 2001 +From 9b808816831ea41d399e6454e279f09c81b5110e Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Tue, 11 May 2021 14:22:00 +0200 Subject: [PATCH 09/35] Browser: Redirect users to e foundation docs @@ -6,7 +6,8 @@ Subject: [PATCH 09/35] Browser: Redirect users to e foundation docs Signed-off-by: Aayush Gupta --- .../chrome/browser/feedback/HelpAndFeedbackLauncherImpl.java | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + .../browser/feedback/HelpAndFeedbackLauncherDelegate.java | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherImpl.java index cf2e3ae9ed8f2..aa7706f656002 100644 @@ -21,6 +22,19 @@ index cf2e3ae9ed8f2..aa7706f656002 100644 private static ProfileKeyedMap sProfileToLauncherMap; private final HelpAndFeedbackLauncherDelegate mDelegate; +diff --git a/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherDelegate.java b/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherDelegate.java +index 663e657e8ba94..d197e35985b3d 100644 +--- a/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherDelegate.java ++++ b/chrome/browser/feedback/android/java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherDelegate.java +@@ -16,7 +16,7 @@ import androidx.annotation.NonNull; + * Delegate that handles the display of the HelpAndFeedback flows. + */ + public interface HelpAndFeedbackLauncherDelegate { +- static final String FALLBACK_SUPPORT_URL = "https://support.google.com/chrome/topic/6069782"; ++ static final String FALLBACK_SUPPORT_URL = "https://doc.e.foundation/how-tos/"; + + /** + * Starts an activity showing a help page for the specified context ID. -- 2.34.1 diff --git a/build/e_patches_list.txt b/build/e_patches_list.txt index f783dd09..d176cfe3 100644 --- a/build/e_patches_list.txt +++ b/build/e_patches_list.txt @@ -59,3 +59,4 @@ 0001-Browser-Remove-send-to-devices-option.patch 0001-Browser-Enable-webRTC-by-default.patch +0001-Browser-fix-help-icon-crash.patch -- GitLab From a167efa84fa39849537655d0c60c7b94eed2d526 Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 20 Oct 2023 22:16:33 +0530 Subject: [PATCH 05/15] Browser: Fix bookmark crash --- .../Enable-ImprovedBookmarks-by-default.patch | 113 ++++++++++++++++++ build/bromite_patches_list.txt | 1 + 2 files changed, 114 insertions(+) create mode 100644 build/bromite_patches/Enable-ImprovedBookmarks-by-default.patch diff --git a/build/bromite_patches/Enable-ImprovedBookmarks-by-default.patch b/build/bromite_patches/Enable-ImprovedBookmarks-by-default.patch new file mode 100644 index 00000000..3e068a90 --- /dev/null +++ b/build/bromite_patches/Enable-ImprovedBookmarks-by-default.patch @@ -0,0 +1,113 @@ +From: uazo +Date: Tue, 12 Sep 2023 12:39:23 +0000 +Subject: Enable ImprovedBookmarks by default + +License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html +--- + chrome/android/java/res/layout/bookmark_search_box_row.xml | 6 +++--- + .../chromium/chrome/browser/bookmarks/BookmarkFeatures.java | 2 +- + .../browser/bookmarks/BookmarkSearchBoxRowViewBinder.java | 2 ++ + .../chromium/chrome/browser/bookmarks/BookmarkUiPrefs.java | 2 +- + .../chromium/chrome/browser/bookmarks/BookmarkUtils.java | 3 ++- + chrome/browser/flags/android/chrome_feature_list.cc | 2 +- + 6 files changed, 10 insertions(+), 7 deletions(-) + +diff --git a/chrome/android/java/res/layout/bookmark_search_box_row.xml b/chrome/android/java/res/layout/bookmark_search_box_row.xml +--- a/chrome/android/java/res/layout/bookmark_search_box_row.xml ++++ b/chrome/android/java/res/layout/bookmark_search_box_row.xml +@@ -31,9 +31,9 @@ found in the LICENSE file. + android:textAppearance="@style/TextAppearance.TextLarge.Primary" /> + + + + + +- +\ No newline at end of file ++ +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFeatures.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFeatures.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFeatures.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkFeatures.java +@@ -14,7 +14,7 @@ import org.chromium.chrome.browser.flags.MutableFlagWithSafeDefault; + */ + public class BookmarkFeatures { + private static final MutableFlagWithSafeDefault sAndroidImprovedBookmarksFlag = +- new MutableFlagWithSafeDefault(ChromeFeatureList.ANDROID_IMPROVED_BOOKMARKS, false); ++ new MutableFlagWithSafeDefault(ChromeFeatureList.ANDROID_IMPROVED_BOOKMARKS, true); + + /** Returns whether an additional "add bookmark" item should be in the overflow menu. */ + public static boolean isBookmarkMenuItemAsDedicatedRowEnabled() { +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSearchBoxRowViewBinder.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSearchBoxRowViewBinder.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSearchBoxRowViewBinder.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSearchBoxRowViewBinder.java +@@ -5,6 +5,7 @@ + package org.chromium.chrome.browser.bookmarks; + + import android.view.View; ++import android.view.ViewGroup; + + import androidx.annotation.DrawableRes; + import androidx.annotation.StringRes; +@@ -20,6 +21,7 @@ class BookmarkSearchBoxRowViewBinder { + static void bind(PropertyModel model, View view, PropertyKey key) { + BookmarkSearchBoxRow row = (BookmarkSearchBoxRow) view; + ChipView shoppingChip = view.findViewById(R.id.shopping_filter_chip); ++ shoppingChip.setVisibility(ViewGroup.GONE); + if (key == BookmarkSearchBoxRowProperties.QUERY_CALLBACK) { + row.setQueryCallback(model.get(BookmarkSearchBoxRowProperties.QUERY_CALLBACK)); + } else if (key == BookmarkSearchBoxRowProperties.SHOPPING_CHIP_VISIBILITY) { +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUiPrefs.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUiPrefs.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUiPrefs.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUiPrefs.java +@@ -18,7 +18,7 @@ import java.lang.annotation.RetentionPolicy; + */ + public class BookmarkUiPrefs { + private static final @BookmarkRowDisplayPref int INITIAL_BOOKMARK_ROW_DISPLAY_PREF = +- BookmarkRowDisplayPref.VISUAL; ++ BookmarkRowDisplayPref.COMPACT; + private static final @BookmarkRowSortOrder int INITIAL_BOOKMARK_ROW_SORT_ORDER = + BookmarkRowSortOrder.REVERSE_CHRONOLOGICAL; + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java +@@ -38,6 +38,7 @@ import org.chromium.chrome.browser.app.bookmarks.BookmarkAddEditFolderActivity; + import org.chromium.chrome.browser.app.bookmarks.BookmarkEditActivity; + import org.chromium.chrome.browser.app.bookmarks.BookmarkFolderPickerActivity; + import org.chromium.chrome.browser.app.bookmarks.BookmarkFolderSelectActivity; ++import org.chromium.chrome.browser.bookmarks.BookmarkFeatures; + import org.chromium.chrome.browser.bookmarks.BookmarkUiPrefs.BookmarkRowDisplayPref; + import org.chromium.chrome.browser.commerce.ShoppingServiceFactory; + import org.chromium.chrome.browser.document.ChromeLauncherActivity; +@@ -405,7 +406,7 @@ public class BookmarkUtils { + RecordUserAction.record("MobileBookmarkManagerReopenBookmarksInSameSession"); + } + +- if (DeviceFormFactor.isNonMultiDisplayContextOnTablet(context)) { ++ if (BookmarkFeatures.isAndroidImprovedBookmarksEnabled() || DeviceFormFactor.isNonMultiDisplayContextOnTablet(context)) { + showBookmarkManagerOnTablet(context, + activity == null ? null : activity.getComponentName(), url, isIncognito); + } else { +diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc +--- a/chrome/browser/flags/android/chrome_feature_list.cc ++++ b/chrome/browser/flags/android/chrome_feature_list.cc +@@ -495,7 +495,7 @@ BASE_FEATURE(kAndroidSearchEngineChoiceNotification, + + BASE_FEATURE(kAndroidImprovedBookmarks, + "AndroidImprovedBookmarks", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + + BASE_FEATURE(kAnimatedImageDragShadow, + "AnimatedImageDragShadow", +-- +2.25.1 diff --git a/build/bromite_patches_list.txt b/build/bromite_patches_list.txt index e3595216..1884dff3 100644 --- a/build/bromite_patches_list.txt +++ b/build/bromite_patches_list.txt @@ -190,3 +190,4 @@ Enable-PermuteTLSExtensions-by-default.patch Enable-third-party-storage-partitioning.patch Restore-adaptive-button-in-top-toolbar-customization.patch bromite-build-utils.patch +Enable-ImprovedBookmarks-by-default.patch -- GitLab From d324828b956053cf6b935e34b09090e8926dd91f Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 20 Oct 2023 23:03:38 +0530 Subject: [PATCH 06/15] Browser: Move to cromite autoplay commit --- .../Add-autoplay-site-setting.patch} | 16 +++------------- build/bromite_patches_list.txt | 1 + build/e_patches_list.txt | 1 - 3 files changed, 4 insertions(+), 14 deletions(-) rename build/{e_patches/0003-Add-autoplay-site-setting.patch => bromite_patches/Add-autoplay-site-setting.patch} (97%) diff --git a/build/e_patches/0003-Add-autoplay-site-setting.patch b/build/bromite_patches/Add-autoplay-site-setting.patch similarity index 97% rename from build/e_patches/0003-Add-autoplay-site-setting.patch rename to build/bromite_patches/Add-autoplay-site-setting.patch index c5811996..a242e6d3 100644 --- a/build/e_patches/0003-Add-autoplay-site-setting.patch +++ b/build/bromite_patches/Add-autoplay-site-setting.patch @@ -1,13 +1,10 @@ -From b2bb3220b21a9cff8f15a278da5f27b38fc18313 Mon Sep 17 00:00:00 2001 From: uazo Date: Sat, 7 Nov 2020 21:59:18 +0000 -Subject: [PATCH 03/17] Add autoplay site setting +Subject: Add autoplay site setting Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html Require: Content-settings-infrastructure.patch - -Change-Id: I0800ab1fc452d0a57932b7e0653a353c3fdf464c --- .../res/drawable-hdpi/settings_autoplay.png | Bin 0 -> 456 bytes .../res/drawable-mdpi/settings_autoplay.png | Bin 0 -> 296 bytes @@ -140,7 +137,6 @@ HcmV?d00001 diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteAutoplayContentSetting.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteAutoplayContentSetting.java new file mode 100644 -index 0000000000000..e80c419f231a7 --- /dev/null +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteAutoplayContentSetting.java @@ -0,0 +1,92 @@ @@ -238,7 +234,6 @@ index 0000000000000..e80c419f231a7 +} diff --git a/components/browser_ui/strings/bromite_content_settings/autoplay.grdp b/components/browser_ui/strings/bromite_content_settings/autoplay.grdp new file mode 100644 -index 0000000000000..03a149f683fb9 --- /dev/null +++ b/components/browser_ui/strings/bromite_content_settings/autoplay.grdp @@ -0,0 +1,21 @@ @@ -265,7 +260,6 @@ index 0000000000000..03a149f683fb9 + diff --git a/components/content_settings/core/browser/bromite_content_settings/autoplay.inc b/components/content_settings/core/browser/bromite_content_settings/autoplay.inc new file mode 100644 -index 0000000000000..8d7a0eb1a4c5c --- /dev/null +++ b/components/content_settings/core/browser/bromite_content_settings/autoplay.inc @@ -0,0 +1,12 @@ @@ -282,7 +276,6 @@ index 0000000000000..8d7a0eb1a4c5c + .set_blocked_exceptions_ui(IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY_BLOCKED_EXCEPTIONS) + .set_mid_sentence_ui(IDS_AUTOPLAY_PERMISSION_TITLE); diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc -index c2e63e4c40fba..5b2ba6f26d785 100644 --- a/components/content_settings/core/browser/content_settings_registry.cc +++ b/components/content_settings/core/browser/content_settings_registry.cc @@ -246,7 +246,7 @@ void ContentSettingsRegistry::Init() { @@ -295,7 +288,6 @@ index c2e63e4c40fba..5b2ba6f26d785 100644 /*valid_settings=*/{CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK}, WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE, diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.cc b/third_party/blink/renderer/core/html/media/autoplay_policy.cc -index 3a7a3d92f074c..ad6d08e8a59cf 100644 --- a/third_party/blink/renderer/core/html/media/autoplay_policy.cc +++ b/third_party/blink/renderer/core/html/media/autoplay_policy.cc @@ -8,6 +8,7 @@ @@ -334,7 +326,6 @@ index 3a7a3d92f074c..ad6d08e8a59cf 100644 if (!element_->GetExecutionContext() || element_->GetExecutionContext()->IsSandboxed( diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.h b/third_party/blink/renderer/core/html/media/autoplay_policy.h -index 408935f82be91..62b9ac59a14b7 100644 --- a/third_party/blink/renderer/core/html/media/autoplay_policy.h +++ b/third_party/blink/renderer/core/html/media/autoplay_policy.h @@ -133,6 +133,10 @@ class CORE_EXPORT AutoplayPolicy final @@ -348,6 +339,5 @@ index 408935f82be91..62b9ac59a14b7 100644 bool IsAutoplayingMutedInternal(bool muted) const; bool IsOrWillBeAutoplayingMutedInternal(bool muted) const; --- -2.34.1 - +-- +2.25.1 diff --git a/build/bromite_patches_list.txt b/build/bromite_patches_list.txt index 1884dff3..c97db091 100644 --- a/build/bromite_patches_list.txt +++ b/build/bromite_patches_list.txt @@ -191,3 +191,4 @@ Enable-third-party-storage-partitioning.patch Restore-adaptive-button-in-top-toolbar-customization.patch bromite-build-utils.patch Enable-ImprovedBookmarks-by-default.patch +Add-autoplay-site-setting.patch diff --git a/build/e_patches_list.txt b/build/e_patches_list.txt index d176cfe3..1502252a 100644 --- a/build/e_patches_list.txt +++ b/build/e_patches_list.txt @@ -1,6 +1,5 @@ 0001-disable-browser-sign-in-feature-by-default.patch 0002-disable-contextual-search-by-default.patch -0003-Add-autoplay-site-setting.patch 0005-Disable-AGSA-by-default.patch 0006-Update-i18n-zh_CN-support.patch 0007-Remove-mremap-from-seccomp-baseline-policy.patch -- GitLab From ebb639228f37dd19a6614f579bf2d1703fa0c13f Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 20 Oct 2023 23:05:07 +0530 Subject: [PATCH 07/15] Browser: Build arm/x86 trichrome --- build.sh | 23 +++++-------- ...romium-Add-32-bit-chrome-app-support.patch | 33 ------------------- build/e_patches_list.txt | 1 - 3 files changed, 8 insertions(+), 49 deletions(-) delete mode 100644 build/e_patches/0002-chromium-Add-32-bit-chrome-app-support.patch diff --git a/build.sh b/build.sh index 8b890448..090cfff8 100755 --- a/build.sh +++ b/build.sh @@ -29,7 +29,8 @@ usage() { build() { echo ">> [$(date)] Head commit: $(git show -s --format=%s)" - apks="ChromePublic SystemWebView TrichromeChrome32 TrichromeLibrary32 TrichromeWebView32 TrichromeChrome6432 TrichromeLibrary6432 TrichromeWebView6432 MonochromePublic" + apks="ChromePublic SystemWebView TrichromeChrome TrichromeLibrary TrichromeWebView TrichromeChrome6432 \ + TrichromeLibrary6432 TrichromeWebView6432 MonochromePublic" build_args="$(cat "${root_dir}"/build/browser.gn_args) target_cpu=\"${1}\" " apk_arch=${1} @@ -57,26 +58,18 @@ build() { gn gen "out/$1" --args="$build_args" build_targets="chrome_public_apk system_webview_apk monochrome_public_apk" if [ $1 '==' "x64" ] || [ $1 '==' "arm64" ]; then - build_targets="$build_targets trichrome_webview_32_apk trichrome_chrome_32_apk trichrome_library_32_apk \ - trichrome_webview_64_32_apk trichrome_chrome_64_32_apk trichrome_library_64_32_apk" + build_targets="$build_targets trichrome_webview_64_32_apk trichrome_chrome_64_32_apk trichrome_library_64_32_apk" + else + build_targets="$build_targets trichrome_webview_apk trichrome_chrome_apk trichrome_library_apk" fi + ninja -C out/$1 $build_targets for apk in $apks; do if [ -f "out/${1}/apks/$apk.apk" ]; then echo ">> [$(date)] Moving $apk for ${apk_arch} to output folder" - if [[ "$apk.apk" == *Public.apk ]] || [[ "$apk.apk" == SystemWebView.apk ]] || [[ "$apk.apk" == *6432.apk ]]; then - mkdir -p "${root_dir}/apks/${apk_arch}" - mv "out/${1}/apks/$apk.apk" "${root_dir}/apks/${apk_arch}/$(echo "$apk" | sed 's/[0-9]*//g').apk" - else - if [ "$1" = "x64" ]; then - mkdir -p "${root_dir}/apks/x86" - mv "out/${1}/apks/$apk.apk" "${root_dir}/apks/x86/$(echo "$apk" | sed 's/[0-9]*//g').apk" - elif [ "$1" = "arm64" ]; then - mkdir -p "${root_dir}/apks/arm" - mv "out/${1}/apks/$apk.apk" "${root_dir}/apks/arm/$(echo "$apk" | sed 's/[0-9]*//g').apk" - fi - fi + mkdir -p "${root_dir}/apks/${apk_arch}" + mv "out/${1}/apks/$apk.apk" "${root_dir}/apks/${apk_arch}/$(echo "$apk" | sed 's/[0-9]*//g').apk" fi done } diff --git a/build/e_patches/0002-chromium-Add-32-bit-chrome-app-support.patch b/build/e_patches/0002-chromium-Add-32-bit-chrome-app-support.patch deleted file mode 100644 index c6ca0165..00000000 --- a/build/e_patches/0002-chromium-Add-32-bit-chrome-app-support.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 5066e7cc4f90d39d5fc83629f4842832b59dd540 Mon Sep 17 00:00:00 2001 -From: TheScarastic -Date: Fri, 2 Dec 2022 10:10:43 +0000 -Subject: [PATCH 02/34] chromium: Add 32 bit chrome app support - -Signed-off-by: althafvly ---- - chrome/android/BUILD.gn | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn -index fb0512ba96ae8..c34e2cce882f6 100644 ---- a/chrome/android/BUILD.gn -+++ b/chrome/android/BUILD.gn -@@ -2707,6 +2707,15 @@ if (current_toolchain == default_toolchain) { - is_64_bit_browser = true - include_32_bit_webview = false - } -+ -+ chrome_public_apk_or_module_tmpl("trichrome_chrome_32_apk") { -+ apk_name = "TrichromeChrome32" -+ is_trichrome = true -+ target_type = "android_apk" -+ static_library_provider = ":trichrome_library_32_apk" -+ is_64_bit_browser = false -+ include_32_bit_webview = true -+ } - } - - # As compared to chrome_public_test_apk, this target contains only unit tests --- -2.34.1 - diff --git a/build/e_patches_list.txt b/build/e_patches_list.txt index 1502252a..54ff8daa 100644 --- a/build/e_patches_list.txt +++ b/build/e_patches_list.txt @@ -15,7 +15,6 @@ 0017-Automated-domain-substitution.patch 0001-add-trichrome-browser-apk-targets.patch -0002-chromium-Add-32-bit-chrome-app-support.patch 0002-Browser-Change-app-and-package-name-to-browser.patch 0003-Browser-Point-to-our-default-popular-sites.patch 0004-Browser-Enable-do-not-track-by-default.patch -- GitLab From 455c4943e73a50b88f114373dea3c0a9c04f63c7 Mon Sep 17 00:00:00 2001 From: althafvly Date: Tue, 24 Oct 2023 12:29:55 +0530 Subject: [PATCH 08/15] Browser: cleanup apks folder also --- build.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 090cfff8..c5cb0bbd 100755 --- a/build.sh +++ b/build.sh @@ -48,8 +48,13 @@ build() { build_args+=' android_default_version_name="'$chromium_version'"' build_args+=' android_default_version_code="'$code'"' - if [ $clean -eq 1 ] && [ -d "out/$1" ]; then - rm -rf "out/$1" + if [ $clean -eq 1 ]; then + if [ -d "out/$1" ]; then + rm -rf "out/$1" + fi + if [ -d "${root_dir}/apks/${apk_arch}" ]; then + rm -rf "${root_dir}/apks/${apk_arch}" + fi fi build_args+=' cc_wrapper="ccache"' -- GitLab From 542fb340ea8e5d10e47e4bc103f6ea7ff50dcc39 Mon Sep 17 00:00:00 2001 From: althafvly Date: Tue, 24 Oct 2023 14:41:50 +0530 Subject: [PATCH 09/15] Browser: Enable webGL by default --- ...0001-Browser-Enable-webgl-by-default.patch | 38 +++ .../0030-Revert-Add-webGL-site-setting.patch | 291 ------------------ build/e_patches_list.txt | 2 +- 3 files changed, 39 insertions(+), 292 deletions(-) create mode 100644 build/e_patches/0001-Browser-Enable-webgl-by-default.patch delete mode 100644 build/e_patches/0030-Revert-Add-webGL-site-setting.patch diff --git a/build/e_patches/0001-Browser-Enable-webgl-by-default.patch b/build/e_patches/0001-Browser-Enable-webgl-by-default.patch new file mode 100644 index 00000000..430ffd19 --- /dev/null +++ b/build/e_patches/0001-Browser-Enable-webgl-by-default.patch @@ -0,0 +1,38 @@ +From 1a021fdb9f112dafddedac59dfe755dadf641afe Mon Sep 17 00:00:00 2001 +From: althafvly +Date: Tue, 24 Oct 2023 14:39:06 +0530 +Subject: [PATCH] Browser: Enable webgl by default + +--- + .../core/browser/bromite_content_settings/webgl.inc | 2 +- + .../renderer/core/execution_context/execution_context.cc | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/components/content_settings/core/browser/bromite_content_settings/webgl.inc b/components/content_settings/core/browser/bromite_content_settings/webgl.inc +index 3ff01832baef4..dd88ffeab7bbb 100644 +--- a/components/content_settings/core/browser/bromite_content_settings/webgl.inc ++++ b/components/content_settings/core/browser/bromite_content_settings/webgl.inc +@@ -1,4 +1,4 @@ +- Register(ContentSettingsType::WEBGL, "webgl", CONTENT_SETTING_BLOCK, ++ Register(ContentSettingsType::WEBGL, "webgl", CONTENT_SETTING_ALLOW, + WebsiteSettingsInfo::SYNCABLE, + /*allowlisted_schemes=*/{}, + /*valid_settings=*/{CONTENT_SETTING_ALLOW, +diff --git a/third_party/blink/renderer/core/execution_context/execution_context.cc b/third_party/blink/renderer/core/execution_context/execution_context.cc +index 1bc4805ab9da9..e021859af960d 100644 +--- a/third_party/blink/renderer/core/execution_context/execution_context.cc ++++ b/third_party/blink/renderer/core/execution_context/execution_context.cc +@@ -87,8 +87,8 @@ blink::WebContentSettingsClient* GetContentSettingsClientFor( + bool AllowWebgl(ExecutionContext* context) { + blink::WebContentSettingsClient* settings = GetContentSettingsClientFor(context); + if (settings) +- return settings->AllowContentSetting(ContentSettingsType::WEBGL, false); +- return false; ++ return settings->AllowContentSetting(ContentSettingsType::WEBGL, true); ++ return true; + } + + ExecutionContext::ExecutionContext(v8::Isolate* isolate, +-- +2.34.1 + diff --git a/build/e_patches/0030-Revert-Add-webGL-site-setting.patch b/build/e_patches/0030-Revert-Add-webGL-site-setting.patch deleted file mode 100644 index d035b17f..00000000 --- a/build/e_patches/0030-Revert-Add-webGL-site-setting.patch +++ /dev/null @@ -1,291 +0,0 @@ -From 71dbcf8989c5228d9078676c75c77186de48c935 Mon Sep 17 00:00:00 2001 -From: althafvly -Date: Tue, 19 Sep 2023 13:34:49 +0530 -Subject: [PATCH 30/35] Revert "Add webGL site setting" - -This reverts commit 94d605389f12260a10d1d270491907c8788b3bd2. ---- - .../impl/BromiteWebGLContentSetting.java | 92 ------------------- - .../bromite_content_settings/webgl.grdp | 27 ------ - .../bromite_content_settings/webgl.inc | 22 ----- - .../common/bromite_content_settings/WEBGL.inc | 1 - - .../execution_context/execution_context.cc | 7 -- - .../execution_context/execution_context.h | 2 - - .../webgl/webgl_rendering_context_base.cc | 32 ++++--- - .../webgl/webgl_rendering_context_base.h | 2 - - 8 files changed, 19 insertions(+), 166 deletions(-) - delete mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebGLContentSetting.java - delete mode 100644 components/browser_ui/strings/bromite_content_settings/webgl.grdp - delete mode 100644 components/content_settings/core/browser/bromite_content_settings/webgl.inc - delete mode 100644 components/content_settings/core/common/bromite_content_settings/WEBGL.inc - -diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebGLContentSetting.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebGLContentSetting.java -deleted file mode 100644 -index f7bb6433b714d..0000000000000 ---- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebGLContentSetting.java -+++ /dev/null -@@ -1,92 +0,0 @@ --/* -- This file is part of Bromite. -- -- Bromite is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- Bromite is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with Bromite. If not, see . --*/ -- --package org.chromium.components.browser_ui.site_settings.impl; -- --import org.chromium.components.browser_ui.site_settings.R; -- --import org.chromium.components.browser_ui.site_settings.BromiteCustomContentSetting; --import org.chromium.components.browser_ui.site_settings.ContentSettingsResources; --import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory; --import org.chromium.components.content_settings.ContentSettingValues; --import org.chromium.components.content_settings.ContentSettingsType; --import org.chromium.content_public.browser.BrowserContextHandle; -- --import androidx.annotation.Nullable; --import androidx.preference.Preference; --import androidx.preference.PreferenceScreen; -- --import java.util.ArrayList; -- --public class BromiteWebGLContentSetting extends BromiteCustomContentSetting { -- public BromiteWebGLContentSetting() { -- super(/*contentSettingsType*/ ContentSettingsType.WEBGL, -- /*defaultEnabledValue*/ ContentSettingValues.ALLOW, -- /*defaultDisabledValue*/ ContentSettingValues.BLOCK, -- /*allowException*/ true, -- /*preferenceKey*/ "webgl", -- /*profilePrefKey*/ "webgl"); -- } -- -- @Override -- public ContentSettingsResources.ResourceItem getResourceItem() { -- return new ContentSettingsResources.ResourceItem( -- /*icon*/ R.drawable.web_asset, -- /*title*/ R.string.webgl_permission_title, -- /*defaultEnabledValue*/ getDefaultEnabledValue(), -- /*defaultDisabledValue*/ getDefaultDisabledValue(), -- /*enabledSummary*/ R.string.website_settings_category_webgl_enabled, -- /*disabledSummary*/ R.string.website_settings_category_webgl_disabled); -- } -- -- @Override -- public int getCategorySummary(@Nullable @ContentSettingValues int value) { -- switch (value) { -- case ContentSettingValues.ALLOW: -- return R.string.website_settings_category_webgl_enabled; -- case ContentSettingValues.BLOCK: -- return R.string.website_settings_category_webgl_disabled; -- default: -- return 0; -- } -- } -- -- @Override -- public int getCategoryDescription() { -- return R.string.settings_site_settings_webgl_description; -- } -- -- @Override -- public boolean requiresTriStateContentSetting() { -- return false; -- } -- -- @Override -- public boolean showOnlyDescriptions() { -- return true; -- } -- -- @Override -- public int getAddExceptionDialogMessage() { -- return R.string.website_settings_category_webgl_enabled; -- } -- -- @Override -- public @Nullable Boolean considerException(SiteSettingsCategory category, @ContentSettingValues int value) { -- return value != ContentSettingValues.BLOCK; -- } --} -diff --git a/components/browser_ui/strings/bromite_content_settings/webgl.grdp b/components/browser_ui/strings/bromite_content_settings/webgl.grdp -deleted file mode 100644 -index 53635991ed294..0000000000000 ---- a/components/browser_ui/strings/bromite_content_settings/webgl.grdp -+++ /dev/null -@@ -1,27 +0,0 @@ -- -- -- -- Webgl -- -- -- Enable Webgl, a JavaScript API for rendering high-performance interactive 3D and 2D graphics -- -- -- webgl -- -- -- Webgl -- -- -- Enabled -- -- -- Disabled -- -- -- Allowed to use webgl -- -- -- Not allowed to use webgl -- -- -diff --git a/components/content_settings/core/browser/bromite_content_settings/webgl.inc b/components/content_settings/core/browser/bromite_content_settings/webgl.inc -deleted file mode 100644 -index 3ff01832baef4..0000000000000 ---- a/components/content_settings/core/browser/bromite_content_settings/webgl.inc -+++ /dev/null -@@ -1,22 +0,0 @@ -- Register(ContentSettingsType::WEBGL, "webgl", CONTENT_SETTING_BLOCK, -- WebsiteSettingsInfo::SYNCABLE, -- /*allowlisted_schemes=*/{}, -- /*valid_settings=*/{CONTENT_SETTING_ALLOW, -- CONTENT_SETTING_BLOCK}, -- WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE, -- WebsiteSettingsRegistry::ALL_PLATFORMS, -- ContentSettingsInfo::INHERIT_IN_INCOGNITO, -- ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS); -- -- content_settings::WebsiteSettingsRegistry::GetInstance() -- ->GetMutable(ContentSettingsType::WEBGL) -- ->set_show_into_info_page() -- .set_desktop_ui() -- .set_is_renderer_content_setting() -- .set_title_ui(IDS_SITE_SETTINGS_TYPE_WEBGL) -- .set_description_ui(IDS_SETTINGS_SITE_SETTINGS_WEBGL_DESCRIPTION) -- .set_allowed_ui(IDS_WEBSITE_SETTINGS_CATEGORY_WEBGL_ENABLED) -- .set_blocked_ui(IDS_WEBSITE_SETTINGS_CATEGORY_WEBGL_DISABLED) -- .set_allowed_exceptions_ui(IDS_SETTINGS_SITE_SETTINGS_WEBGL_ALLOWED_EXCEPTIONS) -- .set_blocked_exceptions_ui(IDS_SETTINGS_SITE_SETTINGS_WEBGL_BLOCKED_EXCEPTIONS) -- .set_mid_sentence_ui(IDS_SITE_SETTINGS_TYPE_WEBGL); -diff --git a/components/content_settings/core/common/bromite_content_settings/WEBGL.inc b/components/content_settings/core/common/bromite_content_settings/WEBGL.inc -deleted file mode 100644 -index 30dc2ff2d125f..0000000000000 ---- a/components/content_settings/core/common/bromite_content_settings/WEBGL.inc -+++ /dev/null -@@ -1 +0,0 @@ -- WEBGL, -diff --git a/third_party/blink/renderer/core/execution_context/execution_context.cc b/third_party/blink/renderer/core/execution_context/execution_context.cc -index 1bc4805ab9da9..d6208255ef5e8 100644 ---- a/third_party/blink/renderer/core/execution_context/execution_context.cc -+++ b/third_party/blink/renderer/core/execution_context/execution_context.cc -@@ -84,13 +84,6 @@ blink::WebContentSettingsClient* GetContentSettingsClientFor( - return settings; - } - --bool AllowWebgl(ExecutionContext* context) { -- blink::WebContentSettingsClient* settings = GetContentSettingsClientFor(context); -- if (settings) -- return settings->AllowContentSetting(ContentSettingsType::WEBGL, false); -- return false; --} -- - ExecutionContext::ExecutionContext(v8::Isolate* isolate, - Agent* agent, - bool is_window) -diff --git a/third_party/blink/renderer/core/execution_context/execution_context.h b/third_party/blink/renderer/core/execution_context/execution_context.h -index 180cda4e10fc4..580f56a58cf74 100644 ---- a/third_party/blink/renderer/core/execution_context/execution_context.h -+++ b/third_party/blink/renderer/core/execution_context/execution_context.h -@@ -116,8 +116,6 @@ enum ReasonForCallingCanExecuteScripts { - - enum ReferrerPolicySource { kPolicySourceHttpHeader, kPolicySourceMetaTag }; - --CORE_EXPORT bool AllowWebgl(ExecutionContext* context); -- - // An environment in which script can execute. This class exposes the common - // properties of script execution environments on the web (i.e, common between - // script executing in a window and script executing in a worker), such as: -diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc -index 8783d3560f727..74a289a88a953 100644 ---- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc -+++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc -@@ -248,13 +248,6 @@ void WebGLRenderingContextBase::InitializeWebGLContextLimits( - } - } - --bool WebGLRenderingContextBase::AllowWebglForHost(blink::CanvasRenderingContextHost* host) { -- if (!host) -- return false; -- blink::ExecutionContext* context = host->GetTopExecutionContext(); -- return blink::AllowWebgl(context); --} -- - unsigned WebGLRenderingContextBase::CurrentMaxGLContexts() { - base::AutoLock locker(WebGLContextLimitLock()); - DCHECK(webgl_context_limits_initialized_); -@@ -528,6 +521,25 @@ static String ExtractWebGLContextCreationError( - const Platform::GraphicsInfo& info) { - StringBuilder builder; - builder.Append("Could not create a WebGL context"); -+ FormatWebGLStatusString( -+ "VENDOR", -+ info.vendor_id ? String::Format("0x%04x", info.vendor_id) : "0xffff", -+ builder); -+ FormatWebGLStatusString( -+ "DEVICE", -+ info.device_id ? String::Format("0x%04x", info.device_id) : "0xffff", -+ builder); -+ FormatWebGLStatusString("GL_VENDOR", info.vendor_info, builder); -+ FormatWebGLStatusString("GL_RENDERER", info.renderer_info, builder); -+ FormatWebGLStatusString("GL_VERSION", info.driver_version, builder); -+ FormatWebGLStatusString("Sandboxed", info.sandboxed ? "yes" : "no", builder); -+ FormatWebGLStatusString("Optimus", info.optimus ? "yes" : "no", builder); -+ FormatWebGLStatusString("AMD switchable", info.amd_switchable ? "yes" : "no", -+ builder); -+ FormatWebGLStatusString( -+ "Reset notification strategy", -+ String::Format("0x%04x", info.reset_notification_strategy).Utf8().c_str(), -+ builder); - FormatWebGLStatusString("ErrorMessage", info.error_message.Utf8().c_str(), - builder); - builder.Append('.'); -@@ -587,12 +599,6 @@ WebGLRenderingContextBase::CreateWebGraphicsContext3DProvider( - const CanvasContextCreationAttributesCore& attributes, - Platform::ContextType context_type, - Platform::GraphicsInfo* graphics_info) { -- if (!AllowWebglForHost(host)) { -- host->HostDispatchEvent(WebGLContextEvent::Create( -- event_type_names::kWebglcontextcreationerror, -- "disabled by site settings policy.")); -- return nullptr; -- } - if ((context_type == Platform::kWebGL1ContextType && - !host->IsWebGL1Enabled()) || - (context_type == Platform::kWebGL2ContextType && -diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h -index 58a3066ac23a1..2261611fdd586 100644 ---- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h -+++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h -@@ -1936,8 +1936,6 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext, - DOMArrayBufferView* pixels, - int64_t offset); - -- static bool AllowWebglForHost(blink::CanvasRenderingContextHost* host); -- - // Record Canvas/OffscreenCanvas.RenderingContextDrawnTo at the first draw - // call. - void RecordUKMCanvasDrawnToAtFirstDrawCall(); --- -2.34.1 - diff --git a/build/e_patches_list.txt b/build/e_patches_list.txt index 54ff8daa..d48632a6 100644 --- a/build/e_patches_list.txt +++ b/build/e_patches_list.txt @@ -43,7 +43,6 @@ 0027-Browser-Replace-default-tab-favicon.patch 0028-Browser-Spoof-as-Pixel-4a-by-default.patch 0029-Revert-Guard-for-user-agent-reduction.patch -0030-Revert-Add-webGL-site-setting.patch 0031-Browser-Remove-broken-link-about-entries.patch 0032-Revert-Remove-navigator.connection-info.patch 0033-Browser-Disable-Android-native-autofill-by-default.patch @@ -58,3 +57,4 @@ 0001-Browser-Remove-send-to-devices-option.patch 0001-Browser-Enable-webRTC-by-default.patch 0001-Browser-fix-help-icon-crash.patch +0001-Browser-Enable-webgl-by-default.patch -- GitLab From c309d8fb335283578cb99698e4634d0802eb3d3f Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 20 Oct 2023 09:57:41 +0530 Subject: [PATCH 10/15] Browser: fetch chromium version faster --- build.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index c5cb0bbd..7fe3cd76 100755 --- a/build.sh +++ b/build.sh @@ -135,23 +135,29 @@ sync() { echo ">> [$(date)] Syncing chromium $chromium_version" cd $chromium_dir gclient_config + if [ -d "$chromium_dir/src" ]; then + cd $chromium_dir/src + git fetch origin refs/tags/$chromium_version + git reset --hard FETCH_HEAD + fi if [ $history -eq 1 ]; then - gclient sync -D --nohooks -R -r $chromium_version + gclient sync -D --nohooks -R else - gclient sync --no-history -D --nohooks -R -r $chromium_version + gclient sync --no-history -D --nohooks -R fi gclient runhooks patch } gclient_config() { + url=https://github.com/chromium/chromium.git + commit_hash=$(git ls-remote --refs $url refs/tags/$chromium_version | awk '{print $1}') cat < "$chromium_dir/.gclient" solutions = [{ - "url": "https://github.com/chromium/chromium", + "url": "$url@$commit_hash", "managed": False, "name": "src", "custom_deps": {}, - "custom_hooks": [], "custom_vars": {} }] -- GitLab From c300c904397ad649f7a518bd178e53f2a09d4c48 Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 20 Oct 2023 23:21:32 +0530 Subject: [PATCH 11/15] Browser: add script for signing --- platform.jks | Bin 0 -> 3052 bytes sign.sh | 38 ++++++++++++++++++++++++++++++++++++++ trichrome_patch.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 platform.jks create mode 100755 sign.sh create mode 100755 trichrome_patch.py diff --git a/platform.jks b/platform.jks new file mode 100644 index 0000000000000000000000000000000000000000..b778840542e79c048bcf570aa960243eeb9b9d53 GIT binary patch literal 3052 zcma);X*d)N_r_vnWO@5v|M%*--cRrQ;aulB_qp%$@pm000rrgv$c!YwQXy>8L<8a; zJCFsKPk`MA5nxfjBp@a1n?A&igHA|E>%O?B6Lk6v&iM0AKzsVvx>%5@2?u zHB#lD5ss7r@i;~}2N0R1jpIE^U8cR)G z(MbgFvXnR02BXGsAvGbk_JK!(9!_7{0_sox==H?I1jLl);M(UUVES*ylFi2`(%~f& z8}H{2BJ&aV6lg1(n)E^x@?z2wD~g}j^>C#iG2TQDb#j4S(y&M;$S#g!*MV8tQ5CHj zu*)3V3a5Iffoe&QuC?)G%5)v`{;**bXi4)*6Q%pF6m;|w-yeQx=~1jXM0Y)?CLt0+ z{>t@>4_{imi-H~SiW*dYpP`JMJMbG5jq4RDkslw79Hff5c@RKE{nmLd80U_UXbAPG*UvH{L_`oD5_{KKwox?RxwXP8u|5iAh|rR$V1JrH zy=?8q@O!HB7nUMeeTTnrKB2GeLa(KM>Q!^5t@QdTVl~ZZq`TDmQo7TzT9SYNT1j8i zUORKNOW6D1gCovs;N^5HMX3!RWxZv^TlPI56G7rdILp>_BtjCdIV+NW|44+$aXsLWyJ^qD+YS4xj1i zt1Xy*{!p#+ii;rQj`+8CZO2Q1yRujGou}}`p}pH`qy6<>VjqVkw5pgxuDdIepUUD9 zEPlI@_Vo=Fyp|PG|kbFf<{&>8MMzxklwcIlN_6i_OT=i@nplB$-njv5d(c zkzl_a#OC55S0e5<-G}6InS7s*$F_sK1`!IpmUsMa(Ex%ce#$?#l<1D%hmyKDzge1AgVL;6 z_f58fl0Z#T5`e7?ZbDs$R$$M(4ZqkCyWwI)y=!ZA-Ilh|`S`0!q`h4Jk$4n`` zj+#SerS8&FRso-Fxm9lROa)T=T=B#BsHAuBB$${fDZ|6j?d%Uc&%gmY?Oh^MV}JUXFQEWH>emAIeIZ5FabSAX2T@Mf?3rGQPaLj&E@;`NIR z-8!KTVnKZ|?*}s9X>I<78`pX!1)z15z`oUCgs*oY+oo^8O0)%+U%B$=T$rW7N=*L? zv_Q%z#F`hSgB1RQOEwe@=A zME3uJ>W7!*d@a6&99xa#jk%gIBJL5u$g3yRm7eSeK0R=8ENvUN{y1`ZlNtJbMU z2)D;wu{77DYdc#EYVrTn&^mHcP(~~yQRgy{cZ(xotA(dj>X|~aB9Pg^u|K_=A|E&t zzNznzJOwsWOK#n#?-Z>|YuOMpU+qZY&VF6UoWP)YTo=t;dUra@%YSXuOwiT4Z*-C$ zd;^mgS?v;)tgb%`+mPPuli@Uf@|UjiKt}oXk69nIgcLolG{&mLW~nXYcsk!Wv@o%o z>P#``v;UIjcGOP}zM*jnHvsp&`C3X+@1Ay@@K?$U(Yl?;YS~j-mc)qMbthN7U+$xd zMVN_U>hePuAhlsqr5qcK?;iEu>L@F0{^AfKgVGVgC9i&cS?0n8&~?pg4V8a7#F5Jq z;4FK0%EDs%QUaxvuYWsm^+H)Wf}BG#teA!-id-<9)a+DT6h63)jVRWnHSkB?Zh4b$ zefsZy$Q4w9{`5lQhe?6=vU@!gQ`7y{b7UZ%BcsZ!s4hPUrO}~5abBie3hs1|d{vx- zMz)RIil)Sw6&avd!Y#gNBVjq)Ir(KR+pho^k6JT_I?E=K>7xUr?le%h5`!mMryR&5%r19rA zA0=(agb&wE5MKR(+Orr`em$D&F%@YwB!z8S-+1~UEPL%}<gqO zQiHM>4++tSS11X}O4edV8O{<@f=%iec|sY1t44~Hhm0s}fpFG-cCp#DYRO$9m^I6Y73Ks1cd=z6He}1B=Hs)J| z@Y<<{RFbIs@ZXk2E+w`)PXxv$VXv)Ej1SN4LQG}dZ5wohY*M!f+0;|} zKYj9YAuyBKr1^w0s*|wSTe6&vrbezw>KHx$x{Xuv=vDg?;pzM3B*cwlN5V|M zv5Qu;@oPBi#dHe3GTI|S*V5z#dVujVa5k_4l z0leYN19kPLANGqDWQ@ox_*?(Vv)|~DP2G=UQO^=*W#jd{Cr^iLB1MV|aJ?DV-QHo5 zCP);L{m%!?1Ox*>BI2jAxpR^{&zO~B1?(GL;&b&xHRhC^Zt@*LrO~ToTM*Ba)belP X4gBin;_WFr#VkVgR?9E{583|$1Z;)? literal 0 HcmV?d00001 diff --git a/sign.sh b/sign.sh new file mode 100755 index 00000000..f0e77270 --- /dev/null +++ b/sign.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +root_dir=$(dirname "$(readlink -f "$0")") + +input_apk=$1 +cert=$2 +ks_pass=$3 +ks_alias=$4 + +if [ "$#" -ne 4 ]; then + echo "Usage: $0 " + exit 1 +fi + +if [[ "$cert" != *.jks ]]; then + echo ">> [$(date)] Error: Certificate file must have the extension .jks." + exit 1 +else + echo ">> [$(date)] Patching apk." + certdigest=$(openssl x509 -sha256 -fingerprint -noout -in $cert -passin pass:$ks_pass) + fingerprint=$(echo $certdigest | awk -F'=' '{print $2}' | sed 's/://g' | tr '[:upper:]' '[:lower:]') + python3 ${root_dir}/trichrome_patch.py $fingerprint $input_apk +fi + +output_apk="${input_apk%.apk}_signed.apk" + +if [ -f "$input_apk.patched" ]; then + echo ">> [$(date)] Zipaligning apk." + zipalign -p -f 4 "$input_apk.patched" $output_apk + rm "$input_apk.patched" +else + cp -r $input_apk $output_apk +fi + +if [ -f "$output_apk" ]; then + echo ">> [$(date)] Signing apk." + apksigner sign --ks $cert --ks-pass pass:$ks_pass --ks-key-alias $ks_alias $output_apk +fi diff --git a/trichrome_patch.py b/trichrome_patch.py new file mode 100755 index 00000000..e59c7b21 --- /dev/null +++ b/trichrome_patch.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 + +import os +import sys +import zipfile + +if len(sys.argv) < 3: + print("Usage: python " + sys.argv[0] + ".py certdigest ") + sys.exit(1) + +certdigest = sys.argv[1] +input_apks = sys.argv[2:] + +def patch_apk(infilename, new_certdigest): + # Default for chromium apks + orig_certdigest = "32a2fc74d731105859e5a85df16d95f102d85b22099b8064c5d8915c61dad1e0" + + # Check if the original and new certificate digests are the same + if orig_certdigest == new_certdigest: + return + + delete_apk = False + + with zipfile.ZipFile(infilename, 'r') as zin: + # Initialize the output ZIP file + outfilename = infilename + ".patched" + with zipfile.ZipFile(outfilename, 'w') as zout: + for info in zin.infolist(): + data = zin.read(info.filename) + if info.filename == 'AndroidManifest.xml': + if new_certdigest.encode('utf-16-le') in data: + delete_apk = True + # Check if the original certdigest is found + if orig_certdigest.encode('utf-16-le') in data: + data = data.replace(orig_certdigest.encode('utf-16-le'), new_certdigest.encode('utf-16-le')) + else: + delete_apk = True + zout.writestr(info, data) + + if delete_apk and os.path.exists(outfilename): + os.remove(outfilename) + +for apk in input_apks: + patch_apk(apk, certdigest) -- GitLab From c3f91e53da61a6dc546c9dd017a32c1303d7f7c9 Mon Sep 17 00:00:00 2001 From: althafvly Date: Thu, 26 Oct 2023 14:04:09 +0530 Subject: [PATCH 12/15] Browser: Use python script to sign --- sign.sh | 38 ------------------------- trichrome_patch.py | 69 +++++++++++++++++++++++++++++++++++----------- 2 files changed, 53 insertions(+), 54 deletions(-) delete mode 100755 sign.sh diff --git a/sign.sh b/sign.sh deleted file mode 100755 index f0e77270..00000000 --- a/sign.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -root_dir=$(dirname "$(readlink -f "$0")") - -input_apk=$1 -cert=$2 -ks_pass=$3 -ks_alias=$4 - -if [ "$#" -ne 4 ]; then - echo "Usage: $0 " - exit 1 -fi - -if [[ "$cert" != *.jks ]]; then - echo ">> [$(date)] Error: Certificate file must have the extension .jks." - exit 1 -else - echo ">> [$(date)] Patching apk." - certdigest=$(openssl x509 -sha256 -fingerprint -noout -in $cert -passin pass:$ks_pass) - fingerprint=$(echo $certdigest | awk -F'=' '{print $2}' | sed 's/://g' | tr '[:upper:]' '[:lower:]') - python3 ${root_dir}/trichrome_patch.py $fingerprint $input_apk -fi - -output_apk="${input_apk%.apk}_signed.apk" - -if [ -f "$input_apk.patched" ]; then - echo ">> [$(date)] Zipaligning apk." - zipalign -p -f 4 "$input_apk.patched" $output_apk - rm "$input_apk.patched" -else - cp -r $input_apk $output_apk -fi - -if [ -f "$output_apk" ]; then - echo ">> [$(date)] Signing apk." - apksigner sign --ks $cert --ks-pass pass:$ks_pass --ks-key-alias $ks_alias $output_apk -fi diff --git a/trichrome_patch.py b/trichrome_patch.py index e59c7b21..7248d234 100755 --- a/trichrome_patch.py +++ b/trichrome_patch.py @@ -2,43 +2,80 @@ import os import sys +import subprocess import zipfile -if len(sys.argv) < 3: - print("Usage: python " + sys.argv[0] + ".py certdigest ") - sys.exit(1) +def main(): + if len(sys.argv) != 5: + print("Usage: {} ".format(sys.argv[0])) + sys.exit(1) -certdigest = sys.argv[1] -input_apks = sys.argv[2:] + input_apk = sys.argv[1] + cert = sys.argv[2] + ks_pass = sys.argv[3] + ks_alias = sys.argv[4] -def patch_apk(infilename, new_certdigest): - # Default for chromium apks + root_dir = os.path.dirname(os.path.realpath(__file__)) + + if not cert.endswith(".jks"): + print(">> [{}] Error: Certificate file must have the extension .jks.".format(get_current_time())) + sys.exit(1) + else: + print(">> [{}] Patching apk.".format(get_current_time())) + certdigest = get_certificate_fingerprint(cert, ks_pass) + fingerprint = certdigest.replace(':', '').lower() + patch_apk(root_dir, fingerprint, input_apk) + + output_apk = "{}_signed.apk".format(os.path.splitext(input_apk)[0]) + + if os.path.exists("{}_patched".format(input_apk)): + print(">> [{}] Zipaligning apk.".format(get_current_time())) + zipalign_apk("{}_patched".format(input_apk), output_apk) + os.remove("{}_patched".format(input_apk)) + else: + subprocess.run(["cp", input_apk, output_apk]) + + if os.path.exists(output_apk): + print(">> [{}] Signing apk.".format(get_current_time())) + sign_apk(cert, ks_pass, ks_alias, output_apk) + +def get_current_time(): + return subprocess.check_output("date", shell=True).decode().strip() + +def get_certificate_fingerprint(cert, ks_pass): + certdigest = subprocess.check_output("openssl x509 -sha256 -fingerprint -noout -in {} -passin pass:{}".format(cert, ks_pass), shell=True).decode().strip() + return certdigest.split('=')[1].replace(':', '').lower() + +def patch_apk(root_dir, new_certdigest, input_apk): orig_certdigest = "32a2fc74d731105859e5a85df16d95f102d85b22099b8064c5d8915c61dad1e0" - # Check if the original and new certificate digests are the same if orig_certdigest == new_certdigest: return delete_apk = False - with zipfile.ZipFile(infilename, 'r') as zin: - # Initialize the output ZIP file - outfilename = infilename + ".patched" + with zipfile.ZipFile(input_apk, 'r') as zin: + outfilename = "{}_patched".format(input_apk) with zipfile.ZipFile(outfilename, 'w') as zout: for info in zin.infolist(): data = zin.read(info.filename) if info.filename == 'AndroidManifest.xml': if new_certdigest.encode('utf-16-le') in data: delete_apk = True - # Check if the original certdigest is found - if orig_certdigest.encode('utf-16-le') in data: + elif orig_certdigest.encode('utf-16-le') in data: data = data.replace(orig_certdigest.encode('utf-16-le'), new_certdigest.encode('utf-16-le')) else: delete_apk = True zout.writestr(info, data) if delete_apk and os.path.exists(outfilename): - os.remove(outfilename) + os.remove(outfilename) + +def zipalign_apk(input_apk, output_apk): + subprocess.run(["zipalign", "-f", "-p", "-z", "4", input_apk, output_apk]) + +def sign_apk(cert, ks_pass, ks_alias, output_apk): + subprocess.run(["apksigner", "sign", "--ks", cert, "--ks-pass", "pass:{}".format(ks_pass), "--ks-key-alias", ks_alias, output_apk]) -for apk in input_apks: - patch_apk(apk, certdigest) +if __name__ == "__main__": + main() -- GitLab From 34a98c74cdafb16019f8e7f28339603698491c11 Mon Sep 17 00:00:00 2001 From: althafvly Date: Thu, 26 Oct 2023 14:11:13 +0530 Subject: [PATCH 13/15] Browser: Remove legacy targets --- build.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index 7fe3cd76..1edbfa70 100755 --- a/build.sh +++ b/build.sh @@ -29,8 +29,8 @@ usage() { build() { echo ">> [$(date)] Head commit: $(git show -s --format=%s)" - apks="ChromePublic SystemWebView TrichromeChrome TrichromeLibrary TrichromeWebView TrichromeChrome6432 \ - TrichromeLibrary6432 TrichromeWebView6432 MonochromePublic" + apks="TrichromeChrome TrichromeLibrary TrichromeWebView TrichromeChrome6432 \ + TrichromeLibrary6432 TrichromeWebView6432" build_args="$(cat "${root_dir}"/build/browser.gn_args) target_cpu=\"${1}\" " apk_arch=${1} @@ -61,11 +61,10 @@ build() { echo ">> [$(date)] Building chromium $chromium_version for $1" gn gen "out/$1" --args="$build_args" - build_targets="chrome_public_apk system_webview_apk monochrome_public_apk" if [ $1 '==' "x64" ] || [ $1 '==' "arm64" ]; then - build_targets="$build_targets trichrome_webview_64_32_apk trichrome_chrome_64_32_apk trichrome_library_64_32_apk" + build_targets="trichrome_webview_64_32_apk trichrome_chrome_64_32_apk trichrome_library_64_32_apk" else - build_targets="$build_targets trichrome_webview_apk trichrome_chrome_apk trichrome_library_apk" + build_targets="trichrome_webview_apk trichrome_chrome_apk trichrome_library_apk" fi ninja -C out/$1 $build_targets -- GitLab From 5c837a514ebbd0f1bd1335f113debedf33f83cfa Mon Sep 17 00:00:00 2001 From: althafvly Date: Thu, 26 Oct 2023 14:38:14 +0530 Subject: [PATCH 14/15] Browser: Update patches --- ...y-services-dependent-password-manager-fea.patch | 4 ++-- ...2-Browser-Remove-some-preferences-from-UI.patch | 14 +++++++------- .../0003-Browser-fix-adblock-rebranding.patch | 4 ++-- ...id-using-cached-legacy-pref-value-for-tab.patch | 4 ++-- ...05-Browser-Remove-send-to-devices-option.patch} | 4 ++-- ...=> 0006-Browser-Enable-webRTC-by-default.patch} | 4 ++-- ...atch => 0007-Browser-fix-help-icon-crash.patch} | 4 ++-- ... => 0008-Browser-Enable-webgl-by-default.patch} | 4 ++-- build/e_patches_list.txt | 9 ++++----- 9 files changed, 25 insertions(+), 26 deletions(-) rename build/e_patches/{0001-Browser-Remove-send-to-devices-option.patch => 0005-Browser-Remove-send-to-devices-option.patch} (96%) rename build/e_patches/{0001-Browser-Enable-webRTC-by-default.patch => 0006-Browser-Enable-webRTC-by-default.patch} (96%) rename build/e_patches/{0001-Browser-fix-help-icon-crash.patch => 0007-Browser-fix-help-icon-crash.patch} (94%) rename build/e_patches/{0001-Browser-Enable-webgl-by-default.patch => 0008-Browser-Enable-webgl-by-default.patch} (93%) diff --git a/build/e_patches/0001-Disable-Play-services-dependent-password-manager-fea.patch b/build/e_patches/0001-Disable-Play-services-dependent-password-manager-fea.patch index 6066a23e..6df5a3fe 100644 --- a/build/e_patches/0001-Disable-Play-services-dependent-password-manager-fea.patch +++ b/build/e_patches/0001-Disable-Play-services-dependent-password-manager-fea.patch @@ -1,7 +1,7 @@ -From a177f67795435619d7c7cbfa0fda4db32773f30a Mon Sep 17 00:00:00 2001 +From a2b03c8888b091ffd173ddeb6dd990b0cc28b271 Mon Sep 17 00:00:00 2001 From: fgei Date: Tue, 21 Feb 2023 02:02:40 +0000 -Subject: [PATCH 1/3] Disable Play services dependent password manager feature +Subject: [PATCH 1/8] Disable Play services dependent password manager feature by default --- diff --git a/build/e_patches/0002-Browser-Remove-some-preferences-from-UI.patch b/build/e_patches/0002-Browser-Remove-some-preferences-from-UI.patch index c147fe40..784a81df 100644 --- a/build/e_patches/0002-Browser-Remove-some-preferences-from-UI.patch +++ b/build/e_patches/0002-Browser-Remove-some-preferences-from-UI.patch @@ -1,7 +1,7 @@ -From 10b257327256fa936aef04dc7e7bc5b8e22bcb65 Mon Sep 17 00:00:00 2001 +From 7b40ec3262ea02f0e28a5a0451305d11f99817be Mon Sep 17 00:00:00 2001 From: althafvly Date: Mon, 9 Oct 2023 12:41:18 +0530 -Subject: [PATCH 2/3] Browser: Remove some preferences from UI +Subject: [PATCH 2/8] Browser: Remove some preferences from UI --- .../android/java/res/xml/main_preferences.xml | 10 ---------- @@ -142,7 +142,7 @@ index 65d7d279c99e7..69b29d7ed2c45 100644 List options = new ArrayList<>(); options.add(new TimeFrequencySpinnerOption(0, diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java -index ee4bd26f4fc5a..021def8fc5994 100644 +index 1dd32e4bb001b..3f798c19d678a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java @@ -40,7 +40,6 @@ import org.chromium.chrome.browser.sync.settings.ManageSyncSettings; @@ -162,9 +162,9 @@ index ee4bd26f4fc5a..021def8fc5994 100644 private final ManagedPreferenceDelegate mManagedPreferenceDelegate; private final Map mAllPreferences = new HashMap<>(); -@@ -237,14 +234,6 @@ public class MainSettings extends PreferenceFragmentCompat - removePreferenceIfPresent(PREF_SIGN_IN); - } +@@ -231,14 +228,6 @@ public class MainSettings extends PreferenceFragmentCompat + private void updatePreferences() { + removePreferenceIfPresent(PREF_SIGN_IN); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O - && ChromeFeatureList.isEnabled( @@ -177,7 +177,7 @@ index ee4bd26f4fc5a..021def8fc5994 100644 updateManageSyncPreference(); updateSearchEnginePreference(); updatePasswordsPreference(); -@@ -260,12 +249,6 @@ public class MainSettings extends PreferenceFragmentCompat +@@ -254,12 +243,6 @@ public class MainSettings extends PreferenceFragmentCompat } else { removePreferenceIfPresent(PREF_UI_THEME); } diff --git a/build/e_patches/0003-Browser-fix-adblock-rebranding.patch b/build/e_patches/0003-Browser-fix-adblock-rebranding.patch index fc0c0805..563cc83c 100644 --- a/build/e_patches/0003-Browser-fix-adblock-rebranding.patch +++ b/build/e_patches/0003-Browser-fix-adblock-rebranding.patch @@ -1,7 +1,7 @@ -From aa6db92d7c92dd6995da314ea85bb340c3bdad2d Mon Sep 17 00:00:00 2001 +From 0bcae88bc90a24ad0efad239f971ccf356a6015f Mon Sep 17 00:00:00 2001 From: althafvly Date: Mon, 9 Oct 2023 17:07:09 +0530 -Subject: [PATCH 3/3] Browser: fix adblock rebranding +Subject: [PATCH 3/8] Browser: fix adblock rebranding --- chrome/browser/ui/android/strings/android_chrome_strings.grd | 2 +- diff --git a/build/e_patches/0004-Browser-Avoid-using-cached-legacy-pref-value-for-tab.patch b/build/e_patches/0004-Browser-Avoid-using-cached-legacy-pref-value-for-tab.patch index 0f5db815..dbb82a73 100644 --- a/build/e_patches/0004-Browser-Avoid-using-cached-legacy-pref-value-for-tab.patch +++ b/build/e_patches/0004-Browser-Avoid-using-cached-legacy-pref-value-for-tab.patch @@ -1,7 +1,7 @@ -From 0d2ab70ad5ede11266766f8fd6bc28eeb5208823 Mon Sep 17 00:00:00 2001 +From f0a88d3465860b71a8b6fd1dbb684aac877a6af8 Mon Sep 17 00:00:00 2001 From: althafvly Date: Tue, 10 Oct 2023 16:32:44 +0530 -Subject: [PATCH 4/4] Browser: Avoid using cached legacy pref value for tab +Subject: [PATCH 4/8] Browser: Avoid using cached legacy pref value for tab group --- diff --git a/build/e_patches/0001-Browser-Remove-send-to-devices-option.patch b/build/e_patches/0005-Browser-Remove-send-to-devices-option.patch similarity index 96% rename from build/e_patches/0001-Browser-Remove-send-to-devices-option.patch rename to build/e_patches/0005-Browser-Remove-send-to-devices-option.patch index da6935fc..e548bda0 100644 --- a/build/e_patches/0001-Browser-Remove-send-to-devices-option.patch +++ b/build/e_patches/0005-Browser-Remove-send-to-devices-option.patch @@ -1,7 +1,7 @@ -From 92cbf726cce7f13335141ab06dae3179334ae48b Mon Sep 17 00:00:00 2001 +From cfde569ba312384599e76cb180ae3d0fa3b2aac2 Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 20 Oct 2023 18:23:09 +0530 -Subject: [PATCH] Browser: Remove send to devices option +Subject: [PATCH 5/8] Browser: Remove send to devices option --- ...omeProvidedSharingOptionsProviderBase.java | 28 ------------------- diff --git a/build/e_patches/0001-Browser-Enable-webRTC-by-default.patch b/build/e_patches/0006-Browser-Enable-webRTC-by-default.patch similarity index 96% rename from build/e_patches/0001-Browser-Enable-webRTC-by-default.patch rename to build/e_patches/0006-Browser-Enable-webRTC-by-default.patch index ed215c48..d2cfb827 100644 --- a/build/e_patches/0001-Browser-Enable-webRTC-by-default.patch +++ b/build/e_patches/0006-Browser-Enable-webRTC-by-default.patch @@ -1,7 +1,7 @@ -From 0aa009541f303d6238c0c6be0e5c3b54e12886ca Mon Sep 17 00:00:00 2001 +From 7672d3191f6de3cd8c8b6a068bd48e85a88c48fc Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 20 Oct 2023 18:49:36 +0530 -Subject: [PATCH] Browser: Enable webRTC by default +Subject: [PATCH 6/8] Browser: Enable webRTC by default --- .../core/browser/bromite_content_settings/webrtc.inc | 2 +- diff --git a/build/e_patches/0001-Browser-fix-help-icon-crash.patch b/build/e_patches/0007-Browser-fix-help-icon-crash.patch similarity index 94% rename from build/e_patches/0001-Browser-fix-help-icon-crash.patch rename to build/e_patches/0007-Browser-fix-help-icon-crash.patch index 4a83481e..67bcc30d 100644 --- a/build/e_patches/0001-Browser-fix-help-icon-crash.patch +++ b/build/e_patches/0007-Browser-fix-help-icon-crash.patch @@ -1,7 +1,7 @@ -From 8b0670ebd9c51730c95b1236e1a41a76f62a0fbd Mon Sep 17 00:00:00 2001 +From b8b3070fdad7abfb853dab6fe065ef2a701468fa Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 20 Oct 2023 21:49:42 +0530 -Subject: [PATCH] Browser: fix help icon crash +Subject: [PATCH 7/8] Browser: fix help icon crash --- .../chrome/browser/feedback/FeedbackCollector.java | 9 +++++---- diff --git a/build/e_patches/0001-Browser-Enable-webgl-by-default.patch b/build/e_patches/0008-Browser-Enable-webgl-by-default.patch similarity index 93% rename from build/e_patches/0001-Browser-Enable-webgl-by-default.patch rename to build/e_patches/0008-Browser-Enable-webgl-by-default.patch index 430ffd19..c84177c4 100644 --- a/build/e_patches/0001-Browser-Enable-webgl-by-default.patch +++ b/build/e_patches/0008-Browser-Enable-webgl-by-default.patch @@ -1,7 +1,7 @@ -From 1a021fdb9f112dafddedac59dfe755dadf641afe Mon Sep 17 00:00:00 2001 +From be3785f05aab2b2a3f0362fac56b569084d928b8 Mon Sep 17 00:00:00 2001 From: althafvly Date: Tue, 24 Oct 2023 14:39:06 +0530 -Subject: [PATCH] Browser: Enable webgl by default +Subject: [PATCH 8/8] Browser: Enable webgl by default --- .../core/browser/bromite_content_settings/webgl.inc | 2 +- diff --git a/build/e_patches_list.txt b/build/e_patches_list.txt index d48632a6..023ed640 100644 --- a/build/e_patches_list.txt +++ b/build/e_patches_list.txt @@ -53,8 +53,7 @@ 0002-Browser-Remove-some-preferences-from-UI.patch 0003-Browser-fix-adblock-rebranding.patch 0004-Browser-Avoid-using-cached-legacy-pref-value-for-tab.patch - -0001-Browser-Remove-send-to-devices-option.patch -0001-Browser-Enable-webRTC-by-default.patch -0001-Browser-fix-help-icon-crash.patch -0001-Browser-Enable-webgl-by-default.patch +0005-Browser-Remove-send-to-devices-option.patch +0006-Browser-Enable-webRTC-by-default.patch +0007-Browser-fix-help-icon-crash.patch +0008-Browser-Enable-webgl-by-default.patch -- GitLab From 7a54f1d26ce3ec6ac6796281fe7c0e41d2fcff29 Mon Sep 17 00:00:00 2001 From: althafvly Date: Fri, 27 Oct 2023 10:11:16 +0530 Subject: [PATCH 15/15] Browser: Bump to 117.0.5938.156 --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 1edbfa70..8cf54b48 100755 --- a/build.sh +++ b/build.sh @@ -7,7 +7,7 @@ root_dir=$(dirname "$(readlink -f "$0")") if [ ! -d "$chromium_dir" ]; then chromium_dir=$root_dir fi -chromium_version="117.0.5938.153" +chromium_version="117.0.5938.156" chromium_code=$(echo "$chromium_version" | tr -d '.' | cut -c5-) clean=0 gsync=0 -- GitLab