diff options
author | Arne Schwabe <arne@rfc2549.org> | 2013-09-01 19:38:54 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2013-09-01 19:38:54 +0200 |
commit | d066e03e7d61477424b49742ce142780c698d750 (patch) | |
tree | d4eaefd762d2852551f9b73a3d88fc47aa22dcef /vpndialogxposed/src/main/java | |
parent | cc588b680ff3b6978950422c7f7b27e47940702e (diff) |
Working version of xposed framework VPNDialogs hack
Diffstat (limited to 'vpndialogxposed/src/main/java')
-rw-r--r-- | vpndialogxposed/src/main/java/de/blinkt/vpndialogxposed/VpnDialogPatcher.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/vpndialogxposed/src/main/java/de/blinkt/vpndialogxposed/VpnDialogPatcher.java b/vpndialogxposed/src/main/java/de/blinkt/vpndialogxposed/VpnDialogPatcher.java index 74cd97e4..d87b2d89 100644 --- a/vpndialogxposed/src/main/java/de/blinkt/vpndialogxposed/VpnDialogPatcher.java +++ b/vpndialogxposed/src/main/java/de/blinkt/vpndialogxposed/VpnDialogPatcher.java @@ -36,20 +36,28 @@ public class VpnDialogPatcher implements IXposedHookLoadPackage { IConnectivityManager mService = IConnectivityManager.Stub.asInterface( (IBinder) getService.invoke(servicemanager, Context.CONNECTIVITY_SERVICE)); - */ + */ Object mService = XposedHelpers.getObjectField(param.thisObject, "mService"); String mPackage = ((Activity) param.thisObject).getCallingPackage(); // App is already allowed do nothing - if (mService.prepareVpn(mPackage, null)) { + /*if (mService.prepareVpn(mPackage, null)) { + return; + }*/ + + + Class<?>[] prepareVPNsignature = {String.class, String.class}; + if((Boolean) XposedHelpers.callMethod(mService,"prepareVpn",prepareVPNsignature, mPackage,(String)null)) return; - } if (mPackage.equals("de.blinkt.openvpn")) { - mService.prepareVpn(null, mPackage); + //mService.prepareVpn(null, mPackage); + XposedHelpers.callMethod(mService,"prepareVpn",prepareVPNsignature, (String)null,mPackage); + ((Activity) param.thisObject).setResult(Activity.RESULT_OK); Toast.makeText((Context)param.thisObject,"Allowed de.blinkt.openvpn",Toast.LENGTH_LONG).show(); + ((Activity) param.thisObject).finish(); } } catch (Exception e) { |