导航菜单

页面标题

页面副标题

万能钥匙 v1.1.23 - ez.java 源代码

正在查看: 万能钥匙 v1.1.23 应用的 ez.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package cn.fly.verify;

import android.text.TextUtils;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantReadWriteLock;

public class ez {

    private static ez f8480d;

    private ArrayList<String> f8483g;

    private volatile HashMap<String, Long> f8484h;

    private ReentrantReadWriteLock f8485i;

    private ReentrantReadWriteLock f8486j;

    private static final CountDownLatch f8479c = new CountDownLatch(1);

    public static HashMap<String, String> f8477a = new HashMap<>();

    private static final ArrayList<String> f8478b = new ArrayList<>(Arrays.asList("cfgc.zztfly.com"));

    private volatile CountDownLatch f8487k = f8479c;

    private volatile HashMap<String, HashMap<String, ArrayList<String>>> f8481e = db.a().p();

    private volatile HashMap<String, String> f8482f = db.a().q();

    static {
        f8477a.put("gcfg", "cfgc.zztfly.com");
        f8477a.put("gclg", "upc.zztfly.com");
        f8477a.put("el", "errc.zztfly.com");
        f8477a.put("dg", "devc.zztfly.com");
        f8477a.put("dtc", "fdl.zztfly.com");
    }

    private ez() {
        ArrayList<String> r10 = db.a().r();
        this.f8483g = r10;
        if (r10 == null || r10.isEmpty()) {
            this.f8483g = f8478b;
        }
        this.f8484h = db.a().s();
        this.f8485i = new ReentrantReadWriteLock();
        this.f8486j = new ReentrantReadWriteLock();
    }

    public static ez a() {
        if (f8480d == null) {
            synchronized (ez.class) {
                try {
                    if (f8480d == null) {
                        f8480d = new ez();
                    }
                } finally {
                }
            }
        }
        return f8480d;
    }

    public void a(java.util.concurrent.CountDownLatch r20, int r21) {
        throw new UnsupportedOperationException("Method not decompiled: cn.fly.verify.ez.a(java.util.concurrent.CountDownLatch, int):void");
    }

    private boolean a(String str, String str2) {
        Long l10;
        boolean z = true;
        try {
            if (this.f8486j.readLock().tryLock(3000L, TimeUnit.MILLISECONDS)) {
                String str3 = str + "_" + str2;
                if (this.f8484h != null && this.f8484h.containsKey(str3) && (l10 = this.f8484h.get(str3)) != null) {
                    if (System.currentTimeMillis() - l10.longValue() < 1800000) {
                        z = false;
                    }
                }
            }
            try {
                this.f8486j.readLock().unlock();
            } catch (Throwable th) {
                ft.a().a(th, "DM " + th.getMessage(), new Object[0]);
            }
        } catch (Throwable th2) {
            try {
                ft.a().a(th2, "DM " + th2.getMessage(), new Object[0]);
                try {
                    this.f8486j.readLock().unlock();
                } catch (Throwable th3) {
                    ft.a().a(th3, "DM " + th3.getMessage(), new Object[0]);
                }
            } catch (Throwable th4) {
                try {
                    this.f8486j.readLock().unlock();
                } catch (Throwable th5) {
                    ft.a().a(th5, "DM " + th5.getMessage(), new Object[0]);
                }
                throw th4;
            }
        }
        ft.a().a("DM ck dur: " + str + "-" + str2 + ", pass: " + z, new Object[0]);
        return z;
    }

