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


package com.tencent.mm.plugin.scanner.ui;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.Looper;
import android.os.MessageQueue;
import android.os.Vibrator;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewPropertyAnimator;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import bw3.m13;
import bw3.vj;
import bw3.xi;
import com.google.android.gms.common.internal.ServiceSpecificExtraArgs;
import com.tencent.mm.R;
import com.tencent.mm.app.h;
import com.tencent.mm.autogen.events.AppBrandVoipCheckIsDeviceUsingEvent;
import com.tencent.mm.autogen.events.FinderLivePauseActionEvent;
import com.tencent.mm.autogen.events.PublishScanCodeResultEvent;
import com.tencent.mm.autogen.events.ScanDarkDetectEvent;
import com.tencent.mm.autogen.events.ScanFlashSwitchEvent;
import com.tencent.mm.autogen.events.VoipEvent;
import com.tencent.mm.autogen.mmdata.rpt.WC3DTouchHomeShortCutStruct;
import com.tencent.mm.autogen.mmdata.rpt.android_scanner_performanceStruct;
import com.tencent.mm.network.p;
import com.tencent.mm.plugin.scanner.api.BaseScanRequest;
import com.tencent.mm.plugin.scanner.api.ScanGoodsRequest;
import com.tencent.mm.plugin.scanner.box.BaseBoxDialogView;
import com.tencent.mm.plugin.scanner.model.ScanProductInfo;
import com.tencent.mm.plugin.scanner.model.a1;
import com.tencent.mm.plugin.scanner.model.b1;
import com.tencent.mm.plugin.scanner.model.d;
import com.tencent.mm.plugin.scanner.model.d1;
import com.tencent.mm.plugin.scanner.model.e1;
import com.tencent.mm.plugin.scanner.model.f1;
import com.tencent.mm.plugin.scanner.model.g1;
import com.tencent.mm.plugin.scanner.model.h1;
import com.tencent.mm.plugin.scanner.model.i;
import com.tencent.mm.plugin.scanner.model.n0;
import com.tencent.mm.plugin.scanner.model.v0;
import com.tencent.mm.plugin.scanner.model.w0;
import com.tencent.mm.plugin.scanner.model.x0;
import com.tencent.mm.plugin.scanner.model.z0;
import com.tencent.mm.plugin.scanner.ui.ScanUIRectView;
import com.tencent.mm.plugin.scanner.ui.component.ScanUITopOpButtonComponent;
import com.tencent.mm.plugin.scanner.ui.scangoods.widget.ScanGoodsMaskView;
import com.tencent.mm.plugin.scanner.ui.widget.ScanCodeMaskView;
import com.tencent.mm.plugin.scanner.ui.widget.ScanCodeProductMergeMaskView;
import com.tencent.mm.plugin.scanner.ui.widget.ScanDebugView;
import com.tencent.mm.plugin.scanner.ui.widget.ScanInfoMaskView;
import com.tencent.mm.plugin.scanner.ui.widget.ScanProductMaskDecorView;
import com.tencent.mm.plugin.scanner.ui.widget.ScanScrollTabView;
import com.tencent.mm.plugin.scanner.ui.widget.ScanSharedMaskView;
import com.tencent.mm.plugin.scanner.view.BaseScanMaskView;
import com.tencent.mm.plugin.scanner.view.ScanProductDetectRectView;
import com.tencent.mm.plugin.scanner.view.d;
import com.tencent.mm.plugin.secdata.ui.MMSecDataActivity;
import com.tencent.mm.sdk.event.IListener;
import com.tencent.mm.sdk.platformtools.BackwardSupportUtil;
import com.tencent.mm.sdk.platformtools.BitmapUtil;
import com.tencent.mm.sdk.platformtools.BuildInfo;
import com.tencent.mm.sdk.platformtools.Log;
import com.tencent.mm.sdk.platformtools.MMHandlerThread;
import com.tencent.mm.sdk.platformtools.MultiProcessMMKV;
import com.tencent.mm.sdk.platformtools.PlaySound;
import com.tencent.mm.sdk.platformtools.Util;
import com.tencent.mm.sdk.platformtools.WeChatBrands;
import com.tencent.mm.ui.x4;
import com.tencent.qbar.ScanDecodeFrameData;
import com.tencent.qbar.ScanIdentifyReportInfo;
import com.tencent.qbar.WxQBarResult;
import com.tencent.qbar.WxQbarNative;
import com.tencent.qbar.a;
import com.tencent.qbar.b;
import com.tencent.thumbplayer.tmediacodec.util.MimeTypes;
import com.tencent.tmassistantsdk.openSDK.QQDownloader.AssistantStore;
import d60.f0;
import d60.z;
import ez2.g0;
import ez2.h0;
import ez2.i0;
import ez2.j0;
import ez2.k0;
import ez2.r0;
import ez2.s0;
import fy2.a0;
import fy2.k;
import fy2.l;
import fy2.x;
import fz2.e0;
import fz2.y;
import hy.h0;
import i14.a;
import i14.d0;
import i14.l0;
import i14.p0;
import i14.y0;
import ie1.h;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import lh4.m;
import ny2.d;
import ny2.f;
import p64.n;
import u64.c;
import wg4.b0;
import wy2.a;
import wy2.e;
import wy2.f;
import wy2.g;
import xc4.j;
import xc4.t;
import xg4.c0;
import xy2.o;
import xy2.p;
import xy2.q;
import xy2.r;

@a(3)
@f0
@c(0)
public class BaseScanUI extends MMSecDataActivity implements e.a, d, i {

    /* renamed from: n1  reason: collision with root package name */
    public static final /* synthetic */ int f143578n1 = 0;
    public long A;
    public int B;
    public boolean C = true;
    public boolean D = true;
    public boolean E = true;
    public boolean F = true;
    public boolean G = false;
    public int[] H;
    public boolean I;
    public boolean J;
    public boolean K;
    public boolean L;
    public boolean M;
    public BaseScanRequest N;
    public boolean P;
    public int Q;
    public boolean R = false;
    public boolean S = true;
    public boolean T = true;
    public boolean T0 = false;
    public x0 U = new x0();
    public boolean U0 = false;
    public boolean V = true;
    public boolean V0 = true;
    public android_scanner_performanceStruct W = new android_scanner_performanceStruct();
    public boolean W0 = true;
    public int X;
    public int X0 = 4;
    public boolean Y = false;
    public ArrayList<Integer> Y0 = new ArrayList<>();
    public boolean Z = false;
    public final xy2.i Z0 = new xy2.i() {
        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass1 */

        @Override // xy2.i
        public void a(p pVar) {
            o oVar;
            ScanProductMaskDecorView scanProductMaskDecorView = BaseScanUI.this.f143589h;
            if (scanProductMaskDecorView != null) {
                ArrayList<o> arrayList = pVar.f341752d;
                int b15 = scanProductMaskDecorView.b(arrayList);
                Log.i("MicroMsg.ScanUI", "AiScanProductHandleCallback onRetrievalImageSuccess pos:" + b15);
                if (b15 > 0 && b15 <= arrayList.size() && (oVar = arrayList.get(b15 - 1)) != null && oVar.f341740g == 4) {
                    BaseScanUI baseScanUI = BaseScanUI.this;
                    e1.q(baseScanUI.B, baseScanUI.Q, 4, b15, baseScanUI.f143589h.getTotalProductCount(), BaseScanUI.this.A, pVar.f341750b, pVar.f341751c, oVar.f341748o, oVar.f341747n, oVar.f341745l, 0);
                }
            }
        }

        @Override // xy2.i
        public boolean b(final r rVar) {
            if (!BaseScanUI.T7(BaseScanUI.this, rVar)) {
                Log.w("MicroMsg.ScanUI", "AiScanProductHandleCallback onAddScanProductResult can not add now");
                return false;
            }
            Log.i("MicroMsg.ScanUI", "AiScanProductHandleCallback onAddScanProductResult");
            if (BaseScanUI.this.f143589h == null) {
                return false;
            }
            ((j) j.f338034d).z(new Runnable() {
                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass1.AnonymousClass1 */

                public void run() {
                    boolean z15;
                    ScanProductMaskDecorView.d dVar;
                    Iterator<q> it;
                    boolean z16;
                    boolean z17;
                    ScanProductMaskDecorView scanProductMaskDecorView = BaseScanUI.this.f143589h;
                    r rVar = rVar;
                    AnonymousClass1 r35 = new kh4.a<b0>() {
                        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass1.AnonymousClass1.AnonymousClass1 */

                        /* Return type fixed from 'java.lang.Object' to match base method */
                        @Override // kh4.a
                        public b0 invoke() {
                            BaseScanUI.this.f143585f.x(true);
                            return null;
                        }
                    };
                    scanProductMaskDecorView.getClass();
                    if (rVar != null) {
                        ArrayList<q> arrayList = rVar.f341779d;
                        if (arrayList == null || arrayList.isEmpty()) {
                            z15 = true;
                        } else {
                            z15 = false;
                        }
                        if (!z15) {
                            ArrayList arrayList2 = new ArrayList();
                            int totalProductCount = scanProductMaskDecorView.getTotalProductCount();
                            Iterator<q> it4 = arrayList.iterator();
                            boolean z18 = false;
                            while (it4.hasNext()) {
                                q next = it4.next();
                                q qVar = null;
                                if (next != null) {
                                    if (next.f341754a.getId() > scanProductMaskDecorView.f144249j && next.f341754a.getShouldShow()) {
                                        scanProductMaskDecorView.f144249j = next.f341754a.getId();
                                        qVar = next;
                                    }
                                    Rect rect = new Rect();
                                    float width = (float) scanProductMaskDecorView.getWidth();
                                    float height = (float) scanProductMaskDecorView.getHeight();
                                    rect.set((int) (next.f341754a.getX1() * width), (int) (next.f341754a.getY1() * height), (int) (width * next.f341754a.getX2()), (int) (height * next.f341754a.getY2()));
                                    if (qVar != null) {
                                        if (!z18) {
                                            ScanProductInfo scanProductInfo = new ScanProductInfo();
                                            ScanProductInfo scanProductInfo2 = qVar.f341754a;
                                            scanProductInfo.setShouldShow(scanProductInfo2.getShouldShow());
                                            scanProductInfo.setProb(scanProductInfo2.getProb());
                                            scanProductInfo.setId(scanProductInfo2.getId());
                                            scanProductInfo.setAge(scanProductInfo2.getAge());
                                            scanProductInfo.setClassId(scanProductInfo2.getClassId());
                                            scanProductInfo.setHit(scanProductInfo2.getHit());
                                            scanProductInfo.setX1(scanProductInfo2.getX1());
                                            scanProductInfo.setY1(scanProductInfo2.getY1());
                                            scanProductInfo.setX2(scanProductInfo2.getX2());
                                            scanProductInfo.setY2(scanProductInfo2.getY2());
                                            q qVar2 = new q(scanProductInfo);
                                            qVar2.f341756c = qVar.f341756c;
                                            qVar2.f341757d = qVar.f341757d;
                                            qVar2.f341755b = qVar.f341755b;
                                            if (scanProductMaskDecorView.f144248i == 0) {
                                                Log.i("MicroMsg.ScanProductMaskDecorView", "addNewProduct:" + qVar2.f341754a.getId());
                                                ScanProductDetectRectView scanProductDetectRectView = new ScanProductDetectRectView(scanProductMaskDecorView.getContext());
                                                scanProductDetectRectView.setRect(rect);
                                                scanProductDetectRectView.setPivotX(rect.exactCenterX());
                                                scanProductDetectRectView.setPivotY(rect.exactCenterY());
                                                scanProductMaskDecorView.addView(scanProductDetectRectView);
                                                float width2 = scanProductMaskDecorView.f144246g / ((float) rect.width());
                                                ValueAnimator ofFloat = ValueAnimator.ofFloat(0.0f, 1.0f);
                                                ofFloat.setDuration(1000L);
                                                ScanProductMaskDecorView.b bVar = scanProductMaskDecorView.f144245f;
                                                if (bVar != null) {
                                                    int id5 = qVar2.f341754a.getId();
                                                    synchronized (bVar.f144257j) {
                                                        HashMap<Integer, o> hashMap = bVar.f144257j;
                                                        Integer valueOf = Integer.valueOf(id5);
                                                        o oVar = new o();
                                                        it = it4;
                                                        oVar.f341741h = qVar2.f341754a.getId();
                                                        oVar.f341738e = qVar2.f341756c;
                                                        oVar.f341739f = qVar2.f341757d;
                                                        oVar.f341740g = 1;
                                                        hashMap.put(valueOf, oVar);
                                                        b0 b0Var = b0.f332794a;
                                                    }
                                                } else {
                                                    it = it4;
                                                }
                                                ofFloat.addListener(new g0(scanProductMaskDecorView, scanProductDetectRectView, qVar2, r35));
                                                ofFloat.addUpdateListener(new h0(scanProductDetectRectView, width2));
                                                ofFloat.start();
                                                z17 = true;
                                            } else {
                                                it = it4;
                                                Log.w("MicroMsg.ScanProductMaskDecorView", "addNewProduct fail, scanProductListState:" + scanProductMaskDecorView.f144248i);
                                                z17 = false;
                                            }
                                            if (!z17) {
                                                z16 = false;
                                                z18 = z16;
                                            }
                                        } else {
                                            it = it4;
                                        }
                                        z16 = true;
                                        z18 = z16;
                                    } else {
                                        it = it4;
                                    }
                                    Log.i("MicroMsg.ScanProductMaskDecorView", "updateProductInfo  info:" + next + "   ");
                                    arrayList2.add(rect);
                                } else {
                                    it = it4;
                                }
                                it4 = it;
                            }
                            if (z18 && (dVar = scanProductMaskDecorView.f144247h) != null) {
                                dVar.b(rVar.f341778c, rVar.f341777b, totalProductCount + 1);
                            }
                        }
                    }
                }
            });
            return true;
        }

        @Override // xy2.i
        public void c(p pVar, int i15, String str) {
            int i16;
            ScanProductMaskDecorView scanProductMaskDecorView = BaseScanUI.this.f143589h;
            if (scanProductMaskDecorView != null) {
                ArrayList<o> arrayList = pVar.f341752d;
                int b15 = scanProductMaskDecorView.b(arrayList);
                Log.w("MicroMsg.ScanUI", "AiScanProductHandleCallback onUploadImageFailed pos:" + b15);
                if (b15 > 0 && b15 <= arrayList.size()) {
                    if (i15 != 1001) {
                        i16 = 1002;
                    } else {
                        i16 = i15;
                    }
                    o oVar = arrayList.get(b15 - 1);
                    BaseScanUI baseScanUI = BaseScanUI.this;
                    e1.q(baseScanUI.B, baseScanUI.Q, 3, b15, baseScanUI.f143589h.getTotalProductCount(), BaseScanUI.this.A, pVar.f341750b, pVar.f341751c, oVar.f341748o, oVar.f341747n, oVar.f341745l, i16);
                }
            }
        }

        @Override // xy2.i
        public void d(p pVar) {
            ScanProductMaskDecorView scanProductMaskDecorView = BaseScanUI.this.f143589h;
            if (scanProductMaskDecorView != null) {
                int b15 = scanProductMaskDecorView.b(pVar.f341752d);
                Log.i("MicroMsg.ScanUI", "AiScanProductHandleCallback onUploadImageSuccess pos:" + b15);
            }
        }

        @Override // xy2.i
        public void e(p pVar, int i15, String str) {
            ScanProductMaskDecorView scanProductMaskDecorView = BaseScanUI.this.f143589h;
            if (scanProductMaskDecorView != null) {
                ArrayList<o> arrayList = pVar.f341752d;
                int b15 = scanProductMaskDecorView.b(arrayList);
                Log.w("MicroMsg.ScanUI", "AiScanProductHandleCallback onRetrievalImageFailed pos:" + b15);
                if (b15 > 0 && b15 <= arrayList.size()) {
                    o oVar = arrayList.get(b15 - 1);
                    BaseScanUI baseScanUI = BaseScanUI.this;
                    e1.q(baseScanUI.B, baseScanUI.Q, 3, b15, baseScanUI.f143589h.getTotalProductCount(), BaseScanUI.this.A, pVar.f341750b, pVar.f341751c, oVar.f341748o, oVar.f341747n, oVar.f341745l, 1004);
                }
            }
        }
    };

    /* renamed from: a1  reason: collision with root package name */
    public final b1 f143579a1 = new b1(new l() {
        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass2 */

        @Override // fy2.l
        public void a(DialogInterface dialogInterface, int i15) {
            Log.i("MicroMsg.ScanUI", "alvinluo scanProductDialog onDismiss exitType: %d", Integer.valueOf(i15));
            BaseScanUI baseScanUI = BaseScanUI.this;
            baseScanUI.T = true;
            if (baseScanUI.f143584e1 == 0) {
                ScanUITopOpButtonComponent scanUITopOpButtonComponent = baseScanUI.f143599o;
                scanUITopOpButtonComponent.getClass();
                y.b(scanUITopOpButtonComponent, true, null);
                BaseScanUI.this.o8();
            }
            BaseScanUI baseScanUI2 = BaseScanUI.this;
            baseScanUI2.F = true;
            baseScanUI2.W0 = true;
            baseScanUI2.a8(true);
            long currentTimeMillis = System.currentTimeMillis();
            e1.b f15 = e1.f143320a.f(12);
            if (f15 != null) {
                f15.f143341d = currentTimeMillis;
            }
            BaseScanUI baseScanUI3 = BaseScanUI.this;
            e1.w(baseScanUI3.f143603r, 12, i15, baseScanUI3.N);
        }

        @Override // fy2.l
        public void onCancel(DialogInterface dialogInterface) {
            Log.i("MicroMsg.ScanUI", "alvinluo scanProductDialog onCancel");
            BaseScanUI baseScanUI = BaseScanUI.this;
            baseScanUI.R = false;
            baseScanUI.T = true;
            baseScanUI.F = true;
            baseScanUI.W0 = true;
        }

        @Override // fy2.l
        public void onShow(DialogInterface dialogInterface) {
            Log.i("MicroMsg.ScanUI", "alvinluo scanProductDialog onShow");
            ScanUITopOpButtonComponent scanUITopOpButtonComponent = BaseScanUI.this.f143599o;
            scanUITopOpButtonComponent.getClass();
            y.b(scanUITopOpButtonComponent, false, null);
            BaseScanUI.this.a8(false);
            long currentTimeMillis = System.currentTimeMillis();
            e1.b f15 = e1.f143320a.f(12);
            if (f15 != null) {
                f15.f143340c = currentTimeMillis;
            }
        }
    });

    /* renamed from: b1  reason: collision with root package name */
    public z0 f143580b1 = null;

    /* renamed from: c1  reason: collision with root package name */
    public final z0.a f143581c1 = new z0.a() {
        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass3 */

        @Override // com.tencent.mm.plugin.scanner.model.z0.a
        public void a(p pVar, int i15, long j15, int i16, String str) {
            Log.e("MicroMsg.ScanUI", "onScanFailed session: %d, source: %d, errCode: %d, errMsg: %s", Long.valueOf(j15), Integer.valueOf(i15), Integer.valueOf(i16), str);
            if (Util.isNullOrNil(str)) {
                str = BaseScanUI.this.getResources().getString(R.string.f369106ib4);
            }
            BaseScanUI baseScanUI = BaseScanUI.this;
            i14.j.y(baseScanUI, str, "", baseScanUI.getResources().getString(R.string.f367559x1), new DialogInterface.OnClickListener() {
                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass3.AnonymousClass1 */

                public void onClick(DialogInterface dialogInterface, int i15) {
                    BaseScanUI.this.o8();
                    e1.y(BaseScanUI.this.B);
                }
            });
            BaseScanUI baseScanUI2 = BaseScanUI.this;
            e1.r(baseScanUI2.B, baseScanUI2.Q, 14, baseScanUI2.A, pVar.f341750b);
            int i17 = pVar.f341749a;
            if (i17 == 4) {
                e1.s(false, i17);
            }
        }

        @Override // com.tencent.mm.plugin.scanner.model.z0.a
        public void b(p pVar) {
            if (!pVar.f341752d.isEmpty()) {
                BaseScanUI.U7(BaseScanUI.this, pVar.f341752d.get(0), true, -1, -1);
            }
            BaseScanUI baseScanUI = BaseScanUI.this;
            e1.r(baseScanUI.B, baseScanUI.Q, 15, baseScanUI.A, pVar.f341750b);
            com.tencent.mm.plugin.scanner.model.d.a(42, pVar.f341753e);
            int i15 = pVar.f341749a;
            if (i15 == 4) {
                e1.s(true, i15);
            }
        }
    };

    /* renamed from: d1  reason: collision with root package name */
    public final ScanProductMaskDecorView.e f143582d1 = new ScanProductMaskDecorView.e() {
        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass5 */

        @Override // com.tencent.mm.plugin.scanner.ui.widget.ScanProductMaskDecorView.e
        public void a(View view, o oVar, int i15, int i16) {
            q qVar = oVar.f341737d;
            if (qVar != null) {
                d.a aVar = qVar.f341760g;
                if (aVar != null) {
                    aVar.f143302c = oVar.f341747n;
                    aVar.f143303d = oVar.f341748o;
                }
                com.tencent.mm.plugin.scanner.model.d.a(3, aVar);
                com.tencent.mm.plugin.scanner.model.d.a(38, aVar);
            }
            BaseScanUI.U7(BaseScanUI.this, oVar, false, i15, i16);
        }
    };

    /* renamed from: e  reason: collision with root package name */
    public FrameLayout f143583e;

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

    /* renamed from: f  reason: collision with root package name */
    public ScanUIRectView f143585f;

    /* renamed from: f1  reason: collision with root package name */
    public final ScanProductMaskDecorView.d f143586f1 = new ScanProductMaskDecorView.d() {
        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass6 */

        @Override // com.tencent.mm.plugin.scanner.ui.widget.ScanProductMaskDecorView.d
        public void a(int i15) {
            Log.i("MicroMsg.ScanUI", "onProductListStateChange:" + i15);
            BaseScanUI baseScanUI = BaseScanUI.this;
            baseScanUI.f143584e1 = i15;
            if (i15 == 0) {
                baseScanUI.f143585f.A();
            } else if (i15 == 6) {
                t tVar = j.f338034d;
                AnonymousClass1 r05 = new Runnable() {
                    /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass6.AnonymousClass1 */

                    public void run() {
                        BaseScanUI.this.o8();
                        BaseScanUI.this.s8(true);
                        ScanUITopOpButtonComponent scanUITopOpButtonComponent = BaseScanUI.this.f143599o;
                        scanUITopOpButtonComponent.getClass();
                        y.b(scanUITopOpButtonComponent, true, null);
                    }
                };
                j jVar = (j) tVar;
                jVar.getClass();
                jVar.w(r05, 250, false);
            } else if (i15 == 2) {
                baseScanUI.f143585f.B();
            } else if (i15 == 3) {
                Log.i("MicroMsg.ScanUI", "alvinluo pauseScan");
                ScanUIRectView scanUIRectView = baseScanUI.f143585f;
                if (scanUIRectView != null) {
                    scanUIRectView.e();
                    scanUIRectView.j();
                }
                BaseScanUI.this.f143585f.getScanMaskView().setScanSource(3);
                BaseScanUI.this.f143585f.getScanMaskView().i(BaseScanUI.this.f143585f.getTextrueView());
                BaseScanUI.this.s8(false);
                ScanUITopOpButtonComponent scanUITopOpButtonComponent = BaseScanUI.this.f143599o;
                scanUITopOpButtonComponent.getClass();
                y.b(scanUITopOpButtonComponent, false, null);
            }
        }

        @Override // com.tencent.mm.plugin.scanner.ui.widget.ScanProductMaskDecorView.d
        public void b(int i15, long j15, int i16) {
            BaseScanUI.V7(BaseScanUI.this);
            BaseScanUI baseScanUI = BaseScanUI.this;
            e1.o(baseScanUI.B, baseScanUI.Q, 1, 1, i16, baseScanUI.A, j15, i15);
            com.tencent.mm.plugin.scanner.model.d.a(35, null);
            if (i16 == 1) {
                com.tencent.mm.plugin.report.service.q.INSTANCE.t(1259, 84);
                BaseScanUI baseScanUI2 = BaseScanUI.this;
                e1.o(baseScanUI2.B, baseScanUI2.Q, 2, 1, i16, baseScanUI2.A, j15, i15);
            }
        }
    };

