package com.ss.android.ugc.aweme.services;

import X.0Gf;
import X.0Gp;
import X.2Pr;
import X.2UX;
import X.2fU;
import X.2nK;
import X.2pl;
import X.2pm;
import X.2pn;
import X.3Pc;
import X.3Pd;
import X.3Pf;
import X.3Pt;
import X.3Pu;
import X.3Q0;
import X.3Q1;
import X.3aF;
import X.3aG;
import X.3aH;
import X.3aI;
import X.3aJ;
import X.3aL;
import X.3aM;
import X.3aS;
import X.3ad;
import X.3be;
import X.3i8;
import X.3yj;
import X.3zH;
import X.41G;
import X.46i;
import X.47m;
import X.4CJ;
import X.4Ew;
import X.4Mb;
import X.4WH;
import X.4Wk;
import X.4ZR;
import X.4ZU;
import X.4ZV;
import X.4ZW;
import X.4ZX;
import X.4dC;
import X.4qh;
import X.7TA;
import X.7uw;
import X.85f;
import X.863;
import X.8Zb;
import X.8Ze;
import X.8eL;
import X.9EH;
import X.9Fh;
import X.9GB;
import X.9JB;
import X.9Jh;
import X.9KN;
import X.9XM;
import X.9Y3;
import X.9ZJ;
import X.Bbb;
import X.Bbc;
import X.Bbd;
import X.Bbe;
import X.Bi2;
import X.C0578D2g;
import X.C4212EdM;
import X.C4685Ekz;
import X.C4728Elg;
import X.C5337EvV;
import X.C5338EvW;
import X.C5372Ew4;
import X.C5376Ew8;
import X.C5719F3z;
import X.C5968FDo;
import X.C6022FFq;
import X.C6110FJa;
import X.C6111FJb;
import X.C6116FJg;
import X.C6117FJh;
import X.C6118FJi;
import X.C6119FJj;
import X.C6121FJl;
import X.C6122FJm;
import X.C6123FJn;
import X.C6124FJo;
import X.C6125FJp;
import X.C6126FJq;
import X.C6127FJr;
import X.C6133FJx;
import X.C6134FJy;
import X.C6140FKe;
import X.C6152FKq;
import X.C6160FKy;
import X.CBA;
import X.CqM;
import X.F40;
import X.F41;
import X.F42;
import X.FB1;
import X.FB8;
import X.FBO;
import X.FER;
import X.FES;
import X.FEU;
import X.FK0;
import X.FK1;
import X.FK4;
import X.FK7;
import X.FK8;
import X.FKI;
import X.FKM;
import X.FLD;
import X.FLH;
import X.JZx;
import X.KIT;
import X.KqE;
import X.KqU;
import X.Kqt;
import X.Kue;
import X.Kug;
import X.KwI;
import X.LFp;
import X.Lnj;
import X.LsC;
import X.Lw1;
import X.M12;
import X.OZG;
import X.OZI;
import X.S9A;
import X.SfZ;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.abmock.SettingsManager;
import com.bytedance.tiktok.homepage.mainactivity.PerformanceActivityObserver;
import com.bytedance.tiktok.homepage.mainactivity.PreloadActicityTask;
import com.google.gson.g;
import com.google.gson.m;
import com.ss.android.ugc.aweme.IAccountUserService;
import com.ss.android.ugc.aweme.account.task.CookieMonitorTask;
import com.ss.android.ugc.aweme.app.SharePrefCache;
import com.ss.android.ugc.aweme.app.api.Api;
import com.ss.android.ugc.aweme.commercialize.views.cards.AdHalfWebPageFragmentV2;
import com.ss.android.ugc.aweme.commercialize.views.cards.X2CAdWebPage;
import com.ss.android.ugc.aweme.commercialize.views.form.AdFormMaskFragment;
import com.ss.android.ugc.aweme.compliance.api.a;
import com.ss.android.ugc.aweme.deeplink.DeepLinkServiceImpl;
import com.ss.android.ugc.aweme.deeplink.IDeepLinkService;
import com.ss.android.ugc.aweme.feed.model.AnchorLynxModel;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.AwemeRawAd;
import com.ss.android.ugc.aweme.feed.ui.VideoPlayActivity;
import com.ss.android.ugc.aweme.homepage.msadapt.MSAdaptionService;
import com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService;
import com.ss.android.ugc.aweme.legoImp.task.CleanEffectsTask;
import com.ss.android.ugc.aweme.legoImp.task.ColdBootPreloadInstanceTask;
import com.ss.android.ugc.aweme.legoImp.task.PreloadResourcesTask;
import com.ss.android.ugc.aweme.live.LiveOuterService;
import com.ss.android.ugc.aweme.main.MainActivity;
import com.ss.android.ugc.aweme.main.MainFragment;
import com.ss.android.ugc.aweme.main.MainPageFragment;
import com.ss.android.ugc.aweme.profile.model.User;
import com.ss.android.ugc.aweme.prop.impl.PropReuseServiceImpl;
import com.ss.android.ugc.aweme.requesttask.idle.FetchImUnder16RequestTask;
import com.ss.android.ugc.aweme.services.IMainService;
import com.ss.android.ugc.aweme.shortvideo.model.MusicModel;
import com.ss.android.ugc.aweme.splash.SplashActivity;
import com.ss.android.ugc.aweme.utils.AppWidgetServiceImpl;
import com.ss.android.ugc.effectmanager.effect.model.Effect;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import kotlin.h.b.n;
import org.json.JSONArray;
import org.json.JSONObject;

