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

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


package cn.ninegame.hybird.link;

import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import cn.ninegame.b.a.a;
import cn.ninegame.gamemanager.download.fragment.SpecialDownloadPage;
import cn.ninegame.gamemanager.game.gamedetail.GameDetailNativePage;
import cn.ninegame.genericframework.basic.m;
import cn.ninegame.genericframework.basic.r;
import cn.ninegame.library.uilib.adapter.webFragment.SpecialPage;
import cn.ninegame.library.util.cc;
import cn.ninegame.library.util.l;
import cn.ninegame.share.core.o;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.json.JSONObject;
public final class h implements m {
    private static h b = null;
    private k f1799a = null;

    private static h a() {
        if (b == null) {
            b = new h();
        }
        return b;
    }

    private h() {
        cn.ninegame.genericframework.basic.g.a().b().a("base_biz_flex_param_changes", this);
        if (cn.ninegame.library.stat.b.b.a()) {
            a((String) null);
        } else {
            a(cn.ninegame.library.dynamicconfig.b.a().a("url_direct_rule"));
        }
    }

    private void a(String str) {
        try {
            k a2 = k.a(str);
            if (a2 == null) {
                a2 = b();
            }
            cn.ninegame.library.stat.b.b.a("rules=" + a2, new Object[0]);
            this.f1799a = a2;
        } catch (Exception e) {
            cn.ninegame.library.stat.b.b.a(e);
        }
    }

    private j a(CharSequence charSequence) {
        k kVar = this.f1799a;
        return a(kVar == null ? null : kVar.f1802a, charSequence, 1);
    }

    private j b(CharSequence charSequence) {
        k kVar = this.f1799a;
        return a(kVar == null ? null : kVar.c, charSequence, 3);
    }

    private j c(CharSequence charSequence) {
        k kVar = this.f1799a;
        return a(kVar == null ? null : kVar.d, charSequence, 4);
    }

    private j d(CharSequence charSequence) {
        k kVar = this.f1799a;
        return a(kVar == null ? null : kVar.e, charSequence, 13);
    }

    private j e(CharSequence charSequence) {
        k kVar = this.f1799a;
        return a(kVar == null ? null : kVar.h, charSequence, 7);
    }

    private j f(CharSequence charSequence) {
        k kVar = this.f1799a;
        return a(kVar == null ? null : kVar.i, charSequence, 8);
    }

    private j g(CharSequence charSequence) {
        k kVar = this.f1799a;
        return a(kVar == null ? null : kVar.j, charSequence, 9);
    }

    private j h(CharSequence charSequence) {
        k kVar = this.f1799a;
        return a(kVar == null ? null : kVar.k, charSequence, 10);
    }

    private j i(CharSequence charSequence) {
        k kVar = this.f1799a;
        return a(kVar == null ? null : kVar.l, charSequence, 11);
    }

    private j j(CharSequence charSequence) {
        k kVar = this.f1799a;
        return a(kVar == null ? null : kVar.m, charSequence, 12);
    }

    private static j a(List<Pattern> list, CharSequence charSequence, int i) {
        if (list == null || charSequence == null) {
            return null;
        }
        try {
            for (Pattern pattern : list) {
                Matcher matcher = pattern.matcher(charSequence);
                if (matcher.find()) {
                    j jVar = new j();
                    if (matcher.groupCount() > 0) {
                        jVar.b = matcher.group(1);
                    }
                    jVar.f1801a = i;
                    return jVar;
                }
            }
        } catch (Exception e) {
            cn.ninegame.library.stat.b.b.a(e);
        }
        return null;
    }

