diff options
author | Thialfihar <thialfihar@gmail.com> | 2010-05-28 08:12:54 +0000 |
---|---|---|
committer | Thialfihar <thialfihar@gmail.com> | 2010-05-28 08:12:54 +0000 |
commit | 2f3bc6dcaff0cc4afd76312c8185c63eca64654d (patch) | |
tree | 6508df1b4b18ab3b1586e42a5e582480c9b2749d /src/org/thialfihar/android/apg | |
parent | eed42b2e34d6ba7e6eda43640eb3bb1555d9e24f (diff) | |
download | open-keychain-2f3bc6dcaff0cc4afd76312c8185c63eca64654d.tar.gz open-keychain-2f3bc6dcaff0cc4afd76312c8185c63eca64654d.tar.bz2 open-keychain-2f3bc6dcaff0cc4afd76312c8185c63eca64654d.zip |
trivial
Diffstat (limited to 'src/org/thialfihar/android/apg')
-rw-r--r-- | src/org/thialfihar/android/apg/provider/Database.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/org/thialfihar/android/apg/provider/Database.java b/src/org/thialfihar/android/apg/provider/Database.java index 505248d14..acb5c0943 100644 --- a/src/org/thialfihar/android/apg/provider/Database.java +++ b/src/org/thialfihar/android/apg/provider/Database.java @@ -160,17 +160,14 @@ public class Database extends SQLiteOpenHelper { UserIds.USER_ID + " " + UserIds.USER_ID_type + "," +
UserIds.RANK + " " + UserIds.RANK_type + ");");
- Cursor cursor = db.query("public_keys",
- new String[]{
- "c_key_data",
- }, null, null, null, null, null);
+ Cursor cursor = db.query("public_keys", new String[] { "c_key_data" },
+ null, null, null, null, null);
if (cursor != null && cursor.moveToFirst()) {
do {
byte[] data = cursor.getBlob(0);
try {
PGPPublicKeyRing keyRing = new PGPPublicKeyRing(data);
saveKeyRing(keyRing);
- Log.e("good", "imported " + keyRing);
} catch (IOException e) {
Log.e("apg.db.upgrade", "key import failed: " + e);
} catch (GeneralException e) {
@@ -183,17 +180,14 @@ public class Database extends SQLiteOpenHelper { cursor.close();
}
- cursor = db.query("secret_keys",
- new String[]{
- "c_key_data",
- }, null, null, null, null, null);
+ cursor = db.query("secret_keys", new String[]{ "c_key_data" },
+ null, null, null, null, null);
if (cursor != null && cursor.moveToFirst()) {
do {
byte[] data = cursor.getBlob(0);
try {
PGPSecretKeyRing keyRing = new PGPSecretKeyRing(data);
saveKeyRing(keyRing);
- Log.e("good", "imported " + keyRing);
} catch (IOException e) {
Log.e("apg.db.upgrade", "key import failed: " + e);
} catch (PGPException e) {
@@ -208,6 +202,9 @@ public class Database extends SQLiteOpenHelper { cursor.close();
}
+ db.execSQL("DROP TABLE IF EXISTS public_keys;");
+ db.execSQL("DROP TABLE IF EXISTS secret_keys;");
+
break;
}
|