From c34c72760710e2cba4cf0b555f4e465f6e5252ef Mon Sep 17 00:00:00 2001 From: Trudu Laurent Date: Mon, 7 Nov 2022 10:45:02 +0100 Subject: [PATCH] Revert to min SDK 19 --- .../deviceidentifierswrapper/RetrieveOEMInfoTask.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/RetrieveOEMInfoTask.java b/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/RetrieveOEMInfoTask.java index 8681321..1d885b7 100644 --- a/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/RetrieveOEMInfoTask.java +++ b/DeviceIdentifiersWrapper/src/main/java/com/zebra/deviceidentifierswrapper/RetrieveOEMInfoTask.java @@ -107,7 +107,10 @@ private static void registerCurrentApplication(Context context, Uri serviceIdent // You can copy/paste this snippet if you want to provide your own // certificate // TODO: use the following code snippet to extract your custom certificate if necessary - final Signature[] arrSignatures = packageInfo.signingInfo.getApkContentsSigners(); + Signature[] arrSignatures = null; + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) { + arrSignatures = packageInfo.signingInfo.getApkContentsSigners(); + } if(arrSignatures == null || arrSignatures.length == 0) { if(callbackInterface != null) @@ -125,7 +128,10 @@ private static void registerCurrentApplication(Context context, Uri serviceIdent final byte[] rawCert = sig.toByteArray(); // Get the certificate as a base64 string - String encoded = Base64.getEncoder().encodeToString(rawCert); + String encoded = null; + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { + encoded = Base64.getEncoder().encodeToString(rawCert); + } profileData = "" +