影视仓 v5.0.24版本的 MD5 值为:620341689ccdc375a3b86527e140060e
以下内容为反编译后的 FastSearchActivity.java 源代码,内容仅作参考
package com.github.tvbox.osc.ui.activity;
import android.content.Intent;
import android.text.TextUtils;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.lifecycle.ViewModelProvider;
import com.androidx.ck;
import com.androidx.gw0;
import com.androidx.i;
import com.androidx.j11;
import com.androidx.md;
import com.androidx.mr;
import com.androidx.nr0;
import com.androidx.oO0O000o;
import com.androidx.oO0O00oO;
import com.androidx.oo0oO0;
import com.androidx.or;
import com.androidx.sm;
import com.androidx.tm;
import com.androidx.ty0;
import com.androidx.uf0;
import com.androidx.um;
import com.androidx.vm;
import com.androidx.wm;
import com.androidx.xm;
import com.androidx.xm0;
import com.androidx.xs0;
import com.androidx.ym;
import com.androidx.yq;
import com.github.catvod.crawler.JsLoader;
import com.github.tvbox.osc.R$id;
import com.github.tvbox.osc.R$layout;
import com.github.tvbox.osc.base.BaseActivity;
import com.github.tvbox.osc.bean.AbsXml;
import com.github.tvbox.osc.bean.Movie;
import com.github.tvbox.osc.bean.SourceBean;
import com.owen.tvrecyclerview.widget.TvRecyclerView;
import com.owen.tvrecyclerview.widget.V7GridLayoutManager;
import com.owen.tvrecyclerview.widget.V7LinearLayoutManager;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Stack;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicInteger;
import org.greenrobot.eventbus.ThreadMode;
public class FastSearchActivity extends BaseActivity {
public LinearLayout OooO;
public TextView OooOO0;
public TvRecyclerView OooOO0O;
public TvRecyclerView OooOO0o;
public TvRecyclerView OooOOO;
public TvRecyclerView OooOOO0;
public gw0 OooOOOO;
public oO0O00oO OooOOOo;
public nr0 OooOOo;
public nr0 OooOOo0;
public sm OooOOoo;
public HashMap OooOo0;
public HashMap OooOo0o;
public String OooOo00 = "";
public String OooOo0O = "";
public final ArrayList OooOo = new ArrayList();
public HashMap OooOoO0 = null;
public final Stack OooOoO = new Stack();
public Movie.Video OooOoOO = null;
public final boolean OooOoo0 = i.OooOo0o("search_result_type", Boolean.TRUE);
public final tm OooOoo = new tm(this, 0);
public List OooOooO = null;
public ExecutorService OooOooo = null;
public final AtomicInteger Oooo000 = new AtomicInteger(0);
public static void OooO(FastSearchActivity fastSearchActivity, String str) {
fastSearchActivity.getClass();
if (str.equals("全部显示")) {
fastSearchActivity.OooOO0O.setVisibility(0);
fastSearchActivity.OooOO0o.setVisibility(8);
return;
}
fastSearchActivity.OooOO0O.setVisibility(8);
fastSearchActivity.OooOO0o.setVisibility(0);
String str2 = (String) fastSearchActivity.OooOo0.get(str);
if (str2 != null && !str2.isEmpty() && !Objects.equals(fastSearchActivity.OooOo0O, str2)) {
fastSearchActivity.OooOo0O = str2;
fastSearchActivity.OooOOo.OooOOO((List) fastSearchActivity.OooOo0o.get(str2));
}
}
@Override
public final int OooO0O0() {
return R$layout.activity_fast_search;
}
public final void OooOO0(Movie.Video video) {
this.OooOOOO.OooOO0(video.sourceKey, video.id, new HashMap());
this.OooOOOO.OooO0o.observe(this, new ym(this));
}
public final void OooOO0O(String str) {
nr0 nr0Var;
ArrayList arrayList;
HashMap hashMap;
uf0.OooO00o.OooO00o("search");
OooO0oO();
this.OooOo00 = str.replaceAll("[pP][gG]\\d+", "");
if (this.OooOo.isEmpty()) {
((yq) new yq("http://api.pullword.com/get.php?source=" + URLEncoder.encode(this.OooOo00) + "¶m1=0¶m2=0&json=1").tag("fenci")).execute(new md(this, 1));
}
this.OooOO0O.setVisibility(4);
this.OooOO0o.setVisibility(8);
this.OooOOo0.OooOOO(new ArrayList());
this.OooOOo.OooOOO(new ArrayList());
sm smVar = this.OooOOoo;
smVar.OooOOo = 0L;
smVar.OooOOoo = 0;
smVar.OooOo00 = null;
this.OooOo0o.clear();
this.OooOo0O = "";
this.OooOo0.clear();
ArrayList OooOo0o = or.OooOo0o(String.class, "SEARCH_HISTORY");
if (OooOo0o.size() > 20) {
OooOo0o.remove(OooOo0o.size() - 1);
}
if (!OooOo0o.contains(str)) {
OooOo0o.add(0, str);
}
i.OoooOO0("SEARCH_HISTORY", OooOo0o);
AtomicInteger atomicInteger = this.Oooo000;
try {
ExecutorService executorService = this.OooOooo;
if (executorService != null) {
executorService.shutdownNow();
this.OooOooo = null;
JsLoader.stopAll();
}
this.OooOOo0.OooOOO(new ArrayList());
nr0Var = this.OooOOo;
arrayList = new ArrayList();
} catch (Throwable th) {
try {
th.printStackTrace();
this.OooOOo0.OooOOO(new ArrayList());
nr0Var = this.OooOOo;
arrayList = new ArrayList();
} catch (Throwable th2) {
this.OooOOo0.OooOOO(new ArrayList());
this.OooOOo.OooOOO(new ArrayList());
atomicInteger.set(0);
throw th2;
}
}
nr0Var.OooOOO(arrayList);
atomicInteger.set(0);
this.OooOooo = Executors.newFixedThreadPool(8);
ArrayList arrayList2 = new ArrayList();
arrayList2.addAll(oo0oO0.get().getSourceBeanList());
SourceBean homeSourceBean = oo0oO0.get().getHomeSourceBean();
arrayList2.remove(homeSourceBean);
arrayList2.add(0, homeSourceBean);
ArrayList arrayList3 = new ArrayList();
this.OooOOoo.OooOOO(new ArrayList());
this.OooOOoo.OooO00o("全部显示");
Iterator it = arrayList2.iterator();
while (it.hasNext()) {
SourceBean sourceBean = (SourceBean) it.next();
if (sourceBean.isSearchable() && ((hashMap = this.OooOoO0) == null || hashMap.containsKey(sourceBean.getKey()))) {
arrayList3.add(sourceBean.getKey());
this.OooOo0.put(sourceBean.getName(), sourceBean.getKey());
atomicInteger.incrementAndGet();
}
}
Iterator it2 = arrayList3.iterator();
while (it2.hasNext()) {
this.OooOooo.execute(new j11(this, (String) it2.next()));
}
}
public final void OooOO0o(AbsXml absXml) {
Movie movie;
List<Movie.Video> list;
boolean z;
if (absXml != null && (movie = absXml.movie) != null && (list = movie.videoList) != null && list.size() > 0) {
ArrayList arrayList = new ArrayList();
Iterator<Movie.Video> it = absXml.movie.videoList.iterator();
String str = "";
while (true) {
int i = 0;
if (!it.hasNext()) {
break;
}
Movie.Video next = it.next();
if (this.OooOoo0) {
String str2 = next.name;
String str3 = this.OooOo00;
if (!TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str3)) {
String[] split = str3.trim().split("\\s+");
int i2 = 0;
for (String str4 : split) {
if (str2.contains(str4)) {
i2++;
}
}
if (i2 == split.length) {
z = true;
if (z && !next.isAlist()) {
}
}
}
z = false;
if (z) {
}
}
arrayList.add(next);
if (!this.OooOo0o.containsKey(next.sourceKey)) {
this.OooOo0o.put(next.sourceKey, new ArrayList());
}
((ArrayList) this.OooOo0o.get(next.sourceKey)).add(next);
if (!next.sourceKey.equals(str)) {
str = next.sourceKey;
try {
String str5 = "";
for (String str6 : this.OooOo0.keySet()) {
if (this.OooOo0.get(str6) == str) {
str5 = str6;
}
}
if (str5 != "") {
List list2 = this.OooOOoo.OooOOO0;
while (true) {
if (i < list2.size()) {
if (str5 == list2.get(i)) {
break;
}
i++;
} else {
this.OooOOoo.OooO00o(str5);
break;
}
}
}
} catch (Exception unused) {
}
}
if (oO0O000o.OooO0o0().OooO0oO().size() < 5) {
oO0O000o OooO0o0 = oO0O000o.OooO0o0();
String str7 = this.OooOo00;
String str8 = next.name;
OooO0o0.getClass();
if (oO0O000o.OooO(str7, str8)) {
oO0O000o.OooO0o0().OooO0oO().put(next.sourceKey, next);
}
}
}
if (this.OooOOo0.OooOOO0.size() > 0) {
this.OooOOo0.OooO0O0(arrayList);
} else {
OooO0oo();
this.OooOO0O.setVisibility(0);
this.OooOOo0.OooOOO(arrayList);
}
}
if (this.Oooo000.decrementAndGet() <= 0) {
if (this.OooOOo0.OooOOO0.size() <= 0) {
OooO0o();
}
uf0.OooO00o.OooO00o("search");
}
}
public final void OooOOO0() {
ExecutorService executorService = this.OooOooo;
if (executorService != null) {
this.OooOooO = executorService.shutdownNow();
this.OooOooo = null;
JsLoader.stopAll();
}
}
@Override
public final void init() {
this.OooOo0 = new HashMap();
this.OooOo0o = new HashMap();
ck.OooO0O0().OooO(this);
this.OooO = (LinearLayout) findViewById(R$id.llLayout);
this.OooOO0 = (TextView) findViewById(R$id.mSearchTitle);
this.OooOO0O = (TvRecyclerView) findViewById(R$id.mGridView);
this.OooOOO0 = (TvRecyclerView) findViewById(R$id.mGridViewWord);
this.OooOO0o = (TvRecyclerView) findViewById(R$id.mGridViewFilter);
this.OooOOO0.setHasFixedSize(true);
this.OooOOO0.setLayoutManager(new V7LinearLayoutManager(this.OooO0o0, 1));
sm smVar = new sm();
this.OooOOoo = smVar;
this.OooOOO0.setAdapter(smVar);
this.OooOOO0.addOnChildAttachStateChangeListener(new um(this));
this.OooOOoo.setOnItemClickListener(new vm(this, 0));
this.OooOO0O.setHasFixedSize(true);
this.OooOO0O.setLayoutManager(new V7GridLayoutManager(this.OooO0o0, 5));
this.OooOO0O.setOnItemListener(new vm(this));
nr0 nr0Var = new nr0();
this.OooOOo0 = nr0Var;
this.OooOO0O.setAdapter(nr0Var);
this.OooOOo0.setOnItemClickListener(new wm(this));
if (i.OooOoO("search_view", 1) == 0) {
this.OooOO0O.setLayoutManager(new V7GridLayoutManager(this.OooO0o0, 2));
this.OooOO0o.setLayoutManager(new V7GridLayoutManager(this.OooO0o0, 2));
} else {
this.OooOO0O.setLayoutManager(new V7GridLayoutManager(this.OooO0o0, 5));
this.OooOO0o.setLayoutManager(new V7GridLayoutManager(this.OooO0o0, 5));
}
nr0 nr0Var2 = new nr0();
this.OooOOo = nr0Var2;
this.OooOO0o.setAdapter(nr0Var2);
this.OooOOo.setOnItemClickListener(new xm(this));
OooO0o0(this.OooO);
this.OooOOOo = new oO0O00oO(9);
TvRecyclerView tvRecyclerView = (TvRecyclerView) findViewById(R$id.mGridViewWordFenci);
this.OooOOO = tvRecyclerView;
tvRecyclerView.setAdapter(this.OooOOOo);
this.OooOOO.setLayoutManager(new V7LinearLayoutManager(this.OooO0o0, 0));
this.OooOOOo.setOnItemClickListener(new vm(this, 2));
this.OooOOOo.OooOOO(new ArrayList());
this.OooOOOO = (gw0) new ViewModelProvider(this).get(gw0.class);
Intent intent = getIntent();
this.OooOoO0 = mr.OooOOo();
if (intent != null && intent.hasExtra("title")) {
String stringExtra = intent.getStringExtra("title");
OooO0oO();
OooOO0O(stringExtra);
}
}
@Override
public final void onBackPressed() {
Stack stack = this.OooOoO;
if (stack.isEmpty()) {
super.onBackPressed();
return;
}
Movie.Video video = (Movie.Video) stack.pop();
if (video.isFolder()) {
OooOO0(video);
this.OooOoOO = video;
return;
}
OooOO0O(this.OooOo00);
}
@Override
public final void onDestroy() {
super.onDestroy();
uf0.OooO00o.OooO00o("search");
try {
OooOOO0();
} catch (Throwable th) {
th.printStackTrace();
}
oO0O000o.OooO0o0().OooO0Oo();
ck.OooO0O0().OooOO0O(this);
JsLoader.load();
}
@Override
public final void onNewIntent(Intent intent) {
super.onNewIntent(intent);
this.OooOoO0 = mr.OooOOo();
if (intent != null && intent.hasExtra("title")) {
String stringExtra = intent.getStringExtra("title");
OooO0oO();
OooOO0O(stringExtra);
}
}
@Override
public final void onResume() {
super.onResume();
List list = this.OooOooO;
if (list != null && list.size() > 0) {
this.OooOooo = Executors.newFixedThreadPool(8);
this.Oooo000.set(this.OooOooO.size());
for (Runnable runnable : this.OooOooO) {
this.OooOooo.execute(runnable);
}
this.OooOooO.clear();
this.OooOooO = null;
}
}
@ty0(threadMode = ThreadMode.MAIN)
public void refresh(xm0 xm0Var) {
Object obj;
AbsXml absXml;
int i = xm0Var.type;
if (i == 6) {
try {
Object obj2 = xm0Var.obj;
if (obj2 == null) {
absXml = null;
} else {
absXml = (AbsXml) obj2;
}
OooOO0o(absXml);
} catch (Exception unused) {
OooOO0o(null);
}
} else if (i == 4 && (obj = xm0Var.obj) != null) {
this.OooOOOo.OooOOO((List) obj);
}
TextView textView = this.OooOO0;
if (textView != null) {
textView.setText(String.format("搜索(%d/%d)", Integer.valueOf(this.OooOo0o.size()), Integer.valueOf(this.OooOo0.size())));
}
}
@ty0(threadMode = ThreadMode.MAIN)
public void server(xs0 xs0Var) {
if (xs0Var.type == 2) {
OooO0oO();
OooOO0O((String) xs0Var.obj);
}
}
}