Browse Source

Update for CR

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 7 năm trước cách đây
mục cha
commit
15b542c1a6

+ 0 - 52
src/main/java/com/owncloud/android/datamodel/PushMessage.java

@@ -1,52 +0,0 @@
-/*
- * Nextcloud application
- *
- * @author Mario Danic
- * Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package com.owncloud.android.datamodel;
-
-import org.parceler.Parcel;
-
-@Parcel
-public class PushMessage {
-    public String subject;
-    public String signature;
-
-    public PushMessage() {
-    }
-
-    public PushMessage(String subject, String signature) {
-        this.subject = subject;
-        this.signature = signature;
-    }
-
-    public String getSubject() {
-        return subject;
-    }
-
-    public void setSubject(String subject) {
-        this.subject = subject;
-    }
-
-    public String getSignature() {
-        return signature;
-    }
-
-    public void setSignature(String signature) {
-        this.signature = signature;
-    }
-}

+ 2 - 7
src/main/java/com/owncloud/android/jobs/NotificationJob.java

@@ -38,7 +38,6 @@ import com.evernote.android.job.util.support.PersistableBundleCompat;
 import com.google.gson.Gson;
 import com.owncloud.android.R;
 import com.owncloud.android.datamodel.DecryptedPushMessage;
-import com.owncloud.android.datamodel.PushMessage;
 import com.owncloud.android.datamodel.SignatureVerification;
 import com.owncloud.android.ui.activity.NotificationsActivity;
 import com.owncloud.android.ui.notifications.NotificationUtils;
@@ -71,12 +70,8 @@ public class NotificationJob extends Job {
         if (!TextUtils.isEmpty(subject) && !TextUtils.isEmpty(signature)) {
 
             try {
-                PushMessage pushMessage = new PushMessage();
-                pushMessage.setSubject(subject);
-                pushMessage.setSignature(signature);
-
-                byte[] base64DecodedSubject = Base64.decode(pushMessage.getSubject(), Base64.DEFAULT);
-                byte[] base64DecodedSignature = Base64.decode(pushMessage.getSignature(), Base64.DEFAULT);
+                byte[] base64DecodedSubject = Base64.decode(subject, Base64.DEFAULT);
+                byte[] base64DecodedSignature = Base64.decode(signature, Base64.DEFAULT);
                 PushUtils pushUtils = new PushUtils();
                 PrivateKey privateKey = (PrivateKey) PushUtils.readKeyFromFile(false);