package com.ss.android.ugc.aweme.app;

import X.3fK;
import X.3fQ;
import X.3fa;
import X.4Tj;
import X.4U3;
import X.AnonymousClass91L;
import X.AnonymousClass9KN;
import X.C22428Zd;
import X.C22438Ze;
import X.C25348eL;
import X.C25518ec;
import X.C29918li;
import X.C42489Eh;
import X.C42869Ft;
import X.C42909Fx;
import X.C42989Gf;
import X.C43769Jf;
import X.C43789Jh;
import X.C43799Ji;
import X.C43839Jm;
import X.TmS;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.main.MainActivity;
import java.util.List;

public final class AwemeAppData extends C43789Jh implements 3fa, 4Tj {
    public boolean LJFF;
    public boolean LJI;
    public boolean LJII;

    static {
        Covode.recordClassIndex(53070);
    }

    public class RedPointTask implements C22438Ze {
        static {
            Covode.recordClassIndex(53072);
        }

        public boolean meetTrigger() {
            return true;
        }

        public String prefix() {
            return "task_";
        }

        public boolean serialExecute() {
            return false;
        }

        public int targetProcess() {
            return 1048575;
        }

        public List triggerOtherLegoComponents() {
            return null;
        }

        public C42869Ft triggerType() {
            return C22428Zd.LIZ(this);
        }

        public C42909Fx scenesType() {
            return C42909Fx.DEFAULT;
        }

        public C25518ec type() {
            return C25518ec.BOOT_FINISH;
        }

        public String key() {
            return getClass().getSimpleName();
        }

        public RedPointTask() {
        }

        public void run(Context context) {
            C43769Jf.LIZ.LJ();
        }

        public /* synthetic */ RedPointTask(AwemeAppData awemeAppData, byte b) {
            this();
        }
    }

    public final void LIZIZ(Activity activity) {
        AnonymousClass91L.LIZ((Context) activity).LIZIZ();
        C43839Jm.LJ.LIZIZ(activity);
    }

    public final void LIZ(Activity activity) {
        boolean z = activity instanceof MainActivity;
        boolean z2 = true;
        if (z) {
            if (!C29918li.LIZ.LIZ() ? !((Boolean) TmS.LJIILJJIL.getValue()).booleanValue() : !C42489Eh.LIZLLL.LIZIZ() || !C42989Gf.LIZIZ.LIZ()) {
                4U3 r1 = new 4U3();
                r1.LIZ(new RedPointTask(this, (byte) 0));
                r1.LIZ();
            } else {
                C25348eL.LIZIZ().execute(new Runnable() {
                    static {
                        Covode.recordClassIndex(53071);
                    }

                    public final void run() {
                        4U3 r3 = new 4U3();
                        r3.LIZ(new RedPointTask(AwemeAppData.this, (byte) 0));
                        r3.LIZ();
                    }
                });
            }
        }
        C43839Jm.LJ.LIZ(activity);
        this.LJFF = false;
        this.LJI = false;
        this.LJII = z;
        if (activity == null) {
            throw new NullPointerException("getIntent");
        }
        Intent intent = activity.getIntent();
        try {
            this.LJFF = intent.getBooleanExtra("from_notification", false);
            Uri data = intent.getData();
            if (!intent.getBooleanExtra("ads_app_activity_by_wap_click", false) && (data == null || data.getQueryParameter("gd_label") == null || !data.getQueryParameter("gd_label").startsWith("click_wap"))) {
                z2 = false;
            }
            this.LJI = z2;
        } catch (Exception unused) {
        }
        if (!AnonymousClass9KN.LIZ.LIZ() && !C43799Ji.LIZ.LIZ()) {
            3fK r12 = new 3fK();
            r12.LIZ(new 3fQ());
            r12.LIZ();
        }
    }
}
