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

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

AndroidManifest.xml165 lines · 8.1 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 tools:ignore="ProtectedPermissions">
5
6 <!--
7 Every permission the discovery and transfer paths actually exercise. These were missing
8 entirely, which made advertising, scanning, mDNS, the foreground service, notifications
9 and the boot receiver all fail silently at runtime.
10
11 INTERNET is the load-bearing one and the easiest to overlook: without it the app is not in
12 the `inet` group, so `ServerSocket` fails with EPERM *and* NsdManager's own socket work
13 fails, which surfaces only as `onStartDiscoveryFailed` with FAILURE_INTERNAL_ERROR — no
14 exception, and nothing that names the real cause.
15
16 neverForLocation on both radio scans is what keeps this list free of
17 ACCESS_FINE_LOCATION: minSdk is 31, so the pre-Android-12 location-backed scan fallback
18 is unreachable and nothing here needs to derive position.
19 -->
20 <!-- MAOS: opt out of the GrapheneOS Sensors permission (OTHER_SENSORS). -->
21 <!-- This app uses no motion/environment sensors; MAOS withholds the -->
22 <!-- Sensors permission at install instead of auto-granting it. -->
23 <uses-permission android:name="com.vayunmathur.permission.SENSORS_OPTOUT" />
24
25 <uses-permission android:name="android.permission.INTERNET" />
26 <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
27 <uses-permission
28 android:name="android.permission.BLUETOOTH_SCAN"
29 android:usesPermissionFlags="neverForLocation" />
30 <uses-permission
31 android:name="android.permission.NEARBY_WIFI_DEVICES"
32 android:usesPermissionFlags="neverForLocation" />
33
34 <!--
35 Local Network Protections (Android 16+). Gates mDNS and every LAN socket; without it
36 NsdManager.registerService throws and the device is invisible over WIFI_LAN, which is
37 the only medium a transfer is accepted on.
38 -->
39 <uses-permission
40 android:name="android.permission.ACCESS_LOCAL_NETWORK"
41 tools:targetApi="36" />
42
43 <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
44 <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
45 <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />
46 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
47
48 <!-- AirDrop: link selection reads the active Wi-Fi network and its channel. -->
49 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
50 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
51
52 <!--
53 AirDrop over Google's Mosey (AWDL) HAL. Publishing `mosey0` needs CREATE_APP_SPECIFIC_NETWORK
54 (ConnectivityService accepts it in place of NETWORK_FACTORY, which is signature|role and out of
55 reach), and binding sockets/mDNS to that restricted network needs
56 CONNECTIVITY_USE_RESTRICTED_NETWORKS. Both are signature|privileged: granted only when MAOS
57 installs :share as an allowlisted priv-app; elsewhere they are inert and AirDrop uses Wi-Fi.
58 -->
59 <uses-permission android:name="android.permission.CREATE_APP_SPECIFIC_NETWORK" />
60 <uses-permission android:name="android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS" />
61
62 <uses-feature android:name="android.hardware.bluetooth" android:required="false" />
63 <uses-feature android:name="android.hardware.bluetooth_le" android:required="false" />
64 <uses-feature android:name="android.hardware.wifi" android:required="false" />
65
66 <application
67 android:allowBackup="true"
68 android:dataExtractionRules="@xml/data_extraction_rules"
69 android:icon="@mipmap/ic_launcher"
70 android:label="@string/app_name"
71 android:roundIcon="@mipmap/ic_launcher"
72 android:supportsRtl="true"
73 android:theme="@style/Theme.General">
74 <!-- Mosey's client library, present on Pixels that ship AirDrop interop. -->
75 <uses-library
76 android:name="com.google.android.moseylib"
77 android:required="false" />
78
79 <activity
80 android:name=".MainActivity"
81 android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
82 android:exported="true"
83 android:launchMode="singleTop"
84 android:theme="@style/Theme.General">
85 <intent-filter>
86 <action android:name="android.intent.action.MAIN" />
87 <category android:name="android.intent.category.LAUNCHER" />
88 </intent-filter>
89 <intent-filter>
90 <action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
91 <category android:name="android.intent.category.DEFAULT" />
92 </intent-filter>
93 </activity>
94
95 <activity
96 android:name=".ui.SharePopupActivity"
97 android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
98 android:exported="true"
99 android:theme="@style/Theme.SharePopup">
100 <intent-filter>
101 <action android:name="android.intent.action.SEND" />
102 <category android:name="android.intent.category.DEFAULT" />
103 <data android:mimeType="*/*" />
104 </intent-filter>
105 <intent-filter>
106 <action android:name="android.intent.action.SEND_MULTIPLE" />
107 <category android:name="android.intent.category.DEFAULT" />
108 <data android:mimeType="*/*" />
109 </intent-filter>
110 <!-- Direct Share: @xml/shortcuts names this activity as the share
111 target for ShareShortcuts.CATEGORY, so the dynamic shortcut
112 ShareShortcuts.publish() puts it in the direct-share row. -->
113 <meta-data
114 android:name="android.app.shortcuts"
115 android:resource="@xml/shortcuts" />
116 </activity>
117
118 <activity
119 android:name=".platform.receive.ShareSaveActivity"
120 android:excludeFromRecents="true"
121 android:exported="false"
122 android:theme="@android:style/Theme.Translucent.NoTitleBar" />
123
124 <service
125 android:name=".platform.transfer.ShareTransferService"
126 android:exported="false"
127 android:foregroundServiceType="connectedDevice" />
128
129 <service
130 android:name=".platform.receive.ShareReceiveTileService"
131 android:exported="true"
132 android:icon="@drawable/ic_tile_share"
133 android:label="@string/share_tile_label"
134 android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
135 <intent-filter>
136 <action android:name="android.service.quicksettings.action.QS_TILE" />
137 </intent-filter>
138 <meta-data
139 android:name="android.service.quicksettings.ACTIVITY"
140 android:value=".MainActivity" />
141 </service>
142
143 <receiver
144 android:name=".platform.receive.ShareNotificationReceiver"
145 android:exported="false" />
146
147 <receiver
148 android:name=".platform.receive.ShareBootReceiver"
149 android:exported="false">
150 <intent-filter>
151 <action android:name="android.intent.action.BOOT_COMPLETED" />
152 <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
153 </intent-filter>
154 </receiver>
155 <provider
156 android:name="androidx.core.content.FileProvider"
157 android:authorities="${applicationId}.fileprovider"
158 android:exported="false"
159 android:grantUriPermissions="true">
160 <meta-data
161 android:name="android.support.FILE_PROVIDER_PATHS"
162 android:resource="@xml/file_paths" />
163 </provider>
164 </application>
165</manifest>