导航菜单

页面标题

页面副标题

Mitra Bukalapak v2.55.0 - WholesaleFirebaseMessagingService.java 源代码

正在查看: Mitra Bukalapak v2.55.0 应用的 WholesaleFirebaseMessagingService.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.bukalapak.mitra.notification;

import android.net.Uri;
import com.bukalapak.android.lib.api4.tungku.data.SingleKycIdentity;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.x;
import defpackage.C0145ka0;
import defpackage.C0152ku0;
import defpackage.C0162lu0;
import defpackage.C0187su0;
import defpackage.C0215xl4;
import defpackage.ad8;
import defpackage.az6;
import defpackage.b51;
import defpackage.dk4;
import defpackage.ds5;
import defpackage.ex2;
import defpackage.ic8;
import defpackage.jh7;
import defpackage.ke;
import defpackage.ku8;
import defpackage.lm9;
import defpackage.lu8;
import defpackage.nq8;
import defpackage.ot7;
import defpackage.p64;
import defpackage.r31;
import defpackage.r44;
import defpackage.s64;
import defpackage.sw8;
import defpackage.ux2;
import defpackage.v44;
import defpackage.vo9;
import defpackage.xk4;
import defpackage.xr5;
import defpackage.zy6;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import kotlin.Metadata;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

@Metadata(d1 = {"\u0000T\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010$\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\t\n\u0002\b\u0007\n\u0002\u0010 \n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0006\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b;\u0010,J\u001c\u0010\u0006\u001a\u00020\u00052\u0012\u0010\u0004\u001a\u000e\u0012\u0004\u0012\u00020\u0003\u0012\u0004\u0012\u00020\u00030\u0002H\u0002J\u0010\u0010\n\u001a\u00020\t2\u0006\u0010\b\u001a\u00020\u0007H\u0002J\u0010\u0010\r\u001a\u00020\t2\u0006\u0010\f\u001a\u00020\u000bH\u0002J\u001c\u0010\u0010\u001a\u00020\t2\b\u0010\u000e\u001a\u0004\u0018\u00010\u00032\b\u0010\u000f\u001a\u0004\u0018\u00010\u0003H\u0002J\u0010\u0010\u0012\u001a\u00020\t2\u0006\u0010\u0011\u001a\u00020\u0003H\u0002J\u000e\u0010\u0014\u001a\b\u0012\u0004\u0012\u00020\u00030\u0013H\u0002J\u0016\u0010\u0016\u001a\u00020\u00052\f\u0010\u0015\u001a\b\u0012\u0004\u0012\u00020\u00030\u0013H\u0002J\u0010\u0010\u0017\u001a\u00020\u00052\u0006\u0010\b\u001a\u00020\u0007H\u0002J\u0010\u0010\u0018\u001a\u00020\u00052\u0006\u0010\b\u001a\u00020\u0007H\u0002J\u0010\u0010\u0019\u001a\u00020\u00052\u0006\u0010\u0004\u001a\u00020\u0007H\u0002J\u0010\u0010\u001a\u001a\u00020\u00052\u0006\u0010\u0004\u001a\u00020\u0007H\u0002J\u0010\u0010\u001c\u001a\u00020\u00052\u0006\u0010\u001b\u001a\u00020\u0003H\u0016J\u0010\u0010\u001f\u001a\u00020\u00052\u0006\u0010\u001e\u001a\u00020\u001dH\u0016J\u001c\u0010 \u001a\u00020\u00072\u0012\u0010\u0004\u001a\u000e\u0012\u0004\u0012\u00020\u0003\u0012\u0004\u0012\u00020\u00030\u0002H\u0007R\u001c\u0010#\u001a\b\u0012\u0004\u0012\u00020\u00030\u00138\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b!\u0010\"R(\u0010-\u001a\u00020$8\u0006@\u0006X\u0087\u000e¢\u0006\u0018\n\u0004\b%\u0010&\u0012\u0004\b+\u0010,\u001a\u0004\b'\u0010(\"\u0004\b)\u0010*R(\u00105\u001a\u00020.8\u0006@\u0006X\u0087\u000e¢\u0006\u0018\n\u0004\b\u001a\u0010/\u0012\u0004\b4\u0010,\u001a\u0004\b0\u00101\"\u0004\b2\u00103R\u001b\u0010:\u001a\u0002068BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0019\u00107\u001a\u0004\b8\u00109¨\u0006<"}, d2 = {"Lcom/bukalapak/mitra/notification/WholesaleFirebaseMessagingService;", "Lcom/google/firebase/messaging/FirebaseMessagingService;", SingleKycIdentity.EMPTY, SingleKycIdentity.EMPTY, "data", "Llm9;", "h", "Lcz6;", "pushNotificationData", SingleKycIdentity.EMPTY, "n", SingleKycIdentity.EMPTY, "receiverId", "k", "url", "groupUrl", "i", "newNotificationKey", "j", SingleKycIdentity.EMPTY, "e", "keys", "m", "l", SingleKycIdentity.O, "d", "c", "token", "onNewToken", "Lcom/google/firebase/messaging/x;", "remoteMessage", "onMessageReceived", "f", SingleKycIdentity.A, "Ljava/util/List;", "notificationKeys", "Lzy6;", SingleKycIdentity.B, "Lzy6;", "getPushNotificationBuilder", "()Lzy6;", "setPushNotificationBuilder", "(Lzy6;)V", "getPushNotificationBuilder$annotations", "()V", "pushNotificationBuilder", "Lxr5;", "Lxr5;", "getNotificationPref", "()Lxr5;", "setNotificationPref", "(Lxr5;)V", "getNotificationPref$annotations", "notificationPref", "Lz37;", "Lxk4;", "g", "()Lz37;", "qrisTransactionEventBroadcaster", "<init>", "base_app_release"}, k = 1, mv = {1, 8, 0})
public final class WholesaleFirebaseMessagingService extends FirebaseMessagingService {

