Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

以访客或匿名的形式访问Windows共享报错,Linux没问题 #1382

Open
MoYiha opened this issue Jan 24, 2025 · 2 comments
Open

以访客或匿名的形式访问Windows共享报错,Linux没问题 #1382

MoYiha opened this issue Jan 24, 2025 · 2 comments

Comments

@MoYiha
Copy link

MoYiha commented Jan 24, 2025

添加SMB服务器时通过自动搜索选择Windows服务器后验证方式选择访客或匿名.

报错:

Image

@MoYiha
Copy link
Author

MoYiha commented Jan 24, 2025

跟这个issue一样,是第三方库的问题.

@MoYiha
Copy link
Author

MoYiha commented Jan 25, 2025

解决办法:
升级库到最新版:0.14.0

implementation ('com.hierynomus:smbj:0.14.0') { // org.bouncycastle:bcprov-jdk15on uses bytecode version unsupported by Jetifier, so use // org.bouncycastle:bcprov-jdk15to18 instead. exclude group: 'org.bouncycastle', module: 'bcprov-jdk15on' exclude group: 'org.bouncycastle', module: 'bcprov-jdk18on' // 增加此行,不然编译失败 }

implementation ('com.rapid7.client:dcerpc:0.12.1') { // 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' exclude group: 'org.bouncycastle', module: 'bcprov-jdk18on' // 增加此行,不然编译失败 }

app/src/main/java/me/zhanghai/android/files/provider/smb/client/FileByteChannel.kt
source.position(sourcePosition + bytesWritten)
改为
source.position((sourcePosition + bytesWritten).toInt())

由于我不懂安卓开发,更加不知道升级库是否会带来其他问题,不敢提交PR.
目前测试下来我需要的功能工作正常,这个文件管理器对我来说很完美了.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant