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

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


package net.youmi.android;

import android.content.Context;
import java.io.InputStream;
import java.io.OutputStream;
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.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;

abstract class dz implements dj {

    protected String f583a;
    protected String b;
    protected long c;
    protected String d;
    protected Context f;
    protected DefaultHttpClient g;
    protected InputStream h;
    protected OutputStream i;
    protected List j;
    protected final String e = "utf-8";
    protected int k = 4;

    public dz(Context context, String str) {
        this.f = context;
        this.f583a = str;
        this.b = str;
    }

    private int c() {
        try {
            if (!aw.a(this.f, "android.permission.INTERNET")) {
                try {
                    if (this.i != null) {
                        this.i.close();
                    }
                } catch (Exception e) {
                }
                try {
                    if (this.h != null) {
                        this.h.close();
                    }
                } catch (Exception e2) {
                }
                try {
                    if (this.g == null) {
                        return 0;
                    }
                    this.g.getConnectionManager().shutdown();
                    return 0;
                } catch (Exception e3) {
                    return 0;
                }
            }
            if (!aq.b(this.f)) {
                try {
                    if (this.i != null) {
                        this.i.close();
                    }
                } catch (Exception e4) {
                }
                try {
                    if (this.h != null) {
                        this.h.close();
                    }
                } catch (Exception e5) {
                }
                try {
                    if (this.g != null) {
                        this.g.getConnectionManager().shutdown();
                    }
                } catch (Exception e6) {
                }
                return 1;
            }
            this.g = aq.a(this.f, this);
            HttpPost httpPost = new HttpPost(this.f583a);
            if (this.j != null && this.j.size() > 0) {
                httpPost.setEntity(new UrlEncodedFormEntity(this.j, "utf-8"));
            }
            httpPost.setHeader("Referer", "http://sdk.youmi.net/?p=3&app=" + f.a(this.f) + "&chn=" + f.e(this.f));
            HttpResponse execute = this.g.execute(httpPost);
            if (execute.getStatusLine().getStatusCode() != 200) {
                try {
                    if (this.i != null) {
                        this.i.close();
                    }
                } catch (Exception e7) {
                }
                try {
                    if (this.h != null) {
                        this.h.close();
                    }
                } catch (Exception e8) {
                }
                try {
                    if (this.g != null) {
                        this.g.getConnectionManager().shutdown();
                    }
                } catch (Exception e9) {
                }
                return 2;
            }
            HttpEntity entity = execute.getEntity();
            if (entity != null) {
                this.c = entity.getContentLength();
                this.h = entity.getContent();
                if (this.h != null) {
                    a();
                    byte[] bArr = new byte[1024];
                    while (true) {
                        int read = this.h.read(bArr);
                        if (read <= 0) {
                            break;
                        }
                        this.i.write(bArr, 0, read);
                    }
                    if (b()) {
                        try {
                            if (this.i != null) {
                                this.i.close();
                            }
                        } catch (Exception e10) {
                        }
                        try {
                            if (this.h != null) {
                                this.h.close();
                            }
                        } catch (Exception e11) {
                        }
                        try {
                            if (this.g != null) {
                                this.g.getConnectionManager().shutdown();
                            }
                        } catch (Exception e12) {
                        }
                        return 3;
                    }
                    int i = this.k;
                    try {
                        if (this.i != null) {
                            this.i.close();
                        }
                    } catch (Exception e13) {
                    }
                    try {
                        if (this.h != null) {
                            this.h.close();
                        }
                    } catch (Exception e14) {
                    }
                    try {
                        if (this.g == null) {
                            return i;
                        }
                        this.g.getConnectionManager().shutdown();
                        return i;
                    } catch (Exception e15) {
                        return i;
                    }
                }
            }
            try {
                if (this.i != null) {
                    this.i.close();
                }
            } catch (Exception e16) {
            }
            try {
                if (this.h != null) {
                    this.h.close();
                }
            } catch (Exception e17) {
            }
            try {
                if (this.g != null) {
                    this.g.getConnectionManager().shutdown();
                }
            } catch (Exception e18) {
            }
            return 2;
        } catch (Exception e19) {
            try {
                if (this.i != null) {
                    this.i.close();
                }
            } catch (Exception e20) {
            }
            try {
                if (this.h != null) {
                    this.h.close();
                }
            } catch (Exception e21) {
            }
            try {
                if (this.g != null) {
                    this.g.getConnectionManager().shutdown();
                }
            } catch (Exception e22) {
            }
            return 2;
        } catch (Throwable th) {
            try {
                if (this.i != null) {
                    this.i.close();
                }
            } catch (Exception e23) {
            }
            try {
                if (this.h != null) {
                    this.h.close();
                }
            } catch (Exception e24) {
            }
            try {
                if (this.g == null) {
                    throw th;
                }
                this.g.getConnectionManager().shutdown();
                throw th;
            } catch (Exception e25) {
                throw th;
            }
        }
    }

    public final int a(List list) {
        this.j = list;
        return c();
    }

    @Override
    public final void a(String str) {
        this.b = str;
    }

    protected abstract boolean a();

    protected abstract boolean b();
}