鸠摩搜书官方正版 v1.7版本的 MD5 值为:01c9a20d2c415de3233d7f691829edf5

以下内容为反编译后的 ed.java 源代码,内容仅作参考


package net.youmi.android;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.InputStream;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;

abstract class ed extends cb {
    protected cg h;

    public ed(cg cgVar) {
        this.h = cgVar;
    }

    protected abstract boolean a(File file);

    protected abstract boolean a(byte[] bArr);

    @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() {
        try {
            a(0L);
            try {
                if (this.h != null) {
                    File file = new File(this.h.b(this.f541a));
                    if (file.exists() && a(file)) {
                        this.f = 6;
                        d();
                        return this.f;
                    }
                }
            } catch (Exception e) {
            }
            DefaultHttpClient a2 = a();
            HttpGet 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 = a2.execute(httpGet);
            if (execute.getStatusLine().getStatusCode() != 200) {
                this.f = 7;
                d();
                return this.f;
            }
            HttpEntity entity = execute.getEntity();
            this.c = entity.getContentLength();
            InputStream content = entity.getContent();
            if (content == null) {
                this.f = 7;
                d();
                return this.f;
            }
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream((int) this.c);
            byte[] bArr = new byte[1024];
            while (true) {
                int read = content.read(bArr);
                if (read <= 0) {
                    break;
                }
                this.f = 5;
                this.d += read;
                byteArrayOutputStream.write(bArr, 0, read);
            }
            this.f = 7;
            if (byteArrayOutputStream.size() > 0) {
                byte[] byteArray = byteArrayOutputStream.toByteArray();
                try {
                    if (this.h != null) {
                        this.h.a(this.e, this.f541a, byteArray);
                    }
                } catch (Exception e2) {
                }
                if (a(byteArray)) {
                    this.f = 6;
                } else {
                    this.f = 7;
                }
            }
            try {
                content.close();
            } catch (Exception e3) {
            }
            try {
                byteArrayOutputStream.close();
            } catch (Exception e4) {
            }
            d();
            return this.f;
        } catch (Exception e5) {
            this.f = 4;
            d();
            return this.f;
        }
    }
}