package com.tencent.mm.plugin.appbrand.jsapi.f;

import android.content.Intent;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.kernel.g;
import com.tencent.mm.plugin.appbrand.jsapi.m;
import com.tencent.mm.plugin.appbrand.jsapi.n;
import com.tencent.mm.plugin.appbrand.page.u;
import com.tencent.mm.plugin.appbrand.q;
import com.tencent.mm.plugin.luckymoney.appbrand.a;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.ui.MMActivity;
import java.util.HashMap;
import org.json.JSONObject;

public class a$a extends n {
    public a$a(m mVar, q qVar, u uVar, JSONObject jSONObject, int i) {
        super(mVar, qVar, uVar, jSONObject, i);
    }

    public final boolean a(MMActivity mMActivity, JSONObject jSONObject, int i) {
        AppMethodBeat.i(131115);
        String appId = xT().getAppId();
        String optString = jSONObject.optString("redPacketId", null);
        if (bo.isNullOrNil(appId) || bo.isNullOrNil(optString)) {
            ab.i("MicroMsg.JsApiOpenRedPacket", "GetLuckMoneyRequest.launch appId = [%s] sendId = [%s]", new Object[]{appId, optString});
            AppMethodBeat.o(131115);
            return false;
        }
        ((a) g.K(a.class)).a(mMActivity, optString, appId, i);
        AppMethodBeat.o(131115);
        return true;
    }

    public final void C(Intent intent) {
        AppMethodBeat.i(131116);
        ab.i("MicroMsg.JsApiOpenRedPacket", "GetLuckMoneyRequest.onResult");
        HashMap hashMap = new HashMap();
        hashMap.put("errCode", Integer.valueOf(0));
        w(hashMap);
        AppMethodBeat.o(131116);
    }

    public final void onError(int i, String str) {
        AppMethodBeat.i(131117);
        ab.i("MicroMsg.JsApiOpenRedPacket", "onError errCode: %d,errMsg: %s", new Object[]{Integer.valueOf(i), str});
        HashMap hashMap = new HashMap();
        hashMap.put("errCode", Integer.valueOf(i));
        k(str, hashMap);
        AppMethodBeat.o(131117);
    }
}
