package com.kwad.sdk.core.config; import android.content.Context; import android.text.TextUtils; import com.ksad.annotation.invoker.ForInvoker; import com.kwad.components.ad.c.a; import com.kwad.sdk.components.DevelopMangerComponents; import com.kwad.sdk.components.c; import com.kwad.sdk.core.config.item.TipsConfigItem; import com.kwad.sdk.core.config.item.b; import com.kwad.sdk.core.config.item.k; import com.kwad.sdk.core.config.item.m; import com.kwad.sdk.core.config.item.p; import com.kwad.sdk.core.response.model.SdkConfigData; import com.kwad.sdk.core.response.model.TemplateConfig; import com.kwad.sdk.service.ServiceProvider; import com.kwad.sdk.service.kwai.e; import com.kwad.sdk.utils.aw; import com.kwad.sdk.utils.g; import com.kwad.sdk.utils.x; import java.io.File; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import org.json.JSONObject; public final class d { private static final AtomicBoolean aUo = new AtomicBoolean(false); private static volatile SdkConfigData aUp; public static synchronized File I(Context context, String str) { File file; synchronized (d.class) { file = new File(bk(context), str); } return file; } public static int Je() { c.g(DevelopMangerComponents.class); return c.aSu.getValue().intValue(); } public static boolean Jf() { c.g(DevelopMangerComponents.class); return c.aSJ.getValue().booleanValue(); } public static boolean Jg() { c.g(DevelopMangerComponents.class); return c.aSy.getValue().intValue() == 1; } public static boolean Jh() { return c.aSw.getValue().intValue() == 0; } public static boolean Ji() { return c.aTi.getValue().intValue() == 1; } public static boolean Jj() { return c.aTk.getValue().intValue() == 1; } public static boolean Jk() { return c.aTj.getValue().intValue() == 1; } public static boolean Jl() { return c.aTh.getValue().intValue() == 1; } public static String Jm() { return c.aTu.getImei(); } public static String Jn() { return c.aTu.getOaid(); } public static List<String> Jo() { return c.aSS.getValue(); } public static boolean Jp() { return c.aTG.getValue().intValue() == 1; } public static boolean Jq() { return c.aTI.getValue().intValue() == 1; } public static boolean Jr() { return c.aTm.getValue().intValue() == 1; } public static boolean Jt() { return c.aUa.getValue().booleanValue(); } public static boolean Ju() { return c.aUb.getValue().booleanValue(); } public static int Jv() { if (aUp != null) { return aUp.goodIdcThresholdMs; } return 200; } public static int Jw() { return c.aUd.getValue().intValue(); } public static String KA() { return c.aSR.getValue(); } public static List<String> KB() { return c.aST.getValue(); } public static boolean KC() { return c.aSK.getValue().booleanValue(); } public static boolean KD() { return c.aSx.getValue().intValue() == 1; } public static String KE() { return c.aSO.getValue(); } public static String KF() { return c.aSP.getValue(); } public static boolean KG() { return c.aSz.getValue().intValue() == 1; } public static int KH() { return c.aSA.getValue().intValue(); } public static boolean KI() { return c.aSB.getValue().intValue() == 1; } public static int KJ() { return c.aTa.getValue().intValue(); } public static int KK() { return c.aTb.getValue().intValue(); } public static int KL() { return c.aTc.getValue().intValue(); } public static long KM() { return ((long) c.aTd.getValue().intValue()) * 60000; } public static boolean KN() { return c.aTl.getValue().intValue() == 1; } public static int KO() { return c.aTs.getValue().intValue(); } public static boolean KP() { return c.aTt.getValue().booleanValue(); } public static boolean KQ() { return c.aTv.getValue().booleanValue(); } public static boolean KR() { return !c.aTx.getValue().booleanValue(); } public static boolean KS() { return c.aTz.getValue().intValue() == 1; } public static int KT() { return c.aTA.getValue().intValue(); } public static SdkConfigData KU() { if (aUp != null) { return aUp; } try { String cX = x.cX(((e) ServiceProvider.get(e.class)).getContext()); if (!TextUtils.isEmpty(cX)) { JSONObject jSONObject = new JSONObject(cX); SdkConfigData sdkConfigData = new SdkConfigData(); aUp = sdkConfigData; sdkConfigData.parseJson(jSONObject); } } catch (Exception unused) { } return aUp; } public static boolean KV() { return c.aSD.getValue().intValue() == 1; } public static boolean KW() { return c.aSE.getValue().intValue() == 1; } public static int KX() { return c.aSG.getValue().intValue(); } public static boolean KY() { return c.aSH.getValue().booleanValue(); } public static boolean KZ() { c.g(DevelopMangerComponents.class); return c.aTo.getValue().intValue() == 1; } public static TemplateConfig Kw() { return aUp.templateConfigMap.couponOpenConfig; } public static TemplateConfig Kx() { return aUp.templateConfigMap.couponInfoConfig; } public static boolean Ky() { return c.aSC.getValue().intValue() == 1; } @ForInvoker(methodId = "initConfigList") private static void Kz() { a.init(); com.kwad.components.ad.feed.kwai.a.init(); com.kwad.components.ad.fullscreen.kwai.a.init(); com.kwad.components.ad.interstitial.kwai.a.init(); com.kwad.components.ad.reward.kwai.a.init(); com.kwad.components.ad.splashscreen.a.a.init(); com.kwad.components.ct.kwai.a.init(); com.kwad.components.ct.detail.kwai.a.init(); com.kwad.components.ct.entry.kwai.a.init(); com.kwad.components.ct.home.config.a.init(); com.kwad.components.ct.horizontal.kwai.a.init(); com.kwad.components.ct.wallpaper.kwai.a.init(); } public static boolean La() { return c.aTZ.getValue().intValue() == 1; } public static int Lb() { return c.aSF.getValue().intValue(); } public static int Lc() { return c.aTK.getValue().intValue(); } public static int Ld() { return c.aTJ.getValue().intValue(); } public static boolean Le() { return c.aTL.getValue().intValue() == 1; } public static boolean Lf() { return c.aTM.getValue().booleanValue(); } public static float Lg() { float floatValue = c.aTN.getValue().floatValue(); if (floatValue <= 0.0f || floatValue > 1.0f) { return 0.3f; } return floatValue; } public static float Lh() { return c.aTO.getValue().floatValue(); } public static boolean Li() { return c.aTP.getValue().booleanValue(); } public static boolean Lj() { return c.aTY.getValue().intValue() == 1; } public static long Lk() { return c.aTX.getValue().longValue(); } public static boolean Ll() { return c.aUc.LG(); } public static com.kwad.sdk.core.network.idc.kwai.a Lm() { return (com.kwad.sdk.core.network.idc.kwai.a) c.aUe.getValue(); } public static long Ln() { return c.aUf.getValue().longValue(); } public static boolean Lo() { return c.aUg.getValue().booleanValue() && Lp() > 0 && Lp() <= 100; } public static int Lp() { return c.aUh.getValue().intValue(); } public static boolean Lq() { return c.aUi.getValue().floatValue() == 1.0f; } public static boolean Lr() { return c.aUj.LG(); } public static boolean Ls() { return c.aUk.LG(); } public static String Lt() { return c.aUl.getValue(); } public static String Lu() { return c.aUm.getValue(); } public static String Lv() { return c.aUn.getValue(); } public static boolean R(long j) { return (j & c.aSI.getValue().longValue()) != 0; } public static int a(k kVar) { Integer num = (Integer) b((b) kVar); if (num == null) { num = (Integer) kVar.Lw(); } return num.intValue(); } public static long a(m mVar) { Long l = (Long) b(mVar); if (l == null) { l = (Long) mVar.Lw(); } return l.longValue(); } public static String a(p pVar) { String str = (String) b(pVar); return str != null ? str : (String) pVar.Lw(); } public static JSONObject a(com.kwad.sdk.core.config.item.e eVar) { JSONObject jSONObject = (JSONObject) b(eVar); return jSONObject != null ? jSONObject : (JSONObject) eVar.Lw(); } public static boolean a(com.kwad.sdk.core.config.item.d dVar) { Boolean bool = (Boolean) b(dVar); if (bool == null) { bool = (Boolean) dVar.Lw(); } return bool.booleanValue(); } private static <T> T b(b<T> bVar) { if (isLoaded()) { return bVar.getValue(); } final Context context = ((e) ServiceProvider.get(e.class)).getContext(); b.a(context, bVar); g.execute(new aw() { /* class com.kwad.sdk.core.config.d.AnonymousClass1 */ @Override // com.kwad.sdk.utils.aw public final void mc() { d.bj(context); } }); return bVar.getValue(); } public static boolean b(k kVar) { Integer num = (Integer) b((b) kVar); return num != null ? num.intValue() > 0 : ((Integer) kVar.Lw()).intValue() > 0; } public static synchronized void bj(Context context) { synchronized (d.class) { AtomicBoolean atomicBoolean = aUo; if (!atomicBoolean.get()) { com.kwad.sdk.core.e.b.d("SdkConfigManager", "loadCache"); c.init(); Kz(); b.bi(context); KU(); atomicBoolean.set(true); } } } private static synchronized File bk(Context context) { File file; synchronized (d.class) { file = new File(context.getCacheDir(), "template"); } return file; } public static void c(SdkConfigData sdkConfigData) { aUp = sdkConfigData; } public static String getLogObiwanData() { return c.aTW.getValue(); } public static String getTips(String str) { TipsConfigItem.TipConfigData tipConfigData = (TipsConfigItem.TipConfigData) c.aSU.getValue(); return tipConfigData != null ? tipConfigData.getTips(str) : ""; } public static String getUserAgent() { return c.aTH.getValue(); } public static boolean gq() { return c.aTS.getValue().booleanValue(); } public static boolean isCanUseTk() { return c.aTw.getValue().booleanValue(); } public static boolean isLoaded() { return aUo.get(); } public static boolean isShowTips() { TipsConfigItem.TipConfigData tipConfigData = (TipsConfigItem.TipConfigData) c.aSU.getValue(); if (tipConfigData != null) { return tipConfigData.isShowTips(); } return true; } }