adds optional boolean to the intent
This commit is contained in:
parent
0131cf20f0
commit
94a3b0b107
|
@ -565,7 +565,7 @@ public class OrbotMainActivity extends AppCompatActivity
|
||||||
stopVpnService();
|
stopVpnService();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enableHiddenServicePort (String hsName, int hsPort) throws RemoteException, InterruptedException
|
private void enableHiddenServicePort (String hsName, int hsPort, boolean getGey) throws RemoteException, InterruptedException
|
||||||
{
|
{
|
||||||
String onionHostname="";
|
String onionHostname="";
|
||||||
String[] mProjection = new String[]{
|
String[] mProjection = new String[]{
|
||||||
|
@ -580,6 +580,7 @@ public class OrbotMainActivity extends AppCompatActivity
|
||||||
ContentValues fields = new ContentValues();
|
ContentValues fields = new ContentValues();
|
||||||
fields.put("name", hsName);
|
fields.put("name", hsName);
|
||||||
fields.put("port", hsPort);
|
fields.put("port", hsPort);
|
||||||
|
|
||||||
ContentResolver cr = getContentResolver();
|
ContentResolver cr = getContentResolver();
|
||||||
Cursor row = cr.query(HSContentProvider.CONTENT_URI, mProjection, "port="+hsPort, null, null);
|
Cursor row = cr.query(HSContentProvider.CONTENT_URI, mProjection, "port="+hsPort, null, null);
|
||||||
|
|
||||||
|
@ -594,9 +595,9 @@ public class OrbotMainActivity extends AppCompatActivity
|
||||||
requestTorRereadConfig();
|
requestTorRereadConfig();
|
||||||
|
|
||||||
// TODO: Wait for hostname
|
// TODO: Wait for hostname
|
||||||
|
|
||||||
Intent nResult = new Intent();
|
Intent nResult = new Intent();
|
||||||
nResult.putExtra("hs_host", onionHostname);
|
nResult.putExtra("hs_host", onionHostname);
|
||||||
|
// TODO: Add key
|
||||||
setResult(RESULT_OK, nResult);
|
setResult(RESULT_OK, nResult);
|
||||||
finish();
|
finish();
|
||||||
|
|
||||||
|
@ -621,6 +622,7 @@ public class OrbotMainActivity extends AppCompatActivity
|
||||||
{
|
{
|
||||||
final int hiddenServicePort = getIntent().getIntExtra("hs_port", -1);
|
final int hiddenServicePort = getIntent().getIntExtra("hs_port", -1);
|
||||||
final String hiddenServiceName = getIntent().getStringExtra("hs_name");
|
final String hiddenServiceName = getIntent().getStringExtra("hs_name");
|
||||||
|
final boolean getHiddenServiceKey = getIntent().getBooleanExtra("hs_key",false);
|
||||||
|
|
||||||
DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
|
DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
|
@ -629,8 +631,9 @@ public class OrbotMainActivity extends AppCompatActivity
|
||||||
case DialogInterface.BUTTON_POSITIVE:
|
case DialogInterface.BUTTON_POSITIVE:
|
||||||
|
|
||||||
try {
|
try {
|
||||||
enableHiddenServicePort (hiddenServiceName, hiddenServicePort);
|
enableHiddenServicePort (
|
||||||
|
hiddenServiceName, hiddenServicePort, getHiddenServiceKey
|
||||||
|
);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
Loading…
Reference in New Issue