导航菜单

页面标题

页面副标题

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

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

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


package com.mxtech.subtitle.service;

import android.net.Uri;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.microsoft.identity.common.java.authscheme.PopAuthenticationSchemeInternal;
import com.microsoft.identity.common.java.cache.CacheKeyValueDelegate;
import com.mxtech.subtitle.service.SubtitleService;
import com.mxtech.videoplayer.ad.online.model.bean.next.ResourceType;
import defpackage.d1j;
import defpackage.fab;
import defpackage.z4i;
import defpackage.zjg;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Locale;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public final class a extends b {
    public static final String[] m = {"User-Agent", "MX Player v1"};

    public static void F(@NonNull Uri.Builder builder, String str, String str2) {
        if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
            return;
        }
        builder.appendEncodedPath(str + CacheKeyValueDelegate.CACHE_VALUE_SEPARATOR + str2);
    }

    public static String G(fab fabVar, Locale[] localeArr, String str) {
        Uri.Builder buildUpon = Uri.parse("https://subtitle.mxplay.com/search").buildUpon();
        Uri.Builder buildUpon2 = Uri.parse("https://rest.opensubtitles.org/search/").buildUpon();
        String f = fabVar.f();
        long g = fabVar.g();
        if (!TextUtils.isEmpty(f) && g > 0) {
            F(buildUpon2, "moviebytesize", Long.toString(g));
            F(buildUpon2, "moviehash", f);
        }
        F(buildUpon2, "query", str);
        F(buildUpon2, "sublanguageid", b.y((localeArr == null || localeArr.length <= 0) ? null : localeArr[0]));
        F(buildUpon2, ResourceType.TYPE_NAME_TAG, fabVar.c);
        buildUpon.appendQueryParameter(PopAuthenticationSchemeInternal.SerializedNames.URL, buildUpon2.build().toString());
        return buildUpon.build().toString();
    }

    public static zjg[] H(fab fabVar, String str) {
        if (TextUtils.isEmpty(str)) {
            return new zjg[0];
        }
        ArrayList arrayList = new ArrayList();
        try {
            HashSet hashSet = new HashSet();
            JSONArray jSONArray = new JSONArray(str);
            for (int i = 0; i < jSONArray.length(); i++) {
                JSONObject optJSONObject = jSONArray.optJSONObject(i);
                if (optJSONObject != null) {
                    zjg zjgVar = new zjg();
                    zjgVar.b = "opensubtitles.org";
                    zjgVar.f = optJSONObject.optString("SubFileName");
                    zjgVar.c = fabVar;
                    zjgVar.l = optJSONObject.optString("IDSubtitleFile");
                    zjgVar.g = b.C(optJSONObject.optString("SubLanguageID"));
                    zjgVar.k = optJSONObject.optString("SubDownloadLink", null);
                    zjgVar.i = b.u(optJSONObject.optString("SubRating"));
                    zjgVar.h = optJSONObject.optInt("SubSize");
                    String str2 = zjgVar.k;
                    if (str2 != null && !hashSet.contains(str2)) {
                        arrayList.add(zjgVar);
                        hashSet.add(zjgVar.k);
                    }
                }
            }
        } catch (JSONException unused) {
        }
        return (zjg[]) arrayList.toArray(new zjg[arrayList.size()]);
    }

    @Override
    public final zjg[] D(fab[] fabVarArr, Locale[] localeArr, String str) throws SubtitleService.SubtitleServiceException {
        if (fabVarArr != null) {
            try {
                if (fabVarArr.length > 0) {
                    fab fabVar = fabVarArr[0];
                    String G = G(fabVar, localeArr, str);
                    String[] strArr = m;
                    String c = z4i.c(G, strArr);
                    Arrays.toString(strArr);
                    int i = d1j.a;
                    return H(fabVar, c);
                }
            } catch (IOException e) {
                throw new SubtitleService.NetworkException(e);
            }
        }
        return new zjg[0];
    }
}