    private List<String> notificationKeys = C0152ku0.h();

    private zy6 pushNotificationBuilder = new az6(null, null, 3, null);

    private xr5 notificationPref = xr5.INSTANCE.a();

    private final xk4 qrisTransactionEventBroadcaster;

    @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lb51;", "Llm9;", "<anonymous>"}, k = 3, mv = {1, 8, 0})
    @eo1(c = "com.bukalapak.mitra.notification.WholesaleFirebaseMessagingService$onNewToken$1", f = "WholesaleFirebaseMessagingService.kt", l = {40}, m = "invokeSuspend")
    static final class a extends sw8 implements ux2<b51, r31<? super lm9>, Object> {
        int label;

        a(r31<? super a> r31Var) {
            super(2, r31Var);
        }

        @Override
        public final r31<lm9> create(Object obj, r31<?> r31Var) {
            return new a(r31Var);
        }

        @Override
        public final Object invoke(b51 b51Var, r31<? super lm9> r31Var) {
            return ((a) create(b51Var, r31Var)).invokeSuspend(lm9.a);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object d;
            d = s64.d();
            int i = this.label;
            if (i == 0) {
                ot7.b(obj);
                ds5 D = ic8.a.D();
                this.label = 1;
                if (D.b(this) == d) {
                    return d;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                ot7.b(obj);
            }
            return lm9.a;
        }
    }

