]> hydra-www.ietfng.org Git - android-vcpass-oisafe/commitdiff
OI Safe: export to CSV now also exports Last edited. import ignores the
authorrmceoin <rmceoin@72b678ce-9140-0410-bee8-679b907dd61a>
Sun, 3 Jan 2010 03:08:47 +0000 (03:08 +0000)
committerrmceoin <rmceoin@72b678ce-9140-0410-bee8-679b907dd61a>
Sun, 3 Jan 2010 03:08:47 +0000 (03:08 +0000)
extra column

git-svn-id: http://openintents.googlecode.com/svn/trunk/Safe@2455 72b678ce-9140-0410-bee8-679b907dd61a

src/org/openintents/safe/AskPassword.java
src/org/openintents/safe/CategoryList.java
src/org/openintents/safe/IntentHandler.java

index df3e5216062e1b3ea42ed4ec27a60a9f8c6373e2..0ffb61c7db8e79d28c97c9786965f8b514bf24fa 100644 (file)
@@ -68,7 +68,7 @@ public class AskPassword extends Activity {
     private int viewMode = VIEW_NORMAL;
 
        private EditText pbeKey;
-       private DBHelper dbHelper;
+       private DBHelper dbHelper=null;
        private TextView introText;
 //     private TextView confirmText;
        private TextView remoteAsk;
@@ -276,8 +276,10 @@ public class AskPassword extends Activity {
 
                if (debug) Log.d(TAG, "onPause()");
 
-               dbHelper.close();
-               dbHelper = null;
+               if (dbHelper!=null) {
+                       dbHelper.close();
+                       dbHelper = null;
+               }
        }
 
        @Override
index c73e1eb90a029170cf4f8eb809fced162ef1dd62..cae49be0aa781763af240453547e0baf87016907 100644 (file)
@@ -701,7 +701,8 @@ public class CategoryList extends ListActivity {
                                        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);
                        
@@ -716,7 +717,8 @@ public class CategoryList extends ListActivity {
                                        row.plainWebsite,
                                        row.plainUsername,
                                        row.plainPassword,
-                                       row.plainNote
+                                       row.plainNote,
+                                       row.lastEdited
                            };
                            writer.writeNext(rowEntries);
                        }
@@ -835,7 +837,7 @@ public class CategoryList extends ListActivity {
                        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;
                    }
index c0f2fe284a3ca03ec2eab973cdefd6dabf491c8b..be3ad92532b3894366a2fddbf26715ccd55b092a 100644 (file)
@@ -18,6 +18,7 @@ package org.openintents.safe;
 \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
@@ -61,7 +62,7 @@ public class IntentHandler extends Activity {
        \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
@@ -70,7 +71,7 @@ public class IntentHandler extends Activity {
        @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
@@ -113,6 +114,7 @@ public class IntentHandler extends Activity {
                                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
@@ -186,6 +188,8 @@ public class IntentHandler extends Activity {
         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
@@ -261,6 +265,7 @@ public class IntentHandler extends Activity {
                        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
@@ -269,12 +274,14 @@ public class IntentHandler extends Activity {
                        \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
@@ -476,11 +483,15 @@ public class IntentHandler extends Activity {
        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
@@ -555,6 +566,8 @@ public class IntentHandler extends Activity {
                                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