9

I have a phonegap/cordova app that I want to secure with Precise Biometric's Smart Card Tactivo reader. I am very new to Smart card integration, and Precise Biometrics does not seem to have a very informative documentation. However I have found that I need to create my own plugin for phonegap in order to use the card reader.

My question is: is there a plugin already created for this, or can someone post an example of the plugin code that I would need?

So far I have this code in my plugin.xml file:

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

And no code in the www/*.js files

I just want to be pointed in the right direction. Thanks.

now_world
  • 940
  • 7
  • 21
  • 56
  • If you are going to down vote please have the common courtesy and explain why. How will I ever know "better" if you don't... – now_world Apr 15 '15 at 20:40
  • I assume that the downvote could've come from lack of own effort to solve this as the guides are out there to be read and you haven't actually tried to write the plugin part. – Roope Hakulinen Apr 23 '15 at 14:11

1 Answers1

0

No, I wasn't able to find a plugin to do this for you and most probably there doesn't exist one simply because the Smart Card Tactivos aren't too common.

That said, the only option is to create a plugin of your own. First of all, you need to get the Precise Mobile Toolkit details from the Precise Biometrics as described on their website:

Please contact your local Precise Biometrics representative or email: partners@precisebiometrics.com to request a free toolkit.

After you get the toolkit you need to just wrap the implementation as Cordova plugin as described on Cordova documentation: generally about plugins and specifically about Android plugin development. Please also see other plugins that support Android for reference. Good examples to look into are the most used ones such as the Device plugin (and especially the Android implementation) and the File plugin (and its Android implementation). From there two the first one is simpler and shows well the basic structure of how to implement callable Java functions whereas the later one provides much more sophisticated structure and a lot more of example.

Roope Hakulinen
  • 7,326
  • 4
  • 43
  • 66