java - 如何使用 android studio Java 获得 ssh 会话?
问题描述
我正在开发一个需要启动 ssh 会话和运行命令的 android 应用程序,我听说过 JSH,它似乎正是我需要的,但不确定如何与 android 一起使用它工作室 - 任何人都可以帮忙吗?
提供更多上下文 - 我的应用程序是一个指纹解锁客户端,旨在与 Linux 桌面一起使用
我的相关代码是这样的:
Button authenticate = findViewById(R.id.authenticate);
final MainActivity activity = this;
authenticate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
biometricPrompt.authenticate(new CancellationSignal(), executor, new BiometricPrompt.AuthenticationCallback() {
@Override
public void onAuthenticationSucceeded(BiometricPrompt.AuthenticationResult result) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(MainActivity.this, "Unlocked", Toast.LENGTH_SHORT).show();
//I assume this is where the ssh stuff would go
}
});
}
});
}
});
}
解决方案
推荐阅读
- c - 构建后立即运行可执行文件(c、cmake、make)
- c - c中具有动态内存数组元素的结构
- reactjs - 如何使对话框出现在 Snackbar 上?
- r - Tidymodels(Fitting a random forest with fit_samples()): Fold01: internal: Error: Must group by variables found in `.data`
- java - 关于具有相同名称的方法的多态无关类的问题?
- php - 尝试进行 PHP 服务器验证,但未显示错误消息
- python - 在 Python 中排序字典
- python - 使用 Jquery、Ajax、Flask 和 Sqlalchemy 数据库检查用户名是否可用
- azure - 集群内连接被拒绝,但端口转发在 Kubernetes 中有效
- javascript - 如何在隐藏问题时阻止单选按钮的结果显示