added LOG_OUTPUT_TO_DEBUG variable for compile time on/off of log output to Android stdout
svn:r23157
This commit is contained in:
parent
9bedc470dd
commit
9bf8568681
|
@ -61,7 +61,6 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
|
||||||
Log.d(TAG,"TorService: onCreate");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -73,7 +72,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
|
|
||||||
if (procId != -1)
|
if (procId != -1)
|
||||||
{
|
{
|
||||||
Log.d(TAG,"Found existing Tor process");
|
logNotice("Found existing Tor process");
|
||||||
|
|
||||||
sendCallbackLogMessage ("found existing Tor process...");
|
sendCallbackLogMessage ("found existing Tor process...");
|
||||||
|
|
||||||
|
@ -111,7 +110,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
public void onLowMemory() {
|
public void onLowMemory() {
|
||||||
super.onLowMemory();
|
super.onLowMemory();
|
||||||
|
|
||||||
Log.d(TAG, "Low Memory Called");
|
logNotice( "Low Memory Warning!");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +120,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
*/
|
*/
|
||||||
public boolean onUnbind(Intent intent) {
|
public boolean onUnbind(Intent intent) {
|
||||||
|
|
||||||
Log.d(TAG, "onUnbind Called: " + intent.getAction());
|
// logNotice( "onUnbind Called: " + intent.getAction());
|
||||||
|
|
||||||
isBound = false;
|
isBound = false;
|
||||||
|
|
||||||
|
@ -213,9 +212,6 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
// Unregister all callbacks.
|
// Unregister all callbacks.
|
||||||
mCallbacks.kill();
|
mCallbacks.kill();
|
||||||
|
|
||||||
|
|
||||||
Log.d(TAG,"onDestroy called");
|
|
||||||
|
|
||||||
stopTor();
|
stopTor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,7 +273,6 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
logNotice("sending SHUTDOWN signal to Tor process");
|
logNotice("sending SHUTDOWN signal to Tor process");
|
||||||
// conn.shutdownTor(arg0)
|
|
||||||
conn.signal("SHUTDOWN");
|
conn.signal("SHUTDOWN");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d(TAG,"error shutting down Tor via connection",e);
|
Log.d(TAG,"error shutting down Tor via connection",e);
|
||||||
|
@ -305,7 +300,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
while (procId != -1)
|
while (procId != -1)
|
||||||
{
|
{
|
||||||
|
|
||||||
Log.d(TAG,"Found Privoxy PID=" + procId + " - killing now...");
|
logNotice("Found Privoxy PID=" + procId + " - killing now...");
|
||||||
String[] cmd = { SHELL_CMD_KILL + ' ' + procId + "" };
|
String[] cmd = { SHELL_CMD_KILL + ' ' + procId + "" };
|
||||||
|
|
||||||
TorServiceUtils.doShellCommand(cmd,log, false, false);
|
TorServiceUtils.doShellCommand(cmd,log, false, false);
|
||||||
|
@ -317,10 +312,13 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
|
|
||||||
private void logNotice (String msg)
|
private void logNotice (String msg)
|
||||||
{
|
{
|
||||||
|
if (msg != null && msg.trim().length() > 0)
|
||||||
|
{
|
||||||
|
if (LOG_OUTPUT_TO_DEBUG)
|
||||||
|
Log.d(TAG, msg);
|
||||||
|
|
||||||
Log.d(TAG, msg);
|
sendCallbackLogMessage(msg);
|
||||||
sendCallbackLogMessage(msg);
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String findAPK ()
|
private String findAPK ()
|
||||||
|
@ -333,7 +331,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
int MAX_TRIES = 10;
|
int MAX_TRIES = 10;
|
||||||
|
|
||||||
String buildPath = apkBase + TOR_APP_USERNAME + APK_EXT;
|
String buildPath = apkBase + TOR_APP_USERNAME + APK_EXT;
|
||||||
Log.d(TAG, "Checking APK location: " + buildPath);
|
logNotice("Checking APK location: " + buildPath);
|
||||||
|
|
||||||
File fileApk = new File(buildPath);
|
File fileApk = new File(buildPath);
|
||||||
|
|
||||||
|
@ -345,7 +343,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
buildPath = apkBase + TOR_APP_USERNAME + '-' + i + APK_EXT;
|
buildPath = apkBase + TOR_APP_USERNAME + '-' + i + APK_EXT;
|
||||||
fileApk = new File(buildPath);
|
fileApk = new File(buildPath);
|
||||||
|
|
||||||
Log.d(TAG, "Checking APK location: " + buildPath);
|
logNotice( "Checking APK location: " + buildPath);
|
||||||
|
|
||||||
if (fileApk.exists())
|
if (fileApk.exists())
|
||||||
return fileApk.getAbsolutePath();
|
return fileApk.getAbsolutePath();
|
||||||
|
@ -357,7 +355,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
buildPath = apkBaseExt + pkgFile;
|
buildPath = apkBaseExt + pkgFile;
|
||||||
fileApk = new File(buildPath);
|
fileApk = new File(buildPath);
|
||||||
|
|
||||||
Log.d(TAG, "Checking external storage APK location: " + buildPath);
|
logNotice( "Checking external storage APK location: " + buildPath);
|
||||||
|
|
||||||
if (fileApk.exists())
|
if (fileApk.exists())
|
||||||
return fileApk.getAbsolutePath();
|
return fileApk.getAbsolutePath();
|
||||||
|
@ -367,7 +365,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
buildPath = apkBaseExt + '-' + i + pkgFile;
|
buildPath = apkBaseExt + '-' + i + pkgFile;
|
||||||
fileApk = new File(buildPath);
|
fileApk = new File(buildPath);
|
||||||
|
|
||||||
Log.d(TAG, "Checking external storage APK location: " + buildPath);
|
logNotice( "Checking external storage APK location: " + buildPath);
|
||||||
|
|
||||||
if (fileApk.exists())
|
if (fileApk.exists())
|
||||||
return fileApk.getAbsolutePath();
|
return fileApk.getAbsolutePath();
|
||||||
|
@ -381,16 +379,16 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
Log.d(TAG,"checking Tor binaries");
|
logNotice( "checking Tor binaries");
|
||||||
|
|
||||||
//appHome = getApplicationContext().getFilesDir().getAbsolutePath();
|
//appHome = getApplicationContext().getFilesDir().getAbsolutePath();
|
||||||
appHome = "/data/data/" + TOR_APP_USERNAME + "/";
|
appHome = "/data/data/" + TOR_APP_USERNAME + "/";
|
||||||
|
|
||||||
Log.d(TAG,"appHome=" + appHome);
|
logNotice( "appHome=" + appHome);
|
||||||
|
|
||||||
String apkPath = findAPK();
|
String apkPath = findAPK();
|
||||||
|
|
||||||
Log.d(TAG,"found apk at: " + apkPath);
|
logNotice( "found apk at: " + apkPath);
|
||||||
|
|
||||||
boolean apkExists = new File(apkPath).exists();
|
boolean apkExists = new File(apkPath).exists();
|
||||||
|
|
||||||
|
@ -522,7 +520,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
String[] torCmd = {torBinaryPath + " -f " + torrcPath + " || exit\n"};
|
String[] torCmd = {torBinaryPath + " -f " + torrcPath + " || exit\n"};
|
||||||
TorServiceUtils.doShellCommand(torCmd, log, false, false);
|
TorServiceUtils.doShellCommand(torCmd, log, false, false);
|
||||||
|
|
||||||
Log.d(TAG,"Starting tor process: " + torCmd[0]);
|
logNotice( "Starting tor process: " + torCmd[0]);
|
||||||
|
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
int procId = TorServiceUtils.findProcessId(torBinaryPath);
|
int procId = TorServiceUtils.findProcessId(torBinaryPath);
|
||||||
|
@ -568,7 +566,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
private void runPrivoxyShellCmd () throws Exception
|
private void runPrivoxyShellCmd () throws Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
Log.d(TAG,"Starting privoxy process");
|
logNotice( "Starting privoxy process");
|
||||||
|
|
||||||
int privoxyProcId = TorServiceUtils.findProcessId(privoxyPath);
|
int privoxyProcId = TorServiceUtils.findProcessId(privoxyPath);
|
||||||
|
|
||||||
|
@ -630,7 +628,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.d(TAG,"Connecting to control port: " + TOR_CONTROL_PORT);
|
logNotice( "Connecting to control port: " + TOR_CONTROL_PORT);
|
||||||
|
|
||||||
String baseMessage = getString(R.string.tor_process_connecting);
|
String baseMessage = getString(R.string.tor_process_connecting);
|
||||||
sendCallbackStatusMessage(baseMessage);
|
sendCallbackStatusMessage(baseMessage);
|
||||||
|
@ -641,7 +639,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
|
|
||||||
sendCallbackStatusMessage(getString(R.string.tor_process_connecting_step2));
|
sendCallbackStatusMessage(getString(R.string.tor_process_connecting_step2));
|
||||||
|
|
||||||
Log.d(TAG,"SUCCESS connected to control port");
|
logNotice( "SUCCESS connected to control port");
|
||||||
|
|
||||||
String torAuthCookie = appHome + "data/control_auth_cookie";
|
String torAuthCookie = appHome + "data/control_auth_cookie";
|
||||||
|
|
||||||
|
@ -650,7 +648,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
new FileInputStream(new File(torAuthCookie)).read(cookie);
|
new FileInputStream(new File(torAuthCookie)).read(cookie);
|
||||||
conn.authenticate(cookie);
|
conn.authenticate(cookie);
|
||||||
|
|
||||||
Log.d(TAG,"SUCCESS authenticated to control port");
|
logNotice( "SUCCESS authenticated to control port");
|
||||||
|
|
||||||
sendCallbackStatusMessage(getString(R.string.tor_process_connecting_step2) + getString(R.string.tor_process_connecting_step3));
|
sendCallbackStatusMessage(getString(R.string.tor_process_connecting_step2) + getString(R.string.tor_process_connecting_step3));
|
||||||
|
|
||||||
|
@ -722,7 +720,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
// We extend NullEventHandler so that we don't need to provide empty
|
// We extend NullEventHandler so that we don't need to provide empty
|
||||||
// implementations for all the events we don't care about.
|
// implementations for all the events we don't care about.
|
||||||
// ...
|
// ...
|
||||||
Log.d(TAG,"adding control port event handler");
|
logNotice( "adding control port event handler");
|
||||||
|
|
||||||
conn.setEventHandler(this);
|
conn.setEventHandler(this);
|
||||||
|
|
||||||
|
@ -731,7 +729,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
// conn.setEvents(Arrays.asList(new String[]{
|
// conn.setEvents(Arrays.asList(new String[]{
|
||||||
// "DEBUG", "INFO", "NOTICE", "WARN", "ERR"}));
|
// "DEBUG", "INFO", "NOTICE", "WARN", "ERR"}));
|
||||||
|
|
||||||
Log.d(TAG,"SUCCESS added control port event handler");
|
logNotice( "SUCCESS added control port event handler");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -783,7 +781,7 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
|
|
||||||
public void message(String severity, String msg) {
|
public void message(String severity, String msg) {
|
||||||
|
|
||||||
Log.d(TAG, "[Tor Control Port] " + severity + ": " + msg);
|
logNotice( "[Tor Control Port] " + severity + ": " + msg);
|
||||||
|
|
||||||
if (msg.indexOf(TOR_CONTROL_PORT_MSG_BOOTSTRAP_DONE)!=-1)
|
if (msg.indexOf(TOR_CONTROL_PORT_MSG_BOOTSTRAP_DONE)!=-1)
|
||||||
{
|
{
|
||||||
|
@ -813,40 +811,46 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
|
|
||||||
public void orConnStatus(String status, String orName) {
|
public void orConnStatus(String status, String orName) {
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
if (LOG_OUTPUT_TO_DEBUG)
|
||||||
sb.append("orConnStatus (");
|
{
|
||||||
sb.append((orName) );
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("): ");
|
sb.append("orConnStatus (");
|
||||||
sb.append(status);
|
sb.append((orName) );
|
||||||
|
sb.append("): ");
|
||||||
|
sb.append(status);
|
||||||
|
|
||||||
logNotice(sb.toString());
|
logNotice(sb.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void streamStatus(String status, String streamID, String target) {
|
public void streamStatus(String status, String streamID, String target) {
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
if (LOG_OUTPUT_TO_DEBUG)
|
||||||
sb.append("StreamStatus (");
|
{
|
||||||
sb.append((streamID));
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("): ");
|
sb.append("StreamStatus (");
|
||||||
sb.append(status);
|
sb.append((streamID));
|
||||||
|
sb.append("): ");
|
||||||
logNotice(sb.toString());
|
sb.append(status);
|
||||||
|
|
||||||
|
|
||||||
|
logNotice(sb.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void unrecognized(String type, String msg) {
|
public void unrecognized(String type, String msg) {
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
if (LOG_OUTPUT_TO_DEBUG)
|
||||||
sb.append("Message (");
|
{
|
||||||
sb.append(type);
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("): ");
|
sb.append("Message (");
|
||||||
sb.append(msg);
|
sb.append(type);
|
||||||
|
sb.append("): ");
|
||||||
logNotice(sb.toString());
|
sb.append(msg);
|
||||||
|
|
||||||
|
logNotice(sb.toString());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -865,17 +869,18 @@ public class TorService extends Service implements TorServiceConstants, Runnable
|
||||||
|
|
||||||
public void circuitStatus(String status, String circID, String path) {
|
public void circuitStatus(String status, String circID, String path) {
|
||||||
|
|
||||||
/*
|
if (LOG_OUTPUT_TO_DEBUG)
|
||||||
StringBuilder sb = new StringBuilder();
|
{
|
||||||
sb.append("Circuit (");
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append((circID));
|
sb.append("Circuit (");
|
||||||
sb.append("): ");
|
sb.append((circID));
|
||||||
sb.append(status);
|
sb.append("): ");
|
||||||
sb.append("; ");
|
sb.append(status);
|
||||||
sb.append(path);
|
sb.append("; ");
|
||||||
|
sb.append(path);
|
||||||
|
|
||||||
logNotice(sb.toString());
|
logNotice(sb.toString());
|
||||||
*/
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@ public interface TorServiceConstants {
|
||||||
|
|
||||||
public final static String TAG = "ORBOT";
|
public final static String TAG = "ORBOT";
|
||||||
|
|
||||||
|
public static boolean LOG_OUTPUT_TO_DEBUG = false;
|
||||||
|
|
||||||
public final static String TOR_APP_USERNAME = "org.torproject.android";
|
public final static String TOR_APP_USERNAME = "org.torproject.android";
|
||||||
|
|
||||||
public final static String ASSETS_BASE = "assets/";
|
public final static String ASSETS_BASE = "assets/";
|
||||||
|
|
|
@ -12,6 +12,11 @@ import android.util.Log;
|
||||||
public class TorServiceUtils implements TorServiceConstants {
|
public class TorServiceUtils implements TorServiceConstants {
|
||||||
|
|
||||||
|
|
||||||
|
private static void logNotice (String msg)
|
||||||
|
{
|
||||||
|
if (LOG_OUTPUT_TO_DEBUG)
|
||||||
|
Log.d(TAG, msg);
|
||||||
|
}
|
||||||
|
|
||||||
public static int findProcessId(String command)
|
public static int findProcessId(String command)
|
||||||
{
|
{
|
||||||
|
@ -112,7 +117,7 @@ public class TorServiceUtils implements TorServiceConstants {
|
||||||
|
|
||||||
public static int doShellCommand(String[] cmds, StringBuilder log, boolean runAsRoot, boolean waitFor) throws Exception
|
public static int doShellCommand(String[] cmds, StringBuilder log, boolean runAsRoot, boolean waitFor) throws Exception
|
||||||
{
|
{
|
||||||
Log.d(TAG,"executing shell cmds: " + cmds[0] + "; runAsRoot=" + runAsRoot);
|
logNotice("executing shell cmds: " + cmds[0] + "; runAsRoot=" + runAsRoot);
|
||||||
|
|
||||||
|
|
||||||
Process proc = null;
|
Process proc = null;
|
||||||
|
@ -163,7 +168,7 @@ public class TorServiceUtils implements TorServiceConstants {
|
||||||
log.append(exitCode);
|
log.append(exitCode);
|
||||||
log.append("\n");
|
log.append("\n");
|
||||||
|
|
||||||
Log.d(TAG,"command process exit value: " + exitCode);
|
logNotice("command process exit value: " + exitCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,27 +5,17 @@ import org.torproject.android.TorifiedApp;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
public class TorTransProxy {
|
public class TorTransProxy implements TorServiceConstants {
|
||||||
|
|
||||||
private final static String TAG = TorServiceConstants.TAG;
|
private final static String TAG = TorServiceConstants.TAG;
|
||||||
|
|
||||||
|
|
||||||
//private static String BASE_DIR = "/data/data/" + TorServiceConstants.TOR_APP_USERNAME + "/";
|
//private static String BASE_DIR = "/data/data/" + TorServiceConstants.TOR_APP_USERNAME + "/";
|
||||||
|
|
||||||
/*
|
private static void logNotice (String msg)
|
||||||
private final static String CMD_NAT_FLUSH = "iptables -t nat -F || exit\n";
|
{
|
||||||
private final static String CMD_FILTER_FLUSH = "iptables -t filter -F || exit\n";
|
if (LOG_OUTPUT_TO_DEBUG)
|
||||||
|
Log.d(TAG, msg);
|
||||||
private final static String CMD_DNS_PROXYING_ADD = "iptables -t nat -A PREROUTING -p udp --dport 53 -j DNAT --to 127.0.0.1:5400 || exit\n";
|
}
|
||||||
|
|
||||||
private final static String IPTABLES_ADD = " -A ";
|
|
||||||
*/
|
|
||||||
|
|
||||||
//private final static String CMD_DNS_PROXYING_DELETE = "iptables -t nat -D PREROUTING -p udp --dport 53 -j DNAT --to 127.0.0.1:5400 || exit\n";
|
|
||||||
// - just calling a system wide flush of iptables rules
|
|
||||||
//private final static String IPTABLES_DELETE = " -D "; //not deleting manually anymore - just calling a system wide flush of iptables rules
|
|
||||||
// private final static String IPTABLES_DROP_ALL = " -j DROP ";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if we have root access
|
* Check if we have root access
|
||||||
* @return boolean true if we have root
|
* @return boolean true if we have root
|
||||||
|
@ -48,7 +38,8 @@ public class TorTransProxy {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(TAG,"Error checking for root access: " + e.getMessage() ,e);
|
Log.w(TAG,"Error checking for root access: " + e.getMessage() ,e);
|
||||||
}
|
}
|
||||||
Log.w(TAG, "Could not acquire root access: " + log.toString());
|
|
||||||
|
logNotice("Could not acquire root access: " + log.toString());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +58,7 @@ public class TorTransProxy {
|
||||||
String[] cmd = {"iptables -v"};
|
String[] cmd = {"iptables -v"};
|
||||||
int code = TorServiceUtils.doShellCommand(cmd, log, true, true);
|
int code = TorServiceUtils.doShellCommand(cmd, log, true, true);
|
||||||
String msg = log.toString();
|
String msg = log.toString();
|
||||||
Log.d(TAG,cmd[0] + ";errCode=" + code + ";resp=" + msg);
|
logNotice(cmd[0] + ";errCode=" + code + ";resp=" + msg);
|
||||||
|
|
||||||
|
|
||||||
String out = log.toString();
|
String out = log.toString();
|
||||||
|
@ -85,7 +76,7 @@ public class TorTransProxy {
|
||||||
Log.w(TAG,"Error checking iptables version: " + e.getMessage() ,e);
|
Log.w(TAG,"Error checking iptables version: " + e.getMessage() ,e);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w(TAG, "Could not acquire check iptables: " + log.toString());
|
logNotice("Could not acquire check iptables: " + log.toString());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +137,7 @@ public class TorTransProxy {
|
||||||
String[] cmd = {script.toString()};
|
String[] cmd = {script.toString()};
|
||||||
code = TorServiceUtils.doShellCommand(cmd, res, true, true);
|
code = TorServiceUtils.doShellCommand(cmd, res, true, true);
|
||||||
String msg = res.toString();
|
String msg = res.toString();
|
||||||
Log.d(TAG,cmd[0] + ";errCode=" + code + ";resp=" + msg);
|
logNotice(cmd[0] + ";errCode=" + code + ";resp=" + msg);
|
||||||
|
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
@ -163,7 +154,7 @@ public class TorTransProxy {
|
||||||
String baseDir = findBaseDir();
|
String baseDir = findBaseDir();
|
||||||
|
|
||||||
String iptablesVersion = getIPTablesVersion();
|
String iptablesVersion = getIPTablesVersion();
|
||||||
Log.d(TAG, "iptables version: " + iptablesVersion);
|
logNotice( "iptables version: " + iptablesVersion);
|
||||||
|
|
||||||
boolean ipTablesOld = false;
|
boolean ipTablesOld = false;
|
||||||
if (iptablesVersion != null && iptablesVersion.startsWith("1.3")){
|
if (iptablesVersion != null && iptablesVersion.startsWith("1.3")){
|
||||||
|
@ -208,7 +199,7 @@ public class TorTransProxy {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.d(TAG,"enabling transproxy for app: " + apps[i].getUsername() + "(" + apps[i].getUid() + ")");
|
logNotice("enabling transproxy for app: " + apps[i].getUsername() + "(" + apps[i].getUid() + ")");
|
||||||
|
|
||||||
//TCP
|
//TCP
|
||||||
script.append(baseDir);
|
script.append(baseDir);
|
||||||
|
@ -285,7 +276,7 @@ public class TorTransProxy {
|
||||||
String[] cmdAdd = {script.toString()};
|
String[] cmdAdd = {script.toString()};
|
||||||
code = TorServiceUtils.doShellCommand(cmdAdd, res, true, true);
|
code = TorServiceUtils.doShellCommand(cmdAdd, res, true, true);
|
||||||
String msg = res.toString();
|
String msg = res.toString();
|
||||||
Log.d(TAG,cmdAdd[0] + ";errCode=" + code + ";resp=" + msg);
|
logNotice(cmdAdd[0] + ";errCode=" + code + ";resp=" + msg);
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue