@regulaforensics/document-reader 9.9.1244-rc → 9.9.1313-rc
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/Package.swift +2 -2
- package/android/build.gradle.kts +1 -1
- package/android/cordova.gradle.kts +1 -1
- package/android/src/main/kotlin/com/regula/plugin/document/reader/Config.kt +2 -0
- package/android/src/main/kotlin/com/regula/plugin/document/reader/JSONConstructor.kt +10 -18
- package/android/src/main/kotlin/com/regula/plugin/document/reader/Main.kt +14 -4
- package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +4 -4
- package/examples/capacitor/package-lock.json +113 -661
- package/examples/capacitor/package.json +6 -5
- package/examples/ionic/config.xml +1 -1
- package/examples/ionic/package-lock.json +4315 -925
- package/examples/ionic/package.json +27 -5
- package/examples/ionic/scripts/ios.sh +3 -1
- package/examples/react_native/README.md +1 -1
- package/examples/react_native/app.config.ts +3 -0
- package/examples/react_native/index.tsx +52 -22
- package/examples/react_native/metro.config.js +1 -3
- package/examples/react_native/package-lock.json +1217 -1579
- package/examples/react_native/package.json +20 -19
- package/examples/react_native/scripts/android.sh +1 -8
- package/examples/react_native/scripts/ios.sh +3 -11
- package/examples/react_native/scripts/setup.sh +1 -5
- package/examples/react_native/scripts/withoutMetroServer.js +89 -0
- package/ios/RGLWConfig.m +2 -0
- package/ios/RGLWJSONConstructor.m +1 -0
- package/ios/RGLWMain.h +1 -0
- package/ios/RGLWMain.m +16 -0
- package/ios/RNDocumentReader.m +1 -0
- package/package.json +1 -1
- package/plugin.xml +3 -3
- package/react-native-document-reader.podspec +3 -3
- package/test/json.tsx +6 -6
- package/test/package-lock.json +2 -5
- package/test/test.tsx +259 -261
- package/www/capacitor/config/RFIDConfig.js +2 -0
- package/www/capacitor/index.js +2 -0
- package/www/capacitor/internal/bridge.js +8 -0
- package/www/capacitor/params/process_params/AuthenticityPropertiesParams.js +8 -0
- package/www/capacitor/results/authenticity/CheckDiagnose.js +2 -0
- package/www/capacitor/results/authenticity/SecurityFeatureType.js +1 -0
- package/www/capacitor/results/visual_results/FieldType.js +2 -0
- package/www/cordova.js +25 -0
- package/www/react-native/config/RFIDConfig.js +2 -0
- package/www/react-native/index.js +2 -0
- package/www/react-native/internal/bridge.js +8 -0
- package/www/react-native/params/process_params/AuthenticityPropertiesParams.js +8 -0
- package/www/react-native/results/authenticity/CheckDiagnose.js +2 -0
- package/www/react-native/results/authenticity/SecurityFeatureType.js +1 -0
- package/www/react-native/results/visual_results/FieldType.js +2 -0
- package/www/types/config/RFIDConfig.d.ts +15 -0
- package/www/types/config/RecognizeConfig.d.ts +2 -2
- package/www/types/params/process_params/AuthenticityPropertiesParams.d.ts +2 -0
- package/www/types/results/authenticity/CheckDiagnose.d.ts +2 -0
- package/www/types/results/authenticity/SecurityFeatureType.d.ts +1 -0
- package/www/types/results/visual_results/FieldType.d.ts +2 -0
- package/examples/react_native/index.html +0 -12
package/Package.swift
CHANGED
|
@@ -4,13 +4,13 @@ import PackageDescription
|
|
|
4
4
|
|
|
5
5
|
let package = Package(
|
|
6
6
|
name: "@regulaforensics/document-reader",
|
|
7
|
-
platforms: [.iOS(.
|
|
7
|
+
platforms: [.iOS(.v16)],
|
|
8
8
|
products: [.library(name: "@regulaforensics/document-reader", targets: ["@regulaforensics/document-reader"])],
|
|
9
9
|
dependencies: [
|
|
10
10
|
.package(url: "https://github.com/apache/cordova-ios.git", branch: "master"),
|
|
11
11
|
.package(
|
|
12
12
|
url: "https://github.com/regulaforensics/DocumentReader-Swift-Package",
|
|
13
|
-
exact: "9.10.
|
|
13
|
+
exact: "9.10.7353-rc"
|
|
14
14
|
)
|
|
15
15
|
],
|
|
16
16
|
targets: [
|
package/android/build.gradle.kts
CHANGED
|
@@ -31,7 +31,7 @@ dependencies {
|
|
|
31
31
|
//noinspection GradleDynamicVersion
|
|
32
32
|
implementation("com.facebook.react:react-native:+")
|
|
33
33
|
//noinspection GradleDependency
|
|
34
|
-
implementation("com.regula.documentreader:api:9.
|
|
34
|
+
implementation("com.regula.documentreader:api:9.9.13741") {
|
|
35
35
|
isTransitive = true
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -789,12 +789,14 @@ fun getLivenessParams(input: LivenessParams?) = input?.let {
|
|
|
789
789
|
fun setAuthenticityPropertiesParams(input: AuthenticityPropertiesParams, opts: JSONObject) = opts.forEach { k, v ->
|
|
790
790
|
when (k) {
|
|
791
791
|
"checkHoldersSignature" -> input.checkHoldersSignature = v as Boolean
|
|
792
|
+
"checkDocumentDamage" -> input.checkDocumentDamage = v as Boolean
|
|
792
793
|
}
|
|
793
794
|
}
|
|
794
795
|
|
|
795
796
|
fun getAuthenticityPropertiesParams(input: AuthenticityPropertiesParams?) = input?.let {
|
|
796
797
|
mapOf(
|
|
797
798
|
"checkHoldersSignature" to it.checkHoldersSignature,
|
|
799
|
+
"checkDocumentDamage" to it.checkDocumentDamage,
|
|
798
800
|
).toJson()
|
|
799
801
|
}
|
|
800
802
|
|
|
@@ -260,8 +260,10 @@ fun generateScannerConfig(input: ScannerConfig?) = input?.let {
|
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
fun recognizeConfigFromJSON(input: JSONObject) = input.let {
|
|
263
|
-
val builder =
|
|
264
|
-
|
|
263
|
+
val builder =
|
|
264
|
+
if (it.has("scenario") && it.has("onlineProcessingConfig")) RecognizeConfig.Builder(it.getString("scenario"), onlineProcessingConfigFromJSON(it.getJSONObject("onlineProcessingConfig"))!!)
|
|
265
|
+
else if (it.has("scenario")) RecognizeConfig.Builder(it.getString("scenario"))
|
|
266
|
+
else RecognizeConfig.Builder(onlineProcessingConfigFromJSON(it.getJSONObject("onlineProcessingConfig"))!!)
|
|
265
267
|
|
|
266
268
|
if (it.has("oneShotIdentification")) builder.setOneShotIdentification(it.getBoolean("oneShotIdentification"))
|
|
267
269
|
if (it.has("dtc")) builder.setDTC(it.getString("dtc").toByteArray()!!)
|
|
@@ -560,25 +562,15 @@ fun generateOcclusionCheckParams(input: OcclusionCheckParams?) = input?.let {
|
|
|
560
562
|
|
|
561
563
|
@SuppressLint("DiscouragedApi")
|
|
562
564
|
fun typefaceFromJSON(it: JSONObject): Pair<Typeface?, Int?> {
|
|
565
|
+
val name = it.getString("name")
|
|
563
566
|
val font = try {
|
|
564
567
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
|
565
|
-
context.resources.getFont(
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
"font",
|
|
569
|
-
context.packageName
|
|
570
|
-
)
|
|
571
|
-
)
|
|
572
|
-
else throw Exception("")
|
|
573
|
-
} catch (_: Exception) {
|
|
574
|
-
Typeface.create(
|
|
575
|
-
it.getString("name"),
|
|
576
|
-
it.optInt("style", Typeface.NORMAL)
|
|
577
|
-
)
|
|
578
|
-
}
|
|
568
|
+
context.resources.getFont(context.resources.getIdentifier(name, "font", context.packageName))
|
|
569
|
+
else null
|
|
570
|
+
} catch (_: Exception) { null }
|
|
579
571
|
return Pair(
|
|
580
|
-
font,
|
|
581
|
-
|
|
572
|
+
font ?: Typeface.create(name, it.optInt("style", Typeface.NORMAL)),
|
|
573
|
+
it.getIntOrNull("size")
|
|
582
574
|
)
|
|
583
575
|
}
|
|
584
576
|
|
|
@@ -21,6 +21,7 @@ import com.regula.documentreader.api.completions.IVideoEncoderCompletion
|
|
|
21
21
|
import com.regula.documentreader.api.completions.model.PrepareProgress
|
|
22
22
|
import com.regula.documentreader.api.completions.rfid.ICaProtocolCompletion
|
|
23
23
|
import com.regula.documentreader.api.completions.rfid.IPaceProtocolCompletion
|
|
24
|
+
import com.regula.documentreader.api.completions.rfid.IRfidAaChallengeCompletion
|
|
24
25
|
import com.regula.documentreader.api.completions.rfid.IRfidPKDCertificateCompletion
|
|
25
26
|
import com.regula.documentreader.api.completions.rfid.IRfidReaderCompletion
|
|
26
27
|
import com.regula.documentreader.api.completions.rfid.IRfidReaderRequest
|
|
@@ -92,6 +93,7 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
|
|
|
92
93
|
"providePACertificates" -> providePACertificates(argsNullable(0))
|
|
93
94
|
"provideTACertificates" -> provideTACertificates(argsNullable(0))
|
|
94
95
|
"provideTASignature" -> provideTASignature(args(0))
|
|
96
|
+
"provideAAChallenge" -> provideAAChallenge(args(0))
|
|
95
97
|
"selectPACEProtocol" -> selectPACEProtocol(args(0))
|
|
96
98
|
"selectCAProtocol" -> selectCAProtocol(args(0))
|
|
97
99
|
"setTCCParams" -> setTCCParams(callback, args(0))
|
|
@@ -154,6 +156,7 @@ const val rfidOnRetryReadChipEvent = "rfidOnRetryReadChipEvent"
|
|
|
154
156
|
const val paCertificateCompletionEvent = "pa_certificate_completion"
|
|
155
157
|
const val taCertificateCompletionEvent = "ta_certificate_completion"
|
|
156
158
|
const val taSignatureCompletionEvent = "ta_signature_completion"
|
|
159
|
+
const val aaChallengeCompletionEvent = "aaChallengeCompletionEvent"
|
|
157
160
|
const val paceProtocolCompletionEvent = "paceProtocolCompletionEvent"
|
|
158
161
|
const val caProtocolCompletionEvent = "caProtocolCompletionEvent"
|
|
159
162
|
|
|
@@ -281,6 +284,8 @@ fun provideTASignature(signature: String?) = taSignatureCompletion.onSignatureRe
|
|
|
281
284
|
signature.toByteArray()
|
|
282
285
|
)
|
|
283
286
|
|
|
287
|
+
fun provideAAChallenge(challenge: String?) = aaChallengeCompletion.onChallengeReceived(challenge)
|
|
288
|
+
|
|
284
289
|
fun selectPACEProtocol(protocol: JSONObject) = paceProtocolCompletion.onPaceProtocolSelected(
|
|
285
290
|
paceProtocolFromJSON(protocol)!!
|
|
286
291
|
)
|
|
@@ -550,6 +555,7 @@ fun initCompletion(callback: Callback) = IDocumentReaderInitCompletion { success
|
|
|
550
555
|
lateinit var paCertificateCompletion: IRfidPKDCertificateCompletion
|
|
551
556
|
lateinit var taCertificateCompletion: IRfidPKDCertificateCompletion
|
|
552
557
|
lateinit var taSignatureCompletion: IRfidTASignatureCompletion
|
|
558
|
+
lateinit var aaChallengeCompletion: IRfidAaChallengeCompletion
|
|
553
559
|
lateinit var paceProtocolCompletion: IPaceProtocolCompletion
|
|
554
560
|
lateinit var caProtocolCompletion: ICaProtocolCompletion
|
|
555
561
|
|
|
@@ -559,19 +565,23 @@ fun getRfidReaderRequest(config: JSONObject? = null): IRfidReaderRequest {
|
|
|
559
565
|
val result = IRfidReaderRequest()
|
|
560
566
|
if (config == null) return result
|
|
561
567
|
|
|
562
|
-
if (config.
|
|
568
|
+
if (config.getBooleanOrNull("paCertificates") == true) result.setPACertificates { serialNumber, issuer, completion ->
|
|
563
569
|
paCertificateCompletion = completion
|
|
564
570
|
sendEvent(paCertificateCompletionEvent, generatePACertificateCompletion(serialNumber, issuer))
|
|
565
571
|
}
|
|
566
|
-
if (config.
|
|
572
|
+
if (config.getBooleanOrNull("taCertificates") == true) result.setTACertificates { keyCAR, completion ->
|
|
567
573
|
taCertificateCompletion = completion
|
|
568
574
|
sendEvent(taCertificateCompletionEvent, keyCAR)
|
|
569
575
|
}
|
|
570
|
-
if (config.
|
|
576
|
+
if (config.getBooleanOrNull("taSignature") == true) result.setTASignature { challenge, completion ->
|
|
571
577
|
taSignatureCompletion = completion
|
|
572
578
|
sendEvent(taSignatureCompletionEvent, generateTAChallenge(challenge))
|
|
573
579
|
}
|
|
574
|
-
if (config.
|
|
580
|
+
if (config.getBooleanOrNull("aaChallenge") == true) result.setRfidAaChallenge { challenge, completion ->
|
|
581
|
+
aaChallengeCompletion = completion
|
|
582
|
+
sendEvent(aaChallengeCompletionEvent, challenge)
|
|
583
|
+
}
|
|
584
|
+
if (config.getBooleanOrNull("paceProtocol") == true || config.getBooleanOrNull("caProtocol") == true) result.setRfidAccessControl(object : IRfidAccessControl {
|
|
575
585
|
override fun onRequestPaceProtocol(list: List<PaceProtocol?>, completion: IPaceProtocolCompletion) {
|
|
576
586
|
paceProtocolCompletion = completion
|
|
577
587
|
sendEvent(paceProtocolCompletionEvent, list.toJson(::generatePaceProtocol))
|
|
@@ -234,7 +234,7 @@
|
|
|
234
234
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
235
235
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
236
236
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
237
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
237
|
+
IPHONEOS_DEPLOYMENT_TARGET = 17.6;
|
|
238
238
|
MTL_ENABLE_DEBUG_INFO = YES;
|
|
239
239
|
ONLY_ACTIVE_ARCH = YES;
|
|
240
240
|
SDKROOT = iphoneos;
|
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
287
287
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
288
288
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
289
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
289
|
+
IPHONEOS_DEPLOYMENT_TARGET = 17.6;
|
|
290
290
|
MTL_ENABLE_DEBUG_INFO = NO;
|
|
291
291
|
SDKROOT = iphoneos;
|
|
292
292
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
CODE_SIGN_STYLE = Automatic;
|
|
303
303
|
CURRENT_PROJECT_VERSION = 1;
|
|
304
304
|
INFOPLIST_FILE = App/Info.plist;
|
|
305
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
305
|
+
IPHONEOS_DEPLOYMENT_TARGET = 17.6;
|
|
306
306
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
|
307
307
|
MARKETING_VERSION = 1.0;
|
|
308
308
|
PRODUCT_BUNDLE_IDENTIFIER = com.regula.example.dr.capacitor;
|
|
@@ -322,7 +322,7 @@
|
|
|
322
322
|
CODE_SIGN_STYLE = Automatic;
|
|
323
323
|
CURRENT_PROJECT_VERSION = 1;
|
|
324
324
|
INFOPLIST_FILE = App/Info.plist;
|
|
325
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
325
|
+
IPHONEOS_DEPLOYMENT_TARGET = 17.6;
|
|
326
326
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
|
327
327
|
MARKETING_VERSION = 1.0;
|
|
328
328
|
PRODUCT_BUNDLE_IDENTIFIER = com.regula.example.dr.capacitor;
|