package com.ss.android.ugc.aweme.kids.homepage.deeplink;

import X.86a;
import X.AnonymousClass3TJ;
import X.SNU;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import com.bytedance.covode.number.Covode;
import java.util.HashMap;
import kotlin.h.b.n;
import kotlin.o.z;

public final class KidsDeepLinkHandlerActivity extends SNU {
    public static final AnonymousClass3TJ Companion = new AnonymousClass3TJ((byte) 0);
    public HashMap _$_findViewCache;
    public String gdLabel = "";
    public boolean isOpenAwemeDetail;
    public boolean mNoMatched;
    public Uri mUri;

    static {
        Covode.recordClassIndex(89723);
    }

    public final void _$_clearFindViewByIdCache() {
        HashMap hashMap = this._$_findViewCache;
        if (hashMap != null) {
            hashMap.clear();
        }
    }

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

    public final void com_ss_android_ugc_aweme_kids_homepage_deeplink_KidsDeepLinkHandlerActivity__onStop$___twin___() {
        KidsDeepLinkHandlerActivity.super.onStop();
    }

    public final void onStop() {
        com_ss_android_ugc_aweme_kids_homepage_deeplink_KidsDeepLinkHandlerActivity_com_ss_android_ugc_aweme_lancet_ActivityEnterTransitionCoordinatorLancet_onStop(this);
    }

    public final boolean getMNoMatched() {
        return this.mNoMatched;
    }

    public final Uri getMUri() {
        return this.mUri;
    }

    public final void onDestroy() {
        KidsDeepLinkHandlerActivity.super.onDestroy();
        this.mNoMatched = false;
    }

    public final void onStart() {
        KidsDeepLinkHandlerActivity.super.onStart();
        finish();
    }

    public final void setMNoMatched(boolean z) {
        this.mNoMatched = z;
    }

    public final void setMUri(Uri uri) {
        this.mUri = uri;
    }

