Swiggy v4.51.1版本的 MD5 值为:5af7ec91512a0a8c1510e3f8bac20b8b
以下内容为反编译后的 b.java 源代码,内容仅作参考
package in.swiggy.kmm.asseturlbuilder.assettransformers;
import com.xiaomi.mipush.sdk.Constants;
import in.swiggy.kmm.asseturlbuilder.ConnectionQuality;
import in.swiggy.kmm.asseturlbuilder.ImageFormat;
import in.swiggy.kmm.asseturlbuilder.c;
import java.util.ArrayList;
import java.util.List;
import kotlin.NoWhenBranchMatchedException;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.o;
import kotlin.text.StringsKt__StringsKt;
import kotlin.text.q;
public final class b extends in.swiggy.kmm.asseturlbuilder.assettransformers.a {
public static final a f = new a(null);
public static final class a {
public a(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private a() {
}
}
public class C0966b {
public static final int[] a;
public static final int[] b;
static {
int[] iArr = new int[ImageFormat.values().length];
try {
iArr[ImageFormat.Avif.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[ImageFormat.WebP.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
a = iArr;
int[] iArr2 = new int[ConnectionQuality.values().length];
try {
iArr2[ConnectionQuality.POOR.ordinal()] = 1;
} catch (NoSuchFieldError unused3) {
}
try {
iArr2[ConnectionQuality.MODERATE.ordinal()] = 2;
} catch (NoSuchFieldError unused4) {
}
try {
iArr2[ConnectionQuality.UNKNOWN.ordinal()] = 3;
} catch (NoSuchFieldError unused5) {
}
try {
iArr2[ConnectionQuality.EXCELLENT.ordinal()] = 4;
} catch (NoSuchFieldError unused6) {
}
b = iArr2;
}
}
public b(String baseUrl, List<String> imagePathParams, List<String> videoPathParams, List<String> lottiePathParams, boolean z) {
super(baseUrl, imagePathParams, videoPathParams, lottiePathParams, z);
o.k(baseUrl, "baseUrl");
o.k(imagePathParams, "imagePathParams");
o.k(videoPathParams, "videoPathParams");
o.k(lottiePathParams, "lottiePathParams");
}
private final String h(String str) {
boolean U;
String J;
U = StringsKt__StringsKt.U(str, "https://de-docs.s3.amazonaws.com/de-images", false, 2, null);
if (U) {
StringBuilder sb = new StringBuilder();
sb.append("de-images");
J = q.J(str, "https://de-docs.s3.amazonaws.com/de-images", "", false, 4, null);
sb.append(J);
return sb.toString();
}
return str;
}
private final int i(int i, ConnectionQuality connectionQuality) {
float f2;
float f3;
int i2 = C0966b.b[connectionQuality.ordinal()];
if (i2 != 1) {
if (i2 == 2 || i2 == 3) {
f2 = i;
f3 = 1.33f;
} else {
return i;
}
} else {
f2 = i;
f3 = 1.66f;
}
return (int) (f2 / f3);
}
private final String j(ImageFormat imageFormat) {
int i = C0966b.a[imageFormat.ordinal()];
if (i != 1) {
if (i != 2) {
return "f_auto";
}
return "f_webp";
}
return "f_avif";
}
private final String k(in.swiggy.kmm.asseturlbuilder.b bVar, boolean z) {
c e = bVar.e();
if (e instanceof c.a) {
if (!z) {
return "q_auto";
}
} else if (e instanceof c.b) {
if (!z) {
int i = C0966b.b[((c.b) bVar.e()).a().ordinal()];
if (i != 1) {
if (i != 2 && i != 3) {
if (i == 4) {
return "q_auto";
}
throw new NoWhenBranchMatchedException();
}
} else {
return "q_auto:low";
}
}
} else {
throw new NoWhenBranchMatchedException();
}
return "q_auto:eco";
}
private final String l(in.swiggy.kmm.asseturlbuilder.b bVar, boolean z, boolean z2) {
c.b bVar2;
ConnectionQuality connectionQuality;
String t0;
ArrayList arrayList = new ArrayList();
if (bVar.i()) {
arrayList.add("c_fit");
} else {
arrayList.add("c_fill");
}
if (bVar.k()) {
arrayList.add("fl_lossy");
}
if (bVar.a() != null) {
arrayList.add(bVar.a());
}
arrayList.add(j(bVar.c()));
if (z2) {
arrayList.add("c_crop");
arrayList.add("g_face");
arrayList.add("c_thumb");
}
arrayList.add(k(bVar, z));
c e = bVar.e();
if (e instanceof c.b) {
bVar2 = (c.b) e;
} else {
bVar2 = null;
}
if (bVar2 == null || (connectionQuality = bVar2.a()) == null) {
connectionQuality = ConnectionQuality.EXCELLENT;
}
if (bVar.b() > 0) {
arrayList.add("h_" + i(bVar.b(), connectionQuality));
}
if (bVar.f() > 0) {
arrayList.add("w_" + i(bVar.f(), connectionQuality));
}
if (bVar.h()) {
arrayList.add("r_max");
}
if (bVar.j()) {
arrayList.add("e_grayscale");
}
t0 = CollectionsKt___CollectionsKt.t0(arrayList, Constants.ACCEPT_TIME_SEPARATOR_SP, null, null, 0, null, null, 62, null);
return t0;
}
static String m(b bVar, in.swiggy.kmm.asseturlbuilder.b bVar2, boolean z, boolean z2, int i, Object obj) {
if ((i & 4) != 0) {
z2 = false;
}
return bVar.l(bVar2, z, z2);
}
@Override
public List<String> c(in.swiggy.kmm.asseturlbuilder.b imageConfig, boolean z) {
o.k(imageConfig, "imageConfig");
ArrayList arrayList = new ArrayList();
arrayList.add(l(imageConfig, z, true));
arrayList.add(h(imageConfig.d()));
if (imageConfig.g()) {
arrayList.add("cache");
}
return arrayList;
}
@Override
public List<String> e(in.swiggy.kmm.asseturlbuilder.b imageConfig, boolean z) {
o.k(imageConfig, "imageConfig");
ArrayList arrayList = new ArrayList();
arrayList.add(m(this, imageConfig, z, false, 4, null));
arrayList.add(imageConfig.d());
if (imageConfig.g()) {
arrayList.add("cache");
}
return arrayList;
}
@Override
public List<String> g(String lottieId) {
List<String> e;
o.k(lottieId, "lottieId");
e = kotlin.collections.q.e(lottieId);
return e;
}
}