九游游戏中心HD v4.6.8.1版本的 MD5 值为:78c397802cc5ffdcc7f5502ede90502e

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


package cn.ninegame.library.network.net.c;

import android.text.TextUtils;
import cn.ninegame.framework.NineGameClientApplication;
import cn.ninegame.library.d.e;
import cn.ninegame.library.util.am;
import cn.uc.downloadlib.parameter.Constant;
import java.io.Closeable;
import java.util.HashMap;
public final class p extends cn.ninegame.library.i.a.b.a<String, Integer, String> {
    a f2162a;

    public interface a {
        void a(p pVar);

        void a(p pVar, HashMap<String, String> hashMap);
    }

    @Override
    public final String a(String[] strArr) {
        HashMap<String, String> hashMap;
        String[] strArr2 = strArr;
        if (strArr2.length < 2 || TextUtils.isEmpty(strArr2[0]) || TextUtils.isEmpty(strArr2[1])) {
            if (this.f2162a != null) {
                this.f2162a.a(this);
            }
        } else {
            if (strArr2[1].equals("IP")) {
                String str = strArr2[0];
                if (cn.ninegame.library.network.b.a(NineGameClientApplication.a()).a()) {
                    String b = cn.ninegame.library.util.l.b();
                    if (!TextUtils.isEmpty(b)) {
                        if (b.startsWith("46000") || b.startsWith("46002")) {
                            hashMap = b(s.a().c, str);
                        } else if (b.startsWith("46001")) {
                            hashMap = b(s.a().d, str);
                        } else if (b.startsWith("46003")) {
                            hashMap = b(s.a().b, str);
                        }
                        if (hashMap == null && (hashMap = b(s.a().b, str)) == null && (hashMap = b(s.a().d, str)) == null) {
                            hashMap = b(s.a().c, str);
                        }
                    }
                }
                hashMap = null;
                if (hashMap == null) {
                    hashMap = b(s.a().c, str);
                }
            } else if (strArr2[1].equals("ALLIP")) {
                String str2 = strArr2[0];
                if (cn.ninegame.library.network.b.a(NineGameClientApplication.a()).a()) {
                    String b2 = cn.ninegame.library.util.l.b();
                    if (!TextUtils.isEmpty(b2)) {
                        if (b2.startsWith("46000") || b2.startsWith("46002")) {
                            hashMap = a(s.a().c, str2);
                        } else if (b2.startsWith("46001")) {
                            hashMap = a(s.a().d, str2);
                        } else if (b2.startsWith("46003")) {
                            hashMap = a(s.a().b, str2);
                        }
                        if (hashMap == null && (hashMap = a(s.a().b, str2)) == null && (hashMap = a(s.a().d, str2)) == null) {
                            hashMap = a(s.a().c, str2);
                        }
                    }
                }
                hashMap = null;
                if (hashMap == null) {
                    hashMap = a(s.a().c, str2);
                }
            } else {
                hashMap = null;
            }
            if (this.f2162a != null) {
                if (hashMap == null) {
                    this.f2162a.a(this);
                } else {
                    this.f2162a.a(this, hashMap);
                }
            }
        }
        return null;
    }

