From f5c80b230ac81b988a6c8ad294e275c0aa003ec5 Mon Sep 17 00:00:00 2001 From: gdlbo <41114720+gdlbo@users.noreply.github.com> Date: Thu, 16 Jun 2022 22:46:07 +0300 Subject: [PATCH] gcmfix v2 is here --- app/src/main/java/ru/vtosters/lite/audio/gcm/GCMFix.java | 9 ++------- .../main/java/ru/vtosters/lite/utils/Preferences.java | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/ru/vtosters/lite/audio/gcm/GCMFix.java b/app/src/main/java/ru/vtosters/lite/audio/gcm/GCMFix.java index 5d24e135a8..de53d4c066 100644 --- a/app/src/main/java/ru/vtosters/lite/audio/gcm/GCMFix.java +++ b/app/src/main/java/ru/vtosters/lite/audio/gcm/GCMFix.java @@ -81,7 +81,7 @@ public static String requestToken() { Thread.sleep(100); } String token = sb.toString(); - if (token.equals("EGISTRATION_ERROR")) { + if (token.equals("REGISTRATION_ERROR")) { return requestToken(); } rid = 0; @@ -89,12 +89,7 @@ public static String requestToken() { String sig2 = getSig(pub22); params.clear(); fillParams(params, sig2, pub22, xappide, Long.parseLong(aid.split(" ")[1].split(":")[0]), true); - doRequest("https://android.clients.google.com/c2dm/register3", "POST", params, aid, new Callback() { - @Override - public void doCallback(String str) { - GCMFix.lambda$requestToken$1(str); - } - }); + doRequest("https://android.clients.google.com/c2dm/register3", "POST", params, aid, GCMFix::lambda$requestToken$1); return token; } catch (FileNotFoundException e2) { return requestToken(); diff --git a/app/src/main/java/ru/vtosters/lite/utils/Preferences.java b/app/src/main/java/ru/vtosters/lite/utils/Preferences.java index 5db706c329..0c53e96477 100644 --- a/app/src/main/java/ru/vtosters/lite/utils/Preferences.java +++ b/app/src/main/java/ru/vtosters/lite/utils/Preferences.java @@ -216,7 +216,7 @@ public static boolean CommentsSort() { } public static boolean gcmfix() { - return getBoolValue("gcmfix", true); + return getBoolValue("gcmfix", true) && isValidSignature(); } public static boolean hasMusicSubscription() {