FinalCrypt - The No¹ One-Time Pad Encryption
Revisión | 44a31bc0875b76438f591bee3ded145eabc17f0b (tree) |
---|---|
Tiempo | 2020-07-08 04:14:22 |
Autor | ron <ronuitzaandam@gmai...> |
Commiter | ron |
Date: 2020-07-07 Version: 6.3.9
Added 3 Sec HTTP Timeout to speedup HTTP(S) connect
This also improves all other HTTP Connect Responses
General, Support, Update, Download or Share Webpage
This fixes FinalCrypt's unresponsiveness at startup
when the webservers of the hosting are unresponsive
@@ -1791,65 +1791,47 @@ public class GUIFX extends Application implements UI, Initializable | ||
1791 | 1791 | |
1792 | 1792 | private void checkUpdate(boolean userActivated) |
1793 | 1793 | { |
1794 | -// Platform.runLater(() -> | |
1795 | -// { | |
1796 | - Thread pleaseShareThread = new Thread(new Runnable() | |
1797 | - { | |
1798 | - @Override | |
1799 | - @SuppressWarnings({"static-access"}) | |
1800 | - public void run() | |
1801 | - { | |
1802 | - Platform.runLater(() -> | |
1803 | - { | |
1804 | - version = new Version(ui); | |
1805 | - version.checkCurrentlyInstalledVersion(GUIFX.this); | |
1806 | - version.checkLatestOnlineVersion(GUIFX.this); | |
1807 | - prefs.putLong("Update Checked", now); flushPrefs(prefs); | |
1808 | - String[] lines = version.getUpdateStatus().split("\r\n"); | |
1809 | - for (String line: lines) { log(line + "\r\n", true, true, true, false, false); } | |
1810 | - | |
1811 | - // Just for testing purposes (uncomment) | |
1812 | - // alertCurrentVersionIsUp2Date(); | |
1813 | - // alertCurrentVersionCanBeUpdated(); | |
1814 | - // alertCurrentVersionIsDevelopement(); | |
1815 | - // alertlatestVersionUnknown(); | |
1816 | - // latestAlertMessage(); | |
1817 | - //// currentAlertMessage(); // Should never be tested and used in production | |
1818 | - | |
1819 | - if (version.latestVersionIsKnown()) | |
1820 | - { | |
1821 | - if (( ! version.versionIsDifferent() ) && ( userActivated )) { alertCurrentVersionIsUp2Date(); } | |
1822 | - else { if (version.versionCanBeUpdated()) { alertCurrentVersionCanBeUpdated(); } | |
1823 | - else if ( (version.versionIsDevelopment() ) && ( userActivated ) ) { alertCurrentVersionIsDevelopement(); } } | |
1824 | - } | |
1825 | - else { alertlatestVersionUnknown(); } | |
1826 | - | |
1827 | - // After all check update processing comes an optional alert | |
1828 | - if ( | |
1829 | - ( true ) // Leave to "true" to enable online alerts | |
1830 | - && ( version.getLatestAlertSubjectString() != null) | |
1831 | - && ( ! version.getLatestAlertSubjectString().isEmpty()) | |
1832 | - && ( version.getLatestAlertString() != null) | |
1833 | - && ( ! version.getLatestAlertString().isEmpty()) | |
1834 | - ) // Only display Alert in VERSION2 file | |
1835 | - { latestAlertMessage(); } | |
1836 | - | |
1837 | - if ( | |
1838 | - ( false ) // Leave to "false" Only set to true to test an alert | |
1839 | - && ( version.getCurrentAlertSubjectString() != null) | |
1840 | - && ( ! version.getCurrentAlertSubjectString().isEmpty()) | |
1841 | - && ( version.getCurrentAlertString() != null) | |
1842 | - && ( ! version.getCurrentAlertString().isEmpty()) | |
1843 | - ) // Only display Alert in VERSION2 file | |
1844 | - { currentAlertMessage(); } | |
1845 | - }); | |
1846 | - } | |
1847 | - }); | |
1848 | - pleaseShareThread.setName("pleaseShareThread"); | |
1849 | - pleaseShareThread.setDaemon(true); | |
1850 | - pleaseShareThread.start(); | |
1851 | - | |
1852 | -// }); | |
1794 | + version = new Version(this); | |
1795 | + version.checkCurrentlyInstalledVersion(GUIFX.this); | |
1796 | + version.checkLatestOnlineVersion(GUIFX.this); | |
1797 | + prefs.putLong("Update Checked", now); flushPrefs(prefs); | |
1798 | + String[] lines = version.getUpdateStatus().split("\r\n"); | |
1799 | + for (String line: lines) { log(line + "\r\n", true, true, true, false, false); } | |
1800 | + | |
1801 | + // Just for testing purposes (uncomment) | |
1802 | + // alertCurrentVersionIsUp2Date(); | |
1803 | + // alertCurrentVersionCanBeUpdated(); | |
1804 | + // alertCurrentVersionIsDevelopement(); | |
1805 | + // alertlatestVersionUnknown(); | |
1806 | + // latestAlertMessage(); | |
1807 | + //// currentAlertMessage(); // Should never be tested and used in production | |
1808 | + | |
1809 | + if (version.latestVersionIsKnown()) | |
1810 | + { | |
1811 | + if (( ! version.versionIsDifferent() ) && ( userActivated )) { alertCurrentVersionIsUp2Date(); } | |
1812 | + else { if (version.versionCanBeUpdated()) { alertCurrentVersionCanBeUpdated(); } | |
1813 | + else if ( (version.versionIsDevelopment() ) && ( userActivated ) ) { alertCurrentVersionIsDevelopement(); } } | |
1814 | + } | |
1815 | + else { alertlatestVersionUnknown(); } | |
1816 | + | |
1817 | +// After all check update processing comes an optional alert | |
1818 | + if ( | |
1819 | + ( true ) // Leave to "true" to enable online alerts | |
1820 | + && ( version.getLatestAlertSubjectString() != null) | |
1821 | + && ( ! version.getLatestAlertSubjectString().isEmpty()) | |
1822 | + && ( version.getLatestAlertString() != null) | |
1823 | + && ( ! version.getLatestAlertString().isEmpty()) | |
1824 | + ) // Only display Alert in VERSION2 file | |
1825 | + { latestAlertMessage(); } | |
1826 | + | |
1827 | + if ( | |
1828 | + ( false ) // Leave to "false" Only set to true to test an alert | |
1829 | + && ( version.getCurrentAlertSubjectString() != null) | |
1830 | + && ( ! version.getCurrentAlertSubjectString().isEmpty()) | |
1831 | + && ( version.getCurrentAlertString() != null) | |
1832 | + && ( ! version.getCurrentAlertString().isEmpty()) | |
1833 | + ) // Only display Alert in VERSION2 file | |
1834 | + { currentAlertMessage(); } | |
1853 | 1835 | } |
1854 | 1836 | |
1855 | 1837 | private void alertCurrentVersionIsUp2Date() |
@@ -107,8 +107,13 @@ public class Version | ||
107 | 107 | ,"http://www.google.com/search?q=finalcrypt+homepage&oq=finalcrypt+homepage" // tested |
108 | 108 | }; |
109 | 109 | |
110 | +// Emulate bad server response | |
111 | +// nc -l -p 8080 | |
112 | +// "http://localhost:8080/VERSION2" | |
113 | + | |
110 | 114 | private static final String[] REMOTEVERSIONFILEURLSTRINGARRAY = { |
111 | 115 | "https://www.finalcrypt.org/VERSION2" // tested |
116 | +// ,"http://localhost:8080/VERSION2" // tested | |
112 | 117 | ,"http://www.finalcrypt.org/VERSION2" // tested |
113 | 118 | ,"https://www.finalcrypt.com/VERSION2" // tested |
114 | 119 | ,"http://www.finalcrypt.com/VERSION2" // tested |
@@ -412,7 +417,7 @@ public class Version | ||
412 | 417 | |
413 | 418 | if (remoteVERSION2FileString.startsWith("https://")) { remoteContent = httpsGetRequest(ui, remoteVERSION2FileString); } else { remoteContent = httpGetRequest(ui, remoteVERSION2FileString); } |
414 | 419 | |
415 | -// ui.test("\r\nNEXT\r\n"); | |
420 | +// ui.test("Remote Content: " + remoteContent + "\r\n\r\n"); | |
416 | 421 | if ((remoteContent != null) && (! checkOnlineFailed)) |
417 | 422 | { |
418 | 423 | String[] lines = remoteContent.split("\n"); // VERSION2 file was create on linux with unix newlines \n |