导航菜单

页面标题

页面副标题

泰剧兔 v1.5.7.0 - l.java 源代码

正在查看: 泰剧兔 v1.5.7.0 应用的 l.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.windmill.sdk.strategy;

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.volley.VolleyError;
import com.windmill.sdk.WindMillAd;
import com.windmill.sdk.base.WMLogUtil;
import com.windmill.sdk.models.Android;
import com.windmill.sdk.models.Common;
import com.windmill.sdk.models.CommonEndpointsConfig;
import com.windmill.sdk.models.SdkConfig;
import com.windmill.sdk.models.SdkConfigResponse;
import com.windmill.sdk.strategy.g;
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;

public class l {
    public static String a = "_timeout";
    private static final String b = "sdkConfigVer";
    private static final String c = "/tb_config";
    private static l d = null;
    private static boolean e = false;

    private static String f1905n = "";

    private static String f1906o = "";

    private static boolean f1907p = false;

    private static final String f1908q = "https://adservice.sigmob.cn/w/config";

    private static final String f1909r = "https://c.tobidad.cn/w/config";

    private static final String f1910s = "https://adservice.sigmob.cn/extconfig?";

    private a f1916m;

    private final String f1911h = "tb-4.4.0";

    private long f1913j = 0;

    private SdkConfig f1914k = null;

    private SdkConfig f1915l = null;

    private String f1917t = "https://adservice.sigmob.cn/strategy/v6";

    private String f1918u = "https://adservice.sigmob.cn/waterfall/v1";

    private String f1919v = "https://dc.sigmob.cn/log";
    private final Handler f = new Handler(Looper.getMainLooper());
    private final Runnable g = new Runnable() {
        @Override
        public void run() {
            l.this.G();
        }
    };

    private boolean f1912i = true;

    public interface a {
        void a();
    }

    private l() {
        D();
        F();
    }

