

In addition, in the “sqliteopenhelper” class, I replaced codes below with the previous codes: this.getReadableDatabase("pass") I also in the sqliteopenhelper class replaced all of the imports which are starting with “” with “”. Then In Android studio I replaced the database file with the previous file in the assets folder and added this line below to the gradle.

SQLiteDatabase.openDatabase(newFile.getAbsolutePath(), SQLiteDatabase.openDatabase(originalFile.getAbsolutePath(),ĭb.rawExecSQL(String.format("ATTACH DATABASE '%s' AS encrypted KEY '%s' ",ĭb.rawExecSQL("SELECT sqlcipher_export('encrypted')") ĭb.rawExecSQL("DETACH DATABASE encrypted ") I converted my sqlite database into encrypted database by this method : public static void encrypt(Context ctxt, String dbName,įile originalFile=ctxt.getDatabasePath(dbName) įile.createTempFile("sqlcipherutils", "tmp",
