导航菜单

页面标题

页面副标题

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

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

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


package com.mxtech.videoplayer.ad.local.tiles;

import android.text.TextUtils;
import com.mxtech.videoplayer.ad.online.model.bean.next.Poster;
import com.mxtech.videoplayer.ad.online.model.bean.next.ResourceType;
import com.mxtech.videoplayer.ad.online.model.bean.next.TileResource;
import com.mxtech.videoplayer.ad.online.model.bean.next.TileResources;
import defpackage.c0;
import defpackage.d1j;
import defpackage.nn;
import defpackage.tya;
import defpackage.vc2;
import defpackage.zna;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import kotlin.Unit;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.Charsets;
import org.jetbrains.annotations.NotNull;
import org.json.JSONArray;
import org.json.JSONObject;

public final class a {

    @NotNull
    public static TileResources d = new TileResources();

    @NotNull
    public static final String e = "resources";

    @NotNull
    public static final String f = "allResources";

    @NotNull
    public final fba a;
    public g8g b;
    public nn c;

    public interface InterfaceC0052a {
        @NotNull
        TileResources Y2();
    }

    public a(@NotNull fba fbaVar) {
        this.a = fbaVar;
    }

    public static final TileResources a(a aVar) {
        String str;
        aVar.getClass();
        try {
            str = c0.d("https://androidapi.mxplay.com/v1/local-tab-tile");
        } catch (Exception unused) {
            str = null;
        }
        if (str == null || str.length() == 0) {
            return new TileResources();
        }
        TileResources e2 = e(str);
        if (e2.getTiles().isEmpty()) {
            return new TileResources();
        }
        byte[] bytes = str.getBytes(Charsets.UTF_8);
        File file = new File(tya.m.getExternalCacheDir(), "tiles-cache");
        File parentFile = file.getParentFile();
        if (parentFile != null) {
            parentFile.mkdirs();
        }
        FileOutputStream fileOutputStream = new FileOutputStream(file);
        try {
            aee aeeVar = new aee(vc2.d(fileOutputStream));
            aeeVar.k0("1\n");
            aeeVar.y2(0, bytes.length, bytes);
            aeeVar.flush();
            Unit unit = Unit.INSTANCE;
            ep2.a(fileOutputStream, (Throwable) null);
            HashSet hashSet = new HashSet();
            hashSet.addAll(e2.getTiles());
            hashSet.addAll(e2.getAllTiles());
            Iterator it = hashSet.iterator();
            while (it.hasNext()) {
                List<Poster> poster = ((TileResource) it.next()).getPoster();
                if (poster != null) {
                    Iterator<T> it2 = poster.iterator();
                    while (it2.hasNext()) {
                        String url = ((Poster) it2.next()).getUrl();
                        if (url != null) {
                            zs8.d().f(url, (ou8) null, kr4.t());
                        }
                    }
                }
            }
            int i = d1j.a;
            return e2;
        } catch (Throwable th) {
            try {
                throw th;
            } catch (Throwable th2) {
                ep2.a(fileOutputStream, th);
                throw th2;
            }
        }
    }

    public static void b(List list) {
        zna.b.getClass();
        if (list.isEmpty() || !Intrinsics.b(((TileResource) list.get(0)).getName(), "Offline")) {
            return;
        }
        ((ArrayList) list).remove(0);
    }

    public static TileResources c() {
        TileResources e2;
        File file = new File(tya.m.getExternalCacheDir(), "tiles-cache");
        File parentFile = file.getParentFile();
        if (parentFile != null) {
            parentFile.mkdirs();
        }
        byte[] a = d96.a(file);
        if (a.length < 2) {
            return new TileResources();
        }
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(a);
        try {
            bee beeVar = new bee(vc2.g(byteArrayInputStream));
            if (Intrinsics.b(beeVar.r(), "1")) {
                byte[] n1 = beeVar.n1();
                int i = d1j.a;
                e2 = e(new String(n1, Charsets.UTF_8));
            } else {
                e2 = new TileResources();
            }
            ep2.a(byteArrayInputStream, (Throwable) null);
            return e2;
        } finally {
        }
    }

    public static TileResources e(String str) {
        TileResources tileResources = new TileResources();
        if (str.length() == 0) {
            return tileResources;
        }
        JSONObject jSONObject = new JSONObject(str);
        JSONArray optJSONArray = jSONObject.optJSONArray(e);
        JSONArray optJSONArray2 = jSONObject.optJSONArray(f);
        tileResources.setTiles(f(optJSONArray));
        tileResources.setAllTiles(f(optJSONArray2));
        return tileResources;
    }

    public static ArrayList f(JSONArray jSONArray) {
        ArrayList arrayList = new ArrayList();
        if (jSONArray != null && jSONArray.length() > 0) {
            int length = jSONArray.length();
            for (int i = 0; i < length; i++) {
                JSONObject jSONObject = (JSONObject) jSONArray.get(i);
                TileResource tileResource = new TileResource();
                if (!TextUtils.isEmpty(jSONObject.optString("name"))) {
                    tileResource.initFromJson(jSONObject);
                    tileResource.setType(ResourceType.RealType.TILE);
                    arrayList.add(tileResource);
                }
            }
        }
        h(arrayList);
        return arrayList;
    }

    public static void g(java.util.List r15) {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ad.local.tiles.a.g(java.util.List):void");
    }

    public static void h(List list) {
        List<Poster> poster;
        List<Poster> poster2;
        Iterator it = list.iterator();
        while (it.hasNext()) {
            TileResource tileResource = (TileResource) it.next();
            if ("Recycle Bin".equals(tileResource.getName())) {
                com.mxtech.bin.b.a.getClass();
                Integer num = null;
                int i = 0;
                if (com.mxtech.bin.b.i() > 0) {
                    List<Poster> poster3 = tileResource.getPoster();
                    if (poster3 != null) {
                        List<Poster> list2 = poster3;
                        if (!(list2 instanceof Collection) || !list2.isEmpty()) {
                            Iterator<T> it2 = list2.iterator();
                            while (it2.hasNext()) {
                                if (Intrinsics.b(((Poster) it2.next()).getType(), "light_v2") && (i = i + 1) < 0) {
                                    g43.l();
                                    throw null;
                                }
                            }
                        }
                        num = Integer.valueOf(i);
                    }
                    if (num.intValue() <= 0 || (poster2 = tileResource.getPoster()) == null) {
                        return;
                    }
                    for (Poster poster4 : poster2) {
                        String type = poster4.getType();
                        if (type != null) {
                            switch (type.hashCode()) {
                                case 3075958:
                                    if (type.equals("dark")) {
                                        poster4.setType("dark_emp");
                                        break;
                                    } else {
                                        break;
                                    }
                                case 102970646:
                                    if (type.equals("light")) {
                                        poster4.setType("light_emp");
                                        break;
                                    } else {
                                        break;
                                    }
                                case 991960645:
                                    if (type.equals("light_v2")) {
                                        poster4.setType("light");
                                        break;
                                    } else {
                                        break;
                                    }
                                case 1441646565:
                                    if (type.equals("dark_v2")) {
                                        poster4.setType("dark");
                                        break;
                                    } else {
                                        break;
                                    }
                            }
                        }
                    }
                    return;
                }
                List<Poster> poster5 = tileResource.getPoster();
                if (poster5 != null) {
                    List<Poster> list3 = poster5;
                    if (!(list3 instanceof Collection) || !list3.isEmpty()) {
                        Iterator<T> it3 = list3.iterator();
                        while (it3.hasNext()) {
                            if (Intrinsics.b(((Poster) it3.next()).getType(), "light_emp") && (i = i + 1) < 0) {
                                g43.l();
                                throw null;
                            }
                        }
                    }
                    num = Integer.valueOf(i);
                }
                if (num.intValue() <= 0 || (poster = tileResource.getPoster()) == null) {
                    return;
                }
                for (Poster poster6 : poster) {
                    String type2 = poster6.getType();
                    if (type2 != null) {
                        switch (type2.hashCode()) {
                            case 3075958:
                                if (type2.equals("dark")) {
                                    poster6.setType("dark_v2");
                                    break;
                                } else {
                                    break;
                                }
                            case 102970646:
                                if (type2.equals("light")) {
                                    poster6.setType("light_v2");
                                    break;
                                } else {
                                    break;
                                }
                            case 685994527:
                                if (type2.equals("light_emp")) {
                                    poster6.setType("light");
                                    break;
                                } else {
                                    break;
                                }
                            case 1741356159:
                                if (type2.equals("dark_emp")) {
                                    poster6.setType("dark");
                                    break;
                                } else {
                                    break;
                                }
                        }
                    }
                }
                return;
            }
        }
    }

    public final void d() {
        throw new UnsupportedOperationException("Method not decompiled: com.mxtech.videoplayer.ad.local.tiles.a.d():void");
    }
}