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


package com.shizhuang.duapp.media.record;

import a.f;
import android.app.Activity;
import android.content.Context;
import android.graphics.Rect;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.core.view.ViewKt;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import com.knightboost.weaver.api.Scope;
import com.knightboost.weaver.api.annotations.Insert;
import com.knightboost.weaver.api.annotations.TargetClass;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.meizu.cloud.pushsdk.constants.PushConstants;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.sensorsdata.analytics.android.sdk.autotrack.aop.FragmentTrackHelper;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.extension.ViewModelLifecycleAwareLazy;
import com.shizhuang.duapp.common.widget.shapeview.ShapeConstraintLayout;
import com.shizhuang.duapp.libs.arface.Manifest;
import com.shizhuang.duapp.libs.bpm.BM;
import com.shizhuang.duapp.media.model.EffectCategoryItemModel;
import com.shizhuang.duapp.media.model.EffectDataModel;
import com.shizhuang.duapp.media.publish.helper.MediaPermissionHelper;
import com.shizhuang.duapp.media.publish.ui.viewmodel.PublishNavigationViewModel;
import com.shizhuang.duapp.media.record.service.ArEffectServce;
import com.shizhuang.duapp.media.record.service.IArEffectService;
import com.shizhuang.duapp.stream.util.ResourceHelper;
import com.shizhuang.duapp.vesdk.IServiceManager;
import com.shizhuang.duapp.vesdk.IVEContainer;
import com.shizhuang.duapp.vesdk.VEConfig;
import com.shizhuang.duapp.vesdk.service.ar.ArRecordService;
import com.shizhuang.duapp.vesdk.service.ar.GoogleArCoreService;
import com.shizhuang.duapp.vesdk.service.ar.IGoogleArCoreService;
import com.shizhuang.duapp.vesdk.service.record.IRecordCoreService;
import com.shizhuang.duapp.vesdk.service.record.RecordCoreService;
import com.shizhuang.duapp.vesdk.utils.ArfaceHelper;
import com.shizhuang.media.camera.Facing;
import df.q;
import fd.n;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.TuplesKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import org.jetbrains.annotations.NotNull;
import rd.l;
import td.s;

