Skip to content

Commit

Permalink
Merge pull request #141 from BlinkID/release/5.11.0
Browse files Browse the repository at this point in the history
Release/5.11.0
  • Loading branch information
mijo-gracanin authored Apr 20, 2021
2 parents 36c5284 + cf26721 commit fb82bb0
Show file tree
Hide file tree
Showing 50 changed files with 157 additions and 99 deletions.
2 changes: 1 addition & 1 deletion BlinkID/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blinkid-cordova",
"version": "5.10.0",
"version": "5.11.0",
"description": "A small and powerful ID card scanning library",
"cordova": {
"id": "blinkid-cordova",
Expand Down
5 changes: 3 additions & 2 deletions BlinkID/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="blinkid-cordova"
version="5.10.0">
version="5.11.0">

<name>BlinkIdScanner</name>
<description>A small and powerful ID card scanning library</description>
Expand Down Expand Up @@ -59,6 +59,7 @@
<source-file src="src/android/java/com/microblink/plugins/cordova/MicroblinkScanner.java" target-dir="src/com/microblink/plugins/cordova" />
<source-file src="src/android/java/com/microblink/plugins/cordova/FakeR.java" target-dir="src/com/microblink/plugins/cordova" />
<source-file src="src/android/java/com/microblink/plugins/cordova/overlays/OverlaySettingsSerialization.java" target-dir="src/com/microblink/plugins/cordova/overlays" />
<source-file src="src/android/java/com/microblink/plugins/cordova/overlays/OverlaySerializationUtils.java" target-dir="src/com/microblink/plugins/cordova/overlays" />
<source-file src="src/android/java/com/microblink/plugins/cordova/overlays/OverlaySettingsSerializers.java" target-dir="src/com/microblink/plugins/cordova/overlays" />
<source-file src="src/android/java/com/microblink/plugins/cordova/overlays/serialization/DocumentVerificationOverlaySettingsSerialization.java" target-dir="src/com/microblink/plugins/cordova/overlays/serialization" />
<source-file src="src/android/java/com/microblink/plugins/cordova/overlays/serialization/BlinkIdOverlaySettingsSerialization.java" target-dir="src/com/microblink/plugins/cordova/overlays/serialization" />
Expand Down Expand Up @@ -148,7 +149,7 @@
<framework src="AudioToolbox.framework" />
<framework src="OpenGLES.framework" />
<framework src="Accelerate.framework" />
<framework src="src/ios/Microblink.framework" custom="true" embed="true"/>
<framework src="src/ios/Microblink.xcframework" custom="true" embed="true"/>

<preference name="CAMERA_USAGE_DESCRIPTION" default=" " />
<config-file target="*-Info.plist" parent="NSCameraUsageDescription">
Expand Down
12 changes: 4 additions & 8 deletions BlinkID/scripts/initIOSFramework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
HERE="$(dirname "$(test -L "$0" && readlink "$0" || echo "$0")")"
pushd "${HERE}/../src/ios/" > /dev/null

LINK='https://github.com/BlinkID/blinkid-ios/releases/download/v5.10.0/Microblink.framework.zip'
FILENAME='Microblink.framework.zip'
LINK='https://github.com/BlinkID/blinkid-ios/releases/download/v5.11.0/Microblink.xcframework.zip'
FILENAME='Microblink.xcframework.zip'

# check if Microblink framework and bundle already exist
wget --version > /dev/null 2>&1 || { echo "ERROR: couldn't download Microblink framework, install wget" && exit 1; }
Expand All @@ -19,19 +19,15 @@ if [ -d 'Microblink.framework' ] ; then
rm -rf Microblink.framework && echo "Removing Microblink.framework"
fi


if [ -d 'Microblink.xcframework' ] ; then
rm -rf Microblink.xcframework && echo "Removing Microblink.xcframework"
fi

echo "Unzipping ${FILENAME}"
unzip -v > /dev/null 2>&1 || { echo "ERROR: couldn't unzip Microblink framework, install unzip" && exit 1; }
unzip -v > /dev/null 2>&1 || { echo "ERROR: couldn't unzip Microblink xcframework, install unzip" && exit 1; }
unzip -o "${FILENAME}" > /dev/null 2>&1 && echo "Unzipped ${FILENAME}"

# cd blinkid-ios || exit 1

# mv -f Microblink.xcframework ../Microblink.xcframework
# cd ..

echo "Removing unnecessary files"

rm -rfv Microblink.xcframework.zip >/dev/null 2>&1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ public static RecognitionModeFilter deserializeRecognitionModeFilter(JSONObject
boolean enableMrzVisa = (boolean)json.optBoolean("enableMrzVisa", true);
boolean enableMrzPassport = (boolean)json.optBoolean("enableMrzPassport", true);
boolean enablePhotoId = (boolean)json.optBoolean("enablePhotoId", true);
boolean enableBarcodeId = (boolean)json.optBoolean("enableBarcodeId", true);
boolean enableFullDocumentRecognition = (boolean)json.optBoolean("enableFullDocumentRecognition", true);
return new RecognitionModeFilter(enableMrzId, enableMrzVisa, enableMrzPassport, enablePhotoId, enableFullDocumentRecognition);
return new RecognitionModeFilter(enableMrzId, enableMrzVisa, enableMrzPassport, enablePhotoId, enableBarcodeId, enableFullDocumentRecognition);
} else {
return new RecognitionModeFilter();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.microblink.plugins.cordova.overlays;

import android.content.Context;

import com.microblink.hardware.camera.CameraType;
import com.microblink.plugins.cordova.FakeR;
import com.microblink.uisettings.CameraSettings;
import com.microblink.uisettings.UISettings;
import com.microblink.uisettings.options.BeepSoundUIOptions;

import org.json.JSONObject;

public class OverlaySerializationUtils {

public static void prepareCommonUiSettings(Context context, JSONObject jsonUISettings, UISettings uiSettings) {
boolean useFrontCamera = jsonUISettings.optBoolean("useFrontCamera", false);
if (useFrontCamera) {
CameraSettings cameraSettings = new CameraSettings.Builder()
.setType(CameraType.CAMERA_FRONTFACE).build();
uiSettings.setCameraSettings(cameraSettings);
}

if (uiSettings instanceof BeepSoundUIOptions) {
boolean enableBeep = jsonUISettings.optBoolean("enableBeep", false);
if (enableBeep) {
FakeR fakeR = new FakeR(context);
((BeepSoundUIOptions) uiSettings).setBeepSoundResourceID(fakeR.getId("raw", "beep"));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.microblink.uisettings.UISettings;
import com.microblink.plugins.cordova.overlays.OverlaySettingsSerialization;
import com.microblink.plugins.cordova.SerializationUtils;
import com.microblink.plugins.cordova.overlays.OverlaySerializationUtils;

import org.json.JSONObject;

Expand All @@ -18,6 +19,8 @@ public final class BlinkIdOverlaySettingsSerialization implements OverlaySetting
public UISettings createUISettings(Context context, JSONObject jsonUISettings, RecognizerBundle recognizerBundle) {
BlinkIdUISettings settings = new BlinkIdUISettings(recognizerBundle);

OverlaySerializationUtils.prepareCommonUiSettings(context, jsonUISettings, settings);

boolean requireDocumentSidesDataMatch = jsonUISettings.optBoolean("requireDocumentSidesDataMatch", true);
settings.setDocumentDataMatchRequired(requireDocumentSidesDataMatch);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
import com.microblink.uisettings.DocumentUISettings;
import com.microblink.uisettings.UISettings;
import com.microblink.plugins.cordova.overlays.OverlaySettingsSerialization;
import com.microblink.plugins.cordova.overlays.OverlaySerializationUtils;

import org.json.JSONObject;

public final class DocumentOverlaySettingsSerialization implements OverlaySettingsSerialization {
@Override
public UISettings createUISettings(Context context, JSONObject jsonUISettings, RecognizerBundle recognizerBundle) {
// no settings deserialized at the moment
return new DocumentUISettings(recognizerBundle);
DocumentUISettings settings = new DocumentUISettings(recognizerBundle);
OverlaySerializationUtils.prepareCommonUiSettings(context, jsonUISettings, settings);
return settings;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.microblink.uisettings.DocumentVerificationUISettings;
import com.microblink.uisettings.UISettings;
import com.microblink.plugins.cordova.overlays.OverlaySettingsSerialization;
import com.microblink.plugins.cordova.overlays.OverlaySerializationUtils;

import org.json.JSONObject;

Expand All @@ -17,6 +18,8 @@ public final class DocumentVerificationOverlaySettingsSerialization implements O
public UISettings createUISettings(Context context, JSONObject jsonUISettings, RecognizerBundle recognizerBundle) {
DocumentVerificationUISettings settings = new DocumentVerificationUISettings(recognizerBundle);

OverlaySerializationUtils.prepareCommonUiSettings(context, jsonUISettings, settings);

DocumentVerificationOverlayStrings.Builder overlasStringsBuilder = new DocumentVerificationOverlayStrings.Builder(context);
String firstSideSplashMessage = getStringFromJSONObject(jsonUISettings, "firstSideSplashMessage");
if (firstSideSplashMessage != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public Recognizer<?> createRecognizer(JSONObject jsonObject) {
recognizer.setReturnFaceImage(jsonObject.optBoolean("returnFaceImage", false));
recognizer.setReturnFullDocumentImage(jsonObject.optBoolean("returnFullDocumentImage", false));
recognizer.setReturnSignatureImage(jsonObject.optBoolean("returnSignatureImage", false));
recognizer.setScanCroppedDocumentImage(jsonObject.optBoolean("scanCroppedDocumentImage", true));
recognizer.setScanCroppedDocumentImage(jsonObject.optBoolean("scanCroppedDocumentImage", false));
recognizer.setSignResult(jsonObject.optBoolean("signResult", false));
recognizer.setSignatureImageDpi(jsonObject.optInt("signatureImageDpi", 250));
recognizer.setSkipUnsupportedBack(jsonObject.optBoolean("skipUnsupportedBack", false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public Recognizer<?> createRecognizer(JSONObject jsonObject) {
recognizer.setReturnFaceImage(jsonObject.optBoolean("returnFaceImage", false));
recognizer.setReturnFullDocumentImage(jsonObject.optBoolean("returnFullDocumentImage", false));
recognizer.setReturnSignatureImage(jsonObject.optBoolean("returnSignatureImage", false));
recognizer.setScanCroppedDocumentImage(jsonObject.optBoolean("scanCroppedDocumentImage", true));
recognizer.setScanCroppedDocumentImage(jsonObject.optBoolean("scanCroppedDocumentImage", false));
recognizer.setSignatureImageDpi(jsonObject.optInt("signatureImageDpi", 250));
recognizer.setValidateResultCharacters(jsonObject.optBoolean("validateResultCharacters", true));
return recognizer;
Expand Down
2 changes: 1 addition & 1 deletion BlinkID/src/android/libBlinkID.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repositories {
}

dependencies {
implementation('com.microblink:blinkid:5.10.0@aar') {
implementation('com.microblink:blinkid:5.11.0@aar') {
transitive = true
}
}
Expand Down
2 changes: 1 addition & 1 deletion BlinkID/src/ios/sources/CDVMicroblinkScanner.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#import "MBRecognizerWrapper.h"
#import "MBSerializationUtils.h"

#import <MicroBlink/MicroBlink.h>
#import <Microblink/Microblink.h>

const NSString *RESULT_LIST = @"resultList";

Expand Down
4 changes: 2 additions & 2 deletions BlinkID/src/ios/sources/MBBlinkIDSerializationUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by DoDo on 04/06/2018.
//

#import <MicroBlink/MicroBlink.h>
#import <Microblink/Microblink.h>

#import <Foundation/Foundation.h>

Expand All @@ -22,4 +22,4 @@
+(NSDictionary * _Nonnull) serializeBarcodeElements:(MBBarcodeElements * _Nonnull)extendedElements;
+(NSArray<NSString *> *) serializeBarcodeElementsValues:(MBBarcodeElements *)extendedElements;

@end
@end
3 changes: 2 additions & 1 deletion BlinkID/src/ios/sources/MBBlinkIDSerializationUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ +(MBRecognitionModeFilter *) deserializeMBRecognitionModeFilter:(NSDictionary *)
recognitionModeFilter.enableMrzVisa = [[jsonRecognitionModeFilter valueForKey:@"enableMrzVisa"] boolValue];
recognitionModeFilter.enableMrzPassport = [[jsonRecognitionModeFilter valueForKey:@"enableMrzPassport"] boolValue];
recognitionModeFilter.enablePhotoId = [[jsonRecognitionModeFilter valueForKey:@"enablePhotoId"] boolValue];
recognitionModeFilter.enableBarcodeId = [[jsonRecognitionModeFilter valueForKey:@"enableBarcodeId"] boolValue];
recognitionModeFilter.enableFullDocumentRecognition = [[jsonRecognitionModeFilter valueForKey:@"enableFullDocumentRecognition"] boolValue];

return recognitionModeFilter;
Expand All @@ -184,4 +185,4 @@ +(NSDictionary * _Nonnull) serializeBarcodeElements:(MBBarcodeElements * _Nonnul
return fieldsArr;
}

@end
@end
4 changes: 2 additions & 2 deletions BlinkID/src/ios/sources/MBCommonSerializationUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
// Created by DoDo on 04/06/2018.
//

#import <MicroBlink/MicroBlink.h>
#import <Microblink/Microblink.h>

#import <Foundation/Foundation.h>

@interface MBCommonSerializationUtils : NSObject

+(MBImageExtensionFactors) deserializeMBImageExtensionFactors:(NSDictionary * _Nullable)jsonExtensionFactors;

@end
@end
2 changes: 1 addition & 1 deletion BlinkID/src/ios/sources/MBCommonSerializationUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ +(MBImageExtensionFactors) deserializeMBImageExtensionFactors:(NSDictionary *)js
);
}
}
@end
@end
4 changes: 2 additions & 2 deletions BlinkID/src/ios/sources/MBSerializationUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by DoDo on 01/06/2018.
//

#import <MicroBlink/MicroBlink.h>
#import <Microblink/Microblink.h>
#import <Foundation/Foundation.h>

@interface MBSerializationUtils : NSObject
Expand All @@ -16,4 +16,4 @@
+(NSDictionary * _Nonnull)serializeCGPoint:(CGPoint) point;
+(NSDictionary * _Nonnull) serializeMBQuadrangle:(MBQuadrangle * _Nonnull) quad;

@end
@end
2 changes: 1 addition & 1 deletion BlinkID/src/ios/sources/MBSerializationUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ +(NSDictionary *) serializeMBQuadrangle:(MBQuadrangle *) quad {
};
}

@end
@end
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
// Copyright © 2018 Jura Skrlec. All rights reserved.
//

#import <MicroBlink/MicroBlink.h>
#import <Microblink/Microblink.h>
#import <Foundation/Foundation.h>

@interface MBOverlaySerializationUtils : NSObject

+(void) extractCommonOverlaySettings:(NSDictionary *)jsonOverlaySettings overlaySettings:(MBOverlaySettings *)overlaySettings;

@end
@end
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ +(void) extractCommonOverlaySettings:(NSDictionary *)jsonOverlaySettings overlay
}
}

@end
@end
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#import "MBOverlayViewControllerDelegate.h"

#import <MicroBlink/MicroBlink.h>
#import <Microblink/Microblink.h>

#import <Foundation/Foundation.h>

Expand Down
2 changes: 1 addition & 1 deletion BlinkID/src/ios/sources/Overlays/MBOverlayVCCreator.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#import "MBOverlayViewControllerDelegate.h"

#import <MicroBlink/MicroBlink.h>
#import <Microblink/Microblink.h>
#import <Foundation/Foundation.h>

@protocol MBOverlayVCCreator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#pragma once

#import <MicroBlink/MicroBlink.h>
#import <Microblink/Microblink.h>

@protocol MBOverlayViewControllerDelegate<NSObject>
@required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@

@interface MBBlinkIdOverlaySettingsSerialization : NSObject<MBOverlayVCCreator, MBBlinkIdOverlayViewControllerDelegate>

@end
@end
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,4 @@ - (void)blinkIdOverlayViewControllerDidTapClose:(nonnull MBBlinkIdOverlayViewCon
}


@end
@end
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

@interface MBDocumentOverlaySettingsSerialization : NSObject<MBOverlayVCCreator, MBDocumentOverlayViewControllerDelegate>

@end
@end
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ - (void)documentOverlayViewControllerDidTapClose:(nonnull MBDocumentOverlayViewC
[self.delegate overlayDidTapClose:documentOverlayViewController];
}

@end
@end
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@

@interface MBDocumentVerificationOverlaySettingsSerialization : NSObject<MBOverlayVCCreator, MBDocumentVerificationOverlayViewControllerDelegate>

@end
@end
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ - (void)documentVerificationOverlayViewControllerDidTapClose:(nonnull MBDocument
[self.delegate overlayDidTapClose:documentVerificationOverlayViewController];
}

@end
@end
4 changes: 2 additions & 2 deletions BlinkID/src/ios/sources/Recognizers/MBRecognizerSerializers.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "MBRecognizerWrapper.h"

#import <MicroBlink/MicroBlink.h>
#import <Microblink/Microblink.h>

#import <Foundation/Foundation.h>

Expand All @@ -11,4 +11,4 @@
-(MBRecognizerCollection *) deserializeRecognizerCollection:(NSDictionary *)jsonRecognizerCollection;
-(id<MBRecognizerCreator>) recognizerCreatorForJson:(NSDictionary *)recognizerJson;

@end
@end
4 changes: 2 additions & 2 deletions BlinkID/src/ios/sources/Recognizers/MBRecognizerWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#pragma once

#import <MicroBlink/MicroBlink.h>
#import <Microblink/Microblink.h>

/** Object that knows how to create recognizer from JSON */
@protocol MBRecognizerCreator
Expand All @@ -25,4 +25,4 @@

-(NSDictionary *) serializeResult;

@end
@end
Loading

0 comments on commit fb82bb0

Please sign in to comment.