WeChat.apk(点击下载) / SDKOAuthUI.java


package com.tencent.mm.plugin.webview.ui.tools;

import android.content.Intent;
import android.content.pm.Signature;
import android.content.res.Configuration;
import android.graphics.Paint;
import android.net.Uri;
import android.os.Bundle;
import android.text.Spannable;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.view.ContextMenu;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewStub;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import androidx.appcompat.app.ActionBar;
import bw3.bl4;
import bw3.df0;
import bw3.f74;
import bw3.oq3;
import bw3.qu3;
import bw3.rq3;
import bw3.ru3;
import bw3.sq3;
import bw3.zk4;
import com.tencent.mm.R;
import com.tencent.mm.autogen.events.GetAppSettingEvent;
import com.tencent.mm.opensdk.channel.MMessageActV2;
import com.tencent.mm.opensdk.constants.ConstantsAPI;
import com.tencent.mm.opensdk.modelmsg.SendAuth;
import com.tencent.mm.plugin.webview.core.v;
import com.tencent.mm.plugin.webview.core.x;
import com.tencent.mm.plugin.webview.model.a1;
import com.tencent.mm.plugin.webview.model.c1;
import com.tencent.mm.plugin.webview.model.j0;
import com.tencent.mm.plugin.webview.model.k0;
import com.tencent.mm.plugin.webview.model.l0;
import com.tencent.mm.plugin.webview.model.z0;
import com.tencent.mm.sdk.platformtools.Log;
import com.tencent.mm.sdk.platformtools.MMApplicationContext;
import com.tencent.mm.sdk.platformtools.NetStatusUtil;
import com.tencent.mm.sdk.platformtools.Util;
import com.tencent.mm.ui.MMActivity;
import com.tencent.mm.ui.base.MMFormInputView;
import com.tencent.mm.ui.component.UIComponent;
import com.tencent.mm.ui.x4;
import com.tencent.xweb.updater.XWebUpdater;
import d60.z;
import gh.g;
import i14.a;
import i14.j;
import i14.p0;
import ih.n2;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Set;
import lh4.m;
import ln.l;
import p64.i0;
import rg0.c;
import u64.c;
import wq3.b;
import yf0.n;
import yf0.y;

@a(3)
@c(0)
public final class SDKOAuthUI extends MMActivity implements n {
    public static int J;
    public String A;
    public String B;
    public int C;
    public int D;
    public String E;
    public String F;
    public SendAuth.Options G;
    public LinkedList<String> H = new LinkedList<>();
    public p0 I = new SDKOAuthUI$$c(this);

    /* renamed from: e  reason: collision with root package name */
    public String f166290e;

    /* renamed from: f  reason: collision with root package name */
    public SendAuth.Req f166291f;

    /* renamed from: g  reason: collision with root package name */
    public int f166292g;

    /* renamed from: h  reason: collision with root package name */
    public int f166293h;

    /* renamed from: i  reason: collision with root package name */
    public int f166294i;

    /* renamed from: j  reason: collision with root package name */
    public i0 f166295j;

    /* renamed from: n  reason: collision with root package name */
    public SDKOAuthUI$$f f166296n;

    /* renamed from: o  reason: collision with root package name */
    public t64.a f166297o;

    /* renamed from: p  reason: collision with root package name */
    public OpenSdkFaceDetectInfoLayout f166298p;

    /* renamed from: q  reason: collision with root package name */
    public boolean f166299q;

    /* renamed from: r  reason: collision with root package name */
    public int f166300r = 0;

    /* renamed from: s  reason: collision with root package name */
    public boolean f166301s;

    /* renamed from: t  reason: collision with root package name */
    public c1 f166302t;

    /* renamed from: u  reason: collision with root package name */
    public long f166303u;

    /* renamed from: v  reason: collision with root package name */
    public boolean f166304v = true;

    /* renamed from: w  reason: collision with root package name */
    public boolean f166305w = false;

    /* renamed from: x  reason: collision with root package name */
    public String f166306x;

    /* renamed from: y  reason: collision with root package name */
    public String f166307y;

    /* renamed from: z  reason: collision with root package name */
    public int f166308z = 2;

    /* JADX DEBUG: Failed to insert an additional move for type inference into block B:80:0x0094 */
    /* JADX DEBUG: Failed to insert an additional move for type inference into block B:84:0x018e */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r3v3 */
    /* JADX WARN: Type inference failed for: r3v4 */
    /* JADX WARN: Type inference failed for: r0v3 */
    /* JADX WARN: Type inference failed for: r0v4 */
    /* JADX WARN: Type inference failed for: r15v2 */
    /* JADX WARN: Type inference failed for: r15v3 */
    /* JADX WARN: Type inference failed for: r15v4 */
    /* JADX WARN: Type inference failed for: r15v5 */
    /* JADX WARN: Type inference failed for: r15v6 */
    /* JADX WARN: Type inference failed for: r15v7 */
    /* JADX WARN: Type inference failed for: r4v10 */
    /* JADX WARN: Type inference failed for: r0v35 */
    /* JADX WARN: Type inference failed for: r4v11 */
    /* JADX WARN: Type inference failed for: r4v12 */
    /* JADX WARN: Type inference failed for: r3v21 */
    /* JADX WARNING: Unknown variable types count: 5 */
    public static void T7(SDKOAuthUI sDKOAuthUI, rq3 rq32, bl4 bl42, boolean z15) {
        ?? r35;
        String str;
        ?? r05;
        ?? r15;
        ?? r152;
        boolean z16;
        ?? r45;
        sDKOAuthUI.getClass();
        if (rq32 == null) {
            Log.e("MicroMsg.SdkOAuthUI", "fillNewOauthPage: do not get scope request for user info");
            return;
        }
        Log.i("MicroMsg.SdkOAuthUI", "disagreeBtnCallback click");
        Iterator<rq3> it = bl42.f17366d.iterator();
        while (true) {
            if (it.hasNext()) {
                if (c1.p(it.next())) {
                    r35 = true;
                    break;
                }
            } else {
                r35 = false;
                break;
            }
        }
        if (r35 == true) {
            if (z15) {
                c1.a(bl42, sDKOAuthUI.H);
                Log.i("MicroMsg.SdkOAuthUI", "add scopes to userHasSelectedScopes, userHasSelectedScopes = %s", c1.k(sDKOAuthUI.H));
            }
            if (z15 || rq32.f35604f != 3) {
                Iterator<rq3> it4 = bl42.f17366d.iterator();
                while (true) {
                    str = "snsapi_wxaapp_info";
                    if (!it4.hasNext()) {
                        r05 = false;
                        break;
                    }
                    rq3 next = it4.next();
                    if (next != null && ("snsapi_friend".equals(next.f35602d) || str.equals(next.f35602d))) {
                        r45 = true;
                        continue;
                    } else {
                        r45 = false;
                        continue;
                    }
                    if (r45 == true) {
                        r05 = true;
                        break;
                    }
                }
                if (r05 == true || c1.m(bl42)) {
                    b.INSTANCE.a(sDKOAuthUI.f166290e, sDKOAuthUI.f166303u, z15 ? 1 : 0, sDKOAuthUI.f166308z, 2, 1, 0);
                    Iterator<rq3> it5 = bl42.f17366d.iterator();
                    while (true) {
                        if (!it5.hasNext()) {
                            r15 = false;
                            break;
                        }
                        rq3 next2 = it5.next();
                        if (next2 != null && ("snsapi_friend".equals(next2.f35602d) || str.equals(next2.f35602d))) {
                            r152 = true;
                            continue;
                        } else {
                            r152 = false;
                            continue;
                        }
                        if (r152 == true) {
                            r15 = true;
                            break;
                        }
                    }
                    if (r15 == true) {
                        if (c1.n("snsapi_friend", bl42.f17366d) != null) {
                            str = "snsapi_friend";
                        } else if (c1.n(str, bl42.f17366d) == null) {
                            str = "";
                        }
                        Log.i("MicroMsg.SdkOAuthUI", "has friend info, scope = %s", str);
                        sDKOAuthUI.h8(bl42, SDKOAuthFriendUI.class, sDKOAuthUI.f166296n.f166319h, 0, str);
                    } else if (c1.m(bl42)) {
                        Log.i("MicroMsg.SdkOAuthUI", "has other info");
                        sDKOAuthUI.h8(bl42, SDKOAuthOtherUI.class, sDKOAuthUI.f166296n.f166319h, 0, "");
                    }
                    c1.f(sDKOAuthUI);
                    return;
                }
                Log.i("MicroMsg.SdkOAuthUI", "only show page 1");
                if (c1.b(bl42, sDKOAuthUI.f166305w).booleanValue()) {
                    Log.i("MicroMsg.SdkOAuthUI", "go to SDKOAuthAppDataUI");
                    sDKOAuthUI.h8(bl42, SDKOAuthAppDataUI.class, sDKOAuthUI.f166296n.f166319h, 7, "snsapi_friend");
                    c1.f(sDKOAuthUI);
                } else if (z15) {
                    Log.i("MicroMsg.SdkOAuthUI", "check policy and try to send result");
                    LinkedList<String> linkedList = new LinkedList<>();
                    c1.a(bl42, linkedList);
                    Log.i("MicroMsg.SdkOAuthUI", "try to send result, isFromQRCodeScan = %s, scopeSize = %s", Boolean.valueOf(sDKOAuthUI.f166305w), Integer.valueOf(sDKOAuthUI.H.size()));
                    sDKOAuthUI.W7();
                    sDKOAuthUI.f166295j = j.Q(sDKOAuthUI, null, sDKOAuthUI.getString(R.string.f367656zq), true, true, new i0(sDKOAuthUI));
                    if (sDKOAuthUI.f166305w) {
                        sDKOAuthUI.f166302t.h(1, linkedList, sDKOAuthUI.f166296n.f166319h, sDKOAuthUI.f166307y);
                        return;
                    }
                    SendAuth.Req req = sDKOAuthUI.f166291f;
                    if (req != null) {
                        z16 = req.isOption1;
                    } else {
                        z16 = false;
                    }
                    sDKOAuthUI.f166302t.i(1, linkedList, sDKOAuthUI.f166296n.f166319h, sDKOAuthUI.A, sDKOAuthUI.C, null, Boolean.FALSE, z16);
                } else {
                    Log.i("MicroMsg.SdkOAuthUI", "only page 1 + no need to show appDataUI => cancel");
                    sDKOAuthUI.U7(-4);
                    sDKOAuthUI.finish();
                }
            } else {
                Log.i("MicroMsg.SdkOAuthUI", "user disagree + but must agree => cancel");
                sDKOAuthUI.U7(-4);
                sDKOAuthUI.finish();
            }
        }
    }

