Moved CharonVpnService to logic sub-package
authorTobias Brunner <tobias@strongswan.org>
Sat, 14 Jul 2012 15:03:22 +0000 (17:03 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 8 Aug 2012 13:41:04 +0000 (15:41 +0200)
src/frontends/android/AndroidManifest.xml
src/frontends/android/jni/libandroidbridge/android_jni.h
src/frontends/android/src/org/strongswan/android/CharonVpnService.java [deleted file]
src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java [new file with mode: 0644]

index 79ebd66..c6f4e14 100644 (file)
@@ -5,6 +5,7 @@
     android:versionName="1.0" >
 
     <uses-sdk android:minSdkVersion="14" />
+
     <uses-permission android:name="android.permission.INTERNET" />
 
     <application
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        <service android:name=".CharonVpnService" android:permission="android.permission.BIND_VPN_SERVICE">
+        <service
+            android:name=".logic.CharonVpnService"
+            android:exported="false"
+            android:permission="android.permission.BIND_VPN_SERVICE" >
             <intent-filter>
-                <action android:name="android.net.VpnService"/>
+                <action android:name="org.strongswan.android.logic.CharonVpnService" />
             </intent-filter>
         </service>
     </application>
index 2a8d3a7..77c33f7 100644 (file)
@@ -25,8 +25,8 @@
 
 #include <jni.h>
 
-#define JNI_PACKAGE org_strongswan_android
-#define JNI_PACKAGE_STRING "org/strongswan/android"
+#define JNI_PACKAGE org_strongswan_android_logic
+#define JNI_PACKAGE_STRING "org/strongswan/android/logic"
 
 #define JNI_METHOD_PP(pack, klass, name, ret, ...) \
        ret Java_##pack##_##klass##_##name(JNIEnv *env, jobject this, ##__VA_ARGS__)
diff --git a/src/frontends/android/src/org/strongswan/android/CharonVpnService.java b/src/frontends/android/src/org/strongswan/android/CharonVpnService.java
deleted file mode 100644 (file)
index d917d3e..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.strongswan.android;
-
-import android.content.Intent;
-import android.net.VpnService;
-
-public class CharonVpnService extends VpnService
-{
-
-       @Override
-       public int onStartCommand(Intent intent, int flags, int startId)
-       {
-               // called whenever the service is started with startService
-               // create our own thread because we are running in the calling processes
-               // main thread
-               return super.onStartCommand(intent, flags, startId);
-       }
-
-       @Override
-       public void onCreate()
-       {
-               // onCreate is only called once
-               initializeCharon();
-               super.onCreate();
-       }
-
-       @Override
-       public void onDestroy()
-       {
-               // called once the service is to be destroyed
-               deinitializeCharon();
-               super.onDestroy();
-       }
-
-       /**
-        * Initialization of charon, provided by libandroidbridge.so
-        */
-       public native void initializeCharon();
-
-       /**
-        * Deinitialize charon, provided by libandroidbridge.so
-        */
-       public native void deinitializeCharon();
-
-       /*
-        * The libraries are extracted to /data/data/org.strongswan.android/...
-        * during installation.
-        */
-       static
-       {
-               System.loadLibrary("crypto");
-               System.loadLibrary("strongswan");
-               System.loadLibrary("hydra");
-               System.loadLibrary("charon");
-               System.loadLibrary("ipsec");
-               System.loadLibrary("androidbridge");
-       }
-}
diff --git a/src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java b/src/frontends/android/src/org/strongswan/android/logic/CharonVpnService.java
new file mode 100644 (file)
index 0000000..b32f9ae
--- /dev/null
@@ -0,0 +1,57 @@
+package org.strongswan.android.logic;
+
+import android.content.Intent;
+import android.net.VpnService;
+
+public class CharonVpnService extends VpnService
+{
+
+       @Override
+       public int onStartCommand(Intent intent, int flags, int startId)
+       {
+               // called whenever the service is started with startService
+               // create our own thread because we are running in the calling processes
+               // main thread
+               return super.onStartCommand(intent, flags, startId);
+       }
+
+       @Override
+       public void onCreate()
+       {
+               // onCreate is only called once
+               initializeCharon();
+               super.onCreate();
+       }
+
+       @Override
+       public void onDestroy()
+       {
+               // called once the service is to be destroyed
+               deinitializeCharon();
+               super.onDestroy();
+       }
+
+       /**
+        * Initialization of charon, provided by libandroidbridge.so
+        */
+       public native void initializeCharon();
+
+       /**
+        * Deinitialize charon, provided by libandroidbridge.so
+        */
+       public native void deinitializeCharon();
+
+       /*
+        * The libraries are extracted to /data/data/org.strongswan.android/...
+        * during installation.
+        */
+       static
+       {
+               System.loadLibrary("crypto");
+               System.loadLibrary("strongswan");
+               System.loadLibrary("hydra");
+               System.loadLibrary("charon");
+               System.loadLibrary("ipsec");
+               System.loadLibrary("androidbridge");
+       }
+}