package com.ss.android.ugc.aweme.fe.method.incentive;

import X.0CB;
import X.0CH;
import X.6Is;
import X.C6104FIu;
import X.FJM;
import X.KKi;
import X.SfZ;
import android.app.Activity;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.fe.base.BaseCommonJavaMethod;
import com.ss.android.ugc.aweme.specact.SpecActServiceImpl;
import kotlin.h.b.n;
import org.json.JSONObject;

public final class CheckCalendarExistMethod extends BaseCommonJavaMethod implements 6Is {
    public static final FJM LIZ = new FJM((byte) 0);

    static {
        Covode.recordClassIndex(76261);
    }

    public CheckCalendarExistMethod(byte b) {
        this();
    }

    public final void onStateChanged(0CH r1, 0CB r2) {
        CheckCalendarExistMethod.super.onStateChanged(r1, r2);
    }

    public /* synthetic */ CheckCalendarExistMethod() {
        this((KKi) null);
    }

    public CheckCalendarExistMethod(KKi kKi) {
        super(kKi);
    }

    public final void handle(JSONObject jSONObject, C6104FIu fIu) {
        String optString;
        Activity LJIIIZ = SfZ.LJIJ.LJIIIZ();
        if (LJIIIZ != null) {
            if (jSONObject == null) {
                optString = "";
            } else {
                optString = jSONObject.optString("identifier");
                n.LIZIZ(optString, "");
            }
            int i = 1;
            if (optString.length() != 0) {
                if (!SpecActServiceImpl.LJIJJ().LIZ(LJIIIZ, optString)) {
                    i = 2;
                }
                if (fIu != null) {
                    fIu.LIZ("", i, "");
                }
            } else if (fIu != null) {
                fIu.LIZ(-1, "Parameter invalid");
            }
        }
    }
}
