Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check OrbotService status, start Tor, if down, switch to Meek, when s…
…tarted, fetch CAPTCHA, as soon as done with that. Proxy Volley correctly. Improved option menu handling. Not working, yet: Tor doesn't come up. Why?
- Loading branch information
1 parent
e7cfe46
commit c026e20
Showing
3 changed files
with
141 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
app/src/main/java/org/torproject/android/ui/onboarding/ProxiedHurlStack.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* Copyright (c) 2020, Benjamin Erhart, Orbot / The Guardian Project - https://guardianproject.info */ | ||
/* See LICENSE for licensing information */ | ||
package org.torproject.android.ui.onboarding; | ||
|
||
import com.android.volley.toolbox.HurlStack; | ||
|
||
import java.io.IOException; | ||
import java.net.HttpURLConnection; | ||
import java.net.InetSocketAddress; | ||
import java.net.Proxy; | ||
import java.net.URL; | ||
|
||
@SuppressWarnings("WeakerAccess") | ||
public class ProxiedHurlStack extends HurlStack { | ||
|
||
private final String mHost; | ||
private final int mPort; | ||
|
||
public ProxiedHurlStack(String host, int port) { | ||
super(); | ||
|
||
mHost = host; | ||
mPort = port; | ||
} | ||
|
||
@Override | ||
protected HttpURLConnection createConnection(URL url) throws IOException { | ||
Proxy proxy = new Proxy(Proxy.Type.SOCKS, | ||
InetSocketAddress.createUnresolved(mHost, mPort)); | ||
|
||
return (HttpURLConnection) url.openConnection(proxy); | ||
} | ||
} |