    public final void U7(int i15) {
        Log.i("MicroMsg.SdkOAuthUI", "dealWithCancel");
        if (this.f166305w) {
            z.d().f(new j0(2, this.f166307y, null, 0));
        } else if (this.f166291f != null) {
            String Y7 = Y7(this.f166290e);
            String str = this.f166290e;
            SendAuth.Req req = this.f166291f;
            z.d().f(new l0(2, str, req.state, Y7, null, 0, req.extData, this.f166302t.f165483i, this.A, this.C, req.isOption1));
            SendAuth.Resp resp = new SendAuth.Resp();
            SendAuth.Req req2 = this.f166291f;
            resp.transaction = req2.transaction;
            resp.errCode = i15;
            resp.lang = "zh_CN";
            resp.country = "";
            resp.state = req2.state;
            X7(Y7, resp);
        }
    }

    public final void V7(int i15, String str) {
        String Y7 = Y7(this.f166290e);
        if (Util.isNullOrNil(Y7)) {
            Log.e("MicroMsg.SdkOAuthUI", "dealWithError pkg nil");
            return;
        }
        SendAuth.Resp resp = new SendAuth.Resp();
        SendAuth.Req req = this.f166291f;
        resp.transaction = req.transaction;
        resp.errCode = i15;
        resp.errStr = str;
        resp.lang = "zh_CN";
        resp.country = "";
        resp.state = req.state;
        X7(Y7, resp);
    }

    public final void W7() {
        i0 i0Var = this.f166295j;
        if (i0Var != null) {
            i0Var.dismiss();
        }
    }

    public final void X7(String str, SendAuth.Resp resp) {
        if (this.f166299q) {
            Log.i("MicroMsg.SdkOAuthUI", "doCallback has callback");
        } else if (Util.isNullOrNil(str)) {
            Log.i("MicroMsg.SdkOAuthUI", "doCallback pkg is empty");
        } else {
            this.f166299q = true;
            this.f166302t.f165480f = true;
            Bundle bundle = new Bundle();
            resp.toBundle(bundle);
            com.tencent.mm.pluginsdk.model.app.j0.g(bundle);
            MMessageActV2.Args args = new MMessageActV2.Args();
            args.targetPkgName = str;
            args.bundle = bundle;
            SendAuth.Options options = this.G;
            if (options != null && !Util.isNullOrNil(options.callbackClassName)) {
                Log.i("MicroMsg.SdkOAuthUI", "doCallback options.callbackClassName:" + this.G.callbackClassName + "  options.callbackFlags:" + this.G.callbackFlags);
                SendAuth.Options options2 = this.G;
                args.targetClassName = options2.callbackClassName;
                args.flags = options2.callbackFlags;
            }
            Log.i("MicroMsg.SdkOAuthUI", "doCallback pkg:" + str);
            MMessageActV2.send(this, args);
        }
    }

    public final String Y7(String str) {
        com.tencent.mm.pluginsdk.model.app.j u602 = ((l) yz3.j.c(l.class)).u60(str, false);
        if (u602 != null) {
            return u602.field_packageName;
        }
        Log.w("MicroMsg.SdkOAuthUI", "dealWithCancel getAppInfo null; appid: %s", str);
        return null;
    }

    public final int Z7() {
        return this.f166304v ? 2 : 1;
    }

