diff options
Diffstat (limited to 'app/src/main')
44 files changed, 157 insertions, 87 deletions
diff --git a/app/src/main/c/exec.c b/app/src/main/c/exec.c index 838135c..5e92b11 100644 --- a/app/src/main/c/exec.c +++ b/app/src/main/c/exec.c | |||
@@ -40,11 +40,11 @@ static inline void exec(const char **argcv) { | |||
40 | } | 40 | } |
41 | 41 | ||
42 | JNIEXPORT jint JNICALL | 42 | JNIEXPORT jint JNICALL |
43 | Java_org_pacien_tincapp_commands_Executor_forkExec(JNIEnv *env, jclass class, jobjectArray argcv) { | 43 | Java_org_pacien_tincapp_commands_Executor_forkExec(JNIEnv *env, __attribute__((unused)) jclass class, jobjectArray args) { |
44 | pid_t pid = fork(); | 44 | pid_t pid = fork(); |
45 | switch (pid) { | 45 | switch (pid) { |
46 | case 0: | 46 | case 0: |
47 | exec(to_string_array(env, argcv)); | 47 | exec(to_string_array(env, args)); |
48 | return 0; | 48 | return 0; |
49 | 49 | ||
50 | default: | 50 | default: |
@@ -53,7 +53,7 @@ Java_org_pacien_tincapp_commands_Executor_forkExec(JNIEnv *env, jclass class, jo | |||
53 | } | 53 | } |
54 | 54 | ||
55 | JNIEXPORT jint JNICALL | 55 | JNIEXPORT jint JNICALL |
56 | Java_org_pacien_tincapp_commands_Executor_wait(JNIEnv *env, jclass class, jint pid) { | 56 | Java_org_pacien_tincapp_commands_Executor_wait(__attribute__((unused))JNIEnv *env, __attribute__((unused)) jclass class, jint pid) { |
57 | int status; | 57 | int status; |
58 | waitpid(pid, &status, 0); | 58 | waitpid(pid, &status, 0); |
59 | return WIFEXITED(status) ? WEXITSTATUS(status) : -1; | 59 | return WIFEXITED(status) ? WEXITSTATUS(status) : -1; |
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 3e2bebd..4b1cb91 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/BaseActivity.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/BaseActivity.kt | |||
@@ -78,7 +78,7 @@ abstract class BaseActivity : AppCompatActivity() { | |||
78 | resources.getString(R.string.app_license) + "\n\n" + | 78 | resources.getString(R.string.app_license) + "\n\n" + |
79 | AppInfo.all()) | 79 | AppInfo.all()) |
80 | .setNeutralButton(R.string.action_open_project_website) { _, _ -> App.openURL(resources.getString(R.string.app_website_url)) } | 80 | .setNeutralButton(R.string.action_open_project_website) { _, _ -> App.openURL(resources.getString(R.string.app_website_url)) } |
81 | .setPositiveButton(R.string.action_close, { _, _ -> Unit }) | 81 | .setPositiveButton(R.string.action_close) { _, _ -> Unit } |
82 | .show() | 82 | .show() |
83 | } | 83 | } |
84 | 84 | ||
@@ -96,13 +96,13 @@ abstract class BaseActivity : AppCompatActivity() { | |||
96 | resources.getString(R.string.message_app_crash), | 96 | resources.getString(R.string.message_app_crash), |
97 | resources.getString(R.string.message_crash_logged, AppPaths.appLogFile().absolutePath) | 97 | resources.getString(R.string.message_crash_logged, AppPaths.appLogFile().absolutePath) |
98 | ).joinToString("\n\n")) | 98 | ).joinToString("\n\n")) |
99 | .setNeutralButton(R.string.action_send_report, { _, _ -> | 99 | .setNeutralButton(R.string.action_send_report) { _, _ -> |
100 | App.sendMail( | 100 | App.sendMail( |
101 | resources.getString(R.string.app_dev_email), | 101 | resources.getString(R.string.app_dev_email), |
102 | listOf(R.string.app_name, R.string.title_app_crash).joinToString(" / ", transform = resources::getString), | 102 | listOf(R.string.app_name, R.string.title_app_crash).joinToString(" / ", transform = resources::getString), |
103 | AppPaths.appLogFile().let { if (it.exists()) it.readText() else "" }) | 103 | AppPaths.appLogFile().let { if (it.exists()) it.readText() else "" }) |
104 | }) | 104 | } |
105 | .setPositiveButton(R.string.action_close, { _, _ -> Unit }) | 105 | .setPositiveButton(R.string.action_close) { _, _ -> Unit } |
106 | .show() | 106 | .show() |
107 | } | 107 | } |
108 | 108 | ||
@@ -111,5 +111,5 @@ abstract class BaseActivity : AppCompatActivity() { | |||
111 | protected fun showProgressDialog(@StringRes msg: Int): AlertDialog = ProgressModal.show(this, getString(msg)) | 111 | protected fun showProgressDialog(@StringRes msg: Int): AlertDialog = ProgressModal.show(this, getString(msg)) |
112 | protected fun showErrorDialog(msg: String): AlertDialog = AlertDialog.Builder(this) | 112 | protected fun showErrorDialog(msg: String): AlertDialog = AlertDialog.Builder(this) |
113 | .setTitle(R.string.title_error).setMessage(msg) | 113 | .setTitle(R.string.title_error).setMessage(msg) |
114 | .setPositiveButton(R.string.action_close, { _, _ -> Unit }).show() | 114 | .setPositiveButton(R.string.action_close) { _, _ -> Unit }.show() |
115 | } | 115 | } |
diff --git a/app/src/main/java/org/pacien/tincapp/activities/ConfigureActivity.kt b/app/src/main/java/org/pacien/tincapp/activities/ConfigureActivity.kt index 45a29bf..f823691 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/ConfigureActivity.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/ConfigureActivity.kt | |||
@@ -76,7 +76,7 @@ class ConfigureActivity : BaseActivity() { | |||
76 | genDialog.new_net_name.text.toString(), | 76 | genDialog.new_net_name.text.toString(), |
77 | genDialog.new_node_name.text.toString(), | 77 | genDialog.new_node_name.text.toString(), |
78 | genDialog.new_passphrase.text.toString()) | 78 | genDialog.new_passphrase.text.toString()) |
79 | }.setNegativeButton(R.string.action_cancel, { _, _ -> Unit }).show() | 79 | }.setNegativeButton(R.string.action_cancel) { _, _ -> Unit }.show() |
80 | } | 80 | } |
81 | 81 | ||
82 | fun openJoinNetworkDialog(@Suppress("UNUSED_PARAMETER") v: View) { | 82 | fun openJoinNetworkDialog(@Suppress("UNUSED_PARAMETER") v: View) { |
@@ -87,7 +87,7 @@ class ConfigureActivity : BaseActivity() { | |||
87 | joinDialog!!.net_name.text.toString(), | 87 | joinDialog!!.net_name.text.toString(), |
88 | joinDialog!!.invitation_url.text.toString(), | 88 | joinDialog!!.invitation_url.text.toString(), |
89 | joinDialog!!.join_passphrase.text.toString()) | 89 | joinDialog!!.join_passphrase.text.toString()) |
90 | }.setNegativeButton(R.string.action_cancel, { _, _ -> Unit }).show() | 90 | }.setNegativeButton(R.string.action_cancel) { _, _ -> Unit }.show() |
91 | } | 91 | } |
92 | 92 | ||
93 | fun openEncryptDecryptPrivateKeyDialog(@Suppress("UNUSED_PARAMETER") v: View) { | 93 | fun openEncryptDecryptPrivateKeyDialog(@Suppress("UNUSED_PARAMETER") v: View) { |
@@ -98,7 +98,7 @@ class ConfigureActivity : BaseActivity() { | |||
98 | encryptDecryptDialog!!.enc_dec_net_name.text.toString(), | 98 | encryptDecryptDialog!!.enc_dec_net_name.text.toString(), |
99 | encryptDecryptDialog.enc_dec_current_passphrase.text.toString(), | 99 | encryptDecryptDialog.enc_dec_current_passphrase.text.toString(), |
100 | encryptDecryptDialog.enc_dec_new_passphrase.text.toString()) | 100 | encryptDecryptDialog.enc_dec_new_passphrase.text.toString()) |
101 | }.setNegativeButton(R.string.action_cancel, { _, _ -> Unit }).show() | 101 | }.setNegativeButton(R.string.action_cancel) { _, _ -> Unit }.show() |
102 | } | 102 | } |
103 | 103 | ||
104 | private fun writeContent() { | 104 | private fun writeContent() { |
diff --git a/app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt b/app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt index fbcde81..4be1609 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/StartActivity.kt | |||
@@ -68,7 +68,7 @@ class StartActivity : BaseActivity() { | |||
68 | } | 68 | } |
69 | 69 | ||
70 | override fun onRefresh() { | 70 | override fun onRefresh() { |
71 | val networks = AppPaths.confDir()?.list()?.toList() ?: emptyList() | 71 | val networks = AppPaths.confDir().list()?.toList() ?: emptyList() |
72 | runOnUiThread { | 72 | runOnUiThread { |
73 | networkListAdapter?.setElements(networks) | 73 | networkListAdapter?.setElements(networks) |
74 | setPlaceholderVisibility() | 74 | setPlaceholderVisibility() |
@@ -121,7 +121,7 @@ class StartActivity : BaseActivity() { | |||
121 | AlertDialog.Builder(this@StartActivity) | 121 | AlertDialog.Builder(this@StartActivity) |
122 | .setTitle(R.string.title_unlock_private_keys).setView(dialog) | 122 | .setTitle(R.string.title_unlock_private_keys).setView(dialog) |