maos: declare app membership in GrapheneOS product makefiles
- Commit
1ae4600334334576a5685bff4031c1201acc20ed- Author
- Vayun Mathur <[email protected]>
- When
- 2026-09-06 01:51 UTC (3 months ago)
- Parents
5d356b9
Diff
build-maos.sh
diff --git a/build-maos.sh b/build-maos.shindex 925c2fd..1037036 100755--- a/build-maos.sh+++ b/build-maos.sh@@ -245,6 +245,29 @@ phase_deps() { fi } +# Apply MAOS's patches to GrapheneOS-owned sources. Idempotent: a patch that is already+# applied is skipped, and one that no longer applies is fatal rather than silent.+apply_maos_patches() {+ cd "$TREE"+ local patches="vendor/modern-apps/patches"+ [[ -d "$patches" ]] || die "Missing $patches — is vendor/modern-apps synced?"+ local spec repo patch+ for spec in "build/make:platform_build.patch" "vendor/adevtool:adevtool.patch"; do+ repo="${spec%%:*}"; patch="$TREE/$patches/${spec##*:}"+ [[ -f "$patch" ]] || die "Missing patch file: $patch"+ [[ -d "$repo" ]] || die "Missing repo for patch: $repo"+ if git -C "$repo" apply --reverse --check "$patch" 2>/dev/null; then+ log "Patch already applied to $repo (${spec##*:})"+ elif git -C "$repo" apply --check "$patch" 2>/dev/null; then+ git -C "$repo" apply "$patch"+ log "Applied ${spec##*:} to $repo"+ else+ die "${spec##*:} does not apply to $repo. GrapheneOS tag $TAG likely moved these+ files; rebase the patch (edit $repo, then: git -C $repo diff > $patch)."+ fi+ done+}+ phase_sync() { log "Syncing GrapheneOS $TAG into $TREE" case "$TREE" in /mnt/*) die "TREE is under /mnt (Windows FS). Use ext4, e.g. \$HOME/maos.";; esac@@ -275,6 +298,8 @@ phase_sync() { EOF log "repo sync (this downloads ~150 GB; resumable)" repo sync -j8+ # repo sync is exactly what reverts these, so re-apply right after.+ apply_maos_patches } populate_prebuilts() {@@ -303,6 +328,9 @@ populate_prebuilts() { } phase_vendor() {+ # Must precede generate-all: the eSIM removal lives in adevtool's vendor+ # skeletons, which are the source this copies into vendor/google_devices/.+ apply_maos_patches log "Extracting Pixel vendor files for $DEVICE (adevtool)" cd "$TREE"; source build/envsetup.sh # Modern Apps prebuilt APKs must exist before adevtool generate-all triggers a
modern_apps.mk
diff --git a/modern_apps.mk b/modern_apps.mkindex 0c03d39..996bd0a 100644--- a/modern_apps.mk+++ b/modern_apps.mk@@ -1,77 +1,16 @@ # MAOS (Modern Apps OS) — product configuration overlay. #-# Include this from your device product makefile AFTER the base GrapheneOS/AOSP-# product has been inherited, so the $(filter-out ...) below can see and remove the-# stock app modules. Example (in device/.../aosp_<device>.mk):-#-# $(call inherit-product, vendor/modern-apps/modern_apps.mk) # must be LAST+# Inherited from the device product makefile. The MAOS app list itself lives in+# GrapheneOS's build/make/target/product/*.mk, patched in by phase_overlay - a+# makefile inherited from here cannot add or remove PRODUCT_PACKAGES entries that+# belong to the parent, because inherit-product defers resolution (see+# build/make/core/product.mk:539). # # ----------------------------------------------------------------------------------- -# 1. Add the Modern Apps prebuilts (defined in Android.bp).-PRODUCT_PACKAGES += \- ModernAppsWeb \- ModernAppsCamera \- ModernAppsPdf \- ModernAppsContacts \- ModernAppsCalculator \- ModernAppsClock \- ModernAppsFiles \- ModernAppsPhotos \- ModernAppsStore \- ModernAppsKeyboard \- ModernAppsSpeech \- ModernAppsCalendar \- ModernAppsMusic \- ModernAppsCommunicate \- ModernAppsEuicc \- ModernAppsBackup \- ModernAppsNetworkLocation--# 2. Remove the stock userspace apps we're replacing.-# IMPORTANT: only ever remove *UI apps*, never content-provider backends. Contacts and-# Calendar are each split in AOSP/GrapheneOS:-# - UI: Contacts (com.android.contacts), Calendar (com.android.calendar)-# - backend: ContactsProvider (com.android.providers.contacts),-# CalendarProvider (com.android.providers.calendar)-# The *Provider modules implement ContactsContract/CalendarContract that our apps (and-# everything else) depend on — removing them breaks the whole system. So we remove only-# the UI apps, leaving ContactsProvider/CalendarProvider intact.-#-# Module names below are VERIFIED against a real GrapheneOS device (Pixel 9 Pro XL, from-# the /product/app/<Module>/<Module>.apk install paths). They should match cheetah (same-# OS build across Pixels), but re-confirm on your synced tree if a build surprises you.-_maos_remove := \- Camera \- PdfViewerGOS \- AppStore \- Contacts \- Calendar \- DeskClock \- ExactCalculator \- Gallery2 \- DocumentsUI \- LatinIME \- SpeechServices \- Music \- Dialer \- Messaging \- InfoApp \- Auditor \- EuiccGoogle \- EuiccGoogleOverlay \- Seedvault \- ContactsBackup \- NetworkLocation--# Safety: refuse to remove any content-provider backend. This makes the Contacts/Calendar-# footgun structurally impossible — if a *Provider ever ends up in the list, fail loudly.-_maos_providers := $(filter %Provider,$(_maos_remove))-ifneq ($(_maos_providers),)-$(error MAOS: refusing to remove content providers: $(_maos_providers). Remove only UI apps, never *Provider backends.)-endif--PRODUCT_PACKAGES := $(filter-out $(_maos_remove),$(PRODUCT_PACKAGES))+# 1. App membership (which Modern Apps ship, which stock apps are dropped) is applied+# by patches/platform_build.patch against build/make/target/product/*.mk. The+# Android.bp modules referenced there are defined alongside this file. # NOTE on the browser (Vanadium): Vanadium provides BOTH the default browser AND the # system WebView provider. We make Modern Apps Web the default browser via the@@ -179,9 +118,7 @@ PRODUCT_COPY_FILES += \ # 5. MAOS branding (PRODUCT_* + ro.maos.* props). Kept separate for readability. $(call inherit-product-if-exists, vendor/modern-apps/maos_branding.mk) -# 6. Build-time guard: fail the build if any stock app we meant to drop is still in-# PRODUCT_PACKAGES (catches upstream module renames that would silently re-add it).-_maos_leaked := $(filter $(_maos_remove),$(PRODUCT_PACKAGES))-ifneq ($(_maos_leaked),)-$(error MAOS: stock apps still present in PRODUCT_PACKAGES: $(_maos_leaked). Update the _maos_remove list in vendor/modern-apps/modern_apps.mk)-endif+# 6. The old leak guard lived here. It filtered the same local PRODUCT_PACKAGES as the+# removal above, so it was always empty and never fired - which is why a build that+# shipped zero MAOS apps still reported success. Removal is now a patch, and a patch+# that no longer applies fails loudly in phase_overlay.
patches/adevtool.patch
diff --git a/patches/adevtool.patch b/patches/adevtool.patchnew file mode 100644index 0000000..624e694--- /dev/null+++ b/patches/adevtool.patch@@ -0,0 +1,260 @@+diff --git a/vendor-skels/google_devices/akita/akita.mk b/vendor-skels/google_devices/akita/akita.mk+index d81ccef5b..d7ec08bc9 100644+--- a/vendor-skels/google_devices/akita/akita.mk++++ b/vendor-skels/google_devices/akita/akita.mk+@@ -583,8 +583,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel-P23 \+ EuiccSupportPixelPermissions \+ OemRilHookService \+diff --git a/vendor-skels/google_devices/blazer/blazer.mk b/vendor-skels/google_devices/blazer/blazer.mk+index a72a5650b..5c6411530 100644+--- a/vendor-skels/google_devices/blazer/blazer.mk++++ b/vendor-skels/google_devices/blazer/blazer.mk+@@ -598,8 +598,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel-P23 \+ EuiccSupportPixelPermissions \+ OemRilHookService \+diff --git a/vendor-skels/google_devices/bluejay/bluejay.mk b/vendor-skels/google_devices/bluejay/bluejay.mk+index cc36d92b6..58c6f0812 100644+--- a/vendor-skels/google_devices/bluejay/bluejay.mk++++ b/vendor-skels/google_devices/bluejay/bluejay.mk+@@ -541,8 +541,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel \+ EuiccSupportPixelPermissions \+ HbmSVManager \+diff --git a/vendor-skels/google_devices/caiman/caiman.mk b/vendor-skels/google_devices/caiman/caiman.mk+index a4e971eb2..ec3ab63fe 100644+--- a/vendor-skels/google_devices/caiman/caiman.mk++++ b/vendor-skels/google_devices/caiman/caiman.mk+@@ -592,8 +592,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel-P23 \+ EuiccSupportPixelPermissions \+ OemRilHookService \+diff --git a/vendor-skels/google_devices/cheetah/cheetah.mk b/vendor-skels/google_devices/cheetah/cheetah.mk+index e0a7c32ff..51d9b6675 100644+--- a/vendor-skels/google_devices/cheetah/cheetah.mk++++ b/vendor-skels/google_devices/cheetah/cheetah.mk+@@ -569,8 +569,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel \+ EuiccSupportPixelPermissions \+ HbmSVManager \+diff --git a/vendor-skels/google_devices/comet/comet.mk b/vendor-skels/google_devices/comet/comet.mk+index 3caac251e..363abfdc0 100644+--- a/vendor-skels/google_devices/comet/comet.mk++++ b/vendor-skels/google_devices/comet/comet.mk+@@ -602,8 +602,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel-P23 \+ EuiccSupportPixelPermissions \+ OemRilHookService \+diff --git a/vendor-skels/google_devices/felix/felix.mk b/vendor-skels/google_devices/felix/felix.mk+index 3c808dc59..237f3fd8e 100644+--- a/vendor-skels/google_devices/felix/felix.mk++++ b/vendor-skels/google_devices/felix/felix.mk+@@ -579,8 +579,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel \+ EuiccSupportPixelPermissions \+ HbmSVManager \+diff --git a/vendor-skels/google_devices/frankel/frankel.mk b/vendor-skels/google_devices/frankel/frankel.mk+index caab39760..651dd850c 100644+--- a/vendor-skels/google_devices/frankel/frankel.mk++++ b/vendor-skels/google_devices/frankel/frankel.mk+@@ -593,8 +593,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel-P23 \+ EuiccSupportPixelPermissions \+ OemRilHookService \+diff --git a/vendor-skels/google_devices/husky/husky.mk b/vendor-skels/google_devices/husky/husky.mk+index 8094ff978..20ff8d47d 100644+--- a/vendor-skels/google_devices/husky/husky.mk++++ b/vendor-skels/google_devices/husky/husky.mk+@@ -577,8 +577,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel-P23 \+ EuiccSupportPixelPermissions \+ OemRilHookService \+diff --git a/vendor-skels/google_devices/komodo/komodo.mk b/vendor-skels/google_devices/komodo/komodo.mk+index 30ce39a98..17ec484f0 100644+--- a/vendor-skels/google_devices/komodo/komodo.mk++++ b/vendor-skels/google_devices/komodo/komodo.mk+@@ -592,8 +592,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel-P23 \+ EuiccSupportPixelPermissions \+ OemRilHookService \+diff --git a/vendor-skels/google_devices/lynx/lynx.mk b/vendor-skels/google_devices/lynx/lynx.mk+index d765bc351..076223174 100644+--- a/vendor-skels/google_devices/lynx/lynx.mk++++ b/vendor-skels/google_devices/lynx/lynx.mk+@@ -567,8 +567,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel \+ EuiccSupportPixelPermissions \+ HbmSVManager \+diff --git a/vendor-skels/google_devices/mustang/mustang.mk b/vendor-skels/google_devices/mustang/mustang.mk+index 4f44cdbaf..2348377e3 100644+--- a/vendor-skels/google_devices/mustang/mustang.mk++++ b/vendor-skels/google_devices/mustang/mustang.mk+@@ -598,8 +598,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel-P23 \+ EuiccSupportPixelPermissions \+ OemRilHookService \+diff --git a/vendor-skels/google_devices/oriole/oriole.mk b/vendor-skels/google_devices/oriole/oriole.mk+index c031b121f..6f42bac22 100644+--- a/vendor-skels/google_devices/oriole/oriole.mk++++ b/vendor-skels/google_devices/oriole/oriole.mk+@@ -552,8 +552,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel \+ EuiccSupportPixelPermissions \+ HbmSVManager \+diff --git a/vendor-skels/google_devices/panther/panther.mk b/vendor-skels/google_devices/panther/panther.mk+index d8c8b4ac3..80c560494 100644+--- a/vendor-skels/google_devices/panther/panther.mk++++ b/vendor-skels/google_devices/panther/panther.mk+@@ -570,8 +570,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel \+ EuiccSupportPixelPermissions \+ HbmSVManager \+diff --git a/vendor-skels/google_devices/rango/rango.mk b/vendor-skels/google_devices/rango/rango.mk+index 79da5d0fd..bc07df294 100644+--- a/vendor-skels/google_devices/rango/rango.mk++++ b/vendor-skels/google_devices/rango/rango.mk+@@ -611,8 +611,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel-P23 \+ EuiccSupportPixelPermissions \+ OemRilHookService \+diff --git a/vendor-skels/google_devices/raven/raven.mk b/vendor-skels/google_devices/raven/raven.mk+index b4b7dd1f6..7bc84e728 100644+--- a/vendor-skels/google_devices/raven/raven.mk++++ b/vendor-skels/google_devices/raven/raven.mk+@@ -554,8 +554,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel \+ EuiccSupportPixelPermissions \+ HbmSVManager \+diff --git a/vendor-skels/google_devices/shiba/shiba.mk b/vendor-skels/google_devices/shiba/shiba.mk+index 311cac53b..f866d3136 100644+--- a/vendor-skels/google_devices/shiba/shiba.mk++++ b/vendor-skels/google_devices/shiba/shiba.mk+@@ -573,8 +573,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel-P23 \+ EuiccSupportPixelPermissions \+ OemRilHookService \+diff --git a/vendor-skels/google_devices/stallion/stallion.mk b/vendor-skels/google_devices/stallion/stallion.mk+index 7875f23fe..e67f2fa50 100644+--- a/vendor-skels/google_devices/stallion/stallion.mk++++ b/vendor-skels/google_devices/stallion/stallion.mk+@@ -586,8 +586,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel-P23 \+ EuiccSupportPixelPermissions \+ OemRilHookService \+diff --git a/vendor-skels/google_devices/tegu/tegu.mk b/vendor-skels/google_devices/tegu/tegu.mk+index 21b538b72..85448456b 100644+--- a/vendor-skels/google_devices/tegu/tegu.mk++++ b/vendor-skels/google_devices/tegu/tegu.mk+@@ -588,8 +588,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel-P23 \+ EuiccSupportPixelPermissions \+ OemRilHookService \+diff --git a/vendor-skels/google_devices/tokay/tokay.mk b/vendor-skels/google_devices/tokay/tokay.mk+index 67eac4ffa..e52a53917 100644+--- a/vendor-skels/google_devices/tokay/tokay.mk++++ b/vendor-skels/google_devices/tokay/tokay.mk+@@ -588,8 +588,6 @@ PRODUCT_PACKAGES += \+ + # file-based packages+ PRODUCT_PACKAGES += \+- EuiccGoogle \+- EuiccGoogleOverlay \+ EuiccSupportPixel-P23 \+ EuiccSupportPixelPermissions \+ OemRilHookService \
patches/platform_build.patch
diff --git a/patches/platform_build.patch b/patches/platform_build.patchnew file mode 100644index 0000000..2361c27--- /dev/null+++ b/patches/platform_build.patch@@ -0,0 +1,108 @@+diff --git a/target/product/aosp_base_telephony.mk b/target/product/aosp_base_telephony.mk+index 8e5cc4cbdf..f1ddd7718c 100644+--- a/target/product/aosp_base_telephony.mk++++ b/target/product/aosp_base_telephony.mk+@@ -16,5 +16,4 @@+ $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)+ + PRODUCT_PACKAGES += \+- Messaging \+ Stk+diff --git a/target/product/aosp_product.mk b/target/product/aosp_product.mk+index c54d58ddf6..fe09fa2969 100644+--- a/target/product/aosp_product.mk++++ b/target/product/aosp_product.mk+@@ -31,7 +31,6 @@ PRODUCT_PRODUCT_PROPERTIES += \+ # More AOSP packages+ PRODUCT_PACKAGES += \+ initial-package-stopped-states-aosp.xml \+- Messaging \+ PhotoTable \+ preinstalled-packages-platform-aosp-product.xml \+ ThemePicker \+diff --git a/target/product/handheld_product.mk b/target/product/handheld_product.mk+index 2a4602d43b..bd9a088fea 100644+--- a/target/product/handheld_product.mk++++ b/target/product/handheld_product.mk+@@ -22,21 +22,25 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/media_product.mk)+ + # /product packages+ PRODUCT_PACKAGES += \+- AppStore \+- Auditor \+- Calendar \+- Camera \+- Contacts \+- DeskClock \+- ExactCalculator \+- Gallery2 \+- InfoApp \+- LatinIME \+- Music \+- PdfViewerGOS \++ ModernAppsWeb \++ ModernAppsCamera \++ ModernAppsPdf \++ ModernAppsContacts \++ ModernAppsCalculator \++ ModernAppsClock \++ ModernAppsFiles \++ ModernAppsPhotos \++ ModernAppsStore \++ ModernAppsKeyboard \++ ModernAppsSpeech \++ ModernAppsCalendar \++ ModernAppsMusic \++ ModernAppsCommunicate \++ ModernAppsEuicc \++ ModernAppsBackup \++ ModernAppsNetworkLocation \+ preinstalled-packages-platform-handheld-product.xml \+ SettingsIntelligence \+- SpeechServices \+ talkback \+ ThemePicker \+ ThemesStub \+diff --git a/target/product/handheld_system.mk b/target/product/handheld_system.mk+index 029bdd6ef3..b9729321b2 100644+--- a/target/product/handheld_system.mk++++ b/target/product/handheld_system.mk+@@ -48,7 +48,6 @@ PRODUCT_PACKAGES += \+ CredentialManager \+ DeviceAsWebcam \+ DeviceDiagnostics \+- DocumentsUI \+ DownloadProviderUi \+ EasterEgg \+ ExternalStorageProvider \+@@ -62,7 +61,6 @@ PRODUCT_PACKAGES += \+ MmsService \+ MtpService \+ MusicFX \+- NetworkLocation \+ PacProcessor \+ preinstalled-packages-platform-handheld-system.xml \+ PrintRecommendationService \+diff --git a/target/product/media_system.mk b/target/product/media_system.mk+index 424844a429..8cd1714de2 100644+--- a/target/product/media_system.mk++++ b/target/product/media_system.mk+@@ -40,7 +40,6 @@ ifeq ($(OFFICIAL_BUILD),true)+ PRODUCT_PACKAGES += Updater+ endif+ +-PRODUCT_PACKAGES += Seedvault+ + # Allowlist for system packages included in media_system.mk+ PRODUCT_PACKAGES += preinstalled-packages-media-system.xml+diff --git a/target/product/telephony_product.mk b/target/product/telephony_product.mk+index aa70f46797..0705511932 100644+--- a/target/product/telephony_product.mk++++ b/target/product/telephony_product.mk+@@ -19,6 +19,5 @@+ + # /product packages+ PRODUCT_PACKAGES += \+- Dialer \+ ImsServiceEntitlement \+ preinstalled-packages-platform-telephony-product.xml