]> hydra-www.ietfng.org Git - android-vcpass-oisafe/commitdiff
Updated backup with unique_name. Removed legacy code from DBHelper
authorrmceoin <rmceoin@72b678ce-9140-0410-bee8-679b907dd61a>
Mon, 19 Jan 2009 20:06:24 +0000 (20:06 +0000)
committerrmceoin <rmceoin@72b678ce-9140-0410-bee8-679b907dd61a>
Mon, 19 Jan 2009 20:06:24 +0000 (20:06 +0000)
and finally implemented lastdatetimeedit on passwords.

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

src/org/openintents/safe/Backup.java
src/org/openintents/safe/DBHelper.java

index 20d377d8a13fb6c28e0d46616e117d37af422a46..cf9b91d65207bd7ba961eb89d3db1d7d80a42005 100644 (file)
@@ -109,6 +109,10 @@ public class Backup {
                                        serializer.text(row.note);
                                        serializer.endTag(null, "Note");
 
+                                       serializer.startTag(null, "UniqueName");
+                                       serializer.text(row.uniqueName);
+                                       serializer.endTag(null, "UniqueName");
+
                                        serializer.endTag(null, "Entry");
                                }
                                serializer.endTag(null, "Category");
index d1ddcdb917ee1290d5076075094607aefaad87da..7e6db5726e63186ef71c456b4d310a68230fd5f3 100644 (file)
  */
 package org.openintents.safe;
 
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import android.content.ContentValues;
 import android.content.Context;
@@ -40,7 +43,6 @@ public class DBHelper {
     private static final String TABLE_DBVERSION = "dbversion";
     private static final String TABLE_PASSWORDS = "passwords";
     private static final String TABLE_CATEGORIES = "categories";
-    private static final String TABLE_VERIFY = "verify_crypto";
     private static final String TABLE_MASTER_KEY = "master_key";
     private static final String TABLE_PACKAGE_ACCESS = "package_access";
     private static final int DATABASE_VERSION = 4;
@@ -213,22 +215,6 @@ public class DBHelper {
                return version;
     }
 
-    public String fetchOldConfirm() {
-       String key="";
-        try {
-                       Cursor c = db.query(true, TABLE_VERIFY, new String[] {"confirm"},
-                               null, null, null, null, null,null);
-                       if(c.getCount() > 0) {
-                           c.moveToFirst();
-                           key=c.getString(0);
-                       }
-                       c.close();
-               } catch (SQLException e)
-               {
-                       Log.d(TAG,"SQLite exception: " + e.getLocalizedMessage());
-               }
-               return key;
-    }
     /**
      * 
      * @return
@@ -570,6 +556,10 @@ public class DBHelper {
            args.put("website", entry.website);
            args.put("note", entry.note);
            args.put("unique_name", entry.uniqueName);
+           DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); 
+           Date date = new Date();
+        String timeNow = dateFormat.format(date); 
+           args.put("lastdatetimeedit", timeNow);
            try {
                        db.update(TABLE_PASSWORDS, args, "id=" + Id, null);
                } catch (SQLException e)