APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:Caller ID
版本号:1.8.3
包名称:com.callerid.block

MD5 校验值:5ef3f775189f42f146cf0788a99eebd7

反编译源代码说明

g.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package w3;

import android.os.AsyncTask;
import android.os.Handler;
import android.os.Looper;
import com.callerid.block.main.EZCallApplication;
import ja.q;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Locale;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.json.JSONObject;
import w3.g;
import y3.a0;
import y3.c1;
import y3.l;
import y3.l0;
import y3.m;
import y3.n0;
import y3.r1;
import y3.u;
import y3.w;

public class g extends AsyncTask<String, Void, String> {

    private final b f34496b;

    private final String f34495a = com.phone.libphone.j.f29614a + "/office.zip";

    private final ja.i f34497c = new a();

    public class a extends ja.i {
        a() {
        }

        public void n() {
            try {
                if (a0.f34733a) {
                    a0.a("wbb", "Util.path: " + com.phone.libphone.j.f29614a);
                }
                g gVar = g.this;
                gVar.i(gVar.f34495a, com.phone.libphone.j.f29614a + "/");
            } catch (Exception e10) {
                e10.printStackTrace();
                if (a0.f34733a) {
                    a0.a("wbb", "IOException: " + e10.getMessage());
                }
                if (g.this.f34496b != null) {
                    g.this.f34496b.a();
                }
            }
        }

        public void o() {
            new File(g.this.f34495a).delete();
        }

        @Override
        public void b(ja.a aVar) {
            if (a0.f34733a) {
                a0.a("wbb", "下载完成:开始解压数据: " + Thread.currentThread().getName());
            }
            n0.a().f34776a.execute(new Runnable() {
                @Override
                public final void run() {
                    g.a.this.n();
                }
            });
        }

        @Override
        public void d(ja.a aVar, Throwable th) {
            if (a0.f34733a) {
                a0.a("wbb", "下载失败:失败原因:" + th.getMessage() + " : " + Thread.currentThread().getName());
            }
            if ("Requested Range Not Satisfiable".equals(th.getMessage())) {
                n0.a().f34776a.execute(new Runnable() {
                    @Override
                    public final void run() {
                        g.a.this.o();
                    }
                });
            }
            if (g.this.f34496b != null) {
                g.this.f34496b.a();
            }
        }

        @Override
        public void f(ja.a aVar, int i10, int i11) {
        }

        @Override
        public void g(ja.a aVar, int i10, int i11) {
        }

        @Override
        public void h(ja.a aVar, int i10, int i11) {
            float t10 = aVar.t() / aVar.f();
            if (a0.f34733a) {
                a0.a("wbb", "下载进度: " + i11 + "/" + i10 + "/   进度:" + ((int) (t10 * 100.0f)) + "%");
            }
        }

        @Override
        public void k(ja.a aVar) {
        }
    }

    public g(b bVar) {
        this.f34496b = bVar;
    }

    private static File e(String str, String str2) {
        String replace = str2.replace("\\", "/");
        String[] split = replace.split("/");
        File file = new File(str);
        if (split.length <= 1) {
            return new File(file, replace);
        }
        int i10 = 0;
        while (i10 < split.length - 1) {
            File file2 = new File(file, split[i10]);
            i10++;
            file = file2;
        }
        if (!file.exists()) {
            file.mkdirs();
        }
        return new File(file, split[split.length - 1]);
    }

    public void f() {
        b bVar = this.f34496b;
        if (bVar != null) {
            bVar.a();
            this.f34496b.onSuccess();
        }
    }

    @Override
    public String doInBackground(String... strArr) {
        try {
            long I1 = c1.I1();
            m.c().g("request_offline_parser");
            String iso_code = l.f(EZCallApplication.d()).getIso_code();
            String country_code = l.f(EZCallApplication.d()).getCountry_code();
            if (iso_code.contains("/")) {
                iso_code = iso_code.substring(0, iso_code.indexOf("/"));
            }
            String H = r1.H(EZCallApplication.d());
            HashMap hashMap = new HashMap();
            hashMap.put("app_version", r1.J(EZCallApplication.d()));
            hashMap.put("uid", H);
            hashMap.put("country", iso_code);
            hashMap.put("cc", country_code);
            hashMap.put("language", Locale.getDefault().getLanguage());
            hashMap.put("last_update_time", String.valueOf(I1));
            hashMap.put("stamp", r1.D(EZCallApplication.d(), H));
            if (a0.f34733a) {
                a0.a("wbb", "params: " + hashMap);
            }
            String b10 = u.b(w.b("https://app.ayamote.com/proc/v1/parcheupd.php", hashMap, "utf-8"));
            a0.a("wbb", "result=" + b10);
            if (b10 != null) {
                String string = new JSONObject(b10).getString("data_url");
                if (!"".equals(string)) {
                    return string;
                }
                if (I1 != 0) {
                    c1.R1();
                }
            }
        } catch (Exception e10) {
            e10.printStackTrace();
        }
        return "";
    }

    @Override
    public void onPostExecute(String str) {
        b bVar;
        super.onPostExecute(str);
        if (a0.f34733a) {
            a0.a("wbb", "onPostExecute: " + str);
        }
        if (str == null || str.equals("")) {
            bVar = this.f34496b;
            if (bVar == null) {
                return;
            }
        } else if (y3.d.b(EZCallApplication.d())) {
            m.c().g("download_offline_parser");
            h(str);
            return;
        } else {
            bVar = this.f34496b;
            if (bVar == null) {
                return;
            }
        }
        bVar.a();
    }

    public void h(String str) {
        if (a0.f34733a) {
            a0.a("wbb", "开始下载离线解析库: " + str);
        }
        try {
            q.d().c(str).setPath(this.f34495a).I(this.f34497c).D(8).M(1000).G(1000).start();
        } catch (Exception e10) {
            e10.printStackTrace();
        }
    }

    public void i(String str, String str2) throws Exception {
        ZipFile zipFile = new ZipFile(str);
        Enumeration<? extends ZipEntry> entries = zipFile.entries();
        byte[] bArr = new byte[1024];
        while (entries.hasMoreElements()) {
            ZipEntry nextElement = entries.nextElement();
            if (nextElement.isDirectory()) {
                String str3 = str2 + nextElement.getName();
                str3.trim();
                new File(str3).mkdir();
            } else {
                BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(e(str2, nextElement.getName())));
                BufferedInputStream bufferedInputStream = new BufferedInputStream(zipFile.getInputStream(nextElement));
                while (true) {
                    int read = bufferedInputStream.read(bArr, 0, 1024);
                    if (read == -1) {
                        break;
                    } else {
                        bufferedOutputStream.write(bArr, 0, read);
                    }
                }
                bufferedInputStream.close();
                bufferedOutputStream.close();
            }
        }
        zipFile.close();
        Thread.sleep(2000L);
        try {
            File file = new File(str);
            if (file.exists()) {
                file.delete();
            }
            m.c().g("download_offline_parser_ok");
            l0.d(EZCallApplication.d());
            c1.R1();
        } catch (Exception e10) {
            e10.printStackTrace();
        }
        new Handler(Looper.getMainLooper()).post(new Runnable() {
            @Override
            public final void run() {
                g.this.f();
            }
        });
    }
}