changeset 525:b61919d8a701

code cleanup; document connections file
author Carl Byington <carl@five-ten-sg.com>
date Sat, 01 Jun 2024 10:12:40 -0600
parents 609b142218bc
children 9a8862b87f6e
files 510Connectbot.connections Makefile app/src/main/java/com/five_ten_sg/connectbot/transport/Local.java app/src/main/java/com/five_ten_sg/connectbot/transport/SSH.java app/src/main/java/com/five_ten_sg/connectbot/transport/TN5250.java app/src/main/java/com/five_ten_sg/connectbot/transport/Telnet.java xml/510connectbot.in
diffstat 7 files changed, 27 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/510Connectbot.connections	Fri May 31 21:14:55 2024 -0600
+++ b/510Connectbot.connections	Sat Jun 01 10:12:40 2024 -0600
@@ -1,7 +1,6 @@
 #
 # available host keys:
 #
-# nickname          (string)
 # color             (string)    ("red", "green", "blue", "gray")
 # fontsize          (float)
 # fixed_size        (boolean)
@@ -76,13 +75,15 @@
 #
 
 
-tn5250://pub400.com:23#pub400
+tn5250://pub400.com:23#pub400%20here
     encryption5250=TLSv1.3
     fontsize=20
     fixed_size=true
     fixed_width=40
     fixed_height=25
 
+local://#local
+
 global://
     emulation=xterm-256color
     scrollback=200
--- a/Makefile	Fri May 31 21:14:55 2024 -0600
+++ b/Makefile	Sat Jun 01 10:12:40 2024 -0600
@@ -140,6 +140,10 @@
 	echo installing $(debugapk)
 	$(adb) install -r -d $(debugapk)
 
+install.android.connections:
+	$(adb) push $(dest)/../testcases/deployment.connections /storage/self/primary/AccuSpeech/VoiceProjects/510Connectbot.connections
+	$(adb) shell ls -al /storage/self/primary/AccuSpeech/VoiceProjects
+
 logcat.device:
 	$(adb) logcat -c
 	$(adb) logcat
--- a/app/src/main/java/com/five_ten_sg/connectbot/transport/Local.java	Fri May 31 21:14:55 2024 -0600
+++ b/app/src/main/java/com/five_ten_sg/connectbot/transport/Local.java	Sat Jun 01 10:12:40 2024 -0600
@@ -203,15 +203,10 @@
         HostBean host = new HostBean();
         host.setProtocol(PROTOCOL);
         String nickname = uri.getFragment();
-
         if (nickname == null || nickname.length() == 0) {
-            host.setNickname(getDefaultNickname(host.getUsername(),
-                                                host.getHostname(), host.getPort()));
+            nickname = getDefaultNickname(host.getUsername(), host.getHostname(), host.getPort());
         }
-        else {
-            host.setNickname(uri.getFragment());
-        }
-
+        host.setNickname(nickname);
         return host;
     }
 
--- a/app/src/main/java/com/five_ten_sg/connectbot/transport/SSH.java	Fri May 31 21:14:55 2024 -0600
+++ b/app/src/main/java/com/five_ten_sg/connectbot/transport/SSH.java	Sat Jun 01 10:12:40 2024 -0600
@@ -998,22 +998,14 @@
         host.setProtocol(PROTOCOL);
         host.setHostname(uri.getHost());
         int port = uri.getPort();
-
-        if (port < 0)
-            port = DEFAULT_PORT;
-
+        if (port < 0) port = DEFAULT_PORT;
         host.setPort(port);
         host.setUsername(uri.getUserInfo());
         String nickname = uri.getFragment();
-
         if (nickname == null || nickname.length() == 0) {
-            host.setNickname(getDefaultNickname(host.getUsername(),
-                                                host.getHostname(), host.getPort()));
+            nickname = getDefaultNickname(host.getUsername(), host.getHostname(), host.getPort()));
         }
-        else {
-            host.setNickname(uri.getFragment());
-        }
-
+        host.setNickname(nickname);
         return host;
     }
 
--- a/app/src/main/java/com/five_ten_sg/connectbot/transport/TN5250.java	Fri May 31 21:14:55 2024 -0600
+++ b/app/src/main/java/com/five_ten_sg/connectbot/transport/TN5250.java	Sat Jun 01 10:12:40 2024 -0600
@@ -440,16 +440,12 @@
         host.setProtocol(PROTOCOL);
         host.setHostname(uri.getHost());
         int port = uri.getPort();
-
         if (port < 0) port = DEFAULT_PORT;
-
         host.setPort(port);
         String nickname = uri.getFragment();
-
         if (nickname == null || nickname.length() == 0) {
             nickname = getDefaultNickname(host.getUsername(), host.getHostname(), host.getPort());
         }
-
         host.setNickname(nickname);
         return host;
     }
--- a/app/src/main/java/com/five_ten_sg/connectbot/transport/Telnet.java	Fri May 31 21:14:55 2024 -0600
+++ b/app/src/main/java/com/five_ten_sg/connectbot/transport/Telnet.java	Sat Jun 01 10:12:40 2024 -0600
@@ -325,21 +325,13 @@
         host.setProtocol(PROTOCOL);
         host.setHostname(uri.getHost());
         int port = uri.getPort();
-
-        if (port < 0)
-            port = DEFAULT_PORT;
-
+        if (port < 0) port = DEFAULT_PORT;
         host.setPort(port);
         String nickname = uri.getFragment();
-
         if (nickname == null || nickname.length() == 0) {
-            host.setNickname(getDefaultNickname(host.getUsername(),
-                                                host.getHostname(), host.getPort()));
+            nickname = getDefaultNickname(host.getUsername(), host.getHostname(), host.getPort());
         }
-        else {
-            host.setNickname(uri.getFragment());
-        }
-
+        host.setNickname(nickname);
         return host;
     }
 
--- a/xml/510connectbot.in	Fri May 31 21:14:55 2024 -0600
+++ b/xml/510connectbot.in	Sat Jun 01 10:12:40 2024 -0600
@@ -479,11 +479,20 @@
                 and parsed every time the app is launched.
             </para>
 
+            <para>
+                The connections are specified by a URI of the form
+                scheme://host:port#nickname
+                where scheme is one of (telnet, ssh, tn5250). The URI
+                must be uri encoded - spaces replaced by %20, etc.
+            </para>
+
+            <para>
+            </para>
+
             <literallayout class="monospaced"><![CDATA[
 #
 # available host keys:
 #
-# nickname          (string)
 # color             (string)    ("red", "green", "blue", "gray")
 # fontsize          (float)
 # fixed_size        (boolean)
@@ -513,13 +522,13 @@
 # autolaunch        (boolean)
 
 
-tn5250://pub400.com:23#battleship
+tn5250://pub400.com:23#battleship%20game
     encryption5250=NONE
     fontsize=20
     fixed_size=true
     fixed_width=80
     fixed_height=25
-    monitor=socket://localhost/pub400
+    monitor=socket2://localhost/pub400_enu
 
 
 #