使用智能卡集成的PhoneGap应用程序

9
我有一个使用Phonegap/Cordova开发的应用程序,我希望使用Precise Biometric公司的Smart Card Tactivo读卡器来保护它。我对智能卡集成非常陌生,而Precise Biometrics似乎没有提供详细的文档资料。然而,我发现需要创建自己的phonegap插件才能使用读卡器。
我的问题是:是否已经有为此创建的插件,或者有人可以发布我需要的插件代码示例?
到目前为止,在我的plugin.xml文件中,我拥有下面的代码:
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
    xmlns:rim="http://www.blackberry.com/ns/widgets"
    xmlns:android="http://schemas.android.com/apk/res/android"
    id="cordova-plugin-device"
    version="1.0.0-dev">
    <name>smartCard</name>
    <description>Cordova smartCard Plugin</description>
    <license>Apache 2.0</license>
    <keywords>cordova,smartCard</keywords>
    <repo>https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git</repo>
    <issue>https://issues.apache.org/jira/browse/CB/component/12320648</issue>

    <js-module src="www/smartCard.js" name="smartCard">
        <clobbers target="smartCard" />
    </js-module>

...

<!-- android -->
    <platform name="android">
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="smartCard" >
                <param name="android-package" value="org.apache.cordova.smartCard.SMARDCARD"/>
            </feature>
        </config-file>
        <config-file target="AndroidManifest.xml" parent="/*">
           <uses-permission android:name="com.precisebiometrics.android.mtk.manager.permission.BIOMETRIC_DATA" />
        </config-file>

        <source-file src="src/android/smartCard.java" target-dir="src/org/apache/cordova/smartCard" />

         <js-module src="www/smartCardHandle.js" name="smartCardHandle">
            <clobbers target="smartCardrHandle" />
        </js-module>


    </platform>

我希望能得到指引,关于www/*.js文件中没有代码的问题。谢谢。


如果你要点踩,请有基本的礼貌并解释原因。如果你不解释,我怎么会知道如何做得“更好”呢? - now_world
我认为这个踩的可能是因为你没有自己努力去解决这个问题,因为相关指南已经存在并且你也没有尝试编写插件部分。 - Roope Hakulinen
1个回答

0

不,我无法为您找到一个能够完成这个任务的插件,很可能是因为Smart Card Tactivos并不常见。

话虽如此,唯一的选择就是自己创建一个插件。首先,您需要从Precise Biometrics获取Precise Mobile Toolkit的详细信息,如他们的网站所述:

请联系您当地的Precise Biometrics代表或发送电子邮件至:partners@precisebiometrics.com以请求免费工具包。

获取工具包后,您只需要按照Cordova文档所述的方法将其实现封装为Cordova插件:通常关于插件的说明特别是关于Android插件开发的说明。请参考其他支持Android的插件以供参考。值得关注的好例子包括最常用的设备(plugin)(特别是Android实现)和文件(plugin)(及其Android实现)。从中,第一个更简单,可以很好地展示如何实现可调用Java函数的基本结构,而后者则提供了更复杂的结构和更多的示例。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接