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 = "" +