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 CHANGED
@@ -1,7 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Senthalan S
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: ```android/build.gradle```
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 { getDeviceInfo, captureFinger,isDriverFound,openFingerPrintScanner, DEFAULT_PID_OPTIONS } from "react-native-rdservice-fingerprintscanner";
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
- .then((response) => {
40
- console.log(response, 'DEVICE DRIVER FOUND'); // Response about Device Driver
41
- })
42
- .catch((error) => {
43
- console.log(error, 'DEVICE DRIVER NOT FOUND'); //Failed to get device information
44
- });
45
-
46
- captureFinger(pidOptions) //you can pass pidOptions (optional) to "captureFinger(pidOptions)"" method otherwise it takes DEFAULT_PID_OPTIONS
47
- .then((response) => {
48
- console.log(response, 'FINGER CAPTURE'); // FingerPrint Response
49
- })
50
- .catch((e) => {
51
- console.log(e, 'ERROR_FINGER_CAPTURE'); // Failed to capture the Fingerprint
52
- });
53
-
54
- isDriverFound(PACKAGE_NAME)
55
- .then((res) => {
56
- console.log(res, 'DRIVER CHECK');
57
- })
58
- .catch((error) => {
59
- console.log(error, 'ERROR_DRIVER CHECK');
60
- });
61
-
62
- openFingerPrintScanner(PACKAGE_NAME,pidOptions) //you can pass pidOptions (optional) to "openFingerPrintScanner(pidOptions)"" method otherwise it takes DEFAULT_PID_OPTIONS
63
- .then((res) => {
64
- console.log(res, 'FINGER CAPTURE');
65
- })
66
- .catch((e) => {
67
- console.log(e, 'ERROR_FINGER_CAPTURE');
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
- ```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)
86
+ `pidOptions` is an XML string that you need to pass to the `captureFinger`, `openFingerPrintScanner` and `captureFace` methods.
74
87
 
75
- ```DEFAULT_PID_OPTIONS``` is used when you not passed the pidOptions to the ```captureFinger()``` Method.
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
- ```PACKAGE_NAME``` is required to check the rd service. (eg) The Package name of StarTek Device is ```com.acpl.registersdk```
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
- ```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.
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
- ## Response JSON Object
96
+ `PACKAGE_NAME` is required to check the rd service. (eg) The Package name of StarTek Device is `com.acpl.registersdk`
83
97
 
84
- ```getDeviceInfo()``` Method Reponse
98
+ You can use `AVAILABLE_PACKAGES` for `PACKAGE_NAME`.
85
99
 
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
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
- ```captureFinger()``` and ```openFingerPrintScanner()``` Methods Reponse
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
- 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
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
- ```isDriverFound()``` Method Response
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
- Key | Value | Description
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 | Result
123
- --- | ---
124
- Startek FM220 | :white_check_mark:
125
- MORPHO | :white_check_mark:
126
- MANTRA | :white_check_mark:
127
- Tatvik TMF20 | :white_check_mark:
128
- PB510 | :white_check_mark:
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
 
@@ -1,60 +1,104 @@
1
1
  buildscript {
2
- if (project == rootProject) {
3
- repositories {
4
- google()
5
- mavenCentral()
6
- jcenter()
7
- }
8
-
9
- dependencies {
10
- classpath 'com.android.tools.build:gradle:3.5.3'
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
- apply plugin: 'com.android.library'
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
- def safeExtGet(prop, fallback) {
18
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
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
- compileSdkVersion safeExtGet('RdserviceFingerprintscanner_compileSdkVersion', 29)
23
- defaultConfig {
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
- buildTypes {
32
- release {
33
- minifyEnabled false
34
- }
35
- }
36
- lintOptions {
37
- disable 'GradleCompatible'
38
- }
39
- compileOptions {
40
- sourceCompatibility JavaVersion.VERSION_1_8
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
- mavenLocal()
47
- maven {
48
- // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
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
- //noinspection GradleDynamicVersion
58
- implementation "com.facebook.react:react-native:+" // From node_modules
59
- implementation 'com.github.smart-fun:XmlToJson:1.5.1'
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,5 @@
1
+ RdserviceFingerprintscanner_kotlinVersion=1.7.0
2
+ RdserviceFingerprintscanner_minSdkVersion=21
3
+ RdserviceFingerprintscanner_targetSdkVersion=31
4
+ RdserviceFingerprintscanner_compileSdkVersion=31
5
+ RdserviceFingerprintscanner_ndkversion=21.4.7075529
@@ -1,4 +1,3 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.reactnativerdservicefingerprintscanner">
3
-
2
+ package="com.rdservicefingerprintscanner">
4
3
  </manifest>
@@ -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.reactnativerdservicefingerprintscanner;
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.reactnativerdservicefingerprintscanner;
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
- } catch (Exception e) {
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
- Bundle b = data.getExtras();
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