@regulaforensics/cordova-plugin-document-reader-api 8.1.121-rc → 8.1.129-nightly
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/example/package.json
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"author": "Regula Forensics Inc.",
|
|
14
14
|
"license": "commercial",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@regulaforensics/cordova-plugin-document-reader-api": "8.1.
|
|
17
|
-
"@regulaforensics/cordova-plugin-document-reader-core-fullauthrfid": "8.1.
|
|
16
|
+
"@regulaforensics/cordova-plugin-document-reader-api": "8.1.129-nightly",
|
|
17
|
+
"@regulaforensics/cordova-plugin-document-reader-core-fullauthrfid": "8.1.322-nightly",
|
|
18
18
|
"cordova-android": "13.0.0",
|
|
19
19
|
"cordova-ios": "7.1.1",
|
|
20
20
|
"cordova-plugin-add-swift-support": "2.0.2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/cordova-plugin-document-reader-api",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.129-nightly",
|
|
4
4
|
"description": "Cordova plugin for reading and validation of identification documents (API framework)",
|
|
5
5
|
"cordova": {
|
|
6
6
|
"id": "@regulaforensics/cordova-plugin-document-reader-api",
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="@regulaforensics/cordova-plugin-document-reader-api" version="8.1.
|
|
2
|
+
<plugin id="@regulaforensics/cordova-plugin-document-reader-api" version="8.1.129-nightly" xmlns="http://apache.org/cordova/ns/plugins/1.0">
|
|
3
3
|
<name>DocumentReaderApi</name>
|
|
4
4
|
<description>Cordova plugin Document reader api</description>
|
|
5
5
|
<license>commercial</license>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<source url="https://github.com/CocoaPods/Specs.git"/>
|
|
28
28
|
</config>
|
|
29
29
|
<pods>
|
|
30
|
-
<pod name="
|
|
30
|
+
<pod name="DocumentReaderNightly" spec="8.1.4635" />
|
|
31
31
|
</pods>
|
|
32
32
|
</podspec>
|
|
33
33
|
</platform>
|
|
@@ -22,6 +22,7 @@ import android.content.pm.PackageManager.PERMISSION_GRANTED
|
|
|
22
22
|
import android.os.Build
|
|
23
23
|
import android.os.IBinder
|
|
24
24
|
import android.provider.Settings
|
|
25
|
+
import android.util.Log
|
|
25
26
|
import androidx.core.content.ContextCompat.checkSelfPermission
|
|
26
27
|
import com.regula.common.ble.BLEWrapper
|
|
27
28
|
import com.regula.common.ble.BleWrapperCallback
|
|
@@ -38,44 +39,40 @@ const val INTENT_REQUEST_ENABLE_LOCATION = 196
|
|
|
38
39
|
const val INTENT_REQUEST_ENABLE_BLUETOOTH = 197
|
|
39
40
|
|
|
40
41
|
@SuppressLint("StaticFieldLeak")
|
|
41
|
-
|
|
42
|
+
var bluetooth: BLEWrapper? = null
|
|
42
43
|
lateinit var savedCallbackForPermissionResult: Callback
|
|
43
|
-
var deviceConnected = false
|
|
44
44
|
|
|
45
45
|
fun connectBluetoothDevice(callback: Callback) {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
if (bluetooth?.isConnected == true) {
|
|
47
|
+
Log.e("REGULA", "Bluetooth device already connected, returning false")
|
|
48
|
+
callback.success(false)
|
|
49
|
+
return
|
|
50
|
+
}
|
|
48
51
|
|
|
49
|
-
// If some of the bluetooth permissions/settings don't match the requirements,
|
|
50
|
-
// save callback for later and request the permissions/settings.
|
|
51
|
-
// Callback will then be used in onRequestPermissionsResult for permission requests
|
|
52
|
-
// and in onActivityResult for settings change requests.
|
|
53
52
|
if (!isBluetoothSettingsReady(activity)) {
|
|
54
53
|
savedCallbackForPermissionResult = callback
|
|
55
54
|
return
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
val timer = object : TimerTask() {
|
|
57
|
+
val timeout = object : TimerTask() {
|
|
60
58
|
override fun run() {
|
|
61
59
|
callback.success(false)
|
|
62
|
-
bluetooth
|
|
63
|
-
bluetooth
|
|
60
|
+
bluetooth?.stopDeviceScan()
|
|
61
|
+
bluetooth?.disconnect()
|
|
64
62
|
}
|
|
65
63
|
}
|
|
66
|
-
Timer().schedule(
|
|
64
|
+
Timer().schedule(timeout, SEARCHING_TIMEOUT)
|
|
67
65
|
|
|
68
|
-
// start searching devices
|
|
69
66
|
val bleIntent = Intent(context, RegulaBleService::class.java)
|
|
70
67
|
context.startService(bleIntent)
|
|
71
68
|
context.bindService(bleIntent, object : ServiceConnection {
|
|
72
69
|
override fun onServiceConnected(name: ComponentName, service: IBinder) {
|
|
73
70
|
bluetooth = (service as RegulaBleService.LocalBinder).service.bleManager
|
|
74
|
-
bluetooth.
|
|
71
|
+
if (bluetooth!!.isConnected) callback.success(true)
|
|
72
|
+
else bluetooth!!.addCallback(object : BleWrapperCallback() {
|
|
75
73
|
override fun onDeviceReady() {
|
|
76
|
-
|
|
77
|
-
bluetooth
|
|
78
|
-
deviceConnected = true
|
|
74
|
+
timeout.cancel()
|
|
75
|
+
bluetooth!!.removeCallback(this)
|
|
79
76
|
callback.success(true)
|
|
80
77
|
}
|
|
81
78
|
})
|
|
@@ -250,9 +250,9 @@ fun generateDocReaderConfig(temp: DocReaderConfig?): JSONObject? {
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
fun bleDeviceConfigFromJSON(input: JSONObject): BleDeviceConfig {
|
|
253
|
-
var result = BleDeviceConfig(bluetooth)
|
|
253
|
+
var result = BleDeviceConfig(bluetooth!!)
|
|
254
254
|
|
|
255
|
-
if (input.has("customDb")) result = BleDeviceConfig(bluetooth
|
|
255
|
+
if (input.has("customDb")) result = BleDeviceConfig(bluetooth!!, byteArrayFromBase64(input.getString("customDb")))
|
|
256
256
|
if (input.has("licenseUpdate")) result.setLicenseUpdate(input.getBoolean("licenseUpdate"))
|
|
257
257
|
if (input.has("delayedNNLoad")) result.isDelayedNNLoad = input.getBoolean("delayedNNLoad")
|
|
258
258
|
if (input.has("blackList")) result.blackList = input.getJSONObject("blackList")
|
package/src/android/build.gradle
CHANGED
|
@@ -8,13 +8,13 @@ android {
|
|
|
8
8
|
|
|
9
9
|
repositories {
|
|
10
10
|
maven {
|
|
11
|
-
url "https://maven.regulaforensics.com/RegulaDocumentReader/
|
|
11
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader/Nightly"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
dependencies {
|
|
16
16
|
//noinspection GradleDependency
|
|
17
|
-
implementation ('com.regula.documentreader:api:8.1.
|
|
17
|
+
implementation ('com.regula.documentreader:api:8.1.11453'){
|
|
18
18
|
transitive = true
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -928,17 +928,19 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
928
928
|
+(NSDictionary*)generateImageQuality:(RGLImageQuality*)input {
|
|
929
929
|
if(input == nil) return nil;
|
|
930
930
|
NSMutableDictionary* result = [NSMutableDictionary new];
|
|
931
|
-
|
|
931
|
+
|
|
932
932
|
result[@"type"] = [RGLWConfig generateImageQualityCheckType:input.type];
|
|
933
933
|
result[@"result"] = @(input.result);
|
|
934
934
|
result[@"featureType"] = @(input.featureType);
|
|
935
935
|
if(input.boundRects != nil){
|
|
936
936
|
NSMutableArray *array = [NSMutableArray new];
|
|
937
|
-
for(NSValue* item in input.boundRects)
|
|
938
|
-
|
|
937
|
+
for(NSValue* item in input.boundRects) {
|
|
938
|
+
id rect = [self generateRect:[item CGRectValue]];
|
|
939
|
+
if(rect) [array addObject:rect];
|
|
940
|
+
}
|
|
939
941
|
result[@"boundRects"] = array;
|
|
940
942
|
}
|
|
941
|
-
|
|
943
|
+
|
|
942
944
|
return result;
|
|
943
945
|
}
|
|
944
946
|
|
|
@@ -1907,7 +1909,7 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
1907
1909
|
+(RGLTAChallenge*)taChallengeFromJson:(NSDictionary*)input {
|
|
1908
1910
|
NSMutableDictionary* json = input.mutableCopy;
|
|
1909
1911
|
|
|
1910
|
-
json[@"#text"] = [
|
|
1912
|
+
json[@"#text"] = [input valueForKey:@"data"];
|
|
1911
1913
|
json[@"@auxPCD"] = [input valueForKey:@"auxPCD"];
|
|
1912
1914
|
json[@"@challengePICC"] = [input valueForKey: @"challengePICC"];
|
|
1913
1915
|
json[@"@hashPK"] = [input valueForKey:@"hashPK"];
|