package com.ss.android.ugc.aweme.bullet.bridge.common;

import X.0CB;
import X.0CH;
import X.6Is;
import X.9qj;
import X.AnonymousClass2OM;
import X.AnonymousClass4UQ;
import X.C10772kf;
import X.C459840w;
import X.KT7;
import X.M12;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import com.bytedance.bpea.basics.PrivacyCert;
import com.bytedance.bpea.store.policy.PrivacyPolicyStore;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.bullet.bridge.BaseBridgeMethod;
import org.json.JSONObject;

public final class CopyContentMethod extends BaseBridgeMethod implements 6Is {
    public final String LIZIZ = "copyContent";

    static {
        Covode.recordClassIndex(54991);
    }

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

    public final String LIZLLL() {
        return this.LIZIZ;
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public CopyContentMethod(KT7 kt7) {
        super(kt7);
        M12.LIZ(kt7);
    }

    public final void LIZ(JSONObject jSONObject, AnonymousClass4UQ r11) {
        M12.LIZ(jSONObject, r11);
        Context LJ = LJ();
        if (LJ != null) {
            String optString = jSONObject.optString("content");
            String optString2 = jSONObject.optString("toastMsg");
            if (optString == null || optString.length() == 0 || optString2 == null || optString2.length() == 0) {
                r11.LIZ(-1, "content or toastMsg is empty");
                return;
            }
            try {
                PrivacyCert.Builder with = PrivacyCert.Builder.Companion.with("bpea-217");
                with.usage("");
                with.tag("CopyContentMethod_handle");
                with.policies(new 9qj[]{PrivacyPolicyStore.getClipboardPrivacyPolicy()});
                AnonymousClass2OM.LIZ(optString, optString, LJ, with.build());
            } catch (Exception e) {
                C10772kf.LIZ("", e);
            }
            new Handler(Looper.getMainLooper()).post(new C459840w(LJ, optString2));
            r11.LIZ((Object) null);
        }
    }
}
