导航菜单

页面标题

页面副标题

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

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

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


package com.bukalapak.mitra.feature.pin.screen.landing;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import androidx.lifecycle.u;
import com.bukalapak.mitra.lib.tracker.screen.Screen;
import defpackage.sd7;
import java.util.HashSet;
import kotlin.Metadata;

@Metadata(d1 = {"\u0000~\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\b\u0007\u0018\u0000 \u00152\u00020\u0001:\u0001\u0019B9\b\u0007\u0012\u0006\u0010\u001b\u001a\u00020\u0018\u0012\u0006\u0010\u001f\u001a\u00020\u001c\u0012\u0006\u0010#\u001a\u00020 \u0012\u0006\u0010'\u001a\u00020$\u0012\u0006\u0010*\u001a\u00020(\u0012\u0006\u0010-\u001a\u00020+¢\u0006\u0004\b=\u0010>J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0002J\u0016\u0010\n\u001a\u00020\u00042\u0006\u0010\u0007\u001a\u00020\u00062\u0006\u0010\t\u001a\u00020\bJ\u000e\u0010\u000b\u001a\u00020\u00042\u0006\u0010\u0007\u001a\u00020\u0006J\u0006\u0010\r\u001a\u00020\fJ\u0006\u0010\u000e\u001a\u00020\fJ\u0006\u0010\u0010\u001a\u00020\u000fJ\u0006\u0010\u0011\u001a\u00020\u000fJ\u0006\u0010\u0012\u001a\u00020\u0004J\u0006\u0010\u0013\u001a\u00020\u0004J\u000e\u0010\u0014\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002J\u000e\u0010\u0015\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002J\u0006\u0010\u0016\u001a\u00020\fJ\u0006\u0010\u0017\u001a\u00020\u0004R\u0014\u0010\u001b\u001a\u00020\u00188\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0019\u0010\u001aR\u0014\u0010\u001f\u001a\u00020\u001c8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u001d\u0010\u001eR\u0014\u0010#\u001a\u00020 8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b!\u0010\"R\u0014\u0010'\u001a\u00020$8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b%\u0010&R\u0014\u0010*\u001a\u00020(8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0011\u0010)R\u0014\u0010-\u001a\u00020+8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0010\u0010,R\u0017\u00102\u001a\u00020.8\u0006¢\u0006\f\n\u0004\b\u0005\u0010/\u001a\u0004\b0\u00101R$\u00106\u001a\u0012\u0012\u0004\u0012\u00020\u000f03j\b\u0012\u0004\u0012\u00020\u000f`48\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\n\u00105R(\u0010<\u001a\u0004\u0018\u0001072\b\u00108\u001a\u0004\u0018\u0001078F@FX\u0086\u000e¢\u0006\f\u001a\u0004\b%\u00109\"\u0004\b:\u0010;¨\u0006?"}, d2 = {"Lcom/bukalapak/mitra/feature/pin/screen/landing/PinLandingViewModel;", "Landroidx/lifecycle/u;", "Landroid/content/Context;", "context", "Llm9;", "g", "Landroid/app/Activity;", "activity", "", "requestCode", "h", "p", "", "m", "k", "", "f", "e", "r", "q", "j", "i", "l", "n", "Lgd6;", "a", "Lgd6;", "pinNavigation", "Lf28;", "b", "Lf28;", "savedState", "Lsc6;", "c", "Lsc6;", "pinEventTracker", "Loq3;", "d", "Loq3;", "homeNavigation", "Lh4;", "Lh4;", "accountPref", "Lc59;", "Lc59;", "systemTime", "Lcom/bukalapak/mitra/lib/tracker/screen/Screen;", "Lcom/bukalapak/mitra/lib/tracker/screen/Screen;", "getScreen", "()Lcom/bukalapak/mitra/lib/tracker/screen/Screen;", "screen", "Ljava/util/HashSet;", "Lkotlin/collections/HashSet;", "Ljava/util/HashSet;", "transactionReferrer", "Lmd6;", "value", "()Lmd6;", "o", "(Lmd6;)V", "pinLandingArgument", "<init>", "(Lgd6;Lf28;Lsc6;Loq3;Lh4;Lc59;)V", "feature_pin_release"}, k = 1, mv = {1, 8, 0})
public final class PinLandingViewModel extends u {

