<string name="dialog_restore_database_msg">Sind Sie sicher, dass Sie die bestehenden Einträge ersetzen wollen?</string>
<string name="restore_found">%s Passwörter im Backup gefunden vom %s.</string>
<string name="restore_complete">Fertig. Passwörter wiederhergestellt: %s</string>
- <string name="copy_to_clipboard">Password wurde in Zwischenablage kopiert</string>
+ <string name="copied_to_clipboard">wurde in Zwischenablage kopiert</string>
<string name="invalid_website">Ungültige Webseite</string>
<!-- Menu label to open a category -->
<string name="dialog_restore_database_msg">Êtes-vous sûr de vouloir remplacer les données actuelles?</string>
<string name="restore_found">Trouvé %s mots de passe à partir de la sauvegarde du %s.</string>
<string name="restore_complete">Complet. Mots de passe restaurés: %s</string>
- <string name="copy_to_clipboard">Copier le mot de passe dans le Presse-papiers</string>
+ <!-- needs to be re-translated -->
+ <string name="copied_to_clipboard">Copier le mot de passe dans le Presse-papiers</string>
<string name="invalid_website">Site invalide</string>
<!-- Menu label to open a category -->
<string name="dialog_restore_database_msg">Are you sure you want to replace the current data?</string>\r
<string name="restore_found">Found %s passwords from backup dated %s.</string>\r
<string name="restore_complete">Complete. Passwords restored: %s</string>\r
- <string name="copy_to_clipboard">Copying Password to Clipboard</string>\r
+ <string name="copied_to_clipboard">copied to Clipboard</string>\r
<string name="invalid_website">Invalid website</string>\r
\r
<!-- Menu label to open a category -->\r
*/
public class AskPassword extends Activity {
- private boolean debug = false;
+ private boolean debug = true;
private static String TAG = "AskPassword";
public static String EXTRA_IS_LOCAL = "org.openintents.safe.bundle.EXTRA_IS_REMOTE";
super.onPause();
if (debug) Log.d(TAG, "onResume()");
+ if (CategoryList.isSignedIn()==true) {
+ if (debug) Log.d(TAG,"already signed in");
+ Intent callbackIntent = new Intent();
+ callbackIntent.putExtra("salt", CategoryList.getSalt());
+ callbackIntent.putExtra("masterKey", CategoryList.getMasterKey());
+ setResult(RESULT_OK, callbackIntent);
+ finish();
+ return;
+ }
+
if (dbHelper == null) {
dbHelper = new DBHelper(this);
}
if (debug) Log.d(TAG,"onUserInteraction()");
if (CategoryList.isSignedIn()==false) {
- startActivity(frontdoor);
+// startActivity(frontdoor);
}else{
if (restartTimerIntent!=null) sendBroadcast (restartTimerIntent);
}
if (debug) Log.d(TAG,"onUserInteraction()");
if (CategoryList.isSignedIn()==false) {
- Intent frontdoor = new Intent(this, FrontDoor.class);
- frontdoor.setAction(CryptoIntents.ACTION_AUTOLOCK);
- startActivity(frontdoor);
+// Intent frontdoor = new Intent(this, FrontDoor.class);
+// frontdoor.setAction(CryptoIntents.ACTION_AUTOLOCK);
+// startActivity(frontdoor);
}else{
if (restartTimerIntent!=null) sendBroadcast (restartTimerIntent);
}
if (debug) Log.d(TAG,"onUserInteraction()");
if (CategoryList.isSignedIn()==false) {
- startActivity(frontdoor);
+// startActivity(frontdoor);
}else{
if (restartTimerIntent!=null) sendBroadcast (restartTimerIntent);
}
public class FrontDoor extends Activity {\r
\r
private static final String TAG = "FrontDoor";\r
- private static final boolean debug = false;\r
+ private static final boolean debug = true;\r
\r
// public static final String KEY_AUTOLOCK = "autolock";\r
\r
if (debug) Log.d(TAG,"onUserInteraction()");
if (CategoryList.isSignedIn()==false) {
- startActivity(frontdoor);
+// startActivity(frontdoor);
}else{
if (restartTimerIntent!=null) sendBroadcast (restartTimerIntent);
}
*/\r
public class IntentHandler extends Activity {\r
\r
- private static final boolean debug = false;\r
+ private static final boolean debug = true;\r
private static String TAG = "IntentHandler";\r
\r
private static final int REQUEST_CODE_ASK_PASSWORD = 1;\r
private Intent mServiceIntent;\r
\r
SharedPreferences mPreferences;\r
- //public static String SERVICE_NAME = "org.openintents.safe.service.ServiceDispatchImpl";\r
\r
/** Called when the activity is first created. */\r
@Override\r
public void onCreate(Bundle icicle) {\r
super.onCreate(icicle);\r
+ if (debug) Log.d(TAG, "onCreate()");\r
+ \r
mServiceIntent = null;\r
mPreferences = PreferenceManager.getDefaultSharedPreferences(this);\r
\r
Passwords.Initialize(this);\r
-\r
- // The service is launched in onResume()\r
}\r
\r
\r
}\r
\r
try {\r
+ final Intent thisIntent = getIntent();\r
+ String action=thisIntent.getAction();\r
+ if (action!=null && action.equals(CryptoIntents.ACTION_AUTOLOCK)) {\r
+ if (debug) Log.d(TAG,"autolock");\r
+ askPassIsLocal=true;\r
+ }\r
+\r
if (service.getPassword() == null) {\r
boolean promptforpassword = getIntent().getBooleanExtra(CryptoIntents.EXTRA_PROMPT, true);\r
if (debug) Log.d(TAG, "Prompt for password: " + promptforpassword);\r
Intent askPass = new Intent(getApplicationContext(),\r
AskPassword.class);\r
\r
- final Intent thisIntent = getIntent();\r
String inputBody = thisIntent.getStringExtra (CryptoIntents.EXTRA_TEXT);\r
\r
- String action=thisIntent.getAction();\r
- if (action!=null && action.equals(CryptoIntents.ACTION_AUTOLOCK)) {\r
- if (debug) Log.d(TAG,"autolock");\r
- askPassIsLocal=true;\r
- }\r
askPass.putExtra (CryptoIntents.EXTRA_TEXT, inputBody);\r
askPass.putExtra (AskPassword.EXTRA_IS_LOCAL, askPassIsLocal);\r
//TODO: Is there a way to make sure all the extras are set? \r
goButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
- Toast.makeText(PassEdit.this, R.string.copy_to_clipboard,
+ Toast.makeText(PassEdit.this, getString(R.string.password)+" "+getString(R.string.copied_to_clipboard),
Toast.LENGTH_SHORT).show();
ClipboardManager cb = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
populated=true;
}
}
- }
-
+ }
+
@Override
public void onUserInteraction() {
super.onUserInteraction();
if (debug) Log.d(TAG,"onUserInteraction()");
if (CategoryList.isSignedIn()==false) {
- startActivity(frontdoor);
+// startActivity(frontdoor);
}else{
if (restartTimerIntent!=null) sendBroadcast (restartTimerIntent);
}
if (debug) Log.d(TAG,"onUserInteraction()");
if (CategoryList.isSignedIn()==false) {
- startActivity(frontdoor);
+// startActivity(frontdoor);
}else{
if (restartTimerIntent!=null) sendBroadcast (restartTimerIntent);
}
*/
public class PassList extends ListActivity {
- private static final boolean debug = false;
+ private static final boolean debug = true;
private static final String TAG = "PassList";
// Menu Item order
} catch (IllegalArgumentException e) {
if (debug) Log.d(TAG,"IllegalArgumentException");
}
+ removeDialog(DECRYPT_PROGRESS_KEY);
}
@Override
if (debug) Log.d(TAG,"onUserInteraction()");
if (CategoryList.isSignedIn()==false) {
- startActivity(frontdoor);
+// startActivity(frontdoor);
}else{
if (restartTimerIntent!=null) sendBroadcast (restartTimerIntent);
}
*
* @author Randy McEoin
*/
-public class PassView extends Activity {
+public class PassView extends Activity implements View.OnClickListener {
private static boolean debug = false;
private static String TAG = "PassView";
goButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
+ String link = websiteText.getText().toString();
+ if (link == null || link.equals("") || link.equals("http://")) {
+ return;
+ }
- Toast.makeText(PassView.this, R.string.copy_to_clipboard,
- Toast.LENGTH_SHORT).show();
-
- ClipboardManager cb = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
- cb.setText(passwordText.getText().toString());
+ clipboard(getString(R.string.password), passwordText.getText().toString());
Intent i = new Intent(Intent.ACTION_VIEW);
- String link = websiteText.getText().toString();
Uri u = Uri.parse(link);
i.setData(u);
try {
descriptionText.setText(row.plainDescription);
websiteText.setText(row.plainWebsite);
usernameText.setText(row.plainUsername);
+ usernameText.setOnClickListener(this);
passwordText.setText(row.plainPassword);
+ passwordText.setOnClickListener(this);
noteText.setText(row.plainNote);
String lastEdited;
if (row.lastEdited!=null) {
}
}
+ /**
+ *
+ * @author Billy Cui
+ */
+ public void onClick(View view) {
+ if (view == usernameText) {
+ if (debug) Log.d(TAG, "click " + usernameText.getText());
+ clipboard(getString(R.string.username),usernameText.getText().toString());
+ } else if (view == passwordText) {
+ if (debug) Log.d(TAG, "click " + passwordText.getText());
+ clipboard(getString(R.string.password),passwordText.getText().toString());
+ }
+ }
+
+ /**
+ * Copy to clipboard and toast to let user know that we have done so.
+ *
+ * @author Billy Cui
+ * @param fieldName Name of the field copied from
+ * @param value String to copy to clipboard
+ */
+ private void clipboard(String fieldName, String value) {
+ Toast.makeText(PassView.this, fieldName+" "+getString(R.string.copied_to_clipboard),
+ Toast.LENGTH_SHORT).show();
+
+ ClipboardManager cb = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
+ cb.setText(value);
+ }
+
@Override
public void onUserInteraction() {
super.onUserInteraction();
if (debug) Log.d(TAG,"onUserInteraction()");
if (CategoryList.isSignedIn()==false) {
- startActivity(frontdoor);
+// startActivity(frontdoor);
}else{
if (restartTimerIntent!=null) sendBroadcast (restartTimerIntent);
}
if (debug) Log.d(TAG,"onUserInteraction()");
if (CategoryList.isSignedIn()==false) {
- startActivity(frontdoor);
+// startActivity(frontdoor);
}else{
if (restartTimerIntent!=null) sendBroadcast (restartTimerIntent);
}
if (debug) Log.d(TAG,"onUserInteraction()");
if (CategoryList.isSignedIn()==false) {
- startActivity(frontdoor);
+// startActivity(frontdoor);
}else{
if (restartTimerIntent!=null) sendBroadcast (restartTimerIntent);
}
if (debug) Log.d(TAG,"onUserInteraction()");
if (CategoryList.isSignedIn()==false) {
- startActivity(frontdoor);
+// startActivity(frontdoor);
}else{
if (restartTimerIntent!=null) sendBroadcast (restartTimerIntent);
}