Android Room数据库文件在数据库浏览器中是无效的文件格式 [英] Android Room database file is invalid file format in DB browser

查看:209
本文介绍了Android Room数据库文件在数据库浏览器中是无效的文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在模拟器中进入data/data/myPackage并下载有关我的应用程序数据库的这三个文件:

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

但是当我将其导入数据库浏览器时,我遇到了这个错误:

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

我认为问题出在权限(-rw------)上,因为当我导入具有此(-rw-rw----)的其他数据库时,DB浏览器可以打开它.

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

那我该如何在数据库浏览器中更改权限或打开会议室数据库?

这是我的房间配置:

@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;
    }
}

推荐答案

我发现Linux中开发的数据库浏览器无法打开我的加密房间数据库,因为我是在MAC OS中打开它的.

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.

这篇关于Android Room数据库文件在数据库浏览器中是无效的文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