    private final gd6 pinNavigation;

    private final f28 savedState;

    private final sc6 pinEventTracker;

    private final oq3 homeNavigation;

    private final h4 accountPref;

    private final c59 systemTime;

    private final Screen screen;

    private final HashSet<String> transactionReferrer;

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Ltx1$d;", "Llm9;", "a", "(Ltx1$d;)V"}, k = 3, mv = {1, 8, 0})
    static final class b extends dk4 implements gx2<d, lm9> {
        final Activity $activity;
        final PinLandingViewModel this$0;

        @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Ltx1;", "dialog", "Llm9;", "a", "(Ltx1;)V"}, k = 3, mv = {1, 8, 0})
        static final class a extends dk4 implements gx2<tx1, lm9> {
            final Activity $activity;
            final PinLandingViewModel this$0;

            a(PinLandingViewModel pinLandingViewModel, Activity activity) {
                super(1);
                this.this$0 = pinLandingViewModel;
                this.$activity = activity;
            }

            public final void a(tx1 tx1Var) {
                p64.h(tx1Var, "dialog");
                this.this$0.h(this.$activity, 1111);
            }

            public Object invoke(Object obj) {
                a((tx1) obj);
                return lm9.a;
            }
        }

        @Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Ltx1;", "dialog", "Llm9;", "a", "(Ltx1;)V"}, k = 3, mv = {1, 8, 0})
        static final class C0086b extends dk4 implements gx2<tx1, lm9> {
            final Activity $activity;
            final PinLandingViewModel this$0;

            C0086b(PinLandingViewModel pinLandingViewModel, Activity activity) {
                super(1);
                this.this$0 = pinLandingViewModel;
                this.$activity = activity;
            }

            public final void a(tx1 tx1Var) {
                p64.h(tx1Var, "dialog");
                this.this$0.g(this.$activity);
            }

            public Object invoke(Object obj) {
                a((tx1) obj);
                return lm9.a;
            }
        }

        b(Activity activity, PinLandingViewModel pinLandingViewModel) {
            super(1);
            this.$activity = activity;
            this.this$0 = pinLandingViewModel;
        }

        public final void a(d dVar) {
            p64.h(dVar, "$this$confirmation");
            String string = this.$activity.getString(sd7.u);
            p64.g(string, "activity.getString(R.str…ding_cancel_dialog_title)");
            dVar.i(string);
            String string2 = this.$activity.getString(sd7.t);
            p64.g(string2, "activity.getString(R.str…g_cancel_dialog_subtitle)");
            dVar.g(string2);
            d.u(dVar, this.$activity.getString(sd7.s), (d) null, new a(this.this$0, this.$activity), 2, (Object) null);
            d.s(dVar, this.$activity.getString(sd7.r), (d) null, new C0086b(this.this$0, this.$activity), 2, (Object) null);
        }

        public Object invoke(Object obj) {
            a((d) obj);
            return lm9.a;
        }
    }

    public PinLandingViewModel(gd6 gd6Var, f28 f28Var, sc6 sc6Var, oq3 oq3Var, h4 h4Var, c59 c59Var) {
        p64.h(gd6Var, "pinNavigation");
        p64.h(f28Var, "savedState");
        p64.h(sc6Var, "pinEventTracker");
        p64.h(oq3Var, "homeNavigation");
        p64.h(h4Var, "accountPref");
        p64.h(c59Var, "systemTime");
        this.pinNavigation = gd6Var;
        this.savedState = f28Var;
        this.pinEventTracker = sc6Var;
        this.homeNavigation = oq3Var;
        this.accountPref = h4Var;
        this.systemTime = c59Var;
        d48 d48Var = d48.a;
        this.screen = d48Var.H();
        this.transactionReferrer = xd8.f(new String[]{d48Var.X().b(), d48Var.n1().b(), d48Var.u1().b(), d48Var.C4().b(), d48Var.w4().b(), d48Var.w2().b()});
    }

