diff options
author | Arne Schwabe <arne@rfc2549.org> | 2020-09-24 18:15:58 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2020-09-24 19:10:53 +0200 |
commit | b7e00f86fb0b925322b8f1fff127ac8d4c381581 (patch) | |
tree | 14bb7ac00fd7d9be8707b448ab5dab663459c31b /main/src | |
parent | 23714a6640f6dabaa35728805dc978399e50415b (diff) |
Request QUERY_ALL_PACKAGES permission (closes #1238)
On SDK 30 or higher this permission is required to be able to list all
packages on a device. This app needs that to show all installed apps
in the allow/disallow Apps via VPN dialog.
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/main/AndroidManifest.xml | 19 | ||||
-rw-r--r-- | main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java | 13 |
2 files changed, 25 insertions, 7 deletions
diff --git a/main/src/main/AndroidManifest.xml b/main/src/main/AndroidManifest.xml index 14b6f5cc..aa3815ac 100644 --- a/main/src/main/AndroidManifest.xml +++ b/main/src/main/AndroidManifest.xml @@ -4,10 +4,24 @@ package="de.blinkt.openvpn"> <uses-permission android:name="android.permission.INTERNET" /> - <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> --> + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> - <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- <uses-permission android:name="com.android.vending.BILLING" /> --> + <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> + + <!-- Used to show all apps in the allowed Apps selection --> + <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" /> + + +<!-- <queries>--> +<!-- <intent>--> +<!-- <action android:name="android.intent.action.GET_CONTENT" />--> +<!-- </intent>--> +<!-- <intent>--> +<!-- <action android:name="android.intent.action.ACTION_OPEN_DOCUMENT" />--> +<!-- </intent>--> +<!-- </queries>--> + <application android:name=".core.ICSOpenVPNApplication" @@ -32,7 +46,6 @@ android:theme="@style/blinkt.dialog" /> - <service android:name=".core.OpenVPNService" android:permission="android.permission.BIND_VPN_SERVICE" diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java b/main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java index 1813ba1d..3692624b 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/Utils.java @@ -125,12 +125,17 @@ public class Utils { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N) i.setPackage("com.android.documentsui"); + + /* + * Android 11 is much stricter about allowing what to query. Since the app has the + * QUERY_ALL permission we can still check on Android 11 but otherwise we would just + * assume the documents ui to be always there: + */ + + /* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { - /* For some reason checking if the intent is available does not work on Android 11, - * just assume the document storage is always available. - */ return i; - } + }*/ |