public class MainServiceImpl implements IMainService {
    static {
        Covode.recordClassIndex(105121);
    }

    public boolean isUseJediAwemelistFragment() {
        return false;
    }

    public boolean openAdTestUrl(Context context, String str, int i) {
        return false;
    }

    public void startupTestColdBootEnd() {
    }

    public String getApiUrlPrefix() {
        return Api.LIZLLL;
    }

    public Class<? extends Activity> getMainActivityClass() {
        return MainActivity.class;
    }

    public 8Ze getPreloadInstanceTask() {
        return ColdBootPreloadInstanceTask.LIZ;
    }

    public 8Ze getPreloadResourcesTask() {
        return PreloadResourcesTask.LIZ;
    }

    public Class<? extends Activity> getSplashActivityClass() {
        return SplashActivity.class;
    }

    public String getAccessKey() {
        return 863.LIZ.LIZJ();
    }

    public 8Zb getAnchorListRequest() {
        return new FKM();
    }

    public int getAppVersionCode() {
        return (int) 9EH.LJJIFFI.LJII();
    }

    public 8Ze getCleanEffectsTask() {
        return new CleanEffectsTask();
    }

    public 8Ze getCookieMonitorTask() {
        return new CookieMonitorTask();
    }

    public 8Ze getFetchImUnder16RequestTask() {
        return new FetchImUnder16RequestTask();
    }

    public 8Zb getFetchUnifiedSettingRequest() {
        return new 9XM(1);
    }

    public int getLauncherIconRes() {
        AppWidgetServiceImpl.LIZLLL();
        return 2131232853;
    }

    public 8Ze getLikoInitTask() {
        return new PerformanceActivityObserver.LikoInitTask();
    }

    public 9GB getMainInflate() {
        return new X2CAdWebPage();
    }

    public 8Ze getPreloadActicityTask() {
        return new PreloadActicityTask();
    }

    public 8Ze getRegisterStorageTask() {
        return Lw1.LIZ.LIZLLL();
    }

    public boolean isContainsKeyWithLruEntries() {
        return 9ZJ.LIZ.LIZLLL();
    }

    public boolean isReplaceAwemeCache() {
        return 9ZJ.LIZ.LIZJ();
    }

    public C5968FDo routerDepend() {
        return new C6133FJx();
    }

    public Class[] getFixFragmentManagerWhiteList() {
        return new Class[]{AdHalfWebPageFragmentV2.class, AdFormMaskFragment.class};
    }

    public boolean getLeakUploadEnableExperimentValue() {
        return SettingsManager.LIZ().LIZ("leak_hprof_upload", false);
    }

    public void initLegoInflate() {
        9Fh.LJIILIIL.LIZ(X2CAdWebPage.class, new X2CAdWebPage());
    }

    public boolean isAppHot() {
        return C6140FKe.LIZ().LIZ.LIZ();
    }

    public boolean isAwemeAppDataEmpty() {
        if (9Jh.LIZ() != null) {
            return true;
        }
        return false;
    }

    public void releaseWebPageActivity() {
        ((X2CAdWebPage) 9Fh.LJIILIIL.LIZIZ(X2CAdWebPage.class)).LIZLLL();
    }

