Skip to content

jiangjm424/view-db

Repository files navigation

This lib is used to view or edit our database by browser or native app, include encrypt database.

dependencies {
    debugImplementation 'io.github.jiangjm424:view-db:+'
}

or

implementation("io.github.jiangjm424:view-db:+")

with encrypt database you should add your database password in the db_viewer share preference such as

val dbName = "CheeseDatabase"
val dbPwd = "cheese"
if (BuildConfig.DEBUG) {
    context.getSharedPreferences("db_viewer", AppCompatActivity.MODE_PRIVATE).edit()
        .putString(dbName, dbPwd).apply()
}
instance = Room.databaseBuilder(
    context.applicationContext,
    CheeseDb::class.java, dbName
).openHelperFactory(SupportFactory(dbPwd.toByteArray()))
    .addCallback(object : RoomDatabase.Callback() {
        override fun onCreate(db: SupportSQLiteDatabase) {
            fillInDb(context.applicationContext)
        }
    }).build()

Thanks for : Android-Debug-Database https://github.com/amitshekhariitbhu/Android-Debug-Database.git Glance https://github.com/guolindev/Glance.git

About

a component which can view our app db easily

Resources

Stars

Watchers

Forks

Packages

No packages published