    public final void g(Context context) {
        md6 d = d();
        String a = d != null ? d.a() : null;
        if (a == null || bu8.y(a)) {
            a = "628175720770";
        }
        md6 d2 = d();
        String b2 = d2 != null ? d2.b() : null;
        if (b2 == null) {
            b2 = "";
        }
        String str = "https://api.whatsapp.com/send?phone=" + a + "&text=" + b2;
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.setData(Uri.parse(str));
        try {
            context.startActivity(intent);
        } catch (ActivityNotFoundException unused) {
            context.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=com.whatsapp")));
        }
    }

    public final md6 d() {
        return (md6) this.savedState.d("pin_landing_arguments");
    }

    public final String e() {
        md6 d = d();
        String h = d != null ? d.h() : null;
        return h == null ? "" : h;
    }

    public final String f() {
        md6 d = d();
        String i = d != null ? d.i() : null;
        return i == null ? "" : i;
    }

    public final void h(Activity activity, int i) {
        p64.h(activity, "activity");
        a.d(this.pinNavigation, activity, i, k(), (String) null, (String) null, (String) null, l(), 56, (Object) null);
    }

    public final void i(Context context) {
        String referrerUrl;
        p64.h(context, "context");
        oq3 oq3Var = this.homeNavigation;
        md6 d = d();
        String str = null;
        String screenName = d != null ? d.getScreenName() : null;
        md6 d2 = d();
        if (d2 != null && (referrerUrl = d2.getReferrerUrl()) != null && !bu8.y(referrerUrl)) {
            str = referrerUrl;
        }
        a.c(oq3Var, context, 0, str, (String) null, (String) null, (Long) null, screenName, false, false, (String) null, true, 954, (Object) null);
    }

    public final void j(Context context) {
        p64.h(context, "context");
        a.c(this.homeNavigation, context, 2, (String) null, (String) null, (String) null, (Long) null, (String) null, false, false, (String) null, false, 1020, (Object) null);
    }

    public final boolean k() {
        md6 d = d();
        if (d != null) {
            return d.j();
        }
        return false;
    }

    public final boolean l() {
        HashSet<String> hashSet = this.transactionReferrer;
        md6 d = d();
        String referrerScreen = d != null ? d.getReferrerScreen() : null;
        if (referrerScreen == null) {
            referrerScreen = "";
        }
        return hashSet.contains(referrerScreen);
    }

    public final boolean m() {
        md6 d = d();
        if (d != null) {
            return d.g();
        }
        return true;
    }

    public final void n() {
        this.accountPref.x1(this.systemTime.a());
    }

    public final void o(md6 md6Var) {
        this.savedState.g("pin_landing_arguments", md6Var);
    }

    public final void p(Activity activity) {
        p64.h(activity, "activity");
        tx1.b.b(activity, new b(activity, this)).h();
    }

    public final void q() {
        sc6 sc6Var = this.pinEventTracker;
        md6 d = d();
        String referrerScreen = d != null ? d.getReferrerScreen() : null;
        if (referrerScreen == null) {
            referrerScreen = "";
        }
        md6 d2 = d();
        sc6.b(sc6Var, referrerScreen, d2 != null ? d2.getReferrerUrl() : null, "created_pin_button", d48.a.G().b(), (String) null, 16, (Object) null);
    }

    public final void r() {
        Screen screen = this.screen;
        md6 d = d();
        String referrerScreen = d != null ? d.getReferrerScreen() : null;
        if (referrerScreen == null) {
            referrerScreen = "";
        }
        md6 d2 = d();
        String referrerUrl = d2 != null ? d2.getReferrerUrl() : null;
        if (referrerUrl == null) {
            referrerUrl = "";
        }
        t38.d(screen, referrerScreen, referrerUrl, (String) null, (String) null, 12, (Object) null);
    }
}