得物.apk(点击下载) / AIMeasureFootActivity.java


package com.shizhuang.duapp.modules.ai_measure.ui;

import a40.j;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import androidx.core.view.accessibility.AccessibilityEventCompat;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.viewpager.widget.ViewPager;
import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.knightboost.weaver.api.Scope;
import com.knightboost.weaver.api.annotations.Insert;
import com.knightboost.weaver.api.annotations.TargetClass;
import com.liulishuo.okdownload.core.cause.EndCause;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.ui.BaseActivity;
import com.shizhuang.duapp.libs.downloader.listener.DuSafeListener;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.modules.ai_measure.model.GuideInfo;
import com.shizhuang.duapp.modules.ai_measure.model.MeasureFacade;
import com.shizhuang.duapp.modules.ai_measure.model.MeasureInfo;
import com.shizhuang.duapp.modules.ai_measure.model.MeasureItemResult;
import com.shizhuang.duapp.modules.ai_measure.model.UserInfo;
import com.shizhuang.duapp.modules.ai_measure.ui.GuidePanel;
import com.shizhuang.duapp.modules.ai_measure.ui.RoleEditDialog;
import com.shizhuang.duapp.modules.ai_measure.wiget.ARChangeView;
import com.shizhuang.duapp.modules.du_mall_common.extension.ViewExtensionKt;
import com.shizhuang.duapp.modules.identify.ui.ai_measure.model.HumanBody;
import com.shizhuang.duapp.stream.interfaces.IRecorder;
import com.shizhuang.dufootmesure.mnn.CompleteCallBack;
import com.shizhuang.dufootmesure.mnn.DuFootModel;
import com.shizhuang.dufootmesure.mnn.MeasureResult;
import com.shizhuang.media.image.RenderManager;
import cw.c;
import df.u0;
import dw.n;
import dw.o;
import fd.i;
import fd.q;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Timer;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.Metadata;
import kotlin.Result;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.JvmField;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Ref;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;
import rd.l;
import td.s;

