mwiede / jsch

fork of the popular jsch library
Other
756 stars 143 forks source link

Android build with R8 Missing class warnings #633

Open KimiChiu opened 2 months ago

KimiChiu commented 2 months ago
{"kind":"warning","text":"Missing class com.sun.jna.Memory (referenced from: com.sun.jna.platform.win32.WinUser$COPYDATASTRUCT com.jcraft.jsch.PageantConnector.createCDS(java.lang.String))
Missing class com.sun.jna.Pointer (referenced from: com.sun.jna.platform.win32.WinUser$COPYDATASTRUCT com.jcraft.jsch.PageantConnector.createCDS(java.lang.String) and 2 other contexts)
Missing class com.sun.jna.platform.win32.BaseTSD$ULONG_PTR (referenced from: com.sun.jna.platform.win32.WinUser$COPYDATASTRUCT com.jcraft.jsch.PageantConnector.createCDS(java.lang.String) and 1 other context)
Missing class com.sun.jna.platform.win32.Kernel32 (referenced from: com.sun.jna.platform.win32.Kernel32 com.jcraft.jsch.PageantConnector.kernel32 and 2 other contexts)
Missing class com.sun.jna.platform.win32.User32 (referenced from: com.sun.jna.platform.win32.User32 com.jcraft.jsch.PageantConnector.user32 and 4 other contexts)
Missing class com.sun.jna.platform.win32.WinBase$SECURITY_ATTRIBUTES (referenced from: void com.jcraft.jsch.PageantConnector.query(com.jcraft.jsch.Buffer))
Missing class com.sun.jna.platform.win32.WinBase (referenced from: void com.jcraft.jsch.PageantConnector.query(com.jcraft.jsch.Buffer))
Missing class com.sun.jna.platform.win32.WinDef$HWND (referenced from: boolean com.jcraft.jsch.PageantConnector.isAvailable() and 2 other contexts)
Missing class com.sun.jna.platform.win32.WinDef$LPARAM (referenced from: long com.jcraft.jsch.PageantConnector.sendMessage(com.sun.jna.platform.win32.WinDef$HWND, com.sun.jna.platform.win32.WinUser$COPYDATASTRUCT))
Missing class com.sun.jna.platform.win32.WinDef$LRESULT (referenced from: long com.jcraft.jsch.PageantConnector.sendMessage(com.sun.jna.platform.win32.WinDef$HWND, com.sun.jna.platform.win32.WinUser$COPYDATASTRUCT))
Missing class com.sun.jna.platform.win32.WinDef$WPARAM (referenced from: long com.jcraft.jsch.PageantConnector.sendMessage(com.sun.jna.platform.win32.WinDef$HWND, com.sun.jna.platform.win32.WinUser$COPYDATASTRUCT))
Missing class com.sun.jna.platform.win32.WinNT$HANDLE (referenced from: void com.jcraft.jsch.PageantConnector.query(com.jcraft.jsch.Buffer))
Missing class com.sun.jna.platform.win32.WinUser$COPYDATASTRUCT (referenced from: com.sun.jna.platform.win32.WinUser$COPYDATASTRUCT com.jcraft.jsch.PageantConnector.createCDS(java.lang.String) and 2 other contexts)
Missing class org.bouncycastle.crypto.BlockCipher (referenced from: void com.jcraft.jsch.bc.CAST128CBC.init(int, byte[], byte[]) and 4 other contexts)
Missing class org.bouncycastle.crypto.BufferedBlockCipher (referenced from: org.bouncycastle.crypto.BufferedBlockCipher com.jcraft.jsch.bc.CAST128CBC.cipher and 8 other contexts)
Missing class org.bouncycastle.crypto.CipherParameters (referenced from: void com.jcraft.jsch.bc.CAST128CBC.init(int, byte[], byte[]) and 8 other contexts)
Missing class org.bouncycastle.crypto.DefaultBufferedBlockCipher (referenced from: void com.jcraft.jsch.bc.CAST128CBC.init(int, byte[], byte[]) and 2 other contexts)
Missing class org.bouncycastle.crypto.Digest (referenced from: org.bouncycastle.crypto.Digest com.jcraft.jsch.bc.HMAC.digest and 1 other context)
Missing class org.bouncycastle.crypto.Signer (referenced from: org.bouncycastle.crypto.Signer com.jcraft.jsch.bc.SignatureEdDSA.signature and 5 other contexts)
Missing class org.bouncycastle.crypto.digests.RIPEMD160Digest (referenced from: void com.jcraft.jsch.bc.HMACRIPEMD160.<init>())
Missing class org.bouncycastle.crypto.engines.CAST5Engine (referenced from: void com.jcraft.jsch.bc.CAST128CBC.init(int, byte[], byte[]) and 1 other context)
Missing class org.bouncycastle.crypto.engines.ChaChaEngine (referenced from: org.bouncycastle.crypto.engines.ChaChaEngine com.jcraft.jsch.bc.ChaCha20Poly1305.header_cipher and 5 other contexts)
Missing class org.bouncycastle.crypto.engines.SEEDEngine (referenced from: void com.jcraft.jsch.bc.SEEDCBC.init(int, byte[], byte[]))
Missing class org.bouncycastle.crypto.engines.TwofishEngine (referenced from: void com.jcraft.jsch.bc.TwofishCBC.init(int, byte[], byte[]) and 1 other context)
Missing class org.bouncycastle.crypto.generators.Argon2BytesGenerator (referenced from: org.bouncycastle.crypto.generators.Argon2BytesGenerator com.jcraft.jsch.bc.Argon2.generator and 2 other contexts)
Missing class org.bouncycastle.crypto.generators.SCrypt (referenced from: byte[] com.jcraft.jsch.bc.SCrypt.getKey(byte[], int) and 1 other context)
Missing class org.bouncycastle.crypto.macs.HMac (referenced from: org.bouncycastle.crypto.macs.HMac com.jcraft.jsch.bc.HMAC.mac and 3 other contexts)
Missing class org.bouncycastle.crypto.macs.Poly1305 (referenced from: org.bouncycastle.crypto.macs.Poly1305 com.jcraft.jsch.bc.ChaCha20Poly1305.poly1305 and 3 other contexts)
Missing class org.bouncycastle.crypto.modes.CBCBlockCipher (referenced from: void com.jcraft.jsch.bc.CAST128CBC.init(int, byte[], byte[]) and 2 other contexts)
Missing class org.bouncycastle.crypto.modes.CBCModeCipher (referenced from: void com.jcraft.jsch.bc.CAST128CBC.init(int, byte[], byte[]) and 2 other contexts)
Missing class org.bouncycastle.crypto.modes.CTRModeCipher (referenced from: org.bouncycastle.crypto.modes.CTRModeCipher com.jcraft.jsch.bc.CAST128CTR.cipher and 5 other contexts)
Missing class org.bouncycastle.crypto.modes.SICBlockCipher (referenced from: void com.jcraft.jsch.bc.CAST128CTR.init(int, byte[], byte[]) and 1 other context)
Missing class org.bouncycastle.crypto.params.Argon2Parameters$Builder (referenced from: void com.jcraft.jsch.bc.Argon2.init(byte[], int, int, byte[], byte[], int, int, int))
Missing class org.bouncycastle.crypto.params.Argon2Parameters (referenced from: void com.jcraft.jsch.bc.Argon2.init(byte[], int, int, byte[], byte[], int, int, int))
Missing class org.bouncycastle.crypto.params.Ed25519PrivateKeyParameters (referenced from: void com.jcraft.jsch.bc.KeyPairGenEdDSA.init(java.lang.String, int) and 2 other contexts)
Missing class org.bouncycastle.crypto.params.Ed25519PublicKeyParameters (referenced from: void com.jcraft.jsch.bc.KeyPairGenEdDSA.init(java.lang.String, int) and 2 other contexts)
Missing class org.bouncycastle.crypto.params.Ed448PrivateKeyParameters (referenced from: void com.jcraft.jsch.bc.KeyPairGenEdDSA.init(java.lang.String, int) and 2 other contexts)
Missing class org.bouncycastle.crypto.params.Ed448PublicKeyParameters (referenced from: void com.jcraft.jsch.bc.KeyPairGenEdDSA.init(java.lang.String, int) and 2 other contexts)
Missing class org.bouncycastle.crypto.params.KeyParameter (referenced from: org.bouncycastle.crypto.params.KeyParameter com.jcraft.jsch.bc.ChaCha20Poly1305.K_1_spec and 9 other contexts)
Missing class org.bouncycastle.crypto.params.ParametersWithIV (referenced from: void com.jcraft.jsch.bc.CAST128CBC.init(int, byte[], byte[]) and 5 other contexts)
Missing class org.bouncycastle.crypto.params.X25519PrivateKeyParameters (referenced from: byte[] com.jcraft.jsch.bc.XDH.getSecret(byte[]) and 1 other context)
Missing class org.bouncycastle.crypto.params.X25519PublicKeyParameters (referenced from: byte[] com.jcraft.jsch.bc.XDH.getSecret(byte[]) and 1 other context)
Missing class org.bouncycastle.crypto.params.X448PrivateKeyParameters (referenced from: byte[] com.jcraft.jsch.bc.XDH.getSecret(byte[]) and 1 other context)
Missing class org.bouncycastle.crypto.params.X448PublicKeyParameters (referenced from: byte[] com.jcraft.jsch.bc.XDH.getSecret(byte[]) and 1 other context)
Missing class org.bouncycastle.crypto.signers.Ed25519Signer (referenced from: void com.jcraft.jsch.bc.SignatureEdDSA.init())
Missing class org.bouncycastle.crypto.signers.Ed448Signer (referenced from: void com.jcraft.jsch.bc.SignatureEdDSA.init())
Missing class org.newsclub.net.unix.AFUNIXServerSocketChannel (referenced from: java.nio.channels.ServerSocketChannel com.jcraft.jsch.JUnixSocketFactory.bind(java.nio.file.Path))
Missing class org.newsclub.net.unix.AFUNIXSocketAddress (referenced from: java.nio.channels.ServerSocketChannel com.jcraft.jsch.JUnixSocketFactory.bind(java.nio.file.Path) and 1 other context)
Missing class org.newsclub.net.unix.AFUNIXSocketChannel (referenced from: void com.jcraft.jsch.JUnixSocketFactory.<init>() and 1 other context)","sources":[{}],"tool":"R8"}

But there's no any issues when running on Android devices. Should I ignore these warnings? Is it necessary to add these two libraries?

implementation 'org.bouncycastle:bcprov-jdk18on:1.77'
implementation 'com.kohlschutter.junixsocket:junixsocket-core:2.1.1'
norrisjeremy commented 2 months ago

Hi @KimiChiu,

I'm not especially familiar with Android development, but all these missing classes are for optional features in JSch. I would not expect them to be required unless you use a feature in JSch that would require them:

Thanks, Jeremy