SQLCipher for Android - Upcoming Changes for Android N and Coordinated Beta Test Request

Google has recently announced significant behavior changes for NDK applications in the Android N Developer preview. Prior to the Android N Preview, NDK applications could link to platform libraries for supporting functions, but this support for linking against non-public APIs is being removed in Android N. In addition to the public deprecation of access to private/internal APIs, the Google Android team has also contacted us directly and requested that we reengineer the SQLCipher for Android library to remove all private API calls (special thanks to Google for providing guidance and clarification on the requirements).

As noted in GitHub issues and SQLCipher discussion posts on the topic, these behavior changes have caused existing builds of SQLCipher for Android to fail on Android N.

The reason for this has to do with the historical architecture of SQLCipher for Android; the library was originally based on a fork of the android.database.sqlite AOSP code, recompiled to link SQLCipher instead of standard SQLite. The underlying JNI code included a number of tight dependencies on third party libraries and internal APIs. While this approach has worked well for Android versions from 2.1 up to and including 6, these dependencies are no longer feasible with Android N.

Because of these requirements, we recently undertook a substantial effort to prepare a new version of SQLCipher for Android which is meant to provide a better foundation for use with Android N and future Android releases (along with compatibility to older versions of Android dating to 2.1).

The changes to the library were, out of necessity, both substantial and invasive:

  1. All internal and third-party library dependencies except for OpenSSL (the crypto provider) have been removed. This includes libbinder, libandroid_runtime, libnativehelper, libcutils, libutils, and libicuc.
  2. Non-essential Google AOSP legacy provider code and supporting code has been removed
  3. The library has been converted to use native UTF-16 encoding instead of performing redundant on-the-fly translation
  4. Multiple related changes to the JNI layer

There have been some significant benefits to this effort:

  1. The build process has been drastically simplified and is now much easier to understand
  2. Issues with characters that fall outside of the basic multilingual plane (e.g. emoticons) have been resolved
  3. Less time is required to build the library from source
  4. Only a single native .so library is required for each platform
  5. The resulting libraries are much smaller that before (armeabi is only 1.6 MB), and no longer require a large supporting ICU database
  6. These architecture changes pave the way for future improvements like API modernization and improved x64 support

At this time, the new beta branch successfully passes all tests found in the SQLCipher for Android test suite.

However we know that the test suite isn’t all encompassing, and due to the scope of the changes, there may be other impacts to these changes that can most effectively be identified by a widespread beta test.

As a result, we would like to recruit interested developers to assist us with a coordinated beta test process. Participation is open, we simply ask that interested beta testers:

  1. Contact us at support@zetetic.net with your SQLCipher Community Forum username so we can arrange access to the appropriate supporting resources (see below)
  2. Have an existing application that already includes SQLCipher for Android that can be utilized for regression testing and compatibility testing purposes
  3. Have access to the Android N Developer preview emulators and at least one Android N device for testing
  4. Be willing to test on older versions of Android (emulators and devices) to ensure backward compatibility
  5. Be willing to share your test results with the SQLCipher team, i.e. either confirming that the new SQLCipher for Android release is working with your application, or providing detailed technical summaries of any issues you encounter (along with troubleshooting support)

In order to accelerate and simplify the coordinated beta testing experience, we will provide pre-built binary packages during the beta period, and access to a site to report and discuss any findings.

Of course, if you would prefer not to participate in the coordinated beta for any reason, you can still check out the changes in the new beta branch on GitHub.

This new version of SQLCipher for Android will provide the long term foundation for ongoing Android support.This will quite likely be a mandatory upgrade for any applications wishing to support Android N when it is publically released. As a result, we are taking this update very seriously, and this coordinated beta test provides a unique opportunity to help ensure a successful upgrade for the numerous applications that depend on SQLCipher.

We know there is a lot of interest in supporting SQLCipher for Android in the future, a platform we are excited about. We look forward to hearing back from you when you get the opportunity to test out the latest development of SQLCipher for Android!

1 Like

Will this affect Codebook on Android?

Hi @LDCR

Codebook for Android does utilize SQLCipher for Android. We have already begun internal testing of Codebook for Android with the new beta builds and haven’t identified any issues with the new SQLCipher for Android library.

Congrats on this, it sounds like a major achievement! Glad to see you ditching our old hacks and kludges :wink: I’ll try testing with IOCipher.

Hi @eighthave

Thanks! We look forward to hearing your results with IOCipher as well.

Hi Guys,

Is there any release ETA for this library? it’s currently in beta; Thanks!

Hi folks , any upcoming changes for Android O ?Thanks .

1 Like

Hi @manju143

Thanks for inquiring! SQLCipher for Android will operate on Android O. Is there anything specific you are looking for?

Hello!, will this library work for Android O out of the box or will it need and update?

Hi @critikal

We are not planning on any changes as of yet with Android O. Everything is working properly with the latest release. We urge you to verify the behavior of your application on Android O however.

1 Like