    public Fragment getFollowFragmentCache() {
        ColdBootPreloadInstanceTask coldBootPreloadInstanceTask = (ColdBootPreloadInstanceTask) 9Fh.LJIILIIL.LIZ(ColdBootPreloadInstanceTask.LIZ);
        if (coldBootPreloadInstanceTask.LIZJ == null) {
            return null;
        }
        Fragment fragment = coldBootPreloadInstanceTask.LIZJ;
        coldBootPreloadInstanceTask.LIZJ = null;
        return fragment;
    }

    public Fragment getRecommendFragmentCache() {
        ColdBootPreloadInstanceTask coldBootPreloadInstanceTask = (ColdBootPreloadInstanceTask) 9Fh.LJIILIIL.LIZ(ColdBootPreloadInstanceTask.LIZ);
        if (coldBootPreloadInstanceTask.LIZIZ == null) {
            return null;
        }
        Fragment fragment = coldBootPreloadInstanceTask.LIZIZ;
        coldBootPreloadInstanceTask.LIZIZ = null;
        return fragment;
    }

    public Fragment obtainMainPageFragment() {
        if (!MSAdaptionService.LIZJ().LIZ(9EH.LJJIFFI.LIZ())) {
            return null;
        }
        Bundle bundle = new Bundle();
        MainPageFragment mainPageFragment = new MainPageFragment();
        mainPageFragment.setArguments(bundle);
        return mainPageFragment;
    }

    public boolean isLastPublishFailed() {
        if (SharePrefCache.inst().getLastPublishFailed() == null || !((Boolean) SharePrefCache.inst().getLastPublishFailed().LIZLLL()).booleanValue()) {
            return false;
        }
        return true;
    }

    public boolean isLimitAdTrackingEnabled() {
        if (((Boolean) 2pn.LIZJ.getValue()).booleanValue()) {
            return true;
        }
        if (!2pn.LIZIZ) {
            2pn.LIZIZ = true;
            if (9KN.LIZ.LIZIZ()) {
                0Gp.LIZ(2pl.LIZ, 8eL.LIZ(), (0Gf) null);
            } else {
                0Gp.LIZ(2pm.LIZ);
            }
        }
        return 2pn.LIZ;
    }

    public Fragment obtainSecondTabFragment() {
        if (!MSAdaptionService.LIZJ().LIZ(9EH.LJJIFFI.LIZ())) {
            return null;
        }
        if (C4685Ekz.LIZ.LJIIL() && C4685Ekz.LIZ.LJFF() < 0) {
            return C4685Ekz.LIZ.LIZLLL();
        }
        Bundle bundle = new Bundle();
        bundle.putSerializable("i18n_tab_mode", true);
        Fragment LIZ = C4728Elg.LIZ.LIZ();
        LIZ.setArguments(bundle);
        return LIZ;
    }

