Skip to content

Commit 2106b43

Browse files
committed
Update patches for M144
1 parent eaee628 commit 2106b43

4 files changed

+44
-23
lines changed

patch/0001-Patch-installer-to-close-previous-browser-instance-o.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 6672d08c0f5587b6450b2137cf41cd69acc37b10 Mon Sep 17 00:00:00 2001
1+
From 42415a266a519540186c16eaf5c4791f2ad2db2a Mon Sep 17 00:00:00 2001
22
From: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
33
Date: Thu, 5 Aug 2021 02:09:34 +0200
44
Subject: [PATCH 1/4] Patch installer to close previous browser instance on
@@ -10,7 +10,7 @@ Signed-off-by: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
1010
1 file changed, 48 insertions(+)
1111

1212
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc
13-
index 3393a297bb712..40f877019cd32 100644
13+
index 317e77e81c040..a635e1b48d637 100644
1414
--- a/chrome/installer/setup/install_worker.cc
1515
+++ b/chrome/installer/setup/install_worker.cc
1616
@@ -29,6 +29,8 @@

patch/0002-Patch-updater-to-work-with-unsigned-and-unbranded-bu.patch

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
From b6d0c246ec55919274446bcb7701a17eb5c4af7c Mon Sep 17 00:00:00 2001
1+
From 7a0c840a1732f84b1e1805fc7998a12fddca1af6 Mon Sep 17 00:00:00 2001
22
From: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
33
Date: Wed, 12 Jun 2024 02:14:41 +0200
44
Subject: [PATCH 2/4] Patch updater to work with unsigned and unbranded builds
55

66
Signed-off-by: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
77
---
8-
.../install_static/chromium_install_modes.h | 3 +--
8+
.../install_static/chromium_install_modes.h | 3 +-
99
chrome/updater/BUILD.gn | 1 +
10-
chrome/updater/win/installer/installer.cc | 15 +++++++++++++
11-
chrome/updater/win/signing/sign.py | 21 ++-----------------
12-
4 files changed, 19 insertions(+), 21 deletions(-)
10+
chrome/updater/win/installer/installer.cc | 15 +++++++
11+
chrome/updater/win/signing/sign.py | 42 +------------------
12+
4 files changed, 19 insertions(+), 42 deletions(-)
1313