    /* renamed from: g  reason: collision with root package name */
    public ScannerFlashSwitcher f143587g;

    /* renamed from: g1  reason: collision with root package name */
    public ScanUIRectView.ScanCallBack f143588g1 = new ScanUIRectView.ScanCallBack() {
        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass7 */

        @Override // com.tencent.mm.plugin.scanner.ui.ScanUIRectView.ScanCallBack
        public void a(final long j15, final Bundle bundle) {
            int i15;
            boolean z15;
            boolean z16;
            boolean z17;
            boolean z18;
            long j16;
            long j17;
            BaseScanUI baseScanUI = BaseScanUI.this;
            if (!baseScanUI.S) {
                Log.w("MicroMsg.ScanUI", "alvinluo onScanSuccess can not process code result currentMode: %d", Integer.valueOf(baseScanUI.B));
            } else if (baseScanUI.f143604s != null && bundle != null) {
                Log.i("MicroMsg.ScanUI", "scan code cost time: %d", Long.valueOf(System.currentTimeMillis() - BaseScanUI.this.A));
                final ArrayList parcelableArrayList = bundle.getParcelableArrayList("result_qbar_result_list");
                if (parcelableArrayList == null || parcelableArrayList.size() <= 0) {
                    Log.w("MicroMsg.ScanUI", "alvinluo onScanSuccess qbarResult invalid");
                    return;
                }
                final int i16 = bundle.getInt("result_code_point_count", 0);
                long j18 = bundle.getLong("decode_success_cost_time", 0);
                BaseScanUI baseScanUI2 = BaseScanUI.this;
                if (baseScanUI2.f143601p0) {
                    i15 = 3;
                } else {
                    i15 = 1;
                }
                e1.n(baseScanUI2.B, true, i15, i16);
                com.tencent.mm.plugin.scanner.model.d.a(1, null);
                BaseScanUI.this.m8();
                BaseScanUI baseScanUI3 = BaseScanUI.this;
                if (i16 > 1) {
                    z15 = true;
                } else {
                    z15 = false;
                }
                baseScanUI3.k8(true, z15);
                BaseScanUI.this.q8(false);
                int i17 = BaseScanUI.this.B;
                e1.a aVar = new e1.a(parcelableArrayList, j18);
                e1.f143328i = aVar;
                try {
                    String e15 = e1.e(i17);
                    if (e15 != null) {
                        j16 = Long.parseLong(e15);
                    } else {
                        j16 = System.currentTimeMillis();
                    }
                    aVar.f143332c = j16;
                    e1.a aVar2 = e1.f143328i;
                    if (aVar2 != null) {
                        String d15 = e1.d(i17);
                        if (d15 != null) {
                            j17 = Long.parseLong(d15);
                        } else {
                            j17 = System.currentTimeMillis();
                        }
                        aVar2.f143333d = j17;
                    }
                    e1.a aVar3 = e1.f143328i;
                    if (aVar3 != null) {
                        aVar3.f143334e = Long.parseLong(e1.f143321b);
                    }
                    e1.a aVar4 = e1.f143328i;
                    if (aVar4 != null) {
                        aVar4.f143335f = System.currentTimeMillis();
                    }
                } catch (Exception unused) {
                }
                boolean z19 = BaseScanUI.this.f143587g.f143967g;
                final WxQBarResult wxQBarResult = (WxQBarResult) parcelableArrayList.get(0);
                if (wxQBarResult == null) {
                    Log.i("MicroMsg.ScanUI", "firstQBarResult is null");
                    return;
                }
                BaseScanUI baseScanUI4 = BaseScanUI.this;
                if (parcelableArrayList.size() <= 1) {
                    z16 = true;
                } else {
                    z16 = false;
                }
                if (BaseScanUI.W7(baseScanUI4, wxQBarResult, z16)) {
                    Log.w("MicroMsg.ScanUI", "scan code has deal with");
                    return;
                }
                bundle.putInt("qbar_string_scan_source", 0);
                if (i16 <= 0 || BaseScanUI.this.f143585f == null) {
                    BaseScanUI.this.q8(true);
                    if (!BaseScanUI.W7(BaseScanUI.this, wxQBarResult, true)) {
                        BaseScanUI.X7(BaseScanUI.this, j15, bundle, wxQBarResult);
                        return;
                    }
                    return;
                }
                ScanDecodeFrameData scanDecodeFrameData = (ScanDecodeFrameData) bundle.getParcelable("decode_success_frame_data");
                if (scanDecodeFrameData != null) {
                    BaseScanUI.this.f143585f.setDecodeSuccessFrameData(scanDecodeFrameData);
                }
                BaseScanUI baseScanUI5 = BaseScanUI.this;
                if (i16 > 1) {
                    z17 = true;
                } else {
                    z17 = false;
                }
                baseScanUI5.T0 = z17;
                if (i16 > 1) {
                    baseScanUI5.f143599o.a(false);
                    BaseScanUI.this.f143599o.b(true, null);
                    BaseScanUI.this.s8(false);
                }
                BaseScanUI baseScanUI6 = BaseScanUI.this;
                baseScanUI6.R = true;
                baseScanUI6.f143585f.setSuccessMarkClickListener(new g1() {
                    /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass7.AnonymousClass1 */

                    @Override // com.tencent.mm.plugin.scanner.model.g1
                    public void a(int i15, View view) {
                        int i16;
                        Log.i("MicroMsg.ScanUI", "alvinluo onScanSuccess onClick mark index: %d", Integer.valueOf(i15));
                        if (i15 < parcelableArrayList.size() && i16 > 1) {
                            BaseScanUI.this.R = false;
                            WxQBarResult wxQBarResult = (WxQBarResult) parcelableArrayList.get(i15);
                            if (!BaseScanUI.W7(BaseScanUI.this, wxQBarResult, true)) {
                                BaseScanUI.X7(BaseScanUI.this, j15, bundle, wxQBarResult);
                            }
                            e1.k(2, i15, BaseScanUI.this.f143601p0);
                            com.tencent.mm.plugin.report.service.q qVar = com.tencent.mm.plugin.report.service.q.INSTANCE;
                            if (!e1.f143327h) {
                                i16 = 63;
                            } else {
                                i16 = 83;
                            }
                            qVar.t(1259, i16);
                        }
                    }
                });
                BaseScanUI.this.Y7(2);
                BaseScanUI.this.t8(false, false);
                BaseScanUI.V7(BaseScanUI.this);
                ScanUIRectView scanUIRectView = BaseScanUI.this.f143585f;
                scanUIRectView.getClass();
                if (fz2.p.f218174b) {
                    if (scanUIRectView.f143901s == null) {
                        Context context = scanUIRectView.getContext();
                        m.g(context, "context");
                        ScanDebugView scanDebugView = new ScanDebugView(context, null);
                        scanUIRectView.f143901s = scanDebugView;
                        scanUIRectView.addView(scanDebugView);
                    }
                    ScanDebugView scanDebugView2 = scanUIRectView.f143901s;
                    if (scanDebugView2 != null) {
                        String string = bundle.getString("decode_debug_string");
                        if (string == null || string.length() == 0) {
                            z18 = true;
                        } else {
                            z18 = false;
                        }
                        if (!z18) {
                            scanDebugView2.setVisibility(0);
                            TextView textView = scanDebugView2.f144182d;
                            if (textView != null) {
                                textView.setText(string);
                            } else {
                                m.p("debugInfo");
                                throw null;
                            }
                        } else {
                            scanDebugView2.setVisibility(8);
                            TextView textView2 = scanDebugView2.f144182d;
                            if (textView2 != null) {
                                textView2.setText("");
                            } else {
                                m.p("debugInfo");
                                throw null;
                            }
                        }
                    }
                }
                BaseScanUI.this.f143585f.q(parcelableArrayList, new com.tencent.mm.plugin.scanner.view.e() {
                    /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass7.AnonymousClass2 */

                    @Override // com.tencent.mm.plugin.scanner.view.e
                    public void a(boolean z15) {
                        if (z15 || i16 == 1 || parcelableArrayList.size() == 1) {
                            BaseScanUI baseScanUI = BaseScanUI.this;
                            baseScanUI.R = false;
                            if (!BaseScanUI.W7(baseScanUI, wxQBarResult, true)) {
                                BaseScanUI.X7(BaseScanUI.this, j15, bundle, wxQBarResult);
                            }
                            e1.k(1, 0, BaseScanUI.this.f143601p0);
                            return;
                        }
                        BaseScanUI.this.f143606u.b(false);
                    }

                    @Override // com.tencent.mm.plugin.scanner.view.e
                    public void b() {
                    }
                }, z19, true);
            }
        }
    };

    /* renamed from: h  reason: collision with root package name */
    public ScanProductMaskDecorView f143589h;

    /* renamed from: h1  reason: collision with root package name */
    public final d.c f143590h1 = new d.c() {
        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass9 */

        @Override // com.tencent.mm.plugin.scanner.ui.ScanUIRectView.ScanCallBack
        public void a(long j15, Bundle bundle) {
            BaseScanUI baseScanUI = BaseScanUI.this;
            if (baseScanUI.f143607v) {
                Log.w("MicroMsg.ScanUI", "alvinluo onScanSuccess isScrolling and ignore");
            } else if (baseScanUI.f143604s != null && bundle != null) {
                baseScanUI.X++;
                int i15 = bundle.getInt("scan_source", 0);
                Log.i("MicroMsg.ScanUI", "alvinluo onScanSuccess cost time %d, scanImageCount: %d, source: %d, session: %d", Long.valueOf(System.currentTimeMillis() - BaseScanUI.this.A), Integer.valueOf(BaseScanUI.this.X), Integer.valueOf(i15), Long.valueOf(j15));
                if (i15 == 1) {
                    BaseScanUI baseScanUI2 = BaseScanUI.this;
                    if (!baseScanUI2.R) {
                        BaseScanRequest baseScanRequest = baseScanUI2.N;
                        if (baseScanRequest instanceof ScanGoodsRequest) {
                            bundle.putParcelable("key_scan_request", baseScanRequest);
                            bundle.putInt("key_scan_goods_mode", ((ScanGoodsRequest) BaseScanUI.this.N).f143097j);
                        }
                        BaseScanUI.this.f143604s.a(j15, bundle);
                        return;
                    }
                }
                if (i15 == 2) {
                    BaseScanRequest baseScanRequest2 = BaseScanUI.this.N;
                    if (baseScanRequest2 instanceof ScanGoodsRequest) {
                        bundle.putParcelable("key_scan_request", baseScanRequest2);
                    }
                    BaseScanUI.this.f143604s.a(j15, bundle);
                }
            }
        }

        @Override // ny2.d.c
        public void b(long j15, int i15, int i16, String str) {
            Log.e("MicroMsg.ScanUI", "alvinluo onScanFailed session: %d, source: %d, errCode: %d, errMsg: %s", Long.valueOf(j15), Integer.valueOf(i15), Integer.valueOf(i16), str);
            if (Util.isNullOrNil(str)) {
                str = BaseScanUI.this.getResources().getString(R.string.f369106ib4);
            }
            BaseScanUI baseScanUI = BaseScanUI.this;
            i14.j.y(baseScanUI, str, "", baseScanUI.getResources().getString(R.string.f367559x1), new DialogInterface.OnClickListener() {
                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass9.AnonymousClass1 */

                public void onClick(DialogInterface dialogInterface, int i15) {
                    BaseScanUI.this.o8();
                    e1.y(BaseScanUI.this.B);
                }
            });
            e1.b(i15, false, System.currentTimeMillis(), false);
        }
    };

    /* renamed from: i  reason: collision with root package name */
    public View f143591i;

    /* renamed from: i1  reason: collision with root package name */
    public final a.b f143592i1 = new a.b() {
        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass10 */

        @Override // wy2.a.b
        public void a(int i15, long j15, int i16, String str) {
            if (i15 == 2) {
                Log.e("MicroMsg.ScanUI", "alvinluo onScanResultFailed scan from gallery failed errCode: %d, errMsg: %s", Integer.valueOf(i16), str);
                e1.b(i15, false, System.currentTimeMillis(), false);
                e1.s(false, i15);
                BaseScanUI baseScanUI = BaseScanUI.this;
                baseScanUI.getClass();
                Log.i("MicroMsg.ScanUI", "alvinluo pauseScan");
                ScanUIRectView scanUIRectView = baseScanUI.f143585f;
                if (scanUIRectView != null) {
                    scanUIRectView.e();
                    scanUIRectView.j();
                }
                BaseScanUI.this.m8();
                BaseScanMaskView baseScanMaskView = BaseScanUI.this.f143585f.f143900r;
                if (baseScanMaskView != null) {
                    baseScanMaskView.s(false, null);
                }
                if (Util.isNullOrNil(str)) {
                    str = BaseScanUI.this.getResources().getString(R.string.f369106ib4);
                }
                BaseScanUI baseScanUI2 = BaseScanUI.this;
                i14.j.y(baseScanUI2, str, "", baseScanUI2.getResources().getString(R.string.f367559x1), new DialogInterface.OnClickListener() {
                    /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass10.AnonymousClass1 */

                    public void onClick(DialogInterface dialogInterface, int i15) {
                        BaseScanUI.this.o8();
                        e1.y(BaseScanUI.this.B);
                    }
                });
            } else if (i15 == 1 && i16 == 1003) {
                Log.e("MicroMsg.ScanUI", "alvinluo onScanResultFailed stop upload and show alert");
                f fVar = BaseScanUI.this.f143604s;
                if (fVar != null) {
                    fVar.c(j15, false);
                }
                BaseScanUI baseScanUI3 = BaseScanUI.this;
                baseScanUI3.getClass();
                Log.i("MicroMsg.ScanUI", "alvinluo pauseScan");
                ScanUIRectView scanUIRectView2 = baseScanUI3.f143585f;
                if (scanUIRectView2 != null) {
                    scanUIRectView2.e();
                    scanUIRectView2.j();
                }
                BaseScanUI.this.m8();
                if (Util.isNullOrNil(str)) {
                    str = BaseScanUI.this.getResources().getString(R.string.ib5);
                }
                BaseScanUI baseScanUI4 = BaseScanUI.this;
                i14.j.y(baseScanUI4, str, "", baseScanUI4.getResources().getString(R.string.f367559x1), new DialogInterface.OnClickListener() {
                    /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass10.AnonymousClass2 */

                    public void onClick(DialogInterface dialogInterface, int i15) {
                        BaseScanUI.this.o8();
                        e1.y(BaseScanUI.this.B);
                    }
                });
            }
        }

        @Override // wy2.a.b
        public void b(int i15, long j15, int i16) {
            Log.i("MicroMsg.ScanUI", "notifyEvent source: %d, session: %d, event: %d", Integer.valueOf(i15), Long.valueOf(j15), Integer.valueOf(i16));
        }

        @Override // wy2.a.b
        public void c(n0 n0Var) {
            BaseScanUI baseScanUI = BaseScanUI.this;
            if (baseScanUI.B != 12) {
                Log.i("MicroMsg.ScanUI", "alvnluo onScanResultSuccess not SELECT_SCAN_MODE_GOODS and ignore");
            } else if (baseScanUI.f143607v || (n0Var.f143466h == 1 && baseScanUI.R)) {
                Log.e("MicroMsg.ScanUI", "alvinluo onScanResultSuccess source:%d, isScrolling: %b or needPauseScan: %b and ignore", Integer.valueOf(n0Var.f143466h), Boolean.valueOf(BaseScanUI.this.f143607v), Boolean.valueOf(BaseScanUI.this.R));
            } else {
                baseScanUI.getClass();
                long j15 = n0Var.f143464f;
                if (n0Var.f143459a) {
                    boolean z15 = baseScanUI.f143587g.f143967g;
                    baseScanUI.g8(j15, n0Var.f143466h);
                    baseScanUI.j8(true);
                    e1.s(true, n0Var.f143466h);
                    e1.b(n0Var.f143466h, true, System.currentTimeMillis(), false);
                    baseScanUI.f143585f.q(n0Var, new com.tencent.mm.plugin.scanner.view.e(n0Var) {
                        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass11 */

                        /* renamed from: a  reason: collision with root package name */
                        public final /* synthetic */ n0 f143624a;

                        {
                            this.f143624a = r2;
                        }

                        @Override // com.tencent.mm.plugin.scanner.view.e
                        public void a(boolean z15) {
                            BaseScanUI.this.f143585f.post(new Runnable() {
                                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass11.AnonymousClass1 */

                                public void run() {
                                    boolean z15;
                                    int i15;
                                    int i16;
                                    if (!BaseScanUI.this.isFinishing()) {
                                        AnonymousClass11 r05 = AnonymousClass11.this;
                                        BaseScanUI baseScanUI = BaseScanUI.this;
                                        n0 n0Var = r05.f143624a;
                                        if (n0Var == null) {
                                            int i17 = BaseScanUI.f143578n1;
                                            baseScanUI.getClass();
                                            return;
                                        }
                                        BaseScanRequest baseScanRequest = baseScanUI.N;
                                        if ((baseScanRequest instanceof ScanGoodsRequest) && ((ScanGoodsRequest) baseScanRequest).f143099o == (i16 = n0Var.f143465g) && i16 == 1) {
                                            z15 = true;
                                        } else {
                                            z15 = false;
                                        }
                                        Log.i("MicroMsg.ScanUI", "alvinluo showBoxDialog jumpType: %d, returnType: %d, directFinishWithResult: %b", Integer.valueOf(n0Var.f143462d), Integer.valueOf(n0Var.f143465g), Boolean.valueOf(z15));
                                        if (z15) {
                                            e1.t(baseScanUI.f143603r, 12, n0Var.f143466h, baseScanUI.N, 2);
                                            Intent intent = new Intent();
                                            intent.putExtra("key_scan_goods_result_req_key", n0Var.f143463e);
                                            baseScanUI.setResult(-1, intent);
                                            baseScanUI.p();
                                            return;
                                        }
                                        ScanUIRectView scanUIRectView = baseScanUI.f143585f;
                                        if (scanUIRectView != null) {
                                            BaseScanMaskView scanMaskView = scanUIRectView.getScanMaskView();
                                            if ((scanMaskView instanceof ScanGoodsMaskView) || (scanMaskView instanceof ScanCodeProductMergeMaskView)) {
                                                x xVar = baseScanUI.f143602q;
                                                if (xVar != null) {
                                                    xVar.g(0);
                                                }
                                                n nVar = baseScanUI.f143600p;
                                                if (nVar != null && nVar.h()) {
                                                    baseScanUI.f143600p.p();
                                                }
                                                e1.t(baseScanUI.f143603r, 12, n0Var.f143466h, baseScanUI.N, 1);
                                                Bundle bundle = new Bundle();
                                                bundle.putInt("template_type", 1);
                                                bundle.putString("req_key", n0Var.f143463e);
                                                bundle.putString("enter_session", e1.f143321b);
                                                bundle.putString("tab_session", e1.e(12));
                                                bundle.putString("scan_session", e1.d(12));
                                                int i18 = n0Var.f143466h;
                                                if (i18 == 1 || i18 == 2) {
                                                    bundle.putString("scanTabMerge", "0");
                                                }
                                                BaseScanRequest baseScanRequest2 = baseScanUI.N;
                                                if ((baseScanRequest2 instanceof ScanGoodsRequest) && (i15 = ((ScanGoodsRequest) baseScanRequest2).f143104t) > 0) {
                                                    bundle.putInt("fixed_dialog_height", i15);
                                                }
                                                x b15 = a0.b(baseScanUI, bundle, baseScanUI.f143594j1);
                                                baseScanUI.f143602q = b15;
                                                fy2.i iVar = (fy2.i) scanMaskView;
                                                m.g(iVar, "viewModel");
                                                BaseBoxDialogView baseBoxDialogView = b15.f217983s;
                                                if (baseBoxDialogView != null) {
                                                    baseBoxDialogView.setBackgroundViewModel(iVar);
                                                }
                                                x xVar2 = baseScanUI.f143602q;
                                                k kVar = (k) scanMaskView;
                                                xVar2.getClass();
                                                m.g(kVar, ServiceSpecificExtraArgs.CastExtraArgs.LISTENER);
                                                BaseBoxDialogView baseBoxDialogView2 = xVar2.f217983s;
                                                if (baseBoxDialogView2 != null) {
                                                    baseBoxDialogView2.setBackgroundListener(kVar);
                                                }
                                            }
                                        }
                                    }
                                }
                            });
                        }

                        @Override // com.tencent.mm.plugin.scanner.view.e
                        public void b() {
                        }
                    }, z15, true);
                }
            }
        }
    };

    /* renamed from: j  reason: collision with root package name */
    public ScanSharedMaskView f143593j;

    /* renamed from: j1  reason: collision with root package name */
    public final l f143594j1 = new l() {
        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass12 */

        @Override // fy2.l
        public void a(DialogInterface dialogInterface, int i15) {
            Log.i("MicroMsg.ScanUI", "alvinluo ScanBoxDialog onDismiss exitType: %d", Integer.valueOf(i15));
            BaseScanUI baseScanUI = BaseScanUI.this;
            baseScanUI.T = true;
            baseScanUI.F = true;
            ScanUITopOpButtonComponent scanUITopOpButtonComponent = baseScanUI.f143599o;
            scanUITopOpButtonComponent.getClass();
            y.b(scanUITopOpButtonComponent, true, null);
            BaseScanUI.this.o8();
            BaseScanUI.this.a8(true);
            long currentTimeMillis = System.currentTimeMillis();
            e1.b f15 = e1.f143320a.f(12);
            if (f15 != null) {
                f15.f143341d = currentTimeMillis;
            }
            BaseScanUI baseScanUI2 = BaseScanUI.this;
            e1.w(baseScanUI2.f143603r, 12, i15, baseScanUI2.N);
            e1.y(12);
        }

        @Override // fy2.l
        public void onCancel(DialogInterface dialogInterface) {
            Log.i("MicroMsg.ScanUI", "alvinluo ScanBoxDialog onCancel");
            BaseScanUI baseScanUI = BaseScanUI.this;
            baseScanUI.R = false;
            baseScanUI.T = true;
            baseScanUI.F = true;
        }

        @Override // fy2.l
        public void onShow(DialogInterface dialogInterface) {
            Log.i("MicroMsg.ScanUI", "alvinluo ScanBoxDialog onShow");
            ScanUITopOpButtonComponent scanUITopOpButtonComponent = BaseScanUI.this.f143599o;
            scanUITopOpButtonComponent.getClass();
            y.b(scanUITopOpButtonComponent, false, null);
            BaseScanUI.this.a8(false);
            long currentTimeMillis = System.currentTimeMillis();
            e1.b f15 = e1.f143320a.f(12);
            if (f15 != null) {
                f15.f143340c = currentTimeMillis;
            }
        }
    };

