summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md7
-rw-r--r--main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt19
2 files changed, 18 insertions, 8 deletions
diff --git a/README.md b/README.md
index 2a2e2e06..415fc0ca 100644
--- a/README.md
+++ b/README.md
@@ -37,7 +37,12 @@ acitvies to start/stop, pause/resume (like a user would with the notification)
- `de.blinkt.openvpn.api.PauseVPN`
- `de.blinkt.openvpn.api.ResumeVPN`
-They use `de.blinkt.openvpn.api.profileName` as extra for the name of the VPN profile..
+They use `de.blinkt.openvpn.api.profileName` as extra for the name of the VPN profile.
+
+You can use `adb` to to test these intents:
+
+ adb -d shell am start -a android.intent.action.MAIN -n de.blinkt.openvpn/.api.ConnectVPN --es de.blinkt.openvpn.api.profileName myvpnprofile
+
Note to administrators
------------------------
diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt b/main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt
index 0842925d..7db8cba6 100644
--- a/main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt
+++ b/main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt
@@ -20,6 +20,7 @@ import androidx.preference.*
import de.blinkt.openvpn.BuildConfig
import de.blinkt.openvpn.R
import de.blinkt.openvpn.activities.OpenSSLSpeed
+import de.blinkt.openvpn.api.ConfirmDialog.ANONYMOUS_PACKAGE
import de.blinkt.openvpn.api.ExternalAppDatabase
import de.blinkt.openvpn.core.ProfileManager
import java.io.File
@@ -153,13 +154,17 @@ class GeneralSettings : PreferenceFragmentCompat(), Preference.OnPreferenceClick
val pm = requireActivity().packageManager
val applist = StringBuilder()
for (packagename in mExtapp.extAppList) {
- try {
- app = pm.getApplicationInfo(packagename, 0)
- if (applist.length != 0) applist.append(delim)
- applist.append(app.loadLabel(pm))
- } catch (e: PackageManager.NameNotFoundException) {
- // App not found. Remove it from the list
- mExtapp.removeApp(packagename)
+ if (packagename == ANONYMOUS_PACKAGE) {
+ applist.append("(Any app)")
+ } else {
+ try {
+ app = pm.getApplicationInfo(packagename, 0)
+ if (applist.length != 0) applist.append(delim)
+ applist.append(app.loadLabel(pm))
+ } catch (e: PackageManager.NameNotFoundException) {
+ // App not found. Remove it from the list
+ mExtapp.removeApp(packagename)
+ }
}
}
return applist.toString()