summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2023-11-11 17:02:22 +0100
committerArne Schwabe <arne@rfc2549.org>2023-11-11 18:55:42 +0100
commit823cb52eff9934d36214af161759580bac589fdf (patch)
tree56c5e6433c4676ddbe55ee63ac4935b35ff1ef37 /main/src
parent5efca0f647e4933d2548aba9fec2f25b7480d18f (diff)
Allow setting restart VPN on Boot setting via App restrictions
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/api/AppRestrictions.java8
-rw-r--r--main/src/main/res/values/untranslatable.xml1
-rw-r--r--main/src/main/res/xml/app_restrictions.xml5
3 files changed, 14 insertions, 0 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/api/AppRestrictions.java b/main/src/main/java/de/blinkt/openvpn/api/AppRestrictions.java
index 53919216..48fbb2da 100644
--- a/main/src/main/java/de/blinkt/openvpn/api/AppRestrictions.java
+++ b/main/src/main/java/de/blinkt/openvpn/api/AppRestrictions.java
@@ -147,6 +147,13 @@ public class AppRestrictions {
editor.putBoolean("screenoff", pauseVPN);
editor.apply();
}
+ if (restrictions.containsKey("restartvpnonboot"))
+ {
+ boolean restartVPNonBoot = restrictions.getBoolean("restartvpnonboot");
+ SharedPreferences.Editor editor = defaultPrefs.edit();
+ editor.putBoolean("restartvpnonboot", restartVPNonBoot);
+ editor.apply();
+ }
}
private void importVPNProfiles(Context c, Bundle restrictions, Parcelable[] profileList) {
@@ -155,6 +162,7 @@ public class AppRestrictions {
String defaultprofile = restrictions.getString("defaultprofile", null);
boolean defaultprofileProvisioned = false;
+
ProfileManager pm = ProfileManager.getInstance(c);
for (Parcelable profile : profileList) {
if (!(profile instanceof Bundle)) {
diff --git a/main/src/main/res/values/untranslatable.xml b/main/src/main/res/values/untranslatable.xml
index 6b3c1f70..edafd76e 100644
--- a/main/src/main/res/values/untranslatable.xml
+++ b/main/src/main/res/values/untranslatable.xml
@@ -85,6 +85,7 @@
<string name="faq_title_ncp">Failed to negotiate cipher with server</string>
<string name="import_from_URL">URL</string>
<string name="restriction_pausevpn">Pause VPN when screen is off and less than 64 kB transferred data in 60s</string>
+ <string name="restriction_restartvpnonboot">Enable the workaround to use an on boot receiver to start the VPN if the Always On VPN functionality is not available</string>
<string name="apprest_aidl_list">List of apps that are allowed to use the remote AIDL. If this list is in the restrictions, the app will not allowed any changes to the list by the user. Package names of allowed apps separated by comma, space or newlines</string>
<string name="apprest_remoteaidl">Remote API access</string>
diff --git a/main/src/main/res/xml/app_restrictions.xml b/main/src/main/res/xml/app_restrictions.xml
index b3258b50..81171d6f 100644
--- a/main/src/main/res/xml/app_restrictions.xml
+++ b/main/src/main/res/xml/app_restrictions.xml
@@ -73,6 +73,11 @@
android:restrictionType="bool"
android:title="@string/restriction_pausevpn" />
<restriction
+ android:key="restartvpnonboot"
+ android:restrictionType="bool"
+ android:title="@string/restriction_restartvpnonboot" />
+
+ <restriction
android:description="@string/apprest_aidl_list"
android:key="allowed_remote_access"
android:restrictionType="string"