@Route(extPath = {"/product/arFootScan", "/arMeasure/foot"})
@Metadata(bv = {}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0007\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Lcom/shizhuang/duapp/modules/ai_measure/ui/AIMeasureFootActivity;", "Lcom/shizhuang/duapp/common/ui/BaseActivity;", "<init>", "()V", "du_ai_measure_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: AIMeasureFootActivity.kt */
public final class AIMeasureFootActivity extends BaseActivity {
    public static ChangeQuickRedirect changeQuickRedirect;
    public final Lazy A = LazyKt__LazyJVMKt.lazy(AIMeasureFootActivity$mLeftFootResult$2.INSTANCE);
    public final Lazy B = LazyKt__LazyJVMKt.lazy(AIMeasureFootActivity$mRightFootResult$2.INSTANCE);
    public final Lazy C = LazyKt__LazyJVMKt.lazy(AIMeasureFootActivity$mLeftMeasureInfo$2.INSTANCE);
    public final Lazy D = LazyKt__LazyJVMKt.lazy(AIMeasureFootActivity$mRightMeasureInfo$2.INSTANCE);
    public HumanBody E = HumanBody.LEFT_FOOT;
    public boolean F;
    public boolean G;
    public String H = "";
    public long I;
    public boolean J;
    public int K = -1;
    public final Lazy L = LazyKt__LazyJVMKt.lazy(AIMeasureFootActivity$mTimer$2.INSTANCE);
    public final Lazy M = LazyKt__LazyJVMKt.lazy(AIMeasureFootActivity$mMainHandler$2.INSTANCE);
    public Context N;
    public int O = -1;
    public String P = "";
    public boolean Q;
    public boolean R;
    public int S;
    public boolean T;
    public boolean U;
    public boolean V;
    public boolean W;
    public boolean X;
    public RoleViewModel Y;
    public RoleEditDialog Z;

    /* renamed from: a0  reason: collision with root package name */
    public ReportUpdateDialog f10957a0;
    @Autowired
    @JvmField
    @NotNull
    public String b0;

    /* renamed from: c  reason: collision with root package name */
    public final String f10958c = "FootMeasure";

    /* renamed from: c0  reason: collision with root package name */
    public final AIMeasureFootActivity$mOnPageChangedListener$1 f10959c0;
    public String d = "";

    /* renamed from: d0  reason: collision with root package name */
    public HashMap f10960d0;
    public String e = "";
    public String f = "";

    /* renamed from: g  reason: collision with root package name */
    public String f10961g = "";

    /* renamed from: h  reason: collision with root package name */
    public String f10962h = "";
    public UserInfo i = new UserInfo(null, null, null, 0, null, null, 0, null, 0, 0, 0, false, 0.0d, 0.0d, 0, 0, 0.0d, 0.0d, 0.0d, 0.0d, 0, null, 0, null, false, 0.0d, 0.0d, 0, 0, 0.0d, 0.0d, 0.0d, 0.0d, 0, null, 0, null, -1, 31, null);
    public IRecorder j;
    public RenderManager k;
    public int l;
    public int m;
    public float n;
    public final Lazy o = LazyKt__LazyJVMKt.lazy(AIMeasureFootActivity$mSelectedTitleList$2.INSTANCE);
    public GuidePageAdapter p;

    /* renamed from: q  reason: collision with root package name */
    public int f10963q = -1;
    public boolean r = true;
    public boolean s;
    public MediaPlayer t;

    /* renamed from: u  reason: collision with root package name */
    public final Lazy f10964u = LazyKt__LazyJVMKt.lazy(AIMeasureFootActivity$mGuidePanel$2.INSTANCE);

    /* renamed from: v  reason: collision with root package name */
    public final Lazy f10965v = LazyKt__LazyJVMKt.lazy(AIMeasureFootActivity$mMeasureSuccessPanel$2.INSTANCE);
    public final DuFootModel w = new DuFootModel();
    public final Lazy x = LazyKt__LazyJVMKt.lazy(AIMeasureFootActivity$mObjectLock$2.INSTANCE);
    public int y = -1;
    public boolean z;

    public class _boostWeave {
        public static ChangeQuickRedirect changeQuickRedirect;

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.appcompat.app.AppCompatActivity")
        @Insert(mayCreateSuper = true, value = "onCreate")
        @Keep
        public static void ActivityMethodWeaver_onCreate(@Nullable AIMeasureFootActivity aIMeasureFootActivity, Bundle bundle) {
            if (!PatchProxy.proxy(new Object[]{aIMeasureFootActivity, bundle}, null, changeQuickRedirect, true, 66019, new Class[]{AIMeasureFootActivity.class, Bundle.class}, Void.TYPE).isSupported) {
                jn.b bVar = jn.b.f34396a;
                if (!bVar.b()) {
                    bVar.d(true);
                }
                long currentTimeMillis = System.currentTimeMillis();
                AIMeasureFootActivity.e(aIMeasureFootActivity, bundle);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (aIMeasureFootActivity.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.ai_measure.ui.AIMeasureFootActivity")) {
                    bVar.activityOnCreateMethod(aIMeasureFootActivity, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.appcompat.app.AppCompatActivity")
        @Insert(mayCreateSuper = true, value = "onResume")
        @Keep
        public static void ActivityMethodWeaver_onResume(AIMeasureFootActivity aIMeasureFootActivity) {
            if (!PatchProxy.proxy(new Object[]{aIMeasureFootActivity}, null, changeQuickRedirect, true, 66018, new Class[]{AIMeasureFootActivity.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                AIMeasureFootActivity.d(aIMeasureFootActivity);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (aIMeasureFootActivity.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.ai_measure.ui.AIMeasureFootActivity")) {
                    jn.b.f34396a.activityOnResumeMethod(aIMeasureFootActivity, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.appcompat.app.AppCompatActivity")
        @Insert(mayCreateSuper = true, value = "onStart")
        @Keep
        public static void ActivityMethodWeaver_onStart(AIMeasureFootActivity aIMeasureFootActivity) {
            if (!PatchProxy.proxy(new Object[]{aIMeasureFootActivity}, null, changeQuickRedirect, true, 66020, new Class[]{AIMeasureFootActivity.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                AIMeasureFootActivity.f(aIMeasureFootActivity);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (aIMeasureFootActivity.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.ai_measure.ui.AIMeasureFootActivity")) {
                    jn.b.f34396a.activityOnStartMethod(aIMeasureFootActivity, currentTimeMillis, currentTimeMillis2);
                }
            }
        }
    }

    /* compiled from: AIMeasureFootActivity.kt */
    public static final class a implements CompleteCallBack {

        /* renamed from: a  reason: collision with root package name */
        public static final a f10966a = new a();
        public static ChangeQuickRedirect changeQuickRedirect;

        @Override // com.shizhuang.dufootmesure.mnn.CompleteCallBack
        public final void onComplete(MeasureResult measureResult) {
            boolean z = PatchProxy.proxy(new Object[]{measureResult}, this, changeQuickRedirect, false, 66028, new Class[]{MeasureResult.class}, Void.TYPE).isSupported;
        }
    }

    /* compiled from: AIMeasureFootActivity.kt */
    public static final class b extends DuSafeListener {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ AIMeasureFootActivity d;
        public final /* synthetic */ File e;
        public final /* synthetic */ File f;

        /* renamed from: g  reason: collision with root package name */
        public final /* synthetic */ String f10967g;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public b(AIMeasureFootActivity aIMeasureFootActivity, File file, File file2, String str, LifecycleOwner lifecycleOwner) {
            super(lifecycleOwner);
            this.d = aIMeasureFootActivity;
            this.e = file;
            this.f = file2;
            this.f10967g = str;
        }

        @Override // vl.a
        public void onTaskCanceled(@org.jetbrains.annotations.Nullable s9.c cVar) {
            if (!PatchProxy.proxy(new Object[]{cVar}, this, changeQuickRedirect, false, 66030, new Class[]{s9.c.class}, Void.TYPE).isSupported) {
                super.onTaskCanceled(cVar);
                fo.a.m(a.f.g(new StringBuilder(), this.d.f10958c, "  onTaskCanceled"), new Object[0]);
                ki.a.a(this.e);
                ViewExtensionKt.k((TextView) this.d._$_findCachedViewById(R.id.load_id));
                AIMeasureFootActivity aIMeasureFootActivity = this.d;
                u0.d(aIMeasureFootActivity.N, aIMeasureFootActivity.getString(R.string.pull_resource_error));
            }
        }

        @Override // vl.a
        public void onTaskCompleted(@NotNull s9.c cVar) {
            if (!PatchProxy.proxy(new Object[]{cVar}, this, changeQuickRedirect, false, 66031, new Class[]{s9.c.class}, Void.TYPE).isSupported) {
                super.onTaskCompleted(cVar);
                fo.a.m(a.f.g(new StringBuilder(), this.d.f10958c, " Download success"), new Object[0]);
                this.d.E(this.e, this.f, this.f10967g);
                ViewExtensionKt.k((TextView) this.d._$_findCachedViewById(R.id.load_id));
                AIMeasureFootActivity aIMeasureFootActivity = this.d;
                u0.d(aIMeasureFootActivity.N, aIMeasureFootActivity.getString(R.string.pull_resource_success));
            }
        }

        @Override // vl.a
        public void onTaskError(@NotNull s9.c cVar, @NotNull EndCause endCause, @org.jetbrains.annotations.Nullable Exception exc) {
            if (!PatchProxy.proxy(new Object[]{cVar, endCause, exc}, this, changeQuickRedirect, false, 66029, new Class[]{s9.c.class, EndCause.class, Exception.class}, Void.TYPE).isSupported) {
                super.onTaskError(cVar, endCause, exc);
                fo.a.m(this.d.f10958c + "  onTaskError cause = " + endCause.name(), new Object[0]);
                ki.a.a(this.e);
                ViewExtensionKt.k((TextView) this.d._$_findCachedViewById(R.id.load_id));
                AIMeasureFootActivity aIMeasureFootActivity = this.d;
                u0.d(aIMeasureFootActivity.N, aIMeasureFootActivity.getString(R.string.pull_resource_error));
            }
        }
    }

    /* compiled from: AIMeasureFootActivity.kt */
    public static final class c implements MediaPlayer.OnPreparedListener {

        /* renamed from: a  reason: collision with root package name */
        public static final c f10969a = new c();
        public static ChangeQuickRedirect changeQuickRedirect;

        public final void onPrepared(MediaPlayer mediaPlayer) {
            if (!PatchProxy.proxy(new Object[]{mediaPlayer}, this, changeQuickRedirect, false, 66060, new Class[]{MediaPlayer.class}, Void.TYPE).isSupported) {
                mediaPlayer.start();
            }
        }
    }

    /* compiled from: AIMeasureFootActivity.kt */
    public static final class d extends s<String> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ AIMeasureFootActivity b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ int f10970c;

        public d(AIMeasureFootActivity aIMeasureFootActivity, int i) {
            this.b = aIMeasureFootActivity;
            this.f10970c = i;
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.s, td.a
        public void onBzError(@org.jetbrains.annotations.Nullable l<String> lVar) {
            if (!PatchProxy.proxy(new Object[]{lVar}, this, changeQuickRedirect, false, 66066, new Class[]{l.class}, Void.TYPE).isSupported) {
                super.onBzError(lVar);
                fo.a.i(a.f.g(new StringBuilder(), this.b.f10958c, "  postUpdateRoleSize onFailed"), new Object[0]);
            }
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
        public void onSuccess(Object obj) {
            String str = (String) obj;
            if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 66067, new Class[]{String.class}, Void.TYPE).isSupported) {
                super.onSuccess(str);
                AIMeasureFootActivity aIMeasureFootActivity = this.b;
                if (!aIMeasureFootActivity.V) {
                    aIMeasureFootActivity.i.setMRoleSex(AIMeasureFootActivity.g(aIMeasureFootActivity).c().getMRoleSex());
                    AIMeasureFootActivity aIMeasureFootActivity2 = this.b;
                    aIMeasureFootActivity2.i.setMRole(AIMeasureFootActivity.g(aIMeasureFootActivity2).c().getMRole());
                    AIMeasureFootActivity aIMeasureFootActivity3 = this.b;
                    aIMeasureFootActivity3.i.setMRoleName(AIMeasureFootActivity.g(aIMeasureFootActivity3).c().getMRoleName());
                    AIMeasureFootActivity aIMeasureFootActivity4 = this.b;
                    if (aIMeasureFootActivity4.W) {
                        aIMeasureFootActivity4.i.setMRoleSex(AIMeasureFootActivity.g(aIMeasureFootActivity4).b().getMRoleSex());
                        AIMeasureFootActivity aIMeasureFootActivity5 = this.b;
                        aIMeasureFootActivity5.i.setMRole(AIMeasureFootActivity.g(aIMeasureFootActivity5).b().getMRole());
                        AIMeasureFootActivity aIMeasureFootActivity6 = this.b;
                        aIMeasureFootActivity6.i.setMRoleName(AIMeasureFootActivity.g(aIMeasureFootActivity6).b().getMRoleName());
                    }
                }
                fo.a.i(a.f.g(new StringBuilder(), this.b.f10958c, "  postUpdateRoleSize onSuccess"), new Object[0]);
                AIMeasureFootActivity aIMeasureFootActivity7 = this.b;
                int i = this.f10970c;
                if (!PatchProxy.proxy(new Object[]{new Integer(i)}, aIMeasureFootActivity7, AIMeasureFootActivity.changeQuickRedirect, false, 66002, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
                    ik1.f.i(LifecycleOwnerKt.getLifecycleScope(aIMeasureFootActivity7), null, null, new AIMeasureFootActivity$showMeasureResult$1(aIMeasureFootActivity7, i, null), 3, null);
                }
            }
        }
    }

    /* compiled from: AIMeasureFootActivity.kt */
    public static final class e extends s<String> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ AIMeasureFootActivity b;

        /* JADX WARN: Incorrect args count in method signature: ()V */
        public e(AIMeasureFootActivity aIMeasureFootActivity) {
            this.b = aIMeasureFootActivity;
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.s, td.a
        public void onBzError(@org.jetbrains.annotations.Nullable l<String> lVar) {
            if (!PatchProxy.proxy(new Object[]{lVar}, this, changeQuickRedirect, false, 66068, new Class[]{l.class}, Void.TYPE).isSupported) {
                super.onBzError(lVar);
                fo.a.i(this.b.f10958c + " postMeasureResult error=" + lVar, new Object[0]);
                AIMeasureFootActivity aIMeasureFootActivity = this.b;
                u0.d(aIMeasureFootActivity.N, aIMeasureFootActivity.getString(R.string.measure_report_network_error));
                if (this.b.o().size() < 7 || this.b.t().size() < 7) {
                    this.b.k();
                }
                this.b.finish();
            }
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
        public void onSuccess(Object obj) {
            String str = (String) obj;
            int i = 0;
            if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 66069, new Class[]{String.class}, Void.TYPE).isSupported) {
                super.onSuccess(str);
                fo.a.m(a01.a.i(new StringBuilder(), this.b.f10958c, " postMeasureResult success=", str), new Object[0]);
                if (str != null) {
                    try {
                        JsonObject jsonObject = (JsonObject) new Gson().fromJson(str, JsonObject.class);
                        if (jsonObject.has("reportId")) {
                            i = jsonObject.get("reportId").getAsInt();
                        }
                        AIMeasureFootActivity aIMeasureFootActivity = this.b;
                        aIMeasureFootActivity.T = true;
                        aIMeasureFootActivity.S = i;
                        aIMeasureFootActivity.z();
                    } catch (Exception unused) {
                    }
                }
            }
        }
    }

    /* compiled from: AIMeasureFootActivity.kt */
    public static final class f implements GuidePanel.GuideListener {
        public static ChangeQuickRedirect changeQuickRedirect;

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ AIMeasureFootActivity f10971a;
        public final /* synthetic */ String b;

        public f(AIMeasureFootActivity aIMeasureFootActivity, String str) {
            this.f10971a = aIMeasureFootActivity;
            this.b = str;
        }

        @Override // com.shizhuang.duapp.modules.ai_measure.ui.GuidePanel.GuideListener
        public void close() {
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 66071, new Class[0], Void.TYPE).isSupported) {
                i60.a.f33292a.D(this.f10971a.getString(R.string.guide_title_4), "关闭", this.b);
                this.f10971a.I = System.currentTimeMillis();
                synchronized (this.f10971a.s()) {
                    this.f10971a.z = false;
                    Unit unit = Unit.INSTANCE;
                }
            }
        }
    }

    /* compiled from: AIMeasureFootActivity.kt */
    public static final class g extends co.a {
        public static ChangeQuickRedirect changeQuickRedirect;

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ AIMeasureFootActivity f10972a;
        public final /* synthetic */ Ref.ObjectRef b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ int f10973c;
        public final /* synthetic */ int d;
        public final /* synthetic */ MeasureInfo e;

        public g(AIMeasureFootActivity aIMeasureFootActivity, Ref.ObjectRef objectRef, int i, int i3, MeasureInfo measureInfo) {
            this.f10972a = aIMeasureFootActivity;
            this.b = objectRef;
            this.f10973c = i;
            this.d = i3;
            this.e = measureInfo;
        }

        @Override // co.a
        public void a(@org.jetbrains.annotations.Nullable Drawable drawable) {
            if (!PatchProxy.proxy(new Object[]{drawable}, this, changeQuickRedirect, false, 66084, new Class[]{Drawable.class}, Void.TYPE).isSupported) {
                super.a(drawable);
                this.b.element = (T) ((RelativeLayout.LayoutParams) ((DuImageLoaderView) this.f10972a._$_findCachedViewById(R.id.measure_guide_animation)).getLayoutParams());
                c.a aVar = cw.c.f31260c;
                ((RelativeLayout.LayoutParams) this.b.element).width = aVar.c(375.0f, this.f10973c);
                ((RelativeLayout.LayoutParams) this.b.element).height = aVar.b(440.0f, this.d);
                ((DuImageLoaderView) this.f10972a._$_findCachedViewById(R.id.measure_guide_animation)).setLayoutParams(this.b.element);
                ((DuImageLoaderView) this.f10972a._$_findCachedViewById(R.id.measure_guide_animation)).e(BitmapFactory.decodeFile(this.e.getMImagePath()));
                synchronized (this.f10972a.s()) {
                    AIMeasureFootActivity aIMeasureFootActivity = this.f10972a;
                    aIMeasureFootActivity.y = 4;
                    aIMeasureFootActivity.G = true;
                    Unit unit = Unit.INSTANCE;
                }
            }
        }
    }

    /* compiled from: AIMeasureFootActivity.kt */
    public static final class h implements Runnable {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ AIMeasureFootActivity b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ File f10974c;
        public final /* synthetic */ File d;
        public final /* synthetic */ String e;

        /* compiled from: AIMeasureFootActivity.kt */
        public static final class a implements Runnable {
            public static ChangeQuickRedirect changeQuickRedirect;
            public final /* synthetic */ h b;

            public a(h hVar) {
                this.b = hVar;
            }

            public final void run() {
                if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 66098, new Class[0], Void.TYPE).isSupported) {
                    h hVar = this.b;
                    AIMeasureFootActivity aIMeasureFootActivity = hVar.b;
                    String str = hVar.e;
                    if (!PatchProxy.proxy(new Object[]{str}, aIMeasureFootActivity, AIMeasureFootActivity.changeQuickRedirect, false, 65975, new Class[]{String.class}, Void.TYPE).isSupported) {
                        if (Intrinsics.areEqual(str, "https://apk.poizon.com/duApp/Android_Config/resource/ai_measure/res_zip/res_1_0915.zip")) {
                            fo.a.m(a.f.g(new StringBuilder(), aIMeasureFootActivity.f10958c, " Download success into one"), new Object[0]);
                            aIMeasureFootActivity.r = true;
                            if (!PatchProxy.proxy(new Object[0], aIMeasureFootActivity, AIMeasureFootActivity.changeQuickRedirect, false, 65986, new Class[0], Void.TYPE).isSupported) {
                                ArrayList arrayList = new ArrayList();
                                String string = aIMeasureFootActivity.getString(R.string.guide_title_1);
                                String string2 = aIMeasureFootActivity.getString(R.string.guide_desc_1);
                                StringBuilder sb2 = new StringBuilder();
                                sb2.append(aIMeasureFootActivity.e);
                                String str2 = File.separator;
                                arrayList.add(new GuideInfo(0, string, string2, h6.a.q(sb2, str2, "res_1", str2, "ar_footscan_guide_1.webp"), ""));
                                String string3 = aIMeasureFootActivity.getString(R.string.guide_title_2);
                                String string4 = aIMeasureFootActivity.getString(R.string.guide_desc_2);
                                StringBuilder sb3 = new StringBuilder();
                                h.b.u(sb3, aIMeasureFootActivity.e, str2, "res_1", str2);
                                sb3.append("ar_footscan_guide_2.webp");
                                arrayList.add(new GuideInfo(1, string3, string4, sb3.toString(), ""));
                                String string5 = aIMeasureFootActivity.getString(R.string.guide_title_3);
                                String string6 = aIMeasureFootActivity.getString(R.string.guide_desc_3);
                                StringBuilder sb4 = new StringBuilder();
                                h.b.u(sb4, aIMeasureFootActivity.e, str2, "res_1", str2);
                                sb4.append("ar_footscan_guide_3.webp");
                                arrayList.add(new GuideInfo(2, string5, string6, sb4.toString(), ""));
                                String string7 = aIMeasureFootActivity.getString(R.string.guide_title_4);
                                String string8 = aIMeasureFootActivity.getString(R.string.guide_desc_4);
                                StringBuilder sb5 = new StringBuilder();
                                h.b.u(sb5, aIMeasureFootActivity.e, str2, "res_1", str2);
                                sb5.append("ar_footscan_guide_4.mp4");
                                arrayList.add(new GuideInfo(3, string7, string8, "", sb5.toString()));
                                aIMeasureFootActivity.v().clear();
                                aIMeasureFootActivity.v().add(aIMeasureFootActivity.getString(R.string.guide_title_1));
                                aIMeasureFootActivity.v().add(aIMeasureFootActivity.getString(R.string.guide_title_2));
                                aIMeasureFootActivity.v().add(aIMeasureFootActivity.getString(R.string.guide_title_3));
                                aIMeasureFootActivity.v().add(aIMeasureFootActivity.getString(R.string.guide_title_4));
                                aIMeasureFootActivity.p = new GuidePageAdapter(aIMeasureFootActivity.getSupportFragmentManager(), arrayList);
                                ((ViewPager) aIMeasureFootActivity._$_findCachedViewById(R.id.guide_pager)).setAdapter(aIMeasureFootActivity.p);
                                IndicateDotView indicateDotView = (IndicateDotView) aIMeasureFootActivity._$_findCachedViewById(R.id.page_indicate);
                                GuidePageAdapter guidePageAdapter = aIMeasureFootActivity.p;
                                indicateDotView.setDotCount(guidePageAdapter != null ? guidePageAdapter.getCount() : 0);
                                ((ViewPager) aIMeasureFootActivity._$_findCachedViewById(R.id.guide_pager)).setOffscreenPageLimit(4);
                                ((ViewPager) aIMeasureFootActivity._$_findCachedViewById(R.id.guide_pager)).addOnPageChangeListener(aIMeasureFootActivity.f10959c0);
                                ((ViewPager) aIMeasureFootActivity._$_findCachedViewById(R.id.guide_pager)).setPageTransformer(false, AIMeasureFootActivity$initGuideInfo$1.f10975a);
                            }
                            if (!PatchProxy.proxy(new Object[0], aIMeasureFootActivity, AIMeasureFootActivity.changeQuickRedirect, false, 65981, new Class[0], Void.TYPE).isSupported) {
                                fo.a.m(a.f.g(new StringBuilder(), aIMeasureFootActivity.f10958c, " updateUIWithResOne begin"), new Object[0]);
                                ((TextView) aIMeasureFootActivity._$_findCachedViewById(R.id.tv_guide)).setOnClickListener(new AIMeasureFootActivity$updateUIWithResOne$1(aIMeasureFootActivity));
                                ((ImageView) aIMeasureFootActivity._$_findCachedViewById(R.id.iv_back)).setOnClickListener(new AIMeasureFootActivity$updateUIWithResOne$2(aIMeasureFootActivity));
                                ((TextView) aIMeasureFootActivity._$_findCachedViewById(R.id.tv_next_step)).setOnClickListener(new AIMeasureFootActivity$updateUIWithResOne$3(aIMeasureFootActivity));
                                ((ImageView) aIMeasureFootActivity._$_findCachedViewById(R.id.iv_close)).setOnClickListener(new AIMeasureFootActivity$updateUIWithResOne$4(aIMeasureFootActivity));
                                fo.a.m(a.f.g(new StringBuilder(), aIMeasureFootActivity.f10958c, " updateUIWithResOne end"), new Object[0]);
                            }
                            if (!PatchProxy.proxy(new Object[0], aIMeasureFootActivity, AIMeasureFootActivity.changeQuickRedirect, false, 65978, new Class[0], Void.TYPE).isSupported) {
                                aIMeasureFootActivity.f = new File(aIMeasureFootActivity.P, "resource_2").getAbsolutePath();
                                fo.a.m(a.f.g(new StringBuilder(), aIMeasureFootActivity.f10958c, "  loadResource  loadResourceTwo"), new Object[0]);
                                aIMeasureFootActivity.m(aIMeasureFootActivity.P, "res_0915_2.zip", "resource_2", "https://apk.poizon.com/duApp/Android_Config/resource/ai_measure/res_zip/res_2_0915.zip");
                            }
                        }
                        if (Intrinsics.areEqual(str, "https://apk.poizon.com/duApp/Android_Config/resource/ai_measure/res_zip/res_2_0915.zip")) {
                            fo.a.m(a.f.g(new StringBuilder(), aIMeasureFootActivity.f10958c, " Download success into two"), new Object[0]);
                            aIMeasureFootActivity.X = true;
                            aIMeasureFootActivity.F();
                            if (!PatchProxy.proxy(new Object[0], aIMeasureFootActivity, AIMeasureFootActivity.changeQuickRedirect, false, 65979, new Class[0], Void.TYPE).isSupported) {
                                aIMeasureFootActivity.f10961g = new File(aIMeasureFootActivity.P, "resource_3").getAbsolutePath();
                                fo.a.m(a.f.g(new StringBuilder(), aIMeasureFootActivity.f10958c, "  loadResource  loadResourceThree"), new Object[0]);
                                aIMeasureFootActivity.m(aIMeasureFootActivity.P, "res_0915_3.zip", "resource_3", "https://apk.poizon.com/duApp/Android_Config/resource/ai_measure/res_zip/res_3_0915.zip");
                                aIMeasureFootActivity.m(aIMeasureFootActivity.P, "res_ms_2022_07_13.zip", "min_resource", "https://apk.poizon.com/duApp/Android_Config/resource/ai_measure/res_ms_2022_07_13.zip");
                            }
                        }
                        if (Intrinsics.areEqual(str, "https://apk.poizon.com/duApp/Android_Config/resource/ai_measure/res_zip/res_3_0915.zip")) {
                            fo.a.m(a.f.g(new StringBuilder(), aIMeasureFootActivity.f10958c, " Download success into three"), new Object[0]);
                        }
                    }
                }
            }
        }

        public h(AIMeasureFootActivity aIMeasureFootActivity, File file, File file2, String str) {
            this.b = aIMeasureFootActivity;
            this.f10974c = file;
            this.d = file2;
            this.e = str;
        }

        /* JADX WARNING: Removed duplicated region for block: B:34:0x0104 A[SYNTHETIC, Splitter:B:34:0x0104] */
        /* JADX WARNING: Removed duplicated region for block: B:40:0x012c A[SYNTHETIC, Splitter:B:40:0x012c] */
        /* JADX WARNING: Removed duplicated region for block: B:52:? A[RETURN, SYNTHETIC] */
        public final void run() {
            ZipFile zipFile;
            Throwable th2;
            Exception e6;
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 66097, new Class[0], Void.TYPE).isSupported) {
                try {
                    zipFile = new ZipFile(this.f10974c);
                    try {
                        Enumeration<? extends ZipEntry> entries = zipFile.entries();
                        while (entries.hasMoreElements()) {
                            ZipEntry zipEntry = (ZipEntry) entries.nextElement();
                            if (zipEntry.isDirectory()) {
                                new File(this.d.getAbsolutePath() + File.separator + zipEntry.getName()).mkdirs();
                            } else {
                                File file = new File(this.d.getAbsoluteFile(), zipEntry.getName());
                                if (!file.getParentFile().exists()) {
                                    file.getParentFile().mkdirs();
                                }
                                file.createNewFile();
                                InputStream inputStream = zipFile.getInputStream(zipEntry);
                                FileOutputStream fileOutputStream = new FileOutputStream(file);
                                byte[] bArr = new byte[AccessibilityEventCompat.TYPE_VIEW_TEXT_SELECTION_CHANGED];
                                for (int read = inputStream.read(bArr); read != -1; read = inputStream.read(bArr)) {
                                    fileOutputStream.write(bArr, 0, read);
                                }
                                inputStream.close();
                                fileOutputStream.close();
                            }
                        }
                        this.b.q().post(new a(this));
                        try {
                            zipFile.close();
                        } catch (Exception e12) {
                            fo.a.w(this.b.f10958c + "  exception = " + e12.getMessage(), new Object[0]);
                        }
                    } catch (Exception e13) {
                        e6 = e13;
                        try {
                            fo.a.w(this.b.f10958c + "  exception = " + e6.getMessage(), new Object[0]);
                            if (zipFile == null) {
                            }
                        } catch (Throwable th3) {
                            th2 = th3;
                            if (zipFile != null) {
                            }
                            throw th2;
                        }
                    }
                } catch (Exception e14) {
                    zipFile = null;
                    e6 = e14;
                    fo.a.w(this.b.f10958c + "  exception = " + e6.getMessage(), new Object[0]);
                    if (zipFile == null) {
                        try {
                            zipFile.close();
                        } catch (Exception e15) {
                            fo.a.w(this.b.f10958c + "  exception = " + e15.getMessage(), new Object[0]);
                        }
                    }
                } catch (Throwable th4) {
                    zipFile = null;
                    th2 = th4;
                    if (zipFile != null) {
                        try {
                            zipFile.close();
                        } catch (Exception e16) {
                            fo.a.w(this.b.f10958c + "  exception = " + e16.getMessage(), new Object[0]);
                        }
                    }
                    throw th2;
                }
            }
        }
    }

    public AIMeasureFootActivity() {
        new ArrayList();
        this.b0 = "";
        this.f10959c0 = new AIMeasureFootActivity$mOnPageChangedListener$1(this);
    }

    public static void d(AIMeasureFootActivity aIMeasureFootActivity) {
        if (!PatchProxy.proxy(new Object[0], aIMeasureFootActivity, changeQuickRedirect, false, 66006, new Class[0], Void.TYPE).isSupported) {
            super.onResume();
            IRecorder iRecorder = aIMeasureFootActivity.j;
            if (iRecorder != null) {
                iRecorder.onRecorderResume();
            }
            if (!aIMeasureFootActivity.J) {
                ((RelativeLayout) aIMeasureFootActivity._$_findCachedViewById(R.id.measure_result_layout)).setVisibility(8);
            }
        }
    }

    public static void e(AIMeasureFootActivity aIMeasureFootActivity, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, aIMeasureFootActivity, changeQuickRedirect, false, 66014, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.onCreate(bundle);
        }
    }

    public static void f(AIMeasureFootActivity aIMeasureFootActivity) {
        if (!PatchProxy.proxy(new Object[0], aIMeasureFootActivity, changeQuickRedirect, false, 66016, new Class[0], Void.TYPE).isSupported) {
            super.onStart();
        }
    }

    public static final /* synthetic */ RoleViewModel g(AIMeasureFootActivity aIMeasureFootActivity) {
        RoleViewModel roleViewModel = aIMeasureFootActivity.Y;
        if (roleViewModel == null) {
            Intrinsics.throwUninitializedPropertyAccessException("roleViewModel");
        }
        return roleViewModel;
    }

    public final void A() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 66000, new Class[0], Void.TYPE).isSupported) {
            fo.a.i(a.f.g(new StringBuilder(), this.f10958c, "  reportMeasureResult into"), new Object[0]);
            if (this.i.getMLeftSuccess() && this.i.getMRightSuccess()) {
                fo.a.m(a.f.g(new StringBuilder(), this.f10958c, " reportMeasureResult"), new Object[0]);
                MeasureFacade.postMeasureResult(this.i, this.f10962h, new e(this));
            }
        }
    }

    public final void B(int i3) {
        if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 65991, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
            fo.a.m(a.f.g(new StringBuilder(), this.f10958c, " showEditDialog"), new Object[0]);
            RoleViewModel roleViewModel = this.Y;
            if (roleViewModel == null) {
                Intrinsics.throwUninitializedPropertyAccessException("roleViewModel");
            }
            roleViewModel.p(i3);
            if (this.Z == null) {
                RoleEditDialog.a aVar = RoleEditDialog.f;
                RoleViewModel roleViewModel2 = this.Y;
                if (roleViewModel2 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("roleViewModel");
                }
                this.Z = aVar.a(roleViewModel2);
            }
            RoleEditDialog roleEditDialog = this.Z;
            if (roleEditDialog != null) {
                roleEditDialog.i(this);
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:13:0x002c, code lost:
        if (r17.E != com.shizhuang.duapp.modules.identify.ui.ai_measure.model.HumanBody.LEFT_FOOT) goto L_0x0031;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:14:0x002e, code lost:
        r1 = "左脚测量";
     */
    /* JADX WARNING: Code restructure failed: missing block: B:15:0x0031, code lost:
        r1 = "右脚测量";
     */
    /* JADX WARNING: Code restructure failed: missing block: B:16:0x0033, code lost:
        r2 = i60.a.f33292a;
        r4 = getString(com.shizhuang.duapp.R.string.guide_title_4);
        r7 = true;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:17:0x005b, code lost:
        if (com.meituan.robust.PatchProxy.proxy(new java.lang.Object[]{r4, r1}, r2, i60.a.changeQuickRedirect, false, 125175, new java.lang.Class[]{java.lang.Object.class, java.lang.Object.class}, java.lang.Void.TYPE).isSupported == false) goto L_0x005e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:18:0x005e, code lost:
        i60.b.f33293a.b("trade_ar_footmeasure_exposure", "1464", "2839", g.a.e(8, "block_content_title", r4, "page_title", r1));
     */
    /* JADX WARNING: Code restructure failed: missing block: B:19:0x0073, code lost:
        r4 = s();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:20:0x0077, code lost:
        monitor-enter(r4);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:22:?, code lost:
        r17.z = true;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:23:0x007a, code lost:
        monitor-exit(r4);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:24:0x007b, code lost:
        r11 = getString(com.shizhuang.duapp.R.string.guide_title_4);
        r12 = getString(com.shizhuang.duapp.R.string.guide_desc_4);
        r5 = new java.lang.StringBuilder();
        r5.append(r17.e);
        r9 = java.io.File.separator;
        r4 = new com.shizhuang.duapp.modules.ai_measure.model.GuideInfo(3, r11, r12, "", h6.a.q(r5, r9, "res_1", r9, "ar_footscan_guide_4.mp4"));
        r2.D(getString(com.shizhuang.duapp.R.string.guide_title_4), "播放", r1);
        r2 = n();
        r3 = (android.widget.FrameLayout) _$_findCachedViewById(com.shizhuang.duapp.R.id.panel_container);
        r5 = new com.shizhuang.duapp.modules.ai_measure.ui.AIMeasureFootActivity.f(r17, r1);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:25:0x00e4, code lost:
        if (com.meituan.robust.PatchProxy.proxy(new java.lang.Object[]{r3, r4, r5}, r2, com.shizhuang.duapp.modules.ai_measure.ui.GuidePanel.changeQuickRedirect, false, 66333, new java.lang.Class[]{android.view.ViewGroup.class, com.shizhuang.duapp.modules.ai_measure.model.GuideInfo.class, com.shizhuang.duapp.modules.ai_measure.ui.GuidePanel.GuideListener.class}, java.lang.Void.TYPE).isSupported == false) goto L_0x00e8;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:26:0x00e8, code lost:
        r2.f11011h = r5;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:27:0x00ee, code lost:
        if (r2.f11008a != null) goto L_0x01d1;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:28:0x00f0, code lost:
        r1 = (android.view.ViewGroup) android.view.LayoutInflater.from(r3.getContext()).inflate(com.shizhuang.duapp.R.layout.layout_guide_panel, r3, false);
        r6 = (android.widget.LinearLayout) r1.findViewById(com.shizhuang.duapp.R.id.guide_card);
        r2.b = r6;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:29:0x010e, code lost:
        if (r6 != null) goto L_0x0113;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:30:0x0110, code lost:
        kotlin.jvm.internal.Intrinsics.throwUninitializedPropertyAccessException("mGuideCardLayout");
     */
    /* JADX WARNING: Code restructure failed: missing block: B:31:0x0113, code lost:
        r6 = r6.getLayoutParams();
        r10 = fi.b.f32351a;
        r11 = fi.b.b;
        r12 = cw.c.f31260c;
        r14 = r12.c(320.0f, r10);
        r6.width = r14;
        r6.height = r12.b(156.0f, r11) + r14;
        r14 = r2.b;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:32:0x0131, code lost:
        if (r14 != null) goto L_0x0136;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:33:0x0133, code lost:
        kotlin.jvm.internal.Intrinsics.throwUninitializedPropertyAccessException("mGuideCardLayout");
     */
    /* JADX WARNING: Code restructure failed: missing block: B:34:0x0136, code lost:
        r14.setLayoutParams(r6);
        r6 = (com.shizhuang.duapp.modules.ai_measure.ui.TextureVideoView) r1.findViewById(com.shizhuang.duapp.R.id.guide_video);
        r2.f11009c = r6;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:35:0x0144, code lost:
        if (r6 != null) goto L_0x0149;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:36:0x0146, code lost:
        kotlin.jvm.internal.Intrinsics.throwUninitializedPropertyAccessException("mVideoView");
     */
    /* JADX WARNING: Code restructure failed: missing block: B:37:0x0149, code lost:
        r6 = r6.getLayoutParams();
        r9 = r12.c(320.0f, r10);
        r6.width = r9;
        r6.height = r9;
        r9 = r2.f11009c;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:38:0x0157, code lost:
        if (r9 != null) goto L_0x015c;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:39:0x0159, code lost:
        kotlin.jvm.internal.Intrinsics.throwUninitializedPropertyAccessException("mVideoView");
     */
    /* JADX WARNING: Code restructure failed: missing block: B:40:0x015c, code lost:
        r9.setLayoutParams(r6);
        r6 = (android.widget.LinearLayout) r1.findViewById(com.shizhuang.duapp.R.id.layout_measure_guide);
        r9 = r6.getLayoutParams();
        r9.width = r12.c(320.0f, r10);
        r9.height = r12.b(156.0f, r11);
        r6.setLayoutParams(r9);
        r2.d = (android.widget.TextView) r1.findViewById(com.shizhuang.duapp.R.id.guide_title);
        r2.e = (android.widget.TextView) r1.findViewById(com.shizhuang.duapp.R.id.guide_desc);
        r6 = r1.findViewById(com.shizhuang.duapp.R.id.iv_close);
        r2.f = r6;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:41:0x019a, code lost:
        if (r6 != null) goto L_0x01a1;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:42:0x019c, code lost:
        kotlin.jvm.internal.Intrinsics.throwUninitializedPropertyAccessException("mCloseView");
     */
    /* JADX WARNING: Code restructure failed: missing block: B:43:0x01a1, code lost:
        r6.setOnClickListener(new com.shizhuang.duapp.modules.ai_measure.ui.GuidePanel$show$1(r2));
        r6 = r2.d;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:44:0x01ab, code lost:
        if (r6 != null) goto L_0x01b2;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:45:0x01ad, code lost:
        kotlin.jvm.internal.Intrinsics.throwUninitializedPropertyAccessException("mTitleView");
     */
    /* JADX WARNING: Code restructure failed: missing block: B:46:0x01b2, code lost:
        r6.setText(r4.getMTitle());
        r6 = r2.e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:47:0x01bb, code lost:
        if (r6 != null) goto L_0x01c2;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:48:0x01bd, code lost:
        kotlin.jvm.internal.Intrinsics.throwUninitializedPropertyAccessException("mDescView");
     */
    /* JADX WARNING: Code restructure failed: missing block: B:49:0x01c2, code lost:
        r6.setText(r4.getMDesc());
        r2.f11010g = r4.getMVideoPath();
        r2.f11008a = r1;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:50:0x01d1, code lost:
        r1 = r2.f11008a;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:51:0x01d3, code lost:
        if (r1 == null) goto L_?;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:53:0x01d9, code lost:
        if (r1.getParent() == null) goto L_0x01e4;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:54:0x01db, code lost:
        ((android.view.ViewGroup) r1.getParent()).removeView(r1);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:56:0x01e9, code lost:
        if (r3.indexOfChild(r1) == -1) goto L_0x01ec;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:57:0x01ec, code lost:
        r7 = false;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:58:0x01ed, code lost:
        if (r7 != false) goto L_?;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:59:0x01ef, code lost:
        r3.addView(r2.f11008a, new android.widget.FrameLayout.LayoutParams(-1, -1));
     */
    /* JADX WARNING: Code restructure failed: missing block: B:60:0x020c, code lost:
        if (com.meituan.robust.PatchProxy.proxy(new java.lang.Object[0], r2, com.shizhuang.duapp.modules.ai_measure.ui.GuidePanel.changeQuickRedirect, false, 66335, new java.lang.Class[0], java.lang.Void.TYPE).isSupported == false) goto L_0x020f;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:62:0x0215, code lost:
        if (android.text.TextUtils.isEmpty(r2.f11010g) != false) goto L_?;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:63:0x0217, code lost:
        r0 = r2.f11009c;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:64:0x0219, code lost:
        if (r0 != null) goto L_0x021e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:65:0x021b, code lost:
        kotlin.jvm.internal.Intrinsics.throwUninitializedPropertyAccessException("mVideoView");
     */
    /* JADX WARNING: Code restructure failed: missing block: B:66:0x021e, code lost:
        r0.setVideoPath(r2.f11010g);
        r0 = r2.f11009c;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:67:0x0225, code lost:
        if (r0 != null) goto L_0x022a;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:68:0x0227, code lost:
        kotlin.jvm.internal.Intrinsics.throwUninitializedPropertyAccessException("mVideoView");
     */
    /* JADX WARNING: Code restructure failed: missing block: B:69:0x022a, code lost:
        r0.setOnCompletionListener(new dw.p(r2));
        r0 = r2.f11009c;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:70:0x0234, code lost:
        if (r0 != null) goto L_0x0239;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:71:0x0236, code lost:
        kotlin.jvm.internal.Intrinsics.throwUninitializedPropertyAccessException("mVideoView");
     */
    /* JADX WARNING: Code restructure failed: missing block: B:72:0x0239, code lost:
        r0.start();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:80:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:81:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:82:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:83:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:84:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:85:?, code lost:
        return;
     */
    public final void C() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65987, new Class[0], Void.TYPE).isSupported) {
            synchronized (s()) {
                if (!this.z) {
                    Unit unit = Unit.INSTANCE;
                }
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:12:0x002f, code lost:
        r1 = r19.getMPosition();
        ((android.widget.TextView) _$_findCachedViewById(com.shizhuang.duapp.R.id.tv_measure_foot)).setText(r19.getMTitle());
        ((android.widget.TextView) _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_text_view)).setText(r19.getMDesc());
     */
    /* JADX WARNING: Code restructure failed: missing block: B:13:0x0071, code lost:
        switch(r1) {
            case 0: goto L_0x03d7;
            case 1: goto L_0x0344;
            case 2: goto L_0x02ac;
            case 3: goto L_0x0214;
            case 4: goto L_0x0179;
            case 5: goto L_0x0119;
            case 6: goto L_0x00b9;
            case 7: goto L_0x0076;
            default: goto L_0x0074;
        };
     */
    /* JADX WARNING: Code restructure failed: missing block: B:14:0x0076, code lost:
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_1_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_2_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_3_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_4_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_5_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_6_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_7_view).setSelected(true);
        ik1.f.i(androidx.lifecycle.LifecycleOwnerKt.getLifecycleScope(r18), null, null, new com.shizhuang.duapp.modules.ai_measure.ui.AIMeasureFootActivity$showMeasureInfo$9(null), 3, null);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:15:0x00b9, code lost:
        x(r19.getMAudioPath());
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_1_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_2_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_3_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_4_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_5_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_6_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_7_view).setSelected(false);
        ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).e(android.graphics.BitmapFactory.decodeFile(r19.getMImagePath()));
        h(2);
        ik1.f.i(androidx.lifecycle.LifecycleOwnerKt.getLifecycleScope(r18), null, null, new com.shizhuang.duapp.modules.ai_measure.ui.AIMeasureFootActivity$showMeasureInfo$8(r18, null), 3, null);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:16:0x0119, code lost:
        x(r19.getMAudioPath());
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_1_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_2_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_3_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_4_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_5_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_6_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_7_view).setSelected(false);
        ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).e(android.graphics.BitmapFactory.decodeFile(r19.getMImagePath()));
        h(2);
        ik1.f.i(androidx.lifecycle.LifecycleOwnerKt.getLifecycleScope(r18), null, null, new com.shizhuang.duapp.modules.ai_measure.ui.AIMeasureFootActivity$showMeasureInfo$7(r18, null), 3, null);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:17:0x0179, code lost:
        x(r19.getMAudioPath());
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_1_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_2_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_3_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_4_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_5_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_6_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_7_view).setSelected(false);
        r3 = new kotlin.jvm.internal.Ref.ObjectRef();
        r1 = (T) ((android.widget.RelativeLayout.LayoutParams) ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).getLayoutParams());
        r3.element = r1;
        r4 = fi.b.f32351a;
        r6 = fi.b.b;
        ((android.widget.RelativeLayout.LayoutParams) r1).width = cw.c.f31260c.c(263.0f, r4);
        r1 = r3.element;
        ((android.widget.RelativeLayout.LayoutParams) r1).height = ((android.widget.RelativeLayout.LayoutParams) r1).width;
        ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).setLayoutParams(r3.element);
        ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).i(r19.getMAnimationPath()).T(1).S(new com.shizhuang.duapp.modules.ai_measure.ui.AIMeasureFootActivity.g(r18, r3, r4, r6, r19)).x();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:18:0x0214, code lost:
        x(r19.getMAudioPath());
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_1_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_2_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_3_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_4_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_5_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_6_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_7_view).setSelected(false);
        r1 = (android.widget.RelativeLayout.LayoutParams) ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).getLayoutParams();
        r1.removeRule(12);
        r1.removeRule(14);
        r2 = fi.b.f32351a;
        r3 = fi.b.b;
        r4 = cw.c.f31260c;
        r1.width = r4.c(375.0f, r2);
        r1.height = r4.b(440.0f, r3);
        r1.addRule(13, -1);
        ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).setLayoutParams(r1);
        ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).e(android.graphics.BitmapFactory.decodeFile(r19.getMImagePath()));
        h(1);
        ik1.f.i(androidx.lifecycle.LifecycleOwnerKt.getLifecycleScope(r18), null, null, new com.shizhuang.duapp.modules.ai_measure.ui.AIMeasureFootActivity$showMeasureInfo$5(r18, null), 3, null);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:19:0x02ac, code lost:
        x(r19.getMAudioPath());
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_1_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_2_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_3_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_4_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_5_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_6_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_7_view).setSelected(false);
        r1 = (android.widget.RelativeLayout.LayoutParams) ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).getLayoutParams();
        r1.removeRule(12);
        r1.removeRule(14);
        r2 = fi.b.f32351a;
        r3 = fi.b.b;
        r4 = cw.c.f31260c;
        r1.width = r4.c(375.0f, r2);
        r1.height = r4.b(440.0f, r3);
        r1.addRule(13, -1);
        ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).setLayoutParams(r1);
        ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).e(android.graphics.BitmapFactory.decodeFile(r19.getMImagePath()));
        h(1);
        ik1.f.i(androidx.lifecycle.LifecycleOwnerKt.getLifecycleScope(r18), null, null, new com.shizhuang.duapp.modules.ai_measure.ui.AIMeasureFootActivity$showMeasureInfo$4(r18, null), 3, null);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:20:0x0344, code lost:
        x(r19.getMAudioPath());
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_1_view).setSelected(true);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_2_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_3_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_4_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_5_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_6_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_7_view).setSelected(false);
        r0 = (android.widget.RelativeLayout.LayoutParams) ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).getLayoutParams();
        r0.removeRule(12);
        r0.removeRule(14);
        r1 = fi.b.f32351a;
        r2 = fi.b.b;
        r3 = cw.c.f31260c;
        r0.width = r3.c(375.0f, r1);
        r0.height = r3.b(440.0f, r2);
        r0.addRule(13, -1);
        ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).setLayoutParams(r0);
        ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).e(android.graphics.BitmapFactory.decodeFile(r19.getMImagePath()));
        ik1.f.i(androidx.lifecycle.LifecycleOwnerKt.getLifecycleScope(r18), null, null, new com.shizhuang.duapp.modules.ai_measure.ui.AIMeasureFootActivity$showMeasureInfo$3(r18, null), 3, null);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:21:0x03d7, code lost:
        x(r19.getMAudioPath());
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_1_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_2_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_3_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_4_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_5_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_6_view).setSelected(false);
        _$_findCachedViewById(com.shizhuang.duapp.R.id.progress_7_view).setSelected(false);
        r0 = (android.widget.RelativeLayout.LayoutParams) ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).getLayoutParams();
        r1 = fi.b.f32351a;
        r2 = fi.b.b;
        r3 = cw.c.f31260c;
        r0.width = r3.c(246.0f, r1);
        r0.height = r3.b(562.0f, r2);
        r0.addRule(12, -1);
        r0.addRule(14, -1);
        ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).setLayoutParams(r0);
        ((com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView) _$_findCachedViewById(com.shizhuang.duapp.R.id.measure_guide_animation)).e(android.graphics.BitmapFactory.decodeFile(r19.getMImagePath()));
        ik1.f.i(androidx.lifecycle.LifecycleOwnerKt.getLifecycleScope(r18), null, null, new com.shizhuang.duapp.modules.ai_measure.ui.AIMeasureFootActivity$showMeasureInfo$2(r18, null), 3, null);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:25:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:26:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:27:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:28:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:29:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:30:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:31:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:32:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:33:?, code lost:
        return;
     */
    public final void D(MeasureInfo measureInfo) {
        if (!PatchProxy.proxy(new Object[]{measureInfo}, this, changeQuickRedirect, false, 65995, new Class[]{MeasureInfo.class}, Void.TYPE).isSupported) {
            synchronized (s()) {
                if (!this.J) {
                    Unit unit = Unit.INSTANCE;
                }
            }
        }
    }

    public final void E(@NotNull File file, @NotNull File file2, @NotNull String str) {
        if (!PatchProxy.proxy(new Object[]{file, file2, str}, this, changeQuickRedirect, false, 66009, new Class[]{File.class, File.class, String.class}, Void.TYPE).isSupported && file.exists()) {
            if (!file2.exists()) {
                file2.mkdir();
            }
            q.a(new h(this, file, file2, str));
        }
    }

    public final void F() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65983, new Class[0], Void.TYPE).isSupported) {
            if (Intrinsics.areEqual(this.f, "") || !this.R) {
                fo.a.m(a.f.g(new StringBuilder(), this.f10958c, "  updateModel return err1"), new Object[0]);
            } else if (!this.X) {
                fo.a.m(a.f.g(new StringBuilder(), this.f10958c, "  updateModel return err2"), new Object[0]);
            } else if (this.w.isInit()) {
                fo.a.m(a.f.g(new StringBuilder(), this.f10958c, "  updateModel hasInit"), new Object[0]);
            } else {
                this.w.createInstance();
                DuFootModel duFootModel = this.w;
                StringBuilder sb2 = new StringBuilder();
                sb2.append(this.f);
                String str = File.separator;
                String q8 = h6.a.q(sb2, str, "res_2", str, "FootModel_v1.0.2.bin");
                StringBuilder sb3 = new StringBuilder();
                h.b.u(sb3, this.f, str, "res_2", str);
                sb3.append("460x460mm.json");
                String sb4 = sb3.toString();
                StringBuilder sb5 = new StringBuilder();
                h.b.u(sb5, this.f, str, "res_2", str);
                sb5.append("nanodet_3_14.mnn");
                String sb6 = sb5.toString();
                StringBuilder sb7 = new StringBuilder();
                h.b.u(sb7, this.f, str, "res_2", str);
                sb7.append("hexagon0309_48_48-e0d29c14.mnn");
                String sb8 = sb7.toString();
                StringBuilder sb9 = new StringBuilder();
                h.b.u(sb9, this.f, str, "res_2", str);
                sb9.append("foot-bisenetv2-352-160-20220523-1.mnn");
                duFootModel.createWithFootModelPath(q8, sb4, sb6, sb8, sb9.toString());
                StringBuilder sb10 = new StringBuilder();
                h.b.u(sb10, this.f, str, "res_2", str);
                sb10.append("foot-bisenetv2-352-160-20220523-1.mnn");
                if (i.t(sb10.toString())) {
                    fo.a.m(a.f.g(new StringBuilder(), this.f10958c, "  footSegPath exists"), new Object[0]);
                }
                this.Q = true;
                ((TextView) _$_findCachedViewById(R.id.tv_tips_text)).setVisibility(0);
                ((TextView) _$_findCachedViewById(R.id.tv_tips_text)).setOnClickListener(new AIMeasureFootActivity$updateModel$1(this));
            }
        }
    }

    public View _$_findCachedViewById(int i3) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 66011, new Class[]{Integer.TYPE}, View.class);
        if (proxy.isSupported) {
            return (View) proxy.result;
        }
        if (this.f10960d0 == null) {
            this.f10960d0 = new HashMap();
        }
        View view = (View) this.f10960d0.get(Integer.valueOf(i3));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i3);
        this.f10960d0.put(Integer.valueOf(i3), findViewById);
        return findViewById;
    }

    @Override // com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    public int getLayout() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65971, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.activity_ai_measure_foot;
    }

    public final void h(int i3) {
        boolean z4 = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 65996, new Class[]{Integer.TYPE}, Void.TYPE).isSupported;
    }

    public final void i() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65997, new Class[0], Void.TYPE).isSupported) {
            fo.a.m(this.f10958c + "  buildFootModel left=" + o().size() + ", right=" + t().size(), new Object[0]);
            ((FrameLayout) _$_findCachedViewById(R.id.measure_operate_layout)).setVisibility(8);
            ((RelativeLayout) _$_findCachedViewById(R.id.measure_result_layout)).setVisibility(0);
            StringBuilder sb2 = new StringBuilder();
            sb2.append(this.f10961g);
            String str = File.separator;
            if (new File(h6.a.q(sb2, str, "res_3", str, "foot_build_loading.apng")).exists()) {
                StringBuilder sb3 = new StringBuilder();
                h.b.u(sb3, this.f10961g, str, "res_3", str);
                sb3.append("foot_build_loading.apng");
                ((DuImageLoaderView) _$_findCachedViewById(R.id.image_result_loading)).i(sb3.toString()).x();
            }
            if (!PatchProxy.proxy(new Object[]{"足部测量报告"}, i60.a.f33292a, i60.a.changeQuickRedirect, false, 125183, new Class[]{Object.class}, Void.TYPE).isSupported) {
                i60.b.f33293a.b("trade_ar_footmeasure_pageview", "1469", "", j.e(8, "block_content_title", "足部测量报告"));
            }
            q.a(new AIMeasureFootActivity$buildFootModel$1(this));
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    public void initData() {
        boolean z4 = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65972, new Class[0], Void.TYPE).isSupported;
    }

    @Override // com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    public void initView(@org.jetbrains.annotations.Nullable Bundle bundle) {
        String str;
        String str2;
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 65984, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            RoleViewModel roleViewModel = new RoleViewModel();
            this.Y = roleViewModel;
            roleViewModel.fetchData();
            i60.a aVar = i60.a.f33292a;
            if (!PatchProxy.proxy(new Object[0], aVar, i60.a.changeQuickRedirect, false, 125172, new Class[0], Void.TYPE).isSupported) {
                a1.a.j(8, i60.b.f33293a, "trade_ar_footmeasure_pageview", "1462", "");
            }
            if (!getIntent().hasExtra("fromPage")) {
                fo.a.m(a.f.g(new StringBuilder(), this.f10958c, " has not sourcePage"), new Object[0]);
            } else {
                fo.a.m(a.f.g(new StringBuilder(), this.f10958c, " has sourcePage"), new Object[0]);
                Bundle extras = getIntent().getExtras();
                Object obj = null;
                if (Intrinsics.areEqual("PageViewPage", (String) (extras != null ? extras.get("fromPage") : null))) {
                    UserInfo userInfo = this.i;
                    Bundle extras2 = getIntent().getExtras();
                    userInfo.setMRole(((Integer) (extras2 != null ? extras2.get("roleId") : null)).intValue());
                    UserInfo userInfo2 = this.i;
                    Bundle extras3 = getIntent().getExtras();
                    userInfo2.setMRoleName((String) (extras3 != null ? extras3.get("roleName") : null));
                    UserInfo userInfo3 = this.i;
                    Bundle extras4 = getIntent().getExtras();
                    userInfo3.setMRoleSex(((Integer) (extras4 != null ? extras4.get("roleSex") : null)).intValue());
                    UserInfo userInfo4 = this.i;
                    Bundle extras5 = getIntent().getExtras();
                    userInfo4.setMModifyId(((Integer) (extras5 != null ? extras5.get("dataId") : null)).intValue());
                    Bundle extras6 = getIntent().getExtras();
                    if (extras6 != null) {
                        obj = extras6.get("reportId");
                    }
                    this.S = ((Integer) obj).intValue();
                    this.V = true;
                }
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65976, new Class[0], Void.TYPE).isSupported) {
                String str3 = "其他";
                if (getIntent() != null) {
                    String stringExtra = getIntent().getStringExtra("sourcePage");
                    if (stringExtra != null) {
                        int hashCode = stringExtra.hashCode();
                        if (hashCode != -1033001697) {
                            if (hashCode == -255109663 && stringExtra.equals("measureReportPage")) {
                                str2 = "测量报告";
                            }
                        } else if (stringExtra.equals("orCodePage")) {
                            str2 = "二维码";
                        }
                        str3 = str2;
                    }
                    if (getIntent().hasExtra("source")) {
                        String stringExtra2 = getIntent().getStringExtra("source");
                        if (stringExtra2 == null) {
                            stringExtra2 = "";
                        }
                        this.f10962h = stringExtra2;
                    }
                }
                aVar.T(str3);
                this.N = this;
                File externalFilesDir = getContext().getExternalFilesDir("ar_measure");
                if (externalFilesDir == null || (str = externalFilesDir.getPath()) == null) {
                    str = "";
                }
                this.P = str;
                this.d = str;
            }
            RoleViewModel roleViewModel2 = this.Y;
            if (roleViewModel2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("roleViewModel");
            }
            roleViewModel2.g().observe(this, new AIMeasureFootActivity$initView$1(this));
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65980, new Class[0], Void.TYPE).isSupported) {
                fo.a.m(a.f.g(new StringBuilder(), this.f10958c, "  initViewCamera"), new Object[0]);
                this.N = this;
                getWindow().addFlags(128);
                ViewGroup.LayoutParams layoutParams = ((ViewPager) _$_findCachedViewById(R.id.guide_pager)).getLayoutParams();
                int i3 = fi.b.f32351a;
                int i12 = fi.b.b;
                c.a aVar2 = cw.c.f31260c;
                int c5 = aVar2.c(300.0f, i3);
                layoutParams.width = c5;
                layoutParams.height = aVar2.b(154.0f, i12) + c5;
                ((ViewPager) _$_findCachedViewById(R.id.guide_pager)).setLayoutParams(layoutParams);
                ViewGroup.LayoutParams layoutParams2 = ((ImageView) _$_findCachedViewById(R.id.iv_close)).getLayoutParams();
                int c12 = aVar2.c(25.0f, i3);
                layoutParams2.width = c12;
                layoutParams2.height = c12;
                ((ImageView) _$_findCachedViewById(R.id.iv_close)).setLayoutParams(layoutParams2);
                this.J = false;
                fo.a.m(a.f.g(new StringBuilder(), this.f10958c, "  loadResourceOne first resource"), new Object[0]);
                if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65977, new Class[0], Void.TYPE).isSupported) {
                    this.e = new File(this.P, "resource_1").getAbsolutePath();
                    fo.a.m(a.f.g(new StringBuilder(), this.f10958c, "  loadResource"), new Object[0]);
                    m(this.P, "res_0915_1.zip", "resource_1", "https://apk.poizon.com/duApp/Android_Config/resource/ai_measure/res_zip/res_1_0915.zip");
                }
                o oVar = new o(this, new AIMeasureFootActivity$initViewCamera$1(this), new AIMeasureFootActivity$initViewCamera$2(this));
                if (!PatchProxy.proxy(new Object[0], oVar, o.changeQuickRedirect, false, 66305, new Class[0], Void.TYPE).isSupported) {
                    oVar.f31615a.b("android.permission.CAMERA", "android.permission.WRITE_EXTERNAL_STORAGE").subscribe(new n(oVar));
                }
            }
            if (this.b0.equals("")) {
                ((ARChangeView) _$_findCachedViewById(R.id.arChangeView)).setVisibility(8);
            } else if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65985, new Class[0], Void.TYPE).isSupported) {
                ((ARChangeView) _$_findCachedViewById(R.id.arChangeView)).setVisibility(0);
                ((ARChangeView) _$_findCachedViewById(R.id.arChangeView)).setSelectId(2);
                ((ARChangeView) _$_findCachedViewById(R.id.arChangeView)).setExpandClick(new AIMeasureFootActivity$initChange$1(this));
                ((ARChangeView) _$_findCachedViewById(R.id.arChangeView)).setItemClick(new AIMeasureFootActivity$initChange$2(this));
            }
        }
    }

    public final void j(int i3) {
        if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 65998, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
            ArrayList arrayList = new ArrayList();
            CollectionsKt___CollectionsKt.toMutableList((Collection) arrayList);
            JsonArray jsonArray = new JsonArray();
            JsonObject jsonObject = new JsonObject();
            if (i3 == 0) {
                int size = o().size();
                for (int i12 = 0; i12 < size; i12++) {
                    arrayList.add(BitmapFactory.decodeFile(o().get(i12).getMImagePath()));
                    try {
                        jsonArray.add(o().get(i12).getMHexagons());
                    } catch (Exception e6) {
                        e6.printStackTrace();
                        l(arrayList);
                        return;
                    }
                }
            } else {
                int size2 = t().size();
                for (int i13 = 0; i13 < size2; i13++) {
                    arrayList.add(BitmapFactory.decodeFile(t().get(i13).getMImagePath()));
                    try {
                        jsonArray.add(t().get(i13).getMHexagons());
                    } catch (Exception e12) {
                        e12.printStackTrace();
                        l(arrayList);
                        return;
                    }
                }
            }
            try {
                jsonObject.add("frames", jsonArray);
                this.w.buildFootWithSide(i3, (Bitmap[]) arrayList.toArray(new Bitmap[0]), jsonObject.toString(), a.f10966a);
                l(arrayList);
            } catch (Exception e13) {
                e13.printStackTrace();
                l(arrayList);
            }
        }
    }

    public final void k() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65993, new Class[0], Void.TYPE).isSupported) {
            ArrayList arrayList = new ArrayList();
            CollectionsKt___CollectionsKt.toMutableList((Collection) arrayList);
            Iterator<MeasureItemResult> it2 = o().iterator();
            while (it2.hasNext()) {
                arrayList.add(it2.next().getMImagePath());
            }
            Iterator<MeasureItemResult> it3 = t().iterator();
            while (it3.hasNext()) {
                arrayList.add(it3.next().getMImagePath());
            }
            cw.a.b().a(arrayList);
        }
    }

    public final void l(List<Bitmap> list) {
        if (!PatchProxy.proxy(new Object[]{list}, this, changeQuickRedirect, false, 65999, new Class[]{List.class}, Void.TYPE).isSupported) {
            int size = list.size();
            for (int i3 = 0; i3 < size; i3++) {
                Bitmap bitmap = list.get(i3);
                if (bitmap != null) {
                    bitmap.recycle();
                }
            }
            list.clear();
        }
    }

    public final void m(String str, String str2, String str3, String str4) {
        boolean z4 = false;
        if (!PatchProxy.proxy(new Object[]{str, str2, str3, str4}, this, changeQuickRedirect, false, 65974, new Class[]{String.class, String.class, String.class, String.class}, Void.TYPE).isSupported) {
            StringBuilder sb2 = new StringBuilder();
            h.b.u(sb2, this.f10958c, "  downloadMinResourceWithType parentDir=", str, " zipName=");
            h.b.u(sb2, str2, "   fileName=", str3, " resUrl=");
            sb2.append(str4);
            fo.a.m(sb2.toString(), new Object[0]);
            if (str.length() > 0) {
                z4 = true;
            }
            if (z4) {
                ViewExtensionKt.o((TextView) _$_findCachedViewById(R.id.load_id));
                File file = new File(str, str2);
                File file2 = new File(str, str3);
                if (file.exists()) {
                    E(file, file2, str4);
                    ViewExtensionKt.k((TextView) _$_findCachedViewById(R.id.load_id));
                    return;
                }
                tl.a.r(str4, str, str2, new b(this, file, file2, str4, this));
            }
        }
    }

    public final GuidePanel n() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65962, new Class[0], GuidePanel.class);
        return (GuidePanel) (proxy.isSupported ? proxy.result : this.f10964u.getValue());
    }

    public final ArrayList<MeasureItemResult> o() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65965, new Class[0], ArrayList.class);
        return (ArrayList) (proxy.isSupported ? proxy.result : this.A.getValue());
    }

    @Override // androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onCreate(Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 66013, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.ActivityMethodWeaver_onCreate(this, bundle);
        }
    }

    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onDestroy() {
        DuFootModel duFootModel;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 66008, new Class[0], Void.TYPE).isSupported) {
            super.onDestroy();
            getWindow().clearFlags(128);
            w().cancel();
            MediaPlayer mediaPlayer = this.t;
            if (mediaPlayer != null) {
                mediaPlayer.stop();
            }
            MediaPlayer mediaPlayer2 = this.t;
            if (mediaPlayer2 != null) {
                mediaPlayer2.release();
            }
            DuFootModel duFootModel2 = this.w;
            if ((duFootModel2 != null ? Boolean.valueOf(duFootModel2.isInit()) : null).booleanValue() && (duFootModel = this.w) != null) {
                duFootModel.releaseInstance();
            }
            IRecorder iRecorder = this.j;
            if (iRecorder != null) {
                iRecorder.onRecorderDestroy();
            }
            ((ViewPager) _$_findCachedViewById(R.id.guide_pager)).removeOnPageChangeListener(this.f10959c0);
        }
    }

    @Override // androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onPause() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 66007, new Class[0], Void.TYPE).isSupported) {
            super.onPause();
            IRecorder iRecorder = this.j;
            if (iRecorder != null) {
                iRecorder.onRecorderPause();
            }
        }
    }

    @Override // androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onResume() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 66005, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.ActivityMethodWeaver_onResume(this);
        }
    }

    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onStart() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 66015, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.ActivityMethodWeaver_onStart(this);
        }
    }

    public final ArrayList<MeasureInfo> p() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65967, new Class[0], ArrayList.class);
        return (ArrayList) (proxy.isSupported ? proxy.result : this.C.getValue());
    }

    public final Handler q() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65970, new Class[0], Handler.class);
        return (Handler) (proxy.isSupported ? proxy.result : this.M.getValue());
    }

    public final dw.q r() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65963, new Class[0], dw.q.class);
        return (dw.q) (proxy.isSupported ? proxy.result : this.f10965v.getValue());
    }

    public final Object s() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65964, new Class[0], Object.class);
        return proxy.isSupported ? proxy.result : this.x.getValue();
    }

    public final ArrayList<MeasureItemResult> t() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65966, new Class[0], ArrayList.class);
        return (ArrayList) (proxy.isSupported ? proxy.result : this.B.getValue());
    }

    public final ArrayList<MeasureInfo> u() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65968, new Class[0], ArrayList.class);
        return (ArrayList) (proxy.isSupported ? proxy.result : this.D.getValue());
    }

    public final ArrayList<String> v() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65961, new Class[0], ArrayList.class);
        return (ArrayList) (proxy.isSupported ? proxy.result : this.o.getValue());
    }

    public final Timer w() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 65969, new Class[0], Timer.class);
        return (Timer) (proxy.isSupported ? proxy.result : this.L.getValue());
    }

    public final void x(String str) {
        Unit unit;
        if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 66004, new Class[]{String.class}, Void.TYPE).isSupported && !TextUtils.isEmpty(str)) {
            MediaPlayer mediaPlayer = this.t;
            if (mediaPlayer == null) {
                this.t = new MediaPlayer();
            } else if (mediaPlayer != null) {
                mediaPlayer.reset();
            }
            try {
                Result.Companion companion = Result.Companion;
                MediaPlayer mediaPlayer2 = this.t;
                if (mediaPlayer2 != null) {
                    mediaPlayer2.setDataSource(str);
                }
                MediaPlayer mediaPlayer3 = this.t;
                if (mediaPlayer3 != null) {
                    mediaPlayer3.setLooping(false);
                }
                MediaPlayer mediaPlayer4 = this.t;
                if (mediaPlayer4 != null) {
                    mediaPlayer4.prepare();
                }
                MediaPlayer mediaPlayer5 = this.t;
                if (mediaPlayer5 != null) {
                    mediaPlayer5.setOnPreparedListener(c.f10969a);
                    unit = Unit.INSTANCE;
                } else {
                    unit = null;
                }
                Result.m822constructorimpl(unit);
            } catch (Throwable th2) {
                Result.Companion companion2 = Result.Companion;
                Result.m822constructorimpl(ResultKt.createFailure(th2));
            }
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:101:0x0338 A[SYNTHETIC, Splitter:B:101:0x0338] */
    /* JADX WARNING: Removed duplicated region for block: B:107:0x0362  */
    /* JADX WARNING: Removed duplicated region for block: B:128:0x03ad  */
    /* JADX WARNING: Removed duplicated region for block: B:142:0x03d5 A[SYNTHETIC, Splitter:B:142:0x03d5] */
    public final void y(Bitmap bitmap) {
        int i3;
        int i12;
        String str;
        boolean z4;
        FileOutputStream fileOutputStream;
        Throwable th2;
        Throwable th3;
        Exception e6;
        if (!PatchProxy.proxy(new Object[]{bitmap}, this, changeQuickRedirect, false, 65989, new Class[]{Bitmap.class}, Void.TYPE).isSupported) {
            synchronized (s()) {
                this.G = false;
                Unit unit = Unit.INSTANCE;
            }
            double motionBlurWithImageFloat = this.w.motionBlurWithImageFloat(bitmap);
            fo.a.m(this.f10958c + " motionBlurWithImage ret=" + motionBlurWithImageFloat, new Object[0]);
            if (motionBlurWithImageFloat > 4.5d) {
                this.w.inferHexagonWithImage(bitmap);
                String centerPoint = this.w.getCenterPoint();
                c.a aVar = cw.c.f31260c;
                PatchProxyResult proxy = PatchProxy.proxy(new Object[]{centerPoint}, aVar, c.a.changeQuickRedirect, false, 65555, new Class[]{String.class}, Integer.TYPE);
                if (proxy.isSupported) {
                    i3 = ((Integer) proxy.result).intValue();
                } else {
                    if (!TextUtils.isEmpty(centerPoint)) {
                        try {
                            Object obj = new JSONObject(centerPoint).get("hexagons");
                            if (!TextUtils.isEmpty(obj.toString())) {
                                i3 = aVar.a(obj.toString(), ":");
                            }
                        } catch (Exception unused) {
                        }
                    }
                    i3 = 0;
                }
                fo.a.m(this.f10958c + " processFrame inferHexagonWithImage size=" + i3, new Object[0]);
                if (i3 > 12) {
                    Ref.IntRef intRef = new Ref.IntRef();
                    synchronized (s()) {
                        i12 = this.y;
                        intRef.element = i12;
                        Unit unit2 = Unit.INSTANCE;
                    }
                    if (i12 >= 0) {
                        float f12 = (this.n / 3.1415927f) * ((float) 180);
                        int width = bitmap.getWidth();
                        int height = bitmap.getHeight();
                        double d12 = ((((double) width) * 1.7777777777777777d) - ((double) height)) / ((double) 2);
                        StringBuilder sb2 = new StringBuilder();
                        sb2.append(this.f10958c);
                        sb2.append(" processFrame mPreviewWidth=");
                        sb2.append(this.l);
                        sb2.append(" mPreviewHeight=");
                        h.b.t(sb2, this.m, " width=", width, " height=");
                        sb2.append(height);
                        sb2.append(" catYSize=");
                        sb2.append(d12);
                        fo.a.m(sb2.toString(), new Object[0]);
                        int cameraPosition = this.w.cameraPosition(centerPoint, (double) -1, (double) f12, d12 < ((double) 0) ? 0.0d : d12, intRef.element, width, height);
                        fo.a.m(this.f10958c + " cameraPosition  currentPosition=" + intRef.element + "  positionResult=" + cameraPosition, new Object[0]);
                        if (cameraPosition == 0) {
                            HumanBody humanBody = this.E;
                            HumanBody humanBody2 = HumanBody.LEFT_FOOT;
                            if (humanBody == humanBody2) {
                                if (o().size() > intRef.element) {
                                    synchronized (s()) {
                                        this.G = true;
                                    }
                                    return;
                                }
                            } else if (t().size() > intRef.element) {
                                synchronized (s()) {
                                    this.G = true;
                                }
                                return;
                            }
                            MeasureItemResult measureItemResult = new MeasureItemResult(0, 0, null, 0, 0, null, null, 127, null);
                            measureItemResult.setMIndex(intRef.element);
                            if (this.E == humanBody2) {
                                measureItemResult.setMSide(0);
                            } else {
                                measureItemResult.setMSide(1);
                            }
                            measureItemResult.setMPosition(intRef.element);
                            measureItemResult.setMSize(i3);
                            measureItemResult.setMHexagons(centerPoint);
                            StringBuilder sb3 = new StringBuilder();
                            sb3.append(this.d);
                            String str2 = File.separator;
                            StringBuilder h12 = a.f.h(a01.a.i(sb3, str2, "frames", str2));
                            if (this.E == humanBody2) {
                                StringBuilder h13 = a.f.h("frame_left_");
                                h13.append(intRef.element);
                                h13.append('-');
                                h13.append(System.currentTimeMillis());
                                h13.append(".jpg");
                                str = h13.toString();
                            } else {
                                StringBuilder h14 = a.f.h("frame_right_");
                                h14.append(intRef.element);
                                h14.append('-');
                                h14.append(System.currentTimeMillis());
                                h14.append(".jpg");
                                str = h14.toString();
                            }
                            h12.append(str);
                            String sb4 = h12.toString();
                            PatchProxyResult proxy2 = PatchProxy.proxy(new Object[]{bitmap, sb4}, this, changeQuickRedirect, false, 65992, new Class[]{Bitmap.class, String.class}, Boolean.TYPE);
                            FileOutputStream fileOutputStream2 = null;
                            if (proxy2.isSupported) {
                                z4 = ((Boolean) proxy2.result).booleanValue();
                            } else {
                                StringBuilder sb5 = new StringBuilder();
                                sb5.append(this.f10958c);
                                sb5.append(" saveBitmap width=");
                                sb5.append(bitmap.getWidth());
                                sb5.append(", height=");
                                sb5.append(bitmap.getHeight());
                                fo.a.m(a.f.g(sb5, ", path=", sb4), new Object[0]);
                                try {
                                    File file = new File(sb4);
                                    if (file.exists()) {
                                        ki.a.a(file);
                                    }
                                    if (!file.getParentFile().exists()) {
                                        file.getParentFile().mkdir();
                                    }
                                    fileOutputStream = new FileOutputStream(file);
                                    try {
                                        bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fileOutputStream);
                                        fileOutputStream.flush();
                                        try {
                                            fileOutputStream.close();
                                        } catch (Exception e12) {
                                            e12.printStackTrace();
                                            fo.a.i(this.f10958c + "  saveBitmap Exception2 is " + e12.getMessage(), new Object[0]);
                                        }
                                        z4 = true;
                                    } catch (Exception e13) {
                                        e6 = e13;
                                        try {
                                            e6.printStackTrace();
                                            fo.a.i(this.f10958c + "  saveBitmap Exception is " + e6.getMessage(), new Object[0]);
                                            if (fileOutputStream != null) {
                                            }
                                            z4 = false;
                                            if (z4) {
                                            }
                                        } catch (Throwable th4) {
                                            th3 = th4;
                                            fileOutputStream2 = fileOutputStream;
                                            th2 = th3;
                                            fileOutputStream = fileOutputStream2;
                                            if (fileOutputStream != null) {
                                            }
                                            throw th2;
                                        }
                                    } catch (Throwable th5) {
                                        th2 = th5;
                                        if (fileOutputStream != null) {
                                        }
                                        throw th2;
                                    }
                                } catch (Exception e14) {
                                    e6 = e14;
                                    fileOutputStream = null;
                                    e6.printStackTrace();
                                    fo.a.i(this.f10958c + "  saveBitmap Exception is " + e6.getMessage(), new Object[0]);
                                    if (fileOutputStream != null) {
                                        try {
                                            fileOutputStream.close();
                                        } catch (Exception e15) {
                                            e15.printStackTrace();
                                            fo.a.i(this.f10958c + "  saveBitmap Exception2 is " + e15.getMessage(), new Object[0]);
                                        }
                                    }
                                    z4 = false;
                                    if (z4) {
                                    }
                                } catch (Throwable th6) {
                                    th3 = th6;
                                    th2 = th3;
                                    fileOutputStream = fileOutputStream2;
                                    if (fileOutputStream != null) {
                                        try {
                                            fileOutputStream.close();
                                        } catch (Exception e16) {
                                            e16.printStackTrace();
                                            fo.a.i(this.f10958c + "  saveBitmap Exception2 is " + e16.getMessage(), new Object[0]);
                                        }
                                    }
                                    throw th2;
                                }
                            }
                            if (z4) {
                                measureItemResult.setMImagePath(sb4);
                                if (this.E == HumanBody.LEFT_FOOT) {
                                    o().add(measureItemResult);
                                } else {
                                    t().add(measureItemResult);
                                }
                                synchronized (s()) {
                                    this.I = System.currentTimeMillis();
                                    Unit unit3 = Unit.INSTANCE;
                                }
                                synchronized (s()) {
                                    intRef.element++;
                                }
                                ik1.f.i(LifecycleOwnerKt.getLifecycleScope(this), null, null, new AIMeasureFootActivity$processFrame$8(this, intRef, null), 3, null);
                                return;
                            }
                            fo.a.i(a.f.g(new StringBuilder(), this.f10958c, "  saveBitmap failed"), new Object[0]);
                            synchronized (s()) {
                                this.G = true;
                                Unit unit4 = Unit.INSTANCE;
                            }
                            return;
                        }
                        synchronized (s()) {
                            this.G = true;
                        }
                        return;
                    }
                    return;
                }
                synchronized (s()) {
                    this.G = true;
                    Unit unit5 = Unit.INSTANCE;
                }
                return;
            }
            synchronized (s()) {
                this.G = true;
            }
        }
    }

    public final void z() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 66001, new Class[0], Void.TYPE).isSupported) {
            int i3 = this.S;
            RoleViewModel roleViewModel = this.Y;
            if (roleViewModel == null) {
                Intrinsics.throwUninitializedPropertyAccessException("roleViewModel");
            }
            int mRole = roleViewModel.c().getMRole();
            RoleViewModel roleViewModel2 = this.Y;
            if (roleViewModel2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("roleViewModel");
            }
            int mRoleSex = roleViewModel2.c().getMRoleSex();
            RoleViewModel roleViewModel3 = this.Y;
            if (roleViewModel3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("roleViewModel");
            }
            roleViewModel3.c().getMModifyId();
            if (this.W) {
                RoleViewModel roleViewModel4 = this.Y;
                if (roleViewModel4 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("roleViewModel");
                }
                mRole = roleViewModel4.b().getMRole();
                RoleViewModel roleViewModel5 = this.Y;
                if (roleViewModel5 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("roleViewModel");
                }
                mRoleSex = roleViewModel5.b().getMRoleSex();
                RoleViewModel roleViewModel6 = this.Y;
                if (roleViewModel6 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("roleViewModel");
                }
                roleViewModel6.b().getMModifyId();
            }
            if (this.V) {
                mRole = this.i.getMRole();
                mRoleSex = this.i.getMRoleSex();
                this.i.getMModifyId();
            }
            boolean z4 = this.T;
            if ((z4 && this.U) || (z4 && this.V)) {
                ArrayList arrayList = new ArrayList();
                arrayList.add(Integer.valueOf(i3));
                arrayList.add(Integer.valueOf(mRole));
                arrayList.add(Integer.valueOf(mRoleSex));
                arrayList.add(0);
                fo.a.i(this.f10958c + "  postUpdateRoleSize measureResultList = " + arrayList, new Object[0]);
                MeasureFacade.postUpdateRoleSize(arrayList, new d(this, i3));
            }
        }
    }
}