整点视频 v3.3.0版本的 MD5 值为:cba0457dc37421eed445b30f92de25d3

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


package com.sigmob.sdk.base;

import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import com.czhj.sdk.common.ClientMetadata;
import com.czhj.sdk.common.models.Config;
import com.czhj.sdk.common.network.Networking;
import com.czhj.sdk.common.network.SigmobRequestQueue;
import com.czhj.sdk.common.track.TrackManager;
import com.czhj.sdk.logger.SigmobLog;
import com.czhj.volley.VolleyError;
import com.czhj.wire.Wire;
import com.sigmob.sdk.base.models.config.SigmobAndroid;
import com.sigmob.sdk.base.models.config.SigmobCommon;
import com.sigmob.sdk.base.models.config.SigmobCommonEndpointsConfig;
import com.sigmob.sdk.base.models.config.SigmobDialogSetting;
import com.sigmob.sdk.base.models.config.SigmobNativeConfig;
import com.sigmob.sdk.base.models.config.SigmobRvConfig;
import com.sigmob.sdk.base.models.config.SigmobSdkConfig;
import com.sigmob.sdk.base.models.config.SigmobSdkConfigResponse;
import com.sigmob.sdk.base.models.config.SigmobSplashConfig;
import com.sigmob.sdk.base.network.f;
import com.sigmob.windad.WindAdOptions;
import com.sigmob.windad.WindAds;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.List;
import org.fourthline.cling.model.Constants;
public class i {
    private static final String a = "sdkConfigVer";
    private static i b;
    private static boolean c;
    private a k;
    private final String f = h.j;
    private long h = 0;
    private SigmobSdkConfig i = null;
    private SigmobSdkConfig j = null;
    private final Handler d = new Handler(Looper.getMainLooper());
    private final Runnable e = new Runnable() {
        @Override
        public void run() {
            i.this.V();
        }
    };
    private boolean g = true;

    public interface a {
        void a();
    }

    private i() {
        U();
    }

    private void U() {
        if (this.i == null) {
            SigmobSdkConfig.Builder builder = new SigmobSdkConfig.Builder();
            SigmobCommon.Builder builder2 = new SigmobCommon.Builder();
            SigmobAndroid.Builder builder3 = new SigmobAndroid.Builder();
            builder2.endpoints(new SigmobCommonEndpointsConfig.Builder().build());
            SigmobRvConfig.Builder builder4 = new SigmobRvConfig.Builder();
            builder4.cacheTop(4);
            builder2.rv_config(builder4.build());
            builder2.configRefresh(1000);
            Boolean bool = Boolean.TRUE;
            builder2.disable_up_location(bool);
            Boolean bool2 = Boolean.FALSE;
            builder2.is_gdpr_region(bool2);
            builder2.enable_debug_level(bool2);
            builder3.disable_boot_mark(bool);
            builder3.disableUpAppInfo(bool);
            builder3.oaid_api_is_disable(bool);
            builder3.enable_permission(bool2);
            builder3.enable_report_crash(bool2);
            builder.common_config(builder2.build());
            builder.android_config(builder3.build());
            this.i = builder.build();
        }
        SigmobLog.d("Default config: " + this.i.toString());
    }

    public void V() {
        if (com.sigmob.sdk.b.e() == null) {
            return;
        }
        if (ClientMetadata.getInstance().isNetworkConnected(c()) && c.a().i()) {
            X();
            return;
        }
        SigmobLog.d("Can't load an ad because there is no network connectivity.");
        Z();
    }

    private boolean W() {
        SigmobCommon j = j();
        if (j != null) {
            return ((Boolean) Wire.get(j.log_enc, Boolean.FALSE)).booleanValue();
        }
        return false;
    }

