summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vpndialogxposed/src/main/AndroidManifest.xml30
-rw-r--r--vpndialogxposed/src/main/java/de/blinkt/vpndialogxposed/VpnDialogPatcher.java16
-rw-r--r--vpndialogxposed/src/main/res/layout/activity_main.xml16
-rw-r--r--vpndialogxposed/src/main/res/menu/main.xml6
-rw-r--r--vpndialogxposed/src/main/res/values/strings.xml2
-rw-r--r--vpndialogxposed/src/main/res/values/styles.xml20
6 files changed, 30 insertions, 60 deletions
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 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="de.blinkt.vpndialogxposed"
- android:versionCode="1"
- android:versionName="1.0" >
+ package="de.blinkt.vpndialogxposed"
+ android:versionCode="2"
+ android:versionName="1.0.1">
<uses-sdk
- android:minSdkVersion="14"
- android:targetSdkVersion="17" />
+ android:minSdkVersion="14"
+ android:targetSdkVersion="17"/>
<application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
+ android:allowBackup="true"
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ >
- <meta-data android:value="true" android:name="xposedmodule"/>
- <meta-data android:value="2.0*" android:name="xposedminversion"/>
- <meta-data android:value="Allows OpenVPN for Android to establish a VPN connection without confirmation dialog" android:name="xposeddescription"/>
+ <meta-data
+ android:value="true"
+ android:name="xposedmodule"/>
+ <meta-data
+ android:value="2.0*"
+ android:name="xposedminversion"/>
+ <meta-data
+ android:value="Allows OpenVPN for Android to establish a VPN connection without confirmation dialog"
+ android:name="xposeddescription"/>
</application>
</manifest>
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 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- android:paddingBottom="@dimen/activity_vertical_margin"
- tools:context=".MainActivity">
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/hello_world" />
-
-</RelativeLayout>
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 @@
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:id="@+id/action_settings"
- android:title="@string/action_settings"
- android:orderInCategory="100"
- android:showAsAction="never" />
-</menu>
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 @@
<resources>
<string name="app_name">VpnDialog Xposed Module</string>
- <string name="action_settings">Settings</string>
- <string name="hello_world">Hello world!</string>
</resources>
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 @@
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
-</resources>