getString(R.string.website),
getString(R.string.username),
getString(R.string.password),
- getString(R.string.notes)
+ getString(R.string.notes),
+ getString(R.string.last_edited)
};
writer.writeNext(header);
row.plainWebsite,
row.plainUsername,
row.plainPassword,
- row.plainNote
+ row.plainNote,
+ row.lastEdited
};
writer.writeNext(rowEntries);
}
importMessage=getString(R.string.import_error_first_line);
return;
}
- if (nextLine.length != recordLength){
+ if (nextLine.length < recordLength){
importMessage=getString(R.string.import_error_first_line);
return;
}
\r
\r
import java.util.ArrayList;\r
+import java.util.Arrays;\r
\r
import org.openintents.intents.CryptoIntents;\r
import org.openintents.safe.dialog.DialogHostingActivity;\r
\r
// service elements\r
private static ServiceDispatch service=null;\r
- private ServiceDispatchConnection conn;\r
+ private ServiceDispatchConnection conn=null;\r
private Intent mServiceIntent;\r
\r
SharedPreferences mPreferences;\r
@Override\r
public void onCreate(Bundle icicle) {\r
super.onCreate(icicle);\r
- if (debug) Log.d(TAG, "onCreate()");\r
+ if (debug) Log.d(TAG, "onCreate("+icicle+")");\r
\r
mServiceIntent = null;\r
mPreferences = PreferenceManager.getDefaultSharedPreferences(this);\r
try {\r
salt = service.getSalt();\r
masterKey = service.getPassword();\r
+ if (debug) Log.d(TAG,"starting actiondispatch");\r
actionDispatch();\r
} catch (RemoteException e) {\r
Log.d(TAG, e.toString());\r
CategoryList.setSalt(salt);\r
PassList.setMasterKey(masterKey);\r
CategoryList.setMasterKey(masterKey);\r
+ \r
+ if (debug) Log.d(TAG,"actionDispatch()");\r
if ((salt==null) || (salt=="")) {\r
return;\r
}\r
if (thisIntent.hasExtra(CryptoIntents.EXTRA_TEXT)) {\r
// get the body text out of the extras.\r
String inputBody = thisIntent.getStringExtra (CryptoIntents.EXTRA_TEXT);\r
+ if (debug) Log.d(TAG,"inputBody="+inputBody);\r
String outputBody = "";\r
outputBody = ch.encryptWithSessionKey (inputBody);\r
// stash the encrypted text in the extra\r
\r
if (thisIntent.hasExtra(CryptoIntents.EXTRA_TEXT_ARRAY)) {\r
String[] in = thisIntent.getStringArrayExtra(CryptoIntents.EXTRA_TEXT_ARRAY);\r
+ if (debug) Log.d(TAG,"in="+Arrays.toString(in));\r
String[] out = new String[in.length];\r
for (int i = 0; i < in.length; i++) {\r
if (in[i] != null) {\r
out[i] = ch.encryptWithSessionKey(in[i]);\r
}\r
}\r
+ if (debug) Log.d(TAG,"out="+Arrays.toString(out));\r
callbackIntent.putExtra(CryptoIntents.EXTRA_TEXT_ARRAY, out);\r
}\r
\r
private void initService() {\r
\r
boolean isLocal = isIntentLocal();\r
- conn = new ServiceDispatchConnection(isLocal);\r
- Intent i = new Intent();\r
- i.setClass(this, ServiceDispatchImpl.class);\r
- startService(i);\r
- bindService( i, conn, Context.BIND_AUTO_CREATE);\r
+ if (conn==null) {\r
+ conn = new ServiceDispatchConnection(isLocal);\r
+ Intent i = new Intent();\r
+ i.setClass(this, ServiceDispatchImpl.class);\r
+ startService(i);\r
+ bindService( i, conn, Context.BIND_AUTO_CREATE);\r
+ } else {\r
+ if (debug) Log.d(TAG,"service already running");\r
+ }\r
}\r
\r
/**\r
if (askPassIsLocal || externalAccess) {\r
salt = service.getSalt();\r
masterKey = service.getPassword();\r
+ if (debug) Log.d(TAG,"starting actiondispatch from service");\r
+\r
actionDispatch();\r
} else {\r
if (debug) Log.d(TAG, "onServiceConnected: showDialogAllowExternalAccess()");\r