Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
dependencies ▾

Modern-Apps.git / appstore / src / main / AndroidManifest.xml

AndroidManifest.xml207 lines · 11.0 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 <intent-filter android:autoVerify="false">
126 <action android:name="android.intent.action.VIEW" />
127 <category android:name="android.intent.category.DEFAULT" />
128 <category android:name="android.intent.category.BROWSABLE" />
129 <!-- Accrescent /app/<pkg> listing URLs. -->
130 <data android:scheme="https" />
131 <data android:host="accrescent.app" />
132 <data android:pathPrefix="/app/" />
133 </intent-filter>
134 </activity>
135
136 <!--
137 TV entry: a separate activity carrying only LEANBACK_LAUNCHER, so the TV row
138 opens the D-pad UI instead of the phone pager. Separate activity (not a second
139 filter on MainActivity): split filters on one activity build separate resolve
140 entries that confuse launcher resolution (the tvlauncher HOME lesson).
141 -->
142 <activity
143 android:name=".ui.tv.TvMainActivity"
144 android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
145 android:exported="true"
146 android:launchMode="singleTask"
147 android:theme="@style/Theme.General">
148 <intent-filter>
149 <action android:name="android.intent.action.MAIN" />
150 <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
151 </intent-filter>
152 </activity>
153
154 <service
155 android:name="androidx.work.impl.foreground.SystemForegroundService"
156 android:foregroundServiceType="dataSync"
157 tools:node="merge" />
158
159 <!-- Read-only assistant intents: catalogue search + available-updates
160 summary. No install/update/uninstall activity is exported here. -->
161 <activity
162 android:name=".intents.SearchAppsIntent"
163 android:exported="true"
164 android:permission="com.vayunmathur.appstore.permissions.ACCESS_APPSTORE"
165 android:theme="@android:style/Theme.NoDisplay" />
166 <activity
167 android:name=".intents.GetUpdatesIntent"
168 android:exported="true"
169 android:permission="com.vayunmathur.appstore.permissions.ACCESS_APPSTORE"
170 android:theme="@android:style/Theme.NoDisplay" />
171
172 <!-- Watch experience: entered only via MainActivity's watch routing
173 (no launcher filter of its own), plus its install-result receiver.
174 All are inert on a phone/TV: InstallResultReceiver gates on the
175 watch feature, and the rest are reached only from watch state. -->
176 <activity
177 android:name=".ui.WearMainActivity"
178 android:exported="false"
179 android:taskAffinity=""
180 android:theme="@android:style/Theme.Material.NoActionBar" />
181 <receiver
182 android:name=".platform.InstallResultReceiver"
183 android:exported="false" />
184
185 <receiver
186 android:name=".data.installer.InstallStatusReceiver"
187 android:exported="false">
188 <intent-filter>
189 <action android:name="com.vayunmathur.appstore.INSTALL_STATUS" />
190 </intent-filter>
191 </receiver>
192
193
194 <!-- Watch "Open on phone" wake: the phone Watch conduit host fires
195 OpenOnPhoneContract.ACTION (signature permission, package-addressed)
196 when a watch open request arrives with no live registration in
197 this app; this receiver launches the main activity. -->
198 <receiver
199 android:name=".sync.OpenOnPhoneReceiver"
200 android:exported="true"
201 android:permission="com.vayunmathur.watch.permissions.CONDUIT">
202 <intent-filter>
203 <action android:name="com.vayunmathur.watch.action.OPEN_ON_PHONE" />
204 </intent-filter>
205 </receiver>
206 </application>
207</manifest>