-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJTouch.java
More file actions
16326 lines (13122 loc) · 499 KB
/
JTouch.java
File metadata and controls
16326 lines (13122 loc) · 499 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
JTouch java web browser, running in GUI or command-line.
It demonstrates the pluggability of JSSE and the low-level configuration of SSL handshakes.
Copyright (C) under Modified BSD License
Contact : nephylim@users.sourceforge.net
*/
import java.io.*;
import java.nio.charset.Charset;
import java.net.*;
import java.util.Hashtable;
import java.util.Enumeration;
import java.util.Vector;
import java.util.Timer;
import java.util.TimerTask;
import java.nio.ByteBuffer;
import java.util.regex.*;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Calendar;
import java.util.SimpleTimeZone;
import java.util.Locale;
import java.util.ArrayList;
import java.util.List;
import javax.net.ssl.*;
import java.security.*;
import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
import java.security.cert.X509Certificate;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeEvent;
import java.text.*;
import javax.naming.*;
import javax.naming.directory.*;
import com.sun.security.ntlm.*;
import com.river_tiger.jtouch.util.StringHashtable;
import com.river_tiger.jtouch.util.DigestChallenge;
import com.river_tiger.jtouch.util.RuntimeUtil;
public class JTouch extends JFrame {
/*
* stores all common parameters coming from GUI or command-line
*/
private static Hashtable<String, Object> hFast = new Hashtable<String, Object>();
/*
* stores all parameters and objects related to the GUI
* most of the values will be used to build the hFast table
*/
private static Hashtable<String, Object> hGUI = new Hashtable<String, Object>();
/*
* Keep-Alive is a pain in the ass
* 1st, being compliant to RFCs (by default : closing connections in 1.0, keeping alive in 1.1 ; unless specified by the Keep-Alive header in both cases)
* 2nd, handling connection errors in Java (we never know that an opened connection was later closed, until we write on the socket again, or even read..)
* 3rd, every change on the requested server (name or port), or on the used proxy (name or port) will terminate the keep-alive
* 4th, many GUI-related changes will terminate the keep-alive (http->https, provider, SSL parameters,..)
*/
/*
* remember the last request (hostname+port+proxyname+proxyport)
* any change will break the keep-alive if any (this can be improved for both proxies, and end-server)
*/
private static String lastHost = "";
/*
* tracks the GUI activity. If any change is significant (http->https, SSL changes,..), we should break the keep-alive (if any)
*/
private static Boolean reuseConn = false;
/*
* GUI constructor
*/
public JTouch(String WindowTitle) {
super(WindowTitle);
/*
* design the MENU
*
* File -> [Abort current job, Log settings, Quit]
* Edit -> [Select PLAF]
* Tools -> [SSL Server check-up, See last cert]
* Advanced -> [Cookie support, Select SSL Provider, Truststore, SSL Random settings]
* Help -> [About]
*
* any change to the menu must be carefully checked, particularly the show/hide for 'see last certificate'
*/
JMenuBar theJMenuBar = new JMenuBar();
/* File */
JMenu menua = new JMenu("File");
menua.setMnemonic(KeyEvent.VK_F);
//mymenu.getAccessibleContext().setAccessibleDescription("The only menu in this program that has menu items");
JMenuItem oItem1 = new JMenuItem("Abort current job", KeyEvent.VK_A);
oItem1.addActionListener(new swgAbort(this));
menua.add(oItem1);
JMenuItem oItem2 = new JMenuItem("Log settings", KeyEvent.VK_L);
oItem2.addActionListener(new swgLogSettings(this));
menua.add(oItem2);
JMenuItem oItem3 = new JMenuItem("Exit", KeyEvent.VK_E);
oItem3.addActionListener(new swgQuitter(this));
menua.add(oItem3);
theJMenuBar.add(menua);
/* Edit */
JMenu menub = new JMenu("Edit");
menub.setMnemonic(KeyEvent.VK_E);
JMenuItem oItem4 = new JMenuItem("Select PLAF", KeyEvent.VK_P);
oItem4.addActionListener(new swgSelectPLAF(this));
menub.add(oItem4);
theJMenuBar.add(menub);
/* Tools */
JMenu menuc = new JMenu("Tools");
menuc.setMnemonic(KeyEvent.VK_T);
JMenuItem oItem5 = new JMenuItem("SSL Server check-up", KeyEvent.VK_S);
oItem5.addActionListener(new swgSSLServerCheckUp(this));
menuc.add(oItem5);
JMenuItem oItem6 = new JMenuItem("See last cert", KeyEvent.VK_L);
oItem6.addActionListener(new swgLastCertificate(this));
oItem6.setEnabled(false);
menuc.add(oItem6);
theJMenuBar.add(menuc);
/* Advanced */
JMenu menud = new JMenu("Advanced");
menud.setMnemonic(KeyEvent.VK_A);
JMenuItem oItem7 = new JMenuItem("Cookie support", KeyEvent.VK_C);
oItem7.addActionListener(new swgCookieSupport(this));
menud.add(oItem7);
JMenuItem oItem8 = new JMenuItem("Select SSL Provider", KeyEvent.VK_C);
oItem8.addActionListener(new swgConfigSSL(this));
menud.add(oItem8);
JMenuItem oItem9 = new JMenuItem("Select Truststore", KeyEvent.VK_T);
oItem9.addActionListener(new swgSSLTruststore(this));
menud.add(oItem9);
JMenuItem oItem11 = new JMenuItem("SSL Random settings", KeyEvent.VK_R);
oItem11.addActionListener(new swgSSLRandom(this));
menud.add(oItem11);
JMenuItem oItem12 = new JMenuItem("Server Name Indication", KeyEvent.VK_I);
oItem12.addActionListener(new swgSSLSNI(this));
menud.add(oItem12);
theJMenuBar.add(menud);
JMenu menue = new JMenu("Help");
menue.setMnemonic(KeyEvent.VK_H);
JMenuItem oItem10 = new JMenuItem("About", KeyEvent.VK_A);
oItem10.addActionListener(new swgAbout(this));
menue.add(oItem10);
theJMenuBar.add(menue);
setJMenuBar(theJMenuBar);
/* end of menu */
/* preferredSize to use later*/
Dimension dimScroll1 = new Dimension(200, 200);
Dimension dimInput1 = new Dimension(80, 20);
/* * global panel and constraints * */
JPanel pane = new JPanel();
pane.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.anchor = GridBagConstraints.FIRST_LINE_START;
c.insets = new Insets(1, 1, 1, 1);
/* * First-Line panel * */
JPanel paneFL = new JPanel();
paneFL.setLayout(new GridBagLayout());
GridBagConstraints cFL = new GridBagConstraints();
cFL.fill = GridBagConstraints.HORIZONTAL;
cFL.insets = new Insets(1, 1, 1, 1);
cFL.anchor = GridBagConstraints.LINE_END;
cFL.weightx = 0;
cFL.weighty = 0;
JLabel flLMethod = new JLabel("Method");
cFL.gridx = 0;
cFL.gridy = 0;
paneFL.add(flLMethod, cFL);
String[] flSMethod = { "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT", "OPTIONS" };
JComboBox flCMethod = new JComboBox(flSMethod);
flCMethod.setSelectedIndex(0);
flCMethod.setEditable(false);
cFL.gridx = 1;
cFL.gridy = 0;
flCMethod.addActionListener(new swgMethod(this));
paneFL.add(flCMethod, cFL);
Hashtable<String, Object> ht = new Hashtable<String, Object>();
ht.put("objectID", flCMethod);
ht.put("value", (String)flCMethod.getSelectedItem());
hGUI.put("guiMethod", ht);
JLabel flLHost = new JLabel("Host");
cFL.gridx = 2;
cFL.gridy = 0;
paneFL.add(flLHost, cFL);
/*
* we need some consistency between the free input boxes (host, port, path) and their init values
* then we use one var _sConsistency in order to avoid mistakes
*/
String _sConsistency = "sourceforge.net";
String[] flSHost = { _sConsistency };
JComboBox flCHost = new JComboBox(flSHost);
flCHost.setSelectedIndex(0);
flCHost.setEditable(true);
cFL.gridx = 3;
cFL.gridy = 0;
// combobox is resizable
cFL.weightx = 1;
flCHost.addActionListener(new swgHost(this));
//anti-resizing bug of JComboBox
JPanel miniPanel2 = new JPanel(new BorderLayout());
flCHost.setPreferredSize(new Dimension(205, 24));
miniPanel2.add(flCHost, BorderLayout.CENTER);
paneFL.add(miniPanel2, cFL);
//paneFL.add(flCHost, cFL);
ht = new Hashtable<String, Object>();
ht.put("objectID", flCHost);
ht.put("value", (String)flCHost.getSelectedItem());
List<String> list = new ArrayList<String>();
list.add(_sConsistency);
ht.put("vals", list);
hGUI.put("guiHost", ht);
JLabel flLPort = new JLabel("Port");
cFL.gridx = 4;
cFL.gridy = 0;
cFL.weightx = 0;
paneFL.add(flLPort, cFL);
_sConsistency = "80";
String[] flSPort = { _sConsistency };
JComboBox flCPort = new JComboBox(flSPort);
flCPort.setSelectedIndex(0);
flCPort.setEditable(true);
cFL.gridx = 5;
cFL.gridy = 0;
flCPort.addActionListener(new swgPort(this));
paneFL.add(flCPort, cFL);
ht = new Hashtable<String, Object>();
ht.put("objectID", flCPort);
ht.put("value", (String)flCPort.getSelectedItem());
list = new ArrayList<String>();
list.add( _sConsistency );
ht.put("vals", list);
hGUI.put("guiPort", ht);
JLabel flLVersion = new JLabel("Ver");
cFL.gridx = 6;
cFL.gridy = 0;
paneFL.add(flLVersion, cFL);
String[] flSVersion = { "1.0", "1.1" };
JComboBox flCVersion = new JComboBox(flSVersion);
flCVersion.setSelectedIndex(1);
flCVersion.setEditable(false);
cFL.gridx = 7;
cFL.gridy = 0;
flCVersion.addActionListener(new swgVersion(this));
paneFL.add(flCVersion, cFL);
ht = new Hashtable<String, Object>();
ht.put("objectID", flCVersion);
ht.put("value", "HTTP/".concat((String)flCVersion.getSelectedItem()) );
hGUI.put("guiVersion", ht);
JButton butGO = new JButton("GO");
butGO.setVerticalTextPosition(AbstractButton.CENTER);
butGO.setHorizontalTextPosition(AbstractButton.LEADING);
butGO.addActionListener(new swgGo(this));
cFL.gridx = 8;
cFL.gridy = 0;
paneFL.add(butGO, cFL);
ht = new Hashtable<String, Object>();
ht.put("objectID", butGO);
ht.put("value", "");
hGUI.put("guiGo", ht);
JLabel flLPath = new JLabel("Path");
cFL.gridx = 0;
cFL.gridy = 1;
paneFL.add(flLPath, cFL);
_sConsistency = "/";
String[] flSPath = { _sConsistency };
JComboBox flCPath = new JComboBox(flSPath);
flCPath.setSelectedIndex(0);
flCPath.setEditable(true);
cFL.gridx = 1;
cFL.gridwidth = 7;
cFL.gridy = 1;
cFL.weightx = 1;
flCPath.addActionListener(new swgPath(this));
//anti-resizing bug of JComboBox
JPanel miniPanel1 = new JPanel(new BorderLayout());
flCPath.setPreferredSize(new Dimension(564, 24));
miniPanel1.add(flCPath, BorderLayout.CENTER);
paneFL.add(miniPanel1, cFL);
//paneFL.add(flCPath, cFL);
ht = new Hashtable<String, Object>();
ht.put("objectID", flCPath);
ht.put("value", (String)flCPath.getSelectedItem());
list = new ArrayList<String>();
list.add( _sConsistency );
ht.put("vals", list);
hGUI.put("guiPath", ht);
/* * FirstLine border * */
paneFL.setBorder(BorderFactory.createLineBorder(Color.black));
/* * add paneFirstLine to global panel * */
c.weightx = 0;
c.weighty = 0;
c.gridx = 0;
c.gridy = 0;
//c.anchor = GridBagConstraints.EAST;
pane.add(paneFL, c);
/* * authentication panel * */
JPanel paneAuth = new JPanel();
paneAuth.setLayout(new GridBagLayout());
GridBagConstraints cAuth = new GridBagConstraints();
cAuth.fill = GridBagConstraints.HORIZONTAL;
cAuth.insets = new Insets(1, 1, 1, 1);
cAuth.weightx = 0;
cAuth.weighty = 0;
cAuth.anchor = GridBagConstraints.LAST_LINE_END;
JLabel autMethod = new JLabel("Method");
cAuth.gridx = 0;
cAuth.gridy = 0;
paneAuth.add(autMethod, cAuth);
String[] autSMethod = { "Anonymous", "Basic", "Digest", "NTLM" };
//String[] autSMethod = { "Anonymous", "Basic", "Digest" };
JComboBox autCMethod = new JComboBox(autSMethod);
autCMethod.setSelectedIndex(0);
autCMethod.setEditable(false);
cAuth.gridx = 1;
cAuth.gridy = 0;
autCMethod.addActionListener(new swgAuthMethod(this));
paneAuth.add(autCMethod, cAuth);
ht = new Hashtable<String, Object>();
ht.put("objectID", autCMethod);
ht.put("value", (String)autCMethod.getSelectedItem());
hGUI.put("guiAuthMethod", ht);
JLabel autMeth = new JLabel("User");
cAuth.gridx = 0;
cAuth.gridy = 1;
paneAuth.add(autMeth, cAuth);
JTextField autUser = new JTextField("", 12);
cAuth.gridx = 1;
cAuth.gridy = 1;
autUser.setEnabled(false);
paneAuth.add(autUser, cAuth);
ht = new Hashtable<String, Object>();
ht.put("objectID", autUser);
ht.put("value", (String)autUser.getText());
hGUI.put("guiAuthUser", ht);
JLabel autMet = new JLabel("Password");
cAuth.gridx = 0;
cAuth.gridy = 2;
paneAuth.add(autMet, cAuth);
JPasswordField autPassword = new JPasswordField("", 12);
cAuth.gridx = 1;
cAuth.gridy = 2;
autPassword.setEnabled(false);
paneAuth.add(autPassword, cAuth);
ht = new Hashtable<String, Object>();
ht.put("objectID", autPassword);
ht.put("value", (String)autPassword.getText());
hGUI.put("guiAuthPassword", ht);
JLabel autDome = new JLabel("Domain");
cAuth.gridx = 0;
cAuth.gridy = 3;
paneAuth.add(autDome, cAuth);
JTextField autDom = new JTextField("", 12);
cAuth.gridx = 1;
cAuth.gridy = 3;
autDom.setEnabled(false);
paneAuth.add(autDom, cAuth);
ht = new Hashtable<String, Object>();
ht.put("objectID", autDom);
ht.put("value", (String)autDom.getText());
hGUI.put("guiAuthDomain", ht);
/* * authentication border panel * */
paneAuth.setBorder(
BorderFactory.createCompoundBorder(
BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("Authentication"),
BorderFactory.createEmptyBorder(5, 5, 5, 5)),
paneAuth.getBorder()));
/* * connection panel * */
JPanel paneConn = new JPanel();
paneConn.setLayout(new GridBagLayout());
GridBagConstraints cPan = new GridBagConstraints();
cPan.fill = GridBagConstraints.HORIZONTAL;
cPan.insets = new Insets(1, 1, 1, 1);
cPan.weightx = 0;
cPan.weighty = 0;
JLabel panMethod = new JLabel("Connect");
cPan.gridwidth = 1;
cPan.gridx = 0;
cPan.gridy = 0;
paneConn.add(panMethod, cPan);
/* TLS versions depends on Java Runtime version */
String[] panSMethod = new String[0];
switch(RuntimeUtil.getVersion()) {
case 5:
case 6:
case 7: // early JSSE is not handling over TLS 1.0
panSMethod = new String[]{ "http", "SSL 3.0", "TLS 1.0" };
break;
case 8: // starting from 8u261, TLS 1.3 is handled by JSSE 8
if(RuntimeUtil.getMinorVersion() < 261)
panSMethod = new String[]{ "http", "SSL 3.0", "TLS 1.0", "TLS 1.1", "TLS 1.2" };
else
panSMethod = new String[]{ "http", "SSL 3.0", "TLS 1.0", "TLS 1.1", "TLS 1.2", "TLS 1.3" };
break;
case 11: // see https://stackoverflow.com/a/73097062/7748072
case 17:
case 18:
panSMethod = new String[]{ "http", "SSL 3.0", "TLS 1.0", "TLS 1.1", "TLS 1.2", "TLS 1.3" };
break;
default: // 9+ , not everyone is supporting TLS 1.3
panSMethod = new String[]{ "http", "SSL 3.0", "TLS 1.0", "TLS 1.1", "TLS 1.2" };
break;
}
//String[] panSMethod = { "http", "SSL 3.0", "TLS 1.0"};
JComboBox panCMethod = new JComboBox(panSMethod);
panCMethod.setSelectedIndex(0);
panCMethod.setEditable(false);
cPan.gridx = 1;
cPan.gridwidth = 2;
cPan.gridy = 0;
panCMethod.addActionListener(new swgConnConnect(this));
paneConn.add(panCMethod, cPan);
ht = new Hashtable<String, Object>();
ht.put("objectID", panCMethod);
ht.put("value", (String)panCMethod.getSelectedItem());
hGUI.put("guiConnConnect", ht);
JLabel panMetho = new JLabel("Cipher");
cPan.weightx = 0;
cPan.weighty = 0;
cPan.gridwidth = 1;
cPan.gridx = 0;
cPan.gridy = 1;
paneConn.add(panMetho, cPan);
String[] panSCipher = { "" };
JComboBox panCCipher = new JComboBox(panSCipher);
panCCipher.setSelectedIndex(0);
panCCipher.setEditable(true);
cPan.weightx = 0;
cPan.weighty = 0;
cPan.gridx = 1;
cPan.gridwidth = 2;
cPan.gridy = 1;
panCCipher.setEnabled(false);
panCCipher.setActionCommand("guiConnCipher");
panCCipher.addActionListener(new swgConnCipher(this));
paneConn.add(panCCipher, cPan);
ht = new Hashtable<String, Object>();
ht.put("objectID", panCCipher);
ht.put("value", (String)panCCipher.getSelectedItem());
hGUI.put("guiConnCipher", ht);
JLabel panMeth = new JLabel("Client cert");
cPan.weightx = 0;
cPan.weighty = 0;
cPan.gridwidth = 1;
cPan.gridx = 0;
cPan.gridy = 2;
//RFU paneConn.add(panMeth, cPan);
JTextField panUser = new JTextField("", 12);
cPan.weightx = 0;
cPan.weighty = 0;
cPan.gridx = 1;
cPan.gridwidth = 2;
cPan.gridy = 2;
//RFU paneConn.add(panUser, cPan);
/* * connection border panel * */
paneConn.setBorder(
BorderFactory.createCompoundBorder(
BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("Connection"),
BorderFactory.createEmptyBorder(5, 5, 5, 5)),
paneConn.getBorder()));
/* * proxy panel * */
JPanel paneProxy = new JPanel();
paneProxy.setLayout(new GridBagLayout());
GridBagConstraints cProx = new GridBagConstraints();
cProx.fill = GridBagConstraints.HORIZONTAL;
cProx.insets = new Insets(1, 1, 1, 1);
JCheckBox proxOnOff = new JCheckBox("use proxy");
cProx.weightx = 0;
cProx.weighty = 0;
cProx.gridwidth = 2;
cProx.gridx = 0;
cProx.gridy = 0;
proxOnOff.addActionListener(new swgProxOnOff(this));
paneProxy.add(proxOnOff, cProx);
ht = new Hashtable<String, Object>();
ht.put("objectID", proxOnOff);
ht.put("value", (Boolean)proxOnOff.isSelected());
hGUI.put("guiProxOnOff", ht);
JLabel proxCName = new JLabel("Proxyname");
cProx.weightx = 0;
cProx.weighty = 0;
cProx.gridwidth = 1;
cProx.gridx = 0;
cProx.gridy = 1;
paneProxy.add(proxCName, cProx);
JTextField proxName = new JTextField("127.0.0.1", 12);
proxName.setPreferredSize(dimInput1);
proxName.setMinimumSize(dimInput1);
cProx.gridx = 1;
cProx.gridwidth = 1;
cProx.gridy = 1;
proxName.setEnabled(false);
paneProxy.add(proxName, cProx);
ht = new Hashtable<String, Object>();
ht.put("objectID", proxName);
ht.put("value", (String)proxName.getText());
hGUI.put("guiProxyname", ht);
JLabel proxCPort = new JLabel("Port");
cProx.weightx = 0;
cProx.weighty = 0;
cProx.gridwidth = 1;
cProx.gridx = 0;
cProx.gridy = 2;
paneProxy.add(proxCPort, cProx);
JTextField proxPort = new JTextField("8080", 12);
cProx.weightx = 0;
cProx.weighty = 0;
cProx.gridx = 1;
cProx.gridwidth = 1;
cProx.gridy = 2;
proxPort.setEnabled(false);
paneProxy.add(proxPort, cProx);
ht = new Hashtable<String, Object>();
ht.put("objectID", proxPort);
ht.put("value", (String)proxPort.getText());
hGUI.put("guiProxyport", ht);
JLabel proxCUser = new JLabel("User");
cProx.weightx = 0;
cProx.weighty = 0;
cProx.gridwidth = 1;
cProx.gridx = 0;
cProx.gridy = 3;
paneProxy.add(proxCUser, cProx);
//JTextField proxUser = new JTextField("firstname.lastname", 12);
JTextField proxUser = new JTextField(12);
cProx.weightx = 0;
cProx.weighty = 0;
cProx.gridx = 1;
cProx.gridwidth = 1;
cProx.gridy = 3;
proxUser.setEnabled(false);
paneProxy.add(proxUser, cProx);
ht = new Hashtable<String, Object>();
ht.put("objectID", proxUser);
ht.put("value", (String)proxUser.getText());
hGUI.put("guiProxyuser", ht);
JLabel proxCPass = new JLabel("Password");
cProx.weightx = 0;
cProx.weighty = 0;
cProx.gridwidth = 1;
cProx.gridx = 0;
cProx.gridy = 4;
paneProxy.add(proxCPass, cProx);
JPasswordField proxPass = new JPasswordField(6);
cProx.weightx = 0;
cProx.weighty = 0;
cProx.gridx = 1;
cProx.gridy = 4;
proxPass.setEnabled(false);
paneProxy.add(proxPass, cProx);
ht = new Hashtable<String, Object>();
ht.put("objectID", proxPass);
ht.put("value", (String)proxPass.getText());
hGUI.put("guiProxypass", ht);
/* * proxy border panel * */
paneProxy.setBorder(
BorderFactory.createCompoundBorder(
BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("Proxy"),
BorderFactory.createEmptyBorder(5, 5, 5, 5)),
paneProxy.getBorder()));
JPanel paneInt = new JPanel();
paneInt.setLayout(new GridBagLayout());
GridBagConstraints cInt = new GridBagConstraints();
cInt.fill = GridBagConstraints.BOTH;
cInt.anchor = GridBagConstraints.FIRST_LINE_START;
paneInt.setBorder(BorderFactory.createLineBorder(Color.black));
cInt.weightx = 0;
cInt.weighty = 0;
cInt.gridx = 0;
cInt.gridy = 0;
paneInt.add(paneAuth, cInt);
cInt.weightx = 0;
cInt.weighty = 0;
cInt.gridx = 1;
cInt.gridy = 0;
paneInt.add(paneConn, cInt);
cInt.weightx = 0;
cInt.weighty = 0;
cInt.gridx = 2;
cInt.gridy = 0;
paneInt.add(paneProxy, cInt);
c.weightx = 0.0;
c.weighty = 0;
c.gridx = 0;
c.gridy = 1;
pane.add(paneInt, c);
/* * empty space under authentication & connection * */
c.weightx = 0;
c.weighty = 0;
c.gridx = 0;
c.gridy = 2;
//pane.add(new JPanel(), c);
/* * ADVANCED REQUEST * */
JPanel adJPanel = new JPanel();
adJPanel.setLayout(new GridBagLayout());
GridBagConstraints d = new GridBagConstraints();
d.fill = GridBagConstraints.HORIZONTAL;
d.anchor = GridBagConstraints.FIRST_LINE_START;
//d.fill = GridBagConstraints.BOTH;
// combo box `Advanced Request`
String[] advStrings = { "Disabled", "Add Headers", "Add Body", "Add Headers & Body", "Raw Request" };
JComboBox advList = new JComboBox(advStrings);
advList.setSelectedIndex(0);
advList.setActionCommand("guiAdvancedRequest");
advList.addActionListener(new swgAdvList(this));
advList.setPreferredSize(new Dimension(120, 24));
d.insets = new Insets(1, 1, 1, 1);
d.weightx = 0;
d.weighty = 0;
d.gridx = 0;
d.gridy = 0;
adJPanel.add(advList, d);
ht = new Hashtable<String, Object>();
ht.put("objectID", advList);
ht.put("value", (String)advList.getSelectedItem());
hGUI.put("guiAdvancedRequest", ht);
// textarea `Advanced Request`
JTextArea extArea = new JTextArea(
"User-Agent: JTouch 1.0.8\r\n" +
"Accept-Charset: utf-8\r\n" +
"Accept-Encoding: gzip\r\n" +
"Accept-Language: en-US\r\n" +
"Cache-Control: no-cache\r\n" +
"Pragma: no-cache"
);
extArea.setFont(new Font("Courier New", Font.ITALIC, 10));
extArea.setLineWrap(true);
extArea.setWrapStyleWord(true);
extArea.setEnabled(false);
JScrollPane areaScrollPane = new JScrollPane();
areaScrollPane.setViewportView(extArea);
areaScrollPane.setVerticalScrollBarPolicy(
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
areaScrollPane.setPreferredSize(dimScroll1);
areaScrollPane.setMinimumSize(dimScroll1);
ht = new Hashtable<String, Object>();
ht.put("objectID", extArea);
ht.put("value", "");
hGUI.put("guiAdvanced", ht);
adJPanel.setBorder(
BorderFactory.createCompoundBorder(
BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("Advanced Request"),
BorderFactory.createEmptyBorder(5, 5, 5, 5)),
adJPanel.getBorder()));
d.weightx = 1.0;
d.gridx = 0;
d.gridy = 1;
//d.gridwidth = 2;
adJPanel.add(areaScrollPane, d);
c.gridx = 1;
c.gridy = 0;
c.weightx = 1.0;
c.weighty = 0;
// c.gridheight = number of lines in left part (1st-line + Authentication... + empty line to allow the resize)
c.gridheight = 2;
pane.add(adJPanel, c);
/* * standard output * */
JTextArea guiOut = new JTextArea("");
guiOut.setFont(new Font("Courier New", Font.ITALIC, 12));
guiOut.setLineWrap(true);
guiOut.setWrapStyleWord(true);
JScrollPane srollPane = new JScrollPane();
srollPane.setViewportView(guiOut);
// anti-resizing bug
//System.out.println(" . " + srollPane.getPreferredSize() );
srollPane.setPreferredSize( new Dimension(110, 512) );
srollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
//srollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
//JScrollPane srollPane = new JScrollPane(guiOut, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
c.weightx = 1.0;
c.weighty = 1.0;
c.gridx = 0;
c.gridwidth = 2;
c.gridy = 2;
//c.anchor = GridBagConstraints.CENTER;
c.fill = GridBagConstraints.BOTH;
pane.add(srollPane, c);
//add(new JScrollPane(tp), BorderLayout.SOUTH);
add(pane);
//setContentPane(pane);
/* * initialize some default parameters and store in hGUI * */
hGUI.put("-follow", false);
ht = new Hashtable<String, Object>();
ht.put("value", "");
hGUI.put("ciphers", ht);
ht = new Hashtable<String, Object>();
ht.put("value", "");
hGUI.put("sslprotocols", ht);
ht = new Hashtable<String, Object>();
ht.put("value", "SunJSSE_SSLv2Hello");
hGUI.put("provider", ht);
ht = new Hashtable<String, Object>();
ht.put("value", new TrustManager[0]);
hGUI.put("trustmanager", ht);
ht = new Hashtable<String, Object>();
ht.put("value", true);
hGUI.put("netstamps", true);
hGUI.put("htmlstamps", true);
hGUI.put("resolvedns", true);
hGUI.put("raw", false);
ht = new Hashtable<String, Object>();
hGUI.put("cookiesupport", ht);
hGUI.put("unsecurerandom", false);
hGUI.put("sni", false);
// build the 'out' object
JTextAreaOutputStream taos = new JTextAreaOutputStream(guiOut, 2048);
MultiOutputStream mps = new MultiOutputStream(new OutputStream[] {taos});
//System.setOut(mps);
// assign the 'out' to all outputs
hGUI.put("mps", new MultiOutputStream[] {mps, mps, mps});
// we need to save the mps object or it could be lost by the GUi changes
hGUI.put("mps-save", mps);
// default bistreamhandle
hGUI.put("bsh", new BiStreamHandle());
}
/**
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event-dispatching thread.
*/
private static void createAndShowGUI() {
//Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(true);
//Create and set up the window.
JFrame frame = new JTouch("JTouch");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// default LAF supports decorations
frame.setUndecorated(true);
//Create and set up the content pane.
//JComponent newContentPane = new JTouch();
//newContentPane.setOpaque(true); //content panes must be opaque
//frame.setContentPane(newContentPane);
//Display the window.
frame.pack();
frame.setVisible(true);
// RFU JAVA 1.6 : transparency
//com.sun.awt.AWTUtilities.setWindowOpacity(frame, 0.90f);
}
public static void main(String[] args) {
final StringBuffer SBUsage = new StringBuffer(512);
SBUsage.append("\n\nusage: java -jar JTouch.jar -method:<method> -uri:<uri> -version:<version> -hostname:<hostname> -port:<port>");
SBUsage.append(" -connect:<http|https> [-header:<<name>:<value>>:..] [-o:<file>] [-orequest:<file>:..] [-oheader:<file>:..] [-obody:<file>:..] [-ciphers:ssl_cipher:..]");
SBUsage.append("[-sslversion:protocol1:..] [-provider:provider] [-instance:instance] [-truststore:<jks_file>] [-proxyname:proxyname] [-proxyport:proxyport] [-proxyuser:username] [-proxypass:password]");
SBUsage.append("[-user:user] [-password:<password>] [-cookiestore:<cookie-type>] [-requestbody:<hex_file>] [-viewcookies_v1:file] [-viewcookies_netscape:file]");
SBUsage.append("[--follow] [--sslservercheckup] [--basic] [--digest] [--ntlm] [--netstamps] [--htmlstamps] [--resolvedns] [--lf2crlf] [--crlf2lf] [--raw] [--exportcert]");
SBUsage.append("\n\nTry `java -jar JTouch.jar --help' for more information\n\n");
//RFU [--ntlm]
final String Usage = SBUsage.toString();
final StringBuffer SBHelp = new StringBuffer(2048);
SBHelp.append("\nJTouch is a java browser running both in Swing GUI or command-line.\n\n");
SBHelp.append("To run JTouch in GUI mode, just type java -jar JTouch.\n\n");
SBHelp.append("Running JTouch in command-line is a little more difficult but it allows you to embed it in scripts and make complex scenarios.\n");
SBHelp.append("Such scenarios are for example login pages needing cookie persistence.\n");
SBHelp.append("The detail of all possible parameters and their meaning is :\n\n");
SBHelp.append("-method: (mandatory) GET | POST | HEAD | PUT | DELETE | TRACE | CONNECT | OPTIONS.\n");
SBHelp.append("-uri: (mandatory) a URI as defined in RFC2616 (typically /).\n");
SBHelp.append("-hostname: (mandatory) a host identified by a name server or IP address.\n");
SBHelp.append("-version: (mandatory) HTTP/1.0 | HTTP/1.1. By default, version 1.1 keeps the connection alive. Using 1.0 with extra header 'Connection: Keep-Alive' is at your own risk.\n");
SBHelp.append("-port: (mandatory) typically 80 or 443, any integer value is possible.\n");
SBHelp.append("-connect: (mandatory) http | https.\n");
SBHelp.append("-header:header-name:header-value. Allows adding headers, such as User-Agent, Cache-Control,..\n");
SBHelp.append("-o: System.out|output files. You can choose several outputs using -o:output1:output2:..\n");
SBHelp.append("-orequest: System.out|output files. Cannot be used with -o.\n");
SBHelp.append("-oheader: System.out|output files. Cannot be used with -o.\n");
SBHelp.append("-obody: System.out|output files. Cannot be used with -o.\n");
SBHelp.append("-user: login requested by the web site. Use with --basic or --digest or --ntlm.\n");
SBHelp.append("-password: password requested by the web site. Use with --basic or --digest or --ntlm.\n");
SBHelp.append("-domain: NTLM domain requested by the web site. Use with --ntlm.\n");
SBHelp.append("-ciphers: cipher1:cipher2:.. Defines a list of cipher suites. For the complete list of cipher suites available, see below\n");
SBHelp.append("-sslversion: SSLv2 | SSLv3 | TLSv1. It is possible to set 2 or more protocols.\n");
SBHelp.append("-provider: SunJSSE | IBMJSSE. SUN allows only SSLv3, TLSv1, SSLv2Hello:SSLv3, SSLv2Hello:TLSv1 version, and IBM allow SSLv2, SSLv3, TLSv1\n");
SBHelp.append("-truststore: all | jks file. When not specified, the system will choose the default truststore file. Value 'all' will accept all certificates.\n");
SBHelp.append("-proxyname: the proxy host identified by a name server or IP address.\n");
SBHelp.append("-proxyport: the proxy port identified by a integer value. Usually 8080, 3128,..\n");
SBHelp.append("-proxyuser: login of the user who will be authenticated by the proxy.\n");
SBHelp.append("-proxypass: password of the user who will be authenticated by the proxy.\n");
SBHelp.append("-cookiestore: netscape | v1. The cookies are stored in a file called cookies_netscape or cookies_v1.\n");
SBHelp.append("-requestbody: adds a body to the request from a hexadecimal file. The corresponding headers must be set.\n");
SBHelp.append("-viewcookies_v1: prints the cookies v1 stored in a file.\n\n\n");
SBHelp.append("-viewcookies_netscape: prints the cookies in netscape format stored in a file.\n\n\n");
SBHelp.append("Special parameters.\n\n");
SBHelp.append("--follow: follows redirects (301, 302,..).\n");
SBHelp.append("--sslservercheckup: checks all cipher suites for all ssl versions and providers against a web site.\n");
SBHelp.append("--basic: permits Basic authentication. Needs user and password parameters. Cannot be used with --digest or --ntlm\n");
SBHelp.append("--digest: permits Digest authentication. Needs user and password parameters. Cannot be used with --basic or --ntlm\n");
SBHelp.append("--ntlm: permits NTLM authentication. Needs user and password and domain parameters. Cannot be used with --basic or --digest\n");
SBHelp.append("--netstamps: prints the network time stamps for the connection (socket opening, 1st byte received,..).\n");
SBHelp.append("--htmlstamps: prints the HTTP time stamps (send request, parse response headers, parse response body.\n");
SBHelp.append("--resolvedns: prints the time needed to resolve the server name.\n");
SBHelp.append("--lf2crlf: translates the LF character into CRLF in response body messages.\n");
SBHelp.append("--crlf2lf: translates the CRLF characters into LF in response body messages.\n");
SBHelp.append("--raw: prints the response message in RAW format, displaying the chunk-length values in chunked responses.\n");
SBHelp.append("--exportcert: export the certificate to file webcert.pem, and all intermediary ACs to AC_number.pem.\n");
SBHelp.append("--unsecurerandom: uses a fast and unsecure random for SSL instead of the default.\n");
SBHelp.append("--sni: enables the Server Name Indication extension.\n\n\n");
SBHelp.append("Examples.\n\n");
SBHelp.append("The smaller request possible looks like this :\n");
SBHelp.append("java -jar JTouch -method:GET -hostname:google.com -uri:/ -version:1.1.\n\n");
SBHelp.append("\n");
SBHelp.append("Supported Cipher Suites.\n\n");
SBHelp.append("(SUN) SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA\n");
SBHelp.append("(SUN) SSL_DH_anon_EXPORT_WITH_RC4_40_MD5\n");
SBHelp.append("(SUN) SSL_DH_anon_WITH_3DES_EDE_CBC_SHA\n");
SBHelp.append("(SUN) SSL_DH_anon_WITH_DES_CBC_SHA\n");
SBHelp.append("(SUN) SSL_DH_anon_WITH_RC4_128_MD5\n");
SBHelp.append("(SUN) SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA\n");
SBHelp.append("(SUN) SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA\n");
SBHelp.append("(SUN) SSL_DHE_DSS_WITH_DES_CBC_SHA\n");
SBHelp.append("(SUN) SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA\n");
SBHelp.append("(SUN) SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA\n");
SBHelp.append("(SUN) SSL_DHE_RSA_WITH_DES_CBC_SHA\n");
SBHelp.append("(SUN) SSL_RSA_EXPORT_WITH_DES40_CBC_SHA\n");
SBHelp.append("(SUN) SSL_RSA_EXPORT_WITH_RC4_40_MD5\n");
SBHelp.append("(SUN) SSL_RSA_WITH_3DES_EDE_CBC_SHA\n");
SBHelp.append("(SUN) SSL_RSA_WITH_DES_CBC_SHA\n");
SBHelp.append("(SUN) SSL_RSA_WITH_NULL_MD5\n");
SBHelp.append("(SUN) SSL_RSA_WITH_NULL_SHA\n");
SBHelp.append("(SUN) SSL_RSA_WITH_RC4_128_MD5\n");
SBHelp.append("(SUN) SSL_RSA_WITH_RC4_128_SHA\n");
SBHelp.append("(SUN) TLS_DH_anon_WITH_AES_128_CBC_SHA\n");
SBHelp.append("(SUN) TLS_DH_anon_WITH_AES_256_CBC_SHA\n");
SBHelp.append("(SUN) TLS_DHE_DSS_WITH_AES_128_CBC_SHA\n");
SBHelp.append("(SUN) TLS_DHE_DSS_WITH_AES_256_CBC_SHA\n");
SBHelp.append("(SUN) TLS_DHE_RSA_WITH_AES_128_CBC_SHA\n");
SBHelp.append("(SUN) TLS_DHE_RSA_WITH_AES_256_CBC_SHA\n");
SBHelp.append("(SUN) TLS_RSA_WITH_AES_128_CBC_SHA\n");
SBHelp.append("(SUN) TLS_RSA_WITH_AES_256_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DH_anon_WITH_AES_128_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DH_anon_WITH_AES_256_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DHE_DSS_WITH_AES_128_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DHE_DSS_WITH_AES_256_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DHE_RSA_WITH_AES_128_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DHE_RSA_WITH_AES_256_CBC_SHA\n");
SBHelp.append("(IBM) SSL_RSA_WITH_AES_128_CBC_SHA\n");
SBHelp.append("(IBM) SSL_RSA_WITH_AES_256_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DH_anon_EXPORT_WITH_RC4_40_MD5\n");
SBHelp.append("(IBM) SSL_DH_anon_WITH_3DES_EDE_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DH_anon_WITH_DES_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DH_anon_WITH_RC4_128_MD5\n");
SBHelp.append("(IBM) SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DHE_DSS_WITH_DES_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA\n");
SBHelp.append("(IBM) SSL_DHE_RSA_WITH_DES_CBC_SHA\n");
SBHelp.append("(IBM) SSL_RSA_EXPORT_WITH_DES40_CBC_SHA\n");
SBHelp.append("(IBM) SSL_RSA_EXPORT_WITH_RC4_40_MD5\n");
SBHelp.append("(IBM) SSL_RSA_WITH_3DES_EDE_CBC_SHA\n");
SBHelp.append("(IBM) SSL_RSA_WITH_DES_CBC_SHA\n");
SBHelp.append("(IBM) SSL_RSA_WITH_NULL_MD5\n");
SBHelp.append("(IBM) SSL_RSA_WITH_NULL_SHA\n");
SBHelp.append("(IBM) SSL_RSA_WITH_RC4_128_MD5\n");
SBHelp.append("(IBM) SSL_RSA_WITH_RC4_128_SHA\n");
SBHelp.append("(IBM) SSL_DHE_DSS_WITH_RC4_128_SHA\n");
SBHelp.append("(IBM) SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5\n");
SBHelp.append("(IBM) SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA\n");
SBHelp.append("(IBM) SSL_RSA_FIPS_WITH_DES_CBC_SHA\n");
SBHelp.append("\n\n");
SBHelp.append("Troubleshooting.\n\n");
SBHelp.append("Please see the TROUBLESHOOTING file to know more about troubleshooting.\n\n\n");
SBHelp.append("Version.\n\n1.0.8\n\n\n");
SBHelp.append("Support.\n\n");
SBHelp.append("All support will be given from the JTouch team. See the official website to ask for support : http://sourceforge.net/projects/JTouch.\n\n\n");
SBHelp.append("Donations.\n\n");
SBHelp.append("See the official website to learn more about the donation process.\n\n\n");
SBHelp.append("License.\n\n");
SBHelp.append("JTouch Copyright (C) 2009-2026 Contact : nephylim@users.sourceforge.net\n");
SBHelp.append("Copyright (C) under Modified BSD License <2009-2026>");
SBHelp.append("\n\n");
SBHelp.append("Credits.\n\n");
SBHelp.append("Robert Harder : Base64 encoding/decoding, under Public Domain license. http://iharder.net/base64.\n");
SBHelp.append("Emil Ivov : Digest algorithm, under Apache Software license. http://sip-communicator.org/.\n");
final String Help = SBHelp.toString();
// 0 - type d'utilisation : ligne de commande ou GUi ?
if(args.length == 0) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}