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).
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:
- 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.
- Non-essential Google AOSP legacy provider code and supporting code has been removed
- The library has been converted to use native UTF-16 encoding instead of performing redundant on-the-fly translation
- Multiple related changes to the JNI layer
There have been some significant benefits to this effort:
- The build process has been drastically simplified and is now much easier to understand
- Issues with characters that fall outside of the basic multilingual plane (e.g. emoticons) have been resolved
- Less time is required to build the library from source
- Only a single native .so library is required for each platform
- The resulting libraries are much smaller that before (armeabi is only 1.6 MB), and no longer require a large supporting ICU database
- These architecture changes pave the way for future improvements like API modernization and improved x64 support
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:
- Contact us at email@example.com with your SQLCipher Community Forum username so we can arrange access to the appropriate supporting resources (see below)
- Have an existing application that already includes SQLCipher for Android that can be utilized for regression testing and compatibility testing purposes
- Have access to the Android N Developer preview emulators and at least one Android N device for testing
- Be willing to test on older versions of Android (emulators and devices) to ensure backward compatibility
- 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!