Skip to content

Commit

Permalink
Bug 30501: BridgesList Preferences is an overloaded field
Browse files Browse the repository at this point in the history
Bug 30767: Custom obfs4 bridge does not work on Tor Browser for Android
Bug 30552: Android - Clean up torrc

TOPL fixes thaliproject#133 fixes thaliproject#134

Bug 30552: Android - Clean up torrc

Builder fixes.
  • Loading branch information
sisbell committed Nov 1, 2019
1 parent 81e8962 commit d446255
Show file tree
Hide file tree
Showing 11 changed files with 596 additions and 219 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public TestTorInstaller(Context context, File configDir) {
}

@Override
public InputStream openBridgesStream() throws IOException {
public InputStream openDefaultBridgesStream() throws IOException {
return context.getResources().openRawResource(R.raw.bridges);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
* Installs Tor for an Android app. This is a wrapper around the <code>TorResourceInstaller</code>.
*
* Since this class only deals with installing Tor, it is up to the developer to implement
* the <code>openBridgesStream</code> which will give the bridges for pluggable transports. A
* the <code>openDefaultBridgesStream</code> which will give the bridges for pluggable transports. A
* typical implementation looks like:
*
* <code>
* public InputStream openBridgesStream() throws IOException {
* public InputStream openDefaultBridgesStream() throws IOException {
* return context.getResources().openRawResource(R.raw.bridges);
* }
* </code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ public void updateTorConfigCustom(String content) throws IOException, TimeoutExc
* TorSettings.hasBridges is flagged to false to avoid this method being called.
*/
@Override
public InputStream openBridgesStream() throws IOException {
public InputStream openDefaultBridgesStream() throws IOException {
throw new UnsupportedOperationException();
}

@Override
public boolean hasDefaultBridgesStream() {
return false;
}
}
2 changes: 1 addition & 1 deletion universal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies {
implementation 'org.slf4j:slf4j-api:1.7.25'
implementation 'net.freehaven.tor.control:jtorctl:0.2'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
testCompile group: 'org.mockito', name: 'mockito-core', version: '3.1.0'}

task sourcesJar(type:Jar){
from sourceSets.main.allSource
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.msopentech.thali.toronionproxy;

public enum BridgeType {
MEEK_LITE, OBFS3, OBFS4
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.msopentech.thali.toronionproxy;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
Expand All @@ -13,9 +13,18 @@ public boolean disableNetwork() {
return true;
}

public String getDnsHost() {
return null;
}

@Override
public String dnsPort() {
return "5400";
public Integer getDnsPort() {
return 5400;
}

@Override
public List<String> getCustomBridges() {
return Collections.emptyList();
}

@Override
Expand All @@ -39,13 +48,18 @@ public String getExitNodes() {
}

@Override
public int getHttpTunnelPort() {
return 8118;
public String getHttpTunnelHost() {
return null;
}

@Override
public Integer getHttpTunnelPort() {
return null;
}

@Override
public List<String> getListOfSupportedBridges() {
return new ArrayList<>();
public List<BridgeType> getBridgeTypes() {
return Collections.emptyList();
}

@Override
Expand All @@ -59,7 +73,7 @@ public String getProxyPassword() {
}

@Override
public String getProxyPort() {
public Integer getProxyPort() {
return null;
}

Expand All @@ -69,7 +83,7 @@ public String getProxySocks5Host() {
}

@Override
public String getProxySocks5ServerPort() {
public Integer getProxySocks5ServerPort() {
return null;
}

Expand All @@ -94,7 +108,7 @@ public String getRelayNickname() {
}

@Override
public int getRelayPort() {
public Integer getRelayPort() {
return 9001;
}

Expand Down Expand Up @@ -165,7 +179,7 @@ public boolean hasTestSocks() {

@Override
public boolean isAutomapHostsOnResolve() {
return true;
return false;
}

@Override
Expand All @@ -179,8 +193,13 @@ public boolean runAsDaemon() {
}

@Override
public String transPort() {
return "9040";
public String getTransparentProxyAddress() {
return null;
}

@Override
public Integer getTransparentProxyPort() {
return null;
}

@Override
Expand Down
Loading

0 comments on commit d446255

Please sign in to comment.