net.sqlcipher.database.SQLiteOpenHelper Java Examples

The following examples show how to use net.sqlcipher.database.SQLiteOpenHelper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MigratingImportTest.java    From cwac-saferoom with Apache License 2.0 6 votes vote down vote up
@Test
public void safe() {
  final Context ctxt=InstrumentationRegistry.getTargetContext();

  SQLiteDatabase.loadLibs(ctxt);
  SQLiteOpenHelper helper = new SafeNonRoomHelper(ctxt);

  helper.getWritableDatabase(PASSPHRASE);
  helper.close();

  ImportingSafeDatabase room = ImportingSafeDatabase.gimme(ctxt);
  SupportSQLiteDatabase db=room.getOpenHelper().getWritableDatabase();

  try {
    assertTrue(db.isWriteAheadLoggingEnabled());
  }
  finally {
    room.close();
  }
}
 
Example #2
Source File: MigratingImportTest.java    From cwac-saferoom with Apache License 2.0 6 votes vote down vote up
@Test
public void notQuiteAsSafeButStillNice() {
  final Context ctxt=InstrumentationRegistry.getTargetContext();

  android.database.sqlite.SQLiteOpenHelper helper = new LessSafeNonRoomHelper(ctxt);

  helper.getWritableDatabase();
  helper.close();

  ImportingLessSafeDatabase room = ImportingLessSafeDatabase.gimme(ctxt);
  SupportSQLiteDatabase db=room.getOpenHelper().getWritableDatabase();

  try {
    assertTrue(db.isWriteAheadLoggingEnabled());
  }
  finally {
    room.close();
  }
}