package com.bytedance.sdk.component.fm;

import android.text.TextUtils;
import com.google.android.gms.measurement.internal.u1;
import u.a;

/* JADX INFO: loaded from: classes.dex */
class gqi {
    private static boolean fm;

    public static String fm() {
        return "";
    }

    public static void fm(boolean z10) {
        fm = z10;
    }

    public static String fm(Throwable th) {
        return a.b(new StringBuilder("{\"code\":"), th instanceof irt ? ((irt) th).fm : 0, "}");
    }

    public static String fm(String str, boolean z10) {
        if (TextUtils.isEmpty(str)) {
            return "{\"code\":1}";
        }
        String strH = (!fm || z10) ? "" : u1.h(str, 1, 1);
        String strConcat = "{\"code\":1,\"__data\":".concat(String.valueOf(str));
        if (!strH.isEmpty()) {
            return strConcat + "," + strH + "}";
        }
        return u1.j(strConcat, "}");
    }
}
