From 7a9ad4720b87b71b003e05c3b396b0d2c72f7b1a Mon Sep 17 00:00:00 2001 From: arrase Date: Mon, 28 Nov 2016 22:06:09 +0100 Subject: [PATCH] non perfect but better option to start/stop --- .../java/org/torproject/android/OrbotMainActivity.java | 9 ++++++++- app/src/main/res/values/strings.xml | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/torproject/android/OrbotMainActivity.java b/app/src/main/java/org/torproject/android/OrbotMainActivity.java index 8e03f56f..aeb4a18a 100644 --- a/app/src/main/java/org/torproject/android/OrbotMainActivity.java +++ b/app/src/main/java/org/torproject/android/OrbotMainActivity.java @@ -602,7 +602,14 @@ public class OrbotMainActivity extends AppCompatActivity hsutils.restoreKeyBackup(hsPort, hsKeyPath); } - startTor(); + if (torStatus.equals(TorServiceConstants.STATUS_OFF)) { + startTor(); + } else { + stopTor(); + Toast.makeText( + this, R.string.start_tor_again_for_finish_the_process, Toast.LENGTH_LONG + ).show(); + } new Thread() { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 656a3dd0..bab15f14 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -351,4 +351,5 @@ Restore Backup Create a backup first Name can\'t be empty + Start Tor again for finish the process