Java Code Examples for net.sqlcipher.database.SQLiteOpenHelper

The following examples show how to use net.sqlcipher.database.SQLiteOpenHelper. These examples are extracted from open source projects. 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 Project: cwac-saferoom   Source File: MigratingImportTest.java    License: 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 Project: cwac-saferoom   Source File: MigratingImportTest.java    License: 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();
  }
}