/*
* This file is part of "JTA - Telnet/SSH for the JAVA(tm) platform".
*
* (c) Matthias L. Jugel, Marcus Meiner 1996-2005. All Rights Reserved.
*
* Please visit http://javatelnet.org/ for updates and contact.
*
* --LICENSE NOTICE--
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* --LICENSE NOTICE--
*
*/
package de.mud.terminal;
import android.text.AndroidCharacter;
import java.util.Properties;
/**
* Implementation of a VT terminal emulation plus ANSI compatible.
* <P>
* <B>Maintainer:</B> Marcus Meißner
*
* @version $Id: vt320.java 507 2005-10-25 10:14:52Z marcus $
* @author Matthias L. Jugel, Marcus Meißner
*/
public abstract class vt320 extends VDUBuffer implements VDUInput {
/** The current version id tag.<P>
* $Id: vt320.java 507 2005-10-25 10:14:52Z marcus $
*
*/
public final static String ID = "$Id: vt320.java 507 2005-10-25 10:14:52Z marcus $";
/** the debug level */
private final static int debug = 0;
private StringBuilder debugStr;
public abstract void debug(String notice);
/**
* Write an answer back to the remote host. This is needed to be able to
* send terminal answers requests like status and type information.
* @param b the array of bytes to be sent
*/
public abstract void write(byte[] b);
/**
* Write an answer back to the remote host. This is needed to be able to
* send terminal answers requests like status and type information.
* @param b the array of bytes to be sent
*/
public abstract void write(int b);
/**
* Play the beep sound ...
*/
public void beep() { /* do nothing by default */
}
/**
* Convenience function for putString(char[], int, int)
*/
public void putString(String s) {
int len = s.length();
char[] tmp = new char[len];
s.getChars(0, len, tmp, 0);
putString(tmp, null, 0, len);
}
/**
* Put string at current cursor position. Moves cursor
* according to the String. Does NOT wrap.
* @param s character array
* @param start place to start in array
* @param len number of characters to process
*/
public void putString(char[] s, byte[] fullwidths, int start, int len) {
if (len > 0) {
//markLine(R, 1);
int lastChar = -1;
char c;
boolean isWide = false;
for (int i = 0; i < len; i++) {
c = s[start + i];
// Shortcut for my favorite ASCII
if (c <= 0x7F) {
if (lastChar != -1)
putChar((char) lastChar, isWide, false);
lastChar = c;
isWide = false;
} else if (!Character.isLowSurrogate(c) && !Character.isHighSurrogate(c)) {
if (Character.getType(c) == Character.NON_SPACING_MARK) {
if (lastChar != -1) {
char nc = Precomposer.precompose((char) lastChar, c);
putChar(nc, isWide, false);
lastChar = -1;
}
} else {
if (lastChar != -1)
putChar((char) lastChar, isWide, false);
lastChar = c;
if (fullwidths != null) {
final byte width = fullwidths[i];
isWide = (width == AndroidCharacter.EAST_ASIAN_WIDTH_WIDE)
|| (width == AndroidCharacter.EAST_ASIAN_WIDTH_FULL_WIDTH);
}
}
}
}
if (lastChar != -1)
putChar((char) lastChar, isWide, false);
setCursorPosition(C, R);
redraw();
}
}
protected void sendTelnetCommand(byte cmd) {
}
/**
* Sent the changed window size from the terminal to all listeners.
*/
protected void setWindowSize(int c, int r) {
/* To be overridden by Terminal.java */
}
@Override
public void setScreenSize(int c, int r, boolean broadcast) {
int oldrows = height;
if (debug>2) {
if (debugStr == null)
debugStr = new StringBuilder();
debugStr.append("setscreensize (")
.append(c)
.append(',')
.append(r)
.append(',')
.append(broadcast)
.append(')');
debug(debugStr.toString());
debugStr.setLength(0);
}
super.setScreenSize(c,r,false);
boolean cursorChanged = false;
// Don't let the cursor go off the screen.
if (C >= c) {
C = c - 1;
cursorChanged = true;
}
if (R >= r) {
R = r - 1;
cursorChanged = true;
}
if (cursorChanged) {
setCursorPosition(C, R);
redraw();
}
if (broadcast) {
setWindowSize(c, r); /* broadcast up */
}
}
/**
* Create a new vt320 terminal and intialize it with useful settings.
*/
public vt320(int width, int height) {
super(width, height);
debugStr = new StringBuilder();
setVMS(false);
setIBMCharset(false);
setTerminalID("vt320");
setBufferSize(100);
//setBorder(2, false);
gx = new char[4];
reset();
/* top row of numpad */
PF1 = "\u001bOP";
PF2 = "\u001bOQ";
PF3 = "\u001bOR";
PF4 = "\u001bOS";
/* the 3x2 keyblock on PC keyboards */
Insert = new String[4];
Remove = new String[4];
KeyHome = new String[4];
KeyEnd = new String[4];
NextScn = new String[4];
PrevScn = new String[4];
Escape = new String[4];
BackSpace = new String[4];
TabKey = new String[4];
Insert[0] = Insert[1] = Insert[2] = Insert[3] = "\u001b[2~";
Remove[0] = Remove[1] = Remove[2] = Remove[3] = "\u001b[3~";
PrevScn[0] = PrevScn[1] = PrevScn[2] = PrevScn[3] = "\u001b[5~";
NextScn[0] = NextScn[1] = NextScn[2] = NextScn[3] = "\u001b[6~";
KeyHome[0] = KeyHome[1] = KeyHome[2] = KeyHome[3] = "\u001b[H";
KeyEnd[0] = KeyEnd[1] = KeyEnd[2] = KeyEnd[3] = "\u001b[F";
Escape[0] = Escape[1] = Escape[2] = Escape[3] = "\u001b";
if (vms) {
BackSpace[1] = "" + (char) 10; // VMS shift deletes word back
BackSpace[2] = "\u0018"; // VMS control deletes line back
BackSpace[0] = BackSpace[3] = "\u007f"; // VMS other is delete
} else {
//BackSpace[0] = BackSpace[1] = BackSpace[2] = BackSpace[3] = "\b";
// ConnectBot modifications.
BackSpace[0] = "\b";
BackSpace[1] = "\u007f";
BackSpace[2] = "\u001b[3~";
BackSpace[3] = "\u001b[2~";
}
/* some more VT100 keys */
Find = "\u001b[1~";
Select = "\u001b[4~";
Help = "\u001b[28~";
Do = "\u001b[29~";
FunctionKey = new String[21];
FunctionKey[0] = "";
FunctionKey[1] = PF1;
FunctionKey[2] = PF2;
FunctionKey[3] = PF3;
FunctionKey[4] = PF4;
/* following are defined differently for vt220 / vt132 ... */
FunctionKey[5] = "\u001b[15~";
FunctionKey[6] = "\u001b[17~";
FunctionKey[7] = "\u001b[18~";
FunctionKey[8] = "\u001b[19~";
FunctionKey[9] = "\u001b[20~";
FunctionKey[10] = "\u001b[21~";
FunctionKey[11] = "\u001b[23~";
FunctionKey[12] = "\u001b[24~";
FunctionKey[13] = "\u001b[25~";
FunctionKey[14] = "\u001b[26~";
FunctionKey[15] = Help;
FunctionKey[16] = Do;
FunctionKey[17] = "\u001b[31~";
FunctionKey[18] = "\u001b[32~";
FunctionKey[19] = "\u001b[33~";
FunctionKey[20] = "\u001b[34~";
FunctionKeyShift = new String[21];
FunctionKeyAlt = new String[21];
FunctionKeyCtrl = new String[21];
for (int i = 0; i < 20; i++) {
FunctionKeyShift[i] = "";
FunctionKeyAlt[i] = "";
F
没有合适的资源?快使用搜索试试~ 我知道了~
ConnectBot(SSH 远程)
共720个文件
class:379个
java:228个
xml:79个
5星 · 超过95%的资源 需积分: 14 29 下载量 57 浏览量
2013-06-19
11:51:59
上传
评论
收藏 2.38MB ZIP 举报
温馨提示
ConnectBot 是 Android 平台上的一个 SSH 远程连接客户端软件。
资源推荐
资源详情
资源评论
收起资源包目录
ConnectBot(SSH 远程) (720个子文件)
resources.ap_ 469KB
ConnectBot.apk 799KB
vt320.class 38KB
ChannelManager.class 37KB
AES.class 37KB
Precomposer.class 30KB
SSH.class 23KB
TerminalBridge.class 22KB
Deflate.class 21KB
HostDatabase.class 20KB
Connection.class 19KB
SFTPv3Client.class 19KB
TerminalManager.class 19KB
ConsoleActivity.class 19KB
KexManager.class 17KB
BlowFish.class 17KB
UberColorPickerDialog$ColorPickerView.class 17KB
PubkeyListActivity.class 16KB
InfTree.class 15KB
TransportManager.class 15KB
KnownHosts.class 13KB
HostListActivity.class 12KB
SCPClient.class 12KB
PubkeyUtils.class 12KB
ProxyServer.class 12KB
VDUBuffer.class 11KB
AuthenticationManager.class 11KB
Tree.class 10KB
AuthAgentForwardThread.class 10KB
TerminalKeyListener.class 10KB
SHA1.class 9KB
R$string.class 9KB
InfBlocks.class 9KB
DES.class 9KB
InfCodes.class 9KB
TelnetProtocolHandler.class 9KB
PEMDecoder.class 9KB
Proxy.class 8KB
HostBean.class 8KB
Session.class 8KB
PubkeyDatabase.class 8KB
GeneratePubkeyActivity.class 8KB
Telnet.class 8KB
TerminalView.class 7KB
TransportConnection.class 7KB
HostEditorActivity.class 7KB
RSASHA1Verify.class 7KB
DSASHA1Verify.class 6KB
ExceptionHandler.class 6KB
PortForwardListActivity.class 6KB
ColorsActivity.class 6KB
IBM437$Encoder.class 6KB
DynamicAcceptThread$DynamicAcceptRunnable.class 6KB
Local.class 6KB
Inflate.class 6KB
RemoteX11AcceptThread.class 6KB
StaticTree.class 6KB
Socks5DatagramSocket.class 6KB
Socks5Proxy.class 6KB
ErrorCodes.class 5KB
MD5.class 5KB
UpdateHelper.class 5KB
UDPRelayServer.class 5KB
ZStream.class 5KB
HostListActivity$HostAdapter.class 5KB
HostEditorActivity$CursorPreferenceHack.class 5KB
PacketKexInit.class 5KB
EntropyView.class 5KB
ConnectivityReceiver.class 5KB
SocksSocket.class 5KB
ConsoleActivity$11.class 5KB
Relay.class 5KB
Socks5Message.class 5KB
PubkeyListActivity$PubkeyAdapter.class 4KB
PubkeyBean.class 4KB
ConnectionNotifier.class 4KB
PortForwardBean.class 4KB
Socks4Message.class 4KB
RobustSQLiteOpenHelper.class 4KB
SelectionArea.class 4KB
Colors.class 4KB
DhExchange.class 4KB
Packets.class 4KB
HostEditorActivity$CursorPreferenceHack$Editor.class 4KB
GeneratePubkeyActivity$2.class 4KB
TypesReader.class 4KB
PortForwardListActivity$5.class 4KB
BlockCipherFactory.class 4KB
IBM437$Decoder.class 4KB
ColorsActivity$ColorView.class 4KB
ConsoleActivity$1.class 4KB
TypesWriter.class 4KB
AbsTransport.class 4KB
StreamGobbler.class 4KB
ZOutputStream.class 4KB
TransportFactory.class 4KB
LocalAcceptThread.class 3KB
SSH$HostKeyVerifier.class 3KB
PortForwardListActivity$5$2.class 3KB
RemoteAcceptThread.class 3KB
共 720 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
- zhb_zhangbin2013-11-23我以为是电脑能telnet设备。???结果反过来了
- lll0988902014-10-08资源很好,学习学习,不过现在就是不知道怎么使用,哈哈
半棵树
- 粉丝: 2537
- 资源: 247
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- IRobot:萝卜圈学习微课.zip
- 测试.doc
- 电脑课3.0.pbix
- 腾讯会议TencentMeeting-publish.officialwebsite.exe
- Screenshot_2024-05-18-10-48-45-370_com.tencent.mobileqq.jpg
- 哈工大-生物信息学作业
- Screenshot_2024-05-18-10-34-33-43_f40a83f504dccd7f68fe1f6e8cd8ec9a.jpg
- 基于遗传算法的高校自动排课系统的设计与实现+全部资料+详细文档(毕业设计).zip
- 顺序表的基本操作.doc
- 萝卜圈:无人驾驶技术(机器人和程序).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功