[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r21749: {projects} added check for trans proxy preference (in projects/android/trunk/Orbot/src/org/torproject/android: . service)
Author: n8fr8
Date: 2010-02-24 05:09:24 +0000 (Wed, 24 Feb 2010)
New Revision: 21749
Modified:
projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java
projects/android/trunk/Orbot/src/org/torproject/android/TorConstants.java
projects/android/trunk/Orbot/src/org/torproject/android/service/TorRoot.java
Log:
added check for trans proxy preference
Modified: projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java
===================================================================
--- projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java 2010-02-24 05:09:05 UTC (rev 21748)
+++ projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java 2010-02-24 05:09:24 UTC (rev 21749)
@@ -63,8 +63,8 @@
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setTheme(android.R.style.Theme_Black);
- setTitle(getString(R.string.app_name) + ' ' + getString(R.string.app_version));
+ setTheme(android.R.style.Theme_Black_NoTitleBar);
+ //setTitle(getString(R.string.app_name) + ' ' + getString(R.string.app_version));
showMain();
}
@@ -328,7 +328,9 @@
boolean useBridges = prefs.getBoolean(PREF_BRIDGES_ENABLED, false);
boolean autoUpdateBridges = prefs.getBoolean(PREF_BRIDGES_UPDATED, false);
-
+
+ enableTransparentProxy = prefs.getBoolean(PREF_TRANSPARENT, false);
+
String bridgeList = prefs.getString(PREF_BRIDGES_LIST,"");
if (useBridges)
@@ -496,7 +498,7 @@
processSettings();
mService.setProfile(PROFILE_ON);
- if (hasRoot)
+ if (hasRoot && enableTransparentProxy)
{
TorRoot.enableDNSProxying();
TorRoot.enabledWebProxying();
@@ -507,7 +509,7 @@
mService.setProfile(PROFILE_ONDEMAND);
- if (hasRoot)
+ if (hasRoot && enableTransparentProxy)
{
TorRoot.purgeNatIptables();
}
@@ -606,6 +608,7 @@
boolean mIsBound = false;
boolean hasRoot = false;
+ boolean enableTransparentProxy = false;
private void bindService ()
{
Modified: projects/android/trunk/Orbot/src/org/torproject/android/TorConstants.java
===================================================================
--- projects/android/trunk/Orbot/src/org/torproject/android/TorConstants.java 2010-02-24 05:09:05 UTC (rev 21748)
+++ projects/android/trunk/Orbot/src/org/torproject/android/TorConstants.java 2010-02-24 05:09:24 UTC (rev 21749)
@@ -34,4 +34,7 @@
public final static String PREF_BRIDGES_ENABLED = "pref_bridges_enabled";
public final static String PREF_BRIDGES_UPDATED = "pref_bridges_enabled";
public final static String PREF_BRIDGES_LIST = "pref_bridges_list";
+ public final static String PREF_TRANSPARENT = "pref_transparent";
+
+
}
Modified: projects/android/trunk/Orbot/src/org/torproject/android/service/TorRoot.java
===================================================================
--- projects/android/trunk/Orbot/src/org/torproject/android/service/TorRoot.java 2010-02-24 05:09:05 UTC (rev 21748)
+++ projects/android/trunk/Orbot/src/org/torproject/android/service/TorRoot.java 2010-02-24 05:09:24 UTC (rev 21749)
@@ -5,6 +5,12 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
+import java.util.Iterator;
+import java.util.List;
+
+import android.content.Context;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
import android.util.Log;
/**
@@ -227,4 +233,27 @@
exec = null;
}
}
+
+ public void getApps (Context context)
+ {
+ PackageManager pMgr = context.getPackageManager();
+
+ List<ApplicationInfo> lAppInfo = pMgr.getInstalledApplications(0);
+
+ Iterator<ApplicationInfo> itAppInfo = lAppInfo.iterator();
+
+ ApplicationInfo aInfo = null;
+
+ while (itAppInfo.hasNext())
+ {
+ aInfo = itAppInfo.next();
+
+ boolean appEnabled = aInfo.enabled;
+ int uid = aInfo.uid; //-m owner --uid-owner
+ String username = pMgr.getNameForUid(uid);
+ String procName = aInfo.processName;
+ String name = aInfo.name;
+
+ }
+ }
}