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

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

AndroidManifest.xml154 lines · 7.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 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 <uses-permission android:name="android.permission.INTERNET" />
21 <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
22 <uses-permission
23 android:name="android.permission.BLUETOOTH_SCAN"
24 android:usesPermissionFlags="neverForLocation" />
25 <uses-permission
26 android:name="android.permission.NEARBY_WIFI_DEVICES"
27 android:usesPermissionFlags="neverForLocation" />
28
29 <!--
30 Local Network Protections (Android 16+). Gates mDNS and every LAN socket; without it
31 NsdManager.registerService throws and the device is invisible over WIFI_LAN, which is
32 the only medium a transfer is accepted on.
33 -->
34 <uses-permission
35 android:name="android.permission.ACCESS_LOCAL_NETWORK"
36 tools:targetApi="36" />
37
38 <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
39 <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
40 <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />
41 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
42
43 <!-- AirDrop: link selection reads the active Wi-Fi network and its channel. -->
44 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
45 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
46
47 <!--
48 AirDrop over Google's Mosey (AWDL) HAL. Publishing `mosey0` needs CREATE_APP_SPECIFIC_NETWORK
49 (ConnectivityService accepts it in place of NETWORK_FACTORY, which is signature|role and out of
50 reach), and binding sockets/mDNS to that restricted network needs
51 CONNECTIVITY_USE_RESTRICTED_NETWORKS. Both are signature|privileged: granted only when MAOS
52 installs :share as an allowlisted priv-app; elsewhere they are inert and AirDrop uses Wi-Fi.
53 -->
54 <uses-permission android:name="android.permission.CREATE_APP_SPECIFIC_NETWORK" />
55 <uses-permission android:name="android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS" />
56
57 <uses-feature android:name="android.hardware.bluetooth" android:required="false" />
58 <uses-feature android:name="android.hardware.bluetooth_le" android:required="false" />
59 <uses-feature android:name="android.hardware.wifi" android:required="false" />
60
61 <application
62 android:allowBackup="true"
63 android:dataExtractionRules="@xml/data_extraction_rules"
64 android:icon="@mipmap/ic_launcher"
65 android:label="@string/app_name"
66 android:roundIcon="@mipmap/ic_launcher"
67 android:supportsRtl="true"
68 android:theme="@style/Theme.General">
69 <!-- Mosey's client library, present on Pixels that ship AirDrop interop. -->
70 <uses-library
71 android:name="com.google.android.moseylib"
72 android:required="false" />
73
74 <activity
75 android:name=".MainActivity"
76 android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
77 android:exported="true"
78 android:launchMode="singleTop"
79 android:theme="@style/Theme.General">
80 <intent-filter>
81 <action android:name="android.intent.action.MAIN" />
82 <category android:name="android.intent.category.LAUNCHER" />
83 </intent-filter>
84 <intent-filter>
85 <action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
86 <category android:name="android.intent.category.DEFAULT" />
87 </intent-filter>
88 </activity>
89
90 <activity
91 android:name=".SharePopupActivity"
92 android:configChanges="mcc|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
93 android:exported="true"
94 android:theme="@style/Theme.SharePopup">
95 <intent-filter>
96 <action android:name="android.intent.action.SEND" />
97 <category android:name="android.intent.category.DEFAULT" />
98 <data android:mimeType="*/*" />
99 </intent-filter>
100 <intent-filter>
101 <action android:name="android.intent.action.SEND_MULTIPLE" />
102 <category android:name="android.intent.category.DEFAULT" />
103 <data android:mimeType="*/*" />
104 </intent-filter>
105 </activity>
106
107 <activity
108 android:name=".platform.receive.ShareSaveActivity"
109 android:excludeFromRecents="true"
110 android:exported="false"
111 android:theme="@android:style/Theme.Translucent.NoTitleBar" />
112
113 <service
114 android:name=".platform.transfer.ShareTransferService"
115 android:exported="false"
116 android:foregroundServiceType="connectedDevice" />
117
118 <service
119 android:name=".platform.receive.ShareReceiveTileService"
120 android:exported="true"
121 android:icon="@drawable/ic_tile_share"
122 android:label="@string/share_tile_label"
123 android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
124 <intent-filter>
125 <action android:name="android.service.quicksettings.action.QS_TILE" />
126 </intent-filter>
127 <meta-data
128 android:name="android.service.quicksettings.ACTIVITY"
129 android:value=".MainActivity" />
130 </service>
131
132 <receiver
133 android:name=".platform.receive.ShareNotificationReceiver"
134 android:exported="false" />
135
136 <receiver
137 android:name=".platform.receive.ShareBootReceiver"
138 android:exported="false">
139 <intent-filter>
140 <action android:name="android.intent.action.BOOT_COMPLETED" />
141 <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
142 </intent-filter>
143 </receiver>
144 <provider
145 android:name="androidx.core.content.FileProvider"
146 android:authorities="${applicationId}.fileprovider"
147 android:exported="false"
148 android:grantUriPermissions="true">
149 <meta-data
150 android:name="android.support.FILE_PROVIDER_PATHS"
151 android:resource="@xml/file_paths" />
152 </provider>
153 </application>
154</manifest>