问题描述:

I have one android myLibrary.jar file. But myLibrary.jar file will load the native 3 different so file. I have a.so, b.so and c.so.

When i using in my own application, it just simply put the jar file to the Android Dependencies and all 3 so files put in the libs/armeabi of the main application package.

When deploy and install on the device, these so file will be in the data/data/my-appname/lib/*.so.

Now i need to provide the sdk solution. The user side doesn't want the main application. They just want the myLibrary.jar. So i am considering about packing all 3 *.so files to the jar. I searched for the how to add to the so files to myLibrary.jar. But i still don't understand.

In this following post:

[Ant]How to add .so file into a jar and use it within jar(set the java.library.path)?

It mentioned about adding the so file to the jar and extract at runtime. But i still don't understand how to achieve that.

After trying that mentioned in the following post:

Creating a product SDK: How do I add a native lib (.SO) and a jar with the SDK I am creating?

After my sample application reference the the compiled jar that included the .so file. After installing to the device, the libs/armeabi/xxx is not unpacked on the install. So i would like to know how to extract them dynamically and save them to data/data/my-appname/lib/ so that i can use with System.loadlibary(.so).

Thanks a lot.

相关阅读:
Top