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

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.page.u;
import com.tencent.mm.plugin.appbrand.r.m;
import com.tencent.mm.plugin.appbrand.widget.input.d.h;
import org.json.JSONException;
import org.json.JSONObject;

public class i extends a<h> {
    private static final int CTRL_INDEX = 112;
    private static final String NAME = "updateInput";

    public void a(u uVar, JSONObject jSONObject, int i) {
        AppMethodBeat.i(123562);
        h hVar = new h();
        if (a(hVar, jSONObject, uVar, i)) {
            try {
                int i2 = jSONObject.getInt("inputId");
                if (hVar.jjp != null && hVar.jjp.intValue() < 0) {
                    hVar.jjp = Integer.valueOf(0);
                }
                if (hVar.jjq != null && hVar.jjq.intValue() < 0) {
                    hVar.jjq = Integer.valueOf(0);
                }
                String optString = jSONObject.optString("data", null);
                if (optString != null) {
                    a.S(i2, optString);
                }
                m.runOnUiThread(new 1(this, uVar, i2, hVar, i));
                AppMethodBeat.o(123562);
                return;
            } catch (JSONException e) {
                uVar.M(i, j("fail:invalid data", null));
                AppMethodBeat.o(123562);
                return;
            }
        }
        AppMethodBeat.o(123562);
    }

    /* Access modifiers changed, original: protected|final */
    public final boolean aDx() {
        return true;
    }
}
