|
1
|
+From edf4337158df11da3b6ef6d30050e2441cfeafeb Mon Sep 17 00:00:00 2001
|
|
2
|
+From: Cecylia Bocovich <cohosh@xxxxxxxxxxxxxx>
|
|
3
|
+Date: Thu, 13 Oct 2022 10:20:59 -0400
|
|
4
|
+Subject: [PATCH] Bug 41361: Add conjure support
|
|
5
|
+
|
|
6
|
+---
|
|
7
|
+ android/build.gradle | 3 +++
|
|
8
|
+ .../thali/toronionproxy/TorConfigBuilder.java | 18 ++++++++++++++----
|
|
9
|
+ 2 files changed, 17 insertions(+), 4 deletions(-)
|
|
10
|
+
|
|
11
|
+diff --git a/android/build.gradle b/android/build.gradle
|
|
12
|
+index 2392731..b1aca0a 100644
|
|
13
|
+--- a/android/build.gradle
|
|
14
|
++++ b/android/build.gradle
|
|
15
|
+@@ -96,6 +96,9 @@ task copyPluggableTransports(type: Copy) {
|
|
16
|
+ rename { filename ->
|
|
17
|
+ filename.replace 'snowflake-client', 'libSnowflake.so'
|
|
18
|
+ }
|
|
19
|
++ rename { filename ->
|
|
20
|
++ filename.replace 'conjure-client', 'libConjure.so'
|
|
21
|
++ }
|
|
22
|
+ }
|
|
23
|
+
|
|
24
|
+ gradle.projectsEvaluated {
|
|
25
|
+diff --git a/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java b/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java
|
|
26
|
+index cc10783..c7e20c0 100644
|
|
27
|
+--- a/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java
|
|
28
|
++++ b/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java
|
|
29
|
+@@ -109,8 +109,8 @@ public final class TorConfigBuilder {
|
|
30
|
+ return this;
|
|
31
|
+ }
|
|
32
|
+
|
|
33
|
+- public TorConfigBuilder configurePluggableTransportsFromSettings(File pluggableTransportObfs, File pluggableTransportSnow) throws IOException {
|
|
34
|
+- if (pluggableTransportObfs == null || pluggableTransportSnow == null) {
|
|
35
|
++ public TorConfigBuilder configurePluggableTransportsFromSettings(File pluggableTransportObfs, File pluggableTransportSnow, File pluggableTransportConjure) throws IOException {
|
|
36
|
++ if (pluggableTransportObfs == null || pluggableTransportSnow == null || pluggableTransportConjure == null) {
|
|
37
|
+ return this;
|
|
38
|
+ }
|
|
39
|
+
|
|
40
|
+@@ -124,6 +124,11 @@ public final class TorConfigBuilder {
|
|
41
|
+ .getCanonicalPath());
|
|
42
|
+ }
|
|
43
|
+
|
|
44
|
++ if (!pluggableTransportConjure.exists()) {
|
|
45
|
++ throw new IOException("Conjure binary does not exist: " + pluggableTransportConjure
|
|
46
|
++ .getCanonicalPath());
|
|
47
|
++ }
|
|
48
|
++
|
|
49
|
+ if (!pluggableTransportObfs.canExecute()) {
|
|
50
|
+ throw new IOException("Obfs4proxy binary is not executable: " + pluggableTransportObfs
|
|
51
|
+ .getCanonicalPath());
|
|
52
|
+@@ -134,8 +139,12 @@ public final class TorConfigBuilder {
|
|
53
|
+ .getCanonicalPath());
|
|
54
|
+ }
|
|
55
|
+
|
|
56
|
++ if (!pluggableTransportConjure.canExecute()) {
|
|
57
|
++ throw new IOException("Conjure binary is not executable: " + pluggableTransportConjure
|
|
58
|
++ .getCanonicalPath());
|
|
59
|
++ }
|
|
60
|
+
|
|
61
|
+- transportPlugin(pluggableTransportObfs.getCanonicalPath(), pluggableTransportSnow.getCanonicalPath());
|
|
62
|
++ transportPlugin(pluggableTransportObfs.getCanonicalPath(), pluggableTransportSnow.getCanonicalPath(), pluggableTransportConjure.getCanonicalPath());
|
|
63
|
+ return this;
|
|
64
|
+ }
|
|
65
|
+
|
|
66
|
+@@ -502,9 +511,10 @@ public final class TorConfigBuilder {
|
|
67
|
+ return transPort(settings.transPort());
|
|
68
|
+ }
|
|
69
|
+
|
|
70
|
+- public TorConfigBuilder transportPlugin(String obfsPath, String snowPath) {
|
|
71
|
++ public TorConfigBuilder transportPlugin(String obfsPath, String snowPath, String conjurePath) {
|
|
72
|
+ buffer.append("ClientTransportPlugin meek_lite,obfs3,obfs4 exec ").append(obfsPath).append('\n');
|
|
73
|
+ buffer.append("ClientTransportPlugin snowflake exec ").append(snowPath).append(" -url https://snowflake-broker.torproject.net.global.prod.fastly.net/ -front cdn.sstatic.net -ice stun:stun.l.google.com:19302,stun:stun.voip.blackberry.com:3478,stun:stun.altar.com.pl:3478,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.com:3478,stun:stun.sonetel.net:3478,stun:stun.stunprotocol.org:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478\n");
|
|
74
|
++ buffer.append("ClientTransportPlugin conjure exec ").append(conjurePath).append(" -registerURL https://registration.refraction.network/api\n");
|
|
75
|
+ return this;
|
|
76
|
+ }
|
|
77
|
+
|
|
78
|
+--
|
|
79
|
+2.37.2
|
|
80
|
+ |