Skip to content

Commit

Permalink
Work-around unreadable PID file (fix #36).
Browse files Browse the repository at this point in the history
Bump tinc to 1.0.28.
  • Loading branch information
Vilbrekin committed May 15, 2016
1 parent 2015355 commit 2a5180d
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 18 deletions.
13 changes: 11 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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') {

Expand All @@ -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
}
}
}
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
package="org.poirsouille.tinc_gui"
android:versionCode="14"
android:versionName="0.9.13" >
android:versionCode="15"
android:versionName="0.9.14" >

<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="19" />
<uses-sdk />
<uses-permission android:name="android.permission.ACCESS_SUPERUSER" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
fileList.notifyDataSetChanged();
}
});

super.onBindDialogView(view);
}

/**
Expand Down
10 changes: 8 additions & 2 deletions app/src/main/java/org/poirsouille/tinc_gui/TincdService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/jni/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'com.android.tools.build:gradle:2.+'
}
}

Expand Down
16 changes: 16 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion platform_external_openssl
2 changes: 1 addition & 1 deletion tinc
Submodule tinc updated from e48c97 to bd3335

0 comments on commit 2a5180d

Please sign in to comment.