导航菜单

页面标题

页面副标题

Housing v14.7.8 - GlobalUrlConfig.java 源代码

正在查看: Housing v14.7.8 应用的 GlobalUrlConfig.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.razorpay;

import java.net.URI;
import kotlin.Metadata;
import kotlin.jvm.JvmStatic;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.r;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.json.JSONObject;

@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0010\u0018\u0000 \u00152\u00020\u0001:\u0001\u0015B\u000f\b\u0002\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0006\u0010\u0010\u001a\u00020\u0006J\u0006\u0010\u0011\u001a\u00020\u0006J\u0006\u0010\u0012\u001a\u00020\u0006J\u0006\u0010\u0013\u001a\u00020\u0006J\u0006\u0010\u0014\u001a\u00020\u0006R\u0011\u0010\u0005\u001a\u00020\u0006¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\bR\u0011\u0010\t\u001a\u00020\u0006¢\u0006\b\n\u0000\u001a\u0004\b\n\u0010\bR\u0011\u0010\u000b\u001a\u00020\u0006¢\u0006\b\n\u0000\u001a\u0004\b\f\u0010\bR\u0011\u0010\r\u001a\u00020\u0006¢\u0006\b\n\u0000\u001a\u0004\b\u000e\u0010\bR\u000e\u0010\u000f\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0016"}, d2 = {"Lcom/razorpay/GlobalUrlConfig;", "", "urlConfig", "Lorg/json/JSONObject;", "(Lorg/json/JSONObject;)V", "baseCdn", "", "getBaseCdn", "()Ljava/lang/String;", "baseUrl", "getBaseUrl", "cdnUrl", "getCdnUrl", "staticCdn", "getStaticCdn", "trackUrl", "getButlerUrl", "getCheckoutUrl", "getOtpelfJsUrl", "getOtpelfVersionUrl", "getTrackUrl", "Companion", "core_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class GlobalUrlConfig {

    @NotNull
    public static final Companion INSTANCE = new Companion(null);
    private static GlobalUrlConfig globalUrlConfig;

    @NotNull
    private final String baseCdn;

    @NotNull
    private final String baseUrl;

    @NotNull
    private final String cdnUrl;

    @NotNull
    private final String staticCdn;

    @NotNull
    private final String trackUrl;

    @Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003J\u000f\u0010\u0005\u001a\u00020\u0004H\u0007¢\u0006\u0004\b\u0005\u0010\u0006J\u0019\u0010\n\u001a\u00020\t2\b\u0010\b\u001a\u0004\u0018\u00010\u0007H\u0007¢\u0006\u0004\b\n\u0010\u000bR\u0016\u0010\f\u001a\u00020\u00048\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\b\f\u0010\r¨\u0006\u000e"}, d2 = {"Lcom/razorpay/GlobalUrlConfig$Companion;", "", "<init>", "()V", "Lcom/razorpay/GlobalUrlConfig;", "instance", "()Lcom/razorpay/GlobalUrlConfig;", "Lorg/json/JSONObject;", "urlConfig", "Lzp/j0;", "initiate", "(Lorg/json/JSONObject;)V", "globalUrlConfig", "Lcom/razorpay/GlobalUrlConfig;", "core_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
    public final class Companion {
        private Companion() {
        }

        @JvmStatic
        public final void initiate(@Nullable JSONObject urlConfig) {
            DefaultConstructorMarker defaultConstructorMarker = null;
            GlobalUrlConfig.globalUrlConfig = urlConfig == null ? new GlobalUrlConfig(new JSONObject(), defaultConstructorMarker) : new GlobalUrlConfig(urlConfig, defaultConstructorMarker);
        }

        @JvmStatic
        @NotNull
        public final GlobalUrlConfig instance() {
            DefaultConstructorMarker defaultConstructorMarker = null;
            if (GlobalUrlConfig.globalUrlConfig != null) {
                GlobalUrlConfig globalUrlConfig = GlobalUrlConfig.globalUrlConfig;
                if (globalUrlConfig != null) {
                    return globalUrlConfig;
                }
                r.o("globalUrlConfig");
                throw null;
            }
            GlobalUrlConfig.globalUrlConfig = new GlobalUrlConfig(new JSONObject(), defaultConstructorMarker);
            GlobalUrlConfig globalUrlConfig2 = GlobalUrlConfig.globalUrlConfig;
            if (globalUrlConfig2 != null) {
                return globalUrlConfig2;
            }
            r.o("globalUrlConfig");
            throw null;
        }

        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }
    }

    public GlobalUrlConfig(JSONObject jSONObject, DefaultConstructorMarker defaultConstructorMarker) {
        this(jSONObject);
    }

    @JvmStatic
    public static final void initiate(@Nullable JSONObject jSONObject) {
        INSTANCE.initiate(jSONObject);
    }

    @JvmStatic
    @NotNull
    public static final GlobalUrlConfig instance() {
        return INSTANCE.instance();
    }

    @NotNull
    public final String getBaseCdn() {
        return this.baseCdn;
    }

    @NotNull
    public final String getBaseUrl() {
        return this.baseUrl;
    }

    @NotNull
    public final String getButlerUrl() {
        if (r.f(this.baseUrl, "https://api.razorpay.com")) {
            String configEndpoint = CoreConfig.getInstance().getConfigEndpoint();
            r.j(configEndpoint, "getInstance().configEndpoint");
            return configEndpoint;
        }
        URI uri = new URI(this.baseUrl);
        return uri.getScheme() + "://" + uri.getHost() + "/butler/v1/settings";
    }

    @NotNull
    public final String getCdnUrl() {
        return this.cdnUrl;
    }

    @NotNull
    public final String getCheckoutUrl() {
        if (r.f(this.baseUrl, "https://api.razorpay.com")) {
            return a.r(new StringBuilder(), this.baseUrl, "/v1/checkout/public");
        }
        return this.baseUrl + "?baseCdn=" + this.baseCdn + "&staticCdn=" + this.staticCdn + "&trackUrl=" + this.trackUrl + "&cdn=" + this.cdnUrl;
    }

    @NotNull
    public final String getOtpelfJsUrl() {
        if (this.cdnUrl.length() != 0) {
            return a.r(new StringBuilder(), this.cdnUrl, "static/otpelf2/otpelf.js");
        }
        String otpElfJsUrl = CoreConfig.getInstance().getOtpElfJsUrl();
        r.j(otpElfJsUrl, "{\n            CoreConfig…e().otpElfJsUrl\n        }");
        return otpElfJsUrl;
    }

    @NotNull
    public final String getOtpelfVersionUrl() {
        if (this.cdnUrl.length() != 0) {
            return a.r(new StringBuilder(), this.cdnUrl, "static/otpelf2/version.json");
        }
        String otpElfVersionUrl = CoreConfig.getInstance().getOtpElfVersionUrl();
        r.j(otpElfVersionUrl, "{\n            CoreConfig…tpElfVersionUrl\n        }");
        return otpElfVersionUrl;
    }

    @NotNull
    public final String getStaticCdn() {
        return this.staticCdn;
    }

    @NotNull
    public final String getTrackUrl() {
        return r.f(this.trackUrl, CoreConfig.getInstance().getLumberjackEndpoint()) ? this.trackUrl : a.r(new StringBuilder(), this.trackUrl, "v1/track");
    }

    private GlobalUrlConfig(JSONObject jSONObject) {
        String optString = jSONObject.optString("frame", "https://api.razorpay.com");
        r.j(optString, "urlConfig.optString(\"fra…\", BaseConstants.RZP_URL)");
        this.baseUrl = optString;
        String optString2 = jSONObject.optString("baseCdn", "");
        r.j(optString2, "urlConfig.optString(\"baseCdn\", \"\")");
        this.baseCdn = optString2;
        String optString3 = jSONObject.optString("staticCdn", "");
        r.j(optString3, "urlConfig.optString(\"staticCdn\", \"\")");
        this.staticCdn = optString3;
        String optString4 = jSONObject.optString("trackUrl", CoreConfig.getInstance().getLumberjackEndpoint());
        r.j(optString4, "urlConfig.optString(\"tra…nce().lumberjackEndpoint)");
        this.trackUrl = optString4;
        String optString5 = jSONObject.optString("cdnUrl");
        r.j(optString5, "urlConfig.optString(\"cdnUrl\")");
        this.cdnUrl = optString5;
    }
}