CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 d.java 源代码,内容仅作参考
package d.c.a.a.a;
import com.google.android.exoplayer2.metadata.icy.IcyHeaders;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import com.liulishuo.filedownloader.model.FileDownloadModel;
import d.c.a.b.r;
import d.c.a.j.x;
import i.c.a.c.k;
import i.c.a.c.l;
import i.c.a.c.m;
import i.d.a.g;
import i.d.a.l.p.i;
import java.io.File;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import kotlin.Metadata;
import kotlin.Pair;
import n.i.b.h;
import org.godfootsteps.arch.api.AppClient;
import org.godfootsteps.arch.api.model.BookCaseBook;
import org.godfootsteps.arch.api.model.BookCaseModel;
import org.godfootsteps.arch.api.model.BookDetailModel;
import org.godfootsteps.arch.api.model.BookUpdateItem;
import org.godfootsteps.arch.api.model.DetailUpdateItem;
import org.json.JSONObject;
import r.c0;
import r.g0;
import r.w;
@Metadata(d1 = {"\u00004\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\b\u001a \u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u0007H\u0002\u001a\u0018\u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\rH\u0002\u001a\u0010\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\n\u001a\u00020\u000fH\u0002\u001a\u0010\u0010\u0010\u001a\u00020\u000f2\b\u0010\u0011\u001a\u0004\u0018\u00010\u000f\u001a\u001c\u0010\u0012\u001a\u00020\u0005*\u00020\u00052\u0006\u0010\u0013\u001a\u00020\u000f2\u0006\u0010\u0014\u001a\u00020\u000fH\u0002\u001a\f\u0010\u0015\u001a\u00020\u000f*\u00020\u0005H\u0002\u001a\f\u0010\u0016\u001a\u00020\u000f*\u00020\u0005H\u0002¨\u0006\u0017"}, d2 = {"dealResponse", "", "originalResponse", "Lokhttp3/Response;", "request", "Lokhttp3/Request;", "cache", "Lorg/godfootsteps/arch/api/util/Cache;", "dealUpdate", "", "url", "Lokhttp3/HttpUrl;", "response", "Lorg/json/JSONObject;", "getCacheKey", "", "getHomeModeCacheKey", "mode", "appendParameter", "param", AppMeasurementSdk.ConditionalUserProperty.VALUE, "cacheName", "endpoint", "arch_release"}, k = 2, mv = {1, 5, 1}, xi = 48)
public final class d {
public static final c0 a(c0 c0Var, String str, String str2) {
c0.a aVar = new c0.a(c0Var);
w.a k2 = c0Var.a.k();
k2.a(str, str2);
aVar.g(k2.b());
c0 a = aVar.a();
h.d(a, "newBuilder().url(url().n…, value).build()).build()");
return a;
}
public static final boolean b(g0 g0Var, c0 c0Var, d.c.a.a.b.b bVar) {
String str;
boolean z;
JSONObject optJSONObject;
List<DetailUpdateItem> update;
List<BookUpdateItem> update2;
String str2;
Iterator it;
String str3;
BookCaseModel bookCaseModel;
File[] listFiles;
List<BookCaseBook> list;
Iterator it2;
Iterator it3;
List<BookCaseBook> list2;
if (g0Var.f16523k == 200) {
String x0 = n.m.t.a.p.m.e1.a.x0(g0Var);
JSONObject jSONObject = new JSONObject(x0);
w wVar = c0Var.a;
h.d(wVar, "request.url()");
JSONObject optJSONObject2 = jSONObject.optJSONObject("result");
String optString = optJSONObject2 == null ? null : optJSONObject2.optString("update");
if (optString == null || optString.length() == 0) {
str = x0;
} else {
if (!h.a(optString, "null")) {
String str4 = wVar.f16859i;
h.d(str4, "url.toString()");
h.e(str4, "<this>");
if (n.o.a.c(str4, "v3/getBookList", false, 2)) {
b bVar2 = b.a;
String optString2 = jSONObject.optString("result");
h.d(optString2, "response.optString(\"result\")");
h.e(optString2, "result");
BookCaseModel bookCaseModel2 = (BookCaseModel) m.a(optString2, BookCaseModel.class);
b.c = bookCaseModel2;
if (bookCaseModel2 != null && (update2 = bookCaseModel2.getUpdate()) != null) {
Iterator it4 = update2.iterator();
while (it4.hasNext()) {
BookUpdateItem bookUpdateItem = (BookUpdateItem) it4.next();
String type = bookUpdateItem.getType();
switch (type.hashCode()) {
case 48:
str2 = x0;
it = it4;
if (type.equals("0")) {
b bVar3 = b.a;
String id = bookUpdateItem.getId();
if (id == null) {
break;
} else {
l.f(n.m.t.a.p.m.e1.a.T(id));
BookCaseModel bookCaseModel3 = b.c;
if (bookCaseModel3 == null) {
break;
} else {
String a = x.a.a(n.m.t.a.p.m.e1.a.U(new Pair(bookCaseModel3.getCssPath(), id)), false);
if (!n.o.a.o(a)) {
k.d(n.m.t.a.p.m.e1.a.T(id), a);
break;
} else {
break;
}
}
}
} else {
break;
}
case 49:
it = it4;
if (type.equals(IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE)) {
b bVar4 = b.a;
String id2 = bookUpdateItem.getId();
if (id2 != null) {
r rVar = (r) i.d.a.c.f(i.c.a.c.w.c());
Objects.requireNonNull(AppClient.a);
BookCaseModel bookCaseModel4 = b.c;
String j2 = h.j("https://appservercn.kingdomsalvation.org", bookCaseModel4 == null ? null : bookCaseModel4.getCoverPath());
BookCaseModel bookCaseModel5 = b.c;
String str5 = "";
if (bookCaseModel5 != null && (list2 = bookCaseModel5.getList()) != null) {
Iterator<BookCaseBook> it5 = list2.iterator();
while (it5.hasNext()) {
BookCaseBook next = it5.next();
Iterator<BookCaseBook> it6 = it5;
if (h.a(next.getId(), id2)) {
str3 = h.j(j2, next.getCover());
g a0 = rVar.v(str3).Y(i.a).a0();
i.d.a.p.e eVar = new i.d.a.p.e(Integer.MIN_VALUE, Integer.MIN_VALUE);
a0.K(eVar, eVar, a0, i.d.a.r.d.b);
File file = (File) eVar.get();
b bVar5 = b.a;
bookCaseModel = b.c;
if (bookCaseModel != null && (list = bookCaseModel.getList()) != null) {
it2 = list.iterator();
while (true) {
if (!it2.hasNext()) {
BookCaseBook bookCaseBook = (BookCaseBook) it2.next();
it3 = it2;
if (h.a(bookCaseBook.getId(), id2)) {
str5 = bookCaseBook.getCover();
} else {
it2 = it3;
}
}
}
}
l.m(file, n.m.t.a.p.m.e1.a.Q(new Pair(id2, str5)));
listFiles = n.m.t.a.p.m.e1.a.q(id2).listFiles();
if (listFiles != null) {
int length = listFiles.length;
int i2 = 0;
while (i2 < length) {
File file2 = listFiles[i2];
File[] fileArr = listFiles;
String name = file2.getName();
int i3 = length;
h.d(name, "it.name");
String str6 = x0;
if (n.o.a.c(name, ".png", false, 2) && !h.a(file2.getName(), str5)) {
file2.delete();
}
i2++;
listFiles = fileArr;
length = i3;
x0 = str6;
}
}
} else {
it5 = it6;
}
}
}
str3 = "";
g a02 = rVar.v(str3).Y(i.a).a0();
i.d.a.p.e eVar2 = new i.d.a.p.e(Integer.MIN_VALUE, Integer.MIN_VALUE);
a02.K(eVar2, eVar2, a02, i.d.a.r.d.b);
File file3 = (File) eVar2.get();
b bVar52 = b.a;
bookCaseModel = b.c;
if (bookCaseModel != null) {
it2 = list.iterator();
while (true) {
if (!it2.hasNext()) {
}
it2 = it3;
}
}
l.m(file3, n.m.t.a.p.m.e1.a.Q(new Pair(id2, str5)));
listFiles = n.m.t.a.p.m.e1.a.q(id2).listFiles();
if (listFiles != null) {
}
}
}
str2 = x0;
break;
case 50:
it = it4;
if (type.equals("2") && n.m.t.a.p.m.e1.a.k1(bookUpdateItem.getId())) {
i.c.a.c.x xVar = b.b;
Set<String> h2 = xVar.h("booksNeedUpdate");
h.d(h2, "spUtil.getStringSet(BOOK_NEED_UPDATE_KEY)");
xVar.a.edit().putStringSet("booksNeedUpdate", n.f.g.O(h2, bookUpdateItem.getId())).apply();
}
str2 = x0;
break;
case 51:
it = it4;
type.equals("3");
str2 = x0;
break;
case 52:
if (type.equals("4")) {
l.f(n.m.t.a.p.m.e1.a.q(bookUpdateItem.getId()));
l.f(n.m.t.a.p.m.e1.a.t(bookUpdateItem.getId()));
new d.c.a.a.b.b(bookUpdateItem.getId()).a();
i.c.a.c.x xVar2 = b.b;
Set<String> h3 = xVar2.h("booksNeedUpdate");
it = it4;
if (h3.contains(bookUpdateItem.getId())) {
h3.remove(bookUpdateItem.getId());
xVar2.a.edit().putStringSet("booksNeedUpdate", h3).apply();
}
i.c.a.c.x.d("BookUpdatePopupTime").l(bookUpdateItem.getId());
d.c.i.c cVar = (d.c.i.c) k.a.a.a.a.b(d.c.i.c.class);
if (cVar != null) {
cVar.c(bookUpdateItem.getId(), null);
}
str2 = x0;
break;
}
default:
str2 = x0;
it = it4;
break;
}
it4 = it;
x0 = str2;
}
}
} else {
str = x0;
String str7 = wVar.f16859i;
h.d(str7, "url.toString()");
h.e(str7, "<this>");
if (n.o.a.c(str7, "getBookDetail", false, 2)) {
b bVar6 = b.a;
String q2 = wVar.q("bookId");
h.c(q2);
h.d(q2, "url.queryParameter(\"bookId\")!!");
String optString3 = jSONObject.optString("result");
h.d(optString3, "response.optString(\"result\")");
h.e(q2, "bookId");
h.e(optString3, "result");
BookDetailModel bookDetailModel = (BookDetailModel) m.a(optString3, BookDetailModel.class);
b.f6010d = bookDetailModel;
if (bookDetailModel != null && (update = bookDetailModel.getUpdate()) != null) {
for (DetailUpdateItem detailUpdateItem : update) {
File t2 = n.m.t.a.p.m.e1.a.t(q2);
BookDetailModel bookDetailModel2 = b.f6010d;
h.c(bookDetailModel2);
Pair pair = new Pair(bookDetailModel2.getDesc().getUrl(), detailUpdateItem.getPieceId());
File R1 = n.m.t.a.p.m.e1.a.R1(new Pair(q2, detailUpdateItem.getPieceId()));
String type2 = detailUpdateItem.getType();
switch (type2.hashCode()) {
case 49:
if (type2.equals(IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE)) {
l.f(R1);
if (t2.exists()) {
String a2 = x.a.a(n.m.t.a.p.m.e1.a.S1(pair), false);
if (!n.o.a.o(a2)) {
k.d(R1, a2);
}
}
d.c.i.c cVar2 = (d.c.i.c) k.a.a.a.a.b(d.c.i.c.class);
if (cVar2 == null) {
break;
} else {
cVar2.h(q2, detailUpdateItem.getPieceId());
break;
}
} else {
break;
}
case 50:
if (type2.equals("2") && t2.exists()) {
String a3 = x.a.a(n.m.t.a.p.m.e1.a.S1(pair), false);
if (!n.o.a.o(a3)) {
k.d(R1, a3);
break;
} else {
break;
}
}
break;
case 51:
if (type2.equals("3")) {
l.f(R1);
d.c.i.c cVar3 = (d.c.i.c) k.a.a.a.a.b(d.c.i.c.class);
if (cVar3 == null) {
break;
} else {
cVar3.c(q2, detailUpdateItem.getPieceId());
break;
}
} else {
break;
}
}
}
}
}
optJSONObject = jSONObject.optJSONObject("result");
if (optJSONObject != null) {
optJSONObject.remove("update");
}
}
}
str = x0;
optJSONObject = jSONObject.optJSONObject("result");
if (optJSONObject != null) {
}
}
if (jSONObject.has(FileDownloadModel.STATUS) && jSONObject.has("result")) {
String optString4 = jSONObject.optString("result");
if (jSONObject.optInt(FileDownloadModel.STATUS) == 1) {
h.d(optString4, "result");
if (!n.o.a.o(optString4)) {
}
}
z = false;
}
if (z) {
String c = c0Var.c.c("Cache-Control");
if (c != null && n.o.a.c(c, "read-only", false, 2)) {
l.o(bVar.c, bVar.b());
} else {
bVar.f(str);
}
return true;
}
l.o(bVar.c, bVar.b());
}
return false;
}
public static final String c(c0 c0Var) {
String str = c0Var.a.f16859i;
h.d(str, "url().toString()");
return (String) n.o.a.z(n.o.a.w(str, AppClient.a.a(), "", false, 4), new char[]{'?'}, false, 0, 6).get(0);
}
public static final String d(String str) {
if (str != null) {
switch (str.hashCode()) {
case -1240117076:
if (str.equals("gospel")) {
return "getNewGospelHomeV2";
}
break;
case -1102508601:
if (str.equals("listen")) {
return "getListenHomeV2";
}
break;
case 3377875:
if (str.equals("news")) {
return "getHomeNewsV2";
}
break;
case 3536371:
if (str.equals("soul")) {
return "getSoulHomeV2";
}
break;
case 485665033:
if (str.equals("simplify")) {
return "getSimplifyHomeV2";
}
break;
case 1355322681:
if (str.equals("witness")) {
return "getHomeWitnessV2";
}
break;
}
}
return "";
}
}