summaryrefslogtreecommitdiff
path: root/app/src/main/java/se
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/se')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java2
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/tor/IPtProxyWrapper.java40
2 files changed, 42 insertions, 0 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java
index dcbe9636..9ba64b31 100644
--- a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java
+++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderAPI.java
@@ -39,6 +39,7 @@ import java.util.concurrent.LinkedBlockingQueue;
import se.leap.bitmaskclient.base.utils.PreferenceHelper;
import se.leap.bitmaskclient.providersetup.connectivity.OkHttpClientGenerator;
+import se.leap.bitmaskclient.tor.IPtProxyWrapper;
import se.leap.bitmaskclient.tor.TorNotificationManager;
import se.leap.bitmaskclient.tor.TorStatusObservable;
@@ -202,6 +203,7 @@ public class ProviderAPI extends JobIntentService implements ProviderApiManagerB
try {
if (torServiceConnection == null) {
Log.d(TAG, "serviceConnection is still null");
+ TorService.setIPtProxy(new IPtProxyWrapper());
torServiceConnection = new TorServiceConnection(context);
}
} catch (InterruptedException | IllegalStateException e) {
diff --git a/app/src/main/java/se/leap/bitmaskclient/tor/IPtProxyWrapper.java b/app/src/main/java/se/leap/bitmaskclient/tor/IPtProxyWrapper.java
new file mode 100644
index 00000000..c7ca165e
--- /dev/null
+++ b/app/src/main/java/se/leap/bitmaskclient/tor/IPtProxyWrapper.java
@@ -0,0 +1,40 @@
+package se.leap.bitmaskclient.tor;
+
+import IPtProxy.IPtProxy;
+
+public class IPtProxyWrapper implements IPtProxyInterface {
+ @Override
+ public void setStateLocation(String location) {
+ IPtProxy.setStateLocation(location);
+ }
+
+ @Override
+ public String getStateLocation() {
+ return IPtProxy.getStateLocation();
+ }
+
+ @Override
+ public long snowflakePort() {
+ return IPtProxy.snowflakePort();
+ }
+
+ @Override
+ public long startSnowflake(String ice, String url, String front, String logFile, boolean logToStateDir, boolean keepLocalAddresses, boolean unsafeLogging, long maxPeers) {
+ return IPtProxy.startSnowflake(ice, url, front, logFile, logToStateDir, keepLocalAddresses, unsafeLogging, maxPeers);
+ }
+
+ @Override
+ public void startSnowflakeProxy(long capacity, String broker, String relay, String stun, String logFile, boolean keepLocalAddresses, boolean unsafeLogging) {
+ IPtProxy.startSnowflakeProxy(capacity, broker, relay, stun, logFile, keepLocalAddresses, unsafeLogging);
+ }
+
+ @Override
+ public void stopSnowflake() {
+ IPtProxy.stopSnowflake();
+ }
+
+ @Override
+ public void stopSnowflakeProxy() {
+ IPtProxy.stopSnowflakeProxy();
+ }
+}