|
|
@ -16,14 +16,6 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
package org.thoughtcrime.securesms.database;
|
|
|
|
package org.thoughtcrime.securesms.database;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.crypto.IdentityKey;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.crypto.InvalidKeyException;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.crypto.MasterCipher;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.util.Base64;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import android.content.ContentValues;
|
|
|
|
import android.content.ContentValues;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.database.Cursor;
|
|
|
|
import android.database.Cursor;
|
|
|
@ -32,6 +24,14 @@ import android.database.sqlite.SQLiteOpenHelper;
|
|
|
|
import android.net.Uri;
|
|
|
|
import android.net.Uri;
|
|
|
|
import android.util.Log;
|
|
|
|
import android.util.Log;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.crypto.IdentityKey;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.crypto.InvalidKeyException;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.crypto.MasterCipher;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.util.Base64;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
|
|
public class IdentityDatabase extends Database {
|
|
|
|
public class IdentityDatabase extends Database {
|
|
|
|
|
|
|
|
|
|
|
|
private static final Uri CHANGE_URI = Uri.parse("content://textsecure/identities");
|
|
|
|
private static final Uri CHANGE_URI = Uri.parse("content://textsecure/identities");
|
|
|
@ -61,6 +61,9 @@ public class IdentityDatabase extends Database {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getNameForIdentity(MasterSecret masterSecret, IdentityKey identityKey) {
|
|
|
|
public String getNameForIdentity(MasterSecret masterSecret, IdentityKey identityKey) {
|
|
|
|
|
|
|
|
if (identityKey == null)
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
|
|
MasterCipher masterCipher = new MasterCipher(masterSecret);
|
|
|
|
MasterCipher masterCipher = new MasterCipher(masterSecret);
|
|
|
|
SQLiteDatabase database = databaseHelper.getReadableDatabase();
|
|
|
|
SQLiteDatabase database = databaseHelper.getReadableDatabase();
|
|
|
|
Cursor cursor = null;
|
|
|
|
Cursor cursor = null;
|
|
|
|