I have build a pretty nice little app using Adobe Air Mobile (FlashBuilder) and Android Native Extensions (ANE). I would like to incorporate the Jayspt encryption library with my ANE but I can't seem to find any documentation telling how to do it. If I do the standard ADT export to jar for the ANE build, it doesn't include the jayspt jar.
Does anyone know how (spell it out for me) to include another jar in the ANE?
Thanks, FB
Firstly make sure you're using AIR 4.0+ to package. Earlier versions definitely can do it as well but the following method is much easier and doesn't require repackaging of the jar. Firstly you just add it to your Android project as an external lib, this will make all the functions available in your code.
Then create a platform-options-android.xml for android, it should look like the following:
<platform xmlns="http://ns.adobe.com/air/extension/4.0">
<packagedDependencies>
<packagedDependency>jayspt.jar</packagedDependency>
</packagedDependencies>
<packagedResources>
</packagedResources>
</platform>
You'll need to make sure that the jayspt.jar file sits in the same directory as your native extension jar file.
Now in your packaging script make sure you specify the platform options for android:
adt -package [YOUR NORMAL OPTIONS] \
-platform Android-ARM -platformoptions platform-options-android.xml -C [PATH TO YOUR LIB] .
来源:https://stackoverflow.com/questions/24626380/how-to-include-additional-jar-in-android-native-extension-for-adobe-air-mobile