Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
From e006e215b274b1b834e098b199ea2697bc11b0f1 Mon Sep 17 00:00:00 2001
From: Georg Koppen <gk@torproject.org>
Date: Sun, 10 May 2020 08:29:10 +0000
Subject: [PATCH] Bug 30318: Add snowflake support
diff --git a/android/build.gradle b/android/build.gradle
index a8d9bdc..2392731 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -93,6 +93,9 @@ task copyPluggableTransports(type: Copy) {
rename { filename ->
filename.replace 'obfs4proxy', 'libObfs4proxy.so'
}
+ rename { filename ->
+ filename.replace 'snowflake-client', 'libSnowflake.so'
+ }
}
gradle.projectsEvaluated {
diff --git a/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java b/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java
index 2405097..bcb6a37 100644
--- a/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java
+++ b/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java
@@ -109,22 +109,33 @@ public final class TorConfigBuilder {
return this;
}
- public TorConfigBuilder configurePluggableTransportsFromSettings(File pluggableTransportClient) throws IOException {
- if (pluggableTransportClient == null) {
+ public TorConfigBuilder configurePluggableTransportsFromSettings(File pluggableTransportObfs, File pluggableTransportSnow) throws IOException {
+ if (pluggableTransportObfs == null || pluggableTransportSnow == null) {
return this;
}
- if (!pluggableTransportClient.exists()) {
- throw new IOException("Bridge binary does not exist: " + pluggableTransportClient
+ if (!pluggableTransportObfs.exists()) {
+ throw new IOException("Obfs4proxy binary does not exist: " + pluggableTransportObfs
.getCanonicalPath());
}
- if (!pluggableTransportClient.canExecute()) {
- throw new IOException("Bridge binary is not executable: " + pluggableTransportClient
+ if (!pluggableTransportSnow.exists()) {
+ throw new IOException("Snowflake binary does not exist: " + pluggableTransportSnow
.getCanonicalPath());
}
- transportPlugin(pluggableTransportClient.getCanonicalPath());
+ if (!pluggableTransportObfs.canExecute()) {
+ throw new IOException("Obfs4proxy binary is not executable: " + pluggableTransportObfs
+ .getCanonicalPath());
+ }
+
+ if (!pluggableTransportSnow.canExecute()) {
+ throw new IOException("Snowflake binary is not executable: " + pluggableTransportSnow
+ .getCanonicalPath());
+ }
+
+
+ transportPlugin(pluggableTransportObfs.getCanonicalPath(), pluggableTransportSnow.getCanonicalPath());
return this;
}
@@ -491,8 +502,9 @@ public final class TorConfigBuilder {
return transPort(settings.transPort());
}
- public TorConfigBuilder transportPlugin(String clientPath) {
- buffer.append("ClientTransportPlugin meek_lite,obfs3,obfs4 exec ").append(clientPath).append('\n');
+ public TorConfigBuilder transportPlugin(String obfsPath, String snowPath) {
+ buffer.append("ClientTransportPlugin meek_lite,obfs3,obfs4 exec ").append(obfsPath).append('\n');
+ buffer.append("ClientTransportPlugin snowflake exec ").append(snowPath).append('\n');
return this;
}
@@ -557,6 +569,9 @@ public final class TorConfigBuilder {
case 3:
reqBridgeType = "meek_lite";
break;
+ case 4:
+ reqBridgeType = "snowflake";
+ break;
default:
throw new IOException("Requested unknown transport type: " + bridgesType);
}
--
2.26.2