import typing

import android.content
import java
import java.chaquopy
import java.lang
import java.nio.channels
import java.util.concurrent

class Channel(java.nio.channels.Channel):
    def close(self) -> None: ...
    def getSelectResponse(self) -> java.chaquopy.JavaArrayJByte | None: ...
    def getSession(self) -> Session: ...
    def isBasicChannel(self) -> bool: ...
    def isOpen(self) -> bool: ...
    def selectNext(self) -> bool: ...
    def transmit(self, command: java.chaquopy.JavaArrayJByte, /) -> java.chaquopy.JavaArrayJByte: ...

class Reader(java.lang.Object):
    def closeSessions(self) -> None: ...
    def getName(self) -> str: ...
    def getSEService(self) -> SEService: ...
    def isSecureElementPresent(self) -> bool: ...
    def openSession(self) -> Session: ...

class SEService(java.lang.Object):
    ACTION_SECURE_ELEMENT_STATE_CHANGED: typing.ClassVar[str] = ...
    EXTRA_READER_NAME: typing.ClassVar[str] = ...
    EXTRA_READER_STATE: typing.ClassVar[str] = ...
    def __init__(self, context: android.content.Context, executor: java.util.concurrent.Executor, listener: SEService.OnConnectedListener, /) -> None: ...
    def getReaders(self) -> java.chaquopy.JavaArray[Reader]: ...
    def getUiccReader(self, slotNumber: int | java.jint | java.lang.Integer, /) -> Reader: ...
    def getVersion(self) -> str: ...
    def isConnected(self) -> bool: ...
    def shutdown(self) -> None: ...

    class OnConnectedListener(java.lang.Object):
        def onConnected(self) -> None: ...

class Session(java.lang.Object):
    def close(self) -> None: ...
    def closeChannels(self) -> None: ...
    def getATR(self) -> java.chaquopy.JavaArrayJByte | None: ...
    def getReader(self) -> Reader: ...
    def isClosed(self) -> bool: ...
    @typing.overload
    def openBasicChannel(self, aid: java.chaquopy.JavaArrayJByte, /) -> Channel | None: ...
    @typing.overload
    def openBasicChannel(self, aid: java.chaquopy.JavaArrayJByte, p2: int | java.jbyte | java.lang.Byte, /) -> Channel | None: ...
    @typing.overload
    def openLogicalChannel(self, aid: java.chaquopy.JavaArrayJByte, /) -> Channel | None: ...
    @typing.overload
    def openLogicalChannel(self, aid: java.chaquopy.JavaArrayJByte, p2: int | java.jbyte | java.lang.Byte, /) -> Channel | None: ...
