package com.tencent.mm.plugin.expt.hellhound.core.v2.activity;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.text.TextUtils;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.expt.a.b.a;
import com.tencent.mm.plugin.expt.hellhound.core.stack.d;
import com.tencent.mm.plugin.expt.hellhound.core.stack.f;
import com.tencent.mm.plugin.expt.hellhound.core.stack.g;
import com.tencent.mm.plugin.expt.hellhound.core.stack.h;
import com.tencent.mm.plugin.expt.hellhound.core.v2.activity.a.b;
import com.tencent.mm.protocal.protobuf.be;
import com.tencent.mm.protocal.protobuf.bf;
import com.tencent.mm.protocal.protobuf.cgq;
import com.tencent.mm.protocal.protobuf.chm;
import com.tencent.mm.sdk.platformtools.ab;

public final class c implements com.tencent.mm.plugin.expt.hellhound.core.c, d, e {
    private a lMG;
    private b lMH = new b(this);
    private HellInstrumentationHijack lMI = new HellInstrumentationHijack(this);

    public c() {
        AppMethodBeat.i(73396);
        AppMethodBeat.o(73396);
    }

    public final void a(a aVar) {
        this.lMG = aVar;
    }

    /* JADX WARNING: Removed duplicated region for block: B:31:0x00c6 A:{Catch:{ Exception -> 0x00fa }} */
    /* JADX WARNING: Removed duplicated region for block: B:14:0x003b A:{SYNTHETIC, Splitter:B:14:0x003b} */
    /* JADX WARNING: Removed duplicated region for block: B:14:0x003b A:{SYNTHETIC, Splitter:B:14:0x003b} */
    /* JADX WARNING: Removed duplicated region for block: B:31:0x00c6 A:{Catch:{ Exception -> 0x00fa }} */
    public final void g(android.app.Application r13) {
        /*
        r12 = this;
        r6 = 1;
        r11 = 73397; // 0x11eb5 float:1.02851E-40 double:3.6263E-319;
        r1 = 0;
        r8 = 0;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r11);
        if (r13 != 0) goto L_0x0010;
    L_0x000c:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r11);
    L_0x000f:
        return;
    L_0x0010:
        r3 = r12.lMH;
        r0 = "ActivityHijack";
        r2 = "ActivityHijack start hijack";
        com.tencent.mm.sdk.platformtools.ab.i(r0, r2);
        r0 = android.os.Build.VERSION.SDK_INT;
        r2 = 26;
        if (r0 >= r2) goto L_0x0162;
    L_0x0021:
        r0 = "android.app.ActivityManagerNative";
        r4 = java.lang.Class.forName(r0);	 Catch:{ Exception -> 0x00fa }
        r0 = "gDefault";
        r0 = r4.getDeclaredField(r0);	 Catch:{ NoSuchFieldException -> 0x009c }
        r2 = 1;
        r0.setAccessible(r2);	 Catch:{ NoSuchFieldException -> 0x01fb }
        r2 = 0;
        r1 = r0.get(r2);	 Catch:{ NoSuchFieldException -> 0x01fb }
        r2 = r0;
    L_0x0039:
        if (r1 != 0) goto L_0x00c6;
    L_0x003b:
        r0 = "ActivityHijack";
        r1 = "ActivityHijack.gDefaultObject == null";
        com.tencent.mm.sdk.platformtools.ab.e(r0, r1);	 Catch:{ Exception -> 0x00fa }
    L_0x0044:
        r1 = r12.lMI;
        r0 = "HellInstrumentationHijack";
        r2 = "HellInstrumentationHijack start hijack";
        com.tencent.mm.sdk.platformtools.ab.i(r0, r2);
        r0 = com.tencent.mm.plugin.expt.hellhound.core.a.a.bqr();	 Catch:{ Exception -> 0x01e1 }
        r2 = "currentActivityThread";
        r3 = 0;
        r3 = new java.lang.Class[r3];	 Catch:{ Exception -> 0x01e1 }
        r2 = r0.getDeclaredMethod(r2, r3);	 Catch:{ Exception -> 0x01e1 }
        r3 = 1;
        r2.setAccessible(r3);	 Catch:{ Exception -> 0x01e1 }
        r3 = 0;
        r4 = 0;
        r4 = new java.lang.Object[r4];	 Catch:{ Exception -> 0x01e1 }
        r2 = r2.invoke(r3, r4);	 Catch:{ Exception -> 0x01e1 }
        r3 = "mInstrumentation";
        r3 = r0.getDeclaredField(r3);	 Catch:{ Exception -> 0x01e1 }
        r0 = 1;
        r3.setAccessible(r0);	 Catch:{ Exception -> 0x01e1 }
        r0 = r3.get(r2);	 Catch:{ Exception -> 0x01e1 }
        r0 = (android.app.Instrumentation) r0;	 Catch:{ Exception -> 0x01e1 }
        r1.lMK = r0;	 Catch:{ Exception -> 0x01e1 }
        r0 = android.app.Instrumentation.class;
        r4 = r0.getDeclaredFields();	 Catch:{ Exception -> 0x01e1 }
        r0 = r8;
    L_0x0083:
        r5 = r4.length;	 Catch:{ Exception -> 0x01e1 }
        if (r0 >= r5) goto L_0x01d9;
    L_0x0086:
        r5 = r4[r0];	 Catch:{ Exception -> 0x01e1 }
        r9 = 1;
        r5.setAccessible(r9);	 Catch:{ Exception -> 0x01e1 }
        r5 = r4[r0];	 Catch:{ Exception -> 0x01e1 }
        r9 = r1.lMK;	 Catch:{ Exception -> 0x01e1 }
        r5 = r5.get(r9);	 Catch:{ Exception -> 0x01e1 }
        r9 = r4[r0];	 Catch:{ Exception -> 0x01e1 }
        r9.set(r1, r5);	 Catch:{ Exception -> 0x01e1 }
        r0 = r0 + 1;
        goto L_0x0083;
    L_0x009c:
        r0 = move-exception;
        r0 = r1;
    L_0x009e:
        r2 = "getDefault";
        r5 = 0;
        r5 = new java.lang.Class[r5];	 Catch:{ Exception -> 0x00b6 }
        r2 = r4.getDeclaredMethod(r2, r5);	 Catch:{ Exception -> 0x00b6 }
        r5 = 1;
        r2.setAccessible(r5);	 Catch:{ Exception -> 0x00b6 }
        r5 = 0;
        r9 = 0;
        r9 = new java.lang.Object[r9];	 Catch:{ Exception -> 0x00b6 }
        r1 = r2.invoke(r5, r9);	 Catch:{ Exception -> 0x00b6 }
        r2 = r0;
        goto L_0x0039;
    L_0x00b6:
        r2 = move-exception;
        r5 = "ActivityHijack";
        r9 = "AHijack._doHijackBellowApi26";
        r10 = 0;
        r10 = new java.lang.Object[r10];	 Catch:{ Exception -> 0x00fa }
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r5, r2, r9, r10);	 Catch:{ Exception -> 0x00fa }
        r2 = r0;
        goto L_0x0039;
    L_0x00c6:
        r0 = r4.isInstance(r1);	 Catch:{ Exception -> 0x00fa }
        if (r0 == 0) goto L_0x0115;
    L_0x00cc:
        r3.lMB = r1;	 Catch:{ Exception -> 0x00fa }
        r1 = r1.getClass();	 Catch:{ Exception -> 0x00fa }
        r0 = com.tencent.mm.plugin.expt.hellhound.core.a.a.ap(r1);	 Catch:{ Exception -> 0x00fa }
        if (r0 == 0) goto L_0x0111;
    L_0x00d8:
        r4 = r0.size();	 Catch:{ Exception -> 0x00fa }
        if (r4 <= 0) goto L_0x0111;
    L_0x00de:
        r4 = r0.size();	 Catch:{ Exception -> 0x00fa }
        r4 = new java.lang.Class[r4];	 Catch:{ Exception -> 0x00fa }
        r0 = r0.toArray(r4);	 Catch:{ Exception -> 0x00fa }
        r0 = (java.lang.Class[]) r0;	 Catch:{ Exception -> 0x00fa }
    L_0x00ea:
        r1 = r1.getClassLoader();	 Catch:{ Exception -> 0x00fa }
        r0 = java.lang.reflect.Proxy.newProxyInstance(r1, r0, r3);	 Catch:{ Exception -> 0x00fa }
        if (r2 == 0) goto L_0x0044;
    L_0x00f4:
        r1 = 0;
        r2.set(r1, r0);	 Catch:{ Exception -> 0x00fa }
        goto L_0x0044;
    L_0x00fa:
        r0 = move-exception;
        r1 = "ActivityHijack";
        r2 = "AHijack._doHijackBellowApi26";
        r3 = new java.lang.Object[r8];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r1, r0, r2, r3);
        r1 = com.tencent.mm.plugin.report.service.h.pYm;
        r2 = 932; // 0x3a4 float:1.306E-42 double:4.605E-321;
        r4 = 3;
        r1.a(r2, r4, r6, r8);
        goto L_0x0044;
    L_0x0111:
        r0 = 0;
        r0 = new java.lang.Class[r0];	 Catch:{ Exception -> 0x00fa }
        goto L_0x00ea;
    L_0x0115:
        r0 = "android.util.Singleton";
        r0 = java.lang.Class.forName(r0);	 Catch:{ Exception -> 0x00fa }
        r2 = r0.isInstance(r1);	 Catch:{ Exception -> 0x00fa }
        if (r2 == 0) goto L_0x0044;
    L_0x0122:
        r2 = "mInstance";
        r2 = r0.getDeclaredField(r2);	 Catch:{ Exception -> 0x00fa }
        r0 = 1;
        r2.setAccessible(r0);	 Catch:{ Exception -> 0x00fa }
        r0 = r2.get(r1);	 Catch:{ Exception -> 0x00fa }
        if (r0 == 0) goto L_0x0044;
    L_0x0133:
        r3.lMB = r0;	 Catch:{ Exception -> 0x00fa }
        r4 = r0.getClass();	 Catch:{ Exception -> 0x00fa }
        r0 = com.tencent.mm.plugin.expt.hellhound.core.a.a.ap(r4);	 Catch:{ Exception -> 0x00fa }
        if (r0 == 0) goto L_0x015e;
    L_0x013f:
        r5 = r0.size();	 Catch:{ Exception -> 0x00fa }
        if (r5 <= 0) goto L_0x015e;
    L_0x0145:
        r5 = r0.size();	 Catch:{ Exception -> 0x00fa }
        r5 = new java.lang.Class[r5];	 Catch:{ Exception -> 0x00fa }
        r0 = r0.toArray(r5);	 Catch:{ Exception -> 0x00fa }
        r0 = (java.lang.Class[]) r0;	 Catch:{ Exception -> 0x00fa }
    L_0x0151:
        r4 = r4.getClassLoader();	 Catch:{ Exception -> 0x00fa }
        r0 = java.lang.reflect.Proxy.newProxyInstance(r4, r0, r3);	 Catch:{ Exception -> 0x00fa }
        r2.set(r1, r0);	 Catch:{ Exception -> 0x00fa }
        goto L_0x0044;
    L_0x015e:
        r0 = 0;
        r0 = new java.lang.Class[r0];	 Catch:{ Exception -> 0x00fa }
        goto L_0x0151;
    L_0x0162:
        r0 = "android.app.ActivityManager";
        r0 = java.lang.Class.forName(r0);	 Catch:{ Exception -> 0x01be }
        r1 = "IActivityManagerSingleton";
        r0 = r0.getDeclaredField(r1);	 Catch:{ Exception -> 0x01be }
        r1 = 1;
        r0.setAccessible(r1);	 Catch:{ Exception -> 0x01be }
        r1 = 0;
        r1 = r0.get(r1);	 Catch:{ Exception -> 0x01be }
        r0 = "android.util.Singleton";
        r0 = java.lang.Class.forName(r0);	 Catch:{ Exception -> 0x01be }
        r2 = "mInstance";
        r2 = r0.getDeclaredField(r2);	 Catch:{ Exception -> 0x01be }
        r0 = 1;
        r2.setAccessible(r0);	 Catch:{ Exception -> 0x01be }
        r4 = r2.get(r1);	 Catch:{ Exception -> 0x01be }
        r3.lMB = r4;	 Catch:{ Exception -> 0x01be }
        r0 = r4.getClass();	 Catch:{ Exception -> 0x01be }
        r0 = com.tencent.mm.plugin.expt.hellhound.core.a.a.ap(r0);	 Catch:{ Exception -> 0x01be }
        if (r0 == 0) goto L_0x01d5;
    L_0x019b:
        r5 = r0.size();	 Catch:{ Exception -> 0x01be }
        if (r5 <= 0) goto L_0x01d5;
    L_0x01a1:
        r5 = r0.size();	 Catch:{ Exception -> 0x01be }
        r5 = new java.lang.Class[r5];	 Catch:{ Exception -> 0x01be }
        r0 = r0.toArray(r5);	 Catch:{ Exception -> 0x01be }
        r0 = (java.lang.Class[]) r0;	 Catch:{ Exception -> 0x01be }
    L_0x01ad:
        r4 = r4.getClass();	 Catch:{ Exception -> 0x01be }
        r4 = r4.getClassLoader();	 Catch:{ Exception -> 0x01be }
        r0 = java.lang.reflect.Proxy.newProxyInstance(r4, r0, r3);	 Catch:{ Exception -> 0x01be }
        r2.set(r1, r0);	 Catch:{ Exception -> 0x01be }
        goto L_0x0044;
    L_0x01be:
        r0 = move-exception;
        r1 = "ActivityHijack";
        r2 = "AHijack._doHijackAboveEqualApi26";
        r3 = new java.lang.Object[r8];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r1, r0, r2, r3);
        r1 = com.tencent.mm.plugin.report.service.h.pYm;
        r2 = 932; // 0x3a4 float:1.306E-42 double:4.605E-321;
        r4 = 4;
        r1.a(r2, r4, r6, r8);
        goto L_0x0044;
    L_0x01d5:
        r0 = 0;
        r0 = new java.lang.Class[r0];	 Catch:{ Exception -> 0x01be }
        goto L_0x01ad;
    L_0x01d9:
        r3.set(r2, r1);	 Catch:{ Exception -> 0x01e1 }
        com.tencent.matrix.trace.core.AppMethodBeat.o(r11);
        goto L_0x000f;
    L_0x01e1:
        r0 = move-exception;
        r1 = "HellInstrumentationHijack";
        r2 = "Instru.hijack";
        r3 = new java.lang.Object[r8];
        com.tencent.mm.sdk.platformtools.ab.printErrStackTrace(r1, r0, r2, r3);
        r1 = com.tencent.mm.plugin.report.service.h.pYm;
        r2 = 932; // 0x3a4 float:1.306E-42 double:4.605E-321;
        r4 = 5;
        r1.a(r2, r4, r6, r8);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r11);
        goto L_0x000f;
    L_0x01fb:
        r2 = move-exception;
        goto L_0x009e;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.expt.hellhound.core.v2.activity.c.g(android.app.Application):void");
    }

    public final void a(Activity activity, boolean z) {
        AppMethodBeat.i(73398);
        com.tencent.mm.vending.j.c K = K(activity);
        if (K == null) {
            AppMethodBeat.o(73398);
            return;
        }
        String str = (String) K.get(0);
        String str2 = (String) K.get(1);
        ab.d("ActivityMonitor", "habbyge-mali, moveActivityTaskToBack: " + str + " / " + str2);
        if (TextUtils.isEmpty(str)) {
            AppMethodBeat.o(73398);
            return;
        }
        d.bqu();
        ab.d("TaskRecordWrapper", "habbyge-mali, moveActivityTaskToBack: " + str + ":" + str2 + ":" + z);
        bf bqs = com.tencent.mm.plugin.expt.hellhound.core.stack.c.bqs();
        be beVar = new be();
        beVar.vDg = new chm();
        beVar.vDg.activityName = str;
        beVar.vDg.wkp = str2;
        com.tencent.mm.vending.j.c a = g.a(bqs, beVar);
        if (a == null) {
            ab.e("TaskRecordWrapper", "habbyge-mali, moveActivityTaskToBack tuple2 == null");
        } else {
            cgq cgq = (cgq) a.get(0);
            int intValue = ((Integer) a.get(1)).intValue();
            if (!z) {
                ab.w("TaskRecordWrapper", "habbyge-mali, moveActivityTaskToBack nonRoot: false");
                if (!h.a(((be) cgq.xfy.getFirst()).vDg, beVar.vDg)) {
                    ab.w("TaskRecordWrapper", "habbyge-mali, moveActivityTaskToBack nonRoot: 不处理直接返回");
                }
            }
            int size = bqs.vDi.size();
            ab.d("TaskRecordWrapper", "habbyge-mali, moveActivityTaskToBack: taskPosition = " + intValue + "/" + size);
            if (intValue == size - 1) {
                bqs.vDi.remove(intValue);
                bqs.vDi.addFirst(cgq);
                com.tencent.mm.plugin.expt.hellhound.core.stack.c.a(bqs);
                ab.d("TaskRecordWrapper", "habbyge-mali, moveActivityTaskToBack 栈顶");
            } else {
                ab.e("TaskRecordWrapper", "habbyge-mali, moveActivityTaskToBack 非栈顶，不合法");
            }
        }
        aD(str, false);
        if (!(TextUtils.isEmpty(str) || this.lMG == null)) {
            this.lMG.eb(str, str2);
        }
        AppMethodBeat.o(73398);
    }

    public final void F(Activity activity) {
        AppMethodBeat.i(73399);
        com.tencent.mm.vending.j.c K = K(activity);
        if (K == null) {
            AppMethodBeat.o(73399);
            return;
        }
        String str = (String) K.get(0);
        String str2 = (String) K.get(1);
        ab.d("ActivityMonitor", "habbyge-mali, finish: " + str + " / " + str2);
        if (TextUtils.isEmpty(str)) {
            AppMethodBeat.o(73399);
            return;
        }
        g gVar = d.bqu().lMw.lMx;
        if (!TextUtils.isEmpty(str)) {
            ab.d("TaskRecordWrapper", "habbyge-mali, pop_String: " + str + ":" + str2);
            bf bqs = com.tencent.mm.plugin.expt.hellhound.core.stack.c.bqs();
            if (!bqs.vDi.isEmpty()) {
                be a = g.a(bqs, str, str2);
                if (a == null) {
                    ab.e("TaskRecordWrapper", "habbyge-mali, pop_string: realPopActivityRecord Do-Nothing !!!");
                } else {
                    com.tencent.mm.plugin.expt.hellhound.core.stack.c.a(bqs);
                    if (gVar.lMA != null) {
                        f fVar = gVar.lMA;
                        g.bqz();
                        fVar.a(a);
                    }
                }
            }
        }
        aD(str, true);
        if (!(TextUtils.isEmpty(str) || this.lMG == null)) {
            this.lMG.ea(str, str2);
        }
        AppMethodBeat.o(73399);
    }

    private static void aD(String str, boolean z) {
        AppMethodBeat.i(73400);
        a.uX(1);
        if (z || !"com.tencent.mm.ui.LauncherUI".equals(str)) {
            d.bqu();
            be bqv = d.bqv();
            String str2 = null;
            if (bqv != null) {
                str2 = bqv.vDg.activityName;
            }
            a.KP(str);
            a.KO(str2);
            ab.i("ActivityMonitor", "habbyge-mali, _finish: from/to = " + str + "/" + str2);
            AppMethodBeat.o(73400);
            return;
        }
        ab.i("ActivityMonitor", "habbyge-mali, _quiteActivity come frome: moveActivityTaskToBack");
        AppMethodBeat.o(73400);
    }

    public final void c(Intent intent, Activity activity) {
        AppMethodBeat.i(73402);
        if (activity == null) {
            AppMethodBeat.o(73402);
            return;
        }
        e(intent, activity);
        AppMethodBeat.o(73402);
    }

    public final void d(Intent intent, Activity activity) {
        AppMethodBeat.i(73403);
        if (activity == null) {
            AppMethodBeat.o(73403);
            return;
        }
        e(intent, activity);
        AppMethodBeat.o(73403);
    }

    private static void e(Intent intent, Activity activity) {
        AppMethodBeat.i(73404);
        String canonicalName = activity.getClass().getCanonicalName();
        String valueOf = String.valueOf(activity.hashCode());
        ab.d("ActivityMonitor", "habbyge-mali, _onCreateEvent: /0x" + Integer.toHexString(intent.getFlags()) + "/" + canonicalName + "/" + valueOf);
        a(intent, canonicalName, valueOf);
        a(canonicalName, valueOf, com.tencent.mm.plugin.expt.hellhound.core.stack.a.lMo);
        AppMethodBeat.o(73404);
    }

    public final void G(Activity activity) {
        AppMethodBeat.i(73405);
        String canonicalName = activity.getClass().getCanonicalName();
        String valueOf = String.valueOf(activity.hashCode());
        d.bqu();
        if (!TextUtils.isEmpty(canonicalName)) {
            int i;
            ab.d("TaskRecordWrapper", "habbyge-mali, bringTask2FrontWhenActivityResumeIfNeed: ".concat(String.valueOf(canonicalName)));
            bf bqs = com.tencent.mm.plugin.expt.hellhound.core.stack.c.bqs();
            if (bqs == null || bqs.vDi.isEmpty() || TextUtils.isEmpty(canonicalName)) {
                i = 0;
            } else {
                ab.d("TaskRecordWrapper", "habbyge-mali, bringTask2Front: " + canonicalName + "/" + valueOf);
                cgq cgq = (cgq) bqs.vDi.getLast();
                if (cgq == null) {
                    i = 0;
                } else if (cgq.xfy.isEmpty()) {
                    i = 0;
                } else {
                    be beVar = (be) cgq.xfy.getLast();
                    if (beVar == null) {
                        i = 0;
                    } else if (h.l(beVar.vDg.activityName, beVar.vDg.wkp, canonicalName, valueOf)) {
                        i = 0;
                    } else {
                        com.tencent.mm.vending.j.c b = g.b(bqs, canonicalName, valueOf);
                        int intValue = ((Integer) b.get(0)).intValue();
                        int intValue2 = ((Integer) b.get(1)).intValue();
                        if (intValue < 0) {
                            i = 0;
                        } else {
                            cgq = (cgq) bqs.vDi.remove(intValue);
                            int size = cgq.xfy.size();
                            if (intValue2 < size - 1) {
                                for (size--; size > intValue2; size--) {
                                    cgq.xfy.remove(size);
                                }
                            }
                            bqs.vDi.addLast(cgq);
                            i = 1;
                        }
                    }
                }
            }
            if (i != 0) {
                com.tencent.mm.plugin.expt.hellhound.core.stack.c.a(bqs);
                ab.d("TaskRecordWrapper", "habbyge-mali, bringTask2FntWhenActivityResume true");
            } else {
                ab.d("TaskRecordWrapper", "habbyge-mali, bringTask2FrontWhenActivityResume false");
            }
        }
        a(canonicalName, valueOf, com.tencent.mm.plugin.expt.hellhound.core.stack.a.lMp);
        if (this.lMG != null) {
            this.lMG.B(activity);
        }
        AppMethodBeat.o(73405);
    }

    public final void H(Activity activity) {
        AppMethodBeat.i(73406);
        if (activity == null) {
            AppMethodBeat.o(73406);
            return;
        }
        a(activity.getClass().getCanonicalName(), String.valueOf(activity.hashCode()), com.tencent.mm.plugin.expt.hellhound.core.stack.a.lMq);
        if (this.lMG != null) {
            this.lMG.C(activity);
        }
        AppMethodBeat.o(73406);
    }

    public final void I(Activity activity) {
        AppMethodBeat.i(73407);
        if (activity == null) {
            AppMethodBeat.o(73407);
            return;
        }
        String canonicalName = activity.getClass().getCanonicalName();
        String valueOf = String.valueOf(activity.hashCode());
        if ("com.tencent.mm.plugin.appbrand.launching.AppBrandLaunchProxyUI".equals(canonicalName)) {
            AppMethodBeat.o(73407);
            return;
        }
        a(canonicalName, valueOf, com.tencent.mm.plugin.expt.hellhound.core.stack.a.lMr);
        if (this.lMG != null) {
            this.lMG.D(activity);
        }
        AppMethodBeat.o(73407);
    }

    public final void J(Activity activity) {
        AppMethodBeat.i(73408);
        if (activity == null) {
            AppMethodBeat.o(73408);
            return;
        }
        a(activity.getClass().getCanonicalName(), String.valueOf(activity.hashCode()), com.tencent.mm.plugin.expt.hellhound.core.stack.a.lMs);
        if (this.lMG != null) {
            this.lMG.E(activity);
        }
        AppMethodBeat.o(73408);
    }

    private static void a(Intent intent, String str, String str2) {
        AppMethodBeat.i(73409);
        d.bqu().a(intent, str, str2);
        AppMethodBeat.o(73409);
    }

    private static void a(String str, String str2, com.tencent.mm.plugin.expt.hellhound.core.stack.a aVar) {
        AppMethodBeat.i(73410);
        d.bqu();
        d.a(str, str2, aVar);
        AppMethodBeat.o(73410);
    }

    private static com.tencent.mm.vending.j.c<String, String> K(Activity activity) {
        AppMethodBeat.i(73411);
        if (activity == null) {
            try {
                d.bqu();
                com.tencent.mm.vending.j.c<String, String> bqw = d.bqw();
                ab.d("ActivityMonitor", "habbyge-mali, getActivityOnFinish: " + ((String) bqw.get(0)) + " / " + ((String) bqw.get(1)));
                AppMethodBeat.o(73411);
                return bqw;
            } catch (Exception e) {
                ab.printErrStackTrace("ActivityMonitor", e, "habbyge-mali, getActivityOnFinish", new Object[0]);
                AppMethodBeat.o(73411);
                return null;
            }
        }
        com.tencent.mm.vending.j.c<String, String> F = com.tencent.mm.vending.j.a.F(activity.getClass().getCanonicalName(), String.valueOf(activity.hashCode()));
        AppMethodBeat.o(73411);
        return F;
    }

    public final void a(Activity activity, Intent intent) {
        Object canonicalName;
        String className;
        AppMethodBeat.i(73401);
        if (activity != null) {
            canonicalName = activity.getClass().getCanonicalName();
            ab.i("ActivityMonitor", "habbyge-mali, startActivity, fromActivity: ".concat(String.valueOf(canonicalName)));
        } else {
            d.bqu();
            be bqv = d.bqv();
            if (bqv != null) {
                canonicalName = bqv.vDg.activityName;
            } else {
                canonicalName = null;
            }
            ab.i("ActivityMonitor", "habbyge-mali, startActivity, fromActivityName: ".concat(String.valueOf(canonicalName)));
        }
        ComponentName component = intent.getComponent();
        if (component != null) {
            className = component.getClassName();
        } else {
            className = null;
        }
        a(intent, className, null);
        ab.i("ActivityActionWrapper", "habbyge-mali, setStartActivityAction_resume: ".concat(String.valueOf(className)));
        b.bqC().lMN.KQ(className);
        ab.i("ActivityActionWrapper", "habbyge-mali, setStartActivityAction_pause: ".concat(String.valueOf(canonicalName)));
        b.bqC().lMN.KS(canonicalName);
        a.uX(0);
        if (!(className == null || this.lMG == null)) {
            this.lMG.KM(className);
        }
        AppMethodBeat.o(73401);
    }
}
