From b6610c8390ed995142ce9c18ec1b612aa86ab3b5 Mon Sep 17 00:00:00 2001 From: agentflow-marathon Date: Mon, 30 Nov 2026 00:38:47 -0800 Subject: [PATCH 1/4] Port native Windows updater and interactive qualification to Chromium 159 [skip ci] --- config/chromium-release-windows-x64.gn | 17 + config/updater/windows-identities.json | 55 ++ config/updater/windows-production.gni | 106 +++ docs/chromium-159-windows-internal.md | 35 + .../11-windows-native-updater.patch | 676 ++++++++++++++++++ scripts/verify_chromium_windows_midl.py | 23 + scripts/verify_chromium_windows_release.ps1 | 102 +++ scripts/verify_chromium_windows_toolbar.ps1 | 116 +++ scripts/verify_chromium_windows_update.mjs | 56 ++ 9 files changed, 1186 insertions(+) create mode 100644 config/chromium-release-windows-x64.gn create mode 100644 config/updater/windows-identities.json create mode 100644 config/updater/windows-production.gni create mode 100644 docs/chromium-159-windows-internal.md create mode 100644 patches/chromium/159.0.8154.13/11-windows-native-updater.patch create mode 100644 scripts/verify_chromium_windows_midl.py create mode 100644 scripts/verify_chromium_windows_release.ps1 create mode 100644 scripts/verify_chromium_windows_toolbar.ps1 create mode 100644 scripts/verify_chromium_windows_update.mjs diff --git a/config/chromium-release-windows-x64.gn b/config/chromium-release-windows-x64.gn new file mode 100644 index 0000000000..cf8d3041a6 --- /dev/null +++ b/config/chromium-release-windows-x64.gn @@ -0,0 +1,17 @@ +is_official_build=true +is_debug=false +is_component_build=false +dcheck_always_on=false +is_chrome_branded=false +target_cpu="x64" +chrome_pgo_phase=2 +symbol_level=0 +blink_symbol_level=0 +v8_symbol_level=0 +use_thin_lto=false +use_remoteexec=false +use_siso=false +devtools_bundle=true +devtools_skip_typecheck=false +enable_updater=true +browser_operator_updater_config="//third_party/devtools-frontend/src/config/updater/windows-production.gni" diff --git a/config/updater/windows-identities.json b/config/updater/windows-identities.json new file mode 100644 index 0000000000..f47e44bb89 --- /dev/null +++ b/config/updater/windows-identities.json @@ -0,0 +1,55 @@ +{ + "browser": "6A900E82-8B40-53D6-84F6-494715149889", + "updater": "CCEB6F77-92D1-55FC-A133-3C1DEB2848C3", + "qualification": "3C0FA6DC-25DE-53E0-BCE6-B84729CD65EC", + "platform-helper": "FBD32EEF-E000-58A8-B0FA-44B173CB45F3", + "prefs-mutex": "452E98F6-4823-5475-90C1-FD4863AE5CB1", + "setup-mutex": "BD98D6F5-97C1-5690-B60D-FB94A272B195", + "legacy-updater": "30C60A74-F49D-53E8-AE2D-6E0181352CD6", + "active-setup": "9B2C6864-59B1-5C80-8A80-DA6802FE61A9", + "toast": "48D9C750-53E6-55C8-907D-E141C31C3B1D", + "UpdaterLegacyLibGUID": "A392BF40-C260-526D-8FBB-0A352D12806B", + "GoogleUpdate3WebUserClassGUID": "F357D608-8537-59D6-B104-A05B6FCF8DAF", + "GoogleUpdate3WebSystemClassGUID": "EA84B8A7-B4A3-5351-B8F9-256F0AA781AA", + "GoogleUpdate3WebServiceClassGUID": "235F6FF8-B5B8-57A6-8D65-D88529A438DB", + "PolicyStatusUserClassGUID": "CEA756F8-8A4E-5B47-B7D1-5F1CC714B8ED", + "PolicyStatusSystemClassGUID": "B23DCD27-38FD-5C46-9D19-926CCFD5DDBC", + "ProcessLauncherClassGUID": "0FB9E553-2E30-5A53-BE4D-F56D77767348", + "IAppVersionWebGUID": "4891E59B-3F34-5B86-9E0C-5F56D7A3982A", + "IAppVersionWebUserGUID": "3024EFE7-0C61-598B-A1A2-E2731C93F609", + "IAppVersionWebSystemGUID": "42E87B77-C420-5883-8233-AEAAED1BE488", + "ICurrentStateGUID": "85CD7CF2-74CD-5AB8-ACEE-84B6B7773FE2", + "ICurrentStateUserGUID": "CB44F274-5CE7-5420-8F57-E341788B9E02", + "ICurrentStateSystemGUID": "FE8D89BD-3D89-5877-A0E1-75578DCAC294", + "IGoogleUpdate3WebGUID": "5630D47C-90C4-5114-AC75-A2A2CC167393", + "IGoogleUpdate3WebUserGUID": "4E768C9D-BE73-5510-8EE9-64B8FBAD35F0", + "IGoogleUpdate3WebSystemGUID": "D66770B9-A613-5F74-A0E3-9BE9919AFFD9", + "IAppBundleWebGUID": "927C6504-EC38-5691-8FDF-5F649775C3CA", + "IAppBundleWebUserGUID": "2A4B3B0A-A340-5476-8AF3-B3DC2CFFDDBC", + "IAppBundleWebSystemGUID": "E4CBBAC8-D4AC-5AB8-99A2-AA05CFB96E8C", + "IAppWebGUID": "4AC76D40-726A-53E5-89A7-F43B0F061C33", + "IAppWebUserGUID": "018B3296-91F2-5E0C-8D4E-1A3E18BEBCE7", + "IAppWebSystemGUID": "C8632C72-621E-53A2-B1EA-BEA8C5E46B47", + "IAppCommandWebGUID": "B6E1DBCC-7DF7-590E-B983-CB6A09546CBC", + "IAppCommandWebUserGUID": "C68D03FD-0ABD-5BB9-8A79-AA3D00C3DC8F", + "IAppCommandWebSystemGUID": "D38A3008-4FFC-5AAD-8395-A27BF8AB47C3", + "IPolicyStatusGUID": "472F168E-5E4A-5DDC-BE2A-6EB6015C5C21", + "IPolicyStatusUserGUID": "4F1D7E32-7568-56B3-844F-1B598AC0E8AA", + "IPolicyStatusSystemGUID": "06CC6367-9776-52AD-86FE-BCCED330C4CE", + "IPolicyStatus2GUID": "B9F671E7-61BA-55EC-9016-4B26AC7137A4", + "IPolicyStatus2UserGUID": "6DF9DB52-778E-50F3-8964-4CC1431AB268", + "IPolicyStatus2SystemGUID": "B8829064-B420-5A47-A657-6AEC728000F2", + "IPolicyStatus3GUID": "9C03AE6B-C5AE-5A83-9313-AFB932DC450C", + "IPolicyStatus3UserGUID": "AB76F0BC-8BDB-560B-B093-5ACD58749065", + "IPolicyStatus3SystemGUID": "34E91666-F4BE-57A8-A06B-64A5AE265CFF", + "IPolicyStatus4GUID": "3F290530-620D-5919-A69D-5EF1AD92F883", + "IPolicyStatus4UserGUID": "A68C57B2-7BBF-5A74-A77B-7C981682B9AD", + "IPolicyStatus4SystemGUID": "9302E136-E067-51ED-BDD9-0A6FB4A1E2DA", + "IPolicyStatusValueGUID": "1E5A4C31-7141-5CD9-ACBE-147E7BC04B92", + "IPolicyStatusValueUserGUID": "6244E00C-BFCD-5E39-8A00-1D7DE187DED5", + "IPolicyStatusValueSystemGUID": "A5321DB9-0899-5E6B-A335-19BC5004D35A", + "IProcessLauncherGUID": "B3BB104D-D0D8-5CFC-B89B-6A7EE1D474A8", + "IProcessLauncherSystemGUID": "C45E6B19-8937-57FD-9C3A-41606196B47B", + "IProcessLauncher2GUID": "E6EC844C-FE2E-5022-8CC4-D4257835BC3F", + "IProcessLauncher2SystemGUID": "703B1610-C2E6-5A30-8AA6-98628865A4BC" +} diff --git a/config/updater/windows-production.gni b/config/updater/windows-production.gni new file mode 100644 index 0000000000..4c34cad8fa --- /dev/null +++ b/config/updater/windows-production.gni @@ -0,0 +1,106 @@ +# Stable Windows identity. Public verification roots are shared with macOS; +# no signing credentials are stored in either file. +import("macos-production.gni") +assert(is_win) +browser_operator_updater_branding.updater_appid = + "{CCEB6F77-92D1-55FC-A133-3C1DEB2848C3}" +browser_operator_updater_branding.browser_appid = + "{6A900E82-8B40-53D6-84F6-494715149889}" +browser_operator_updater_branding.qualification_appid = + "{3C0FA6DC-25DE-53E0-BCE6-B84729CD65EC}" +browser_operator_updater_branding.platform_experience_helper_appid = + "{FBD32EEF-E000-58A8-B0FA-44B173CB45F3}" +browser_operator_updater_branding.prefs_access_mutex = + "{452E98F6-4823-5475-90C1-FD4863AE5CB1}" +browser_operator_updater_branding.setup_mutex_prefix = + "{BD98D6F5-97C1-5690-B60D-FB94A272B195}" +browser_operator_updater_branding.legacy_google_update_appid = + "{30C60A74-F49D-53E8-AE2D-6E0181352CD6}" +browser_operator_updater_branding.UpdaterLegacyLibGUID = + "A392BF40-C260-526D-8FBB-0A352D12806B" +browser_operator_updater_branding.GoogleUpdate3WebUserClassGUID = + "F357D608-8537-59D6-B104-A05B6FCF8DAF" +browser_operator_updater_branding.GoogleUpdate3WebSystemClassGUID = + "EA84B8A7-B4A3-5351-B8F9-256F0AA781AA" +browser_operator_updater_branding.GoogleUpdate3WebServiceClassGUID = + "235F6FF8-B5B8-57A6-8D65-D88529A438DB" +browser_operator_updater_branding.PolicyStatusUserClassGUID = + "CEA756F8-8A4E-5B47-B7D1-5F1CC714B8ED" +browser_operator_updater_branding.PolicyStatusSystemClassGUID = + "B23DCD27-38FD-5C46-9D19-926CCFD5DDBC" +browser_operator_updater_branding.ProcessLauncherClassGUID = + "0FB9E553-2E30-5A53-BE4D-F56D77767348" +browser_operator_updater_branding.IAppVersionWebGUID = + "4891E59B-3F34-5B86-9E0C-5F56D7A3982A" +browser_operator_updater_branding.IAppVersionWebUserGUID = + "3024EFE7-0C61-598B-A1A2-E2731C93F609" +browser_operator_updater_branding.IAppVersionWebSystemGUID = + "42E87B77-C420-5883-8233-AEAAED1BE488" +browser_operator_updater_branding.ICurrentStateGUID = + "85CD7CF2-74CD-5AB8-ACEE-84B6B7773FE2" +browser_operator_updater_branding.ICurrentStateUserGUID = + "CB44F274-5CE7-5420-8F57-E341788B9E02" +browser_operator_updater_branding.ICurrentStateSystemGUID = + "FE8D89BD-3D89-5877-A0E1-75578DCAC294" +browser_operator_updater_branding.IGoogleUpdate3WebGUID = + "5630D47C-90C4-5114-AC75-A2A2CC167393" +browser_operator_updater_branding.IGoogleUpdate3WebUserGUID = + "4E768C9D-BE73-5510-8EE9-64B8FBAD35F0" +browser_operator_updater_branding.IGoogleUpdate3WebSystemGUID = + "D66770B9-A613-5F74-A0E3-9BE9919AFFD9" +browser_operator_updater_branding.IAppBundleWebGUID = + "927C6504-EC38-5691-8FDF-5F649775C3CA" +browser_operator_updater_branding.IAppBundleWebUserGUID = + "2A4B3B0A-A340-5476-8AF3-B3DC2CFFDDBC" +browser_operator_updater_branding.IAppBundleWebSystemGUID = + "E4CBBAC8-D4AC-5AB8-99A2-AA05CFB96E8C" +browser_operator_updater_branding.IAppWebGUID = + "4AC76D40-726A-53E5-89A7-F43B0F061C33" +browser_operator_updater_branding.IAppWebUserGUID = + "018B3296-91F2-5E0C-8D4E-1A3E18BEBCE7" +browser_operator_updater_branding.IAppWebSystemGUID = + "C8632C72-621E-53A2-B1EA-BEA8C5E46B47" +browser_operator_updater_branding.IAppCommandWebGUID = + "B6E1DBCC-7DF7-590E-B983-CB6A09546CBC" +browser_operator_updater_branding.IAppCommandWebUserGUID = + "C68D03FD-0ABD-5BB9-8A79-AA3D00C3DC8F" +browser_operator_updater_branding.IAppCommandWebSystemGUID = + "D38A3008-4FFC-5AAD-8395-A27BF8AB47C3" +browser_operator_updater_branding.IPolicyStatusGUID = + "472F168E-5E4A-5DDC-BE2A-6EB6015C5C21" +browser_operator_updater_branding.IPolicyStatusUserGUID = + "4F1D7E32-7568-56B3-844F-1B598AC0E8AA" +browser_operator_updater_branding.IPolicyStatusSystemGUID = + "06CC6367-9776-52AD-86FE-BCCED330C4CE" +browser_operator_updater_branding.IPolicyStatus2GUID = + "B9F671E7-61BA-55EC-9016-4B26AC7137A4" +browser_operator_updater_branding.IPolicyStatus2UserGUID = + "6DF9DB52-778E-50F3-8964-4CC1431AB268" +browser_operator_updater_branding.IPolicyStatus2SystemGUID = + "B8829064-B420-5A47-A657-6AEC728000F2" +browser_operator_updater_branding.IPolicyStatus3GUID = + "9C03AE6B-C5AE-5A83-9313-AFB932DC450C" +browser_operator_updater_branding.IPolicyStatus3UserGUID = + "AB76F0BC-8BDB-560B-B093-5ACD58749065" +browser_operator_updater_branding.IPolicyStatus3SystemGUID = + "34E91666-F4BE-57A8-A06B-64A5AE265CFF" +browser_operator_updater_branding.IPolicyStatus4GUID = + "3F290530-620D-5919-A69D-5EF1AD92F883" +browser_operator_updater_branding.IPolicyStatus4UserGUID = + "A68C57B2-7BBF-5A74-A77B-7C981682B9AD" +browser_operator_updater_branding.IPolicyStatus4SystemGUID = + "9302E136-E067-51ED-BDD9-0A6FB4A1E2DA" +browser_operator_updater_branding.IPolicyStatusValueGUID = + "1E5A4C31-7141-5CD9-ACBE-147E7BC04B92" +browser_operator_updater_branding.IPolicyStatusValueUserGUID = + "6244E00C-BFCD-5E39-8A00-1D7DE187DED5" +browser_operator_updater_branding.IPolicyStatusValueSystemGUID = + "A5321DB9-0899-5E6B-A335-19BC5004D35A" +browser_operator_updater_branding.IProcessLauncherGUID = + "B3BB104D-D0D8-5CFC-B89B-6A7EE1D474A8" +browser_operator_updater_branding.IProcessLauncherSystemGUID = + "C45E6B19-8937-57FD-9C3A-41606196B47B" +browser_operator_updater_branding.IProcessLauncher2GUID = + "E6EC844C-FE2E-5022-8CC4-D4257835BC3F" +browser_operator_updater_branding.IProcessLauncher2SystemGUID = + "703B1610-C2E6-5A30-8AA6-98628865A4BC" diff --git a/docs/chromium-159-windows-internal.md b/docs/chromium-159-windows-internal.md new file mode 100644 index 0000000000..4a5b7c6e8d --- /dev/null +++ b/docs/chromium-159-windows-internal.md @@ -0,0 +1,35 @@ +# Chromium159 Windows internal qualification + +Target Chromium159.0.8154.13, product0.7.0, x64. The unsigned installer is for +internal testing only. Auto-update remains enabled at the permanent production +HTTPS/CUP endpoint. No release publication or updater catalog promotion is +allowed before the owner merges the reviewed source and driver PRs. + +The Windows native patch is ported from the qualified158 source at +`eed6438f9cbfa4bfc7fe239f2f146581b5fef5c4`. It preserves the permanent browser, +updater, COM and mutex identities. The159 DevTools optional initiator and stock +security policy remain in place. macOS inputs and completed DMGs are separate. + +The shared build driver pins the upstream tag, frontend and helper revisions, +patch family, branding archive, GN configuration and trust roots. Its Windows +build stage compiles the browser, mini-installer and updater, verifies embedded +payload hashes, then retains an explicitly unsigned internal installer. +Installed qualification runs separately as a standard interactive desktop user; +batch/session0 success cannot qualify the app or COM updater. + +Required desktop evidence: native AI toolbar opens, first-run Skip, panel close +and reopen, a nonblank screenshot, AI JavaScript/accessibility/screenshot tools, +0.7.0 native update entry opening About, privileged URL denials, installed updater +payload and registration hashes, real native HTTPS/CUP check, wake task and +startup registration. Evidence must match this exact engine, frontend SHA and +installer SHA before the shared driver marks the internal candidate passed. + +A `noupdate` response proves a native update check, not a Windows upgrade install. +The current server has no promoted Windows update payload. Actual159 offer and +installation testing remains a separate gate. Windows Server desktop testing +also does not establish qualification on physical Windows10/11 hardware. + +Local preflight: all11 patches check in order against pristine159; MIDL +normalization and patch regression tests pass. Paid VM creation waits for the +independent reviewer. Runtime results and artifact hashes will be added after +Windows execution; no build or runtime pass is claimed by these source checks. diff --git a/patches/chromium/159.0.8154.13/11-windows-native-updater.patch b/patches/chromium/159.0.8154.13/11-windows-native-updater.patch new file mode 100644 index 0000000000..023284ce67 --- /dev/null +++ b/patches/chromium/159.0.8154.13/11-windows-native-updater.patch @@ -0,0 +1,676 @@ +diff --git a/build/toolchain/win/midl.py b/build/toolchain/win/midl.py +index 370e5ad..96519f4 100644 +--- a/build/toolchain/win/midl.py ++++ b/build/toolchain/win/midl.py +@@ -274,6 +274,17 @@ def generate_idl_from_template(idl_template, dynamic_guids, idl): + + # This function runs the MIDL compiler with the provided arguments. It creates + # and returns a tuple of |0,midl_output_dir| on success. ++def NormalizeDynamicIdlComment(contents, original_idl, generated_idl): ++ # Branding an existing .idl relocates the compiler input to gen/. Only ++ # normalize that provenance comment; declarations and GUIDs stay compared. ++ # Existing .template inputs already have gen/ paths in their baselines. ++ if not original_idl.endswith('.idl'): ++ return contents ++ generated = b'/* Compiler settings for ' + generated_idl.encode() + b':' ++ original = b'/* Compiler settings for ' + original_idl.encode() + b':' ++ return contents.replace(generated, original) ++ ++ + def run_midl(args, env_dict): + midl_output_dir = tempfile.mkdtemp() + delete_midl_output_dir = True +@@ -500,6 +511,16 @@ def main( + if returncode != 0: + return returncode + ++ if idl_template: ++ for filename in (h, iid): ++ if filename: ++ path = os.path.join(midl_output_dir, filename) ++ with open(path, 'rb') as output: ++ contents = output.read() ++ with open(path, 'wb') as output: ++ output.write(NormalizeDynamicIdlComment( ++ contents, idl_template, idl)) ++ + # Now compare the output in midl_output_dir to the copied-over outputs. + _, mismatch, errors = filecmp.cmpfiles( + midl_output_dir, outdir, common_files +diff --git a/chrome/browser/devtools/BUILD.gn b/chrome/browser/devtools/BUILD.gn +index 6cab394..328a567 100644 +--- a/chrome/browser/devtools/BUILD.gn ++++ b/chrome/browser/devtools/BUILD.gn +@@ -139,6 +139,8 @@ static_library("devtools") { + + deps = [ + "//base", ++ "//chrome/browser:buildflags", ++ "//chrome/browser/ui:chrome_pages", + "//chrome/browser:file_select_helper", + "//chrome/browser/infobars", + "//chrome/browser/lifetime", +diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc +index 708341d..5b7f107 100644 +--- a/chrome/browser/devtools/devtools_ui_bindings.cc ++++ b/chrome/browser/devtools/devtools_ui_bindings.cc +@@ -1458,7 +1458,7 @@ void DevToolsUIBindings::OpenInNewTab( + const std::string& url, + const std::optional& initiator_id) { + GURL gurl(url); +-#if BUILDFLAG(IS_MAC) && BUILDFLAG(ENABLE_UPDATER) ++#if (BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)) && BUILDFLAG(ENABLE_UPDATER) + // The shipped Browser Operator panel may open only the fixed native update + // page. Remote/custom frontends and all other chrome:// URLs retain the + // standard request policy below. +@@ -2414,7 +2414,7 @@ base::DictValue DevToolsUIBindings::GetHostConfigDictionary(Profile* profile) { + + void DevToolsUIBindings::GetHostConfig(DispatchCallback callback) { + base::DictValue config = GetHostConfigDictionary(profile_); +-#if BUILDFLAG(IS_MAC) && BUILDFLAG(ENABLE_UPDATER) ++#if (BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)) && BUILDFLAG(ENABLE_UPDATER) + if (is_local_frontend_ && !profile_->IsSystemProfile() && web_contents_) { + const GURL& frontend = web_contents_->GetLastCommittedURL(); + if (frontend.SchemeIs(content::kChromeDevToolsScheme) && +diff --git a/chrome/browser/ui/webui/help/BUILD.gn b/chrome/browser/ui/webui/help/BUILD.gn +index 45aa604..e026cb4 100644 +--- a/chrome/browser/ui/webui/help/BUILD.gn ++++ b/chrome/browser/ui/webui/help/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//chrome/common/features.gni") ++import("//chrome/updater/branding.gni") + + source_set("help") { + public = [ "version_updater.h" ] +@@ -53,7 +54,7 @@ source_set("help") { + } + + if (is_win) { +- if (is_chrome_branded) { ++ if (is_chrome_branded || browser_operator_updater_config != "") { + sources = [ "version_updater_win.cc" ] + deps += [ + "//chrome/app:generated_resources_grit", +diff --git a/chrome/elevation_service/BUILD.gn b/chrome/elevation_service/BUILD.gn +index 0ce72b2..d4f2fea 100644 +--- a/chrome/elevation_service/BUILD.gn ++++ b/chrome/elevation_service/BUILD.gn +@@ -6,10 +6,15 @@ import("//build/config/chrome_build.gni") + import("//build/config/ui.gni") + import("//build/toolchain/win/midl.gni") + import("//chrome/process_version_rc_template.gni") ++import("//chrome/updater/branding.gni") + import("//testing/libfuzzer/fuzzer_test.gni") + import("//testing/test.gni") + + midl("elevation_service_idl") { ++ if (browser_operator_updater_config != "") { ++ dynamic_guids = "ignore_proxy_stub,BB19A0E5-00C6-4966-94B2-5AFEC6FED93A=DF13BDBE-D910-5F85-93E8-9A1FDC67192D,0014D784-7012-4A79-8AB6-ADDB8193A06E=98F8B270-AA59-5C5F-9C69-3E2B5F104DC9" ++ } ++ + sources = [ "elevation_service_idl.idl" ] + + writes_tlb = true +diff --git a/chrome/install_static/BUILD.gn b/chrome/install_static/BUILD.gn +index e01fe13..27c6838 100644 +--- a/chrome/install_static/BUILD.gn ++++ b/chrome/install_static/BUILD.gn +@@ -5,13 +5,16 @@ + import("//build/buildflag_header.gni") + import("//build/config/chrome_build.gni") + import("//testing/test.gni") ++import("//chrome/updater/branding.gni") + + buildflag_header("buildflags") { + header = "buildflags.h" +- if (is_chrome_branded && is_win) { +- flags = [ "USE_GOOGLE_UPDATE_INTEGRATION=true" ] ++ browser_operator_windows_updates = is_win && browser_operator_updater_config != "" ++ flags = [ "BROWSER_OPERATOR_UPDATE_INTEGRATION=$browser_operator_windows_updates" ] ++ if ((is_chrome_branded || browser_operator_windows_updates) && is_win) { ++ flags += [ "USE_GOOGLE_UPDATE_INTEGRATION=true" ] + } else { +- flags = [ "USE_GOOGLE_UPDATE_INTEGRATION=false" ] ++ flags += [ "USE_GOOGLE_UPDATE_INTEGRATION=false" ] + } + } + +@@ -54,6 +57,8 @@ if (is_win) { + sources += [ "google_chrome_install_modes.h" ] + } else if (is_chrome_for_testing_branded) { + sources += [ "google_chrome_for_testing_install_modes.h" ] ++ } else if (browser_operator_updater_config != "") { ++ sources += [ "browser_operator_install_modes.h" ] + } else { + sources += [ "chromium_install_modes.h" ] + } +diff --git a/chrome/install_static/browser_operator_install_modes.h b/chrome/install_static/browser_operator_install_modes.h +new file mode 100644 +index 0000000..f2f3d21 +--- /dev/null ++++ b/chrome/install_static/browser_operator_install_modes.h +@@ -0,0 +1,104 @@ ++// Copyright 2016 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++// Brand-specific types and constants for Chromium. ++ ++#ifndef CHROME_INSTALL_STATIC_BROWSER_OPERATOR_INSTALL_MODES_H_ ++#define CHROME_INSTALL_STATIC_BROWSER_OPERATOR_INSTALL_MODES_H_ ++ ++#include ++#include ++ ++#include "chrome/app/chrome_dll_resource.h" ++#include "chrome/common/chrome_icon_resources_win.h" ++#include "chrome/install_static/install_constants.h" ++ ++namespace install_static { ++ ++// The brand-specific company name to be included as a component of the install ++// and user data directory paths. May be empty if no such dir is to be used. ++inline constexpr wchar_t kCompanyPathName[] = L"BrowserOperator"; ++ ++// The brand-specific product name to be included as a component of the install ++// and user data directory paths. ++inline constexpr wchar_t kProductPathName[] = L"Browser Operator"; ++ ++// The brand-specific safe browsing client name. ++inline constexpr char kSafeBrowsingName[] = "chromium"; ++ ++// Note: This list of indices must be kept in sync with the brand-specific ++// resource strings in chrome/installer/util/prebuild/create_string_rc. ++enum InstallConstantIndex { ++ CHROMIUM_INDEX, ++ NUM_INSTALL_MODES, ++}; ++ ++inline constexpr auto kOldTracingServiceIids = std::to_array({ ++ // Replaced in 2026-09. Delete after 2028-09. ++ // {A3FD580A-FFD4-4075-9174-75D0B199D3CB} ++ {0xa3fd580a, ++ 0xffd4, ++ 0x4075, ++ {0x91, 0x74, 0x75, 0xd0, 0xb1, 0x99, 0xd3, 0xcb}}, ++}); ++ ++inline constexpr auto kInstallModes = std::to_array({ ++ // The primary (and only) install mode for Chromium. ++ { ++ .size = sizeof(InstallConstants), ++ .index = CHROMIUM_INDEX, // The one and only mode for Chromium. ++ .install_switch = ++ "", // No install switch for the primary install mode. ++ .install_suffix = ++ L"", // Empty install_suffix for the primary install mode. ++ .logo_suffix = L"", // No logo suffix for the primary install mode. ++ .app_guid = ++ L"{6A900E82-8B40-53D6-84F6-494715149889}", // Browser Operator update identity. ++ .base_app_name = L"Browser Operator", // A distinct base_app_name. ++ .base_app_id = L"BrowserOperator", // A distinct base_app_id. ++ .browser_prog_id_prefix = L"BrowserOpHTM", // Browser ProgID prefix. ++ .browser_prog_id_description = ++ L"Browser Operator HTML Document", // Browser ProgID description. ++ .direct_launch_url_scheme = "browseroperator", ++ .pdf_prog_id_prefix = L"BrowserOpPDF", // PDF ProgID prefix. ++ .pdf_prog_id_description = ++ L"Browser Operator PDF Document", // PDF ProgID description. ++ .active_setup_guid = ++ L"{9B2C6864-59B1-5C80-8A80-DA6802FE61A9}", // Active Setup ++ // GUID. ++ .toast_activator_clsid = {0x48d9c750, 0x53e6, 0x55c8, {0x90, 0x7d, 0xe1, 0x41, 0xc3, 0x1c, 0x3b, 0x1d}}, // Toast Activator CLSID. ++ .elevator_clsid = {0x79cf1b84, 0xb4c0, 0x5d9e, {0xa5, 0x52, 0x03, 0x9a, 0x23, 0x09, 0x7b, 0x70}}, ++ .elevator_iid = {0xdf13bdbe, 0xd910, 0x5f85, {0x93, 0xe8, 0x9a, 0x1f, 0xdc, 0x67, 0x19, 0x2d}}, ++ .old_elevator_iids = {}, ++ .tracing_service_clsid = {0x62f56917, 0x30da, 0x536a, {0xa9, 0x36, 0x90, 0x33, 0x1c, 0x11, 0x18, 0x34}}, ++ .tracing_service_iid = {0xa6191323, 0x484b, 0x567f, {0xa2, 0xfa, 0x28, 0xa9, 0x9f, 0xd7, 0x6c, 0xaf}}, ++ .old_tracing_service_iids = {}, ++ .default_channel_name = ++ L"", // Empty default channel name since no update integration. ++ .channel_strategy = ChannelStrategy::FIXED, ++ .supports_system_level = true, // Supports system-level installs. ++ .supports_set_as_default_browser = ++ true, // Supports in-product set as default browser UX. ++ .app_icon_resource_index = ++ icon_resources::kApplicationIndex, // App icon resource index. ++ .app_icon_resource_id = IDR_MAINFRAME, // App icon resource id. ++ .html_doc_icon_resource_index = ++ icon_resources::kHtmlDocIndex, // HTML doc icon resource index. ++ .pdf_doc_icon_resource_index = ++ icon_resources::kPDFDocIndex, // PDF doc icon resource index. ++ .sandbox_sid_prefix = ++ L"S-1-15-2-3486774053-2428884997-534694156-2855730961-431531788-1642304090-1315250560-", // Browser Operator app container. ++ }, ++}); ++ ++// Windows limits ProgIds to 39 characters. Chromium appends a dot and ++// a 26-character user hash for per-user registration. ++static_assert(std::wstring_view(kInstallModes[0].browser_prog_id_prefix).size() + ++ 27 <= 39); ++static_assert(std::wstring_view(kInstallModes[0].pdf_prog_id_prefix).size() + ++ 27 <= 39); ++ ++} // namespace install_static ++ ++#endif // CHROME_INSTALL_STATIC_BROWSER_OPERATOR_INSTALL_MODES_H_ +diff --git a/chrome/install_static/install_modes.cc b/chrome/install_static/install_modes.cc +index bdd057b..3dafdb5 100644 +--- a/chrome/install_static/install_modes.cc ++++ b/chrome/install_static/install_modes.cc +@@ -6,22 +6,28 @@ + + #include "chrome/install_static/buildflags.h" + ++#if BUILDFLAG(BROWSER_OPERATOR_UPDATE_INTEGRATION) ++#define BROWSER_OPERATOR_UPDATE_ROOT L"Software\\BrowserOperator\\Update" ++#else ++#define BROWSER_OPERATOR_UPDATE_ROOT L"Software\\Google\\Update" ++#endif ++ + namespace install_static { + + namespace { + + #if BUILDFLAG(USE_GOOGLE_UPDATE_INTEGRATION) + std::wstring GetClientsKeyPathForApp(const wchar_t* app_guid) { +- return std::wstring(L"Software\\Google\\Update\\Clients\\").append(app_guid); ++ return std::wstring(BROWSER_OPERATOR_UPDATE_ROOT L"\\Clients\\").append(app_guid); + } + + std::wstring GetClientStateKeyPathForApp(const wchar_t* app_guid) { +- return std::wstring(L"Software\\Google\\Update\\ClientState\\") ++ return std::wstring(BROWSER_OPERATOR_UPDATE_ROOT L"\\ClientState\\") + .append(app_guid); + } + + std::wstring GetClientStateMediumKeyPathForApp(const wchar_t* app_guid) { +- return std::wstring(L"Software\\Google\\Update\\ClientStateMedium\\") ++ return std::wstring(BROWSER_OPERATOR_UPDATE_ROOT L"\\ClientStateMedium\\") + .append(app_guid); + } + #else +diff --git a/chrome/install_static/install_modes.h b/chrome/install_static/install_modes.h +index d2a8f59..f186278 100644 +--- a/chrome/install_static/install_modes.h ++++ b/chrome/install_static/install_modes.h +@@ -33,6 +33,7 @@ + #include + + #include "build/branding_buildflags.h" ++#include "chrome/install_static/buildflags.h" + + // Include the brand-specific values. Each of these must define: + // - kCompanyPathName, kProductPathName and kSafeBrowsingName constants. +@@ -44,6 +45,8 @@ + #include "chrome/install_static/google_chrome_install_modes.h" + #elif BUILDFLAG(GOOGLE_CHROME_FOR_TESTING_BRANDING) + #include "chrome/install_static/google_chrome_for_testing_install_modes.h" ++#elif BUILDFLAG(BROWSER_OPERATOR_UPDATE_INTEGRATION) ++#include "chrome/install_static/browser_operator_install_modes.h" + #else + #include "chrome/install_static/chromium_install_modes.h" + #endif +diff --git a/chrome/installer/mini_installer/BUILD.gn b/chrome/installer/mini_installer/BUILD.gn +index df9408b..fd0b185 100644 +--- a/chrome/installer/mini_installer/BUILD.gn ++++ b/chrome/installer/mini_installer/BUILD.gn +@@ -7,6 +7,7 @@ import("//build/config/python.gni") + import("//build/config/ui.gni") + import("//build/timestamp.gni") + import("//chrome/process_version_rc_template.gni") ++import("//chrome/updater/branding.gni") + import("//third_party/dawn/scripts/dawn_features.gni") + import("//third_party/ffmpeg/ffmpeg_options.gni") + import("//third_party/icu/config.gni") +@@ -71,6 +72,7 @@ source_set("lib") { + + deps = [ + "//base:compiler_specific", ++ "//chrome/install_static:buildflags", + "//build:branding_buildflags", + ] + +@@ -200,6 +202,11 @@ action("mini_installer_archive") { + "//third_party/icu:icudata", + ] + ++ if (browser_operator_updater_config != "") { ++ inputs += [ "$root_out_dir/UpdaterSetup.exe" ] ++ deps += [ "//chrome/updater/win/installer" ] ++ } ++ + if (enable_hidpi) { + args += [ "--enable_hidpi=1" ] + } +@@ -263,6 +270,7 @@ source_set("mini_installer_sources") { + ":lib", + "//base:clang_profiling_buildflags", + "//base:compiler_specific", ++ "//chrome/install_static:buildflags", + ] + configs -= [ "//build/config/compiler:default_init_stack_vars" ] + configs += [ ":mini_installer_compiler_flags" ] +diff --git a/chrome/installer/mini_installer/chrome.release b/chrome/installer/mini_installer/chrome.release +index 33e8546..6ff15cd 100644 +--- a/chrome/installer/mini_installer/chrome.release ++++ b/chrome/installer/mini_installer/chrome.release +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + [GENERAL] ++UpdaterSetup.exe: %(VersionDir)s\ + # + # Chrome Application dir entries, sorted alphabetically. + # +diff --git a/chrome/installer/mini_installer/chrome_appid.cc b/chrome/installer/mini_installer/chrome_appid.cc +index 8875c8f..10c1f82 100644 +--- a/chrome/installer/mini_installer/chrome_appid.cc ++++ b/chrome/installer/mini_installer/chrome_appid.cc +@@ -5,6 +5,7 @@ + #include "chrome/installer/mini_installer/appid.h" + + #include "build/branding_buildflags.h" ++#include "chrome/install_static/buildflags.h" + + namespace google_update { + +@@ -13,6 +14,8 @@ const wchar_t kAppGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}"; + const wchar_t kBetaAppGuid[] = L"{8237E44A-0054-442C-B6B6-EA0509993955}"; + const wchar_t kDevAppGuid[] = L"{401C381F-E0DE-4B85-8BD8-3F3F14FBDA57}"; + const wchar_t kSxSAppGuid[] = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}"; ++#elif BUILDFLAG(BROWSER_OPERATOR_UPDATE_INTEGRATION) ++const wchar_t kAppGuid[] = L"{6A900E82-8B40-53D6-84F6-494715149889}"; + #else // BUILDFLAG(GOOGLE_CHROME_BRANDING) + const wchar_t kAppGuid[] = L""; + #endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) +diff --git a/chrome/installer/mini_installer/mini_installer.cc b/chrome/installer/mini_installer/mini_installer.cc +index c37d8d1..4011f2b 100644 +--- a/chrome/installer/mini_installer/mini_installer.cc ++++ b/chrome/installer/mini_installer/mini_installer.cc +@@ -42,6 +42,7 @@ + #include + + #include "build/branding_buildflags.h" ++#include "chrome/install_static/buildflags.h" + #include "chrome/installer/mini_installer/appid.h" + #include "chrome/installer/mini_installer/configuration.h" + #include "chrome/installer/mini_installer/decompress.h" +@@ -68,7 +69,7 @@ void DeleteWithRetryAndMetrics(const wchar_t* path, int& max_delete_attempts) { + // TODO(grt): Frame this in terms of whether or not the brand supports + // integration with Omaha, where Google Update is the Google-specific fork of + // the open-source Omaha project. +-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) ++#if BUILDFLAG(USE_GOOGLE_UPDATE_INTEGRATION) + // Opens the Google Update ClientState key for the current install mode. + bool OpenInstallStateKey(const Configuration& configuration, RegKey* key) { + const HKEY root_key = +@@ -749,7 +750,7 @@ ProcessExitResult WMain(HMODULE module) { + DeleteExtractedFiles(module, setup_path, base_path, max_delete_attempts); + } + +-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) ++#if BUILDFLAG(USE_GOOGLE_UPDATE_INTEGRATION) + if (exit_code.IsSuccess()) { + // Send up a signal in ExtraCode1 upon successful install indicating the + // maximum number of retries needed to delete a file or directory by +diff --git a/chrome/installer/mini_installer/mini_installer_constants.cc b/chrome/installer/mini_installer/mini_installer_constants.cc +index ed57860..ec17a63 100644 +--- a/chrome/installer/mini_installer/mini_installer_constants.cc ++++ b/chrome/installer/mini_installer/mini_installer_constants.cc +@@ -5,6 +5,7 @@ + #include "chrome/installer/mini_installer/mini_installer_constants.h" + + #include "build/branding_buildflags.h" ++#include "chrome/install_static/buildflags.h" + + namespace mini_installer { + +@@ -56,6 +57,10 @@ const wchar_t kClientStateKeyBase[] = + L"Software\\Google\\Update\\ClientState\\"; + // The path to the key in which kCleanupRegistryValue is found. + const wchar_t kCleanupRegistryKey[] = L"Software\\Google"; ++#elif BUILDFLAG(BROWSER_OPERATOR_UPDATE_INTEGRATION) ++const wchar_t kClientsKeyBase[] = L"Software\\BrowserOperator\\Update\\Clients\\"; ++const wchar_t kClientStateKeyBase[] = L"Software\\BrowserOperator\\Update\\ClientState\\"; ++const wchar_t kCleanupRegistryKey[] = L"Software\\BrowserOperator"; + #elif BUILDFLAG(GOOGLE_CHROME_FOR_TESTING_BRANDING) + // The path to the key containing each app's Clients registry key. + // No trailing slash on this one because the app's GUID is not appended. +diff --git a/chrome/installer/mini_installer/regkey.cc b/chrome/installer/mini_installer/regkey.cc +index e9d8af1..c309a5a 100644 +--- a/chrome/installer/mini_installer/regkey.cc ++++ b/chrome/installer/mini_installer/regkey.cc +@@ -6,6 +6,7 @@ + + #include "base/compiler_specific.h" + #include "build/branding_buildflags.h" ++#include "chrome/install_static/buildflags.h" + #include "chrome/installer/mini_installer/mini_installer_constants.h" + #include "chrome/installer/mini_installer/mini_string.h" + +@@ -85,7 +86,7 @@ LONG OpenClientsKey(HKEY root_key, + StackString clients_key; + if (!clients_key.assign(kClientsKeyBase)) + return ERROR_BUFFER_OVERFLOW; +-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) ++#if BUILDFLAG(USE_GOOGLE_UPDATE_INTEGRATION) + if (!clients_key.append(app_guid)) + return ERROR_BUFFER_OVERFLOW; + #endif +@@ -100,7 +101,7 @@ LONG OpenClientStateKey(HKEY root_key, + StackString client_state_key; + if (!client_state_key.assign(kClientStateKeyBase)) + return ERROR_BUFFER_OVERFLOW; +-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) ++#if BUILDFLAG(USE_GOOGLE_UPDATE_INTEGRATION) + if (!client_state_key.append(app_guid)) + return ERROR_BUFFER_OVERFLOW; + #endif +diff --git a/chrome/installer/setup/BUILD.gn b/chrome/installer/setup/BUILD.gn +index e7e695f..0560441 100644 +--- a/chrome/installer/setup/BUILD.gn ++++ b/chrome/installer/setup/BUILD.gn +@@ -5,6 +5,7 @@ + import("//build/buildflag_header.gni") + import("//build/config/chrome_build.gni") + import("//chrome/process_version_rc_template.gni") ++import("//chrome/updater/branding.gni") + import("//services/webnn/features.gni") + import("//testing/test.gni") + +@@ -143,7 +144,7 @@ if (is_win) { + deps += [ "//services/webnn/public/cpp:win" ] + } + +- if (is_chrome_branded) { ++ if (is_chrome_branded || browser_operator_updater_config != "") { + sources += [ + "channel_override_work_item.cc", + "channel_override_work_item.h", +diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc +index 9249a5b..28e01dc 100644 +--- a/chrome/installer/setup/setup_main.cc ++++ b/chrome/installer/setup/setup_main.cc +@@ -61,6 +61,7 @@ + #include "base/win/scoped_handle.h" + #include "base/win/windows_handle_util.h" + #include "build/branding_buildflags.h" ++#include "chrome/install_static/buildflags.h" + #include "build/build_config.h" + #include "chrome/browser/enterprise/connectors/device_trust/key_management/core/network/win_key_network_delegate.h" + #include "chrome/browser/enterprise/connectors/device_trust/key_management/installer/key_rotation_manager.h" +@@ -1445,6 +1446,42 @@ InstallStatus InstallProductsHelper(InstallationState& original_state, + } + } + ++#if BUILDFLAG(BROWSER_OPERATOR_UPDATE_INTEGRATION) ++ if (InstallUtil::GetInstallReturnCode(install_status) == 0) { ++ // This product owns a separate updater and registry tree. Never bootstrap ++ // Google's updater or rely on a developer's machine-wide installation. ++ base::win::RegKey updater_key; ++ std::wstring updater_version; ++ const bool registered = ++ updater_key.Open(system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, ++ L"Software\\BrowserOperator\\Update\\Clients\\{CCEB6F77-92D1-55FC-A133-3C1DEB2848C3}", ++ KEY_READ | KEY_WOW64_32KEY) == ERROR_SUCCESS && ++ updater_key.ReadValue(L"pv", &updater_version) == ERROR_SUCCESS && ++ !updater_version.empty(); ++ if (!registered) { ++ base::CommandLine updater_setup( ++ installer_state.target_path() ++ .AppendASCII(installer_version->GetString()) ++ .Append(L"UpdaterSetup.exe")); ++ updater_setup.AppendSwitch("install"); ++ updater_setup.AppendSwitch("silent"); ++ if (system_install) { ++ updater_setup.AppendSwitch("system"); ++ } ++ base::Process process = base::LaunchProcess(updater_setup, {}); ++ int exit_code = -1; ++ if (!process.IsValid() || ++ !process.WaitForExitWithTimeout(base::Minutes(3), &exit_code) || ++ exit_code != 0) { ++ LOG(ERROR) << "Browser Operator updater installation failed: " << exit_code; ++ install_status = INSTALL_FAILED; ++ installer_state.WriteInstallerResult( ++ install_status, IDS_INSTALL_FAILED_BASE, nullptr); ++ } ++ } ++ } ++#endif ++ + // If the installation completed successfully... + if (InstallUtil::GetInstallReturnCode(install_status) == 0) { + // Update the installer properties created by an MSI-based install. +diff --git a/chrome/installer/util/google_update_constants.cc b/chrome/installer/util/google_update_constants.cc +index d29b9e2..1a838b4 100644 +--- a/chrome/installer/util/google_update_constants.cc ++++ b/chrome/installer/util/google_update_constants.cc +@@ -3,6 +3,13 @@ + // found in the LICENSE file. + + #include "chrome/installer/util/google_update_constants.h" ++#include "chrome/install_static/buildflags.h" ++ ++#if BUILDFLAG(BROWSER_OPERATOR_UPDATE_INTEGRATION) ++#define BROWSER_OPERATOR_UPDATE_ROOT L"Software\\BrowserOperator\\Update" ++#else ++#define BROWSER_OPERATOR_UPDATE_ROOT L"Software\\Google\\Update" ++#endif + + namespace google_update { + +@@ -13,11 +20,11 @@ const wchar_t kGoogleUpdateUpgradeCode[] = + + const wchar_t kGoogleUpdateSetupExe[] = L"GoogleUpdateSetup.exe"; + +-const wchar_t kRegPathClients[] = L"Software\\Google\\Update\\Clients"; +-const wchar_t kRegPathClientState[] = L"Software\\Google\\Update\\ClientState"; ++const wchar_t kRegPathClients[] = BROWSER_OPERATOR_UPDATE_ROOT L"\\Clients"; ++const wchar_t kRegPathClientState[] = BROWSER_OPERATOR_UPDATE_ROOT L"\\ClientState"; + const wchar_t kRegPathClientStateMedium[] = +- L"Software\\Google\\Update\\ClientStateMedium"; +-const wchar_t kRegPathGoogleUpdate[] = L"Software\\Google\\Update"; ++ BROWSER_OPERATOR_UPDATE_ROOT L"\\ClientStateMedium"; ++const wchar_t kRegPathGoogleUpdate[] = BROWSER_OPERATOR_UPDATE_ROOT L""; + + const wchar_t kRegCommandsKey[] = L"Commands"; + +diff --git a/chrome/updater/branding.gni b/chrome/updater/branding.gni +index 5f6be5e..3899cc7 100644 +--- a/chrome/updater/branding.gni ++++ b/chrome/updater/branding.gni +@@ -156,6 +156,57 @@ if (browser_operator_updater_config != "") { + assert(mac_update_channel != "") + } + ++ if (is_win) { ++ platform_experience_helper_appid = browser_operator_updater_branding.platform_experience_helper_appid ++ prefs_access_mutex = browser_operator_updater_branding.prefs_access_mutex ++ setup_mutex_prefix = browser_operator_updater_branding.setup_mutex_prefix ++ legacy_google_update_appid = browser_operator_updater_branding.legacy_google_update_appid ++ UpdaterLegacyLibGUID = browser_operator_updater_branding.UpdaterLegacyLibGUID ++ GoogleUpdate3WebUserClassGUID = browser_operator_updater_branding.GoogleUpdate3WebUserClassGUID ++ GoogleUpdate3WebSystemClassGUID = browser_operator_updater_branding.GoogleUpdate3WebSystemClassGUID ++ GoogleUpdate3WebServiceClassGUID = browser_operator_updater_branding.GoogleUpdate3WebServiceClassGUID ++ PolicyStatusUserClassGUID = browser_operator_updater_branding.PolicyStatusUserClassGUID ++ PolicyStatusSystemClassGUID = browser_operator_updater_branding.PolicyStatusSystemClassGUID ++ ProcessLauncherClassGUID = browser_operator_updater_branding.ProcessLauncherClassGUID ++ IAppVersionWebGUID = browser_operator_updater_branding.IAppVersionWebGUID ++ IAppVersionWebUserGUID = browser_operator_updater_branding.IAppVersionWebUserGUID ++ IAppVersionWebSystemGUID = browser_operator_updater_branding.IAppVersionWebSystemGUID ++ ICurrentStateGUID = browser_operator_updater_branding.ICurrentStateGUID ++ ICurrentStateUserGUID = browser_operator_updater_branding.ICurrentStateUserGUID ++ ICurrentStateSystemGUID = browser_operator_updater_branding.ICurrentStateSystemGUID ++ IGoogleUpdate3WebGUID = browser_operator_updater_branding.IGoogleUpdate3WebGUID ++ IGoogleUpdate3WebUserGUID = browser_operator_updater_branding.IGoogleUpdate3WebUserGUID ++ IGoogleUpdate3WebSystemGUID = browser_operator_updater_branding.IGoogleUpdate3WebSystemGUID ++ IAppBundleWebGUID = browser_operator_updater_branding.IAppBundleWebGUID ++ IAppBundleWebUserGUID = browser_operator_updater_branding.IAppBundleWebUserGUID ++ IAppBundleWebSystemGUID = browser_operator_updater_branding.IAppBundleWebSystemGUID ++ IAppWebGUID = browser_operator_updater_branding.IAppWebGUID ++ IAppWebUserGUID = browser_operator_updater_branding.IAppWebUserGUID ++ IAppWebSystemGUID = browser_operator_updater_branding.IAppWebSystemGUID ++ IAppCommandWebGUID = browser_operator_updater_branding.IAppCommandWebGUID ++ IAppCommandWebUserGUID = browser_operator_updater_branding.IAppCommandWebUserGUID ++ IAppCommandWebSystemGUID = browser_operator_updater_branding.IAppCommandWebSystemGUID ++ IPolicyStatusGUID = browser_operator_updater_branding.IPolicyStatusGUID ++ IPolicyStatusUserGUID = browser_operator_updater_branding.IPolicyStatusUserGUID ++ IPolicyStatusSystemGUID = browser_operator_updater_branding.IPolicyStatusSystemGUID ++ IPolicyStatus2GUID = browser_operator_updater_branding.IPolicyStatus2GUID ++ IPolicyStatus2UserGUID = browser_operator_updater_branding.IPolicyStatus2UserGUID ++ IPolicyStatus2SystemGUID = browser_operator_updater_branding.IPolicyStatus2SystemGUID ++ IPolicyStatus3GUID = browser_operator_updater_branding.IPolicyStatus3GUID ++ IPolicyStatus3UserGUID = browser_operator_updater_branding.IPolicyStatus3UserGUID ++ IPolicyStatus3SystemGUID = browser_operator_updater_branding.IPolicyStatus3SystemGUID ++ IPolicyStatus4GUID = browser_operator_updater_branding.IPolicyStatus4GUID ++ IPolicyStatus4UserGUID = browser_operator_updater_branding.IPolicyStatus4UserGUID ++ IPolicyStatus4SystemGUID = browser_operator_updater_branding.IPolicyStatus4SystemGUID ++ IPolicyStatusValueGUID = browser_operator_updater_branding.IPolicyStatusValueGUID ++ IPolicyStatusValueUserGUID = browser_operator_updater_branding.IPolicyStatusValueUserGUID ++ IPolicyStatusValueSystemGUID = browser_operator_updater_branding.IPolicyStatusValueSystemGUID ++ IProcessLauncherGUID = browser_operator_updater_branding.IProcessLauncherGUID ++ IProcessLauncherSystemGUID = browser_operator_updater_branding.IProcessLauncherSystemGUID ++ IProcessLauncher2GUID = browser_operator_updater_branding.IProcessLauncher2GUID ++ IProcessLauncher2SystemGUID = browser_operator_updater_branding.IProcessLauncher2SystemGUID ++ } ++ + assert(browser_operator_cup_key != "") + assert(browser_operator_cup_key_version > 0) + assert(crx_pkhash != "") +diff --git a/chrome/updater/win/setup/setup_util.cc b/chrome/updater/win/setup/setup_util.cc +index 5088e99..e1570d2 100644 +--- a/chrome/updater/win/setup/setup_util.cc ++++ b/chrome/updater/win/setup/setup_util.cc +@@ -637,6 +637,9 @@ void RegisterUserRunAtStartup(const std::wstring& run_value_name, + CHECK(list); + VLOG(1) << __func__; + ++ // Fresh user profiles may not have the Run key yet. Use a work item so ++ // creation participates in the same rollback as the startup value. ++ list->AddCreateRegKeyWorkItem(HKEY_CURRENT_USER, REGSTR_PATH_RUN, 0); + list->AddSetRegValueWorkItem(HKEY_CURRENT_USER, REGSTR_PATH_RUN, 0, + run_value_name, command.GetCommandLineString(), + true); +diff --git a/chrome/windows_services/elevated_tracing_service/BUILD.gn b/chrome/windows_services/elevated_tracing_service/BUILD.gn +index be389aa..a54234b 100644 +--- a/chrome/windows_services/elevated_tracing_service/BUILD.gn ++++ b/chrome/windows_services/elevated_tracing_service/BUILD.gn +@@ -5,9 +5,14 @@ + import("//build/config/chrome_build.gni") + import("//build/toolchain/win/midl.gni") + import("//chrome/process_version_rc_template.gni") ++import("//chrome/updater/branding.gni") + import("//testing/test.gni") + + midl("tracing_service_idl") { ++ if (browser_operator_updater_config != "") { ++ dynamic_guids = "ignore_proxy_stub,E0B03E2D-7682-4D83-B9FF-4574AF720500=A6191323-484B-567F-A2FA-28A99FD76CAF,C9368104-11AE-4784-8C2D-115C5D421937=5E7BC182-7906-56B6-A914-F90DF8FD9479" ++ } ++ + sources = [ "tracing_service_idl.idl" ] + + writes_tlb = true diff --git a/scripts/verify_chromium_windows_midl.py b/scripts/verify_chromium_windows_midl.py new file mode 100644 index 0000000000..55e9a66cf8 --- /dev/null +++ b/scripts/verify_chromium_windows_midl.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 +"""Check the patched MIDL provenance normalization without hiding ABI changes.""" +import argparse +import importlib.util +from pathlib import Path + +parser = argparse.ArgumentParser(description=__doc__) +parser.add_argument('--chromium-src', required=True, type=Path) +args = parser.parse_args() +path = args.chromium_src / 'build/toolchain/win/midl.py' +spec = importlib.util.spec_from_file_location('reviewed_midl', path) +module = importlib.util.module_from_spec(spec) +spec.loader.exec_module(module) +original = '../../chrome/elevation_service/elevation_service_idl.idl' +generated = 'gen/chrome/elevation_service/elevation_service_idl.idl' +expected = b'/* Compiler settings for ' + original.encode() + b': */\r\nGUID A;\r\n' +actual = b'/* Compiler settings for ' + generated.encode() + b': */\r\nGUID A;\r\n' +assert module.NormalizeDynamicIdlComment(actual, original, generated) == expected +changed = actual.replace(b'GUID A', b'GUID B') +assert module.NormalizeDynamicIdlComment(changed, original, generated) != expected +assert module.NormalizeDynamicIdlComment(actual, original+'.template', generated) == actual +assert module.NormalizeDynamicIdlComment(b'GUID B;', original, generated) == b'GUID B;' +print('MIDL comment normalization passed; declaration/GUID differences remain visible') diff --git a/scripts/verify_chromium_windows_release.ps1 b/scripts/verify_chromium_windows_release.ps1 new file mode 100644 index 0000000000..2eefbff55b --- /dev/null +++ b/scripts/verify_chromium_windows_release.ps1 @@ -0,0 +1,102 @@ +param( + [Parameter(Mandatory=$true)][string]$ChromiumSource, + [Parameter(Mandatory=$true)][string]$Installer, + [Parameter(Mandatory=$true)][string]$Artifacts, + [Parameter(Mandatory=$true)][ValidatePattern('^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$')][string]$Version, + [Parameter(Mandatory=$true)][ValidatePattern('^[a-f0-9]{40}$')][string]$FrontendRevision +) +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version Latest +$repo = Split-Path $PSScriptRoot +# Fail before installation if the caller/source/pinned frontend differ. +$sourceVersion = (Get-Content (Join-Path $ChromiumSource 'chrome\VERSION') | ForEach-Object { ($_ -split '=')[1] }) -join '.' +if ($sourceVersion -ne $Version) { throw 'Requested engine differs from Chromium source' } +if (Test-Path (Join-Path $repo '.git')) { + $actualFrontendRevision = (& git -C $repo rev-parse HEAD).Trim() + if ($LASTEXITCODE -ne 0 -or $actualFrontendRevision -ne $FrontendRevision) { throw 'Frontend checkout differs from pinned source' } +} +# Portable qualification inputs are hashed by the reviewed desktop harness. +$frontendRevision = $FrontendRevision +$productText = Get-Content (Join-Path $repo 'front_end\panels\ai_chat\core\Version.ts') -Raw +$productVersion = [regex]::Match($productText, "version: ['`"]([0-9]+\.[0-9]+\.[0-9]+)['`"]").Groups[1].Value +if (!$productVersion) { throw 'Cannot identify product version' } +$identity = [Security.Principal.WindowsIdentity]::GetCurrent() +$principal = New-Object Security.Principal.WindowsPrincipal($identity) +if ($principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) -or $identity.Groups.Value -notcontains 'S-1-5-4' -or (Get-Process -Id $PID).SessionId -eq 0) { throw 'Run installed GUI qualification as a non-admin interactive desktop user' } +$installerHash = (Get-FileHash -LiteralPath $Installer -Algorithm SHA256).Hash.ToLower() + +$identities = Get-Content (Join-Path $repo 'config\updater\windows-identities.json') -Raw | ConvertFrom-Json +$browserId = '{'+$identities.browser+'}' +$updaterId = '{'+$identities.updater+'}' +$installRoot = Join-Path $env:LOCALAPPDATA 'BrowserOperator\Browser Operator\Application' +$exe = Join-Path $installRoot 'chrome.exe' +$ownership = Join-Path $env:LOCALAPPDATA 'BrowserOperatorQualification\installation.json' +$currentSid = [Security.Principal.WindowsIdentity]::GetCurrent().User.Value +if (Test-Path $exe) { + if (!(Test-Path $ownership)) { throw 'Refusing to replace an installation not created by this qualification' } + $owned = Get-Content $ownership -Raw | ConvertFrom-Json + if ($owned.sid -ne $currentSid -or $owned.path -ne $exe) { throw 'Existing qualification ownership differs' } + # Chromium intentionally retains same-version files during repair. A new + # candidate with the same engine version must be tested as a fresh installation. + $uninstaller = Join-Path $installRoot "$Version\Installer\setup.exe" + if (!(Test-Path -LiteralPath $uninstaller)) { throw 'Owned installation has no uninstaller; preserve it for inspection' } + $uninstall = Start-Process -FilePath $uninstaller -ArgumentList @('--uninstall','--force-uninstall','--verbose-logging') -PassThru + $null = $uninstall.Handle + if (!$uninstall.WaitForExit(120000) -or $uninstall.ExitCode -notin @(0,19)) { throw 'Owned qualification uninstall failed; do not replace unknown files' } + for ($n=0; $n -lt 30 -and (Test-Path -LiteralPath $exe); $n++) { Start-Sleep -Seconds 1 } + if (Test-Path -LiteralPath $exe) { throw 'Owned browser remains after uninstall' } + +} else { + New-Item -ItemType Directory -Force (Split-Path $ownership) | Out-Null + @{sid=$currentSid; path=$exe} | ConvertTo-Json | Set-Content -Encoding utf8 $ownership +} +New-Item -ItemType Directory -Force $Artifacts | Out-Null +if ((Get-AuthenticodeSignature -LiteralPath $Installer).Status -ne 'NotSigned') { throw 'This qualification is for the explicitly approved unsigned internal candidate' } +$beforeGoogleUpdate = Test-Path 'HKCU:\Software\Google\Update' +$beforeChromiumUpdate = Test-Path 'HKCU:\Software\Chromium\Update' +$process = Start-Process -FilePath $Installer -ArgumentList @('--do-not-launch-chrome','--enable-logging','--verbose-logging') -PassThru +$null = $process.Handle +if (!$process.WaitForExit(600000)) { throw 'Candidate installer timed out' } +if ($process.ExitCode -ne 0) { throw "Candidate installer failed: $($process.ExitCode)" } +if (!(Test-Path $exe)) { throw 'Installer did not create the branded per-user browser' } +$expectedSetup = Join-Path (Split-Path $Installer) 'UpdaterSetup.exe' +$installedSetup = Join-Path $installRoot "$Version\UpdaterSetup.exe" +if ((Get-FileHash -LiteralPath $expectedSetup -Algorithm SHA256).Hash -ne (Get-FileHash -LiteralPath $installedSetup -Algorithm SHA256).Hash) { throw 'Installed updater setup differs from the candidate payload' } +$expectedUpdater = Join-Path (Split-Path $Installer) 'updater.exe' +$installedUpdater = Join-Path $env:LOCALAPPDATA "BrowserOperator\BrowserOperatorUpdater\$Version\updater.exe" +if ((Get-FileHash -LiteralPath $expectedUpdater -Algorithm SHA256).Hash -ne (Get-FileHash -LiteralPath $installedUpdater -Algorithm SHA256).Hash) { throw 'Installed updater executable differs from the candidate payload' } + +$registry = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::CurrentUser,[Microsoft.Win32.RegistryView]::Registry32) +foreach ($app in @($browserId,$updaterId)) { + $key = $registry.OpenSubKey('Software\BrowserOperator\Update\Clients\'+$app) + if (!$key) { throw "Missing native updater registration: $app" } + try { if ($key.GetValue('pv') -ne $Version) { throw "Incorrect registered native version: $app" } } finally { $key.Dispose() } +} +$registry.Dispose() +if (!$beforeGoogleUpdate -and (Test-Path 'HKCU:\Software\Google\Update')) { throw 'Installer wrote Google updater identity' } +if (!$beforeChromiumUpdate -and (Test-Path 'HKCU:\Software\Chromium\Update')) { throw 'Installer wrote Chromium updater identity' } +$node = Join-Path $ChromiumSource 'third_party\node\win\node.exe' +$profile = Join-Path $Artifacts 'disposable-profile' +$port = 9445 +$browser = Start-Process -FilePath $exe -ArgumentList @('--no-first-run','--no-default-browser-check','--force-renderer-accessibility','--remote-debugging-address=127.0.0.1',"--remote-debugging-port=$port",('--user-data-dir="{0}"' -f $profile),'--enable-logging','--v=1','about:blank') -PassThru +$null = $browser.Handle +try { + $endpoint = "http://127.0.0.1:$port" + $ready = $false + for ($n=0; $n -lt 60; $n++) { + try { $null=Invoke-RestMethod "$endpoint/json/version"; $ready=$true; break } catch { Start-Sleep -Seconds 1 } + } + if (!$ready) { throw 'Installed browser did not start its local qualification endpoint' } + & (Join-Path $PSScriptRoot 'verify_chromium_windows_toolbar.ps1') -BrowserPid $browser.Id -Endpoint $endpoint -Artifacts $Artifacts + & $node (Join-Path $PSScriptRoot 'verify_chromium_release.mjs') $endpoint $Version $Artifacts $productVersion + if ($LASTEXITCODE -ne 0) { throw 'Installed AI tools, native update entry, or privileged-URL tests failed' } + & $node (Join-Path $PSScriptRoot 'verify_chromium_windows_update.mjs') $endpoint $Artifacts $Version + if ($LASTEXITCODE -ne 0) { throw 'Installed native updater check failed' } + @{passed=$true; engine=$Version; product_version=$productVersion; frontend_revision=$frontendRevision; installer_sha256=$installerHash; native_update_check_passed=$true; native_toolbar_passed=$true; installed_executable=$exe; browser_app_id=$browserId; updater_app_id=$updaterId; signed=$false; publication=$false; os=[Environment]::OSVersion.VersionString; windows_10_11_client_tested=$false} | ConvertTo-Json | Set-Content -Encoding utf8 (Join-Path $Artifacts 'installed-windows-report.json') +} finally { + if (!$browser.HasExited) { & "$env:SystemRoot\System32\taskkill.exe" /PID $browser.Id /T /F | Out-Null } + $updaterRoot = Join-Path $env:LOCALAPPDATA 'BrowserOperator\BrowserOperatorUpdater' + if (Test-Path $updaterRoot) { + Get-ChildItem $updaterRoot -Filter '*.log' -Recurse -ErrorAction SilentlyContinue | ForEach-Object { Copy-Item $_.FullName (Join-Path $Artifacts ('updater-'+$_.Name)) -Force } + } +} diff --git a/scripts/verify_chromium_windows_toolbar.ps1 b/scripts/verify_chromium_windows_toolbar.ps1 new file mode 100644 index 0000000000..f940555585 --- /dev/null +++ b/scripts/verify_chromium_windows_toolbar.ps1 @@ -0,0 +1,116 @@ +param([int]$BrowserPid,[string]$Endpoint,[string]$Artifacts) +$ErrorActionPreference = 'Stop' +Add-Type -AssemblyName UIAutomationClient,UIAutomationTypes,System.Drawing +Add-Type @' +using System; +using System.Runtime.InteropServices; +public static class WindowCapture { + [StructLayout(LayoutKind.Sequential)] public struct Rect { public int Left,Top,Right,Bottom; } + [DllImport("user32.dll")] public static extern bool GetWindowRect(IntPtr handle,out Rect rect); + [DllImport("user32.dll")] public static extern bool PrintWindow(IntPtr handle,IntPtr dc,uint flags); +} +'@ +$window = [IntPtr]::Zero +for ($n=0;$n -lt 30;$n++) { + $process = Get-Process -Id $BrowserPid + $window = $process.MainWindowHandle + if ($window -ne [IntPtr]::Zero) { break } + Start-Sleep -Seconds 1 +} +if ($window -eq [IntPtr]::Zero) { throw 'Installed browser has no native window for toolbar qualification' } +function Invoke-NamedControl { + param([string]$Name='AI Assistant') + $condition = New-Object Windows.Automation.PropertyCondition([Windows.Automation.AutomationElement]::NameProperty,$Name) + $button=$null + for ($attempt=0;$attempt -lt 60;$attempt++) { + $root = [Windows.Automation.AutomationElement]::FromHandle($window) + $button = $root.FindFirst([Windows.Automation.TreeScope]::Descendants,$condition) + if ($button) { break } + Start-Sleep -Milliseconds 250 + } + if (!$button) { + try { + $root.FindAll([Windows.Automation.TreeScope]::Descendants,[Windows.Automation.Condition]::TrueCondition) | + ForEach-Object { @{name=$_.Current.Name;type=$_.Current.ControlType.ProgrammaticName;offscreen=$_.Current.IsOffscreen} } | + ConvertTo-Json -Depth 4 | Set-Content -Encoding utf8 (Join-Path $Artifacts 'native-controls-on-failure.json') + } catch {} + throw ('Native control did not become ready: '+$Name) + } + $pattern = $null + if ($button.TryGetCurrentPattern([Windows.Automation.InvokePattern]::Pattern,[ref]$pattern)) { + ([Windows.Automation.InvokePattern]$pattern).Invoke() + } elseif ($button.TryGetCurrentPattern([Windows.Automation.LegacyIAccessiblePattern]::Pattern,[ref]$pattern)) { + ([Windows.Automation.LegacyIAccessiblePattern]$pattern).DoDefaultAction() + } else { throw ('Native control exposes no accessible action: '+$Name) } +} +function Get-PanelTarget { + @((Invoke-RestMethod "$Endpoint/json/list") | Where-Object { $_.url -like 'devtools://*' }) +} +Invoke-NamedControl +$opened = @() +for ($n=0;$n -lt 60;$n++) { + $opened = @(Get-PanelTarget) + if ($opened.Count -gt 0) { break } + Start-Sleep -Milliseconds 500 +} +if ($opened.Count -eq 0) { throw 'Invoking the native toolbar did not open the bundled AI frontend' } +# A target exists before its first rendered frame. Wait for the actual panel +# or its first-run welcome UI before capturing the native browser window. +$panelReady=$false +foreach ($attempt in 1..60) { + $root=[Windows.Automation.AutomationElement]::FromHandle($window) + foreach ($name in @('AI Assistant panel','Welcome to Browser Operator')) { + $condition=New-Object Windows.Automation.PropertyCondition([Windows.Automation.AutomationElement]::NameProperty,$name) + if ($root.FindFirst([Windows.Automation.TreeScope]::Descendants,$condition)) { $panelReady=$true;break } + } + if ($panelReady) { break } + Start-Sleep -Milliseconds 500 +} +if (!$panelReady) { throw 'Native toolbar target exists but the AI panel did not render' } +$root=[Windows.Automation.AutomationElement]::FromHandle($window) +$welcomeCondition=New-Object Windows.Automation.PropertyCondition([Windows.Automation.AutomationElement]::NameProperty,'Welcome to Browser Operator') +$welcomeDismissed=$false +if ($root.FindFirst([Windows.Automation.TreeScope]::Descendants,$welcomeCondition)) { + Invoke-NamedControl 'Skip' + $welcomeDismissed=$true + for ($attempt=0;$attempt -lt 60;$attempt++) { + $root=[Windows.Automation.AutomationElement]::FromHandle($window) + if (!$root.FindFirst([Windows.Automation.TreeScope]::Descendants,$welcomeCondition)) { break } + Start-Sleep -Milliseconds 250 + } + if ($root.FindFirst([Windows.Automation.TreeScope]::Descendants,$welcomeCondition)) { throw 'Welcome Skip did not reveal the AI panel' } +} +if (!$welcomeDismissed) { throw 'A fresh qualification profile must exercise welcome Skip' } +Invoke-NamedControl 'Close Chat Window' +for ($attempt=0;$attempt -lt 60;$attempt++) { + if (@(Get-PanelTarget).Count -eq 0) { break } + Start-Sleep -Milliseconds 250 +} +if (@(Get-PanelTarget).Count -ne 0) { throw 'AI panel close control did not close its frontend' } +Invoke-NamedControl +$panelReady=$false +for ($attempt=0;$attempt -lt 60;$attempt++) { + $opened=@(Get-PanelTarget) + $root=[Windows.Automation.AutomationElement]::FromHandle($window) + $condition=New-Object Windows.Automation.PropertyCondition([Windows.Automation.AutomationElement]::NameProperty,'AI Assistant panel') + if ($opened.Count -gt 0 -and $root.FindFirst([Windows.Automation.TreeScope]::Descendants,$condition)) { $panelReady=$true;break } + Start-Sleep -Milliseconds 500 +} +if (!$panelReady) { throw 'Native toolbar did not reopen the AI panel' } +Start-Sleep -Milliseconds 1000 + +$rect = New-Object WindowCapture+Rect +if (![WindowCapture]::GetWindowRect($window,[ref]$rect)) { throw 'Cannot measure native browser window' } +$width=$rect.Right-$rect.Left; $height=$rect.Bottom-$rect.Top +if ($width -lt 500 -or $height -lt 300) { throw 'Native browser window is not a usable size' } +$bitmap = New-Object Drawing.Bitmap($width,$height) +$graphics = [Drawing.Graphics]::FromImage($bitmap) +$dc=$graphics.GetHdc() +try { if (![WindowCapture]::PrintWindow($window,$dc,2)) { throw 'Native browser window capture failed' } } finally { $graphics.ReleaseHdc($dc) } +try { + $colors = @{} + for ($x=0;$x -lt $width;$x+=17) { for ($y=0;$y -lt $height;$y+=17) { $colors[$bitmap.GetPixel($x,$y).ToArgb()]=$true } } + if ($colors.Count -lt 10) { throw 'Native window capture is blank; desktop rendering is unverified' } + $bitmap.Save((Join-Path $Artifacts 'native-toolbar-panel.png'),[Drawing.Imaging.ImageFormat]::Png) +} finally { $graphics.Dispose(); $bitmap.Dispose() } +@{passed=$true; action='UI Automation toolbar open, welcome Skip, panel close and toolbar reopen'; welcome_skipped=$welcomeDismissed; reopened=$true; accessible_name='AI Assistant'; frontend_urls=@($opened | ForEach-Object {$_.url}); width=$width; height=$height} | ConvertTo-Json | Set-Content -Encoding utf8 (Join-Path $Artifacts 'native-toolbar-report.json') diff --git a/scripts/verify_chromium_windows_update.mjs b/scripts/verify_chromium_windows_update.mjs new file mode 100644 index 0000000000..ddbac85409 --- /dev/null +++ b/scripts/verify_chromium_windows_update.mjs @@ -0,0 +1,56 @@ +import assert from 'node:assert/strict'; +import {writeFile} from 'node:fs/promises'; +import {join} from 'node:path'; +import {CDP} from './chromium_cdp.mjs'; + +const [endpoint, artifacts, engine] = process.argv.slice(2); +assert.ok(endpoint && artifacts && /^\d+\.\d+\.\d+\.\d+$/.test(engine), 'Usage: endpoint artifact-directory engine-version'); +let target; +for (let n = 0; n < 60; n++) { + const targets = await fetch(`${endpoint}/json/list`).then(r => r.json()); + target = targets.find(t => t.url === 'chrome://settings/help' && t.webSocketDebuggerUrl); + if (target) break; + await new Promise(resolve => setTimeout(resolve, 500)); +} +assert.ok(target, 'The AI update entry must have opened the native About page'); +const cdp = await CDP.connect(target.webSocketDebuggerUrl); +try { + let text = ''; + for (let n = 0; n < 180; n++) { + // Settings renders inside shadow roots. Use the rendered accessibility + // tree instead of reading innerText from DocumentFragment shadow roots. + const tree = await cdp.send('Accessibility.getFullAXTree'); + text = tree.nodes.filter(node => !node.ignored) + .map(node => node.name?.value ?? '').filter(Boolean).join('\n'); + await writeFile(join(artifacts, 'native-about-ax.json'), JSON.stringify(tree, null, 2)); + if (/Browser Operator is up to date/.test(text)) break; + if (/error occurred|failed to check|updates are disabled/i.test(text)) break; + await new Promise(resolve => setTimeout(resolve, 1000)); + } + await writeFile(join(artifacts, 'native-about.txt'), text); + const capture = await cdp.send('Page.captureScreenshot', {format: 'png'}); + await writeFile(join(artifacts, 'native-about.png'), Buffer.from(capture.data, 'base64')); + assert.ok(text.includes(engine), 'About page engine must match the requested version'); + assert.match(text, /Official Build/); + assert.match(text, /Browser Operator is up to date/, 'Native COM updater must complete its real production HTTPS/CUP check'); + const version = await fetch(`${endpoint}/json/version`).then(r => r.json()); + const browser = await CDP.connect(version.webSocketDebuggerUrl); + let nativeResult; + try { + for (let n = 0; n < 50; n++) { + const {histograms} = await browser.send('Browser.getHistograms', { + query: 'GoogleUpdate.UpgradeResult', delta: false, + }); + nativeResult = histograms.find(h => h.name === 'GoogleUpdate.UpgradeResult'); + if (nativeResult?.buckets.some(bucket => bucket.low === 4 && bucket.count > 0)) break; + await new Promise(resolve => setTimeout(resolve, 100)); + } + } finally { browser.close(); } + await writeFile(join(artifacts, 'native-update-result-histogram.json'), JSON.stringify(nativeResult ?? null, null, 2)); + assert.ok(nativeResult?.buckets.some(bucket => bucket.low === 4 && bucket.count > 0), + 'Native UpdateCheckDriver must report UPGRADE_ALREADY_UP_TO_DATE (4); the basic UI stub does not'); + await writeFile(join(artifacts, 'native-update-check.json'), JSON.stringify({passed: true, + nativeUpgradeResult: 4, visibleStatus: 'Browser Operator is up to date', + engine, protocol: 'Omaha over HTTPS with native CUP verification', + offer: 'noupdate', upgradeInstallationQualified: false}, null, 2)); +} finally { cdp.close(); } From 74254affbaf6d0171e0e9d122c3fd439078ad2c1 Mon Sep 17 00:00:00 2001 From: agentflow-marathon Date: Mon, 30 Nov 2026 00:51:28 -0800 Subject: [PATCH 2/4] Hold Windows candidate publication on its matching source and driver PRs [skip ci] --- config/releases/0.7.0.json | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/config/releases/0.7.0.json b/config/releases/0.7.0.json index 948a86a1b6..0c95b8442e 100644 --- a/config/releases/0.7.0.json +++ b/config/releases/0.7.0.json @@ -2,12 +2,17 @@ "product_version": "0.7.0", "chromium_version": "159.0.8154.13", "integration_repository": "BrowserOperator/browser-operator-core", - "required_merged_pr": 116, + "required_merged_pr": 117, "required_base_branch": "main", "allowed_mergers": [ "tysonthomas9" ], "additional_merged_prs": [ + { + "repository": "BrowserOperator/browser-operator-core", + "number": 116, + "base_branch": "main" + }, { "repository": "BrowserOperator/browser-operator-core", "number": 115, @@ -22,6 +27,21 @@ "repository": "BrowserOperator/build-script", "number": 1, "base_branch": "main" + }, + { + "repository": "BrowserOperator/build-script", + "number": 2, + "base_branch": "main" + }, + { + "repository": "BrowserOperator/build-script", + "number": 3, + "base_branch": "main" + }, + { + "repository": "BrowserOperator/test-github-pipeline", + "number": 11, + "base_branch": "main" } ] } From 94772734d287e8c50d09556d423991ada36ef22b Mon Sep 17 00:00:00 2001 From: agentflow-marathon Date: Mon, 30 Nov 2026 10:47:55 -0800 Subject: [PATCH 3/4] Reuse Windows branding paths and verify interrupted pristine preparation [skip ci] --- scripts/apply_chromium_patches.py | 11 ++- scripts/test_apply_chromium_patches.py | 31 ++++++++- scripts/test_verify_chromium_preparation.py | 74 ++++++++++++++++++++ scripts/verify_chromium_preparation.py | 77 +++++++++++++++++++++ 4 files changed, 188 insertions(+), 5 deletions(-) create mode 100644 scripts/test_verify_chromium_preparation.py create mode 100644 scripts/verify_chromium_preparation.py diff --git a/scripts/apply_chromium_patches.py b/scripts/apply_chromium_patches.py index 1239f3bde5..95d2b46719 100644 --- a/scripts/apply_chromium_patches.py +++ b/scripts/apply_chromium_patches.py @@ -14,6 +14,13 @@ from chromium_git import git_environment +def check_branding_asset_paths(relative, source_name): + """Keep branding paths relative and inside the theme tree on every host.""" + if (relative.anchor or source_name.anchor or '..' in relative.parts + or '..' in source_name.parts or not relative.as_posix().startswith('chrome/app/theme/')): + raise RuntimeError('Invalid reviewed branding asset path') + + def message_ids(path): try: return {node.attrib['name'] for node in ET.parse(path).iter('message')} @@ -101,9 +108,7 @@ def main(): raise RuntimeError('Branding dependency revision differs from the reviewed manifest') for item in manifest['files']: relative, source_name = Path(item['destination']), Path(item['source']) - if (relative.is_absolute() or source_name.is_absolute() or '..' in relative.parts - or '..' in source_name.parts or not str(relative).startswith('chrome/app/theme/')): - raise RuntimeError('Invalid reviewed branding asset path') + check_branding_asset_paths(relative, source_name) destination = chromium / relative if not destination.resolve().is_relative_to(chromium): raise RuntimeError('Branding destination escapes Chromium source') diff --git a/scripts/test_apply_chromium_patches.py b/scripts/test_apply_chromium_patches.py index 4bdf8ad372..18d23cc28c 100644 --- a/scripts/test_apply_chromium_patches.py +++ b/scripts/test_apply_chromium_patches.py @@ -1,12 +1,39 @@ """Validate ordered patch checking without writing partial source changes.""" -from pathlib import Path +from pathlib import Path, PurePosixPath, PureWindowsPath import subprocess import tempfile from unittest.mock import patch import unittest -from apply_chromium_patches import combined_patch +from apply_chromium_patches import check_branding_asset_paths, combined_patch +class BrandingPathTests(unittest.TestCase): + def test_theme_assets_accept_posix_and_windows_separators(self): + for flavor in (PurePosixPath, PureWindowsPath): + with self.subTest(flavor=flavor): + check_branding_asset_paths(flavor('chrome/app/theme/win/chromium.ico'), + flavor('theme/chromium/win/chromium.ico')) + + def test_traversal_and_theme_siblings_are_rejected_for_both_path_flavors(self): + for flavor in (PurePosixPath, PureWindowsPath): + for destination, source in ( + ('chrome/app/theme/../outside.ico', 'theme/icon.ico'), + ('chrome/app/theme/icon.ico', '../outside.ico'), + ('chrome/app/theme-sibling/icon.ico', 'theme/icon.ico'), + ('chrome/app/theme', 'theme/icon.ico'), + ('/chrome/app/theme/icon.ico', 'theme/icon.ico'), + ('chrome/app/theme/icon.ico', '/theme/icon.ico')): + with self.subTest(flavor=flavor, destination=destination, source=source): + with self.assertRaisesRegex(RuntimeError, 'Invalid reviewed branding asset path'): + check_branding_asset_paths(flavor(destination), flavor(source)) + + def test_windows_drive_and_unc_sources_are_rejected(self): + for source in ('C:/theme/icon.ico', 'C:theme/icon.ico', '//server/share/icon.ico'): + with self.subTest(source=source): + with self.assertRaisesRegex(RuntimeError, 'Invalid reviewed branding asset path'): + check_branding_asset_paths(PureWindowsPath('chrome/app/theme/icon.ico'), + PureWindowsPath(source)) + class OrderedPatchTests(unittest.TestCase): def test_spaced_xml_attribute_cannot_hide_a_deleted_upstream_message(self): with tempfile.TemporaryDirectory() as temp: diff --git a/scripts/test_verify_chromium_preparation.py b/scripts/test_verify_chromium_preparation.py new file mode 100644 index 0000000000..cc74987f96 --- /dev/null +++ b/scripts/test_verify_chromium_preparation.py @@ -0,0 +1,74 @@ +from pathlib import Path +import hashlib +import json +import subprocess +import tempfile +import unittest + +from verify_chromium_preparation import verify,STOCK,FRONTEND +from chromium_git import git_environment + + +def command(root,*args): + return subprocess.check_output(['git','-C',str(root),*args],env=git_environment()) + + +def commit(root,*files): + command(root,'add','--',*files) + command(root,'-c','user.name=Test','-c','user.email=test@invalid','commit','-qm','fixture') + return command(root,'rev-parse','HEAD').decode().strip() + + +class InterruptedPreparationTests(unittest.TestCase): + def fixture(self,root): + source=root/'native';source.mkdir();command(source,'init','-q') + stock=source/STOCK;stock.mkdir(parents=True);command(stock,'init','-q') + (stock/'tracked.txt').write_text('stock');stock_rev=commit(stock,'tracked.txt') + fork=source/FRONTEND;fork.mkdir(parents=True);command(fork,'init','-q') + (fork/'tracked.txt').write_text('fork');commit(fork,'tracked.txt') + (source/'DEPS').write_text("'devtools_frontend_revision': '"+stock_rev+"',\n") + asset=source/'chrome/app/theme/icon.ico';asset.parent.mkdir(parents=True);asset.write_bytes(b'upstream') + (source/'native.cc').write_text('native') + rev=commit(source,'DEPS','chrome/app/theme/icon.ico','native.cc') + core=root/'core';family='159.0.8154.13';folder=core/'patches/chromium'/family;folder.mkdir(parents=True) + (folder/'branding-assets.json').write_text(json.dumps({'files':[{'destination':'chrome/app/theme/icon.ico','source':'theme/icon.ico','sha256':hashlib.sha256(b'reviewed').hexdigest()}]})) + return source,core,family,rev,asset + + def test_pristine_and_reviewed_branding_only_are_read_only(self): + with tempfile.TemporaryDirectory() as name: + args=self.fixture(Path(name));source,core,family,rev,asset=args + self.assertTrue(verify(source,core,family,rev)['passed']) + asset.write_bytes(b'reviewed');before=command(source,'diff','--binary') + self.assertTrue(verify(source,core,family,rev)['passed']) + self.assertEqual(before,command(source,'diff','--binary')) + self.assertEqual(b'reviewed',asset.read_bytes()) + + def test_unknown_tracked_or_untracked_changes_are_rejected(self): + for kind in ('tracked','untracked'): + with self.subTest(kind=kind),tempfile.TemporaryDirectory() as name: + source,core,family,rev,asset=self.fixture(Path(name));asset.write_bytes(b'reviewed') + path=source/('native.cc' if kind=='tracked' else 'unknown.cc');path.write_text('unknown') + with self.assertRaisesRegex(RuntimeError,'Unreviewed native'):verify(source,core,family,rev) + self.assertEqual('unknown',path.read_text()) + + def test_untracked_stock_and_dangling_esbuild_are_rejected(self): + for kind in ('stock','esbuild'): + with self.subTest(kind=kind),tempfile.TemporaryDirectory() as name: + source,core,family,rev,asset=self.fixture(Path(name)) + if kind=='stock':(source/STOCK/'unknown.txt').write_text('unknown') + else: + path=source/FRONTEND/'third_party/esbuild';path.parent.mkdir(parents=True) + (source/FRONTEND/'.git/info/exclude').write_text('third_party/esbuild\n') + path.symlink_to(source/'missing',target_is_directory=True) + with self.assertRaises(RuntimeError):verify(source,core,family,rev) + + def test_unknown_asset_and_dirty_stock_are_rejected(self): + for kind in ('asset','stock'): + with self.subTest(kind=kind),tempfile.TemporaryDirectory() as name: + source,core,family,rev,asset=self.fixture(Path(name)) + if kind=='asset':asset.write_bytes(b'unknown') + else:(source/STOCK/'tracked.txt').write_text('unknown') + with self.assertRaises(RuntimeError):verify(source,core,family,rev) + + +if __name__=='__main__':unittest.main() diff --git a/scripts/verify_chromium_preparation.py b/scripts/verify_chromium_preparation.py new file mode 100644 index 0000000000..b93a9f493f --- /dev/null +++ b/scripts/verify_chromium_preparation.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 +"""Read-only proof that interrupted native preparation contains only reviewed branding.""" +import argparse +import hashlib +import json +import os +from pathlib import Path +import re +import subprocess + +from apply_chromium_patches import check_branding_asset_paths +from chromium_git import git_environment + +STOCK = 'third_party/devtools-frontend/src.chromium-original' +FRONTEND = 'third_party/devtools-frontend/src' + + +def git(root,*args,check=True): + return subprocess.run(['git','-C',str(root),*args],env=git_environment(),capture_output=True,check=check) + + +def verify(source,frontend,family,revision): + if not re.fullmatch(r'\d+\.\d+\.\d+\.\d+',family) or not re.fullmatch('[a-f0-9]{40}',revision):raise RuntimeError('Invalid reviewed preparation inputs') + source=source.resolve() + actual=git(source,'rev-parse','HEAD').stdout.decode().strip() + if actual!=revision:raise RuntimeError('Native revision differs from the reviewed upstream tag') + deps=git(source,'show','HEAD:DEPS').stdout.decode() + match=re.search(r"'devtools_frontend_revision': '([a-f0-9]{40})'",deps) + stock=source/STOCK;fork=source/FRONTEND + if not match or stock.is_symlink() or not stock.resolve().is_relative_to(source):raise RuntimeError('Invalid saved stock frontend') + stock_revision=git(stock,'rev-parse','HEAD').stdout.decode().strip() + if stock_revision!=match[1] or git(stock,'diff','--no-ext-diff','--no-textconv','HEAD').stdout or git(stock,'ls-files','--others','--exclude-standard','-z').stdout: + raise RuntimeError('Saved stock frontend revision or tracked files changed') + if fork.is_symlink() or not fork.resolve().is_relative_to(source):raise RuntimeError('Invalid replacement frontend') + old_frontend=git(fork,'rev-parse','HEAD').stdout.decode().strip() + if git(fork,'status','--porcelain').stdout:raise RuntimeError('Interrupted replacement frontend contains source changes') + link=fork/'third_party/esbuild' + if os.path.lexists(link) and (link.resolve()!=(stock/'third_party/esbuild').resolve() or not link.is_dir()): + raise RuntimeError('Interrupted esbuild path differs from saved stock tools') + manifest=json.loads((frontend/'patches/chromium'/family/'branding-assets.json').read_text()) + assets={} + for entry in manifest['files']: + path=Path(entry['destination']);check_branding_asset_paths(path,Path(entry['source'])) + name=path.as_posix() + if name in assets or not re.fullmatch('[a-f0-9]{64}',entry['sha256']):raise RuntimeError('Invalid reviewed branding manifest') + assets[name]=entry['sha256'] + changed=set(git(source,'diff','--name-only','--no-ext-diff','--no-textconv','--ignore-submodules=all','-z','HEAD','--','.',':!components/resources/sample_credits.html').stdout.decode().strip('\0').split('\0'))-{''} + untracked=set(git(source,'ls-files','--others','--exclude-standard','-z').stdout.decode().strip('\0').split('\0'))-{''} + # These two nested repositories were verified above; they are not native deltas. + untracked={name for name in untracked if not any(name.rstrip('/')==prefix or name.startswith(prefix+'/') for prefix in (STOCK,FRONTEND))} + unexpected=(changed|untracked)-assets.keys() + if unexpected:raise RuntimeError('Unreviewed native preparation changes: '+', '.join(sorted(unexpected))) + copied=[] + for name,expected in assets.items(): + path=source/name + if path.is_symlink() or not path.resolve().is_relative_to((source/'chrome/app/theme').resolve()) or not path.resolve().is_relative_to(source):raise RuntimeError('Branding asset escapes native theme tree') + original=git(source,'show','HEAD:'+name,check=False) + baseline=hashlib.sha256(original.stdout).hexdigest() if original.returncode==0 else None + if not path.exists(): + if baseline is not None:raise RuntimeError('Tracked branding asset was removed: '+name) + continue + actual_hash=hashlib.sha256(path.read_bytes()).hexdigest() + if actual_hash==expected:copied.append(name) + elif actual_hash!=baseline:raise RuntimeError('Unreviewed branding bytes: '+name) + if name in changed|untracked and actual_hash!=expected:raise RuntimeError('Changed branding does not match reviewed bytes: '+name) + return {'passed':True,'native_revision':revision,'stock_revision':stock_revision, + 'previous_frontend_revision':old_frontend,'copied_branding_paths':copied, + 'source_mutated':False} + + +if __name__=='__main__': + p=argparse.ArgumentParser(description=__doc__) + p.add_argument('--chromium-src',type=Path,required=True);p.add_argument('--frontend',type=Path,required=True) + p.add_argument('--patch-series-version',required=True);p.add_argument('--chromium-revision',required=True) + p.add_argument('--report',type=Path,required=True);a=p.parse_args() + result=verify(a.chromium_src,a.frontend,a.patch_series_version,a.chromium_revision) + a.report.write_text(json.dumps(result,indent=2)+'\n');print('Verified interrupted pristine/branding-only native preparation') From 8622018364731de469082647fb1fd5f857a032f8 Mon Sep 17 00:00:00 2001 From: agentflow-marathon Date: Mon, 30 Nov 2026 10:51:01 -0800 Subject: [PATCH 4/4] Test Windows dangling junctions without extra symlink privileges [skip ci] --- scripts/test_verify_chromium_preparation.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/test_verify_chromium_preparation.py b/scripts/test_verify_chromium_preparation.py index cc74987f96..18b98c46c0 100644 --- a/scripts/test_verify_chromium_preparation.py +++ b/scripts/test_verify_chromium_preparation.py @@ -1,6 +1,7 @@ from pathlib import Path import hashlib import json +import os import subprocess import tempfile import unittest @@ -59,7 +60,15 @@ def test_untracked_stock_and_dangling_esbuild_are_rejected(self): else: path=source/FRONTEND/'third_party/esbuild';path.parent.mkdir(parents=True) (source/FRONTEND/'.git/info/exclude').write_text('third_party/esbuild\n') - path.symlink_to(source/'missing',target_is_directory=True) + target=source/'missing' + if os.name=='nt': + # Junctions need no extra standard-user symlink right. + target.mkdir() + subprocess.run(['powershell.exe','-NoProfile','-NonInteractive','-Command', + "$ErrorActionPreference='Stop'; New-Item -ItemType Junction -Path $env:BO_TEST_LINK -Target $env:BO_TEST_TARGET | Out-Null"], + env={**os.environ,'BO_TEST_LINK':str(path),'BO_TEST_TARGET':str(target)},check=True,capture_output=True,timeout=30) + target.rmdir() + else:path.symlink_to(target,target_is_directory=True) with self.assertRaises(RuntimeError):verify(source,core,family,rev) def test_unknown_asset_and_dirty_stock_are_rejected(self):