fix(unifiedPushHelper): surround by try and catch due to a javax.crypto.AEADBadTagException
cc: @p1gp1g
This commit is contained in:
@@ -29,21 +29,29 @@ public class UnifiedPushHelper {
|
|||||||
|
|
||||||
public static void registerAllAccounts(@NonNull Context context) {
|
public static void registerAllAccounts(@NonNull Context context) {
|
||||||
for (AccountSession accountSession : AccountSessionManager.getInstance().getLoggedInAccounts()){
|
for (AccountSession accountSession : AccountSessionManager.getInstance().getLoggedInAccounts()){
|
||||||
UnifiedPush.register(
|
try {
|
||||||
context,
|
UnifiedPush.register(
|
||||||
accountSession.getID(),
|
context,
|
||||||
null,
|
accountSession.getID(),
|
||||||
accountSession.app.vapidKey.replaceAll("=","")
|
null,
|
||||||
);
|
accountSession.app.vapidKey.replaceAll("=","")
|
||||||
|
);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void unregisterAllAccounts(@NonNull Context context) {
|
public static void unregisterAllAccounts(@NonNull Context context) {
|
||||||
for (AccountSession accountSession : AccountSessionManager.getInstance().getLoggedInAccounts()){
|
for (AccountSession accountSession : AccountSessionManager.getInstance().getLoggedInAccounts()){
|
||||||
UnifiedPush.unregister(
|
try {
|
||||||
|
UnifiedPush.unregister(
|
||||||
context,
|
context,
|
||||||
accountSession.getID()
|
accountSession.getID()
|
||||||
);
|
);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
// use FCM again
|
// use FCM again
|
||||||
accountSession.getPushSubscriptionManager().registerAccountForPush(null);
|
accountSession.getPushSubscriptionManager().registerAccountForPush(null);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user