milad salimi
milad salimi

Reputation: 1660

Android Room database file is invalid file format in DB browser

I am going to data/data/myPackage in emulator and download these three files about my apps database :

enter image description here

But when i import it to DB browser i faced with this error :

enter image description here

I think the problem is about permissions(-rw------) because when i import other database that has this (-rw-rw----),DB browser can open it.

Then how can i change permission or open my room database in DB browser?

This is my room config :

@Database(entities = {Authentication.class}, version = 1)
public abstract class InsensitiveDatabase extends RoomDatabase {

    private static InsensitiveDatabase INSTANCE;

    public abstract AuthenticationDao authenticationDao();

    public static InsensitiveDatabase getInsensitiveDatabase(Context context) {
        if (INSTANCE == null) {
            Editable editable = new SpannableStringBuilder("1234");
            SafeHelperFactory factory = SafeHelperFactory.fromUser(editable);
            INSTANCE = Room.databaseBuilder(context, InsensitiveDatabase.class, "insensitive.db")
                    .openHelperFactory(factory)
                    .build();
        }
        return INSTANCE;
    }
}

Upvotes: 1

Views: 3399

Answers (2)

vikas khot
vikas khot

Reputation: 31

If you are using SQLCipher in Room DB then it will not show in App Inspection->Database Inspector

Remove this below line and check-

.openHelperFactory(factory) //will not show in App Inspection ->Database inspection

Upvotes: 0

milad salimi
milad salimi

Reputation: 1660

As i found The DB browser that developed in Linux cant open my encrypted room database because i open it in MAC OS.

You can see more detail in this issue that i open it,i hope that this is useful for your problem.

Upvotes: 1

Related Questions