diff options
Diffstat (limited to 'src/org/theb/ssh/ShellView.java')
-rw-r--r-- | src/org/theb/ssh/ShellView.java | 77 |
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"); - } - -} |