Sqlcipher library is adding 6mb to apk size!


#1

Sqlcipher library is adding 6mb to apk size !

For sake of encryption, 6mb is not acceptable for a user. any progard rules to add ? i have added this. no help!
-keep class net.sqlcipher.** { *; }

How much of size does sqlcipher library add to apk size ? How can i reduce the size ?


#2

@srinivas3120 as @developernotes mentioned on the Github ticket you opened, here isn’t a simple way to reduce the size. You can consider removing native platforms to reduce the number of binary objects that have to be included with the APK (e.g. remove x86, since libhoudini should allow the arm binaries to be used). For example, if you are manually packaging SQLCipher, only include the armeabi and armeabi-v7a folders and binaries. Or, if you are using gradel, include an abiFilter in the gradle configuration, e.g.

ndk {
    abiFilters "armeabi", "armeabi-v7a"
}

If that doesn’t reduce the size enough you will need to reconsider using SQLCipher to provide your application with local data encryption.


#3

Generally, How much of size does sqlcipher library add to apk size ? I am using gradle
compile 'net.zetetic:android-database-sqlcipher:3.5.4@aar'


#4

@srinivas3120 ~5 or ~6 MB sounds about right. The native arm libraries are in the neighborhood of 1.25 MB each. The native x86 lib is 2.2 MB.


#5

what are cons of removing x86 lib?
Is it guaranteed “libhoudini should allow the arm binaries to be used” after removing x86 lib


#6

Hi @srinivas3120

libhoudini is a translation library which is not provided by Zetetic, so we cannot provide a guarantee that it will work on every device. You will have to decide whether the additional size required for SQLCipher on Android is appropriate for your application.