    private void D() {
        if (this.f1915l == null) {
            SdkConfig.Builder builder = new SdkConfig.Builder();
            Common.Builder builder2 = new Common.Builder();
            Android.Builder builder3 = new Android.Builder();
            CommonEndpointsConfig.Builder builder4 = new CommonEndpointsConfig.Builder();
            builder4.log(this.f1919v);
            builder4.strategy(this.f1917t);
            builder4.bidding_url(this.f1918u);
            builder4.config(f1909r);
            builder2.endpoints(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.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.f1915l = builder.build();
        }
    }

    private void E() {
        Handler handler = this.f;
        if (handler != null) {
            handler.removeCallbacks(this.g);
        }
    }

    private void F() {
        if (ClientMetadata.getInstance() == null) {
            a(this.f1915l);
            return;
        }
        ObjectInputStream objectInputStream = null;
        String string = com.windmill.sdk.utils.k.a(ClientMetadata.getInstance().getContext()).getString(b, null);
        File file = new File(com.windmill.sdk.utils.e.a() + c);
        if ("tb-4.4.0".equals(string)) {
            try {
                if (file.exists()) {
                    try {
                        ObjectInputStream objectInputStream2 = new ObjectInputStream(new FileInputStream(file));
                        try {
                            a(SdkConfig.ADAPTER.decode(objectInputStream2));
                            objectInputStream2.close();
                        } catch (Throwable th) {
                            th = th;
                            objectInputStream = objectInputStream2;
                            try {
                                a(this.f1915l);
                                WMLogUtil.e(th.getMessage());
                                if (objectInputStream != null) {
                                    objectInputStream.close();
                                    return;
                                }
                                return;
                            } catch (Throwable th2) {
                                if (objectInputStream != null) {
                                    try {
                                        objectInputStream.close();
                                    } catch (Throwable th3) {
                                        WMLogUtil.e(th3.getMessage());
                                    }
                                }
                                throw th2;
                            }
                        }
                    } catch (Throwable th4) {
                        th = th4;
                    }
                    return;
                }
            } catch (Throwable th5) {
                WMLogUtil.e(th5.getMessage());
                return;
            }
        }
        a(this.f1915l);
    }

    public void G() {
        if (ClientMetadata.getInstance() == null) {
            return;
        }
        if (ClientMetadata.getInstance().isNetworkConnected(b()) && com.windmill.sdk.a.a.b()) {
            H();
        } else {
            WMLogUtil.e("Can't load an ad because  is no network or can not CollectPersonalInformation");
            I();
        }
    }

    private void H() {
        SigmobRequestQueue requestQueue = Networking.getRequestQueue();
        g gVar = new g(b(), new g.a() {
            @Override
            public void a(SdkConfigResponse sdkConfigResponse) {
                WMLogUtil.dd(WMLogUtil.TAG, "SdkConfigResponse:" + sdkConfigResponse.toString());
                boolean unused = l.f1907p = false;
                SdkConfig sdkConfig = sdkConfigResponse.config;
                if (sdkConfigResponse.code.intValue() != 0 || sdkConfig == null) {
                    WMLogUtil.e("ConfigResponseError:" + sdkConfigResponse.error_message);
                } else {
                    l.this.a(sdkConfig);
                    l.this.b(sdkConfig);
                }
                l.this.I();
            }

            @Override
            public void onErrorResponse(VolleyError volleyError) {
                WMLogUtil.e("ConfigResponseError:" + volleyError.toString());
                String unused = l.f1906o = l.this.J();
                if (l.f1907p) {
                    l.this.I();
                } else {
                    boolean unused2 = l.f1907p = true;
                    l.this.f.post(l.this.g);
                }
            }
        });
        if (requestQueue == null) {
            WMLogUtil.e("queue is null");
            I();
        } else {
            requestQueue.add(gVar);
            WMLogUtil.i(WMLogUtil.TAG, "start update sdk config");
        }
    }

    public void I() {
        E();
        if (this.f1912i) {
            this.f.postDelayed(this.g, Math.max(30000L, this.f1913j));
        }
    }

    public String J() {
        try {
            String str = h().endpoints.config;
            if (!TextUtils.isEmpty(str)) {
                if (str.indexOf(63) == -1) {
                    return str + "?" + d();
                }
                return str + "&" + d();
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
        return "https://c.tobidad.cn/w/config?" + d();
    }

    public static boolean f() {
        return e;
    }

    public boolean A() {
        if (g() == null || i() == null) {
            return true;
        }
        return i().oaid_api_is_disable.booleanValue();
    }

    public boolean B() {
        if (g() == null || i() == null) {
            return true;
        }
        return i().disable_boot_mark.booleanValue();
    }

    public SdkConfig g() {
        SdkConfig sdkConfig = this.f1914k;
        return sdkConfig == null ? this.f1915l : sdkConfig;
    }

    public Common h() {
        return g().common_config;
    }

    public Android i() {
        return g().android_config;
    }

    public String j() {
        String str = h().endpoints.log;
        if (TextUtils.isEmpty(str)) {
            return this.f1919v + "?" + d();
        }
        if (str.indexOf(63) == -1) {
            return str + "?" + d();
        }
        return str + "&" + d();
    }

    public String k() {
        String str = h().endpoints.strategy;
        if (TextUtils.isEmpty(str)) {
            return this.f1917t + "?" + d();
        }
        if (str.indexOf(63) == -1) {
            return str + "?" + d();
        }
        return str + "&" + d();
    }

    public String l() {
        String str = h().endpoints.bidding_url;
        if (TextUtils.isEmpty(str)) {
            return this.f1918u + "?" + d();
        }
        if (str.indexOf(63) == -1) {
            return str + "?" + d();
        }
        return str + "&" + d();
    }

    public int m() {
        int intValue = h().max_send_log_records.intValue();
        if (intValue < 10) {
            return 100;
        }
        return intValue;
    }

    public boolean n() {
        if (h() != null) {
            return h().log_enc.booleanValue();
        }
        return false;
    }

    public int o() {
        if (h() == null || h().tracking_expiration_time.intValue() < 1) {
            return 86400;
        }
        return h().tracking_expiration_time.intValue();
    }

    public int p() {
        if (h() == null || h().tracking_retry_interval.intValue() < 10) {
            return 180;
        }
        return h().tracking_retry_interval.intValue();
    }

    public int q() {
        int intValue = h().send_log_interval.intValue();
        if (intValue < 3) {
            return 3;
        }
        return intValue;
    }

    public List<Integer> r() {
        return h().dclog_blacklist;
    }

    public boolean s() {
        if (g() == null || h().enable_debug_level == null) {
            return false;
        }
        return h().enable_debug_level.booleanValue();
    }

    public long t() {
        int intValue = h().ready_expire_timestamp.intValue();
        if (intValue < 1) {
            intValue = 900;
        }
        return intValue * 1000;
    }

    public long u() {
        Integer num = h().load_interval;
        if (num == null || num.intValue() < 1) {
            return 0L;
        }
        return num.intValue() * 1000;
    }

    public boolean v() {
        if (g() == null || h().disable_up_location == null) {
            return true;
        }
        return h().disable_up_location.booleanValue();
    }

    public int w() {
        if (g() == null || i() == null) {
            return 0;
        }
        return i().report_log.intValue();
    }

    public int x() {
        if (g() == null || i() == null) {
            return 0;
        }
        return i().disable_up_oaid.intValue();
    }

    public boolean y() {
        if (g() == null || i() == null) {
            return false;
        }
        return i().enable_permission.booleanValue();
    }

    public boolean z() {
        if (g() == null || i() == null) {
            return false;
        }
        return i().enable_report_crash.booleanValue();
    }

    public static String c() {
        return f1910s + d();
    }

    public static String d() {
        return "appId=" + WindMillAd.sharedAds().getAppId() + "&sdkVersion=4.4.0";
    }

    public void e() {
        E();
        Handler handler = this.f;
        if (handler != null) {
            handler.post(this.g);
        }
    }

    public static l a() {
        if (d == null) {
            synchronized (l.class) {
                try {
                    if (d == null) {
                        d = new l();
                    }
                } finally {
                }
            }
        }
        return d;
    }

    public static String b() {
        if (!TextUtils.isEmpty(f1906o)) {
            return f1906o;
        }
        if (!TextUtils.isEmpty(f1905n)) {
            return f1905n + "?" + d();
        }
        return "https://adservice.sigmob.cn/w/config?" + d();
    }

    public void b(SdkConfig sdkConfig) {
        ObjectOutputStream objectOutputStream;
        if (sdkConfig != null) {
            File file = new File(com.windmill.sdk.utils.e.a() + c);
            if (file.exists()) {
                file.delete();
            }
            file.getParentFile().mkdirs();
            ObjectOutputStream objectOutputStream2 = null;
            try {
                try {
                    try {
                        objectOutputStream = new ObjectOutputStream(new FileOutputStream(file));
                    } catch (IOException e2) {
                        WMLogUtil.e(e2.getMessage());
                        return;
                    }
                } catch (IOException e3) {
                    e = e3;
                }
            } catch (Throwable th) {
                th = th;
            }
            try {
                sdkConfig.encode(objectOutputStream);
                com.windmill.sdk.utils.k.a(ClientMetadata.getInstance().getContext()).edit().putString(b, "tb-4.4.0").apply();
                objectOutputStream.close();
            } catch (IOException e4) {
                e = e4;
                objectOutputStream2 = objectOutputStream;
                WMLogUtil.e(e.getMessage());
                if (objectOutputStream2 != null) {
                    objectOutputStream2.close();
                }
            } catch (Throwable th2) {
                th = th2;
                objectOutputStream2 = objectOutputStream;
                if (objectOutputStream2 != null) {
                    try {
                        objectOutputStream2.close();
                    } catch (IOException e5) {
                        WMLogUtil.e(e5.getMessage());
                    }
                }
                throw th;
            }
        }
    }

    public void a(SdkConfig sdkConfig) {
        Common common;
        if (sdkConfig == null || (common = sdkConfig.common_config) == null) {
            return;
        }
        this.f1914k = sdkConfig;
        this.f1913j = common.configRefresh.intValue() * 1000;
        a aVar = this.f1916m;
        if (aVar != null) {
            aVar.a();
        }
        Config.sharedInstance().update(e, B(), A(), x(), j(), q(), m(), n());
        TrackManager.getInstance().setRetryExpiredTime(o());
        TrackManager.getInstance().setRetryInterval(p());
    }

    public long a(String str) {
        int i2 = 0;
        try {
            i2 = com.windmill.sdk.utils.k.a(ClientMetadata.getInstance().getContext()).getInt(str + a, 0);
        } catch (Exception e2) {
            e2.printStackTrace();
        }
        return i2;
    }

    public l a(a aVar) {
        this.f1916m = aVar;
        return d;
    }
}