    private void X() {
        SigmobRequestQueue sigRequestQueue = Networking.getSigRequestQueue();
        com.sigmob.sdk.base.network.f fVar = new com.sigmob.sdk.base.network.f(c(), new f.a() {
            @Override
            public void a(SigmobSdkConfigResponse sigmobSdkConfigResponse) {
                SigmobLog.d(sigmobSdkConfigResponse.toString());
                final SigmobSdkConfig sigmobSdkConfig = sigmobSdkConfigResponse.config;
                if (sigmobSdkConfig != null) {
                    WindAds.sharedAds().getHandler().post(new Runnable() {
                        @Override
                        public void run() {
                            i.this.b(sigmobSdkConfig);
                        }
                    });
                    i.this.a(sigmobSdkConfig);
                } else {
                    SigmobLog.e(sigmobSdkConfigResponse.error_message);
                }
                i.this.Z();
            }

            @Override
            public void onErrorResponse(VolleyError volleyError) {
                SigmobLog.e(volleyError.toString());
                i.this.Z();
            }
        });
        if (sigRequestQueue == null) {
            SigmobLog.e("queue is null");
            Z();
            return;
        }
        sigRequestQueue.add(fVar);
        SigmobLog.i("update sdk config");
    }

    private void Y() {
        this.d.removeCallbacks(this.e);
    }

    public void Z() {
        Y();
        if (this.g) {
            this.d.postDelayed(this.e, Math.max(30000L, this.h));
        }
    }

    public static synchronized i a() {
        i iVar;
        synchronized (i.class) {
            if (b == null) {
                b = new i();
            }
            iVar = b;
        }
        return iVar;
    }

    public void a(SigmobSdkConfig sigmobSdkConfig) {
        ObjectOutputStream objectOutputStream;
        if (sigmobSdkConfig != null) {
            ObjectOutputStream objectOutputStream2 = null;
            File file = new File(com.sigmob.sdk.base.utils.c.a() + "/config");
            if (file.exists()) {
                file.delete();
            }
            file.getParentFile().mkdirs();
            try {
                try {
                    try {
                        objectOutputStream = new ObjectOutputStream(new FileOutputStream(file));
                    } catch (IOException e) {
                        e = e;
                    }
                } catch (Throwable th) {
                    th = th;
                }
                try {
                    sigmobSdkConfig.encode(objectOutputStream);
                    com.sigmob.sdk.base.utils.e.a().edit().putString(a, h.j).apply();
                    objectOutputStream.close();
                } catch (IOException e2) {
                    e = e2;
                    objectOutputStream2 = objectOutputStream;
                    SigmobLog.e(e.getMessage());
                    if (objectOutputStream2 != null) {
                        objectOutputStream2.close();
                    }
                } catch (Throwable th2) {
                    th = th2;
                    objectOutputStream2 = objectOutputStream;
                    if (objectOutputStream2 != null) {
                        try {
                            objectOutputStream2.close();
                        } catch (IOException e3) {
                            SigmobLog.e(e3.getMessage());
                        }
                    }
                    throw th;
                }
            } catch (IOException e4) {
                SigmobLog.e(e4.getMessage());
            }
        }
    }

    private SigmobSplashConfig aa() {
        if (j() != null) {
            return j().splash_config;
        }
        return null;
    }

    private SigmobNativeConfig ab() {
        if (j() != null) {
            return j().native_config;
        }
        return null;
    }

    public static String b() {
        return "appId=" + WindAds.sharedAds().getAppId() + "&sdkVersion=4.15.1";
    }

    public void b(SigmobSdkConfig sigmobSdkConfig) {
        SigmobCommon sigmobCommon;
        if (sigmobSdkConfig == null || (sigmobCommon = sigmobSdkConfig.sigmobCommon_config) == null) {
            return;
        }
        this.j = sigmobSdkConfig;
        this.h = ((Integer) Wire.get(sigmobCommon.configRefresh, Integer.valueOf((int) Constants.MIN_ADVERTISEMENT_AGE_SECONDS))).intValue() * 1000;
        SigmobLog.d("config: " + sigmobSdkConfig.toString());
        a aVar = this.k;
        if (aVar != null) {
            aVar.a();
        }
        Config.sharedInstance().setEnable_okhttp3(R());
        Config.sharedInstance().update(c, T(), Q(), M(), l(), E(), D(), W());
        TrackManager.getInstance().setRetryInterval(C());
        TrackManager.getInstance().setRetryExpiredTime(B());
    }

    public static String c() {
        String str;
        WindAdOptions options = WindAds.sharedAds().getOptions();
        if (options == null || options.getExtData() == null || (str = options.getExtData().get(h.c)) == null || TextUtils.isEmpty(str)) {
            if (TextUtils.isEmpty(h.f)) {
                return "https://adservice.sigmob.cn/s/config?" + b();
            }
            return h.f + "?" + b();
        } else if (str.indexOf(63) == -1) {
            return str + "?" + b();
        } else {
            return str + "&" + b();
        }
    }

    public static String d() {
        return "https://adservice.sigmob.cn/extconfig?" + b();
    }

    public static boolean h() {
        return c;
    }

    public int A() {
        if (!x() || j().anti_fraud_log.motion_config == null) {
            return 0;
        }
        return j().anti_fraud_log.motion_config.queue_max.intValue() + (-50) < j().anti_fraud_log.motion_config.count.intValue() * 2 ? (((Integer) Wire.get(j().anti_fraud_log.motion_config.count, 0)).intValue() * 2) + 50 : ((Integer) Wire.get(j().anti_fraud_log.motion_config.queue_max, 0)).intValue();
    }

    public long B() {
        long intValue = j() != null ? ((Integer) Wire.get(j().tracking_expiration_time, 86400)).intValue() : 86400L;
        if (intValue < 180) {
            return 180L;
        }
        return intValue;
    }

    public int C() {
        int intValue = j() != null ? ((Integer) Wire.get(j().tracking_retry_interval, 180)).intValue() : 180;
        if (intValue < 10) {
            return 10;
        }
        return intValue;
    }

    public int D() {
        Integer num = SigmobCommon.DEFAULT_MAX_SEND_LOG_RECORDS;
        int intValue = num.intValue();
        if (j() != null) {
            intValue = ((Integer) Wire.get(j().max_send_log_records, num)).intValue();
        }
        return intValue < 10 ? num.intValue() : intValue;
    }

    public int E() {
        int intValue;
        if (j() == null || (intValue = ((Integer) Wire.get(j().send_log_interval, 3)).intValue()) < 3) {
            return 3;
        }
        return intValue;
    }

    public List<Integer> F() {
        if (j() != null) {
            return j().dclog_blacklist;
        }
        return null;
    }

    public boolean G() {
        if (j() != null) {
            return ((Boolean) Wire.get(j().enable_debug_level, Boolean.FALSE)).booleanValue();
        }
        return false;
    }

    public long H() {
        if (j() != null) {
            long intValue = ((Integer) Wire.get(j().load_interval, 0)).intValue();
            if (intValue < 1) {
                return 0L;
            }
            return intValue * 1000;
        }
        return 0L;
    }

    public boolean I() {
        if (j() != null) {
            return ((Boolean) Wire.get(j().disable_up_location, Boolean.FALSE)).booleanValue();
        }
        return true;
    }

    public boolean J() {
        if (k() != null) {
            return ((Boolean) Wire.get(k().disableUpAppInfo, Boolean.FALSE)).booleanValue();
        }
        return true;
    }

    public int K() {
        if (k() != null) {
            return ((Integer) Wire.get(k().report_log, 0)).intValue();
        }
        return 0;
    }

    public boolean L() {
        SigmobAndroid k = k();
        return k != null && ((Integer) Wire.get(k.up_wifi_list_interval, 0)).intValue() >= 60;
    }

