影视仓 v5.0.24版本的 MD5 值为:620341689ccdc375a3b86527e140060e
以下内容为反编译后的 DriveActivity.java 源代码,内容仅作参考
package com.github.tvbox.osc.ui.activity;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.media3.session.o000;
import com.androidx.OooOo;
import com.androidx.ck;
import com.androidx.i;
import com.androidx.jb;
import com.androidx.ng;
import com.androidx.o0o0000;
import com.androidx.oO0O00oO;
import com.androidx.og;
import com.androidx.pg;
import com.androidx.sg;
import com.androidx.ty0;
import com.androidx.uf0;
import com.androidx.vg;
import com.androidx.xm0;
import com.androidx.yx0;
import com.github.tvbox.osc.R$color;
import com.github.tvbox.osc.R$drawable;
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.DriveFolderFile;
import com.github.tvbox.osc.bean.VodInfo;
import com.github.tvbox.osc.cache.OooO00o;
import com.github.tvbox.osc.cache.StorageDrive;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.owen.tvrecyclerview.widget.TvRecyclerView;
import com.owen.tvrecyclerview.widget.V7LinearLayoutManager;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicInteger;
import me.jessyan.autosize.utils.AutoSizeUtils;
import org.greenrobot.eventbus.ThreadMode;
public class DriveActivity extends BaseActivity {
public static final int OooOo0 = 0;
public TextView OooO;
public TvRecyclerView OooOO0;
public ImageButton OooOO0O;
public ImageButton OooOO0o;
public ImageButton OooOOO0;
public boolean OooOOo;
public boolean OooOOoo;
public final Handler OooOo00;
public final oO0O00oO OooOOO = new oO0O00oO(2);
public ArrayList OooOOOO = null;
public OooOo OooOOOo = null;
public int OooOOo0 = 0;
public DriveActivity() {
new AtomicInteger(0);
this.OooOOo = i.OooOo0o("drive_auto_save", Boolean.FALSE);
this.OooOOoo = false;
this.OooOo00 = new Handler();
}
public static void OooO(DriveActivity driveActivity, String str, DriveFolderFile driveFolderFile) {
String webDAVBase64Credential;
driveActivity.getClass();
VodInfo vodInfo = new VodInfo();
vodInfo.name = driveFolderFile.name;
vodInfo.playFlag = "drive";
DriveFolderFile driveFolderFile2 = driveActivity.OooOOOo.OooO00o;
if (driveFolderFile2.getDriveType() == yx0.WEBDAV && (webDAVBase64Credential = driveFolderFile2.getWebDAVBase64Credential()) != null) {
JsonObject jsonObject = new JsonObject();
JsonArray jsonArray = new JsonArray();
jsonArray.add(JsonParser.parseString("{ \"name\": \"authorization\", \"value\": \"Basic " + webDAVBase64Credential + "\" }"));
jsonObject.add("headers", jsonArray);
vodInfo.playerCfg = jsonObject.toString();
}
ArrayList<VodInfo.VodSeriesFlag> arrayList = new ArrayList<>();
vodInfo.seriesFlags = arrayList;
arrayList.add(new VodInfo.VodSeriesFlag("drive"));
vodInfo.seriesMap = new LinkedHashMap<>();
VodInfo.VodSeries vodSeries = new VodInfo.VodSeries(str, o000.Oooo000("tvbox-drive://", str));
ArrayList arrayList2 = new ArrayList();
arrayList2.add(vodSeries);
vodInfo.seriesMap.put("drive", arrayList2);
Bundle bundle = new Bundle();
bundle.putBoolean("newSource", true);
bundle.putString("sourceKey", "_drive");
bundle.putSerializable("VodInfo", vodInfo);
driveActivity.OooO0Oo(PlayActivity.class, bundle);
String str2 = driveFolderFile.getAccessingPathStr() + driveFolderFile.name;
if (driveFolderFile2.getDriveType() == yx0.ALISTWEB && !TextUtils.isEmpty(str2)) {
String str3 = driveFolderFile2.name;
ArrayList<VodInfo.VodSeriesFlag> arrayList3 = new ArrayList<>();
vodInfo.seriesFlags = arrayList3;
arrayList3.add(new VodInfo.VodSeriesFlag(str3));
vodInfo.sourceKey = "TVBOX_DRIVE" + str3;
vodInfo.sourceName = str3;
vodInfo.pic = "https://avatars.githubusercontent.com/u/97389433?s=120&v=4";
vodInfo.seriesMap = new LinkedHashMap<>();
vodInfo.playFlag = vodInfo.sourceKey;
vodInfo.id = str2;
vodInfo.playNote = vodInfo.name;
vodInfo.driveUrl = driveActivity.OooOOOo.OooO00o.getConfig().get("url").getAsString();
ArrayList arrayList4 = new ArrayList();
VodInfo.VodSeries vodSeries2 = new VodInfo.VodSeries();
vodSeries2.name = vodInfo.name;
vodSeries2.url = str2;
arrayList4.add(vodSeries2);
vodInfo.seriesMap.put(vodInfo.sourceKey, arrayList4);
OooO00o.OooO0o0(vodInfo.sourceKey, vodInfo);
}
driveActivity.OooOo00.postDelayed(new jb(driveActivity, 9), 300L);
}
@Override
public final int OooO0O0() {
return R$layout.activity_drive;
}
public final void OooOO0O() {
this.OooO.setText("存储空间");
this.OooOOo0 = i.OooOoO("storage_drive_sort", 0);
this.OooOOO0.setVisibility(8);
if (this.OooOOOO == null) {
this.OooOOOO = new ArrayList();
for (StorageDrive storageDrive : o0o0000.OooO0O0().getStorageDriveDao().getAll()) {
DriveFolderFile driveFolderFile = new DriveFolderFile(storageDrive);
if (this.OooOOoo) {
driveFolderFile.isDelMode = true;
}
this.OooOOOO.add(driveFolderFile);
}
}
this.OooOOO.OooOOO(this.OooOOOO);
OooOOO(this.OooOOOO);
this.OooOO0O.setVisibility(0);
this.OooOO0o.setVisibility(0);
OooO0oo();
}
public final void OooOO0o() {
this.OooOOOo.OooO0OO = this.OooOOo0;
this.OooOOO0.setVisibility(0);
OooO0oO();
String OooO00o = this.OooOOOo.OooO00o(new og(this));
this.OooO.setText("");
TextView textView = this.OooO;
textView.setText(this.OooOOOo.OooO00o.name + OooO00o);
}
public final void OooOOO(List list) {
for (int i = 0; i < list.size(); i++) {
if (((DriveFolderFile) list.get(i)).isSelected) {
this.OooOo00.postDelayed(new vg(this, i, 0), 50L);
return;
}
}
this.OooOO0.setSelection(0);
}
public final void OooOOO0() {
this.OooOOOo.OooO0O0.setChildren(null);
OooOo oooOo = this.OooOOOo;
DriveFolderFile driveFolderFile = oooOo.OooO0O0.parentFolder;
oooOo.OooO0O0 = driveFolderFile;
if (driveFolderFile == null) {
this.OooOOOo = null;
OooOO0O();
return;
}
OooOO0o();
}
public final void OooOOOO() {
boolean z = !this.OooOOoo;
this.OooOOoo = z;
if (z) {
this.OooOO0o.setColorFilter(ContextCompat.getColor(this.OooO0o0, R$color.color_1890FF));
} else {
this.OooOO0o.setColorFilter(ContextCompat.getColor(this.OooO0o0, R$color.color_FFFFFF));
}
boolean z2 = this.OooOOoo;
int i = 0;
while (true) {
oO0O00oO oo0o00oo = this.OooOOO;
if (i < oo0o00oo.getItemCount()) {
((DriveFolderFile) oo0o00oo.getItem(i)).isDelMode = z2;
i++;
} else {
oo0o00oo.notifyDataSetChanged();
return;
}
}
}
@Override
public final void init() {
ck.OooO0O0().OooO(this);
Executors.newFixedThreadPool(5);
this.OooO = (TextView) findViewById(R$id.textView);
this.OooOO0O = (ImageButton) findViewById(R$id.btnAddServer);
this.OooOO0 = (TvRecyclerView) findViewById(R$id.mGridView);
this.OooOO0o = (ImageButton) findViewById(R$id.btnRemoveServer);
this.OooOOO0 = (ImageButton) findViewById(R$id.btnSort);
getLayoutInflater().inflate(R$layout.item_search_lite, (ViewGroup) null).findViewById(R$id.tvName).setVisibility(8);
this.OooOO0o.setColorFilter(ContextCompat.getColor(this.OooO0o0, R$color.color_FFFFFF));
this.OooOO0o.setOnClickListener(new pg(this, 0));
findViewById(R$id.btnHome).setOnClickListener(new pg(this, 1));
ImageView imageView = (ImageView) findViewById(R$id.icon_lock);
if (this.OooOOo) {
imageView.setImageResource(R$drawable.icon_unlock);
} else {
imageView.setImageResource(R$drawable.icon_lock);
}
findViewById(R$id.icon_lock).setOnClickListener(new ng(imageView, 0, this));
this.OooOOO0.setOnClickListener(new pg(this, 2));
this.OooOO0O.setOnClickListener(new sg(this));
this.OooOO0.setLayoutManager(new V7LinearLayoutManager(this.OooO0o0, 1));
this.OooOO0.OooO(AutoSizeUtils.mm2px(this.OooO0o0, 10.0f), 0);
TvRecyclerView tvRecyclerView = this.OooOO0;
oO0O00oO oo0o00oo = this.OooOOO;
tvRecyclerView.setAdapter(oo0o00oo);
TvRecyclerView tvRecyclerView2 = this.OooOO0;
if (oo0o00oo.OooOOO == null) {
oo0o00oo.OooOOO = tvRecyclerView2;
tvRecyclerView2.setAdapter(oo0o00oo);
this.OooOO0.setOnItemListener(new og(this));
OooO0o0(findViewById(R$id.mGridView));
OooOO0O();
return;
}
throw new RuntimeException("Don't bind twice");
}
@Override
public final void onBackPressed() {
if (this.OooOOOo != null) {
uf0.OooO00o.OooO00o("drive");
OooO0oo();
OooOOO0();
} else if (!this.OooOOoo) {
super.onBackPressed();
} else {
OooOOOO();
}
}
@Override
public final void onDestroy() {
super.onDestroy();
ck.OooO0O0().OooOO0O(this);
}
@ty0(threadMode = ThreadMode.MAIN)
public void refresh(xm0 xm0Var) {
if (xm0Var.type == 16) {
this.OooOOOO = null;
OooOO0O();
}
}
}