tor-commits
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 1 participants
- 216059 discussions
commit d7c15dd81bead96956cd5164c287c2729b60f409
Author: Sathyanarayanan Gunasekaran <gsathya.ceg(a)gmail.com>
Date: Tue Jun 28 09:20:01 2011 +0530
Minor changes to LotsaText.java
Now shows "Introduction" screen when the
app is installed for the first time.
---
src/org/torproject/android/LotsaText.java | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/org/torproject/android/LotsaText.java b/src/org/torproject/android/LotsaText.java
index 9f845db..1b0656b 100644
--- a/src/org/torproject/android/LotsaText.java
+++ b/src/org/torproject/android/LotsaText.java
@@ -34,7 +34,7 @@ public class LotsaText extends Activity implements TorConstants{
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
- boolean wizardScreen1 = prefs.getBoolean("wizardscreen1",false);
+ boolean wizardScreen1 = prefs.getBoolean("wizardscreen1",true);
if(wizardScreen1)
stepOne();
else
1
0
commit cd6c533a7189a126384377f0d4e8bc2f700f776f
Merge: 9b3419e d7c15dd
Author: Nathan Freitas <nathan(a)freitas.net>
Date: Sun Jul 24 17:09:30 2011 -0400
Merge branch 'wizard'
Conflicts:
res/values/strings.xml
src/org/torproject/android/Orbot.java
AUTHORS | 2 +-
AndroidManifest.xml | 2 +-
res/drawable/icon_firefox.png | Bin 0 -> 9233 bytes
res/drawable/icon_orweb.png | Bin 8783 -> 0 bytes
res/drawable/icon_otrchat.png | Bin 4610 -> 0 bytes
res/drawable/proxymob.png | Bin 0 -> 11265 bytes
res/drawable/warning.png | Bin 0 -> 2922 bytes
res/layout/layout_apps_item.xml | 3 +-
res/layout/layout_wizard_permissions.xml | 55 +++
res/layout/layout_wizard_root.xml | 64 +++-
res/layout/layout_wizard_tips.xml | 56 ++-
res/layout/scrollingtext_buttons_view.xml | 68 +++
res/values/strings.xml | 31 ++-
res/values/theme.xml | 9 +
.../torproject/android/ConfigureTransProxy.java | 183 ++++++++
src/org/torproject/android/LotsaText.java | 133 ++++++
src/org/torproject/android/Orbot.java | 438 +++++++++-----------
src/org/torproject/android/Permissions.java | 229 ++++++++++
src/org/torproject/android/TipsAndTricks.java | 139 +++++++
src/org/torproject/android/WizardActivity.java | 71 ----
src/org/torproject/android/WizardHelper.java | 10 +-
.../android/service/TorServiceUtils.java | 37 ++-
22 files changed, 1190 insertions(+), 340 deletions(-)
diff --cc res/layout/layout_wizard_permissions.xml
index 0000000,151bb3e..1ba5fec
mode 000000,100644..100644
--- a/res/layout/layout_wizard_permissions.xml
+++ b/res/layout/layout_wizard_permissions.xml
@@@ -1,0 -1,55 +1,55 @@@
+ <?xml version="1.0" encoding="utf-8"?>
+
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <RelativeLayout
- android:layout_width="match_parent"
++ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/relativeLayout1"
+ android:layout_gravity="center_horizontal"
+ android:background="#000000">
+
+ <TextView android:textSize="10pt"
+ android:textColor="#FFFFFF"
+ android:layout_alignParentTop="true"
+ android:layout_height="wrap_content"
+ android:id="@+id/WizardTextTitle"
+ android:layout_width="wrap_content"
+ android:fadingEdge="vertical"
+ android:text="TITLE"
+ android:singleLine="true"
+ android:padding="20px" android:layout_centerInParent="true">
+ </TextView>
+ </RelativeLayout>
+ <TableLayout android:id="@+id/TableLayout01" android:stretchColumns="*" android:layout_height="fill_parent" android:layout_width="wrap_content">
+
+ <TableRow android:layout_margin="10dip" android:id="@+id/TableRow01" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="fill_parent">
+
+
+ <ScrollView android:id="@+id/helpscrollview"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_span="3"
+ >
+ <LinearLayout android:background="#575757" android:layout_width="wrap_content" android:id="@+id/linearLayout1" android:layout_height="wrap_content" android:orientation="vertical">
+ <TextView android:layout_width="wrap_content" android:textColor="#ffffff" android:layout_height="wrap_content" android:textSize="8pt" android:id="@+id/WizardTextBody1" android:text="this is sample text this is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample text" android:padding="20dip"></TextView>
+ <Button android:layout_width="wrap_content" android:visibility="gone" android:layout_height="wrap_content" android:gravity="center" android:text="Grant Permission" android:id="@+id/grantPermissions" android:layout_gravity="center"></Button>
+ <TextView android:layout_width="wrap_content" android:visibility="gone" android:textColor="#ffffff" android:layout_height="wrap_content" android:textSize="8pt" android:id="@+id/WizardTextBody2" android:text="this is sample text this is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample text" android:padding="20dip"></TextView>
+ <CheckBox android:id="@+id/checkBox" android:layout_gravity="center" android:text="@string/wizard_permissions_consent" android:layout_height="wrap_content" android:layout_width="wrap_content" android:gravity="center" android:visibility="visible"></CheckBox>
+ </LinearLayout>
+
+ </ScrollView>
+
+ </TableRow>
+ <TableRow android:background="#000000" android:layout_marginTop="10dip" android:paddingTop="10dip" android:id="@+id/TableRow01" android:textColor="#00ff00" android:layout_width="fill_parent" android:layout_height="30px">
+ <Button android:text="Back" android:id="@+id/btnWizard1" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content"></Button>
+ <Button android:text="Next" android:id="@+id/btnWizard2" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content"></Button>
+ </TableRow>
+ </TableLayout>
+ </LinearLayout>
+
+
diff --cc res/layout/layout_wizard_root.xml
index f71c284,443106e..530d917
--- a/res/layout/layout_wizard_root.xml
+++ b/res/layout/layout_wizard_root.xml
@@@ -3,8 -3,31 +3,31 @@@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
- android:layout_height="wrap_content">
+ android:layout_height="fill_parent">
+
+ <RelativeLayout
- android:layout_width="match_parent"
++ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/relativeLayout1"
+ android:layout_gravity="center_horizontal"
+ android:background="#000000">
+ <TextView android:textSize="10pt"
+ android:textColor="#FFFFFF"
+ android:layout_alignParentTop="true"
+ android:layout_height="wrap_content"
+ android:id="@+id/WizardTextTitle"
+ android:layout_width="wrap_content"
+ android:fadingEdge="vertical"
+ android:text="TITLE"
+ android:singleLine="true"
+ android:padding="20px" android:layout_centerInParent="true">
+ </TextView>
+ </RelativeLayout>
+ <TableLayout android:id="@+id/TableLayout01" android:stretchColumns="*" android:layout_height="fill_parent" android:layout_width="wrap_content">
+
+ <TableRow android:layout_margin="10dip" android:id="@+id/TableRow01" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="fill_parent">
+
+
<ScrollView android:id="@+id/helpscrollview"
android:orientation="vertical"
android:layout_width="fill_parent"
diff --cc res/layout/layout_wizard_tips.xml
index 19aaef0,1b7b50b..17ddb88
--- a/res/layout/layout_wizard_tips.xml
+++ b/res/layout/layout_wizard_tips.xml
@@@ -3,8 -3,31 +3,31 @@@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
- android:layout_height="wrap_content">
+ android:layout_height="fill_parent">
+
+ <RelativeLayout
- android:layout_width="match_parent"
++ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/relativeLayout1"
+ android:layout_gravity="center_horizontal"
+ android:background="#000000">
+ <TextView android:textSize="10pt"
+ android:textColor="#FFFFFF"
+ android:layout_alignParentTop="true"
+ android:layout_height="wrap_content"
+ android:id="@+id/WizardTextTitle"
+ android:layout_width="wrap_content"
+ android:fadingEdge="vertical"
+ android:text="TITLE"
+ android:singleLine="true"
+ android:padding="20px" android:layout_centerInParent="true">
+ </TextView>
+ </RelativeLayout>
+ <TableLayout android:id="@+id/TableLayout01" android:stretchColumns="*" android:layout_height="fill_parent" android:layout_width="wrap_content">
+
+ <TableRow android:layout_margin="10dip" android:id="@+id/TableRow01" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="fill_parent">
+
+
<ScrollView android:id="@+id/helpscrollview"
android:orientation="vertical"
android:layout_width="fill_parent"
diff --cc res/layout/scrollingtext_buttons_view.xml
index 0000000,ebecfad..df59922
mode 000000,100644..100644
--- a/res/layout/scrollingtext_buttons_view.xml
+++ b/res/layout/scrollingtext_buttons_view.xml
@@@ -1,0 -1,68 +1,68 @@@
+ <?xml version="1.0" encoding="utf-8"?>
+
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+ <RelativeLayout
- android:layout_width="match_parent"
++ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/relativeLayout1"
+ android:layout_gravity="center_horizontal"
+ android:background="#000000"
+ >
+ <ImageView
+ android:src="@drawable/warning"
+ android:id="@+id/orbot_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:paddingLeft="20px" android:layout_marginLeft="10dip" android:layout_marginTop="8dip">
+ </ImageView>
+ <TextView
+ android:textColor="#FFFFFF"
+ android:textSize="10pt"
+ android:layout_toRightOf="@id/orbot_image"
+ android:layout_alignParentTop="true"
+ android:gravity="center_vertical"
+ android:layout_height="wrap_content"
+ android:id="@+id/WizardTextTitle"
+ android:layout_width="wrap_content"
+ android:fadingEdge="vertical"
+ android:text="TITLE"
+ android:singleLine="true"
+
+
+
+ android:layout_centerInParent="true"
+ android:paddingLeft="5px"
+ android:padding="20px"
+ >
+ </TextView>
+ </RelativeLayout>
+ <TableLayout android:id="@+id/TableLayout01" android:stretchColumns="*" android:layout_height="fill_parent" android:layout_width="wrap_content" >
+
+ <TableRow android:id="@+id/TableRow01" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_margin="10dip">
+
+
+ <ScrollView android:id="@+id/helpscrollview"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_span="3">
+
+ <TextView android:background="#575757" android:text="this is sample text this is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample text" android:textColor="#ffffff" android:id="@+id/WizardTextBody" android:textSize="8pt" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="20dip"></TextView>
+
+ </ScrollView>
+
+ </TableRow>
+ <TableRow android:background="#000000" android:id="@+id/TableRow01" android:textColor="#00ff00" android:layout_width="fill_parent" android:layout_height="30px" android:layout_marginTop="10dip" android:paddingTop="10dip">
+ <Button android:text="Back" android:id="@+id/btnWizard1" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content"></Button>
+ <Button android:text="Next" android:id="@+id/btnWizard2" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content"></Button>
+ </TableRow>
+ </TableLayout>
+ </LinearLayout>
+
+
diff --cc res/values/strings.xml
index 1a5daf3,720c03c..6a82430
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@@ -130,9 -124,30 +130,32 @@@
<string name="pref_general_group">General</string>
<string name="pref_start_boot_title">Start Orbot on Boot</string>
<string name="pref_start_boot_summary">Automatically start Orbot and connect Tor when your Android device boots</string>
-
- <string name="pref_transparent_tethering_title">Tor Tethering</string>
+ <!-- New Wizard Strings -->
+ <!-- Title Screen -->
- <string name="wizard_title">Orbot</string>
+ <string name="wizard_title_msg">Orbot brings Tor to Android \n\nTor helps you defend against a form of network surveillance that threatens privacy, confidential business activity and relationships, and state security known as traffic analysis</string>
+ <!-- Warning screen -->
+ <string name="wizard_warning_title">Warning</string>
+ <string name="wizard_warning_msg">Simply installing Orbot will not automatically anonymize your mobile traffic.\n\nPlease follow the following steps to get started</string>
+ <!-- Permissions screen -->
+ <string name="wizard_permissions_title">Permissions</string>
+ <string name="wizard_permissions_root_msg1">Orbot has detected that you have root permissions enabled. To enable \'Transparent Proxying\', please grant superuser privileges to Orbot</string>
+ <string name="wizard_permissions_root_msg2">If you choose to continue without providing superuser privileges, make sure to use apps made to work with orbot</string>
+ <string name="wizard_permissions_msg">Orbot has detected that you do not have root permissions.\nTransparent Proxying is not possible without superuser privileges.\nMake sure to use apps that have been configured to work with Orbot</string>
- <string name="wizard_permissions_consent">I understand and would like to continue without root</string>
+ <!-- TipsAndTricks screen -->
+ <string name="wizard_tips_title">Orbot configured Apps</string>
+ <string name="wizard_tips_gibberbot">Gibberbot - Secure instant messaging client for Android</string>
+ <string name="wizard_tips_firefox">Firefox - Android browser - To be used along with ProxyMob Add-on </string>
+ <string name="wizard_tips_proxymob">ProxyMob - Simple Firefox Add-on for setting HTTP, SOCKS and SSL proxy settings</string>
+ <string name="gibberbot_apk_url">https://market.android.com/details?id=info.guardianproject.otr.app.im</string>
+ <string name="firefox_apk_url">https://market.android.com/details?id=org.mozilla.firefox</string>
+ <string name="proxymob_url">https://addons.mozilla.org/mobile/downloads/latest/251558/type:attachment/a…</string>
+ <!-- Transparent Proxy screen -->
+ <string name="wizard_transproxy_title">Transparent Proxy</string>
+ <string name="wizard_transproxy_msg">Transparent Proxying allows you to redirect client requests without any special configuration or knowledge at the client.</string>
+ <string name="wizard_transproxy_hint">(Check this box if you have no idea what we are talking about)</string>
+ <string name="wizard_transproxy_none">None</string>
++
++ <string name="pref_transparent_tethering_title">Tor Tethering</string>
+ <string name="pref_transparent_tethering_summary">Enable Tor Transparent Proxying for Wifi and USB Tethered Devices</string>
-
-
++
</resources>
diff --cc src/org/torproject/android/Orbot.java
index 690ce10,f5f5f03..7374822
--- a/src/org/torproject/android/Orbot.java
+++ b/src/org/torproject/android/Orbot.java
@@@ -147,353 -137,305 +150,317 @@@ public class Orbot extends Activity imp
/* When a menu item is selected launch the appropriate view or activity
* (non-Javadoc)
- * @see android.app.Activity#onMenuItemSelected(int, android.view.MenuItem)
- */
- public boolean onMenuItemSelected(int featureId, MenuItem item) {
-
- super.onMenuItemSelected(featureId, item);
-
- if (item.getItemId() == 1)
- {
-
- try
- {
-
- if (mService == null)
- {
-
- }
- else if (mService.getStatus() == STATUS_READY)
- {
- if (mItemOnOff != null)
- mItemOnOff.setTitle(R.string.menu_stop);
- startTor();
-
- }
- else
- {
- if (mItemOnOff != null)
- mItemOnOff.setTitle(R.string.menu_start);
- stopTor();
-
- }
-
- }
- catch (RemoteException re)
- {
- Log.w(TAG, "Unable to start/top Tor from menu UI", re);
- }
- }
- else if (item.getItemId() == 4)
- {
- showSettings();
- }
- else if (item.getItemId() == 3)
- {
- showHelp();
- }
- else if (item.getItemId() == 7)
- {
- doTorCheck();
- }
- else if (item.getItemId() == 8)
- {
- //exit app
- doExit();
-
-
- }
- else if (item.getItemId() == 6)
- {
- showAbout();
-
-
- }
-
+ * @see android.app.Activity#onMenuItemSelected(int, android.view.MenuItem)
+ */
+ public boolean onMenuItemSelected(int featureId, MenuItem item) {
+
+ super.onMenuItemSelected(featureId, item);
+
+ if (item.getItemId() == 1)
+ {
+
+ try
+ {
+
+ if (mService == null)
+ {
+
+ }
+ else if (mService.getStatus() == STATUS_READY)
+ {
+ if (mItemOnOff != null)
+ mItemOnOff.setTitle(R.string.menu_stop);
+ startTor();
+
+ }
+ else
+ {
+ if (mItemOnOff != null)
+ mItemOnOff.setTitle(R.string.menu_start);
+ stopTor();
+
+ }
+
+ }
+ catch (RemoteException re)
+ {
+ Log.w(TAG, "Unable to start/top Tor from menu UI", re);
+ }
+ }
+ else if (item.getItemId() == 4)
+ {
+ showSettings();
+ }
+ else if (item.getItemId() == 3)
+ {
+ showHelp();
+ }
+ else if (item.getItemId() == 7)
+ {
+ doTorCheck();
+ }
+ else if (item.getItemId() == 8)
+ {
+ //exit app
+ doExit();
+
+
+ }
+ else if (item.getItemId() == 6)
+ {
+ showAbout();
+
+
+ }
+
return true;
- }
-
- private void doExit ()
- {
- try {
-
- stopTor();
-
- stopService(new Intent(ITorService.class.getName()));
-
- NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
- mNotificationManager.cancelAll();
-
-
- } catch (RemoteException e) {
- Log.w(TAG, e);
- }
-
- finish();
-
- }
-
- /* Return to the main view when the back key is pressed
- * (non-Javadoc)
- * @see android.app.Activity#onKeyDown(int, android.view.KeyEvent)
- */
- /*
- public boolean onKeyDown(int keyCode, KeyEvent event){
-
- if(keyCode==KeyEvent.KEYCODE_BACK){
-
- if(currentView != R.layout.layout_main){
-
- showMain ();
- return true;
- }
- else{
- return super.onKeyDown(keyCode, event);
- }
- }
-
- return super.onKeyDown(keyCode, event);
-
- }*/
+ }
+
+ /**
+ * This is our attempt to REALLY exit Orbot, and stop the background service
+ * However, Android doesn't like people "quitting" apps, and/or our code may not
+ * be quite right b/c no matter what we do, it seems like the TorService still exists
+ **/
+ private void doExit ()
+ {
+ try {
+
+ //one of the confusing things about all of this code is the multiple
+ //places where things like "stopTor" are called, both in the Activity and the Service
+ //not something to tackle in your first iteration, but i thin we can talk about fixing
+ //terminology but also making sure there are clear distinctions in control
+ stopTor();
+
+ //perhaps this should be referenced as INTENT_TOR_SERVICE as in startService
+ stopService(new Intent(ITorService.class.getName()));
+
+ //clears all notifications from the status bar
+ NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+ mNotificationManager.cancelAll();
+
+
+ } catch (RemoteException e) {
+ Log.w(TAG, e);
+ }
+
+ finish();
+
+ }
+
+ /* Return to the main view when the back key is pressed
+ * (non-Javadoc)
+ * @see android.app.Activity#onKeyDown(int, android.view.KeyEvent)
+ */
+ /*
+ public boolean onKeyDown(int keyCode, KeyEvent event){
+
+ //yeah this should probably go away now :) - or not
+ if(keyCode==KeyEvent.KEYCODE_BACK){
+
+ if(currentView != R.layout.layout_main){
+
+ showMain ();
+ return true;
+ }
+ else{
+ return super.onKeyDown(keyCode, event);
+ }
+ }
+
+ return super.onKeyDown(keyCode, event);
+
+ }*/
/* (non-Javadoc)
- * @see android.app.Activity#onPause()
- */
- protected void onPause() {
- super.onPause();
-
- hideProgressDialog();
+ * @see android.app.Activity#onPause()
+ */
+ protected void onPause() {
+ super.onPause();
+
+ hideProgressDialog();
- if (aDialog != null)
- aDialog.dismiss();
- }
+ if (aDialog != null)
+ aDialog.dismiss();
+ }
- /**
- * i think we need to suport this onSave/Restore code more b/c i think
- * when someone rotates the screen, and the state is lost during setup
- * etc it causes problems. this might be the place to solve that in the wizard - hmm this prob coz android restarts the activity when the screen is rotated. this will prob be fixed(?) when
- we redesign the wizard into a view not just a dialogbox
- cool
- **/
- public void onSaveInstanceState(Bundle savedInstanceState) {
- // Save UI state changes to the savedInstanceState.
- // This bundle will be passed to onCreate if the process is
- // killed and restarted.
- // etc.
- super.onSaveInstanceState(savedInstanceState);
- }
-
- public void onRestoreInstanceState(Bundle savedInstanceState) {
- super.onRestoreInstanceState(savedInstanceState);
- // Restore UI state from the savedInstanceState.
- // This bundle has also been passed to onCreate.
-
- //we do nothing here
- }
-
- /**
- * confirm with the user that they want to open a browser to connect to https://check.torproject.org
- and then launch the URL.
- this may be where the TorCheck API code/UI is added, though always offering the web-based confirm
- should be an option, since users know it
-
- **/
- private void doTorCheck ()
- {
-
- DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
-
- @Override
- public void onClick(DialogInterface dialog, int which) {
- switch (which){
- case DialogInterface.BUTTON_POSITIVE:
-
- openBrowser(URL_TOR_CHECK);
+ public void onSaveInstanceState(Bundle savedInstanceState) {
+ // Save UI state changes to the savedInstanceState.
+ // This bundle will be passed to onCreate if the process is
+ // killed and restarted.
+ // etc.
+ super.onSaveInstanceState(savedInstanceState);
+ }
+
+ public void onRestoreInstanceState(Bundle savedInstanceState) {
+ super.onRestoreInstanceState(savedInstanceState);
+ // Restore UI state from the savedInstanceState.
+ // This bundle has also been passed to onCreate.
+
+ }
+
+ private void doTorCheck ()
+ {
+
+ DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ switch (which){
+ case DialogInterface.BUTTON_POSITIVE:
+
+ openBrowser(URL_TOR_CHECK);
-
-
- break;
+
+
+ break;
- case DialogInterface.BUTTON_NEGATIVE:
-
- //do nothing
- break;
- }
- }
- };
+ case DialogInterface.BUTTON_NEGATIVE:
+
+ //do nothing
+ break;
+ }
+ }
+ };
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setMessage(R.string.tor_check).setPositiveButton(R.string.btn_okay, dialogClickListener)
- .setNegativeButton(R.string.btn_cancel, dialogClickListener).show();
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setMessage(R.string.tor_check).setPositiveButton(R.string.btn_okay, dialogClickListener)
+ .setNegativeButton(R.string.btn_cancel, dialogClickListener).show();
- }
-
- /**
- * this adds a port to the list of hidden service ports
- * we might want to add remove/disable port too
- * this is used by external apps that launch an intent
- * to request a hidden service on a specific port
- * currently, we haven't promoted this intent API or capability
- * that much, but we hope to
- **/
- private void enableHiddenServicePort (int hsPort)
- {
- SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
- Editor pEdit = prefs.edit();
-
- String hsPortString = prefs.getString("pref_hs_ports", "");
-
- if (hsPortString.length() > 0 && hsPortString.indexOf(hsPort+"")==-1)
- hsPortString += ',' + hsPort;
- else
- hsPortString = hsPort + "";
-
- pEdit.putString("pref_hs_ports", hsPortString);
- pEdit.putBoolean("pref_hs_enable", true);
-
- pEdit.commit();
-
- String onionHostname = prefs.getString("pref_hs_hostname","");
+ }
+
+ private void enableHiddenServicePort (int hsPort)
+ {
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
+ Editor pEdit = prefs.edit();
+
+ String hsPortString = prefs.getString("pref_hs_ports", "");
+
+ if (hsPortString.length() > 0 && hsPortString.indexOf(hsPort+"")==-1)
+ hsPortString += ',' + hsPort;
+ else
+ hsPortString = hsPort + "";
+
+ pEdit.putString("pref_hs_ports", hsPortString);
+ pEdit.putBoolean("pref_hs_enable", true);
+
+ pEdit.commit();
+
+ String onionHostname = prefs.getString("pref_hs_hostname","");
- Intent nResult = new Intent();
- nResult.putExtra("hs_host", onionHostname);
- setResult(RESULT_OK, nResult);
-
- }
-
- /* (non-Javadoc)
- * @see android.app.Activity#onResume()
- */
- protected void onResume() {
- super.onResume();
-
- //this is where we make sure we have a handle to ITorService
- bindService();
-
- //this is a hack which basically pings the ITorService to update our status for the UI
- // - the dialogbox/progressbar ?
- // right, this was for when the label displayed the status, and not the progress, so it may
- // not make as much sense now; there is a bunch of loose ends like this that should be
- // cleaned up with the transition to the progressdialog - ok
- updateStatus("");
-
- //this checks if we were launched via an Intent call from another app or activity
- //- how does this matter? if Orbot has been launched via an Intent or not ?
- //we want to know if this is a launch by the user from the home screen, or via back, or some
- // standard interaction, or if it is another app launching Orbot for a programmatic/API request
- // this is how we can add more functionality into ORlib, for instance via Intent launching - hmm ok
- if (getIntent() == null)
- return;
-
- String action = getIntent().getAction();
-
- if (action == null)
- return;
-
- //this relates to the previously discussed hidden port capability
- if (action.equals("org.torproject.android.REQUEST_HS_PORT"))
- {
-
- //tell the user an app is trying to open a hidden port and ask for permission
- DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- switch (which){
- case DialogInterface.BUTTON_POSITIVE:
-
- int hsPort = getIntent().getIntExtra("hs_port", -1);
-
- enableHiddenServicePort (hsPort);
-
- finish();
-
-
- break;
+ Intent nResult = new Intent();
+ nResult.putExtra("hs_host", onionHostname);
+ setResult(RESULT_OK, nResult);
+
+ }
+
+ /* (non-Javadoc)
+ * @see android.app.Activity#onResume()
+ */
+ protected void onResume() {
+ super.onResume();
+
+ bindService();
+
+ updateStatus("");
+
+ if (getIntent() == null)
+ return;
+
+ String action = getIntent().getAction();
+
+ if (action == null)
+ return;
+
+ if (action.equals("org.torproject.android.REQUEST_HS_PORT"))
+ {
+
+ DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ switch (which){
+ case DialogInterface.BUTTON_POSITIVE:
+
+ int hsPort = getIntent().getIntExtra("hs_port", -1);
+
+ enableHiddenServicePort (hsPort);
+
+ finish();
+
+
+ break;
- case DialogInterface.BUTTON_NEGATIVE:
- //No button clicked
- finish();
- break;
- }
- }
- };
+ case DialogInterface.BUTTON_NEGATIVE:
+ //No button clicked
+ finish();
+ break;
+ }
+ }
+ };
- int hsPort = getIntent().getIntExtra("hs_port", -1);
+ int hsPort = getIntent().getIntExtra("hs_port", -1);
- String requestMsg = "An app wants to open a server port (" + hsPort + ") to the Tor network. This is safe if you trust the app.";
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setMessage(requestMsg).setPositiveButton("Allow", dialogClickListener)
- .setNegativeButton("Deny", dialogClickListener).show();
-
-
- }
- else if (action.equals("org.torproject.android.START_TOR")) //this is the intent used to start Tor from another app, again meant for ORlib functionality
- {
- autoStartOnBind = true;
-
- if (mService == null)
- bindService();
-
- }
- else
- {
- //hmm not sure when this is ever reached honestly ;P
- //but it looks like a general UI reset
-
- NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
- mNotificationManager.cancelAll();
-
- SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
-
- boolean showWizard = prefs.getBoolean("show_wizard",true);
-
- if (showWizard)
- {
-
- Editor pEdit = prefs.edit();
-
- pEdit.putBoolean("show_wizard",false);
-
- pEdit.commit();
-
- new WizardHelper(this).showWizard();
+ String requestMsg = "An app wants to open a server port (" + hsPort + ") to the Tor network. This is safe if you trust the app.";
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setMessage(requestMsg).setPositiveButton("Allow", dialogClickListener)
+ .setNegativeButton("Deny", dialogClickListener).show();
+
+
+ }
+ else if (action.equals("org.torproject.android.START_TOR"))
+ {
+ autoStartOnBind = true;
+
+ if (mService == null)
+ bindService();
+
+ }
+ else
+ {
+
+ //setTitle(getString(R.string.app_name) + ' ' + getString(R.string.app_version));
+
+ NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+ mNotificationManager.cancelAll();
+
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
+
+ boolean showWizard = prefs.getBoolean("show_wizard",true);
+
+ if (showWizard)
+ {
+
+ Editor pEdit = prefs.edit();
+
+ pEdit.putBoolean("show_wizard",false);
+
+ pEdit.commit();
+
+ startActivityForResult(new Intent(getBaseContext(), LotsaText.class), 1);
- }
-
- }
- }
+ }
+
+ }
+ }
- /* (non-Javadoc)
- * @see android.app.Activity#onStart()
- */
- protected void onStart() {
- super.onStart();
-
-
- updateStatus ("");
-
- }
+ /* (non-Javadoc)
+ * @see android.app.Activity#onStart()
+ */
+ protected void onStart() {
+ super.onStart();
+
+
+ updateStatus ("");
+
+ }
- /* (non-Javadoc)
- * @see android.app.Activity#onStop()
- */
- protected void onStop() {
- super.onStop();
-
- //unbindService();
- }
+ /* (non-Javadoc)
+ * @see android.app.Activity#onStop()
+ */
+ protected void onStop() {
+ super.onStop();
+
+ //unbindService();
+ }
1
0
commit 6a4388de28ed62fd9ff4525c4164f38a53e55f60
Merge: 73b6a06 8dffdba
Author: Nathan Freitas <nathan(a)freitas.net>
Date: Sun Jul 24 14:31:02 2011 -0400
Merge branch 'tethering'
AndroidManifest.xml | 2 +-
CHANGELOG | 3 +
res/raw/torrc | 3 +
res/values/strings.xml | 4 +
res/xml/preferences.xml | 7 +
src/org/torproject/android/Orbot.java | 1303 +++++++++++---------
.../android/boot/OnbootBroadcastReceiver.java | 37 -
src/org/torproject/android/service/TorService.java | 15 +-
.../torproject/android/service/TorTransProxy.java | 43 +-
9 files changed, 755 insertions(+), 662 deletions(-)
1
0
[orbot/master] added support for unpacking split binary into one tor exe; supports devices with 1M raw resource limit
by n8fr8@torproject.org 28 Oct '11
by n8fr8@torproject.org 28 Oct '11
28 Oct '11
commit 0bfad80ca64fa205bd7d9b36acf7e8b49601d732
Author: Nathan Freitas <nathan(a)freitas.net>
Date: Mon Jul 25 10:50:03 2011 -0400
added support for unpacking split binary into one tor exe; supports devices with 1M raw resource limit
---
.../android/service/TorBinaryInstaller.java | 31 +++++++++++++-------
1 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/src/org/torproject/android/service/TorBinaryInstaller.java b/src/org/torproject/android/service/TorBinaryInstaller.java
index 9260c09..3c4907d 100644
--- a/src/org/torproject/android/service/TorBinaryInstaller.java
+++ b/src/org/torproject/android/service/TorBinaryInstaller.java
@@ -58,18 +58,26 @@ public class TorBinaryInstaller implements TorServiceConstants {
{
- InputStream is = context.getResources().openRawResource(R.raw.tor);
- streamToFile(is,installPath + TOR_BINARY_ASSET_KEY);
+ InputStream is = context.getResources().openRawResource(R.raw.toraa);
+ streamToFile(is,installPath + TOR_BINARY_ASSET_KEY, false);
+
+ is = context.getResources().openRawResource(R.raw.torab);
+ streamToFile(is,installPath + TOR_BINARY_ASSET_KEY, true);
+
+ is = context.getResources().openRawResource(R.raw.torac);
+ streamToFile(is,installPath + TOR_BINARY_ASSET_KEY, true);
+
+ is = context.getResources().openRawResource(R.raw.torad);
+ streamToFile(is,installPath + TOR_BINARY_ASSET_KEY, true);
-
is = context.getResources().openRawResource(R.raw.torrc);
- streamToFile(is,installPath + TORRC_ASSET_KEY);
+ streamToFile(is,installPath + TORRC_ASSET_KEY, false);
is = context.getResources().openRawResource(R.raw.privoxy);
- streamToFile(is,installPath + PRIVOXY_ASSET_KEY);
+ streamToFile(is,installPath + PRIVOXY_ASSET_KEY, false);
is = context.getResources().openRawResource(R.raw.privoxy_config);
- streamToFile(is,installPath + PRIVOXYCONFIG_ASSET_KEY);
+ streamToFile(is,installPath + PRIVOXYCONFIG_ASSET_KEY, false);
@@ -77,9 +85,8 @@ public class TorBinaryInstaller implements TorServiceConstants {
}
+
/*
- * Extract the Tor binary from the APK file using ZIP
- */
private void installFromZip ()
{
@@ -89,7 +96,7 @@ public class TorBinaryInstaller implements TorServiceConstants {
ZipFile zip = new ZipFile(apkPath);
ZipEntry zipen = zip.getEntry(ASSETS_BASE + TOR_BINARY_ASSET_KEY);
- streamToFile(zip.getInputStream(zipen),installPath + TOR_BINARY_ASSET_KEY);
+ streamToFile(zip.getInputStream(zipen),installPath + TOR_BINARY_ASSET_KEY, false);
zipen = zip.getEntry(ASSETS_BASE + TORRC_ASSET_KEY);
streamToFile(zip.getInputStream(zipen),installPath + TORRC_ASSET_KEY);
@@ -115,11 +122,12 @@ public class TorBinaryInstaller implements TorServiceConstants {
}
}
+ */
/*
* Write the inputstream contents to the file
*/
- private static void streamToFile(InputStream stm, String targetFilename)
+ private static void streamToFile(InputStream stm, String targetFilename, boolean append)
{
@@ -133,7 +141,8 @@ public class TorBinaryInstaller implements TorServiceConstants {
File outFile = new File(targetFilename);
try {
- outFile.createNewFile();
+ if (!append)
+ outFile.createNewFile();
stmOut = new FileOutputStream(outFile);
}
1
0
commit 6af2989ab82bff30ad45f14a40dfe15a4f787ddc
Author: Sathyanarayanan Gunasekaran <gsathya.ceg(a)gmail.com>
Date: Sat Jun 4 02:12:06 2011 +0530
Permissions screen added
---
AUTHORS | 2 +-
AndroidManifest.xml | 1 +
res/layout/layout_wizard_permissions.xml | 67 ++++++++++
res/values/strings.xml | 3 +
src/org/torproject/android/LotsaText.java | 17 ++--
src/org/torproject/android/Permissions.java | 176 +++++++++++++++++++++++++++
6 files changed, 256 insertions(+), 10 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index f99ac6f..135d9b4 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -27,7 +27,7 @@ provided guidance in the entire effort.
Adam Langley made the original valiant effort to port Tor to Android.
-Sathyanarayanan <gsathya.ceg(a)gmail.com> created a patch for the wizard
+Sathyanarayanan <me(a)gsathya.in> created a patch for the wizard
which updated the icon and link for the secure chat app info to point
to Gibberbot, and hopefully will continue to contribute useful patches.
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 59c2cca..be3c43f 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -30,6 +30,7 @@
</activity>
<activity android:name=".LotsaText"/>
+ <activity android:name=".Permissions"/>
<activity android:name=".SettingsPreferences" android:label="@string/app_name"/>
<activity android:name=".AppManager" android:label="@string/app_name"/>
<activity android:name=".WizardActivity" android:label="@string/app_name"/>
diff --git a/res/layout/layout_wizard_permissions.xml b/res/layout/layout_wizard_permissions.xml
new file mode 100644
index 0000000..b861d7a
--- /dev/null
+++ b/res/layout/layout_wizard_permissions.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:background="@drawable/background">
+
+<RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/relativeLayout1"
+ android:layout_gravity="center_horizontal">
+ <ImageView
+ android:src="@drawable/tor"
+ android:visibility="invisible"
+ android:id="@+id/orbot_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:paddingLeft="20px" android:paddingRight="20px" >
+ </ImageView>
+ <TextView android:textSize="10pt"
+ android:layout_toRightOf="@id/orbot_image"
+ android:layout_alignParentTop="true"
+ android:gravity="center_vertical"
+ android:layout_height="wrap_content"
+ android:id="@+id/WizardTextTitle"
+ android:layout_width="wrap_content"
+ android:fadingEdge="vertical"
+ android:text="TITLE"
+ android:textColor="#00ff00"
+ android:singleLine="true"
+
+
+
+ android:layout_centerInParent="true"
+ android:padding="20px">
+ </TextView>
+ </RelativeLayout>
+<TableLayout android:id="@+id/TableLayout01" android:stretchColumns="*" android:layout_height="fill_parent" android:layout_width="wrap_content">
+
+<TableRow android:id="@+id/TableRow01" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="fill_parent">
+
+
+ <ScrollView android:id="@+id/helpscrollview"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_span="3">
+ <LinearLayout android:layout_width="wrap_content" android:id="@+id/linearLayout1" android:layout_height="wrap_content" android:orientation="vertical">
+ <TextView android:layout_width="wrap_content" android:textColor="#ffffff" android:layout_height="wrap_content" android:background="#222222" android:textSize="8pt" android:padding="6px" android:id="@+id/WizardTextBody1" android:text="this is sample text this is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample text"></TextView>
+ <Button android:layout_width="wrap_content" android:visibility="gone" android:layout_height="wrap_content" android:gravity="center" android:text="Grant Permission" android:id="@+id/grantPermissions" android:layout_gravity="center"></Button>
+ <TextView android:layout_width="wrap_content" android:visibility="gone" android:textColor="#ffffff" android:layout_height="wrap_content" android:background="#222222" android:textSize="8pt" android:padding="6px" android:id="@+id/WizardTextBody2" android:text="this is sample text this is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample text"></TextView>
+ </LinearLayout>
+
+ </ScrollView>
+
+</TableRow>
+<TableRow android:id="@+id/TableRow01" android:textColor="#00ff00" android:layout_width="fill_parent" android:layout_height="30px">
+ <Button android:text="Back" android:id="@+id/btnWizard1" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content"></Button>
+ <Button android:text="Next" android:id="@+id/btnWizard2" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content"></Button>
+</TableRow>
+</TableLayout>
+</LinearLayout>
+
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2212f49..f4ca03c 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -137,6 +137,9 @@
<string name="wizard_warning_msg">Simply installing Orbot will not automatically anonymize your mobile traffic.\nPlease follow the following steps to get started</string>
<!-- Permissions screen -->
<string name="wizard_permissions_title">Permissions</string>
+ <string name="wizard_permissions_root_msg1">Orbot has detected that you have root permissions enabled. To enable \'Transparent Proxying\', please grant superuser privileges to Orbot</string>
+ <string name="wizard_permissions_root_msg2">If you choose to continue without providing superuser privileges, make sure to use apps made to work with orbot</string>
+ <string name="wizard_permissions_msg">Orbot has detected that you do not have root permissions.\nTransparent Proxying is not possible without superuser privileges.\nMake sure to use apps that have been configured to work with Orbot</string>
</resources>
diff --git a/src/org/torproject/android/LotsaText.java b/src/org/torproject/android/LotsaText.java
index d044c57..e9fc556 100644
--- a/src/org/torproject/android/LotsaText.java
+++ b/src/org/torproject/android/LotsaText.java
@@ -2,6 +2,7 @@ package org.torproject.android;
import android.app.Activity;
import android.content.Context;
+import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
@@ -24,13 +25,10 @@ public class LotsaText extends Activity implements TorConstants{
protected void onStart() {
super.onStart();
+ setContentView(R.layout.scrollingtext_buttons_view);
-
- if (step == -1)
- {
- setContentView(R.layout.scrollingtext_buttons_view);
- stepOne();
- }
+ stepOne();
+
}
@Override
@@ -52,7 +50,6 @@ public class LotsaText extends Activity implements TorConstants{
*/
private void stepOne() {
- step++;
//setContentView(R.layout.scrollingtext_buttons_view);
String title = context.getString(R.string.wizard_title);
@@ -82,7 +79,7 @@ public class LotsaText extends Activity implements TorConstants{
}
private void stepTwo() {
- step++;
+ step=0;
setContentView(R.layout.scrollingtext_buttons_view);
String title = context.getString(R.string.wizard_warning_title);
@@ -114,9 +111,11 @@ public class LotsaText extends Activity implements TorConstants{
@Override
public void onClick(View v) {
- //stepThree();
+ startActivityForResult(new Intent(getBaseContext(), Permissions.class), 1);
}
});
}
+
+
}
\ No newline at end of file
diff --git a/src/org/torproject/android/Permissions.java b/src/org/torproject/android/Permissions.java
new file mode 100644
index 0000000..bd96e56
--- /dev/null
+++ b/src/org/torproject/android/Permissions.java
@@ -0,0 +1,176 @@
+package org.torproject.android;
+
+import org.torproject.android.service.TorService;
+import org.torproject.android.service.TorServiceUtils;
+import org.torproject.android.service.TorTransProxy;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.SharedPreferences.Editor;
+import android.os.Bundle;
+import android.preference.PreferenceManager;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.TextView;
+import android.widget.Toast;
+
+public class Permissions 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_permissions);
+
+ stepThree();
+
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+
+
+ }
+
+ private void stepThree(){
+
+ boolean hasRoot = TorServiceUtils.checkRootAccess();
+
+ if (hasRoot)
+ {
+ try {
+ int resp = TorTransProxy.testOwnerModule(context);
+
+ if (resp < 0)
+ {
+ hasRoot = false;
+ Toast.makeText(context, "ERROR: IPTables OWNER module not available", Toast.LENGTH_LONG).show();
+
+ Log.i(TorService.TAG,"ERROR: IPTables OWNER module not available");
+ }
+
+ } catch (Exception e) {
+
+ hasRoot = false;
+ Log.d(TorService.TAG,"ERROR: IPTables OWNER module not available",e);
+ }
+ }
+
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+
+ Editor pEdit = prefs.edit();
+ pEdit.putBoolean("has_root",hasRoot);
+ pEdit.commit();
+
+ if (hasRoot)
+ {
+ Toast.makeText(context, "Has Root", Toast.LENGTH_SHORT).show();
+ stepFourRoot();
+ }
+ else
+ {
+ Toast.makeText(context, "Unable to get root access", Toast.LENGTH_LONG).show();
+ stepFour();
+ }
+
+ }
+
+ private void stepFourRoot(){
+
+ String title = context.getString(R.string.wizard_permissions_title);
+ String msg1 = context.getString(R.string.wizard_permissions_root_msg1);
+ String msg2 = context.getString(R.string.wizard_permissions_root_msg2);
+
+ TextView txtTitle = ((TextView)findViewById(R.id.WizardTextTitle));
+ txtTitle.setText(title);
+
+ TextView txtBody1 = ((TextView)findViewById(R.id.WizardTextBody1));
+ txtBody1.setText(msg1);
+
+
+ TextView txtBody2 = ((TextView)findViewById(R.id.WizardTextBody2));
+ txtBody2.setText(msg2);
+ txtBody2.setVisibility(TextView.VISIBLE);
+
+ Button grantPermissions = ((Button)findViewById(R.id.grantPermissions));
+ grantPermissions.setVisibility(Button.VISIBLE);
+
+ Button back = ((Button)findViewById(R.id.btnWizard1));
+ Button next = ((Button)findViewById(R.id.btnWizard2));
+
+ grantPermissions.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ //Check and Install iptables
+
+ }
+ });
+
+ back.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+
+ startActivityForResult(new Intent(getBaseContext(), LotsaText.class), 1);
+ }
+ });
+
+ next.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ //Tips Screen
+ }
+ });
+
+ }
+
+ private void stepFour(){
+
+
+ String title = context.getString(R.string.wizard_permissions_title);
+ String msg = context.getString(R.string.wizard_permissions_msg);
+
+ TextView txtTitle = ((TextView)findViewById(R.id.WizardTextTitle));
+ txtTitle.setText(title);
+
+ TextView txtBody = ((TextView)findViewById(R.id.WizardTextBody));
+ txtBody.setText(msg);
+
+ Button btn1 = ((Button)findViewById(R.id.btnWizard1));
+ Button btn2 = ((Button)findViewById(R.id.btnWizard2));
+
+ btn1.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+
+ startActivityForResult(new Intent(getBaseContext(), LotsaText.class), 1);
+ }
+ });
+
+ btn2.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ //Tips Screen
+ }
+ });
+ }
+
+
+}
\ No newline at end of file
1
0
commit 991b2d72706f093852ddbf54cef5a27b6d53dc99
Author: Sathyanarayanan Gunasekaran <gsathya.ceg(a)gmail.com>
Date: Tue Jun 7 13:04:09 2011 +0530
Added missing icons
---
res/drawable/icon_firefox.png | Bin 0 -> 9233 bytes
res/drawable/icon_orweb.png | Bin 8783 -> 0 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/res/drawable/icon_firefox.png b/res/drawable/icon_firefox.png
new file mode 100644
index 0000000..27b0cf4
Binary files /dev/null and b/res/drawable/icon_firefox.png differ
diff --git a/res/drawable/icon_orweb.png b/res/drawable/icon_orweb.png
deleted file mode 100755
index 679986f..0000000
Binary files a/res/drawable/icon_orweb.png and /dev/null differ
1
0
commit 22118bc38280bdf3d375018dac1c0de743b75ec0
Author: Sathyanarayanan Gunasekaran <gsathya.ceg(a)gmail.com>
Date: Mon Jun 6 02:25:18 2011 +0530
Tips and Tricks screen added
---
res/drawable/icon_otrchat.png | Bin 4610 -> 0 bytes
res/layout/layout_wizard_tips.xml | 63 +++++++++++++--
res/values/strings.xml | 13 ++-
src/org/torproject/android/Permissions.java | 4 +-
src/org/torproject/android/TipsAndTricks.java | 103 +++++++++++++++++++++++++
5 files changed, 168 insertions(+), 15 deletions(-)
diff --git a/res/drawable/icon_otrchat.png b/res/drawable/icon_otrchat.png
deleted file mode 100755
index 08171ab..0000000
Binary files a/res/drawable/icon_otrchat.png and /dev/null differ
diff --git a/res/layout/layout_wizard_tips.xml b/res/layout/layout_wizard_tips.xml
index 19aaef0..60cba51 100644
--- a/res/layout/layout_wizard_tips.xml
+++ b/res/layout/layout_wizard_tips.xml
@@ -1,15 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
- android:layout_height="wrap_content">
+ android:layout_height="fill_parent"
+ android:background="@drawable/background">
+
+<RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/relativeLayout1"
+ android:layout_gravity="center_horizontal">
+ <ImageView
+ android:src="@drawable/tor"
+ android:id="@+id/orbot_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:paddingLeft="20px" android:paddingRight="20px" >
+ </ImageView>
+ <TextView android:textSize="10pt"
+ android:layout_toRightOf="@id/orbot_image"
+ android:layout_alignParentTop="true"
+ android:gravity="center_vertical"
+ android:layout_height="wrap_content"
+ android:id="@+id/WizardTextTitle"
+ android:layout_width="wrap_content"
+ android:fadingEdge="vertical"
+ android:text="TITLE"
+ android:textColor="#00ff00"
+ android:singleLine="true"
+
+
+
+ android:layout_centerInParent="true"
+ android:padding="20px">
+ </TextView>
+ </RelativeLayout>
+<TableLayout android:id="@+id/TableLayout01" android:stretchColumns="*" android:layout_height="fill_parent" android:layout_width="wrap_content">
+
+<TableRow android:id="@+id/TableRow01" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="fill_parent">
+
+
<ScrollView android:id="@+id/helpscrollview"
android:orientation="vertical"
android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <LinearLayout
+ android:layout_height="fill_parent"
+ android:layout_span="3">
+
+<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@@ -17,13 +56,21 @@
<TextView android:text="@string/wizard_tips_msg" android:layout_gravity="left" android:textColor="#ffffff" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
-<Button android:text="@string/wizard_tips_otrchat" android:layout_gravity="left" android:drawableLeft="@drawable/ic_launcher_gibberbot" android:layout_marginTop="10px" android:id="@+id/WizardRootButtonInstallOtrchat" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
+<Button android:text="@string/wizard_tips_gibberbot" android:layout_gravity="left" android:drawableLeft="@drawable/ic_launcher_gibberbot" android:layout_marginTop="10px" android:id="@+id/WizardRootButtonInstallGibberbot" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
-<Button android:text="@string/wizard_tips_orweb" android:drawableLeft="@drawable/icon_orweb" android:layout_marginTop="10px" android:id="@+id/WizardRootButtonInstallOrweb" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
+<Button android:text="@string/wizard_tips_firefox" android:layout_gravity="left" android:drawableLeft="@drawable/icon_firefox" android:layout_marginTop="10px" android:id="@+id/WizardRootButtonInstallFirefox" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
-<Button android:text="@string/wizard_tips_proxy" android:layout_marginTop="10px" android:id="@+id/WizardRootButtonProxyHelp" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
+<Button android:text="@string/wizard_tips_proxymob" android:layout_marginTop="10px" android:id="@+id/WizardRootButtonInstallProxyMob" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
</LinearLayout>
- </ScrollView>
+ </ScrollView>
+
+</TableRow>
+<TableRow android:id="@+id/TableRow01" android:textColor="#00ff00" android:layout_width="fill_parent" android:layout_height="30px">
+ <Button android:text="Back" android:id="@+id/btnWizard1" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content"></Button>
+ <Button android:text="Next" android:id="@+id/btnWizard2" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content"></Button>
+</TableRow>
+</TableLayout>
</LinearLayout>
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f4ca03c..25e253d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -99,7 +99,6 @@
<string name="wizard_tips_tricks">Orbot-enabled Apps</string>
<string name="wizard_tips_msg">We encourage you to download & use apps that know how to connect directly to Orbot. Click on the buttons below to install.</string>
- <string name="wizard_tips_otrchat">Gibberbot - Secure instant messaging client for Android</string>
<string name="wizard_tips_orweb">ORWEB (Android 1.x Only) - Browser designed for privacy & for Orbot</string>
<string name="wizard_tips_proxy">Proxy Settings - Learn how to configure apps to work with Orbot</string>
@@ -113,8 +112,6 @@
<string name="wizard_final">Orbot is ready!</string>
<string name="wizard_final_msg">Hundreds of thousands of people around the world use Tor for a wide variety of reasons: journalists and bloggers, human rights workers, law enforcement officers, soldiers, corporations, citizens of repressive regimes, and just ordinary citizens... and now you are ready to, as well!</string>
- <string name="otrchat_apk_url">market://search?q=pname:info.guardianproject.otr.app.im</string>
- <string name="orweb_apk_url">market://search?q=pname:nfo.guardianproject.browser</string>
<!-- END Welcome Wizard strings (DJH) -->
@@ -140,6 +137,12 @@
<string name="wizard_permissions_root_msg1">Orbot has detected that you have root permissions enabled. To enable \'Transparent Proxying\', please grant superuser privileges to Orbot</string>
<string name="wizard_permissions_root_msg2">If you choose to continue without providing superuser privileges, make sure to use apps made to work with orbot</string>
<string name="wizard_permissions_msg">Orbot has detected that you do not have root permissions.\nTransparent Proxying is not possible without superuser privileges.\nMake sure to use apps that have been configured to work with Orbot</string>
-
-
+ <!-- TipsAndTricks screen -->
+ <string name="wizard_tips_gibberbot">Gibberbot - Secure instant messaging client for Android</string>
+ <string name="wizard_tips_firefox">Firefox - Android browser - To be used along with ProxyMob Add-on </string>
+ <string name="wizard_tips_proxymob">ProxyMob - Simple Firefox Add-on for setting HTTP, SOCKS and SSL proxy settings</string>
+ <string name="gibberbot_apk_url">https://market.android.com/details?id=info.guardianproject.otr.app.im</string>
+ <string name="firefox_apk_url">https://market.android.com/details?id=org.mozilla.firefox</string>
+ <string name="proxymob_url">https://addons.mozilla.org/mobile/downloads/latest/251558/type:attachment/a…</string>
+
</resources>
diff --git a/src/org/torproject/android/Permissions.java b/src/org/torproject/android/Permissions.java
index bd96e56..996a1dc 100644
--- a/src/org/torproject/android/Permissions.java
+++ b/src/org/torproject/android/Permissions.java
@@ -133,7 +133,7 @@ public class Permissions extends Activity implements TorConstants {
@Override
public void onClick(View v) {
- //Tips Screen
+ startActivityForResult(new Intent(getBaseContext(), TipsAndTricks.class), 1);
}
});
@@ -167,7 +167,7 @@ public class Permissions extends Activity implements TorConstants {
@Override
public void onClick(View v) {
- //Tips Screen
+ startActivityForResult(new Intent(getBaseContext(), TipsAndTricks.class), 1);
}
});
}
diff --git a/src/org/torproject/android/TipsAndTricks.java b/src/org/torproject/android/TipsAndTricks.java
new file mode 100644
index 0000000..c4aba96
--- /dev/null
+++ b/src/org/torproject/android/TipsAndTricks.java
@@ -0,0 +1,103 @@
+package org.torproject.android;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+
+public class TipsAndTricks 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_tips);
+
+ //stepFive();
+
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+
+
+ }
+
+ void stepFive(){
+
+
+
+ Button btn1 = (Button)findViewById(R.id.WizardRootButtonInstallGibberbot);
+
+ btn1.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View view) {
+
+ String url = context.getString(R.string.gibberbot_apk_url);
+ context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+
+ }
+ });
+
+ Button btn2 = (Button)findViewById(R.id.WizardRootButtonInstallFirefox);
+
+ btn2.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View view) {
+
+ String url = context.getString(R.string.firefox_apk_url);
+ context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+
+ }
+ });
+
+ Button btn3 = (Button)findViewById(R.id.WizardRootButtonInstallProxyMob);
+
+ btn3.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View view) {
+
+ String url = context.getString(R.string.proxymob_url);
+ context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+ }
+ });
+
+ 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) {
+ //Finsh Screen
+ }
+ });
+
+ }
+}
\ No newline at end of file
1
0
commit c9c35ead48b0453458e91b64810bb3971ff195d1
Author: Sathyanarayanan Gunasekaran <gsathya.ceg(a)gmail.com>
Date: Mon Jun 6 02:39:52 2011 +0530
Updated AndroidManifest, Tips Screen
---
AndroidManifest.xml | 1 +
res/values/strings.xml | 1 +
src/org/torproject/android/TipsAndTricks.java | 9 ++++++---
src/org/torproject/android/WizardHelper.java | 6 +++---
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index be3c43f..ad48d9d 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -31,6 +31,7 @@
<activity android:name=".LotsaText"/>
<activity android:name=".Permissions"/>
+ <activity android:name=".TipsAndTricks"/>
<activity android:name=".SettingsPreferences" android:label="@string/app_name"/>
<activity android:name=".AppManager" android:label="@string/app_name"/>
<activity android:name=".WizardActivity" android:label="@string/app_name"/>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 25e253d..0bf8286 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -138,6 +138,7 @@
<string name="wizard_permissions_root_msg2">If you choose to continue without providing superuser privileges, make sure to use apps made to work with orbot</string>
<string name="wizard_permissions_msg">Orbot has detected that you do not have root permissions.\nTransparent Proxying is not possible without superuser privileges.\nMake sure to use apps that have been configured to work with Orbot</string>
<!-- TipsAndTricks screen -->
+ <string name="wizard_tips_title">Orbot configured Apps</string>
<string name="wizard_tips_gibberbot">Gibberbot - Secure instant messaging client for Android</string>
<string name="wizard_tips_firefox">Firefox - Android browser - To be used along with ProxyMob Add-on </string>
<string name="wizard_tips_proxymob">ProxyMob - Simple Firefox Add-on for setting HTTP, SOCKS and SSL proxy settings</string>
diff --git a/src/org/torproject/android/TipsAndTricks.java b/src/org/torproject/android/TipsAndTricks.java
index c4aba96..a3aa1ef 100644
--- a/src/org/torproject/android/TipsAndTricks.java
+++ b/src/org/torproject/android/TipsAndTricks.java
@@ -8,6 +8,7 @@ import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
+import android.widget.TextView;
public class TipsAndTricks extends Activity implements TorConstants {
@@ -26,7 +27,7 @@ public class TipsAndTricks extends Activity implements TorConstants {
super.onStart();
setContentView(R.layout.layout_wizard_tips);
- //stepFive();
+ stepFive();
}
@@ -39,8 +40,10 @@ public class TipsAndTricks extends Activity implements TorConstants {
void stepFive(){
-
-
+ String title = context.getString(R.string.wizard_tips_title);
+ TextView txtTitle = ((TextView)findViewById(R.id.WizardTextTitle));
+ txtTitle.setText(title);
+
Button btn1 = (Button)findViewById(R.id.WizardRootButtonInstallGibberbot);
btn1.setOnClickListener(new OnClickListener() {
diff --git a/src/org/torproject/android/WizardHelper.java b/src/org/torproject/android/WizardHelper.java
index c3fa3c0..684a730 100644
--- a/src/org/torproject/android/WizardHelper.java
+++ b/src/org/torproject/android/WizardHelper.java
@@ -215,7 +215,7 @@ public class WizardHelper implements TorConstants {
LayoutInflater li = LayoutInflater.from(context);
View view = li.inflate(R.layout.layout_wizard_tips, null);
- Button btn1 = (Button)view.findViewById(R.id.WizardRootButtonInstallOtrchat);
+ Button btn1 = (Button)view.findViewById(R.id.WizardRootButtonInstallGibberbot);
btn1.setOnClickListener(new OnClickListener() {
@@ -228,7 +228,7 @@ public class WizardHelper implements TorConstants {
}
});
- Button btn2 = (Button)view.findViewById(R.id.WizardRootButtonInstallOrweb);
+ Button btn2 = (Button)view.findViewById(R.id.WizardRootButtonInstallFirefox);
btn2.setOnClickListener(new OnClickListener() {
@@ -241,7 +241,7 @@ public class WizardHelper implements TorConstants {
}
});
- Button btn3 = (Button)view.findViewById(R.id.WizardRootButtonProxyHelp);
+ Button btn3 = (Button)view.findViewById(R.id.WizardRootButtonInstallProxyMob);
btn3.setOnClickListener(new OnClickListener() {
1
0
28 Oct '11
commit 4f333e370d68a3606a0f39c5a610276d959ce00d
Author: Sathyanarayanan Gunasekaran <gsathya.ceg(a)gmail.com>
Date: Fri Jun 10 00:31:35 2011 +0530
Updated Permissions and Transproxy screens
Included a checkbox in Permission screen to account for
users who do not wish to grant root permissions.
Updated radio buttons in Transproxy screen
---
res/layout/layout_wizard_permissions.xml | 1 +
res/layout/layout_wizard_root.xml | 17 ++++++---
res/values/strings.xml | 2 +-
.../torproject/android/ConfigureTransProxy.java | 24 ++++++++++++--
src/org/torproject/android/Permissions.java | 35 ++++++++++++++++++++
5 files changed, 69 insertions(+), 10 deletions(-)
diff --git a/res/layout/layout_wizard_permissions.xml b/res/layout/layout_wizard_permissions.xml
index f7ecab8..168968b 100644
--- a/res/layout/layout_wizard_permissions.xml
+++ b/res/layout/layout_wizard_permissions.xml
@@ -39,6 +39,7 @@
<TextView android:layout_width="wrap_content" android:textColor="#ffffff" android:layout_height="wrap_content" android:background="#222222" android:textSize="8pt" android:padding="6px" android:id="@+id/WizardTextBody1" android:text="this is sample text this is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample text"></TextView>
<Button android:layout_width="wrap_content" android:visibility="gone" android:layout_height="wrap_content" android:gravity="center" android:text="Grant Permission" android:id="@+id/grantPermissions" android:layout_gravity="center"></Button>
<TextView android:layout_width="wrap_content" android:visibility="gone" android:textColor="#ffffff" android:layout_height="wrap_content" android:background="#222222" android:textSize="8pt" android:padding="6px" android:id="@+id/WizardTextBody2" android:text="this is sample text this is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample textthis is sample text"></TextView>
+ <CheckBox android:id="@+id/checkBox" android:visibility="gone" android:layout_gravity="center" android:text="@string/wizard_permissions_consent" android:layout_height="wrap_content" android:layout_width="wrap_content"></CheckBox>
</LinearLayout>
</ScrollView>
diff --git a/res/layout/layout_wizard_root.xml b/res/layout/layout_wizard_root.xml
index 62afa38..afe6005 100644
--- a/res/layout/layout_wizard_root.xml
+++ b/res/layout/layout_wizard_root.xml
@@ -41,12 +41,17 @@
android:layout_height="fill_parent"
android:padding="3px">
<TextView android:text="@string/wizard_transproxy_msg" android:textColor="#ffffff" android:id="@+id/WizardRootTextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
-
-
-<CheckBox android:layout_marginTop="20px" android:text="@string/wizard_configure_all" android:id="@+id/WizardRootCheckBox01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"></CheckBox>
-<TextView android:text="@string/wizard_transproxy_hint" android:textColor="#ffffff" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingBottom="20dip"></TextView>
-
-<Button android:text="@string/wizard_configure_select_apps" android:id="@+id/WizardRootButton01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"/>
+<RadioGroup android:id="@+id/radioGroup" android:layout_height="wrap_content" android:layout_width="wrap_content">
+ <RadioButton android:checked="true" android:text="@string/wizard_configure_all" android:id="@+id/radio0" android:layout_height="wrap_content" android:layout_width="wrap_content"></RadioButton>
+ <TextView android:layout_height="wrap_content"
+ android:text="@string/wizard_transproxy_hint"
+ android:layout_width="wrap_content"
+ android:textSize="15sp"
+ android:paddingBottom="10dip">
+ </TextView>
+ <RadioButton android:text="@string/wizard_configure_select_apps" android:id="@+id/radio1" android:layout_height="wrap_content" android:layout_width="wrap_content"></RadioButton>
+ <RadioButton android:text="@string/wizard_transproxy_none" android:id="@+id/radio2" android:layout_height="wrap_content" android:layout_width="wrap_content"></RadioButton>
+</RadioGroup>
</LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index daf8f3c..af22a49 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -88,7 +88,6 @@
<string name="wizard_permissions_msg_stock"> While it is not required, Orbot can become a more powerful tool if your device has root access. Use the button below to grant Orbot superpowers! </string>
<string name="wizard_permissions_no_root">If you don\'t have root access or have no idea what we\'re talking about, just be sure to use apps made to work with Orbot.</string>
- <string name="wizard_permissions_consent">I understand and would like to continue without root</string>
<string name="wizard_permission_enable_root">Grant Root for Orbot</string>
<string name="wizard_configure">Configure Torification</string>
@@ -137,6 +136,7 @@
<string name="wizard_permissions_root_msg1">Orbot has detected that you have root permissions enabled. To enable \'Transparent Proxying\', please grant superuser privileges to Orbot</string>
<string name="wizard_permissions_root_msg2">If you choose to continue without providing superuser privileges, make sure to use apps made to work with orbot</string>
<string name="wizard_permissions_msg">Orbot has detected that you do not have root permissions.\nTransparent Proxying is not possible without superuser privileges.\nMake sure to use apps that have been configured to work with Orbot</string>
+ <string name="wizard_permissions_consent">I understand and would like to continue without root</string>
<!-- TipsAndTricks screen -->
<string name="wizard_tips_title">Orbot configured Apps</string>
<string name="wizard_tips_gibberbot">Gibberbot - Secure instant messaging client for Android</string>
diff --git a/src/org/torproject/android/ConfigureTransProxy.java b/src/org/torproject/android/ConfigureTransProxy.java
index 3969dbb..3f0f31c 100644
--- a/src/org/torproject/android/ConfigureTransProxy.java
+++ b/src/org/torproject/android/ConfigureTransProxy.java
@@ -24,7 +24,8 @@ import android.widget.Toast;
public class ConfigureTransProxy extends Activity implements TorConstants {
private Context context;
- private int flag =0;
+ private int flag = 0;
+
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
@@ -63,8 +64,15 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId){
-
- flag = 0;
+ Button next = ((Button)findViewById(R.id.btnWizard2));
+ next.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+
+ showWizardFinal();
+ }
+ });
RadioButton rb0 = (RadioButton)findViewById(R.id.radio0);
RadioButton rb1 = (RadioButton)findViewById(R.id.radio1);
@@ -90,6 +98,16 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
pEdit1.putBoolean(PREF_TRANSPARENT_ALL, false);
pEdit1.commit();
+ next.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+
+ context.startActivity(new Intent(context, AppManager.class));
+
+
+ }
+ });
}
diff --git a/src/org/torproject/android/Permissions.java b/src/org/torproject/android/Permissions.java
index a37d3c3..a29b04a 100644
--- a/src/org/torproject/android/Permissions.java
+++ b/src/org/torproject/android/Permissions.java
@@ -14,6 +14,9 @@ import android.preference.PreferenceManager;
import android.util.Log;
import android.view.View;
import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.TextView;
import android.widget.Toast;
@@ -110,6 +113,38 @@ public class Permissions extends Activity implements TorConstants {
Button back = ((Button)findViewById(R.id.btnWizard1));
Button next = ((Button)findViewById(R.id.btnWizard2));
+ next.setClickable(false);
+
+ CheckBox consent = (CheckBox)findViewById(R.id.checkBox);
+ consent.setVisibility(CheckBox.VISIBLE);
+
+ consent.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();
+
+ Button next = ((Button)findViewById(R.id.btnWizard2));
+ if(isChecked)
+ next.setClickable(true);
+ else
+ next.setClickable(false);
+
+
+ }
+
+ });
+
grantPermissions.setOnClickListener(new View.OnClickListener() {
1
0
commit 86727d6298766816bccbd5f58e91fd58f6846786
Author: Sathyanarayanan Gunasekaran <gsathya.ceg(a)gmail.com>
Date: Thu Jun 9 01:31:32 2011 +0530
Updated Transproxy screen
---
res/values/strings.xml | 1 +
.../torproject/android/ConfigureTransProxy.java | 81 ++++++++++---------
src/org/torproject/android/Permissions.java | 2 +-
3 files changed, 45 insertions(+), 39 deletions(-)
diff --git a/res/values/strings.xml b/res/values/strings.xml
index da4cca3..daf8f3c 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -149,4 +149,5 @@
<string name="wizard_transproxy_title">Transparent Proxy</string>
<string name="wizard_transproxy_msg">Transparent Proxying allows you to redirect client requests without any special configuration or knowledge at the client.</string>
<string name="wizard_transproxy_hint">(Check this box if you have no idea what we are talking about)</string>
+ <string name="wizard_transproxy_none">None</string>
</resources>
diff --git a/src/org/torproject/android/ConfigureTransProxy.java b/src/org/torproject/android/ConfigureTransProxy.java
index 8ff6dad..3969dbb 100644
--- a/src/org/torproject/android/ConfigureTransProxy.java
+++ b/src/org/torproject/android/ConfigureTransProxy.java
@@ -15,13 +15,16 @@ import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.widget.Toast;
public class ConfigureTransProxy extends Activity implements TorConstants {
private Context context;
-
+ private int flag =0;
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
@@ -46,55 +49,53 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
}
+
+
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);
+ RadioGroup mRadioGroup = (RadioGroup)findViewById(R.id.radioGroup);
+ mRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener (){
+
- cb1.setOnCheckedChangeListener(new OnCheckedChangeListener (){
+ @Override
+ public void onCheckedChanged(RadioGroup group, int checkedId){
+
+ flag = 0;
+
+ RadioButton rb0 = (RadioButton)findViewById(R.id.radio0);
+ RadioButton rb1 = (RadioButton)findViewById(R.id.radio1);
+ RadioButton rb2 = (RadioButton)findViewById(R.id.radio2);
- @Override
- public void onCheckedChanged(CompoundButton buttonView,
- boolean isChecked) {
-
-
- SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
Editor pEdit = prefs.edit();
-
- pEdit.putBoolean(PREF_TRANSPARENT, isChecked);
- pEdit.putBoolean(PREF_TRANSPARENT_ALL, isChecked);
-
+
+ pEdit.putBoolean(PREF_TRANSPARENT, rb0.isChecked());
+ pEdit.putBoolean(PREF_TRANSPARENT_ALL, rb0.isChecked());
+
pEdit.commit();
-
- }
-
+
+
+ if(rb1.isChecked())
+ {
+ flag = 1;
+ SharedPreferences prefs1 = PreferenceManager.getDefaultSharedPreferences(context);
+
+ Editor pEdit1 = prefs1.edit();
+ pEdit1.putBoolean(PREF_TRANSPARENT, true);
+ pEdit1.putBoolean(PREF_TRANSPARENT_ALL, false);
+ pEdit1.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));
@@ -111,7 +112,11 @@ public class ConfigureTransProxy extends Activity implements TorConstants {
@Override
public void onClick(View v) {
- showWizardFinal();
+ if( flag == 1 )
+ context.startActivity(new Intent(context, AppManager.class));
+
+ else
+ showWizardFinal();
}
});
}
diff --git a/src/org/torproject/android/Permissions.java b/src/org/torproject/android/Permissions.java
index 248fd96..a37d3c3 100644
--- a/src/org/torproject/android/Permissions.java
+++ b/src/org/torproject/android/Permissions.java
@@ -115,7 +115,7 @@ public class Permissions extends Activity implements TorConstants {
@Override
public void onClick(View v) {
- //Check and Install iptables
+ //Check and Install iptables - orTransProxy.testOwnerModule(this)
startActivityForResult(new Intent(getBaseContext(), ConfigureTransProxy.class), 1);
1
0