1414
diff --git a/chrome/install_static/chromium_install_modes.h b/chrome/install_static/chromium_install_modes.h
15-
index 7de32cf745755..9bbb8ecadd23a 100644
15+
index 0cf937413e08a..e2b57a664660f 100644
1616
--- a/chrome/install_static/chromium_install_modes.h
1717
+++ b/chrome/install_static/chromium_install_modes.h
1818
@@ -32,8 +32,7 @@ inline constexpr auto kInstallModes = std::to_array<InstallConstants>({
@@ -26,10 +26,10 @@ index 7de32cf745755..9bbb8ecadd23a 100644
2626
.base_app_id = L"Chromium", // A distinct base_app_id.
2727
.browser_prog_id_prefix = L"ChromiumHTM", // Browser ProgID prefix.
2828
diff --git a/chrome/updater/BUILD.gn b/chrome/updater/BUILD.gn
29-
index 58400305cb10a..b2fa2db65c701 100644
29+
index ae9d83075d2eb..64efb84497a14 100644
3030
--- a/chrome/updater/BUILD.gn
3131
+++ b/chrome/updater/BUILD.gn
32-
@@ -358,6 +358,7 @@ if (is_win || is_mac || is_linux) {
32+
@@ -377,6 +377,7 @@ if (is_win || is_mac || is_linux) {
3333
"//chrome/installer/util:constants",
3434
"//chrome/installer/util:metainstaller_utils",
3535
"//chrome/installer/util:work_item",
@@ -38,7 +38,7 @@ index 58400305cb10a..b2fa2db65c701 100644
3838
"//chrome/updater/app/server/win:updater_idl_system",
3939
"//chrome/updater/app/server/win:updater_idl_user",
4040
diff --git a/chrome/updater/win/installer/installer.cc b/chrome/updater/win/installer/installer.cc
41-
index 2444634092235..71f13cfa910f5 100644
41+
index 543e55df64519..bd732c5103745 100644
4242
--- a/chrome/updater/win/installer/installer.cc
4343
+++ b/chrome/updater/win/installer/installer.cc
4444
@@ -11,6 +11,11 @@
@@ -90,24 +90,24 @@ index 2444634092235..71f13cfa910f5 100644
9090

9191
// Shows a splash screen "Initializing...".
9292
diff --git a/chrome/updater/win/signing/sign.py b/chrome/updater/win/signing/sign.py
93-
index d22b29c4875fc..6f7a0bbfc616e 100755
93+
index 42becb59dd93c..8304169764b80 100755
9494
--- a/chrome/updater/win/signing/sign.py
9595
+++ b/chrome/updater/win/signing/sign.py
96-
@@ -117,28 +117,11 @@ class Signer:
96+
@@ -124,49 +124,11 @@ class Signer:
9797
self._sign_flags = sign_flags
9898

9999
def _add_tagging_cert(self, in_file, out_file):
100100
- """Adds the tagging cert. Returns the path to the tagged file."""
101101
- subprocess.run(
102102
- [self._tagging_exe, '--set-tag',
103103
- '--out=%s' % out_file, in_file],
104-
- check=True)
104+
- check=True,
105+
- stdout=subprocess.DEVNULL)
105106
+ shutil.copy(in_file, out_file)
106107
return out_file
107108

108109
def _sign_item(self, in_file):
109110
- """Sign an executable in-place."""
110-
- # Retries may be required: lore states the timestamp server is flaky.
111111
- for flags in self._sign_flags:
112112
- command = [self._signtool_exe, 'sign']
113113
- command += flags
@@ -119,7 +119,28 @@ index d22b29c4875fc..6f7a0bbfc616e 100755
119119
- command += ['/s', 'My', '/n', self._identity]
120120
-
121121
- command += [in_file]
122-
- subprocess.run(command, check=True)
122+
-
123+
- # Timestamp server is flaky, retry sign if timestamp server is used
124+
- attempts = 10 if ({'/tr', '/tseal'} & set(command)) else 1
125+
- delay = 1
126+
- for attempt in range(1, attempts + 1):
127+
- try:
128+
- subprocess.run(command,
129+
- check=True,
130+
- stdout=subprocess.DEVNULL)
131+
- except subprocess.CalledProcessError:
132+
- if attempt == attempts:
133+
- raise
134+
- logging.exception(
135+
- 'Sign attempt failed, attempts left: %d',
136+
- attempts - attempt
137+
- )
138+
- logging.info(
139+
- 'Waiting for %d seconds before next attempt...', delay
140+
- )
141+
- time.sleep(delay)
142+
- continue
143+
- break
123144
+ return
124145

125146
def _generate_target_manifest(self, appid, installer_path, manifest_path,

patch/0003-Ensure-bogus-ElevationService-is-not-being-created-d.patch

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 5221611b74b49a818db69aa6389c83eabb9860c0 Mon Sep 17 00:00:00 2001
1+
From bb9750f7ebbecb7c4cbf521c137829afe1a4c81a Mon Sep 17 00:00:00 2001
22
From: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
33
Date: Sat, 22 Jul 2023 01:33:35 +0200
44
Subject: [PATCH 3/4] Ensure bogus ElevationService is not being created during
@@ -10,7 +10,7 @@ Signed-off-by: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
1010
1 file changed, 6 insertions(+), 2 deletions(-)
1111

1212
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc
13-
index 40f877019cd32..52b872a32ee18 100644
13+
index a635e1b48d637..d14a65b70fc66 100644
1414
--- a/chrome/installer/setup/install_worker.cc
1515
+++ b/chrome/installer/setup/install_worker.cc
1616
@@ -320,6 +320,7 @@ void AddChromeWorkItems(const InstallParams& install_params,
@@ -21,15 +21,15 @@ index 40f877019cd32..52b872a32ee18 100644
2121
// Adds work items to register the Elevation Service with Windows. Only for
2222
// system level installs.
2323
void AddElevationServiceWorkItems(const base::FilePath& elevation_service_path,
24-
@@ -405,7 +406,6 @@ void AddTracingServiceWorkItems(const InstallationState& original_state,
24+
@@ -404,7 +405,6 @@ void AddTracingServiceWorkItems(const InstallationState& original_state,
2525
}
2626
}
2727

2828
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
2929
// Adds work items to add the "store-dmtoken" command to Chrome's version key.
3030
// This method is a no-op if this is anything other than system-level Chrome.
3131
// The command is used when enrolling Chrome browser instances into enterprise
32-
@@ -1029,7 +1029,7 @@ void AddInstallWorkItems(const InstallParams& install_params,
32+
@@ -1028,7 +1028,7 @@ void AddInstallWorkItems(const InstallParams& install_params,
3333
install_list);
3434
AddPlatformExperienceHelperWorkItems(installer_state, new_version,
3535
install_list);
@@ -38,7 +38,7 @@ index 40f877019cd32..52b872a32ee18 100644
3838
AddFirewallRulesWorkItems(installer_state, !current_version.IsValid(),
3939
install_list);
4040

41-
@@ -1039,10 +1039,12 @@ void AddInstallWorkItems(const InstallParams& install_params,
41+
@@ -1038,10 +1038,12 @@ void AddInstallWorkItems(const InstallParams& install_params,
4242
installer_state.root_key(),
4343
GetNotificationHelperPath(target_path, new_version), install_list);
4444

@@ -51,7 +51,7 @@ index 40f877019cd32..52b872a32ee18 100644
5151

5252
AddUpdateDowngradeVersionItem(installer_state.root_key(), current_version,
5353
new_version, install_list);
54-
@@ -1322,10 +1324,12 @@ void AddFinalizeUpdateWorkItems(const InstallationState& original_state,
54+
@@ -1321,10 +1323,12 @@ void AddFinalizeUpdateWorkItems(const InstallationState& original_state,
5555
AddWerHelperRegistration(installer_state.root_key(),
5656
GetWerHelperPath(target_path, new_version), list);
5757

patch/0004-Fix-Grit-branding-args-for-policy_templates.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 09ce76599632777f51894548f69000c29f2d975c Mon Sep 17 00:00:00 2001
1+
From b0c07e6d032a576bd7bf2974244644e11f4f3d6f Mon Sep 17 00:00:00 2001
22
From: Hibiki Tachibana <57486057+Hibbiki@users.noreply.github.com>
33
Date: Thu, 3 Aug 2023 11:25:53 +0200
44
Subject: [PATCH 4/4] Fix Grit branding args for policy_templates

0 commit comments

Comments
 (0)