Shinigami ID v1.1.3版本的 MD5 值为:c381e85feac697f048c400ae89b7b92d
以下内容为反编译后的 a.java 源代码,内容仅作参考
package f9;
import aa.p;
import android.app.Dialog;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.lifecycle.e0;
import androidx.lifecycle.r;
import com.google.android.material.card.MaterialCardView;
import com.google.android.material.progressindicator.CircularProgressIndicator;
import com.shinigami.id.R;
import com.shinigami.id.api.FavoriteEndpoint;
import com.shinigami.id.base.BaseApplication;
import com.shinigami.id.dto.FavoriteChapterDto;
import com.shinigami.id.model.ChapterModel;
import com.shinigami.id.model.ComicDetailModel;
import com.shinigami.id.model.ComicModel;
import com.shinigami.id.model.FavoriteChapterModel;
import com.shinigami.id.model.UserModel;
import com.shinigami.id.ui.chapter.ChapterDetailActivity;
import java.util.List;
import java.util.concurrent.Executors;
import k.b;
public class a extends com.google.android.material.bottomsheet.b {
public TextView A0;
public TextView B0;
public MaterialCardView C0;
public MaterialCardView D0;
public MaterialCardView E0;
public MaterialCardView F0;
public MaterialCardView G0;
public MaterialCardView H0;
public ImageView I0;
public CircularProgressIndicator J0;
public int K0;
public int L0;
public boolean M0;
public UserModel N0;
public ChapterModel O0;
public List<FavoriteChapterModel> P0;
public FavoriteEndpoint Q0;
public ComicModel R0;
public h S0;
public BaseApplication f5812y0;
public x8.b f5813z0;
public class C0086a implements r<ComicDetailModel> {
public C0086a() {
}
@Override
public final void a(ComicDetailModel comicDetailModel) {
ComicDetailModel comicDetailModel2 = comicDetailModel;
if (comicDetailModel2 == null) {
return;
}
a.this.L0 = comicDetailModel2.getChapterList().size();
a.this.O0 = comicDetailModel2.getChapterList().get(a.this.K0);
a aVar = a.this;
aVar.B0.setText(aVar.O0.getTitle());
}
}
public class b implements View.OnClickListener {
public b() {
}
@Override
public final void onClick(View view) {
new i9.a(true).m0(a.this.r(), "inner_bs_chapter_dlg");
}
}
public class c implements View.OnClickListener {
public c() {
}
@Override
public final void onClick(View view) {
a aVar = a.this;
int i10 = aVar.K0;
if (i10 == 0 || i10 == -1) {
return;
}
UserModel userModel = aVar.N0;
if (userModel == null || !userModel.isPremium()) {
a.n0(a.this, r3.K0 - 1);
} else {
Intent intent = new Intent(a.this.Z(), (Class<?>) ChapterDetailActivity.class);
intent.putExtra("chapterPosition", a.this.K0 - 1);
a.this.h0(intent);
a.this.Z().finish();
}
}
}
public class d implements View.OnClickListener {
public d() {
}
@Override
public final void onClick(View view) {
a aVar = a.this;
int i10 = aVar.K0;
if (i10 + 1 >= aVar.L0 || i10 == -1) {
return;
}
UserModel userModel = aVar.N0;
if (userModel == null || !userModel.isPremium()) {
a aVar2 = a.this;
a.n0(aVar2, aVar2.K0 + 1);
} else {
Intent intent = new Intent(a.this.Z(), (Class<?>) ChapterDetailActivity.class);
intent.putExtra("chapterPosition", a.this.K0 + 1);
a.this.h0(intent);
a.this.Z().finish();
}
}
}
public class e implements View.OnClickListener {
public class RunnableC0087a implements Runnable {
public final String f5819o;
public RunnableC0087a(String str) {
this.f5819o = str;
}
@Override
public final void run() {
Integer valueOf = Integer.valueOf(a.this.Z().getColor(R.color.second2) | (-16777216));
b.a aVar = new b.a();
aVar.c();
aVar.d();
aVar.b();
if (aVar.c == null) {
aVar.c = new SparseArray<>();
}
SparseArray<Bundle> sparseArray = aVar.c;
Bundle bundle = new Bundle();
if (valueOf != null) {
bundle.putInt("android.support.customtabs.extra.TOOLBAR_COLOR", valueOf.intValue());
}
sparseArray.put(2, bundle);
aVar.a().a(a.this.Z(), Uri.parse(this.f5819o));
}
}
public e() {
}
@Override
public final void onClick(View view) {
ChapterModel chapterModel = a.this.O0;
if (chapterModel == null) {
return;
}
String url = chapterModel.getUrl();
String replace = url.substring(url.lastIndexOf("/chapter-") + 9).replace("/", "");
Log.d("SettingBsDialog", "onClick: chapt get: " + replace);
String str = "https://komentar.shinigamiscans.com/?id=" + url.substring(url.indexOf("series/") + 7, url.lastIndexOf("/chapter")).replace("/", "") + "&chapter=" + replace;
Log.d("SettingBsDialog", "onClick: url chap: " + str);
Executors.newSingleThreadExecutor().execute(new RunnableC0087a(str));
Dialog dialog = a.this.f1347t0;
if (dialog != null) {
dialog.dismiss();
}
}
}
public class f implements View.OnClickListener {
public class C0088a implements z8.g {
public C0088a() {
}
@Override
public final void a() {
a aVar = a.this;
int i10 = 0;
aVar.M0 = false;
aVar.I0.setImageDrawable(s3.a.m(aVar.Z(), R.drawable.ic_heart_out));
while (true) {
if (i10 >= a.this.P0.size()) {
break;
}
if (a.this.P0.get(i10).getUrl().equalsIgnoreCase(a.this.R0.getUrl())) {
a.this.P0.remove(i10);
break;
}
i10++;
}
a aVar2 = a.this;
aVar2.f5813z0.f14014k.k(aVar2.P0);
}
}
public class b implements z8.g {
public b() {
}
@Override
public final void a() {
a aVar = a.this;
aVar.M0 = true;
aVar.I0.setImageDrawable(s3.a.m(aVar.Z(), R.drawable.ic_heart));
a aVar2 = a.this;
aVar2.P0.add(new FavoriteChapterModel(aVar2.R0.getTitle(), a.this.R0.getUrl(), a.this.R0.getCover(), a.this.R0.getLatestChapter()));
a aVar3 = a.this;
aVar3.f5813z0.f14014k.k(aVar3.P0);
}
}
public f() {
}
@Override
public final void onClick(View view) {
if (a.this.f5813z0.f14014k.d() == null) {
return;
}
a aVar = a.this;
if (aVar.M0) {
C0088a c0088a = new C0088a();
UserModel userModel = aVar.N0;
if (userModel == null) {
return;
}
aVar.Q0.deleteFavorites(userModel.getUid(), aVar.R0.getUrl()).A(new f9.b(aVar, c0088a));
return;
}
b bVar = new b();
UserModel userModel2 = aVar.N0;
if (userModel2 == null) {
return;
}
aVar.Q0.saveFavorites(new FavoriteChapterDto(userModel2.getUid(), new FavoriteChapterModel(aVar.R0.getTitle(), aVar.R0.getUrl(), aVar.R0.getCover(), aVar.R0.getLatestChapter()))).A(new f9.c(aVar, bVar));
}
}
public class g implements View.OnClickListener {
public g() {
}
@Override
public final void onClick(View view) {
a.this.S0.a();
Dialog dialog = a.this.f1347t0;
if (dialog != null) {
dialog.dismiss();
}
}
}
public interface h {
void a();
}
public a() {
this.K0 = -1;
this.L0 = 0;
this.M0 = false;
}
public a(int i10, h hVar) {
this.L0 = 0;
this.M0 = false;
this.K0 = i10;
this.S0 = hVar;
}
public static void n0(a aVar, int i10) {
aVar.f5812y0.f4459s++;
p.B(p.w("showAds: curr ads: "), aVar.f5812y0.f4459s, "SettingBsDialog");
if (aVar.f5812y0.f4459s >= 4) {
Dialog dialog = aVar.f1347t0;
if (dialog != null) {
dialog.dismiss();
}
new l9.b(i10, true).m0(aVar.r(), "ads_settings_dlg");
return;
}
aVar.J0.setVisibility(8);
Intent intent = new Intent(aVar.Z(), (Class<?>) ChapterDetailActivity.class);
intent.putExtra("chapterPosition", i10);
aVar.h0(intent);
aVar.f5812y0.a();
aVar.Z().finish();
Dialog dialog2 = aVar.f1347t0;
if (dialog2 != null) {
dialog2.dismiss();
}
}
@Override
public final View F(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
return layoutInflater.inflate(R.layout.bs_settings, viewGroup, false);
}
@Override
public final void N(Bundle bundle) {
super.N(bundle);
Log.d("SettingBsDialog", "onSaveInstanceState: settings bs save instance");
bundle.putInt("chapterPosition", this.K0);
}
@Override
public final void Q(View view, Bundle bundle) {
if (bundle != null) {
Log.d("SettingBsDialog", "onViewCreated: settings bs instance not null");
this.K0 = bundle.getInt("chapterPosition");
}
this.A0 = (TextView) view.findViewById(R.id.bs_settings_tv_title);
this.B0 = (TextView) view.findViewById(R.id.bs_settings_tv_ch);
this.C0 = (MaterialCardView) view.findViewById(R.id.bs_settings_card_chapter);
this.D0 = (MaterialCardView) view.findViewById(R.id.bs_settings_card_prev);
this.E0 = (MaterialCardView) view.findViewById(R.id.bs_settings_card_next);
this.F0 = (MaterialCardView) view.findViewById(R.id.bs_settings_card_disqus);
this.G0 = (MaterialCardView) view.findViewById(R.id.bs_settings_card_favorite);
this.H0 = (MaterialCardView) view.findViewById(R.id.bs_settings_card_refresh);
this.I0 = (ImageView) view.findViewById(R.id.bs_setting_img_fav);
this.J0 = (CircularProgressIndicator) view.findViewById(R.id.bs_settings_loading);
this.f5812y0 = (BaseApplication) Z().getApplication();
x8.b bVar = (x8.b) new e0(Z(), this.f5812y0.f4456p).a(x8.b.class);
this.f5813z0 = bVar;
ComicModel d10 = bVar.f14009f.d();
this.R0 = d10;
if (d10 == null) {
Dialog dialog = this.f1347t0;
if (dialog != null) {
dialog.dismiss();
return;
}
return;
}
this.A0.setText(d10.getTitle());
this.N0 = this.f5813z0.f14007d.d();
this.Q0 = (FavoriteEndpoint) this.f5812y0.f4457q.b(FavoriteEndpoint.class);
List<FavoriteChapterModel> d11 = this.f5813z0.f14014k.d();
this.P0 = d11;
if (d11 != null) {
for (int i10 = 0; i10 < this.P0.size(); i10++) {
String replace = this.R0.getUrl().replace(".ae", ".id");
String url = this.R0.getUrl();
FavoriteChapterModel favoriteChapterModel = this.P0.get(i10);
if (favoriteChapterModel.getUrl().equalsIgnoreCase(url) || favoriteChapterModel.getUrl().equalsIgnoreCase(replace)) {
this.M0 = true;
this.I0.setImageDrawable(s3.a.m(this.f5812y0, R.drawable.ic_heart));
break;
}
}
}
this.f5813z0.f14010g.e(Z(), new C0086a());
this.C0.setOnClickListener(new b());
this.E0.setOnClickListener(new c());
this.D0.setOnClickListener(new d());
this.F0.setOnClickListener(new e());
this.G0.setOnClickListener(new f());
this.H0.setOnClickListener(new g());
}
}