    public int M() {
        if (k() != null) {
            return ((Integer) Wire.get(k().disable_up_oaid, 0)).intValue();
        }
        return 0;
    }

    public boolean N() {
        if (k() != null) {
            return ((Boolean) Wire.get(k().enable_permission, Boolean.FALSE)).booleanValue();
        }
        return false;
    }

    public int O() {
        if (k() != null) {
            return ((Integer) Wire.get(k().apk_expired_time, 0)).intValue();
        }
        return 0;
    }

    public boolean P() {
        if (k() != null) {
            return ((Boolean) Wire.get(k().enable_report_crash, Boolean.FALSE)).booleanValue();
        }
        return false;
    }

    public boolean Q() {
        if (k() != null) {
            return ((Boolean) Wire.get(k().oaid_api_is_disable, Boolean.FALSE)).booleanValue();
        }
        return true;
    }

    public boolean R() {
        return false;
    }

    public int S() {
        if (k() != null) {
            return ((Integer) Wire.get(k().enable_app_list, 0)).intValue();
        }
        return 0;
    }

    public boolean T() {
        if (k() != null) {
            return ((Boolean) Wire.get(k().disable_boot_mark, Boolean.FALSE)).booleanValue();
        }
        return true;
    }

    public i a(a aVar) {
        this.k = aVar;
        return b;
    }

    public boolean a(String str) {
        if (!x() || j().anti_fraud_log.events == null) {
            return false;
        }
        return j().anti_fraud_log.events.contains(str);
    }

    public void e() {
        ObjectInputStream objectInputStream = null;
        String string = com.sigmob.sdk.base.utils.e.a().getString(a, null);
        File file = new File(com.sigmob.sdk.base.utils.c.a() + "/config");
        if (h.j.equals(string)) {
            try {
                if (file.exists()) {
                    try {
                        ObjectInputStream objectInputStream2 = new ObjectInputStream(new FileInputStream(file));
                        try {
                            b(SigmobSdkConfig.ADAPTER.decode(objectInputStream2));
                            objectInputStream2.close();
                        } catch (Throwable th) {
                            th = th;
                            objectInputStream = objectInputStream2;
                            try {
                                b(this.i);
                                SigmobLog.e(th.getMessage());
                                if (objectInputStream != null) {
                                    objectInputStream.close();
                                    return;
                                }
                                return;
                            } catch (Throwable th2) {
                                if (objectInputStream != null) {
                                    try {
                                        objectInputStream.close();
                                    } catch (Throwable th3) {
                                        SigmobLog.e(th3.getMessage());
                                    }
                                }
                                throw th2;
                            }
                        }
                    } catch (Throwable th4) {
                        th = th4;
                    }
                    return;
                }
            } catch (Throwable th5) {
                SigmobLog.e(th5.getMessage());
                return;
            }
        }
        b(this.i);
    }

    public void f() {
        Y();
        this.d.post(this.e);
    }

    public boolean g() {
        SigmobCommon j = j();
        if (j != null) {
            return ((Boolean) Wire.get(j.feedback_debug, Boolean.FALSE)).booleanValue();
        }
        return false;
    }

    public SigmobSdkConfig i() {
        SigmobSdkConfig sigmobSdkConfig = this.j;
        return sigmobSdkConfig == null ? this.i : sigmobSdkConfig;
    }

    public SigmobCommon j() {
        if (i() == null) {
            return null;
        }
        return i().sigmobCommon_config;
    }

    public SigmobAndroid k() {
        if (i() == null) {
            return null;
        }
        return i().sigmobAndroid_config;
    }

    public String l() {
        StringBuilder sb;
        String str;
        String str2 = j().endpoints.log;
        if (TextUtils.isEmpty(str2)) {
            str2 = "https://dc.sigmob.cn/log";
        }
        if (str2.indexOf(63) == -1) {
            sb = new StringBuilder();
            sb.append(str2);
            str = "?";
        } else {
            sb = new StringBuilder();
            sb.append(str2);
            str = "&";
        }
        sb.append(str);
        sb.append(b());
        return sb.toString();
    }

