曹妃甸核酸检测平台.apk(点击下载) / HostUtils.java


package com.yht.util;

import android.text.TextUtils;
import android.util.Log;
import com.alibaba.fastjson.annotation.JSONField;
import com.health.im.b;
import java.io.Serializable;

public class HostUtils {

    /* renamed from: a  reason: collision with root package name */
    private static String f16112a;

    /* renamed from: b  reason: collision with root package name */
    public static HostUtils f16113b = new HostUtils();

    /* renamed from: c  reason: collision with root package name */
    private String f16114c = "https://apia.91taogu.com";

    /* renamed from: d  reason: collision with root package name */
    private String f16115d = "https://app.91taogu.com";

    /* renamed from: e  reason: collision with root package name */
    private String f16116e = "im.91taogu.com";

    /* renamed from: f  reason: collision with root package name */
    private String f16117f = "http://im.91taogu.com";

    /* renamed from: g  reason: collision with root package name */
    private boolean f16118g = true;

    public static class Urls implements Serializable {
        private String api;
        private String h5;
        private String im;
        @JSONField(name = "im_pic")
        private String imUpload;
        @JSONField(name = "did")
        private boolean ssl;

        public String getApi() {
            return this.api;
        }

        public String getH5() {
            return this.h5;
        }

        public String getIm() {
            return this.im;
        }

        public String getImUpload() {
            return this.imUpload;
        }

        public boolean getSsl() {
            return this.ssl;
        }

        public void setApi(String str) {
            this.api = str;
        }

        public void setH5(String str) {
            this.h5 = str;
        }

        public void setIm(String str) {
            this.im = str;
        }

        public void setImUpload(String str) {
            this.imUpload = str;
        }

        public void setSsl(boolean z) {
            this.ssl = z;
        }
    }

    private HostUtils() {
    }

    public static String a() {
        return f16113b.b() + "/";
    }

    public static String a(String str) {
        int indexOf = str.indexOf(":");
        return indexOf != -1 ? str.substring(0, indexOf) : str;
    }

    public static String a(boolean z) {
        return z ? "https://master-test.91taogu.com/" : "https://master.91taogu.com/";
    }

    public static Integer b(String str) {
        int indexOf = str.indexOf(":");
        if (indexOf != -1) {
            str = str.substring(indexOf);
        }
        int i = 63002;
        try {
            return Integer.valueOf(str);
        } catch (Exception unused) {
            Log.e("im port", "not num.");
            return i;
        }
    }

    public static String c() {
        return f16112a;
    }

    public static boolean c(String str) {
        if (str.startsWith(f16113b.d())) {
            return true;
        }
        if (str.startsWith(f16113b.b() + "/") || str.startsWith("https://fe-beta1.91taogu.com") || str.startsWith("https://test.91taogu.com") || str.startsWith("https://api.91taogu.com") || str.startsWith("http://api.91taogu.com")) {
            return true;
        }
        if (!TextUtils.isEmpty(f16112a)) {
            return str.startsWith(f16112a);
        }
        return false;
    }

    public static void f(String str) {
        f16112a = str;
    }

    public static String h() {
        return b.Z() ? f16112a : a(z.p());
    }

    public String b() {
        return this.f16114c;
    }

    public void b(boolean z) {
        String str;
        if (z) {
            this.f16114c = "https://test.91taogu.com";
            this.f16115d = "https://fe-beta1.91taogu.com";
            str = "imtest.91taogu.com";
        } else {
            this.f16114c = "https://apia.91taogu.com";
            this.f16115d = "https://app.91taogu.com";
            str = "im.91taogu.com";
        }
        this.f16116e = str;
        this.f16117f = "https://im.91taogu.com";
        this.f16118g = true;
    }

    public void c(boolean z) {
        this.f16118g = z;
    }

    public String d() {
        return this.f16115d;
    }

    public void d(String str) {
        this.f16114c = str;
        this.f16115d = "https://fe-beta1.91taogu.com";
        this.f16116e = "imtest.91taogu.com";
        this.f16117f = "http://imtest.91taogu.com:4080";
        this.f16118g = true;
    }

    public String e() {
        return this.f16116e;
    }

    public void e(String str) {
        if (!TextUtils.isEmpty(str)) {
            this.f16114c = str;
        }
    }

    public String f() {
        return this.f16117f;
    }

    public void g(String str) {
        if (!TextUtils.isEmpty(str)) {
            this.f16115d = str;
        }
    }

    public boolean g() {
        return this.f16118g;
    }

    public void h(String str) {
        if (!TextUtils.isEmpty(str)) {
            this.f16116e = str;
        }
    }

    public void i(String str) {
        if (!TextUtils.isEmpty(str)) {
            this.f16117f = str;
        }
    }
}