    private static HashMap<String, String> a(String str, String str2) {
        Exception e;
        HashMap<String, String> hashMap;
        String[] split;
        byte[] bytes;
        cn.ninegame.library.d.f a2;
        String[] split2;
        String[] split3;
        cn.ninegame.library.stat.b.b.a("UCDNSHelper# request to ucdns originUrl: " + str, new Object[0]);
        try {
            try {
                split = str2.split("\\|");
                String str3 = "";
                for (int i = 0; i < split.length; i++) {
                    str3 = str3 + split[i] + "_1.1.1.1_600,";
                }
                bytes = ("001`d=" + str3.substring(0, str3.length() - 1)).getBytes("utf-8");
                e.a aVar = new e.a();
                aVar.l = str;
                aVar.m = Constant.ErrorCode.NO_ERROR;
                aVar.n = Constant.ErrorCode.NO_ERROR;
                e.a a3 = aVar.a("Charset", "UTF-8").a("Content-Type", "application/json; charset=utf-8");
                a3.h = bytes;
                a2 = cn.ninegame.library.d.c.INSTANCE.a(a3.a());
            } finally {
                am.a((Closeable) null);
                am.a((Closeable) null);
            }
        } catch (Exception e2) {
            e = e2;
            hashMap = null;
        }
        if (a2 == null) {
            return null;
        }
        int i2 = a2.f1907a;
        String b = a2.b();
        z.a(str, new String(bytes), new StringBuilder().append(split.length).toString(), b, String.valueOf(i2));
        if (i2 != 200 || TextUtils.isEmpty(b) || b.length() <= 7 || (split2 = b.split("\\`")) == null || split2.length < 2 || (split3 = split2[1].split("\\,")) == null) {
            hashMap = null;
        } else {
            hashMap = new HashMap<>();
            for (String str4 : split3) {
                try {
                    String[] split4 = str4.split("\\_");
                    if (split4.length >= 2 && t.b(split4[1])) {
                        z.a(str, split4[0], split4[1]);
                        if (split4[1].equals("empty")) {
                            split4[1] = null;
                        }
                        hashMap.put(split4[0], split4[1]);
                    }
                } catch (Exception e3) {
                    e = e3;
                    cn.ninegame.library.stat.b.b.c("UCDNSHelper# errror " + e, new Object[0]);
                    am.a((Closeable) null);
                    am.a((Closeable) null);
                    return hashMap;
                }
            }
        }
        return hashMap;
    }

    private static HashMap<String, String> b(String str, String str2) {
        Exception e;
        HashMap<String, String> hashMap;
        byte[] bytes;
        cn.ninegame.library.d.f a2;
        String[] split;
        String[] split2;
        cn.ninegame.library.stat.b.b.a("UCDNSHelper# request to ucdns originUrl: " + str, new Object[0]);
        try {
            try {
                bytes = ("001`d=" + str2 + "_1.1.1.1_600").getBytes("utf-8");
                e.a aVar = new e.a();
                aVar.l = str;
                aVar.m = Constant.ErrorCode.NO_ERROR;
                aVar.n = Constant.ErrorCode.NO_ERROR;
                e.a a3 = aVar.a("Charset", "UTF-8").a("Content-Type", "application/json; charset=utf-8");
                a3.h = bytes;
                a2 = cn.ninegame.library.d.c.INSTANCE.a(a3.a());
            } finally {
                am.a((Closeable) null);
                am.a((Closeable) null);
            }
        } catch (Exception e2) {
            e = e2;
            hashMap = null;
        }
        if (a2 == null) {
            return null;
        }
        int i = a2.f1907a;
        String b = a2.b();
        z.a(str, new String(bytes), "1", b, String.valueOf(i));
        if (i == 200 && !TextUtils.isEmpty(b) && b.length() > 7 && (split = b.split("\\`")) != null && split.length > 1 && (split2 = split[1].split("\\,")) != null) {
            String[] split3 = split2[0].split("\\_");
            if (split3.length > 1 && t.b(split3[1])) {
                z.a(str, split3[0], split3[1]);
                if (split3[1].equals("empty")) {
                    split3[1] = null;
                }
                hashMap = new HashMap<>();
                try {
                    hashMap.put(split3[0], split3[1]);
                } catch (Exception e3) {
                    e = e3;
                    cn.ninegame.library.stat.b.b.c("UCDNSHelper# errror " + e, new Object[0]);
                    am.a((Closeable) null);
                    am.a((Closeable) null);
                    return hashMap;
                }
                return hashMap;
            }
        }
        hashMap = null;
        return hashMap;
    }
}