package com.ss.android.ugc.aweme.services;

import X.AnonymousClass9DY;
import X.C23868bx;
import X.C32888qV;
import X.Fm2;
import X.M12;
import X.PTw;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.ugc.aweme.network.RetrofitFactory;
import com.google.gson.Gson;
import com.ss.android.ugc.aweme.utils.GsonHolder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import kotlin.h.b.n;

public final class NetworkServiceImpl implements Fm2 {
    static {
        Covode.recordClassIndex(105135);
    }

    public final String getApiHost() {
        String str = AnonymousClass9DY.LIZIZ;
        n.LIZIZ(str, "");
        return str;
    }

    public final Gson getRetrofitFactoryGson() {
        Gson LIZIZ = GsonHolder.LIZJ().LIZIZ();
        n.LIZIZ(LIZIZ, "");
        return LIZIZ;
    }

    public final <T> T createDefaultRetrofit(Class<T> cls) {
        M12.LIZ(cls);
        return RetrofitFactory.LIZ().LIZ(getApiHost()).LIZ(cls);
    }

    public final void putCommonParams(HashMap<String, String> hashMap, boolean z) {
        M12.LIZ(hashMap);
        C32888qV.LIZ((Map) hashMap, z);
    }

    public final <T> T retrofitCreate(String str, Class<T> cls) {
        M12.LIZ(str, cls);
        return RetrofitService.createIRetrofitServicebyMonsterPlugin(false).createNewRetrofit(str).create(cls);
    }

    public final <T> T createRetrofit(String str, boolean z, Class<T> cls) {
        M12.LIZ(str, cls);
        PTw LIZIZ = RetrofitFactory.LIZ().LIZIZ(str);
        LIZIZ.LIZ(z);
        return LIZIZ.LIZJ().LIZ(cls);
    }

    public final <T> T createRetrofitWithInterceptors(String str, boolean z, Class<T> cls, List<? extends C23868bx> list) {
        M12.LIZ(str, cls, list);
        PTw LIZIZ = RetrofitFactory.LIZ().LIZIZ(str);
        LIZIZ.LIZ(z);
        LIZIZ.LIZ(list);
        return LIZIZ.LIZJ().LIZ(cls);
    }
}