    /* renamed from: k1  reason: collision with root package name */
    public com.tencent.mm.network.p f143595k1 = new p.a() {
        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass29 */

        @Override // com.tencent.mm.network.p
        public void onNetworkChange(final int i15) {
            MMHandlerThread.postToMainThread(new Runnable() {
                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass29.AnonymousClass1 */

                /* JADX WARNING: Removed duplicated region for block: B:17:0x0053  */
                /* JADX WARNING: Removed duplicated region for block: B:44:0x00c2 A[RETURN] */
                /* JADX WARNING: Removed duplicated region for block: B:45:0x00c3  */
                public void run() {
                    boolean z15;
                    ScanUIRectView scanUIRectView;
                    BaseScanUI baseScanUI;
                    boolean z16;
                    x xVar;
                    BaseScanUI baseScanUI2 = BaseScanUI.this;
                    int i15 = BaseScanUI.f143578n1;
                    if (!baseScanUI2.f8() || !baseScanUI2.T0) {
                        if (baseScanUI2.B == 12) {
                            z16 = true;
                        } else {
                            z16 = false;
                        }
                        if (!z16 || (xVar = baseScanUI2.f143602q) == null || !xVar.isShowing()) {
                            z15 = true;
                            Log.i("MicroMsg.ScanUI", "onNetWorkChange %d, canResume: %b", Integer.valueOf(z.d().m()), Boolean.valueOf(z15));
                            scanUIRectView = BaseScanUI.this.f143585f;
                            if (scanUIRectView != null) {
                                int i16 = i15;
                                if (z.d().m() == 6 || z.d().m() == 4) {
                                    scanUIRectView.E = true;
                                    if (!scanUIRectView.l() && z15) {
                                        scanUIRectView.f();
                                    }
                                } else {
                                    scanUIRectView.E = false;
                                    if (!scanUIRectView.l()) {
                                        scanUIRectView.e();
                                    }
                                }
                                BaseScanMaskView baseScanMaskView = scanUIRectView.f143900r;
                                if (baseScanMaskView != null) {
                                    baseScanMaskView.k(i16);
                                }
                                ScanSharedMaskView scanSharedMaskView = scanUIRectView.f143899q;
                                if (scanSharedMaskView != null) {
                                    scanSharedMaskView.d();
                                    scanSharedMaskView.i(scanSharedMaskView.f144274o);
                                }
                            }
                            if (z.d().m() != 6 || z.d().m() == 4) {
                                baseScanUI = BaseScanUI.this;
                                if (baseScanUI.E) {
                                    baseScanUI.E = true;
                                    baseScanUI.y8();
                                    return;
                                }
                                return;
                            }
                            BaseScanUI baseScanUI3 = BaseScanUI.this;
                            if (baseScanUI3.E) {
                                baseScanUI3.E = false;
                                baseScanUI3.y8();
                                return;
                            }
                            return;
                        }
                    }
                    z15 = false;
                    Log.i("MicroMsg.ScanUI", "onNetWorkChange %d, canResume: %b", Integer.valueOf(z.d().m()), Boolean.valueOf(z15));
                    scanUIRectView = BaseScanUI.this.f143585f;
                    if (scanUIRectView != null) {
                    }
                    if (z.d().m() != 6) {
                    }
                    baseScanUI = BaseScanUI.this;
                    if (baseScanUI.E) {
                    }
                }
            });
        }
    };

    /* renamed from: l1  reason: collision with root package name */
    public IListener f143596l1;

    /* renamed from: m1  reason: collision with root package name */
    public IListener<VoipEvent> f143597m1;

    /* renamed from: n  reason: collision with root package name */
    public ScanInfoMaskView f143598n;

    /* renamed from: o  reason: collision with root package name */
    public ScanUITopOpButtonComponent f143599o;

    /* renamed from: p  reason: collision with root package name */
    public n f143600p;

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

    /* renamed from: q  reason: collision with root package name */
    public x f143602q = null;

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

    /* renamed from: s  reason: collision with root package name */
    public f f143604s;

    /* renamed from: t  reason: collision with root package name */
    public Vibrator f143605t;

    /* renamed from: u  reason: collision with root package name */
    public i0 f143606u;

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

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

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

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

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

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

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

    public BaseScanUI() {
        h hVar = h.f61283d;
        this.f143596l1 = new IListener<ScanDarkDetectEvent>(hVar) {
            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass30 */

            {
                this.__eventId = -890853388;
            }

            /* JADX DEBUG: Method arguments types fixed to match base method, original types: [com.tencent.mm.sdk.event.IEvent] */
            @Override // com.tencent.mm.sdk.event.IListener
            public boolean callback(ScanDarkDetectEvent scanDarkDetectEvent) {
                boolean z15;
                ScanDarkDetectEvent scanDarkDetectEvent2 = scanDarkDetectEvent;
                BaseScanUI baseScanUI = BaseScanUI.this;
                int i15 = BaseScanUI.f143578n1;
                if (baseScanUI.B == 3) {
                    z15 = true;
                } else {
                    z15 = false;
                }
                if ((!z15) && baseScanUI.F) {
                    if (scanDarkDetectEvent2.f64377d.f64378a) {
                        baseScanUI.t8(true, true);
                    } else {
                        baseScanUI.t8(false, true);
                    }
                }
                return false;
            }
        };
        this.f143597m1 = new IListener<VoipEvent>(hVar) {
            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass31 */

            {
                this.__eventId = -797557590;
            }

            /* JADX DEBUG: Method arguments types fixed to match base method, original types: [com.tencent.mm.sdk.event.IEvent] */
            @Override // com.tencent.mm.sdk.event.IListener
            public boolean callback(VoipEvent voipEvent) {
                VoipEvent voipEvent2 = voipEvent;
                if (voipEvent2 instanceof VoipEvent) {
                    if (!z.a()) {
                        return false;
                    }
                    if (voipEvent2.f65043d.f65046b == 3) {
                        ScanUIRectView scanUIRectView = BaseScanUI.this.f143585f;
                        if (scanUIRectView != null) {
                            scanUIRectView.o();
                        }
                        BaseScanUI.this.finish();
                    }
                }
                return true;
            }
        };
    }

    public static boolean T7(BaseScanUI baseScanUI, r rVar) {
        int i15;
        if (!baseScanUI.W0 || baseScanUI.f143607v || (rVar != null && rVar.f341776a == 3 && baseScanUI.R)) {
            Object[] objArr = new Object[4];
            if (rVar != null) {
                i15 = rVar.f341776a;
            } else {
                i15 = -1;
            }
            objArr[0] = Integer.valueOf(i15);
            objArr[1] = Boolean.valueOf(baseScanUI.f143607v);
            objArr[2] = Boolean.valueOf(baseScanUI.R);
            objArr[3] = Boolean.valueOf(baseScanUI.W0);
            Log.e("MicroMsg.ScanUI", "checkCanAddScanNewProduct source:%d, isScrolling: %b or needPauseScan: %b or canAddScanProduct: %s, and ignore", objArr);
        } else if (baseScanUI.f8()) {
            return true;
        } else {
            Log.w("MicroMsg.ScanUI", "onScanResult not scan code mode and ignore");
        }
        return false;
    }

    public static void U7(BaseScanUI baseScanUI, o oVar, final boolean z15, int i15, int i16) {
        boolean z16;
        if (oVar == null) {
            baseScanUI.getClass();
            return;
        }
        if (i15 > 0) {
            e1.q(baseScanUI.B, baseScanUI.Q, 5, i16, i15, baseScanUI.A, oVar.f341735b, oVar.f341736c, oVar.f341748o, oVar.f341747n, oVar.f341745l, 0);
        }
        boolean z17 = false;
        baseScanUI.W0 = false;
        b1 b1Var = baseScanUI.f143579a1;
        AnonymousClass4 r55 = new b1.a() {
            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass4 */

            @Override // com.tencent.mm.plugin.scanner.model.b1.a
            public void a(x xVar) {
                if (!BaseScanUI.this.isFinishing()) {
                    x xVar2 = BaseScanUI.this.f143602q;
                    if (xVar2 != null) {
                        xVar2.g(0);
                    }
                    n nVar = BaseScanUI.this.f143600p;
                    if (nVar != null && nVar.h()) {
                        BaseScanUI.this.f143600p.p();
                    }
                    BaseScanUI baseScanUI = BaseScanUI.this;
                    baseScanUI.f143602q = xVar;
                    BaseScanMaskView scanMaskView = baseScanUI.f143585f.getScanMaskView();
                    if (scanMaskView instanceof ScanCodeProductMergeMaskView) {
                        x xVar3 = BaseScanUI.this.f143602q;
                        ScanCodeProductMergeMaskView scanCodeProductMergeMaskView = (ScanCodeProductMergeMaskView) scanMaskView;
                        xVar3.getClass();
                        m.g(scanCodeProductMergeMaskView, ServiceSpecificExtraArgs.CastExtraArgs.LISTENER);
                        BaseBoxDialogView baseBoxDialogView = xVar3.f217983s;
                        if (baseBoxDialogView != null) {
                            baseBoxDialogView.setBackgroundListener(scanCodeProductMergeMaskView);
                        }
                    }
                    if ((scanMaskView instanceof fy2.i) && z15) {
                        x xVar4 = BaseScanUI.this.f143602q;
                        fy2.i iVar = (fy2.i) scanMaskView;
                        xVar4.getClass();
                        m.g(iVar, "viewModel");
                        BaseBoxDialogView baseBoxDialogView2 = xVar4.f217983s;
                        if (baseBoxDialogView2 != null) {
                            baseBoxDialogView2.setBackgroundViewModel(iVar);
                        }
                    }
                }
            }

            public void b(o oVar) {
                BaseScanUI baseScanUI = BaseScanUI.this;
                long j15 = oVar.f341735b;
                int i15 = oVar.f341734a;
                int i16 = BaseScanUI.f143578n1;
                baseScanUI.g8(j15, i15);
            }
        };
        b1Var.getClass();
        r55.b(oVar);
        ScanUIRectView scanUIRectView = baseScanUI.f143585f;
        ScannerFlashSwitcher scannerFlashSwitcher = baseScanUI.f143587g;
        if (scannerFlashSwitcher == null || !scannerFlashSwitcher.f143967g) {
            z16 = false;
        } else {
            z16 = true;
        }
        ScanCodeProductMergeMaskView.a aVar = new ScanCodeProductMergeMaskView.a(oVar, z15);
        if (!(scanUIRectView instanceof ScanUIRectView)) {
            scanUIRectView = null;
        }
        if (scanUIRectView != null) {
            d1 d1Var = new d1(baseScanUI, oVar, b1Var, r55);
            if (baseScanUI.f143584e1 != 1) {
                z17 = true;
            }
            scanUIRectView.q(aVar, d1Var, z16, z17);
        }
    }

    public static void V7(BaseScanUI baseScanUI) {
        baseScanUI.getClass();
        ((j) j.f338034d).f(new Runnable() {
            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass8 */

            public void run() {
                PlaySound.play(BaseScanUI.this, R.string.hpq);
            }
        });
        baseScanUI.f143605t.vibrate(10);
    }

    public static boolean W7(BaseScanUI baseScanUI, WxQBarResult wxQBarResult, boolean z15) {
        if (!baseScanUI.J) {
            return false;
        }
        if (wxQBarResult == null) {
            Log.e("MicroMsg.ScanUI", "dealWithReturnCode qBarResult is null");
        } else if (!baseScanUI.f143612y0 || z15) {
            Log.i("MicroMsg.ScanUI", "dealWithReturnCode deal with qBarResult");
            String str = wxQBarResult.f191070e;
            PublishScanCodeResultEvent publishScanCodeResultEvent = new PublishScanCodeResultEvent();
            String str2 = wxQBarResult.f191071f;
            PublishScanCodeResultEvent.a aVar = publishScanCodeResultEvent.f63981d;
            aVar.f63985c = str2;
            aVar.f63984b = str;
            aVar.f63983a = 0;
            publishScanCodeResultEvent.publish();
            Intent intent = new Intent();
            intent.putExtra("key_scan_result", str2);
            intent.putExtra("key_scan_result_raw", wxQBarResult.f191072g);
            intent.putExtra("key_scan_result_code_name", str);
            intent.putExtra("key_scan_result_code_version", wxQBarResult.f191065j);
            baseScanUI.setResult(-1, intent);
            baseScanUI.p();
        } else {
            Log.w("MicroMsg.ScanUI", "dealWithReturnCode do not direct deal with multicode");
            return false;
        }
        return true;
    }

    public static void X7(BaseScanUI baseScanUI, long j15, Bundle bundle, WxQBarResult wxQBarResult) {
        if (baseScanUI.f143604s != null && wxQBarResult != null && bundle != null) {
            bundle.putInt("result_code_format", wxQBarResult.f191069d);
            bundle.putString("result_content", wxQBarResult.f191071f);
            bundle.putString("result_code_name", wxQBarResult.f191070e);
            bundle.putByteArray("result_raw_data", wxQBarResult.f191072g);
            bundle.putInt("result_code_version", wxQBarResult.f191065j);
            bundle.putBoolean("key_disable_bar_code_jump_scan_goods", baseScanUI.f143601p0);
            bundle.putIntegerArrayList("key_scan_tab_bar_type_list", baseScanUI.Y0);
            baseScanUI.f143604s.a(j15, new g.a(1, bundle));
        }
    }

    public final void Y7(int i15) {
        if (i15 == 1 && !this.f143587g.f143967g) {
            h8(i15);
        } else if (i15 == 2 && this.f143587g.f143967g) {
            h8(i15);
        }
    }

    public final void Z7() {
        boolean z15;
        if (!this.Y) {
            if (this.B == 12) {
                z15 = true;
            } else {
                z15 = false;
            }
            if (z15 || (f8() && this.f143601p0)) {
                this.Y = true;
                com.tencent.mm.plugin.scanner.model.i0 i0Var = com.tencent.mm.plugin.scanner.model.i0.f143377a;
                Log.i("MicroMsg.ScanFastFocusEngineManager", "checkAndUpdateScanEngineConfig");
                com.tencent.mm.plugin.scanner.model.i0 i0Var2 = com.tencent.mm.plugin.scanner.model.i0.f143377a;
                i0Var2.b();
                if (i0Var2.i(2)) {
                    i0Var2.m(2);
                }
                if (i0Var2.i(3)) {
                    i0Var2.m(3);
                }
                if (i0Var2.i(4)) {
                    i0Var2.m(4);
                }
                i0Var2.m(6);
            }
        }
    }

    public final void a8(boolean z15) {
        if (z15) {
            getController().z0(getResources().getColor(R.color.a3p));
        } else if (x4.B()) {
            getController().z0(getResources().getColor(R.color.a3p));
        } else {
            getController().z0(getContext().getResources().getColor(R.color.f357928b));
        }
    }

    public final void b8() {
        j30.a.a("com/tencent/mm/plugin/scanner/ui/BaseScanUI", "com/tencent/mm/plugin/scanner/ui/BaseScanUI", "goBack", "()V", this);
        setResult(0);
        finish();
        overridePendingTransition(0, 0);
        j30.a.g(this, "com/tencent/mm/plugin/scanner/ui/BaseScanUI", "com/tencent/mm/plugin/scanner/ui/BaseScanUI", "goBack", "()V");
    }

