diff --git a/build/cromite_patches_list.txt b/build/cromite_patches_list.txt index efc71a07..62d00323 100644 --- a/build/cromite_patches_list.txt +++ b/build/cromite_patches_list.txt @@ -1,7 +1,11 @@ +Do-not-link-with-libatomic.patch bromite-build-utils.patch +Add-cromite-flags-support.patch +Fix-chromium-vanilla.patch +Final-patch-for-chromium-vanilla.patch + Remove-EV-certificates.patch do-not-hide-.orig-files.patch -Do-not-link-with-libatomic.patch do-not-add-suffix-to-package-name.patch exit-on-failure-of-inclusion.patch Move-some-account-settings-back-to-privacy-settings.patch @@ -264,7 +268,6 @@ Keep-Manta-Service-Disabled.patch Disable-Service-and-Shared-workers-on-3P-iframe.patch Disable-Real-Box.patch Always-allow-inspect-fallback.patch -Add-cromite-flags-support.patch Add-PartialLowEndModeOnMidRangeDevices-flag.patch Use-list-mode-for-tab-switcher.patch Chrome-web-store-protection.patch @@ -298,7 +301,7 @@ Close-Sessions-On-Ip-Change.patch Ask-for-restart-on-connection-change.patch Bubble-Locking-on-UI-DevTools.patch -# temporary patches +# temporary or wip patches Disable-wip-Android-Hub.patch Temp-PerformanceNavigationTiming-privacy-fix.patch Temp-disable-predictive-back-gesture.patch diff --git a/build/patches/Add-an-always-incognito-mode.patch b/build/patches/Add-an-always-incognito-mode.patch index b064cfd1..18541c49 100644 --- a/build/patches/Add-an-always-incognito-mode.patch +++ b/build/patches/Add-an-always-incognito-mode.patch @@ -67,7 +67,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/browser/profiles/profile_selections.h | 7 +- .../browser/ui/android/native_page/BUILD.gn | 2 + .../browser/ui/native_page/NativePage.java | 23 ++- - .../strings/android_chrome_strings.grd | 31 ++++ + .../strings/android_chrome_strings.grd | 25 +++ .../browser/toolbar/LocationBarModel.java | 5 +- chrome/browser/ui/messages/android/BUILD.gn | 1 + .../snackbar/INeedSnackbarManager.java | 27 +++ @@ -85,7 +85,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../add-an-always-incognito-mode.inc | 3 + .../add-an-always-incognito-mode.inc | 1 + net/base/file_stream_context.cc | 2 +- - 66 files changed, 781 insertions(+), 103 deletions(-) + 66 files changed, 775 insertions(+), 103 deletions(-) create mode 100644 chrome/android/java/res/xml/incognito_preferences.xml create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/IncognitoSettings.java @@ -170,7 +170,7 @@ new file mode 100644 diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml --- a/chrome/android/java/res/xml/privacy_preferences.xml +++ b/chrome/android/java/res/xml/privacy_preferences.xml -@@ -82,6 +82,11 @@ found in the LICENSE file. +@@ -86,6 +86,11 @@ found in the LICENSE file. android:key="secure_dns" android:title="@string/settings_secure_dns_title" android:fragment="org.chromium.chrome.browser.privacy.secure_dns.SecureDnsSettings" /> @@ -895,17 +895,17 @@ new file mode 100644 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java -@@ -86,6 +86,7 @@ import org.chromium.chrome.browser.sync.settings.AccountManagementFragment; +@@ -87,6 +87,7 @@ import org.chromium.chrome.browser.sync.settings.AccountManagementFragment; import org.chromium.chrome.browser.sync.settings.GoogleServicesSettings; import org.chromium.chrome.browser.sync.settings.ManageSyncSettings; import org.chromium.chrome.browser.ui.device_lock.MissingDeviceLockLauncher; +import org.chromium.chrome.browser.ui.messages.snackbar.INeedSnackbarManager; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarManageable; - import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; -@@ -374,6 +375,9 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity - ((PrivacySandboxSettingsBaseFragment) fragment) - .setSnackbarManager(getSnackbarManager()); + import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar; +@@ -410,6 +411,9 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity + ((ChromeBaseSettingsFragment)fragment).setRequestRestartDelegate( + new RequestRestartDelegate(mSnackbarManager, this)); } + if (fragment instanceof INeedSnackbarManager) { + ((INeedSnackbarManager)fragment).setSnackbarManager(mSnackbarManager); @@ -1880,7 +1880,7 @@ diff --git a/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd -@@ -1296,6 +1296,37 @@ Your Google account may have other forms of browsing history like searches and a +@@ -1297,6 +1297,31 @@ Your Google account may have other forms of browsing history like searches and a Deletes history from all synced devices @@ -1897,12 +1897,6 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro + + Opens links in incognito tabs when you click on new tab or on a link + -+ -+ Relaunch -+ -+ -+ Your changes will take effect the next time you relaunch Bromite. -+ + + Enable history + diff --git a/build/patches/Add-cromite-flags-support.patch b/build/patches/Add-cromite-flags-support.patch index fced281c..6507020b 100644 --- a/build/patches/Add-cromite-flags-support.patch +++ b/build/patches/Add-cromite-flags-support.patch @@ -36,6 +36,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html chrome/browser/settings/BUILD.gn | 1 + .../settings/ChromeBaseSettingsFragment.java | 47 +++++ .../strings/android_chrome_strings.grd | 1 + + .../Add-cromite-flags-support.grdp | 9 + .../placeholder.txt | 1 + chrome/browser/ui/ui_features.cc | 1 + chrome/common/chrome_features.cc | 1 + @@ -95,9 +96,10 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html third_party/blink/public/common/features.h | 1 + ui/base/ui_base_features.cc | 1 + ui/base/ui_base_features.h | 1 + - 82 files changed, 762 insertions(+), 22 deletions(-) + 83 files changed, 771 insertions(+), 22 deletions(-) create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/include_all_directory.java create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/java_template/CromiteCachedFlag.java.tmpl + create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-cromite-flags-support.grdp create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/placeholder.txt create mode 100644 components/cromite_components_strings_grd/placeholder.txt create mode 100755 cromite_flags/BUILD.gn @@ -436,10 +438,10 @@ diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml --- a/chrome/android/java/res/xml/privacy_preferences.xml +++ b/chrome/android/java/res/xml/privacy_preferences.xml -@@ -75,6 +75,10 @@ found in the LICENSE file. - android:title="@string/tabgrid_use_icons_title" - android:summary="@string/tabgrid_use_icons_summary" - android:defaultValue="false" /> +@@ -55,6 +55,10 @@ found in the LICENSE file. + android:key="do_not_track" + android:title="@string/do_not_track_title" + android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings" /> + sFlagsCachedFullBrowserChromium = List.of( sAccountReauthenticationRecentTimeWindow, - sAllowUserCertificates, -@@ -816,6 +820,13 @@ public abstract class ChromeFeatureList { + sAndroidAppIntegration, +@@ -788,6 +792,13 @@ public abstract class ChromeFeatureList { sUseLibunwindstackNativeUnwinderAndroid, sVerticalAutomotiveBackButtonToolbar); @@ -852,6 +854,20 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro +diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-cromite-flags-support.grdp b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-cromite-flags-support.grdp +new file mode 100644 +--- /dev/null ++++ b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-cromite-flags-support.grdp +@@ -0,0 +1,9 @@ ++ ++ ++ ++ Relaunch ++ ++ ++ Your changes will take effect the next time you relaunch Cromite. ++ ++ diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/placeholder.txt b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/placeholder.txt new file mode 100644 --- /dev/null @@ -887,8 +903,8 @@ diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibil + - - - +@@ -281,6 +281,7 @@ + + + + - - - + + + diff --git a/components/content_settings/core/common/features.cc b/components/content_settings/core/common/features.cc --- a/components/content_settings/core/common/features.cc +++ b/components/content_settings/core/common/features.cc @@ -1367,7 +1383,7 @@ diff --git a/components/offline_pages/core/offline_page_feature.h b/components/o diff --git a/components/password_manager/core/browser/features/password_features.cc b/components/password_manager/core/browser/features/password_features.cc --- a/components/password_manager/core/browser/features/password_features.cc +++ b/components/password_manager/core/browser/features/password_features.cc -@@ -207,4 +207,5 @@ BASE_FEATURE(kUsernameFirstFlowWithIntermediateValuesVoting, +@@ -206,4 +206,5 @@ BASE_FEATURE(kUsernameFirstFlowWithIntermediateValuesVoting, "UsernameFirstFlowWithIntermediateValuesVoting", base::FEATURE_ENABLED_BY_DEFAULT); @@ -1771,7 +1787,7 @@ diff --git a/media/base/media_switches.h b/media/base/media_switches.h diff --git a/net/base/features.cc b/net/base/features.cc --- a/net/base/features.cc +++ b/net/base/features.cc -@@ -550,4 +550,5 @@ BASE_FEATURE(kSpdySessionForProxyAdditionalChecks, +@@ -549,4 +549,5 @@ BASE_FEATURE(kSpdySessionForProxyAdditionalChecks, "SpdySessionForProxyAdditionalChecks", base::FEATURE_ENABLED_BY_DEFAULT); @@ -1811,7 +1827,7 @@ diff --git a/services/network/public/cpp/features.h b/services/network/public/cp diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc --- a/third_party/blink/common/features.cc +++ b/third_party/blink/common/features.cc -@@ -2678,5 +2678,6 @@ BASE_FEATURE(kOptimizeLoadingDataUrls, +@@ -2677,5 +2677,6 @@ BASE_FEATURE(kOptimizeLoadingDataUrls, "OptimizeLoadingDataUrls", base::FEATURE_DISABLED_BY_DEFAULT); @@ -1821,7 +1837,7 @@ diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/fea diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h --- a/third_party/blink/public/common/features.h +++ b/third_party/blink/public/common/features.h -@@ -1747,6 +1747,7 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kRenderSizeInScoreAdBrowserSignals); +@@ -1744,6 +1744,7 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kRenderSizeInScoreAdBrowserSignals); // Optimize loading data: URLs. BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kOptimizeLoadingDataUrls); @@ -1832,7 +1848,7 @@ diff --git a/third_party/blink/public/common/features.h b/third_party/blink/publ diff --git a/ui/base/ui_base_features.cc b/ui/base/ui_base_features.cc --- a/ui/base/ui_base_features.cc +++ b/ui/base/ui_base_features.cc -@@ -529,4 +529,5 @@ BASE_FEATURE(kEnableGestureBeginEndTypes, +@@ -521,4 +521,5 @@ BASE_FEATURE(kEnableGestureBeginEndTypes, "EnableGestureBeginEndTypes", base::FEATURE_DISABLED_BY_DEFAULT); @@ -1841,7 +1857,7 @@ diff --git a/ui/base/ui_base_features.cc b/ui/base/ui_base_features.cc diff --git a/ui/base/ui_base_features.h b/ui/base/ui_base_features.h --- a/ui/base/ui_base_features.h +++ b/ui/base/ui_base_features.h -@@ -247,6 +247,7 @@ BASE_DECLARE_FEATURE(kBubbleFrameViewTitleIsHeading); +@@ -245,6 +245,7 @@ BASE_DECLARE_FEATURE(kBubbleFrameViewTitleIsHeading); COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kEnableGestureBeginEndTypes); diff --git a/build/patches/Add-custom-tab-intents-privacy-option.patch b/build/patches/Add-custom-tab-intents-privacy-option.patch index 052e21d3..533b8f7c 100644 --- a/build/patches/Add-custom-tab-intents-privacy-option.patch +++ b/build/patches/Add-custom-tab-intents-privacy-option.patch @@ -26,10 +26,10 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml --- a/chrome/android/java/res/xml/privacy_preferences.xml +++ b/chrome/android/java/res/xml/privacy_preferences.xml -@@ -59,6 +59,16 @@ found in the LICENSE file. - android:key="do_not_track" - android:title="@string/do_not_track_title" - android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings" /> +@@ -63,6 +63,16 @@ found in the LICENSE file. + android:key="cromite_flags" + android:title="@string/cromite_flags_title" + app:url="@string/cromite_flags_url" /> + ", "", servicesLink)); @@ -203,7 +203,7 @@ diff --git a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAsso diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd -@@ -5454,6 +5454,20 @@ To change this setting, BEGIN_LINKdelete the Chrome d +@@ -5449,6 +5449,20 @@ To change this setting, BEGIN_LINKdelete the Chrome d Resume diff --git a/build/patches/Enable-Global-Privacy-Control.patch b/build/patches/Enable-Global-Privacy-Control.patch index a89f63b5..fd473f27 100644 --- a/build/patches/Enable-Global-Privacy-Control.patch +++ b/build/patches/Enable-Global-Privacy-Control.patch @@ -111,9 +111,9 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi + android:key="gpc" + android:title="@string/gpc_title" + android:fragment="org.chromium.chrome.browser.privacy.settings.GpcSettings" /> - @@ -5426,7 +5426,7 @@ new file mode 100755 + intersection_schemes = valid_schemes_ & other.valid_schemes_; + + if (intersection_schemes == URLPattern::SCHEME_NONE) -+ return absl::nullopt; ++ return std::nullopt; + + { + // In a few cases, we can (mostly) return a copy of one of the patterns. @@ -5488,7 +5488,7 @@ new file mode 100755 + !get_intersection(port_, other.port_, &URLPattern::MatchesPortPattern, + &port) || + !get_intersection(path_, other.path_, &URLPattern::MatchesPath, &path)) { -+ return absl::nullopt; ++ return std::nullopt; + } + + // Only match subdomains if both patterns match subdomains. @@ -9356,11 +9356,11 @@ new file mode 100755 +} + +std::optional UserScriptInjector::GetCssOrigin() const { -+ return absl::nullopt; ++ return std::nullopt; +} + +const std::optional UserScriptInjector::GetInjectionKey() const { -+ return absl::nullopt; ++ return std::nullopt; +} + +bool UserScriptInjector::ShouldInjectJs( diff --git a/build/patches/Final-patch-for-chromium-vanilla.patch b/build/patches/Final-patch-for-chromium-vanilla.patch new file mode 100644 index 00000000..e9f3277a --- /dev/null +++ b/build/patches/Final-patch-for-chromium-vanilla.patch @@ -0,0 +1,17 @@ +From: uazo +Date: Fri, 2 Aug 2024 14:43:51 +0000 +Subject: final patch for chromium vanilla + +Mark the latest patch for chromium vanilla +--- + tools/android/chromium_stage | 1 + + 1 file changed, 1 insertion(+) + create mode 100644 tools/android/chromium_stage + +diff --git a/tools/android/chromium_stage b/tools/android/chromium_stage +new file mode 100644 +--- /dev/null ++++ b/tools/android/chromium_stage +@@ -0,0 +1 @@ ++this file is only for the purpose of delimiting patches for chromium vanilla +-- diff --git a/build/patches/Fix-chromium-vanilla.patch b/build/patches/Fix-chromium-vanilla.patch new file mode 100644 index 00000000..d11aca2b --- /dev/null +++ b/build/patches/Fix-chromium-vanilla.patch @@ -0,0 +1,34 @@ +From: uazo +Date: Fri, 2 Aug 2024 10:22:09 +0000 +Subject: Fix chromium vanilla + +Fixes some crashes in start-up (only chromium vanilla) +--- + .../chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java | 2 ++ + .../components/safe_browsing/SafeBrowsingApiBridge.java | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java +@@ -206,6 +206,8 @@ public abstract class FirstRunFlowSequencer { + * @param freProperties Resulting FRE properties bundle. + */ + public void updateFirstRunProperties(Bundle freProperties) { ++ // fix chromium vanilla startup ++ if (freProperties == null) return; + boolean isHistorySyncEnabled = + ChromeFeatureList.isEnabled( + ChromeFeatureList.REPLACE_SYNC_PROMOS_WITH_SIGN_IN_PROMOS); +diff --git a/components/safe_browsing/android/java/src/org/chromium/components/safe_browsing/SafeBrowsingApiBridge.java b/components/safe_browsing/android/java/src/org/chromium/components/safe_browsing/SafeBrowsingApiBridge.java +--- a/components/safe_browsing/android/java/src/org/chromium/components/safe_browsing/SafeBrowsingApiBridge.java ++++ b/components/safe_browsing/android/java/src/org/chromium/components/safe_browsing/SafeBrowsingApiBridge.java +@@ -305,6 +305,7 @@ public final class SafeBrowsingApiBridge { + @CalledByNative + private static void startUriLookupBySafeBrowsingApi( + long callbackId, String uri, int[] threatTypes, int protocol) { ++ if ((true)) return; // (unused code in cromite) fix chromium vanilla crash + synchronized (sSafeBrowsingApiHandlerLock) { + if (sSafeBrowsingApiHandler == null) { + // sSafeBrowsingApiHandler can only be null in tests. +-- diff --git a/build/patches/Internal-firewall.patch b/build/patches/Internal-firewall.patch index 68db3139..86d4bdce 100644 --- a/build/patches/Internal-firewall.patch +++ b/build/patches/Internal-firewall.patch @@ -552,7 +552,7 @@ new file mode 100644 + int32_t unique_id_hash_code) const { + const auto it = decode_map_.find(unique_id_hash_code); + if (it == decode_map_.end()) -+ return absl::nullopt; ++ return std::nullopt; + + return std::optional(it->second); +}