热汗舞蹈 v1.24.1.0版本的 MD5 值为:f1dc6ef07903515a73f51f41f372123e
以下内容为反编译后的 c.java 源代码,内容仅作参考
package com.qiyukf.unicorn.i.a;
import android.text.TextUtils;
import com.huawei.hms.framework.common.ContainerUtils;
import com.qiyukf.nimlib.sdk.RequestCallback;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class c {
private static final Logger f23001a = LoggerFactory.getLogger(c.class);
private static boolean f23002b = false;
public static void b(String str, Map<String, String> map, RequestCallback<String> requestCallback) {
if (f23002b) {
a("POST", str, map, requestCallback);
return;
}
try {
requestCallback.onSuccess(e.a(b(a(), str, map), "POST", "Common"));
} catch (IOException unused) {
a("POST", str, map, requestCallback);
} catch (Exception e10) {
requestCallback.onException(e10);
}
}
public static String a(String str, Map<String, String> map) throws d {
try {
return e.a(b(a(), str, map), "GET", "Common");
} catch (IOException e10) {
throw new d("get request error", e10);
}
}
public static String a(String str, String str2) throws d {
try {
return e.a(b(str, str2, (Map<String, String>) null), "GET", "Common");
} catch (IOException e10) {
throw new d("get request error", e10);
}
}
public static void a(String str, Map<String, String> map, RequestCallback<String> requestCallback) {
if (f23002b) {
a("GET", str, map, requestCallback);
return;
}
try {
requestCallback.onSuccess(e.a(b(a(), str, map), "GET", "Common"));
} catch (IOException unused) {
a("GET", str, map, requestCallback);
} catch (Exception e10) {
requestCallback.onException(e10);
}
}
public static String b(String str, String str2, Map<String, String> map) {
String str3 = str + str2;
if (map != null) {
int i10 = 0;
for (Map.Entry<String, String> entry : map.entrySet()) {
if (!TextUtils.isEmpty(entry.getKey()) && !TextUtils.isEmpty(entry.getValue())) {
StringBuilder sb2 = new StringBuilder();
sb2.append(str3);
sb2.append(i10 == 0 ? "?" : ContainerUtils.FIELD_DELIMITER);
str3 = sb2.toString() + entry.getKey() + ContainerUtils.KEY_VALUE_DELIMITER + URLEncoder.encode(entry.getValue());
i10++;
}
}
}
f23001a.info("http request url={}", str3);
return str3;
}
public static String b() {
if (com.qiyukf.unicorn.c.g().unicornAddress != null && !TextUtils.isEmpty(com.qiyukf.unicorn.c.g().unicornAddress.daUrl)) {
return com.qiyukf.unicorn.c.g().unicornAddress.daUrl;
}
int e10 = com.qiyukf.nimlib.e.e.e();
return e10 == 1 ? "http://da.qytest.netease.com" : e10 == 2 ? "http://da.qiyukf.netease.com" : "https://da.qiyukf.com";
}
private static void a(final String str, final String str2, final Map<String, String> map, final RequestCallback<String> requestCallback) {
f23002b = true;
a.a().a(a(), new RequestCallback<String>() {
@Override
public final void onException(Throwable th) {
RequestCallback requestCallback2 = requestCallback;
requestCallback2.onException(new d(404, "ip get is exception" + str2));
}
@Override
public final void onFailed(int i10) {
RequestCallback requestCallback2 = requestCallback;
requestCallback2.onException(new d(i10, "ip get is failed" + str2));
}
@Override
public final void onSuccess(String str3) {
String str4 = str3;
try {
c.f23001a.info("http request use ip={} ", str4);
requestCallback.onSuccess(e.a(c.b(c.a(), str2, map), str4, str, "Common"));
} catch (IOException e10) {
requestCallback.onException(e10);
}
}
});
}
public static String a() {
if (com.qiyukf.unicorn.c.g().unicornAddress != null && !TextUtils.isEmpty(com.qiyukf.unicorn.c.g().unicornAddress.defaultUrl)) {
return com.qiyukf.unicorn.c.g().unicornAddress.defaultUrl;
}
int e10 = com.qiyukf.nimlib.e.e.e();
return e10 == 1 ? "http://aq1.qytest.netease.com" : e10 == 2 ? "http://qiyukf.netease.com" : e10 == 3 ? "http://qydev.netease.com" : "https://ap1.qiyukf.com";
}
}