From 23d9368d169b2ce355b68711b0de3e77f742bedb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Mickevi=C4=8Dius?= Date: Sun, 8 Mar 2015 16:10:09 +0200 Subject: Gradle build --- .gitignore | 2 + .travis.yml | 5 + AndroidManifest.xml | 44 -- BUGS | 19 - README.md | 8 +- build.gradle | 33 + jni/Android.mk | 2 +- jni/iodine-client.c | 1 - jni/iodine/src/base64.c | 2 +- proguard-project.txt | 20 - project.properties | 14 - res/anim/main_status_image_connect.xml | 14 - res/anim/main_status_image_connected.xml | 11 - res/anim/main_status_image_disconnect.xml | 9 - res/anim/main_status_image_error.xml | 20 - res/anim/main_status_image_idle.xml | 4 - res/drawable/action_help.png | Bin 693 -> 0 bytes res/drawable/cancel.png | Bin 1709 -> 0 bytes res/drawable/delete.png | Bin 4567 -> 0 bytes res/drawable/device_access_new_account.png | Bin 2662 -> 0 bytes res/drawable/error.png | Bin 1142 -> 0 bytes res/drawable/ic_bt_config.png | Bin 956 -> 0 bytes res/drawable/logo.png | Bin 19292 -> 0 bytes res/layout/configitem.xml | 40 -- res/layout/fragment_list.xml | 15 - res/layout/fragment_status.xml | 47 -- res/layout/main.xml | 12 - res/layout/pref.xml | 13 - res/layout/rowlayout.xml | 31 - res/menu/fragment_list.xml | 10 - res/menu/main.xml | 11 - res/menu/pref.xml | 11 - res/raw/license | 56 -- res/raw/logo.svg | 742 --------------------- res/values-de/strings.xml | 34 - res/values/strings.xml | 82 --- src/main/AndroidManifest.xml | 43 ++ .../java/org/xapek/andiodine/FragmentList.java | 205 ++++++ .../java/org/xapek/andiodine/FragmentStatus.java | 120 ++++ .../java/org/xapek/andiodine/IodineClient.java | 53 ++ src/main/java/org/xapek/andiodine/IodineMain.java | 112 ++++ src/main/java/org/xapek/andiodine/IodinePref.java | 112 ++++ .../java/org/xapek/andiodine/IodineVpnService.java | 350 ++++++++++ .../org/xapek/andiodine/config/ConfigDatabase.java | 124 ++++ .../andiodine/config/IodineConfiguration.java | 132 ++++ .../andiodine/preferences/AbstractPreference.java | 49 ++ .../andiodine/preferences/BooleanPreference.java | 33 + .../andiodine/preferences/PreferenceActivity.java | 104 +++ .../andiodine/preferences/SpinnerPreference.java | 47 ++ .../andiodine/preferences/TextPreference.java | 35 + src/main/res/anim/main_status_image_connect.xml | 14 + src/main/res/anim/main_status_image_connected.xml | 11 + src/main/res/anim/main_status_image_disconnect.xml | 9 + src/main/res/anim/main_status_image_error.xml | 20 + src/main/res/anim/main_status_image_idle.xml | 4 + src/main/res/drawable/action_help.png | Bin 0 -> 693 bytes src/main/res/drawable/cancel.png | Bin 0 -> 1709 bytes src/main/res/drawable/delete.png | Bin 0 -> 4567 bytes .../res/drawable/device_access_new_account.png | Bin 0 -> 2662 bytes src/main/res/drawable/error.png | Bin 0 -> 1142 bytes src/main/res/drawable/ic_bt_config.png | Bin 0 -> 956 bytes src/main/res/drawable/logo.png | Bin 0 -> 19292 bytes src/main/res/layout/configitem.xml | 40 ++ src/main/res/layout/fragment_list.xml | 15 + src/main/res/layout/fragment_status.xml | 47 ++ src/main/res/layout/main.xml | 12 + src/main/res/layout/pref.xml | 13 + src/main/res/layout/rowlayout.xml | 31 + src/main/res/menu/fragment_list.xml | 10 + src/main/res/menu/main.xml | 11 + src/main/res/menu/pref.xml | 11 + src/main/res/raw/license | 56 ++ src/main/res/raw/logo.svg | 742 +++++++++++++++++++++ src/main/res/values-de/strings.xml | 60 ++ src/main/res/values/strings.xml | 82 +++ src/org/xapek/andiodine/FragmentList.java | 205 ------ src/org/xapek/andiodine/FragmentStatus.java | 120 ---- src/org/xapek/andiodine/IodineClient.java | 53 -- src/org/xapek/andiodine/IodineMain.java | 112 ---- src/org/xapek/andiodine/IodinePref.java | 112 ---- src/org/xapek/andiodine/IodineVpnService.java | 350 ---------- src/org/xapek/andiodine/config/ConfigDatabase.java | 124 ---- .../andiodine/config/IodineConfiguration.java | 132 ---- .../andiodine/preferences/AbstractPreference.java | 49 -- .../andiodine/preferences/BooleanPreference.java | 33 - .../andiodine/preferences/PreferenceActivity.java | 104 --- .../andiodine/preferences/SpinnerPreference.java | 47 -- .../andiodine/preferences/TextPreference.java | 35 - tests/AndroidManifest.xml | 30 - tests/proguard-project.txt | 20 - tests/project.properties | 14 - tests/src/org/xapek/andiodine/HelloJniTest.java | 22 - tests/tests.iml | 26 - 93 files changed, 2756 insertions(+), 2851 deletions(-) create mode 100644 .travis.yml delete mode 100644 AndroidManifest.xml delete mode 100644 BUGS create mode 100644 build.gradle delete mode 100644 proguard-project.txt delete mode 100644 project.properties delete mode 100644 res/anim/main_status_image_connect.xml delete mode 100644 res/anim/main_status_image_connected.xml delete mode 100644 res/anim/main_status_image_disconnect.xml delete mode 100644 res/anim/main_status_image_error.xml delete mode 100644 res/anim/main_status_image_idle.xml delete mode 100644 res/drawable/action_help.png delete mode 100644 res/drawable/cancel.png delete mode 100644 res/drawable/delete.png delete mode 100644 res/drawable/device_access_new_account.png delete mode 100644 res/drawable/error.png delete mode 100644 res/drawable/ic_bt_config.png delete mode 100644 res/drawable/logo.png delete mode 100644 res/layout/configitem.xml delete mode 100644 res/layout/fragment_list.xml delete mode 100644 res/layout/fragment_status.xml delete mode 100644 res/layout/main.xml delete mode 100644 res/layout/pref.xml delete mode 100644 res/layout/rowlayout.xml delete mode 100644 res/menu/fragment_list.xml delete mode 100644 res/menu/main.xml delete mode 100644 res/menu/pref.xml delete mode 100644 res/raw/license delete mode 100644 res/raw/logo.svg delete mode 100644 res/values-de/strings.xml delete mode 100644 res/values/strings.xml create mode 100644 src/main/AndroidManifest.xml create mode 100644 src/main/java/org/xapek/andiodine/FragmentList.java create mode 100644 src/main/java/org/xapek/andiodine/FragmentStatus.java create mode 100644 src/main/java/org/xapek/andiodine/IodineClient.java create mode 100644 src/main/java/org/xapek/andiodine/IodineMain.java create mode 100644 src/main/java/org/xapek/andiodine/IodinePref.java create mode 100644 src/main/java/org/xapek/andiodine/IodineVpnService.java create mode 100644 src/main/java/org/xapek/andiodine/config/ConfigDatabase.java create mode 100644 src/main/java/org/xapek/andiodine/config/IodineConfiguration.java create mode 100644 src/main/java/org/xapek/andiodine/preferences/AbstractPreference.java create mode 100644 src/main/java/org/xapek/andiodine/preferences/BooleanPreference.java create mode 100644 src/main/java/org/xapek/andiodine/preferences/PreferenceActivity.java create mode 100644 src/main/java/org/xapek/andiodine/preferences/SpinnerPreference.java create mode 100644 src/main/java/org/xapek/andiodine/preferences/TextPreference.java create mode 100644 src/main/res/anim/main_status_image_connect.xml create mode 100644 src/main/res/anim/main_status_image_connected.xml create mode 100644 src/main/res/anim/main_status_image_disconnect.xml create mode 100644 src/main/res/anim/main_status_image_error.xml create mode 100644 src/main/res/anim/main_status_image_idle.xml create mode 100644 src/main/res/drawable/action_help.png create mode 100644 src/main/res/drawable/cancel.png create mode 100644 src/main/res/drawable/delete.png create mode 100644 src/main/res/drawable/device_access_new_account.png create mode 100644 src/main/res/drawable/error.png create mode 100644 src/main/res/drawable/ic_bt_config.png create mode 100644 src/main/res/drawable/logo.png create mode 100644 src/main/res/layout/configitem.xml create mode 100644 src/main/res/layout/fragment_list.xml create mode 100644 src/main/res/layout/fragment_status.xml create mode 100644 src/main/res/layout/main.xml create mode 100644 src/main/res/layout/pref.xml create mode 100644 src/main/res/layout/rowlayout.xml create mode 100644 src/main/res/menu/fragment_list.xml create mode 100644 src/main/res/menu/main.xml create mode 100644 src/main/res/menu/pref.xml create mode 100644 src/main/res/raw/license create mode 100644 src/main/res/raw/logo.svg create mode 100644 src/main/res/values-de/strings.xml create mode 100644 src/main/res/values/strings.xml delete mode 100644 src/org/xapek/andiodine/FragmentList.java delete mode 100644 src/org/xapek/andiodine/FragmentStatus.java delete mode 100644 src/org/xapek/andiodine/IodineClient.java delete mode 100644 src/org/xapek/andiodine/IodineMain.java delete mode 100644 src/org/xapek/andiodine/IodinePref.java delete mode 100644 src/org/xapek/andiodine/IodineVpnService.java delete mode 100644 src/org/xapek/andiodine/config/ConfigDatabase.java delete mode 100644 src/org/xapek/andiodine/config/IodineConfiguration.java delete mode 100644 src/org/xapek/andiodine/preferences/AbstractPreference.java delete mode 100644 src/org/xapek/andiodine/preferences/BooleanPreference.java delete mode 100644 src/org/xapek/andiodine/preferences/PreferenceActivity.java delete mode 100644 src/org/xapek/andiodine/preferences/SpinnerPreference.java delete mode 100644 src/org/xapek/andiodine/preferences/TextPreference.java delete mode 100644 tests/AndroidManifest.xml delete mode 100644 tests/proguard-project.txt delete mode 100644 tests/project.properties delete mode 100644 tests/src/org/xapek/andiodine/HelloJniTest.java delete mode 100644 tests/tests.iml diff --git a/.gitignore b/.gitignore index 21c7ed0..3932f8e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ +/.gradle /bin +/build /jni/iodine/src/*.o /jni/iodine/bin /obj diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7d3db1b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: android +android: + components: + - build-tools-21.1.2 + - android-15 diff --git a/AndroidManifest.xml b/AndroidManifest.xml deleted file mode 100644 index 1600d93..0000000 --- a/AndroidManifest.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/BUGS b/BUGS deleted file mode 100644 index a660555..0000000 --- a/BUGS +++ /dev/null @@ -1,19 +0,0 @@ -E/AndroidRuntime( 1505): FATAL EXCEPTION: main -E/AndroidRuntime( 1505): java.lang.RuntimeException: Error receiving broadcast Intent { act=org.xapek.andiodine.IodineVpnService.STATUS_IDLE flg=0x10 } in org.xapek.andiodine.IodineMain$1@40f33f68 -E/AndroidRuntime( 1505): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java) -E/AndroidRuntime( 1505): at android.os.Handler.handleCallback(Handler.java) -E/AndroidRuntime( 1505): at android.os.Handler.dispatchMessage(Handler.java) -E/AndroidRuntime( 1505): at android.os.Looper.loop(Looper.java) -E/AndroidRuntime( 1505): at android.app.ActivityThread.main(ActivityThread.java) -E/AndroidRuntime( 1505): at java.lang.reflect.Method.invokeNative(Native Method) -E/AndroidRuntime( 1505): at java.lang.reflect.Method.invoke(Method.java) -E/AndroidRuntime( 1505): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java) -E/AndroidRuntime( 1505): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java) -E/AndroidRuntime( 1505): at dalvik.system.NativeStart.main(Native Method) -E/AndroidRuntime( 1505): Caused by: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState -E/AndroidRuntime( 1505): at android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java) -E/AndroidRuntime( 1505): at android.app.FragmentManagerImpl.enqueueAction(FragmentManager.java) -E/AndroidRuntime( 1505): at android.app.BackStackRecord.commitInternal(BackStackRecord.java) -E/AndroidRuntime( 1505): at android.app.BackStackRecord.commit(BackStackRecord.java) -E/AndroidRuntime( 1505): at org.xapek.andiodine.IodineMain$1.onReceive(IodineMain.java:41) -E/AndroidRuntime( 1505): ... 10 more diff --git a/README.md b/README.md index 7f48e1f..185457b 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,13 @@ auf Android - (german)[Anwenderdokumentation](doc/anwenderdoku.html) [(PDF)](doc/anwenderdoku.pdf) - (german)[Entwicklerdokumentation](doc/entwicklerdoku.html) [(PDF)](doc/entwicklerdoku.pdf) +# Building + +``` bash +(cd jni && ndk-build) +gradle build +``` + # Authors and License Android Iodine Copyright (c) 2013 Yves Fischer Same license as iodine. @@ -28,4 +35,3 @@ PERFORMANCE OF THIS SOFTWARE. MD5 implementation by L. Peter Deutsch (license and source in src/md5.[ch]) Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved. - diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..b15b3e1 --- /dev/null +++ b/build.gradle @@ -0,0 +1,33 @@ +buildscript { + repositories { + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:1.1.3' + } +} + +apply plugin: 'com.android.application' + +android { + compileSdkVersion 15 + buildToolsVersion "21.1.2" + + sourceSets.main { + jniLibs.srcDir 'libs' + } + + productFlavors { + arm { + ndk { + abiFilters "armeabi" + } + } + x86 { + ndk { + abiFilter "x86" + } + } + } +} diff --git a/jni/Android.mk b/jni/Android.mk index 06cf936..2117fb6 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -26,7 +26,7 @@ $(LOCAL_PATH)/iodine/src/base64u.h: $(LOCAL_PATH)/iodine/src/base64.h @echo '/* No use in editing, produced by Makefile! */' > $@ @sed -e 's/\([Bb][Aa][Ss][Ee]64\)/\1u/g ; s/0123456789+/0123456789_/' < $< >> $@ -LOCAL_MODULE := iodine-client +LOCAL_MODULE := iodine-client LOCAL_LDLIBS := -lz -llog LOCAL_CFLAGS := -Wall LOCAL_SRC_FILES := iodine-client.c \ diff --git a/jni/iodine-client.c b/jni/iodine-client.c index 905b154..11ef7cf 100644 --- a/jni/iodine-client.c +++ b/jni/iodine-client.c @@ -212,4 +212,3 @@ JNIEXPORT jstring JNICALL Java_org_xapek_andiodine_IodineClient_getPropertyNetDn __system_property_get("net.dns1", value); return (*env)->NewStringUTF(env, value); } - diff --git a/jni/iodine/src/base64.c b/jni/iodine/src/base64.c index 00a84fc..71bbcf1 100644 --- a/jni/iodine/src/base64.c +++ b/jni/iodine/src/base64.c @@ -90,7 +90,7 @@ base64_reverse_init() } } -static int +static int base64_encode(char *buf, size_t *buflen, const void *data, size_t size) /* * Fills *buf with max. *buflen characters, encoding size bytes of *data. diff --git a/proguard-project.txt b/proguard-project.txt deleted file mode 100644 index f2fe155..0000000 --- a/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/project.properties b/project.properties deleted file mode 100644 index 0840b4a..0000000 --- a/project.properties +++ /dev/null @@ -1,14 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-15 diff --git a/res/anim/main_status_image_connect.xml b/res/anim/main_status_image_connect.xml deleted file mode 100644 index dadf0d6..0000000 --- a/res/anim/main_status_image_connect.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - \ No newline at end of file diff --git a/res/anim/main_status_image_connected.xml b/res/anim/main_status_image_connected.xml deleted file mode 100644 index e9aba80..0000000 --- a/res/anim/main_status_image_connected.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - \ No newline at end of file diff --git a/res/anim/main_status_image_disconnect.xml b/res/anim/main_status_image_disconnect.xml deleted file mode 100644 index 49677b5..0000000 --- a/res/anim/main_status_image_disconnect.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - \ No newline at end of file diff --git a/res/anim/main_status_image_error.xml b/res/anim/main_status_image_error.xml deleted file mode 100644 index 55472d0..0000000 --- a/res/anim/main_status_image_error.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/res/anim/main_status_image_idle.xml b/res/anim/main_status_image_idle.xml deleted file mode 100644 index 68802e7..0000000 --- a/res/anim/main_status_image_idle.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/res/drawable/action_help.png b/res/drawable/action_help.png deleted file mode 100644 index 1bf05f2..0000000 Binary files a/res/drawable/action_help.png and /dev/null differ diff --git a/res/drawable/cancel.png b/res/drawable/cancel.png deleted file mode 100644 index d743d75..0000000 Binary files a/res/drawable/cancel.png and /dev/null differ diff --git a/res/drawable/delete.png b/res/drawable/delete.png deleted file mode 100644 index a9d4d6e..0000000 Binary files a/res/drawable/delete.png and /dev/null differ diff --git a/res/drawable/device_access_new_account.png b/res/drawable/device_access_new_account.png deleted file mode 100644 index 6e92072..0000000 Binary files a/res/drawable/device_access_new_account.png and /dev/null differ diff --git a/res/drawable/error.png b/res/drawable/error.png deleted file mode 100644 index 2d0283e..0000000 Binary files a/res/drawable/error.png and /dev/null differ diff --git a/res/drawable/ic_bt_config.png b/res/drawable/ic_bt_config.png deleted file mode 100644 index 6754469..0000000 Binary files a/res/drawable/ic_bt_config.png and /dev/null differ diff --git a/res/drawable/logo.png b/res/drawable/logo.png deleted file mode 100644 index c60295a..0000000 Binary files a/res/drawable/logo.png and /dev/null differ diff --git a/res/layout/configitem.xml b/res/layout/configitem.xml deleted file mode 100644 index d8d279d..0000000 --- a/res/layout/configitem.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/res/layout/fragment_list.xml b/res/layout/fragment_list.xml deleted file mode 100644 index 3b1e678..0000000 --- a/res/layout/fragment_list.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/res/layout/fragment_status.xml b/res/layout/fragment_status.xml deleted file mode 100644 index 65f63b1..0000000 --- a/res/layout/fragment_status.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - -