import typing

import java
import java.chaquopy
import java.io
import java.lang
import java.net
import java.nio
import java.util

class ApplicationRuntime(java.lang.Object):
    @staticmethod
    def getBaseApkOptimizationInfo() -> DexFile.OptimizationInfo: ...

class BaseDexClassLoader(java.lang.ClassLoader):
    def __init__(self, dexPath: str | java.lang.String, optimizedDirectory: java.io.File, librarySearchPath: str | java.lang.String, parent: java.lang.ClassLoader, /) -> None: ...
    def findClass(self, name: str | java.lang.String, /) -> typing.Type[java.lang.Object]: ...
    def findLibrary(self, name: str | java.lang.String, /) -> str: ...
    def findResource(self, name: str | java.lang.String, /) -> java.net.URL: ...
    def findResources(self, name: str | java.lang.String, /) -> java.util.Enumeration[java.net.URL]: ...
    def getPackage(self, name: str | java.lang.String, /) -> java.lang.Package: ...
    def toString(self) -> str: ...

class DelegateLastClassLoader(PathClassLoader):
    @typing.overload
    def __init__(self, dexPath: str | java.lang.String, parent: java.lang.ClassLoader, /) -> None: ...
    @typing.overload
    def __init__(self, dexPath: str | java.lang.String, librarySearchPath: str | java.lang.String, parent: java.lang.ClassLoader, /) -> None: ...
    @typing.overload
    def __init__(self, dexPath: str | java.lang.String, librarySearchPath: str | java.lang.String, parent: java.lang.ClassLoader, delegateResourceLoading: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    def getResource(self, name: str | java.lang.String, /) -> java.net.URL: ...
    def getResources(self, name: str | java.lang.String, /) -> java.util.Enumeration[java.net.URL]: ...
    def loadClass(self, name: str | java.lang.String, resolve: bool | java.jboolean | java.lang.Boolean, /) -> typing.Type[java.lang.Object]: ...

class DexClassLoader(BaseDexClassLoader):
    def __init__(self, dexPath: str | java.lang.String, optimizedDirectory: str | java.lang.String, librarySearchPath: str | java.lang.String, parent: java.lang.ClassLoader, /) -> None: ...

class DexFile(java.lang.Object):
    @typing.overload
    def __init__(self, file: java.io.File, /) -> None: ...
    @typing.overload
    def __init__(self, fileName: str | java.lang.String, /) -> None: ...
    def close(self) -> None: ...
    def entries(self) -> java.util.Enumeration[java.lang.String]: ...
    def finalize(self) -> None: ...
    def getName(self) -> str: ...
    @staticmethod
    def isDexOptNeeded(arg1: str | java.lang.String, /) -> bool: ...
    def loadClass(self, name: str | java.lang.String, loader: java.lang.ClassLoader, /) -> typing.Type: ...
    @staticmethod
    def loadDex(sourcePathName: str | java.lang.String, outputPathName: str | java.lang.String, flags: int | java.jint | java.lang.Integer, /) -> DexFile: ...
    def toString(self) -> str: ...

    class OptimizationInfo(java.lang.Object):
        def isFullyCompiled(self) -> bool: ...
        def isOptimized(self) -> bool: ...
        def isVerified(self) -> bool: ...

class InMemoryDexClassLoader(BaseDexClassLoader):
    @typing.overload
    def __init__(self, dexBuffer: java.nio.ByteBuffer, parent: java.lang.ClassLoader, /) -> None: ...
    @typing.overload
    def __init__(self, dexBuffers: java.chaquopy.JavaArray[java.nio.ByteBuffer], parent: java.lang.ClassLoader, /) -> None: ...
    @typing.overload
    def __init__(self, dexBuffers: java.chaquopy.JavaArray[java.nio.ByteBuffer], librarySearchPath: str | java.lang.String, parent: java.lang.ClassLoader, /) -> None: ...

class PathClassLoader(BaseDexClassLoader):
    @typing.overload
    def __init__(self, dexPath: str | java.lang.String, parent: java.lang.ClassLoader, /) -> None: ...
    @typing.overload
    def __init__(self, dexPath: str | java.lang.String, librarySearchPath: str | java.lang.String, parent: java.lang.ClassLoader, /) -> None: ...

class ZipPathValidator(java.lang.Object):
    @staticmethod
    def clearCallback() -> None: ...
    @staticmethod
    def setCallback(callback: ZipPathValidator.Callback, /) -> None: ...

    class Callback(java.lang.Object):
        def onZipEntryAccess(self, path: str | java.lang.String, /) -> None: ...