    public List<FLH> getDeeplinkCommands() {
        ArrayList arrayList = new ArrayList();
        ArrayList arrayList2 = new ArrayList();
        arrayList2.add(new C6119FJj());
        arrayList2.add(new Bbe());
        arrayList2.add(new 4ZR());
        arrayList2.add(new F42());
        arrayList2.add(new C6116FJg());
        arrayList2.add(new FER());
        arrayList2.add(new 3ad());
        arrayList2.add(new FES());
        arrayList2.add(new C6121FJl());
        arrayList2.add(new C6125FJp());
        arrayList2.add(new C5719F3z());
        arrayList2.add(new 3aF());
        arrayList2.add(new 4ZX());
        arrayList2.add(new 3aG());
        arrayList2.add(new 3aI());
        arrayList2.add(new FK1());
        arrayList2.add(new C6117FJh());
        arrayList2.add(new 3aJ());
        arrayList2.add(new 4Mb());
        arrayList2.add(new 3zH());
        arrayList2.add(new 3aL());
        arrayList2.add(new C6127FJr());
        arrayList2.add(new C6126FJq());
        arrayList2.add(new 3aS());
        arrayList2.add(new 3yj());
        arrayList2.add(new FEU());
        arrayList.addAll(arrayList2);
        ArrayList arrayList3 = new ArrayList();
        arrayList3.add(new FK7());
        arrayList3.add(new 4ZW());
        arrayList3.add(new 4ZV());
        arrayList3.add(new 3be());
        arrayList3.add(new C5338EvW());
        arrayList3.add(new 4Ew());
        arrayList3.add(new F41());
        arrayList3.add(new 4CJ());
        arrayList3.add(new 4ZU());
        arrayList3.add(new C6110FJa());
        arrayList3.add(new 3aM());
        arrayList3.add(new 3Pt());
        arrayList3.add(new F40());
        arrayList3.add(new Bbc());
        arrayList3.add(new Bbd());
        arrayList3.add(new C6123FJn());
        arrayList3.add(new 41G());
        arrayList3.add(new 3Q1());
        arrayList3.add(new S9A());
        arrayList3.add(new C6118FJi());
        arrayList3.add(new C6111FJb());
        arrayList3.add(new C6134FJy());
        arrayList3.add(new 4Wk());
        arrayList3.add(new 3Pc());
        arrayList3.add(new 3Pd());
        arrayList3.add(new C5372Ew4());
        arrayList3.add(new 47m());
        arrayList3.add(new C6124FJo());
        arrayList3.add(new FK8());
        arrayList3.add(new FKI());
        arrayList3.add(new Bbb());
        arrayList3.add(new C6160FKy());
        arrayList3.add(new C5376Ew8());
        arrayList3.add(new FK4());
        arrayList3.add(new FLD());
        arrayList3.add(new C6122FJm());
        arrayList3.add(new 3Q0());
        arrayList3.add(new FK0());
        arrayList3.add(new 3Pu());
        arrayList3.add(new C5337EvV());
        arrayList3.add(new CBA());
        arrayList3.add(new 3Pf());
        arrayList3.add(new 4WH());
        arrayList.addAll(arrayList3);
        return arrayList;
    }

    public boolean isMainPage(Context context) {
        return context instanceof MainActivity;
    }

    public void restartApp(Bundle bundle) {
        C6022FFq.LIZ(bundle);
    }

    public void setOptSmartAvatarBorderView(boolean z) {
        C4212EdM.setOpt(z);
    }

    public void setSwitchAccountRestartPending(boolean z) {
        C6022FFq.LIZ = z;
    }

    public String getAnywhereChannelPath(String str) {
        return 85f.LIZIZ(str);
    }

    public Long getFeedCount(Integer num) {
        return 7TA.LIZ.LIZ(num);
    }

    public Intent getMainActivityIntent(Context context) {
        return 3aH.LIZ(context);
    }

    private JSONArray jsonArrayToJSONArray(g gVar) {
        return new JSONArray(gVar.toString());
    }

    private JSONObject jsonObjectToJSONObject(m mVar) {
        return new JSONObject(mVar.toString());
    }

    public OZG avMusicApply(MusicModel musicModel) {
        return new OZI().LIZ(musicModel);
    }

    public Class<? extends Activity> getDeepLinkHandlerActivityClass(boolean z) {
        IDeepLinkService LJIIJ = DeepLinkServiceImpl.LJIIJ();
        if (z) {
            return LJIIJ.LJFF();
        }
        return LJIIJ.LJ();
    }

    public String getSecurityUrl(String str) {
        return Kqt.LIZ.LIZ(str, JZx.LIZ.LIZIZ());
    }

    public void pendingDeepLinkLog(LsC<Boolean, 2Pr> lsC) {
        lsC.getClass();
        Kue.LIZ(MainServiceImpl$$Lambda$2.get$Lambda(lsC));
    }

    public void setLastPublishFailed(boolean z) {
        SharePrefCache.inst().getLastPublishFailed().LIZIZ(Boolean.valueOf(z));
    }

    public void setWebPageActivity(Activity activity) {
        ((X2CAdWebPage) 9Fh.LJIILIIL.LIZIZ(X2CAdWebPage.class)).LIZ(activity);
    }

    public void updateIMUserFollowStatus(User user) {
        IMService.createIIMServicebyMonsterPlugin(false).updateIMUserFollowStatus(4dC.LIZ(user));
    }

    public static IMainService createIMainServicebyMonsterPlugin(boolean z) {
        IMainService iMainService = (IMainService) Lnj.LIZ(IMainService.class, z);
        if (iMainService != null) {
            return iMainService;
        }
        Object LIZIZ = Lnj.LIZIZ(IMainService.class, z);
        if (LIZIZ != null) {
            return (IMainService) LIZIZ;
        }
        return new MainServiceImpl();
    }

    public Class<? extends Activity> getAppLinkHandlerActivityClass(boolean z) {
        if (z) {
            return DeepLinkServiceImpl.LJIIJ().LJII();
        }
        return DeepLinkServiceImpl.LJIIJ().LJI();
    }

    public boolean handleLiveSchema(String str) {
        return LiveOuterService.LJJI().LJIIJ().LIZIZ(str).booleanValue();
    }

    public boolean isDeepLinkHandlerActivity(Context context) {
        IDeepLinkService LJIIJ = DeepLinkServiceImpl.LJIIJ();
        if (LJIIJ.LIZ(context) || LJIIJ.LIZIZ(context)) {
            return true;
        }
        return false;
    }

    public void startCleanEffect(Context context) {
        if (context != null && !CleanEffectsTask.LIZ && SfZ.LJIJ.LJIIIZ() == null) {
            0Gp.LIZ(new 9JB(context), 8eL.LIZJ(), (0Gf) null);
        }
    }

    private List<String> mergeKeys(List<String> list) {
        HashSet hashSet = new HashSet();
        for (String split : list) {
            String[] split2 = split.split("\\.");
            if (split2.length > 0) {
                hashSet.add(split2[0]);
            }
        }
        return new ArrayList(hashSet);
    }

    public boolean isOnFollowPage(Activity activity) {
        if (activity == null || !(activity instanceof MainActivity)) {
            return false;
        }
        MainActivity mainActivity = (MainActivity) activity;
        if (!mainActivity.isUnderMainTab() || !(mainActivity.getCurFragment() instanceof MainFragment)) {
            return false;
        }
        MainFragment curFragment = mainActivity.getCurFragment();
        if (!curFragment.getUserVisibleHint() || !curFragment.LJIILJJIL()) {
            return false;
        }
        return true;
    }

    public Map<String, Object> getSettings(List<String> list) {
        try {
            Map LIZ = 7uw.LIZ.LIZ(mergeKeys(list));
            HashMap hashMap = new HashMap();
            for (Map.Entry entry : LIZ.entrySet()) {
                if (entry.getValue() != null) {
                    if (entry.getValue() instanceof m) {
                        hashMap.put(entry.getKey(), jsonObjectToJSONObject((m) entry.getValue()));
                    } else if (entry.getValue() instanceof g) {
                        hashMap.put(entry.getKey(), jsonArrayToJSONArray((g) entry.getValue()));
                    } else {
                        hashMap.put(entry.getKey(), entry.getValue());
                    }
                }
            }
            HashMap hashMap2 = new HashMap();
            for (String next : list) {
                Object retrieveSettingValue = retrieveSettingValue(next, hashMap);
                if (retrieveSettingValue != null) {
                    hashMap2.put(next, retrieveSettingValue);
                }
            }
            return hashMap2;
        } catch (Exception unused) {
            return new HashMap();
        }
    }

    public void changeStatusBarMainTab(Activity activity, String str) {
        FBO.LIZ(activity, str);
    }

    public void trackAppsFlyerEvent(String str, String str2) {
        FBO.LIZ(str, str2);
    }

    public static void INVOKEVIRTUAL_com_ss_android_ugc_aweme_services_MainServiceImpl_com_ss_android_ugc_tiktok_security_lancet_ContextLancet_startActivity(Context context, Intent intent) {
        3i8.LIZ(intent, context);
        context.startActivity(intent);
    }

    public String getFeedOrder(Aweme aweme, Integer num) {
        return 7TA.LIZ.LIZ(aweme, num);
    }

    public boolean openGpByPackageName(Context context, String str) {
        return KIT.LIZ(context, str);
    }

    public boolean openSystemBrowser(Context context, String str) {
        return Kue.LIZIZ(context, str);
    }

    public boolean shouldShowCommerceTagOnFeed(Aweme aweme, Integer num) {
        num.intValue();
        return false;
    }

    public static final /* synthetic */ void lambda$downloadStickerHelper$1$MainServiceImpl(IMainService.DownLoadFinishListener downLoadFinishListener, int i) {
        boolean z;
        if (i == 2006) {
            z = true;
        } else {
            z = false;
        }
        downLoadFinishListener.doAfterDownLoad(i, Boolean.valueOf(z));
    }