    private boolean a(String str, String str2, String str3) {
        boolean b10 = b(str3);
        if (b10) {
            try {
                if (this.f8486j.writeLock().tryLock(3000L, TimeUnit.MILLISECONDS)) {
                    this.f8484h.put(str + "_" + str2, Long.valueOf(System.currentTimeMillis()));
                    db.a().d(this.f8484h);
                }
                try {
                    this.f8486j.writeLock().unlock();
                    return b10;
                } catch (Throwable th) {
                    ft.a().a(th, "DM " + th.getMessage(), new Object[0]);
                }
            } catch (Throwable th2) {
                try {
                    ft.a().a(th2, "DM " + th2.getMessage(), new Object[0]);
                    try {
                        this.f8486j.writeLock().unlock();
                    } catch (Throwable th3) {
                        ft.a().a(th3, "DM " + th3.getMessage(), new Object[0]);
                    }
                } catch (Throwable th4) {
                    try {
                        this.f8486j.writeLock().unlock();
                    } catch (Throwable th5) {
                        ft.a().a(th5, "DM " + th5.getMessage(), new Object[0]);
                    }
                    throw th4;
                }
            }
        }
        return b10;
    }

    private boolean b(String str) {
        if (!TextUtils.isEmpty(str)) {
            try {
                InetAddress[] allByName = InetAddress.getAllByName(str);
                if (allByName != null) {
                    for (InetAddress inetAddress : allByName) {
                        if (!c(inetAddress.getHostAddress())) {
                            ft.a().a("DM ck ht: " + str + ", fai", new Object[0]);
                            return false;
                        }
                    }
                }
                ft.a().a("DM ck ht: " + str + ", suc", new Object[0]);
                return true;
            } catch (Throwable th) {
                ft.a().a(th, "DM " + th.getMessage(), new Object[0]);
            }
        }
        ft.a().a("DM ck ht: " + str + ", fai_emp|exp", new Object[0]);
        return false;
    }

    private static boolean c(String str) {
        if (TextUtils.isEmpty(str) || str.equals("127.0.0.1") || str.startsWith("10.") || str.startsWith("192.168")) {
            return false;
        }
        if (str.startsWith("172.")) {
            String[] split = str.split("\\.");
            if (split.length > 1) {
                try {
                    int parseInt = Integer.parseInt(split[1]);
                    return parseInt < 16 || parseInt > 31;
                } catch (Throwable th) {
                    ft.a().a(th, "DM " + th.getMessage(), new Object[0]);
                }
            }
        }
        return true;
    }

    public String a(String str) {
        return fm.a(a().a("FCOMMON", str, f8477a.get(str), false));
    }

