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
From edf4337158df11da3b6ef6d30050e2441cfeafeb Mon Sep 17 00:00:00 2001
From: Cecylia Bocovich <cohosh@torproject.org>
Date: Thu, 13 Oct 2022 10:20:59 -0400
Subject: [PATCH] Bug 41361: Add conjure support
---
android/build.gradle | 3 +++
.../thali/toronionproxy/TorConfigBuilder.java | 18 ++++++++++++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/android/build.gradle b/android/build.gradle
index 2392731..b1aca0a 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -96,6 +96,9 @@ task copyPluggableTransports(type: Copy) {
rename { filename ->
filename.replace 'snowflake-client', 'libSnowflake.so'
}
+ rename { filename ->
+ filename.replace 'conjure-client', 'libConjure.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 cc10783..c7e20c0 100644
--- a/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java
+++ b/universal/src/main/java/com/msopentech/thali/toronionproxy/TorConfigBuilder.java
@@ -109,8 +109,8 @@ public final class TorConfigBuilder {
return this;
}
- public TorConfigBuilder configurePluggableTransportsFromSettings(File pluggableTransportObfs, File pluggableTransportSnow) throws IOException {
- if (pluggableTransportObfs == null || pluggableTransportSnow == null) {
+ public TorConfigBuilder configurePluggableTransportsFromSettings(File pluggableTransportObfs, File pluggableTransportSnow, File pluggableTransportConjure) throws IOException {
+ if (pluggableTransportObfs == null || pluggableTransportSnow == null || pluggableTransportConjure == null) {
return this;
}
@@ -124,6 +124,11 @@ public final class TorConfigBuilder {
.getCanonicalPath());
}
+ if (!pluggableTransportConjure.exists()) {
+ throw new IOException("Conjure binary does not exist: " + pluggableTransportConjure
+ .getCanonicalPath());
+ }
+
if (!pluggableTransportObfs.canExecute()) {
throw new IOException("Obfs4proxy binary is not executable: " + pluggableTransportObfs
.getCanonicalPath());
@@ -134,8 +139,12 @@ public final class TorConfigBuilder {
.getCanonicalPath());
}
+ if (!pluggableTransportConjure.canExecute()) {
+ throw new IOException("Conjure binary is not executable: " + pluggableTransportConjure
+ .getCanonicalPath());
+ }
- transportPlugin(pluggableTransportObfs.getCanonicalPath(), pluggableTransportSnow.getCanonicalPath());
+ transportPlugin(pluggableTransportObfs.getCanonicalPath(), pluggableTransportSnow.getCanonicalPath(), pluggableTransportConjure.getCanonicalPath());
return this;
}
@@ -502,9 +511,10 @@ public final class TorConfigBuilder {
return transPort(settings.transPort());
}
- public TorConfigBuilder transportPlugin(String obfsPath, String snowPath) {
+ public TorConfigBuilder transportPlugin(String obfsPath, String snowPath, String conjurePath) {
buffer.append("ClientTransportPlugin meek_lite,obfs3,obfs4 exec ").append(obfsPath).append('\n');
buffer.append("ClientTransportPlugin snowflake exec ").append(snowPath).append('\n');
+ buffer.append("ClientTransportPlugin conjure exec ").append(conjurePath).append(" -registerURL https://registration.refraction.network/api\n");
return this;
}
--
2.37.2