|
@@ -60,7 +60,7 @@ public class NotificationJob extends Job {
|
|
|
|
|
|
@NonNull
|
|
|
@Override
|
|
|
- protected Result onRunJob(Params params) {
|
|
|
+ protected Result onRunJob(@NonNull Params params) {
|
|
|
|
|
|
Context context = getContext();
|
|
|
PersistableBundleCompat persistableBundleCompat = getParams().getExtras();
|
|
@@ -68,7 +68,6 @@ public class NotificationJob extends Job {
|
|
|
String signature = persistableBundleCompat.getString(KEY_NOTIFICATION_SIGNATURE, "");
|
|
|
|
|
|
if (!TextUtils.isEmpty(subject) && !TextUtils.isEmpty(signature)) {
|
|
|
-
|
|
|
try {
|
|
|
byte[] base64DecodedSubject = Base64.decode(subject, Base64.DEFAULT);
|
|
|
byte[] base64DecodedSignature = Base64.decode(signature, Base64.DEFAULT);
|
|
@@ -92,14 +91,10 @@ public class NotificationJob extends Job {
|
|
|
if (!decryptedPushMessage.getApp().equals("spreed")) {
|
|
|
sendNotification(decryptedPushMessage.getSubject(), signatureVerification.getAccount());
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
- } catch (NoSuchAlgorithmException e1) {
|
|
|
- Log.d(TAG, "No proper algorithm to decrypt the message " + e1.getLocalizedMessage());
|
|
|
- } catch (NoSuchPaddingException e1) {
|
|
|
- Log.d(TAG, "No proper padding to decrypt the message " + e1.getLocalizedMessage());
|
|
|
- } catch (InvalidKeyException e1) {
|
|
|
- Log.d(TAG, "Invalid private key " + e1.getLocalizedMessage());
|
|
|
+ } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException e1) {
|
|
|
+ Log.d(TAG, "Error decrypting message " + e1.getClass().getName()
|
|
|
+ + " " + e1.getLocalizedMessage());
|
|
|
}
|
|
|
} catch (Exception exception) {
|
|
|
Log.d(TAG, "Something went very wrong" + exception.getLocalizedMessage());
|
|
@@ -136,5 +131,4 @@ public class NotificationJob extends Job {
|
|
|
|
|
|
notificationManager.notify(0, notificationBuilder.build());
|
|
|
}
|
|
|
-
|
|
|
}
|