package e.c.d;

import com.seewo.sdk.internal.command.system.CmdExecShellCommand;
import com.seewo.sdk.internal.command.system.CmdPowerOff;
import com.seewo.sdk.internal.command.system.CmdReboot;
import com.seewo.sdk.internal.command.system.CmdResetSystem;
import com.seewo.sdk.internal.command.system.CmdRs232Data;
import com.seewo.sdk.internal.command.system.CmdSendKeyEvent;
import com.seewo.sdk.internal.command.system.CmdSystem;
import com.seewo.sdk.internal.command.system.SDKSystemType;
import com.seewo.sdk.internal.model.ResponseCallback;
import com.seewo.sdk.internal.model.SDKResponse;
import com.seewo.sdk.internal.response.common.RespBooleanResult;
import com.seewo.sdk.internal.response.system.RespShellCommand;
import com.seewo.sdk.model.SDKCallback;
import com.seewo.sdk.model.SDKShellResult;

/* JADX INFO: compiled from: SDKSystemHelper.java */
/* JADX INFO: loaded from: classes.dex */
public class n {
    public static final n a = new n();

    /* JADX INFO: compiled from: SDKSystemHelper.java */
    class a implements ResponseCallback {
        final /* synthetic */ SDKCallback.OnInitSystemFinished a;

        a(n nVar, SDKCallback.OnInitSystemFinished onInitSystemFinished) {
            this.a = onInitSystemFinished;
        }

        @Override // com.seewo.sdk.internal.model.ResponseCallback
        public void onCall(SDKResponse sDKResponse) {
            if (this.a != null) {
                this.a.onInitSystemFinished(((RespBooleanResult) e.c.d.y.c.e(sDKResponse, RespBooleanResult.class)).getResult());
            }
        }
    }

    public SDKShellResult a(String str) {
        return ((RespShellCommand) e.c.d.y.c.e(c.p().A(new CmdExecShellCommand(str)), RespShellCommand.class)).getShellResult();
    }

    public boolean b() {
        return e.c.d.y.c.b(c.p().A(CmdSystem.obtain(SDKSystemType.GET_FAKE_STANDBY_POWER_MODE_STATUS)));
    }

    public boolean c() {
        return e.c.d.y.c.b(c.p().A(CmdSystem.obtain(SDKSystemType.IS_FAKE_STANDBY_ALLOWED)));
    }

    public boolean d() {
        return e.c.d.y.c.b(c.p().A(CmdSystem.obtain(SDKSystemType.IS_IN_FAKE_POWER_OFF_MODE)));
    }

    public void e() {
        c.p().A(new CmdPowerOff(-1));
    }

    public void f(int i2) {
        c.p().A(new CmdPowerOff(i2));
    }

    public void g() {
        c.p().A(new CmdReboot());
    }

    public void h(SDKCallback.OnInitSystemFinished onInitSystemFinished) {
        i(true, onInitSystemFinished);
    }

    public void i(boolean z, SDKCallback.OnInitSystemFinished onInitSystemFinished) {
        c.p().v(new CmdResetSystem(z), new a(this, onInitSystemFinished));
    }

    public void j(int i2) {
        c.p().A(new CmdSendKeyEvent(i2));
    }

    public boolean k(byte[] bArr) {
        return e.c.d.y.c.b(c.p().A(CmdSystem.obtain(SDKSystemType.SEND_RS232_COMMAND_DATA, new CmdRs232Data(bArr))));
    }

    public void l(boolean z) {
        c.p().A(CmdSystem.obtain(SDKSystemType.SET_FAKE_STANDBY_POWER_MODE_STATUS, Boolean.valueOf(z)));
    }

    public void m(boolean z) {
        c.p().A(CmdSystem.obtain(SDKSystemType.SET_USB_DISK_ENABLED, Boolean.valueOf(z)));
    }
}
