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

import X.C474646o;
import X.LeS;
import android.content.Intent;
import com.bytedance.covode.number.Covode;
import com.bytedance.router.interceptor.IInterceptor;
import java.util.ArrayList;

public final class AccountInterceptor implements IInterceptor {
    public static final C474646o LIZ = new C474646o((byte) 0);
    public final ArrayList<String> LIZIZ = LeS.LIZLLL(new String[]{"mobile/phoneNumber", "password/change", "emailBind", "setAltLoginMethod"});

    static {
        Covode.recordClassIndex(103811);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:15:0x003c, code lost:
        if (r6 != null) goto L_0x000d;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final boolean matchInterceptRules(com.bytedance.router.RouteIntent r6) {
        /*
            r5 = this;
            r2 = 0
            if (r6 == 0) goto L_0x003b
            android.net.Uri r0 = r6.getUri()
            if (r0 == 0) goto L_0x003b
            java.lang.String r1 = r0.getHost()
        L_0x000d:
            android.net.Uri r0 = r6.getUri()
            if (r0 == 0) goto L_0x0017
            java.lang.String r2 = r0.getPath()
        L_0x0017:
            java.lang.String r4 = kotlin.h.b.n.LIZ(r1, r2)
            java.util.ArrayList<java.lang.String> r0 = r5.LIZIZ
            java.util.Iterator r3 = r0.iterator()
        L_0x0021:
            boolean r0 = r3.hasNext()
            r2 = 0
            if (r0 == 0) goto L_0x003f
            java.lang.Object r1 = r3.next()
            java.lang.String r1 = (java.lang.String) r1
            java.lang.String r0 = ""
            kotlin.h.b.n.LIZIZ(r1, r0)
            boolean r0 = kotlin.o.y.LIZIZ(r4, r1, r2)
            if (r0 == 0) goto L_0x0021
            r0 = 1
            return r0
        L_0x003b:
            r1 = r2
            if (r6 == 0) goto L_0x0017
            goto L_0x000d
        L_0x003f:
            return r2
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.router.AccountInterceptor.matchInterceptRules(com.bytedance.router.RouteIntent):boolean");
    }

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

    /* JADX WARNING: Code restructure failed: missing block: B:102:0x01d5, code lost:
        if (r16 != null) goto L_0x004b;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:44:0x009d, code lost:
        if (r16 != null) goto L_0x007a;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:57:0x00d1, code lost:
        if (r16 != null) goto L_0x00ae;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:95:0x01b0, code lost:
        if (r16 != null) goto L_0x00e2;
     */
    /* JADX WARNING: Removed duplicated region for block: B:100:0x01c8  */
    /* JADX WARNING: Removed duplicated region for block: B:101:0x01d4  */
    /* JADX WARNING: Removed duplicated region for block: B:13:0x0027  */
    /* JADX WARNING: Removed duplicated region for block: B:25:0x0047  */
    /* JADX WARNING: Removed duplicated region for block: B:28:0x0051  */
    /* JADX WARNING: Removed duplicated region for block: B:31:0x0062  */
    /* JADX WARNING: Removed duplicated region for block: B:33:0x006e  */
    /* JADX WARNING: Removed duplicated region for block: B:42:0x0090  */
    /* JADX WARNING: Removed duplicated region for block: B:46:0x00a2  */
    /* JADX WARNING: Removed duplicated region for block: B:55:0x00c4  */
    /* JADX WARNING: Removed duplicated region for block: B:59:0x00d6  */
    /* JADX WARNING: Removed duplicated region for block: B:68:0x00f8  */
    /* JADX WARNING: Removed duplicated region for block: B:85:0x0142  */
    /* JADX WARNING: Removed duplicated region for block: B:88:0x014c  */
    /* JADX WARNING: Removed duplicated region for block: B:91:0x01a7  */
    /* JADX WARNING: Removed duplicated region for block: B:99:0x01bd  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final boolean onInterceptRoute(android.content.Context r15, com.bytedance.router.RouteIntent r16) {
        /*
            r14 = this;
            r9 = r15
            boolean r0 = r9 instanceof android.app.Activity
            r7 = 0
            if (r0 == 0) goto L_0x01df
            r3 = 0
            if (r16 == 0) goto L_0x01dc
            android.net.Uri r1 = r16.getUri()
            if (r1 == 0) goto L_0x0017
            java.lang.String r0 = "enter_from"
            java.lang.String r10 = r1.getQueryParameter(r0)
            if (r10 != 0) goto L_0x0023
        L_0x0017:
            android.content.Intent r1 = r16.getExtra()
            if (r1 == 0) goto L_0x01dc
            java.lang.String r0 = "enterFrom"
            java.lang.String r10 = LIZ(r1, r0)
        L_0x0023:
            java.lang.String r6 = ""
            if (r10 != 0) goto L_0x0028
            r10 = r6
        L_0x0028:
            kotlin.h.b.n.LIZIZ(r10, r6)
            if (r16 == 0) goto L_0x003b
            android.net.Uri r1 = r16.getUri()
            if (r1 == 0) goto L_0x003b
            java.lang.String r0 = "enter_method"
            java.lang.String r11 = r1.getQueryParameter(r0)
            if (r11 != 0) goto L_0x003c
        L_0x003b:
            r11 = r6
        L_0x003c:
            kotlin.h.b.n.LIZIZ(r11, r6)
            if (r16 == 0) goto L_0x01d4
            android.net.Uri r0 = r16.getUri()
            if (r0 == 0) goto L_0x01d4
            java.lang.String r1 = r0.getHost()
        L_0x004b:
            android.net.Uri r0 = r16.getUri()
            if (r0 == 0) goto L_0x01d9
            java.lang.String r0 = r0.getPath()
        L_0x0055:
            java.lang.String r1 = kotlin.h.b.n.LIZ(r1, r0)
            java.lang.String r0 = "setAltLoginMethod"
            boolean r1 = kotlin.o.y.LIZIZ(r1, r0, r7)
            r0 = 1
            if (r1 == 0) goto L_0x006e
            com.ss.android.ugc.aweme.IBindService r8 = X.C474046i.LIZLLL()
            android.app.Activity r9 = (android.app.Activity) r9
            r12 = 0
            r13 = 0
            r8.bindMobileOrEmailAndSetPwd(r9, r10, r11, r12, r13)
        L_0x006d:
            return r0
        L_0x006e:
            if (r16 == 0) goto L_0x009c
            android.net.Uri r1 = r16.getUri()
            if (r1 == 0) goto L_0x009c
            java.lang.String r2 = r1.getHost()
        L_0x007a:
            android.net.Uri r1 = r16.getUri()
            if (r1 == 0) goto L_0x00a0
            java.lang.String r1 = r1.getPath()
        L_0x0084:
            java.lang.String r2 = kotlin.h.b.n.LIZ(r2, r1)
            java.lang.String r1 = "mobile/phoneNumber"
            boolean r1 = kotlin.o.y.LIZIZ(r2, r1, r7)
            if (r1 == 0) goto L_0x00a2
            com.ss.android.ugc.aweme.IBindService r8 = X.C474046i.LIZLLL()
            android.app.Activity r9 = (android.app.Activity) r9
            r12 = 0
            r13 = 0
            r8.bindMobile(r9, r10, r11, r12, r13)
            goto L_0x006d
        L_0x009c:
            r2 = r3
            if (r16 == 0) goto L_0x00a0
            goto L_0x007a
        L_0x00a0:
            r1 = r3
            goto L_0x0084
        L_0x00a2:
            if (r16 == 0) goto L_0x00d0
            android.net.Uri r1 = r16.getUri()
            if (r1 == 0) goto L_0x00d0
            java.lang.String r2 = r1.getHost()
        L_0x00ae:
            android.net.Uri r1 = r16.getUri()
            if (r1 == 0) goto L_0x00d4
            java.lang.String r1 = r1.getPath()
        L_0x00b8:
            java.lang.String r2 = kotlin.h.b.n.LIZ(r2, r1)
            java.lang.String r1 = "password/change"
            boolean r1 = kotlin.o.y.LIZIZ(r2, r1, r7)
            if (r1 == 0) goto L_0x00d6
            X.S60 r8 = X.C474046i.LJ()
            android.app.Activity r9 = (android.app.Activity) r9
            r12 = 0
            r13 = 0
            r8.changePassword(r9, r10, r11, r12, r13)
            goto L_0x006d
        L_0x00d0:
            r2 = r3
            if (r16 == 0) goto L_0x00d4
            goto L_0x00ae
        L_0x00d4:
            r1 = r3
            goto L_0x00b8
        L_0x00d6:
            if (r16 == 0) goto L_0x01af
            android.net.Uri r1 = r16.getUri()
            if (r1 == 0) goto L_0x01af
            java.lang.String r2 = r1.getHost()
        L_0x00e2:
            android.net.Uri r1 = r16.getUri()
            if (r1 == 0) goto L_0x01b4
            java.lang.String r1 = r1.getPath()
        L_0x00ec:
            java.lang.String r2 = kotlin.h.b.n.LIZ(r2, r1)
            java.lang.String r1 = "emailBind"
            boolean r1 = kotlin.o.y.LIZIZ(r2, r1, r7)
            if (r1 == 0) goto L_0x006d
            com.ss.android.ugc.aweme.framework.services.IUserService r1 = com.ss.android.ugc.aweme.services.BaseUserService.createIUserServicebyMonsterPlugin(r7)
            kotlin.h.b.n.LIZIZ(r1, r6)
            com.ss.android.ugc.aweme.profile.model.User r4 = r1.getCurrentUser()
            if (r16 == 0) goto L_0x01ac
            android.content.Intent r2 = r16.getExtra()
            if (r2 == 0) goto L_0x01ac
            java.lang.String r1 = "enableSwitchPhone"
            java.lang.String r2 = LIZ(r2, r1)
        L_0x0111:
            java.lang.String r1 = "1"
            boolean r1 = kotlin.o.y.LIZ((java.lang.String) r2, (java.lang.String) r1, (boolean) r7)
            if (r1 == 0) goto L_0x01a9
            kotlin.h.b.n.LIZIZ(r4, r6)
            boolean r1 = r4.isPhoneBinded()
            if (r1 != 0) goto L_0x01a9
            r2 = 1
        L_0x0123:
            android.os.Bundle r12 = new android.os.Bundle
            r12.<init>()
            if (r16 == 0) goto L_0x0135
            android.content.Intent r1 = r16.getExtra()
            if (r1 == 0) goto L_0x0135
            java.lang.String r1 = "use_phone"
            r12.putBoolean(r1, r2)
        L_0x0135:
            com.ss.android.ugc.aweme.IAccountUserService r1 = X.C474046i.LJFF()
            kotlin.h.b.n.LIZIZ(r1, r6)
            com.ss.android.ugc.aweme.profile.model.User r1 = r1.getCurUser()
            if (r1 == 0) goto L_0x01a7
            java.lang.String r8 = r1.getEmail()
        L_0x0146:
            boolean r1 = android.text.TextUtils.isEmpty(r8)
            if (r1 != 0) goto L_0x01b7
            com.ss.android.ugc.aweme.IAccountUserService r1 = X.C474046i.LJFF()
            kotlin.h.b.n.LIZIZ(r1, r6)
            com.ss.android.ugc.aweme.profile.model.User r1 = r1.getCurUser()
            kotlin.h.b.n.LIZIZ(r1, r6)
            boolean r1 = r1.isEmailVerified()
            if (r1 == 0) goto L_0x01b7
            X.4vl r5 = new X.4vl
            r5.<init>(r9)
            r1 = 2131823150(0x7f110a2e, float:1.9279092E38)
            r5.LIZJ(r1)
            java.util.Locale r4 = java.util.Locale.US
            r1 = 2131823149(0x7f110a2d, float:1.927909E38)
            java.lang.String r2 = r9.getString(r1)
            kotlin.h.b.n.LIZIZ(r2, r6)
            java.lang.Object[] r1 = new java.lang.Object[r0]
            r1[r7] = r8
            java.lang.Object[] r1 = java.util.Arrays.copyOf(r1, r0)
            java.lang.String r1 = X.0HH.LIZ(r4, r2, r1)
            kotlin.h.b.n.LIZIZ(r1, r6)
            r5.LIZLLL((java.lang.CharSequence) r1)
            r2 = 2131827577(0x7f111b79, float:1.928807E38)
            X.46n r1 = new X.46n
            r1.<init>(r9, r10, r12)
            r5.LIZIZ((int) r2, (android.content.DialogInterface.OnClickListener) r1)
            r1 = 2131822315(0x7f1106eb, float:1.9277398E38)
            r5.LIZJ(r1, r3)
            X.4vk r1 = r5.LIZ()
            android.app.Dialog r1 = r1.LIZJ()
            X.AnonymousClass4FQ.LIZ((android.app.Dialog) r1)
            goto L_0x006d
        L_0x01a7:
            r8 = r3
            goto L_0x0146
        L_0x01a9:
            r2 = 0
            goto L_0x0123
        L_0x01ac:
            r2 = r3
            goto L_0x0111
        L_0x01af:
            r2 = r3
            if (r16 == 0) goto L_0x01b4
            goto L_0x00e2
        L_0x01b4:
            r1 = r3
            goto L_0x00ec
        L_0x01b7:
            boolean r1 = android.text.TextUtils.isEmpty(r8)
            if (r1 != 0) goto L_0x01c8
            com.ss.android.ugc.aweme.IBindService r1 = X.C474046i.LIZLLL()
            android.app.Activity r9 = (android.app.Activity) r9
            r1.verifyEmail(r9, r10, r12, r3)
            goto L_0x006d
        L_0x01c8:
            com.ss.android.ugc.aweme.IBindService r8 = X.C474046i.LIZLLL()
            android.app.Activity r9 = (android.app.Activity) r9
            r13 = 0
            r8.bindEmail(r9, r10, r11, r12, r13)
            goto L_0x006d
        L_0x01d4:
            r1 = r3
            if (r16 == 0) goto L_0x01d9
            goto L_0x004b
        L_0x01d9:
            r0 = r3
            goto L_0x0055
        L_0x01dc:
            r10 = r3
            goto L_0x0023
        L_0x01df:
            return r7
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.router.AccountInterceptor.onInterceptRoute(android.content.Context, com.bytedance.router.RouteIntent):boolean");
    }
}
