Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / appstore / src / main / AndroidManifest.xml
AndroidManifest.xml185 lines · 9.9 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 | <!-- Assistant tools (catalogue search / available updates) for openassistant. |
| 11 | Signature-level: only apps signed with the Modern Apps key can call. --> |
| 12 | <permission |
| 13 | android:name="com.vayunmathur.appstore.permissions.ACCESS_APPSTORE" |
| 14 | android:protectionLevel="signature" /> |
| 15 | |
| 16 | <uses-permission android:name="android.permission.INTERNET" /> |
| 17 | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
| 18 | <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> |
| 19 | <!-- Privileged silent installs on MAOS: the OS grants this signature|privileged |
| 20 | permission to the store, letting session commits proceed with |
| 21 | USER_ACTION_NOT_REQUIRED even for first installs. Stock Android never |
| 22 | grants it to a regularly installed app, so the installer checks at |
| 23 | runtime (checkSelfPermission) and keeps the user-confirmed session flow |
| 24 | when it is not held. Declaring it here changes nothing on stock. --> |
| 25 | <!-- INSTALL_PACKAGES is a signature|privileged permission held only on MAOS, where this store is the system installer; the runtime check above keeps stock Android on the user-confirmed flow, so ProtectedPermissions is a false positive here. --> |
| 26 | <uses-permission android:name="android.permission.INSTALL_PACKAGES" tools:ignore="ProtectedPermissions" /> |
| 27 | <uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" /> |
| 28 | <uses-permission android:name="android.permission.ENFORCE_UPDATE_OWNERSHIP" /> |
| 29 | <!-- Silent background updates: SessionInstaller commits with USER_ACTION_NOT_REQUIRED, |
| 30 | which the system only honours for holders of this (normal, auto-granted) permission |
| 31 | on API 33+ targets. Without it every background commit degrades to a confirmation |
| 32 | prompt the background job cannot answer, so nothing ever installs (#898). --> |
| 33 | <uses-permission android:name="android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION" /> |
| 34 | <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" |
| 35 | tools:ignore="QueryAllPackagesPermission" /> |
| 36 | <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> |
| 37 | <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> |
| 38 | <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" /> |
| 39 | |
| 40 | <!-- Watch-local install sessions wake the watch CPU when they fire. --> |
| 41 | <uses-permission android:name="android.permission.WAKE_LOCK" /> |
| 42 | |
| 43 | <!-- Single APK for phone, TV and watch. Deliberately NO |
| 44 | android.hardware.type.watch uses-feature here: required="true" |
| 45 | would block every phone install, and required="false" is |
| 46 | disallowed for this feature (lint InvalidWearFeatureAttribute; |
| 47 | Google's packaging model does not support one APK for Wear and |
| 48 | non-Wear via Play). This app does not distribute through Play's |
| 49 | watch channel — it is sideloaded / F-Droid-installed, where no |
| 50 | feature declaration is needed to install on a watch — so the |
| 51 | APK carries no watch feature filter at all and |
| 52 | FormFactor.isWatch (PackageManager.FEATURE_WATCH, still |
| 53 | reported by watch hardware at runtime) routes the experience. --> |
| 54 | <!-- Leanback is supported, not required: one APK serves phones and TVs. Without these, |
| 55 | a TV launcher never lists the app; with required="true" phones would lose it. --> |
| 56 | <uses-feature |
| 57 | android:name="android.software.leanback" |
| 58 | android:required="false" /> |
| 59 | <uses-feature |
| 60 | android:name="android.hardware.touchscreen" |
| 61 | android:required="false" /> |
| 62 | |
| 63 | <application |
| 64 | android:allowBackup="true" |
| 65 | android:backupAgent=".platform.AppBackupAgent" |
| 66 | android:banner="@drawable/tv_banner" |
| 67 | android:dataExtractionRules="@xml/data_extraction_rules" |
| 68 | android:icon="@mipmap/ic_launcher" |
| 69 | android:label="@string/app_name" |
| 70 | android:roundIcon="@mipmap/ic_launcher" |
| 71 | android:supportsRtl="true" |
| 72 | android:theme="@style/Theme.General"> |
| 73 | |
| 74 | <!-- Watch experience is paired with the phone app, not standalone. --> |
| 75 | <meta-data |
| 76 | android:name="com.google.android.wearable.standalone" |
| 77 | android:value="false" /> |
| 78 | |
| 79 | <provider |
| 80 | android:name="androidx.core.content.FileProvider" |
| 81 | android:authorities="${applicationId}.fileprovider" |
| 82 | android:exported="false" |
| 83 | android:grantUriPermissions="true"> |
| 84 | <meta-data |
| 85 | android:name="android.support.FILE_PROVIDER_PATHS" |
| 86 | android:resource="@xml/file_paths" /> |
| 87 | </provider> |
| 88 | |
| 89 | <activity |
| 90 | android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" |
| 91 | android:name=".MainActivity" |
| 92 | android:exported="true" |
| 93 | android:theme="@style/Theme.General"> |
| 94 | <intent-filter> |
| 95 | <action android:name="android.intent.action.MAIN" /> |
| 96 | <category android:name="android.intent.category.LAUNCHER" /> |
| 97 | </intent-filter> |
| 98 | <intent-filter> |
| 99 | <action android:name="android.intent.action.VIEW" /> |
| 100 | <category android:name="android.intent.category.DEFAULT" /> |
| 101 | <category android:name="android.intent.category.BROWSABLE" /> |
| 102 | <data android:scheme="market" /> |
| 103 | </intent-filter> |
| 104 | <intent-filter android:autoVerify="false"> |
| 105 | <action android:name="android.intent.action.VIEW" /> |
| 106 | <category android:name="android.intent.category.DEFAULT" /> |
| 107 | <category android:name="android.intent.category.BROWSABLE" /> |
| 108 | <data android:scheme="https" /> |
| 109 | <data android:host="play.google.com" /> |
| 110 | <data android:pathPrefix="/store/apps/details" /> |
| 111 | </intent-filter> |
| 112 | <intent-filter android:autoVerify="false"> |
| 113 | <action android:name="android.intent.action.VIEW" /> |
| 114 | <category android:name="android.intent.category.DEFAULT" /> |
| 115 | <category android:name="android.intent.category.BROWSABLE" /> |
| 116 | <!-- Plain /packages/<pkg> listing URLs. --> |
| 117 | <data android:scheme="https" /> |
| 118 | <data android:host="f-droid.org" /> |
| 119 | <data android:pathPrefix="/packages/" /> |
| 120 | <!-- Localised /<locale>/packages/<pkg>/ listing URLs. --> |
| 121 | <data android:scheme="https" /> |
| 122 | <data android:host="f-droid.org" /> |
| 123 | <data android:pathPattern="/.*/packages/.*" /> |
| 124 | </intent-filter> |
| 125 | </activity> |
| 126 | |
| 127 | <!-- |
| 128 | TV entry: a separate activity carrying only LEANBACK_LAUNCHER, so the TV row |
| 129 | opens the D-pad UI instead of the phone pager. Separate activity (not a second |
| 130 | filter on MainActivity): split filters on one activity build separate resolve |
| 131 | entries that confuse launcher resolution (the tvlauncher HOME lesson). |
| 132 | --> |
| 133 | <activity |
| 134 | android:name=".ui.tv.TvMainActivity" |
| 135 | android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" |
| 136 | android:exported="true" |
| 137 | android:launchMode="singleTask" |
| 138 | android:theme="@style/Theme.General"> |
| 139 | <intent-filter> |
| 140 | <action android:name="android.intent.action.MAIN" /> |
| 141 | <category android:name="android.intent.category.LEANBACK_LAUNCHER" /> |
| 142 | </intent-filter> |
| 143 | </activity> |
| 144 | |
| 145 | <service |
| 146 | android:name="androidx.work.impl.foreground.SystemForegroundService" |
| 147 | android:foregroundServiceType="dataSync" |
| 148 | tools:node="merge" /> |
| 149 | |
| 150 | <!-- Read-only assistant intents: catalogue search + available-updates |
| 151 | summary. No install/update/uninstall activity is exported here. --> |
| 152 | <activity |
| 153 | android:name=".intents.SearchAppsIntent" |
| 154 | android:exported="true" |
| 155 | android:permission="com.vayunmathur.appstore.permissions.ACCESS_APPSTORE" |
| 156 | android:theme="@android:style/Theme.NoDisplay" /> |
| 157 | <activity |
| 158 | android:name=".intents.GetUpdatesIntent" |
| 159 | android:exported="true" |
| 160 | android:permission="com.vayunmathur.appstore.permissions.ACCESS_APPSTORE" |
| 161 | android:theme="@android:style/Theme.NoDisplay" /> |
| 162 | |
| 163 | <!-- Watch experience: entered only via MainActivity's watch routing |
| 164 | (no launcher filter of its own), plus its install-result receiver. |
| 165 | All are inert on a phone/TV: InstallResultReceiver gates on the |
| 166 | watch feature, and the rest are reached only from watch state. --> |
| 167 | <activity |
| 168 | android:name=".ui.WearMainActivity" |
| 169 | android:exported="false" |
| 170 | android:taskAffinity="" |
| 171 | android:theme="@android:style/Theme.Material.NoActionBar" /> |
| 172 | <receiver |
| 173 | android:name=".platform.InstallResultReceiver" |
| 174 | android:exported="false" /> |
| 175 | |
| 176 | <receiver |
| 177 | android:name=".data.installer.InstallStatusReceiver" |
| 178 | android:exported="false"> |
| 179 | <intent-filter> |
| 180 | <action android:name="com.vayunmathur.appstore.INSTALL_STATUS" /> |
| 181 | </intent-filter> |
| 182 | </receiver> |
| 183 | |
| 184 | </application> |
| 185 | </manifest> |