diff --git a/app/build.gradle b/app/build.gradle index 2ff1565..ca5435b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,7 @@ android { defaultConfig { applicationId "org.poirsouille.tinc_gui" minSdkVersion 16 - targetSdkVersion 19 + targetSdkVersion 21 compileOptions { sourceCompatibility JavaVersion.VERSION_1_5 targetCompatibility JavaVersion.VERSION_1_5 @@ -25,7 +25,7 @@ android { jniLibs.srcDir 'src/main/libs' } - def ndkDir = project.plugins.findPlugin('com.android.application').getNdkFolder() + def ndkDir = android.ndkDirectory def nkdBuildCmd = "$ndkDir/ndk-build" + (Os.isFamily(Os.FAMILY_WINDOWS) ? ".cmd" : "") task buildNative(type: Exec, description: 'Compile JNI source via NDK') { @@ -47,11 +47,20 @@ android { compileTask -> compileTask.dependsOn buildNative } + signingConfigs { + release { + storeFile file(System.console().readLine("\n\$ Enter keystore path: ")) + storePassword new String(System.console().readPassword("\n\$ Enter keystore password: ")) + keyAlias System.console().readLine("\n\$ Enter key alias: ") + keyPassword new String(System.console().readPassword("\n\$ Enter key password: ")) + } + } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' zipAlignEnabled true + signingConfig signingConfigs.release } } } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a3d959d..9cc466f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,10 +1,10 @@ + android:versionCode="15" + android:versionName="0.9.14" > - + diff --git a/app/src/main/java/org/poirsouille/tinc_gui/FilePreference.java b/app/src/main/java/org/poirsouille/tinc_gui/FilePreference.java index 879dc6a..d57e2ec 100644 --- a/app/src/main/java/org/poirsouille/tinc_gui/FilePreference.java +++ b/app/src/main/java/org/poirsouille/tinc_gui/FilePreference.java @@ -72,6 +72,8 @@ public void onItemClick(AdapterView parent, View view, int position, long id) fileList.notifyDataSetChanged(); } }); + + super.onBindDialogView(view); } /** diff --git a/app/src/main/java/org/poirsouille/tinc_gui/TincdService.java b/app/src/main/java/org/poirsouille/tinc_gui/TincdService.java index d20fe06..1ae517c 100644 --- a/app/src/main/java/org/poirsouille/tinc_gui/TincdService.java +++ b/app/src/main/java/org/poirsouille/tinc_gui/TincdService.java @@ -230,6 +230,12 @@ public void stopTincd() run("kill " + aPid + " || rm " + getFileStreamPath(PIDFILE), null); Log.d(Tools.TAG, "killed"); } + else + { + // Work around bug #36: seems PID file doesn't work correctly on some ROMS (probably related to selinux) + run("pkill tincd", null); + Log.d(Tools.TAG, "Couldn't find PID, tincd pkilled"); + } } _debug = false; stopForeground(true); @@ -454,8 +460,8 @@ public IBinder onBind(Intent intent) @SuppressWarnings("deprecation") private void showNotification() { - - Notification notification = new Notification(R.drawable.favicon, getText(R.string.local_service_started), + // TODO: migrate to Notification.Builder (http://developer.android.com/reference/android/app/Notification.Builder.html) + Notification notification = new Notification(R.raw.favicon, getText(R.string.local_service_started), System.currentTimeMillis()); Intent notificationIntent = new Intent(this, TincActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); diff --git a/app/src/main/jni/Android.mk b/app/src/main/jni/Android.mk index 32bf1c0..239104e 100644 --- a/app/src/main/jni/Android.mk +++ b/app/src/main/jni/Android.mk @@ -12,7 +12,7 @@ LOCAL_LDLIBS := -lz LOCAL_CFLAGS := -std=gnu99 -DHAVE_CONFIG_H -DCONFDIR=\"/etc\" -DLOCALSTATEDIR=\"/var\" LOCAL_STATIC_LIBRARIES := libcrypto_static libssl_static LOCAL_FORCE_STATIC_EXECUTABLE := true -LOCAL_SRC_FILES += tinc/src/protocol_edge.c tinc/src/xmalloc.c tinc/src/dummy_device.c tinc/src/protocol_subnet.c tinc/src/edge.c tinc/src/pidfile.c tinc/src/conf.c tinc/src/protocol_misc.c tinc/src/utils.c tinc/src/event.c tinc/src/protocol_key.c tinc/src/raw_socket_device.c tinc/src/protocol.c tinc/src/net_socket.c tinc/src/logger.c tinc/src/list.c tinc/src/fake-getaddrinfo.c tinc/src/net.c tinc/src/tincd.c tinc/src/graph.c tinc/src/process.c tinc/src/net_packet.c tinc/src/netutl.c tinc/src/linux/device.c tinc/src/avl_tree.c tinc/src/route.c tinc/src/meta.c tinc/src/protocol_auth.c tinc/src/net_setup.c tinc/src/getopt.c tinc/src/multicast_device.c tinc/src/connection.c tinc/src/subnet.c tinc/src/node.c tinc/src/fake-getnameinfo.c tinc/src/getopt1.c tinc/src/dropin.c +LOCAL_SRC_FILES += tinc/src/protocol_edge.c tinc/src/xmalloc.c tinc/src/dummy_device.c tinc/src/protocol_subnet.c tinc/src/edge.c tinc/src/pidfile.c tinc/src/conf.c tinc/src/protocol_misc.c tinc/src/utils.c tinc/src/event.c tinc/src/protocol_key.c tinc/src/raw_socket_device.c tinc/src/protocol.c tinc/src/net_socket.c tinc/src/logger.c tinc/src/list.c tinc/src/fake-getaddrinfo.c tinc/src/net.c tinc/src/tincd.c tinc/src/graph.c tinc/src/process.c tinc/src/net_packet.c tinc/src/netutl.c tinc/src/linux/device.c tinc/src/avl_tree.c tinc/src/route.c tinc/src/meta.c tinc/src/protocol_auth.c tinc/src/net_setup.c tinc/src/getopt.c tinc/src/multicast_device.c tinc/src/connection.c tinc/src/subnet.c tinc/src/node.c tinc/src/fake-getnameinfo.c tinc/src/getopt1.c tinc/src/dropin.c tinc/src/proxy.c OPENSSL_DIR := $(NDK_PROJECT_PATH)/jni/platform_external_openssl LOCAL_C_INCLUDES := $(OPENSSL_DIR)/include diff --git a/app/src/main/jni/config.h b/app/src/main/jni/config.h index d569698..98fea3d 100644 --- a/app/src/main/jni/config.h +++ b/app/src/main/jni/config.h @@ -409,7 +409,7 @@ /* Version number of package */ -#define VERSION "1.0.25" +#define VERSION "1.0.28" /* Compile with support for Windows 2000 */ /* #undef WITH_WINDOWS2000 */ diff --git a/app/src/main/res/drawable/favicon.ico b/app/src/main/res/raw/favicon.ico similarity index 100% rename from app/src/main/res/drawable/favicon.ico rename to app/src/main/res/raw/favicon.ico diff --git a/build.gradle b/build.gradle index 666f4e5..77e3db1 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.0.0' + classpath 'com.android.tools.build:gradle:2.+' } } diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..6a71c21 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,16 @@ +## Project-wide Gradle settings. +# +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +# +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +#Thu May 12 23:43:53 CEST 2016 +android.useDeprecatedNdk=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0c71e76..47e8b68 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Apr 10 15:27:10 PDT 2013 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +#Thu May 12 23:41:07 CEST 2016 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip diff --git a/platform_external_openssl b/platform_external_openssl index 179a3f0..6398bcc 160000 --- a/platform_external_openssl +++ b/platform_external_openssl @@ -1 +1 @@ -Subproject commit 179a3f0d04fb01528c5960585494b78b6b369790 +Subproject commit 6398bcc818385901cf9c6958414cdc1860c1bef4 diff --git a/tinc b/tinc index e48c97c..bd33353 160000 --- a/tinc +++ b/tinc @@ -1 +1 @@ -Subproject commit e48c97c107ab58b638c2c5a78c56725dd35c7ec8 +Subproject commit bd333530db38cb17d0dca01bbe37bd77e89834e0