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


package com.shizhuang.duapp.modules.community.home.observer;

import android.content.Context;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.shizhuang.duapp.modules.community.home.fragment.TrendFragment;
import com.shizhuang.duapp.modules.du_community_common.helper.PublishDraftHelper;
import com.shizhuang.duapp.modules.router.ServiceManager;
import com.shizhuang.model.trend.TrendUploadViewModel;
import df.b0;
import fd.n;
import fd.q;
import java.io.File;
import kotlin.Metadata;
import kotlin.jvm.functions.Function2;
import nd.e;
import org.jetbrains.annotations.NotNull;
import tl.a;
import y20.f;

@Metadata(bv = {}, d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\u0018\u00002\u00020\u0001J\b\u0010\u0003\u001a\u00020\u0002H\u0007J\b\u0010\u0004\u001a\u00020\u0002H\u0007¨\u0006\u0005"}, d2 = {"Lcom/shizhuang/duapp/modules/community/home/observer/PublishObserver;", "Landroidx/lifecycle/LifecycleObserver;", "", "onResume", "onPause", "du_trend_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: PublishObserver.kt */
public final class PublishObserver implements LifecycleObserver {
    public static ChangeQuickRedirect changeQuickRedirect;
    @NotNull
    public final Context b;
    @NotNull

    /* renamed from: c  reason: collision with root package name */
    public final TrendFragment f11737c;

    public PublishObserver(@NotNull Context context, @NotNull TrendFragment trendFragment) {
        boolean z;
        FragmentActivity activity;
        TrendUploadViewModel trendUploadViewModel;
        String str;
        File t;
        String str2;
        File t4;
        this.b = context;
        this.f11737c = trendFragment;
        trendFragment.getLifecycle().addObserver(this);
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 79951, new Class[0], Void.TYPE).isSupported && ((t4 = a.t((str2 = (String) n.c("community_module", "community_cv_license_v2", String.class, "https://apk.poizon.com/duApp/Android_Config/license/cv/duapp_20210309_20210608_com.shizhuang.duapp_v1.0.2.licbag")))) == null || !t4.exists())) {
            a.m(str2);
        }
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 79952, new Class[0], Void.TYPE).isSupported && ((t = a.t((str = (String) n.c("community_module", "ModelResourceV2", String.class, "https://apk.poizon.com/duApp/Android_Config/resource/updatehair.zip")))) == null || !t.exists())) {
            a.m(str);
        }
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 79947, new Class[0], Void.TYPE).isSupported) {
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 79953, new Class[0], Void.TYPE).isSupported) {
                PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 79954, new Class[0], Boolean.TYPE);
                if (proxy.isSupported) {
                    z = ((Boolean) proxy.result).booleanValue();
                } else {
                    if (context.getExternalCacheDir() != null) {
                        File file = new File(context.getExternalCacheDir(), "du_oss_record");
                        File[] listFiles = file.listFiles();
                        if (file.exists() && listFiles != null) {
                            if (!(listFiles.length == 0)) {
                                z = true;
                            }
                        }
                    }
                    z = false;
                }
                if (!z || (trendUploadViewModel = (TrendUploadViewModel) e.f((String) b0.f("upload_video_draft", ""), TrendUploadViewModel.class)) == null) {
                    Boolean bool = Boolean.FALSE;
                    if (((Boolean) b0.f("abnormal_draft", bool)).booleanValue() && (activity = trendFragment.getActivity()) != null) {
                        PublishDraftHelper.b.c(activity, PublishObserver$showAbnormalDraftDialog$1.INSTANCE, 0);
                        b0.l("abnormal_draft", bool);
                    }
                } else {
                    ServiceManager.C().publishTrend(trendUploadViewModel, 1, null);
                }
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 79948, new Class[0], Void.TYPE).isSupported) {
                f fVar = f.f40166a;
                PublishObserver$checkAllDraft$1 publishObserver$checkAllDraft$1 = new PublishObserver$checkAllDraft$1(this);
                if (!PatchProxy.proxy(new Object[]{publishObserver$checkAllDraft$1}, fVar, f.changeQuickRedirect, false, 100772, new Class[]{Function2.class}, Void.TYPE).isSupported) {
                    q.a(new y20.e(publishObserver$checkAllDraft$1));
                }
            }
        }
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    public final void onPause() {
        boolean z = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 79957, new Class[0], Void.TYPE).isSupported;
    }

    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
    public final void onResume() {
        boolean z = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 79956, new Class[0], Void.TYPE).isSupported;
    }
}