    private Object retrieveSettingValue(String str, Map<String, Object> map) {
        Object obj;
        String[] split = str.split("\\.");
        if (split.length == 0) {
            return null;
        }
        int i = 0;
        Object obj2 = map;
        while (obj2 != null && i < split.length) {
            String str2 = split[i];
            if (obj2 instanceof Map) {
                Map map2 = (Map) obj2;
                if (map2.containsKey(str2)) {
                    obj = map2.get(str2);
                    i++;
                    obj2 = obj;
                }
            }
            if (obj2 instanceof JSONObject) {
                JSONObject jSONObject = (JSONObject) obj2;
                if (jSONObject.opt(str2) != null) {
                    obj = jSONObject.opt(str2);
                    i++;
                    obj2 = obj;
                }
            }
            return null;
        }
        return obj2;
    }

    public boolean openAdOpenUrl(Context context, String str, boolean z) {
        return Kue.LIZ(context, str, z);
    }

    public boolean openAdWebUrl(Context context, String str, String str2) {
        return Kue.LIZ(context, str, str2);
    }

    public boolean startAdsAppActivity(Context context, String str, String str2) {
        return KqE.LIZ(KqU.LJ, context, str, str2);
    }

    public boolean checkIsMinAppVersionNotSatisfied(Activity activity, String str, String str2) {
        return DeepLinkServiceImpl.LJIIJ().LIZ(activity, str, str2);
    }

    public static final /* synthetic */ void lambda$downloadStickerHelper$0$MainServiceImpl(String str, String str2, Effect effect) {
        2UX r2 = new 2UX();
        r2.LIZ("creation_id", str2);
        r2.LIZ("shoot_way", "scan");
        r2.LIZ("prop_id", str);
        2nK.LIZ("shoot", r2.LIZ);
    }

    public void openDeepLinkActivity(Context context, String str, String str2) {
        Intent intent = new Intent(context, DeepLinkServiceImpl.LJIIJ().LJFF());
        intent.setData(Uri.parse(str));
        intent.addFlags(268435456);
        intent.putExtra("is_from_self", true);
        intent.putExtra("in_app_enter_from", str2);
        INVOKEVIRTUAL_com_ss_android_ugc_aweme_services_MainServiceImpl_com_ss_android_ugc_tiktok_security_lancet_ContextLancet_startActivity(context, intent);
    }

    public boolean searchAdTransformOpen(Context context, Aweme aweme, int i) {
        if (context == null || aweme == null || !LFp.LJIJ(aweme) || aweme.getAwemeRawAd() == null) {
            return false;
        }
        String type = aweme.getAwemeRawAd().getType();
        if (TextUtils.isEmpty(type)) {
            return false;
        }
        type.hashCode();
        if (type.equals("app")) {
            Kug.LJII(context, aweme, i);
            return false;
        } else if (!type.equals("web")) {
            return true;
        } else {
            return Kue.LIZIZ(context, aweme, i);
        }
    }

    public boolean tryShowIllegalUsernameDialog(String str, Runnable runnable, Runnable runnable2) {
        String str2 = str;
        M12.LIZ(str2);
        long currentTimeMillis = System.currentTimeMillis();
        Activity LJIIIZ = SfZ.LJIJ.LJIIIZ();
        if (a.LIZJ().LIZ(4) || C6152FKq.LIZ.LJII() || LJIIIZ == null) {
            return false;
        }
        IAccountUserService LJFF = 46i.LJFF();
        n.LIZIZ(LJFF, "");
        if (!LJFF.isLogin()) {
            return false;
        }
        IAccountUserService LJFF2 = 46i.LJFF();
        n.LIZIZ(LJFF2, "");
        User curUser = LJFF2.getCurUser();
        IAccountUserService LJFF3 = 46i.LJFF();
        n.LIZIZ(LJFF3, "");
        String curUserId = LJFF3.getCurUserId();
        n.LIZIZ(curUserId, "");
        long j = currentTimeMillis - FB1.LIZJ.getLong("last_illegal_dialog_show_".concat(String.valueOf(curUserId)), -1);
        int LIZ = 9Y3.LIZ(9Y3.LIZ(), true, "username_modify_tip_interval_2", 0);
        if (LIZ != 1) {
            if (LIZ != 2) {
                if (LIZ != 3) {
                    if (LIZ != 4 || j <= 604800000) {
                        return false;
                    }
                    if (!n.LIZ(str2, "comment") && !n.LIZ(str2, "publish") && !n.LIZ(str2, "profile")) {
                        return false;
                    }
                } else if (j <= 172800000) {
                    return false;
                } else {
                    if (!n.LIZ(str2, "comment") && !n.LIZ(str2, "publish") && !n.LIZ(str2, "profile")) {
                        return false;
                    }
                }
            } else if (j <= 172800000) {
                return false;
            } else {
                if (!n.LIZ(str2, "comment") && !n.LIZ(str2, "publish")) {
                    return false;
                }
            }
        } else if (j <= 172800000) {
            return false;
        } else {
            if (!n.LIZ(str2, "comment") && !n.LIZ(str2, "profile")) {
                return false;
            }
        }
        Dialog changeIllegalUsernameDialog = AccountHelperService.createIAccountHelperServicebyMonsterPlugin(false).getChangeIllegalUsernameDialog(LJIIIZ, curUser);
        FB1.LIZ = currentTimeMillis;
        FB1.LIZIZ = str2;
        changeIllegalUsernameDialog.setOnDismissListener(new FB8(runnable2, changeIllegalUsernameDialog, str2, currentTimeMillis));
        if (runnable != null) {
            runnable.run();
        }
        changeIllegalUsernameDialog.show();
        2fU.LIZ.LIZ(changeIllegalUsernameDialog);
        2UX r3 = new 2UX();
        r3.LIZ("enter_from", str2);
        2nK.LIZ("notify_username", r3.LIZ);
        FB1.LIZJ.storeLong("last_illegal_dialog_show_".concat(String.valueOf(curUserId)), currentTimeMillis);
        return true;
    }

