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

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


package cn.ninegame.library.imageloader;

import com.xiaomi.mipush.sdk.MiPushClient;
import java.net.URLEncoder;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public final class n {
    String b;
    String c;
    String d;
    String e;
    String f;
    public StringBuilder g;
    private final int n;
    private final int o;
    private static final String[] h = {"image.uc.cn", "img.inhotvideo.com", "img.hotvideo.cc", "img.ruhotfilm.ru", "img.rumyvideo.ru", "files.music.uodoo.com", "in.los.img.ucweb.com", "img.ucweb.com", "img.huntnews.in", "img.uodoo.com", "image.uodoo.com", "pfdev.uodoo.com"};
    private static final Pattern i = Pattern.compile("http://([^/]*)/([^/]*)/([^/]*)/*");
    private static final Pattern j = Pattern.compile("http://[^/]*/o/[^/]*/[^/]*/.*;0,([^;]*);.*");
    private static final Pattern k = Pattern.compile("http://[^/]*/o/[^/]*/[^/]*/.*;0,[^;]*;0,[^;]*;.*");
    private static final Pattern l = Pattern.compile("http://[^/]*/o/[^/]*/./.*;0,[^;]*;.*");
    private static final Pattern m = Pattern.compile("http://[^/]*/o/[^/]*/./.*;.*");
    public static boolean f2109a = false;

    private static boolean b(String str) {
        return str == null || str.length() == 0;
    }

    public n(String str) {
        this.b = null;
        this.c = null;
        this.d = null;
        this.e = null;
        this.f = null;
        this.g = new StringBuilder();
        this.n = 75;
        this.o = 10;
        this.d = null;
        this.b = null;
        this.c = null;
        this.e = null;
        this.f = null;
        if (b(str)) {
            return;
        }
        this.d = str;
        int indexOf = str.indexOf(63);
        str = indexOf > 0 ? str.substring(0, indexOf) : str;
        int indexOf2 = str.indexOf(35);
        this.c = indexOf2 > 0 ? str.substring(0, indexOf2) : str;
        Matcher matcher = i.matcher(this.c);
        if (!matcher.find()) {
            return;
        }
        this.b = matcher.group(1);
        this.e = matcher.group(2);
        this.f = matcher.group(3);
    }

    public n() {
        this.b = null;
        this.c = null;
        this.d = null;
        this.e = null;
        this.f = null;
        this.g = new StringBuilder();
        this.n = 75;
        this.o = 10;
    }

    public final n a() {
        this.g = new StringBuilder();
        return this;
    }

    public final n a(String str) {
        this.g.append(";3,").append(str);
        return this;
    }

    private String b() {
        String str = null;
        if (!b(this.e)) {
            if (this.e.equals("s")) {
                str = this.c.substring(this.c.indexOf("/s/") + 3);
            } else if (f2109a && this.e.equals("o")) {
                if (m.matcher(this.c).find()) {
                    if (!l.matcher(this.c).find()) {
                        int indexOf = this.c.indexOf(";");
                        str = this.c.substring(this.c.indexOf("/o/") + 3, indexOf);
                    }
                } else {
                    Matcher matcher = j.matcher(this.c);
                    if (matcher.find()) {
                        if (!k.matcher(this.c).find()) {
                            str = matcher.group(1);
                        }
                    }
                }
            }
            return str;
        }
        str = c();
        return str;
    }

    private String c() {
        try {
            if (!b(this.b)) {
                if (this.b.equals("image.game.uc.cn")) {
                    this.f = "9game";
                    return "9game/g" + this.c.substring(this.c.indexOf(this.b) + this.b.length());
                } else if (this.b.equals("dl.bbs.9game.cn")) {
                    this.f = "y9d";
                    return "y9d/g" + this.c.substring(this.c.indexOf(this.b) + this.b.length() + 12);
                } else if (this.b.equals("static.jiaoyimao.com")) {
                    this.f = "gcmall";
                    return "gcmall/g" + this.c.substring(this.c.indexOf(this.b) + this.b.length());
                }
            }
        } catch (Exception e) {
        }
        return null;
    }

    public final String a(String str, String str2) {
        boolean z = false;
        try {
            if (!b(str2)) {
                int parseInt = Integer.parseInt(str2);
                if (parseInt < 10 || parseInt > 75) {
                    str2 = "";
                }
            }
        } catch (Exception e) {
            str2 = "";
        }
        if (!b(this.b)) {
            if (!b(this.b)) {
                if (this.b.equals("image.game.uc.cn") || this.b.equals("dl.bbs.9game.cn") || this.b.equals("static.jiaoyimao.com") || this.b.endsWith(".image.uc.cn")) {
                    z = true;
                } else {
                    int i2 = 0;
                    while (true) {
                        if (i2 >= h.length) {
                            break;
                        } else if (this.b.equals(h[i2])) {
                            z = true;
                            break;
                        } else {
                            i2++;
                        }
                    }
                }
            }
            if (z) {
                String b = b();
                if (b == null) {
                    return this.d;
                }
                return "http://" + this.b + "/o/" + this.f + "/1k/;," + str2 + MiPushClient.ACCEPT_TIME_SEPARATOR + str + ";0," + b + this.g.toString();
            }
        }
        return this.d;
    }

    public static String a(String str, String str2, String str3) {
        if (b(str2)) {
            str2 = "680";
        }
        if (b(str3)) {
            str3 = "680";
        }
        if (str.indexOf(new StringBuilder("\";16:200,150,\"").toString()) <= 0) {
            n a2 = new n(str).a().a(str2 + "x" + str3);
            a2.g.append(";").append("\"16, 200, 150, 1\"");
            String a3 = a2.a("JPEG", "100");
            if (a3.equals(str)) {
                a3 = String.format("http://sh.image.uc.cn/o/y9g/1k/;,60,JPEG;%s;3,%sx%s;16,200,150,1", "103," + URLEncoder.encode(str), str2, str3);
            }
            return a3;
        }
        return str;
    }
}