【问题标题】:phonegap app with Smart Card integration具有智能卡集成的 phonegap 应用程序
【发布时间】:2015-04-14 18:02:26
【问题描述】:

我有一个 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 文件中没有代码

我只想指出正确的方向。谢谢。

【问题讨论】:

  • 如果您要投反对票,请保持礼貌并解释原因。如果你不这样做,我怎么会知道“更好”……
  • 我认为投反对票可能是由于缺乏自己的努力来解决这个问题,因为指南在那里可供阅读,而您实际上并没有尝试编写插件部分。

标签: android cordova phonegap-plugins smartcard


【解决方案1】:

不,我无法为您找到一个插件来执行此操作,而且很可能不存在一个插件,这仅仅是因为 Smart Card Tactivos 不太常见。

也就是说,唯一的选择是创建自己的插件。首先,您需要从 Precise Biometrics 中获取 Precise Mobile Toolkit 详细信息,如 their website 所述:

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

获得工具包后,您只需将实现包装为 Cordova 插件,如 Cordova 文档中所述:generally about pluginsspecifically about Android plugin development。另请参阅其他支持 Android 的插件以供参考。要研究的好例子是最常用的例子,例如Device plugin(尤其是Android implementation)和File plugin(及其Android implementation)。从那两个开始,第一个更简单,并且很好地展示了如何实现可调用 Java 函数的基本结构,而后一个提供了更复杂的结构和更多示例。

【讨论】:

    猜你喜欢
    • 2019-12-07
    • 2013-08-02
    • 1970-01-01
    • 2013-01-18
    • 1970-01-01
    • 1970-01-01
    • 2015-10-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多