From 43be502f2d87d7c5b2734e15f288259a591e517e Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 9 Aug 2021 19:02:05 +0200 Subject: [PATCH] Prevent crash --- app/src/play/java/eu/faircode/email/ActivityBilling.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/play/java/eu/faircode/email/ActivityBilling.java b/app/src/play/java/eu/faircode/email/ActivityBilling.java index 214eb9ae78..31a0260236 100644 --- a/app/src/play/java/eu/faircode/email/ActivityBilling.java +++ b/app/src/play/java/eu/faircode/email/ActivityBilling.java @@ -169,6 +169,8 @@ public class ActivityBilling extends ActivityBase implements PurchasesUpdatedLis private static String getChallenge(Context context) throws NoSuchAlgorithmException { String android_id = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID); + if (android_id == null) + android_id = Long.toHexString(System.currentTimeMillis() % (24 * 3600 * 1000L)); return Helper.sha256(android_id); }