0
0
mirror of https://github.com/schwabe/ics-openvpn.git synced 2024-09-20 03:52:27 +02:00

Simplify list of allowed AIDL apps to be a simple string

This commit is contained in:
Arne Schwabe 2023-05-22 12:50:14 +02:00
parent a688889a1e
commit 3211fed064
3 changed files with 7 additions and 26 deletions

View File

@ -107,7 +107,7 @@ public class AppRestrictions {
}
private void setAllowedRemoteControl(Context c, Bundle restrictions) {
Parcelable[] allowedApps = restrictions.getParcelableArray("allowed_remote_access");
String allowedApps = restrictions.getString("allowed_remote_access", null);
ExternalAppDatabase extapps = new ExternalAppDatabase(c);
if (allowedApps == null)
@ -118,15 +118,11 @@ public class AppRestrictions {
HashSet<String> restrictionApps = new HashSet<>();
for (Parcelable allowedApp: allowedApps) {
if (!(allowedApp instanceof Bundle)) {
VpnStatus.logError("App restriction allowed app has wrong type");
continue;
for (String package_name:allowedApps.split("[, \n\r]")) {
if (!TextUtils.isEmpty(package_name)) {
restrictionApps.add(package_name);
}
String package_name = ((Bundle) allowedApp).getString("package_name");
restrictionApps.add(package_name);
}
extapps.setFlagManagedConfiguration(true);
extapps.clearAllApiApps();

View File

@ -85,10 +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="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 allowe any changes to the list by the user.</string>
<string name="apprest_remoteapi_package">Package name of the allow app (e.g. de.blinkt.openvpn.remoteapp)</string>
<string name="apprest_remoteapi_package_title">Package</string>
<string name="apprest_allowed_aidl_app">Allowed remote access app</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>
<string-array name="tls_profile_values" translatable="false">

View File

@ -75,18 +75,6 @@
<restriction
android:description="@string/apprest_aidl_list"
android:key="allowed_remote_access"
android:restrictionType="bundle_array"
android:title="@string/apprest_remoteaidl">
<restriction
android:key="allowed_app"
android:restrictionType="bundle"
android:title="@string/apprest_allowed_aidl_app">
<restriction
android:description="@string/apprest_remoteapi_package"
android:key="package_name"
android:restrictionType="string"
android:title="@string/apprest_remoteapi_package_title" />
</restriction>
</restriction>
android:restrictionType="string"
android:title="@string/apprest_remoteaidl" />
</restrictions>