diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 2e9aa21e..192acaf9 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -99,6 +99,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + --> + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/res/layout/layout_main.xml b/res/layout/layout_main.xml index c1a50c74..965e5993 100644 --- a/res/layout/layout_main.xml +++ b/res/layout/layout_main.xml @@ -1,77 +1,36 @@ - + + + + + - - - - - - - + --> + + + + + + + + + + - - - - - - - - - - - - - - - diff --git a/res/layout/layout_wizard_root.xml b/res/layout/layout_wizard_root.xml deleted file mode 100644 index cdda4f49..00000000 --- a/res/layout/layout_wizard_root.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/res/menu/main.xml b/res/menu/main.xml deleted file mode 100644 index 3c592b2f..00000000 --- a/res/menu/main.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/org/torproject/android/Orbot.java b/src/org/torproject/android/Orbot.java index d57eacf5..a55f53ed 100644 --- a/src/org/torproject/android/Orbot.java +++ b/src/org/torproject/android/Orbot.java @@ -4,6 +4,7 @@ package org.torproject.android; import static org.torproject.android.TorConstants.TAG; +import info.guardianproject.browser.Browser; import java.net.URLDecoder; import java.util.Locale; @@ -12,9 +13,7 @@ import org.torproject.android.service.TorService; import org.torproject.android.service.TorServiceConstants; import org.torproject.android.service.TorServiceUtils; import org.torproject.android.settings.SettingsPreferences; -import org.torproject.android.vpn.OrbotVpnService; import org.torproject.android.wizard.ChooseLocaleWizardActivity; -import org.torproject.android.wizard.TipsAndTricks; import android.annotation.TargetApi; import android.app.AlertDialog; @@ -22,7 +21,6 @@ import android.app.ProgressDialog; import android.content.BroadcastReceiver; import android.content.Context; import android.content.DialogInterface; -import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; @@ -41,9 +39,6 @@ import android.os.Message; import android.os.RemoteException; import android.support.v4.content.LocalBroadcastManager; import android.support.v7.app.ActionBarActivity; -import android.text.ClipboardManager; -import android.text.Layout; -import android.text.method.ScrollingMovementMethod; import android.util.Log; import android.view.GestureDetector; import android.view.GestureDetector.SimpleOnGestureListener; @@ -57,7 +52,6 @@ import android.view.View.OnLongClickListener; import android.view.View.OnTouchListener; import android.view.animation.AccelerateInterpolator; import android.widget.Button; -import android.widget.SlidingDrawer; import android.widget.TextView; import android.widget.Toast; @@ -65,16 +59,16 @@ import android.widget.Toast; public class Orbot extends ActionBarActivity implements TorConstants, OnLongClickListener, OnTouchListener, OnSharedPreferenceChangeListener { /* Useful UI bits */ - private TextView lblStatus = null; //the main text display widget + //private TextView lblStatus = null; //the main text display widget private ImageProgressView imgStatus = null; //the main touchable image for activating Orbot private MenuItem mItemOnOff = null; private TextView downloadText = null; private TextView uploadText = null; - private TextView mTxtOrbotLog = null; - private SlidingDrawer mDrawer = null; + // private TextView mTxtOrbotLog = null; + // private SlidingDrawer mDrawer = null; private boolean mDrawerOpen = false; - private View mViewMain = null; + // private View mViewMain = null; /* Some tracking bits */ private int torStatus = TorServiceConstants.STATUS_OFF; //latest status reported from the tor service @@ -96,7 +90,7 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic doLayout(); - appConflictChecker (); + // appConflictChecker (); // Register to receive messages. @@ -181,19 +175,19 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic { setContentView(R.layout.layout_main); - mViewMain = findViewById(R.id.viewMain); - lblStatus = (TextView)findViewById(R.id.lblStatus); - lblStatus.setOnLongClickListener(this); + // lblStatus = (TextView)findViewById(R.id.lblStatus); +// lblStatus.setOnLongClickListener(this); imgStatus = (ImageProgressView)findViewById(R.id.imgStatus); imgStatus.setOnLongClickListener(this); imgStatus.setOnTouchListener(this); - lblStatus.setText("Initializing the application..."); + // lblStatus.setText("Initializing the application..."); downloadText = (TextView)findViewById(R.id.trafficDown); uploadText = (TextView)findViewById(R.id.trafficUp); - mTxtOrbotLog = (TextView)findViewById(R.id.orbotLog); + // mTxtOrbotLog = (TextView)findViewById(R.id.orbotLog); + /* mDrawer = ((SlidingDrawer)findViewById(R.id.SlidingDrawer)); Button slideButton = (Button)findViewById(R.id.slideButton); if (slideButton != null) @@ -212,8 +206,9 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic } }); - } + }*/ + /* ScrollingMovementMethod smm = new ScrollingMovementMethod(); mTxtOrbotLog.setMovementMethod(smm); @@ -227,7 +222,7 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic Toast.makeText(Orbot.this, "LOG COPIED TO CLIPBOARD", Toast.LENGTH_SHORT).show(); return true; } - }); + });*/ downloadText.setText(formatCount(0) + " / " + formatTotal(0)); uploadText.setText(formatCount(0) + " / " + formatTotal(0)); @@ -235,6 +230,33 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic // Gesture detection mGestureDetector = new GestureDetector(this, new MyGestureDetector()); + Button btnBrowser = (Button)findViewById(R.id.btnBrowser); + btnBrowser.setOnClickListener(new View.OnClickListener () + { + + @Override + public void onClick(View v) { + doTorCheck(); + + } + + + }); + + Button btnVPN = (Button)findViewById(R.id.btnVPN); + btnVPN.setOnClickListener(new View.OnClickListener () + { + + @Override + public void onClick(View v) { + + startVpnService(); + + } + + + }); + } @@ -247,8 +269,10 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic } + /* private void appendLogTextAndScroll(String text) { + if(mTxtOrbotLog != null && text != null && text.length() > 0){ if (mTxtOrbotLog.getText().length() > MAX_LOG_LENGTH) @@ -263,7 +287,7 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic mTxtOrbotLog.scrollBy(0, scrollDelta); } } - } + }*/ /* * Create the UI Options Menu (non-Javadoc) @@ -273,14 +297,14 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.main, menu); + inflater.inflate(R.menu.orbot_main, menu); mItemOnOff = menu.getItem(0); return true; } - + /** private void appConflictChecker () { SharedPreferences sprefs = TorServiceUtils.getSharedPrefs(getApplicationContext()); @@ -300,13 +324,13 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic if (showAppConflict) showAlert(getString(R.string.app_conflict),msg,true); - appendLogTextAndScroll(msg); + // appendLogTextAndScroll(msg); } } sprefs.edit().putBoolean("pref_show_conflict", false).commit(); - } + }*/ @@ -394,12 +418,10 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic } - /** - * remove for now... VPN is not ready yet else if (item.getItemId() == R.id.menu_vpn) { - this.startVpnService(); - }*/ + startVpnService(); + } return true; } @@ -451,29 +473,8 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic private void doTorCheck () { - DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() { - - public void onClick(DialogInterface dialog, int which) { - switch (which){ - case DialogInterface.BUTTON_POSITIVE: - - openBrowser(URL_TOR_CHECK); - - - - 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(); + openBrowser(URL_TOR_CHECK); + } @@ -666,12 +667,19 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic */ private void openBrowser(final String browserLaunchUrl) { + //startIntent("info.guardianproject.browser.Browser",Intent.ACTION_VIEW,Uri.parse(browserLaunchUrl)); + + Intent intentBrowser = new Intent(this, Browser.class); + intentBrowser.setAction(Intent.ACTION_VIEW); + intentBrowser.setData(Uri.parse(browserLaunchUrl)); + startActivity(intentBrowser); + + /** boolean isOrwebInstalled = appInstalledOrNot("info.guardianproject.browser"); boolean isTransProxy = mPrefs.getBoolean("pref_transparent", false); if (isOrwebInstalled) { - startIntent("info.guardianproject.browser",Intent.ACTION_VIEW,Uri.parse(browserLaunchUrl)); } else if (isTransProxy) { @@ -685,7 +693,7 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic .setIcon(R.drawable.onion32) .setTitle(R.string.install_apps_) .setMessage(R.string.it_doesn_t_seem_like_you_have_orweb_installed_want_help_with_that_or_should_we_just_open_the_browser_) - .setPositiveButton(android.R.string.ok, new OnClickListener () + .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener () { @Override @@ -698,7 +706,7 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic } }) - .setNegativeButton(android.R.string.no, new OnClickListener () + .setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener () { @Override @@ -712,7 +720,7 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic }) .show(); - } + }*/ } @@ -894,7 +902,7 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic imgStatus.setImageResource(R.drawable.toron); String lblMsg = getString(R.string.status_activated); - lblStatus.setText(lblMsg); + //lblStatus.setText(lblMsg); if (mItemOnOff != null) mItemOnOff.setTitle(R.string.menu_stop); @@ -902,7 +910,7 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic if (torServiceMsg != null && torServiceMsg.length() > 0) { - appendLogTextAndScroll(torServiceMsg); + // appendLogTextAndScroll(torServiceMsg); } boolean showFirstTime = mPrefs.getBoolean("connect_first_time",true); @@ -936,19 +944,20 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic if (mItemOnOff != null) mItemOnOff.setTitle(R.string.menu_stop); - + /** if (lblStatus != null && torServiceMsg != null) if (torServiceMsg.indexOf('%')!=-1) lblStatus.setText(torServiceMsg); + **/ - appendLogTextAndScroll(torServiceMsg); + //appendLogTextAndScroll(torServiceMsg); } else if (torStatus == TorServiceConstants.STATUS_OFF) { imgStatus.setImageResource(R.drawable.toroff); - lblStatus.setText(getString(R.string.status_disabled) + "\n" + getString(R.string.press_to_start)); + //lblStatus.setText(getString(R.string.status_disabled) + "\n" + getString(R.string.press_to_start)); if (mItemOnOff != null) mItemOnOff.setTitle(R.string.menu_start); @@ -970,12 +979,12 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic startService (TorServiceConstants.CMD_START); torStatus = TorServiceConstants.STATUS_CONNECTING; - mTxtOrbotLog.setText(""); +// mTxtOrbotLog.setText(""); //here we update the UI which is a bit sloppy and mixed up code wise //might be best to just call updateStatus() instead of directly manipulating UI in this method - yep makes sense imgStatus.setImageResource(R.drawable.torstarting); - lblStatus.setText(getString(R.string.status_starting_up)); + // lblStatus.setText(getString(R.string.status_starting_up)); //we send a message here to the progressDialog i believe, but we can clarify that shortly Message msg = mHandler.obtainMessage(TorServiceConstants.ENABLE_TOR_MSG); diff --git a/src/org/torproject/android/wizard/ConfigureTransProxy.java b/src/org/torproject/android/wizard/ConfigureTransProxy.java deleted file mode 100644 index ca7f3aca..00000000 --- a/src/org/torproject/android/wizard/ConfigureTransProxy.java +++ /dev/null @@ -1,241 +0,0 @@ -package org.torproject.android.wizard; - -import org.torproject.android.Orbot; -import org.torproject.android.R; -import org.torproject.android.TorConstants; -import org.torproject.android.R.drawable; -import org.torproject.android.R.id; -import org.torproject.android.R.layout; -import org.torproject.android.R.string; -import org.torproject.android.service.TorServiceUtils; -import org.torproject.android.settings.AppManager; - -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.util.Log; -import android.view.KeyEvent; -import android.view.View; -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); - context = this; - - } - - @Override - protected void onStart() { - - super.onStart(); - setContentView(R.layout.layout_wizard_root); - - stepSix(); - - } - - @Override - protected void onResume() { - super.onResume(); - - setupUI(); - - - - } - - private void setupUI () - { - SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext()); - - boolean transEnabled = prefs.getBoolean(PREF_TRANSPARENT, false); - - if (transEnabled) - { - boolean transAllEnabled = prefs.getBoolean(PREF_TRANSPARENT_ALL, false); - - if (transAllEnabled) - { - RadioButton rb0 = (RadioButton)findViewById(R.id.radio0); - rb0.setChecked(true); - - - } - else - { - RadioButton rb1 = (RadioButton)findViewById(R.id.radio1); - rb1.setChecked(true); - - } - - Button next = ((Button)findViewById(R.id.btnWizard2)); - next.setEnabled(true); - } - - } - - - private void stepSix(){ - - String title = context.getString(R.string.wizard_transproxy_title); - - setTitle(title); - - Button back = ((Button)findViewById(R.id.btnWizard1)); - Button next = ((Button)findViewById(R.id.btnWizard2)); - next.setEnabled(false); - - back.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - finish(); - startActivity(new Intent(ConfigureTransProxy.this, Permissions.class)); - } - }); - - next.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - finish(); - startActivity(new Intent(ConfigureTransProxy.this, TipsAndTricks.class)); - - } - }); - - - RadioButton rb0 = (RadioButton)findViewById(R.id.radio0); - RadioButton rb1 = (RadioButton)findViewById(R.id.radio1); - RadioButton rb2 = (RadioButton)findViewById(R.id.radio2); - - rb1.setOnClickListener(new OnClickListener() - { - - public void onClick(View v) { - - startActivity(new Intent(ConfigureTransProxy.this, AppManager.class)); - } - - }); - - RadioGroup mRadioGroup = (RadioGroup)findViewById(R.id.radioGroup); - mRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener (){ - - - public void onCheckedChanged(RadioGroup group, int checkedId){ - Button next = ((Button)findViewById(R.id.btnWizard2)); - next.setEnabled(true); - - RadioButton rb0 = (RadioButton)findViewById(R.id.radio0); - RadioButton rb1 = (RadioButton)findViewById(R.id.radio1); - RadioButton rb2 = (RadioButton)findViewById(R.id.radio2); - - SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext()); - - Editor pEdit = prefs.edit(); - pEdit.putBoolean(PREF_TRANSPARENT, rb0.isChecked()); - pEdit.putBoolean(PREF_TRANSPARENT_ALL, rb0.isChecked()); - pEdit.commit(); - - if(rb0.isChecked()) - { - pEdit.putString("radiobutton","rb0"); - pEdit.commit(); - } - - else if(rb1.isChecked()) - { - flag++; - - pEdit.putBoolean(PREF_TRANSPARENT, true); - pEdit.putBoolean(PREF_TRANSPARENT_ALL, false); - pEdit.putString("radiobutton","rb1"); - pEdit.commit(); - - } - else if(rb2.isChecked()) - { - pEdit.putString("radiobutton", "rb2"); - pEdit.commit(); - } - - } - }); - - - } - - /* - 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() { - - public void onClick(DialogInterface dialog, int which) { - startActivityForResult(new Intent(getBaseContext(), Orbot.class), 1); - - } - }; - - - new AlertDialog.Builder(context) - .setIcon(R.drawable.icon) - .setTitle(title) - .setPositiveButton(R.string.button_close, ocListener) - .setMessage(msg) - .show(); - - - - - }*/ - - @Override - protected void onRestoreInstanceState(Bundle savedInstanceState) { - super.onRestoreInstanceState(savedInstanceState); - } - - @Override - protected void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - - } - - //Code to override the back button! - @Override - public boolean onKeyDown(int keyCode, KeyEvent event) { - if(keyCode == KeyEvent.KEYCODE_BACK){ - finish(); - startActivityForResult(new Intent(getBaseContext(), Permissions.class), 1); - return true; - } - return false; - } - -} \ No newline at end of file diff --git a/src/org/torproject/android/wizard/LotsaText.java b/src/org/torproject/android/wizard/LotsaText.java index 536edabf..137282fc 100644 --- a/src/org/torproject/android/wizard/LotsaText.java +++ b/src/org/torproject/android/wizard/LotsaText.java @@ -117,7 +117,7 @@ public class LotsaText extends Activity implements TorConstants{ public void onClick(View v) { finish(); - startActivity(new Intent(LotsaText.this, Permissions.class)); + startActivity(new Intent(LotsaText.this, TipsAndTricks.class)); } }); diff --git a/src/org/torproject/android/wizard/Permissions.java b/src/org/torproject/android/wizard/Permissions.java deleted file mode 100644 index 229f5bdc..00000000 --- a/src/org/torproject/android/wizard/Permissions.java +++ /dev/null @@ -1,206 +0,0 @@ -package org.torproject.android.wizard; - -import org.sufficientlysecure.rootcommands.RootCommands; -import org.torproject.android.R; -import org.torproject.android.TorConstants; -import org.torproject.android.service.TorServiceUtils; - -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.util.Log; -import android.view.KeyEvent; -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; - -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); - - stepFourRoot(); - - } - - @Override - protected void onResume() { - super.onResume(); - - - } - - - private void stepFourRoot(){ - - String msg1 = context.getString(R.string.wizard_permissions_root_msg1); - String msg2 = context.getString(R.string.wizard_permissions_root_msg2); - - 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)); - next.setEnabled(false); - - CheckBox consent = (CheckBox)findViewById(R.id.checkBox); - consent.setVisibility(CheckBox.VISIBLE); - - consent.setOnCheckedChangeListener(new OnCheckedChangeListener (){ - - public void onCheckedChanged(CompoundButton buttonView, - boolean isChecked) { - - - //this is saying do not use root - - SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext()); - - Editor pEdit = prefs.edit(); - - pEdit.putBoolean(PREF_TRANSPARENT, false); - pEdit.putBoolean(PREF_TRANSPARENT_ALL, false); - pEdit.putBoolean(PREF_HAS_ROOT, false); - - pEdit.commit(); - - /* - Button next = ((Button)findViewById(R.id.btnWizard2)); - if(isChecked) - next.setEnabled(true); - else - next.setEnabled(false); - */ - - stepFour(); - - } - - }); - - - grantPermissions.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - //Check and Install iptables - TorTransProxy.testOwnerModule(this) - - SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext()); - - boolean hasRoot = RootCommands.rootAccessGiven(); - Editor pEdit = prefs.edit(); - pEdit.putBoolean(PREF_HAS_ROOT,hasRoot); - pEdit.commit(); - - if (!hasRoot) - { - - stepFour(); - - } - else - { - finish(); - startActivity(new Intent(Permissions.this, ConfigureTransProxy.class)); - } - - - } - }); - - back.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - finish(); - startActivity(new Intent(Permissions.this, LotsaText.class)); - } - }); - - - next.setOnClickListener(new View.OnClickListener() { - - - public void onClick(View v) { - finish(); - startActivity(new Intent(Permissions.this, TipsAndTricks.class)); - } - }); - - } - - private void stepFour(){ - - String title = context.getString(R.string.wizard_permissions_title); - String msg = context.getString(R.string.wizard_permissions_no_root_msg); - - setTitle(title); - - TextView txtBody = ((TextView)findViewById(R.id.WizardTextBody1)); - txtBody.setText(msg); - - Button btn1 = ((Button)findViewById(R.id.btnWizard1)); - Button btn2 = ((Button)findViewById(R.id.btnWizard2)); - btn2.setEnabled(true); - - TextView txtBody2 = ((TextView)findViewById(R.id.WizardTextBody2)); - txtBody2.setVisibility(TextView.GONE); - - Button grantPermissions = ((Button)findViewById(R.id.grantPermissions)); - grantPermissions.setVisibility(Button.GONE); - - CheckBox consent = (CheckBox)findViewById(R.id.checkBox); - consent.setVisibility(CheckBox.GONE); - - btn1.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - finish(); - startActivity(new Intent(Permissions.this, LotsaText.class)); - } - }); - - btn2.setOnClickListener(new View.OnClickListener() { - - public void onClick(View v) { - finish(); - startActivity(new Intent(Permissions.this, TipsAndTricks.class)); - } - }); - } - - //Code to override the back button! - public boolean onKeyDown(int keyCode, KeyEvent event) { - if(keyCode == KeyEvent.KEYCODE_BACK){ - finish(); - startActivity(new Intent(getBaseContext(), LotsaText.class)); - return true; - } - return false; - } - -} \ No newline at end of file diff --git a/src/org/torproject/android/wizard/TipsAndTricks.java b/src/org/torproject/android/wizard/TipsAndTricks.java index d10278ba..3eea3735 100644 --- a/src/org/torproject/android/wizard/TipsAndTricks.java +++ b/src/org/torproject/android/wizard/TipsAndTricks.java @@ -157,7 +157,7 @@ public class TipsAndTricks extends Activity implements TorConstants { public void onClick(View v) { finish(); - startActivityForResult(new Intent(TipsAndTricks.this, Permissions.class), 1); + startActivityForResult(new Intent(TipsAndTricks.this, LotsaText.class), 1); } }); @@ -184,7 +184,6 @@ public class TipsAndTricks extends Activity implements TorConstants { Button btn1 = ((Button)findViewById(R.id.btnWizard1)); Button btn2 = ((Button)findViewById(R.id.btnWizard2)); - btn2.setText(getString(R.string.btn_finish)); btn1.setVisibility(Button.VISIBLE); @@ -192,7 +191,7 @@ public class TipsAndTricks extends Activity implements TorConstants { public void onClick(View v) { finish(); - startActivity(new Intent(TipsAndTricks.this, Permissions.class)); + startActivity(new Intent(TipsAndTricks.this, LotsaText.class)); } }); @@ -209,7 +208,7 @@ public class TipsAndTricks extends Activity implements TorConstants { public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_BACK){ finish(); - startActivity(new Intent(getBaseContext(), Permissions.class)); + startActivity(new Intent(getBaseContext(), LotsaText.class)); return true; } return false;