@finos_sdk/sdk-ekyc 0.0.35 → 0.0.36
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/android/build.gradle +1 -1
- package/android/settings.gradle +1 -1
- package/package.json +1 -1
- package/android/src/main/AndroidManifest.xml +0 -9
- package/android/src/main/build/generated/source/buildConfig/debug/com/sdkekycrn/BuildConfig.java +0 -10
- package/android/src/main/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -7
- package/android/src/main/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
- package/android/src/main/build/intermediates/aar_main_jar/debug/syncDebugLibJars/classes.jar +0 -0
- package/android/src/main/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
- package/android/src/main/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- package/android/src/main/build/intermediates/annotations_typedef_file/debug/extractDebugAnnotations/typedefs.txt +0 -0
- package/android/src/main/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/src/main/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/src/main/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
- package/android/src/main/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/src/main/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
- package/android/src/main/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/src/main/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/src/main/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/src/main/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/sdkekycrn/BuildConfig.class +0 -0
- package/android/src/main/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
- package/android/src/main/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -7
- package/android/src/main/build/intermediates/merged_java_res/debug/mergeDebugJavaResource/feature-main.jar +0 -0
- package/android/src/main/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -7
- package/android/src/main/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- package/android/src/main/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
- package/android/src/main/build/outputs/aar/main-debug.aar +0 -0
- package/android/src/main/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
- package/android/src/main/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/src/main/build.gradle +0 -32
- package/android/src/main/java/com/sdkekycrn/EKYCModule.kt +0 -473
- package/android/src/main/java/com/sdkekycrn/EKYCPackage.kt +0 -21
package/android/build.gradle
CHANGED
package/android/settings.gradle
CHANGED
|
@@ -19,7 +19,7 @@ dependencyResolutionManagement {
|
|
|
19
19
|
maven { url uri("file://${settingsDir}/SDKeKYC") }
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
rootProject.name = '
|
|
22
|
+
rootProject.name = 'finosSDKeKYC'
|
|
23
23
|
include ':app'
|
|
24
24
|
include ':src:main'
|
|
25
25
|
includeBuild('../node_modules/@react-native/gradle-plugin')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos_sdk/sdk-ekyc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"description": "React Native SDK for eKYC (electronic Know Your Customer) - Vietnamese CCCD NFC reading, OCR, Liveness detection, Face matching, and C06 residence verification",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
package/android/src/main/build/generated/source/buildConfig/debug/com/sdkekycrn/BuildConfig.java
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Automatically generated file. DO NOT MODIFY
|
|
3
|
-
*/
|
|
4
|
-
package com.sdkekycrn;
|
|
5
|
-
|
|
6
|
-
public final class BuildConfig {
|
|
7
|
-
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
|
8
|
-
public static final String LIBRARY_PACKAGE_NAME = "com.sdkekycrn";
|
|
9
|
-
public static final String BUILD_TYPE = "debug";
|
|
10
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"artifactType": {
|
|
4
|
-
"type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
|
|
5
|
-
"kind": "Directory"
|
|
6
|
-
},
|
|
7
|
-
"applicationId": "com.sdkekycrn",
|
|
8
|
-
"variantName": "debug",
|
|
9
|
-
"elements": [
|
|
10
|
-
{
|
|
11
|
-
"type": "SINGLE",
|
|
12
|
-
"filters": [],
|
|
13
|
-
"attributes": [],
|
|
14
|
-
"outputFile": "AndroidManifest.xml"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"elementType": "File"
|
|
18
|
-
}
|
package/android/src/main/build/intermediates/aar_main_jar/debug/syncDebugLibJars/classes.jar
DELETED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
File without changes
|
package/android/src/main/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar
DELETED
|
Binary file
|
package/android/src/main/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt
DELETED
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#Mon Sep 29 16:03:10 ICT 2025
|
package/android/src/main/build/intermediates/incremental/debug/packageDebugResources/merger.xml
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated" generated-set="generated$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/build/generated/res/resValues/debug"/></dataSet><mergedItems/></merger>
|
|
Binary file
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/src/debug/jniLibs"/></dataSet></merger>
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/src/debug/shaders"/></dataSet></merger>
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/src/main/assets"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/src/debug/assets"/></dataSet><dataSet config="generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/build/intermediates/shader_assets/debug/compileDebugShaders/out"/></dataSet></merger>
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0 Warning/Error
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
com.sdkekycrn
|
|
Binary file
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
-- Merging decision tree log ---
|
|
2
|
-
manifest
|
|
3
|
-
ADDED from /Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/build/intermediates/tmp/ProcessLibraryManifest/debug/tempAndroidManifest13369881532742005821.xml:2:13-83
|
|
4
|
-
INJECTED from /Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/build/intermediates/tmp/ProcessLibraryManifest/debug/tempAndroidManifest13369881532742005821.xml:2:13-83
|
|
5
|
-
package
|
|
6
|
-
INJECTED from /Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/build/intermediates/tmp/ProcessLibraryManifest/debug/tempAndroidManifest13369881532742005821.xml
|
|
7
|
-
xmlns:android
|
|
8
|
-
ADDED from /Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/build/intermediates/tmp/ProcessLibraryManifest/debug/tempAndroidManifest13369881532742005821.xml:2:23-81
|
|
9
|
-
uses-sdk
|
|
10
|
-
INJECTED from /Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/build/intermediates/tmp/ProcessLibraryManifest/debug/tempAndroidManifest13369881532742005821.xml reason: use-sdk injection requested
|
|
11
|
-
INJECTED from /Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/build/intermediates/tmp/ProcessLibraryManifest/debug/tempAndroidManifest13369881532742005821.xml
|
|
12
|
-
INJECTED from /Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/build/intermediates/tmp/ProcessLibraryManifest/debug/tempAndroidManifest13369881532742005821.xml
|
|
13
|
-
android:targetSdkVersion
|
|
14
|
-
INJECTED from /Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/build/intermediates/tmp/ProcessLibraryManifest/debug/tempAndroidManifest13369881532742005821.xml
|
|
15
|
-
android:minSdkVersion
|
|
16
|
-
INJECTED from /Volumes/Data/Work/GalaxyHolding/SDK_RN/finos.ekyc.sdk.reactnative/android/src/main/build/intermediates/tmp/ProcessLibraryManifest/debug/tempAndroidManifest13369881532742005821.xml
|
|
Binary file
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
plugins {
|
|
2
|
-
id "com.android.library"
|
|
3
|
-
id "org.jetbrains.kotlin.android"
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
android {
|
|
7
|
-
namespace "com.sdkekycrn"
|
|
8
|
-
compileSdkVersion 35
|
|
9
|
-
|
|
10
|
-
defaultConfig {
|
|
11
|
-
minSdkVersion 24
|
|
12
|
-
targetSdkVersion 34
|
|
13
|
-
consumerProguardFiles "consumer-rules.pro"
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
buildFeatures {
|
|
17
|
-
buildConfig false
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
repositories {
|
|
22
|
-
google()
|
|
23
|
-
mavenCentral()
|
|
24
|
-
mavenLocal()
|
|
25
|
-
maven { url uri("file://${projectDir}/SDKeKYC") }
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
dependencies {
|
|
29
|
-
implementation("com.facebook.react:react-android")
|
|
30
|
-
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.25")
|
|
31
|
-
implementation("finos.sdk.ekyc:ekyc:1.2.0")
|
|
32
|
-
}
|
|
@@ -1,473 +0,0 @@
|
|
|
1
|
-
package com.sdkekycrn
|
|
2
|
-
|
|
3
|
-
import android.util.Base64
|
|
4
|
-
import android.util.Log
|
|
5
|
-
import com.facebook.react.bridge.Arguments
|
|
6
|
-
import com.facebook.react.bridge.Promise
|
|
7
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
8
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
9
|
-
import com.facebook.react.bridge.ReactMethod
|
|
10
|
-
import com.facebook.react.bridge.WritableMap
|
|
11
|
-
import com.facebook.react.module.annotations.ReactModule
|
|
12
|
-
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
13
|
-
import finos.sdk.c06.SdkEkycC06
|
|
14
|
-
import finos.sdk.core.define.EKYCEvent
|
|
15
|
-
import finos.sdk.core.define.SDKType
|
|
16
|
-
import finos.sdk.core.model.response.SDKEkycResult
|
|
17
|
-
import finos.sdk.core.model.sdk.config.C06Config
|
|
18
|
-
import finos.sdk.core.model.sdk.config.EKYCConfigSDK
|
|
19
|
-
import finos.sdk.core.model.sdk.config.FaceServiceConfig
|
|
20
|
-
import finos.sdk.core.model.sdk.config.LivenessConfig
|
|
21
|
-
import finos.sdk.core.model.sdk.config.NfcConfig
|
|
22
|
-
import finos.sdk.core.model.sdk.config.OcrConfig
|
|
23
|
-
import finos.sdk.ekyc.SdkEkyc
|
|
24
|
-
import finos.sdk.faceservice.SdkEkycFaceService
|
|
25
|
-
import finos.sdk.liveness.SdkEkycLiveness
|
|
26
|
-
import finos.sdk.nfc.SdkEkycNfc
|
|
27
|
-
import finos.sdk.ocr.SdkEkycOcr
|
|
28
|
-
import java.io.File
|
|
29
|
-
import java.io.FileOutputStream
|
|
30
|
-
import java.util.Date
|
|
31
|
-
|
|
32
|
-
@ReactModule(name = EKYCModule.NAME)
|
|
33
|
-
class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
|
34
|
-
|
|
35
|
-
companion object {
|
|
36
|
-
const val NAME = "EKYCModule"
|
|
37
|
-
private const val TAG = "EKYCModule"
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
override fun getName(): String = NAME
|
|
41
|
-
|
|
42
|
-
private fun sendEvent(eventName: String, params: WritableMap?) {
|
|
43
|
-
reactApplicationContext
|
|
44
|
-
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
45
|
-
.emit(eventName, params)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@ReactMethod
|
|
49
|
-
fun initSdkEkyc(promise: Promise) {
|
|
50
|
-
try {
|
|
51
|
-
SdkEkyc.initSDKEkyc(reactApplicationContext) {
|
|
52
|
-
val params =
|
|
53
|
-
Arguments.createMap().apply {
|
|
54
|
-
putString("status", "success")
|
|
55
|
-
putString("message", "SDK EKYC initialized successfully")
|
|
56
|
-
}
|
|
57
|
-
sendEvent("EKYCInitEvent", params)
|
|
58
|
-
//promise.resolve("SDK EKYC initialized successfully")
|
|
59
|
-
promise.resolve(true)
|
|
60
|
-
}
|
|
61
|
-
} catch (e: Exception) {
|
|
62
|
-
promise.reject("INIT_ERROR", "Failed to initialize SDK EKYC: ${e.message}")
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@ReactMethod
|
|
67
|
-
fun startNfcScan(
|
|
68
|
-
appKey: String,
|
|
69
|
-
documentNumber: String,
|
|
70
|
-
birthDate: String,
|
|
71
|
-
expireDate: String,
|
|
72
|
-
transactionId: String?,
|
|
73
|
-
facePathStorage: String?,
|
|
74
|
-
promise: Promise
|
|
75
|
-
) {
|
|
76
|
-
try {
|
|
77
|
-
Log.d(TAG, "startNfcScan:::0000")
|
|
78
|
-
val currentActivity = reactApplicationContext.currentActivity
|
|
79
|
-
if (currentActivity == null) {
|
|
80
|
-
promise.reject("NO_ACTIVITY", "Activity not available")
|
|
81
|
-
return
|
|
82
|
-
}
|
|
83
|
-
Log.d(TAG, "startNfcScan:::1111")
|
|
84
|
-
val nfcConfig = NfcConfig(
|
|
85
|
-
documentNumber = documentNumber,
|
|
86
|
-
birthDate = birthDate,
|
|
87
|
-
expireDate = expireDate,
|
|
88
|
-
facePathStorage = facePathStorage ?: "",
|
|
89
|
-
transactionId = transactionId ?: ""
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
val ekycConfig =
|
|
93
|
-
EKYCConfigSDK(appKey = appKey, sdkType = SDKType.NFC, nfcConfig = nfcConfig)
|
|
94
|
-
|
|
95
|
-
SdkEkycNfc.startEkyc(
|
|
96
|
-
activity = currentActivity,
|
|
97
|
-
ekycConfigSDK = ekycConfig,
|
|
98
|
-
callbackSuccess = { event, data ->
|
|
99
|
-
Log.d(TAG, "NFC Success - Event: $event, Data: $data")
|
|
100
|
-
|
|
101
|
-
when (event) {
|
|
102
|
-
EKYCEvent.SCAN_NFC_START -> {
|
|
103
|
-
val eventMap =
|
|
104
|
-
Arguments.createMap().apply {
|
|
105
|
-
putString("event", event.name)
|
|
106
|
-
putString("data", data.toString())
|
|
107
|
-
}
|
|
108
|
-
sendEvent("onNfcScanStart", eventMap)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
EKYCEvent.SCAN_NFC_SUCCESS -> {
|
|
112
|
-
val eventMap =
|
|
113
|
-
Arguments.createMap().apply {
|
|
114
|
-
putString("event", event.name)
|
|
115
|
-
putString("data", (data as SDKEkycResult).nfcResponse)
|
|
116
|
-
}
|
|
117
|
-
sendEvent("onNfcScanSuccess", eventMap)
|
|
118
|
-
val promiseMap =
|
|
119
|
-
Arguments.createMap().apply {
|
|
120
|
-
putString("event", event.name)
|
|
121
|
-
putString("data", (data as SDKEkycResult).nfcResponse)
|
|
122
|
-
}
|
|
123
|
-
promise.resolve(promiseMap)
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
else -> {
|
|
127
|
-
val eventMap =
|
|
128
|
-
Arguments.createMap().apply {
|
|
129
|
-
putString("event", event.name)
|
|
130
|
-
putString("data", data.toString())
|
|
131
|
-
}
|
|
132
|
-
sendEvent("onNfcEvent", eventMap)
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
callbackError = { event, message ->
|
|
137
|
-
Log.e(TAG, "NFC Error - Event: $event, Message: $message")
|
|
138
|
-
|
|
139
|
-
val errorMap =
|
|
140
|
-
Arguments.createMap().apply {
|
|
141
|
-
putString("event", event.name)
|
|
142
|
-
putString("message", message ?: "Unknown error")
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
sendEvent("onNfcError", errorMap)
|
|
146
|
-
promise.reject(event.name, message ?: "Unknown NFC error")
|
|
147
|
-
}
|
|
148
|
-
)
|
|
149
|
-
Log.d(TAG, "startNfcScan:::222222")
|
|
150
|
-
} catch (e: Exception) {
|
|
151
|
-
Log.e(TAG, "Exception in startNfcScan: ${e.message}", e)
|
|
152
|
-
promise.reject("NFC_EXCEPTION", e.message, e)
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
@ReactMethod
|
|
157
|
-
fun checkC06(
|
|
158
|
-
appKey: String,
|
|
159
|
-
sod: String,
|
|
160
|
-
idCardNumber: String,
|
|
161
|
-
recentLocation: String,
|
|
162
|
-
transactionId: String?,
|
|
163
|
-
promise: Promise
|
|
164
|
-
) {
|
|
165
|
-
try {
|
|
166
|
-
val c06Config =
|
|
167
|
-
C06Config(
|
|
168
|
-
transactionId = transactionId ?: "",
|
|
169
|
-
sod = sod,
|
|
170
|
-
idCardNumber = idCardNumber,
|
|
171
|
-
recentLocation = recentLocation
|
|
172
|
-
)
|
|
173
|
-
|
|
174
|
-
val ekycConfig = EKYCConfigSDK(appKey = appKey, c06Config = c06Config)
|
|
175
|
-
|
|
176
|
-
SdkEkycC06.startEkyc(
|
|
177
|
-
ekycConfigSDK = ekycConfig,
|
|
178
|
-
callbackSuccess = { event, data ->
|
|
179
|
-
Log.d(TAG, "C06 Success - Event: $event, Data: $data")
|
|
180
|
-
|
|
181
|
-
// Create separate maps for event and promise
|
|
182
|
-
val eventMap =
|
|
183
|
-
Arguments.createMap().apply {
|
|
184
|
-
putString("event", event.name)
|
|
185
|
-
putString("data", data.toString())
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
val promiseMap =
|
|
189
|
-
Arguments.createMap().apply {
|
|
190
|
-
putString("event", event.name)
|
|
191
|
-
putString("data", data.toString())
|
|
192
|
-
}
|
|
193
|
-
sendEvent("onC06Success", eventMap)
|
|
194
|
-
promise.resolve(promiseMap)
|
|
195
|
-
},
|
|
196
|
-
callbackError = { event, message ->
|
|
197
|
-
Log.e(TAG, "C06 Error - Event: $event, Message: $message")
|
|
198
|
-
|
|
199
|
-
val errorMap =
|
|
200
|
-
Arguments.createMap().apply {
|
|
201
|
-
putString("event", event.name)
|
|
202
|
-
putString("message", message ?: "Unknown error")
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
sendEvent("onC06Error", errorMap)
|
|
206
|
-
promise.reject(event.name, message ?: "Unknown C06 error")
|
|
207
|
-
}
|
|
208
|
-
)
|
|
209
|
-
} catch (e: Exception) {
|
|
210
|
-
Log.e(TAG, "Exception in checkC06: ${e.message}", e)
|
|
211
|
-
promise.reject("C06_EXCEPTION", e.message, e)
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
@ReactMethod
|
|
216
|
-
fun startOcr(
|
|
217
|
-
appKey: String,
|
|
218
|
-
idImage: String,
|
|
219
|
-
expectedDocumentSide: String,
|
|
220
|
-
transactionId: String,
|
|
221
|
-
promise: Promise
|
|
222
|
-
) {
|
|
223
|
-
try {
|
|
224
|
-
val currentActivity = reactApplicationContext.currentActivity
|
|
225
|
-
if (currentActivity == null) {
|
|
226
|
-
promise.reject("NO_ACTIVITY", "Activity not available")
|
|
227
|
-
return
|
|
228
|
-
}
|
|
229
|
-
val imageFile = File(idImage.replace("file://", ""))
|
|
230
|
-
if (!imageFile.exists()) {
|
|
231
|
-
promise.reject("FILE_NOT_FOUND", "Image file does not exist")
|
|
232
|
-
return
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
val ocrConfig =
|
|
236
|
-
OcrConfig(
|
|
237
|
-
idImage = imageFile,
|
|
238
|
-
expectedDocumentSide = expectedDocumentSide,
|
|
239
|
-
transactionId = transactionId
|
|
240
|
-
)
|
|
241
|
-
val ekycConfig =
|
|
242
|
-
EKYCConfigSDK(appKey = appKey, sdkType = SDKType.OCR, ocrConfig = ocrConfig)
|
|
243
|
-
SdkEkycOcr.startEkyc(
|
|
244
|
-
ekycConfigSDK = ekycConfig,
|
|
245
|
-
callbackSuccess = { event, data ->
|
|
246
|
-
Log.d(TAG, "OCR Success - Event: $event, Data: $data")
|
|
247
|
-
val resultMap =
|
|
248
|
-
Arguments.createMap().apply {
|
|
249
|
-
putString("event", event.name)
|
|
250
|
-
putString(
|
|
251
|
-
"data",
|
|
252
|
-
(data as SDKEkycResult).ocrResponse.toString()
|
|
253
|
-
)
|
|
254
|
-
}
|
|
255
|
-
sendEvent("onOcrSuccess", resultMap)
|
|
256
|
-
val promiseMap =
|
|
257
|
-
Arguments.createMap().apply {
|
|
258
|
-
putString("event", event.name)
|
|
259
|
-
putString(
|
|
260
|
-
"data",
|
|
261
|
-
(data as SDKEkycResult).ocrResponse.toString()
|
|
262
|
-
)
|
|
263
|
-
}
|
|
264
|
-
promise.resolve(promiseMap)
|
|
265
|
-
},
|
|
266
|
-
callbackError = { event, message ->
|
|
267
|
-
Log.e(TAG, "OCR Error - Event: $event, Message: $message")
|
|
268
|
-
val errorMap =
|
|
269
|
-
Arguments.createMap().apply {
|
|
270
|
-
putString("event", event.name)
|
|
271
|
-
putString("message", message ?: "Unknown error")
|
|
272
|
-
}
|
|
273
|
-
sendEvent("onOcrError", errorMap)
|
|
274
|
-
promise.reject(event.name, message ?: "Unknown OCR error")
|
|
275
|
-
}
|
|
276
|
-
)
|
|
277
|
-
} catch (e: Exception) {
|
|
278
|
-
Log.e(TAG, "Exception in startOcr: ${e.message}", e)
|
|
279
|
-
promise.reject("OCR_ERROR", e.message)
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
@ReactMethod
|
|
284
|
-
fun startLiveness(
|
|
285
|
-
appKey: String,
|
|
286
|
-
selfieImage: String,
|
|
287
|
-
usingRandomAction: Boolean,
|
|
288
|
-
transactionId: String,
|
|
289
|
-
isStraight: Boolean,
|
|
290
|
-
promise: Promise
|
|
291
|
-
) {
|
|
292
|
-
try {
|
|
293
|
-
val currentActivity = reactApplicationContext.currentActivity
|
|
294
|
-
if (currentActivity == null) {
|
|
295
|
-
promise.reject("NO_ACTIVITY", "Activity not available")
|
|
296
|
-
return
|
|
297
|
-
}
|
|
298
|
-
val imageFile = File(selfieImage.replace("file://", ""))
|
|
299
|
-
if (!imageFile.exists()) {
|
|
300
|
-
promise.reject("FILE_NOT_FOUND", "Image file does not exist")
|
|
301
|
-
return
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
val livenessConfig =
|
|
305
|
-
LivenessConfig(
|
|
306
|
-
selfieImage = imageFile,
|
|
307
|
-
usingRandomAction = usingRandomAction,
|
|
308
|
-
isStraight = isStraight,
|
|
309
|
-
transactionId = transactionId
|
|
310
|
-
)
|
|
311
|
-
val ekycConfig =
|
|
312
|
-
EKYCConfigSDK(
|
|
313
|
-
appKey = appKey,
|
|
314
|
-
sdkType = SDKType.LIVE_NESS,
|
|
315
|
-
livenessConfig = livenessConfig
|
|
316
|
-
)
|
|
317
|
-
SdkEkycLiveness.startEkyc(
|
|
318
|
-
ekycConfigSDK = ekycConfig,
|
|
319
|
-
callbackSuccess = { event, data ->
|
|
320
|
-
Log.d(TAG, "Liveness Success - Event: $event, Data: $data")
|
|
321
|
-
val resultMap =
|
|
322
|
-
Arguments.createMap().apply {
|
|
323
|
-
putString("event", event.name)
|
|
324
|
-
putString(
|
|
325
|
-
"data",
|
|
326
|
-
(data as SDKEkycResult).checkLivenessResponse.toString()
|
|
327
|
-
)
|
|
328
|
-
}
|
|
329
|
-
sendEvent("onLivenessSuccess", resultMap)
|
|
330
|
-
val promiseMap =
|
|
331
|
-
Arguments.createMap().apply {
|
|
332
|
-
putString("event", event.name)
|
|
333
|
-
putString(
|
|
334
|
-
"data",
|
|
335
|
-
(data as SDKEkycResult).checkLivenessResponse.toString()
|
|
336
|
-
)
|
|
337
|
-
}
|
|
338
|
-
promise.resolve(promiseMap)
|
|
339
|
-
},
|
|
340
|
-
callbackError = { event, message ->
|
|
341
|
-
Log.e(TAG, "Liveness Error - Event: $event, Message: $message")
|
|
342
|
-
val errorMap =
|
|
343
|
-
Arguments.createMap().apply {
|
|
344
|
-
putString("event", event.name)
|
|
345
|
-
putString("message", message ?: "Unknown error")
|
|
346
|
-
}
|
|
347
|
-
sendEvent("onLivenessError", errorMap)
|
|
348
|
-
promise.reject(event.name, message ?: "Unknown Liveness error")
|
|
349
|
-
}
|
|
350
|
-
)
|
|
351
|
-
} catch (e: Exception) {
|
|
352
|
-
Log.e(TAG, "Exception in startLiveness: ${e.message}", e)
|
|
353
|
-
promise.reject("LIVENESS_ERROR", e.message)
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
@ReactMethod
|
|
358
|
-
fun startFaceCompare(
|
|
359
|
-
appKey: String,
|
|
360
|
-
transactionId: String,
|
|
361
|
-
selfieImage: String,
|
|
362
|
-
idImage: String,
|
|
363
|
-
promise: Promise
|
|
364
|
-
) {
|
|
365
|
-
try {
|
|
366
|
-
val currentActivity = reactApplicationContext.currentActivity
|
|
367
|
-
if (currentActivity == null) {
|
|
368
|
-
promise.reject("NO_ACTIVITY", "Activity not available")
|
|
369
|
-
return
|
|
370
|
-
}
|
|
371
|
-
val imageFile = File(selfieImage.replace("file://", ""))
|
|
372
|
-
if (!imageFile.exists()) {
|
|
373
|
-
promise.reject("FILE_NOT_FOUND", "Image file does not exist")
|
|
374
|
-
return
|
|
375
|
-
}
|
|
376
|
-
val idImageFile = base64ToImageFile(idImage)
|
|
377
|
-
|
|
378
|
-
val faceServiceConfig =
|
|
379
|
-
FaceServiceConfig(
|
|
380
|
-
appKey = appKey,
|
|
381
|
-
transactionId = transactionId,
|
|
382
|
-
selfieImage = imageFile,
|
|
383
|
-
idImage = idImageFile
|
|
384
|
-
)
|
|
385
|
-
val ekycConfig = EKYCConfigSDK(faceServiceConfig = faceServiceConfig)
|
|
386
|
-
SdkEkycFaceService.startEkyc(
|
|
387
|
-
ekycConfigSDK = ekycConfig,
|
|
388
|
-
callbackSuccess = { event, data ->
|
|
389
|
-
Log.d(TAG, "Face Compare Success - Event: $event, Data: $data")
|
|
390
|
-
val resultMap =
|
|
391
|
-
Arguments.createMap().apply {
|
|
392
|
-
putString("event", event.name)
|
|
393
|
-
putString("data", data.toString())
|
|
394
|
-
}
|
|
395
|
-
sendEvent("onFaceCompareSuccess", resultMap)
|
|
396
|
-
val promiseMap =
|
|
397
|
-
Arguments.createMap().apply {
|
|
398
|
-
putString("event", event.name)
|
|
399
|
-
putString("data", data.toString())
|
|
400
|
-
}
|
|
401
|
-
promise.resolve(promiseMap)
|
|
402
|
-
},
|
|
403
|
-
callbackError = { event, message ->
|
|
404
|
-
Log.e(TAG, "FaceService Error - Event: $event, Message: $message")
|
|
405
|
-
val errorMap =
|
|
406
|
-
Arguments.createMap().apply {
|
|
407
|
-
putString("event", event.name)
|
|
408
|
-
putString("message", message ?: "Unknown error")
|
|
409
|
-
}
|
|
410
|
-
sendEvent("onFaceCompareError", errorMap)
|
|
411
|
-
promise.reject(event.name, message ?: "Unknown FaceService error")
|
|
412
|
-
}
|
|
413
|
-
)
|
|
414
|
-
} catch (e: Exception) {
|
|
415
|
-
Log.e(TAG, "Exception in startFaceCompare: ${e.message}", e)
|
|
416
|
-
promise.reject("FACE_COMPARE_ERROR", e.message)
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
@ReactMethod
|
|
421
|
-
fun onResume() {
|
|
422
|
-
reactApplicationContext.currentActivity?.let { activity ->
|
|
423
|
-
activity.runOnUiThread { SdkEkycNfc.onResumeNfc(activity) }
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
@ReactMethod
|
|
428
|
-
fun onPause() {
|
|
429
|
-
reactApplicationContext.currentActivity?.let { activity ->
|
|
430
|
-
activity.runOnUiThread { SdkEkycNfc.onPauseNfc(activity) }
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
@ReactMethod
|
|
435
|
-
fun handleNewIntent() {
|
|
436
|
-
reactApplicationContext.currentActivity?.let { activity ->
|
|
437
|
-
activity.runOnUiThread { SdkEkycNfc.onNewIntentNfc(activity.intent) }
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
private fun base64ToImageFile(base64Image: String): File {
|
|
442
|
-
try {
|
|
443
|
-
// Remove data URI prefix if present (like "data:image/png;base64,")
|
|
444
|
-
var processedBase64 = base64Image
|
|
445
|
-
if (base64Image.contains(",")) {
|
|
446
|
-
processedBase64 = base64Image.split(",")[1]
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
// Decode base64 string to bytes
|
|
450
|
-
val bytes = Base64.decode(processedBase64, Base64.DEFAULT)
|
|
451
|
-
|
|
452
|
-
// Create a unique filename with timestamp
|
|
453
|
-
val timestamp = Date().time.toString()
|
|
454
|
-
val fileName = "image_$timestamp.jpg"
|
|
455
|
-
|
|
456
|
-
// Get temporary directory and create file path
|
|
457
|
-
val directory = reactApplicationContext.cacheDir
|
|
458
|
-
val filePath = "${directory.path}/$fileName"
|
|
459
|
-
|
|
460
|
-
// Write bytes to file
|
|
461
|
-
val imageFile = File(filePath)
|
|
462
|
-
FileOutputStream(imageFile).use { it.write(bytes) }
|
|
463
|
-
|
|
464
|
-
return imageFile
|
|
465
|
-
} catch (e: Exception) {
|
|
466
|
-
Log.e("LivenessFragment", "Error converting base64 to image file: ${e.message}", e)
|
|
467
|
-
// In case of error, create an empty file to avoid null returns
|
|
468
|
-
val errorFile = File(reactApplicationContext.cacheDir, "error_image_${Date().time}.jpg")
|
|
469
|
-
errorFile.createNewFile()
|
|
470
|
-
return errorFile
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
package com.sdkekycrn
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.ReactPackage
|
|
4
|
-
import com.facebook.react.bridge.NativeModule
|
|
5
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
-
import com.facebook.react.uimanager.ViewManager
|
|
7
|
-
|
|
8
|
-
class EKYCPackage : ReactPackage {
|
|
9
|
-
|
|
10
|
-
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
|
|
11
|
-
return listOf(EKYCModule(reactContext))
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
override fun createViewManagers(
|
|
15
|
-
reactContext: ReactApplicationContext
|
|
16
|
-
): List<ViewManager<*, *>> {
|
|
17
|
-
return emptyList()
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|