diff options
Diffstat (limited to 'app')
40 files changed, 968 insertions, 913 deletions
diff --git a/app/build.gradle b/app/build.gradle index 1e96fdc..4b11a3e 100644 --- a/app/build.gradle +++ b/app/build.gradle | |||
@@ -3,66 +3,66 @@ apply plugin: 'kotlin-android' | |||
3 | apply plugin: 'kotlin-android-extensions' | 3 | apply plugin: 'kotlin-android-extensions' |
4 | 4 | ||
5 | android { | 5 | android { |
6 | compileSdkVersion 25 | 6 | compileSdkVersion 25 |
7 | buildToolsVersion '26.0.2' | 7 | buildToolsVersion '26.0.2' |
8 | 8 | ||
9 | defaultConfig { | 9 | defaultConfig { |
10 | applicationId "org.pacien.tincapp" | 10 | applicationId "org.pacien.tincapp" |
11 | minSdkVersion 21 | 11 | minSdkVersion 21 |
12 | targetSdkVersion 21 | 12 | targetSdkVersion 21 |
13 | multiDexEnabled true | 13 | multiDexEnabled true |
14 | versionCode 7 | 14 | versionCode 7 |
15 | versionName "0.7" | 15 | versionName "0.7" |
16 | ndk { | 16 | ndk { |
17 | abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'arm64-v8a' | 17 | abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'arm64-v8a' |
18 | } | 18 | } |
19 | } | 19 | } |
20 | 20 | ||
21 | buildTypes { | 21 | buildTypes { |
22 | release { | 22 | release { |
23 | minifyEnabled true | 23 | minifyEnabled true |
24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | 24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
25 | } | 25 | } |
26 | } | 26 | } |
27 | 27 | ||
28 | externalNativeBuild { | 28 | externalNativeBuild { |
29 | cmake { | 29 | cmake { |
30 | path "CMakeLists.txt" | 30 | path "CMakeLists.txt" |
31 | } | 31 | } |
32 | } | 32 | } |
33 | 33 | ||
34 | lintOptions { | 34 | lintOptions { |
35 | disable 'MissingTranslation' | 35 | disable 'MissingTranslation' |
36 | } | 36 | } |
37 | } | 37 | } |
38 | 38 | ||
39 | dependencies { | 39 | dependencies { |
40 | compile fileTree(dir: 'libs', include: ['*.jar']) | 40 | compile fileTree(dir: 'libs', include: ['*.jar']) |
41 | 41 | ||
42 | compile 'com.android.support:appcompat-v7:25.4.0' | 42 | compile 'com.android.support:appcompat-v7:25.4.0' |
43 | compile 'com.android.support:design:25.4.0' | 43 | compile 'com.android.support:design:25.4.0' |
44 | compile 'com.android.support:support-v4:25.4.0' | 44 | compile 'com.android.support:support-v4:25.4.0' |
45 | compile 'com.android.support:recyclerview-v7:25.4.0' | 45 | compile 'com.android.support:recyclerview-v7:25.4.0' |
46 | compile 'com.android.support.constraint:constraint-layout:1.0.2' | 46 | compile 'com.android.support.constraint:constraint-layout:1.0.2' |
47 | 47 | ||
48 | compile('org.apache.commons:commons-configuration2:2.1.1') { | 48 | compile('org.apache.commons:commons-configuration2:2.1.1') { |
49 | exclude group: 'commons-logging', module: 'commons-logging' | 49 | exclude group: 'commons-logging', module: 'commons-logging' |
50 | } | 50 | } |
51 | compile('commons-beanutils:commons-beanutils:1.9.3') { | 51 | compile('commons-beanutils:commons-beanutils:1.9.3') { |
52 | exclude group: 'commons-logging', module: 'commons-logging' | 52 | exclude group: 'commons-logging', module: 'commons-logging' |
53 | } | 53 | } |
54 | 54 | ||
55 | compile 'org.bouncycastle:bcpkix-jdk15on:1.57' | 55 | compile 'org.bouncycastle:bcpkix-jdk15on:1.57' |
56 | 56 | ||
57 | compile 'net.sourceforge.streamsupport:streamsupport-cfuture:1.5.5' | 57 | compile 'net.sourceforge.streamsupport:streamsupport-cfuture:1.5.5' |
58 | 58 | ||
59 | compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" | 59 | compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" |
60 | } | 60 | } |
61 | 61 | ||
62 | repositories { | 62 | repositories { |
63 | mavenCentral() | 63 | mavenCentral() |
64 | jcenter() | 64 | jcenter() |
65 | maven { | 65 | maven { |
66 | url "https://maven.google.com" | 66 | url "https://maven.google.com" |
67 | } | 67 | } |
68 | } | 68 | } |
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3ccc9e6..f03a640 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml | |||
@@ -1,7 +1,7 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:tools="http://schemas.android.com/tools" | 3 | xmlns:tools="http://schemas.android.com/tools" |
4 | package="org.pacien.tincapp"> | 4 | package="org.pacien.tincapp"> |
5 | 5 | ||
6 | <uses-permission android:name="android.permission.INTERNET"/> | 6 | <uses-permission android:name="android.permission.INTERNET"/> |
7 | <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> | 7 | <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> |
diff --git a/app/src/main/c/exec.c b/app/src/main/c/exec.c index fdaec0f..a9871a5 100644 --- a/app/src/main/c/exec.c +++ b/app/src/main/c/exec.c | |||
@@ -3,32 +3,32 @@ | |||
3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
4 | 4 | ||
5 | static inline const char **to_string_array(JNIEnv *env, jobjectArray ja) { | 5 | static inline const char **to_string_array(JNIEnv *env, jobjectArray ja) { |
6 | const int len = (*env)->GetArrayLength(env, ja); | 6 | const int len = (*env)->GetArrayLength(env, ja); |
7 | const char **ca = calloc((size_t) len + 1, sizeof(char *)); | 7 | const char **ca = calloc((size_t) len + 1, sizeof(char *)); |
8 | 8 | ||
9 | for (int i = 0; i < len; ++i) { | 9 | for (int i = 0; i < len; ++i) { |
10 | jstring jstr = (jstring) (*env)->GetObjectArrayElement(env, ja, i); | 10 | jstring jstr = (jstring) (*env)->GetObjectArrayElement(env, ja, i); |
11 | ca[i] = (*env)->GetStringUTFChars(env, jstr, NULL); | 11 | ca[i] = (*env)->GetStringUTFChars(env, jstr, NULL); |
12 | } | 12 | } |
13 | 13 | ||
14 | ca[len] = NULL; | 14 | ca[len] = NULL; |
15 | return ca; | 15 | return ca; |
16 | } | 16 | } |
17 | 17 | ||
18 | static inline void exec(const char **argcv) { | 18 | static inline void exec(const char **argcv) { |
19 | execv(argcv[0], (char *const *) argcv); | 19 | execv(argcv[0], (char *const *) argcv); |
20 | exit(1); | 20 | exit(1); |
21 | } | 21 | } |
22 | 22 | ||
23 | JNIEXPORT jint JNICALL | 23 | JNIEXPORT jint JNICALL |
24 | Java_org_pacien_tincapp_commands_Executor_forkExec(JNIEnv *env, jclass class, jobjectArray argcv) { | 24 | Java_org_pacien_tincapp_commands_Executor_forkExec(JNIEnv *env, jclass class, jobjectArray argcv) { |
25 | pid_t pid = fork(); | 25 | pid_t pid = fork(); |
26 | switch (pid) { | 26 | switch (pid) { |
27 | case 0: | 27 | case 0: |
28 | exec(to_string_array(env, argcv)); | 28 | exec(to_string_array(env, argcv)); |
29 | return 0; | 29 | return 0; |
30 | 30 | ||
31 | default: | 31 | default: |
32 | return pid; | 32 | return pid; |
33 | } | 33 | } |
34 | } | 34 | } |
diff --git a/app/src/main/java/org/pacien/tincapp/activities/BaseActivity.kt b/app/src/main/java/org/pacien/tincapp/activities/BaseActivity.kt index 4904a66..c092111 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/BaseActivity.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/BaseActivity.kt | |||
@@ -19,34 +19,34 @@ import org.pacien.tincapp.context.AppInfo | |||
19 | */ | 19 | */ |