package com.tencent.mm.plugin.game;

import android.content.Intent;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.g.a.lw;
import com.tencent.mm.plugin.game.e.b;
import com.tencent.mm.plugin.game.ui.GameCenterUI;
import com.tencent.mm.plugin.game.ui.GameDetailUI;
import com.tencent.mm.plugin.game.ui.GameLibraryUI;
import com.tencent.mm.plugin.game.ui.GameMessageUI;
import com.tencent.mm.sdk.b.c;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.ytcommon.BuildConfig;
import org.json.JSONException;
import org.json.JSONObject;

class c$14 extends c<lw> {
    final /* synthetic */ c mTg;

    c$14(c cVar) {
        this.mTg = cVar;
        AppMethodBeat.i(111157);
        this.xxI = lw.class.getName().hashCode();
        AppMethodBeat.o(111157);
    }

    private static boolean a(lw lwVar) {
        int i;
        AppMethodBeat.i(111158);
        String str = BuildConfig.FLAVOR;
        try {
            JSONObject jSONObject = new JSONObject(lwVar.cHK.extraInfo);
            str = jSONObject.optString("appId");
            i = bo.getInt(jSONObject.optString("ssid"), 0);
        } catch (JSONException e) {
            ab.e("MicroMsg.OpenGameJsapiProcessor", "JSONException : %s", new Object[]{e.getMessage()});
            i = 0;
        } catch (Exception e2) {
            ab.e("MicroMsg.OpenGameJsapiProcessor", "JSONException : %s", new Object[]{e2.getMessage()});
            i = 0;
        }
        Intent intent = new Intent();
        switch (lwVar.cHK.cHL) {
            case 0:
                intent.setClass(lwVar.cHK.context, GameCenterUI.class);
                if (lwVar.cHK.jumpType == 1) {
                    intent.putExtra("jump_find_more_friends", "jump_find_more_friends");
                }
                intent.putExtra("game_report_from_scene", 5);
                lwVar.cHK.context.startActivity(intent);
                b.a(lwVar.cHK.context, 5, 5, 1, 6, i, null);
                break;
            case 1:
                intent.setClass(lwVar.cHK.context, GameLibraryUI.class);
                if (lwVar.cHK.jumpType == 1) {
                    intent.putExtra("jump_game_center", "jump_game_center");
                }
                intent.putExtra("game_report_from_scene", 5);
                lwVar.cHK.context.startActivity(intent);
                b.a(lwVar.cHK.context, 5, 5, 1, 6, i, null);
                break;
            case 2:
                if (!bo.isNullOrNil(str)) {
                    intent.setClass(lwVar.cHK.context, GameDetailUI.class);
                    intent.putExtra("game_app_id", str);
                    if (lwVar.cHK.jumpType == 1) {
                        intent.putExtra("jump_game_center", "jump_game_center");
                    }
                    intent.putExtra("game_report_from_scene", 5);
                    lwVar.cHK.context.startActivity(intent);
                    b.a(lwVar.cHK.context, 5, 5, 1, 6, i, null);
                    break;
                }
                break;
            case 3:
                intent.setClass(lwVar.cHK.context, GameMessageUI.class);
                intent.putExtra("game_report_from_scene", 5);
                lwVar.cHK.context.startActivity(intent);
                b.a(lwVar.cHK.context, 5, 5, 1, 6, i, null);
                break;
        }
        AppMethodBeat.o(111158);
        return false;
    }
}
