如何包括Android原生扩展的其他罐Adobe AIR的移动Android、Adobe、AIR

2023-09-13 02:09:03 作者:兔子必须死

我在使用Adobe AIR的移动(FlashBuilder)和Android原生扩展(ANE)建立pretty的可爱的小应用程序。我想,以纳入Jayspt加密库与我的ANE但我似乎无法找到任何文件,告诉如何做到这一点。如果我做标准ADT出口罐子的ANE构建,它不包括jayspt罐子。

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.

有谁知道(拼出来对我来说),包括在ANE另一个罐子?

Does anyone know how (spell it out for me) to include another jar in the ANE?

谢谢, FB

推荐答案

首先请确保您使用的是AIR 4.0 +包装。早期版本肯定能做得一样好,但下面的方法是非常容易的,不需要罐子的重新包装。首先,你只需将它添加到你的Andr​​oid项目作为外部LIB,这将使所有可用的功能在你的code。

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.

然后创建一个平台 - 选项 - android.xml为Android,它应该如下所示:

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>

您需要确保该jayspt.jar文件坐在同一目录下的原生扩展的jar文件。

You'll need to make sure that the jayspt.jar file sits in the same directory as your native extension jar file.

现在你打包脚本请确保您指定的Andr​​oid平台的选择:

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] .