renable polipo

This commit is contained in:
Nathan Freitas 2016-09-23 11:01:20 -04:00
parent 90d77ce4be
commit d56fdb20aa
2 changed files with 10 additions and 3 deletions

View File

@ -20,6 +20,7 @@ android {
dependencies { dependencies {
compile 'com.android.support:appcompat-v7:23.+' compile 'com.android.support:appcompat-v7:23.+'
// compile group: 'org.littleshoot', name: 'littleproxy', version: '1.1.0-beta1'
compile fileTree(dir: 'libs', include: ['*.jar']) compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

View File

@ -54,6 +54,7 @@ import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.PrintStream; import java.io.PrintStream;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.Proxy; import java.net.Proxy;
import java.net.Socket; import java.net.Socket;
@ -69,12 +70,15 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Properties; import java.util.Properties;
import java.util.Queue;
import java.util.Set; import java.util.Set;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeoutException;
import javax.net.ssl.SSLEngine;
public class TorService extends Service implements TorServiceConstants, OrbotConstants, EventHandler public class TorService extends Service implements TorServiceConstants, OrbotConstants, EventHandler
{ {
@ -86,6 +90,7 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
private Socket torConnSocket = null; private Socket torConnSocket = null;
private int mLastProcessId = -1; private int mLastProcessId = -1;
private int mPortHTTP = HTTP_PROXY_PORT_DEFAULT; private int mPortHTTP = HTTP_PROXY_PORT_DEFAULT;
private int mPortSOCKS = SOCKS_PROXY_PORT_DEFAULT; private int mPortSOCKS = SOCKS_PROXY_PORT_DEFAULT;
@ -511,6 +516,7 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
Log.w(OrbotConstants.TAG,"could not kill polipo",e); Log.w(OrbotConstants.TAG,"could not kill polipo",e);
cannotKillFile = filePolipo; cannotKillFile = filePolipo;
} }
try { try {
TorServiceUtils.killProcess(fileTor); TorServiceUtils.killProcess(fileTor);
} catch (IOException e) { } catch (IOException e) {