酷狗概念版 v2.5.5版本的 MD5 值为:782d327088fca4e58310f35a56f41319
以下内容为反编译后的 ab.java 源代码,内容仅作参考
package com.kugou.fanxing.util;
import android.text.TextUtils;
import com.kugou.common.config.ConfigKey;
import com.kugou.common.config.c;
import com.kugou.common.network.d.d;
import com.kugou.fanxing.pro.a.e;
import com.tencent.connect.common.Constants;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import org.apache.commons.codec.net.StringEncodings;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicNameValuePair;
public class ab extends d implements com.kugou.common.network.d.l {
private String f56795a;
private ConfigKey f56796b;
private Header[] f56797c;
private String f56798d;
private HttpEntity f56799e;
@Override
public String getRequestModuleName() {
return "Fanxing";
}
@Override
public boolean r_() {
return true;
}
public ab() {
this.f56795a = "";
this.f56796b = null;
this.f56797c = null;
this.f56798d = Constants.HTTP_POST;
this.f56799e = null;
}
public ab(boolean z) {
this.f56795a = "";
this.f56796b = null;
this.f56797c = null;
String str = Constants.HTTP_POST;
this.f56798d = Constants.HTTP_POST;
this.f56799e = null;
this.f56798d = z ? Constants.HTTP_GET : str;
}
public boolean a() {
return "http://acshow.kugou.com/show7".equals(e.f56426a);
}
public void a(String str) {
this.f56795a = str;
}
public void a(ConfigKey configKey) {
this.f56796b = configKey;
}
public void a(Header[] headerArr) {
this.f56797c = headerArr;
}
public void a(HttpEntity httpEntity) {
this.f56799e = httpEntity;
}
public void a(Hashtable<String, Object> hashtable) {
b(hashtable);
}
public void c(Hashtable<String, Object> hashtable) {
if (Constants.HTTP_POST.equalsIgnoreCase(this.f56798d)) {
this.f56799e = a((Map<String, Object>) hashtable);
} else {
a(hashtable);
}
}
public static HttpEntity a(Map<String, Object> map) {
if (map != null && map.size() >= 0) {
try {
return new UrlEncodedFormEntity(aq.a(map), StringEncodings.UTF8);
} catch (Exception unused) {
}
}
return null;
}
@Override
public String getUrl() {
String str = this.f56795a;
if (!a() || this.f56796b == null) {
return str;
}
String b2 = c.a().b(this.f56796b);
return !TextUtils.isEmpty(b2) ? b2 : str;
}
@Override
public String getRequestType() {
return this.f56798d;
}
@Override
public Header[] getHttpHeaders() {
if (com.kugou.fanxing.e.a().c()) {
return b(this.f56797c);
}
Header[] headerArr = this.f56797c;
return headerArr != null ? headerArr : super.getHttpHeaders();
}
private Header[] b(Header[] headerArr) {
BasicHeader basicHeader = new BasicHeader("KugouLive", "kglive");
if (headerArr == null) {
return new Header[]{basicHeader};
}
Header[] headerArr2 = new Header[headerArr.length + 1];
for (int i = 0; i < headerArr.length; i++) {
headerArr2[i] = headerArr[i];
}
headerArr2[headerArr2.length - 1] = basicHeader;
return headerArr2;
}
@Override
public HttpEntity getPostRequestEntity() {
return this.f56799e;
}
@Override
public String getGetRequestParams() {
if (this.l == null || this.l.size() < 0) {
return "";
}
ArrayList arrayList = new ArrayList();
Set<String> keySet = this.l.keySet();
if (e()) {
keySet = new TreeSet(keySet);
}
for (String str : keySet) {
arrayList.add(new BasicNameValuePair(str, this.l.get(str).toString()));
}
return URLEncodedUtils.format(arrayList, StringEncodings.UTF8);
}
@Override
public boolean e() {
return Constants.HTTP_GET.equals(this.f56798d);
}
}