maos: point Widevine provisioning at MAOS server
- Commit
ec23262e1324c9bc1114a4450a6e99bc4c0c207e- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-17 02:59 UTC (19 days ago)
- Parents
d387b22
Repoint the GrapheneOS-mode Widevine provisioning hostname from GrapheneOS to MAOS, applied as build-time patches like the other GrapheneOS-source customizations (two new patches, wired into apply_maos_patches in build-maos.sh). A hardcoded Java hostname cannot be overridden by RRO. Widevine (frameworks_base_widevine_provisioning.patch, frameworks/base): WidevineProvisioningSettings WV_GRAPHENEOS_PROXY_HOSTNAME "widevineprovisioning.grapheneos.org" -> WV_MAOS_PROXY_HOSTNAME "wv.maproj.org", renaming the private constant to MAOS. Only the hostname is overridden in this class: the Widevine CDM supplies path+query (its default URL is https://www.googleapis.com/certificateprovisioning/v1/devicecertificates/create?key=...), so the effective MAOS URL is https://wv.maproj.org/certificateprovisioning/v1/devicecertificates/create?... The public WV_GRAPHENEOS_PROXY mode int is kept, like the RKP/GRAPHENEOS_PROXY case: its value is persisted in Settings.Global and referenced by WidevineProvisioningPrefController, so renaming it would be a needless cross-repo change. Owner DNS note: wv.maproj.org is handled server-side (an HTTPS reverse proxy to www.googleapis.com is being added to our server in parallel; it can be Cloudflare-proxied like rkp since it is plain HTTPS); no device-side DNS work in this commit. Until that proxy + DNS exist, MAOS-mode Widevine provisioning will fail. Settings strings (packages_apps_Settings_widevine_servers.patch, packages/apps/Settings, registered after packages_apps_Settings_ct_rkp_servers.patch because its preimage is the post-ct_rkp strings_ext.xml): widevine_provisioning_enabled_grapheneos_proxy "GrapheneOS proxy" -> "MAOS servers", consistent with the SUPL/PSDS/CT/RKP relabels. String name and WidevineProvisioningPrefController are unchanged; the standard Google option (widevine_provisioning_enabled_google_server, WV_STANDARD_SERVER) is untouched. Bypass check: git grep over frameworks/base and packages/apps/Settings for widevineprovisioning.grapheneos.org found only the one hostname line changed above. The consumer path is MediaDrm.getProvisionRequest() -> ProvisionRequest.defaultUrl (from the vendor Widevine CDM) with its hostname replaced by getServerHostnameOverride(); MediaPlayer and apps POST to that URL. Verified without a full OS build: git apply --check on the pristine WidevineProvisioningSettings.java passes and --reverse --check passes after applying. The Settings strings patch was verified sequentially: current tree strings_ext.xml (post-settings.patch) + ct_rkp patch -> apply --check, apply, --reverse --check for the Widevine patch, and the patched XML parses; it also --checks directly on the current tree. Also verified with the patch files copied into ~/maos/vendor/modern-apps/patches (and its build-maos.sh synced, incl. the previously lagging CT/RKP patch files so every registration resolves), and bash -n on build-maos.sh. javac (prebuilts jdk21, prebuilts/sdk/37.0 public android.jar; no 37.1 jar exists in this tree) on patched vs pristine WidevineProvisioningSettings.java gives an identical error profile: 11 errors in both, all missing internal packages/symbols (android.annotation, android.ext.settings IntSetting) with zero syntax errors (normalized logs identical apart from path/line numbers).
Diff
build-maos.sh
diff --git a/build-maos.sh b/build-maos.shindex 7c4950e..05a9f9a 100755--- a/build-maos.sh+++ b/build-maos.sh@@ -273,6 +273,7 @@ apply_maos_patches() { "frameworks/base:frameworks_base.patch" \ "frameworks/base:frameworks_base_gnss_servers.patch" \ "frameworks/base:frameworks_base_remote_key_provisioning.patch" \+ "frameworks/base:frameworks_base_widevine_provisioning.patch" \ "packages/modules/Connectivity:packages_modules_Connectivity_certificate_transparency.patch" \ "frameworks/opt/telephony:frameworks_opt_telephony.patch" \ "packages/modules/Permission:permission_roles.patch" \@@ -282,6 +283,7 @@ apply_maos_patches() { "script:script.patch" \ "packages/apps/Settings:settings.patch" \ "packages/apps/Settings:packages_apps_Settings_ct_rkp_servers.patch" \+ "packages/apps/Settings:packages_apps_Settings_widevine_servers.patch" \ "packages/apps/SetupWizard2:setupwizard2.patch" \ "external/roboto-fonts:roboto_fonts.patch" \ "packages/apps/GmsCompat:gmscompat.patch" \
patches/frameworks_base_widevine_provisioning.patch
diff --git a/patches/frameworks_base_widevine_provisioning.patch b/patches/frameworks_base_widevine_provisioning.patchnew file mode 100644index 0000000..60dc075--- /dev/null+++ b/patches/frameworks_base_widevine_provisioning.patch@@ -0,0 +1,32 @@+diff --git a/core/java/android/ext/settings/WidevineProvisioningSettings.java b/core/java/android/ext/settings/WidevineProvisioningSettings.java+index 6d5ba2eaa69a..93415d7d58c5 100644+--- a/core/java/android/ext/settings/WidevineProvisioningSettings.java++++ b/core/java/android/ext/settings/WidevineProvisioningSettings.java+@@ -16,7 +16,17 @@ public class WidevineProvisioningSettings {+ /** @hide */+ public static final int WV_STANDARD_SERVER = 1;+ +- private static final String WV_GRAPHENEOS_PROXY_HOSTNAME = "widevineprovisioning.grapheneos.org";++ // MAOS: self-hosted HTTPS reverse proxy to Google's Widevine++ // provisioning server (wv.maproj.org -> www.googleapis.com, DNS/proxy++ // handled server-side). Only the hostname is overridden here: the++ // Widevine CDM supplies the path+query (its default URL is++ // https://www.googleapis.com/certificateprovisioning/v1/devicecertificates/create?key=...),++ // so the effective MAOS URL is https://wv.maproj.org/certificateprovisioning/...++ // The public WV_GRAPHENEOS_PROXY mode constant is kept: its int value is++ // persisted in Settings.Global and referenced by Settings, so renaming++ // it would be a needless cross-repo change. Only this private hostname++ // constant is renamed.++ private static final String WV_MAOS_PROXY_HOSTNAME = "wv.maproj.org";+ + /** @hide */+ public static final IntSetting SERVER_SETTING = new IntSetting(+@@ -28,7 +38,7 @@ public class WidevineProvisioningSettings {+ @Nullable+ public static String getServerHostnameOverride(@NonNull Context ctx) {+ if (SERVER_SETTING.get(ctx) == WV_GRAPHENEOS_PROXY) {+- return WV_GRAPHENEOS_PROXY_HOSTNAME;++ return WV_MAOS_PROXY_HOSTNAME;+ }+ return null;+ }
patches/packages_apps_Settings_widevine_servers.patch
diff --git a/patches/packages_apps_Settings_widevine_servers.patch b/patches/packages_apps_Settings_widevine_servers.patchnew file mode 100644index 0000000..2aa7e32--- /dev/null+++ b/patches/packages_apps_Settings_widevine_servers.patch@@ -0,0 +1,13 @@+diff --git a/res/values/strings_ext.xml b/res/values/strings_ext.xml+index d8326f35aef6..c725a098a2b4 100644+--- a/res/values/strings_ext.xml++++ b/res/values/strings_ext.xml+@@ -107,7 +107,7 @@+ </string>+ + <string name="widevine_provisioning_title">Widevine provisioning</string>+- <string name="widevine_provisioning_enabled_grapheneos_proxy">GrapheneOS proxy</string>++ <string name="widevine_provisioning_enabled_grapheneos_proxy">MAOS servers</string>+ <string name="widevine_provisioning_enabled_google_server">Google server</string>+ <string name="widevine_provisioning_footer">The provisioned certificate will be used for accessing DRM protected content.</string>+