简体   繁体   English

MuPdf Android JNI库非常大

[英]MuPdf Android JNI library is very large

As described here ( https://github.com/sufficientlysecure/document-viewer/issues/88 ) we're facing the problem that the JNI library that is part of the MuPdf Android demo is really large. 如此处所述( https://github.com/sufficientlysecure/document-viewer/issues/88 ),我们面临的问题是,作为MuPdf Android演示的一部分的JNI库非常大。 In this case, this affects the size of the Document Viewer app ( https://f-droid.org/repository/browse/?fdid=org.sufficientlysecure.viewer ). 在这种情况下,这会影响Document Viewer应用程序的大小( https://f-droid.org/repository/browse/?fdid=org.sufficientlysecure.viewer )。 The *.so files in the APK are more than 12 MB in size! APK中的* .so文件大小超过12 MB!

Before we updated MuPdf to the latest version a few months ago (ie version 2.5 and earlier of Document Viewer), the *.so files accounted for only 3,9 MB each. 在我们几个月前将MuPdf更新到最新版本之前(即文档查看器的2.5及更早版本),* .so文件每个仅占3,9 MB。

Can you explain this increase of literally 300%? 你能解释这300%的增长吗? Is there anything we can change to compress our JNI libs further? 有什么我们可以改变来进一步压缩我们的JNI库吗?

1) Splitting .apk 1)分裂.apk

NDK support in AndroidStudio and choosing between Android Studio and Eclipse AndroidStudio中支持NDK,并在Android Studio和Eclipse之间进行选择

2) Minimizing MuPDF 2)最小化MuPDF

It is absolutely essential you build the library from sources yourself and generate multiple .so s based on platform (the sources contain strong hints on how to achieve this so I'll not go into details). 您自己从源代码构建库并基于平台生成多个.so是绝对必要的(源代码包含有关如何实现此目的的强烈提示,因此我不会详细介绍)。

Then try adding 然后尝试添加

LOCAL_CFLAGS += -DNOCJK

in Core.mk to exclude fonts from the .so (that's right, the 9 MB worth of fonts from resources\\fonts\\droid will now be stripped from the library). Core.mk中从.so排除字体(这是正确的, resources\\fonts\\droid的9 MB字体现在将从库中删除)。

Just went from 9266 kB to 2155 kB unpacked . 刚刚从9266 kB转到2155 kB unpacked

EDIT: Then again it depends what your target market is. 编辑:那又取决于你的目标市场。 You might need to keep those in. CJK = Chinese, Japanese, Korean 你可能需要保留这些.CJK =中文,日文,韩文

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM