Modern Apps git

MAOS.git

Public
git clone https://git.maproj.org/MAOS.git
main ▾

MAOS.git / privapp-permissions-modern-apps.xml

privapp-permissions-modern-apps.xml200 lines · 12.9 KiBRaw
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3 Privileged-permission allowlist for Modern Apps priv-apps.
4 Copied to /product/etc/permissions/ by modern_apps.mk. Without this entry the build
5 (and boot) rejects a priv-app that requests a signature|privileged permission.
6-->
7<permissions>
8 <!-- Files takes over DocumentsUI's Storage Access Framework role in the system build,
9 which requires the signature|privileged MANAGE_DOCUMENTS permission. -->
10 <privapp-permissions package="com.vayunmathur.files">
11 <permission name="android.permission.MANAGE_DOCUMENTS" />
12 </privapp-permissions>
13
14 <!-- NOTE: MANAGE_EXTERNAL_STORAGE (all-files access), if Files needs it, is a special
15 app-op permission granted via role/appops, NOT a privapp-permission — do not add
16 it here. -->
17
18 <!-- NetworkLocation is a priv-app providing the system network location provider and
19 geocoder (pinned via config_networkLocationProviderPackageName /
20 config_geocoderProviderPackageName). It requires these signature|privileged perms. -->
21 <privapp-permissions package="com.vayunmathur.networklocation">
22 <permission name="android.permission.INSTALL_LOCATION_PROVIDER" />
23 <permission name="android.permission.LOCATION_HARDWARE" />
24 <permission name="android.permission.MODIFY_PHONE_STATE" />
25 <permission name="android.permission.UPDATE_DEVICE_STATS" />
26 </privapp-permissions>
27
28 <!-- Euicc is the system eSIM LPA (declares EuiccService). Managing embedded subscriptions
29 and driving the eUICC over a telephony logical channel requires these signature|privileged
30 perms. Replaces Google's EuiccGoogle LPA; the EuiccSupportPixel hardware backend is kept. -->
31 <!-- Share drives Google's Mosey (AWDL) HAL for AirDrop and publishes its `mosey0` interface
32 as an app-specific network (ConnectivityService accepts CREATE_APP_SPECIFIC_NETWORK in place
33 of NETWORK_FACTORY, which is signature|role). Binding sockets and mDNS to that restricted
34 network needs CONNECTIVITY_USE_RESTRICTED_NETWORKS. -->
35 <privapp-permissions package="com.vayunmathur.share">
36 <permission name="android.permission.CREATE_APP_SPECIFIC_NETWORK" />
37 <permission name="android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS" />
38 </privapp-permissions>
39
40 <privapp-permissions package="com.vayunmathur.euicc">
41 <permission name="android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS" />
42 <permission name="android.permission.MODIFY_PHONE_STATE" />
43 <permission name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
44 </privapp-permissions>
45
46 <!-- Backup is the system app-data backup transport (declares BackupTransport via a
47 TRANSPORT_HOST service). Acting as a transport requires the signature|privileged
48 BACKUP permission; activating itself as the current transport requires
49 WRITE_SECURE_SETTINGS. Replaces GrapheneOS's Seedvault; pinned as the default
50 transport via config_backup_transport. -->
51 <privapp-permissions package="com.vayunmathur.backup">
52 <permission name="android.permission.BACKUP" />
53 <permission name="android.permission.WRITE_SECURE_SETTINGS" />
54 </privapp-permissions>
55
56 <!-- Cast is PRIVILEGED: it is a remote display provider, which is what puts its receivers in
57 Settings' Cast page. RemoteDisplayProviderWatcher.verifyServiceTrusted only trusts a
58 provider whose app holds REMOTE_DISPLAY_PROVIDER (signature|privileged); without it the
59 watcher logs and skips the service and the page is simply empty.
60 START_ACTIVITIES_FROM_BACKGROUND (signature|privileged|vendorPrivileged|oem|verifier|role)
61 is needed because selecting a route ends at the screen-capture consent activity, launched
62 from a bound service while Settings is in front. CAPTURE_VIDEO_OUTPUT would avoid the
63 consent activity entirely but is signature-only, so it is unreachable for a presigned app.
64 The package attribute below must byte-match the installed package
65 (cast/build.gradle.kts applicationId). With ro.control_privapp_permissions=enforce a
66 mismatch is not a warning - the device does not boot.
67 The TV receiver (com.vayunmathur.cast.tv) is deliberately absent: it is not preinstalled. -->
68 <privapp-permissions package="com.vayunmathur.cast">
69 <permission name="android.permission.REMOTE_DISPLAY_PROVIDER" />
70 <permission name="android.permission.START_ACTIVITIES_FROM_BACKGROUND" />
71 <!-- Desktop-mode audio via MediaRecorder.AudioSource.REMOTE_SUBMIX. The
72 projection-scoped capture used by screen mirroring is unavailable on that
73 path because it deliberately holds no MediaProjection. -->
74 <permission name="android.permission.CAPTURE_AUDIO_OUTPUT"/>
75</privapp-permissions>
76
77 <!-- SetupWizard is PRIVILEGED: it is the first-run setup wizard, selected by the platform
78 as the HOME activity (MAIN + SETUP_WIZARD + HOME at priority 999) while the device is
79 unprovisioned. It sets the system locale, the clock, the time zone and the location
80 master switch, reads and clears the OEM-unlock state, disables the status bar for the
81 duration, and writes DEVICE_PROVISIONED / user_setup_complete to end setup - all of
82 which are signature|privileged. It replaces GrapheneOS's SetupWizard2
83 (app.grapheneos.setupwizard); that module and AOSP's fallback Provision are both
84 dropped by `overrides` on ModernAppsSetupWizard in Android.bp.
85
86 The package attribute below must byte-match the installed package
87 (setupwizard/build.gradle.kts applicationId). With
88 ro.control_privapp_permissions=enforce a mismatch is not a warning - the device does
89 not boot past setup.
90
91 This is GrapheneOS's etc/permissions/app.grapheneos.setupwizard.xml minus
92 com.stevesoltys.seedvault.RESTORE_BACKUP, which is gone with Seedvault.
93 SET_TIME / SET_TIME_ZONE ARE PENDING REMOVAL AND MUST NOT BE REMOVED YET. Source
94 stopped using them when the manual date-and-time step was replaced by the automatic
95 clock (a Settings.Global write, covered by WRITE_SECURE_SETTINGS below, not by
96 SET_TIME), and the app manifest no longer requests them - but the STAGED PREBUILT
97 still does, and this allowlist is matched against the installed APK, not against
98 source. Removing them before the prebuilt is rebuilt is the boot-fatal direction.
99 Sequence: rebuild + re-stage the APK, confirm with
100 analysis/probe_setupwizard_apk_perms.py, then run
101 analysis/setupwizard_drop_time_perms.py.
102 ACCESS_WIFI_STATE (normal) and app.seamlessupdate.client.OPEN_SECURITY_PREVIEW_SETTINGS
103 (declared by the updater, not the platform) are in the app manifest and correctly not
104 allowlisted here, matching upstream. -->
105
106 <!-- Modern Apps Auto (Android Auto sender, com.vayunmathur.auto) is PRIVILEGED:
107 it exercises signature|privileged operations no role can grant: MANAGE_USB
108 (AOAP accessory handling), MODIFY_AUDIO_ROUTING (head-unit sinks), power/user
109 management around projection sessions, privileged phone-state reads for call
110 templates, and the CDM/Bluetooth-privileged + incall-experience pieces of the
111 wireless/call paths.
112
113 ONLY signature|privileged permissions are listed here. Everything the
114 SYSTEM_AUTOMOTIVE_PROJECTION role grants (microphone/location/nearby-devices/
115 notifications sets, telephony, ADD_TRUSTED_DISPLAY / CREATE_VIRTUAL_DEVICE /
116 CAPTURE_SECURE_VIDEO_OUTPUT family, companion-device association) arrives via
117 the role pin (config_systemAutomotiveProjection in MaosFrameworkResRRO) and is
118 deliberately absent: role grants in an allowlist are a boot failure under
119 ro.control_privapp_permissions=enforce, not a belt-and-braces extra.
120
121 The package attribute must byte-match the installed package (auto/build.gradle.kts
122 applicationId com.vayunmathur.auto) for the same reason. -->
123 <privapp-permissions package="com.vayunmathur.auto">
124 <permission name="android.permission.MANAGE_USB" />
125 <permission name="android.permission.MODIFY_AUDIO_ROUTING" />
126 <permission name="android.permission.TETHER_PRIVILEGED" />
127 <permission name="android.permission.CALL_PRIVILEGED" />
128 <permission name="android.permission.POWER_SAVER" />
129 <permission name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
130 <permission name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
131 <permission name="android.permission.MANAGE_USERS" />
132 <permission name="android.permission.BLUETOOTH_PRIVILEGED" />
133 <permission name="android.permission.CONTROL_INCALL_EXPERIENCE" />
134 <permission name="android.permission.MODIFY_PHONE_STATE" />
135 <permission name="android.permission.LOCAL_MAC_ADDRESS" />
136 <permission name="android.permission.ENTER_CAR_MODE_PRIORITIZED" />
137 <permission name="android.permission.REQUEST_COMPANION_SELF_MANAGED" />
138 <permission name="android.permission.COMPANION_APPROVE_WIFI_CONNECTIONS" />
139 <permission name="android.permission.BIND_INCALL_SERVICE" />
140 <permission name="android.permission.START_ACTIVITIES_FROM_BACKGROUND" />
141 </privapp-permissions>
142
143 <privapp-permissions package="com.vayunmathur.setupwizard">
144 <permission name="android.permission.CHANGE_CONFIGURATION" />
145 <permission name="android.permission.MANAGE_USER_OEM_UNLOCK_STATE" />
146 <permission name="android.permission.NETWORK_SETUP_WIZARD" />
147 <permission name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
148 <permission name="android.permission.READ_OEM_UNLOCK_STATE" />
149 <permission name="android.permission.REBOOT" />
150 <permission name="android.permission.SET_TIME" />
151 <permission name="android.permission.SET_TIME_ZONE" />
152 <permission name="android.permission.STATUS_BAR" />
153 <permission name="android.permission.WRITE_SECURE_SETTINGS" />
154 <permission name="android.permission.WRITE_SETTINGS" />
155 </privapp-permissions>
156
157 <privapp-permissions package="com.vayunmathur.logviewer">
158 <permission name="android.permission.READ_LOGS"/>
159 <permission name="android.permission.READ_LOGS_FULL"/>
160 <permission name="android.permission.READ_OEM_UNLOCK_STATE"/>
161 <permission name="android.permission.QUERY_USERS"/>
162 </privapp-permissions>
163
164 <privapp-permissions package="com.vayunmathur.updater">
165 <!-- Reboot into the slot update_engine just wrote. -->
166 <permission name="android.permission.REBOOT"/>
167 <!-- update_engine stages payload metadata under /cache. -->
168 <permission name="android.permission.ACCESS_CACHE_FILESYSTEM"/>
169 <!-- Evict cached data to make room for a 1-2 GB package. -->
170 <permission name="android.permission.ALLOCATE_AGGRESSIVE"/>
171 </privapp-permissions>
172
173 <!-- Store (com.vayunmathur.appstore) is the first-party package source. INSTALL_PACKAGES
174 lets it apply updates silently when held; without it the app falls back to a
175 user-confirmed install session. Updater (com.vayunmathur.updater) applies OTAs via
176 update_engine and needs no install permission, so it is intentionally absent here. -->
177 <privapp-permissions package="com.vayunmathur.appstore">
178 <permission name="android.permission.INSTALL_PACKAGES"/>
179 </privapp-permissions>
180
181 <!-- Emergency (com.vayunmathur.emergency) is the EMERGENCY role holder and replaces AOSP's
182 EmergencyInfo. It needs these signature|privileged perms: CALL_PRIVILEGED places the
183 emergency call, WRITE_SECURE_SETTINGS lets the gesture provider persist the
184 EMERGENCY_GESTURE_* Settings.Secure keys, READ_PRIVILEGED_PHONE_STATE is the privileged
185 half of the emergency-number lookup, MANAGE_USERS reads the owner name/photo for the
186 card, START_ACTIVITIES_FROM_BACKGROUND lets the SOS receiver fire the call broadcast
187 from the background alarm, and SCHEDULE_EXACT_ALARM drives the SOS countdown alarm.
188 Verified against the staged prebuilt (aapt2 dump permissions on
189 prebuilts/emergency-release.apk), which requests exactly these plus the four above.
190 All degrade gracefully if absent, but the app is privileged so they are granted. -->
191 <privapp-permissions package="com.vayunmathur.emergency">
192 <permission name="android.permission.CALL_PRIVILEGED" />
193 <permission name="android.permission.WRITE_SECURE_SETTINGS" />
194 <permission name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
195 <permission name="android.permission.MANAGE_USERS" />
196 <permission name="android.permission.START_ACTIVITIES_FROM_BACKGROUND" />
197 <permission name="android.permission.SCHEDULE_EXACT_ALARM" />
198 </privapp-permissions>
199
200</permissions>