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: [PATCH] Gradle build --- .gitignore | 2 ++ .travis.yml | 5 +++ 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 -------- .../main/AndroidManifest.xml | 1 - .../org/xapek/andiodine/FragmentList.java | 0 .../org/xapek/andiodine/FragmentStatus.java | 0 .../org/xapek/andiodine/IodineClient.java | 0 .../java}/org/xapek/andiodine/IodineMain.java | 0 .../java}/org/xapek/andiodine/IodinePref.java | 0 .../org/xapek/andiodine/IodineVpnService.java | 0 .../andiodine/config/ConfigDatabase.java | 0 .../andiodine/config/IodineConfiguration.java | 0 .../preferences/AbstractPreference.java | 0 .../preferences/BooleanPreference.java | 0 .../preferences/PreferenceActivity.java | 0 .../preferences/SpinnerPreference.java | 0 .../andiodine/preferences/TextPreference.java | 0 .../res}/anim/main_status_image_connect.xml | 0 .../res}/anim/main_status_image_connected.xml | 0 .../anim/main_status_image_disconnect.xml | 0 .../res}/anim/main_status_image_error.xml | 0 .../main/res}/anim/main_status_image_idle.xml | 0 .../main/res}/drawable/action_help.png | Bin {res => src/main/res}/drawable/cancel.png | Bin {res => src/main/res}/drawable/delete.png | Bin .../drawable/device_access_new_account.png | Bin {res => src/main/res}/drawable/error.png | Bin .../main/res}/drawable/ic_bt_config.png | Bin {res => src/main/res}/drawable/logo.png | Bin {res => src/main/res}/layout/configitem.xml | 0 .../main/res}/layout/fragment_list.xml | 0 .../main/res}/layout/fragment_status.xml | 0 {res => src/main/res}/layout/main.xml | 0 {res => src/main/res}/layout/pref.xml | 0 {res => src/main/res}/layout/rowlayout.xml | 0 {res => src/main/res}/menu/fragment_list.xml | 0 {res => src/main/res}/menu/main.xml | 0 {res => src/main/res}/menu/pref.xml | 0 {res => src/main/res}/raw/license | 0 {res => src/main/res}/raw/logo.svg | 0 {res => src/main/res}/values-de/strings.xml | 28 ++++++++++++++- {res => src/main/res}/values/strings.xml | 2 +- tests/AndroidManifest.xml | 30 ---------------- tests/proguard-project.txt | 20 ----------- tests/project.properties | 14 -------- .../src/org/xapek/andiodine/HelloJniTest.java | 22 ------------ tests/tests.iml | 26 -------------- 54 files changed, 77 insertions(+), 172 deletions(-) create mode 100644 .travis.yml delete mode 100644 BUGS create mode 100644 build.gradle delete mode 100644 proguard-project.txt delete mode 100644 project.properties rename AndroidManifest.xml => src/main/AndroidManifest.xml (97%) rename src/{ => main/java}/org/xapek/andiodine/FragmentList.java (100%) rename src/{ => main/java}/org/xapek/andiodine/FragmentStatus.java (100%) rename src/{ => main/java}/org/xapek/andiodine/IodineClient.java (100%) rename src/{ => main/java}/org/xapek/andiodine/IodineMain.java (100%) rename src/{ => main/java}/org/xapek/andiodine/IodinePref.java (100%) rename src/{ => main/java}/org/xapek/andiodine/IodineVpnService.java (100%) rename src/{ => main/java}/org/xapek/andiodine/config/ConfigDatabase.java (100%) rename src/{ => main/java}/org/xapek/andiodine/config/IodineConfiguration.java (100%) rename src/{ => main/java}/org/xapek/andiodine/preferences/AbstractPreference.java (100%) rename src/{ => main/java}/org/xapek/andiodine/preferences/BooleanPreference.java (100%) rename src/{ => main/java}/org/xapek/andiodine/preferences/PreferenceActivity.java (100%) rename src/{ => main/java}/org/xapek/andiodine/preferences/SpinnerPreference.java (100%) rename src/{ => main/java}/org/xapek/andiodine/preferences/TextPreference.java (100%) rename {res => src/main/res}/anim/main_status_image_connect.xml (100%) rename {res => src/main/res}/anim/main_status_image_connected.xml (100%) rename {res => src/main/res}/anim/main_status_image_disconnect.xml (100%) rename {res => src/main/res}/anim/main_status_image_error.xml (100%) rename {res => src/main/res}/anim/main_status_image_idle.xml (100%) rename {res => src/main/res}/drawable/action_help.png (100%) rename {res => src/main/res}/drawable/cancel.png (100%) rename {res => src/main/res}/drawable/delete.png (100%) rename {res => src/main/res}/drawable/device_access_new_account.png (100%) rename {res => src/main/res}/drawable/error.png (100%) rename {res => src/main/res}/drawable/ic_bt_config.png (100%) rename {res => src/main/res}/drawable/logo.png (100%) rename {res => src/main/res}/layout/configitem.xml (100%) rename {res => src/main/res}/layout/fragment_list.xml (100%) rename {res => src/main/res}/layout/fragment_status.xml (100%) rename {res => src/main/res}/layout/main.xml (100%) rename {res => src/main/res}/layout/pref.xml (100%) rename {res => src/main/res}/layout/rowlayout.xml (100%) rename {res => src/main/res}/menu/fragment_list.xml (100%) rename {res => src/main/res}/menu/main.xml (100%) rename {res => src/main/res}/menu/pref.xml (100%) rename {res => src/main/res}/raw/license (100%) rename {res => src/main/res}/raw/logo.svg (100%) rename {res => src/main/res}/values-de/strings.xml (77%) rename {res => src/main/res}/values/strings.xml (99%) 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/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/AndroidManifest.xml b/src/main/AndroidManifest.xml similarity index 97% rename from AndroidManifest.xml rename to src/main/AndroidManifest.xml index 1600d93..0bea991 100644 --- a/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -11,7 +11,6 @@ + AndIodine + Über + + + automatisch + NULL + TXT + SRV + MX + CNAME + A + + + Netzstandard + Brauch + Tunnel-Endpunkt + + + Konto hinzufügen + Rückgängig Machen + Schließen Tunnel Passwort Tunnel Toplevel Domain Tunnel Nameserver @@ -28,7 +49,12 @@ Unbekannter Fehler. Grund: %s Leerlauf Warnung + Fehler Konfiguriere dieses Verbindungsprofil Verbindungseinstellungen + Erstellen Sie DNS-Tunnel von Configuration Namen %s + Neuer Kunde + Über + Löschen - \ No newline at end of file + diff --git a/res/values/strings.xml b/src/main/res/values/strings.xml similarity index 99% rename from res/values/strings.xml rename to src/main/res/values/strings.xml index e07212c..ffbbb15 100644 --- a/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -79,4 +79,4 @@ About Delete - \ No newline at end of file + diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml deleted file mode 100644 index 75082fb..0000000 --- a/tests/AndroidManifest.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/proguard-project.txt b/tests/proguard-project.txt deleted file mode 100644 index f2fe155..0000000 --- a/tests/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/tests/project.properties b/tests/project.properties deleted file mode 100644 index 9fb894d..0000000 --- a/tests/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-3 diff --git a/tests/src/org/xapek/andiodine/HelloJniTest.java b/tests/src/org/xapek/andiodine/HelloJniTest.java deleted file mode 100644 index 14322f3..0000000 --- a/tests/src/org/xapek/andiodine/HelloJniTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.xapek.andiodine; - -import android.test.ActivityInstrumentationTestCase2; - -import org.xapek.andiodine.IodineMain; - -/** - * This is a simple framework for a test of an Application. See - * {@link android.test.ApplicationTestCase ApplicationTestCase} for more information on - * how to write and extend Application tests. - *

- * To run this test, you can type: - * adb shell am instrument -w \ - * -e class org.xapek.andiodine.HelloJniTest \ - * com.example.HelloJni.tests/android.test.InstrumentationTestRunner - */ -public class HelloJniTest extends ActivityInstrumentationTestCase2 { - public HelloJniTest() { - super(IodineMain.class); - } - -} diff --git a/tests/tests.iml b/tests/tests.iml deleted file mode 100644 index 6698b2b..0000000 --- a/tests/tests.iml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - MANIFEST_FILE_PATH - RESOURCES_DIR_PATH - ASSETS_DIR_PATH - NATIVE_LIBS_DIR_PATH - - - - - - - - - - - - - - - -