Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / updater / src / main / AndroidManifest.xml
AndroidManifest.xml130 lines · 6.4 KiBRaw
| 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | xmlns:tools="http://schemas.android.com/tools"> |
| 4 | |
| 5 | <!-- MAOS: opt out of the GrapheneOS Sensors permission (OTHER_SENSORS). --> |
| 6 | <!-- This app uses no motion/environment sensors; MAOS withholds the --> |
| 7 | <!-- Sensors permission at install instead of auto-granting it. --> |
| 8 | <uses-permission android:name="com.vayunmathur.permission.SENSORS_OPTOUT" /> |
| 9 | |
| 10 | <uses-permission android:name="android.permission.INTERNET" /> |
| 11 | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
| 12 | <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> |
| 13 | <!-- Live Updates (API 36 ProgressStyle promoted ongoing): install-time, no runtime prompt. --> |
| 14 | <uses-permission android:name="android.permission.POST_PROMOTED_NOTIFICATIONS" /> |
| 15 | <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> |
| 16 | <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> |
| 17 | <uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" /> |
| 18 | <uses-permission android:name="android.permission.WAKE_LOCK" /> |
| 19 | |
| 20 | <!-- |
| 21 | signature|privileged, so all four require an entry in |
| 22 | vendor/modern-apps/privapp-permissions-modern-apps.xml whose package= byte-matches |
| 23 | com.vayunmathur.updater. A mismatch there is boot-fatal under |
| 24 | ro.control_privapp_permissions=enforce, not a silent no-op. |
| 25 | --> |
| 26 | <!-- Reboot into the freshly written slot once the payload is applied. Preinstalled |
| 27 | system app: privapp-permissions entry above grants this signature|privileged permission. --> |
| 28 | <uses-permission |
| 29 | android:name="android.permission.REBOOT" |
| 30 | tools:ignore="ProtectedPermissions" /> |
| 31 | <!-- update_engine stages payload metadata under /cache. --> |
| 32 | <uses-permission |
| 33 | android:name="android.permission.ACCESS_CACHE_FILESYSTEM" |
| 34 | tools:ignore="ProtectedPermissions" /> |
| 35 | <!-- Lets update_engine reclaim space aggressively when the inactive slot is tight. --> |
| 36 | <uses-permission |
| 37 | android:name="android.permission.ALLOCATE_AGGRESSIVE" |
| 38 | tools:ignore="ProtectedPermissions" /> |
| 39 | |
| 40 | <application |
| 41 | android:name=".platform.UpdaterApplication" |
| 42 | android:allowBackup="false" |
| 43 | android:dataExtractionRules="@xml/data_extraction_rules" |
| 44 | android:icon="@mipmap/ic_launcher" |
| 45 | android:label="@string/app_name" |
| 46 | android:roundIcon="@mipmap/ic_launcher" |
| 47 | android:supportsRtl="true" |
| 48 | android:theme="@style/Theme.General"> |
| 49 | |
| 50 | <!-- UpdaterApplication implements Configuration.Provider (on-demand |
| 51 | WorkManager init with a reserved JobScheduler id range), so the |
| 52 | default initializer must be removed. --> |
| 53 | <provider |
| 54 | android:name="androidx.startup.InitializationProvider" |
| 55 | android:authorities="${applicationId}.androidx-startup" |
| 56 | android:exported="false" |
| 57 | tools:node="merge"> |
| 58 | <meta-data |
| 59 | android:name="androidx.work.WorkManagerInitializer" |
| 60 | android:value="androidx.startup" |
| 61 | tools:node="remove" /> |
| 62 | </provider> |
| 63 | |
| 64 | <!-- |
| 65 | **Not a launcher activity.** An OTA client is something the user goes looking for in |
| 66 | Settings, under System > System update, rather than an app they open - so it answers |
| 67 | `android.settings.SYSTEM_UPDATE_SETTINGS` and shows no icon. |
| 68 | |
| 69 | That action is exactly what `SystemUpdateRepository.getSystemUpdateIntent` resolves, with |
| 70 | `MATCH_SYSTEM_ONLY`; the preference is *removed* from the System screen when nothing |
| 71 | answers it, which is why the row was missing rather than merely inert. Being preinstalled |
| 72 | under /product satisfies the system-only match. |
| 73 | |
| 74 | `exported` stays true because the caller is Settings, in another process. |
| 75 | --> |
| 76 | <activity |
| 77 | android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" |
| 78 | android:name=".MainActivity" |
| 79 | android:exported="true" |
| 80 | android:launchMode="singleTask" |
| 81 | android:theme="@style/Theme.General"> |
| 82 | <intent-filter> |
| 83 | <action android:name="android.settings.SYSTEM_UPDATE_SETTINGS" /> |
| 84 | <category android:name="android.intent.category.DEFAULT" /> |
| 85 | </intent-filter> |
| 86 | </activity> |
| 87 | |
| 88 | <!-- |
| 89 | specialUse, not dataSync: Android 15 caps dataSync at six cumulative hours a day and |
| 90 | Android 13/14 refuse to let a boot receiver start one. Neither suits a 1-2 GB transfer |
| 91 | followed by an A/B slot write that must not be abandoned halfway. |
| 92 | --> |
| 93 | <service |
| 94 | android:name=".service.UpdateInstallService" |
| 95 | android:exported="false" |
| 96 | android:foregroundServiceType="specialUse"> |
| 97 | <property |
| 98 | android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE" |
| 99 | android:value="Downloads, signature-verifies and applies a full system OTA to the inactive A/B slot. The transfer is 1-2 GB and the slot write cannot be interrupted partway without leaving the update unusable." /> |
| 100 | </service> |
| 101 | |
| 102 | <!-- |
| 103 | BIND_JOB_SERVICE is required by the platform for any JobService. Idle detection is |
| 104 | the scheduler's (setRequiresDeviceIdle), not ours. |
| 105 | --> |
| 106 | <service |
| 107 | android:name=".platform.IdleReboot" |
| 108 | android:exported="false" |
| 109 | android:permission="android.permission.BIND_JOB_SERVICE" /> |
| 110 | |
| 111 | <!-- Re-schedules the periodic check; see the class doc for why it does not install. --> |
| 112 | <receiver |
| 113 | android:name=".platform.UpdateBootReceiver" |
| 114 | android:exported="false"> |
| 115 | <intent-filter> |
| 116 | <action android:name="android.intent.action.BOOT_COMPLETED" /> |
| 117 | <action android:name="android.intent.action.MY_PACKAGE_REPLACED" /> |
| 118 | </intent-filter> |
| 119 | </receiver> |
| 120 | |
| 121 | <!-- |
| 122 | Not exported: the only intent it accepts comes from this app's own PendingIntent on |
| 123 | the update-ready notification, and what it does is reboot the device. |
| 124 | --> |
| 125 | <receiver |
| 126 | android:name=".platform.RebootReceiver" |
| 127 | android:exported="false" /> |
| 128 | </application> |
| 129 | |
| 130 | </manifest> |