    @Metadata(d1 = {"\u0000\b\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"Lz37;", SingleKycIdentity.A, "()Lz37;"}, k = 3, mv = {1, 8, 0})
    static final class b extends dk4 implements ex2<z37> {
        b() {
            super(0);
        }

        @Override
        public final z37 invoke() {
            return new z37(WholesaleFirebaseMessagingService.this);
        }
    }

    public WholesaleFirebaseMessagingService() {
        xk4 a2;
        a2 = C0215xl4.a(new b());
        this.qrisTransactionEventBroadcaster = a2;
    }

    private final void c(cz6 cz6Var) {
        rq5.a.b(new a(cz6Var.o(), cz6Var.q()));
    }

    private final void d(cz6 cz6Var) {
        boolean R;
        String queryParameter;
        String o = cz6Var.o();
        if (o != null) {
            R = lu8.R(o, "\"tag\":\"qris-transaction\"", false, 2, null);
            if (!R || (queryParameter = Uri.parse(cz6Var.q()).getQueryParameter("id")) == null) {
                return;
            }
            g().a(queryParameter);
        }
    }

    private final List<String> e() {
        JSONArray jSONArray;
        v44 n;
        try {
            jSONArray = new JSONArray(this.notificationPref.a());
        } catch (JSONException e) {
            e.printStackTrace();
            jSONArray = null;
        }
        if (jSONArray != null) {
            n = jh7.n(0, jSONArray.length());
            ArrayList arrayList = new ArrayList(C0162lu0.r(n, 10));
            Iterator<Integer> it = n.iterator();
            while (it.hasNext()) {
                arrayList.add(jSONArray.get(((r44) it).b()).toString());
            }
            List<String> Q0 = C0187su0.Q0(arrayList);
            if (Q0 != null) {
                return Q0;
            }
        }
        return C0152ku0.h();
    }

    private final z37 g() {
        return (z37) this.qrisTransactionEventBroadcaster.getValue();
    }

    private final void h(Map<String, String> map) {
        boolean y;
        cz6 f = f(map);
        y = ku8.y(f.c());
        if ((!y) && n(f)) {
            this.pushNotificationBuilder.a(f);
            l(f);
            d(f);
            c(f);
        }
    }

    private final boolean i(String url, String groupUrl) {
        return false;
    }

    private final boolean j(String newNotificationKey) {
        List<String> y0 = C0187su0.y0(this.notificationKeys, e());
        this.notificationKeys = y0;
        boolean contains = y0.contains(newNotificationKey);
        if (!contains) {
            List<String> N0 = this.notificationKeys.size() > 4 ? C0187su0.N0(this.notificationKeys, 4) : this.notificationKeys;
            this.notificationKeys = N0;
            List<String> z0 = C0187su0.z0(N0, newNotificationKey);
            this.notificationKeys = z0;
            m(z0);
        }
        return contains;
    }

    private final boolean k(long receiverId) {
        return (receiverId != -1 && receiverId == ic8.a.I().m()) || receiverId == -1;
    }

    private final void l(cz6 cz6Var) {
        o(cz6Var);
    }

    private final void m(List<String> list) {
        xr5 xr5Var = this.notificationPref;
        String jSONArray = new JSONArray((Collection) list).toString();
        p64.g(jSONArray, "JSONArray(keys).toString()");
        xr5Var.b(jSONArray);
    }

    private final boolean n(cz6 pushNotificationData) {
        ad8 I = ic8.a.I();
        String n = pushNotificationData.n();
        String c = pushNotificationData.c();
        int j = pushNotificationData.j();
        StringBuilder sb = new StringBuilder();
        sb.append(n);
        sb.append(c);
        sb.append(j);
        return I.s() && k(pushNotificationData.l()) && !i(pushNotificationData.q(), pushNotificationData.f()) && !j(sb.toString());
    }

    private final void o(cz6 cz6Var) {
        if (vo9.a.M0(cz6Var.q())) {
            qj3.i(qj3.a, new ii3(cz6Var), (String) null, (String) null, 6, (Object) null);
        }
    }

    public final cz6 f(Map<String, String> data) {
        boolean y;
        v44 n;
        String E;
        String E2;
        boolean y2;
        v44 n2;
        String E3;
        p64.h(data, "data");
        cz6 cz6Var = new cz6();
        cz6Var.M(new Random().nextInt());
        String str = data.get("title");
        String str2 = SingleKycIdentity.EMPTY;
        if (str == null) {
            str = SingleKycIdentity.EMPTY;
        }
        cz6Var.Q(str);
        String str3 = data.get("body");
        if (str3 != null) {
            str2 = str3;
        }
        cz6Var.u(str2);
        cz6Var.F(data.get("header_info"));
        String str4 = data.get("receiver_id");
        cz6Var.N(str4 != null ? Long.parseLong(str4) : -1L);
        cz6Var.P(data.get("small_icon"));
        cz6Var.H(data.get("large_icon"));
        cz6Var.s(data.get("big_picture"));
        cz6Var.r(data.get("android_sound"));
        cz6Var.S(data.get("url"));
        if (!ke.a.k()) {
            cz6Var.D(data.get("group"));
        }
        String str5 = data.get("cancelable");
        cz6Var.w(str5 != null ? Boolean.parseBoolean(str5) : true);
        String str6 = data.get("launch_app");
        cz6Var.J(str6 != null ? Boolean.parseBoolean(str6) : true);
        String str7 = data.get("launch_app_from_button");
        cz6Var.K(str7 != null ? Boolean.parseBoolean(str7) : true);
        String str8 = data.get("direct_reply");
        cz6Var.y(str8 != null ? Boolean.parseBoolean(str8) : false);
        cz6Var.A(data.get("direct_reply_label"));
        cz6Var.R(data.get("tracking_data"));
        String str9 = data.get("buttons");
        if (str9 != null) {
            y2 = ku8.y(str9);
            if (!y2) {
                JSONArray jSONArray = new JSONArray(str9);
                ArrayList arrayList = new ArrayList();
                n2 = jh7.n(0, jSONArray.length());
                ArrayList<JSONObject> arrayList2 = new ArrayList(C0162lu0.r(n2, 10));
                Iterator<Integer> it = n2.iterator();
                while (it.hasNext()) {
                    arrayList2.add(jSONArray.getJSONObject(((r44) it).b()));
                }
                for (JSONObject jSONObject : arrayList2) {
                    a aVar = new a();
                    String optString = jSONObject.optString("action");
                    p64.g(optString, "it.optString(\"action\")");
                    E3 = ku8.E(optString, "\\", SingleKycIdentity.EMPTY, false, 4, null);
                    aVar.c(E3);
                    aVar.d(jSONObject.optString("text"));
                    arrayList.add(aVar);
                }
                cz6Var.v(arrayList);
            }
        }
        String str10 = data.get("carousel");
        if (str10 != null) {
            y = ku8.y(str10);
            if (!y) {
                JSONArray jSONArray2 = new JSONArray(str10);
                ArrayList arrayList3 = new ArrayList();
                n = jh7.n(0, jSONArray2.length());
                ArrayList<JSONObject> arrayList4 = new ArrayList(C0162lu0.r(n, 10));
                Iterator<Integer> it2 = n.iterator();
                while (it2.hasNext()) {
                    arrayList4.add(jSONArray2.getJSONObject(((r44) it2).b()));
                }
                for (JSONObject jSONObject2 : arrayList4) {
                    b bVar = new b();
                    String optString2 = jSONObject2.optString("action");
                    p64.g(optString2, "it.optString(\"action\")");
                    E = ku8.E(optString2, "\\", SingleKycIdentity.EMPTY, false, 4, null);
                    bVar.a(E);
                    String optString3 = jSONObject2.optString("image");
                    p64.g(optString3, "it.optString(\"image\")");
                    E2 = ku8.E(optString3, "\\", SingleKycIdentity.EMPTY, false, 4, null);
                    bVar.b(E2);
                    arrayList3.add(bVar);
                }
                cz6Var.x(arrayList3);
            }
        }
        return cz6Var;
    }

    @Override
    public void onMessageReceived(x xVar) {
        p64.h(xVar, "remoteMessage");
        nq8.a.u();
        if (ic8.a.e().f(xVar)) {
            return;
        }
        Map<String, String> s = xVar.s();
        if (!(!s.isEmpty())) {
            s = null;
        }
        if (s != null) {
            h(s);
        }
    }

    @Override
    public void onNewToken(String str) {
        p64.h(str, "token");
        C0145ka0.b(null, new a(null), 1, null);
    }
}