電視直播.apk(点击下载) / b.java


package com.opos.mobad.c.a;

import android.content.Context;
import android.text.TextUtils;
import com.baidu.mobads.sdk.internal.an;
import com.opos.cmn.an.c.c;
import com.opos.cmn.an.c.d;
import com.opos.cmn.biz.a.e;
import com.opos.cmn.func.a.b.d;
import com.opos.cmn.i.a;
import com.opos.mobad.b.a.j;
import com.opos.mobad.b.a.k;
import com.opos.mobad.b.a.m;
import com.opos.mobad.b.a.n;
import com.opos.mobad.b.a.o;
import com.opos.mobad.provider.record.ControlEntity;
import com.opos.mobad.provider.record.a;
import com.opos.mobad.service.d.a;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicReference;

public class b {
    private Context a;
    private String b;
    private int c;
    private int d;

    /* renamed from: e  reason: collision with root package name */
    private a f13940e;

    /* renamed from: f  reason: collision with root package name */
    private AtomicReference<ControlEntity> f13941f = new AtomicReference<>(null);

    /* renamed from: g  reason: collision with root package name */
    private com.opos.cmn.i.a f13942g = new com.opos.cmn.i.a(new a.b() {
        /* class com.opos.mobad.c.a.b.AnonymousClass1 */

        @Override // com.opos.cmn.i.a.b
        public void a(a.AbstractC0249a aVar) {
            if (b.this.f13940e == null) {
                aVar.b();
            } else {
                b.this.a((b) aVar);
            }
        }
    }, 10000, 0);

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void a(final a.AbstractC0249a aVar) {
        if (this.f13941f.get() == null) {
            com.opos.cmn.an.j.b.c(new Runnable() {
                /* class com.opos.mobad.c.a.b.AnonymousClass2 */

                public void run() {
                    try {
                        if (b.this.f13941f.get() == null) {
                            ControlEntity e2 = b.this.f13940e.e();
                            b.this.f13941f.compareAndSet(null, e2);
                            com.opos.cmn.an.f.a.b("", "control local:" + e2);
                        }
                    } catch (Exception e3) {
                        com.opos.cmn.an.f.a.b("", "loal fail", e3);
                    }
                }
            });
        }
        com.opos.cmn.an.j.b.c(new Runnable() {
            /* class com.opos.mobad.c.a.b.AnonymousClass3 */

            public void run() {
                b.this.b((b) aVar);
            }
        });
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void b(a.AbstractC0249a aVar) {
        try {
            m.a i2 = new m.a().b(com.opos.mobad.service.e.b.k().f()).c("").g(com.opos.mobad.service.d.a.a().f()).h(com.opos.mobad.service.d.a.a().g()).i(com.opos.mobad.service.d.a.a().h());
            a.C0324a k = com.opos.mobad.service.d.a.a().k();
            if (k != null) {
                m.a a2 = i2.a(k.a);
                k.getClass();
                a2.a((Integer) 1);
            } else {
                i2.a("");
            }
            n b2 = new n.a().a(i2.b()).a(new o.a().c(c.c()).a(d.b()).b(d.a()).b()).c(com.opos.cmn.an.c.a.a(this.a)).a(c.a()).b();
            HashMap hashMap = new HashMap();
            hashMap.put("Content-Type", "application/x-protobuf");
            hashMap.put("Route-Data", e.a(this.a));
            d.a b3 = new d.a().a(j.c.b(new j.a().a(this.b).a(b2).b(this.a.getPackageName()).b(Integer.valueOf(this.c)).a(Integer.valueOf(this.d)).a(Boolean.valueOf(com.opos.mobad.service.d.a.a().j())).b(Boolean.valueOf(com.opos.mobad.service.d.a.a().d())).b())).a(hashMap).b(l());
            b3.a(an.b);
            com.opos.cmn.func.a.b.e a3 = com.opos.cmn.func.a.b.b.a().a(this.a, b3.a());
            if (a3 == null || 200 != a3.a) {
                aVar.b();
                return;
            }
            k a4 = k.c.a(a3.c);
            com.opos.cmn.an.f.a.b("", "control succ:", a4);
            ControlEntity controlEntity = new ControlEntity((a4.s != null ? a4.s : k.f13801e).booleanValue(), (a4.t != null ? a4.t : k.f13802f).booleanValue(), (a4.u != null ? a4.u : k.f13803g).booleanValue(), (a4.v != null ? a4.v : k.f13804h).booleanValue(), (a4.w != null ? a4.w : k.f13805i).booleanValue(), (a4.x != null ? a4.x : k.j).booleanValue(), (a4.z != null ? a4.z : k.l).booleanValue(), System.currentTimeMillis(), (a4.y != null ? a4.y : k.k).booleanValue(), (a4.B != null ? a4.B : k.n).booleanValue(), (a4.A != null ? a4.A : k.m).booleanValue(), (a4.C != null ? a4.C : k.o).booleanValue(), (a4.D != null ? a4.D : k.p).booleanValue());
            this.f13941f.set(controlEntity);
            try {
                this.f13940e.a(controlEntity);
            } catch (Exception e2) {
                com.opos.cmn.an.f.a.b("", "set local fail", e2);
            }
            aVar.a();
        } catch (Throwable th) {
            com.opos.cmn.an.f.a.b("", "refresh fail", th);
            aVar.b();
        }
    }

    private String l() {
        return "https://uapi.ads.heytapmobi.com/union/strategy/ability/select";
    }

    public void a(Context context, String str, int i2, int i3) {
        if (context != null && !TextUtils.isEmpty(str)) {
            this.a = context;
            this.b = str;
            this.f13940e = new com.opos.mobad.provider.record.a(context);
            this.c = i2;
            this.d = i3;
            this.f13942g.a();
        }
    }

    public boolean a() {
        ControlEntity controlEntity = this.f13941f.get();
        if (controlEntity != null) {
            return controlEntity.a;
        }
        this.f13942g.a();
        return k.f13801e.booleanValue();
    }

    public boolean b() {
        ControlEntity controlEntity = this.f13941f.get();
        if (controlEntity != null) {
            return controlEntity.b;
        }
        this.f13942g.a();
        return k.f13802f.booleanValue();
    }

    public boolean c() {
        ControlEntity controlEntity = this.f13941f.get();
        if (controlEntity != null) {
            return controlEntity.c;
        }
        this.f13942g.a();
        return k.f13803g.booleanValue();
    }

    public boolean d() {
        ControlEntity controlEntity = this.f13941f.get();
        if (controlEntity != null) {
            return controlEntity.f14392e;
        }
        this.f13942g.a();
        return k.f13804h.booleanValue();
    }

    public boolean e() {
        ControlEntity controlEntity = this.f13941f.get();
        if (controlEntity != null) {
            return controlEntity.f14393f;
        }
        this.f13942g.a();
        return k.f13805i.booleanValue();
    }

    public boolean f() {
        ControlEntity controlEntity = this.f13941f.get();
        if (controlEntity != null) {
            return controlEntity.f14396i;
        }
        this.f13942g.a();
        return k.l.booleanValue();
    }

    public boolean g() {
        ControlEntity controlEntity = this.f13941f.get();
        if (controlEntity != null) {
            return controlEntity.f14395h;
        }
        this.f13942g.a();
        return k.k.booleanValue();
    }

    public boolean h() {
        ControlEntity controlEntity = this.f13941f.get();
        if (controlEntity != null) {
            return controlEntity.j;
        }
        this.f13942g.a();
        return k.n.booleanValue();
    }

    public boolean i() {
        ControlEntity controlEntity = this.f13941f.get();
        if (controlEntity != null) {
            return controlEntity.k;
        }
        this.f13942g.a();
        return k.m.booleanValue();
    }

    public boolean j() {
        ControlEntity controlEntity = this.f13941f.get();
        if (controlEntity != null) {
            return controlEntity.l;
        }
        this.f13942g.a();
        return k.o.booleanValue();
    }

    public boolean k() {
        ControlEntity controlEntity = this.f13941f.get();
        if (controlEntity != null) {
            return controlEntity.m;
        }
        this.f13942g.a();
        return k.p.booleanValue();
    }
}