Skip to content

Commit

Permalink
Update/port patches for 127.0.6533.104.0
Browse files Browse the repository at this point in the history
  • Loading branch information
quh4gko8 authored and thestinger committed Aug 14, 2024
1 parent 5d06d5e commit f69b80e
Show file tree
Hide file tree
Showing 7 changed files with 238 additions and 17 deletions.
24 changes: 13 additions & 11 deletions patches/0078-add-trichrome-browser-apk-targets.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Date: Thu, 27 May 2021 07:30:02 -0400
Subject: [PATCH] add trichrome browser apk targets

---
chrome/android/BUILD.gn | 35 +++++++++++++++++++++++
chrome/android/BUILD.gn | 37 +++++++++++++++++++++++
chrome/android/chrome_public_apk_tmpl.gni | 2 ++
2 files changed, 37 insertions(+)
2 files changed, 39 insertions(+)

diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
index a52a6e6b13959..4ae803cf6fc5e 100644
index a52a6e6b13959..5effb90b62190 100644
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -2497,6 +2497,10 @@ if (current_toolchain == default_toolchain) {
Expand All @@ -23,7 +23,7 @@ index a52a6e6b13959..4ae803cf6fc5e 100644

# Exists separately from chrome_public_base_module_java_for_test to allow
# downstream to depend on test support packages without needing to depend on
@@ -2872,6 +2876,37 @@ if (current_toolchain == default_toolchain) {
@@ -2872,6 +2876,39 @@ if (current_toolchain == default_toolchain) {
}
}
}
Expand All @@ -40,13 +40,15 @@ index a52a6e6b13959..4ae803cf6fc5e 100644
+ }
+
+ if (android_64bit_target_cpu) {
+ chrome_public_apk_or_module_tmpl("trichrome_chrome_64_32_apk") {
+ apk_name = "TrichromeChrome6432"
+ is_trichrome = true
+ target_type = "android_apk"
+ static_library_provider = ":trichrome_library_64_32_apk"
+ is_64_bit_browser = true
+ include_32_bit_webview = true
+ if (!skip_secondary_abi_for_cq) {
+ chrome_public_apk_or_module_tmpl("trichrome_chrome_64_32_apk") {
+ apk_name = "TrichromeChrome6432"
+ is_trichrome = true
+ target_type = "android_apk"
+ static_library_provider = ":trichrome_library_64_32_apk"
+ is_64_bit_browser = true
+ include_32_bit_webview = true
+ }
+ }
+
+ chrome_public_apk_or_module_tmpl("trichrome_chrome_64_apk") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Subject: [PATCH] Consolidate downstream changes in dependencies, sources for
create mode 100644 chrome/android/chrome_ext_java_sources.gni

diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
index 4ae803cf6fc5e..8ca5b88313672 100644
index 5effb90b62190..165a1ba7bcd9e 100644
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -10,6 +10,9 @@ import("//build/config/cronet/config.gni")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ Subject: [PATCH] Use 64-bit toolchain by default for generating resource
allowlist in chrome targets

---
chrome/android/BUILD.gn | 15 +++++++++++++++
1 file changed, 15 insertions(+)
chrome/android/BUILD.gn | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
index 8ca5b88313672..bf5c3f5197bd4 100644
index 165a1ba7bcd9e..9558b3b100166 100644
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -2330,6 +2330,8 @@ if (current_toolchain == default_toolchain) {
Expand Down Expand Up @@ -39,12 +39,13 @@ index 8ca5b88313672..bf5c3f5197bd4 100644
}

# Exists separately from chrome_public_base_module_java_for_test to allow
@@ -4095,6 +4101,15 @@ if (current_toolchain == _monochrome_browser_toolchain) {
@@ -4097,6 +4103,16 @@ if (current_toolchain == _monochrome_browser_toolchain) {
}

if (android_64bit_target_cpu) {
+ # Copied from above libmonochrome_input target, but doesn't include secondary_abi_lib target
+ if (current_toolchain == default_toolchain) {
+ if (current_toolchain == default_toolchain &&
+ current_toolchain != _monochrome_browser_toolchain) {
+ # Avoiding a real link for this step allows the actual libmonochrome to
+ # run at the same time as R8.
+ libmonochrome_apk_or_bundle_tmpl("libmonochrome_inputs") {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zoraver Kang <Zoraver@users.noreply.github.com>
Date: Sun, 28 Jul 2024 12:19:36 -0400
Subject: [PATCH] Fix chrome target generation when skip_secondary_abi_for_cq
is set

---
chrome/android/BUILD.gn | 58 +++++++++++++++++++++++------------------
1 file changed, 33 insertions(+), 25 deletions(-)

diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
index 9558b3b100166..05bf82a09e90c 100644
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -4170,20 +4170,24 @@ if (current_toolchain == default_toolchain &&
if (enable_libs_and_assets_verification) {
if (android_64bit_target_cpu) {
deps += [
- ":monochrome_64_32_public_bundle_validate_libs_and_assets",
- ":trichrome_chrome_32_64_bundle_validate_libs_and_assets",
- ":trichrome_chrome_32_bundle_validate_libs_and_assets",
- ":trichrome_chrome_64_32_bundle_validate_libs_and_assets",
":trichrome_chrome_64_bundle_validate_libs_and_assets",
- ":trichrome_library_32_64_apk_validate_libs_and_assets",
- ":trichrome_library_32_apk_validate_libs_and_assets",
- ":trichrome_library_64_32_apk_validate_libs_and_assets",
":trichrome_library_64_apk_validate_libs_and_assets",
- "//android_webview:trichrome_webview_32_64_bundle_validate_libs_and_assets",
- "//android_webview:trichrome_webview_32_bundle_validate_libs_and_assets",
- "//android_webview:trichrome_webview_64_32_bundle_validate_libs_and_assets",
"//android_webview:trichrome_webview_64_bundle_validate_libs_and_assets",
]
+ if (!skip_secondary_abi_for_cq) {
+ deps += [
+ ":monochrome_64_32_public_bundle_validate_libs_and_assets",
+ ":trichrome_chrome_32_64_bundle_validate_libs_and_assets",
+ ":trichrome_chrome_32_bundle_validate_libs_and_assets",
+ ":trichrome_chrome_64_32_bundle_validate_libs_and_assets",
+ ":trichrome_library_32_64_apk_validate_libs_and_assets",
+ ":trichrome_library_32_apk_validate_libs_and_assets",
+ ":trichrome_library_64_32_apk_validate_libs_and_assets",
+ "//android_webview:trichrome_webview_32_64_bundle_validate_libs_and_assets",
+ "//android_webview:trichrome_webview_32_bundle_validate_libs_and_assets",
+ "//android_webview:trichrome_webview_64_32_bundle_validate_libs_and_assets",
+ ]
+ }
} else {
deps += [
":${_main_monochrome_public_bundle_target}_validate_libs_and_assets",
@@ -4196,27 +4200,31 @@ if (current_toolchain == default_toolchain &&
if (enable_manifest_verification) {
if (android_64bit_target_cpu) {
deps += [
- ":monochrome_32_64_public_bundle__base_bundle_module_validate_android_manifest",
- ":monochrome_32_public_bundle__base_bundle_module_validate_android_manifest",
- ":monochrome_64_32_public_bundle_validate_manifests",
- ":monochrome_64_32_public_bundle_validate_proguard_config",
":monochrome_64_public_bundle__base_bundle_module_validate_android_manifest",
- ":trichrome_chrome_32_64_bundle__base_bundle_module_validate_android_manifest",
- ":trichrome_chrome_32_bundle__base_bundle_module_validate_android_manifest",
- ":trichrome_chrome_64_32_bundle__base_bundle_module_validate_android_manifest",
":trichrome_chrome_64_bundle__base_bundle_module_validate_android_manifest",
- ":trichrome_library_32_64_apk_validate_android_manifest",
- ":trichrome_library_32_apk_validate_android_manifest",
- ":trichrome_library_64_32_apk_validate_android_manifest",
":trichrome_library_64_apk_validate_android_manifest",
- "//android_webview:system_webview_32_64_base_bundle_module_validate_android_manifest",
- "//android_webview:system_webview_32_base_bundle_module_validate_android_manifest",
"//android_webview:system_webview_64_base_bundle_module_validate_android_manifest",
- "//android_webview:trichrome_webview_32_64_base_bundle_module_validate_android_manifest",
- "//android_webview:trichrome_webview_32_base_bundle_module_validate_android_manifest",
- "//android_webview:trichrome_webview_64_32_base_bundle_module_validate_android_manifest",
"//android_webview:trichrome_webview_64_base_bundle_module_validate_android_manifest",
]
+ if (!skip_secondary_abi_for_cq) {
+ deps += [
+ ":monochrome_32_64_public_bundle__base_bundle_module_validate_android_manifest",
+ ":monochrome_32_public_bundle__base_bundle_module_validate_android_manifest",
+ ":monochrome_64_32_public_bundle_validate_manifests",
+ ":monochrome_64_32_public_bundle_validate_proguard_config",
+ ":trichrome_chrome_32_64_bundle__base_bundle_module_validate_android_manifest",
+ ":trichrome_chrome_32_bundle__base_bundle_module_validate_android_manifest",
+ ":trichrome_chrome_64_32_bundle__base_bundle_module_validate_android_manifest",
+ ":trichrome_library_32_64_apk_validate_android_manifest",
+ ":trichrome_library_32_apk_validate_android_manifest",
+ ":trichrome_library_64_32_apk_validate_android_manifest",
+ "//android_webview:system_webview_32_64_base_bundle_module_validate_android_manifest",
+ "//android_webview:system_webview_32_base_bundle_module_validate_android_manifest",
+ "//android_webview:trichrome_webview_32_64_base_bundle_module_validate_android_manifest",
+ "//android_webview:trichrome_webview_32_base_bundle_module_validate_android_manifest",
+ "//android_webview:trichrome_webview_64_32_base_bundle_module_validate_android_manifest",
+ ]
+ }
} else {
deps += [
":${_main_monochrome_public_bundle_target}_validate_manifests",
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: fgei <fgei@gmail.com>
Date: Tue, 20 Feb 2024 04:05:46 +0000
Subject: [PATCH] Always start child processes in jitless mode when execmem is
blocked

---
.../library_loader/LibraryLoaderHooks.java | 31 +++++++++++++++++++
base/base_android_library_ext.gni | 1 +
2 files changed, 32 insertions(+)

diff --git a/base/android/java/src/org/chromium/base/library_loader/LibraryLoaderHooks.java b/base/android/java/src/org/chromium/base/library_loader/LibraryLoaderHooks.java
index b1a621f62770a..9f7482f21d912 100644
--- a/base/android/java/src/org/chromium/base/library_loader/LibraryLoaderHooks.java
+++ b/base/android/java/src/org/chromium/base/library_loader/LibraryLoaderHooks.java
@@ -2,8 +2,15 @@ package org.chromium.base.library_loader;

import android.content.Context;

+import org.chromium.base.CommandLine;
+import org.chromium.base.command_line.VanadiumCommandLineUtils;
import org.chromium.base.config.VanadiumConfigBridge;

+import java.util.ArrayList;
+import java.util.HashSet;
+
+import app.vanadium.ext.CustomOSApis;
+
class LibraryLoaderHooks {

static void onSetLibraryProcessType(Context appContext, @LibraryProcessType int type) {
@@ -12,6 +19,30 @@ class LibraryLoaderHooks {

static void onBeforeCommandLineSwitchLocked(Context appContext, @LibraryProcessType int type) {
VanadiumConfigBridge.applyFlagFromConfigs(appContext, type);
+ switch (type) {
+ case LibraryProcessType.PROCESS_BROWSER:
+ case LibraryProcessType.PROCESS_WEBVIEW:
+ case LibraryProcessType.PROCESS_WEBVIEW_NONEMBEDDED:
+ return;
+ case LibraryProcessType.PROCESS_CHILD:
+ case LibraryProcessType.PROCESS_WEBVIEW_CHILD:
+ if (CommandLine.getInstance() != null) {
+ boolean checkForOSConfigForJitless =
+ !VanadiumCommandLineUtils.getCommaDelimitedSwitchValue(
+ "disable-features").contains("check-os-config-for-jitless");
+ if (CustomOSApis.isExecmemBlocked() && checkForOSConfigForJitless) {
+ String jsFlagsName = "js-flags";
+ HashSet<String> jsFlags = new HashSet<>(
+ VanadiumCommandLineUtils.getCommaDelimitedSwitchValue(jsFlagsName));
+ jsFlags.add("--jitless");
+ VanadiumCommandLineUtils.setCommaDelimitedSwitchValue(
+ jsFlagsName, new ArrayList<>(jsFlags));
+ }
+ }
+ break;
+ default:
+ throw new IllegalStateException();
+ }
}

static void onSubsequentCommandLineSwitchLockedCheck(Context appContext, @LibraryProcessType int type) {
diff --git a/base/base_android_library_ext.gni b/base/base_android_library_ext.gni
index 80fb1746d8aa9..5d007a5e9dcf8 100644
--- a/base/base_android_library_ext.gni
+++ b/base/base_android_library_ext.gni
@@ -19,6 +19,7 @@ base_library_loader_java_ext_java_sources = [

base_library_loader_java_ext_deps = [
"//vanadium/android_config/proto:browser_config_parser_java",
+ "//vanadium/ext/custom_os:custom_os_apis_java",
]

base_library_loader_java_ext_srcjar_deps = [
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: fgei <fgei@gmail.com>
Date: Mon, 12 Aug 2024 14:07:37 +0000
Subject: [PATCH] Only enable shadow_call_stack on android arm64 target

---
build/config/compiler/BUILD.gn | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 77b26305a0d8a..8b2ccc897f9ce 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -339,6 +339,12 @@ config("compiler") {
# --------------------------------
cflags += [ "-fno-strict-aliasing" ] # See http://crbug.com/32204

+ if (enable_shadow_call_stack) {
+ if (!is_android || current_cpu != "arm64") {
+ enable_shadow_call_stack = false
+ }
+ }
+
# Stack protection. ShadowCallStack and Stack protector address the same
# problems. Therefore, we only enable one or the other. Clang advertises SCS as
# a stronger alternative to StackProtector, so we give SCS precedence over SP.
22 changes: 22 additions & 0 deletions patches/0191-Disable-predictive-back-gesture-for-Vanadium.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: fgei <fgei@gmail.com>
Date: Tue, 13 Aug 2024 06:07:33 +0000
Subject: [PATCH] Disable predictive back gesture for Vanadium

---
chrome/android/java/AndroidManifest.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
index bb79024a26c71..18a5f747b63ed 100644
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -204,7 +204,7 @@ by a child template that "extends" this file.
android:networkSecurityConfig="@xml/network_security_config"
android:allowAudioPlaybackCapture="false"
android:appComponentFactory="org.chromium.chrome.browser.base.SplitCompatAppComponentFactory"
- android:enableOnBackInvokedCallback="true"
+ android:enableOnBackInvokedCallback="false"
{% block extra_application_attributes %}{% endblock %}>

{% if channel in ['canary', 'dev', 'default'] %}

0 comments on commit f69b80e

Please sign in to comment.