added proxy settings help screen and fixed processSettings() NPE

svn:r22852
This commit is contained in:
Nathan Freitas 2010-08-10 16:43:32 +00:00
parent 2bc9aa6c57
commit 039091770e
7 changed files with 172 additions and 91 deletions

View File

@ -47,6 +47,4 @@
</manifest> </manifest>

View File

@ -1,8 +1,12 @@
NOTE: Specific #s below correspond to Trac tickets logged and maintained at https://trac.torproject.org/projects/tor/ NOTE: Specific #s below correspond to Trac tickets logged and maintained at https://trac.torproject.org/projects/tor/
1.0.0 - 2010-08-10
- Added "Proxy Settings" help screen
- Handle potential null pointers on process settings where service not yet active
0.0.9x - 2010-08-03 0.0.9x - 2010-08-03
- Revised Orbot install wizard - Revised Orbot install wizard
- Integrated Tor 0.2.2.14 binary - Integrated Tor 0.2.2.14 and iptables 4.x binary
- Fixed "got root" detection method - Fixed "got root" detection method
- Fixed Per App Torification handling so it updates on exit from Settings screen - Fixed Per App Torification handling so it updates on exit from Settings screen

View File

@ -10,5 +10,5 @@
# Indicates whether an apk should be generated for each density. # Indicates whether an apk should be generated for each density.
split.density=false split.density=false
# Project target. # Project target.
target=Google Inc.:Google APIs:3 target=android-3
apk-configurations= apk-configurations=

View File

@ -21,7 +21,7 @@
<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_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_proxy" android:layout_marginTop="10px" android:id="@+id/WizardRootButtonInstallOrweb" 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"/>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

View File

@ -96,7 +96,15 @@ and all DNS requests. This includes the built-in Browser, Gmail, YouTube and Map
<string name="wizard_tips_msg">We encourage you to download &amp; use apps that know how to connect directly to Orbot. Click on the buttons below to install.</string> <string name="wizard_tips_msg">We encourage you to download &amp; use apps that know how to connect directly to Orbot. Click on the buttons below to install.</string>
<string name="wizard_tips_otrchat">OTRCHAT - Secure instant messaging client for Android</string> <string name="wizard_tips_otrchat">OTRCHAT - Secure instant messaging client for Android</string>
<string name="wizard_tips_orweb">ORWEB (Android 1.x Only) - Browser designed for privacy &amp; for Orbot</string> <string name="wizard_tips_orweb">ORWEB (Android 1.x Only) - Browser designed for privacy &amp; for Orbot</string>
<string name="wizard_tips_proxy">Proxy Help - Learn how to configure apps to work with Orbot</string> <string name="wizard_tips_proxy">Proxy Settings - Learn how to configure apps to work with Orbot</string>
<string name="wizard_proxy_help_info">Proxy Settings</string>
<string name="wizard_proxy_help_msg">If the Android app you are using can support the use of an HTTP or SOCKS proxy, then you can configure it to connect to Orbot and use Tor.\n\n
The host settings is 127.0.0.1 or "localhost". For HTTP, the port setting is 8118. For SOCKS, the proxy is 9050. You should use SOCKS4A or SOCKS5 if possible.
\n\n
You can learn more about proxying on Android via the FAQ at: http://tinyurl.com/proxyandroid
</string>
<string name="wizard_final">Orbot is ready!</string> <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="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>

View File

@ -32,6 +32,7 @@ import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.animation.Animation; import android.view.animation.Animation;
@ -398,12 +399,16 @@ public class Orbot extends Activity implements OnClickListener, TorConstants
private void processSettings () throws RemoteException private void processSettings () throws RemoteException
{ {
try
{
if (mService == null)
return; //nothing to do if the service isn't connected yet
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean useBridges = prefs.getBoolean(PREF_BRIDGES_ENABLED, false); boolean useBridges = prefs.getBoolean(PREF_BRIDGES_ENABLED, false);
boolean autoUpdateBridges = prefs.getBoolean(PREF_BRIDGES_UPDATED, false); //boolean autoUpdateBridges = prefs.getBoolean(PREF_BRIDGES_UPDATED, false);
boolean becomeRelay = prefs.getBoolean(PREF_OR, false); boolean becomeRelay = prefs.getBoolean(PREF_OR, false);
@ -490,7 +495,17 @@ public class Orbot extends Activity implements OnClickListener, TorConstants
return; return;
} }
if (mService != null)
mService.saveConfiguration(); mService.saveConfiguration();
}
catch (Exception e)
{
showAlert("Uh-oh!","There was an error updating your settings");
Log.w(TAG, "processSettings()", e);
return;
}
} }
@ -623,15 +638,9 @@ public class Orbot extends Activity implements OnClickListener, TorConstants
} }
/*
* (non-Javadoc)
* @see android.view.View.OnClickListener#onClick(android.view.View)
*/
public void onClick(View view) {
// the start button @Override
if (view.getId()==R.id.imgStatus || view.getId()==R.id.lblStatus) public boolean onTouchEvent(MotionEvent event) {
{
try try
{ {
@ -658,8 +667,46 @@ public class Orbot extends Activity implements OnClickListener, TorConstants
Log.i(TAG,"error onclick",e); Log.i(TAG,"error onclick",e);
} }
return super.onTouchEvent(event);
} }
/*
* (non-Javadoc)
* @see android.view.View.OnClickListener#onClick(android.view.View)
*/
public void onClick(View view) {
// the start button
// if (view.getId()==R.id.imgStatus || view.getId()==R.id.lblStatus)
// {
try
{
if (mService == null)
{
}
else if (mService.getStatus() == STATUS_READY)
{
startTor();
}
else
{
stopTor();
}
}
catch (Exception e)
{
Log.i(TAG,"error onclick",e);
}
// }
} }

View File

@ -207,6 +207,18 @@ public class WizardHelper implements TorConstants {
} }
}); });
Button btn3 = (Button)view.findViewById(R.id.WizardRootButtonProxyHelp);
btn3.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
showProxyHelp();
}
});
showCustomDialog(title, view,context.getString(R.string.btn_next),context.getString(R.string.btn_back),new DialogInterface.OnClickListener() { showCustomDialog(title, view,context.getString(R.string.btn_next),context.getString(R.string.btn_back),new DialogInterface.OnClickListener() {
@ -380,5 +392,17 @@ public class WizardHelper implements TorConstants {
.show(); .show();
} }
private void showProxyHelp ()
{
LayoutInflater li = LayoutInflater.from(context);
View view = li.inflate(R.layout.layout_wizard_proxy_help, null);
new AlertDialog.Builder(context)
.setTitle(context.getString(R.string.wizard_proxy_help_info))
.setView(view)
.show();
}
} }