@regulaforensics/document-reader 9.4.707-rc → 9.4.709-beta
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/RNDocumentReader.podspec +2 -2
- package/android/build.gradle +2 -2
- package/android/cordova.gradle +2 -2
- package/android/src/main/java/com/regula/plugin/documentreader/JSONConstructor.kt +36 -0
- package/android/src/main/java/com/regula/plugin/documentreader/Main.kt +46 -43
- package/examples/capacitor/package.json +1 -1
- package/examples/ionic/package.json +1 -1
- package/examples/react_native/package.json +1 -1
- package/ios/RGLWJSONConstructor.h +4 -0
- package/ios/RGLWJSONConstructor.m +93 -47
- package/ios/RGLWMain.h +2 -4
- package/ios/RGLWMain.m +49 -13
- package/ios/RNDocumentReader.m +2 -0
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/test/json.tsx +11 -0
- package/test/package-lock.json +1 -1
- package/test/test.tsx +4 -2
- package/www/capacitor/config/RFIDConfig.js +14 -0
- package/www/capacitor/index.js +8 -6
- package/www/capacitor/internal/bridge.js +19 -1
- package/www/capacitor/rfid/CAProtocol.js +27 -0
- package/www/capacitor/rfid/PACEProtocol.js +24 -0
- package/www/cordova.js +152 -29
- package/www/react-native/config/RFIDConfig.js +14 -0
- package/www/react-native/index.js +8 -6
- package/www/react-native/internal/bridge.js +19 -1
- package/www/react-native/rfid/CAProtocol.js +27 -0
- package/www/react-native/rfid/PACEProtocol.js +24 -0
- package/www/types/config/RFIDConfig.d.ts +35 -3
- package/www/types/index.d.ts +3 -1
- package/www/types/rfid/CAProtocol.d.ts +6 -0
- package/www/types/rfid/PACEProtocol.d.ts +5 -0
package/RNDocumentReader.podspec
CHANGED
|
@@ -5,7 +5,7 @@ source = File.join(__dir__, 'ios')
|
|
|
5
5
|
|
|
6
6
|
Pod::Spec.new do |s|
|
|
7
7
|
s.name = 'RNDocumentReader'
|
|
8
|
-
s.version = '9.4.
|
|
8
|
+
s.version = '9.4.709-beta'
|
|
9
9
|
s.summary = package['description']
|
|
10
10
|
s.license = package['license']
|
|
11
11
|
|
|
@@ -16,6 +16,6 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.ios.deployment_target = '13.0'
|
|
17
17
|
s.source_files = 'ios/**/*.{h,m}'
|
|
18
18
|
s.exclude_files = [ 'ios/CVDDocumentReader.h', 'ios/CVDDocumentReader.m' ]
|
|
19
|
-
s.dependency '
|
|
19
|
+
s.dependency 'DocumentReader', '9.3.6137'
|
|
20
20
|
s.dependency 'React'
|
|
21
21
|
end
|
package/android/build.gradle
CHANGED
|
@@ -20,7 +20,7 @@ android {
|
|
|
20
20
|
rootProject.allprojects {
|
|
21
21
|
repositories {
|
|
22
22
|
maven {
|
|
23
|
-
url "https://maven.regulaforensics.com/RegulaDocumentReader
|
|
23
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -29,7 +29,7 @@ dependencies {
|
|
|
29
29
|
//noinspection GradleDynamicVersion
|
|
30
30
|
implementation 'com.facebook.react:react-native:+'
|
|
31
31
|
//noinspection GradleDependency
|
|
32
|
-
implementation('com.regula.documentreader:api:9.3.
|
|
32
|
+
implementation('com.regula.documentreader:api:9.3.12663'){
|
|
33
33
|
transitive = true
|
|
34
34
|
}
|
|
35
35
|
}
|
package/android/cordova.gradle
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
repositories {
|
|
2
2
|
maven {
|
|
3
|
-
url "https://maven.regulaforensics.com/RegulaDocumentReader
|
|
3
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader"
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
dependencies {
|
|
8
8
|
//noinspection GradleDependency
|
|
9
|
-
implementation('com.regula.documentreader:api:9.3.
|
|
9
|
+
implementation('com.regula.documentreader:api:9.3.12663'){
|
|
10
10
|
transitive = true
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -47,7 +47,9 @@ import com.regula.documentreader.api.params.mdl.DeviceRetrievalMethod
|
|
|
47
47
|
import com.regula.documentreader.api.params.mdl.DocumentRequest18013MDL
|
|
48
48
|
import com.regula.documentreader.api.params.mdl.DocumentRequestMDL
|
|
49
49
|
import com.regula.documentreader.api.params.mdl.NameSpaceMDL
|
|
50
|
+
import com.regula.documentreader.api.params.rfid.CaProtocol
|
|
50
51
|
import com.regula.documentreader.api.params.rfid.PKDCertificate
|
|
52
|
+
import com.regula.documentreader.api.params.rfid.PaceProtocol
|
|
51
53
|
import com.regula.documentreader.api.params.rfid.RFIDParams
|
|
52
54
|
import com.regula.documentreader.api.params.rfid.TccParams
|
|
53
55
|
import com.regula.documentreader.api.params.rfid.authorization.PAAttribute
|
|
@@ -2138,3 +2140,37 @@ fun generateFinalizeConfig(input: FinalizeConfig?) = input?.let {
|
|
|
2138
2140
|
"mdlSession" to it.getPrivateProperty("mdlSession"),
|
|
2139
2141
|
).toJson()
|
|
2140
2142
|
}
|
|
2143
|
+
|
|
2144
|
+
fun paceProtocolFromJSON(input: JSONObject?) = input?.let {
|
|
2145
|
+
PaceProtocol(
|
|
2146
|
+
it.getString("version"),
|
|
2147
|
+
it.getString("stdDomainParams"),
|
|
2148
|
+
it.getString("keyAlgorithm"),
|
|
2149
|
+
)
|
|
2150
|
+
}
|
|
2151
|
+
|
|
2152
|
+
fun generatePaceProtocol(input: PaceProtocol?) = input?.let {
|
|
2153
|
+
mapOf(
|
|
2154
|
+
"version" to it.version,
|
|
2155
|
+
"stdDomainParams" to it.stdDomainParams,
|
|
2156
|
+
"keyAlgorithm" to it.keyAlgorithm,
|
|
2157
|
+
).toJson()
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
fun caProtocolFromJSON(input: JSONObject?) = input?.let {
|
|
2161
|
+
CaProtocol(
|
|
2162
|
+
it.getString("version"),
|
|
2163
|
+
it.getString("scheme"),
|
|
2164
|
+
it.getString("keyAlgorithm"),
|
|
2165
|
+
it.getBoolean("chipIndividual"),
|
|
2166
|
+
)
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
fun generateCaProtocol(input: CaProtocol?) = input?.let {
|
|
2170
|
+
mapOf(
|
|
2171
|
+
"version" to it.version,
|
|
2172
|
+
"scheme" to it.scheme,
|
|
2173
|
+
"keyAlgorithm" to it.keyAlgorithm,
|
|
2174
|
+
"chipIndividual" to it.isChipIndividual,
|
|
2175
|
+
).toJson()
|
|
2176
|
+
}
|
|
@@ -19,13 +19,13 @@ import com.regula.documentreader.api.completions.IDocumentReaderInitCompletion
|
|
|
19
19
|
import com.regula.documentreader.api.completions.IDocumentReaderPrepareDbCompletion
|
|
20
20
|
import com.regula.documentreader.api.completions.IVideoEncoderCompletion
|
|
21
21
|
import com.regula.documentreader.api.completions.model.PrepareProgress
|
|
22
|
+
import com.regula.documentreader.api.completions.rfid.ICaProtocolCompletion
|
|
23
|
+
import com.regula.documentreader.api.completions.rfid.IPaceProtocolCompletion
|
|
22
24
|
import com.regula.documentreader.api.completions.rfid.IRfidPKDCertificateCompletion
|
|
23
25
|
import com.regula.documentreader.api.completions.rfid.IRfidReaderCompletion
|
|
24
26
|
import com.regula.documentreader.api.completions.rfid.IRfidReaderRequest
|
|
25
27
|
import com.regula.documentreader.api.completions.rfid.IRfidTASignatureCompletion
|
|
26
|
-
import com.regula.documentreader.api.completions.rfid.certificates.
|
|
27
|
-
import com.regula.documentreader.api.completions.rfid.certificates.IRfidTACertificates
|
|
28
|
-
import com.regula.documentreader.api.completions.rfid.certificates.IRfidTASignature
|
|
28
|
+
import com.regula.documentreader.api.completions.rfid.certificates.IRfidAccessControl
|
|
29
29
|
import com.regula.documentreader.api.enums.DocReaderAction
|
|
30
30
|
import com.regula.documentreader.api.enums.LCID
|
|
31
31
|
import com.regula.documentreader.api.enums.eImageQualityCheckType
|
|
@@ -39,6 +39,8 @@ import com.regula.documentreader.api.errors.DocReaderRfidException
|
|
|
39
39
|
import com.regula.documentreader.api.errors.DocumentReaderException
|
|
40
40
|
import com.regula.documentreader.api.internal.core.CoreScenarioUtil
|
|
41
41
|
import com.regula.documentreader.api.params.mdl.DataRetrieval
|
|
42
|
+
import com.regula.documentreader.api.params.rfid.CaProtocol
|
|
43
|
+
import com.regula.documentreader.api.params.rfid.PaceProtocol
|
|
42
44
|
import com.regula.documentreader.api.results.DocumentReaderNotification
|
|
43
45
|
import com.regula.documentreader.api.results.DocumentReaderResults
|
|
44
46
|
import com.regula.documentreader.api.results.DocumentReaderResults.fromRawResults
|
|
@@ -84,12 +86,14 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
|
|
|
84
86
|
"recognize" -> recognize(args(0))
|
|
85
87
|
"startNewPage" -> startNewPage()
|
|
86
88
|
"stopScanner" -> stopScanner()
|
|
87
|
-
"startRFIDReader" -> startRFIDReader(
|
|
88
|
-
"readRFID" -> readRFID(
|
|
89
|
+
"startRFIDReader" -> startRFIDReader(argsNullable(0))
|
|
90
|
+
"readRFID" -> readRFID(argsNullable(0))
|
|
89
91
|
"stopRFIDReader" -> stopRFIDReader()
|
|
90
92
|
"providePACertificates" -> providePACertificates(argsNullable(0))
|
|
91
93
|
"provideTACertificates" -> provideTACertificates(argsNullable(0))
|
|
92
94
|
"provideTASignature" -> provideTASignature(args(0))
|
|
95
|
+
"selectPACEProtocol" -> selectPACEProtocol(args(0))
|
|
96
|
+
"selectCAProtocol" -> selectCAProtocol(args(0))
|
|
93
97
|
"setTCCParams" -> setTCCParams(callback, args(0))
|
|
94
98
|
"addPKDCertificates" -> addPKDCertificates(args(0))
|
|
95
99
|
"clearPKDCertificates" -> clearPKDCertificates()
|
|
@@ -150,6 +154,8 @@ const val rfidOnRetryReadChipEvent = "rfidOnRetryReadChipEvent"
|
|
|
150
154
|
const val paCertificateCompletionEvent = "pa_certificate_completion"
|
|
151
155
|
const val taCertificateCompletionEvent = "ta_certificate_completion"
|
|
152
156
|
const val taSignatureCompletionEvent = "ta_signature_completion"
|
|
157
|
+
const val paceProtocolCompletionEvent = "paceProtocolCompletionEvent"
|
|
158
|
+
const val caProtocolCompletionEvent = "caProtocolCompletionEvent"
|
|
153
159
|
|
|
154
160
|
const val videoEncoderCompletionEvent = "video_encoder_completion"
|
|
155
161
|
const val onCustomButtonTappedEvent = "onCustomButtonTappedEvent"
|
|
@@ -248,22 +254,13 @@ fun startNewPage() = Instance().startNewPage()
|
|
|
248
254
|
|
|
249
255
|
fun stopScanner() = Instance().stopScanner(context)
|
|
250
256
|
|
|
251
|
-
fun startRFIDReader(
|
|
257
|
+
fun startRFIDReader(config: JSONObject?) {
|
|
252
258
|
stopBackgroundRFID()
|
|
253
|
-
|
|
254
|
-
onRequestPACertificates,
|
|
255
|
-
onRequestTACertificates,
|
|
256
|
-
onRequestTASignature
|
|
257
|
-
)
|
|
258
|
-
Instance().startRFIDReader(activity, rfidReaderCompletion, requestType.getRfidReaderRequest())
|
|
259
|
+
Instance().startRFIDReader(activity, rfidReaderCompletion, getRfidReaderRequest(config))
|
|
259
260
|
}
|
|
260
261
|
|
|
261
|
-
fun readRFID(
|
|
262
|
-
|
|
263
|
-
onRequestPACertificates,
|
|
264
|
-
onRequestTACertificates,
|
|
265
|
-
onRequestTASignature
|
|
266
|
-
)
|
|
262
|
+
fun readRFID(config: JSONObject?) {
|
|
263
|
+
rfidReaderRequest = getRfidReaderRequest(config)
|
|
267
264
|
startForegroundDispatch("readRFID")
|
|
268
265
|
}
|
|
269
266
|
|
|
@@ -284,6 +281,14 @@ fun provideTASignature(signature: String?) = taSignatureCompletion.onSignatureRe
|
|
|
284
281
|
signature.toByteArray()
|
|
285
282
|
)
|
|
286
283
|
|
|
284
|
+
fun selectPACEProtocol(protocol: JSONObject) = paceProtocolCompletion.onPaceProtocolSelected(
|
|
285
|
+
paceProtocolFromJSON(protocol)!!
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
fun selectCAProtocol(protocol: JSONObject) = caProtocolCompletion.onCaProtocolSelected(
|
|
289
|
+
caProtocolFromJSON(protocol)!!
|
|
290
|
+
)
|
|
291
|
+
|
|
287
292
|
fun setTCCParams(callback: Callback, params: JSONObject) {
|
|
288
293
|
Instance().setTccParams(tccParamsFromJSON(params)) { success, error ->
|
|
289
294
|
callback(generateSuccessCompletion(success, error))
|
|
@@ -545,49 +550,47 @@ fun initCompletion(callback: Callback) = IDocumentReaderInitCompletion { success
|
|
|
545
550
|
lateinit var paCertificateCompletion: IRfidPKDCertificateCompletion
|
|
546
551
|
lateinit var taCertificateCompletion: IRfidPKDCertificateCompletion
|
|
547
552
|
lateinit var taSignatureCompletion: IRfidTASignatureCompletion
|
|
553
|
+
lateinit var paceProtocolCompletion: IPaceProtocolCompletion
|
|
554
|
+
lateinit var caProtocolCompletion: ICaProtocolCompletion
|
|
555
|
+
|
|
556
|
+
var rfidReaderRequest = getRfidReaderRequest()
|
|
557
|
+
|
|
558
|
+
fun getRfidReaderRequest(config: JSONObject? = null): IRfidReaderRequest {
|
|
559
|
+
val result = IRfidReaderRequest()
|
|
560
|
+
if (config == null) return result
|
|
548
561
|
|
|
549
|
-
|
|
550
|
-
val doPACertificates: Boolean,
|
|
551
|
-
val doTACertificates: Boolean,
|
|
552
|
-
val doTASignature: Boolean
|
|
553
|
-
) {
|
|
554
|
-
private val onRequestPACertificates = IRfidPACertificates { serialNumber, issuer, completion ->
|
|
562
|
+
if (config.getBoolean("paCertificates")) result.setPACertificates { serialNumber, issuer, completion ->
|
|
555
563
|
paCertificateCompletion = completion
|
|
556
564
|
sendEvent(paCertificateCompletionEvent, generatePACertificateCompletion(serialNumber, issuer))
|
|
557
565
|
}
|
|
558
|
-
|
|
566
|
+
if (config.getBoolean("taCertificates")) result.setTACertificates { keyCAR, completion ->
|
|
559
567
|
taCertificateCompletion = completion
|
|
560
568
|
sendEvent(taCertificateCompletionEvent, keyCAR)
|
|
561
569
|
}
|
|
562
|
-
|
|
570
|
+
if (config.getBoolean("taSignature")) result.setTASignature { challenge, completion ->
|
|
563
571
|
taSignatureCompletion = completion
|
|
564
572
|
sendEvent(taSignatureCompletionEvent, generateTAChallenge(challenge))
|
|
565
573
|
}
|
|
574
|
+
if (config.getBoolean("paceProtocol") || config.getBoolean("caProtocol")) result.setRfidAccessControl(object : IRfidAccessControl {
|
|
575
|
+
override fun onRequestPaceProtocol(list: List<PaceProtocol?>, completion: IPaceProtocolCompletion) {
|
|
576
|
+
paceProtocolCompletion = completion
|
|
577
|
+
sendEvent(paceProtocolCompletionEvent, list.toJson(::generatePaceProtocol))
|
|
578
|
+
}
|
|
579
|
+
override fun onRequestCaProtocol(list: List<CaProtocol?>, completion: ICaProtocolCompletion) {
|
|
580
|
+
caProtocolCompletion = completion
|
|
581
|
+
sendEvent(caProtocolCompletionEvent, list.toJson(::generateCaProtocol))
|
|
582
|
+
}
|
|
583
|
+
})
|
|
566
584
|
|
|
567
|
-
|
|
568
|
-
!doPACertificates && !doTACertificates && doTASignature -> IRfidReaderRequest(onRequestTASignature)
|
|
569
|
-
!doPACertificates && doTACertificates && !doTASignature -> IRfidReaderRequest(onRequestTACertificates)
|
|
570
|
-
!doPACertificates && doTACertificates && doTASignature -> IRfidReaderRequest(onRequestTACertificates, onRequestTASignature)
|
|
571
|
-
doPACertificates && !doTACertificates && !doTASignature -> IRfidReaderRequest(onRequestPACertificates)
|
|
572
|
-
doPACertificates && !doTACertificates && doTASignature -> IRfidReaderRequest(onRequestPACertificates, onRequestTASignature)
|
|
573
|
-
doPACertificates && doTACertificates && !doTASignature -> IRfidReaderRequest(onRequestPACertificates, onRequestTACertificates)
|
|
574
|
-
doPACertificates && doTACertificates && doTASignature -> IRfidReaderRequest(onRequestPACertificates, onRequestTACertificates, onRequestTASignature)
|
|
575
|
-
else -> null
|
|
576
|
-
}
|
|
585
|
+
return result
|
|
577
586
|
}
|
|
578
587
|
|
|
579
|
-
var requestType = RfidReaderRequestType(
|
|
580
|
-
doPACertificates = false,
|
|
581
|
-
doTACertificates = false,
|
|
582
|
-
doTASignature = false
|
|
583
|
-
)
|
|
584
|
-
|
|
585
588
|
@Suppress("DEPRECATION", "MissingPermission")
|
|
586
589
|
fun newIntent(intent: Intent): Boolean {
|
|
587
590
|
if (intent.action != NfcAdapter.ACTION_TECH_DISCOVERED) return false
|
|
588
591
|
val isoDep = IsoDep.get(intent.getParcelableExtra(NfcAdapter.EXTRA_TAG))
|
|
589
592
|
when (nfcFunction) {
|
|
590
|
-
"readRFID" -> Instance().readRFID(isoDep, rfidReaderCompletion,
|
|
593
|
+
"readRFID" -> Instance().readRFID(isoDep, rfidReaderCompletion, rfidReaderRequest)
|
|
591
594
|
"engageDeviceNFC" -> Instance().engageDeviceNFC(isoDep) { v1, v2 -> engageDeviceNFCCallback(generateDeviceEngagementCompletion(v1, v2)) }
|
|
592
595
|
"retrieveDataNFC" -> Instance().retrieveDataNFC(isoDep, retrieveDataNFCProp) { v1, v2, v3 -> retrieveDataNFCCallback(generateCompletion(v1, v2, v3)) }
|
|
593
596
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"android": "scripts/android.sh"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@regulaforensics/document-reader": "9.4.
|
|
9
|
+
"@regulaforensics/document-reader": "9.4.709-beta",
|
|
10
10
|
"@regulaforensics/document-reader-core-fullauthrfid": "9.3.1817",
|
|
11
11
|
"@regulaforensics/document-reader-btdevice": "9.1.35",
|
|
12
12
|
"@awesome-cordova-plugins/file": "^8.1.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@ionic/cordova-builders": "^12.3.0",
|
|
19
19
|
"@awesome-cordova-plugins/camera": "^8.1.0",
|
|
20
20
|
"@awesome-cordova-plugins/file": "^8.1.0",
|
|
21
|
-
"@regulaforensics/document-reader": "9.4.
|
|
21
|
+
"@regulaforensics/document-reader": "9.4.709-beta",
|
|
22
22
|
"@regulaforensics/document-reader-core-fullauthrfid": "9.3.1817",
|
|
23
23
|
"@regulaforensics/document-reader-btdevice": "9.1.35",
|
|
24
24
|
"cordova-android": "^14.0.1",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"start": "expo start"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@regulaforensics/document-reader": "9.4.
|
|
11
|
+
"@regulaforensics/document-reader": "9.4.709-beta",
|
|
12
12
|
"@regulaforensics/document-reader-core-fullauthrfid": "9.3.1817",
|
|
13
13
|
"@regulaforensics/document-reader-btdevice": "9.1.35",
|
|
14
14
|
"react-native": "^0.81.4",
|
|
@@ -198,6 +198,10 @@
|
|
|
198
198
|
+(NSDictionary* _Nullable)generateDocumentRequestMDL:(RGLDocumentRequestMDL* _Nullable)input;
|
|
199
199
|
+(RGLFinalizeConfig* _Nullable)finalizeConfigFromJson:(NSDictionary* _Nullable)input;
|
|
200
200
|
+(NSDictionary* _Nullable)generateFinalizeConfig:(RGLFinalizeConfig* _Nullable)input;
|
|
201
|
+
+(RGLRFIDAccessControlPACE* _Nullable)paceProtocolFromJson:(NSDictionary* _Nullable)input;
|
|
202
|
+
+(NSDictionary* _Nullable)generatePaceProtocol:(RGLRFIDAccessControlPACE* _Nullable)input;
|
|
203
|
+
+(RGLRFIDAccessControlCA* _Nullable)caProtocolFromJson:(NSDictionary* _Nullable)input;
|
|
204
|
+
+(NSDictionary* _Nullable)generateCaProtocol:(RGLRFIDAccessControlCA* _Nullable)input;
|
|
201
205
|
|
|
202
206
|
@end
|
|
203
207
|
|
|
@@ -61,22 +61,22 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
61
61
|
+(NSDictionary*)generateError:(NSError*)input {
|
|
62
62
|
if(input == nil) return nil;
|
|
63
63
|
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
result[@"code"] = [NSNumber numberWithInteger:input.code];
|
|
66
66
|
result[@"message"] = input.localizedDescription;
|
|
67
|
-
|
|
67
|
+
|
|
68
68
|
return result;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
+(NSString*)generateCompletion:(NSNumber*)action :(RGLDocumentReaderResults*)results :(NSError*)error {
|
|
72
72
|
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
73
73
|
int actionInt = [action intValue];
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
if(actionInt == 0 || actionInt == 2 || actionInt == 3 || actionInt == 4 || actionInt == 6)
|
|
76
76
|
result[@"results"] = [self generateDocumentReaderResults:results];
|
|
77
77
|
result[@"action"] = action;
|
|
78
78
|
result[@"error"] = [self generateError:error];
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
return [RGLWJSONConstructor dictToString: result];
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -100,11 +100,11 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
100
100
|
|
|
101
101
|
+(NSString*)generateFinalizePackageCompletion:(NSNumber*)action :(RGLTransactionInfo*)info :(NSError*)error {
|
|
102
102
|
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
103
|
-
|
|
103
|
+
|
|
104
104
|
result[@"action"] = action;
|
|
105
105
|
result[@"info"] = [self generateTransactionInfo:info];
|
|
106
106
|
result[@"error"] = [self generateError:error];
|
|
107
|
-
|
|
107
|
+
|
|
108
108
|
return [RGLWJSONConstructor dictToString: result];
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -158,12 +158,12 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
158
158
|
if (!input) return nil;
|
|
159
159
|
if (!input[@"license"]) return nil;
|
|
160
160
|
RGLConfig *config = [[RGLConfig alloc] initWithLicenseData:[self base64Decode: input[@"license"]]];
|
|
161
|
-
|
|
161
|
+
|
|
162
162
|
if (input[@"databasePath"]) config.databasePath = input[@"databasePath"];
|
|
163
163
|
if (input[@"licenseUpdateTimeout"]) config.licenseUpdateTimeout = input[@"licenseUpdateTimeout"];
|
|
164
164
|
if (input[@"licenseUpdate"]) config.licenseUpdateCheck = [input[@"licenseUpdate"] boolValue];
|
|
165
165
|
if (input[@"delayedNNLoad"]) config.delayedNNLoadEnabled = [input[@"delayedNNLoad"] boolValue];
|
|
166
|
-
|
|
166
|
+
|
|
167
167
|
return config;
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -176,19 +176,19 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
176
176
|
result[@"licenseUpdateTimeout"] = input.licenseUpdateTimeout;
|
|
177
177
|
result[@"licenseUpdate"] = @(input.licenseUpdateCheck);
|
|
178
178
|
result[@"delayedNNLoad"] = @(input.delayedNNLoadEnabled);
|
|
179
|
-
|
|
179
|
+
|
|
180
180
|
return result;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
+(RGLBleConfig*)bleDeviceConfigFromJson:(NSDictionary*)input :(RGLBluetooth*)bluetooth {
|
|
184
184
|
if (!input) return nil;
|
|
185
185
|
RGLBleConfig *config = [[RGLBleConfig alloc] initWithBluetooth:bluetooth];
|
|
186
|
-
|
|
186
|
+
|
|
187
187
|
if (input[@"databasePath"]) config.databasePath = input[@"databasePath"];
|
|
188
188
|
if (input[@"licenseUpdateTimeout"]) config.licenseUpdateTimeout = input[@"licenseUpdateTimeout"];
|
|
189
189
|
if (input[@"licenseUpdate"]) config.licenseUpdateCheck = [input[@"licenseUpdate"] boolValue];
|
|
190
190
|
if (input[@"delayedNNLoad"]) config.delayedNNLoadEnabled = [input[@"delayedNNLoad"] boolValue];
|
|
191
|
-
|
|
191
|
+
|
|
192
192
|
return config;
|
|
193
193
|
}
|
|
194
194
|
|
|
@@ -223,7 +223,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
223
223
|
RGLRecognizeConfig *config = [RGLRecognizeConfig alloc];
|
|
224
224
|
if (input[@"scenario"]) config = [config initWithScenario:input[@"scenario"]];
|
|
225
225
|
else config = [config initWithOnlineProcessingConfig:[self onlineProcessingConfigFromJson:input[@"onlineProcessingConfig"]]];
|
|
226
|
-
|
|
226
|
+
|
|
227
227
|
if (input[@"image"]) config.image = [RGLWJSONConstructor imageWithBase64:input[@"image"]];
|
|
228
228
|
if (input[@"data"]) config.imageData = [RGLWJSONConstructor base64Decode:input[@"data"]];
|
|
229
229
|
if (input[@"images"]) {
|
|
@@ -238,13 +238,13 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
238
238
|
[imageInputs addObject:[RGLWJSONConstructor imageInputFromJson: imageInput]];
|
|
239
239
|
config.imageInputs = imageInputs;
|
|
240
240
|
}
|
|
241
|
-
|
|
241
|
+
|
|
242
242
|
if (input[@"scenario"]) config.scenario = input[@"scenario"];
|
|
243
243
|
if (input[@"livePortrait"]) config.livePortrait = [self imageWithBase64:input[@"livePortrait"]];
|
|
244
244
|
if (input[@"extPortrait"]) config.extPortrait = [self imageWithBase64:input[@"extPortrait"]];
|
|
245
245
|
if (input[@"oneShotIdentification"]) config.oneShotIdentification = input[@"oneShotIdentification"];
|
|
246
246
|
if (input[@"dtc"]) config.dtc = [RGLWJSONConstructor base64Decode:input[@"dtc"]];
|
|
247
|
-
|
|
247
|
+
|
|
248
248
|
return config;
|
|
249
249
|
}
|
|
250
250
|
|
|
@@ -533,10 +533,10 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
533
533
|
|
|
534
534
|
+(RGLRFIDParams*)rfidParamsFromJson:(NSDictionary*)input {
|
|
535
535
|
RGLRFIDParams* result = [RGLRFIDParams new];
|
|
536
|
-
|
|
536
|
+
|
|
537
537
|
if([input valueForKey:@"paIgnoreNotificationCodes"] != nil)
|
|
538
538
|
result.paIgnoreNotificationCodes = [input valueForKey:@"paIgnoreNotificationCodes"];
|
|
539
|
-
|
|
539
|
+
|
|
540
540
|
return result;
|
|
541
541
|
}
|
|
542
542
|
|
|
@@ -561,7 +561,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
561
561
|
|
|
562
562
|
+(RGLFaceAPIParams*)faceAPIParamsFromJson:(NSDictionary*)input {
|
|
563
563
|
RGLFaceAPIParams* result = [RGLFaceAPIParams defaultParams];
|
|
564
|
-
|
|
564
|
+
|
|
565
565
|
if([input valueForKey:@"url"] != nil)
|
|
566
566
|
result.url = [input valueForKey:@"url"];
|
|
567
567
|
if([input valueForKey:@"mode"] != nil)
|
|
@@ -578,7 +578,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
578
578
|
result.proxyPassword = [input valueForKey:@"proxyPassword"];
|
|
579
579
|
if([input valueForKey:@"proxyType"] != nil)
|
|
580
580
|
result.proxyType = [input valueForKey:@"proxyType"];
|
|
581
|
-
|
|
581
|
+
|
|
582
582
|
return result;
|
|
583
583
|
}
|
|
584
584
|
|
|
@@ -600,14 +600,14 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
600
600
|
|
|
601
601
|
+(RGLFaceAPISearchParams*)faceAPISearchParamsFromJson:(NSDictionary*)input {
|
|
602
602
|
RGLFaceAPISearchParams* result = [RGLFaceAPISearchParams new];
|
|
603
|
-
|
|
603
|
+
|
|
604
604
|
if([input valueForKey:@"limit"] != nil)
|
|
605
605
|
result.limit = [input valueForKey:@"limit"];
|
|
606
606
|
if([input valueForKey:@"threshold"] != nil)
|
|
607
607
|
result.threshold = [input valueForKey:@"threshold"];
|
|
608
608
|
if([input valueForKey:@"groupIds"] != nil)
|
|
609
609
|
result.groupIDs = [input valueForKey:@"groupIds"];
|
|
610
|
-
|
|
610
|
+
|
|
611
611
|
return result;
|
|
612
612
|
}
|
|
613
613
|
|
|
@@ -1055,7 +1055,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
1055
1055
|
result[@"notificationCode"] = @(input.code & -0x10000);
|
|
1056
1056
|
result[@"dataFileType"] = @((int)input.attachment);
|
|
1057
1057
|
result[@"progress"] = @((int)input.value);
|
|
1058
|
-
|
|
1058
|
+
|
|
1059
1059
|
return [RGLWJSONConstructor dictToString: result];
|
|
1060
1060
|
}
|
|
1061
1061
|
|
|
@@ -1714,10 +1714,10 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
1714
1714
|
+(NSDictionary*)generateDataField:(RGLDataField*)input {
|
|
1715
1715
|
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
1716
1716
|
if(input == nil) return nil;
|
|
1717
|
-
|
|
1717
|
+
|
|
1718
1718
|
result[@"data"] = input.data;
|
|
1719
1719
|
result[@"fieldType"] = @(input.fieldType);
|
|
1720
|
-
|
|
1720
|
+
|
|
1721
1721
|
return result;
|
|
1722
1722
|
}
|
|
1723
1723
|
|
|
@@ -1835,7 +1835,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
1835
1835
|
for(NSDictionary* item in [input valueForKey:@"checks"])
|
|
1836
1836
|
[array addObject:[self authenticityCheckFromJson:item]];
|
|
1837
1837
|
RGLDocumentReaderAuthenticityResult* result = [[RGLDocumentReaderAuthenticityResult alloc]
|
|
1838
|
-
|
|
1838
|
+
initWithAuthenticityChecks:array];
|
|
1839
1839
|
if (input[@"status"]) [result setValue:input[@"status"] forKey:@"_security"];
|
|
1840
1840
|
return result;
|
|
1841
1841
|
}
|
|
@@ -2434,7 +2434,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
2434
2434
|
for (NSString* key in map) {
|
|
2435
2435
|
[result addField:key intentToRetain:[map[key] integerValue]];
|
|
2436
2436
|
}
|
|
2437
|
-
|
|
2437
|
+
|
|
2438
2438
|
return result;
|
|
2439
2439
|
|
|
2440
2440
|
}
|
|
@@ -2459,7 +2459,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
2459
2459
|
[nameSpaces addObject:[self nameSpaceMDLFromJson: item]];
|
|
2460
2460
|
}
|
|
2461
2461
|
[result setValue:nameSpaces forKey:@"nameSpaces"];
|
|
2462
|
-
|
|
2462
|
+
|
|
2463
2463
|
return result;
|
|
2464
2464
|
|
|
2465
2465
|
}
|
|
@@ -2632,7 +2632,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
2632
2632
|
if (input[@"video"]) result.video = [input[@"video"] boolValue];
|
|
2633
2633
|
if (input[@"rfidSession"]) result.rfidSession = [input[@"rfidSession"] boolValue];
|
|
2634
2634
|
if (input[@"mdlSession"]) result.mdlSession = [input[@"mdlSession"] boolValue];
|
|
2635
|
-
|
|
2635
|
+
|
|
2636
2636
|
return result;
|
|
2637
2637
|
}
|
|
2638
2638
|
|
|
@@ -2648,6 +2648,52 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
2648
2648
|
return result;
|
|
2649
2649
|
}
|
|
2650
2650
|
|
|
2651
|
+
+(RGLRFIDAccessControlPACE*)paceProtocolFromJson:(NSDictionary*)input {
|
|
2652
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
2653
|
+
|
|
2654
|
+
json[@"Version"] = input[@"version"];
|
|
2655
|
+
json[@"StdDomainParams"] = input[@"stdDomainParams"];
|
|
2656
|
+
json[@"KeyAlgorithm"] = input[@"keyAlgorithm"];
|
|
2657
|
+
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
|
|
2658
|
+
return [[RGLRFIDAccessControlPACE alloc] performSelector:NSSelectorFromString(@"initWithJSON:") withObject:json];
|
|
2659
|
+
#pragma clang diagnostic pop
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
+(NSDictionary*)generatePaceProtocol:(RGLRFIDAccessControlPACE*)input {
|
|
2663
|
+
if(input == nil) return nil;
|
|
2664
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2665
|
+
|
|
2666
|
+
result[@"version"] = [NSString stringWithFormat:@"%ld", (long)input.version];
|
|
2667
|
+
result[@"stdDomainParams"] = input.stdDomainParams;
|
|
2668
|
+
result[@"keyAlgorithm"] = input.keyAlgorithm;
|
|
2669
|
+
|
|
2670
|
+
return result;
|
|
2671
|
+
}
|
|
2672
|
+
|
|
2673
|
+
+(RGLRFIDAccessControlCA*)caProtocolFromJson:(NSDictionary*)input {
|
|
2674
|
+
NSMutableDictionary* json = input.mutableCopy;
|
|
2675
|
+
|
|
2676
|
+
json[@"Version"] = input[@"version"];
|
|
2677
|
+
json[@"Scheme"] = input[@"scheme"];
|
|
2678
|
+
json[@"KeyAlgorithm"] = input[@"keyAlgorithm"];
|
|
2679
|
+
json[@"ChipIndividual"] = input[@"chipIndividual"];
|
|
2680
|
+
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
|
|
2681
|
+
return [[RGLRFIDAccessControlCA alloc] performSelector:NSSelectorFromString(@"initWithJSON:") withObject:json];
|
|
2682
|
+
#pragma clang diagnostic pop
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
+(NSDictionary*)generateCaProtocol:(RGLRFIDAccessControlCA*)input {
|
|
2686
|
+
if(input == nil) return nil;
|
|
2687
|
+
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
2688
|
+
|
|
2689
|
+
result[@"version"] = [NSString stringWithFormat:@"%ld", (long)input.version];
|
|
2690
|
+
result[@"scheme"] = input.scheme;
|
|
2691
|
+
result[@"keyAlgorithm"] = input.keyAlgorithm;
|
|
2692
|
+
result[@"chipIndividual"] = [NSNumber numberWithBool: input.chipIndividual];
|
|
2693
|
+
|
|
2694
|
+
return result;
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2651
2697
|
+(RGLDocumentReaderResults*)documentReaderResultsFromJson:(NSDictionary*)input {
|
|
2652
2698
|
NSMutableArray<RGLDocumentReaderDocumentType*>* documentType = [NSMutableArray new];
|
|
2653
2699
|
for(NSDictionary* item in [input valueForKey:@"documentType"]){
|
|
@@ -2671,26 +2717,26 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
2671
2717
|
}
|
|
2672
2718
|
|
|
2673
2719
|
RGLDocumentReaderResults* result = [[RGLDocumentReaderResults alloc]
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2720
|
+
initWithDocumentTypes:documentType
|
|
2721
|
+
textResult:[self documentReaderTextResultFromJson: [input valueForKey:@"textResult"]]
|
|
2722
|
+
graphicResult:[self documentReaderGraphicResultFromJson: [input valueForKey:@"graphicResult"]]
|
|
2723
|
+
rawResult:[input valueForKey:@"rawResult"]
|
|
2724
|
+
documentPosition:documentPosition
|
|
2725
|
+
barcodePosition:barcodePosition
|
|
2726
|
+
mrzPosition:mrzPosition
|
|
2727
|
+
imageQualityGroup:imageQuality
|
|
2728
|
+
authenticityResults:[self documentReaderAuthenticityResultFromJson: [input valueForKey:@"authenticityResult"]]
|
|
2729
|
+
rfidSessionData:[self rfidSessionDataFromJson: [input valueForKey:@"rfidSessionData"]]
|
|
2730
|
+
chipPage:[[input valueForKey:@"chipPage"] integerValue]
|
|
2731
|
+
barcodeResult:[self documentReaderBarcodeResultFromJson: [input valueForKey:@"barcodeResult"]]
|
|
2732
|
+
vdsncData:[self vdsncDataFromJson: [input valueForKey:@"vdsncData"]]
|
|
2733
|
+
vdsData:[self vdsDataFromJson: [input valueForKey:@"vdsData"]]
|
|
2734
|
+
status:[self documentReaderResultsStatusFromJson: [input valueForKey:@"status"]]
|
|
2735
|
+
processingFinished:[[input valueForKey:@"processingFinishedStatus"] integerValue]
|
|
2736
|
+
morePagesAvailable:[[input valueForKey:@"morePagesAvailable"] integerValue]
|
|
2737
|
+
elapsedTime:[[input valueForKey:@"elapsedTime"] integerValue]
|
|
2738
|
+
elapsedTimeRFID:[[input valueForKey:@"elapsedTimeRFID"] integerValue]
|
|
2739
|
+
transactionInfo:[self transactionInfoFromJson:[input valueForKey:@"transactionInfo"]]];
|
|
2694
2740
|
|
|
2695
2741
|
[result setValue:[RGLWJSONConstructor base64Decode:input[@"dtcData"]] forKey:@"dtcData"];
|
|
2696
2742
|
[result setValue:input[@"bsiTr03135Results"] forKey:@"bsiTr03135Results"];
|
package/ios/RGLWMain.h
CHANGED
|
@@ -18,10 +18,6 @@ extern UIViewController*_Nonnull(^ _Nonnull RGLWRootViewController)(void);
|
|
|
18
18
|
:(RGLWCallback _Nonnull)callback
|
|
19
19
|
:(RGLWEventSender _Nonnull)eventSender;
|
|
20
20
|
|
|
21
|
-
@property NSNumber* _Nonnull doRequestPACertificates;
|
|
22
|
-
@property NSNumber* _Nonnull doRequestTACertificates;
|
|
23
|
-
@property NSNumber* _Nonnull doRequestTASignature;
|
|
24
|
-
|
|
25
21
|
@end
|
|
26
22
|
|
|
27
23
|
static NSString* _Nonnull completionEvent = @"completion";
|
|
@@ -32,5 +28,7 @@ static NSString* _Nonnull rfidOnRetryReadChipEvent = @"rfidOnRetryReadChipEvent"
|
|
|
32
28
|
static NSString* _Nonnull paCertificateCompletionEvent = @"pa_certificate_completion";
|
|
33
29
|
static NSString* _Nonnull taCertificateCompletionEvent = @"ta_certificate_completion";
|
|
34
30
|
static NSString* _Nonnull taSignatureCompletionEvent = @"ta_signature_completion";
|
|
31
|
+
static NSString* _Nonnull paceProtocolCompletionEvent = @"paceProtocolCompletionEvent";
|
|
32
|
+
static NSString* _Nonnull caProtocolCompletionEvent = @"caProtocolCompletionEvent";
|
|
35
33
|
static NSString* _Nonnull drVideoEncoderCompletionEvent = @"video_encoder_completion";
|
|
36
34
|
static NSString* _Nonnull drOnCustomButtonTappedEvent = @"onCustomButtonTappedEvent";
|