From d066e03e7d61477424b49742ce142780c698d750 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Sun, 1 Sep 2013 19:38:54 +0200 Subject: Working version of xposed framework VPNDialogs hack --- vpndialogxposed/src/main/AndroidManifest.xml | 30 +++++++++++++--------- .../blinkt/vpndialogxposed/VpnDialogPatcher.java | 16 +++++++++--- .../src/main/res/layout/activity_main.xml | 16 ------------ vpndialogxposed/src/main/res/menu/main.xml | 6 ----- vpndialogxposed/src/main/res/values/strings.xml | 2 -- vpndialogxposed/src/main/res/values/styles.xml | 20 --------------- 6 files changed, 30 insertions(+), 60 deletions(-) delete mode 100644 vpndialogxposed/src/main/res/layout/activity_main.xml delete mode 100644 vpndialogxposed/src/main/res/menu/main.xml delete mode 100644 vpndialogxposed/src/main/res/values/styles.xml (limited to 'vpndialogxposed') diff --git a/vpndialogxposed/src/main/AndroidManifest.xml b/vpndialogxposed/src/main/AndroidManifest.xml index d34264c7..2942105e 100644 --- a/vpndialogxposed/src/main/AndroidManifest.xml +++ b/vpndialogxposed/src/main/AndroidManifest.xml @@ -1,22 +1,28 @@ + package="de.blinkt.vpndialogxposed" + android:versionCode="2" + android:versionName="1.0.1"> + android:minSdkVersion="14" + android:targetSdkVersion="17"/> + android:allowBackup="true" + android:icon="@drawable/ic_launcher" + android:label="@string/app_name" + > - - - + + + 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) { diff --git a/vpndialogxposed/src/main/res/layout/activity_main.xml b/vpndialogxposed/src/main/res/layout/activity_main.xml deleted file mode 100644 index efcbf18d..00000000 --- a/vpndialogxposed/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/vpndialogxposed/src/main/res/menu/main.xml b/vpndialogxposed/src/main/res/menu/main.xml deleted file mode 100644 index f3b10b6c..00000000 --- a/vpndialogxposed/src/main/res/menu/main.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/vpndialogxposed/src/main/res/values/strings.xml b/vpndialogxposed/src/main/res/values/strings.xml index f233e945..2afcc0c2 100644 --- a/vpndialogxposed/src/main/res/values/strings.xml +++ b/vpndialogxposed/src/main/res/values/strings.xml @@ -2,7 +2,5 @@ VpnDialog Xposed Module - Settings - Hello world! diff --git a/vpndialogxposed/src/main/res/values/styles.xml b/vpndialogxposed/src/main/res/values/styles.xml deleted file mode 100644 index 6ce89c7b..00000000 --- a/vpndialogxposed/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - -- cgit v1.2.3