diff --git a/app/build.gradle b/app/build.gradle index 4c02e423e..ed3a6ada8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -148,8 +148,10 @@ dependencies { implementation 'com.drakeet.drawer:drawer:1.0.3' implementation 'com.h6ah4i.android.materialshadowninepatch:materialshadowninepatch:1.0.0' implementation 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:1.0.0' - implementation ('com.hierynomus:smbj:0.13.0') { - exclude group: 'org.bouncycastle', module: 'bcprov-jdk18on' + implementation ('com.hierynomus:smbj:0.11.5') { + // org.bouncycastle:bcprov-jdk15on uses bytecode version unsupported by Jetifier, so use + // org.bouncycastle:bcprov-jdk15to18 instead. + exclude group: 'org.bouncycastle', module: 'bcprov-jdk15on' } // SSHJ 0.36.0 requires Java 8. //noinspection GradleDependency @@ -162,8 +164,6 @@ dependencies { // SMBJ-RPC depends on the JRE flavor of Guava which targets Java 8. exclude group: 'com.google.guava', module: 'guava' exclude group: 'org.bouncycastle', module: 'bcprov-jdk15on' - // This comes from the dependency on SMBJ. - exclude group: 'org.bouncycastle', module: 'bcprov-jdk18on' } implementation 'com.google.guava:guava:33.0.0-android' // Guava conflicts with com.google.guava:listenablefuture:1.0 pulled in by AndroidX Core diff --git a/app/src/main/java/me/zhanghai/android/files/provider/smb/client/FileByteChannel.kt b/app/src/main/java/me/zhanghai/android/files/provider/smb/client/FileByteChannel.kt index fbf576117..ab7339881 100644 --- a/app/src/main/java/me/zhanghai/android/files/provider/smb/client/FileByteChannel.kt +++ b/app/src/main/java/me/zhanghai/android/files/provider/smb/client/FileByteChannel.kt @@ -62,7 +62,7 @@ class FileByteChannel( override fun onWrite(position: Long, source: ByteBuffer) { val sourcePosition = source.position() val bytesWritten = try { - file.write(ByteBufferChunkProvider(source, position)).toInt() + file.write(ByteBufferChunkProvider(source, position)) } catch (e: SMBRuntimeException) { throw e.toIOException() }