MuPdf Android JNI library is very large

As described here ( https://github.com/sufficientlysecure/document-viewer/issues/88 ), we are faced with the problem that the JNI library, which is part of the MuPdf Android demo, is really great. In this case, this affects the size of the Document Viewer application ( https://f-droid.org/repository/browse/?fdid=org.sufficientlysecure.viewer ). * .So files in the APK are larger than 12 MB!

Before updating MuPdf to the latest version a few months ago (i.e. version 2.5 and an earlier version of Document Viewer), * .so files were only 3.9 MB each.

Can you explain this increase literally by 300%? Is there anything we can change to compress our JNI libraries further?

+5
source share
1 answer

1) Split .apk

Support for NDK in AndroidStudio and the choice between Android Studio and Eclipse

2) Minimize MuPDF

It is imperative that you yourself create a library from sources and generate several .so based on the platform (sources contain strong tips on how to achieve this, so I won’t go into details).

Then try adding

 LOCAL_CFLAGS += -DNOCJK 

in Core.mk to exclude fonts from .so (this means that fonts from resources\fonts\droid of 9 MB will now be deleted from the library).

I just switched from 9266 kB to 2155 kB without unpacking.

EDIT:. Again, it depends on your target market. You may need to leave them. CJK = Chinese, Japanese, Korean

+6
source

All Articles