鸠摩搜书官方正版 v1.7版本的 MD5 值为:01c9a20d2c415de3233d7f691829edf5
以下内容为反编译后的 dk.java 源代码,内容仅作参考
package net.youmi.android;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
public final class dk extends cb {
private String h;
private String i;
private List j;
private boolean k;
public dk() {
this.k = false;
this.k = false;
}
@Override
protected final int e() {
if (aw.a(this.e, "android.permission.INTERNET")) {
return !aq.b(this.e) ? 2 : 0;
}
return 1;
}
@Override
protected final int f() {
DefaultHttpClient defaultHttpClient;
HttpGet httpGet;
try {
defaultHttpClient = a();
} catch (Exception e) {
defaultHttpClient = null;
}
if (defaultHttpClient == null) {
this.f = 4;
d();
return this.f;
}
try {
a(0L);
if (this.k) {
HttpPost httpPost = new HttpPost(this.f541a);
httpPost.setEntity(new UrlEncodedFormEntity(this.j, "utf-8"));
httpGet = httpPost;
} else {
httpGet = new HttpGet(this.f541a);
}
httpGet.setHeader("Referer", "http://sdk.youmi.net/?p=3&app=" + f.a(this.e) + "&chn=" + f.e(this.e));
HttpResponse execute = defaultHttpClient.execute(httpGet);
if (execute.getStatusLine().getStatusCode() != 200) {
try {
defaultHttpClient.getConnectionManager().shutdown();
} catch (Exception e2) {
}
this.f = 7;
d();
return this.f;
}
HttpEntity entity = execute.getEntity();
this.c = entity.getContentLength();
this.i = EntityUtils.getContentCharSet(entity);
InputStream content = entity.getContent();
byte[] bArr = new byte[1024];
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
while (true) {
int read = content.read(bArr);
if (read <= 0) {
break;
}
byteArrayOutputStream.write(bArr, 0, read);
a(byteArrayOutputStream.size());
}
byte[] byteArray = byteArrayOutputStream.toByteArray();
if (this.i == null) {
this.i = "utf-8";
this.h = new String(byteArray, "utf-8");
} else {
this.h = new String(byteArray, this.i);
}
try {
content.close();
} catch (Exception e3) {
}
try {
byteArrayOutputStream.close();
} catch (Exception e4) {
}
try {
defaultHttpClient.getConnectionManager().shutdown();
} catch (Exception e5) {
}
this.f = 6;
d();
return this.f;
} catch (Exception e6) {
try {
defaultHttpClient.getConnectionManager().shutdown();
} catch (Exception e7) {
}
this.f = 4;
d();
return this.f;
}
}
public final String g() {
return this.h;
}
}