diff --git a/AndroidManifest.xml b/AndroidManifest.xml index ad48d9d4..030bbff5 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -32,6 +32,7 @@ + diff --git a/res/layout/layout_wizard_permissions.xml b/res/layout/layout_wizard_permissions.xml index b861d7a4..f7ecab80 100644 --- a/res/layout/layout_wizard_permissions.xml +++ b/res/layout/layout_wizard_permissions.xml @@ -11,19 +11,10 @@ android:layout_height="wrap_content" android:id="@+id/relativeLayout1" android:layout_gravity="center_horizontal"> - - + + android:padding="20px" android:layout_centerInParent="true"> diff --git a/res/layout/layout_wizard_root.xml b/res/layout/layout_wizard_root.xml index f71c284a..62afa38a 100644 --- a/res/layout/layout_wizard_root.xml +++ b/res/layout/layout_wizard_root.xml @@ -1,29 +1,64 @@ - + android:layout_height="fill_parent" + android:background="@drawable/background"> + + + + + + + + + + - + + - + - - + + - + + + + + diff --git a/res/layout/layout_wizard_tips.xml b/res/layout/layout_wizard_tips.xml index 60cba512..6a304caf 100644 --- a/res/layout/layout_wizard_tips.xml +++ b/res/layout/layout_wizard_tips.xml @@ -11,18 +11,9 @@ android:layout_height="wrap_content" android:id="@+id/relativeLayout1" android:layout_gravity="center_horizontal"> - - - + android:padding="20px" android:layout_centerInParent="true"> diff --git a/res/values/strings.xml b/res/values/strings.xml index 0bf8286f..da4cca30 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -145,5 +145,8 @@ https://market.android.com/details?id=info.guardianproject.otr.app.im https://market.android.com/details?id=org.mozilla.firefox https://addons.mozilla.org/mobile/downloads/latest/251558/type:attachment/addon-251558-latest.xpi?src=addon-detail - + + Transparent Proxy + Transparent Proxying allows you to redirect client requests without any special configuration or knowledge at the client. + (Check this box if you have no idea what we are talking about) diff --git a/src/org/torproject/android/ConfigureTransProxy.java b/src/org/torproject/android/ConfigureTransProxy.java new file mode 100644 index 00000000..8ff6dad9 --- /dev/null +++ b/src/org/torproject/android/ConfigureTransProxy.java @@ -0,0 +1,150 @@ +package org.torproject.android; + +import android.app.Activity; +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; +import android.net.Uri; +import android.os.Bundle; +import android.preference.PreferenceManager; +import android.view.View; +import android.view.View.OnClickListener; +import android.widget.Button; +import android.widget.CheckBox; +import android.widget.CompoundButton; +import android.widget.TextView; +import android.widget.CompoundButton.OnCheckedChangeListener; + +public class ConfigureTransProxy extends Activity implements TorConstants { + + private Context context; + + protected void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + context = this; + + } + + @Override + protected void onStart() { + + super.onStart(); + setContentView(R.layout.layout_wizard_root); + + stepSix(); + + } + + @Override + protected void onResume() { + super.onResume(); + + + } + + private void stepSix(){ + + String title = context.getString(R.string.wizard_transproxy_title); + TextView txtTitle = ((TextView)findViewById(R.id.WizardTextTitle)); + txtTitle.setText(title); + + CheckBox cb1 = (CheckBox)findViewById(R.id.WizardRootCheckBox01); + Button btn1 = (Button)findViewById(R.id.WizardRootButton01); + + cb1.setOnCheckedChangeListener(new OnCheckedChangeListener (){ + + @Override + public void onCheckedChanged(CompoundButton buttonView, + boolean isChecked) { + + + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + + Editor pEdit = prefs.edit(); + + pEdit.putBoolean(PREF_TRANSPARENT, isChecked); + pEdit.putBoolean(PREF_TRANSPARENT_ALL, isChecked); + + pEdit.commit(); + + } + + }); + + + + btn1.setOnClickListener(new OnClickListener() { + + @Override + public void onClick(View view) { + + + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + + Editor pEdit = prefs.edit(); + pEdit.putBoolean(PREF_TRANSPARENT, true); + pEdit.putBoolean(PREF_TRANSPARENT_ALL, false); + pEdit.commit(); + + context.startActivity(new Intent(context, AppManager.class)); + + } + }); + + Button back = ((Button)findViewById(R.id.btnWizard1)); + Button next = ((Button)findViewById(R.id.btnWizard2)); + + back.setOnClickListener(new View.OnClickListener() { + + @Override + public void onClick(View v) { + + startActivityForResult(new Intent(getBaseContext(), Permissions.class), 1); + } + }); + + next.setOnClickListener(new View.OnClickListener() { + + @Override + public void onClick(View v) { + showWizardFinal(); + } + }); + } + + private void showWizardFinal () + { + String title = null; + String msg = null; + + + title = context.getString(R.string.wizard_final); + msg = context.getString(R.string.wizard_final_msg); + + DialogInterface.OnClickListener ocListener = new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + //close wizard - return to orbot + + } + }; + + + new AlertDialog.Builder(context) + .setIcon(R.drawable.icon) + .setTitle(title) + .setPositiveButton(R.string.button_close, ocListener) + .setMessage(msg) + .show(); + + + + + + } +} \ No newline at end of file diff --git a/src/org/torproject/android/Permissions.java b/src/org/torproject/android/Permissions.java index 996a1dc8..248fd965 100644 --- a/src/org/torproject/android/Permissions.java +++ b/src/org/torproject/android/Permissions.java @@ -116,6 +116,8 @@ public class Permissions extends Activity implements TorConstants { @Override public void onClick(View v) { //Check and Install iptables + startActivityForResult(new Intent(getBaseContext(), ConfigureTransProxy.class), 1); + } });