@RequiresApi(24)
@Metadata(bv = {}, d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0007\b\u0007\u0018\u00002\u00020\u0001:\u0001\fB\u0007¢\u0006\u0004\b\n\u0010\u000bJ\u001a\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0003\u001a\u00020\u00022\b\u0010\u0005\u001a\u0004\u0018\u00010\u0004H\u0016J\b\u0010\b\u001a\u00020\u0006H\u0016J\b\u0010\t\u001a\u00020\u0006H\u0016¨\u0006\r"}, d2 = {"Lcom/shizhuang/duapp/media/record/ArFaceFragment;", "Landroidx/fragment/app/Fragment;", "Landroid/view/View;", "view", "Landroid/os/Bundle;", "savedInstanceState", "", "onViewCreated", "onResume", "onPause", "<init>", "()V", "a", "du_media_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: ArFaceFragment.kt */
public final class ArFaceFragment extends Fragment {
    public static ChangeQuickRedirect changeQuickRedirect;
    @NotNull
    public static final a i = new a(null);
    public IVEContainer b;

    /* renamed from: c  reason: collision with root package name */
    public IRecordCoreService f10294c;
    public IGoogleArCoreService d;
    public IArEffectService e;
    public long f;

    /* renamed from: g  reason: collision with root package name */
    public final Lazy f10295g = new ViewModelLifecycleAwareLazy(this, new ArFaceFragment$$special$$inlined$duActivityViewModel$1(this));

    /* renamed from: h  reason: collision with root package name */
    public HashMap f10296h;

    public class _boostWeave {
        public static ChangeQuickRedirect changeQuickRedirect;

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onCreate")
        @Keep
        public static void FragmentMethodWeaver_onCreate(ArFaceFragment arFaceFragment, Bundle bundle) {
            if (!PatchProxy.proxy(new Object[]{arFaceFragment, bundle}, null, changeQuickRedirect, true, 49995, new Class[]{ArFaceFragment.class, Bundle.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                ArFaceFragment.a(arFaceFragment, bundle);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (arFaceFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.media.record.ArFaceFragment")) {
                    jn.b.f34396a.fragmentOnCreateMethod(arFaceFragment, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onCreateView")
        @Keep
        public static View FragmentMethodWeaver_onCreateView(@NonNull ArFaceFragment arFaceFragment, @Nullable LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, Bundle bundle) {
            View onCreateView;
            PatchProxyResult proxy = PatchProxy.proxy(new Object[]{arFaceFragment, layoutInflater, viewGroup, bundle}, null, changeQuickRedirect, true, 49996, new Class[]{ArFaceFragment.class, LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
            if (proxy.isSupported) {
                return (View) proxy.result;
            }
            long currentTimeMillis = System.currentTimeMillis();
            ChangeQuickRedirect changeQuickRedirect2 = ArFaceFragment.changeQuickRedirect;
            PatchProxyResult proxy2 = PatchProxy.proxy(new Object[]{layoutInflater, viewGroup, bundle}, arFaceFragment, ArFaceFragment.changeQuickRedirect, false, 49974, new Class[]{LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
            if (proxy2.isSupported) {
                onCreateView = (View) proxy2.result;
            } else {
                IVEContainer iVEContainer = arFaceFragment.b;
                onCreateView = iVEContainer != null ? iVEContainer.onCreateView(viewGroup, bundle) : null;
            }
            long currentTimeMillis2 = System.currentTimeMillis();
            if (arFaceFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.media.record.ArFaceFragment")) {
                jn.b.f34396a.fragmentOnCreateViewMethod(arFaceFragment, currentTimeMillis, currentTimeMillis2);
            }
            return onCreateView;
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onResume")
        @Keep
        public static void FragmentMethodWeaver_onResume(ArFaceFragment arFaceFragment) {
            if (!PatchProxy.proxy(new Object[]{arFaceFragment}, null, changeQuickRedirect, true, 49998, new Class[]{ArFaceFragment.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                ArFaceFragment.b(arFaceFragment);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (arFaceFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.media.record.ArFaceFragment")) {
                    jn.b.f34396a.fragmentOnResumeMethod(arFaceFragment, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onStart")
        @Keep
        public static void FragmentMethodWeaver_onStart(ArFaceFragment arFaceFragment) {
            if (!PatchProxy.proxy(new Object[]{arFaceFragment}, null, changeQuickRedirect, true, 49999, new Class[]{ArFaceFragment.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                ArFaceFragment.c(arFaceFragment);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (arFaceFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.media.record.ArFaceFragment")) {
                    jn.b.f34396a.fragmentOnStartMethod(arFaceFragment, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onViewCreated")
        @Keep
        public static void FragmentMethodWeaver_onViewCreated(@NonNull ArFaceFragment arFaceFragment, @Nullable View view, Bundle bundle) {
            IServiceManager serviceManager;
            IServiceManager serviceManager2;
            IServiceManager serviceManager3;
            if (!PatchProxy.proxy(new Object[]{arFaceFragment, view, bundle}, null, changeQuickRedirect, true, 49997, new Class[]{ArFaceFragment.class, View.class, Bundle.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                ChangeQuickRedirect changeQuickRedirect2 = ArFaceFragment.changeQuickRedirect;
                if (!PatchProxy.proxy(new Object[]{view, bundle}, arFaceFragment, ArFaceFragment.changeQuickRedirect, false, 49976, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
                    IVEContainer iVEContainer = arFaceFragment.b;
                    if (iVEContainer != null) {
                        iVEContainer.onViewCreated(view, bundle);
                    }
                    IVEContainer iVEContainer2 = arFaceFragment.b;
                    GoogleArCoreService googleArCoreService = null;
                    arFaceFragment.f10294c = (iVEContainer2 == null || (serviceManager3 = iVEContainer2.getServiceManager()) == null) ? null : (RecordCoreService) serviceManager3.getService(RecordCoreService.class);
                    IVEContainer iVEContainer3 = arFaceFragment.b;
                    arFaceFragment.e = (iVEContainer3 == null || (serviceManager2 = iVEContainer3.getServiceManager()) == null) ? null : (ArEffectServce) serviceManager2.getService(ArEffectServce.class);
                    IVEContainer iVEContainer4 = arFaceFragment.b;
                    if (!(iVEContainer4 == null || (serviceManager = iVEContainer4.getServiceManager()) == null)) {
                        googleArCoreService = (GoogleArCoreService) serviceManager.getService(GoogleArCoreService.class);
                    }
                    arFaceFragment.d = googleArCoreService;
                    IRecordCoreService iRecordCoreService = arFaceFragment.f10294c;
                    if (iRecordCoreService != null) {
                        iRecordCoreService.setCameraFacing(Facing.FRONT);
                    }
                    IArEffectService iArEffectService = arFaceFragment.e;
                    if (iArEffectService != null) {
                        iArEffectService.setEffectList(CollectionsKt__CollectionsJVMKt.listOf(new EffectCategoryItemModel(null, "https://cdn.poizon.com/node-common/aff9cf16-17a7-a998-ad15-80fba1e931c8-124-124.png", null, null, 0, null, null, null, null, 0, 0, 0, 0, 0, false, 0, 0, 0, null, 524285, null)));
                    }
                    IVEContainer iVEContainer5 = arFaceFragment.b;
                    if (iVEContainer5 != null) {
                        iVEContainer5.dispatchWindowInsets(new Rect(0, fi.b.j(arFaceFragment.getContext()), 0, 0));
                    }
                }
                long currentTimeMillis2 = System.currentTimeMillis();
                if (arFaceFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.media.record.ArFaceFragment")) {
                    jn.b.f34396a.fragmentOnViewCreatedMethod(arFaceFragment, currentTimeMillis, currentTimeMillis2);
                }
            }
        }
    }

    /* compiled from: ArFaceFragment.kt */
    public static final class a {
        public static ChangeQuickRedirect changeQuickRedirect;

        public a(DefaultConstructorMarker defaultConstructorMarker) {
        }
    }

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

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public b(ArFaceFragment arFaceFragment, Fragment fragment) {
            super(fragment);
            this.b = arFaceFragment;
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.s, td.a
        public void onBzError(@org.jetbrains.annotations.Nullable l<EffectDataModel> lVar) {
            if (!PatchProxy.proxy(new Object[]{lVar}, this, changeQuickRedirect, false, 50001, new Class[]{l.class}, Void.TYPE).isSupported) {
                super.onBzError(lVar);
                h.a.u("isSuccess", "0", BM.nft(), "community_nft_ar_load");
                ShapeConstraintLayout shapeConstraintLayout = (ShapeConstraintLayout) this.b._$_findCachedViewById(R.id.cl_loading);
                if (shapeConstraintLayout != null) {
                    ViewKt.setVisible(shapeConstraintLayout, false);
                }
                q.v("请求失败,请检查网络设置并重试", 0);
                Context context = this.b.getContext();
                if (!(context instanceof Activity)) {
                    context = null;
                }
                Activity activity = (Activity) context;
                if (activity != null) {
                    activity.onBackPressed();
                }
            }
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
        public void onSuccess(Object obj) {
            EffectDataModel effectDataModel = (EffectDataModel) obj;
            if (!PatchProxy.proxy(new Object[]{effectDataModel}, this, changeQuickRedirect, false, 50000, new Class[]{EffectDataModel.class}, Void.TYPE).isSupported) {
                String str = null;
                if ((effectDataModel != null ? effectDataModel.getEffect() : null) != null) {
                    IArEffectService iArEffectService = this.b.e;
                    if (iArEffectService != null) {
                        EffectCategoryItemModel effect = effectDataModel.getEffect();
                        if (effect != null) {
                            iArEffectService.setEffectList(CollectionsKt__CollectionsJVMKt.listOf(effect));
                        } else {
                            return;
                        }
                    }
                    if (ArfaceHelper.f26177a.d()) {
                        ArFaceFragment arFaceFragment = this.b;
                        EffectCategoryItemModel effect2 = effectDataModel.getEffect();
                        if (effect2 != null) {
                            str = effect2.getEffectFile();
                        }
                        if (!PatchProxy.proxy(new Object[]{str}, arFaceFragment, ArFaceFragment.changeQuickRedirect, false, 49984, new Class[]{String.class}, Void.TYPE).isSupported) {
                            File t = tl.a.t("https://apk.poizon.com/duApp/Android_Config/resource/mediapipe/mediapipe.zip");
                            if (t == null || !t.exists()) {
                                tl.a.n("https://apk.poizon.com/duApp/Android_Config/resource/mediapipe/mediapipe.zip", new ArFaceFragment$fetchMediaPipeAssets$2(arFaceFragment, str));
                            } else {
                                ResourceHelper.f26082a.i(arFaceFragment.getContext(), t, new ArFaceFragment$fetchMediaPipeAssets$1(arFaceFragment, str));
                            }
                        }
                    } else {
                        ArFaceFragment arFaceFragment2 = this.b;
                        EffectCategoryItemModel effect3 = effectDataModel.getEffect();
                        if (effect3 != null) {
                            str = effect3.getEffectFile();
                        }
                        arFaceFragment2.e(str);
                    }
                } else {
                    h.a.u("isSuccess", "0", BM.nft(), "community_nft_ar_load");
                    ShapeConstraintLayout shapeConstraintLayout = (ShapeConstraintLayout) this.b._$_findCachedViewById(R.id.cl_loading);
                    if (shapeConstraintLayout != null) {
                        ViewKt.setVisible(shapeConstraintLayout, false);
                    }
                    q.v("请求失败,请检查网络设置并重试", 0);
                    Context context = this.b.getContext();
                    if (context instanceof Activity) {
                        str = context;
                    }
                    Activity activity = (Activity) str;
                    if (activity != null) {
                        activity.onBackPressed();
                    }
                }
            }
        }
    }

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

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

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

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

            public a(c cVar, Manifest manifest) {
                this.b = cVar;
                this.f10298c = manifest;
            }

            public final void run() {
                if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 50016, new Class[0], Void.TYPE).isSupported) {
                    if (n.a("ar_effect", "ArFilamentBlend", true)) {
                        fo.a.m("ArFaceFragment", "Ar effect uses filament blend rendering");
                        IRecordCoreService iRecordCoreService = this.b.b.f10294c;
                        if (iRecordCoreService != null) {
                            iRecordCoreService.setFilamentBlend(true);
                        }
                    }
                    c cVar = this.b;
                    IRecordCoreService iRecordCoreService2 = cVar.b.f10294c;
                    if (iRecordCoreService2 != null) {
                        iRecordCoreService2.setFilamentModel(cVar.d);
                    }
                    c cVar2 = this.b;
                    IGoogleArCoreService iGoogleArCoreService = cVar2.b.d;
                    if (iGoogleArCoreService != null) {
                        iGoogleArCoreService.setModelPath(cVar2.d, this.f10298c);
                    }
                }
            }
        }

        public c(ArFaceFragment arFaceFragment, String str, String str2) {
            this.b = arFaceFragment;
            this.f10297c = str;
            this.d = str2;
        }

        public final void run() {
            boolean z = false;
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 50015, new Class[0], Void.TYPE).isSupported) {
                pf1.c cVar = pf1.c.f37073a;
                Manifest a5 = cVar.a(this.f10297c);
                PatchProxyResult proxy = PatchProxy.proxy(new Object[]{a5}, cVar, pf1.c.changeQuickRedirect, false, 336218, new Class[]{Manifest.class}, Boolean.TYPE);
                if (proxy.isSupported) {
                    z = ((Boolean) proxy.result).booleanValue();
                } else if (a5 != null && a5.getTargetSupportVersion() <= 3.0f) {
                    z = true;
                }
                if (!z) {
                    q.r("当前版本不支持,请更新版本");
                } else {
                    fd.q.c(new a(this, a5));
                }
            }
        }
    }

    public static void a(ArFaceFragment arFaceFragment, Bundle bundle) {
        IServiceManager serviceManager;
        VEConfig config;
        if (!PatchProxy.proxy(new Object[]{bundle}, arFaceFragment, changeQuickRedirect, false, 49972, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.onCreate(bundle);
            arFaceFragment.f = System.currentTimeMillis();
            VEConfig vEConfig = new VEConfig("ArFaceFragment");
            VEConfig.a aVar = new VEConfig.a();
            if (!PatchProxy.proxy(new Object[]{new Byte((byte) 1)}, vEConfig, VEConfig.changeQuickRedirect, false, 335192, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
                vEConfig.b = true;
            }
            StringBuilder h12 = f.h("ar engine use media piple ");
            ArfaceHelper arfaceHelper = ArfaceHelper.f26177a;
            h12.append(arfaceHelper.d());
            fo.a.m("ArFaceFragment", h12.toString());
            if (arfaceHelper.d()) {
                aVar.c(R.layout.layout_media_piple_ar_control_panel);
                vEConfig.d(VEConfig.AREngine.MEDIAPIPLE);
            } else {
                aVar.c(R.layout.layout_arcore_control_panel);
                vEConfig.d(VEConfig.AREngine.ARCORE);
            }
            vEConfig.e(aVar);
            IVEContainer a5 = new IVEContainer.a().b(arFaceFragment.requireContext()).c(vEConfig).a();
            arFaceFragment.b = a5;
            if (a5 != null) {
                a5.onCreate();
            }
            ArrayList arrayList = new ArrayList();
            IVEContainer iVEContainer = arFaceFragment.b;
            if (((iVEContainer == null || (config = iVEContainer.getConfig()) == null) ? null : config.a()) == VEConfig.AREngine.MEDIAPIPLE) {
                arrayList.add(RecordCoreService.class);
            } else {
                arrayList.add(GoogleArCoreService.class);
                arrayList.add(ArRecordService.class);
            }
            arrayList.add(ArEffectServce.class);
            IVEContainer iVEContainer2 = arFaceFragment.b;
            if (!(iVEContainer2 == null || (serviceManager = iVEContainer2.getServiceManager()) == null)) {
                serviceManager.registerBusinessService(arrayList);
            }
            FragmentActivity activity = arFaceFragment.getActivity();
            if (activity != null) {
                new MediaPermissionHelper(activity, new ArFaceFragment$onCreate$$inlined$let$lambda$1(arFaceFragment), new ArFaceFragment$onCreate$$inlined$let$lambda$2(arFaceFragment)).a();
            }
        }
    }

    public static void b(ArFaceFragment arFaceFragment) {
        if (!PatchProxy.proxy(new Object[0], arFaceFragment, changeQuickRedirect, false, 49978, new Class[0], Void.TYPE).isSupported) {
            super.onResume();
            IVEContainer iVEContainer = arFaceFragment.b;
            if (iVEContainer != null) {
                iVEContainer.onResume();
            }
        }
    }

    public static void c(ArFaceFragment arFaceFragment) {
        if (!PatchProxy.proxy(new Object[0], arFaceFragment, changeQuickRedirect, false, 49990, new Class[0], Void.TYPE).isSupported) {
            super.onStart();
        }
    }

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

    public final void d() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 49983, new Class[0], Void.TYPE).isSupported) {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 49970, new Class[0], PublishNavigationViewModel.class);
            ot.a.getEffectTemplate(PushConstants.PUSH_TYPE_UPLOAD_LOG, String.valueOf(((PublishNavigationViewModel) (proxy.isSupported ? proxy.result : this.f10295g.getValue())).getRouterBean().getArEffectId()), new b(this, this));
        }
    }

    public final void e(String str) {
        if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 49985, new Class[]{String.class}, Void.TYPE).isSupported && str != null) {
            File t = tl.a.t(str);
            if (t == null || !t.exists()) {
                tl.a.n(str, new ArFaceFragment$fetchModelPackage$3(this));
                return;
            }
            long currentTimeMillis = System.currentTimeMillis() - this.f;
            ResourceHelper resourceHelper = ResourceHelper.f26082a;
            IVEContainer iVEContainer = this.b;
            Context context = null;
            String f12 = resourceHelper.f(iVEContainer != null ? iVEContainer.getContext() : null, t);
            if (f12 != null) {
                f(f12);
            } else {
                IVEContainer iVEContainer2 = this.b;
                if (iVEContainer2 != null) {
                    context = iVEContainer2.getContext();
                }
                resourceHelper.i(context, t, new ArFaceFragment$fetchModelPackage$2(this));
                Unit unit = Unit.INSTANCE;
            }
            ShapeConstraintLayout shapeConstraintLayout = (ShapeConstraintLayout) _$_findCachedViewById(R.id.cl_loading);
            if (shapeConstraintLayout != null) {
                ViewKt.setVisible(shapeConstraintLayout, false);
            }
            BM.nft().c("community_nft_ar_load", MapsKt__MapsKt.mapOf(TuplesKt.to("isSuccess", "1"), TuplesKt.to("duration", String.valueOf(currentTimeMillis))));
        }
    }

    public final void f(String str) {
        if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 49986, new Class[]{String.class}, Void.TYPE).isSupported) {
            if (str == null) {
                fo.a.i("ArFaceFragment", "arface model path is null");
                return;
            }
            fd.q.a(new c(this, a40.f.g(str, "/manifest.json"), str));
        }
    }

    @Override // androidx.fragment.app.Fragment
    public void onCreate(Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 49971, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onCreate(this, bundle);
        }
    }

    @Override // androidx.fragment.app.Fragment
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{layoutInflater, viewGroup, bundle}, this, changeQuickRedirect, false, 49973, new Class[]{LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
        return proxy.isSupported ? (View) proxy.result : _boostWeave.FragmentMethodWeaver_onCreateView(this, layoutInflater, viewGroup, bundle);
    }

    @Override // androidx.fragment.app.Fragment
    public void onDestroy() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 49981, new Class[0], Void.TYPE).isSupported) {
            super.onDestroy();
            IVEContainer iVEContainer = this.b;
            if (iVEContainer != null) {
                iVEContainer.onDestroy();
            }
        }
    }

    @Override // androidx.fragment.app.Fragment
    public void onDestroyView() {
        HashMap hashMap;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 49980, new Class[0], Void.TYPE).isSupported) {
            super.onDestroyView();
            IVEContainer iVEContainer = this.b;
            if (iVEContainer != null) {
                iVEContainer.onDestroyView();
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 49988, new Class[0], Void.TYPE).isSupported && (hashMap = this.f10296h) != null) {
                hashMap.clear();
            }
        }
    }

    @Override // androidx.fragment.app.Fragment
    @SensorsDataInstrumented
    public void onHiddenChanged(boolean z) {
        if (!PatchProxy.proxy(new Object[]{new Byte(z ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 49991, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            super.onHiddenChanged(z);
            FragmentTrackHelper.trackOnHiddenChanged(this, z);
        }
    }

    @Override // androidx.fragment.app.Fragment
    @SensorsDataInstrumented
    public void onPause() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 49979, new Class[0], Void.TYPE).isSupported) {
            super.onPause();
            IVEContainer iVEContainer = this.b;
            if (iVEContainer != null) {
                iVEContainer.onPause();
            }
            IRecordCoreService iRecordCoreService = this.f10294c;
            if (iRecordCoreService != null) {
                iRecordCoreService.disconnectCamera();
            }
            FragmentTrackHelper.trackFragmentPause(this);
        }
    }

    @Override // androidx.fragment.app.Fragment
    @SensorsDataInstrumented
    public void onResume() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 49977, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onResume(this);
            FragmentTrackHelper.trackFragmentResume(this);
        }
    }

    @Override // androidx.fragment.app.Fragment
    public void onStart() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 49989, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onStart(this);
        }
    }

    @Override // androidx.fragment.app.Fragment
    @SensorsDataInstrumented
    public void onViewCreated(View view, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{view, bundle}, this, changeQuickRedirect, false, 49975, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onViewCreated(this, view, bundle);
            FragmentTrackHelper.onFragmentViewCreated(this, view, bundle);
        }
    }

    @Override // androidx.fragment.app.Fragment
    @SensorsDataInstrumented
    public void setUserVisibleHint(boolean z) {
        if (!PatchProxy.proxy(new Object[]{new Byte(z ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 49992, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            super.setUserVisibleHint(z);
            FragmentTrackHelper.trackFragmentSetUserVisibleHint(this, z);
        }
    }
}