aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/theb/ssh/ShellView.java
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2007-11-21 05:32:39 +0000
committerKenny Root <kenny@the-b.org>2007-11-21 05:32:39 +0000
commitd6764b7763e7857273b65048b4eb37a3c65efade (patch)
tree4e84d4d9327d8a8de685fd0f181208c82e1cb9ad /src/org/theb/ssh/ShellView.java
parent4d94be3c05a341c18396f45945d86d61ca86dec4 (diff)
downloadconnectbot-d6764b7763e7857273b65048b4eb37a3c65efade.tar.gz
connectbot-d6764b7763e7857273b65048b4eb37a3c65efade.tar.bz2
connectbot-d6764b7763e7857273b65048b4eb37a3c65efade.zip
Merging back in the jcterm branch
Diffstat (limited to 'src/org/theb/ssh/ShellView.java')
-rw-r--r--src/org/theb/ssh/ShellView.java77
1 files changed, 0 insertions, 77 deletions
diff --git a/src/org/theb/ssh/ShellView.java b/src/org/theb/ssh/ShellView.java
deleted file mode 100644
index 15d783b..0000000
--- a/src/org/theb/ssh/ShellView.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.theb.ssh;
-
-import java.io.IOException;
-
-import com.trilead.ssh2.Connection;
-import com.trilead.ssh2.Session;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.util.Log;
-import android.widget.EditText;
-import android.widget.TextView;
-
-public class ShellView extends EditText {
-
- private Connection mConn;
- private Session mSess;
-
- private String mHostname;
- private String mUsername;
- private String mPassword;
-
- public ShellView(Context context) {
- super(context);
- // TODO Auto-generated constructor stub
-
- mPassword = "OEfmP07-";
- }
-
- @Override
- public void onDraw(Canvas canvas) {
- super.onDraw(canvas);
-
- append("Connecting... ");
- mConn = new Connection(mHostname);
-
- try {
- mConn.connect(new InteractiveHostKeyVerifier());
- append("OK\n");
- } catch (IOException e) {
- append("Failed.\n");
- Log.e("SSH", e.getMessage());
- append("\nWhoops: " + e.getCause().getMessage() + "\n");
- }
-
- boolean enableKeyboardInteractive = true;
- boolean enableDSA = true;
- boolean enableRSA = true;
-
- try {
- while (true) {
- /*
- if ((enableDSA || enableRSA ) &&
- mConn.isAuthMethodAvailable(username, "publickey");
- */
-
- if (mConn.isAuthMethodAvailable(mUsername, "password")) {
- boolean res = mConn.authenticateWithPassword(mUsername, mPassword);
- if (res == true)
- break;
-
- append("Login failed.\n");
- continue;
- }
-
- throw new IOException("No supported authentication methods available.");
- }
-
- mSess = mConn.openSession();
- append("Logged in as " + mUsername + ".\n");
- } catch (IOException e) {
- Log.e("SSH", e.getMessage());
- }
- append("Exiting\n");
- }
-
-}