android 获取用户名和密码,如何以编程方式启动ssh sever android,以及如何获取连接到设备的用户名和密码...

开发者正在创建类似sshdroid的应用,目标是实现从PC到Android的SSH连接。已尝试JSCH库(适用于Android到PC)和其他库如ConnectBot、SSHelper和SSHJ,但未达到预期效果。遇到的问题包括依赖文件冲突导致的构建错误。解决方案建议在应用的build.gradle文件中排除'META-INF/DEPENDENCIES'以解决冲突。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我正在开发像sshdroid的应用程序.

我想在Android OS上打开ssh连接,并且我想从PC连接应用程序.

我使用了JSCH库,但是该库用于将android连接到pc.

我的要求是PC到Android,

任何人都知道任何lib或任何源代码都可用.

我已经尝试过了

connectbot.(it is unmaintained lib).

JSCH lib (it is connect android to pc).

SSHelper_source (not help to me).

SSHJ ( tried not helpful).

解决方法:

如果收到此错误

Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. >

com.android.build.api.transform.TransformException:

com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/DEPENDENCIES

File1: /home/yogesh/.gradle/caches/modules-2/files-2.1/org.apache.mina/mina-core/2.0.2/‌​e365a84cc76a64bf1508af83da0ea852c35e79c8/mina-core-2.0.2.jar

File2: /home/yogesh/.gradle/caches/modules-2/files-2.1/org.apache.sshd/sshd-core/0.6.0/‌​2b9a119dd77a1decec78b0c511ba400c8655e96e/sshd-core-0.6.0.jar

然后尝试在您的应用程序build.gradle中使用它来解决上述异常.

apply plugin: 'com.android.model.application'

model {

android {

...

}

android.packagingOptions {

exclude 'META-INF/DEPENDENCIES'

}

}

标签:jsch,ssh,android

来源: https://codeday.me/bug/20191026/1939605.html

freadahead.c: In function 'freadahead': freadahead.c:92:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib." 92 | #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib." | ^~~~~ make[7]: *** [Makefile:1910: freadahead.o] Error 1 make[7]: Leaving directory '/home/wk/lede_AR9331_zhuotk_source_64bit/build_dir/host/m4-1.4.18/lib' make[6]: *** [Makefile:1674: all] Error 2 make[6]: Leaving directory '/home/wk/lede_AR9331_zhuotk_source_64bit/build_dir/host/m4-1.4.18/lib' make[5]: *** [Makefile:1572: all-recursive] Error 1 make[5]: Leaving directory '/home/wk/lede_AR9331_zhuotk_source_64bit/build_dir/host/m4-1.4.18' make[4]: *** [Makefile:1528: all] Error 2 make[4]: Leaving directory '/home/wk/lede_AR9331_zhuotk_source_64bit/build_dir/host/m4-1.4.18' make[3]: *** [Makefile:29: /home/wk/lede_AR9331_zhuotk_source_64bit/build_dir/host/m4-1.4.18/.built] Error 2 make[3]: Leaving directory '/home/wk/lede_AR9331_zhuotk_source_64bit/tools/m4' make[2]: *** [tools/Makefile:150: tools/m4/compile] Error 2 make[2]: Leaving directory '/home/wk/lede_AR9331_zhuotk_source_64bit' make[1]: *** [tools/Makefile:146: /home/wk/lede_AR9331_zhuotk_source_64bit/staging_dir/target-mips_24kc_musl/stamp/.tools_compile_yynyyyyynyyyyynyynnyyyyyyyyyyyyyyyyyyyynyynynyyyynny] Error 2 make[1]: Leaving directory '/home/wk/lede_AR9331_zhuotk_source_64bit' make: *** [/home/wk/lede_AR9331_zhuotk_source_64bit/include/toplevel.mk:209:world] 错误 2
最新发布
04-04
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值