The community edition of SQLCipher for Android is distributed via the AAR package format allowing usage in either Java or Kotlin-based Android projects. Integration within Gradle can be performed by adding the
following entry to the dependencies section of the app/build.gradle file:
implementation(group: 'net.zetetic', name: 'sqlcipher-android', version: '4.14.1')
implementation(group: 'androidx.sqlite', name: 'sqlite', version: '2.6.2')
Some third-party SDKs include the Community Edition of SQLCipher for Android as a transitive dependency. In certain deployments, organizations may prefer to replace the Community Edition with the Commercial or Enterprise Edition of SQLCipher for Android. This preference is often driven by requirements such as improved performance, access to advanced features, dedicated vendor support, or compliance needs including FIPS 140-3 integration.
To resolve this dependency conflict, Gradle’s dependency exclusion mechanism can be used to prevent the Community Edition of SQLCipher for Android from being bundled with the application, while explicitly including the Commercial or FIPS-enabled edition of SQLCipher for Android instead.
// Include Okta SDK, excluding SQLCipher for Android Community Edition
implementation(platform(libs.okta.bom))
implementation(libs.okta.auth.foundation) {
exclude(group = "net.zetetic", module = "sqlcipher-android")
}
implementation(libs.okta.oauth2){
exclude(group = "net.zetetic", module = "sqlcipher-android")
}
implementation(libs.okta.web.authentication.ui) {
exclude(group = "net.zetetic", module = "sqlcipher-android")
}
// Include SQLCipher for Android FIPS
implementation(files("libs/sqlcipher-android-fips-4.14.1.aar"))
implementation(libs.androidx.sqlite.ktx)