    public final void a8() {
        if (!this.f166301s) {
            if (this.f166296n.getCount() >= J) {
                View findViewById = findViewById(R.id.f362818cm4);
                k30.a aVar = new k30.a();
                ThreadLocal<k30.a> threadLocal = k30.c.f244265a;
                aVar.c(8);
                j30.a.d(findViewById, aVar.b(), "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "handleAvatarBound", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                findViewById.setVisibility(((Integer) aVar.a(0)).intValue());
                j30.a.e(findViewById, "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "handleAvatarBound", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                View findViewById2 = findViewById(R.id.otw);
                k30.a aVar2 = new k30.a();
                aVar2.c(0);
                j30.a.d(findViewById2, aVar2.b(), "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "handleAvatarBound", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                findViewById2.setVisibility(((Integer) aVar2.a(0)).intValue());
                j30.a.e(findViewById2, "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "handleAvatarBound", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                View findViewById3 = findViewById(R.id.otx);
                k30.a aVar3 = new k30.a();
                aVar3.c(4);
                j30.a.d(findViewById3, aVar3.b(), "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "handleAvatarBound", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                findViewById3.setVisibility(((Integer) aVar3.a(0)).intValue());
                j30.a.e(findViewById3, "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "handleAvatarBound", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                return;
            }
            View findViewById4 = findViewById(R.id.f362818cm4);
            k30.a aVar4 = new k30.a();
            ThreadLocal<k30.a> threadLocal2 = k30.c.f244265a;
            aVar4.c(0);
            j30.a.d(findViewById4, aVar4.b(), "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "handleAvatarBound", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
            findViewById4.setVisibility(((Integer) aVar4.a(0)).intValue());
            j30.a.e(findViewById4, "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "handleAvatarBound", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
            View findViewById5 = findViewById(R.id.otw);
            k30.a aVar5 = new k30.a();
            aVar5.c(8);
            j30.a.d(findViewById5, aVar5.b(), "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "handleAvatarBound", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
            findViewById5.setVisibility(((Integer) aVar5.a(0)).intValue());
            j30.a.e(findViewById5, "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "handleAvatarBound", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
            View findViewById6 = findViewById(R.id.otx);
            k30.a aVar6 = new k30.a();
            aVar6.c(0);
            j30.a.d(findViewById6, aVar6.b(), "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "handleAvatarBound", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
            findViewById6.setVisibility(((Integer) aVar6.a(0)).intValue());
            j30.a.e(findViewById6, "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "handleAvatarBound", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
        }
    }

    public final boolean b8(int i15) {
        if (i15 == 1 || i15 == 2 || i15 == 7 || i15 == 8) {
            Log.e("MicroMsg.SdkOAuthUI", "isNetworkAvailable false, errType = " + i15);
            return false;
        } else if (NetStatusUtil.isConnected(MMApplicationContext.getContext())) {
            return true;
        } else {
            Log.e("MicroMsg.SdkOAuthUI", "isNetworkAvailable false, not connected");
            return false;
        }
    }

    public final boolean c8() {
        int i15 = this.f166300r;
        return i15 == 3 || i15 == 2;
    }

    /* JADX WARNING: Removed duplicated region for block: B:47:0x0254 A[RETURN] */
    /* JADX WARNING: Removed duplicated region for block: B:48:0x0255  */
    public final void d8(int i15, int i16, String str, bl4 bl42) {
        boolean z15;
        boolean z16;
        df0 df02;
        b bVar = b.INSTANCE;
        Log.i("MicroMsg.SdkOAuthUI", "onSDKOauthAuthorizeEnd errType:%d errCode:%d", Integer.valueOf(i15), Integer.valueOf(i16));
        W7();
        if (i15 == 0 && i16 == 0) {
            Object[] objArr = new Object[2];
            objArr[0] = Boolean.valueOf(bl42.f17374o);
            xv3.b bVar2 = bl42.f17383x;
            objArr[1] = Integer.valueOf(bVar2 != null ? bVar2.f341419a.length : 0);
            Log.i("MicroMsg.SdkOAuthUI", "onSDKOauthAuthorizeEnd is_use_newpage %b, bufferSize=%d", objArr);
            if (this.f166300r == 0) {
                qu3 qu32 = new qu3();
                v.b bVar3 = v.f164638a;
                if (n2.a() && x.a().getInt("OpenSdkOpenFaceDetect", 0) == 1) {
                    qu32.f34643d = true;
                    qu32.f34644e = "wxd8c59133dfcbfc70";
                    df0 df03 = new df0();
                    qu32.f34645f = df03;
                    df03.f19269d = "同意微信使用上述信息进行人脸识别认证,用于微信登录功能的安全验证,详见";
                    df03.f19270e = "https://mp.weixin.qq.com/mp/readtemplate?t=face_verify/agreement1&bizname=%E5%BE%AE%E4%BF%A1%E5%9F%8E%E5%B8%82%E6%9C%8D%E5%8A%A1&lang=zh_CN";
                    df03.f19271f = "《个人信息处理说明》";
                } else {
                    xv3.b bVar4 = bl42.C;
                    if (bVar4 != null) {
                        byte[] bArr = bVar4.f341419a;
                        if (bArr.length > 0) {
                            try {
                                qu32.parseFrom(bArr);
                            } catch (Exception e15) {
                                Log.i("MicroMsg.SdkOAuthUI", "checkNeedFaceDetect ex %s", e15.getMessage());
                            }
                        }
                    }
                    Log.i("MicroMsg.SdkOAuthUI", "checkNeedFaceDetect verifyBuffer is empty");
                }
                Log.i("MicroMsg.SdkOAuthUI", "checkNeedFaceDetect shouldFaceDetect %b, appId %s", Boolean.valueOf(qu32.f34643d), qu32.f34644e);
                if (qu32.f34643d && (df02 = qu32.f34645f) != null && !Util.isNullOrNil(df02.f19269d) && !Util.isNullOrNil(qu32.f34644e)) {
                    ActionBar supportActionBar = getSupportActionBar();
                    if (supportActionBar != null) {
                        supportActionBar.L();
                    }
                    setBackBtn(new SDKOAuthUI$$a(this), R.raw.actionbar_icon_dark_back);
                    if (this.f166298p == null) {
                        this.f166298p = (OpenSdkFaceDetectInfoLayout) ((ViewStub) findViewById(R.id.f364957p23)).inflate();
                    }
                    OpenSdkFaceDetectInfoLayout openSdkFaceDetectInfoLayout = (OpenSdkFaceDetectInfoLayout) findViewById(R.id.f362994dn2);
                    this.f166298p = openSdkFaceDetectInfoLayout;
                    openSdkFaceDetectInfoLayout.setVisibility(0);
                    OpenSdkFaceDetectInfoLayout openSdkFaceDetectInfoLayout2 = this.f166298p;
                    openSdkFaceDetectInfoLayout2.getClass();
                    String str2 = qu32.f34644e;
                    m.f(str2, "openSdkFaceDetectInfo.app_id");
                    openSdkFaceDetectInfoLayout2.f166203i = str2;
                    x4.n0(((TextView) openSdkFaceDetectInfoLayout2.getRootContentView().findViewById(R.id.dn8)).getPaint());
                    View findViewById = openSdkFaceDetectInfoLayout2.getRootContentView().findViewById(R.id.dmv);
                    m.f(findViewById, "rootContentView.findView…onfirm_protocol_checkbox)");
                    openSdkFaceDetectInfoLayout2.setProtocolCheckBox((CheckBox) findViewById);
                    MMFormInputView mMFormInputView = (MMFormInputView) openSdkFaceDetectInfoLayout2.getRootContentView().findViewById(R.id.dn5);
                    mMFormInputView.setHint(R.string.f369110ic3);
                    MMFormInputView mMFormInputView2 = (MMFormInputView) openSdkFaceDetectInfoLayout2.getRootContentView().findViewById(R.id.dn4);
                    mMFormInputView2.setHint(R.string.ic6);
                    EditText contentEditText = mMFormInputView.getContentEditText();
                    m.f(contentEditText, "nameInput.contentEditText");
                    openSdkFaceDetectInfoLayout2.setNameEt(contentEditText);
                    EditText contentEditText2 = mMFormInputView2.getContentEditText();
                    m.f(contentEditText2, "idCardInput.contentEditText");
                    openSdkFaceDetectInfoLayout2.setIdCardEt(contentEditText2);
                    p54.c b15 = p54.c.b(openSdkFaceDetectInfoLayout2.getIdCardEt());
                    b15.f280695f = 0;
                    b15.f280694e = 18;
                    b15.d(null);
                    View findViewById2 = openSdkFaceDetectInfoLayout2.getRootContentView().findViewById(R.id.ngn);
                    m.f(findViewById2, "rootContentView.findView…start_face_detect_button)");
                    openSdkFaceDetectInfoLayout2.setNextBt((Button) findViewById2);
                    openSdkFaceDetectInfoLayout2.getNextBt().setOnClickListener(new m(openSdkFaceDetectInfoLayout2));
                    openSdkFaceDetectInfoLayout2.getNameEt().addTextChangedListener(openSdkFaceDetectInfoLayout2.f166204j);
                    openSdkFaceDetectInfoLayout2.getIdCardEt().addTextChangedListener(openSdkFaceDetectInfoLayout2.f166204j);
                    openSdkFaceDetectInfoLayout2.getNameEt().setOnEditorActionListener(new n(openSdkFaceDetectInfoLayout2));
                    openSdkFaceDetectInfoLayout2.getIdCardEt().setOnKeyListener(new o(openSdkFaceDetectInfoLayout2));
                    df0 df04 = qu32.f34645f;
                    m.f(df04, "openSdkFaceDetectInfo.prompt");
                    String str3 = df04.f19269d;
                    String str4 = df04.f19271f;
                    Spannable newSpannable = Spannable.Factory.getInstance().newSpannable(str3 + str4);
                    newSpannable.setSpan(new p(df04, openSdkFaceDetectInfoLayout2), str3.length(), str3.length() + str4.length(), 33);
                    TextView textView = (TextView) openSdkFaceDetectInfoLayout2.getRootContentView().findViewById(R.id.dmx);
                    textView.setText(newSpannable);
                    textView.setMovementMethod(LinkMovementMethod.getInstance());
                    openSdkFaceDetectInfoLayout2.getProtocolCheckBox().setChecked(df04.f19272g == 1);
                    openSdkFaceDetectInfoLayout2.getProtocolCheckBox().setOnCheckedChangeListener(new q(openSdkFaceDetectInfoLayout2));
                    openSdkFaceDetectInfoLayout2.b();
                    z15 = true;
                    if (z15) {
                        this.f166306x = bl42.f17379t;
                        this.f166302t.f165483i = bl42.f17383x;
                        this.E = bl42.f17368f;
                        this.F = bl42.f17367e;
                        if (bl42.f17370h || bl42.f17371i) {
                            Log.i("MicroMsg.SdkOAuthUI", "onSDKOauthAuthorizeEnd direct login");
                            c1 c1Var = this.f166302t;
                            a1 a1Var = new a1(bl42);
                            String str5 = this.A;
                            int i17 = this.D;
                            String str6 = this.B;
                            int i18 = this.C;
                            String str7 = this.E;
                            String str8 = this.F;
                            SendAuth.Req req = this.f166291f;
                            c1Var.e(this, a1Var, str5, i17, str6, i18, str7, str8, req.scope, this.G, req.isOption1);
                            bVar.a(this.f166290e, this.f166303u, 1, this.f166308z, 0, 0, 0);
                            return;
                        }
                        Iterator<rq3> it = bl42.f17366d.iterator();
                        while (true) {
                            if (it.hasNext()) {
                                if (c1.p(it.next())) {
                                    z16 = true;
                                    break;
                                }
                            } else {
                                z16 = false;
                                break;
                            }
                        }
                        if (z16) {
                            Log.i("MicroMsg.SdkOAuthUI", "onSDKOauthAuthorizeEnd  use New OauthPage");
                            TextView textView2 = (TextView) findViewById(R.id.a7w);
                            Iterator<rq3> it4 = bl42.f17366d.iterator();
                            while (it4.hasNext()) {
                                rq3 next = it4.next();
                                if (c1.p(next)) {
                                    textView2.setText(next.f35603e);
                                }
                            }
                            TextPaint paint = textView2.getPaint();
                            paint.setStyle(Paint.Style.FILL_AND_STROKE);
                            paint.setStrokeWidth(0.8f);
                            TextView textView3 = (TextView) findViewById(R.id.buq);
                            TextView textView4 = (TextView) findViewById(R.id.cm7);
                            sq3 sq32 = bl42.f17384y;
                            if (sq32 != null) {
                                if (!Util.isNullOrNil(sq32.f36715d)) {
                                    textView3.setText(bl42.f17384y.f36715d);
                                }
                                if (!Util.isNullOrNil(bl42.f17384y.f36716e)) {
                                    textView4.setText(bl42.f17384y.f36716e);
                                }
                            }
                            TextView textView5 = (TextView) findViewById(R.id.a7z);
                            if (!Util.isNullOrNil(bl42.f17381v)) {
                                textView5.setVisibility(0);
                                textView5.setText(bl42.f17381v);
                            } else {
                                textView5.setVisibility(8);
                            }
                            TextView textView6 = (TextView) findViewById(R.id.k77);
                            c.b bVar5 = new c.b();
                            bVar5.f294629o = R.raw.native_oauth_default_head_img;
                            bVar5.f294635u = getResources().getDimension(R.dimen.a9i);
                            bVar5.f294634t = true;
                            qg0.a.b().h(bl42.f17368f, (ImageView) findViewById(R.id.f364116k73), bVar5.a());
                            textView6.setText(bl42.f17367e);
                            textView6.getPaint().setStyle(Paint.Style.FILL_AND_STROKE);
                            textView6.getPaint().setStrokeWidth(0.8f);
                            Button button = (Button) findViewById(R.id.ioo);
                            Button button2 = (Button) findViewById(R.id.iot);
                            rq3 n15 = c1.n("snsapi_userinfo", bl42.f17366d);
                            if (n15 == null) {
                                n15 = c1.n("snsapi_login", bl42.f17366d);
                            }
                            if (n15 == null) {
                                n15 = c1.n("group_sns_login", bl42.f17366d);
                            }
                            button.setOnClickListener(new c0(this, n15, bl42));
                            button2.setOnClickListener(new d0(this, n15, bl42));
                            J = bl42.f17376q;
                            this.f166297o = new t64.a(this);
                            this.f166296n = new SDKOAuthUI$$f(this, bl42.f17373n, bl42.f17377r);
                            a8();
                            ListView listView = (ListView) findViewById(R.id.a_d);
                            listView.setAdapter((ListAdapter) this.f166296n);
                            listView.setOnItemClickListener(new e0(this));
                            listView.setOnTouchListener(new f0(this));
                            listView.setOnItemLongClickListener(new g0(this));
                            findViewById(R.id.f362818cm4).setOnClickListener(new h0(this, bl42));
                            boolean z17 = bl42.f17375p;
                            this.f166301s = z17;
                            if (z17) {
                                View findViewById3 = findViewById(R.id.cm6);
                                k30.a aVar = new k30.a();
                                ThreadLocal<k30.a> threadLocal = k30.c.f244265a;
                                aVar.c(8);
                                j30.a.d(findViewById3, aVar.b(), "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "fillNewOauthPage", "(Lcom/tencent/mm/protocal/protobuf/SdkOauthAuthorizeResp;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                                findViewById3.setVisibility(((Integer) aVar.a(0)).intValue());
                                j30.a.e(findViewById3, "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "fillNewOauthPage", "(Lcom/tencent/mm/protocal/protobuf/SdkOauthAuthorizeResp;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                            }
                            ((TextView) findViewById(R.id.hzy)).setOnClickListener(new SDKOAuthUI$$b(this));
                            View findViewById4 = findViewById(R.id.k9z);
                            k30.a aVar2 = new k30.a();
                            ThreadLocal<k30.a> threadLocal2 = k30.c.f244265a;
                            aVar2.c(0);
                            j30.a.d(findViewById4, aVar2.b(), "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "fillNewOauthPage", "(Lcom/tencent/mm/protocal/protobuf/SdkOauthAuthorizeResp;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                            findViewById4.setVisibility(((Integer) aVar2.a(0)).intValue());
                            j30.a.e(findViewById4, "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "fillNewOauthPage", "(Lcom/tencent/mm/protocal/protobuf/SdkOauthAuthorizeResp;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                            return;
                        } else if (c1.n("snsapi_friend", bl42.f17366d) != null) {
                            Log.i("MicroMsg.SdkOAuthUI", "onSDKOauthAuthorizeEnd  has scope SCOPE_FRIEND");
                            i8(bl42, SDKOAuthFriendUI.class, "snsapi_friend");
                            c1.f(this);
                            return;
                        } else if (c1.n("snsapi_wxaapp_info", bl42.f17366d) != null) {
                            Log.i("MicroMsg.SdkOAuthUI", "onSDKOauthAuthorizeEnd  has scope SCOPE_GET_WXAAPP_INFO");
                            i8(bl42, SDKOAuthFriendUI.class, "snsapi_wxaapp_info");
                            c1.f(this);
                            return;
                        } else {
                            Log.i("MicroMsg.SdkOAuthUI", "onSDKOauthAuthorizeEnd  has other scope");
                            i8(bl42, SDKOAuthOtherUI.class, "");
                            c1.f(this);
                            return;
                        }
                    } else {
                        return;
                    }
                }
            }
            z15 = false;
            if (z15) {
            }
        } else if (!b8(i15)) {
            Log.e("MicroMsg.SdkOAuthUI", "onSDKOauthAuthorizeEnd  network is not available");
            f8(getString(R.string.l8c), true);
            bVar.a(this.f166290e, this.f166303u, 2, this.f166308z, 0, 0, i16);
        } else {
            Log.e("MicroMsg.SdkOAuthUI", "onSDKOauthAuthorizeEnd  errMsg: %s", str);
            bVar.a(this.f166290e, this.f166303u, 2, this.f166308z, 0, 0, i16);
            f8(str, true);
        }
    }

    public final void e8() {
        int i15 = getResources().getConfiguration().orientation;
        View findViewById = findViewById(R.id.ioq);
        if (findViewById != null) {
            int i16 = 0;
            LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) findViewById.getLayoutParams();
            if (i15 == 2) {
                i16 = gy3.a.b(this, 12);
            } else if (i15 == 1) {
                i16 = gy3.a.b(this, 96);
            }
            layoutParams.bottomMargin = i16;
            findViewById.setLayoutParams(layoutParams);
        }
    }

    public final void f8(String str, boolean z15) {
        j.t(this, str, getString(R.string.l8b), new SDKOAuthUI$$d(this, str, z15));
    }

    public final void g8() {
        i0 i0Var = this.f166295j;
        if (i0Var == null || i0Var.isShowing()) {
            this.f166295j = j.Q(this, null, getString(R.string.hdm), true, true, new SDKOAuthUI$$e(this));
        } else {
            this.f166295j.show();
        }
    }

    @Override // com.tencent.mm.ui.MMActivity
    public int getLayoutId() {
        return R.layout.cil;
    }

    public final void h8(bl4 bl42, Class<?> cls, int i15, int i16, String str) {
        Log.i("MicroMsg.SdkOAuthUI", "startScopeActivity  cls:" + cls + "  scope:" + str);
        Intent intent = new Intent(this, cls);
        intent.putExtra("0", this.f166290e);
        SendAuth.Req req = this.f166291f;
        if (req != null) {
            intent.putExtra("1", req.transaction);
            intent.putExtra(XWebUpdater.XWEB_UPDATER_START_CHECK_TYPE_EMBEDINSTALL, this.f166291f.state);
            intent.putExtra("7", this.f166291f.extData);
            intent.putExtra("auth_isoption1", this.f166291f.isOption1);
        }
        intent.putExtra("3", i15);
        intent.putExtra(XWebUpdater.XWEB_UPDATER_START_CHECK_TYPE_CONFIG_ONLY, i16);
        intent.putExtra("auth_from_scan", this.f166305w);
        intent.putExtra("auth_raw_url", this.f166307y);
        intent.putExtra("has_selected_scope", this.H);
        if (!Util.isNullOrNil(this.A)) {
            intent.putExtra("key_open_sdk_token", this.A);
        }
        if (!Util.isNullOrNil(this.B)) {
            intent.putExtra("key_open_sdk_pkg_name", this.B);
        }
        intent.putExtra("key_open_sdk_authentication_result", this.C);
        intent.putExtra("key_open_sdk_version", this.D);
        if (!TextUtils.isEmpty(str)) {
            intent.putExtra("auth_scope", str);
        }
        SendAuth.Options options = this.G;
        if (options != null && !Util.isNullOrNil(options.callbackClassName)) {
            Bundle bundle = new Bundle();
            this.G.toBundle(bundle);
            intent.putExtra("send_auth_option", bundle);
        }
        try {
            intent.putExtra("2", bl42.toByteArray());
        } catch (IOException unused) {
            Log.e("MicroMsg.SdkOAuthUI", "SdkOauthAuthorizeResp toByteArray failed");
        }
        k30.a aVar = new k30.a();
        aVar.c(intent);
        j30.a.d(this, aVar.b(), "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "startScopeActivity", "(Lcom/tencent/mm/protocal/protobuf/SdkOauthAuthorizeResp;Ljava/lang/Class;IILjava/lang/String;)V", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
        startActivity((Intent) aVar.a(0));
        j30.a.e(this, "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "startScopeActivity", "(Lcom/tencent/mm/protocal/protobuf/SdkOauthAuthorizeResp;Ljava/lang/Class;IILjava/lang/String;)V", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
    }

    public final void i8(bl4 bl42, Class<?> cls, String str) {
        Log.i("MicroMsg.SdkOAuthUI", "startScopeActivity %s", cls.getSimpleName());
        Intent intent = new Intent(this, cls);
        intent.putExtra("0", this.f166290e);
        intent.putExtra("has_selected_scope", this.H);
        SendAuth.Req req = this.f166291f;
        if (req != null) {
            intent.putExtra("1", req.transaction);
            intent.putExtra(XWebUpdater.XWEB_UPDATER_START_CHECK_TYPE_EMBEDINSTALL, this.f166291f.state);
            intent.putExtra("7", this.f166291f.extData);
            intent.putExtra("auth_isoption1", this.f166291f.isOption1);
        }
        intent.putExtra("auth_from_scan", this.f166305w);
        if (!TextUtils.isEmpty(str)) {
            intent.putExtra("auth_scope", str);
        }
        intent.putExtra("auth_raw_url", this.f166307y);
        if (!Util.isNullOrNil(this.A)) {
            intent.putExtra("key_open_sdk_token", this.A);
        }
        if (!Util.isNullOrNil(this.B)) {
            intent.putExtra("key_open_sdk_pkg_name", this.B);
        }
        intent.putExtra("key_open_sdk_authentication_result", this.C);
        intent.putExtra("key_open_sdk_version", this.D);
        SendAuth.Options options = this.G;
        if (options != null && !Util.isNullOrNil(options.callbackClassName)) {
            Bundle bundle = new Bundle();
            this.G.toBundle(bundle);
            intent.putExtra("send_auth_option", bundle);
        }
        try {
            intent.putExtra("2", bl42.toByteArray());
        } catch (IOException unused) {
            Log.e("MicroMsg.SdkOAuthUI", "SdkOauthAuthorizeResp toByteArray failed");
        }
        k30.a aVar = new k30.a();
        aVar.c(intent);
        j30.a.d(this, aVar.b(), "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "startScopeActivity", "(Lcom/tencent/mm/protocal/protobuf/SdkOauthAuthorizeResp;Ljava/lang/Class;Ljava/lang/String;)V", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
        startActivity((Intent) aVar.a(0));
        j30.a.e(this, "com/tencent/mm/plugin/webview/ui/tools/SDKOAuthUI", "startScopeActivity", "(Lcom/tencent/mm/protocal/protobuf/SdkOauthAuthorizeResp;Ljava/lang/Class;Ljava/lang/String;)V", "Undefined", "startActivity", "(Landroid/content/Intent;)V");
    }

    @Override // com.tencent.mm.ui.component.glocom.GloUIComponentActivity, com.tencent.mm.ui.component.UIComponentActivity
    public Set<Class<? extends UIComponent>> importUIComponents() {
        HashSet hashSet = new HashSet();
        hashSet.add(j0.class);
        return hashSet;
    }

    public final void init() {
        b bVar = b.INSTANCE;
        ActionBar supportActionBar = getSupportActionBar();
        if (supportActionBar != null) {
            supportActionBar.o();
        }
        boolean z15 = true;
        if (!z.a()) {
            Log.e("MicroMsg.SdkOAuthUI", "start, hasSetUin fail");
            ak.a.makeText(this, (int) R.string.c_, 1).show();
            return;
        }
        boolean z16 = false;
        this.f166299q = false;
        Intent intent = getIntent();
        this.f166305w = intent.getBooleanExtra("auth_from_scan", false);
        this.f166303u = System.currentTimeMillis();
        SendAuth.Options options = new SendAuth.Options();
        this.G = options;
        options.fromBundle(intent.getExtras());
        this.A = intent.getStringExtra("key_open_sdk_token");
        this.B = intent.getStringExtra("key_open_sdk_pkg_name");
        this.C = intent.getIntExtra("key_open_sdk_authentication_result", -1);
        this.D = intent.getIntExtra("key_open_sdk_version", 0);
        SendAuth.Options options2 = this.G;
        Log.i("MicroMsg.SdkOAuthUI", "init isFromQRCodeScan %b  options.callbackClassName:%s, options.callbackFlags:%d, pkgName:%s, authenticationResult:%d, openSDKVersion:%d", Boolean.valueOf(this.f166305w), options2.callbackClassName, Integer.valueOf(options2.callbackFlags), this.B, Integer.valueOf(this.C), Integer.valueOf(this.D));
        String str = null;
        if (this.f166305w) {
            this.f166308z = 3;
            String stringExtra = intent.getStringExtra("auth_raw_url");
            this.f166307y = stringExtra;
            Log.i("MicroMsg.SdkOAuthUI", "doQRCodeOauthAuthorize url: %s", stringExtra);
            if (!c8()) {
                g8();
            }
            ru3 ru32 = new ru3();
            int i15 = this.f166300r;
            ru32.f35720e = i15;
            if (i15 > 0) {
                z16 = true;
            }
            ru32.f35719d = z16;
            z.d().f(new com.tencent.mm.plugin.webview.model.i0(stringExtra, ru32));
            if (this.f166302t == null) {
                this.f166302t = new c1(this, true, null, this.f166307y);
            }
            bVar.c(3, "");
        } else {
            Bundle extras = getIntent().getExtras();
            String string = extras.getString(ConstantsAPI.CONTENT);
            if (Util.isNullOrNil(string)) {
                Log.e("MicroMsg.SdkOAuthUI", "init content is nil");
                return;
            }
            String queryParameter = Uri.parse(string).getQueryParameter("appid");
            this.f166290e = queryParameter;
            if (Util.isNullOrNil(queryParameter)) {
                Log.i("MicroMsg.SdkOAuthUI", "parseAppId try case not sensitive, content:%s", string);
                this.f166290e = Uri.parse(string.toLowerCase()).getQueryParameter("appid");
            }
            if (this.f166291f == null) {
                String str2 = this.f166290e;
                com.tencent.mm.pluginsdk.model.app.j u602 = ((l) yz3.j.c(l.class)).u60(str2, false);
                if (u602 != null && Util.isNullOrNil(u602.field_openId)) {
                    Log.i("MicroMsg.SdkOAuthUI", "checkGetAppSetting appId: %s ", str2);
                    GetAppSettingEvent getAppSettingEvent = new GetAppSettingEvent();
                    getAppSettingEvent.f63116d.f63117a = str2;
                    getAppSettingEvent.publish();
                }
                this.f166291f = new SendAuth.Req(extras);
            }
            bVar.c(2, this.f166291f.extData);
            if (this.f166302t == null) {
                String str3 = this.f166290e;
                SendAuth.Req req = this.f166291f;
                this.f166302t = new c1(this, str3, req.transaction, req.state, req.extData);
            }
            if (Util.isNullOrNil(this.f166291f.scope) || !this.f166291f.scope.contains("snsapi_wxaapp_info") || this.f166291f.scope.equals("snsapi_wxaapp_info")) {
                Log.e("MicroMsg.SdkOAuthUI", "init success, doSDKOauthAuthorize");
                String str4 = this.f166290e;
                String Y7 = Y7(str4);
                Log.i("MicroMsg.SdkOAuthUI", "doSDKOauthAuthorize appid: %s, extData:%s", str4, this.f166291f.extData);
                if (!c8()) {
                    g8();
                }
                SendAuth.Req req2 = this.f166291f;
                if (!Util.isNullOrNil(Y7)) {
                    Signature[] a15 = com.tencent.mm.pluginsdk.model.app.c.a(this, Y7);
                    if (a15 == null || a15.length == 0) {
                        Log.e("MicroMsg.SdkOAuthUI", "getSignature signatures failed");
                    } else {
                        str = g.f(a15[0].toByteArray());
                    }
                }
                String str5 = this.A;
                int i16 = this.C;
                ru3 ru33 = new ru3();
                int i17 = this.f166300r;
                ru33.f35720e = i17;
                if (i17 <= 0) {
                    z15 = false;
                }
                ru33.f35719d = z15;
                z.d().f(new k0(str4, req2, Y7, str, str5, i16, ru33));
            } else {
                Log.e("MicroMsg.SdkOAuthUI", "init check SCOPE_GET_WXAAPP_INFO fail");
                V7(-1000, String.format(getContext().getResources().getString(R.string.l8d), "snsapi_wxaapp_info"));
                finish();
            }
        }
        e8();
    }

    @Override // androidx.activity.ComponentActivity, androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.ui.MMFragmentActivity
    public void onActivityResult(int i15, int i16, Intent intent) {
        boolean z15;
        LinkedList<oq3> linkedList;
        String str;
        boolean z16 = true;
        Log.i("MicroMsg.SdkOAuthUI", "onAcvityResult requestCode:%d, resultCode:%d", Integer.valueOf(i15), Integer.valueOf(i16));
        Bundle bundle = null;
        if (i15 != 6) {
            if (i15 == 9) {
                if (intent != null) {
                    bundle = intent.getExtras();
                }
                HashMap hashMap = (HashMap) kp3.a.a(bundle);
                if (hashMap.get("err_msg") instanceof String) {
                    str = (String) hashMap.get("err_msg");
                } else {
                    str = "";
                }
                Log.i("MicroMsg.SdkOAuthUI", "face detect errCode %s, errMsg=%s", hashMap.get("err_code"), str);
                if (i16 == -1) {
                    this.f166300r = 1;
                    this.f166298p.setVisibility(8);
                    init();
                } else if (i16 == 1) {
                    this.f166300r = 2;
                    if (!this.f166305w) {
                        V7(-1, str);
                    }
                    init();
                    finish();
                } else if (i16 == 0) {
                    this.f166300r = 3;
                    U7(-2);
                    init();
                    finish();
                }
            }
        } else if (i16 != -1) {
            Log.e("MicroMsg.SdkOAuthUI", "Create avatar cancel or failed");
        } else {
            oq3 oq32 = new oq3();
            oq32.f32239d = intent.getIntExtra("id", -1);
            oq32.f32240e = intent.getStringExtra("nickname");
            oq32.f32241f = intent.getStringExtra("avatarurl");
            oq32.f32242g = null;
            SDKOAuthUI$$f sDKOAuthUI$$f = this.f166296n;
            if (sDKOAuthUI$$f != null) {
                sDKOAuthUI$$f.getClass();
                if (oq32.f32239d == -1 || (linkedList = sDKOAuthUI$$f.f166315d) == null || linkedList.size() >= J) {
                    z15 = false;
                } else {
                    sDKOAuthUI$$f.f166315d.add(oq32);
                    z15 = true;
                }
                if (z15) {
                    this.f166296n.f166319h = oq32.f32239d;
                    a8();
                    this.f166296n.notifyDataSetChanged();
                    return;
                }
            }
            Object[] objArr = new Object[1];
            if (this.f166296n != null) {
                z16 = false;
            }
            objArr[0] = Boolean.valueOf(z16);
            Log.e("MicroMsg.SdkOAuthUI", "onActivityResult mAvatarAdapter == null:%b", objArr);
        }
    }

    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.ui.MMFragmentActivity
    public void onConfigurationChanged(Configuration configuration) {
        super.onConfigurationChanged(configuration);
        e8();
    }

    @Override // androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.hellhoundlib.activities.HellActivity, com.tencent.mm.ui.MMFragmentActivity
    public void onCreate(Bundle bundle) {
        Log.i("MicroMsg.SdkOAuthUI", "onCreate");
        super.onCreate(bundle);
        z.d().a(1346, this);
        z.d().a(1388, this);
        z.d().a(2700, this);
        z.d().a(2543, this);
        z.d().a(1137, this);
        setMMTitle("");
        init();
    }

    public void onCreateContextMenu(ContextMenu contextMenu, View view, ContextMenu.ContextMenuInfo contextMenuInfo) {
        super.onCreateContextMenu(contextMenu, view, contextMenuInfo);
        contextMenu.add(0, 1, 0, getString(R.string.h88));
    }

    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.hellhoundlib.activities.HellActivity, com.tencent.mm.ui.MMFragmentActivity
    public void onDestroy() {
        super.onDestroy();
        Log.i("MicroMsg.SdkOAuthUI", "onDestroy");
        i0 i0Var = this.f166295j;
        if (i0Var != null) {
            i0Var.dismiss();
        }
        z.d().p(1388, this);
        z.d().p(1346, this);
        z.d().p(2700, this);
        z.d().p(2543, this);
        z.d().p(1137, this);
    }

    @Override // androidx.appcompat.app.AppCompatActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity
    public boolean onKeyDown(int i15, KeyEvent keyEvent) {
        if (i15 != 4 || keyEvent.getRepeatCount() != 0) {
            return super.onKeyDown(i15, keyEvent);
        }
        b.INSTANCE.a(this.f166290e, this.f166303u, 0, this.f166308z, Z7(), 1, 0);
        U7(-2);
        Log.i("MicroMsg.SdkOAuthUI", "key back click");
        finish();
        return true;
    }

    @Override // androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.hellhoundlib.activities.HellActivity, com.tencent.mm.ui.MMFragmentActivity
    public void onPause() {
        super.onPause();
        Log.i("MicroMsg.SdkOAuthUI", "onPause");
    }

    @Override // androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.hellhoundlib.activities.HellActivity, com.tencent.mm.ui.MMFragmentActivity
    public void onResume() {
        super.onResume();
        Log.i("MicroMsg.SdkOAuthUI", "onResume");
    }

    /* JADX DEBUG: Multi-variable search result rejected for r25v0, resolved type: com.tencent.mm.plugin.webview.ui.tools.SDKOAuthUI */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r11v1, types: [boolean] */
    /* JADX WARN: Type inference failed for: r10v1, types: [boolean] */
    /* JADX WARN: Type inference failed for: r11v2 */
    /* JADX WARN: Type inference failed for: r11v3 */
    /* JADX WARN: Type inference failed for: r10v8 */
    /* JADX WARN: Type inference failed for: r11v5 */
    /* JADX WARN: Type inference failed for: r11v6 */
    /* JADX WARN: Type inference failed for: r11v7 */
    /* JADX WARN: Type inference failed for: r10v24 */
    /* JADX WARN: Type inference failed for: r10v25 */
    /* JADX WARN: Type inference failed for: r10v26 */
    /* JADX WARN: Type inference failed for: r10v27 */
    /* JADX WARNING: Removed duplicated region for block: B:56:0x0294  */
    /* JADX WARNING: Unknown variable types count: 2 */
    @Override // yf0.n
    public void onSceneEnd(int i15, int i16, String str, y yVar) {
        b bVar;
        y yVar2;
        ?? r112;
        ?? r102;
        int i17;
        int i18;
        String str2;
        int i19;
        int i25;
        boolean z15;
        String str3;
        boolean z16;
        boolean z17;
        b bVar2 = b.INSTANCE;
        if (!(yVar instanceof k0) || c8()) {
            if (yVar instanceof l0) {
                Log.i("MicroMsg.SdkOAuthUI", "onSceneEnd  NetSceneSDKOauthAuthorizeConfirm");
                SendAuth.Options options = this.G;
                Log.i("MicroMsg.SdkOAuthUI", "onSDKOauthAuthorizeConfirmEnd errType:%d errCode:%d", Integer.valueOf(i15), Integer.valueOf(i16));
                W7();
                if (i15 == 0 && i16 == 0) {
                    zk4 zk42 = (zk4) ((l0) yVar).f165623d.f345549b.f345576a;
                    str3 = "MicroMsg.SdkOAuthUI";
                    bVar2.a(this.f166290e, this.f166303u, 1, this.f166308z, Z7(), 1, 0);
                    c1 c1Var = this.f166302t;
                    m.g(zk42, "resp");
                    z0 z0Var = new z0(zk42);
                    String str4 = this.A;
                    int i26 = this.D;
                    String str5 = this.B;
                    int i27 = this.C;
                    String str6 = this.E;
                    String str7 = this.F;
                    SendAuth.Req req = this.f166291f;
                    bVar = bVar2;
                    yVar2 = yVar;
                    c1Var.e(this, z0Var, str4, i26, str5, i27, str6, str7, req.scope, options, req.isOption1);
                    i17 = R.string.l8c;
                    z16 = false;
                } else {
                    str3 = "MicroMsg.SdkOAuthUI";
                    bVar = bVar2;
                    yVar2 = yVar;
                    if (!b8(i15)) {
                        i17 = R.string.l8c;
                        z16 = false;
                        f8(getString(R.string.l8c), false);
                        bVar.a(this.f166290e, this.f166303u, 2, this.f166308z, Z7(), 1, i16);
                    } else {
                        i17 = R.string.l8c;
                        z16 = false;
                        f8(str, false);
                        bVar.a(this.f166290e, this.f166303u, 2, this.f166308z, Z7(), 1, i16);
                    }
                }
            } else {
                str3 = "MicroMsg.SdkOAuthUI";
                bVar = bVar2;
                yVar2 = yVar;
                i17 = R.string.l8c;
                boolean z18 = false;
                z16 = z18;
                if (yVar2 instanceof zy.c) {
                    str2 = str3;
                    Log.i(str2, "onSceneEnd  NetSceneDelAvatar");
                    i19 = 2;
                    r112 = 1;
                    r112 = 1;
                    r112 = 1;
                    Log.i(str2, "onAddAvatarEnd errType:%d errCode:%d", Integer.valueOf(i15), Integer.valueOf(i16));
                    i18 = i16;
                    if (i15 == 0 && i18 == 0) {
                        oq3 a15 = this.f166296n.getItem(this.f166292g);
                        if (a15 != null) {
                            int i28 = a15.f32239d;
                            SDKOAuthUI$$f sDKOAuthUI$$f = this.f166296n;
                            if (i28 == sDKOAuthUI$$f.f166319h && sDKOAuthUI$$f.getItem(0) != null) {
                                SDKOAuthUI$$f sDKOAuthUI$$f2 = this.f166296n;
                                sDKOAuthUI$$f2.f166319h = sDKOAuthUI$$f2.getItem(0).f32239d;
                            }
                        }
                        SDKOAuthUI$$f sDKOAuthUI$$f3 = this.f166296n;
                        int i29 = this.f166292g;
                        LinkedList<oq3> linkedList = sDKOAuthUI$$f3.f166315d;
                        if (linkedList == null) {
                            z17 = false;
                        } else {
                            z17 = linkedList.remove(sDKOAuthUI$$f3.getItem(i29));
                        }
                        if (!z17) {
                            Log.e(str2, "remove avatar failed: not found");
                        }
                        a8();
                        this.f166296n.notifyDataSetChanged();
                        r102 = z18;
                    } else if (!b8(i15)) {
                        j.s(this, getString(R.string.l8c), getString(R.string.h89));
                        r102 = z18;
                    } else {
                        j.s(this, str, getString(R.string.h89));
                        r102 = z18;
                    }
                }
            }
            i18 = i16;
            str2 = str3;
            i19 = 2;
            r112 = 1;
            r102 = z16;
        } else {
            Log.i("MicroMsg.SdkOAuthUI", "onSceneEnd  NetSceneSDKOauthAuthorize");
            d8(i15, i16, str, (bl4) ((k0) yVar).f165617d.f345549b.f345576a);
            bVar2.b(3, (int) (System.currentTimeMillis() - this.f166303u), i16);
            str2 = "MicroMsg.SdkOAuthUI";
            i19 = 2;
            bVar = bVar2;
            i18 = i16;
            i17 = R.string.l8c;
            r102 = 0;
            yVar2 = yVar;
            r112 = 1;
        }
        if ((yVar2 instanceof com.tencent.mm.plugin.webview.model.i0) && !c8()) {
            Log.i(str2, "onSceneEnd  NetSceneQRCodeOauthAuthorize");
            Object[] objArr = new Object[i19];
            objArr[r102] = Integer.valueOf(i15);
            objArr[r112] = Integer.valueOf(i16);
            Log.i(str2, "onQRCodeOauthAuthorizeEnd errType:%d errCode:%d", objArr);
            if (i15 == 0 && i18 == 0) {
                f74 f742 = (f74) ((com.tencent.mm.plugin.webview.model.i0) yVar2).f165573d.f345549b.f345576a;
                String str8 = f742.f21321f;
                this.f166290e = str8;
                this.f166302t.f165476b = str8;
                if (f742.f21319d) {
                    Log.i(str2, "fallback to h5");
                    i25 = i18;
                    bVar.a(this.f166290e, this.f166303u, 1, this.f166308z, 0, 0, i16);
                    sv3.b.j(MMApplicationContext.getContext(), "webview", ".ui.tools.WebViewUI", getIntent(), null);
                    c1.f(this);
                    boolean z19 = r112 == true ? 1 : 0;
                    boolean z25 = r112 == true ? 1 : 0;
                    boolean z26 = r112 == true ? 1 : 0;
                    boolean z27 = r112 == true ? 1 : 0;
                    boolean z28 = r112 == true ? 1 : 0;
                    boolean z29 = r112 == true ? 1 : 0;
                    z15 = z19;
                    if (!z15) {
                        W7();
                    }
                    bVar.b(3, (int) (System.currentTimeMillis() - this.f166303u), i25);
                } else {
                    i25 = i18;
                    bl4 bl42 = new bl4();
                    bl42.BaseResponse = f742.BaseResponse;
                    bl42.f17370h = r102;
                    bl42.f17371i = r102;
                    bl42.f17374o = r112;
                    bl42.f17372j = r102;
                    bl42.f17366d = f742.f21320e;
                    bl42.f17367e = f742.f21322g;
                    bl42.f17368f = f742.f21323h;
                    bl42.f17369g = "";
                    bl42.f17373n = f742.f21324i;
                    bl42.f17375p = f742.f21325j;
                    bl42.f17376q = f742.f21326n;
                    bl42.f17377r = f742.f21327o;
                    bl42.f17378s = f742.f21328p;
                    bl42.f17379t = f742.f21329q;
                    bl42.f17384y = f742.f21330r;
                    bl42.C = f742.f21331s;
                    d8(i15, i25, str, bl42);
                }
            } else {
                i25 = i18;
                if (!b8(i15)) {
                    f8(getString(i17), r112);
                    bVar.a(this.f166290e, this.f166303u, 2, this.f166308z, 0, 0, i16);
                } else {
                    bVar.a(this.f166290e, this.f166303u, 2, this.f166308z, 0, 0, i16);
                    f8(str, r112);
                }
            }
            boolean z35 = r102 == true ? 1 : 0;
            boolean z36 = r102 == true ? 1 : 0;
            boolean z37 = r102 == true ? 1 : 0;
            boolean z38 = r102 == true ? 1 : 0;
            boolean z39 = r102 == true ? 1 : 0;
            boolean z45 = r102 == true ? 1 : 0;
            boolean z46 = r102 == true ? 1 : 0;
            z15 = z35;
            if (!z15) {
            }
            bVar.b(3, (int) (System.currentTimeMillis() - this.f166303u), i25);
        } else if (yVar2 instanceof j0) {
            Log.i(str2, "onSceneEnd  NetSceneQRCodeOauthAuthorizeConfirm");
            Object[] objArr2 = new Object[i19];
            Integer valueOf = Integer.valueOf(i15);
            char c15 = r102 == true ? 1 : 0;
            char c16 = r102 == true ? 1 : 0;
            char c17 = r102 == true ? 1 : 0;
            char c18 = r102 == true ? 1 : 0;
            char c19 = r102 == true ? 1 : 0;
            char c25 = r102 == true ? 1 : 0;
            char c26 = r102 == true ? 1 : 0;
            objArr2[c15] = valueOf;
            Integer valueOf2 = Integer.valueOf(i16);
            char c27 = r112 == true ? 1 : 0;
            char c28 = r112 == true ? 1 : 0;
            char c29 = r112 == true ? 1 : 0;
            char c35 = r112 == true ? 1 : 0;
            char c36 = r112 == true ? 1 : 0;
            char c37 = r112 == true ? 1 : 0;
            objArr2[c27] = valueOf2;
            Log.i(str2, "onQRCodeOauthAuthorizeConfirmEnd errType:%d errCode:%d", objArr2);
            W7();
            if (i15 == 0 && i16 == 0) {
                bVar.a(this.f166290e, this.f166303u, 1, this.f166308z, Z7(), 1, 0);
                finish();
            } else if (!b8(i15)) {
                f8(getString(i17), r102);
                bVar.a(this.f166290e, this.f166303u, 2, this.f166308z, Z7(), 1, i16);
            } else {
                f8(str, r102);
                bVar.a(this.f166290e, this.f166303u, 2, this.f166308z, Z7(), 1, i16);
            }
        }
        W7();
    }

    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.ui.MMFragmentActivity
    public void onStart() {
        super.onStart();
        Log.i("MicroMsg.SdkOAuthUI", "onStart");
    }

    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.hellhoundlib.activities.HellActivity, com.tencent.mm.ui.MMFragmentActivity
    public void onStop() {
        super.onStop();
        Log.i("MicroMsg.SdkOAuthUI", "onStop");
    }
}