    public static boolean a(String str, String str2) {
        boolean z;
        cn.ninegame.b.a.a unused;
        cn.ninegame.b.a.a unused2;
        if (str == null || !str.startsWith("http")) {
            return false;
        }
        JSONObject a2 = l.a(str, true);
        if ("true".equals(cc.b(a2, "noHandle"))) {
            return false;
        }
        if (str.startsWith("http://web.9game.cn/share?") || str.startsWith("https://web.9game.cn/share?")) {
            String b2 = cc.b(a2, cn.ninegame.framework.a.b.KEY_PAGE_TYPE);
            String b3 = cc.b(a2, cn.ninegame.framework.a.b.KEY_TARGET);
            if (!TextUtils.isEmpty(b2)) {
                if (!TextUtils.isEmpty(b3)) {
                    if (b3.toUpperCase().startsWith(cn.ninegame.hybird.link.a.e.HTTP.name())) {
                        l.a(b2, a2, b3);
                    } else {
                        l.a(b2, -1, b3, a2);
                    }
                } else {
                    l.a(b2, a2, str);
                }
                z = true;
                if (z) {
                    if (str2 != null && str2.startsWith("http")) {
                        if (b(str2)) {
                            j b4 = str == null ? null : a().b((CharSequence) str);
                            if (j.a(b4)) {
                                Bundle bundle = new Bundle();
                                bundle.putString("target_id", b4.b);
                                cn.ninegame.genericframework.basic.g.a().b().a("download_biz_url_direction_download_from_remote", bundle);
                                return true;
                            }
                            if (j.a(str == null ? null : a().g(str))) {
                                o.g();
                            }
                            if (j.a(str == null ? null : a().f(str))) {
                                Bundle bundle2 = new Bundle();
                                bundle2.putString("forum_url", str);
                                bundle2.putInt("fid", cn.ninegame.modules.forum.b.b.e(str));
                                cn.ninegame.genericframework.basic.g.a().b().a("forum_open_post_list", bundle2);
                                return true;
                            }
                            if (j.a(str == null ? null : a().e(str))) {
                                Bundle bundle3 = new Bundle();
                                bundle3.putIntArray("open_thread_params", cn.ninegame.modules.forum.b.b.f(str));
                                bundle3.putString("forum_url", str);
                                bundle3.putBoolean("new_window", false);
                                cn.ninegame.genericframework.basic.g.a().b().a("forum_open_post_detail", bundle3);
                                return true;
                            }
                            if (!j.a(str == null ? null : a().h(str))) {
                                if (j.a(str == null ? null : a().j(str))) {
                                    cn.ninegame.library.util.g.b(str);
                                    return true;
                                }
                                if (j.a(str == null ? null : a().i(str))) {
                                    c(str);
                                    return true;
                                }
                                j a3 = str == null ? null : a().a((CharSequence) str);
                                if (j.a(a3)) {
                                    a(a3);
                                    return true;
                                }
                                j c = str == null ? null : a().c((CharSequence) str);
                                if (j.a(c)) {
                                    b(c);
                                    return true;
                                }
                                r1 = str != null ? a().d(str) : null;
                                if (j.a(r1)) {
                                    c(r1);
                                    return true;
                                }
                                return false;
                            }
                            cn.ninegame.sns.user.homepage.b.a(Long.parseLong(cc.b(l.a(str, false), "duid")), 3, null, null);
                            cn.ninegame.library.stat.a.j.b().a("detail_myhome", "tzxq_all", "", "");
                            return true;
                        }
                        return false;
                    }
                    if (str != null) {
                        h a4 = a();
                        j a5 = a4.a((CharSequence) str);
                        if (j.a(a5)) {
                            r1 = a5;
                        } else {
                            k kVar = a4.f1799a;
                            j a6 = a(kVar == null ? null : kVar.b, str, 2);
                            if (j.a(a6)) {
                                r1 = a6;
                            } else {
                                j b5 = a4.b((CharSequence) str);
                                if (j.a(b5)) {
                                    r1 = b5;
                                } else {
                                    j c2 = a4.c((CharSequence) str);
                                    if (j.a(c2)) {
                                        r1 = c2;
                                    } else {
                                        j d = a4.d(str);
                                        if (j.a(d)) {
                                            r1 = d;
                                        } else {
                                            k kVar2 = a4.f1799a;
                                            j a7 = a(kVar2 == null ? null : kVar2.f, str, 6);
                                            if (j.a(a7)) {
                                                r1 = a7;
                                            } else {
                                                k kVar3 = a4.f1799a;
                                                j a8 = a(kVar3 == null ? null : kVar3.g, str, 5);
                                                if (j.a(a8)) {
                                                    r1 = a8;
                                                } else {
                                                    j e = a4.e(str);
                                                    if (j.a(e)) {
                                                        r1 = e;
                                                    } else {
                                                        j f = a4.f(str);
                                                        if (j.a(f)) {
                                                            r1 = f;
                                                        } else {
                                                            j g = a4.g(str);
                                                            if (j.a(g)) {
                                                                r1 = g;
                                                            } else {
                                                                j h = a4.h(str);
                                                                if (j.a(h)) {
                                                                    r1 = h;
                                                                } else {
                                                                    j i = a4.i(str);
                                                                    if (j.a(i)) {
                                                                        r1 = i;
                                                                    } else {
                                                                        j j = a4.j(str);
                                                                        if (j.a(j)) {
                                                                            r1 = j;
                                                                        } else {
                                                                            k kVar4 = a4.f1799a;
                                                                            j a9 = a(kVar4 == null ? null : kVar4.n, str, 14);
                                                                            if (j.a(a9)) {
                                                                                r1 = a9;
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    if (j.a(r1)) {
                        if (r1.f1801a == 1) {
                            a(r1);
                            return true;
                        } else if (r1.f1801a == 2) {
                            StringBuilder sb = new StringBuilder();
                            unused = a.C0021a.f309a;
                            String a10 = cn.ninegame.b.a.g.a().a(sb.append(cn.ninegame.b.a.a.a()).append("/article/detail.html?id=").append(r1.b).toString());
                            Bundle bundle4 = new Bundle();
                            bundle4.putString("url", a10);
                            cn.ninegame.genericframework.basic.g.a().b().c(SpecialPage.class.getName(), bundle4);
                            cn.ninegame.library.stat.a.j.b().a("detail_news`wl`" + r1.b + "`");
                            return true;
                        } else if (r1.f1801a == 3) {
                            Bundle bundle5 = new Bundle();
                            bundle5.putString("target_id", r1.b);
                            cn.ninegame.genericframework.basic.g.a().b().a("download_biz_url_direction_download_from_local", bundle5);
                            return true;
                        } else if (r1.f1801a == 4) {
                            return b(r1);
                        } else {
                            if (r1.f1801a == 13) {
                                return c(r1);
                            }
                            if (r1.f1801a == 5) {
                                StringBuilder sb2 = new StringBuilder();
                                unused2 = a.C0021a.f309a;
                                String a11 = cn.ninegame.b.a.g.a().a(sb2.append(cn.ninegame.b.a.a.a()).append("/album/detail.html?columnId=").append(r1.b).toString());
                                Bundle bundle6 = new Bundle();
                                bundle6.putString("url", a11);
                                cn.ninegame.genericframework.basic.g.a().b().c(SpecialPage.class.getName(), bundle6);
                                l.j(SpecialPage.class.getName());
                                cn.ninegame.library.stat.a.j.b().a("detail_topic`wl`" + r1.b + "`");
                                return true;
                            } else if (r1.f1801a == 6) {
                                JSONObject jSONObject = new JSONObject();
                                cc.a(jSONObject, "gameId", (Object) r1.b);
                                l.a(cn.ninegame.framework.a.b.PAGE_TYPE_GAME_ARTICLE, 0, "/gift/list.html", jSONObject);
                                cn.ninegame.library.stat.a.j.b().a("detail_gift`wl`" + r1.b + "`");
                                return true;
                            } else if (r1.f1801a == 7) {
                                Bundle bundle7 = new Bundle();
                                bundle7.putIntArray("open_thread_params", cn.ninegame.modules.forum.b.b.f(str));
                                bundle7.putString("forum_url", str);
                                bundle7.putBoolean("new_window", false);
                                cn.ninegame.genericframework.basic.g.a().b().a("forum_open_post_detail", bundle7);
                                return true;
                            } else if (r1.f1801a == 8) {
                                Bundle bundle8 = new Bundle();
                                bundle8.putString("forum_url", str);
                                bundle8.putInt("fid", cn.ninegame.modules.forum.b.b.e(str));
                                cn.ninegame.genericframework.basic.g.a().b().a("forum_open_post_list", bundle8);
                                return true;
                            } else if (r1.f1801a == 12) {
                                cn.ninegame.library.util.g.b(str);
                                return true;
                            } else if (r1.f1801a == 11) {
                                return c(str);
                            } else {
                                if (r1.f1801a == 14) {
                                    String substring = str.substring(str.lastIndexOf("/") + 1);
                                    Bundle bundle9 = new Bundle();
                                    bundle9.putString("roomId", substring);
                                    bundle9.putString("url", str);
                                    bundle9.putInt("fromKey", 2);
                                    cn.ninegame.genericframework.basic.g.a().b().a("live_msg_monkey_open_room", bundle9);
                                    return true;
                                }
                            }
                        }
                    }
                    return false;
                }
                return true;
            }
        }
        z = false;
        if (z) {
        }
    }

    private static boolean b(String str) {
        if (str == null) {
            return false;
        }
        try {
            Uri parse = Uri.parse(str);
            String host = parse.getHost();
            String scheme = parse.getScheme();
            if (scheme == null || !scheme.equals("http") || host == null) {
                return false;
            }
            if (!host.equalsIgnoreCase("9game.cn") && !host.toLowerCase().endsWith(".9game.cn")) {
                if (!host.toLowerCase().endsWith("uae.uc.cn")) {
                    return false;
                }
            }
            return true;
        } catch (Exception e) {
            cn.ninegame.library.stat.b.b.a(e);
            return false;
        }
    }

    private static boolean c(String str) {
        long j;
        try {
            j = Long.parseLong(cc.b(l.a(str, true), "guildId"));
        } catch (Exception e) {
            cn.ninegame.library.stat.b.b.a(e);
            j = 0;
        }
        if (j > 0) {
            JSONObject jSONObject = new JSONObject();
            cc.b(jSONObject, "guildId", String.valueOf(j));
            l.a(cn.ninegame.framework.a.b.PAGE_TYPE_GUILD_HOME, jSONObject, "/guild/home.html");
            return true;
        }
        return false;
    }

    private static boolean a(j jVar) {
        cn.ninegame.genericframework.basic.g.a().b().c(GameDetailNativePage.class.getName(), cn.ninegame.gamemanager.game.gamedetail.c.a(TextUtils.isEmpty(jVar.b) ? 0 : Integer.parseInt(jVar.b)));
        cn.ninegame.library.stat.a.j.b().a("detail_game`wl`" + jVar.b + "`");
        return true;
    }

    private static boolean b(j jVar) {
        cn.ninegame.b.a.a unused;
        if (TextUtils.isEmpty(jVar.b)) {
            JSONObject jSONObject = new JSONObject();
            cc.a(jSONObject, "tabIndex", (Object) 1);
            l.a(cn.ninegame.framework.a.b.PAGE_TYPE_GIFT_INDEX, jSONObject, (String) null);
        } else {
            StringBuilder sb = new StringBuilder();
            unused = a.C0021a.f309a;
            String a2 = cn.ninegame.b.a.g.a().a(sb.append(cn.ninegame.b.a.a.a()).append("/gift/detail.html?sceneId=").append(jVar.b).toString());
            Bundle bundle = new Bundle();
            bundle.putString("url", a2);
            cn.ninegame.genericframework.basic.g.a().b().c(SpecialPage.class.getName(), bundle);
            cn.ninegame.library.stat.a.j.b().a("detail_gift`wl`" + jVar.b + "`");
        }
        return true;
    }

    private static boolean c(j jVar) {
        cn.ninegame.b.a.a unused;
        if (TextUtils.isEmpty(jVar.b)) {
            JSONObject jSONObject = new JSONObject();
            cc.a(jSONObject, "tabIndex", (Object) 1);
            l.a(cn.ninegame.framework.a.b.PAGE_TYPE_GIFT_INDEX, jSONObject, (String) null);
        } else {
            StringBuilder sb = new StringBuilder();
            unused = a.C0021a.f309a;
            String a2 = cn.ninegame.b.a.g.a().a(sb.append(cn.ninegame.b.a.a.a()).append("/guild/hall/detail.html?sceneId=").append(jVar.b).toString());
            Bundle bundle = new Bundle();
            bundle.putString("url", a2);
            cn.ninegame.genericframework.basic.g.a().b().c(SpecialDownloadPage.class.getName(), bundle);
            cn.ninegame.library.stat.a.j.b().a("detail_guild_gift`wl`" + jVar.b + "`");
        }
        return true;
    }

    private static k b() {
        k kVar = new k();
        try {
            Pattern compile = Pattern.compile("^http://(?:[\\w-]+\\.)?9game\\.cn/game/detail_(\\d+)\\.html.*$");
            kVar.f1802a = new ArrayList(1);
            kVar.f1802a.add(compile);
            Pattern compile2 = Pattern.compile("^http://(?:[\\w-]+\\.)?9game\\.cn/news/(\\d+)\\.html.*$");
            kVar.b = new ArrayList(1);
            kVar.b.add(compile2);
            kVar.c = new ArrayList(3);
            kVar.c.add(Pattern.compile("^http://(?:[\\w-]+\\.)?9game\\.cn/game/downs_(\\d+)_2\\.html.*$"));
            kVar.c.add(Pattern.compile("^http://(?:[\\w-]+\\.)?9game\\.cn/game/down_(\\d+)_(\\d+)\\.html.*$"));
            kVar.c.add(Pattern.compile("^http://[^/]*\\.9game\\.cn/game/downs?_(\\d+)_(\\d+)\\.html.*$"));
            kVar.d = new ArrayList(3);
            kVar.d.add(Pattern.compile("^http://(?:[\\w-]+\\.)?9game\\.cn/personal/(\\d+)\\.html.*$"));
            kVar.d.add(Pattern.compile("^http://ka\\.9game\\.cn/?$"));
            kVar.d.add(Pattern.compile("^http://.*\\.9game\\.cn/personal/detail\\.html\\?id=(\\d+).*$"));
            kVar.e = new ArrayList(2);
            kVar.e.add(Pattern.compile("^http://.*\\.9game\\.cn/guild/detail\\.html\\?id=(\\d+).*$"));
            kVar.e.add(Pattern.compile("^http://.*\\.9game\\.cn/guild/(\\d+)\\.html.*$"));
            kVar.f = new ArrayList(1);
            kVar.f.add(Pattern.compile("^http://ka\\.9game\\.cn/game/(\\d+)_-5_1\\.html.*$"));
            Pattern compile3 = Pattern.compile("^http://(?:[\\w-]+\\.)?9game\\.cn/page/android/quality/special\\.html\\?(?:.+=.+&)*colmid=(\\d+)(?:&.+=.+)*$");
            kVar.g = new ArrayList(1);
            kVar.g.add(compile3);
            kVar.i = new ArrayList(2);
            kVar.i.add(Pattern.compile("^http\\:/\\/[\\s\\S]+\\/forum-\\w+-\\w+\\.html[\\s\\S]*"));
            kVar.i.add(Pattern.compile("^http\\:\\/\\/[\\s\\S]+\\/forum\\.php\\?[\\s\\S]*mod=forumdisplay[\\s\\S]+fid=\\w+[\\s\\S]+[page=\\w+]*[\\s\\S]*"));
            kVar.h = new ArrayList(2);
            kVar.h.add(Pattern.compile("^http\\:\\/\\/[\\s\\S]+\\/thread-\\w+-\\w+-\\w+\\.html[\\s\\S]*"));
            kVar.h.add(Pattern.compile("^http\\:\\/\\/[\\s\\S]+\\/forum\\.php\\?[\\s\\S]*mod=viewthread[\\s\\S]+tid=\\w+[\\s\\S]+[page=\\w+]*[\\s\\S]*"));
            kVar.h.add(Pattern.compile("^http\\:\\/\\/[\\s\\S]+\\/forum\\.php\\?[\\s\\S]*mod=redirect[\\s\\S]+pid=\\w+[\\s\\S]+ptid=\\w+[\\s\\S]*"));
            kVar.h.add(Pattern.compile("^http\\:\\/\\/[\\s\\S]+\\/forum\\/thread\\?[\\s\\S]*tid=\\w+[\\s\\S]+pid=\\w+[\\s\\S]*"));
            kVar.j = new ArrayList(1);
            kVar.j.add(Pattern.compile("^http\\:\\/\\/[\\s\\S]+\\/message\\/notice\\?[\\s\\S]*type=2[\\s\\S]*"));
            kVar.k = new ArrayList(1);
            kVar.k.add(Pattern.compile("^http\\:\\/\\/[\\s\\S]+\\/space\\/viewspace\\?[\\s\\S]*duid=\\w+[\\s\\S]*"));
            kVar.l = new ArrayList(1);
            kVar.l.add(Pattern.compile("^http:\\/\\/fe\\.(?:assistant\\.)?9game\\.cn\\/modules\\/guild\\/guest.*$"));
            kVar.m = new ArrayList(1);
            kVar.m.add(Pattern.compile("^http://v.youku.com/v_show/[\\s\\S]*"));
            kVar.n = new ArrayList(1);
            kVar.n.add(Pattern.compile("^http\\:\\/\\/[\\s\\S]+\\/live\\/h5\\/\\d+$"));
        } catch (Exception e) {
            cn.ninegame.library.stat.b.b.a(e);
        }
        return kVar;
    }

    @Override
    public final void onNotify(r rVar) {
        HashMap hashMap;
        if (!"base_biz_flex_param_changes".equals(rVar.f1701a) || (hashMap = (HashMap) rVar.b.getSerializable("jsonObject")) == null || !hashMap.containsKey("url_direct_rule")) {
            return;
        }
        cn.ninegame.library.i.i.a((cn.ninegame.library.i.a.b.i) new i(this, cn.ninegame.library.i.a.b.j.OTHER, cn.ninegame.library.i.a.b.k.LOWER, (String) hashMap.get("url_direct_rule")));
    }
}