    public void startBulletActivity(Context context, String str, String str2, Bundle bundle) {
        Bi2.LIZ(context, str, str2, bundle);
    }

    public Intent getAwemeWebIntent(Context context, Uri uri, Boolean bool, Boolean bool2) {
        return KqU.LIZ(context, uri, bool.booleanValue(), bool2.booleanValue());
    }

    public Intent handleAmeWebViewBrowserForDeeplink(Context context, Uri uri, Boolean bool, Boolean bool2) {
        return KqU.LIZ(context, uri, bool.booleanValue(), bool2.booleanValue());
    }

    public void downloadStickerHelper(String str, String str2, Activity activity, boolean z, IMainService.DownLoadFinishListener downLoadFinishListener) {
        4qh r3 = new 4qh();
        r3.LIZ("scan");
        r3.LJI = false;
        r3.LIZ(new MainServiceImpl$$Lambda$0(str));
        MainServiceImpl$$Lambda$1 mainServiceImpl$$Lambda$1 = new MainServiceImpl$$Lambda$1(downLoadFinishListener);
        M12.LIZ(mainServiceImpl$$Lambda$1);
        r3.LJIIIIZZ = mainServiceImpl$$Lambda$1;
        M12.LIZ("qrcode");
        r3.LJFF = "qrcode";
        ArrayList arrayList = new ArrayList();
        arrayList.add(str);
        PropReuseServiceImpl.LIZJ().LIZ(activity, arrayList, r3.LIZ(), z);
    }

    public void startVideoPlayActivity(Context context, String str, String str2, boolean z, String str3, String str4, String str5, String str6, float f) {
        M12.LIZ(context, str, str2, str3, str4);
        Intent intent = new Intent(context, VideoPlayActivity.class);
        intent.putExtra("play_addr_string", str);
        intent.putExtra("cover_image_string", str2);
        intent.putExtra("loop", z);
        intent.putExtra("video_id", str3);
        intent.putExtra("video_md5", str4);
        intent.putExtra("enter_from", str5);
        intent.putExtra("video_type", str6);
        intent.putExtra("progress", f);
        intent.putExtra("tag_line", "");
        3i8.LIZ(intent, context);
        context.startActivity(intent);
    }

    public void showAdPopUpWebPageWidget(Context context, AwemeRawAd awemeRawAd, Integer num, Integer num2, String str, String str2, Boolean bool, String str3, Aweme aweme, AnchorLynxModel anchorLynxModel) {
        AwemeRawAd awemeRawAd2 = awemeRawAd;
        Context context2 = context;
        String str4 = str;
        CqM.LIZ(new C0578D2g(new KwI(context2, awemeRawAd2, num.intValue(), num2.intValue(), str4, str2, bool.booleanValue(), str3, aweme, anchorLynxModel, (byte) 0)));
    }
}
