Swiggy v4.51.1版本的 MD5 值为:5af7ec91512a0a8c1510e3f8bac20b8b
以下内容为反编译后的 r.java 源代码,内容仅作参考
package in.swiggy.android.commonsui.utils;
import android.content.Context;
import android.graphics.drawable.Drawable;
import java.util.List;
import java.util.Random;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.text.StringsKt__StringsKt;
public final class r {
public static final r a = new r();
private r() {
}
public final String a(String url) {
boolean U;
String J;
List K0;
Object j0;
kotlin.jvm.internal.o.k(url, "url");
try {
U = StringsKt__StringsKt.U(url, "https://res.cloudinary.com/swiggy/image/upload/", false, 2, null);
if (U) {
J = kotlin.text.q.J(url, "https://res.cloudinary.com/swiggy/image/upload/", "", false, 4, null);
K0 = StringsKt__StringsKt.K0(J, new String[]{"."}, false, 0, 6, null);
j0 = CollectionsKt___CollectionsKt.j0(K0);
return (String) j0;
}
} catch (Exception unused) {
}
return url;
}
public final int b(int i) {
int i2 = i % 4;
if (i2 != 0) {
if (i2 != 1) {
if (i2 != 2) {
if (i2 != 3) {
return in.swiggy.android.commonsui.ui.h.brown_placeholder;
}
return in.swiggy.android.commonsui.ui.h.brown_placeholder;
}
return in.swiggy.android.commonsui.ui.h.blue_placeholder;
}
return in.swiggy.android.commonsui.ui.h.green_placeholder;
}
return in.swiggy.android.commonsui.ui.h.red_placeholder;
}
public final int c() {
int b;
synchronized ("PlaceHolderUtils") {
b = a.b(new Random().nextInt(4) + 1);
}
return b;
}
public final Drawable d(Context context) {
kotlin.jvm.internal.o.k(context, "context");
return androidx.core.content.a.getDrawable(context, c());
}
}