    public String m() {
        StringBuilder sb;
        String str;
        String str2 = (String) Wire.get(j().endpoints.feedback, "https://adxtool.sigmob.cn/debug/feedback");
        if (TextUtils.isEmpty(str2)) {
            return str2;
        }
        if (str2.indexOf(63) == -1) {
            sb = new StringBuilder();
            sb.append(str2);
            str = "?";
        } else {
            sb = new StringBuilder();
            sb.append(str2);
            str = "&";
        }
        sb.append(str);
        sb.append(b());
        return sb.toString();
    }

    public String n() {
        StringBuilder sb;
        String str;
        String str2 = j().endpoints.ads;
        if (TextUtils.isEmpty(str2)) {
            str2 = "https://adservice.sigmob.cn/ad/v4";
        }
        if (str2.indexOf(63) == -1) {
            sb = new StringBuilder();
            sb.append(str2);
            str = "?";
        } else {
            sb = new StringBuilder();
            sb.append(str2);
            str = "&";
        }
        sb.append(str);
        sb.append(b());
        return sb.toString();
    }

    public String o() {
        StringBuilder sb;
        String str;
        String str2 = j().endpoints.hb_ads;
        if (TextUtils.isEmpty(str2)) {
            str2 = "https://adservice.sigmob.cn/hb/v2/ad";
        }
        if (str2.indexOf(63) == -1) {
            sb = new StringBuilder();
            sb.append(str2);
            str = "?";
        } else {
            sb = new StringBuilder();
            sb.append(str2);
            str = "&";
        }
        sb.append(str);
        sb.append(b());
        return sb.toString();
    }

    public SigmobRvConfig p() {
        if (j() != null) {
            return j().rv_config;
        }
        return null;
    }

    public int q() {
        if (p() != null) {
            return ((Integer) Wire.get(p().cacheTop, 5)).intValue();
        }
        return 5;
    }

    public long r() {
        if (p() != null) {
            int intValue = ((Integer) Wire.get(p().ad_load_timeout, 45)).intValue();
            if (intValue < 10) {
                intValue = 10;
            }
            return intValue * 1000;
        }
        return 45000L;
    }

    public SigmobDialogSetting s() {
        if (p() != null) {
            return p().close_dialog_setting;
        }
        return null;
    }

    public int t() {
        if (aa() == null) {
            return 50;
        }
        return ((Integer) Wire.get(aa().cacheTop, 50)).intValue();
    }

    public long u() {
        int intValue = aa() != null ? ((Integer) Wire.get(aa().material_expired_time, 2)).intValue() : 2;
        return intValue < 0 ? intValue : intValue * 24 * 60 * 60 * 1000;
    }

    public int v() {
        if (ab() != null) {
            return ((Integer) Wire.get(ab().cacheTop, 50)).intValue();
        }
        return 50;
    }

    public long w() {
        SigmobNativeConfig ab = ab();
        if (ab != null) {
            int intValue = ((Integer) Wire.get(ab.ad_load_timeout, 45)).intValue();
            if (intValue < 10) {
                intValue = 10;
            }
            return intValue * 1000;
        }
        return 45000L;
    }

    public boolean x() {
        return (j() == null || j().anti_fraud_log == null || j().anti_fraud_log.events == null) ? false : true;
    }

    public int y() {
        if (!x() || j().anti_fraud_log.motion_config == null) {
            return 0;
        }
        return ((Integer) Wire.get(j().anti_fraud_log.motion_config.interval, 0)).intValue();
    }

    public int z() {
        if (!x() || j().anti_fraud_log.motion_config == null) {
            return 0;
        }
        return ((Integer) Wire.get(j().anti_fraud_log.motion_config.count, 0)).intValue();
    }
}