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

[tor-commits] [orbot/master] enable selection of Snowflake from bridge wizard activity



commit bbe63e4ee5ebe1191c4c2a25ff343fa432f11a61
Author: n8fr8 <nathan@xxxxxxxxxxxxxxxxxxxx>
Date:   Tue Dec 8 20:38:00 2020 -0500

    enable selection of Snowflake from bridge wizard activity
---
 .../android/ui/onboarding/BridgeWizardActivity.java           | 11 +++++++++++
 app/src/main/res/layout/content_bridge_wizard.xml             |  7 +++++++
 app/src/main/res/values/strings.xml                           |  1 +
 3 files changed, 19 insertions(+)

diff --git a/app/src/main/java/org/torproject/android/ui/onboarding/BridgeWizardActivity.java b/app/src/main/java/org/torproject/android/ui/onboarding/BridgeWizardActivity.java
index 8a359b1b..465d8c58 100644
--- a/app/src/main/java/org/torproject/android/ui/onboarding/BridgeWizardActivity.java
+++ b/app/src/main/java/org/torproject/android/ui/onboarding/BridgeWizardActivity.java
@@ -41,6 +41,7 @@ public class BridgeWizardActivity extends AppCompatActivity {
     private RadioButton mBtObfs4;
     private RadioButton mBtMeek;
     private RadioButton mBtCustom;
+    private RadioButton mBtSnowflake;
     private View mBtnConfgiureCustomBridges;
 
     @SuppressWarnings("SameParameterValue")
@@ -125,6 +126,14 @@ public class BridgeWizardActivity extends AppCompatActivity {
             testBridgeConnection();
         });
 
+        mBtSnowflake = findViewById(R.id.btnBridgesSnowflake);
+        mBtSnowflake.setOnCheckedChangeListener((buttonView, isChecked) -> {
+            if (!isChecked) return;
+            cancelHostTestIfRunning();
+            Prefs.setBridgesList("snowflake");
+            Prefs.putBridgesEnabled(true);
+        });
+
         mBtCustom = findViewById(R.id.btnCustomBridges);
         mBtCustom.setOnCheckedChangeListener((buttonView, isChecked) -> {
             if (isChecked) {
@@ -249,6 +258,8 @@ public class BridgeWizardActivity extends AppCompatActivity {
             mBtMeek.setChecked(true);
         } else if (Prefs.getBridgesList().equals("obfs4")) {
             mBtObfs4.setChecked(true);
+        } else if (Prefs.getBridgesList().equals("snowflake")) {
+            mBtSnowflake.setChecked(true);
         } else {
             mBtCustom.setChecked(true);
         }
diff --git a/app/src/main/res/layout/content_bridge_wizard.xml b/app/src/main/res/layout/content_bridge_wizard.xml
index 0b75ffa4..d5bdea3d 100644
--- a/app/src/main/res/layout/content_bridge_wizard.xml
+++ b/app/src/main/res/layout/content_bridge_wizard.xml
@@ -58,6 +58,13 @@
                 android:layout_margin="12dp"
                 android:text="@string/bridge_cloud" />
 
+            <RadioButton
+                android:id="@+id/btnBridgesSnowflake"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="12dp"
+                android:text="@string/bridge_snowflake" />
+
             <RadioButton
                 android:id="@+id/btnCustomBridges"
                 android:layout_width="wrap_content"
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 1c5d2425..8f8cbbf2 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -253,4 +253,5 @@
     <string name="in_a_browser">In a browser, visit %s and tap "Get Bridges" > "Just Give Me Bridges!"</string>
     <string name="paste_bridges">Paste Bridges</string>
     <string name="use_qr_code">Use QR Code</string>
+    <string name="bridge_snowflake">Connect through other Tor peers (experimental)</string>
 </resources>



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