summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-11-11 23:30:32 +0100
committercyBerta <cyberta@riseup.net>2021-11-11 23:30:32 +0100
commit0728a708d8a4d7abc9cb28a0c19a8856b3b285d4 (patch)
tree26c1fc925b7e035f1ba299c730cfd2b4022c8c8f /app/src/main/java/se/leap
parenta917cbe977f640345677b97dc9b00900d78c46b3 (diff)
Check if snowflake stopped with an error. Change state to OFF in that case, too
Diffstat (limited to 'app/src/main/java/se/leap')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java b/app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java
index d426d51e..cde17c34 100644
--- a/app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java
+++ b/app/src/main/java/se/leap/bitmaskclient/tor/TorStatusObservable.java
@@ -1,13 +1,10 @@
package se.leap.bitmaskclient.tor;
import android.content.Context;
-import android.content.Intent;
import android.util.Log;
import androidx.annotation.Nullable;
-import org.torproject.jni.TorService;
-
import java.util.Observable;
import java.util.Observer;
import java.util.Vector;
@@ -45,7 +42,9 @@ public class TorStatusObservable extends Observable {
public static final String LOG_TAG_TOR = "[TOR]";
public static final String LOG_TAG_SNOWFLAKE = "[SNOWFLAKE]";
public static final String SNOWFLAKE_STARTED = "--- Starting Snowflake Client ---";
- public static final String SNOWFLAKE_STOPPED = "---- SnowflakeConn: end collecting snowflakes ---";
+ public static final String SNOWFLAKE_STOPPED_COLLECTING = "---- SnowflakeConn: end collecting snowflakes ---";
+ public static final String SNOWFLAKE_COPY_LOOP_STOPPED = "copy loop ended";
+ public static final String SNOWFLAKE_SOCKS_ERROR = "SOCKS accept error";
private static TorStatusObservable instance;
private TorStatus status = TorStatus.OFF;
@@ -117,7 +116,9 @@ public class TorStatusObservable extends Observable {
if (SNOWFLAKE_STARTED.equals(message.trim())) {
Log.d(TAG, "snowflakeStatus ON");
getInstance().snowflakeStatus = SnowflakeStatus.ON;
- } else if (SNOWFLAKE_STOPPED.equals(message.trim())) {
+ } else if (SNOWFLAKE_STOPPED_COLLECTING.equals(message.trim()) ||
+ SNOWFLAKE_COPY_LOOP_STOPPED.equals(message.trim()) ||
+ message.trim().contains(SNOWFLAKE_SOCKS_ERROR)) {
Log.d(TAG, "snowflakeStatus OFF");
getInstance().snowflakeStatus = SnowflakeStatus.OFF;
}