Skip to content

Commit

Permalink
Merge pull request #124 from BlinkID/release/v4.2.0
Browse files Browse the repository at this point in the history
Release/v4.2.0
  • Loading branch information
i1E authored Aug 31, 2018
2 parents a390cd4 + a5b1c76 commit 08b6364
Show file tree
Hide file tree
Showing 155 changed files with 23,634 additions and 2,125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.microblink.entities.recognizers.blinkid.germany.GermanyCombinedRecognizer;
import com.microblink.entities.recognizers.blinkid.jordan.JordanCombinedRecognizer;
import com.microblink.entities.recognizers.blinkid.mrtd.MrtdCombinedRecognizer;
import com.microblink.entities.recognizers.blinkid.paymentcard.PaymentCardCombinedRecognizer;
import com.microblink.entities.recognizers.blinkid.poland.PolandCombinedRecognizer;
import com.microblink.entities.recognizers.blinkid.serbia.SerbiaCombinedRecognizer;
import com.microblink.entities.recognizers.blinkid.singapore.SingaporeCombinedRecognizer;
Expand Down Expand Up @@ -52,11 +53,12 @@ protected List<MenuListItem> createMenuListItems() {
List<MenuListItem> items = new ArrayList<>();

items.add(createMenuListItem("MRTD combined", ImageSettings.enableAllImages(new MrtdCombinedRecognizer())));
items.add(createMenuListItem("Austrian ID combined", ImageSettings.enableAllImages(new AustriaCombinedRecognizer())));
items.add(createMenuListItem("Austrian combined", ImageSettings.enableAllImages(new AustriaCombinedRecognizer())));
items.add(createMenuListItem("Croatian ID combined", ImageSettings.enableAllImages(new CroatiaCombinedRecognizer())));
items.add(createMenuListItem("Czech ID combined", ImageSettings.enableAllImages(new CzechiaCombinedRecognizer())));
items.add(createMenuListItem("German ID combined", ImageSettings.enableAllImages(new GermanyCombinedRecognizer())));
items.add(createMenuListItem("German combined", ImageSettings.enableAllImages(new GermanyCombinedRecognizer())));
items.add(createMenuListItem("Jordan ID combined", ImageSettings.enableAllImages(new JordanCombinedRecognizer())));
items.add(createMenuListItem("Payment Card combined", ImageSettings.enableAllImages(new PaymentCardCombinedRecognizer())));
items.add(createMenuListItem("Polish ID combined", ImageSettings.enableAllImages(new PolandCombinedRecognizer())));
items.add(createMenuListItem("Serbian ID combined", ImageSettings.enableAllImages(new SerbiaCombinedRecognizer())));
items.add(createMenuListItem("Singapore ID combined", ImageSettings.enableAllImages(new SingaporeCombinedRecognizer())));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<string name="app_name">BlinkID templating sample</string>
<string name="scan_croatian_id_front">Scan croatian ID front side</string>
<string name="scan_croatian_id_back">Scan croatian ID back side</string>
<string name="scan_croatian_id_front">Scan Croatian ID front side</string>
<string name="scan_croatian_id_back">Scan Croatian ID back side</string>

<string name="result_key_first_name">First name</string>
<string name="result_key_last_name">Last name</string>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import com.microblink.entities.recognizers.blinkid.croatia.CroatiaCombinedRecognizer;
import com.microblink.entities.recognizers.blinkid.croatia.CroatiaIdBackRecognizer;
import com.microblink.entities.recognizers.blinkid.croatia.CroatiaIdFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.cyprus.CyprusIdBackRecognizer;
import com.microblink.entities.recognizers.blinkid.cyprus.CyprusIdFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.czechia.CzechiaCombinedRecognizer;
import com.microblink.entities.recognizers.blinkid.czechia.CzechiaIdBackRecognizer;
import com.microblink.entities.recognizers.blinkid.czechia.CzechiaIdFrontRecognizer;
Expand All @@ -52,6 +54,8 @@
import com.microblink.entities.recognizers.blinkid.jordan.JordanCombinedRecognizer;
import com.microblink.entities.recognizers.blinkid.jordan.JordanIdBackRecognizer;
import com.microblink.entities.recognizers.blinkid.jordan.JordanIdFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.kuwait.KuwaitIdBackRecognizer;
import com.microblink.entities.recognizers.blinkid.kuwait.KuwaitIdFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.malaysia.IkadRecognizer;
import com.microblink.entities.recognizers.blinkid.malaysia.MalaysiaDlFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.malaysia.MyKadBackRecognizer;
Expand All @@ -61,6 +65,9 @@
import com.microblink.entities.recognizers.blinkid.morocco.MoroccoIdFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.mrtd.MrtdRecognizer;
import com.microblink.entities.recognizers.blinkid.newzealand.NewZealandDlFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.paymentcard.PaymentCardBackRecognizer;
import com.microblink.entities.recognizers.blinkid.paymentcard.PaymentCardCombinedRecognizer;
import com.microblink.entities.recognizers.blinkid.paymentcard.PaymentCardFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.poland.PolandCombinedRecognizer;
import com.microblink.entities.recognizers.blinkid.poland.PolandIdBackRecognizer;
import com.microblink.entities.recognizers.blinkid.poland.PolandIdFrontRecognizer;
Expand All @@ -79,11 +86,13 @@
import com.microblink.entities.recognizers.blinkid.slovenia.SloveniaCombinedRecognizer;
import com.microblink.entities.recognizers.blinkid.slovenia.SloveniaIdBackRecognizer;
import com.microblink.entities.recognizers.blinkid.slovenia.SloveniaIdFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.spain.SpainDlFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.sweden.dl.SwedenDlFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.switzerland.SwitzerlandDlFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.switzerland.SwitzerlandIdBackRecognizer;
import com.microblink.entities.recognizers.blinkid.switzerland.SwitzerlandIdFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.switzerland.SwitzerlandPassportRecognizer;
import com.microblink.entities.recognizers.blinkid.unitedArabEmirates.UnitedArabEmiratesDlFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.unitedArabEmirates.UnitedArabEmiratesIdBackRecognizer;
import com.microblink.entities.recognizers.blinkid.unitedArabEmirates.UnitedArabEmiratesIdFrontRecognizer;
import com.microblink.entities.recognizers.blinkid.usdl.UsdlCombinedRecognizer;
Expand Down Expand Up @@ -173,6 +182,7 @@ protected List<MenuListItem> createMenuListItems() {
items.add(buildColombiaIDElement());
items.add(buildCroatianIDElement());
items.add(buildCroatianIDCombinedElement());
items.add(buildCyprusIDElement());
items.add(buildCzechIDElement());
items.add(buildCzechIDCombinedElement());
items.add(buildEgyptIDFrontElement());
Expand All @@ -183,6 +193,7 @@ protected List<MenuListItem> createMenuListItems() {
items.add(buildIndonesianIdElement());
items.add(buildJordanIdElement());
items.add(buildJordanIdCombinedElement());
items.add(buildKuwaitIdElement());
items.add(buildMyKadElement());
items.add(buildIKadElement());
items.add(buildMyTenteraElement());
Expand Down Expand Up @@ -210,12 +221,18 @@ protected List<MenuListItem> createMenuListItems() {
items.add(buildNewZealandDLElement());
items.add(buildGermanDLElement());
items.add(buildSingaporeDlElement());
items.add(buildSwedenDlElement());
items.add(buildSwissDlElement());
items.add(buildSpainDLElement());
items.add(buildSwedenDLElement());
items.add(buildSwissDLElement());
items.add(buildUKDLElement());
items.add(buildUsdlElement());
items.add(buildUnitedArabEmiratesDLElement());
items.add(buildUsdlCombinedElement());

// entries for documents which are not country-specific
items.add(buildPaymentCardElement());
items.add(buildPaymentCardCombinedElement());

// barcode list entries
items.add(buildPDF417Element());
items.add(buildBarcodeElement());
Expand Down Expand Up @@ -367,6 +384,21 @@ public void run() {
});
}

private MenuListItem buildCyprusIDElement() {
return new MenuListItem("Cyprus ID", new Runnable() {
@Override
public void run() {
CyprusIdFrontRecognizer cyprusFront = new CyprusIdFrontRecognizer();
ImageSettings.enableAllImages(cyprusFront);

CyprusIdBackRecognizer cyprusBack = new CyprusIdBackRecognizer();
ImageSettings.enableAllImages(cyprusBack);

scanAction(new DocumentUISettings(prepareRecognizerBundle(cyprusFront, cyprusBack)));
}
});
}

private MenuListItem buildCzechIDElement() {
return new MenuListItem("Czech ID", new Runnable() {
@Override
Expand Down Expand Up @@ -463,6 +495,21 @@ public void run() {
});
}

private MenuListItem buildKuwaitIdElement() {
return new MenuListItem("Kuwait ID", new Runnable() {
@Override
public void run() {
KuwaitIdFrontRecognizer kuwaitFront = new KuwaitIdFrontRecognizer();
ImageSettings.enableAllImages(kuwaitFront);

KuwaitIdBackRecognizer kuwaitBack = new KuwaitIdBackRecognizer();
ImageSettings.enableAllImages(kuwaitBack);

scanAction(new DocumentUISettings(prepareRecognizerBundle(kuwaitFront, kuwaitBack)));
}
});
}

private MenuListItem buildMyKadElement() {
return new MenuListItem("Malaysian ID", new Runnable() {
@Override
Expand Down Expand Up @@ -657,6 +704,21 @@ public void run() {
});
}

private MenuListItem buildPaymentCardElement() {
return new MenuListItem("Payment Card", new Runnable() {
@Override
public void run() {
PaymentCardFrontRecognizer paymentCardFront = new PaymentCardFrontRecognizer();
ImageSettings.enableAllImages(paymentCardFront);

PaymentCardBackRecognizer paymentCardBack = new PaymentCardBackRecognizer();
ImageSettings.enableAllImages(paymentCardBack);

scanAction(new DocumentUISettings(prepareRecognizerBundle(paymentCardFront, paymentCardBack)));
}
});
}

private MenuListItem buildEUDLElement(String title, final EudlCountry country) {
return new MenuListItem(title, new Runnable() {
@Override
Expand Down Expand Up @@ -731,7 +793,18 @@ public void run() {
});
}

private MenuListItem buildSwedenDlElement() {
private MenuListItem buildSpainDLElement() {
return new MenuListItem("Spain Driver's License", new Runnable() {
@Override
public void run() {
SpainDlFrontRecognizer spainDlFrontRecognizer = new SpainDlFrontRecognizer();
ImageSettings.enableAllImages(spainDlFrontRecognizer);
scanAction(new DocumentUISettings(prepareRecognizerBundle(spainDlFrontRecognizer)));
}
});
}

private MenuListItem buildSwedenDLElement() {
return new MenuListItem("Sweden Driver's License", new Runnable() {
@Override
public void run() {
Expand All @@ -745,7 +818,7 @@ public void run() {
});
}

private MenuListItem buildSwissDlElement() {
private MenuListItem buildSwissDLElement() {
return new MenuListItem("Swiss Driver's License", new Runnable() {
@Override
public void run() {
Expand All @@ -757,6 +830,18 @@ public void run() {
});
}

private MenuListItem buildUnitedArabEmiratesDLElement() {
return new MenuListItem("United Arab Emirates Driver's License", new Runnable() {
@Override
public void run() {
UnitedArabEmiratesDlFrontRecognizer uaeDlFront = new UnitedArabEmiratesDlFrontRecognizer();
ImageSettings.enableAllImages(uaeDlFront);

scanAction(new DocumentUISettings(prepareRecognizerBundle(uaeDlFront)));
}
});
}

private MenuListItem buildUsdlElement() {
return new MenuListItem("US Driver's License", new Runnable() {
@Override
Expand Down Expand Up @@ -827,6 +912,18 @@ public void run() {
});
}

private MenuListItem buildPaymentCardCombinedElement() {
return new MenuListItem("Payment Card Combined", new Runnable() {
@Override
public void run() {
PaymentCardCombinedRecognizer paymentCardCombined = new PaymentCardCombinedRecognizer();
ImageSettings.enableAllImages(paymentCardCombined);

combinedRecognitionAction(paymentCardCombined);
}
});
}

private MenuListItem buildPolishIdCombinedElement() {
return new MenuListItem("Polish Combined", new Runnable() {
@Override
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
import com.microblink.libresult.R;
import com.microblink.results.date.Date;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;

public class RecognitionResultEntry {

Expand Down Expand Up @@ -84,8 +85,23 @@ public RecognitionResultEntry build(@StringRes int key, Date value) {
String strVal = "";
if (value != null) {
Calendar cal = GregorianCalendar.getInstance();
cal.set(value.getYear(), value.getMonth() - 1, value.getDay());
DateFormat df = DateFormat.getDateInstance();
cal.clear();
// year always exists
cal.set(Calendar.YEAR, value.getYear());
// if date is partial, day and month can be 0
StringBuilder dateFormat = new StringBuilder();
int day = value.getDay();
if (day != 0) {
cal.set(Calendar.DATE, day);
dateFormat.append("dd/");
}
int month = value.getMonth();
if (month != 0) {
cal.set(Calendar.MONTH, month -1);
dateFormat.append("MM/");
}
dateFormat.append("YYYY");
SimpleDateFormat df = new SimpleDateFormat(dateFormat.toString(), Locale.US);
strVal = df.format(cal.getTime());
}
return new RecognitionResultEntry(createKey(key), strVal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,17 @@ public static void extractCommonData(Recognizer.Result result,
DigitalSignatureResult digitalSignatureResult = (DigitalSignatureResult) result;
byte[] digitalSignature = digitalSignatureResult.getDigitalSignature();
if (digitalSignature != null) {
extractedData.add(builder.build(R.string.MBDigitalSignatureVersion, digitalSignatureResult.getDigitalSignatureVersion()));
extractedData.add(builder.build(R.string.MBDigitalSignature, digitalSignature));
boolean allZeros = true;
for (byte b : digitalSignature) {
if (b != 0) {
allZeros = false;
break;
}
}
if (!allZeros) {
extractedData.add(builder.build(R.string.MBDigitalSignatureVersion, digitalSignatureResult.getDigitalSignatureVersion()));
extractedData.add(builder.build(R.string.MBDigitalSignature, digitalSignature));
}
}
}
}
Expand Down
Loading

0 comments on commit 08b6364

Please sign in to comment.