sqlcipher / sqlcipher-android-tests

A collection of tests that can be run on an emulator or device to verify SQLCipher for Android.
Other
94 stars 65 forks source link

Deprecated

This project exists in support of the android-database-sqlcipher project which has been officially deprecated. The long-term replacement is sqlcipher-android. Instructions for migrating from android-database-sqlcipher to sqlcipher-androidmay be found here.

To run: clone this repo and open with a recent version of Android Studio, or build from the command line.

It is possible to run on an emulator or device, as documented in the SQLCipher for Android compatibility section.

More information can be found in SQLCipher for Android.

Creating A New Test

  1. Open this repository within Android Studio
  2. Add a new class within net.zetetic.tests package that extends SQLCipherTest:
package net.zetetic.tests;

import net.sqlcipher.database.SQLiteDatabase;

public class AwesomeTest extends SQLCipherTest {

  @Override
  public boolean execute(SQLiteDatabase database) {
    try {
      // Add your scenario here
      return true;
    } catch (Exception e) {
      return false;
    }
  }

  @Override
  public String getName() {
    return "Awesome Test";
  }
}
  1. Add AwesomeTest to the TestSuiteRunner:
tests.add(new AwesomeTest());
  1. Build and run the application on an Android device or emulator