fix the ability to select per app VPN routing

This commit is contained in:
Nathan Freitas 2016-01-11 17:11:58 -05:00
parent f41d46960c
commit 39244a613a
4 changed files with 13 additions and 3 deletions

View File

@ -809,7 +809,7 @@ public class OrbotMainActivity extends Activity
else if (torStatus == TorServiceConstants.STATUS_ON) else if (torStatus == TorServiceConstants.STATUS_ON)
{ {
updateTransProxy(); updateTransProxy();
Toast.makeText(this, R.string.you_may_need_to_stop_and_start_orbot_for_settings_change_to_be_enabled_, Toast.LENGTH_SHORT).show(); // Toast.makeText(this, R.string.you_may_need_to_stop_and_start_orbot_for_settings_change_to_be_enabled_, Toast.LENGTH_SHORT).show();
} }
} }

View File

@ -300,6 +300,7 @@ public class AppManager extends Activity implements OnCheckedChangeListener, OnC
app.setUid(aInfo.uid); app.setUid(aInfo.uid);
app.setUsername(pMgr.getNameForUid(app.getUid())); app.setUsername(pMgr.getNameForUid(app.getUid()));
app.setProcname(aInfo.processName); app.setProcname(aInfo.processName);
app.setPackageName(aInfo.packageName);
try try
{ {

View File

@ -10,6 +10,7 @@ public class TorifiedApp implements Comparable {
private String procname; private String procname;
private String name; private String name;
private Drawable icon; private Drawable icon;
private String packageName;
private boolean torified = false; private boolean torified = false;
private boolean usesInternet = false; private boolean usesInternet = false;
@ -127,4 +128,12 @@ public class TorifiedApp implements Comparable {
{ {
return getName(); return getName();
} }
public String getPackageName() {
return packageName;
}
public void setPackageName(String packageName) {
this.packageName = packageName;
}
} }

View File

@ -343,9 +343,9 @@ public class OrbotVpnService extends VpnService implements Handler.Callback {
for (TorifiedApp app : apps) for (TorifiedApp app : apps)
{ {
if (app.isTorified()) if (app.isTorified() && (!app.getPackageName().equals(getPackageName())))
{ {
builder.addAllowedApplication(app.getUsername()); builder.addAllowedApplication(app.getPackageName());
perAppEnabled = true; perAppEnabled = true;
} }