导航菜单

页面标题

页面副标题

MX Player v1.97.8 - d.java 源代码

正在查看: MX Player v1.97.8 应用的 d.java JAVA 源代码文件

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


package com.mxtech.videoplayer.ad.online.live;

import android.text.TextUtils;
import com.mxtech.videoplayer.ad.online.model.bean.next.OnlineResource;
import com.mxtech.videoplayer.ad.online.model.bean.next.ResourceFlow;
import com.mxtech.videoplayer.ad.online.model.bean.next.ResourceType;
import com.mxtech.videoplayer.ad.online.model.bean.next.SonyLiveProgramTypeUtil;
import com.mxtech.videoplayer.ad.online.model.bean.next.livetv.TVChannel;
import com.mxtech.videoplayer.ad.online.model.bean.next.livetv.TVProgram;
import com.mxtech.videoplayer.ad.utils.Const;
import defpackage.ofa;
import defpackage.pn7;
import defpackage.w61;
import defpackage.xe0;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public final class d extends w61<TVProgram> {
    public static final HashMap<String, Boolean> v = new HashMap<>(1);
    public static boolean w;
    public TVChannel f;
    public TVProgram g;
    public C0079d h;
    public TVProgram i;
    public String j;
    public TVProgram k;
    public ArrayList l;
    public ResourceFlow m;
    public xe0 n;
    public xe0 o;
    public xe0 p;
    public boolean q;
    public HashMap<Integer, C0079d> r;
    public HashMap<String, C0079d> s;
    public ArrayList<g> t;
    public ArrayList<f> u;

    public class a extends pn7<C0079d> {
        public final TVProgram c;
        public final String d;
        public final c f;
        public final boolean g;

        public a(TVProgram tVProgram, String str, c cVar, boolean z) {
            super(C0079d.class);
            this.c = tVProgram;
            this.d = str;
            this.f = cVar;
            this.g = z;
        }

        @Override
        public final void a(xe0 xe0Var, Throwable th) {
            c cVar = this.f;
            boolean z = this.g;
            if (z) {
                d.this.l(null, cVar, z);
            } else {
                cVar.Q2();
            }
        }

        @Override
        public final Object b(String str) {
            JSONArray optJSONArray = new JSONObject(str).optJSONArray("resources");
            C0079d c0079d = new C0079d();
            if (optJSONArray != null && optJSONArray.length() > 0) {
                for (OnlineResource onlineResource : OnlineResource.from(optJSONArray)) {
                    if (onlineResource instanceof TVProgram) {
                        TVProgram tVProgram = (TVProgram) onlineResource;
                        tVProgram.setIndex(c0079d.b.size());
                        tVProgram.setChannel(d.this.f);
                        c0079d.b(tVProgram);
                    }
                }
            }
            return c0079d;
        }

        @Override
        public final void c(xe0 xe0Var, Object obj) {
            C0079d c0079d = (C0079d) obj;
            if (c0079d != null) {
                c0079d.g = ((l61) this.c.getStartTime()).b;
                if (!c0079d.b.isEmpty()) {
                    d dVar = d.this;
                    dVar.k = null;
                    c0079d.c = "";
                    c0079d.d = "";
                    dVar.s.put(this.d, c0079d);
                }
            }
            d.this.l(c0079d, this.f, this.g);
        }
    }

    public class b extends pn7<e> {
        public final c c;
        public final String d;

        public b(c cVar, String str) {
            super(e.class);
            this.c = cVar;
            this.d = str;
        }

        @Override
        public final void a(xe0 xe0Var, Throwable th) {
            String str = this.d;
            d dVar = d.this;
            dVar.j = str;
            c cVar = this.c;
            if (cVar != null) {
                cVar.Q2();
            }
            dVar.n = null;
        }

        @Override
        public final Object b(String str) {
            JSONObject jSONObject = new JSONObject(str);
            d dVar = d.this;
            e eVar = dVar.new e();
            TVChannel tVChannel = dVar.f;
            if (tVChannel != null) {
                eVar.e = tVChannel;
            }
            eVar.a(jSONObject);
            return eVar;
        }

        @Override
        public final void c(xe0 xe0Var, Object obj) {
            TVProgram tVProgram;
            e eVar = (e) obj;
            d dVar = d.this;
            dVar.j = null;
            C0079d c0079d = eVar != null ? eVar.b : null;
            if (dVar.i == null && (tVProgram = eVar.g) != null) {
                dVar.n(tVProgram);
            }
            c cVar = this.c;
            if (cVar != null) {
                cVar.m(c0079d, false);
            }
            if (c0079d != null) {
                dVar.r.put(Integer.valueOf(c0079d.f), c0079d);
            }
            dVar.n = null;
        }
    }

    public interface c<T> {
        void Q2();

        void d();

        void m(T t, boolean z);
    }

    public class C0079d extends OnlineResource {
        public String c;
        public String d;
        public long g;
        public int h;
        public int i;
        public final ArrayList b = new ArrayList(1);
        public int f = 0;

        public final void b(TVProgram tVProgram) {
            this.b.add(tVProgram);
            if (this.f == 0) {
                d44 startTime = tVProgram.getStartTime();
                this.g = ((l61) tVProgram.getStartTime()).b;
                int f = startTime.l(ofa.a).f();
                this.f = f;
                this.h = f + 1;
                this.i = f - 1;
            }
        }
    }

    public class e {
        public OnlineResource a;
        public C0079d b;
        public String c;
        public String d;
        public TVChannel e;
        public ArrayList f;
        public TVProgram g;

        public e() {
        }

        public final void a(JSONObject jSONObject) throws JSONException {
            JSONArray optJSONArray;
            JSONObject optJSONObject = jSONObject.optJSONObject("profile");
            if (optJSONObject != null) {
                this.a = OnlineResource.from(optJSONObject);
            }
            JSONArray optJSONArray2 = jSONObject.optJSONArray("programs");
            this.b = new C0079d();
            if (optJSONArray2 == null || optJSONArray2.length() <= 0) {
                this.d = gtd.w("nextUrl", jSONObject);
                this.c = gtd.w("lastUrl", jSONObject);
                optJSONArray = jSONObject.optJSONArray("resources");
            } else {
                JSONObject jSONObject2 = optJSONArray2.getJSONObject(0);
                this.d = gtd.w("nextUrl", jSONObject2);
                this.c = gtd.w("lastUrl", jSONObject2);
                optJSONArray = jSONObject2.optJSONArray("resources");
            }
            C0079d c0079d = this.b;
            c0079d.c = this.d;
            c0079d.d = this.c;
            JSONObject optJSONObject2 = jSONObject.optJSONObject("channel");
            if (optJSONObject2 != null) {
                this.e = (TVChannel) OnlineResource.from(optJSONObject2);
            }
            if (optJSONArray != null && optJSONArray.length() > 0) {
                for (OnlineResource onlineResource : OnlineResource.from(optJSONArray)) {
                    if (onlineResource instanceof TVProgram) {
                        TVProgram tVProgram = (TVProgram) onlineResource;
                        tVProgram.setIndex(this.b.b.size());
                        OnlineResource onlineResource2 = this.a;
                        tVProgram.setChannel((onlineResource2 == null || !(onlineResource2 instanceof TVChannel)) ? this.e : (TVChannel) onlineResource2);
                        OnlineResource onlineResource3 = this.a;
                        if ((onlineResource3 instanceof TVProgram) && TextUtils.equals(onlineResource3.getId(), tVProgram.getId())) {
                            ((TVProgram) this.a).setIndex(tVProgram.getIndex());
                            ((TVProgram) this.a).setChannel(tVProgram.getChannel());
                        }
                        this.b.b(tVProgram);
                    }
                }
            }
            this.f = new ArrayList();
            JSONArray optJSONArray3 = jSONObject.optJSONArray(ResourceType.TYPE_NAME_RELATED_CARDS);
            if (optJSONArray3 != null && optJSONArray3.length() > 0) {
                for (int i = 0; i < optJSONArray3.length(); i++) {
                    this.f.add((ResourceFlow) OnlineResource.from(optJSONArray3.getJSONObject(i)));
                }
            }
            int f = ofa.d().f();
            C0079d c0079d2 = this.b;
            if (c0079d2.f == f) {
                ArrayList arrayList = c0079d2.b;
                d.this.getClass();
                this.g = d.e(arrayList);
            }
        }
    }

    public interface f {
        void N();
    }

    public interface g {
        void X(TVProgram tVProgram);
    }

    public interface h {
        d provider();
    }

    public static TVProgram e(ArrayList arrayList) {
        return f(ir2.b(), arrayList);
    }

    public static TVProgram f(long j, ArrayList arrayList) {
        Iterator it = arrayList.iterator();
        while (it.hasNext()) {
            TVProgram tVProgram = (TVProgram) it.next();
            if (((l61) tVProgram.getStartTime()).b <= j && tVProgram.getStopTime().k1() > j) {
                return tVProgram;
            }
        }
        return null;
    }

    public static boolean h(TVProgram tVProgram) {
        return tVProgram != null && SonyLiveProgramTypeUtil.isSonyLiveProgramTvShow(tVProgram.getCategory().getName());
    }

    public static boolean i(OnlineResource onlineResource) {
        if (!(onlineResource instanceof TVProgram)) {
            return false;
        }
        TVProgram tVProgram = (TVProgram) onlineResource;
        String programmeSetId = tVProgram.getProgrammeSetId();
        boolean isSonyLiveProgramTvShow = SonyLiveProgramTypeUtil.isSonyLiveProgramTvShow(tVProgram.getCategory().getName());
        if (!TextUtils.isEmpty(programmeSetId) && isSonyLiveProgramTvShow) {
            HashMap<String, Boolean> hashMap = v;
            if (hashMap.containsKey(programmeSetId)) {
                return hashMap.get(programmeSetId).booleanValue();
            }
        }
        return false;
    }

    public static void o(OnlineResource onlineResource, boolean z) {
        if (onlineResource != null && vue.f0(onlineResource.getType())) {
            TVProgram tVProgram = (TVProgram) onlineResource;
            String programmeSetId = tVProgram.getProgrammeSetId();
            boolean isSonyLiveProgramTvShow = SonyLiveProgramTypeUtil.isSonyLiveProgramTvShow(tVProgram.getCategory().getName());
            if (TextUtils.isEmpty(programmeSetId) || !isSonyLiveProgramTvShow) {
                return;
            }
            v.put(programmeSetId, Boolean.valueOf(z));
        }
    }

    public final void c() {
        xe0 xe0Var = this.n;
        if (xe0Var != null) {
            xe0Var.c();
            this.n = null;
        }
        xe0 xe0Var2 = this.o;
        if (xe0Var2 != null) {
            xe0Var2.c();
            this.o = null;
        }
    }

    public final ResourceFlow d() {
        ResourceFlow resourceFlow = this.m;
        if (resourceFlow == null) {
            return resourceFlow;
        }
        ResourceFlow copySlightly = resourceFlow.copySlightly();
        copySlightly.setResourceList(new ArrayList(this.m.getResourceList()));
        return copySlightly;
    }

    public final void j(String str, c cVar) {
        this.k = null;
        if (cVar != null) {
            cVar.d();
        }
        xe0.c cVar2 = new xe0.c();
        cVar2.b = "GET";
        cVar2.a = str;
        xe0 xe0Var = new xe0(cVar2);
        this.n = xe0Var;
        xe0Var.d(new b(cVar, str));
    }

    public final void k(TVProgram tVProgram, c cVar, boolean z) {
        if (tVProgram == null || cVar == null || TextUtils.isEmpty(tVProgram.getProgrammeSetId())) {
            return;
        }
        this.k = tVProgram;
        String programmeSetId = tVProgram.getProgrammeSetId();
        c();
        xe0.c cVar2 = new xe0.c();
        cVar2.b = "GET";
        String str = Const.YOU_DEV_KEEEEY;
        cVar2.a = bl0.c("https://androidapi.mxplay.com/v1/paging/programs_of_set?id=", programmeSetId);
        xe0 xe0Var = new xe0(cVar2);
        this.o = xe0Var;
        xe0Var.d(new a(tVProgram, programmeSetId, cVar, z));
    }

    public final void l(C0079d c0079d, c cVar, boolean z) {
        if (!z) {
            cVar.m(c0079d, true);
            return;
        }
        ArrayList arrayList = new ArrayList(1);
        this.l = arrayList;
        if (c0079d != null) {
            arrayList.add(c0079d);
        }
        if (this.m != null) {
            this.l.add(d());
        }
        cVar.m(this.l, true);
    }

    public final void m(SonyLivePlayerActivity sonyLivePlayerActivity) {
        String e2;
        this.r.clear();
        c();
        TVProgram tVProgram = this.g;
        if (tVProgram != null) {
            e2 = Const.e(tVProgram.getType().typeName(), this.g.getId());
        } else {
            TVChannel tVChannel = this.f;
            if (tVChannel == null) {
                return;
            } else {
                e2 = Const.e(tVChannel.getType().typeName(), this.f.getId());
            }
        }
        sonyLivePlayerActivity.d();
        xe0.c cVar = new xe0.c();
        cVar.b = "GET";
        cVar.a = e2;
        xe0 xe0Var = new xe0(cVar);
        this.n = xe0Var;
        xe0Var.d(new com.mxtech.videoplayer.ad.online.live.e(this, sonyLivePlayerActivity));
    }

    public final void n(TVProgram tVProgram) {
        if (tVProgram == null) {
            return;
        }
        if (this.i == null || !TextUtils.equals(tVProgram.getId(), this.i.getId())) {
            this.i = tVProgram;
            Iterator<g> it = this.t.iterator();
            while (it.hasNext()) {
                it.next().X(this.i);
            }
        }
    }
}