FLIX VISION v2.8.2版本的 MD5 值为:4d33b143293b36f23ce5a6a5834e6993

以下内容为反编译后的 b.java 源代码,内容仅作参考


package wb;

import android.content.Context;
import android.os.AsyncTask;
import android.os.Handler;
import android.webkit.ValueCallback;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import flix.com.vision.App;
import flix.com.vision.helpers.Constants;
import flix.com.vision.models.Movie;
import flix.com.vision.processors.english.BaseProcessor;
import ib.o;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Iterator;
import org.adblockplus.libadblockplus.android.webview.AdblockWebView;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jsoup.nodes.Element;

public final class b extends BaseProcessor {

    public final Movie f19259f;

    public final Context f19260g;

    public AdblockWebView f19266m;

    public final String f19261h = "https://www.scnsrc.me";

    public final ArrayList<String> f19262i = new ArrayList<>();

    public int f19263j = 0;

    public boolean f19264k = true;

    public int f19265l = 0;

    public boolean f19267n = false;

    public boolean f19268o = false;

    public static class a {

        public String f19269a;
    }

    public class C0280b extends WebViewClient {

        public class a implements ValueCallback<String> {
            public a() {
            }

            @Override
            public void onReceiveValue(String str) {
                C0280b c0280b = C0280b.this;
                b.this.getClass();
                if (str == null || str.length() < 100) {
                    return;
                }
                try {
                    String unescapeJava = StringEscapeUtils.unescapeJava(str);
                    if (unescapeJava.contains("Just a moment...") || unescapeJava.contains("Checking if the site connection is secure") || unescapeJava.contains("Checking your browser before accessing")) {
                        return;
                    }
                    b bVar = b.this;
                    if (bVar.f19264k) {
                        bVar.b(unescapeJava, true);
                    } else {
                        bVar.c(unescapeJava, true);
                    }
                } catch (Exception e10) {
                    e10.printStackTrace();
                }
            }
        }

        public C0280b() {
        }

        @Override
        public void onPageFinished(WebView webView, String str) {
            AdblockWebView adblockWebView;
            super.onPageFinished(webView, str);
            b bVar = b.this;
            if (bVar.f19268o || (adblockWebView = bVar.f19266m) == null) {
                return;
            }
            try {
                adblockWebView.evaluateJavascript("(function(){var el = document.documentElement; var xml = el.innerHTML; return xml;})()", new a());
            } catch (Exception unused) {
            }
        }
    }

    public b(Context context, Movie movie, hb.e eVar) {
        this.f19260g = context;
        this.f19259f = movie;
        this.f12420b = eVar;
        EventBus.getDefault().register(this);
    }

    public final void b(String str, boolean z10) {
        ArrayList<String> arrayList;
        Movie movie = this.f19259f;
        try {
            Iterator<Element> it = ue.a.parse(str).getElementsByTag("A").iterator();
            while (true) {
                boolean hasNext = it.hasNext();
                arrayList = this.f19262i;
                if (!hasNext) {
                    break;
                }
                Element next = it.next();
                String lowerCase = next.text().toLowerCase();
                if (!lowerCase.isEmpty() && lowerCase.length() >= 15) {
                    String attr = next.attr("href");
                    String str2 = movie.getTitle() + StringUtils.SPACE + movie.getYear();
                    String replace = movie.getTitle().replace(":", "").replace(" - ", StringUtils.SPACE).replace("-", StringUtils.SPACE);
                    String str3 = replace + StringUtils.SPACE + movie.getYear();
                    String removeSpecialChars = cc.f.removeSpecialChars(movie.getTitle());
                    String removeSpecialChars2 = cc.f.removeSpecialChars(lowerCase);
                    String str4 = replace.replace("&", StringUtils.SPACE) + StringUtils.SPACE + movie.getYear();
                    if (removeSpecialChars2.toLowerCase().contains(removeSpecialChars.toLowerCase()) || lowerCase.contains(str3.toLowerCase()) || lowerCase.contains(str4.toLowerCase()) || lowerCase.contains(str2.toLowerCase())) {
                        if (attr.startsWith("/")) {
                            attr = this.f19261h + attr;
                        }
                        arrayList.add(attr);
                    }
                }
            }
            if (arrayList.size() <= 0 || this.f19268o) {
                return;
            }
            if (z10) {
                this.f19264k = false;
                this.f19266m.loadUrl(arrayList.get(this.f19263j));
                this.f19263j++;
            } else {
                Iterator<String> it2 = arrayList.iterator();
                while (it2.hasNext()) {
                    c(((ve.b) ue.a.connect(it2.next())).get().html(), false);
                }
            }
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    public final void c(String str, boolean z10) {
        if (this.f19265l > 40) {
            return;
        }
        ArrayList arrayList = new ArrayList();
        Iterator<Element> it = ue.a.parse(str).getElementsByTag("A").iterator();
        while (it.hasNext()) {
            Element next = it.next();
            if (this.f19265l > 40) {
                return;
            }
            String attr = next.attr("href");
            if (!attr.startsWith("/") && !attr.contains(this.f19261h) && next.text().length() >= 10 && !attr.contains(".rar") && App.isRdSupported(attr)) {
                this.f19265l++;
                o oVar = new o();
                oVar.f13832o = false;
                oVar.f13833p = true;
                oVar.f13829l = true;
                oVar.f13840w = true;
                oVar.f13838u = attr;
                try {
                    addLink(oVar);
                    arrayList.add(oVar);
                } catch (Exception unused) {
                }
            }
        }
        if (z10) {
            ArrayList<String> arrayList2 = this.f19262i;
            if (arrayList2.size() <= 0 || this.f19263j >= 2 || arrayList2.size() <= 1) {
                return;
            }
            this.f19264k = false;
            this.f19266m.loadUrl(arrayList2.get(this.f19263j));
            this.f19263j++;
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMessageEvent(Constants.a aVar) {
        this.f19268o = true;
        EventBus.getDefault().unregister(this);
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMessageEvent(a aVar) {
        String str;
        if (this.f19267n || aVar == null || (str = aVar.f19269a) == null) {
            return;
        }
        this.f19267n = true;
        try {
            this.f19266m.loadUrl(str);
        } catch (Exception unused) {
        }
        new Handler().postDelayed(new androidx.activity.d(this, 29), 1000L);
    }

    public void process(int i10) {
        String replace;
        AdblockWebView adblockWebView = new AdblockWebView(this.f19260g);
        this.f19266m = adblockWebView;
        adblockWebView.setWebViewClient(new C0280b());
        this.f19266m.getSettings().setAllowContentAccess(true);
        this.f19266m.getSettings().setJavaScriptEnabled(true);
        StringBuilder sb2 = new StringBuilder();
        Movie movie = this.f19259f;
        sb2.append(movie.getTitle().replace("&", ""));
        sb2.append(StringUtils.SPACE);
        sb2.append(movie.getYear());
        String removeSpecialCharsKeepSpace = cc.f.removeSpecialCharsKeepSpace(sb2.toString());
        String n10 = a.b.n(new StringBuilder(), this.f19261h, "/?s=");
        try {
            replace = URLEncoder.encode(removeSpecialCharsKeepSpace, StandardCharsets.UTF_8.toString());
        } catch (Exception unused) {
            replace = n10.replace(StringUtils.SPACE, "%20");
        }
        new wb.a(this, a.b.C(n10, replace)).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
    }
}