Guidance on Local Build of 4.5.3 for 16 KB Page Alignment Support

Hello SQLCipher Team,

Our team is currently using android-database-sqlcipher:4.5.3 in our application. We have a requirement to add support for Android devices that use a 16 KB memory page size, which involves recompiling the native libraries with the appropriate linker flags.

Unfortunately, we are unable to upgrade to the latest major version of the library at this time due to a critical project constraint: we must maintain support for older devices running Android 4.4 (KitKat, API 19).

Our proposed solution is to create a forked build of the 4.5.3 release. We plan to build the native components ourselves, adding the necessary linker flag (-Wl,-z,max-page-size=16384) to the build process to ensure compliance.

We have been working through the local build process and want to validate our setup with you to ensure we are following the correct procedure and using the intended component versions for this specific release.

Our questions are as follows:

1. Verification of Prerequisites for android-database-sqlcipher:4.5.3: Based on our research, we have assembled the following list of dependencies. Could you please confirm if this is the correct “bill of materials” for building this version?

  • OpenSSL Version: 1.1.1s
  • SQLCipher Core Version: 4.5.2
  • Android NDK Version: r23 (specifically build 23.0.7599858)
  • Tcl Version: 8.5 (required for the amalgamation scripts to run without modification)

2. Default Amalgamation Flags: Are there any specific, non-obvious CFLAGS or configure flags that are used by your official build system when generating the sqlite3.c amalgamation for the official release? We want to ensure our locally generated or downloaded amalgamation matches the official one as closely as possible in terms of included features.

3. Potential Dangers of This Approach: Are there any significant dangers or “gotchas” we should be aware of when using this approach? Specifically, are there any known incompatibilities or subtle issues that might arise from recompiling the 4.5.3 version with this modern linker flag, especially concerning its interaction with the older Android API levels we need to support?

Thank you for your time and for providing such an excellent library. Any guidance you can offer would be greatly appreciated.

Hello @dinq. We no longer support the Community Edition of android-database-sqlcipher so we don’t provide guidance on, or recommend, custom builds.

That said, we provide “long term support” packages for android-database-sqlcipher with 16kb page size under Commercial Edition licensing.

If you really need to continue using the same library, please contact us at support@zetetic.net to discuss this option.