react-native-rdservice-fingerprintscanner 1.1.12 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -2
- package/README.md +75 -78
- package/android/build.gradle +86 -42
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/AndroidManifestNew.xml +20 -0
- package/android/src/main/java/com/{reactnativerdservicefingerprintscanner → rdservicefingerprintscanner}/RDServiceEvents.java +1 -2
- package/android/src/main/java/com/{reactnativerdservicefingerprintscanner → rdservicefingerprintscanner}/RDServiceManager.java +6 -8
- package/android/src/main/java/com/{reactnativerdservicefingerprintscanner → rdservicefingerprintscanner}/RdserviceFingerprintscannerModule.java +26 -27
- package/android/src/main/java/com/rdservicefingerprintscanner/RdserviceFingerprintscannerPackage.java +28 -0
- package/lib/commonjs/index.d.js +2 -0
- package/lib/commonjs/index.d.js.map +1 -0
- package/lib/commonjs/index.js +121 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/index.d.js +2 -0
- package/lib/module/index.d.js.map +1 -0
- package/lib/module/index.js +111 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/index.test.d.ts +1 -0
- package/lib/typescript/index.test.d.ts.map +1 -0
- package/package.json +43 -26
- package/react-native-rdservice-fingerprintscanner.podspec +24 -2
- package/src/index.d.ts +37 -18
- package/src/index.js +20 -1
- package/android/src/main/java/com/reactnativerdservicefingerprintscanner/RdserviceFingerprintscannerPackage.java +0 -28
package/LICENSE
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
4
|
-
|
|
3
|
+
Copyright (c) 2024 Senthalan
|
|
5
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
5
|
of this software and associated documentation files (the "Software"), to deal
|
|
7
6
|
in the Software without restriction, including without limitation the rights
|
package/README.md
CHANGED
|
@@ -8,16 +8,13 @@ This library makes it easy to work with all such devices so that your app can se
|
|
|
8
8
|
|
|
9
9
|
For reference, you may check out the ([Aadhaar Registered Devices by UIDAI](https://uidai.gov.in/images/resource/Aadhaar_Registered_Devices_2_0_4.pdf)).
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
11
|
## Installation
|
|
15
12
|
|
|
16
13
|
```sh
|
|
17
14
|
npm install react-native-rdservice-fingerprintscanner
|
|
18
15
|
```
|
|
19
16
|
|
|
20
|
-
Add jitpack in your root build.gradle file at the end of repositories:
|
|
17
|
+
Add jitpack in your root build.gradle file at the end of repositories: `android/build.gradle`
|
|
21
18
|
|
|
22
19
|
```java
|
|
23
20
|
allprojects {
|
|
@@ -31,101 +28,101 @@ allprojects {
|
|
|
31
28
|
## Usage
|
|
32
29
|
|
|
33
30
|
```js
|
|
34
|
-
import {
|
|
31
|
+
import {
|
|
32
|
+
getDeviceInfo,
|
|
33
|
+
captureFinger,
|
|
34
|
+
isDriverFound,
|
|
35
|
+
openFingerPrintScanner,
|
|
36
|
+
AVAILABLE_PACKAGES,
|
|
37
|
+
DEFAULT_PID_OPTIONS,
|
|
38
|
+
} from 'react-native-rdservice-fingerprintscanner';
|
|
35
39
|
|
|
36
40
|
// ...
|
|
37
41
|
|
|
38
42
|
getDeviceInfo()
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
43
|
+
.then((response) => {
|
|
44
|
+
console.log(response, 'DEVICE DRIVER FOUND'); // Response about Device Driver
|
|
45
|
+
})
|
|
46
|
+
.catch((error) => {
|
|
47
|
+
console.log(error, 'DEVICE DRIVER NOT FOUND'); //Failed to get device information
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
captureFinger(pidOptions) //you can pass pidOptions (optional) to "captureFinger(pidOptions)"" method otherwise it takes DEFAULT_PID_OPTIONS
|
|
51
|
+
.then((response) => {
|
|
52
|
+
console.log(response, 'FINGER CAPTURE'); // FingerPrint Response
|
|
53
|
+
})
|
|
54
|
+
.catch((e) => {
|
|
55
|
+
console.log(e, 'ERROR_FINGER_CAPTURE'); // Failed to capture the Fingerprint
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
isDriverFound(PACKAGE_NAME) // you can use AVAILABLE_PACKAGES for PACKAGE_NAME
|
|
59
|
+
.then((res) => {
|
|
60
|
+
console.log(res, 'DRIVER CHECK');
|
|
61
|
+
})
|
|
62
|
+
.catch((error) => {
|
|
63
|
+
console.log(error, 'ERROR_DRIVER CHECK');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
openFingerPrintScanner(PACKAGE_NAME, pidOptions) //you can pass pidOptions (optional) to "openFingerPrintScanner(pidOptions)"" method otherwise it takes DEFAULT_PID_OPTIONS
|
|
67
|
+
.then((res) => {
|
|
68
|
+
console.log(res, 'FINGER CAPTURE');
|
|
69
|
+
})
|
|
70
|
+
.catch((e) => {
|
|
71
|
+
console.log(e, 'ERROR_FINGER_CAPTURE');
|
|
72
|
+
});
|
|
70
73
|
```
|
|
71
74
|
|
|
75
|
+
`pidOptions` is an XML String that you have to pass to `captureFinger` and `openFingerPrintScanner` methods. Refer [UIDAI Document](https://uidai.gov.in/images/resource/Aadhaar_Registered_Devices_2_0_4.pdf)
|
|
72
76
|
|
|
73
|
-
|
|
77
|
+
`DEFAULT_PID_OPTIONS` is used when you not passed the pidOptions to the `captureFinger()` Method.
|
|
74
78
|
|
|
75
|
-
|
|
79
|
+
`PACKAGE_NAME` is required to check the rd service. (eg) The Package name of StarTek Device is `com.acpl.registersdk`
|
|
76
80
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
```Note``` : Call ```captureFinger()``` Method after getting response from getDeviceInfo() method. Calling of ```captureFinger()``` method before ```getDeviceInfo()``` method, only returns Error in ```catch``` block. Refer [Example Code](https://github.com/senthalan2/react-native-rdservice-fingerprintscanner/blob/main/example/src/App.js). Call ```openFingerPrintScanner()``` method once the ```isDriverFound()``` method returns true value, if the driver is not found then the ```openFingerPrintScanner()``` method returns driver not found error. These added two methods (```isDriverFound()``` and ```openFingerPrintScanner()```) are used to find the selected RD Service which is passed as an argument (device driver package name) to these methods.
|
|
81
|
+
You can use `AVAILABLE_PACKAGES` for `PACKAGE_NAME`.
|
|
80
82
|
|
|
83
|
+
`Note` : Call `captureFinger()` Method after getting response from getDeviceInfo() method. Calling of `captureFinger()` method before `getDeviceInfo()` method, only returns Error in `catch` block. Refer [Example Code](https://github.com/senthalan2/react-native-rdservice-fingerprintscanner/blob/main/example/src/App.js). Call `openFingerPrintScanner()` method once the `isDriverFound()` method returns true value, if the driver is not found then the `openFingerPrintScanner()` method returns driver not found error. These added two methods (`isDriverFound()` and `openFingerPrintScanner()`) are used to find the selected RD Service which is passed as an argument (device driver package name) to these methods.
|
|
81
84
|
|
|
82
85
|
## Response JSON Object
|
|
83
86
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
Key | Value | Description
|
|
87
|
-
--- | --- | ---
|
|
88
|
-
status | -1 or 1 or 0 | ```-1``` - Device Driver not Found, ```1``` - READY, ```0``` - NOTREADY
|
|
89
|
-
isWhitelisted | true or false | iT is about the Device is Approved or not. ```true``` - Approved, ```false``` - Not Approved
|
|
90
|
-
rdServiceInfoJson |JSON DATA | The device returns XML DATA of Device Information. this parameter contains converted JSON DATA of XML DATA
|
|
91
|
-
rdServiceInfoXML | XML DATA | Device Information
|
|
92
|
-
rdServicePackage | Device Package
|
|
93
|
-
message | Message about Success or Failure
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
```captureFinger()``` and ```openFingerPrintScanner()``` Methods Reponse
|
|
98
|
-
|
|
99
|
-
Key | Value | Description
|
|
100
|
-
--- | --- | ---
|
|
101
|
-
status | 1 or 0 | ```1``` - Fingerprint Captured Successfully, ```0``` - FingerPrint not Captured (Check Connection of Device and OTG Connection Settings in Mobile)
|
|
102
|
-
errorCode | ERROR CODE from RD Service | Refer [UIDAI Document](https://uidai.gov.in/images/resource/Aadhaar_Registered_Devices_2_0_4.pdf) and [RDService Error Details](https://github.com/senthalan2/react-native-rdservice-fingerprintscanner/blob/main/Assets/RDService_Error_Details.pdf)
|
|
103
|
-
errInfo | Error Message according to the ERROR CODE | Refer [UIDAI Document](https://uidai.gov.in/images/resource/Aadhaar_Registered_Devices_2_0_4.pdf) and [RDService Error Details](https://github.com/senthalan2/react-native-rdservice-fingerprintscanner/blob/main/Assets/RDService_Error_Details.pdf)
|
|
104
|
-
pidDataJson |JSON DATA | The device returns PID DATA of Captured Fingerprint. this parameter contains converted JSON pidData of XML pidData
|
|
105
|
-
pidDataXML | XML DATA | pidData Captured Fingerprint
|
|
106
|
-
rdServicePackage | Device Package
|
|
107
|
-
message | Message about Success or Failure
|
|
108
|
-
|
|
87
|
+
`getDeviceInfo()` Method Reponse
|
|
109
88
|
|
|
89
|
+
| Key | Value | Description |
|
|
90
|
+
| ----------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
91
|
+
| status | -1 or 1 or 0 | `-1` - Device Driver not Found, `1` - READY, `0` - NOTREADY |
|
|
92
|
+
| isWhitelisted | true or false | iT is about the Device is Approved or not. `true` - Approved, `false` - Not Approved |
|
|
93
|
+
| rdServiceInfoJson | JSON DATA | The device returns XML DATA of Device Information. this parameter contains converted JSON DATA of XML DATA |
|
|
94
|
+
| rdServiceInfoXML | XML DATA | Device Information |
|
|
95
|
+
| rdServicePackage | Device Package |
|
|
96
|
+
| message | Message about Success or Failure |
|
|
110
97
|
|
|
111
|
-
|
|
98
|
+
`captureFinger()` and `openFingerPrintScanner()` Methods Reponse
|
|
112
99
|
|
|
113
|
-
Key
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
100
|
+
| Key | Value | Description |
|
|
101
|
+
| ---------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
102
|
+
| status | 1 or 0 | `1` - Fingerprint Captured Successfully, `0` - FingerPrint not Captured (Check Connection of Device and OTG Connection Settings in Mobile) |
|
|
103
|
+
| errorCode | ERROR CODE from RD Service | Refer [UIDAI Document](https://uidai.gov.in/images/resource/Aadhaar_Registered_Devices_2_0_4.pdf) and [RDService Error Details](https://github.com/senthalan2/react-native-rdservice-fingerprintscanner/blob/main/Assets/RDService_Error_Details.pdf) |
|
|
104
|
+
| errInfo | Error Message according to the ERROR CODE | Refer [UIDAI Document](https://uidai.gov.in/images/resource/Aadhaar_Registered_Devices_2_0_4.pdf) and [RDService Error Details](https://github.com/senthalan2/react-native-rdservice-fingerprintscanner/blob/main/Assets/RDService_Error_Details.pdf) |
|
|
105
|
+
| pidDataJson | JSON DATA | The device returns PID DATA of Captured Fingerprint. this parameter contains converted JSON pidData of XML pidData |
|
|
106
|
+
| pidDataXML | XML DATA | pidData Captured Fingerprint |
|
|
107
|
+
| rdServicePackage | Device Package |
|
|
108
|
+
| message | Message about Success or Failure |
|
|
117
109
|
|
|
110
|
+
`isDriverFound()` Method Response
|
|
118
111
|
|
|
112
|
+
| Key | Value | Description |
|
|
113
|
+
| ------------------- | ------------------------------------- | ------------------------------------------------- |
|
|
114
|
+
| isDeviceDriverFound | true or false | `true` - Driver Found, `false` - Driver not found |
|
|
115
|
+
| message | Message about the driver found or not |
|
|
119
116
|
|
|
120
117
|
## Tested Devices
|
|
121
118
|
|
|
122
|
-
Device Name
|
|
123
|
-
|
|
124
|
-
Startek FM220 | :white_check_mark:
|
|
125
|
-
MORPHO
|
|
126
|
-
MANTRA
|
|
127
|
-
Tatvik TMF20
|
|
128
|
-
PB510
|
|
119
|
+
| Device Name | Result |
|
|
120
|
+
| ------------- | ------------------ |
|
|
121
|
+
| Startek FM220 | :white_check_mark: |
|
|
122
|
+
| MORPHO | :white_check_mark: |
|
|
123
|
+
| MANTRA | :white_check_mark: |
|
|
124
|
+
| Tatvik TMF20 | :white_check_mark: |
|
|
125
|
+
| PB510 | :white_check_mark: |
|
|
129
126
|
|
|
130
127
|
## Contributing
|
|
131
128
|
|
package/android/build.gradle
CHANGED
|
@@ -1,60 +1,104 @@
|
|
|
1
1
|
buildscript {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
repositories {
|
|
3
|
+
google()
|
|
4
|
+
mavenCentral()
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
dependencies {
|
|
8
|
+
classpath "com.android.tools.build:gradle:7.2.1"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
def isNewArchitectureEnabled() {
|
|
13
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
apply plugin: "com.android.library"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
|
|
20
|
+
|
|
21
|
+
if (isNewArchitectureEnabled()) {
|
|
22
|
+
apply plugin: "com.facebook.react"
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
def getExtOrDefault(name) {
|
|
26
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["RdserviceFingerprintscanner_" + name]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
def getExtOrIntegerDefault(name) {
|
|
30
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["RdserviceFingerprintscanner_" + name]).toInteger()
|
|
13
31
|
}
|
|
14
32
|
|
|
15
|
-
|
|
33
|
+
def supportsNamespace() {
|
|
34
|
+
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
|
|
35
|
+
def major = parsed[0].toInteger()
|
|
36
|
+
def minor = parsed[1].toInteger()
|
|
16
37
|
|
|
17
|
-
|
|
18
|
-
|
|
38
|
+
// Namespace support was added in 7.3.0
|
|
39
|
+
if (major == 7 && minor >= 3) {
|
|
40
|
+
return true
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return major >= 8
|
|
19
44
|
}
|
|
20
45
|
|
|
21
46
|
android {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
minSdkVersion safeExtGet('RdserviceFingerprintscanner_minSdkVersion', 16)
|
|
25
|
-
targetSdkVersion safeExtGet('RdserviceFingerprintscanner_targetSdkVersion', 29)
|
|
26
|
-
versionCode 1
|
|
27
|
-
versionName "1.0"
|
|
47
|
+
if (supportsNamespace()) {
|
|
48
|
+
namespace "com.rdservicefingerprintscanner"
|
|
28
49
|
|
|
50
|
+
sourceSets {
|
|
51
|
+
main {
|
|
52
|
+
manifest.srcFile "src/main/AndroidManifestNew.xml"
|
|
53
|
+
}
|
|
29
54
|
}
|
|
55
|
+
}
|
|
30
56
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
targetCompatibility JavaVersion.VERSION_1_8
|
|
57
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
58
|
+
|
|
59
|
+
defaultConfig {
|
|
60
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
61
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
62
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
63
|
+
}
|
|
64
|
+
buildTypes {
|
|
65
|
+
release {
|
|
66
|
+
minifyEnabled false
|
|
42
67
|
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
lintOptions {
|
|
71
|
+
disable "GradleCompatible"
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
compileOptions {
|
|
75
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
76
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
77
|
+
}
|
|
78
|
+
|
|
43
79
|
}
|
|
44
80
|
|
|
45
81
|
repositories {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
url("$rootDir/../node_modules/react-native/android")
|
|
50
|
-
}
|
|
51
|
-
google()
|
|
52
|
-
mavenCentral()
|
|
53
|
-
jcenter()
|
|
82
|
+
mavenCentral()
|
|
83
|
+
jcenter()
|
|
84
|
+
google()
|
|
54
85
|
}
|
|
55
86
|
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
56
90
|
dependencies {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
91
|
+
// For < 0.71, this will be from the local maven repo
|
|
92
|
+
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
|
93
|
+
//noinspection GradleDynamicVersion
|
|
94
|
+
implementation "com.facebook.react:react-native:+"
|
|
95
|
+
implementation 'com.github.smart-fun:XmlToJson:1.5.1'
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (isNewArchitectureEnabled()) {
|
|
99
|
+
react {
|
|
100
|
+
jsRootDir = file("../src/")
|
|
101
|
+
libraryName = "RdserviceFingerprintscanner"
|
|
102
|
+
codegenJavaPackageName = "com.rdservicefingerprintscanner"
|
|
103
|
+
}
|
|
60
104
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
<queries>
|
|
3
|
+
<package android:name="com.secugen.rdservice" />
|
|
4
|
+
<package android:name="com.scl.rdservice" />
|
|
5
|
+
<package android:name="com.mantra.rdservice" />
|
|
6
|
+
<package android:name="com.acpl.registersdk" />
|
|
7
|
+
<package android:name="com.rd.gemalto.com.rdserviceapp" />
|
|
8
|
+
<package android:name="com.integra.registered.device" />
|
|
9
|
+
<package android:name="com.aratek.asix_gms.rdservice" />
|
|
10
|
+
<package android:name="rdservice.metsl.metslrdservice" />
|
|
11
|
+
<package android:name="com.tatvik.bio.tmf20" />
|
|
12
|
+
<package android:name="com.evolute.rdservice" />
|
|
13
|
+
<package android:name="com.precision.pb510.rdservice" />
|
|
14
|
+
<package android:name="com.mantra.mis100v2.rdservice" />
|
|
15
|
+
<package android:name="com.nextbiometrics.rdservice" />
|
|
16
|
+
<package android:name="com.iritech.rdservice" />
|
|
17
|
+
<package android:name="com.evolute.iris.rdservice" />
|
|
18
|
+
|
|
19
|
+
</queries>
|
|
20
|
+
</manifest>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
package com.
|
|
2
|
-
|
|
1
|
+
package com.rdservicefingerprintscanner;
|
|
3
2
|
|
|
4
3
|
import android.app.Activity;
|
|
5
4
|
import android.content.Intent;
|
|
@@ -45,7 +44,6 @@ public class RDServiceManager {
|
|
|
45
44
|
put("com.integra.registered.device", "Integra");
|
|
46
45
|
put("com.aratek.asix_gms.rdservice", "Aratek");
|
|
47
46
|
put("rdservice.metsl.metslrdservice", "Maestros");
|
|
48
|
-
|
|
49
47
|
put("com.tatvik.bio.tmf20", "Tatvik TMF20");
|
|
50
48
|
put("com.evolute.rdservice", "Evolute");
|
|
51
49
|
put("com.precision.pb510.rdservice", "PB510");
|
|
@@ -218,7 +216,7 @@ public class RDServiceManager {
|
|
|
218
216
|
intentInfo.setPackage(_pkg);
|
|
219
217
|
activity.startActivityForResult(intentInfo, next_discover_rc_index);
|
|
220
218
|
|
|
221
|
-
|
|
219
|
+
} catch (Exception e) {
|
|
222
220
|
e.printStackTrace();
|
|
223
221
|
mRDEvent.onRDServiceDriverDiscoveryFailed(0, null, _pkg, e.getMessage());
|
|
224
222
|
}
|
|
@@ -257,7 +255,7 @@ public class RDServiceManager {
|
|
|
257
255
|
activity.startActivityForResult(intentCapture, capture_rc);
|
|
258
256
|
} else {
|
|
259
257
|
mRDEvent.onRDServiceDriverDiscoveryFailed(0, null, rd_service_package, "Package not found or not whitelisted");
|
|
260
|
-
|
|
258
|
+
}
|
|
261
259
|
}
|
|
262
260
|
|
|
263
261
|
|
|
@@ -268,14 +266,14 @@ public class RDServiceManager {
|
|
|
268
266
|
* @param rd_service_package The package name of the RDService driver
|
|
269
267
|
*/
|
|
270
268
|
private void onRDServiceInfoResponse(@NonNull Intent data, @NonNull String rd_service_package) {
|
|
271
|
-
|
|
269
|
+
Bundle b = data.getExtras();
|
|
272
270
|
|
|
273
271
|
if (b != null) {
|
|
274
272
|
// sendWebViewResponse("rdservice_info", b.getString("RD_SERVICE_INFO", "") + "<RD_SERVICE_ANDROID_PACKAGE=\"" + rd_service_package + "\" />");
|
|
275
273
|
|
|
276
274
|
mRDEvent.onRDServiceDriverDiscovery(b.getString("RD_SERVICE_INFO", ""), rd_service_package, mapRDDriverWhitelist.containsKey(rd_service_package));
|
|
277
275
|
|
|
278
|
-
|
|
276
|
+
}
|
|
279
277
|
}
|
|
280
278
|
|
|
281
279
|
|
|
@@ -292,7 +290,7 @@ public class RDServiceManager {
|
|
|
292
290
|
// sendWebViewResponse("rdservice_resp", b.getString("PID_DATA", ""));
|
|
293
291
|
mRDEvent.onRDServiceCaptureResponse(b.getString("PID_DATA", ""), rd_service_package);
|
|
294
292
|
|
|
295
|
-
|
|
293
|
+
}
|
|
296
294
|
}
|
|
297
295
|
|
|
298
296
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.rdservicefingerprintscanner;
|
|
2
2
|
|
|
3
3
|
import android.app.Activity;
|
|
4
4
|
import android.content.Intent;
|
|
5
5
|
import android.util.Log;
|
|
6
|
-
import android.widget.Toast;
|
|
7
6
|
|
|
8
7
|
import androidx.annotation.NonNull;
|
|
9
8
|
|
|
@@ -18,29 +17,29 @@ import com.facebook.react.module.annotations.ReactModule;
|
|
|
18
17
|
|
|
19
18
|
import org.json.JSONException;
|
|
20
19
|
import org.json.JSONObject;
|
|
21
|
-
|
|
22
20
|
import fr.arnaudguyon.xmltojsonlib.XmlToJson;
|
|
23
21
|
|
|
24
22
|
@ReactModule(name = RdserviceFingerprintscannerModule.NAME)
|
|
25
23
|
public class RdserviceFingerprintscannerModule extends ReactContextBaseJavaModule implements RDServiceEvents {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
public static final String NAME = "RdserviceFingerprintscanner";
|
|
25
|
+
public Promise promise;
|
|
29
26
|
private RDServiceManager rdServiceManager;
|
|
30
27
|
String servicePackage = "";
|
|
28
|
+
public RdserviceFingerprintscannerModule(ReactApplicationContext reactContext) {
|
|
29
|
+
super(reactContext);
|
|
30
|
+
reactContext.addActivityEventListener(new RDServiceActivityEventListener());
|
|
31
|
+
rdServiceManager = new RDServiceManager.Builder(this).create();
|
|
32
|
+
}
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
@Override
|
|
35
|
+
@NonNull
|
|
36
|
+
public String getName() {
|
|
37
|
+
return NAME;
|
|
38
|
+
}
|
|
37
39
|
|
|
38
|
-
@Override
|
|
39
|
-
@NonNull
|
|
40
|
-
public String getName() {
|
|
41
|
-
return NAME;
|
|
42
|
-
}
|
|
43
40
|
|
|
41
|
+
// Example method
|
|
42
|
+
// See https://reactnative.dev/docs/native-modules-android
|
|
44
43
|
@ReactMethod
|
|
45
44
|
public void getDeviceInfo( Promise promise) {
|
|
46
45
|
this.promise = promise;
|
|
@@ -72,16 +71,16 @@ public class RdserviceFingerprintscannerModule extends ReactContextBaseJavaModul
|
|
|
72
71
|
|
|
73
72
|
@Override
|
|
74
73
|
public void onDeviceDriverFound(Boolean isFound) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
74
|
+
try{
|
|
75
|
+
WritableMap responseData = Arguments.createMap();
|
|
76
|
+
responseData.putBoolean("isDeviceDriverFound",isFound);
|
|
77
|
+
responseData.putInt("status",isFound?1:0);
|
|
78
|
+
responseData.putString("message",isFound?"Device Driver is Discovered":"Device Driver not found");
|
|
79
|
+
promise.resolve(responseData);
|
|
80
|
+
}
|
|
81
|
+
catch (Exception e){
|
|
82
|
+
promise.reject("DRIVER_FOUND_ERROR",e.getMessage());
|
|
83
|
+
}
|
|
85
84
|
}
|
|
86
85
|
|
|
87
86
|
@Override
|
|
@@ -132,7 +131,7 @@ public class RdserviceFingerprintscannerModule extends ReactContextBaseJavaModul
|
|
|
132
131
|
responseData.putString("message","FingerPrint Scanned Successfully");
|
|
133
132
|
}
|
|
134
133
|
else {
|
|
135
|
-
|
|
134
|
+
errInfo = response.getString("errInfo");
|
|
136
135
|
responseData.putInt("status",0);
|
|
137
136
|
responseData.putString("message","Make Sure the Device is Connected and OTG Connection is Enabled in your Mobile");
|
|
138
137
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package com.rdservicefingerprintscanner;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.ReactPackage;
|
|
6
|
+
import com.facebook.react.bridge.NativeModule;
|
|
7
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
8
|
+
import com.facebook.react.uimanager.ViewManager;
|
|
9
|
+
|
|
10
|
+
import java.util.ArrayList;
|
|
11
|
+
import java.util.Collections;
|
|
12
|
+
import java.util.List;
|
|
13
|
+
|
|
14
|
+
public class RdserviceFingerprintscannerPackage implements ReactPackage {
|
|
15
|
+
@NonNull
|
|
16
|
+
@Override
|
|
17
|
+
public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
|
|
18
|
+
List<NativeModule> modules = new ArrayList<>();
|
|
19
|
+
modules.add(new RdserviceFingerprintscannerModule(reactContext));
|
|
20
|
+
return modules;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@NonNull
|
|
24
|
+
@Override
|
|
25
|
+
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
|
|
26
|
+
return Collections.emptyList();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.d.ts"],"mappings":""}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEFAULT_PID_OPTIONS = exports.AVAILABLE_PACKAGES = void 0;
|
|
7
|
+
exports.captureFinger = captureFinger;
|
|
8
|
+
exports.getDeviceInfo = getDeviceInfo;
|
|
9
|
+
exports.isDriverFound = isDriverFound;
|
|
10
|
+
exports.openFingerPrintScanner = openFingerPrintScanner;
|
|
11
|
+
var _reactNative = require("react-native");
|
|
12
|
+
const LINKING_ERROR = `The package 'react-native-rdservice-fingerprintscanner' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
13
|
+
ios: "- You have run 'pod install'\n",
|
|
14
|
+
default: ''
|
|
15
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
16
|
+
const RdserviceFingerprintscanner = _reactNative.NativeModules.RdserviceFingerprintscanner ? _reactNative.NativeModules.RdserviceFingerprintscanner : new Proxy({}, {
|
|
17
|
+
get() {
|
|
18
|
+
throw new Error(LINKING_ERROR);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const AVAILABLE_PACKAGES = exports.AVAILABLE_PACKAGES = {
|
|
22
|
+
Secugen: 'com.secugen.rdservice',
|
|
23
|
+
Morpho: 'com.scl.rdservice',
|
|
24
|
+
Mantra: 'com.mantra.rdservice',
|
|
25
|
+
Startek_FM220: 'com.acpl.registersdk',
|
|
26
|
+
Gemalto_3M_Cogent_CSD200: 'com.rd.gemalto.com.rdserviceapp',
|
|
27
|
+
Integra: 'com.integra.registered.device',
|
|
28
|
+
Aratek: 'com.aratek.asix_gms.rdservice',
|
|
29
|
+
Maestros: 'rdservice.metsl.metslrdservice',
|
|
30
|
+
Tatvik_TMF20: 'com.tatvik.bio.tmf20',
|
|
31
|
+
Evolute: 'com.evolute.rdservice',
|
|
32
|
+
PB510: 'com.precision.pb510.rdservice',
|
|
33
|
+
MIS100V2_by_Mantra: 'com.mantra.mis100v2.rdservice',
|
|
34
|
+
NEXT_Biometrics_NB3023: 'com.nextbiometrics.rdservice',
|
|
35
|
+
IriTech_IriShield: 'com.iritech.rdservice',
|
|
36
|
+
Evolute_IRIS: 'com.evolute.iris.rdservice'
|
|
37
|
+
};
|
|
38
|
+
const DEFAULT_PID_OPTIONS = exports.DEFAULT_PID_OPTIONS = `<PidOptions ver="1.0"> <Opts fCount="1" fType="0" iCount="0" pCount="0" format="0" pidVer="2.0" timeout="20000" otp="" posh="UNKNOWN" env="P" wadh="" /> <Demo></Demo><CustOpts> <Param name="ValidationKey" value="" /> </CustOpts> </PidOptions>`;
|
|
39
|
+
function getDeviceInfo() {
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
RdserviceFingerprintscanner.getDeviceInfo().then(res => {
|
|
42
|
+
if (res.status === -1) {
|
|
43
|
+
const resObj = {
|
|
44
|
+
status: res.status,
|
|
45
|
+
message: res.message
|
|
46
|
+
};
|
|
47
|
+
resolve(resObj);
|
|
48
|
+
} else {
|
|
49
|
+
const resObj = {
|
|
50
|
+
isWhitelisted: res.isWhitelisted,
|
|
51
|
+
rdServiceInfoJson: JSON.parse(res.rdServiceInfoJsonString),
|
|
52
|
+
rdServiceInfoXML: res.rdServiceInfoXML,
|
|
53
|
+
rdServicePackage: res.rdServicePackage,
|
|
54
|
+
status: res.status,
|
|
55
|
+
message: res.message
|
|
56
|
+
};
|
|
57
|
+
resolve(resObj);
|
|
58
|
+
}
|
|
59
|
+
}).catch(err => {
|
|
60
|
+
reject(err);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function isDriverFound(packageName) {
|
|
65
|
+
return new Promise((resolve, reject) => {
|
|
66
|
+
if (packageName) {
|
|
67
|
+
RdserviceFingerprintscanner.isDriverFound(packageName).then(res => {
|
|
68
|
+
resolve(res);
|
|
69
|
+
}).catch(err => {
|
|
70
|
+
reject(err);
|
|
71
|
+
});
|
|
72
|
+
} else {
|
|
73
|
+
reject('Package Name cannot be empty');
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function openFingerPrintScanner(packageName, pidOptions = DEFAULT_PID_OPTIONS) {
|
|
78
|
+
return new Promise((resolve, reject) => {
|
|
79
|
+
if (packageName) {
|
|
80
|
+
RdserviceFingerprintscanner.openFingerPrintScanner(packageName, pidOptions).then(res => {
|
|
81
|
+
if (res.pidDataJsonString) {
|
|
82
|
+
const resObj = {
|
|
83
|
+
pidDataJson: JSON.parse(res.pidDataJsonString),
|
|
84
|
+
pidDataXML: res.pidDataXML,
|
|
85
|
+
rdServicePackage: res.rdServicePackage,
|
|
86
|
+
status: res.status,
|
|
87
|
+
errInfo: res.errInfo,
|
|
88
|
+
errorCode: parseInt(res.errorCode),
|
|
89
|
+
message: res.message
|
|
90
|
+
};
|
|
91
|
+
resolve(resObj);
|
|
92
|
+
} else {
|
|
93
|
+
resolve(res);
|
|
94
|
+
}
|
|
95
|
+
}).catch(err => {
|
|
96
|
+
reject(err);
|
|
97
|
+
});
|
|
98
|
+
} else {
|
|
99
|
+
reject('Package Name cannot be empty');
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function captureFinger(pidOptions = DEFAULT_PID_OPTIONS) {
|
|
104
|
+
return new Promise((resolve, reject) => {
|
|
105
|
+
RdserviceFingerprintscanner.captureFinger(pidOptions).then(res => {
|
|
106
|
+
const resObj = {
|
|
107
|
+
pidDataJson: JSON.parse(res.pidDataJsonString),
|
|
108
|
+
pidDataXML: res.pidDataXML,
|
|
109
|
+
rdServicePackage: res.rdServicePackage,
|
|
110
|
+
status: res.status,
|
|
111
|
+
errInfo: res.errInfo,
|
|
112
|
+
errorCode: parseInt(res.errorCode),
|
|
113
|
+
message: res.message
|
|
114
|
+
};
|
|
115
|
+
resolve(resObj);
|
|
116
|
+
}).catch(err => {
|
|
117
|
+
reject(err);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","RdserviceFingerprintscanner","NativeModules","Proxy","get","Error","AVAILABLE_PACKAGES","exports","Secugen","Morpho","Mantra","Startek_FM220","Gemalto_3M_Cogent_CSD200","Integra","Aratek","Maestros","Tatvik_TMF20","Evolute","PB510","MIS100V2_by_Mantra","NEXT_Biometrics_NB3023","IriTech_IriShield","Evolute_IRIS","DEFAULT_PID_OPTIONS","getDeviceInfo","Promise","resolve","reject","then","res","status","resObj","message","isWhitelisted","rdServiceInfoJson","JSON","parse","rdServiceInfoJsonString","rdServiceInfoXML","rdServicePackage","catch","err","isDriverFound","packageName","openFingerPrintScanner","pidOptions","pidDataJsonString","pidDataJson","pidDataXML","errInfo","errorCode","parseInt","captureFinger"],"sourceRoot":"../../src","sources":["index.js"],"mappings":";;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GAChB,oGAAmG,GACpGC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD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1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.d.ts"],"mappings":""}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
const LINKING_ERROR = `The package 'react-native-rdservice-fingerprintscanner' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
3
|
+
ios: "- You have run 'pod install'\n",
|
|
4
|
+
default: ''
|
|
5
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
6
|
+
const RdserviceFingerprintscanner = NativeModules.RdserviceFingerprintscanner ? NativeModules.RdserviceFingerprintscanner : new Proxy({}, {
|
|
7
|
+
get() {
|
|
8
|
+
throw new Error(LINKING_ERROR);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
export const AVAILABLE_PACKAGES = {
|
|
12
|
+
Secugen: 'com.secugen.rdservice',
|
|
13
|
+
Morpho: 'com.scl.rdservice',
|
|
14
|
+
Mantra: 'com.mantra.rdservice',
|
|
15
|
+
Startek_FM220: 'com.acpl.registersdk',
|
|
16
|
+
Gemalto_3M_Cogent_CSD200: 'com.rd.gemalto.com.rdserviceapp',
|
|
17
|
+
Integra: 'com.integra.registered.device',
|
|
18
|
+
Aratek: 'com.aratek.asix_gms.rdservice',
|
|
19
|
+
Maestros: 'rdservice.metsl.metslrdservice',
|
|
20
|
+
Tatvik_TMF20: 'com.tatvik.bio.tmf20',
|
|
21
|
+
Evolute: 'com.evolute.rdservice',
|
|
22
|
+
PB510: 'com.precision.pb510.rdservice',
|
|
23
|
+
MIS100V2_by_Mantra: 'com.mantra.mis100v2.rdservice',
|
|
24
|
+
NEXT_Biometrics_NB3023: 'com.nextbiometrics.rdservice',
|
|
25
|
+
IriTech_IriShield: 'com.iritech.rdservice',
|
|
26
|
+
Evolute_IRIS: 'com.evolute.iris.rdservice'
|
|
27
|
+
};
|
|
28
|
+
export const DEFAULT_PID_OPTIONS = `<PidOptions ver="1.0"> <Opts fCount="1" fType="0" iCount="0" pCount="0" format="0" pidVer="2.0" timeout="20000" otp="" posh="UNKNOWN" env="P" wadh="" /> <Demo></Demo><CustOpts> <Param name="ValidationKey" value="" /> </CustOpts> </PidOptions>`;
|
|
29
|
+
export function getDeviceInfo() {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
RdserviceFingerprintscanner.getDeviceInfo().then(res => {
|
|
32
|
+
if (res.status === -1) {
|
|
33
|
+
const resObj = {
|
|
34
|
+
status: res.status,
|
|
35
|
+
message: res.message
|
|
36
|
+
};
|
|
37
|
+
resolve(resObj);
|
|
38
|
+
} else {
|
|
39
|
+
const resObj = {
|
|
40
|
+
isWhitelisted: res.isWhitelisted,
|
|
41
|
+
rdServiceInfoJson: JSON.parse(res.rdServiceInfoJsonString),
|
|
42
|
+
rdServiceInfoXML: res.rdServiceInfoXML,
|
|
43
|
+
rdServicePackage: res.rdServicePackage,
|
|
44
|
+
status: res.status,
|
|
45
|
+
message: res.message
|
|
46
|
+
};
|
|
47
|
+
resolve(resObj);
|
|
48
|
+
}
|
|
49
|
+
}).catch(err => {
|
|
50
|
+
reject(err);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export function isDriverFound(packageName) {
|
|
55
|
+
return new Promise((resolve, reject) => {
|
|
56
|
+
if (packageName) {
|
|
57
|
+
RdserviceFingerprintscanner.isDriverFound(packageName).then(res => {
|
|
58
|
+
resolve(res);
|
|
59
|
+
}).catch(err => {
|
|
60
|
+
reject(err);
|
|
61
|
+
});
|
|
62
|
+
} else {
|
|
63
|
+
reject('Package Name cannot be empty');
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
export function openFingerPrintScanner(packageName, pidOptions = DEFAULT_PID_OPTIONS) {
|
|
68
|
+
return new Promise((resolve, reject) => {
|
|
69
|
+
if (packageName) {
|
|
70
|
+
RdserviceFingerprintscanner.openFingerPrintScanner(packageName, pidOptions).then(res => {
|
|
71
|
+
if (res.pidDataJsonString) {
|
|
72
|
+
const resObj = {
|
|
73
|
+
pidDataJson: JSON.parse(res.pidDataJsonString),
|
|
74
|
+
pidDataXML: res.pidDataXML,
|
|
75
|
+
rdServicePackage: res.rdServicePackage,
|
|
76
|
+
status: res.status,
|
|
77
|
+
errInfo: res.errInfo,
|
|
78
|
+
errorCode: parseInt(res.errorCode),
|
|
79
|
+
message: res.message
|
|
80
|
+
};
|
|
81
|
+
resolve(resObj);
|
|
82
|
+
} else {
|
|
83
|
+
resolve(res);
|
|
84
|
+
}
|
|
85
|
+
}).catch(err => {
|
|
86
|
+
reject(err);
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
reject('Package Name cannot be empty');
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
export function captureFinger(pidOptions = DEFAULT_PID_OPTIONS) {
|
|
94
|
+
return new Promise((resolve, reject) => {
|
|
95
|
+
RdserviceFingerprintscanner.captureFinger(pidOptions).then(res => {
|
|
96
|
+
const resObj = {
|
|
97
|
+
pidDataJson: JSON.parse(res.pidDataJsonString),
|
|
98
|
+
pidDataXML: res.pidDataXML,
|
|
99
|
+
rdServicePackage: res.rdServicePackage,
|
|
100
|
+
status: res.status,
|
|
101
|
+
errInfo: res.errInfo,
|
|
102
|
+
errorCode: parseInt(res.errorCode),
|
|
103
|
+
message: res.message
|
|
104
|
+
};
|
|
105
|
+
resolve(resObj);
|
|
106
|
+
}).catch(err => {
|
|
107
|
+
reject(err);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","RdserviceFingerprintscanner","Proxy","get","Error","AVAILABLE_PACKAGES","Secugen","Morpho","Mantra","Startek_FM220","Gemalto_3M_Cogent_CSD200","Integra","Aratek","Maestros","Tatvik_TMF20","Evolute","PB510","MIS100V2_by_Mantra","NEXT_Biometrics_NB3023","IriTech_IriShield","Evolute_IRIS","DEFAULT_PID_OPTIONS","getDeviceInfo","Promise","resolve","reject","then","res","status","resObj","message","isWhitelisted","rdServiceInfoJson","JSON","parse","rdServiceInfoJsonString","rdServiceInfoXML","rdServicePackage","catch","err","isDriverFound","packageName","openFingerPrintScanner","pidOptions","pidDataJsonString","pidDataJson","pidDataXML","errInfo","errorCode","parseInt","captureFinger"],"sourceRoot":"../../src","sources":["index.js"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GAChB,oGAAmG,GACpGD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,2BAA2B,GAAGN,aAAa,CAACM,2BAA2B,GACzEN,aAAa,CAACM,2BAA2B,GACzC,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,OAAO,MAAMQ,kBAAkB,GAAG;EAChCC,OAAO,EAAE,uBAAuB;EAChCC,MAAM,EAAE,mBAAmB;EAC3BC,MAAM,EAAE,sBAAsB;EAC9BC,aAAa,EAAE,sBAAsB;EACrCC,wBAAwB,EAAE,iCAAiC;EAC3DC,OAAO,EAAE,+BAA+B;EACxCC,MAAM,EAAE,+BAA+B;EACvCC,QAAQ,EAAE,gCAAgC;EAC1CC,YAAY,EAAE,sBAAsB;EACpCC,OAAO,EAAE,uBAAuB;EAChCC,KAAK,EAAE,+BAA+B;EACtCC,kBAAkB,EAAE,+BAA+B;EACnDC,sBAAsB,EAAE,8BAA8B;EACtDC,iBAAiB,EAAE,uBAAuB;EAC1CC,YAAY,EAAE;AAChB,CAAC;AAED,OAAO,MAAMC,mBAAmB,GAAI,oP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AAG,CAACiB,iBAAiB,CAAC;QAC9CE,UAAU,EAAEnB,GAAG,CAACmB,UAAU;QAC1BT,gBAAgB,EAAEV,GAAG,CAACU,gBAAgB;QACtCT,MAAM,EAAED,GAAG,CAACC,MAAM;QAClBmB,OAAO,EAAEpB,GAAG,CAACoB,OAAO;QACpBC,SAAS,EAAEC,QAAQ,CAACtB,GAAG,CAACqB,SAAS,CAAC;QAClClB,OAAO,EAAEH,GAAG,CAACG;MACf,CAAC;MACDN,OAAO,CAACK,MAAM,CAAC;IACjB,CAAC,CAAC,CACDS,KAAK,CAAEC,GAAG,IAAK;MACdd,MAAM,CAACc,GAAG,CAAC;IACb,CAAC,CAAC;EACN,CAAC,CAAC;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/index.test.tsx"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-rdservice-fingerprintscanner",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "FingerPrint Scanner RD Service",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -13,22 +13,30 @@
|
|
|
13
13
|
"android",
|
|
14
14
|
"ios",
|
|
15
15
|
"cpp",
|
|
16
|
-
"
|
|
16
|
+
"*.podspec",
|
|
17
17
|
"!lib/typescript/example",
|
|
18
|
-
"!android/build",
|
|
19
18
|
"!ios/build",
|
|
19
|
+
"!android/build",
|
|
20
|
+
"!android/gradle",
|
|
21
|
+
"!android/gradlew",
|
|
22
|
+
"!android/gradlew.bat",
|
|
23
|
+
"!android/local.properties",
|
|
20
24
|
"!**/__tests__",
|
|
21
25
|
"!**/__fixtures__",
|
|
22
|
-
"!**/__mocks__"
|
|
26
|
+
"!**/__mocks__",
|
|
27
|
+
"!**/.*"
|
|
23
28
|
],
|
|
24
29
|
"scripts": {
|
|
25
30
|
"test": "jest",
|
|
26
|
-
"
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
27
32
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
33
|
+
"prepack": "bob build",
|
|
28
34
|
"release": "release-it",
|
|
29
35
|
"example": "yarn --cwd example",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
36
|
+
"build:android": "cd example/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
|
|
37
|
+
"build:ios": "cd example/ios && xcodebuild -workspace RdserviceFingerprintscannerExample.xcworkspace -scheme RdserviceFingerprintscannerExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO",
|
|
38
|
+
"bootstrap": "yarn example && yarn install && yarn example pods",
|
|
39
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
|
|
32
40
|
},
|
|
33
41
|
"keywords": [
|
|
34
42
|
"react-native",
|
|
@@ -36,40 +44,49 @@
|
|
|
36
44
|
"android"
|
|
37
45
|
],
|
|
38
46
|
"repository": "https://github.com/senthalan2/react-native-rdservice-fingerprintscanner",
|
|
39
|
-
"author": "Senthalan
|
|
47
|
+
"author": "Senthalan <senthalan2@gmail.com> (https://github.com/senthalan2)",
|
|
40
48
|
"license": "MIT",
|
|
41
49
|
"bugs": {
|
|
42
50
|
"url": "https://github.com/senthalan2/react-native-rdservice-fingerprintscanner/issues"
|
|
43
51
|
},
|
|
44
|
-
"homepage": "https://github.com/senthalan2
|
|
52
|
+
"homepage": "https://github.com/senthalan2",
|
|
45
53
|
"publishConfig": {
|
|
46
54
|
"registry": "https://registry.npmjs.org/"
|
|
47
55
|
},
|
|
48
56
|
"devDependencies": {
|
|
49
|
-
"@commitlint/config-conventional": "^
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@types/
|
|
54
|
-
"@types/react
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"eslint
|
|
59
|
-
"
|
|
60
|
-
"
|
|
57
|
+
"@commitlint/config-conventional": "^17.0.2",
|
|
58
|
+
"@evilmartians/lefthook": "^1.2.2",
|
|
59
|
+
"@react-native-community/eslint-config": "^3.0.2",
|
|
60
|
+
"@release-it/conventional-changelog": "^5.0.0",
|
|
61
|
+
"@types/jest": "^28.1.2",
|
|
62
|
+
"@types/react": "~17.0.21",
|
|
63
|
+
"@types/react-native": "0.70.0",
|
|
64
|
+
"commitlint": "^17.0.2",
|
|
65
|
+
"del-cli": "^5.0.0",
|
|
66
|
+
"eslint": "^8.4.1",
|
|
67
|
+
"eslint-config-prettier": "^8.5.0",
|
|
68
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
69
|
+
"jest": "^28.1.1",
|
|
61
70
|
"pod-install": "^0.1.0",
|
|
62
71
|
"prettier": "^2.0.5",
|
|
63
|
-
"react": "
|
|
64
|
-
"react-native": "0.
|
|
65
|
-
"react-native-builder-bob": "^0.
|
|
66
|
-
"release-it": "^
|
|
67
|
-
"
|
|
72
|
+
"react": "18.2.0",
|
|
73
|
+
"react-native": "0.73.2",
|
|
74
|
+
"react-native-builder-bob": "^0.23.2",
|
|
75
|
+
"release-it": "^15.0.0",
|
|
76
|
+
"turbo": "^1.10.7",
|
|
77
|
+
"typescript": "^5.0.2"
|
|
78
|
+
},
|
|
79
|
+
"resolutions": {
|
|
80
|
+
"@types/react": "17.0.21"
|
|
68
81
|
},
|
|
69
82
|
"peerDependencies": {
|
|
70
83
|
"react": "*",
|
|
71
84
|
"react-native": "*"
|
|
72
85
|
},
|
|
86
|
+
"engines": {
|
|
87
|
+
"node": ">= 16.0.0"
|
|
88
|
+
},
|
|
89
|
+
"packageManager": "^yarn@1.22.15",
|
|
73
90
|
"jest": {
|
|
74
91
|
"preset": "react-native",
|
|
75
92
|
"modulePathIgnorePatterns": [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require "json"
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
4
5
|
|
|
5
6
|
Pod::Spec.new do |s|
|
|
6
7
|
s.name = "react-native-rdservice-fingerprintscanner"
|
|
@@ -10,10 +11,31 @@ Pod::Spec.new do |s|
|
|
|
10
11
|
s.license = package["license"]
|
|
11
12
|
s.authors = package["author"]
|
|
12
13
|
|
|
13
|
-
s.platforms = { :ios => "
|
|
14
|
+
s.platforms = { :ios => "11.0" }
|
|
14
15
|
s.source = { :git => "https://github.com/senthalan2/react-native-rdservice-fingerprintscanner.git", :tag => "#{s.version}" }
|
|
15
16
|
|
|
16
|
-
s.source_files = "ios/**/*.{h,m,mm
|
|
17
|
+
s.source_files = "ios/**/*.{h,m,mm}"
|
|
17
18
|
|
|
19
|
+
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
20
|
+
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
21
|
+
if respond_to?(:install_modules_dependencies, true)
|
|
22
|
+
install_modules_dependencies(s)
|
|
23
|
+
else
|
|
18
24
|
s.dependency "React-Core"
|
|
25
|
+
|
|
26
|
+
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
27
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
28
|
+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
29
|
+
s.pod_target_xcconfig = {
|
|
30
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
31
|
+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
32
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
33
|
+
}
|
|
34
|
+
s.dependency "React-Codegen"
|
|
35
|
+
s.dependency "RCT-Folly"
|
|
36
|
+
s.dependency "RCTRequired"
|
|
37
|
+
s.dependency "RCTTypeSafety"
|
|
38
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
19
41
|
end
|
package/src/index.d.ts
CHANGED
|
@@ -3,35 +3,54 @@ declare module "react-native-rdservice-fingerprintscanner" {
|
|
|
3
3
|
isWhitelisted: boolean,
|
|
4
4
|
rdServiceInfoJson: JSON,
|
|
5
5
|
rdServiceInfoXML: string,
|
|
6
|
-
rdServicePackage: string
|
|
6
|
+
rdServicePackage: string,
|
|
7
7
|
status: number,
|
|
8
8
|
message: string,
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
export type optionalInfo ={
|
|
10
|
+
|
|
11
|
+
export type optionalInfo = {
|
|
12
12
|
status: number,
|
|
13
13
|
message: string,
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
|
|
16
|
+
export type fingerprintDataProps = {
|
|
17
|
+
pidDataJson: JSON,
|
|
18
|
+
pidDataXML: string,
|
|
19
|
+
rdServicePackage: string,
|
|
20
|
+
status: number,
|
|
21
|
+
errInfo: string,
|
|
22
|
+
errorCode: number,
|
|
23
|
+
message: string,
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export type driverDataProps = {
|
|
27
|
-
isDeviceDriverFound:boolean;
|
|
28
|
-
message:string;
|
|
27
|
+
isDeviceDriverFound: boolean;
|
|
28
|
+
message: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type availablePackageProps = {
|
|
32
|
+
Secugen: string;
|
|
33
|
+
Morpho: string;
|
|
34
|
+
Mantra: string;
|
|
35
|
+
Startek_FM220: string;
|
|
36
|
+
Gemalto_3M_Cogent_CSD200: string;
|
|
37
|
+
Integra: string;
|
|
38
|
+
Aratek: string;
|
|
39
|
+
Maestros: string;
|
|
40
|
+
Tatvik_TMF20: string;
|
|
41
|
+
Evolute: string;
|
|
42
|
+
PB510: string;
|
|
43
|
+
MIS100V2_by_Mantra: string;
|
|
44
|
+
NEXT_Biometrics_NB3023: string;
|
|
45
|
+
IriTech_IriShield: string;
|
|
46
|
+
Evolute_IRIS: string;
|
|
29
47
|
}
|
|
30
48
|
|
|
31
|
-
export const DEFAULT_PID_OPTIONS
|
|
49
|
+
export const DEFAULT_PID_OPTIONS: string;
|
|
50
|
+
export const AVAILABLE_PACKAGES: availablePackageProps
|
|
32
51
|
export function getDeviceInfo(): Promise<deviceInfoProps | optionalInfo>;
|
|
33
|
-
export function captureFinger(pidOptions
|
|
34
|
-
export function isDriverFound(packageName: string):Promise<driverDataProps>;
|
|
35
|
-
export function openFingerPrintScanner(packageName:string,pidOptions
|
|
52
|
+
export function captureFinger(pidOptions?: string): Promise<fingerprintDataProps>;
|
|
53
|
+
export function isDriverFound(packageName: string): Promise<driverDataProps>;
|
|
54
|
+
export function openFingerPrintScanner(packageName: string, pidOptions?: string): Promise<fingerprintDataProps | driverDataProps>;
|
|
36
55
|
|
|
37
56
|
}
|
package/src/index.js
CHANGED
|
@@ -4,7 +4,7 @@ const LINKING_ERROR =
|
|
|
4
4
|
`The package 'react-native-rdservice-fingerprintscanner' doesn't seem to be linked. Make sure: \n\n` +
|
|
5
5
|
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
6
6
|
'- You rebuilt the app after installing the package\n' +
|
|
7
|
-
'- You are not using Expo
|
|
7
|
+
'- You are not using Expo Go\n';
|
|
8
8
|
|
|
9
9
|
const RdserviceFingerprintscanner = NativeModules.RdserviceFingerprintscanner
|
|
10
10
|
? NativeModules.RdserviceFingerprintscanner
|
|
@@ -16,6 +16,25 @@ const RdserviceFingerprintscanner = NativeModules.RdserviceFingerprintscanner
|
|
|
16
16
|
},
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
|
+
|
|
20
|
+
export const AVAILABLE_PACKAGES = {
|
|
21
|
+
Secugen: 'com.secugen.rdservice',
|
|
22
|
+
Morpho: 'com.scl.rdservice',
|
|
23
|
+
Mantra: 'com.mantra.rdservice',
|
|
24
|
+
Startek_FM220: 'com.acpl.registersdk',
|
|
25
|
+
Gemalto_3M_Cogent_CSD200: 'com.rd.gemalto.com.rdserviceapp',
|
|
26
|
+
Integra: 'com.integra.registered.device',
|
|
27
|
+
Aratek: 'com.aratek.asix_gms.rdservice',
|
|
28
|
+
Maestros: 'rdservice.metsl.metslrdservice',
|
|
29
|
+
Tatvik_TMF20: 'com.tatvik.bio.tmf20',
|
|
30
|
+
Evolute: 'com.evolute.rdservice',
|
|
31
|
+
PB510: 'com.precision.pb510.rdservice',
|
|
32
|
+
MIS100V2_by_Mantra: 'com.mantra.mis100v2.rdservice',
|
|
33
|
+
NEXT_Biometrics_NB3023: 'com.nextbiometrics.rdservice',
|
|
34
|
+
IriTech_IriShield: 'com.iritech.rdservice',
|
|
35
|
+
Evolute_IRIS: 'com.evolute.iris.rdservice',
|
|
36
|
+
};
|
|
37
|
+
|
|
19
38
|
export const DEFAULT_PID_OPTIONS = `<PidOptions ver="1.0"> <Opts fCount="1" fType="0" iCount="0" pCount="0" format="0" pidVer="2.0" timeout="20000" otp="" posh="UNKNOWN" env="P" wadh="" /> <Demo></Demo><CustOpts> <Param name="ValidationKey" value="" /> </CustOpts> </PidOptions>`;
|
|
20
39
|
|
|
21
40
|
export function getDeviceInfo() {
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
package com.reactnativerdservicefingerprintscanner;
|
|
2
|
-
|
|
3
|
-
import androidx.annotation.NonNull;
|
|
4
|
-
|
|
5
|
-
import com.facebook.react.ReactPackage;
|
|
6
|
-
import com.facebook.react.bridge.NativeModule;
|
|
7
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
8
|
-
import com.facebook.react.uimanager.ViewManager;
|
|
9
|
-
|
|
10
|
-
import java.util.ArrayList;
|
|
11
|
-
import java.util.Collections;
|
|
12
|
-
import java.util.List;
|
|
13
|
-
|
|
14
|
-
public class RdserviceFingerprintscannerPackage implements ReactPackage {
|
|
15
|
-
@NonNull
|
|
16
|
-
@Override
|
|
17
|
-
public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
|
|
18
|
-
List<NativeModule> modules = new ArrayList<>();
|
|
19
|
-
modules.add(new RdserviceFingerprintscannerModule(reactContext));
|
|
20
|
-
return modules;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@NonNull
|
|
24
|
-
@Override
|
|
25
|
-
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
|
|
26
|
-
return Collections.emptyList();
|
|
27
|
-
}
|
|
28
|
-
}
|