CarrotChat v2.8.60.240131版本的 MD5 值为:2baf8b9f31830b86b5c5a85ae6b47e05

以下内容为反编译后的 AKCAppConfiguration.java 源代码,内容仅作参考


package ak.im.uitls;

import ak.application.AKApplication;
import ak.im.BuildConfig;
import ak.im.b2;
import ak.im.module.AkeyChatX509PrivateCA;
import ak.im.module.CountryBean;
import ak.im.module.EnterpriseInfo;
import ak.im.module.IMMessage;
import ak.im.module.UpdateBean;
import ak.im.module.UpdateResult;
import ak.im.module.User;
import ak.im.o1;
import ak.im.sdk.manager.UpdateManager;
import ak.im.sdk.manager.ye;
import ak.im.ui.activity.ActivitySupport;
import ak.im.ui.activity.OldActivity;
import ak.im.ui.activity.gh0;
import ak.im.ui.view.UpdateDialog;
import ak.im.utils.AkeyChatUtils;
import ak.im.utils.HttpURLTools;
import ak.im.utils.Log;
import ak.im.utils.OneTimeCertData;
import ak.im.utils.f4;
import ak.im.utils.l4;
import ak.view.AKeyDialog;
import ak.worker.j0;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.LocaleList;
import android.view.View;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.Observer;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.m0;
import kotlin.jvm.internal.Ref$ObjectRef;
import kotlin.text.StringsKt__StringsKt;
import org.jetbrains.anko.AnkoAsyncContext;
import org.jetbrains.anko.AsyncKt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jivesoftware.smackx.amp.packet.AMPExtension;
import org.jivesoftware.smackx.xhtmlim.XHTMLText;
import org.slf4j.Marker;
@kotlin.j(d1 = {"\u0000<\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010%\n\u0002\b\u0007\n\u0002\u0010\u000b\n\u0002\b\t\n\u0002\u0010\b\n\u0002\b\u0012\n\u0002\u0010\t\n\u0002\b\u001a\n\u0002\u0010\u0002\n\u0002\b \bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0006\u0010\u0016\u001a\u00020\u000fJ\u0006\u0010\u0017\u001a\u00020\u000fJ\u0006\u0010\u0018\u001a\u00020\u0019J\u0006\u0010\u001a\u001a\u00020\u0019J\u0006\u0010\u001b\u001a\u00020\u000fJ\u0006\u0010\u001c\u001a\u00020\u000fJ\u0006\u0010\u001d\u001a\u00020\u000fJ\u0006\u0010\u001e\u001a\u00020\u000fJ\u0006\u0010\u001f\u001a\u00020\u000fJ\u0006\u0010 \u001a\u00020\u000fJ\u0006\u0010!\u001a\u00020\u000fJ\u0006\u0010\"\u001a\u00020\u000fJ\u000e\u0010#\u001a\u00020\u000f2\u0006\u0010$\u001a\u00020\u0004J\u0006\u0010%\u001a\u00020\u000fJ\u0006\u0010&\u001a\u00020\u000fJ\u0006\u0010'\u001a\u00020\u000fJ\u0006\u0010(\u001a\u00020\u000fJ\u0006\u0010)\u001a\u00020\u000fJ\u0006\u0010*\u001a\u00020\u000fJ\u0006\u0010+\u001a\u00020,J\u0006\u0010-\u001a\u00020\u0019J\u0006\u0010.\u001a\u00020\u0019J\u0006\u0010/\u001a\u00020\u000fJ\u0006\u00100\u001a\u00020\u0019J\u0006\u00101\u001a\u00020\u0019J\u0006\u00102\u001a\u00020\u000fJ\u001a\u00103\u001a\u0004\u0018\u00010\u00012\u0006\u00104\u001a\u00020\u00042\u0006\u00105\u001a\u00020\u0004H\u0002J\u0006\u00106\u001a\u00020\u0004J\u001a\u00107\u001a\u0004\u0018\u00010\u00012\u0006\u00104\u001a\u00020\u00042\b\b\u0002\u00108\u001a\u00020\u000fJ\u0006\u00109\u001a\u00020\u0004J\u0006\u0010:\u001a\u00020\u0004J\u0006\u0010;\u001a\u00020\u0004J\u0006\u0010<\u001a\u00020\u0004J\u0006\u0010=\u001a\u00020\u0004J\u0006\u0010>\u001a\u00020\u0004J\u0006\u0010?\u001a\u00020\u0004J\u0006\u0010@\u001a\u00020\u0004J\u0006\u0010A\u001a\u00020\u000fJ\u0006\u0010B\u001a\u00020\u0004J\u0006\u0010C\u001a\u00020\u0019J\u0006\u0010D\u001a\u00020\u0004J\u0006\u0010E\u001a\u00020\u0004J\u0006\u0010F\u001a\u00020GJ\u0006\u0010H\u001a\u00020GJ\u0006\u0010I\u001a\u00020\u000fJ\u0018\u0010J\u001a\u00020\u000f2\u0006\u0010K\u001a\u00020,2\u0006\u0010L\u001a\u00020,H\u0002J\u000e\u0010M\u001a\u00020\u000f2\u0006\u0010N\u001a\u00020\u0004J\u000e\u0010O\u001a\u00020\u000f2\u0006\u0010$\u001a\u00020\u0004J\u0006\u0010P\u001a\u00020,J\u0006\u0010Q\u001a\u00020\u0004J\u0006\u0010R\u001a\u00020,J\u0006\u0010S\u001a\u00020\u000fJ\u0006\u0010T\u001a\u00020\u0004J\u000e\u0010U\u001a\u00020\u000f2\u0006\u0010V\u001a\u00020\u0004J\u0006\u0010W\u001a\u00020\u000fJ\u0006\u0010X\u001a\u00020\u0019J\u0006\u0010Y\u001a\u00020\u0004J\u0006\u0010Z\u001a\u00020,J\b\u0010[\u001a\u0004\u0018\u00010\u0004J\u0006\u0010\\\u001a\u00020\u000fJ\u0006\u0010]\u001a\u00020,J\u0006\u0010^\u001a\u00020\u0004J\u0006\u0010_\u001a\u00020\u0004J\u0006\u0010`\u001a\u00020\u000fJ\u0006\u0010a\u001a\u00020\u000fJ\u0006\u0010b\u001a\u00020\u000fJ\u0006\u0010c\u001a\u00020\u000fJ\u0006\u0010d\u001a\u00020\u0019J\u0006\u0010e\u001a\u00020\u0019J\u0006\u0010f\u001a\u00020\u0019R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R&\u0010\u0006\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u00010\u0007X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\b\u0010\t\"\u0004\b\n\u0010\u000bR\u001d\u0010\f\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u00010\u0007¢\u0006\b\n\u0000\u001a\u0004\b\r\u0010\tR\u001a\u0010\u000e\u001a\u00020\u000fX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0010\u0010\u0011\"\u0004\b\u0012\u0010\u0013R\u001a\u0010\u0014\u001a\u00020\u000fX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0014\u0010\u0011\"\u0004\b\u0015\u0010\u0013¨\u0006g"}, d2 = {"Lak/im/uitls/AKCAppConfiguration;", "", "()V", "AKCAppConfigurationCacheKey", "", "TAG", "config", "", "getConfig", "()Ljava/util/Map;", "setConfig", "(Ljava/util/Map;)V", "hintConfig", "getHintConfig", "hintConfigSuccess", "", "getHintConfigSuccess", "()Z", "setHintConfigSuccess", "(Z)V", "isConfiged", "setConfiged", "CanDnsResolve", "CanLogBn", "akeyidMax", "", "akeyidMin", "canGroupMuc", "canIgnoreBackground", "canIgnoreFileSend", "canIgnoreGroupBan", "canIgnoreGroupForbiden", "canIgnoreRosterLimit", "canInAppUpgrade", "canLeave", "canLoginByOneKey", IMMessage.CARD_SERVER_KEY, "canNotificationSetting", "canSLSLog", "canShowAccessInfo", "canShowFileInfo", "changeToMainForBn", "checkmtls", "clearCacheFileTime", "", "connRetries", "connTimeout", "dataRepair", "forwardInterval", "forwardMsgMultiLimit", "forwardResume", "get", "key", "pKey", "getCountryDownloadUrl", "getFromHint", "language", "getNetCheck", "getNotifyCheck", "getSurveillanceIv1", "getSurveillanceIv2", "getSurveillanceIv3", "getSurveillanceKey1", "getSurveillanceKey2", "getSurveillanceKey3", "hideScan", "hotline", "imgMsgMultiLimit", "informationOne", "informationTwo", "initConfig", "", "initHintConfig", "interruptTLSInvalid", "isExpires", "now", "notafter", "isNickBan", "nick", "isSecure", "leaveTime", "m5m", "mtlsExpireat", "mtlsIsExpires", "mtlscert", "needRecord", "code", "newTopMessageProvider", "oneKeyApiOutTime", "oss", "pushCacheTime", "readLocalCountry", "reportOldStats", "slsExpirationGap", "stats", "stats2", "supportAiReplay", "supportCheckHead", "supportFeedback", "supportSurveillance", "textMsgLengthLimit", "xpingRetries", "xpingTimeout", "ak-im_carrotArmV7Release"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class AKCAppConfiguration {
    private static boolean f3476b;
    private static boolean f3479e;
    @NotNull
    public static final AKCAppConfiguration a = new AKCAppConfiguration();
    @NotNull
    private static Map<String, Object> f3477c = new LinkedHashMap();
    @NotNull
    private static final Map<String, Object> f3478d = new LinkedHashMap();

    private AKCAppConfiguration() {
    }

    public static final void a(final Ref$ObjectRef activty) {
        kotlin.jvm.internal.r.checkNotNullParameter(activty, "$activty");
        final AKeyDialog aKeyDialog = new AKeyDialog((Context) activty.element);
        aKeyDialog.setTip(((Activity) activty.element).getString(b2.mtls_expire_hint));
        aKeyDialog.setPositiveButton(((Activity) activty.element).getString(b2.confirm), new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                AKCAppConfiguration.b(Ref$ObjectRef.this, aKeyDialog, view);
            }
        });
        aKeyDialog.setNegativeButton(((Activity) activty.element).getString(b2.cancel), new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                AKCAppConfiguration.f(AKeyDialog.this, activty, view);
            }
        });
        aKeyDialog.setCanceledOnTouchOutside(false);
        aKeyDialog.show();
    }

    public static final void b(final Ref$ObjectRef activty, final AKeyDialog dilog, View view) {
        Locale locale;
        kotlin.jvm.internal.r.checkNotNullParameter(activty, "$activty");
        kotlin.jvm.internal.r.checkNotNullParameter(dilog, "$dilog");
        if (Build.VERSION.SDK_INT >= 24) {
            locale = LocaleList.getDefault().get(0);
            kotlin.jvm.internal.r.checkNotNullExpressionValue(locale, "{\n                      …                        }");
        } else {
            locale = Locale.getDefault();
            kotlin.jvm.internal.r.checkNotNullExpressionValue(locale, "{\n                      …                        }");
        }
        String str = locale.getLanguage() + '_' + ((Object) locale.getCountry());
        EnterpriseInfo currentEnterpriseInfo = ye.getInstance().getmEnterpriseCfg().getCurrentEnterpriseInfo();
        String str2 = (currentEnterpriseInfo == null ? null : currentEnterpriseInfo.enterpriseID) == null ? "" : currentEnterpriseInfo.enterpriseID;
        String propValue = ye.getInstance().getPropValue("ro.product.manufacturer");
        if (propValue == null || propValue.length() == 0) {
            String str3 = Build.BRAND;
            propValue = str3 != null ? str3 : "";
        }
        Locale locale2 = Locale.ROOT;
        String lowerCase = BuildConfig.PRODUCT_PKG_NAME.toLowerCase(locale2);
        kotlin.jvm.internal.r.checkNotNullExpressionValue(lowerCase, "this as java.lang.String).toLowerCase(Locale.ROOT)");
        kotlin.jvm.internal.r.checkNotNullExpressionValue(propValue, "propValue");
        String upperCase = propValue.toUpperCase(locale2);
        kotlin.jvm.internal.r.checkNotNullExpressionValue(upperCase, "this as java.lang.String).toUpperCase(Locale.ROOT)");
        new ak.f.b(ye.getCountServerURL(), false, false).getAKAPI(10).getUpdateRole(m0.hashMapOf(kotlin.l.to("current_version", ye.getInstance().getVersion()), kotlin.l.to("product_type", BuildConfig.PRODUCT_TYPE), kotlin.l.to("device_system", "android"), kotlin.l.to("device_version", Build.VERSION.RELEASE), kotlin.l.to("device_language", str), kotlin.l.to("server_id", str2), kotlin.l.to("serial_number", ye.getInstance().getmLoginCfg().getUuid()), kotlin.l.to("package_name", lowerCase), kotlin.l.to("manufacturer", upperCase))).subscribeOn(io.reactivex.w0.a.io()).observeOn(io.reactivex.q0.c.a.mainThread()).subscribe(new io.reactivex.s0.g() {
            @Override
            public final void accept(Object obj) {
                AKCAppConfiguration.c(Ref$ObjectRef.this, dilog, (UpdateResult) obj);
            }
        }, new io.reactivex.s0.g() {
            @Override
            public final void accept(Object obj) {
                AKCAppConfiguration.e(Ref$ObjectRef.this, dilog, (Throwable) obj);
            }
        });
    }

    public static final void c(Ref$ObjectRef activty, AKeyDialog dilog, UpdateResult updateResult) {
        gh0 iBaseActivity;
        kotlin.jvm.internal.r.checkNotNullParameter(activty, "$activty");
        kotlin.jvm.internal.r.checkNotNullParameter(dilog, "$dilog");
        if (updateResult.getReturnCode() == 0 && updateResult.getUpdateBean() != null && updateResult.getUpdateBean().getUpgrade() != 0) {
            T t = activty.element;
            if (t instanceof gh0) {
                iBaseActivity = (gh0) t;
            } else if (t instanceof OldActivity) {
                iBaseActivity = ((OldActivity) t).getIBaseActivity();
            } else {
                iBaseActivity = t instanceof ActivitySupport ? ((ActivitySupport) t).getIBaseActivity() : null;
            }
            if (iBaseActivity != null) {
                final UpdateDialog updateDialog = new UpdateDialog(iBaseActivity);
                UpdateManager.a aVar = UpdateManager.a;
                LiveData<UpdateBean> updateBeanLiveData = aVar.getInstance().getUpdateBeanLiveData();
                T t2 = activty.element;
                Objects.requireNonNull(t2, "null cannot be cast to non-null type androidx.lifecycle.LifecycleOwner");
                updateBeanLiveData.removeObservers((LifecycleOwner) t2);
                LiveData<UpdateBean> updateBeanLiveData2 = aVar.getInstance().getUpdateBeanLiveData();
                T t3 = activty.element;
                Objects.requireNonNull(t3, "null cannot be cast to non-null type androidx.lifecycle.LifecycleOwner");
                updateBeanLiveData2.observe((LifecycleOwner) t3, new Observer() {
                    @Override
                    public final void onChanged(Object obj) {
                        AKCAppConfiguration.d(UpdateDialog.this, (UpdateBean) obj);
                    }
                });
                dilog.dismiss();
                updateDialog.startCheckVersion(true);
                return;
            }
        }
        AkeyChatUtils.goToMarket((Context) activty.element);
        dilog.dismiss();
    }

    public static final void d(UpdateDialog updateDialog, UpdateBean updateBean) {
        kotlin.jvm.internal.r.checkNotNullParameter(updateDialog, "$updateDialog");
        if (updateBean == null || updateBean.getUpgrade() == 0 || UpdateManager.a.getInstance().getHasShownAuto()) {
            return;
        }
        updateDialog.init(false);
    }

    public static final void e(Ref$ObjectRef activty, AKeyDialog dilog, Throwable th) {
        kotlin.jvm.internal.r.checkNotNullParameter(activty, "$activty");
        kotlin.jvm.internal.r.checkNotNullParameter(dilog, "$dilog");
        AkeyChatUtils.goToMarket((Context) activty.element);
        dilog.dismiss();
    }

    public static final void f(AKeyDialog dilog, Ref$ObjectRef activty, View view) {
        kotlin.jvm.internal.r.checkNotNullParameter(dilog, "$dilog");
        kotlin.jvm.internal.r.checkNotNullParameter(activty, "$activty");
        dilog.dismiss();
        ((Activity) activty.element).finish();
        Application application = ((Activity) activty.element).getApplication();
        Objects.requireNonNull(application, "null cannot be cast to non-null type ak.application.AKApplication");
        ((AKApplication) application).doPreparedWorkBeforeExit(2, null);
        o1.sendStopService(false, false, true);
    }

    private final Object g(String str, String str2) {
        boolean z;
        boolean z2;
        boolean z3 = false;
        if (str != null) {
            try {
            } catch (Throwable th) {
                th.printStackTrace();
            }
            if (str.length() != 0) {
                z = false;
                if (!z) {
                    if (str2 != null && str2.length() != 0) {
                        z2 = false;
                        if (!z2) {
                            Map<String, Object> map = f3477c;
                            if (!((map == null || map.isEmpty()) ? true : true) && f3477c.get("data") != null) {
                                Object obj = f3477c.get("data");
                                if (obj != null) {
                                    Map map2 = (Map) obj;
                                    if (map2.containsKey(str2)) {
                                        Object obj2 = map2.get(str2);
                                        if (obj2 != null) {
                                            Map map3 = (Map) obj2;
                                            if (map3.containsKey(str)) {
                                                return map3.get(str);
                                            }
                                        } else {
                                            throw new NullPointerException("null cannot be cast to non-null type kotlin.collections.Map<kotlin.String, kotlin.Any>");
                                        }
                                    }
                                } else {
                                    throw new NullPointerException("null cannot be cast to non-null type kotlin.collections.Map<kotlin.String, kotlin.Any>");
                                }
                            }
                            return null;
                        }
                    }
                    z2 = true;
                    if (!z2) {
                    }
                }
                return null;
            }
        }
        z = true;
        if (!z) {
        }
        return null;
    }

    public static Object getFromHint$default(AKCAppConfiguration aKCAppConfiguration, String str, boolean z, int i, Object obj) {
        if ((i & 2) != 0) {
            z = false;
        }
        return aKCAppConfiguration.getFromHint(str, z);
    }

    private final boolean h(long j, long j2) {
        boolean z = false;
        if (j > 0 && j2 > 0) {
            boolean z2 = j > j2;
            if (!z2 || f4.isInternetTimeRight()) {
                z = z2;
            } else {
                Log.e("AKCAppConfiguration", "expires but time is not trusty");
            }
        }
        StringBuilder sb = new StringBuilder();
        sb.append(j);
        sb.append('|');
        sb.append(j2);
        sb.append('|');
        sb.append(z);
        Log.d("AKCAppConfiguration", sb.toString());
        return z;
    }

    public final boolean CanDnsResolve() {
        Object g = g("CanDnsResolve", "f");
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return true;
    }

    public final boolean CanLogBn() {
        Object g = g("bnlog", "f");
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return true;
    }

    public final int akeyidMax() {
        try {
            Object g = g("akeyidmax", XHTMLText.P);
            if (g != null) {
                return (int) ((Double) g).doubleValue();
            }
            return 20;
        } catch (Throwable unused) {
            return 20;
        }
    }

    public final int akeyidMin() {
        try {
            Object g = g("akeyidmin", XHTMLText.P);
            if (g != null) {
                return (int) ((Double) g).doubleValue();
            }
            return 6;
        } catch (Throwable unused) {
            return 6;
        }
    }

    public final boolean canGroupMuc() {
        boolean equals;
        Object g = g("groupmcu-setting", "f");
        List<String> emptyList = g != null ? (List) g : CollectionsKt__CollectionsKt.emptyList();
        if (!emptyList.isEmpty()) {
            String enterpriseId = ye.getInstance().getServer().getEnterpriseId();
            for (String str : emptyList) {
                equals = kotlin.text.t.equals(str, enterpriseId, true);
                if (equals) {
                    return true;
                }
            }
            return false;
        }
        return true;
    }

    public final boolean canIgnoreBackground() {
        Object g = g("can_ignore_back", XHTMLText.P);
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return true;
    }

    public final boolean canIgnoreFileSend() {
        Object g = g("IgnoreFileSend", com.nostra13.universalimageloader.core.d.a);
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return false;
    }

    public final boolean canIgnoreGroupBan() {
        Object g = g("IgnoreGroupBan", com.nostra13.universalimageloader.core.d.a);
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return false;
    }

    public final boolean canIgnoreGroupForbiden() {
        Object g = g("IgnoreGroupForbiden", com.nostra13.universalimageloader.core.d.a);
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return false;
    }

    public final boolean canIgnoreRosterLimit() {
        Object g = g("IgnoreRosterLimit", com.nostra13.universalimageloader.core.d.a);
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return false;
    }

    public final boolean canInAppUpgrade() {
        Object g = g("in-app-upgrade", "f");
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return true;
    }

    public final boolean canLeave() {
        Object g = g("leave_app_btn", XHTMLText.P);
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return true;
    }

    public final boolean canLoginByOneKey(@NotNull String serverId) {
        kotlin.jvm.internal.r.checkNotNullParameter(serverId, "serverId");
        try {
            Object g = g("aliauth", "f");
            List arrayList = g != null ? (List) g : new ArrayList();
            if (arrayList.isEmpty()) {
                return true;
            }
            if ((serverId.length() == 0) || arrayList.contains(Marker.ANY_MARKER)) {
                return false;
            }
            return true ^ arrayList.contains(serverId);
        } catch (Throwable unused) {
            return true;
        }
    }

    public final boolean canNotificationSetting() {
        boolean equals;
        Object g = g("notification-setting", "f");
        List<String> emptyList = g != null ? (List) g : CollectionsKt__CollectionsKt.emptyList();
        if (!emptyList.isEmpty()) {
            String enterpriseId = ye.getInstance().getServer().getEnterpriseId();
            for (String str : emptyList) {
                equals = kotlin.text.t.equals(str, enterpriseId, true);
                if (equals) {
                    return true;
                }
            }
            return false;
        }
        return true;
    }

    public final boolean canSLSLog() {
        Object g = g("sls-log", "f");
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return true;
    }

    public final boolean canShowAccessInfo() {
        Object g = g("ShowAccessInfo", com.nostra13.universalimageloader.core.d.a);
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return false;
    }

    public final boolean canShowFileInfo() {
        Object g = g("ShowFileInfo", com.nostra13.universalimageloader.core.d.a);
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return false;
    }

    public final boolean changeToMainForBn() {
        Object g = g("BoxtalkNewNodeEnable", "f");
        Log.debug("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("changeToMainForBn ", g));
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return true;
    }

    public final boolean checkmtls() {
        boolean z;
        Date[] dateArr;
        String str;
        long time;
        String str2;
        final Ref$ObjectRef ref$ObjectRef;
        T t;
        Activity activity;
        while (true) {
            z = f3476b;
            if (z) {
                break;
            }
            Thread.sleep(100L);
        }
        Log.d("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("checkmtls isConfiged:", Boolean.valueOf(z)));
        try {
            dateArr = AkeyChatX509PrivateCA.mtlsDateValidity();
        } catch (Throwable unused) {
            dateArr = null;
        }
        if (dateArr == null || dateArr.length != 2) {
            return true;
        }
        long rightTime = f4.getRightTime() + 1296000000;
        if (mtlsExpireat() > 0) {
            str = "AKCAppConfiguration";
            time = mtlsExpireat() * 1000;
        } else {
            str = "AKCAppConfiguration";
            time = dateArr[1].getTime();
        }
        boolean h = h(rightTime, time);
        if (!h) {
            return true;
        }
        try {
            String mtlscert = mtlscert();
            str2 = str;
            try {
                Log.d(str2, kotlin.jvm.internal.r.stringPlus("checkmtls url:", mtlscert));
                byte[] d2 = HttpURLTools.getBytesFromHttpsUrl(mtlscert, 5000, null, null);
                com.google.gson.d dVar = new com.google.gson.d();
                kotlin.jvm.internal.r.checkNotNullExpressionValue(d2, "d");
                Map c2 = (Map) dVar.fromJson(new String(d2, kotlin.text.d.f18383b), (Type) Map.class);
                Log.d(str2, kotlin.jvm.internal.r.stringPlus("checkmtls success:", c2));
                kotlin.jvm.internal.r.checkNotNullExpressionValue(c2, "c");
                if (!c2.isEmpty()) {
                    Object obj = c2.get("meta");
                    if (obj != null) {
                        Map map = (Map) obj;
                        Object obj2 = c2.get("cert");
                        if (obj2 != null) {
                            Map map2 = (Map) obj2;
                            Object obj3 = map.get("kid");
                            if (obj3 != null) {
                                OneTimeCertData.kid = (String) obj3;
                                Object obj4 = map.get("share");
                                if (obj4 != null) {
                                    OneTimeCertData.share = (String) obj4;
                                    Object obj5 = map.get("iv");
                                    if (obj5 != null) {
                                        OneTimeCertData.iv = (String) obj5;
                                        Object obj6 = map.get("pass");
                                        if (obj6 != null) {
                                            OneTimeCertData.pass = (String) obj6;
                                            Object obj7 = map2.get("cert");
                                            if (obj7 != null) {
                                                OneTimeCertData.cert = (String) obj7;
                                                Object obj8 = map2.get("key");
                                                if (obj8 != null) {
                                                    OneTimeCertData.key = (String) obj8;
                                                    String kid = OneTimeCertData.kid;
                                                    kotlin.jvm.internal.r.checkNotNullExpressionValue(kid, "kid");
                                                    if (kid.length() > 0) {
                                                        String share = OneTimeCertData.share;
                                                        kotlin.jvm.internal.r.checkNotNullExpressionValue(share, "share");
                                                        if (share.length() > 0) {
                                                            String iv = OneTimeCertData.iv;
                                                            kotlin.jvm.internal.r.checkNotNullExpressionValue(iv, "iv");
                                                            if (iv.length() > 0) {
                                                                String pass = OneTimeCertData.pass;
                                                                kotlin.jvm.internal.r.checkNotNullExpressionValue(pass, "pass");
                                                                if (pass.length() > 0) {
                                                                    String cert = OneTimeCertData.cert;
                                                                    kotlin.jvm.internal.r.checkNotNullExpressionValue(cert, "cert");
                                                                    if (cert.length() > 0) {
                                                                        String key = OneTimeCertData.key;
                                                                        kotlin.jvm.internal.r.checkNotNullExpressionValue(key, "key");
                                                                        if (key.length() > 0) {
                                                                            try {
                                                                                OneTimeCertData.save();
                                                                                h = false;
                                                                            } catch (Exception e2) {
                                                                                e = e2;
                                                                                h = false;
                                                                                Log.e(str2, kotlin.jvm.internal.r.stringPlus("checkmtls e:", e.getMessage()));
                                                                                if (h) {
                                                                                }
                                                                                if (h) {
                                                                                    ref$ObjectRef = new Ref$ObjectRef();
                                                                                    while (true) {
                                                                                        t = ref$ObjectRef.element;
                                                                                        if (t == 0) {
                                                                                        }
                                                                                        ref$ObjectRef.element = AKApplication.getTopActivity();
                                                                                    }
                                                                                    Log.d(str2, kotlin.jvm.internal.r.stringPlus("checkmtls in activty:", ref$ObjectRef.element));
                                                                                    activity = (Activity) ref$ObjectRef.element;
                                                                                    if (activity != null) {
                                                                                    }
                                                                                }
                                                                                return !interruptTLSInvalid() ? true : true;
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    Log.e(str2, "mtls update error");
                                                    OneTimeCertData.kid = null;
                                                    OneTimeCertData.share = null;
                                                    OneTimeCertData.iv = null;
                                                    OneTimeCertData.pass = null;
                                                    OneTimeCertData.cert = null;
                                                    OneTimeCertData.key = null;
                                                } else {
                                                    throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
                                                }
                                            } else {
                                                throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
                                            }
                                        } else {
                                            throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
                                        }
                                    } else {
                                        throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
                                    }
                                } else {
                                    throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
                                }
                            } else {
                                throw new NullPointerException("null cannot be cast to non-null type kotlin.String");
                            }
                        } else {
                            throw new NullPointerException("null cannot be cast to non-null type kotlin.collections.Map<kotlin.String, kotlin.Any>");
                        }
                    } else {
                        throw new NullPointerException("null cannot be cast to non-null type kotlin.collections.Map<kotlin.String, kotlin.Any>");
                    }
                }
            } catch (Exception e3) {
                e = e3;
            }
        } catch (Exception e4) {
            e = e4;
            str2 = str;
        }
        if (h) {
            long rightTime2 = f4.getRightTime();
            long time2 = dateArr[1].getTime();
            h = h(rightTime2, time2);
            StringBuilder sb = new StringBuilder();
            sb.append(time2);
            sb.append('|');
            sb.append(rightTime2);
            sb.append('|');
            sb.append(h);
            Log.d(str2, sb.toString());
        }
        if (h && interruptTLSInvalid()) {
            ref$ObjectRef = new Ref$ObjectRef();
            while (true) {
                t = ref$ObjectRef.element;
                if (t == 0 && !((Activity) t).isFinishing()) {
                    break;
                }
                ref$ObjectRef.element = AKApplication.getTopActivity();
            }
            Log.d(str2, kotlin.jvm.internal.r.stringPlus("checkmtls in activty:", ref$ObjectRef.element));
            activity = (Activity) ref$ObjectRef.element;
            if (activity != null) {
                activity.runOnUiThread(new Runnable() {
                    @Override
                    public final void run() {
                        AKCAppConfiguration.a(Ref$ObjectRef.this);
                    }
                });
            }
        }
        if (!interruptTLSInvalid() && h) {
            return false;
        }
    }

    public final long clearCacheFileTime() {
        Object g = g("clear_cache_time", XHTMLText.P);
        return (g != null ? (int) ((Double) g).doubleValue() : 7) * 24 * 60 * 60 * 1000;
    }

    public final int connRetries() {
        Object g = g("conn_retries", XHTMLText.P);
        if (g != null) {
            return (int) ((Double) g).doubleValue();
        }
        return 1;
    }

    public final int connTimeout() {
        Object g = g("conn_timeout", XHTMLText.P);
        if (g != null) {
            return (int) ((Double) g).doubleValue();
        }
        return 7500;
    }

    public final boolean dataRepair() {
        try {
            Object g = g("dataRepair", "f");
            if (g != null) {
                return ((Boolean) g).booleanValue();
            }
            return true;
        } catch (Throwable unused) {
            return true;
        }
    }

    public final int forwardInterval() {
        try {
            Object g = g("forwardInterval", XHTMLText.P);
            if (g != null) {
                return (int) ((Double) g).doubleValue();
            }
            return 0;
        } catch (Throwable unused) {
            return 0;
        }
    }

    public final int forwardMsgMultiLimit() {
        try {
            Object g = g("forwardMsgMultiLimit", XHTMLText.P);
            if (g != null) {
                return (int) ((Double) g).doubleValue();
            }
            return 100;
        } catch (Throwable unused) {
            return 100;
        }
    }

    public final boolean forwardResume() {
        try {
            Object g = g("forwardResume", "f");
            if (g != null) {
                return ((Boolean) g).booleanValue();
            }
            return true;
        } catch (Throwable unused) {
            return true;
        }
    }

    @NotNull
    public final Map<String, Object> getConfig() {
        return f3477c;
    }

    @NotNull
    public final String getCountryDownloadUrl() {
        try {
            Object g = g("countrycodeconfig", User.NAME_PREFIX);
            return g != null ? (String) g : "https://akey-app-configuration.oss-accelerate.aliyuncs.com/config/countrycode.json";
        } catch (Throwable unused) {
            return "https://akey-app-configuration.oss-accelerate.aliyuncs.com/config/countrycode.json";
        }
    }

    @Nullable
    public final Object getFromHint(@NotNull String key, boolean z) {
        kotlin.jvm.internal.r.checkNotNullParameter(key, "key");
        try {
            if (z) {
                int i = l4.currentLanguageIsChinese(o1.get()) ? 0 : 1;
                Map<String, Object> map = f3478d;
                Log.i("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("getFromHint ", map.get(key)));
                Object obj = map.get(key);
                if (obj != null) {
                    return ((List) obj).get(i);
                }
                throw new NullPointerException("null cannot be cast to non-null type kotlin.collections.List<*>");
            } else if ((kotlin.jvm.internal.r.areEqual(AMPExtension.Action.ATTRIBUTE_NAME, key) || kotlin.jvm.internal.r.areEqual("type", key)) && f3478d.get(key) == null) {
                return Double.valueOf(0.0d);
            } else {
                return f3478d.get(key);
            }
        } catch (Exception e2) {
            e2.printStackTrace();
            Log.e("AKCAppConfiguration", "getFromHint failed key is " + key + " ,e is " + ((Object) e2.getMessage()));
            return null;
        }
    }

    @NotNull
    public final Map<String, Object> getHintConfig() {
        return f3478d;
    }

    public final boolean getHintConfigSuccess() {
        return f3479e;
    }

    @NotNull
    public final String getNetCheck() {
        Object g = g("netcheck", "f");
        return g != null ? (String) g : "";
    }

    @NotNull
    public final String getNotifyCheck() {
        String str;
        Object g = g("notify-check", "f");
        StringBuilder sb = new StringBuilder();
        if (g != null) {
            str = (String) g;
        } else {
            str = ak.im.g2.c.a.a.isFlavor("zenchat") ? "https://pub.renxiaoliao.com/notifyaccess.html" : "https://pub.akeydown.com/notifyaccess.html";
        }
        sb.append(str);
        sb.append('?');
        sb.append(System.currentTimeMillis());
        return sb.toString();
    }

    @NotNull
    public final String getSurveillanceIv1() {
        try {
            Object g = g("surveillanceiv1", XHTMLText.P);
            return g != null ? (String) g : "g6uoMOaeIwmC8CDtXMBZ1ROTVkWTp2+MoccoZQOdlF4=";
        } catch (Throwable unused) {
            return "g6uoMOaeIwmC8CDtXMBZ1ROTVkWTp2+MoccoZQOdlF4=";
        }
    }

    @NotNull
    public final String getSurveillanceIv2() {
        try {
            Object g = g("surveillanceiv2", XHTMLText.P);
            return g != null ? (String) g : "8ut8LgbaV6Fq+g45JM6/MoAPGrBbGQLLzoA/30cig7I=";
        } catch (Throwable unused) {
            return "8ut8LgbaV6Fq+g45JM6/MoAPGrBbGQLLzoA/30cig7I=";
        }
    }

    @NotNull
    public final String getSurveillanceIv3() {
        try {
            Object g = g("surveillanceiv3", XHTMLText.P);
            return g != null ? (String) g : "8ut8LgbaV6Fq+g45JM6/MoAPGrBbGQLLzoA/30cig7I=";
        } catch (Throwable unused) {
            return "8ut8LgbaV6Fq+g45JM6/MoAPGrBbGQLLzoA/30cig7I=";
        }
    }

    @NotNull
    public final String getSurveillanceKey1() {
        try {
            Object g = g("surveillancekey1", XHTMLText.P);
            return g != null ? (String) g : "6W6iNYaBCjd67/xkU/8eTvb6IDEoM1xouDg3YdeioDoO1SMocEns/CiB1LBFknes";
        } catch (Throwable unused) {
            return "6W6iNYaBCjd67/xkU/8eTvb6IDEoM1xouDg3YdeioDoO1SMocEns/CiB1LBFknes";
        }
    }

    @NotNull
    public final String getSurveillanceKey2() {
        try {
            Object g = g("surveillancekey2", XHTMLText.P);
            return g != null ? (String) g : "R0sudX0+dkH3CIEsq02oztqc3i0Nkqkz2c63tviBqP/Q0Xq/dc1UtgeX7C1rDHHz";
        } catch (Throwable unused) {
            return "R0sudX0+dkH3CIEsq02oztqc3i0Nkqkz2c63tviBqP/Q0Xq/dc1UtgeX7C1rDHHz";
        }
    }

    @NotNull
    public final String getSurveillanceKey3() {
        try {
            Object g = g("surveillancekey3", XHTMLText.P);
            return g != null ? (String) g : "R0sudX0+dkH3CIEsq02oztqc3i0Nkqkz2c63tviBqP/Q0Xq/dc1UtgeX7C1rDHHz";
        } catch (Throwable unused) {
            return "R0sudX0+dkH3CIEsq02oztqc3i0Nkqkz2c63tviBqP/Q0Xq/dc1UtgeX7C1rDHHz";
        }
    }

    public final boolean hideScan() {
        Object g = g("in-review", "f");
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return false;
    }

    @NotNull
    public final String hotline() {
        Object g = g("bnlog", User.NAME_PREFIX);
        return g != null ? (String) g : "400-823-0608";
    }

    public final int imgMsgMultiLimit() {
        int i = 100;
        try {
            Object g = g("imgMsgMultiLimit", XHTMLText.P);
            if (g != null) {
                i = (int) ((Double) g).doubleValue();
            }
        } catch (Throwable unused) {
        }
        return i - 1;
    }

    @NotNull
    public final String informationOne() {
        String str;
        Object g = g("picl", User.NAME_PREFIX);
        if (kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, "enterprise")) {
            str = "http://app.akeydown.com/ent_picl.html";
        } else if (kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, BuildConfig.FLAVOR_akProduct)) {
            str = "http://app.akeydown.com/carrot_picl.html";
        } else if (kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, "boxtalk")) {
            str = "http://app.akeydown.com/boxtalk_picl.html";
        } else {
            if (kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, "anxintong") ? true : kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, "calculator")) {
                str = "http://app.akeydown.com/axt_picl.html";
            } else if (kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, "gov")) {
                str = "http://app.akeydown.com/gov_picl.html";
            } else if (kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, "ansimixin")) {
                str = "http://app.akeydown.com/normal_picl.html";
            } else {
                str = kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, "zenchat") ? "https://pub.renxiaoliao.com/zenchat-picl.html" : "";
            }
        }
        return g != null ? (String) g : str;
    }

    @NotNull
    public final String informationTwo() {
        String str;
        Object g = g("tpisl", User.NAME_PREFIX);
        if (kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, "enterprise")) {
            str = "http://app.akeydown.com/ent_tpisl.html";
        } else if (kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, BuildConfig.FLAVOR_akProduct)) {
            str = "http://app.akeydown.com/carrot_tpisl.html";
        } else if (kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, "boxtalk")) {
            str = "http://app.akeydown.com/boxtalk_tpisl.html";
        } else {
            if (kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, "anxintong") ? true : kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, "calculator")) {
                str = "http://app.akeydown.com/axt_tpisl.html";
            } else if (kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, "gov")) {
                str = "http://app.akeydown.com/gov_tpisl.html";
            } else if (kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, "ansimixin")) {
                str = "http://app.akeydown.com/normal_tpisl.html";
            } else {
                str = kotlin.jvm.internal.r.areEqual(BuildConfig.FLAVOR_akProduct, "zenchat") ? "https://pub.renxiaoliao.com/zenchat-tpisl.html" : "";
            }
        }
        return g != null ? (String) g : str;
    }

    public final void initConfig() {
        AsyncKt.doAsync$default(this, null, new kotlin.jvm.b.l<AnkoAsyncContext<AKCAppConfiguration>, kotlin.v>() {

            @kotlin.j(d1 = {"\u0000'\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0005*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\"\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u00052\b\u0010\u0007\u001a\u0004\u0018\u00010\bH\u0016J$\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\u00032\b\u0010\u0007\u001a\u0004\u0018\u00010\b2\b\u0010\f\u001a\u0004\u0018\u00010\bH\u0016J\u0012\u0010\r\u001a\u00020\n2\b\u0010\u000e\u001a\u0004\u0018\u00010\bH\u0016¨\u0006\u000f"}, d2 = {"ak/im/uitls/AKCAppConfiguration$initConfig$1$1", "Lak/worker/FileDownloadListener;", "onRecvProgress", "", "cur", "", "total", "url", "", "onRecvResult", "", "result", "des", "receiveFileName", "fileName", "ak-im_carrotArmV7Release"}, k = 1, mv = {1, 6, 0}, xi = 48)
            public static final class a implements j0 {
                a() {
                }

                @Override
                public boolean onRecvProgress(long j, long j2, @Nullable String str) {
                    return false;
                }

                @Override
                public void onRecvResult(boolean z, @Nullable String str, @Nullable String str2) {
                }

                @Override
                public void receiveFileName(@Nullable String str) {
                }
            }

            @kotlin.j(d1 = {"\u0000\u001d\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0003\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\u0007\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u0002H\u0016¨\u0006\t"}, d2 = {"ak/im/uitls/AKCAppConfiguration$initConfig$1$2", "Lak/rxjava/AKObserver;", "", "onError", "", "e", "", "onNext", "p0", "ak-im_carrotArmV7Release"}, k = 1, mv = {1, 6, 0}, xi = 48)
            public static final class b extends ak.j.a<Object> {
                final File a;
                final Ref$ObjectRef<String> f3480b;

                b(File file, Ref$ObjectRef<String> ref$ObjectRef) {
                    this.a = file;
                    this.f3480b = ref$ObjectRef;
                }

                @Override
                public void onError(@NotNull Throwable e2) {
                    kotlin.jvm.internal.r.checkNotNullParameter(e2, "e");
                    Log.e("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("download netCheckUrl failed,reason is ", e2.getMessage()));
                }

                @Override
                public void onNext(@NotNull Object p0) {
                    kotlin.jvm.internal.r.checkNotNullParameter(p0, "p0");
                    Log.i("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("download result is ", Boolean.valueOf(this.a.exists())));
                    ye.getInstance().setNetCheckHtml(this.f3480b.element);
                }
            }

            @Override
            public kotlin.v invoke(AnkoAsyncContext<AKCAppConfiguration> ankoAsyncContext) {
                invoke2(ankoAsyncContext);
                return kotlin.v.a;
            }

            public final void invoke2(@NotNull AnkoAsyncContext<AKCAppConfiguration> doAsync) {
                kotlin.jvm.internal.r.checkNotNullParameter(doAsync, "$this$doAsync");
                try {
                    CountryBean fromJson = (CountryBean) new com.google.gson.d().fromJson(AKCAppConfiguration.a.readLocalCountry(), (Class<Object>) CountryBean.class);
                    kotlin.jvm.internal.r.checkNotNullExpressionValue(fromJson, "fromJson");
                    Log.debug("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("local country json is ", fromJson));
                    ye.getInstance().setCountryBean(fromJson);
                } catch (Throwable th) {
                    Log.debug("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("local country e is ", th.getLocalizedMessage()));
                    th.printStackTrace();
                }
                try {
                    String cache = ak.db.e.KV().getString("AKCAppConfiguration1", "");
                    kotlin.jvm.internal.r.checkNotNullExpressionValue(cache, "cache");
                    if (cache.length() > 0) {
                        Map<? extends String, ? extends Object> c2 = (Map) new com.google.gson.d().fromJson(cache, (Type) Map.class);
                        kotlin.jvm.internal.r.checkNotNullExpressionValue(c2, "c");
                        if (!c2.isEmpty()) {
                            AKCAppConfiguration.a.getConfig().putAll(c2);
                        }
                    }
                    String str = "https://akey-app-configuration.oss-accelerate.aliyuncs.com/apollo/android_luobo_" + ((Object) ye.getInstance().getBigVersion()) + ".json";
                    if (ak.db.e.KV().getBoolean("configdebug", false)) {
                        str = "https://akey-app-configuration.oss-accelerate.aliyuncs.com/apollodev/android_luobo_" + ((Object) ye.getInstance().getBigVersion()) + ".json";
                    }
                    Log.d("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("fileurl:", str));
                    byte[] bytesFromHttpsUrl = HttpURLTools.getBytesFromHttpsUrl(str, 3000, null, null);
                    if (bytesFromHttpsUrl != null) {
                        Map<? extends String, ? extends Object> c3 = (Map) new com.google.gson.d().fromJson(new String(bytesFromHttpsUrl, kotlin.text.d.f18383b), (Type) Map.class);
                        kotlin.jvm.internal.r.checkNotNullExpressionValue(c3, "c");
                        if (!c3.isEmpty()) {
                            AKCAppConfiguration aKCAppConfiguration = AKCAppConfiguration.a;
                            aKCAppConfiguration.getConfig().clear();
                            aKCAppConfiguration.getConfig().putAll(c3);
                        }
                    }
                    ak.db.e KV = ak.db.e.KV();
                    com.google.gson.d dVar = new com.google.gson.d();
                    AKCAppConfiguration aKCAppConfiguration2 = AKCAppConfiguration.a;
                    KV.putString("AKCAppConfiguration1", dVar.toJson(aKCAppConfiguration2.getConfig()));
                    HttpURLTools.initOssServerHosts(null);
                    aKCAppConfiguration2.setConfiged(true);
                    String netCheck = aKCAppConfiguration2.getNetCheck();
                    Ref$ObjectRef ref$ObjectRef = new Ref$ObjectRef();
                    ref$ObjectRef.element = kotlin.jvm.internal.r.stringPlus(l4.getGlobalCachePath(), l4.getFileName(netCheck));
                    File file = new File((String) ref$ObjectRef.element);
                    Log.debug("AKCAppConfiguration", "save path is " + ((String) ref$ObjectRef.element) + ",\n " + ((Object) l4.getGlobalCachePath()) + ((Object) l4.getFileName(netCheck)));
                    if (netCheck.length() > 0) {
                        new ak.i.l(netCheck, new a()).startDownloadFile(file, new b(file, ref$ObjectRef));
                    }
                    String countryDownloadUrl = aKCAppConfiguration2.getCountryDownloadUrl();
                    Log.d("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("countryUrl:", countryDownloadUrl));
                    byte[] bytesFromHttpsUrl2 = HttpURLTools.getBytesFromHttpsUrl(countryDownloadUrl, 3000, null, null);
                    if (bytesFromHttpsUrl2 != null) {
                        CountryBean fromJson2 = (CountryBean) new com.google.gson.d().fromJson(new String(bytesFromHttpsUrl2, kotlin.text.d.f18383b), (Class<Object>) CountryBean.class);
                        kotlin.jvm.internal.r.checkNotNullExpressionValue(fromJson2, "fromJson");
                        Log.debug("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("country json is ", fromJson2));
                        ye.getInstance().setCountryBean(fromJson2);
                    }
                } catch (Exception e2) {
                    Log.e("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("e:", e2.getMessage()));
                    AKCAppConfiguration.a.setConfiged(true);
                }
            }
        }, 1, null);
    }

    public final void initHintConfig() {
        if (f3479e) {
            return;
        }
        AsyncKt.doAsync$default(this, null, new kotlin.jvm.b.l<AnkoAsyncContext<AKCAppConfiguration>, kotlin.v>() {
            @Override
            public kotlin.v invoke(AnkoAsyncContext<AKCAppConfiguration> ankoAsyncContext) {
                invoke2(ankoAsyncContext);
                return kotlin.v.a;
            }

            public final void invoke2(@NotNull AnkoAsyncContext<AKCAppConfiguration> doAsync) {
                kotlin.jvm.internal.r.checkNotNullParameter(doAsync, "$this$doAsync");
                try {
                    String str = ak.db.e.KV().getBoolean("configdebug", false) ? "https://akey-app-configuration.oss-accelerate.aliyuncs.com/configuration/dev_luobo_banner.json" : "https://akey-app-configuration.oss-accelerate.aliyuncs.com/configuration/luobo_banner.json";
                    Log.d("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("fileurl:", str));
                    byte[] d2 = HttpURLTools.getBytesFromHttpsUrl(str, 3000, null, null);
                    kotlin.jvm.internal.r.checkNotNullExpressionValue(d2, "d");
                    String str2 = new String(d2, kotlin.text.d.f18383b);
                    Log.i("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("getFromHint is ", str2));
                    AKCAppConfiguration aKCAppConfiguration = AKCAppConfiguration.a;
                    aKCAppConfiguration.getHintConfig().clear();
                    Map<String, Object> hintConfig = aKCAppConfiguration.getHintConfig();
                    Object fromJson = new com.google.gson.d().fromJson(str2, (Type) Map.class);
                    kotlin.jvm.internal.r.checkNotNullExpressionValue(fromJson, "Gson().fromJson<Map<Stri…>>(json, Map::class.java)");
                    hintConfig.putAll((Map) fromJson);
                    aKCAppConfiguration.setHintConfigSuccess(true);
                } catch (Throwable th) {
                    Log.e("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("bannner e:", th.getMessage()));
                }
            }
        }, 1, null);
    }

    public final boolean interruptTLSInvalid() {
        Object g = g("interruptTLSInvalid", "f");
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return false;
    }

    public final boolean isConfiged() {
        return f3476b;
    }

    public final boolean isNickBan(@NotNull String nick) {
        boolean z;
        boolean z2;
        boolean equals;
        boolean contains;
        kotlin.jvm.internal.r.checkNotNullParameter(nick, "nick");
        Object g = g("nick-bans", "f");
        Iterator it = (g != null ? (List) g : CollectionsKt__CollectionsKt.emptyList()).iterator();
        while (true) {
            if (!it.hasNext()) {
                z = false;
                break;
            }
            contains = StringsKt__StringsKt.contains((CharSequence) nick, (CharSequence) ((String) it.next()), true);
            if (contains) {
                z = true;
                break;
            }
        }
        Object g2 = g("nick-bans-r", "f");
        List<String> emptyList = g2 != null ? (List) g2 : CollectionsKt__CollectionsKt.emptyList();
        if (!(!emptyList.isEmpty())) {
            z2 = true;
            break;
        }
        String enterpriseId = ye.getInstance().getServer().getEnterpriseId();
        for (String str : emptyList) {
            equals = kotlin.text.t.equals(str, enterpriseId, true);
            if (equals) {
                z2 = true;
                break;
            }
        }
        z2 = false;
        return z2 && z;
    }

    public final boolean isSecure(@NotNull String serverId) {
        kotlin.jvm.internal.r.checkNotNullParameter(serverId, "serverId");
        try {
            Object g = g("server-no-secure", com.nostra13.universalimageloader.core.d.a);
            return (g != null ? (List) g : new ArrayList()).contains(serverId);
        } catch (Throwable unused) {
            return false;
        }
    }

    public final long leaveTime() {
        Object g = g("leave_app_time", XHTMLText.P);
        return (g != null ? (long) ((Double) g).doubleValue() : 300L) * 1000;
    }

    @NotNull
    public final String m5m() {
        Object g = g("m5m", User.NAME_PREFIX);
        return g != null ? (String) g : "b.akey.me";
    }

    public final long mtlsExpireat() {
        Object g = g("mtls_expireat", com.nostra13.universalimageloader.core.d.a);
        if (g != null) {
            return (long) ((Double) g).doubleValue();
        }
        return 0L;
    }

    public final boolean mtlsIsExpires() {
        Date[] mtlsDateValidity = AkeyChatX509PrivateCA.mtlsDateValidity();
        if (mtlsDateValidity == null || mtlsDateValidity.length != 2) {
            return false;
        }
        return h(f4.getRightTime(), mtlsDateValidity[1].getTime());
    }

    @NotNull
    public final String mtlscert() {
        Object g = g("mtlscert", User.NAME_PREFIX);
        return g != null ? (String) g : "https://akey-app-configuration.oss-accelerate.aliyuncs.com/configuration/android_mtlscert_luobo";
    }

    public final boolean needRecord(@NotNull String code) {
        List arrayList;
        kotlin.jvm.internal.r.checkNotNullParameter(code, "code");
        try {
            Object g = g("needReport", "f");
            arrayList = g != null ? (List) g : new ArrayList();
        } catch (Throwable unused) {
        }
        if (arrayList.isEmpty()) {
            return false;
        }
        if (arrayList.contains(Marker.ANY_MARKER)) {
            return true;
        }
        return arrayList.contains(code);
    }

    public final boolean newTopMessageProvider() {
        Object g = g("newTopMessageProvider", "f");
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return true;
    }

    public final int oneKeyApiOutTime() {
        Object g = g("aliauthot", XHTMLText.P);
        if (g != null) {
            return (int) (((Double) g).doubleValue() * 1000);
        }
        return 1500;
    }

    @NotNull
    public final String oss() {
        Object g = g("oss", User.NAME_PREFIX);
        return g != null ? (String) g : "enterprise.akeychat.cn:20443";
    }

    public final long pushCacheTime() {
        Object g = g("push_token_refresh_time", XHTMLText.P);
        return (g != null ? (long) ((Double) g).doubleValue() : 86400L) * 1000;
    }

    @Nullable
    public final String readLocalCountry() {
        InputStream open = o1.get().getAssets().open("countrycode.json");
        kotlin.jvm.internal.r.checkNotNullExpressionValue(open, "assetManager.open(\"countrycode.json\")");
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(open, "UTF-8"));
        StringBuffer stringBuffer = new StringBuffer();
        while (true) {
            String readLine = bufferedReader.readLine();
            if (readLine == null) {
                Log.debug("AKCAppConfiguration", kotlin.jvm.internal.r.stringPlus("read country json is ", stringBuffer));
                open.close();
                bufferedReader.close();
                return stringBuffer.toString();
            }
            stringBuffer.append(readLine);
        }
    }

    public final boolean reportOldStats() {
        Object g = g("reportoldstats", "f");
        if (g != null) {
            return ((Boolean) g).booleanValue();
        }
        return true;
    }

    public final void setConfig(@NotNull Map<String, Object> map) {
        kotlin.jvm.internal.r.checkNotNullParameter(map, "<set-?>");
        f3477c = map;
    }

    public final void setConfiged(boolean z) {
        f3476b = z;
    }

    public final void setHintConfigSuccess(boolean z) {
        f3479e = z;
    }

    public final long slsExpirationGap() {
        Object g = g("sls_expiration_gap", XHTMLText.P);
        if (g != null) {
            return (long) ((Double) g).doubleValue();
        }
        return 900000L;
    }

    @NotNull
    public final String stats() {
        Object g = g("stats", User.NAME_PREFIX);
        return g != null ? (String) g : "statistical.akeychat.cn";
    }

    @NotNull
    public final String stats2() {
        Object g = g("stats2", User.NAME_PREFIX);
        return g != null ? (String) g : "stat.akeydev.top:7443";
    }

    public final boolean supportAiReplay() {
        try {
            Object g = g("supportAIReply", "f");
            if (g != null) {
                return ((Boolean) g).booleanValue();
            }
            return true;
        } catch (Throwable unused) {
            return true;
        }
    }

    public final boolean supportCheckHead() {
        try {
            Object g = g("avatarRecoginition", "f");
            if (g != null) {
                return ((Boolean) g).booleanValue();
            }
            return true;
        } catch (Throwable unused) {
            return true;
        }
    }

    public final boolean supportFeedback() {
        try {
            Object g = g("supportFeedback", "f");
            if (g != null) {
                return ((Boolean) g).booleanValue();
            }
            return true;
        } catch (Throwable unused) {
            return true;
        }
    }

    public final boolean supportSurveillance() {
        try {
            Object g = g("surveillance_enable", "f");
            if (g != null) {
                return ((Boolean) g).booleanValue();
            }
            return true;
        } catch (Throwable unused) {
            return true;
        }
    }

    public final int textMsgLengthLimit() {
        try {
            Object g = g("textMsgLengthLimit", XHTMLText.P);
            if (g != null) {
                return (int) ((Double) g).doubleValue();
            }
            return 10000;
        } catch (Throwable unused) {
            return 10000;
        }
    }

    public final int xpingRetries() {
        Object g = g("xping_retries", XHTMLText.P);
        if (g != null) {
            return (int) ((Double) g).doubleValue();
        }
        return 3;
    }

    public final int xpingTimeout() {
        Object g = g("xping_timeout", XHTMLText.P);
        if (g != null) {
            return (int) ((Double) g).doubleValue();
        }
        return 30000;
    }
}