    public final void setTheme(int i) {
        try {
            KidsDeepLinkHandlerActivity.super.setTheme(i);
        } catch (Exception unused) {
        }
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [android.app.Activity, com.ss.android.ugc.aweme.kids.homepage.deeplink.KidsDeepLinkHandlerActivity] */
    /* JADX WARNING: Unknown variable types count: 1 */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public static void com_ss_android_ugc_aweme_kids_homepage_deeplink_KidsDeepLinkHandlerActivity_com_bytedance_sysoptimizer_EnterTransitionLancet_onStop(com.ss.android.ugc.aweme.kids.homepage.deeplink.KidsDeepLinkHandlerActivity r1) {
        /*
            r1.com_ss_android_ugc_aweme_kids_homepage_deeplink_KidsDeepLinkHandlerActivity__onStop$___twin___()
            android.content.Context r0 = com.bytedance.sysoptimizer.EnterTransitionCrashOptimizer.getContext()
            if (r0 == 0) goto L_0x0018
            android.view.Window r0 = r1.getWindow()     // Catch:{ all -> 0x0018 }
            android.view.View r0 = r0.getDecorView()     // Catch:{ all -> 0x0018 }
            android.view.ViewTreeObserver r0 = r0.getViewTreeObserver()     // Catch:{ all -> 0x0018 }
            r0.dispatchOnPreDraw()     // Catch:{ all -> 0x0018 }
        L_0x0018:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.kids.homepage.deeplink.KidsDeepLinkHandlerActivity.com_ss_android_ugc_aweme_kids_homepage_deeplink_KidsDeepLinkHandlerActivity_com_bytedance_sysoptimizer_EnterTransitionLancet_onStop(com.ss.android.ugc.aweme.kids.homepage.deeplink.KidsDeepLinkHandlerActivity):void");
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [android.app.Activity, com.ss.android.ugc.aweme.kids.homepage.deeplink.KidsDeepLinkHandlerActivity] */
    /* JADX WARNING: Unknown variable types count: 1 */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public static void com_ss_android_ugc_aweme_kids_homepage_deeplink_KidsDeepLinkHandlerActivity_com_ss_android_ugc_aweme_lancet_ActivityEnterTransitionCoordinatorLancet_onStop(com.ss.android.ugc.aweme.kids.homepage.deeplink.KidsDeepLinkHandlerActivity r0) {
        /*
            com_ss_android_ugc_aweme_kids_homepage_deeplink_KidsDeepLinkHandlerActivity_com_bytedance_sysoptimizer_EnterTransitionLancet_onStop(r0)
            android.view.Window r0 = r0.getWindow()     // Catch:{ all -> 0x0012 }
            android.view.View r0 = r0.getDecorView()     // Catch:{ all -> 0x0012 }
            android.view.ViewTreeObserver r0 = r0.getViewTreeObserver()     // Catch:{ all -> 0x0012 }
            r0.dispatchOnPreDraw()     // Catch:{ all -> 0x0012 }
        L_0x0012:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.kids.homepage.deeplink.KidsDeepLinkHandlerActivity.com_ss_android_ugc_aweme_kids_homepage_deeplink_KidsDeepLinkHandlerActivity_com_ss_android_ugc_aweme_lancet_ActivityEnterTransitionCoordinatorLancet_onStop(com.ss.android.ugc.aweme.kids.homepage.deeplink.KidsDeepLinkHandlerActivity):void");
    }

    private final boolean parseUri(Intent intent) {
        if (intent == null) {
            return false;
        }
        String action = intent.getAction();
        if (!86a.LIZ(action)) {
            if (action == null) {
                n.LIZIZ();
            }
            if (z.LIZ(action, "com.ss.android.sdk.", 0, false, 6) == 0) {
                String INVOKEVIRTUAL_com_ss_android_ugc_aweme_kids_homepage_deeplink_KidsDeepLinkHandlerActivity_com_ss_android_ugc_aweme_lancet_IntentLancet_getStringExtra = INVOKEVIRTUAL_com_ss_android_ugc_aweme_kids_homepage_deeplink_KidsDeepLinkHandlerActivity_com_ss_android_ugc_aweme_lancet_IntentLancet_getStringExtra(intent, "open_url");
                if (!86a.LIZ(INVOKEVIRTUAL_com_ss_android_ugc_aweme_kids_homepage_deeplink_KidsDeepLinkHandlerActivity_com_ss_android_ugc_aweme_lancet_IntentLancet_getStringExtra)) {
                    try {
                        this.mUri = Uri.parse(INVOKEVIRTUAL_com_ss_android_ugc_aweme_kids_homepage_deeplink_KidsDeepLinkHandlerActivity_com_ss_android_ugc_aweme_lancet_IntentLancet_getStringExtra);
                    } catch (Exception unused) {
                        return false;
                    }
                }
            }
        }
        if (this.mUri == null) {
            this.mUri = intent.getData();
        }
        Uri uri = this.mUri;
        if (uri == null || uri.isOpaque()) {
            return false;
        }
        return true;
    }

    /* JADX WARNING: type inference failed for: r3v0, types: [android.app.Activity] */
    /* JADX WARNING: type inference failed for: r1v2, types: [android.content.Context] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onCreate(android.os.Bundle r5) {
        /*
            r4 = this;
            X.3TH r0 = X.AnonymousClass3TH.LIZ
            r4.activityConfiguration(r0)
            com.ss.android.ugc.aweme.kids.homepage.deeplink.KidsDeepLinkHandlerActivity.super.onCreate(r5)
            X.SfZ r0 = X.SfZ.LJIJ
            r3 = r4
            r0.LIZ(r3)
            android.content.Intent r1 = r4.getIntent()
            boolean r0 = r4.parseUri(r1)
            if (r0 != 0) goto L_0x0022
            boolean r0 = r4.isFinishing()
            if (r0 != 0) goto L_0x0021
            r4.finish()
        L_0x0021:
            return
        L_0x0022:
            android.net.Uri r2 = r1.getData()
            java.lang.String r1 = "gd_label"
            if (r2 == 0) goto L_0x003b
            java.lang.String r0 = r2.getQueryParameter(r1)
            if (r0 == 0) goto L_0x003b
            java.lang.String r0 = r2.getQueryParameter(r1)
            if (r0 != 0) goto L_0x0039
            kotlin.h.b.n.LIZIZ()
        L_0x0039:
            r4.gdLabel = r0
        L_0x003b:
            r1 = r4
            java.lang.String r0 = "//kids/main"
            com.bytedance.router.SmartRoute r0 = com.bytedance.router.SmartRouter.buildRoute(r1, r0)
            r0.open()
            java.lang.String r1 = "amazon_alexa"
            java.lang.String r0 = r4.gdLabel
            boolean r0 = android.text.TextUtils.equals(r1, r0)
            if (r0 != 0) goto L_0x0059
            java.lang.String r1 = "google_assistant"
            java.lang.String r0 = r4.gdLabel
            boolean r0 = android.text.TextUtils.equals(r1, r0)
            if (r0 == 0) goto L_0x0072
        L_0x0059:
            X.3af r2 = new X.3af
            r2.<init>((android.app.Activity) r3)
            android.content.res.Resources r1 = r4.getResources()
            r0 = 2131823693(0x7f110c4d, float:1.9280193E38)
            java.lang.String r0 = r1.getString(r0)
            r2.LIZ((java.lang.CharSequence) r0)
            r2.LIZ()
            X.C30053af.LIZ((X.C30053af) r2)
        L_0x0072:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.kids.homepage.deeplink.KidsDeepLinkHandlerActivity.onCreate(android.os.Bundle):void");
    }

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