maos: add backup, euicc, and communicate app integrations
- Commit
5d356b9536fcc84abcd5035980a3244193d7d3aa- Author
- Vayun Mathur <[email protected]>
- When
- 2026-08-12 20:44 UTC (3 months ago)
- Parents
04a0c72
Diff
Android.bp
diff --git a/Android.bp b/Android.bpindex ab1404c..86c7aa6 100644--- a/Android.bp+++ b/Android.bp@@ -170,3 +170,61 @@ android_app_import { enabled: false, }, }++// Communicate is a unified dialer + messaging app. It replaces BOTH GrapheneOS's Dialer+// (com.android.dialer, module Dialer) and Messaging (com.android.messaging, module Messaging),+// which are removed in modern_apps.mk. It becomes the default dialer and default SMS app via+// config_defaultDialer / config_defaultSms in the frameworks/base overlay (RRO). It holds the+// DIALER and SMS roles (declares an InCallService and the SMS_DELIVER/WAP_PUSH_DELIVER+// receivers); the role system auto-grants its runtime permissions, so it is NOT privileged and+// needs no default-permissions grant. The telephony backends (TelephonyProvider, telecom+// framework) are untouched — only the UI apps are removed.+android_app_import {+ name: "ModernAppsCommunicate",+ apk: "prebuilts/communicate-release.apk",+ presigned: true,+ product_specific: true,+ dex_preopt: {+ enabled: false,+ },+}++// Euicc is PRIVILEGED: it is the system eSIM LPA (Local Profile Assistant). It declares the+// android.service.euicc.EuiccService and the eSIM management LUI, and drives the eUICC over a+// telephony logical channel, so it needs the signature|privileged WRITE_EMBEDDED_SUBSCRIPTIONS /+// MODIFY_PHONE_STATE / READ_PRIVILEGED_PHONE_STATE perms (allowlisted in+// privapp-permissions-modern-apps.xml). It replaces Google's LPA app EuiccGoogle+// (com.google.android.euicc, removed in modern_apps.mk). The proprietary Pixel hardware backend+// EuiccSupportPixel (com.google.euiccpixel) and the modem firmware are KEPT — they provide the+// low-level access to the built-in eUICC that this app sits on top of.+android_app_import {+ name: "ModernAppsEuicc",+ apk: "prebuilts/euicc-release.apk",+ presigned: true,+ privileged: true,+ product_specific: true,+ dex_preopt: {+ enabled: false,+ },+}++// Backup is PRIVILEGED: it is the system app-data backup transport (declares+// android.app.backup.BackupTransport via a TRANSPORT_HOST service) and also does+// standalone encrypted file/media backup. Being the transport requires the+// signature|privileged BACKUP permission, and setting itself active requires+// WRITE_SECURE_SETTINGS — both allowlisted in privapp-permissions-modern-apps.xml.+// It replaces GrapheneOS's Seedvault (com.stevesoltys.seedvault) and the GrapheneOS+// contacts backup transport (app.grapheneos.backup.contacts), both removed in+// modern_apps.mk. It is pinned as the default transport via config_backup_transport+// in the frameworks/base overlay (RRO). Backups are encrypted with a BIP-39 recovery+// code; there is no separate content-provider backend to keep.+android_app_import {+ name: "ModernAppsBackup",+ apk: "prebuilts/backup-release.apk",+ presigned: true,+ privileged: true,+ product_specific: true,+ dex_preopt: {+ enabled: false,+ },+}
README.md
diff --git a/README.md b/README.mdindex 645ea89..658cf97 100644--- a/README.md+++ b/README.md@@ -26,6 +26,9 @@ repo.) | Speech | `com.vayunmathur.speech` | GrapheneOS SpeechServices (default STT + TTS) | | Calendar | `com.vayunmathur.calendar` | AOSP Calendar (uses system CalendarProvider) | | Music | `com.vayunmathur.music` | AOSP Music (incl. popup single-file player) |+| Communicate | `com.vayunmathur.communicate` | AOSP Dialer **and** Messaging (default dialer + SMS app) |+| Euicc | `com.vayunmathur.euicc` | Google's eSIM LPA **EuiccGoogle** (system LPA; Pixel `EuiccSupportPixel` backend kept — see below) |+| Backup | `com.vayunmathur.backup` | **Seedvault** (`com.stevesoltys.seedvault`) **and** the GrapheneOS contacts backup transport (`app.grapheneos.backup.contacts`) — system app-data backup transport; see below | ## Layout @@ -83,6 +86,23 @@ local_manifest.xml # adds this repo to the GrapheneOS tree `DocumentPickerActivity`. It is the **same APK** as the F-Droid build — no separate flavor. The picker component ships disabled and a small `Application` enables it only when `MANAGE_DOCUMENTS` is granted (i.e. only in MAOS), so the userspace Files app is unchanged.+- **Euicc is the eSIM LPA.** Modern Apps Euicc replaces Google's LPA app **EuiccGoogle**+ (`com.google.android.euicc`) and its companion RRO **EuiccGoogleOverlay**. It ships as a+ **priv-app** declaring `android.service.euicc.EuiccService`; with the Google LPA removed it is the+ sole app resolving that intent with `WRITE_EMBEDDED_SUBSCRIPTIONS`, so the framework selects it as+ the LPA automatically (no config pin). Its privileged perms (`WRITE_EMBEDDED_SUBSCRIPTIONS`,+ `MODIFY_PHONE_STATE`, `READ_PRIVILEGED_PHONE_STATE`) are in the privapp allowlist. Only the LPA+ *app* is swapped — the proprietary Pixel backend **`EuiccSupportPixel`** (`com.google.euiccpixel`)+ and the modem firmware are **kept**, since they provide the low-level access to the built-in eUICC.+- **Backup is the app-data backup transport.** Modern Apps Backup replaces GrapheneOS's+ **Seedvault** (`com.stevesoltys.seedvault`) and the GrapheneOS contacts backup transport+ (`app.grapheneos.backup.contacts`), both removed in `modern_apps.mk`. It ships as a **priv-app**+ declaring `android.app.backup.BackupTransport` via a service with the `android.backup.TRANSPORT_HOST`+ intent-filter (gated by the system-only `BIND_BACKUP_TRANSPORT`), and is pinned as the default+ transport via `config_backup_transport` in the RRO. Its privileged perms (`BACKUP` to act as a+ transport, `WRITE_SECURE_SETTINGS` to activate itself) are in the privapp allowlist. Backups are+ encrypted end-to-end with a **BIP-39** recovery code and written to a SAF folder or a+ WebDAV/Nextcloud remote, so there is no separate account/content-provider backend to keep. - **APKs are `presigned`** so each keeps its `com.vayunmathur` certificate, preserving the app-store update chain. The *OS* is signed with your own platform keys. - **Silent-breakage guard:** `modern_apps.mk` fails the build if any stock module we meant
build-maos.sh
diff --git a/build-maos.sh b/build-maos.shindex 1d683d4..925c2fd 100755--- a/build-maos.sh+++ b/build-maos.sh@@ -99,7 +99,7 @@ BUILD="$TAG" MANIFEST_URL="https://github.com/GrapheneOS/platform_manifest.git" MAOS_GH="https://github.com/vayun-mathur/" # overlay repo remote (for the local manifest) MODERN_APPS_GH="vayun-mathur/Modern-Apps" # source of the prebuilt APKs-APPS=(web camera pdf contacts calculator clock files photos appstore keyboard speech calendar music networklocation)+APPS=(web camera pdf contacts calculator clock files photos appstore keyboard speech calendar music communicate euicc backup networklocation) # ---- Derived / optional-env config ---- # ONE shared, device-independent key set (see the "Signing keys" note above).@@ -331,6 +331,8 @@ phase_overlay() { log "Verifying stock module names against this tag" grep -rn --include=*.mk -e '\bCamera\b' -e '\bPdfViewer\b' -e '\bApps\b' \ -e '\bContacts\b' -e '\bDeskClock\b' -e 'Calculator' -e 'Gallery2' -e 'DocumentsUI' \+ -e '\bDialer\b' -e '\bMessaging\b' -e '\bEuiccGoogle\b' \+ -e '\bSeedvault\b' -e '\bContactsBackup\b' \ build/ device/ vendor/ | grep -i 'PRODUCT_PACKAGES' || true warn "Confirm the names above match the filter-out list in vendor/modern-apps/modern_apps.mk."
modern_apps.mk
diff --git a/modern_apps.mk b/modern_apps.mkindex c902c9d..0c03d39 100644--- a/modern_apps.mk+++ b/modern_apps.mk@@ -23,6 +23,9 @@ PRODUCT_PACKAGES += \ ModernAppsSpeech \ ModernAppsCalendar \ ModernAppsMusic \+ ModernAppsCommunicate \+ ModernAppsEuicc \+ ModernAppsBackup \ ModernAppsNetworkLocation # 2. Remove the stock userspace apps we're replacing.@@ -51,8 +54,14 @@ _maos_remove := \ 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@@ -83,6 +92,16 @@ PRODUCT_PACKAGES := $(filter-out $(_maos_remove),$(PRODUCT_PACKAGES)) # in the keyboard app's own manifest (Modern-Apps repo). With LatinIME removed it is the sole # preinstalled IME, so the system enables/selects it by default. +# NOTE on communicate (dialer + messaging): Modern Apps Communicate (com.vayunmathur.communicate)+# is a single app that provides BOTH the phone dialer and the SMS/MMS messenger. It replaces the+# two separate GrapheneOS/AOSP UI apps Dialer (com.android.dialer) and Messaging+# (com.android.messaging), both removed above. It is made the default dialer via config_defaultDialer+# and the default SMS app via config_defaultSms in the frameworks/base overlay (RRO). Holding the+# DIALER and SMS roles causes the role system to auto-grant its runtime permissions, so it is NOT a+# priv-app and needs no default-permissions grant. Only the UI apps are removed; the telephony+# backends (TelephonyProvider, telecom framework) stay intact. Neither `Dialer` nor `Messaging` ends+# in `Provider`, so the safety guard above correctly permits removing them.+ # NOTE on network location + geocoder: Modern Apps NetworkLocation (com.vayunmathur.networklocation) # is a priv-app that provides BOTH the network location provider and the offline geocoder. It # replaces GrapheneOS's NetworkLocation module (app.grapheneos.networklocation), which we remove@@ -94,6 +113,37 @@ PRODUCT_PACKAGES := $(filter-out $(_maos_remove),$(PRODUCT_PACKAGES)) # `NetworkLocation` is a provider *implementation* app, NOT a content-provider backend — it does not # end in `Provider`, so the safety guard above correctly permits removing it. +# NOTE on eSIM (euicc): Modern Apps Euicc (com.vayunmathur.euicc) is a priv-app that is the system+# eSIM LPA (Local Profile Assistant). It declares android.service.euicc.EuiccService plus the eSIM+# management LUI (MANAGE_/PROVISION_EMBEDDED_SUBSCRIPTIONS) and implements the full SGP.22 stack,+# driving the eUICC over a telephony logical channel. It gets its signature|privileged perms+# (WRITE_EMBEDDED_SUBSCRIPTIONS / MODIFY_PHONE_STATE / READ_PRIVILEGED_PHONE_STATE) from+# privapp-permissions-modern-apps.xml. It replaces Google's LPA app EuiccGoogle+# (com.google.android.euicc) and its companion RRO EuiccGoogleOverlay (com.google.android.euiccoverlay),+# both removed above; with the Google LPA gone, ours is the sole app resolving the EuiccService intent+# with the privileged eSIM permission, so the framework selects it as the LPA automatically (no config+# pin needed). Only the LPA *app* layer is replaced: the proprietary Pixel hardware backend+# EuiccSupportPixel (com.google.euiccpixel) and the modem/Shannon firmware are KEPT — they provide the+# low-level access to the built-in eUICC that this app sits on top of. `EuiccGoogle`/`EuiccGoogleOverlay`+# are not content-provider backends (they don't end in `Provider`), so the safety guard permits removal.++# NOTE on backup: Modern Apps Backup (com.vayunmathur.backup) is a priv-app that is the system+# app-data backup transport. It declares android.app.backup.BackupTransport via a service with the+# android.backup.TRANSPORT_HOST intent-filter (gated by the system-only BIND_BACKUP_TRANSPORT+# permission) and also performs standalone encrypted file/media backup. It gets its+# signature|privileged perms (BACKUP to act as a transport, WRITE_SECURE_SETTINGS to activate+# itself) from privapp-permissions-modern-apps.xml, and is pinned as the default transport via+# config_backup_transport in the frameworks/base overlay (RRO). It replaces GrapheneOS's Seedvault+# (com.stevesoltys.seedvault, module Seedvault) and the GrapheneOS contacts backup transport+# (app.grapheneos.backup.contacts, module ContactsBackup), both removed above; with Seedvault gone,+# ours is the transport pinned by config_backup_transport. Backups are encrypted end-to-end with a+# BIP-39 recovery code, so there is no separate account/content-provider backend to keep. Neither+# `Seedvault` nor `ContactsBackup` ends in `Provider`, so the safety guard above permits removal.+# (Module names are the GrapheneOS build names — re-confirm on your synced tree if a build surprises+# you, per the note on the removal list above.)++# 3. framework-res config+ # 3. framework-res config (default browser, documents UI, speech recognition service, and the # geocoder / network-location provider pins + their override bools) ships as an explicit # static, platform-signed RRO. With PRODUCT_ENFORCE_RRO_TARGETS := * (from generic_system.mk)@@ -113,9 +163,11 @@ PRODUCT_PACKAGE_OVERLAYS += vendor/modern-apps/overlay PRODUCT_COPY_FILES += \ vendor/modern-apps/default-permissions-modern-apps.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/default-permissions/default-permissions-modern-apps.xml -# 4. Privileged-permission allowlist so Files (priv-app) may hold MANAGE_DOCUMENTS, and+# 4. Privileged-permission allowlist so Files (priv-app) may hold MANAGE_DOCUMENTS, # NetworkLocation (priv-app) may hold INSTALL_LOCATION_PROVIDER / LOCATION_HARDWARE /-# MODIFY_PHONE_STATE / UPDATE_DEVICE_STATS.+# MODIFY_PHONE_STATE / UPDATE_DEVICE_STATS, Euicc (priv-app, the eSIM LPA) may hold+# WRITE_EMBEDDED_SUBSCRIPTIONS / MODIFY_PHONE_STATE / READ_PRIVILEGED_PHONE_STATE, and+# Backup (priv-app, the app-data backup transport) may hold BACKUP / WRITE_SECURE_SETTINGS. PRODUCT_COPY_FILES += \ vendor/modern-apps/privapp-permissions-modern-apps.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/privapp-permissions-modern-apps.xml
privapp-permissions-modern-apps.xml
diff --git a/privapp-permissions-modern-apps.xml b/privapp-permissions-modern-apps.xmlindex 46a48a2..d5e84a8 100644--- a/privapp-permissions-modern-apps.xml+++ b/privapp-permissions-modern-apps.xml@@ -24,4 +24,23 @@ <permission name="android.permission.MODIFY_PHONE_STATE" /> <permission name="android.permission.UPDATE_DEVICE_STATS" /> </privapp-permissions>++ <!-- Euicc is the system eSIM LPA (declares EuiccService). Managing embedded subscriptions+ and driving the eUICC over a telephony logical channel requires these signature|privileged+ perms. Replaces Google's EuiccGoogle LPA; the EuiccSupportPixel hardware backend is kept. -->+ <privapp-permissions package="com.vayunmathur.euicc">+ <permission name="android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS" />+ <permission name="android.permission.MODIFY_PHONE_STATE" />+ <permission name="android.permission.READ_PRIVILEGED_PHONE_STATE" />+ </privapp-permissions>++ <!-- Backup is the system app-data backup transport (declares BackupTransport via a+ TRANSPORT_HOST service). Acting as a transport requires the signature|privileged+ BACKUP permission; activating itself as the current transport requires+ WRITE_SECURE_SETTINGS. Replaces GrapheneOS's Seedvault; pinned as the default+ transport via config_backup_transport. -->+ <privapp-permissions package="com.vayunmathur.backup">+ <permission name="android.permission.BACKUP" />+ <permission name="android.permission.WRITE_SECURE_SETTINGS" />+ </privapp-permissions> </permissions>
rro/MaosFrameworkResRRO/res/values/config.xml
diff --git a/rro/MaosFrameworkResRRO/res/values/config.xml b/rro/MaosFrameworkResRRO/res/values/config.xmlindex da387d5..07149a1 100644--- a/rro/MaosFrameworkResRRO/res/values/config.xml+++ b/rro/MaosFrameworkResRRO/res/values/config.xml@@ -23,6 +23,17 @@ <!-- TTS: Modern Apps Speech (Piper) is the only installed engine, so the framework selects it as the default TTS engine automatically; no dedicated config exists. --> + <!-- Default dialer role -> Modern Apps Communicate. Replaces GrapheneOS's Dialer+ (com.android.dialer), removed in modern_apps.mk. Communicate declares an InCallService+ and holds the DIALER role. -->+ <string name="config_defaultDialer" translatable="false">com.vayunmathur.communicate</string>++ <!-- Default SMS/MMS app role -> Modern Apps Communicate. Replaces GrapheneOS's Messaging+ (com.android.messaging), removed in modern_apps.mk. Communicate declares the+ SMS_DELIVER / WAP_PUSH_DELIVER receivers and holds the SMS role; the role system+ auto-grants its SMS/Phone/Contacts runtime permissions. -->+ <string name="config_defaultSms" translatable="false">com.vayunmathur.communicate</string>+ <!-- Offline geocoder -> Modern Apps NetworkLocation. Its GeocodeService (bound via the com.android.location.service.GeocodeProvider action) becomes THE system geocoder. Replaces GrapheneOS's NetworkLocation module (removed in modern_apps.mk). -->@@ -40,4 +51,12 @@ key, not the platform key, so it would never be selected. Force the explicit-pin path. --> <bool name="config_enableNetworkLocationOverlay">false</bool> <bool name="config_enableGeocoderOverlay">false</bool>++ <!-- Default app-data backup transport -> Modern Apps Backup. Replaces GrapheneOS's+ Seedvault (com.stevesoltys.seedvault) and the GrapheneOS contacts backup transport+ (app.grapheneos.backup.contacts), both removed in modern_apps.mk. This is the AOSP+ framework default-transport pin (a "package/service" component); Backup holds the+ signature|privileged BACKUP permission (allowlisted in+ privapp-permissions-modern-apps.xml) so the BackupManagerService will bind it. -->+ <string name="config_backup_transport" translatable="false">com.vayunmathur.backup/.transport.ConfigurableBackupTransportService</string> </resources>
scripts/collect-apks.sh
diff --git a/scripts/collect-apks.sh b/scripts/collect-apks.shindex 04d9f2c..23b21ac 100755--- a/scripts/collect-apks.sh+++ b/scripts/collect-apks.sh@@ -21,7 +21,7 @@ SRC="${1:?usage: collect-apks.sh <path to Modern-Apps repo, its distribution_apk DEST="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/prebuilts" mkdir -p "$DEST" -APPS=(web camera pdf contacts calculator clock files photos appstore keyboard speech calendar music networklocation)+APPS=(web camera pdf contacts calculator clock files photos appstore keyboard speech calendar music communicate euicc backup networklocation) find_apk() { local app="$1"