Swiggy v4.51.1版本的 MD5 值为:5af7ec91512a0a8c1510e3f8bac20b8b

以下内容为反编译后的 a.java 源代码,内容仅作参考


package in.swiggy.android.commonsFeature.utils;

import android.content.SharedPreferences;
import in.swiggy.android.commons.extension.KotlinExtensionsKt;
import in.swiggy.android.commons.utils.contextservice.h;
import in.swiggy.android.commonsui.ui.g;
import in.swiggy.android.mvvm.services.s;
import kotlin.jvm.internal.o;
import kotlin.text.q;
public final class a {
    private final SharedPreferences a;
    private final h b;
    private final s c;
    private String d;
    private String e;
    private String f;
    private String g;

    public a(SharedPreferences sharedPreferences, h contextService, s resourcesService) {
        o.k(sharedPreferences, "sharedPreferences");
        o.k(contextService, "contextService");
        o.k(resourcesService, "resourcesService");
        this.a = sharedPreferences;
        this.b = contextService;
        this.c = resourcesService;
        this.d = "https://de-docs.s3.amazonaws.com/photographs/";
        this.e = "https://de-docs.s3.amazonaws.com/de-images/";
        this.f = "delivery_media/";
        this.g = "de-images/";
        String string = sharedPreferences.getString("de_image_prefix", "https://de-docs.s3.amazonaws.com/photographs/");
        this.d = string == null ? "" : string;
        String string2 = sharedPreferences.getString("de_image_prefix_v2", "https://de-docs.s3.amazonaws.com/de-images/");
        this.e = string2 == null ? "" : string2;
        String string3 = sharedPreferences.getString("de_cloudinary_folder", "delivery_media/");
        this.f = string3 == null ? "" : string3;
        String string4 = sharedPreferences.getString("de_cloudinary_folder_v2", "de-images/");
        this.g = string4 != null ? string4 : "";
    }

    private final String a(String str) {
        boolean P;
        boolean P2;
        P = q.P(str, this.d, false, 2, null);
        if (!P) {
            P2 = q.P(str, this.e, false, 2, null);
            if (P2) {
                return this.g;
            }
            return "";
        }
        return this.f;
    }

    public static String c(a aVar, String str, int i, int i2, int i3, Object obj) {
        if ((i3 & 2) != 0) {
            i = g.dimen_46dp;
        }
        if ((i3 & 4) != 0) {
            i2 = g.dimen_46dp;
        }
        return aVar.b(str, i, i2);
    }

    private final String d(String str) {
        boolean P;
        boolean P2;
        String J;
        String J2;
        P = q.P(str, this.d, false, 2, null);
        if (P) {
            J2 = q.J(str, this.d, "", false, 4, null);
            return J2;
        }
        P2 = q.P(str, this.e, false, 2, null);
        if (P2) {
            J = q.J(str, this.e, "", false, 4, null);
            return J;
        }
        return "";
    }

    public final String b(String imageUrl, int i, int i2) {
        boolean P;
        boolean P2;
        o.k(imageUrl, "imageUrl");
        P = q.P(imageUrl, this.d, false, 2, null);
        if (!P) {
            P2 = q.P(imageUrl, this.e, false, 2, null);
            if (!P2) {
                return imageUrl;
            }
        }
        String d = d(imageUrl);
        String str = a(imageUrl) + d;
        String string = this.a.getString("android_de_image_face_crop", "true");
        if (string == null) {
            string = "";
        }
        if (KotlinExtensionsKt.r(string, false, 1, null)) {
            h hVar = this.b;
            s sVar = this.c;
            int i3 = g.dimen_46dp;
            return hVar.z(sVar.m(i3), this.c.m(i3), str);
        }
        h hVar2 = this.b;
        s sVar2 = this.c;
        int i4 = g.dimen_46dp;
        return hVar2.A(sVar2.m(i4), this.c.m(i4), str);
    }
}