    public final void c8() {
        boolean z15;
        ScanSharedMaskView sharedMaskView = this.f143585f.getSharedMaskView();
        if (sharedMaskView != null) {
            this.f143587g = sharedMaskView.getFlashSwitcherView();
        }
        ScannerFlashSwitcher scannerFlashSwitcher = this.f143587g;
        if (scannerFlashSwitcher != null) {
            scannerFlashSwitcher.setOnClickListener(new View.OnClickListener() {
                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass19 */

                public void onClick(View view) {
                    ArrayList arrayList = new ArrayList();
                    arrayList.add(view);
                    Object[] array = arrayList.toArray();
                    arrayList.clear();
                    j30.a.b("com/tencent/mm/plugin/scanner/ui/BaseScanUI$19", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V", this, array);
                    b bVar = b.I;
                    if (bVar.f191089o != 2) {
                        bVar.f191089o = 2;
                    }
                    BaseScanUI baseScanUI = BaseScanUI.this;
                    if (!baseScanUI.f143587g.f143967g) {
                        baseScanUI.h8(1);
                    } else {
                        baseScanUI.h8(2);
                    }
                    BaseScanUI baseScanUI2 = BaseScanUI.this;
                    e1.u(baseScanUI2.B, 2, baseScanUI2.f143601p0);
                    j30.a.g(this, "com/tencent/mm/plugin/scanner/ui/BaseScanUI$19", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V");
                }
            });
            this.f143585f.setFlashStatus(this.f143587g.f143968h);
            if (this.B == 3) {
                z15 = true;
            } else {
                z15 = false;
            }
            if (z15) {
                Y7(2);
                this.f143587g.b();
            }
        }
    }

    public final void d8() {
        ScanSharedMaskView sharedMaskView = this.f143585f.getSharedMaskView();
        if (sharedMaskView != null) {
            if (!this.L) {
                View galleryButton = sharedMaskView.getGalleryButton();
                k30.a aVar = new k30.a();
                ThreadLocal<k30.a> threadLocal = k30.c.f244265a;
                aVar.c(0);
                j30.a.d(galleryButton, aVar.b(), "com/tencent/mm/plugin/scanner/ui/BaseScanUI", "initGalleryButton", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                galleryButton.setVisibility(((Integer) aVar.a(0)).intValue());
                j30.a.e(galleryButton, "com/tencent/mm/plugin/scanner/ui/BaseScanUI", "initGalleryButton", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                sharedMaskView.setOnGalleryClickListener(new View.OnClickListener() {
                    /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass17 */

                    public void onClick(View view) {
                        boolean z15;
                        ArrayList arrayList = new ArrayList();
                        arrayList.add(view);
                        Object[] array = arrayList.toArray();
                        arrayList.clear();
                        j30.a.b("com/tencent/mm/plugin/scanner/ui/BaseScanUI$17", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V", this, array);
                        BaseScanUI baseScanUI = BaseScanUI.this;
                        e1.u(baseScanUI.B, 12, baseScanUI.f143601p0);
                        BaseScanUI baseScanUI2 = BaseScanUI.this;
                        if (baseScanUI2.T) {
                            boolean z16 = true;
                            Log.i("MicroMsg.ScanUI", "alvinluo selectImageFromGallery currentMode: %d", Integer.valueOf(baseScanUI2.B));
                            if (baseScanUI2.f8()) {
                                baseScanUI2.R = true;
                                Intent intent = new Intent();
                                intent.putExtra("preview_ui_title", R.string.ias);
                                ((zw.f) yz3.j.c(zw.f.class)).S20(baseScanUI2, 4660, intent);
                                e1.z(baseScanUI2.B);
                                e1.m(baseScanUI2.B);
                            } else {
                                int i15 = baseScanUI2.B;
                                if (i15 == 12) {
                                    z15 = true;
                                } else {
                                    z15 = false;
                                }
                                if (z15) {
                                    baseScanUI2.R = true;
                                    ((zw.f) yz3.j.c(zw.f.class)).S20(baseScanUI2, 2000, new Intent());
                                    e1.z(baseScanUI2.B);
                                    e1.m(baseScanUI2.B);
                                } else {
                                    if (i15 != 3) {
                                        z16 = false;
                                    }
                                    if (z16) {
                                        ((zw.f) yz3.j.c(zw.f.class)).Ot(baseScanUI2, 561, 1, 0, 1, false, null);
                                    }
                                }
                            }
                        }
                        j30.a.g(this, "com/tencent/mm/plugin/scanner/ui/BaseScanUI$17", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V");
                    }
                });
                return;
            }
            View galleryButton2 = sharedMaskView.getGalleryButton();
            k30.a aVar2 = new k30.a();
            ThreadLocal<k30.a> threadLocal2 = k30.c.f244265a;
            aVar2.c(8);
            j30.a.d(galleryButton2, aVar2.b(), "com/tencent/mm/plugin/scanner/ui/BaseScanUI", "initGalleryButton", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
            galleryButton2.setVisibility(((Integer) aVar2.a(0)).intValue());
            j30.a.e(galleryButton2, "com/tencent/mm/plugin/scanner/ui/BaseScanUI", "initGalleryButton", "()V", "android/view/View_EXEC_", "setVisibility", "(I)V");
        }
    }

    public final void e8() {
        x0 x0Var = this.U;
        if (x0Var != null) {
            x0Var.getClass();
            x0Var.f143531a = this;
            ScanUIRectView scanUIRectView = this.f143585f;
            if (scanUIRectView != null) {
                x0 x0Var2 = this.U;
                BaseScanMaskView<BaseScanRequest> scanMaskView = scanUIRectView.getScanMaskView();
                ScanSharedMaskView sharedMaskView = this.f143585f.getSharedMaskView();
                ScanInfoMaskView scanInfoMaskView = this.f143598n;
                x0Var2.f143532b = scanMaskView;
                x0Var2.f143533c = sharedMaskView;
                x0Var2.f143534d = scanInfoMaskView;
            }
        }
    }

    public final boolean f8() {
        return e0.a(this.B);
    }

    @Override // com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.hellhoundlib.activities.HellActivity, com.tencent.mm.ui.vas.VASActivity, com.tencent.mm.ui.MMFragmentActivity
    public void finish() {
        super.finish();
        Log.i("MicroMsg.ScanUI", "finish()");
    }

    public final void g8(long j15, int i15) {
        Y7(2);
        t8(false, false);
        this.F = false;
        this.T = false;
        this.R = true;
        this.W0 = true;
        q8(false);
        f fVar = this.f143604s;
        if (fVar != null) {
            fVar.c(j15, true);
        }
        BaseScanMaskView baseScanMaskView = this.f143585f.f143900r;
        if (baseScanMaskView != null) {
            baseScanMaskView.s(false, null);
        }
        this.f143585f.setScanSource(i15);
        m8();
    }

    @Override // com.tencent.mm.ui.MMActivity, com.tencent.mm.ui.vas.VASActivity
    public int getForceOrientation() {
        return 1;
    }

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

    public final void h8(int i15) {
        Log.i("MicroMsg.ScanUI", "alvinluo operateFlash operation: %d", Integer.valueOf(i15));
        ScanFlashSwitchEvent scanFlashSwitchEvent = new ScanFlashSwitchEvent();
        scanFlashSwitchEvent.f64379d.f64380a = i15;
        scanFlashSwitchEvent.publish();
        ScannerFlashSwitcher scannerFlashSwitcher = this.f143587g;
        if (scannerFlashSwitcher == null) {
            return;
        }
        if (i15 == 1) {
            Log.i("MicroMsg.ScannerFlashSwitcher", "openFlashStatus");
            scannerFlashSwitcher.f143967g = true;
            scannerFlashSwitcher.f143964d.setImageResource(R.raw.scanner_flash_open_on);
            scannerFlashSwitcher.f143965e.setText(R.string.i9j);
            return;
        }
        scannerFlashSwitcher.a();
    }

    public final boolean i8() {
        boolean z15;
        x0 x0Var;
        int i15;
        int i16;
        Log.i("MicroMsg.ScanUI", "alvinluo processCancel isShowingMultiCodeResult: %b, infoViewType: %d", Boolean.valueOf(this.T0), Integer.valueOf(this.U.f143537g));
        ScanUITopOpButtonComponent scanUITopOpButtonComponent = this.f143599o;
        AnonymousClass25 r15 = new AnimatorListenerAdapter() {
            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass25 */

            public void onAnimationEnd(Animator animator) {
                BaseScanUI.this.o8();
            }
        };
        TextView textView = scanUITopOpButtonComponent.f144047f;
        if (textView != null) {
            if (textView.getVisibility() == 0) {
                scanUITopOpButtonComponent.a(true);
                scanUITopOpButtonComponent.b(false, r15);
                z15 = true;
            } else {
                z15 = false;
            }
            s8(true);
            if (f8() && this.T0) {
                this.T0 = false;
                e1.k(3, -1, this.f143601p0);
                com.tencent.mm.plugin.report.service.q qVar = com.tencent.mm.plugin.report.service.q.INSTANCE;
                if (!e1.f143327h) {
                    i16 = 62;
                } else {
                    i16 = 82;
                }
                qVar.t(1259, i16);
            }
            if (f8() && (x0Var = this.U) != null && ((i15 = x0Var.f143537g) == 3 || i15 == 4)) {
                e1.l(5, this.f143601p0, this.B, this.X0);
            }
            return z15;
        }
        m.p("cancelButton");
        throw null;
    }

    @Override // com.tencent.mm.ui.MMActivity
    public void initView() {
        T t15;
        this.f143583e = (FrameLayout) findViewById(R.id.m_d);
        this.f143606u = new i0(this, this.f143601p0);
        getWindow().getDecorView().setSystemUiVisibility(1280);
        if (ck.e.c(19)) {
            getWindow().addFlags(67109888);
        } else {
            getWindow().setFlags(1024, 1024);
        }
        if (getSupportActionBar() != null) {
            getSupportActionBar().o();
        }
        this.f143591i = findViewById(R.id.m_l);
        ScanInfoMaskView scanInfoMaskView = (ScanInfoMaskView) findViewById(R.id.m_g);
        this.f143598n = scanInfoMaskView;
        scanInfoMaskView.getInfoLayout().setOnClickListener(new View.OnClickListener() {
            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass15 */

            public void onClick(View view) {
                ArrayList arrayList = new ArrayList();
                arrayList.add(view);
                Object[] array = arrayList.toArray();
                arrayList.clear();
                j30.a.b("com/tencent/mm/plugin/scanner/ui/BaseScanUI$15", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V", this, array);
                if (BaseScanUI.this.f143598n.getInfoLayout().getVisibility() == 0) {
                    BaseScanUI baseScanUI = BaseScanUI.this;
                    baseScanUI.X0 = 2;
                    baseScanUI.onBackPressed();
                    BaseScanUI.this.X0 = 4;
                }
                j30.a.g(this, "com/tencent/mm/plugin/scanner/ui/BaseScanUI$15", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V");
            }
        });
        setBackBtn(new MenuItem.OnMenuItemClickListener() {
            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass16 */

            public boolean onMenuItemClick(MenuItem menuItem) {
                BaseScanUI baseScanUI = BaseScanUI.this;
                int i15 = BaseScanUI.f143578n1;
                baseScanUI.b8();
                return true;
            }
        });
        this.f143599o = (ScanUITopOpButtonComponent) findViewById(R.id.ofe);
        ScanUIRectView scanUIRectView = new ScanUIRectView(this);
        this.f143585f = scanUIRectView;
        scanUIRectView.G = this;
        scanUIRectView.setScanRequest(this.N);
        this.f143585f.setEnableScanGoodsDynamicWording(this.U0);
        this.f143585f.setEnableOpenCamera(this.V0);
        this.f143585f.setEnableScanCodeProductMerge(this.f143601p0);
        this.f143585f.setDisableScanProductInMergeMode(this.f143610x0);
        this.f143585f.S = this.Q;
        ScanScrollTabView scanScrollTabView = (ScanScrollTabView) findViewById(R.id.f364478ma1);
        i0 i0Var = this.f143606u;
        i0Var.getClass();
        m.g(scanScrollTabView, "scrollTabView");
        i0Var.f211061b = scanScrollTabView;
        scanScrollTabView.h();
        ScanScrollTabView scanScrollTabView2 = i0Var.f211061b;
        if (scanScrollTabView2 != null) {
            scanScrollTabView2.setOnTabScrollListener(new j0());
        }
        i0Var.f211062c.clear();
        Iterator<T> it = i0Var.f211064e.iterator();
        int i15 = 0;
        while (it.hasNext()) {
            if (i0Var.a(i15, it.next())) {
                i15++;
            }
        }
        i0 i0Var2 = this.f143606u;
        AnonymousClass26 r15 = new s0() {
            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass26 */

            @Override // ez2.s0
            public void a(int i15, int i16) {
                Log.i("MicroMsg.ScanUI", "alvinluo onTabSelected tabId: %d, tabSelectedAction: %d", Integer.valueOf(i15), Integer.valueOf(i16));
                if (i15 == 12 && !WeChatBrands.Business.Entries.DiscoveryScanRecognize.checkAvailable(BaseScanUI.this.getContext())) {
                    BaseScanUI.this.p();
                } else if (i15 != 3 || WeChatBrands.Business.Entries.DiscoveryScanTranslate.checkAvailable(BaseScanUI.this.getContext())) {
                    BaseScanUI baseScanUI = BaseScanUI.this;
                    if (!baseScanUI.C) {
                        baseScanUI.n8(i15, i16);
                    } else {
                        baseScanUI.C = false;
                    }
                    BaseScanUI baseScanUI2 = BaseScanUI.this;
                    if (baseScanUI2.B != i15) {
                        if (i15 == 12 && i16 == 4) {
                            e1.l(7, baseScanUI2.f143601p0, i15, 0);
                            BaseScanUI baseScanUI3 = BaseScanUI.this;
                            baseScanUI3.f143603r = 3;
                            baseScanUI3.V = true;
                            baseScanUI3.q8(false);
                            ScanUIRectView scanUIRectView = baseScanUI3.f143585f;
                            if (scanUIRectView != null) {
                                scanUIRectView.setIgnorePreviewFrame(true);
                            }
                            ScanSharedMaskView scanSharedMaskView = BaseScanUI.this.f143593j;
                            if (scanSharedMaskView != null) {
                                scanSharedMaskView.setShowToast(true);
                                BaseScanUI baseScanUI4 = BaseScanUI.this;
                                baseScanUI4.f143593j.setScanToast(baseScanUI4.getResources().getString(R.string.f369092i90));
                            }
                        } else {
                            baseScanUI2.f143603r = e1.g(baseScanUI2.N);
                            BaseScanUI baseScanUI5 = BaseScanUI.this;
                            baseScanUI5.V = false;
                            ScanSharedMaskView scanSharedMaskView2 = baseScanUI5.f143593j;
                            if (scanSharedMaskView2 != null) {
                                scanSharedMaskView2.setShowToast(false);
                            }
                        }
                        Log.i("MicroMsg.ScanUI", "alvinluo onTabSelected scanGoodsScene: %d, needAnimateHideBlurBackground: %b", Integer.valueOf(BaseScanUI.this.f143603r), Boolean.valueOf(BaseScanUI.this.V));
                        BaseScanUI baseScanUI6 = BaseScanUI.this;
                        baseScanUI6.getClass();
                        Log.i("MicroMsg.ScanUI", "select scan mode %d", Integer.valueOf(i15));
                        baseScanUI6.A = System.currentTimeMillis();
                        baseScanUI6.X = 0;
                        baseScanUI6.T0 = false;
                        baseScanUI6.B = i15;
                        f fVar = baseScanUI6.f143604s;
                        if (fVar != null) {
                            fVar.destroy();
                        }
                        baseScanUI6.p8();
                        baseScanUI6.f143585f.setScanMode(baseScanUI6.B);
                        baseScanUI6.f143585f.e();
                        baseScanUI6.w8(false);
                        baseScanUI6.y8();
                        baseScanUI6.d8();
                        baseScanUI6.f143585f.z();
                        baseScanUI6.f143589h = baseScanUI6.f143585f.getScanProductMaskDecorView();
                        baseScanUI6.e8();
                        baseScanUI6.c8();
                        baseScanUI6.z8();
                        if (!baseScanUI6.isPaused()) {
                            baseScanUI6.f143585f.f();
                        }
                        baseScanUI6.f143585f.u(true);
                        baseScanUI6.f143611y = false;
                        baseScanUI6.Z7();
                    }
                    if (e0.a(i15)) {
                        BaseScanUI.this.S = true;
                    }
                    BaseScanUI.this.r8();
                } else {
                    BaseScanUI.this.p();
                }
            }

            @Override // ez2.s0
            public void b(int i15) {
                Log.i("MicroMsg.ScanUI", "alvinluo onTabUnSelected tabId: %d", Integer.valueOf(i15));
                if (e0.a(i15)) {
                    BaseScanUI.this.S = false;
                }
                BaseScanUI baseScanUI = BaseScanUI.this;
                int i16 = BaseScanUI.f143578n1;
                baseScanUI.getClass();
                e1.z(i15);
                if (i15 == 12) {
                    BaseScanUI.this.j8(false);
                }
            }
        };
        i0Var2.getClass();
        k0 k0Var = new k0(i0Var2, r15);
        ScanScrollTabView scanScrollTabView3 = i0Var2.f211061b;
        if (scanScrollTabView3 != null) {
            scanScrollTabView3.setOnTabChangedListener(k0Var);
        }
        i0 i0Var3 = this.f143606u;
        AnonymousClass27 r16 = new r0() {
            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass27 */

            @Override // ez2.r0
            public void a(int i15) {
                if (i15 == 1) {
                    BaseScanUI.this.f143607v = false;
                } else if (i15 == 3 || i15 == 2) {
                    BaseScanUI.this.f143607v = true;
                }
                boolean z15 = BaseScanUI.this.f143607v;
            }

            @Override // ez2.r0
            public void b(int i15, float f15, float f16) {
            }
        };
        i0Var3.getClass();
        ScanScrollTabView scanScrollTabView4 = i0Var3.f211061b;
        if (scanScrollTabView4 != null) {
            scanScrollTabView4.setOnTabScrollListener(r16);
        }
        ScanUIRectView scanUIRectView2 = this.f143585f;
        if (scanUIRectView2 != null) {
            scanUIRectView2.setScrollTabController(this.f143606u);
        }
        this.Y0.clear();
        if (this.I || this.B == 8) {
            this.M = true;
        } else {
            ArrayList arrayList = new ArrayList();
            arrayList.add(1);
            if (!this.f143601p0) {
                arrayList.add(12);
                this.Y0.add(1);
                this.Y0.add(2);
            } else {
                this.Y0.add(4);
            }
            if (!xg0.a.m()) {
                arrayList.add(3);
                this.Y0.add(3);
            } else if (e0.b()) {
                arrayList.add(3);
                this.Y0.add(3);
            }
            if (arrayList.size() == 1) {
                this.M = true;
            }
            i0 i0Var4 = this.f143606u;
            i0Var4.getClass();
            arrayList.size();
            ScanScrollTabView scanScrollTabView5 = i0Var4.f211061b;
            if (scanScrollTabView5 != null) {
                scanScrollTabView5.h();
            }
            i0Var4.f211062c.clear();
            Iterator it4 = arrayList.iterator();
            int i16 = 0;
            while (it4.hasNext()) {
                int intValue = ((Number) it4.next()).intValue();
                Iterator<T> it5 = i0Var4.f211064e.iterator();
                while (true) {
                    if (!it5.hasNext()) {
                        t15 = null;
                        break;
                    }
                    t15 = it5.next();
                    if (t15.f211066a == intValue) {
                        break;
                    }
                }
                if (t15 == null) {
                    break;
                } else if (i0Var4.a(i16, t15)) {
                    i16++;
                }
            }
        }
        BaseScanRequest baseScanRequest = this.N;
        if (baseScanRequest != null) {
            if (baseScanRequest.f143091d) {
                this.M = true;
            }
            if (baseScanRequest.f143094g) {
                this.L = true;
            }
            if (baseScanRequest.f143095h) {
                this.K = true;
            }
        }
        if (this.M) {
            ScanScrollTabView scanScrollTabView6 = this.f143606u.f211061b;
            if (scanScrollTabView6 != null) {
                scanScrollTabView6.setVisibility(8);
            }
            this.f143608w = false;
            this.f143585f.setBottomExtraHeight(0);
            this.Y0.clear();
        } else {
            ScanScrollTabView scanScrollTabView7 = this.f143606u.f211061b;
            if (scanScrollTabView7 != null) {
                scanScrollTabView7.setVisibility(0);
            }
            this.f143585f.setBottomExtraHeight(getResources().getDimensionPixelSize(R.dimen.a9e));
            this.f143608w = true;
        }
        q8(this.f143608w);
        Log.i("MicroMsg.ScanUI", "alvinluo initView currentMode: %d, showOnlyScanCode: %b, hideScrollTab: %b, scanRequest: %s", Integer.valueOf(this.B), Boolean.valueOf(this.I), Boolean.valueOf(this.M), this.N);
        this.f143585f.setActivity(this);
        this.f143583e.addView(this.f143585f, 0, new FrameLayout.LayoutParams(-1, -1));
        this.f143585f.n();
        ScanSharedMaskView sharedMaskView = this.f143585f.getSharedMaskView();
        this.f143593j = sharedMaskView;
        sharedMaskView.getClass();
        sharedMaskView.f144273n = this;
        this.f143585f.setShowScanTips(this.D);
        this.f143585f.setNetworkAvailable(this.E);
        this.f143585f.setScanMode(this.B);
        this.f143585f.setScanProductOnItemClickListener(this.f143582d1);
        this.f143585f.setScanProductCallback(this.f143586f1);
        this.f143585f.z();
        this.f143589h = this.f143585f.getScanProductMaskDecorView();
        n8(this.B, 0);
        e8();
        e1.y(this.B);
        r8();
        if (this.G) {
            this.f143585f.setBlackInterval(ob4.a.f275960a);
        }
        d8();
        p8();
        int[] iArr = this.H;
        if (iArr != null && iArr.length > 0) {
            this.f143585f.setScanCodeReaders(iArr);
        }
        if (this.P) {
            this.f143585f.setMyQrCodeVisible(false);
        }
        this.f143606u.d(this.B, 0);
        c8();
        this.f143599o.setOnCloseClickListener(new View.OnClickListener() {
            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass23 */

            public void onClick(View view) {
                ArrayList arrayList = new ArrayList();
                arrayList.add(view);
                Object[] array = arrayList.toArray();
                arrayList.clear();
                j30.a.b("com/tencent/mm/plugin/scanner/ui/BaseScanUI$23", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V", this, array);
                BaseScanUI baseScanUI = BaseScanUI.this;
                int i15 = BaseScanUI.f143578n1;
                baseScanUI.j8(false);
                BaseScanUI.this.m8();
                BaseScanUI.this.b8();
                e1.k(3, -1, BaseScanUI.this.f143601p0);
                j30.a.g(this, "com/tencent/mm/plugin/scanner/ui/BaseScanUI$23", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V");
            }
        });
        this.f143599o.setOnCancelClickListener(new View.OnClickListener() {
            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass24 */

            public void onClick(View view) {
                ArrayList arrayList = new ArrayList();
                arrayList.add(view);
                Object[] array = arrayList.toArray();
                arrayList.clear();
                j30.a.b("com/tencent/mm/plugin/scanner/ui/BaseScanUI$24", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V", this, array);
                BaseScanUI baseScanUI = BaseScanUI.this;
                baseScanUI.X0 = 1;
                baseScanUI.onBackPressed();
                BaseScanUI.this.X0 = 4;
                j30.a.g(this, "com/tencent/mm/plugin/scanner/ui/BaseScanUI$24", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V");
            }
        });
        z8();
        ny2.f.f273541v.f273546c = new f.d() {
            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass18 */

            @Override // ny2.f.d
            public void a(r rVar) {
                if (rVar != null) {
                    if (!BaseScanUI.T7(BaseScanUI.this, rVar)) {
                        Log.w("MicroMsg.ScanUI", "onScanResult can not add now and ignore");
                        return;
                    }
                    g.a aVar = new g.a(2, rVar);
                    wy2.f fVar = BaseScanUI.this.f143604s;
                    if (fVar instanceof g) {
                        fVar.a(rVar.f341777b, aVar);
                        return;
                    }
                    Log.w("MicroMsg.ScanUI", "onScanResult resultHandler not expected: %s", fVar);
                }
            }
        };
    }

    public final void j8(boolean z15) {
        e1 e1Var = e1.f143320a;
        com.tencent.mm.plugin.scanner.model.i0.k(new f1(12, z15));
    }

    public final void k8(boolean z15, boolean z16) {
        long j15;
        boolean z17;
        long j16;
        int i15;
        long j17;
        android_scanner_performanceStruct android_scanner_performancestruct = this.W;
        if (z15) {
            j15 = 1;
        } else {
            j15 = 0;
        }
        android_scanner_performancestruct.f72559d = j15;
        android_scanner_performancestruct.f72560e = System.currentTimeMillis() - this.A;
        android_scanner_performanceStruct android_scanner_performancestruct2 = this.W;
        fc4.t tVar = this.f143585f.f191244e;
        boolean z18 = false;
        if (tVar != null) {
            z17 = ((fc4.a) tVar).h(false);
        } else {
            z17 = false;
        }
        if (z17) {
            j16 = 0;
        } else {
            j16 = 1;
        }
        android_scanner_performancestruct2.f72561f = j16;
        android_scanner_performanceStruct android_scanner_performancestruct3 = this.W;
        android_scanner_performancestruct3.f72563h = (long) this.B;
        android_scanner_performancestruct3.f72562g = (long) b.I.f191077c;
        android_scanner_performancestruct3.n();
        if (f8()) {
            if (fz2.p.e() == 1) {
                i15 = 1722;
            } else {
                i15 = 1229;
            }
            Log.i("MicroMsg.ScanUI", "reportScanPerformance idKey:" + i15);
            com.tencent.mm.plugin.report.service.q qVar = com.tencent.mm.plugin.report.service.q.INSTANCE;
            long j18 = (long) i15;
            qVar.v(j18, 0, 1);
            if (z15) {
                j17 = 1;
            } else {
                j17 = 0;
            }
            qVar.v(j18, 1, j17);
            if (z15) {
                fc4.t tVar2 = this.f143585f.f191244e;
                if (tVar2 != null) {
                    z18 = ((fc4.a) tVar2).h(false);
                }
                if (z18) {
                    qVar.v(j18, 5, 1);
                } else {
                    qVar.v(j18, 3, 1);
                }
                qVar.v(j18, 7, this.W.f72560e);
                qVar.v(j18, 9, this.W.f72562g);
                if (z15 && z16) {
                    android_scanner_performanceStruct android_scanner_performancestruct4 = this.W;
                    long j19 = android_scanner_performancestruct4.f72560e;
                    long j25 = android_scanner_performancestruct4.f72562g;
                    qVar.v(j18, 11, 1);
                    qVar.v(j18, 12, this.W.f72560e);
                    qVar.v(j18, 14, this.W.f72562g);
                }
            }
        }
    }

    public final void l8(int i15) {
        Log.i("MicroMsg.ScanUI", "reportScanUIEvent eventType = %d, enterScene = %d", Integer.valueOf(i15), Integer.valueOf(this.Q));
        int g15 = e1.g(this.N);
        int i16 = this.B;
        BaseScanRequest baseScanRequest = this.N;
        int i17 = this.Q;
        boolean z15 = this.f143601p0;
        e1 e1Var = e1.f143320a;
        int h15 = e1Var.h(i16, z15);
        long currentTimeMillis = System.currentTimeMillis();
        long j15 = 0;
        if (i15 == 1) {
            e1.f143329j = currentTimeMillis;
        } else if (i15 == 2) {
            long j16 = e1.f143329j;
            if (j16 > 0) {
                e1.f143329j = 0;
                j15 = currentTimeMillis - j16;
            }
        }
        wg4.l<String, String> c15 = e1Var.c(baseScanRequest);
        com.tencent.mm.plugin.report.service.q qVar = com.tencent.mm.plugin.report.service.q.INSTANCE;
        qVar.g(20275, c15.f332807d, c15.f332808e, e1.f143321b, Integer.valueOf(g15), Integer.valueOf(h15), Integer.valueOf(i15), Long.valueOf(currentTimeMillis), Long.valueOf(j15), Integer.valueOf(i17));
        if (i15 == 1 && (baseScanRequest instanceof ScanGoodsRequest) && ((ScanGoodsRequest) baseScanRequest).f143097j == 5) {
            qVar.t(1259, 108);
        }
    }

    public final void m8() {
        e1.z(this.B);
    }

    public final void n8(int i15, int i16) {
        boolean z15;
        int i17;
        boolean z16 = this.f143601p0;
        boolean z17 = true;
        if (e1.f143321b.length() == 0) {
            z15 = true;
        } else {
            z15 = false;
        }
        if (!z15) {
            int h15 = e1.f143320a.h(i15, z16);
            if (i16 == 0) {
                i17 = 0;
            } else if (i16 == 1) {
                i17 = 3;
            } else if (i16 == 2) {
                i17 = 2;
            } else if (i16 == 3) {
                i17 = 1;
            } else if (i16 != 4) {
                i17 = -1;
            } else {
                i17 = 4;
            }
            com.tencent.mm.plugin.report.service.q qVar = com.tencent.mm.plugin.report.service.q.INSTANCE;
            String str = e1.f143321b;
            qVar.g(18557, 0, Integer.valueOf(h15), Integer.valueOf(i17), str, str);
        }
        e1.f143323d.put(Integer.valueOf(i15), String.valueOf(System.currentTimeMillis()));
        e1.f143323d.get(Integer.valueOf(i15));
        e1.a(i15);
        e1.y(i15);
        if (!f8() || !this.f143601p0) {
            z17 = false;
        }
        if (z17) {
            com.tencent.mm.plugin.scanner.model.d.a(0, null);
        }
    }

    public void o8() {
        Log.i("MicroMsg.ScanUI", "alvinluo resumeScan");
        this.A = System.currentTimeMillis();
        this.R = false;
        ScanUIRectView scanUIRectView = this.f143585f;
        if (scanUIRectView != null) {
            scanUIRectView.f();
        }
        q8(true);
    }

    @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, final int i16, final Intent intent) {
        boolean z15;
        BaseScanMaskView baseScanMaskView;
        super.onActivityResult(i15, i16, intent);
        boolean z16 = true;
        if (i15 != 561) {
            if (i15 != 2000) {
                if (i15 != 4660) {
                    if (i15 == 1001) {
                        finish();
                    } else if (i15 == 1002) {
                        finish();
                        return;
                    } else {
                        return;
                    }
                } else if (i16 != -1 || intent == null) {
                    o8();
                    if (i16 == 0 && e0.a(this.B)) {
                        e1.j(this.B);
                        return;
                    }
                    return;
                } else {
                    e1.v(this.B);
                    e1.u(this.B, 13, this.f143601p0);
                    final String b15 = com.tencent.mm.ui.tools.o.b(this, intent, bc2.a.a());
                    Log.i("MicroMsg.ScanUI", "select: [%s]", b15);
                    if (!Util.isNullOrNil(b15)) {
                        final long currentTimeMillis = System.currentTimeMillis();
                        b.J.f191079e = 1;
                        e1.r(this.B, this.Q, 11, this.A, currentTimeMillis);
                        if (!f8() || !this.f143601p0) {
                            z16 = false;
                        }
                        if (z16) {
                            com.tencent.mm.plugin.scanner.model.d.a(40, null);
                        }
                        h0.b bVar = new h0.b();
                        bVar.f228547b = 4;
                        com.tencent.qbar.c.f191101h.a(this, currentTimeMillis, b15, null, new h0.a() {
                            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass38 */

                            @Override // hy.h0.a
                            public void a(final long j15, h0.c cVar) {
                                final List<a.C1986a> list;
                                final int i15;
                                final List<WxQbarNative.QBarReportMsg> list2 = null;
                                if (cVar != null) {
                                    list = cVar.f228549a;
                                } else {
                                    list = null;
                                }
                                if (cVar != null) {
                                    list2 = cVar.f228551c;
                                }
                                BaseScanUI baseScanUI = BaseScanUI.this;
                                if (baseScanUI.f143601p0) {
                                    i15 = 4;
                                } else {
                                    i15 = 2;
                                }
                                if (j15 == currentTimeMillis && baseScanUI.f8()) {
                                    ((j) j.f338034d).z(new Runnable() {
                                        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass38.AnonymousClass1 */

                                        public void run() {
                                            BaseScanMaskView baseScanMaskView;
                                            BaseScanMaskView baseScanMaskView2;
                                            List list = list;
                                            if (list == null || list.isEmpty()) {
                                                BaseScanUI baseScanUI = BaseScanUI.this;
                                                baseScanUI.R = true;
                                                e1.n(baseScanUI.B, false, i15, 1);
                                                BaseScanUI baseScanUI2 = BaseScanUI.this;
                                                if (baseScanUI2.f143601p0) {
                                                    z0 z0Var = baseScanUI2.f143580b1;
                                                    long currentTimeMillis = System.currentTimeMillis();
                                                    AnonymousClass38 r35 = AnonymousClass38.this;
                                                    int i15 = i16;
                                                    Intent intent = intent;
                                                    BaseScanUI baseScanUI3 = BaseScanUI.this;
                                                    int i16 = baseScanUI3.B;
                                                    int i17 = i15;
                                                    z0.a aVar = baseScanUI3.f143581c1;
                                                    z0Var.getClass();
                                                    m.g(aVar, "callback");
                                                    Object[] objArr = new Object[2];
                                                    objArr[0] = Integer.valueOf(i15);
                                                    objArr[1] = Boolean.valueOf(intent == null);
                                                    Log.i("MicroMsg.ScanProductForGalleryHelper", "handleScanGalleryImage resultCode: %d, data == null: %b", objArr);
                                                    z0Var.f143543c = currentTimeMillis;
                                                    if (i15 == -1) {
                                                        z0Var.f143542b = aVar;
                                                        BaseScanUI baseScanUI4 = (BaseScanUI) z0Var.f143541a;
                                                        baseScanUI4.getClass();
                                                        String b15 = com.tencent.mm.ui.tools.o.b(baseScanUI4, intent, bc2.a.a());
                                                        ScanUIRectView scanUIRectView = ((BaseScanUI) z0Var.f143541a).f143585f;
                                                        BaseScanMaskView scanMaskView = scanUIRectView != null ? scanUIRectView.getScanMaskView() : null;
                                                        if (scanMaskView != null) {
                                                            scanMaskView.setScanSource(i17);
                                                        }
                                                        int exifOrientation = BackwardSupportUtil.ExifHelper.getExifOrientation(b15);
                                                        long currentTimeMillis2 = System.currentTimeMillis();
                                                        Bitmap decodeFileWithSample = BitmapUtil.decodeFileWithSample(b15);
                                                        long currentTimeMillis3 = System.currentTimeMillis();
                                                        if (exifOrientation == 90 || exifOrientation == 270) {
                                                            decodeFileWithSample = BitmapUtil.rotate(decodeFileWithSample, (float) exifOrientation);
                                                        }
                                                        Log.i("MicroMsg.ScanProductForGalleryHelper", "handleScanGalleryImage decode image cost: %d, rotation: %s", Long.valueOf(currentTimeMillis3 - currentTimeMillis2), Integer.valueOf(exifOrientation));
                                                        if (decodeFileWithSample != null && !decodeFileWithSample.isRecycled()) {
                                                            ScanUIRectView scanUIRectView2 = ((BaseScanUI) z0Var.f143541a).f143585f;
                                                            if (scanUIRectView2 != null) {
                                                                baseScanMaskView2 = scanUIRectView2.getScanMaskView();
                                                            } else {
                                                                baseScanMaskView2 = null;
                                                            }
                                                            if (baseScanMaskView2 instanceof ScanGoodsMaskView) {
                                                                ScanGoodsMaskView scanGoodsMaskView = (ScanGoodsMaskView) baseScanMaskView2;
                                                                scanGoodsMaskView.S = true;
                                                                scanGoodsMaskView.T = false;
                                                                scanGoodsMaskView.y(decodeFileWithSample);
                                                            } else if (baseScanMaskView2 instanceof ScanCodeProductMergeMaskView) {
                                                                ScanCodeProductMergeMaskView scanCodeProductMergeMaskView = (ScanCodeProductMergeMaskView) baseScanMaskView2;
                                                                scanCodeProductMergeMaskView.f144167e1 = true;
                                                                scanCodeProductMergeMaskView.f144168f1 = false;
                                                                scanCodeProductMergeMaskView.D(decodeFileWithSample);
                                                                View myQrCodeButton = scanCodeProductMergeMaskView.getMyQrCodeButton();
                                                                k30.a aVar2 = new k30.a();
                                                                ThreadLocal<k30.a> threadLocal = k30.c.f244265a;
                                                                aVar2.c(Float.valueOf(0.0f));
                                                                j30.a.d(myQrCodeButton, aVar2.b(), "com/tencent/mm/plugin/scanner/ui/widget/ScanCodeProductMergeMaskView", "onGalleryImageProcessStart", "()V", "android/view/View_EXEC_", "setAlpha", "(F)V");
                                                                myQrCodeButton.setAlpha(((Float) aVar2.a(0)).floatValue());
                                                                j30.a.e(myQrCodeButton, "com/tencent/mm/plugin/scanner/ui/widget/ScanCodeProductMergeMaskView", "onGalleryImageProcessStart", "()V", "android/view/View_EXEC_", "setAlpha", "(F)V");
                                                                ScanProductMaskDecorView scanProductMaskDecorView = scanCodeProductMergeMaskView.Z0;
                                                                if (scanProductMaskDecorView != null) {
                                                                    scanProductMaskDecorView.setAlpha(0.0f);
                                                                } else {
                                                                    m.p("scanProductListView");
                                                                    throw null;
                                                                }
                                                            }
                                                        }
                                                        z0Var.f143546f = new a1(z0Var, currentTimeMillis);
                                                        ScanUIRectView scanUIRectView3 = ((BaseScanUI) z0Var.f143541a).f143585f;
                                                        if (scanUIRectView3 != null) {
                                                            baseScanMaskView = scanUIRectView3.getScanMaskView();
                                                        } else {
                                                            baseScanMaskView = null;
                                                        }
                                                        if (baseScanMaskView != null) {
                                                            baseScanMaskView.s(true, z0Var.f143546f);
                                                        }
                                                        m.f(b15, AssistantStore.DownloadInfos.DownloadInfoColumns.FILEPATH);
                                                        byte[] b16 = gz2.j.b(b15, exifOrientation, 122880, null);
                                                        boolean z15 = b16 != null && b16.length <= 122880;
                                                        d.a aVar3 = new d.a(0);
                                                        if (z15) {
                                                            Object[] objArr2 = new Object[1];
                                                            objArr2[0] = b16 != null ? Integer.valueOf(b16.length) : null;
                                                            Log.i("MicroMsg.ScanProductForGalleryHelper", "scanProductForFile compressImage success final data length: %d", objArr2);
                                                            if (z0Var.f143545e == null) {
                                                                z0Var.f143545e = new xy2.j(z0Var.f143544d);
                                                            }
                                                            xy2.j jVar = z0Var.f143545e;
                                                            if (jVar != null) {
                                                                r rVar = new r();
                                                                rVar.f341776a = i17;
                                                                rVar.f341777b = currentTimeMillis;
                                                                rVar.f341780e = 1;
                                                                ArrayList<q> arrayList = rVar.f341779d;
                                                                ScanProductInfo scanProductInfo = new ScanProductInfo();
                                                                scanProductInfo.setId(-1);
                                                                q qVar = new q(scanProductInfo);
                                                                aVar3.f143301b = b16.length;
                                                                aVar3.f143300a = 1;
                                                                qVar.f341760g = aVar3;
                                                                qVar.f341758e = b16;
                                                                arrayList.add(qVar);
                                                                b0 b0Var = b0.f332794a;
                                                                jVar.a(currentTimeMillis, rVar);
                                                            }
                                                        } else {
                                                            Log.e("MicroMsg.ScanProductForGalleryHelper", "scanProductByFile compressImage failed");
                                                            if (z0Var.f143543c == currentTimeMillis) {
                                                                com.tencent.mm.plugin.scanner.model.d.a(11, aVar3);
                                                                z0.b bVar = z0Var.f143544d;
                                                                xy2.p pVar = new xy2.p(i17, currentTimeMillis, 2);
                                                                pVar.f341753e = aVar3;
                                                                bVar.c(pVar, 1001, "scan by file compressImage failed");
                                                            }
                                                        }
                                                    } else {
                                                        ((BaseScanUI) z0Var.f143541a).o8();
                                                        if (i15 == 0) {
                                                            e1.j(12);
                                                        }
                                                    }
                                                    AnonymousClass38 r15 = AnonymousClass38.this;
                                                    BaseScanUI baseScanUI5 = BaseScanUI.this;
                                                    e1.r(baseScanUI5.B, baseScanUI5.Q, 13, baseScanUI5.A, currentTimeMillis);
                                                    return;
                                                }
                                                baseScanUI2.w8(true);
                                                return;
                                            }
                                            BaseScanUI baseScanUI6 = BaseScanUI.this;
                                            List<a.C1986a> list2 = list;
                                            int i18 = BaseScanUI.f143578n1;
                                            baseScanUI6.getClass();
                                            if (list2 != null && !list2.isEmpty()) {
                                                ArrayList arrayList2 = new ArrayList();
                                                ArrayList arrayList3 = null;
                                                for (a.C1986a aVar4 : list2) {
                                                    if (aVar4 != null) {
                                                        if (ob4.a.a(aVar4.f191071f)) {
                                                            Log.i("MicroMsg.ScanUI", "resortCodeList badCode:" + aVar4.f191071f);
                                                            if (arrayList3 == null) {
                                                                arrayList3 = new ArrayList();
                                                            }
                                                            arrayList3.add(aVar4);
                                                        } else {
                                                            arrayList2.add(aVar4);
                                                        }
                                                    }
                                                }
                                                if (arrayList3 == null || arrayList3.isEmpty()) {
                                                    Log.i("MicroMsg.ScanUI", "resortCodeList no bad code");
                                                } else {
                                                    Iterator it = arrayList3.iterator();
                                                    while (it.hasNext()) {
                                                        arrayList2.add((a.C1986a) it.next());
                                                    }
                                                    list2 = arrayList2;
                                                }
                                            }
                                            BaseScanUI.this.R = false;
                                            Bundle bundle = new Bundle();
                                            a.C1986a aVar5 = (a.C1986a) list2.get(0);
                                            String str = aVar5.f191071f;
                                            bundle.putString("result_content", str);
                                            bundle.putInt("result_code_format", aVar5.f191069d);
                                            bundle.putString("result_code_name", aVar5.f191070e);
                                            byte[] bArr = aVar5.f191072g;
                                            if (bArr != null) {
                                                bundle.putByteArray("result_raw_data", bArr);
                                            }
                                            List list3 = list2;
                                            int i19 = (list3 == null || list3.isEmpty()) ? 0 : ((WxQbarNative.QBarReportMsg) list2.get(0)).qrcodeVersion;
                                            bundle.putInt("result_code_version", i19);
                                            bundle.putParcelable("ScanIdentifyReportInfo.DecodeKey", new ScanIdentifyReportInfo(b15));
                                            e1.n(BaseScanUI.this.B, true, i15, 1);
                                            com.tencent.mm.plugin.scanner.model.d.a(41, null);
                                            if (BaseScanUI.this.J) {
                                                Intent intent2 = new Intent();
                                                intent2.putExtra("key_scan_result", bundle.getString("result_content"));
                                                intent2.putExtra("key_scan_result_raw", bundle.getByteArray("result_raw_data"));
                                                intent2.putExtra("key_scan_result_code_name", bundle.getString("result_code_name"));
                                                intent2.putExtra("key_scan_result_code_version", i19);
                                                BaseScanUI.this.setResult(-1, intent2);
                                                BaseScanUI.this.p();
                                                return;
                                            }
                                            bundle.putInt("qbar_string_scan_source", 1);
                                            wy2.f fVar = BaseScanUI.this.f143604s;
                                            if (fVar != null) {
                                                fVar.a(j15, new g.a(1, bundle));
                                                com.tencent.mm.plugin.report.service.q.INSTANCE.g(19332, Long.valueOf(j15), 1, str, Integer.valueOf(aVar5.f191074i), 1, str, Integer.valueOf(aVar5.f191074i), 0, "", aVar5.f191070e, Long.valueOf(System.currentTimeMillis()), 1, 0, 0, 8);
                                            }
                                            BaseScanUI.V7(BaseScanUI.this);
                                            AnonymousClass38 r16 = AnonymousClass38.this;
                                            BaseScanUI baseScanUI7 = BaseScanUI.this;
                                            e1.r(baseScanUI7.B, baseScanUI7.Q, 12, baseScanUI7.A, currentTimeMillis);
                                        }
                                    });
                                }
                            }
                        }, this.H, bVar);
                        return;
                    }
                    return;
                }
            }
            e1.u(this.B, 13, this.f143601p0);
            Object[] objArr = new Object[2];
            objArr[0] = Integer.valueOf(i16);
            if (intent == null) {
                z15 = true;
            } else {
                z15 = false;
            }
            objArr[1] = Boolean.valueOf(z15);
            Log.i("MicroMsg.ScanUI", "alvinluo processGoodsImage resultCode: %d, data == null: %b", objArr);
            if (i16 == -1) {
                e1.v(this.B);
                long currentTimeMillis2 = System.currentTimeMillis();
                e1.b f15 = e1.f143320a.f(12);
                if (f15 != null) {
                    f15.f143344g = currentTimeMillis2;
                }
                String b16 = com.tencent.mm.ui.tools.o.b(this, intent, bc2.a.a());
                final long currentTimeMillis3 = System.currentTimeMillis();
                ScanUIRectView scanUIRectView = this.f143585f;
                if (scanUIRectView != null) {
                    scanUIRectView.setScanSource(2);
                }
                int exifOrientation = BackwardSupportUtil.ExifHelper.getExifOrientation(b16);
                long currentTimeMillis4 = System.currentTimeMillis();
                Bitmap decodeFileWithSample = BitmapUtil.decodeFileWithSample(b16);
                long currentTimeMillis5 = System.currentTimeMillis();
                if (exifOrientation == 90 || exifOrientation == 270) {
                    decodeFileWithSample = BitmapUtil.rotate(decodeFileWithSample, (float) exifOrientation);
                }
                Log.i("MicroMsg.ScanUI", "alvinluo processGoodsImage decode image cost: %d, rotation: %s", Long.valueOf(currentTimeMillis5 - currentTimeMillis4), Integer.valueOf(exifOrientation));
                if (decodeFileWithSample != null && !decodeFileWithSample.isRecycled()) {
                    BaseScanMaskView scanMaskView = this.f143585f.getScanMaskView();
                    if (scanMaskView instanceof ScanGoodsMaskView) {
                        ScanGoodsMaskView scanGoodsMaskView = (ScanGoodsMaskView) scanMaskView;
                        scanGoodsMaskView.S = true;
                        scanGoodsMaskView.T = false;
                        scanGoodsMaskView.y(decodeFileWithSample);
                    } else if (scanMaskView instanceof ScanCodeProductMergeMaskView) {
                        ScanCodeProductMergeMaskView scanCodeProductMergeMaskView = (ScanCodeProductMergeMaskView) scanMaskView;
                        scanCodeProductMergeMaskView.f144167e1 = true;
                        scanCodeProductMergeMaskView.f144168f1 = false;
                        scanCodeProductMergeMaskView.D(decodeFileWithSample);
                    }
                }
                AnonymousClass39 r25 = new DialogInterface.OnCancelListener(2) {
                    /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass39 */

                    public void onCancel(DialogInterface dialogInterface) {
                        Log.i("MicroMsg.ScanUI", "alvinluo processGoodsImage onCancel and resumeScan");
                        wy2.f fVar = BaseScanUI.this.f143604s;
                        if (fVar instanceof wy2.a) {
                            wy2.a aVar = (wy2.a) fVar;
                            long j15 = currentTimeMillis3;
                            com.tencent.mm.plugin.scanner.model.b bVar = aVar.f335751n;
                            if (bVar != null) {
                                bVar.a(j15);
                            }
                            com.tencent.mm.plugin.scanner.model.b bVar2 = aVar.f335750j;
                            if (bVar2 != null) {
                                bVar2.a(j15);
                            }
                        }
                        e1.b(2, false, System.currentTimeMillis(), true);
                        BaseScanUI.this.o8();
                    }
                };
                ScanUIRectView scanUIRectView2 = this.f143585f;
                if (!(scanUIRectView2 == null || (baseScanMaskView = scanUIRectView2.f143900r) == null)) {
                    baseScanMaskView.s(true, r25);
                }
                ny2.d dVar = ny2.d.f273520j;
                d.c cVar = this.f143590h1;
                dVar.getClass();
                com.tencent.mm.plugin.scanner.model.i0.k(new ny2.b(dVar, b16, exifOrientation, 2, cVar, currentTimeMillis3));
                return;
            }
            o8();
            if (i16 == 0) {
                e1.j(12);
                return;
            }
            return;
        }
        e1.u(this.B, 13, this.f143601p0);
        if (i16 == -1) {
            String b17 = com.tencent.mm.ui.tools.o.b(this, intent, bc2.a.a());
            Log.i("MicroMsg.ScanUI", "alvinluo scanTranslate select image: [%s]", b17);
            if (this.f143604s != null) {
                Bundle bundle = new Bundle();
                bundle.putString("key_translate_file_path", b17);
                this.f143604s.a(System.currentTimeMillis(), bundle);
            }
        }
    }

    @Override // androidx.activity.ComponentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.ui.vas.VASActivity
    public void onBackPressed() {
        boolean z15;
        x xVar = this.f143602q;
        if (xVar == null || !xVar.J()) {
            x0 x0Var = this.U;
            if (x0Var == null || !x0Var.f143535e) {
                z15 = false;
            } else {
                Log.i("MicroMsg.ScanUI", "alvinluo cancelLoading");
                x0 x0Var2 = this.U;
                d.a aVar = x0Var2.f143536f;
                if (aVar != null) {
                    aVar.a(null);
                }
                x0Var2.f143536f = null;
                this.U.a(false, false);
                z15 = true;
            }
            if (z15) {
                if (!i8()) {
                    o8();
                }
            } else if (!i8()) {
                ScanProductMaskDecorView scanProductMaskDecorView = this.f143589h;
                if (scanProductMaskDecorView == null || !scanProductMaskDecorView.c()) {
                    if (this.B == 12) {
                        j8(false);
                    }
                    m8();
                    b8();
                }
            }
        } else {
            this.f143602q.dismiss();
        }
    }

    @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);
        Log.i("MicroMsg.ScanUI", "screen orientation %d", Integer.valueOf(configuration.orientation));
    }

    /* JADX WARNING: Code restructure failed: missing block: B:130:0x04c3, code lost:
        if (r1.f61856d.f61857a != false) goto L_0x04c5;
     */
    /* JADX WARNING: Removed duplicated region for block: B:104:0x03e7  */
    /* JADX WARNING: Removed duplicated region for block: B:115:0x044b  */
    /* JADX WARNING: Removed duplicated region for block: B:122:0x0469  */
    /* JADX WARNING: Removed duplicated region for block: B:139:0x0542  */
    /* JADX WARNING: Removed duplicated region for block: B:165:0x05d9  */
    /* JADX WARNING: Removed duplicated region for block: B:167:0x05e0  */
    /* JADX WARNING: Removed duplicated region for block: B:84:0x0356  */
    /* JADX WARNING: Removed duplicated region for block: B:87:0x037c  */
    /* JADX WARNING: Removed duplicated region for block: B:93:0x0389 A[ADDED_TO_REGION] */
    /* JADX WARNING: Removed duplicated region for block: B:98:0x03b3  */
    @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.vas.VASActivity, com.tencent.mm.ui.MMFragmentActivity
    public void onCreate(Bundle bundle) {
        boolean z15;
        String str;
        String str2;
        String str3;
        boolean booleanValue;
        boolean z16;
        boolean z17;
        boolean z18;
        boolean z19;
        boolean z25;
        SharedPreferences.Editor putLong;
        boolean z26;
        SharedPreferences.Editor putBoolean;
        SharedPreferences.Editor putBoolean2;
        MultiProcessMMKV multiProcessMMKV;
        int i15;
        Exception e15;
        String pi5;
        Object[] objArr;
        int i16;
        int i17;
        int i18;
        int i19;
        String str4;
        SharedPreferences.Editor putInt;
        SharedPreferences.Editor putInt2;
        int i25;
        super.onCreate(bundle);
        a8(true);
        if (z.d().m() == 6 || z.d().m() == 4) {
            this.E = true;
        } else {
            this.E = false;
        }
        this.f143605t = (Vibrator) getSystemService("vibrator");
        this.H = getIntent().getIntArrayExtra("key_support_scan_code_type");
        this.Q = getIntent().getIntExtra("key_scan_report_enter_scene", 0);
        this.I = getIntent().getBooleanExtra("BaseScanUI_only_scan_qrcode_with_zbar", false);
        this.J = getIntent().getBooleanExtra("key_set_result_after_scan", false);
        this.K = getIntent().getBooleanExtra("key_is_hide_right_btn", false);
        this.B = getIntent().getIntExtra("BaseScanUI_select_scan_mode", 1);
        this.D = getIntent().getBooleanExtra("key_show_scan_tips", true);
        this.G = getIntent().getBooleanExtra("key_config_black_interval", false);
        this.f143612y0 = getIntent().getBooleanExtra("key_enable_multi_code", false);
        this.f143601p0 = getIntent().getBooleanExtra("key_enable_scan_code_product_merge", false);
        this.U0 = getIntent().getBooleanExtra("key_scan_goods_enable_dynamic_wording", false);
        this.P = getIntent().getBooleanExtra("key_for_jsapi_use", false);
        this.L = this.K;
        if (this.B == 12) {
            z15 = true;
        } else {
            z15 = false;
        }
        if (z15) {
            BaseScanRequest baseScanRequest = (BaseScanRequest) getIntent().getParcelableExtra("key_scan_request");
            this.N = baseScanRequest;
            this.f143603r = e1.g(baseScanRequest);
        }
        Log.i("MicroMsg.ScanUI", "onCreate() enterScene:%d, enableMultiCode:%b enableScanCodeProductMerge:%b  currentMode:%d  setResultAfterScan:%s", Integer.valueOf(this.Q), Boolean.valueOf(this.f143612y0), Boolean.valueOf(this.f143601p0), Integer.valueOf(this.B), Boolean.valueOf(this.J));
        if (fz2.r.f218218d || fz2.r.f218217c) {
            MultiProcessMMKV multiProcessMMKV2 = qb4.a.f288261i;
            MultiProcessMMKV multiProcessMMKV3 = qb4.a.f288261i;
            if (multiProcessMMKV3 != null) {
                i16 = multiProcessMMKV3.getInt("scan_code_last_frame_cost", 0);
            } else {
                i16 = 0;
            }
            if (i16 <= 0) {
                str2 = "";
                str = "MicroMsg.ScanUI";
            } else {
                if (i16 >= 250) {
                    i19 = fz2.r.f218220f;
                    Log.i("MicroMsg.ScanProductSkipFrameManager", "computeEngineSkipFrame use minSkipFrame frameCost: " + i16);
                    str2 = "";
                    str = "MicroMsg.ScanUI";
                    str4 = "MicroMsg.ScanProductSkipFrameManager";
                } else {
                    int floor = (int) Math.floor(1000.0d / ((double) i16));
                    int i26 = floor / 2;
                    str = "MicroMsg.ScanUI";
                    double d15 = (double) 1;
                    double d16 = (1000.0d / ((double) (i16 * 2))) - d15;
                    double d17 = (1000.0d / ((double) (i26 * i16))) - d15;
                    str2 = "";
                    int max = Math.max(Math.min((int) Math.floor(((Math.floor(d17) + Math.ceil(d16)) * 1.0d) / ((double) 2)), fz2.r.f218219e), fz2.r.f218220f);
                    str4 = "MicroMsg.ScanProductSkipFrameManager";
                    Log.i(str4, "computeEngineSkipFrame frameCost: " + i16 + ", scanCodeFrameCount: " + floor + ", maxScanProductFrameCount: " + i26 + ", maxSkipFrame: " + d16 + ", minSkipFrame: " + d17 + ", skipFrame: " + max);
                    MultiProcessMMKV multiProcessMMKV4 = fz2.r.f218216b;
                    if (multiProcessMMKV4 != null) {
                        i25 = multiProcessMMKV4.getInt("scan_product_engine_detect_skip_frame_count", 0);
                    } else {
                        i25 = 0;
                    }
                    if (i25 != 0 && Math.abs(max - i25) >= 2) {
                        Log.i(str4, "computeEngineSkipFrame current: %d, last: %d", Integer.valueOf(max), Integer.valueOf(i25));
                        max = (max + i25) / 2;
                    }
                    i19 = max;
                }
                int max2 = Math.max(Math.min((int) ((float) Math.ceil((double) ((((float) fz2.r.f218223i) * 1.0f) / ((float) (i16 * (i19 + 1)))))), fz2.r.f218221g), fz2.r.f218222h);
                com.tencent.mm.plugin.scanner.model.i0 i0Var = com.tencent.mm.plugin.scanner.model.i0.f143377a;
                int i27 = my2.a.f267928f;
                MultiProcessMMKV multiProcessMMKV5 = com.tencent.mm.plugin.scanner.model.i0.f143380d;
                if (multiProcessMMKV5 != null) {
                    i27 = multiProcessMMKV5.getInt("scan_config_server_detect_frame_count", i27);
                }
                int floor2 = (int) ((float) Math.floor((double) (((((float) max2) * 1.0f) * ((float) i27)) / ((float) 20))));
                MultiProcessMMKV multiProcessMMKV6 = fz2.r.f218216b;
                if (!(multiProcessMMKV6 == null || (putInt = multiProcessMMKV6.putInt("scan_product_engine_detect_skip_frame_count", i19)) == null || (putInt2 = putInt.putInt("scan_product_server_detect_frame_count", floor2)) == null)) {
                    putInt2.apply();
                }
                Log.i(str4, "updateSkipFrame engineDetectSkipFrame: " + i19 + ", serverDetectFrame: " + floor2);
            }
            MultiProcessMMKV multiProcessMMKV7 = qb4.a.f288261i;
            if (multiProcessMMKV7 != null) {
                i17 = multiProcessMMKV7.getInt("scan_code_last_frame_cost", 0);
            } else {
                i17 = 0;
            }
            int a15 = fz2.r.a();
            MultiProcessMMKV multiProcessMMKV8 = qb4.a.f288261i;
            if (multiProcessMMKV8 != null) {
                i18 = multiProcessMMKV8.getInt("scan_code_decode_cost", 0);
            } else {
                i18 = 0;
            }
            if (i17 > 0 && i18 > 0) {
                com.tencent.mm.plugin.report.service.q.INSTANCE.g(24741, Integer.valueOf(i17), Integer.valueOf(a15), Integer.valueOf(i18));
            }
        } else {
            Log.w("MicroMsg.ScanProductSkipFrameManager", "not enable adjust skip frame");
            str2 = "";
            str = "MicroMsg.ScanUI";
        }
        int i28 = ob4.a.f275960a;
        int Xj0 = ((ie1.h) yz3.j.c(ie1.h.class)).Xj0(h.c.f232610zr, 6);
        if (Xj0 > 0) {
            ob4.a.f275960a = Xj0;
        }
        ((ArrayList) ob4.a.f275962c).clear();
        ((ArrayList) ob4.a.f275962c).add("https://qr.alipay.com/");
        try {
            str3 = str2;
            try {
                pi5 = ((ie1.h) yz3.j.c(ie1.h.class)).pi(h.c.Ar, str3);
                if (!Util.isNullOrNil(pi5)) {
                    String[] split = pi5.split(";");
                    if (split.length > 0) {
                        Collections.addAll(ob4.a.f275962c, split);
                    }
                }
                objArr = new Object[4];
            } catch (Exception e16) {
                e15 = e16;
                i15 = 0;
                Log.printErrStackTrace("MicroMsg.QBarAIModHelper", e15, "alvinluo updateBlackList exception", new Object[i15]);
                com.tencent.qbar.d.i();
                e0.e();
                e0.d();
                if (e0.f218090b == null) {
                }
                booleanValue = e0.f218090b.booleanValue();
                Log.i(str, "alvinluo initEnableMultiCode configEnableMultiCode: %b, entryEnableMultiCode: %b", Boolean.valueOf(booleanValue), Boolean.valueOf(this.f143612y0));
                if (booleanValue) {
                }
                z16 = false;
                this.f143612y0 = z16;
                com.tencent.qbar.f fVar = com.tencent.qbar.f.f191123x;
                if (booleanValue) {
                }
                z17 = false;
                fVar.f191125b = z17;
                com.tencent.qbar.d dVar = (com.tencent.qbar.d) fVar.f191136m.f220212b;
                dVar.getClass();
                Log.i("MicroMsg.WxQBar", "setEnableMultiCode: %b", Boolean.valueOf(z17));
                dVar.f191121e = z17;
                my2.a.b();
                z18 = my2.a.f267925c;
                if (z18) {
                }
                z19 = false;
                fz2.o.f218167a.a();
                this.Z = fz2.o.f218170d;
                Log.i(str, "initEnableScanCodeProductMerge configEnableScanMerge: %b, enableScanCodeProductMerge: %b, willCrash: %s", Boolean.valueOf(z18), Boolean.valueOf(this.f143601p0), Boolean.valueOf(this.Z));
                this.f143601p0 = z19;
                if (!z19) {
                }
                com.tencent.mm.plugin.scanner.model.d.a(4, null);
                Z7();
                if (getIntent().getBooleanExtra("key_check_camera_using", false)) {
                }
                boolean z27 = this.f143601p0;
                e1 e1Var = e1.f143320a;
                e1.f143321b = String.valueOf(System.currentTimeMillis());
                e1.f143327h = z27;
                initView();
                this.A = System.currentTimeMillis();
                this.f143597m1.alive();
                Looper.myQueue().addIdleHandler(new MessageQueue.IdleHandler(this) {
                    /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass13 */

                    public boolean queueIdle() {
                        Looper.myQueue().removeIdleHandler(this);
                        ((r10.f) yz3.j.c(r10.f.class)).Nl();
                        return false;
                    }
                });
                l8(1);
                m13 m132 = (m13) ((ky.b) yz3.j.c(ky.b.class)).nl(this, 1, 3, m13.class);
                WC3DTouchHomeShortCutStruct wC3DTouchHomeShortCutStruct = new WC3DTouchHomeShortCutStruct();
                wC3DTouchHomeShortCutStruct.f71370d = 2;
                wC3DTouchHomeShortCutStruct.f71371e = 1;
                wC3DTouchHomeShortCutStruct.n();
                wC3DTouchHomeShortCutStruct.r();
                z25 = this.f143601p0;
                Log.i("MicroMsg.ScanCrashManager", "enterScanUI %s", Boolean.valueOf(z25));
                if (fz2.o.f218170d) {
                }
                if (z25) {
                }
                com.tencent.mm.plugin.scanner.model.i0.f143394r = false;
                com.tencent.mm.plugin.scanner.model.i0.f143395s = false;
                ((z81.g) yz3.j.c(z81.g.class)).y10(this, c91.b.f48312v).KA0(this, c91.a.f48245t);
            }
            try {
                objArr[0] = Integer.valueOf(Xj0);
                objArr[1] = Integer.valueOf(ob4.a.f275960a);
                objArr[2] = pi5;
                objArr[3] = Integer.valueOf(((ArrayList) ob4.a.f275962c).size());
                Log.i("MicroMsg.QBarAIModHelper", "alvinluo updateBlackList config: %d, blackListDelayFrames: %d, blackListConfigValue: %s, blackListSize: %d", objArr);
            } catch (Exception e17) {
                e15 = e17;
                i15 = 0;
                Log.printErrStackTrace("MicroMsg.QBarAIModHelper", e15, "alvinluo updateBlackList exception", new Object[i15]);
                com.tencent.qbar.d.i();
                e0.e();
                e0.d();
                if (e0.f218090b == null) {
                }
                booleanValue = e0.f218090b.booleanValue();
                Log.i(str, "alvinluo initEnableMultiCode configEnableMultiCode: %b, entryEnableMultiCode: %b", Boolean.valueOf(booleanValue), Boolean.valueOf(this.f143612y0));
                if (booleanValue) {
                }
                z16 = false;
                this.f143612y0 = z16;
                com.tencent.qbar.f fVar2 = com.tencent.qbar.f.f191123x;
                if (booleanValue) {
                }
                z17 = false;
                fVar2.f191125b = z17;
                com.tencent.qbar.d dVar2 = (com.tencent.qbar.d) fVar2.f191136m.f220212b;
                dVar2.getClass();
                Log.i("MicroMsg.WxQBar", "setEnableMultiCode: %b", Boolean.valueOf(z17));
                dVar2.f191121e = z17;
                my2.a.b();
                z18 = my2.a.f267925c;
                if (z18) {
                }
                z19 = false;
                fz2.o.f218167a.a();
                this.Z = fz2.o.f218170d;
                Log.i(str, "initEnableScanCodeProductMerge configEnableScanMerge: %b, enableScanCodeProductMerge: %b, willCrash: %s", Boolean.valueOf(z18), Boolean.valueOf(this.f143601p0), Boolean.valueOf(this.Z));
                this.f143601p0 = z19;
                if (!z19) {
                }
                com.tencent.mm.plugin.scanner.model.d.a(4, null);
                Z7();
                if (getIntent().getBooleanExtra("key_check_camera_using", false)) {
                }
                boolean z272 = this.f143601p0;
                e1 e1Var2 = e1.f143320a;
                e1.f143321b = String.valueOf(System.currentTimeMillis());
                e1.f143327h = z272;
                initView();
                this.A = System.currentTimeMillis();
                this.f143597m1.alive();
                Looper.myQueue().addIdleHandler(new MessageQueue.IdleHandler(this) {
                    /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass13 */

                    public boolean queueIdle() {
                        Looper.myQueue().removeIdleHandler(this);
                        ((r10.f) yz3.j.c(r10.f.class)).Nl();
                        return false;
                    }
                });
                l8(1);
                m13 m1322 = (m13) ((ky.b) yz3.j.c(ky.b.class)).nl(this, 1, 3, m13.class);
                WC3DTouchHomeShortCutStruct wC3DTouchHomeShortCutStruct2 = new WC3DTouchHomeShortCutStruct();
                wC3DTouchHomeShortCutStruct2.f71370d = 2;
                wC3DTouchHomeShortCutStruct2.f71371e = 1;
                wC3DTouchHomeShortCutStruct2.n();
                wC3DTouchHomeShortCutStruct2.r();
                z25 = this.f143601p0;
                Log.i("MicroMsg.ScanCrashManager", "enterScanUI %s", Boolean.valueOf(z25));
                if (fz2.o.f218170d) {
                }
                if (z25) {
                }
                com.tencent.mm.plugin.scanner.model.i0.f143394r = false;
                com.tencent.mm.plugin.scanner.model.i0.f143395s = false;
                ((z81.g) yz3.j.c(z81.g.class)).y10(this, c91.b.f48312v).KA0(this, c91.a.f48245t);
            }
        } catch (Exception e18) {
            e15 = e18;
            str3 = str2;
            i15 = 0;
            Log.printErrStackTrace("MicroMsg.QBarAIModHelper", e15, "alvinluo updateBlackList exception", new Object[i15]);
            com.tencent.qbar.d.i();
            e0.e();
            e0.d();
            if (e0.f218090b == null) {
            }
            booleanValue = e0.f218090b.booleanValue();
            Log.i(str, "alvinluo initEnableMultiCode configEnableMultiCode: %b, entryEnableMultiCode: %b", Boolean.valueOf(booleanValue), Boolean.valueOf(this.f143612y0));
            if (booleanValue) {
            }
            z16 = false;
            this.f143612y0 = z16;
            com.tencent.qbar.f fVar22 = com.tencent.qbar.f.f191123x;
            if (booleanValue) {
            }
            z17 = false;
            fVar22.f191125b = z17;
            com.tencent.qbar.d dVar22 = (com.tencent.qbar.d) fVar22.f191136m.f220212b;
            dVar22.getClass();
            Log.i("MicroMsg.WxQBar", "setEnableMultiCode: %b", Boolean.valueOf(z17));
            dVar22.f191121e = z17;
            my2.a.b();
            z18 = my2.a.f267925c;
            if (z18) {
            }
            z19 = false;
            fz2.o.f218167a.a();
            this.Z = fz2.o.f218170d;
            Log.i(str, "initEnableScanCodeProductMerge configEnableScanMerge: %b, enableScanCodeProductMerge: %b, willCrash: %s", Boolean.valueOf(z18), Boolean.valueOf(this.f143601p0), Boolean.valueOf(this.Z));
            this.f143601p0 = z19;
            if (!z19) {
            }
            com.tencent.mm.plugin.scanner.model.d.a(4, null);
            Z7();
            if (getIntent().getBooleanExtra("key_check_camera_using", false)) {
            }
            boolean z2722 = this.f143601p0;
            e1 e1Var22 = e1.f143320a;
            e1.f143321b = String.valueOf(System.currentTimeMillis());
            e1.f143327h = z2722;
            initView();
            this.A = System.currentTimeMillis();
            this.f143597m1.alive();
            Looper.myQueue().addIdleHandler(new MessageQueue.IdleHandler(this) {
                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass13 */

                public boolean queueIdle() {
                    Looper.myQueue().removeIdleHandler(this);
                    ((r10.f) yz3.j.c(r10.f.class)).Nl();
                    return false;
                }
            });
            l8(1);
            m13 m13222 = (m13) ((ky.b) yz3.j.c(ky.b.class)).nl(this, 1, 3, m13.class);
            WC3DTouchHomeShortCutStruct wC3DTouchHomeShortCutStruct22 = new WC3DTouchHomeShortCutStruct();
            wC3DTouchHomeShortCutStruct22.f71370d = 2;
            wC3DTouchHomeShortCutStruct22.f71371e = 1;
            wC3DTouchHomeShortCutStruct22.n();
            wC3DTouchHomeShortCutStruct22.r();
            z25 = this.f143601p0;
            Log.i("MicroMsg.ScanCrashManager", "enterScanUI %s", Boolean.valueOf(z25));
            if (fz2.o.f218170d) {
            }
            if (z25) {
            }
            com.tencent.mm.plugin.scanner.model.i0.f143394r = false;
            com.tencent.mm.plugin.scanner.model.i0.f143395s = false;
            ((z81.g) yz3.j.c(z81.g.class)).y10(this, c91.b.f48312v).KA0(this, c91.a.f48245t);
        }
        com.tencent.qbar.d.i();
        e0.e();
        e0.d();
        if (e0.f218090b == null) {
            e0.d();
        }
        booleanValue = e0.f218090b.booleanValue();
        Log.i(str, "alvinluo initEnableMultiCode configEnableMultiCode: %b, entryEnableMultiCode: %b", Boolean.valueOf(booleanValue), Boolean.valueOf(this.f143612y0));
        if (booleanValue || !this.f143612y0) {
            z16 = false;
        } else {
            z16 = true;
        }
        this.f143612y0 = z16;
        com.tencent.qbar.f fVar222 = com.tencent.qbar.f.f191123x;
        if (booleanValue || !z16) {
            z17 = false;
        } else {
            z17 = true;
        }
        fVar222.f191125b = z17;
        com.tencent.qbar.d dVar222 = (com.tencent.qbar.d) fVar222.f191136m.f220212b;
        dVar222.getClass();
        Log.i("MicroMsg.WxQBar", "setEnableMultiCode: %b", Boolean.valueOf(z17));
        dVar222.f191121e = z17;
        my2.a.b();
        z18 = my2.a.f267925c;
        if (z18 || !this.f143601p0) {
            z19 = false;
        } else {
            z19 = true;
        }
        fz2.o.f218167a.a();
        this.Z = fz2.o.f218170d;
        Log.i(str, "initEnableScanCodeProductMerge configEnableScanMerge: %b, enableScanCodeProductMerge: %b, willCrash: %s", Boolean.valueOf(z18), Boolean.valueOf(this.f143601p0), Boolean.valueOf(this.Z));
        this.f143601p0 = z19;
        if (!z19) {
            y8();
            this.f143580b1 = new z0(this);
            ny2.f fVar3 = ny2.f.f273541v;
            fVar3.getClass();
            fVar3.f273547d = new f.c(fVar3);
            fVar3.f273548e = true;
            ny2.f.f273540u = fz2.r.a();
            com.tencent.mm.plugin.scanner.model.x.f143530b = true;
            if (fz2.p.a()) {
                Object[] objArr2 = new Object[2];
                objArr2[0] = Integer.valueOf(fz2.r.a());
                com.tencent.mm.plugin.scanner.model.i0 i0Var2 = com.tencent.mm.plugin.scanner.model.i0.f143377a;
                int i29 = my2.a.f267928f;
                MultiProcessMMKV multiProcessMMKV9 = com.tencent.mm.plugin.scanner.model.i0.f143380d;
                if (multiProcessMMKV9 != null) {
                    i29 = multiProcessMMKV9.getInt("scan_config_server_detect_frame_count", i29);
                }
                if (fz2.r.f218217c && (multiProcessMMKV = fz2.r.f218216b) != null) {
                    i29 = multiProcessMMKV.getInt("scan_product_server_detect_frame_count", i29);
                }
                objArr2[1] = Integer.valueOf(i29);
                y0.makeText(this, String.format("引擎识别跳帧数:%s,后台识别帧数:%s", objArr2), 0).show();
            }
        } else {
            com.tencent.mm.plugin.scanner.model.x.f143530b = false;
        }
        if (z19 && this.Z) {
            com.tencent.mm.plugin.scanner.model.d.a(4, null);
        }
        Z7();
        if (getIntent().getBooleanExtra("key_check_camera_using", false)) {
            AnonymousClass14 r05 = new DialogInterface.OnClickListener() {
                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass14 */

                public void onClick(DialogInterface dialogInterface, int i15) {
                    Log.i("MicroMsg.ScanUI", "checkCameraUsing user confirm and finish");
                    BaseScanUI.this.p();
                }
            };
            if (!zk.a.h(this, true, r05) && !zk.a.v(this, r05)) {
                AppBrandVoipCheckIsDeviceUsingEvent appBrandVoipCheckIsDeviceUsingEvent = new AppBrandVoipCheckIsDeviceUsingEvent();
                appBrandVoipCheckIsDeviceUsingEvent.publish();
                Log.i("MicroMsg.DeviceOccupy", "checkAppBrandCameraUsingAndShowToast isVoiceUsing:%b, isCameraUsing:%b", Boolean.valueOf(appBrandVoipCheckIsDeviceUsingEvent.f61856d.f61858b), Boolean.valueOf(appBrandVoipCheckIsDeviceUsingEvent.f61856d.f61857a));
                if (appBrandVoipCheckIsDeviceUsingEvent.f61856d.f61857a) {
                    Log.i("MicroMsg.DeviceOccupy", "app brand voip camera using");
                    i14.j.y(this, str3, zk.a.D(this, appBrandVoipCheckIsDeviceUsingEvent.f61856d.f61857a), getString(R.string.f367504vi), r05);
                }
            }
            Log.w(str, "checkCameraUsing camera is using and disable camera");
            this.V0 = false;
        }
        boolean z27222 = this.f143601p0;
        e1 e1Var222 = e1.f143320a;
        e1.f143321b = String.valueOf(System.currentTimeMillis());
        e1.f143327h = z27222;
        initView();
        this.A = System.currentTimeMillis();
        this.f143597m1.alive();
        Looper.myQueue().addIdleHandler(new MessageQueue.IdleHandler(this) {
            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass13 */

            public boolean queueIdle() {
                Looper.myQueue().removeIdleHandler(this);
                ((r10.f) yz3.j.c(r10.f.class)).Nl();
                return false;
            }
        });
        l8(1);
        m13 m132222 = (m13) ((ky.b) yz3.j.c(ky.b.class)).nl(this, 1, 3, m13.class);
        if (m132222 != null && "launch_type_scan_qrcode".equals(m132222.f29252d)) {
            WC3DTouchHomeShortCutStruct wC3DTouchHomeShortCutStruct222 = new WC3DTouchHomeShortCutStruct();
            wC3DTouchHomeShortCutStruct222.f71370d = 2;
            wC3DTouchHomeShortCutStruct222.f71371e = 1;
            wC3DTouchHomeShortCutStruct222.n();
            wC3DTouchHomeShortCutStruct222.r();
        }
        z25 = this.f143601p0;
        Log.i("MicroMsg.ScanCrashManager", "enterScanUI %s", Boolean.valueOf(z25));
        if (fz2.o.f218170d) {
            MultiProcessMMKV multiProcessMMKV10 = fz2.o.f218169c;
            long j15 = 0;
            if (multiProcessMMKV10 != null) {
                j15 = multiProcessMMKV10.getLong("key_will_crash_time_limit", 0);
            }
            MultiProcessMMKV multiProcessMMKV11 = fz2.o.f218169c;
            if (multiProcessMMKV11 != null) {
                z26 = multiProcessMMKV11.getBoolean("key_has_report_crash_limit", false);
            } else {
                z26 = false;
            }
            if (!z26) {
                if (j15 == 3600000) {
                    MultiProcessMMKV multiProcessMMKV12 = fz2.o.f218169c;
                    if (!(multiProcessMMKV12 == null || (putBoolean2 = multiProcessMMKV12.putBoolean("key_has_report_crash_limit", true)) == null)) {
                        putBoolean2.apply();
                    }
                    com.tencent.mm.plugin.report.service.q qVar = com.tencent.mm.plugin.report.service.q.INSTANCE;
                    qVar.t(1259, 230);
                    qVar.g(26691, 1, Long.valueOf(fz2.o.f218172f));
                } else if (j15 == 86400000) {
                    MultiProcessMMKV multiProcessMMKV13 = fz2.o.f218169c;
                    if (!(multiProcessMMKV13 == null || (putBoolean = multiProcessMMKV13.putBoolean("key_has_report_crash_limit", true)) == null)) {
                        putBoolean.apply();
                    }
                    com.tencent.mm.plugin.report.service.q qVar2 = com.tencent.mm.plugin.report.service.q.INSTANCE;
                    qVar2.t(1259, 231);
                    qVar2.g(26691, 2, Long.valueOf(fz2.o.f218172f));
                }
                Log.i("MicroMsg.ScanCrashManager", "reportWillCrashWhenEnter crashTimeLimit: " + j15);
            }
        }
        if (z25) {
            Log.w("MicroMsg.ScanCrashManager", "enterScanUI not enableScanCodeProductMerge and ignore");
        } else {
            MultiProcessMMKV multiProcessMMKV14 = fz2.o.f218169c;
            if (multiProcessMMKV14 != null) {
                multiProcessMMKV14.putBoolean("key_last_enter_will_crash", true);
            }
            MultiProcessMMKV multiProcessMMKV15 = fz2.o.f218169c;
            if (!(multiProcessMMKV15 == null || (putLong = multiProcessMMKV15.putLong("key_last_enter", System.currentTimeMillis())) == null)) {
                putLong.apply();
            }
            MultiProcessMMKV multiProcessMMKV16 = fz2.o.f218169c;
            if (multiProcessMMKV16 != null) {
                multiProcessMMKV16.putInt("key_client_version", yv3.d.f349176g);
            }
        }
        com.tencent.mm.plugin.scanner.model.i0.f143394r = false;
        com.tencent.mm.plugin.scanner.model.i0.f143395s = false;
        ((z81.g) yz3.j.c(z81.g.class)).y10(this, c91.b.f48312v).KA0(this, c91.a.f48245t);
    }

    @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.vas.VASActivity, com.tencent.mm.ui.MMFragmentActivity
    public void onDestroy() {
        SharedPreferences.Editor putBoolean;
        SharedPreferences.Editor remove;
        Log.i("MicroMsg.ScanUI", "onDestroy()");
        super.onDestroy();
        fz2.o oVar = fz2.o.f218167a;
        Log.i("MicroMsg.ScanCrashManager", "exitScanUI");
        MultiProcessMMKV multiProcessMMKV = fz2.o.f218169c;
        if (!(multiProcessMMKV == null || (putBoolean = multiProcessMMKV.putBoolean("key_last_enter_will_crash", false)) == null || (remove = putBoolean.remove("key_last_enter")) == null)) {
            remove.apply();
        }
        this.f143597m1.dead();
        wy2.f fVar = this.f143604s;
        if (fVar != null) {
            fVar.destroy();
        }
        ScanUIRectView scanUIRectView = this.f143585f;
        if (scanUIRectView != null) {
            scanUIRectView.o();
        }
        x xVar = this.f143602q;
        if (xVar != null && xVar.J()) {
            this.f143602q.dismiss();
        }
        n nVar = this.f143600p;
        if (nVar != null && nVar.h()) {
            this.f143600p.p();
        }
        l8(2);
        com.tencent.mm.plugin.scanner.model.x.f143530b = false;
    }

    @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.vas.VASActivity, com.tencent.mm.ui.MMFragmentActivity
    public void onPause() {
        BaseBoxDialogView baseBoxDialogView;
        super.onPause();
        Log.i("MicroMsg.ScanUI", "onPause() needPauseScan: %b", Boolean.valueOf(this.R));
        n11.p.b();
        ScanUIRectView scanUIRectView = this.f143585f;
        if (scanUIRectView != null) {
            scanUIRectView.e();
            if (this.R) {
                this.f143585f.j();
            }
        }
        if (this.W.f72559d == 0) {
            k8(false, false);
        }
        b.I.a();
        ob4.b.E.b();
        n11.p.b();
        x xVar = this.f143602q;
        if (xVar != null && (baseBoxDialogView = xVar.f217983s) != null) {
            Log.i("MicroMsg.BaseBoxDialogView", "alvinluo onPause set canMeasured false");
            baseBoxDialogView.J = false;
        }
    }

    @Override // androidx.activity.ComponentActivity, androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, r2.a.AbstractC4855a
    public void onRequestPermissionsResult(int i15, String[] strArr, int[] iArr) {
        Log.i("MicroMsg.ScanUI", "summerper onRequestPermissionsResult requestCode[%d],grantResults len[%d] tid[%d]", Integer.valueOf(i15), Integer.valueOf(iArr.length), Long.valueOf(Thread.currentThread().getId()));
        if (i15 != 16) {
            if (i15 != 26) {
                if (i15 == 76 && iArr.length > 0 && iArr[0] == -1) {
                    this.f143611y = false;
                    i14.j.C(this, getString(R.string.hhm), getString(R.string.hht), getString(R.string.g6z), getString(R.string.f367394sg), false, new DialogInterface.OnClickListener() {
                        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass36 */

                        public void onClick(DialogInterface dialogInterface, int i15) {
                            ((xw.d) yz3.j.c(xw.d.class)).O7(BaseScanUI.this.getContext());
                            BaseScanUI baseScanUI = BaseScanUI.this;
                            baseScanUI.f143611y = true;
                            baseScanUI.finish();
                        }
                    }, new DialogInterface.OnClickListener() {
                        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass37 */

                        public void onClick(DialogInterface dialogInterface, int i15) {
                            BaseScanUI baseScanUI = BaseScanUI.this;
                            baseScanUI.f143611y = true;
                            baseScanUI.finish();
                        }
                    });
                }
            } else if (iArr.length <= 0 || iArr[0] != -1) {
                ((zr.n) yz3.j.c(zr.n.class)).Pw0(this, new BaseScanUI$$c(this), true);
            } else {
                int i16 = r2.a.f292697c;
                if (!shouldShowRequestPermissionRationale("android.permission.RECORD_AUDIO")) {
                    i14.j.u(this, getString(R.string.f367618yo), getString(R.string.f367548wq), new BaseScanUI$$a(this), new BaseScanUI$$b(this));
                } else {
                    finish();
                }
            }
        } else if (iArr.length > 0 && iArr[0] == -1) {
            this.f143609x = false;
            i14.j.C(this, getString(R.string.hh8), getString(R.string.hht), getString(R.string.g6z), getString(R.string.f367394sg), false, new DialogInterface.OnClickListener() {
                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass34 */

                public void onClick(DialogInterface dialogInterface, int i15) {
                    ((xw.d) yz3.j.c(xw.d.class)).O7(BaseScanUI.this.getContext());
                    BaseScanUI baseScanUI = BaseScanUI.this;
                    baseScanUI.f143609x = true;
                    baseScanUI.finish();
                }
            }, new DialogInterface.OnClickListener() {
                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass35 */

                public void onClick(DialogInterface dialogInterface, int i15) {
                    BaseScanUI baseScanUI = BaseScanUI.this;
                    baseScanUI.f143609x = true;
                    baseScanUI.finish();
                }
            });
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:14:0x008c, code lost:
        if (r1 == false) goto L_0x008e;
     */
    /* JADX WARNING: Removed duplicated region for block: B:18:0x0093  */
    /* JADX WARNING: Removed duplicated region for block: B:32:0x014a  */
    /* JADX WARNING: Removed duplicated region for block: B:34:? A[RETURN, SYNTHETIC] */
    @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.vas.VASActivity, com.tencent.mm.ui.MMFragmentActivity
    public void onResume() {
        boolean z15;
        BaseBoxDialogView baseBoxDialogView;
        super.onResume();
        Log.i("MicroMsg.ScanUI", "onResume() needPauseScan: %b", Boolean.valueOf(this.R));
        n11.p.a(true, true, true);
        Log.i("MicroMsg.ScanUI", "should check camera %s, location %s", Boolean.valueOf(this.f143609x), Boolean.valueOf(this.f143611y));
        boolean z16 = this.f143609x;
        if (z16 || this.f143611y) {
            if (z16) {
                boolean M1 = ((xw.d) yz3.j.c(xw.d.class)).M1(this, "android.permission.CAMERA", 16, null, null);
                ScanUIRectView scanUIRectView = this.f143585f;
                if (scanUIRectView != null) {
                    scanUIRectView.R = M1;
                }
                Log.i("MicroMsg.ScanUI", "summerper checkPermission checkCamera[%b]", Boolean.valueOf(M1));
                if (!M1) {
                    this.f143613z = false;
                    z15 = false;
                    if (z15) {
                        boolean z17 = this.f143613z;
                        e1 e1Var = e1.f143320a;
                        Log.i("MicroMsg.ScanReporter", "alvinluo setCameraPermission: %b", Boolean.valueOf(z17));
                        e1.f143326g = z17;
                        if (!xj.b.b()) {
                            i14.j.C(this, getString(R.string.hh8), getString(R.string.hht), getString(R.string.g6z), getString(R.string.f367394sg), false, new DialogInterface.OnClickListener() {
                                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass32 */

                                public void onClick(DialogInterface dialogInterface, int i15) {
                                    ((xw.d) yz3.j.c(xw.d.class)).O7(BaseScanUI.this.getContext());
                                    BaseScanUI baseScanUI = BaseScanUI.this;
                                    baseScanUI.f143609x = true;
                                    baseScanUI.finish();
                                }
                            }, new DialogInterface.OnClickListener() {
                                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass33 */

                                public void onClick(DialogInterface dialogInterface, int i15) {
                                    BaseScanUI baseScanUI = BaseScanUI.this;
                                    baseScanUI.f143609x = true;
                                    baseScanUI.finish();
                                }
                            });
                        } else {
                            Log.i("MicroMsg.ScanUI", "alvinluo onResumeAfterChkPermission needPauseScan: %b", Boolean.valueOf(this.R));
                            if (!this.R) {
                                this.f143585f.f();
                                this.f143599o.a(true);
                                s8(true);
                            }
                            z.l().a(this.f143595k1);
                            y8();
                            this.f143596l1.alive();
                        }
                    }
                    getWindow().addFlags(128);
                    x xVar = this.f143602q;
                    if (!(xVar == null || (baseBoxDialogView = xVar.f217983s) == null)) {
                        baseBoxDialogView.J = true;
                    }
                    FinderLivePauseActionEvent finderLivePauseActionEvent = new FinderLivePauseActionEvent();
                    finderLivePauseActionEvent.f62850d.f62852a = true;
                    finderLivePauseActionEvent.publish();
                    String str = "useXNet: " + my2.a.a();
                    m.g(str, MimeTypes.BASE_TYPE_TEXT);
                    if (!BuildInfo.DEBUG) {
                        y0.k(this, str);
                        return;
                    }
                    return;
                }
            }
            if (this.f143611y) {
                boolean M12 = ((xw.d) yz3.j.c(xw.d.class)).M1(this, "android.permission.ACCESS_FINE_LOCATION", 76, null, null);
                Log.i("MicroMsg.ScanUI", "summerper checkPermission checkLocation [%b]", Boolean.valueOf(M12));
            }
        }
        z15 = true;
        if (z15) {
        }
        getWindow().addFlags(128);
        x xVar2 = this.f143602q;
        baseBoxDialogView.J = true;
        FinderLivePauseActionEvent finderLivePauseActionEvent2 = new FinderLivePauseActionEvent();
        finderLivePauseActionEvent2.f62850d.f62852a = true;
        finderLivePauseActionEvent2.publish();
        String str2 = "useXNet: " + my2.a.a();
        m.g(str2, MimeTypes.BASE_TYPE_TEXT);
        if (!BuildInfo.DEBUG) {
        }
    }

    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.tencent.mm.ui.component.UIComponentActivity, com.tencent.mm.ui.MMActivity, com.tencent.mm.ui.vas.VASActivity, com.tencent.mm.ui.MMFragmentActivity
    public void onStart() {
        super.onStart();
        Log.i("MicroMsg.ScanUI", "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.vas.VASActivity, com.tencent.mm.ui.MMFragmentActivity
    public void onStop() {
        super.onStop();
        Log.i("MicroMsg.ScanUI", "onStop()");
        ScanUIRectView scanUIRectView = this.f143585f;
        if (scanUIRectView != null) {
            scanUIRectView.t();
        }
        this.f143587g.a();
        z.l().d(this.f143595k1);
        this.f143596l1.dead();
        getWindow().clearFlags(128);
        FinderLivePauseActionEvent finderLivePauseActionEvent = new FinderLivePauseActionEvent();
        finderLivePauseActionEvent.f62850d.f62852a = false;
        finderLivePauseActionEvent.publish();
        if (finderLivePauseActionEvent.f62851e.f62853a) {
            finish();
        }
    }

    @Override // wy2.f.b
    public void p() {
        Log.i("MicroMsg.ScanUI", "finishUI");
        finish();
        overridePendingTransition(0, 0);
    }

    public final void p8() {
        int i15 = this.B;
        if (!(i15 == 1 || i15 == 8)) {
            if (i15 == 12) {
                this.f143585f.setScanCallback(this.f143590h1);
                wy2.a aVar = new wy2.a(this.B, this.f143585f, this, this.f143592i1);
                this.f143604s = aVar;
                aVar.f335749i = null;
                com.tencent.mm.plugin.scanner.model.b bVar = aVar.f335751n;
                if (bVar != null) {
                    bVar.f143271f = null;
                    return;
                }
                return;
            } else if (i15 == 3) {
                this.f143604s = new h1(this);
                return;
            } else if (i15 != 4) {
                this.f143585f.setScanCallback(null);
                return;
            }
        }
        this.f143585f.setScanCallback(this.f143588g1);
        this.f143604s = new g(e1.f143321b, this.B, this.Q, true, this.f143585f, this, this, this.Z0);
    }

    public final void q8(boolean z15) {
        Log.i("MicroMsg.ScanUI", "alvinluo setEnableSwitchTab enable: %b, %b", Boolean.valueOf(z15), Boolean.valueOf(this.f143608w));
        i0 i0Var = this.f143606u;
        if (i0Var != null) {
            if (!z15) {
                i0Var.c(false);
            } else if (this.f143608w) {
                i0Var.c(true);
            }
        }
        ScanUIRectView scanUIRectView = this.f143585f;
        if (scanUIRectView == null) {
            return;
        }
        if (!z15) {
            scanUIRectView.setEnableScrollSwitchTab(false);
        } else if (this.f143608w) {
            scanUIRectView.setEnableScrollSwitchTab(true);
        }
    }

    public final void r8() {
        int i15 = 3;
        if (!e0.a(this.B)) {
            int i16 = this.B;
            if (i16 == 12) {
                b bVar = b.I;
                i15 = 2;
            } else if (i16 == 3) {
                b bVar2 = b.I;
            } else {
                i15 = 0;
            }
        } else if (this.f143601p0) {
            b bVar3 = b.I;
            i15 = 4;
        } else {
            b bVar4 = b.I;
            i15 = 1;
        }
        b bVar5 = b.I;
        bVar5.getClass();
        Log.i("MicroMsg.QBarEngineReporter", "alvinluo setReportTabType tabType: %d", Integer.valueOf(i15));
        bVar5.f191090p = i15;
    }

    public final void s8(boolean z15) {
        i0 i0Var = this.f143606u;
        if (i0Var != null) {
            i0Var.getClass();
            Log.i("MicroMsg.ScanScrollTabController", "alvinluo setEnable %b", Boolean.valueOf(z15));
            i0Var.c(z15);
            ScanScrollTabView scanScrollTabView = i0Var.f211061b;
            if (scanScrollTabView != null) {
                scanScrollTabView.setEnabled(z15);
            }
        }
    }

    public final void t8(boolean z15, boolean z16) {
        if (z15) {
            ScannerFlashSwitcher scannerFlashSwitcher = this.f143587g;
            if (scannerFlashSwitcher != null && !scannerFlashSwitcher.isShown()) {
                ScanUIRectView scanUIRectView = this.f143585f;
                ScanSharedMaskView scanSharedMaskView = scanUIRectView.f143899q;
                if (scanSharedMaskView != null && !scanUIRectView.f143902t.f143968h) {
                    scanSharedMaskView.e(true);
                }
                BaseScanMaskView baseScanMaskView = scanUIRectView.f143900r;
                if (baseScanMaskView != null && !scanUIRectView.f143902t.f143968h) {
                    baseScanMaskView.f144339n = true;
                }
                if (z16) {
                    this.f143587g.d();
                } else {
                    this.f143587g.setVisibility(0);
                }
                b bVar = b.I;
                if (bVar.f191089o != 2) {
                    bVar.f191089o = 1;
                }
                e1.u(this.B, 1, this.f143601p0);
                return;
            }
            return;
        }
        ScannerFlashSwitcher scannerFlashSwitcher2 = this.f143587g;
        if (scannerFlashSwitcher2 != null && !scannerFlashSwitcher2.f143967g) {
            ScanUIRectView scanUIRectView2 = this.f143585f;
            ScanSharedMaskView scanSharedMaskView2 = scanUIRectView2.f143899q;
            if (scanSharedMaskView2 != null && scanUIRectView2.f143902t.f143968h) {
                scanSharedMaskView2.e(false);
            }
            BaseScanMaskView baseScanMaskView2 = scanUIRectView2.f143900r;
            if (baseScanMaskView2 != null && scanUIRectView2.f143902t.f143968h) {
                baseScanMaskView2.f144339n = false;
            }
            if (z16) {
                this.f143587g.b();
            } else {
                this.f143587g.setVisibility(8);
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:51:0x00c0, code lost:
        if (r3 == null) goto L_0x00c2;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:97:0x0166, code lost:
        if (r0 == null) goto L_0x0168;
     */
    /* JADX WARNING: Removed duplicated region for block: B:119:0x01a8 A[Catch:{ Exception -> 0x01cd }] */
    /* JADX WARNING: Removed duplicated region for block: B:122:0x01b5 A[Catch:{ Exception -> 0x01cd }] */
    /* JADX WARNING: Removed duplicated region for block: B:128:0x01c1 A[Catch:{ Exception -> 0x01cd }] */
    /* JADX WARNING: Removed duplicated region for block: B:139:0x0237  */
    /* JADX WARNING: Removed duplicated region for block: B:78:0x010b A[Catch:{ Exception -> 0x0135 }] */
    /* JADX WARNING: Removed duplicated region for block: B:81:0x0118 A[Catch:{ Exception -> 0x0135 }] */
    /* JADX WARNING: Removed duplicated region for block: B:87:0x0124 A[Catch:{ Exception -> 0x0135 }] */
    public void u8(int i15, Bundle bundle) {
        boolean z15;
        int i16;
        View view;
        boolean z16;
        int i17;
        View.OnClickListener onClickListener;
        boolean z17;
        String str;
        String str2;
        ScanInfoMaskView scanInfoMaskView;
        int i18;
        int i19;
        String str3;
        String str4;
        byte[] bArr;
        boolean z18;
        boolean z19;
        vj vjVar;
        vj vjVar2;
        byte[] bArr2;
        String str5;
        String str6;
        String str7;
        boolean z25;
        boolean z26;
        vj vjVar3;
        vj vjVar4;
        boolean z27;
        Log.i("MicroMsg.ScanUI", "alvinluo showInfoView type: %d", Integer.valueOf(i15));
        if (i15 == 1 || i15 == 2 || i15 == 3 || i15 == 4) {
            ScanSharedMaskView scanSharedMaskView = this.f143593j;
            if (scanSharedMaskView != null) {
                scanSharedMaskView.f144276q = this.f143585f.getTextrueView();
                ScanSharedMaskView scanSharedMaskView2 = this.f143593j;
                if (i15 == 3 || i15 == 4) {
                    z27 = true;
                } else {
                    z27 = false;
                }
                scanSharedMaskView2.setAnimateBackgroundView(z27);
            }
            this.R = true;
            if (i15 == 3 || i15 == 4) {
                z15 = true;
            } else {
                z15 = false;
            }
            this.f143599o.a(false);
            this.f143599o.b(z15, null);
            x0 x0Var = this.U;
            if (x0Var != null) {
                x0Var.getClass();
                BaseScanMaskView<BaseScanRequest> baseScanMaskView = x0Var.f143532b;
                if (baseScanMaskView != null) {
                    view = baseScanMaskView.getTargetSuccessMarkView();
                } else {
                    view = null;
                }
                ScanInfoMaskView scanInfoMaskView2 = x0Var.f143534d;
                if (scanInfoMaskView2 != null) {
                    scanInfoMaskView2.setAnchorView(view);
                }
                ScanSharedMaskView scanSharedMaskView3 = x0Var.f143533c;
                if (scanSharedMaskView3 != null) {
                    RelativeLayout relativeLayout = scanSharedMaskView3.f144266d;
                    if (relativeLayout != null) {
                        y.a(relativeLayout, 0.0f, 1.0f, 200, null);
                    } else {
                        m.p("contentLayout");
                        throw null;
                    }
                }
                BaseScanMaskView<BaseScanRequest> baseScanMaskView2 = x0Var.f143532b;
                if (baseScanMaskView2 != null) {
                    baseScanMaskView2.p(true);
                }
                if (bundle != null) {
                    z16 = bundle.getBoolean("key_offline_scan_show_tips", true);
                } else {
                    z16 = true;
                }
                int i25 = R.raw.scan_no_network_error;
                String str8 = "";
                if (i15 == 1) {
                    str4 = getResources().getString(R.string.i_u);
                    m.f(str4, "context.resources.getStr…line_network_unavailable)");
                    str3 = getResources().getString(R.string.i_v);
                    m.f(str3, "context.resources.getStr…network_unavailable_tips)");
                } else if (i15 == 2) {
                    str4 = getResources().getString(R.string.i_x);
                    m.f(str4, "context.resources.getStr…can_offline_network_weak)");
                    str3 = getResources().getString(R.string.i_v);
                    m.f(str3, "context.resources.getStr…network_unavailable_tips)");
                } else if (i15 != 3) {
                    if (i15 != 4) {
                        i25 = -1;
                        z16 = false;
                        str2 = str8;
                    } else {
                        if (bundle != null) {
                            try {
                                bArr2 = bundle.getByteArray("key_scan_bar_code_response");
                            } catch (Exception e15) {
                                Log.printErrStackTrace("MicroMsg.ScanInfoPageViewHelper", e15, "buildViewParams parse BizScanBarcodeResponse from byte array exception", new Object[0]);
                                str2 = getResources().getString(R.string.f369094i92);
                                m.f(str2, "context.resources.getStr…scan_goods_title_default)");
                                String string = getResources().getString(R.string.f369093i91);
                                m.f(string, "context.resources.getStr…_goods_sub_title_default)");
                                str8 = string;
                            }
                        }
                        bArr2 = new byte[0];
                        if (bundle != null) {
                            str5 = bundle.getString("key_scan_bar_code_string");
                        } else {
                            str5 = null;
                        }
                        if (str5 != null) {
                            str8 = str5;
                        }
                        x0Var.f143538h = str8;
                        xi xiVar = new xi();
                        xiVar.parseFrom(bArr2);
                        LinkedList<vj> linkedList = xiVar.f42204f;
                        if (linkedList == null || (vjVar4 = (vj) c0.R(linkedList, 0)) == null) {
                            str6 = null;
                        } else {
                            str6 = vjVar4.f39953e;
                        }
                        LinkedList<vj> linkedList2 = xiVar.f42204f;
                        if (linkedList2 == null || (vjVar3 = (vj) c0.R(linkedList2, 1)) == null) {
                            str7 = null;
                        } else {
                            str7 = vjVar3.f39953e;
                        }
                        if (str6 != null) {
                            if (str6.length() != 0) {
                                z25 = false;
                                if (z25) {
                                    str6 = getResources().getString(R.string.f369094i92);
                                }
                                m.f(str6, "if (title.isNullOrEmpty(…title_default) else title");
                                if (str7 != null) {
                                    if (str7.length() != 0) {
                                        z26 = false;
                                        if (z26) {
                                            str7 = getResources().getString(R.string.f369093i91);
                                        }
                                        m.f(str7, "if (subTitle.isNullOrEmp…le_default) else subTitle");
                                        str8 = str7;
                                        str2 = str6;
                                        i25 = R.raw.scan_no_result_error;
                                    }
                                }
                                z26 = true;
                                if (z26) {
                                }
                                m.f(str7, "if (subTitle.isNullOrEmp…le_default) else subTitle");
                                str8 = str7;
                                str2 = str6;
                                i25 = R.raw.scan_no_result_error;
                            }
                        }
                        z25 = true;
                        if (z25) {
                        }
                        m.f(str6, "if (title.isNullOrEmpty(…title_default) else title");
                        if (str7 != null) {
                        }
                        z26 = true;
                        if (z26) {
                        }
                        m.f(str7, "if (subTitle.isNullOrEmp…le_default) else subTitle");
                        str8 = str7;
                        str2 = str6;
                        i25 = R.raw.scan_no_result_error;
                    }
                    z17 = false;
                    i17 = i25;
                    str = str8;
                    onClickListener = null;
                    x0Var.f143537g = i15;
                    scanInfoMaskView = x0Var.f143534d;
                    if (scanInfoMaskView != null) {
                        Log.i("MicroMsg.ScanInfoMaskView", "alvinluo showInfoView needTranslateInfoIcon: %b, showTips: %b, title: %s, subTitle: %s", Boolean.valueOf(scanInfoMaskView.f144202y), Boolean.valueOf(z16), str2, str);
                        View view2 = scanInfoMaskView.f144188h;
                        if (view2 != null) {
                            TextView textView = (TextView) view2.findViewById(R.id.f364477ma0);
                            if (textView != null) {
                                textView.setText(str2);
                            }
                            TextView textView2 = (TextView) view2.findViewById(R.id.m_z);
                            if (textView2 != null) {
                                textView2.setText(str);
                                if (z16) {
                                    i19 = 0;
                                } else {
                                    i19 = 8;
                                }
                                textView2.setVisibility(i19);
                            }
                            ImageView imageView = scanInfoMaskView.f144189i;
                            if (imageView != null) {
                                imageView.setImageResource(i17);
                                TextView textView3 = scanInfoMaskView.f144190j;
                                if (textView3 != null) {
                                    if (z17) {
                                        i18 = 0;
                                    } else {
                                        i18 = 8;
                                    }
                                    textView3.setVisibility(i18);
                                    TextView textView4 = scanInfoMaskView.f144190j;
                                    if (textView4 != null) {
                                        textView4.setOnClickListener(onClickListener);
                                        View view3 = scanInfoMaskView.f144186f;
                                        if (view3 != null) {
                                            k30.a aVar = new k30.a();
                                            ThreadLocal<k30.a> threadLocal = k30.c.f244265a;
                                            aVar.c(8);
                                            j30.a.d(view3, aVar.b(), "com/tencent/mm/plugin/scanner/ui/widget/ScanInfoMaskView", "showInfoView", "(Lcom/tencent/mm/plugin/scanner/view/IScanInfoView$ScanInfoViewParams;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                                            view3.setVisibility(((Integer) aVar.a(0)).intValue());
                                            j30.a.e(view3, "com/tencent/mm/plugin/scanner/ui/widget/ScanInfoMaskView", "showInfoView", "(Lcom/tencent/mm/plugin/scanner/view/IScanInfoView$ScanInfoViewParams;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                                            if (!scanInfoMaskView.f144202y) {
                                                scanInfoMaskView.f144202y = false;
                                                scanInfoMaskView.a(false);
                                            } else {
                                                scanInfoMaskView.f144196s = false;
                                                scanInfoMaskView.f144197t = true;
                                                View view4 = scanInfoMaskView.f144188h;
                                                if (view4 != null) {
                                                    k30.a aVar2 = new k30.a();
                                                    aVar2.c(0);
                                                    j30.a.d(view4, aVar2.b(), "com/tencent/mm/plugin/scanner/ui/widget/ScanInfoMaskView", "showInfoView", "(Lcom/tencent/mm/plugin/scanner/view/IScanInfoView$ScanInfoViewParams;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                                                    view4.setVisibility(((Integer) aVar2.a(0)).intValue());
                                                    j30.a.e(view4, "com/tencent/mm/plugin/scanner/ui/widget/ScanInfoMaskView", "showInfoView", "(Lcom/tencent/mm/plugin/scanner/view/IScanInfoView$ScanInfoViewParams;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                                                    scanInfoMaskView.setVisibility(4);
                                                    scanInfoMaskView.post(new ez2.a0(scanInfoMaskView));
                                                } else {
                                                    m.p("infoLayout");
                                                    throw null;
                                                }
                                            }
                                        } else {
                                            m.p("loadingLayout");
                                            throw null;
                                        }
                                    } else {
                                        m.p("opButton");
                                        throw null;
                                    }
                                } else {
                                    m.p("opButton");
                                    throw null;
                                }
                            } else {
                                m.p("infoIcon");
                                throw null;
                            }
                        } else {
                            m.p("infoLayout");
                            throw null;
                        }
                    }
                    i16 = 3;
                } else {
                    if (bundle != null) {
                        try {
                            bArr = bundle.getByteArray("key_scan_bar_code_response");
                        } catch (Exception e16) {
                            Log.printErrStackTrace("MicroMsg.ScanInfoPageViewHelper", e16, "buildViewParams parse BizScanBarcodeResponse from byte array exception", new Object[0]);
                            onClickListener = new w0(x0Var);
                            str2 = getResources().getString(R.string.i8z);
                            m.f(str2, "context.resources.getStr…scan_goods_title_default)");
                            str = getResources().getString(R.string.i8y);
                            m.f(str, "context.resources.getStr…_goods_sub_title_default)");
                        }
                    }
                    bArr = new byte[0];
                    xi xiVar2 = new xi();
                    xiVar2.parseFrom(bArr);
                    LinkedList<vj> linkedList3 = xiVar2.f42204f;
                    if (linkedList3 == null || (vjVar2 = (vj) c0.R(linkedList3, 0)) == null) {
                        str2 = null;
                    } else {
                        str2 = vjVar2.f39953e;
                    }
                    LinkedList<vj> linkedList4 = xiVar2.f42204f;
                    if (linkedList4 == null || (vjVar = (vj) c0.R(linkedList4, 1)) == null) {
                        str = null;
                    } else {
                        str = vjVar.f39953e;
                    }
                    onClickListener = new v0(x0Var);
                    if (str2 != null) {
                        if (str2.length() != 0) {
                            z18 = false;
                            if (z18) {
                                str2 = getResources().getString(R.string.i8z);
                            }
                            m.f(str2, "if (title.isNullOrEmpty(…title_default) else title");
                            if (str != null) {
                                if (str.length() != 0) {
                                    z19 = false;
                                    if (z19) {
                                        str = getResources().getString(R.string.i8y);
                                    }
                                    m.f(str, "if (subTitle.isNullOrEmp…le_default) else subTitle");
                                    z17 = true;
                                    i17 = R.raw.scan_no_result_error;
                                    x0Var.f143537g = i15;
                                    scanInfoMaskView = x0Var.f143534d;
                                    if (scanInfoMaskView != null) {
                                    }
                                    i16 = 3;
                                }
                            }
                            z19 = true;
                            if (z19) {
                            }
                            m.f(str, "if (subTitle.isNullOrEmp…le_default) else subTitle");
                            z17 = true;
                            i17 = R.raw.scan_no_result_error;
                            x0Var.f143537g = i15;
                            scanInfoMaskView = x0Var.f143534d;
                            if (scanInfoMaskView != null) {
                            }
                            i16 = 3;
                        }
                    }
                    z18 = true;
                    if (z18) {
                    }
                    m.f(str2, "if (title.isNullOrEmpty(…title_default) else title");
                    if (str != null) {
                    }
                    z19 = true;
                    if (z19) {
                    }
                    m.f(str, "if (subTitle.isNullOrEmp…le_default) else subTitle");
                    z17 = true;
                    i17 = R.raw.scan_no_result_error;
                    x0Var.f143537g = i15;
                    scanInfoMaskView = x0Var.f143534d;
                    if (scanInfoMaskView != null) {
                    }
                    i16 = 3;
                }
                str2 = str4;
                str8 = str3;
                z17 = false;
                i17 = i25;
                str = str8;
                onClickListener = null;
                x0Var.f143537g = i15;
                scanInfoMaskView = x0Var.f143534d;
                if (scanInfoMaskView != null) {
                }
                i16 = 3;
            } else {
                i16 = 3;
            }
            if (i15 == i16) {
                e1.l(4, this.f143601p0, this.B, 0);
            }
        }
    }

    public void v8(boolean z15, boolean z16, d.a aVar) {
        boolean z17;
        Object[] objArr = new Object[3];
        objArr[0] = Boolean.valueOf(z15);
        x0 x0Var = this.U;
        if (x0Var == null || !x0Var.f143535e) {
            z17 = false;
        } else {
            z17 = true;
        }
        objArr[1] = Boolean.valueOf(z17);
        objArr[2] = Boolean.valueOf(z16);
        Log.i("MicroMsg.ScanUI", "alvinluo showLoadingView show: %b, isLoadingShow: %b, withAnimation: %b", objArr);
        this.R = z15;
        x0 x0Var2 = this.U;
        if (x0Var2 != null) {
            x0Var2.f143536f = aVar;
            if (x0Var2.f143535e != z15) {
                x0Var2.a(z15, z16);
                if (z15) {
                    this.f143599o.a(false);
                    this.f143599o.b(false, null);
                }
            }
        }
    }

    public final void w8(boolean z15) {
        if (z15) {
            View view = this.f143591i;
            k30.a aVar = new k30.a();
            ThreadLocal<k30.a> threadLocal = k30.c.f244265a;
            aVar.c(0);
            j30.a.d(view, aVar.b(), "com/tencent/mm/plugin/scanner/ui/BaseScanUI", "showNoScanContent", "(Z)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
            view.setVisibility(((Integer) aVar.a(0)).intValue());
            j30.a.e(view, "com/tencent/mm/plugin/scanner/ui/BaseScanUI", "showNoScanContent", "(Z)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
            BaseScanMaskView baseScanMaskView = this.f143585f.f143900r;
            if (baseScanMaskView != null && (baseScanMaskView instanceof ScanCodeMaskView)) {
                ((ScanCodeMaskView) baseScanMaskView).H.cancel();
            }
            this.f143591i.setOnClickListener(new View.OnClickListener() {
                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass28 */

                public void onClick(View view) {
                    ArrayList arrayList = new ArrayList();
                    arrayList.add(view);
                    Object[] array = arrayList.toArray();
                    arrayList.clear();
                    j30.a.b("com/tencent/mm/plugin/scanner/ui/BaseScanUI$28", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V", this, array);
                    BaseScanUI baseScanUI = BaseScanUI.this;
                    baseScanUI.X = 0;
                    baseScanUI.w8(false);
                    BaseScanUI.this.o8();
                    j30.a.g(this, "com/tencent/mm/plugin/scanner/ui/BaseScanUI$28", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V");
                }
            });
            ScanUIRectView scanUIRectView = this.f143585f;
            if (scanUIRectView != null) {
                scanUIRectView.s(true);
            }
            this.f143599o.a(false);
            t8(false, true);
            return;
        }
        View view2 = this.f143591i;
        k30.a aVar2 = new k30.a();
        ThreadLocal<k30.a> threadLocal2 = k30.c.f244265a;
        aVar2.c(8);
        j30.a.d(view2, aVar2.b(), "com/tencent/mm/plugin/scanner/ui/BaseScanUI", "showNoScanContent", "(Z)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
        view2.setVisibility(((Integer) aVar2.a(0)).intValue());
        j30.a.e(view2, "com/tencent/mm/plugin/scanner/ui/BaseScanUI", "showNoScanContent", "(Z)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
        ScanUIRectView scanUIRectView2 = this.f143585f;
        if (scanUIRectView2 != null) {
            scanUIRectView2.s(false);
        }
        this.f143599o.a(true);
    }

    public void x8(final int i15) {
        ViewPropertyAnimator alpha;
        ViewPropertyAnimator duration;
        ViewPropertyAnimator listener;
        s8(true);
        this.R = false;
        if (i15 == 12 && this.U != null) {
            this.f143599o.b(false, null);
            ScanSharedMaskView scanSharedMaskView = this.f143593j;
            if (scanSharedMaskView != null) {
                scanSharedMaskView.a(true, null);
            }
            x0 x0Var = this.U;
            AnonymousClass40 r65 = new AnimatorListenerAdapter() {
                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass40 */

                public void onAnimationEnd(Animator animator) {
                    super.onAnimationEnd(animator);
                    BaseScanUI.this.f143606u.d(i15, 4);
                }
            };
            ScanInfoMaskView scanInfoMaskView = x0Var.f143534d;
            if (scanInfoMaskView != null) {
                View view = scanInfoMaskView.f144188h;
                if (view == null) {
                    m.p("infoLayout");
                    throw null;
                } else if (view.getVisibility() == 0) {
                    View view2 = scanInfoMaskView.f144186f;
                    if (view2 != null) {
                        k30.a aVar = new k30.a();
                        ThreadLocal<k30.a> threadLocal = k30.c.f244265a;
                        aVar.c(8);
                        j30.a.d(view2, aVar.b(), "com/tencent/mm/plugin/scanner/ui/widget/ScanInfoMaskView", "animateSwitch", "(Landroid/animation/AnimatorListenerAdapter;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                        view2.setVisibility(((Integer) aVar.a(0)).intValue());
                        j30.a.e(view2, "com/tencent/mm/plugin/scanner/ui/widget/ScanInfoMaskView", "animateSwitch", "(Landroid/animation/AnimatorListenerAdapter;)V", "android/view/View_EXEC_", "setVisibility", "(I)V");
                        View view3 = scanInfoMaskView.f144188h;
                        if (view3 != null) {
                            k30.a aVar2 = new k30.a();
                            aVar2.c(Float.valueOf(1.0f));
                            j30.a.d(view3, aVar2.b(), "com/tencent/mm/plugin/scanner/ui/widget/ScanInfoMaskView", "animateViewAlpha", "(Landroid/view/View;ZJLandroid/animation/AnimatorListenerAdapter;)V", "android/view/View_EXEC_", "setAlpha", "(F)V");
                            view3.setAlpha(((Float) aVar2.a(0)).floatValue());
                            j30.a.e(view3, "com/tencent/mm/plugin/scanner/ui/widget/ScanInfoMaskView", "animateViewAlpha", "(Landroid/view/View;ZJLandroid/animation/AnimatorListenerAdapter;)V", "android/view/View_EXEC_", "setAlpha", "(F)V");
                            Log.i("MicroMsg.ScanInfoMaskView", "alvinluo animateViewAlpha view: %s, show: %b", view3, Boolean.FALSE);
                            ViewPropertyAnimator animate = view3.animate();
                            if (!(animate == null || (alpha = animate.alpha(0.0f)) == null || (duration = alpha.setDuration(150)) == null || (listener = duration.setListener(new ez2.y(view3, false, r65))) == null)) {
                                listener.start();
                            }
                        } else {
                            m.p("infoLayout");
                            throw null;
                        }
                    } else {
                        m.p("loadingLayout");
                        throw null;
                    }
                }
            }
            t tVar = j.f338034d;
            AnonymousClass41 r55 = new Runnable() {
                /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass41 */

                public void run() {
                    ScanSharedMaskView scanSharedMaskView;
                    BaseScanUI baseScanUI = BaseScanUI.this;
                    if (!baseScanUI.V || (scanSharedMaskView = baseScanUI.f143593j) == null) {
                        baseScanUI.q8(true);
                        ScanUIRectView scanUIRectView = baseScanUI.f143585f;
                        if (scanUIRectView != null) {
                            scanUIRectView.setIgnorePreviewFrame(false);
                            baseScanUI.f143585f.k(0);
                            return;
                        }
                        return;
                    }
                    baseScanUI.V = false;
                    scanSharedMaskView.a(false, new AnimatorListenerAdapter() {
                        /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass41.AnonymousClass1 */

                        public void onAnimationEnd(Animator animator) {
                            super.onAnimationEnd(animator);
                            BaseScanUI baseScanUI = BaseScanUI.this;
                            int i15 = BaseScanUI.f143578n1;
                            baseScanUI.q8(true);
                            ScanUIRectView scanUIRectView = baseScanUI.f143585f;
                            if (scanUIRectView != null) {
                                scanUIRectView.setIgnorePreviewFrame(false);
                                baseScanUI.f143585f.k(0);
                            }
                        }
                    });
                }
            };
            j jVar = (j) tVar;
            jVar.getClass();
            jVar.w(r55, 1000, false);
        }
    }

    public final void y8() {
        boolean z15;
        boolean z16;
        if (this.f143601p0) {
            MultiProcessMMKV multiProcessMMKV = com.tencent.mm.plugin.scanner.model.i0.f143380d;
            if (multiProcessMMKV != null) {
                z15 = multiProcessMMKV.getBoolean("scan_config_disable_scan_product", false);
            } else {
                z15 = false;
            }
            Log.i("MicroMsg.ScanFastFocusEngineManager", "disableScanProductInMergeMode: " + z15);
            if (this.E) {
                if (z15 || this.Z) {
                    z16 = true;
                } else {
                    z16 = false;
                }
                this.f143610x0 = z16;
            } else {
                this.f143610x0 = true;
            }
            ScanUIRectView scanUIRectView = this.f143585f;
            if (scanUIRectView != null) {
                scanUIRectView.setDisableScanProductInMergeMode(this.f143610x0);
            }
            Log.i("MicroMsg.ScanUI", "updateDisableScanProductInMergeMode config: %s, current: %s, currentNetwork: %s, willCrash: %s", Boolean.valueOf(z15), Boolean.valueOf(this.f143610x0), Boolean.valueOf(this.E), Boolean.valueOf(this.Z));
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:11:0x001b, code lost:
        if (r1 != false) goto L_0x001d;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:15:0x0023, code lost:
        if (r5.P == false) goto L_0x0027;
     */
    public final void z8() {
        boolean z15;
        boolean z16;
        ScanUITopOpButtonComponent scanUITopOpButtonComponent = this.f143599o;
        boolean z17 = true;
        if (!f8()) {
            int i15 = this.B;
            if (i15 == 12) {
                z15 = true;
            } else {
                z15 = false;
            }
            if (!z15) {
                if (i15 == 3) {
                    z16 = true;
                } else {
                    z16 = false;
                }
            }
        }
        if (!this.K) {
        }
        z17 = false;
        scanUITopOpButtonComponent.setShowMoreButton(z17);
        this.f143599o.setOnMoreClickListener(new View.OnClickListener() {
            /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass22 */

            public void onClick(View view) {
                ArrayList arrayList = new ArrayList();
                arrayList.add(view);
                Object[] array = arrayList.toArray();
                arrayList.clear();
                j30.a.b("com/tencent/mm/plugin/scanner/ui/BaseScanUI$22", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V", this, array);
                BaseScanUI baseScanUI = BaseScanUI.this;
                e1.u(baseScanUI.B, 9, baseScanUI.f143601p0);
                BaseScanUI baseScanUI2 = BaseScanUI.this;
                baseScanUI2.getClass();
                n nVar = new n((Context) baseScanUI2, 1, false);
                baseScanUI2.f143600p = nVar;
                nVar.f281245i = new l0(baseScanUI2) {
                    /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass20 */

                    @Override // i14.l0
                    public void onCreateMMMenu(d0 d0Var) {
                        if (d0Var.v()) {
                            d0Var.a(101, R.string.f366846d4);
                        }
                    }
                };
                nVar.f281259q = new p0() {
                    /* class com.tencent.mm.plugin.scanner.ui.BaseScanUI.AnonymousClass21 */

                    @Override // i14.p0
                    public void onMMMenuItemSelected(MenuItem menuItem, int i15) {
                        if (menuItem.getItemId() == 101) {
                            BaseScanUI baseScanUI = BaseScanUI.this;
                            e1.u(baseScanUI.B, 10, baseScanUI.f143601p0);
                            BaseScanUI baseScanUI2 = BaseScanUI.this;
                            Intent intent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
                            intent.putExtra("android.intent.extra.shortcut.NAME", baseScanUI2.getString(R.string.cfs));
                            intent.putExtra("duplicate", false);
                            Intent intent2 = new Intent("com.tencent.mm.ui.ShortCutDispatchAction");
                            intent2.putExtra("LauncherUI.From.Scaner.Shortcut", true);
                            intent.putExtra("android.intent.extra.shortcut.INTENT", intent2);
                            intent.putExtra("shortcut_is_adaptive_icon", true);
                            intent.putExtra("android.intent.extra.shortcut.ICON_RESOURCE", Intent.ShortcutIconResource.fromContext(baseScanUI2, R.drawable.scan_shortcut_icon));
                            intent.putExtra("shortcut_icon_resource_id", R.drawable.scan_shortcut_icon);
                            ((wy.b) yz3.j.c(wy.b.class)).dL(baseScanUI2, intent, true);
                            com.tencent.mm.plugin.report.service.q.INSTANCE.g(11410, new Object[0]);
                        }
                    }
                };
                nVar.q();
                j30.a.g(this, "com/tencent/mm/plugin/scanner/ui/BaseScanUI$22", "android/view/View$OnClickListener", "onClick", "(Landroid/view/View;)V");
            }
        });
    }
}