react-native-rdservice-fingerprintscanner 1.1.12 → 1.2.1
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 +98 -72
- 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 +14 -2
- package/android/src/main/java/com/{reactnativerdservicefingerprintscanner → rdservicefingerprintscanner}/RDServiceManager.java +30 -8
- package/android/src/main/java/com/{reactnativerdservicefingerprintscanner → rdservicefingerprintscanner}/RdserviceFingerprintscannerModule.java +71 -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 +143 -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 +132 -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/src/index.d.ts +54 -25
- package/src/index.js +44 -1
- package/android/src/main/java/com/reactnativerdservicefingerprintscanner/RdserviceFingerprintscannerPackage.java +0 -28
- package/react-native-rdservice-fingerprintscanner.podspec +0 -19
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,130 @@ allprojects {
|
|
|
31
28
|
## Usage
|
|
32
29
|
|
|
33
30
|
```js
|
|
34
|
-
import {
|
|
31
|
+
import {
|
|
32
|
+
getDeviceInfo,
|
|
33
|
+
captureFinger,
|
|
34
|
+
isDriverFound,
|
|
35
|
+
openFingerPrintScanner,
|
|
36
|
+
captureFace,
|
|
37
|
+
AVAILABLE_PACKAGES,
|
|
38
|
+
DEFAULT_PID_OPTIONS,
|
|
39
|
+
} from 'react-native-rdservice-fingerprintscanner';
|
|
35
40
|
|
|
36
41
|
// ...
|
|
37
42
|
|
|
38
43
|
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
|
-
|
|
44
|
+
.then((response) => {
|
|
45
|
+
console.log(response, 'DEVICE DRIVER FOUND'); // Response about Device Driver
|
|
46
|
+
})
|
|
47
|
+
.catch((error) => {
|
|
48
|
+
console.log(error, 'DEVICE DRIVER NOT FOUND'); //Failed to get device information
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
captureFinger(pidOptions) // You can pass pidOptions (optional) to the "captureFinger" method; otherwise, it will use DEFAULT_PID_OPTIONS.
|
|
52
|
+
.then((response) => {
|
|
53
|
+
console.log(response, 'FINGER CAPTURE'); // FingerPrint Response
|
|
54
|
+
})
|
|
55
|
+
.catch((e) => {
|
|
56
|
+
console.log(e, 'ERROR_FINGER_CAPTURE'); // Failed to capture the Fingerprint
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
isDriverFound(PACKAGE_NAME) // You can use "AVAILABLE_PACKAGES" for the PACKAGE_NAME
|
|
60
|
+
.then((res) => {
|
|
61
|
+
console.log(res, 'DRIVER CHECK');
|
|
62
|
+
})
|
|
63
|
+
.catch((error) => {
|
|
64
|
+
console.log(error, 'ERROR_DRIVER CHECK');
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
openFingerPrintScanner(PACKAGE_NAME, pidOptions) // You can pass pidOptions (optional) to the "openFingerPrintScanner" method; otherwise, it will use DEFAULT_PID_OPTIONS
|
|
68
|
+
.then((res) => {
|
|
69
|
+
console.log(res, 'FINGER CAPTURE');
|
|
70
|
+
})
|
|
71
|
+
.catch((e) => {
|
|
72
|
+
console.log(e, 'ERROR_FINGER_CAPTURE');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
captureFace(pidOptions) // You should pass pidOptions to the "captureFace" method. The DEFAULT_PID_OPTIONS will not work for this method
|
|
76
|
+
.then((response) => {
|
|
77
|
+
console.log(response, 'FACE CAPTURE'); // Face Response
|
|
78
|
+
})
|
|
79
|
+
.catch((e) => {
|
|
80
|
+
console.log(e, 'ERROR_FACE_CAPTURE'); // Failed to capture the Face
|
|
81
|
+
});
|
|
70
82
|
```
|
|
71
83
|
|
|
84
|
+
## Using pidOptions and RD Service Methods
|
|
72
85
|
|
|
73
|
-
|
|
86
|
+
`pidOptions` is an XML string that you need to pass to the `captureFinger`, `openFingerPrintScanner` and `captureFace` methods.
|
|
74
87
|
|
|
75
|
-
|
|
88
|
+
Refer to Version 2.0 of UIDAI [Revision 6](https://uidai.gov.in/images/resource/Aadhaar_Registered_Devices_2_0_4.pdf) and [Revision 7](https://uidai.gov.in/images/resource/Aadhaar_Registered_Devices_2_0_Revision-7_of_Jan_2022.pdf) documents for `pidOptions` used in `captureFinger` and `openFingerPrintScanner` methods.
|
|
76
89
|
|
|
77
|
-
|
|
90
|
+
The `pidOptions` passed to the `captureFace` method should include the wadh value, which is an encrypted hash key encoded in Base64.
|
|
78
91
|
|
|
79
|
-
|
|
92
|
+
Refer to Version 2.5 of UIDAI [Revision 1](https://uidai.gov.in/images/resource/Aadhaar_Authentication_API-2.5_Revision-1_of_January_2022.pdf) document for `pidOptions` used in `captureFace` method.
|
|
80
93
|
|
|
94
|
+
`DEFAULT_PID_OPTIONS` is used when you not passed the `pidOptions` to the `captureFinger()` and `openFingerPrintScanner` Methods.
|
|
81
95
|
|
|
82
|
-
|
|
96
|
+
`PACKAGE_NAME` is required to check the rd service. (eg) The Package name of StarTek Device is `com.acpl.registersdk`
|
|
83
97
|
|
|
84
|
-
|
|
98
|
+
You can use `AVAILABLE_PACKAGES` for `PACKAGE_NAME`.
|
|
85
99
|
|
|
86
|
-
|
|
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
|
|
100
|
+
`Note`: Call the `captureFinger` method after receiving a response from the `getDeviceInfo` method. Calling `captureFinger` before `getDeviceInfo` will only return an error in the catch block [(refer to the example code)](https://github.com/senthalan2/react-native-rdservice-fingerprintscanner/blob/main/example/src/App.js). Call the `openFingerPrintScanner` method only after the `isDriverFound` method returns true; if the driver is not found, `openFingerPrintScanner` will return a driver not found error. The two methods `isDriverFound` and `openFingerPrintScanner` are used to locate the selected RD Service, which is passed as an argument (device driver package name) to these methods. The [AadhaarFaceRD](https://play.google.com/store/apps/details?id=in.gov.uidai.facerd&hl=en) app must be installed to use the `captureFace` method.
|
|
94
101
|
|
|
102
|
+
## Response JSON Object
|
|
95
103
|
|
|
104
|
+
`getDeviceInfo()` Method Reponse
|
|
96
105
|
|
|
97
|
-
|
|
106
|
+
| Key | Value | Description |
|
|
107
|
+
| ---------- | ------- | ------------ |
|
|
108
|
+
| status | -1 or 1 or 0 | `-1` - Device Driver not Found, `1` - READY, `0` - NOTREADY |
|
|
109
|
+
| isWhitelisted | true or false | IT is about the Device is Approved or not. `true` - Approved, `false` - Not Approved |
|
|
110
|
+
| rdServiceInfoJson | JSON DATA | The device returns XML DATA of Device Information. this parameter contains converted JSON DATA of XML DATA |
|
|
111
|
+
| rdServiceInfoXML | XML DATA | Device Information |
|
|
112
|
+
| rdServicePackage | Device Package |
|
|
113
|
+
| message | Message about Success or Failure |
|
|
98
114
|
|
|
99
|
-
|
|
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
|
|
115
|
+
`captureFinger()` and `openFingerPrintScanner()` Methods Reponse
|
|
108
116
|
|
|
117
|
+
| Key | Value | Description |
|
|
118
|
+
| ---- | ------- | ----------- |
|
|
119
|
+
| status | 1 or 0 | `1` - Fingerprint Captured Successfully, `0` - FingerPrint not Captured (Check Connection of Device and OTG Connection Settings in Mobile) |
|
|
120
|
+
| errorCode | ERROR CODE from RD Service | Refer [UIDAI Document](https://uidai.gov.in/images/resource/Aadhaar_Registered_Devices_2_0_Revision-7_of_Jan_2022.pdf) and [RDService Error Details](https://github.com/senthalan2/react-native-rdservice-fingerprintscanner/blob/main/Assets/RDService_Error_Details.pdf) |
|
|
121
|
+
| errInfo | Error Message according to the ERROR CODE | Refer [UIDAI Document](https://uidai.gov.in/images/resource/Aadhaar_Registered_Devices_2_0_Revision-7_of_Jan_2022.pdf) and [RDService Error Details](https://github.com/senthalan2/react-native-rdservice-fingerprintscanner/blob/main/Assets/RDService_Error_Details.pdf) |
|
|
122
|
+
| pidDataJson | JSON DATA | The device returns PID DATA of Captured Fingerprint. this parameter contains converted JSON pidData of XML pidData |
|
|
123
|
+
| pidDataXML | XML DATA | pidData Captured Fingerprint
|
|
124
|
+
| rdServicePackage | Device Package |
|
|
125
|
+
| message | Message about Success or Failure |
|
|
109
126
|
|
|
127
|
+
`isDriverFound()` Method Response
|
|
110
128
|
|
|
111
|
-
|
|
129
|
+
| Key | Value | Description |
|
|
130
|
+
| ------------------- | -------- | ---------- |
|
|
131
|
+
| isDeviceDriverFound | true or false | `true` - Driver Found, `false` - Driver not found |
|
|
132
|
+
| message | Message about the driver found or not |
|
|
112
133
|
|
|
113
|
-
|
|
114
|
-
--- | --- | ---
|
|
115
|
-
isDeviceDriverFound | true or false | ```true``` - Driver Found, ```false``` - Driver not found
|
|
116
|
-
message | Message about the driver found or not
|
|
134
|
+
`captureFace()` method Reponse
|
|
117
135
|
|
|
136
|
+
| Key | Value | Description |
|
|
137
|
+
| ---------------- | ------------------ | --------- |
|
|
138
|
+
| status | 1 or 0 | `1` - Face Captured Successfully, `0` - Face not Captured |
|
|
139
|
+
| errorCode | ERROR CODE from RD Service | Refer [UIDAI Document](https://uidai.gov.in/images/resource/Aadhaar_Authentication_API-2.5_Revision-1_of_January_2022.pdf) |
|
|
140
|
+
| errInfo | Error Message according to the ERROR CODE | Refer [UIDAI Document](https://uidai.gov.in/images/resource/Aadhaar_Authentication_API-2.5_Revision-1_of_January_2022.pdf) |
|
|
141
|
+
| pidDataJson | JSON DATA | The [AadhaarFaceRD](https://play.google.com/store/apps/details?id=in.gov.uidai.facerd&hl=en) app returns PID data of the captured face. This parameter contains the JSON-converted version of the XML PID data |
|
|
142
|
+
| pidDataXML | XML DATA | PID data of the captured face |
|
|
143
|
+
| message | Message about Success or Failure |
|
|
118
144
|
|
|
119
145
|
|
|
120
146
|
## Tested Devices
|
|
121
147
|
|
|
122
|
-
Device Name
|
|
123
|
-
|
|
124
|
-
Startek FM220 | :white_check_mark:
|
|
125
|
-
MORPHO
|
|
126
|
-
MANTRA
|
|
127
|
-
Tatvik TMF20
|
|
128
|
-
PB510
|
|
148
|
+
| Device Name | Result |
|
|
149
|
+
| ------------- | ------------------ |
|
|
150
|
+
| Startek FM220 | :white_check_mark: |
|
|
151
|
+
| MORPHO | :white_check_mark: |
|
|
152
|
+
| MANTRA | :white_check_mark: |
|
|
153
|
+
| Tatvik TMF20 | :white_check_mark: |
|
|
154
|
+
| PB510 | :white_check_mark: |
|
|
129
155
|
|
|
130
156
|
## Contributing
|
|
131
157
|
|
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.content.Intent;
|
|
5
4
|
|
|
@@ -23,6 +22,12 @@ public interface RDServiceEvents {
|
|
|
23
22
|
*/
|
|
24
23
|
void onRDServiceCaptureResponse(String pidData, String rdServicePackage);
|
|
25
24
|
|
|
25
|
+
/**
|
|
26
|
+
* A face scan data is received from the FaceRD.
|
|
27
|
+
* @param pidData The face scan PID data as XML string
|
|
28
|
+
*/
|
|
29
|
+
void onRDServiceFaceCaptureResponse(String pidData);
|
|
30
|
+
|
|
26
31
|
/**
|
|
27
32
|
* No installed RDService driver was found.
|
|
28
33
|
*/
|
|
@@ -44,5 +49,12 @@ public interface RDServiceEvents {
|
|
|
44
49
|
*/
|
|
45
50
|
void onRDServiceCaptureFailed(int resultCode, Intent data, String rdServicePackage);
|
|
46
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Captured request sent to an RDService face capture failed.
|
|
54
|
+
* @param resultCode The resultCode returned by the FaceRD
|
|
55
|
+
* @param data The data returned by the FaceRD activity
|
|
56
|
+
*/
|
|
57
|
+
void onRDServiceFaceCaptureFailed(int resultCode, Intent data);
|
|
58
|
+
|
|
47
59
|
void onDeviceDriverFound(Boolean isFound);
|
|
48
60
|
}
|
|
@@ -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;
|
|
@@ -29,6 +28,7 @@ public class RDServiceManager {
|
|
|
29
28
|
private static final int RC_RDSERVICE_CAPTURE_START_INDEX = 8300;
|
|
30
29
|
|
|
31
30
|
private static final int FINGERPRINT_SCANNER_CAPTURE = 8761;
|
|
31
|
+
private static final int FACE_SCANNER_CAPTURE = 8762;
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
private static final Map<String, Integer> mapRDDriverRCIndex = new HashMap<String, Integer>();
|
|
@@ -45,7 +45,6 @@ public class RDServiceManager {
|
|
|
45
45
|
put("com.integra.registered.device", "Integra");
|
|
46
46
|
put("com.aratek.asix_gms.rdservice", "Aratek");
|
|
47
47
|
put("rdservice.metsl.metslrdservice", "Maestros");
|
|
48
|
-
|
|
49
48
|
put("com.tatvik.bio.tmf20", "Tatvik TMF20");
|
|
50
49
|
put("com.evolute.rdservice", "Evolute");
|
|
51
50
|
put("com.precision.pb510.rdservice", "PB510");
|
|
@@ -144,6 +143,14 @@ public class RDServiceManager {
|
|
|
144
143
|
mRDEvent.onRDServiceCaptureFailed(resultCode, data, rdservice_pkg_name); // Fingerprint Capture Failed
|
|
145
144
|
}
|
|
146
145
|
}
|
|
146
|
+
else if(requestCode == FACE_SCANNER_CAPTURE){
|
|
147
|
+
if(resultCode == RESULT_OK){
|
|
148
|
+
onRDServiceFaceCaptureIntentResponse(data);
|
|
149
|
+
}
|
|
150
|
+
else{
|
|
151
|
+
mRDEvent.onRDServiceFaceCaptureFailed(resultCode, data);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
147
154
|
}
|
|
148
155
|
|
|
149
156
|
|
|
@@ -218,7 +225,7 @@ public class RDServiceManager {
|
|
|
218
225
|
intentInfo.setPackage(_pkg);
|
|
219
226
|
activity.startActivityForResult(intentInfo, next_discover_rc_index);
|
|
220
227
|
|
|
221
|
-
|
|
228
|
+
} catch (Exception e) {
|
|
222
229
|
e.printStackTrace();
|
|
223
230
|
mRDEvent.onRDServiceDriverDiscoveryFailed(0, null, _pkg, e.getMessage());
|
|
224
231
|
}
|
|
@@ -257,7 +264,14 @@ public class RDServiceManager {
|
|
|
257
264
|
activity.startActivityForResult(intentCapture, capture_rc);
|
|
258
265
|
} else {
|
|
259
266
|
mRDEvent.onRDServiceDriverDiscoveryFailed(0, null, rd_service_package, "Package not found or not whitelisted");
|
|
260
|
-
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
public void captureFace(@NonNull String pid_options,Activity activity){
|
|
271
|
+
Intent intent = new Intent("in.gov.uidai.rdservice.face.CAPTURE");
|
|
272
|
+
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
273
|
+
intent.putExtra("request", pid_options);
|
|
274
|
+
activity.startActivityForResult(intent, FACE_SCANNER_CAPTURE);
|
|
261
275
|
}
|
|
262
276
|
|
|
263
277
|
|
|
@@ -268,14 +282,14 @@ public class RDServiceManager {
|
|
|
268
282
|
* @param rd_service_package The package name of the RDService driver
|
|
269
283
|
*/
|
|
270
284
|
private void onRDServiceInfoResponse(@NonNull Intent data, @NonNull String rd_service_package) {
|
|
271
|
-
|
|
285
|
+
Bundle b = data.getExtras();
|
|
272
286
|
|
|
273
287
|
if (b != null) {
|
|
274
288
|
// sendWebViewResponse("rdservice_info", b.getString("RD_SERVICE_INFO", "") + "<RD_SERVICE_ANDROID_PACKAGE=\"" + rd_service_package + "\" />");
|
|
275
289
|
|
|
276
290
|
mRDEvent.onRDServiceDriverDiscovery(b.getString("RD_SERVICE_INFO", ""), rd_service_package, mapRDDriverWhitelist.containsKey(rd_service_package));
|
|
277
291
|
|
|
278
|
-
|
|
292
|
+
}
|
|
279
293
|
}
|
|
280
294
|
|
|
281
295
|
|
|
@@ -292,7 +306,15 @@ public class RDServiceManager {
|
|
|
292
306
|
// sendWebViewResponse("rdservice_resp", b.getString("PID_DATA", ""));
|
|
293
307
|
mRDEvent.onRDServiceCaptureResponse(b.getString("PID_DATA", ""), rd_service_package);
|
|
294
308
|
|
|
295
|
-
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
private void onRDServiceFaceCaptureIntentResponse(@NonNull Intent data) {
|
|
313
|
+
Bundle b = data.getExtras();
|
|
314
|
+
|
|
315
|
+
if (b != null) {
|
|
316
|
+
mRDEvent.onRDServiceFaceCaptureResponse(b.getString("response", ""));
|
|
317
|
+
}
|
|
296
318
|
}
|
|
297
319
|
|
|
298
320
|
|