3p棋牌.apk(点击下载) / ac.java


package com.tencent.bugly.proguard;

import android.content.Context;
import com.tencent.bugly.crashreport.common.strategy.StrategyBean;
import java.util.List;

public final class ac {

    /* renamed from: a  reason: collision with root package name */
    public static int f1920a = 1000;
    public static long b = 259200000;
    private static ac d;
    private static String i;
    public final ak c;
    private final List<o> e;
    private final StrategyBean f;
    private StrategyBean g = null;
    private Context h;

    private ac(Context context, List<o> list) {
        String str;
        this.h = context;
        if (aa.a(context) != null) {
            String str2 = aa.a(context).H;
            if ("oversea".equals(str2)) {
                StrategyBean.f1910a = "https://astat.bugly.qcloud.com/rqd/async";
                str = "https://astat.bugly.qcloud.com/rqd/async";
            } else if ("na_https".equals(str2)) {
                StrategyBean.f1910a = "https://astat.bugly.cros.wr.pvp.net/:8180/rqd/async";
                str = "https://astat.bugly.cros.wr.pvp.net/:8180/rqd/async";
            }
            StrategyBean.b = str;
        }
        this.f = new StrategyBean();
        this.e = list;
        this.c = ak.a();
    }

    public static synchronized ac a() {
        ac acVar;
        synchronized (ac.class) {
            acVar = d;
        }
        return acVar;
    }

    public static synchronized ac a(Context context, List<o> list) {
        ac acVar;
        synchronized (ac.class) {
            if (d == null) {
                d = new ac(context, list);
            }
            acVar = d;
        }
        return acVar;
    }

    public static void a(String str) {
        if (ap.a(str) || !ap.c(str)) {
            al.d("URL user set is invalid.", new Object[0]);
        } else {
            i = str;
        }
    }

    public static StrategyBean d() {
        List<y> a2 = w.a().a(2);
        if (a2 == null || a2.size() <= 0) {
            return null;
        }
        y yVar = a2.get(0);
        if (yVar.g != null) {
            return (StrategyBean) ap.a(yVar.g, StrategyBean.CREATOR);
        }
        return null;
    }

    /* access modifiers changed from: protected */
    public final void a(StrategyBean strategyBean, boolean z) {
        al.c("[Strategy] Notify %s", s.class.getName());
        s.a(strategyBean, z);
        for (o oVar : this.e) {
            try {
                al.c("[Strategy] Notify %s", oVar.getClass().getName());
                oVar.onServerStrategyChanged(strategyBean);
            } catch (Throwable th) {
                if (!al.a(th)) {
                    th.printStackTrace();
                }
            }
        }
    }

    public final void a(bt btVar) {
        if (btVar != null) {
            if (this.g == null || btVar.h != this.g.o) {
                StrategyBean strategyBean = new StrategyBean();
                strategyBean.f = btVar.f1980a;
                strategyBean.h = btVar.c;
                strategyBean.g = btVar.b;
                if (ap.a(i) || !ap.c(i)) {
                    if (ap.c(btVar.d)) {
                        al.c("[Strategy] Upload url changes to %s", btVar.d);
                        strategyBean.q = btVar.d;
                    }
                    if (ap.c(btVar.e)) {
                        al.c("[Strategy] Exception upload url changes to %s", btVar.e);
                        strategyBean.r = btVar.e;
                    }
                }
                if (btVar.f != null && !ap.a(btVar.f.f1979a)) {
                    strategyBean.s = btVar.f.f1979a;
                }
                if (btVar.h != 0) {
                    strategyBean.o = btVar.h;
                }
                if (!(btVar == null || btVar.g == null || btVar.g.size() <= 0)) {
                    strategyBean.t = btVar.g;
                    String str = btVar.g.get("B11");
                    strategyBean.i = str != null && str.equals("1");
                    String str2 = btVar.g.get("B3");
                    if (str2 != null) {
                        strategyBean.w = Long.parseLong(str2);
                    }
                    strategyBean.p = (long) btVar.l;
                    strategyBean.v = (long) btVar.l;
                    String str3 = btVar.g.get("B27");
                    if (str3 != null && str3.length() > 0) {
                        try {
                            int parseInt = Integer.parseInt(str3);
                            if (parseInt > 0) {
                                strategyBean.u = parseInt;
                            }
                        } catch (Exception e2) {
                            if (!al.a(e2)) {
                                e2.printStackTrace();
                            }
                        }
                    }
                    String str4 = btVar.g.get("B25");
                    strategyBean.k = str4 != null && str4.equals("1");
                }
                al.a("[Strategy] enableCrashReport:%b, enableQuery:%b, enableUserInfo:%b, enableAnr:%b, enableBlock:%b, enableSession:%b, enableSessionTimer:%b, sessionOverTime:%d, enableCocos:%b, strategyLastUpdateTime:%d", Boolean.valueOf(strategyBean.f), Boolean.valueOf(strategyBean.h), Boolean.valueOf(strategyBean.g), Boolean.valueOf(strategyBean.i), Boolean.valueOf(strategyBean.j), Boolean.valueOf(strategyBean.m), Boolean.valueOf(strategyBean.n), Long.valueOf(strategyBean.p), Boolean.valueOf(strategyBean.k), Long.valueOf(strategyBean.o));
                this.g = strategyBean;
                if (!ap.c(btVar.d)) {
                    al.c("[Strategy] download url is null", new Object[0]);
                    this.g.q = "";
                }
                if (!ap.c(btVar.e)) {
                    al.c("[Strategy] download crashurl is null", new Object[0]);
                    this.g.r = "";
                }
                w.a().b(2);
                y yVar = new y();
                yVar.b = 2;
                yVar.f2007a = strategyBean.d;
                yVar.e = strategyBean.e;
                yVar.g = ap.a(strategyBean);
                w.a().a(yVar);
                a(strategyBean, true);
            }
        }
    }

    public final synchronized boolean b() {
        return this.g != null;
    }

    public final StrategyBean c() {
        if (this.g != null) {
            if (!ap.c(this.g.q)) {
                this.g.q = StrategyBean.f1910a;
            }
            if (!ap.c(this.g.r)) {
                this.g.r = StrategyBean.b;
            }
            return this.g;
        }
        if (!ap.a(i) && ap.c(i)) {
            this.f.q = i;
            this.f.r = i;
        }
        return this.f;
    }
}