[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] non perfect but better option to start/stop



commit 7a9ad4720b87b71b003e05c3b396b0d2c72f7b1a
Author: arrase <arrase@xxxxxxxxx>
Date:   Mon Nov 28 22:06:09 2016 +0100

    non perfect but better option to start/stop
---
 app/src/main/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 8e03f56..aeb4a18 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 656a3dd..bab15f1 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -351,4 +351,5 @@
     <string name="restore_backup">Restore Backup</string>
     <string name="create_a_backup_first">Create a backup first</string>
     <string name="name_can_t_be_empty">Name can\'t be empty</string>
+    <string name="start_tor_again_for_finish_the_process">Start Tor again for finish the process</string>
 </resources>



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits