FLIX VISION v2.8.2版本的 MD5 值为:4c8f04d6db90386313134c0796491235
以下内容为反编译后的 a.java 源代码,内容仅作参考
package yb;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.AsyncTask;
import cc.f;
import com.google.gson.l;
import com.google.gson.q;
import com.unity3d.ads.metadata.MediationMetaData;
import flix.com.vision.App;
import flix.com.vision.models.Movie;
import flix.com.vision.utils.JsonUtils;
import ib.m;
import ib.n;
import java.util.ArrayList;
import java.util.Iterator;
import org.apache.commons.lang3.StringUtils;
import org.greenrobot.eventbus.EventBus;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
public final class a {
public final Movie f20666a;
public final String f20667b = "https://www.opensubtitles.org";
public final String f20668c = "https://dl.opensubtitles.org";
public final String f20669d;
public class AsyncTaskC0299a extends AsyncTask<Void, Void, String> {
public ArrayList<m> f20670a = new ArrayList<>();
public final String f20671b;
public final String f20672c;
public final String f20673d;
public AsyncTaskC0299a(String str, String str2, String str3) {
this.f20671b = str;
this.f20672c = str2;
this.f20673d = str3;
}
@Override
@SuppressLint({"StaticFieldLeak"})
public String doInBackground(Void... voidArr) {
int i10;
String str;
String str2 = this.f20671b;
a aVar = a.this;
try {
String str3 = aVar.f20667b;
String str4 = aVar.f20669d;
aVar.f20666a.getImdbID();
l asJsonArray = JsonUtils.parse(App.getAjax("https://www.opensubtitles.org/libs/suggest.php?format=json3&MovieName=" + str2 + "&SubLanguageID=null").body().string()).getAsJsonArray();
i10 = 0;
for (int i11 = 0; i11 < asJsonArray.size(); i11++) {
q asJsonObject = asJsonArray.get(i11).getAsJsonObject();
if (asJsonObject.get(MediationMetaData.KEY_NAME).getAsString().equals(str2) && asJsonObject.get("year").getAsString().equals(this.f20672c)) {
i10 = asJsonObject.get("id").getAsInt();
}
}
} catch (Exception e10) {
e10.printStackTrace();
}
if (i10 == 0) {
EventBus.getDefault().post(new n());
return null;
}
String str5 = "https://www.opensubtitles.org/en/ssearch/sublanguageid-" + aVar.f20669d + "/idmovie-" + i10;
App.getInstance().f11721b = str5;
Iterator<Element> it = ue.a.parse(App.get(str5, aVar.f20667b).body().string()).getElementsByTag("TR").iterator();
String str6 = null;
while (it.hasNext()) {
Element next = it.next();
if (next.attr("itemprop") != null && !next.attr("itemprop").isEmpty()) {
Iterator<Element> it2 = next.getElementsByTag("A").iterator();
while (true) {
if (!it2.hasNext()) {
break;
}
Element next2 = it2.next();
if (next2.attr("itemprop") != null && next2.attr("itemprop").equals("url")) {
if (f.removeSpecialChars(next2.attr("title").split("\"")[r12.split("\"").length - 1].trim()).equalsIgnoreCase(f.removeSpecialChars(this.f20673d))) {
str6 = aVar.f20667b + next2.attr("href");
break;
}
}
}
}
if (str6 != null) {
break;
}
}
if (str6 == null) {
EventBus.getDefault().post(new n());
return null;
}
Document parse = ue.a.parse(App.get(str6, aVar.f20667b).body().string());
Element elementById = parse.getElementById("search_results");
if (elementById == null) {
this.f20670a = aVar.a(parse);
n nVar = new n();
if (!this.f20670a.isEmpty()) {
nVar.f13822a = this.f20670a;
}
EventBus.getDefault().post(nVar);
return null;
}
Iterator<Element> it3 = elementById.getElementsByTag("TR").iterator();
while (it3.hasNext()) {
Element next3 = it3.next();
if (next3.text().contains("srt") || next3.text().contains("vtt")) {
Iterator<Element> it4 = next3.getElementsByTag("A").iterator();
String str7 = null;
while (it4.hasNext() && (str7 = it4.next().attr("href")) != null && !str7.contains("/sub/")) {
}
Iterator<Element> it5 = next3.getElementsByTag("SPAN").iterator();
while (true) {
if (!it5.hasNext()) {
str = null;
break;
}
Element next4 = it5.next();
if (next4.attr("title") != null && !next4.attr("title").isEmpty()) {
str = next4.attr("title");
break;
}
}
String str8 = aVar.f20669d;
Iterator<Element> it6 = next3.getElementsByTag("TD").iterator();
while (true) {
if (!it6.hasNext()) {
break;
}
Element next5 = it6.next();
if (!next5.getElementsByTag("DIV").isEmpty() && !next5.getElementsByTag("A").isEmpty()) {
str8 = next5.getElementsByTag("A").first().attr("title");
break;
}
}
if (str == null || str.length() < 10) {
str = next3.text().substring(0, 30);
}
if (str8 == null) {
str8 = aVar.f20669d;
}
m mVar = new m();
mVar.f13821g = str8 + "." + str;
StringBuilder sb2 = new StringBuilder();
sb2.append(aVar.f20668c);
sb2.append(str7.replace("subtitleserve", "download"));
mVar.f13820b = sb2.toString();
if (!this.f20670a.contains(mVar)) {
this.f20670a.add(mVar);
}
}
}
if (this.f20670a.isEmpty()) {
this.f20670a = aVar.a(parse);
}
n nVar2 = new n();
if (!this.f20670a.isEmpty()) {
nVar2.f13822a = this.f20670a;
}
EventBus.getDefault().post(nVar2);
return null;
}
@Override
public void onPostExecute(String str) {
super.onPostExecute((AsyncTaskC0299a) str);
}
}
public class b extends AsyncTask<Void, Void, String> {
public ArrayList<m> f20675a = new ArrayList<>();
public b() {
}
@Override
@SuppressLint({"StaticFieldLeak"})
public String doInBackground(Void... voidArr) {
Document parse;
Element elementById;
String str;
a aVar = a.this;
try {
parse = ue.a.parse(App.get(aVar.f20667b + "/en/search/sublanguageid-" + aVar.f20669d + "/imdbid-" + aVar.f20666a.getImdbID(), aVar.f20667b).body().string());
elementById = parse.getElementById("search_results");
} catch (Exception e10) {
e10.printStackTrace();
}
if (elementById == null) {
this.f20675a = aVar.a(parse);
n nVar = new n();
if (!this.f20675a.isEmpty()) {
nVar.f13822a = this.f20675a;
}
EventBus.getDefault().post(nVar);
return null;
}
Iterator<Element> it = elementById.getElementsByTag("TR").iterator();
while (it.hasNext()) {
Element next = it.next();
if (next.text().contains("srt") || next.text().contains("vtt")) {
Iterator<Element> it2 = next.getElementsByTag("A").iterator();
String str2 = null;
while (it2.hasNext() && (str2 = it2.next().attr("href")) != null && !str2.contains("/sub/")) {
}
Iterator<Element> it3 = next.getElementsByTag("SPAN").iterator();
while (true) {
if (!it3.hasNext()) {
str = null;
break;
}
Element next2 = it3.next();
if (next2.attr("title") != null && !next2.attr("title").isEmpty()) {
str = next2.attr("title");
break;
}
}
String str3 = aVar.f20669d;
Iterator<Element> it4 = next.getElementsByTag("TD").iterator();
while (true) {
if (!it4.hasNext()) {
break;
}
Element next3 = it4.next();
if (!next3.getElementsByTag("DIV").isEmpty() && !next3.getElementsByTag("A").isEmpty()) {
str3 = next3.getElementsByTag("A").first().attr("title");
break;
}
}
if (str == null || str.length() < 10) {
str = next.text().substring(0, 30);
}
if (str3 == null) {
str3 = aVar.f20669d;
}
m mVar = new m();
mVar.f13821g = str3 + "." + str;
StringBuilder sb2 = new StringBuilder();
sb2.append(aVar.f20668c);
sb2.append(str2.replace("subtitleserve", "download"));
mVar.f13820b = sb2.toString();
if (!this.f20675a.contains(mVar)) {
this.f20675a.add(mVar);
}
}
}
if (this.f20675a.isEmpty()) {
this.f20675a = aVar.a(parse);
}
n nVar2 = new n();
if (!this.f20675a.isEmpty()) {
nVar2.f13822a = this.f20675a;
}
EventBus.getDefault().post(nVar2);
return null;
}
@Override
public void onPostExecute(String str) {
super.onPostExecute((b) str);
}
}
public a(Context context, Movie movie, String str) {
this.f20669d = str.replace(StringUtils.SPACE, "").trim();
this.f20666a = movie;
}
public final ArrayList<m> a(Document document) {
ArrayList<m> arrayList = new ArrayList<>();
Element elementById = document.getElementById("bt-dwl-bt");
if (elementById != null) {
String str = this.f20668c + elementById.attr("href").replace("subtitleserve", "download");
m mVar = new m();
mVar.f13820b = str;
mVar.f13821g = this.f20669d + "." + this.f20666a.getTitle().replace(StringUtils.SPACE, ".") + ".Sub";
arrayList.add(mVar);
}
return arrayList;
}
@SuppressLint({"StaticFieldLeak"})
public void process() {
new b().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
}
@SuppressLint({"StaticFieldLeak"})
public void process(int i10, int i11, String str, String str2, String str3) {
App.getInstance().f11721b = null;
new AsyncTaskC0299a(str, str3, str2).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
}
}