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

import X.8gF;
import X.C0901DEr;
import X.C3922EWw;
import X.SNU;
import android.content.Intent;
import android.util.SparseArray;
import android.view.View;
import com.bytedance.apm.agent.v2.instrumentation.ActivityAgent;
import com.bytedance.covode.number.Covode;
import com.bytedance.sysoptimizer.EnterTransitionCrashOptimizer;

public final class AppWidgetLinkProxyActivity extends SNU {
    public static final C0901DEr LIZJ = new C0901DEr((byte) 0);
    public String LIZ = "";
    public String LIZIZ = "";
    public SparseArray LIZLLL;

    static {
        Covode.recordClassIndex(122031);
    }

    public final void _$_clearFindViewByIdCache() {
        SparseArray sparseArray = this.LIZLLL;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public final View _$_findCachedViewById(int i) {
        if (this.LIZLLL == null) {
            this.LIZLLL = new SparseArray();
        }
        View view = (View) this.LIZLLL.get(i);
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i);
        this.LIZLLL.put(i, findViewById);
        return findViewById;
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [com.ss.android.ugc.aweme.utils.AppWidgetLinkProxyActivity, X.SNU, android.app.Activity] */
    public final void onDestroy() {
        8gF.LJ(this);
        AppWidgetLinkProxyActivity.super.onDestroy();
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [com.ss.android.ugc.aweme.utils.AppWidgetLinkProxyActivity, X.SNU, android.app.Activity] */
    public final void onPause() {
        8gF.LIZJ(this);
        AppWidgetLinkProxyActivity.super.onPause();
    }

    /* JADX WARNING: type inference failed for: r3v0, types: [com.ss.android.ugc.aweme.utils.AppWidgetLinkProxyActivity, X.SNU, android.app.Activity] */
    public final void onResume() {
        8gF.LIZIZ(this);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.utils.AppWidgetLinkProxyActivity", "onResume", true);
        AppWidgetLinkProxyActivity.super.onResume();
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.utils.AppWidgetLinkProxyActivity", "onResume", false);
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [com.ss.android.ugc.aweme.utils.AppWidgetLinkProxyActivity, X.SNU, android.app.Activity] */
    public final void onStart() {
        8gF.LIZ(this);
        AppWidgetLinkProxyActivity.super.onStart();
    }

    public final void onWindowFocusChanged(boolean z) {
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.utils.AppWidgetLinkProxyActivity", "onWindowFocusChanged", true);
        AppWidgetLinkProxyActivity.super.onWindowFocusChanged(z);
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [com.ss.android.ugc.aweme.utils.AppWidgetLinkProxyActivity, X.SNU, android.app.Activity] */
    public final void onStop() {
        8gF.LIZLLL(this);
        AppWidgetLinkProxyActivity.super.onStop();
        if (EnterTransitionCrashOptimizer.getContext() != null) {
            try {
                getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
            } catch (Throwable unused) {
            }
        }
        try {
            getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
        } catch (Throwable unused2) {
        }
    }

    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r15v0, resolved type: com.ss.android.ugc.aweme.utils.AppWidgetLinkProxyActivity} */
    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r15v1, resolved type: X.SNU} */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onCreate(android.os.Bundle r17) {
        /*
            r16 = this;
            r15 = r16
            r15 = r15
            r0 = r17
            X.8gF.LIZ(r15, r0)
            java.lang.String r14 = "com.ss.android.ugc.aweme.utils.AppWidgetLinkProxyActivity"
            java.lang.String r13 = "onCreate"
            r3 = 1
            com.bytedance.apm.agent.v2.instrumentation.ActivityAgent.onTrace(r14, r13, r3)
            com.ss.android.ugc.aweme.utils.AppWidgetLinkProxyActivity.super.onCreate(r0)
            android.content.Intent r2 = r15.getIntent()
            java.lang.String r1 = "extra_jump_type"
            r0 = -1
            int r12 = r2.getIntExtra(r1, r0)
            android.content.Intent r1 = r15.getIntent()
            java.lang.String r0 = "extra_widget_type"
            java.lang.String r11 = LIZ((android.content.Intent) r1, (java.lang.String) r0)
            java.lang.String r10 = ""
            if (r11 != 0) goto L_0x002d
            r11 = r10
        L_0x002d:
            kotlin.h.b.n.LIZIZ(r11, r10)
            java.lang.String r0 = "story_s"
            boolean r0 = kotlin.h.b.n.LIZ(r11, r0)
            r2 = 0
            if (r0 == 0) goto L_0x01ee
            java.lang.String r0 = "story_widget_extension_small"
            r15.LIZ = r0
            java.lang.String r0 = "click_story_widget_extension_small"
            r15.LIZIZ = r0
            X.EWw r1 = X.C3922EWw.LJ
            android.app.Application r0 = r15.getApplication()
            kotlin.h.b.n.LIZIZ(r0, r10)
            r1.LIZ(r0)
            r15.LIZ((int) r12, (boolean) r2)
        L_0x0050:
            java.lang.String r9 = "AppWidgetLinkProxyActivity"
            java.lang.String r0 = "AppWidgetLinkProxyActivity create"
            X.M12.LIZ(r9, r0)
            X.EaK r1 = X.C4024EaK.LIZ
            java.lang.String r0 = "launch_app"
            r1.LIZ((java.lang.String) r0, (java.lang.String) r11)
            com.ss.android.ugc.aweme.ug.IUgCommonService r0 = com.ss.android.ugc.aweme.ug.UgCommonServiceImpl.LJIIL()
            X.LyC r1 = r0.LJII()
            X.FDq r0 = X.C5970FDq.WIDGET
            r1.LIZ(r0, r11)
            java.lang.String r8 = "video_from"
            java.lang.String r7 = "extra_uid"
            java.lang.String r6 = "intent_story_widget_action"
            java.lang.String r5 = "enter_method"
            java.lang.String r4 = "extra_challenge_id"
            java.lang.String r3 = "//main"
            java.lang.String r2 = "id"
            java.lang.String r1 = "enter_from"
            r0 = 268435456(0x10000000, float:2.5243549E-29)
            switch(r12) {
                case 0: goto L_0x01d8;
                case 1: goto L_0x01ac;
                case 2: goto L_0x0150;
                case 3: goto L_0x0138;
                case 4: goto L_0x0080;
                case 5: goto L_0x0116;
                case 6: goto L_0x00f7;
                case 7: goto L_0x00b6;
                case 8: goto L_0x0088;
                default: goto L_0x0080;
            }
        L_0x0080:
            r15.finish()
            r0 = 0
            com.bytedance.apm.agent.v2.instrumentation.ActivityAgent.onTrace(r14, r13, r0)
            return
        L_0x0088:
            android.content.Intent r3 = r15.getIntent()
            java.lang.String r5 = LIZ((android.content.Intent) r3, (java.lang.String) r7)
            if (r5 != 0) goto L_0x0093
            r5 = r10
        L_0x0093:
            kotlin.h.b.n.LIZIZ(r5, r10)
            java.lang.String r3 = "aweme://story/detail"
            com.bytedance.router.SmartRoute r4 = com.bytedance.router.SmartRouter.buildRoute(r15, r3)
            java.lang.String r3 = "STORY_ENTRANCE_COMMON"
            r4.withParam(r8, r3)
            java.lang.String r3 = r15.LIZ
            r4.withParam(r1, r3)
            r4.withParam(r2, r5)
            r1 = r4
            r1.addFlags(r0)
            r0 = 67108864(0x4000000, float:1.5046328E-36)
            r1.addFlags(r0)
            r4.open()
            goto L_0x0080
        L_0x00b6:
            android.content.Intent r3 = r15.getIntent()
            java.lang.String r7 = LIZ((android.content.Intent) r3, (java.lang.String) r7)
            if (r7 != 0) goto L_0x00c1
            r7 = r10
        L_0x00c1:
            kotlin.h.b.n.LIZIZ(r7, r10)
            android.content.Intent r4 = r15.getIntent()
            java.lang.String r3 = "extra_story_id"
            java.lang.String r5 = LIZ((android.content.Intent) r4, (java.lang.String) r3)
            if (r5 != 0) goto L_0x00d1
            r5 = r10
        L_0x00d1:
            kotlin.h.b.n.LIZIZ(r5, r10)
            java.lang.String r3 = "//chat/center"
            com.bytedance.router.SmartRoute r4 = com.bytedance.router.SmartRouter.buildRoute(r15, r3)
            r3 = 1
            r4.withParam(r6, r3)
            r4.withParam(r2, r5)
            java.lang.String r2 = "uid"
            r4.withParam(r2, r7)
            java.lang.String r2 = r15.LIZ
            r4.withParam(r1, r2)
            r4.addFlags(r0)
            r0 = 67108864(0x4000000, float:1.5046328E-36)
            r4.addFlags(r0)
            r4.open()
            goto L_0x0080
        L_0x00f7:
            r4 = 67108864(0x4000000, float:1.5046328E-36)
            com.bytedance.router.SmartRoute r3 = com.bytedance.router.SmartRouter.buildRoute(r15, r3)
            java.lang.String r2 = r15.LIZ
            r3.withParam(r1, r2)
            java.lang.String r1 = r15.LIZIZ
            r3.withParam(r5, r1)
            r1 = 2
            r3.withParam(r6, r1)
            r3.addFlags(r0)
            r3.addFlags(r4)
            r3.open()
            goto L_0x0080
        L_0x0116:
            java.lang.String r2 = java.lang.String.valueOf(r11)
            java.lang.String r0 = "openDefaultCamera: "
            java.lang.String r0 = r0.concat(r2)
            X.M12.LIZ(r9, r0)
            java.lang.String r0 = "aweme://openShoot"
            com.bytedance.router.SmartRoute r2 = com.bytedance.router.SmartRouter.buildRoute(r15, r0)
            java.lang.String r0 = r15.LIZ
            r2.withParam(r1, r0)
            java.lang.String r0 = r15.LIZIZ
            r2.withParam(r5, r0)
            r2.open()
            goto L_0x0080
        L_0x0138:
            java.lang.String r1 = "openKidsMain"
            X.M12.LIZ(r9, r1)
            java.lang.String r1 = "//kids/main"
            com.bytedance.router.SmartRoute r1 = com.bytedance.router.SmartRouter.buildRoute(r15, r1)
            r1.addFlags(r0)
            r0 = 67108864(0x4000000, float:1.5046328E-36)
            r1.addFlags(r0)
            r1.open()
            goto L_0x0080
        L_0x0150:
            r0 = 1
            android.content.Intent r1 = r15.getIntent()
            java.lang.String r0 = "extra_aweme"
            java.io.Serializable r5 = r1.getSerializableExtra(r0)
            boolean r0 = r5 instanceof com.ss.android.ugc.aweme.feed.model.Aweme
            if (r0 != 0) goto L_0x0160
            r5 = 0
        L_0x0160:
            com.ss.android.ugc.aweme.feed.model.Aweme r5 = (com.ss.android.ugc.aweme.feed.model.Aweme) r5
            android.content.Intent r0 = r15.getIntent()
            java.lang.String r3 = LIZ((android.content.Intent) r0, (java.lang.String) r4)
            if (r3 != 0) goto L_0x016d
            r3 = r10
        L_0x016d:
            kotlin.h.b.n.LIZIZ(r3, r10)
            if (r5 == 0) goto L_0x0080
            int r0 = r3.length()
            if (r0 != 0) goto L_0x017a
            goto L_0x0080
        L_0x017a:
            java.lang.String r0 = "aweme://aweme/detail/"
            com.bytedance.router.SmartRoute r4 = com.bytedance.router.SmartRouter.buildRoute(r15, r0)
            java.lang.String r0 = r5.getAid()
            r4.withParam(r2, r0)
            java.lang.String r1 = "refer"
            java.lang.String r0 = "discovery"
            r4.withParam(r1, r0)
            java.lang.String r0 = "from_discovery_challenge"
            r4.withParam(r8, r0)
            java.lang.String r1 = "video_type"
            r0 = 2
            r4.withParam(r1, r0)
            int r1 = r5.getEnterpriseType()
            java.lang.String r0 = "profile_enterprise_type"
            r4.withParam(r0, r1)
            java.lang.String r0 = "challenge_id"
            r4.withParam(r0, r3)
            r4.open()
            goto L_0x0080
        L_0x01ac:
            r0 = 1
            android.content.Intent r0 = r15.getIntent()
            java.lang.String r1 = LIZ((android.content.Intent) r0, (java.lang.String) r4)
            if (r1 == 0) goto L_0x0080
            int r0 = r1.length()
            if (r0 != 0) goto L_0x01bf
            goto L_0x0080
        L_0x01bf:
            java.lang.String r0 = "//challenge/detail"
            com.bytedance.router.SmartRoute r3 = com.bytedance.router.SmartRouter.buildRoute(r15, r0)
            r3.withParam(r2, r1)
            java.lang.String r0 = "extra_challenge_from"
            r3.withParam(r0, r10)
            java.lang.String r1 = "com.ss.android.ugc.aweme.intent.extra.EXTRA_CHALLENGE_TYPE"
            r0 = 0
            r3.withParam(r1, r0)
            r3.open(r0)
            goto L_0x0080
        L_0x01d8:
            java.lang.String r1 = "openMain"
            X.M12.LIZ(r9, r1)
            com.bytedance.router.SmartRoute r1 = com.bytedance.router.SmartRouter.buildRoute(r15, r3)
            r1.addFlags(r0)
            r0 = 67108864(0x4000000, float:1.5046328E-36)
            r1.addFlags(r0)
            r1.open()
            goto L_0x0080
        L_0x01ee:
            java.lang.String r0 = "story_l"
            boolean r0 = kotlin.h.b.n.LIZ(r11, r0)
            if (r0 == 0) goto L_0x0050
            java.lang.String r0 = "story_widget_extension_large"
            r15.LIZ = r0
            java.lang.String r0 = "click_story_widget_extension_large"
            r15.LIZIZ = r0
            X.EWw r1 = X.C3922EWw.LJ
            android.app.Application r0 = r15.getApplication()
            kotlin.h.b.n.LIZIZ(r0, r10)
            r1.LIZ(r0)
            r15.LIZ((int) r12, (boolean) r3)
            goto L_0x0050
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.utils.AppWidgetLinkProxyActivity.onCreate(android.os.Bundle):void");
    }

    public static String LIZ(Intent intent, String str) {
        try {
            return intent.getStringExtra(str);
        } catch (Exception unused) {
            return null;
        }
    }

    private final void LIZ(int i, boolean z) {
        boolean z2;
        if (i == 7 || i == 8) {
            z2 = true;
        } else {
            z2 = false;
        }
        C3922EWw.LJ.LIZ(z2, z);
    }
}
