Skip to content

Commit

Permalink
fixup! Allow setting remote control apps via managed configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
  • Loading branch information
schwabe committed May 9, 2023
1 parent 8abd861 commit 36d6b7d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void addApp(String packagename)
saveExtAppList(allowedapps);
}

boolean checkAllowingModifyingRemoteControl(Context c) {
public boolean checkAllowingModifyingRemoteControl(Context c) {
if (isManagedConfiguration()) {
Toast.makeText(c, "Remote control apps are manged by managed configuration, cannot change", Toast.LENGTH_LONG).show();
VpnStatus.logError("Remote control apps are manged by managed configuration, cannot change");
Expand Down
4 changes: 2 additions & 2 deletions main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ public static String humanReadableByteCount(long bytes, boolean speed, Resources

@Override
public void addAllowedExternalApp(String packagename) throws RemoteException {
if(checkAllowingModifyingRemoteControl(this)) {
ExternalAppDatabase extapps = new ExternalAppDatabase(OpenVPNService.this);
ExternalAppDatabase extapps = new ExternalAppDatabase(OpenVPNService.this);
if(extapps.checkAllowingModifyingRemoteControl(this)) {
extapps.addApp(packagename);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ class GeneralSettings : PreferenceFragmentCompat(), Preference.OnPreferenceClick
File("/system/lib/modules/tun.ko").length() > 10

override fun onPreferenceClick(preference: Preference): Boolean {
if (!mExtapp.checkAllowingModifyingRemoteControl(requireContext()))
{
return false;
}
if (preference.key == "clearapi") {
val builder = AlertDialog.Builder(
requireContext()
Expand Down

0 comments on commit 36d6b7d

Please sign in to comment.