    public String a(String str, String str2, String str3, boolean z) {
        HashMap<String, ArrayList<String>> hashMap;
        ArrayList<String> arrayList;
        ft.a().a("DM get: " + str + "-" + str2 + "-" + str3 + "-" + z, new Object[0]);
        if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
            ft.a().a("DM Params 'sName' or 'aName' is null", new Object[0]);
            return str3;
        }
        boolean z2 = this.f8487k.getCount() == 0;
        try {
            if (this.f8485i.readLock().tryLock(3000L, TimeUnit.MILLISECONDS) && this.f8481e != null && this.f8481e.containsKey(str) && (hashMap = this.f8481e.get(str)) != null && hashMap.containsKey(str2) && (arrayList = hashMap.get(str2)) != null && !arrayList.isEmpty()) {
                Iterator<String> it = arrayList.iterator();
                while (it.hasNext()) {
                    String next = it.next();
                    if (!z || !a(str, str2)) {
                        if (this.f8482f.containsKey(str + "-" + str2)) {
                            String str4 = this.f8482f.get(str + "-" + str2);
                            ft.a().a("DM rtn [cac|chk_abt]: " + str + "-" + str2 + ": " + str4, new Object[0]);
                            try {
                                this.f8485i.readLock().unlock();
                                return str4;
                            } catch (Throwable th) {
                                ft.a().a(th, "DM " + th.getMessage(), new Object[0]);
                                return str4;
                            }
                        }
                        if (!TextUtils.isEmpty(next)) {
                            ft.a().a("DM rtn [cac]: " + str + "-" + str2 + ": " + next, new Object[0]);
                            try {
                                this.f8485i.readLock().unlock();
                                return next;
                            } catch (Throwable th2) {
                                ft.a().a(th2, "DM " + th2.getMessage(), new Object[0]);
                                return next;
                            }
                        }
                    } else if (a(str, str2, next)) {
                        ft.a().a("DM rtn [cac|chk]: " + str + "-" + str2 + ": " + next, new Object[0]);
                        HashMap<String, String> hashMap2 = this.f8482f;
                        StringBuilder sb2 = new StringBuilder();
                        sb2.append(str);
                        sb2.append("-");
                        sb2.append(str2);
                        hashMap2.put(sb2.toString(), next);
                        db.a().c(this.f8482f);
                        try {
                            this.f8485i.readLock().unlock();
                            return next;
                        } catch (Throwable th3) {
                            ft.a().a(th3, "DM " + th3.getMessage(), new Object[0]);
                            return next;
                        }
                    }
                }
            }
            try {
                this.f8485i.readLock().unlock();
            } catch (Throwable th4) {
                ft.a().a(th4, "DM " + th4.getMessage(), new Object[0]);
            }
        } catch (Throwable th5) {
            try {
                ft.a().a(th5, "DM " + th5.getMessage(), new Object[0]);
                try {
                    this.f8485i.readLock().unlock();
                } catch (Throwable th6) {
                    ft.a().a(th6, "DM " + th6.getMessage(), new Object[0]);
                }
            } catch (Throwable th7) {
                try {
                    this.f8485i.readLock().unlock();
                } catch (Throwable th8) {
                    ft.a().a(th8, "DM " + th8.getMessage(), new Object[0]);
                }
                throw th7;
            }
        }
        try {
            this.f8482f.remove(str + "-" + str2);
            db.a().c(this.f8482f);
            if (!z || !a(str, str2)) {
                if (this.f8482f.containsKey(str + "-" + str2)) {
                    String str5 = this.f8482f.get(str + "-" + str2);
                    ft.a().a("DM rtn [def|chk_abt]: " + str + "-" + str2 + ": " + str5, new Object[0]);
                    return str5;
                }
                ft.a().a("DM rtn [def]" + str + "-" + str2 + ": " + str3, new Object[0]);
            } else if (a(str, str2, str3)) {
                ft.a().a("DM rtn [def|chk_true]: " + str + "-" + str2 + ": " + str3, new Object[0]);
                HashMap<String, String> hashMap3 = this.f8482f;
                StringBuilder sb3 = new StringBuilder();
                sb3.append(str);
                sb3.append("-");
                sb3.append(str2);
                hashMap3.put(sb3.toString(), str3);
                db.a().c(this.f8482f);
            } else if (z2) {
                ft.a().a("DM rtn [def|chk_false]" + str + "-" + str2 + ": " + str3, new Object[0]);
            } else {
                if (this.f8487k.await(5000L, TimeUnit.MILLISECONDS)) {
                    ft.a().a("DM awt next", new Object[0]);
                    return a(str, str2, str3, z);
                }
                ft.a().a("DM rtn [def|awt_to]" + str + "-" + str2 + ": " + str3, new Object[0]);
            }
            return str3;
        } catch (Throwable th9) {
            ft.a().a(th9, "DM " + th9.getMessage(), new Object[0]);
            ft.a().a("DM rtn [def|exp]" + str + "-" + str2 + ": " + str3, new Object[0]);
            return str3;
        }
    }

    public void b() {
        if (this.f8487k != f8479c && this.f8487k.getCount() != 0) {
            ft.a().a("DM obt abort", new Object[0]);
            return;
        }
        ft.a().a("DM obt start", new Object[0]);
        this.f8487k = new CountDownLatch(1);
        fq.f8622c.execute(new Runnable() {
            @Override
            public void run() {
                ez ezVar = ez.this;
                ezVar.a(ezVar.f8487k, 0);
            }
        });
    }
}