diff --git a/README.md b/README.md index a2a02b746..d6c2548f2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

MegaBasterd fork for using bulk proxy lists

This fork of megabasterd blocks failed proxies for 1 day instead of just 90 seconds. This ensures that if you are using bulk proxy lists where multiple proxies are useless, they won't be retried unneccessarily

-[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Linux](https://svgshare.com/i/Zhy.svg)](https://svgshare.com/i/Zhy.svg) [![macOS](https://svgshare.com/i/ZjP.svg)](https://svgshare.com/i/ZjP.svg) [![Windows](https://svgshare.com/i/ZhY.svg)](https://svgshare.com/i/ZhY.svg) +[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

"If it compiles, it's good; if it boots up, it's perfect." (Linus Torvalds)

diff --git a/pom.xml b/pom.xml index 86bdba3f5..8c7290b0b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.tonikelope MegaBasterd - 7.74 + 7.76 jar diff --git a/src/main/java/com/tonikelope/megabasterd/ChunkDownloader.java b/src/main/java/com/tonikelope/megabasterd/ChunkDownloader.java index d35b2613a..4cce36a0f 100644 --- a/src/main/java/com/tonikelope/megabasterd/ChunkDownloader.java +++ b/src/main/java/com/tonikelope/megabasterd/ChunkDownloader.java @@ -302,7 +302,7 @@ public void run() { tmp_chunk_file = new File(_download.getChunkmanager().getChunks_dir() + "/" + new File(_download.getFile_name()).getName() + ".chunk" + chunk_id + ".tmp"); - try ( InputStream is = new ThrottledInputStream(con.getInputStream(), _download.getMain_panel().getStream_supervisor()); OutputStream tmp_chunk_file_os = new BufferedOutputStream(new FileOutputStream(tmp_chunk_file))) { + try (InputStream is = new ThrottledInputStream(con.getInputStream(), _download.getMain_panel().getStream_supervisor()); OutputStream tmp_chunk_file_os = new BufferedOutputStream(new FileOutputStream(tmp_chunk_file))) { init_chunk_time = System.currentTimeMillis(); diff --git a/src/main/java/com/tonikelope/megabasterd/ChunkUploader.java b/src/main/java/com/tonikelope/megabasterd/ChunkUploader.java index 902b1a65a..339c70b29 100644 --- a/src/main/java/com/tonikelope/megabasterd/ChunkUploader.java +++ b/src/main/java/com/tonikelope/megabasterd/ChunkUploader.java @@ -200,7 +200,7 @@ public void run() { ByteArrayOutputStream chunk_mac = new ByteArrayOutputStream(); - try ( QueueInputStream qis = new QueueInputStream(); QueueOutputStream qos = qis.newQueueOutputStream(); BufferedInputStream bis = new BufferedInputStream(Channels.newInputStream(f.getChannel())); CipherInputStream cis = new CipherInputStream(qis, genCrypter("AES", "AES/CTR/NoPadding", _upload.getByte_file_key(), forwardMEGALinkKeyIV(_upload.getByte_file_iv(), chunk_offset))); OutputStream out = new ThrottledOutputStream(con.getOutputStream(), _upload.getMain_panel().getStream_supervisor())) { + try (QueueInputStream qis = new QueueInputStream(); QueueOutputStream qos = qis.newQueueOutputStream(); BufferedInputStream bis = new BufferedInputStream(Channels.newInputStream(f.getChannel())); CipherInputStream cis = new CipherInputStream(qis, genCrypter("AES", "AES/CTR/NoPadding", _upload.getByte_file_key(), forwardMEGALinkKeyIV(_upload.getByte_file_iv(), chunk_offset))); OutputStream out = new ThrottledOutputStream(con.getOutputStream(), _upload.getMain_panel().getStream_supervisor())) { LOG.log(Level.INFO, "{0} Uploading chunk {1} from worker {2} {3}...", new Object[]{Thread.currentThread().getName(), chunk_id, _id, _upload.getFile_name()}); @@ -251,7 +251,7 @@ public void run() { String httpresponse; - try ( InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) { + try (InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) { while ((reads = is.read(buffer)) != -1) { byte_res.write(buffer, 0, reads); diff --git a/src/main/java/com/tonikelope/megabasterd/ChunkWriterManager.java b/src/main/java/com/tonikelope/megabasterd/ChunkWriterManager.java index 8302afabe..a4b24e933 100644 --- a/src/main/java/com/tonikelope/megabasterd/ChunkWriterManager.java +++ b/src/main/java/com/tonikelope/megabasterd/ChunkWriterManager.java @@ -214,7 +214,7 @@ public void run() { int reads; - try ( CipherInputStream cis = new CipherInputStream(new BufferedInputStream(new FileInputStream(chunk_file)), genDecrypter("AES", "AES/CTR/NoPadding", _byte_file_key, forwardMEGALinkKeyIV(_byte_iv, _bytes_written)))) { + try (CipherInputStream cis = new CipherInputStream(new BufferedInputStream(new FileInputStream(chunk_file)), genDecrypter("AES", "AES/CTR/NoPadding", _byte_file_key, forwardMEGALinkKeyIV(_byte_iv, _bytes_written)))) { while ((reads = cis.read(buffer)) != -1) { _download.getOutput_stream().write(buffer, 0, reads); } diff --git a/src/main/java/com/tonikelope/megabasterd/CryptTools.java b/src/main/java/com/tonikelope/megabasterd/CryptTools.java index 1bab086ce..4b54398da 100644 --- a/src/main/java/com/tonikelope/megabasterd/CryptTools.java +++ b/src/main/java/com/tonikelope/megabasterd/CryptTools.java @@ -309,7 +309,7 @@ public static HashSet decryptELC(String link, MainPanel main_panel) { if (compression) { - try ( InputStream is = new GZIPInputStream(new ByteArrayInputStream(elc_byte)); ByteArrayOutputStream out = new ByteArrayOutputStream()) { + try (InputStream is = new GZIPInputStream(new ByteArrayInputStream(elc_byte)); ByteArrayOutputStream out = new ByteArrayOutputStream()) { byte[] buffer = new byte[MainPanel.DEFAULT_BYTE_BUFFER_SIZE]; @@ -437,7 +437,7 @@ public static HashSet decryptELC(String link, MainPanel main_panel) { con.getOutputStream().close(); - try ( InputStream is = con.getInputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream()) { + try (InputStream is = con.getInputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream()) { byte[] buffer = new byte[MainPanel.DEFAULT_BYTE_BUFFER_SIZE]; @@ -558,7 +558,7 @@ public static HashSet decryptDLC(String data, MainPanel main_panel) { String enc_dlc_key; - try ( InputStream is = con.getInputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream()) { + try (InputStream is = con.getInputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream()) { byte[] buffer = new byte[MainPanel.DEFAULT_BYTE_BUFFER_SIZE]; int reads; while ((reads = is.read(buffer)) != -1) { diff --git a/src/main/java/com/tonikelope/megabasterd/DBTools.java b/src/main/java/com/tonikelope/megabasterd/DBTools.java index 29957b542..e95f9634c 100644 --- a/src/main/java/com/tonikelope/megabasterd/DBTools.java +++ b/src/main/java/com/tonikelope/megabasterd/DBTools.java @@ -30,7 +30,7 @@ public class DBTools { public static synchronized void setupSqliteTables() throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { stat.executeUpdate("CREATE TABLE IF NOT EXISTS downloads(url TEXT, email TEXT, path TEXT, filename TEXT, filekey TEXT, filesize UNSIGNED BIG INT, filepass VARCHAR(64), filenoexpire VARCHAR(64), custom_chunks_dir TEXT, PRIMARY KEY ('url'), UNIQUE(path, filename));"); stat.executeUpdate("CREATE TABLE IF NOT EXISTS uploads(filename TEXT, email TEXT, url TEXT, ul_key TEXT, parent_node TEXT, root_node TEXT, share_key TEXT, folder_link TEXT, bytes_uploaded UNSIGNED BIG INT, meta_mac TEXT, PRIMARY KEY ('filename'), UNIQUE(filename, email));"); @@ -45,7 +45,7 @@ public static synchronized void setupSqliteTables() throws SQLException { public static synchronized void vaccum() throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { stat.execute("VACUUM"); } @@ -53,7 +53,7 @@ public static synchronized void vaccum() throws SQLException { public static synchronized void insertDownloadsQueue(ArrayList queue) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO downloads_queue (url) VALUES (?)")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO downloads_queue (url) VALUES (?)")) { if (!queue.isEmpty()) { @@ -75,7 +75,7 @@ public static synchronized ArrayList selectDownloadsQueue() throws SQLEx ResultSet res; - try ( Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { res = stat.executeQuery("SELECT * FROM downloads_queue ORDER BY rowid"); @@ -90,7 +90,7 @@ public static synchronized ArrayList selectDownloadsQueue() throws SQLEx public static synchronized void truncateDownloadsQueue() throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { stat.execute("DELETE FROM downloads_queue"); } @@ -98,7 +98,7 @@ public static synchronized void truncateDownloadsQueue() throws SQLException { public static synchronized void insertUploadsQueue(ArrayList queue) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO uploads_queue (filename) VALUES (?)")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO uploads_queue (filename) VALUES (?)")) { if (!queue.isEmpty()) { @@ -120,7 +120,7 @@ public static synchronized ArrayList selectUploadsQueue() throws SQLExce ResultSet res; - try ( Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { res = stat.executeQuery("SELECT * FROM uploads_queue ORDER BY rowid"); @@ -135,7 +135,7 @@ public static synchronized ArrayList selectUploadsQueue() throws SQLExce public static synchronized void truncateUploadsQueue() throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { stat.execute("DELETE FROM uploads_queue"); } @@ -143,7 +143,7 @@ public static synchronized void truncateUploadsQueue() throws SQLException { public static synchronized void insertMegaSession(String email, byte[] ma, boolean crypt) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO mega_sessions (email, ma, crypt) VALUES (?,?,?)")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO mega_sessions (email, ma, crypt) VALUES (?,?,?)")) { ps.setString(1, email); ps.setBytes(2, ma); @@ -155,7 +155,7 @@ public static synchronized void insertMegaSession(String email, byte[] ma, boole public static synchronized void truncateMegaSessions() throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { stat.execute("DELETE FROM mega_sessions"); } @@ -165,7 +165,7 @@ public static synchronized HashMap selectMegaSession(String emai HashMap session = null; - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("SELECT * from mega_sessions WHERE email=?")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("SELECT * from mega_sessions WHERE email=?")) { ps.setString(1, email); @@ -190,7 +190,7 @@ public static synchronized HashMap selectMegaSession(String emai public static synchronized void insertDownload(String url, String email, String path, String filename, String filekey, Long size, String filepass, String filenoexpire, String custom_chunks_dir) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT INTO downloads (url, email, path, filename, filekey, filesize, filepass, filenoexpire, custom_chunks_dir) VALUES (?,?,?,?,?,?,?,?,?)")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT INTO downloads (url, email, path, filename, filekey, filesize, filepass, filenoexpire, custom_chunks_dir) VALUES (?,?,?,?,?,?,?,?,?)")) { ps.setString(1, url); ps.setString(2, email); @@ -208,7 +208,7 @@ public static synchronized void insertDownload(String url, String email, String public static synchronized void deleteDownload(String url) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE FROM downloads WHERE url=?")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE FROM downloads WHERE url=?")) { ps.setString(1, url); @@ -219,7 +219,7 @@ public static synchronized void deleteDownload(String url) throws SQLException { public static synchronized void deleteDownloads(String[] urls) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE FROM downloads WHERE url=?")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE FROM downloads WHERE url=?")) { for (String url : urls) { @@ -234,7 +234,7 @@ public static synchronized void deleteDownloads(String[] urls) throws SQLExcepti public static synchronized void insertUpload(String filename, String email, String parent_node, String ul_key, String root_node, String share_key, String folder_link) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT INTO uploads (filename, email, parent_node, ul_key, root_node, share_key, folder_link, bytes_uploaded, meta_mac) VALUES (?,?,?,?,?,?,?,?,?)")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT INTO uploads (filename, email, parent_node, ul_key, root_node, share_key, folder_link, bytes_uploaded, meta_mac) VALUES (?,?,?,?,?,?,?,?,?)")) { ps.setString(1, filename); ps.setString(2, email); @@ -252,7 +252,7 @@ public static synchronized void insertUpload(String filename, String email, Stri public static synchronized void updateUploadUrl(String filename, String email, String ul_url) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("UPDATE uploads SET url=? WHERE filename=? AND email=?")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("UPDATE uploads SET url=? WHERE filename=? AND email=?")) { ps.setString(1, ul_url); ps.setString(2, filename); @@ -264,7 +264,7 @@ public static synchronized void updateUploadUrl(String filename, String email, S public static synchronized void updateUploadProgress(String filename, String email, Long bytes_uploaded, String meta_mac) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("UPDATE uploads SET bytes_uploaded=?,meta_mac=? WHERE filename=? AND email=?")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("UPDATE uploads SET bytes_uploaded=?,meta_mac=? WHERE filename=? AND email=?")) { ps.setLong(1, bytes_uploaded); ps.setString(2, meta_mac); @@ -277,7 +277,7 @@ public static synchronized void updateUploadProgress(String filename, String ema public static synchronized HashMap selectUploadProgress(String filename, String email) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("SELECT bytes_uploaded,meta_mac FROM uploads WHERE filename=? AND email=?")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("SELECT bytes_uploaded,meta_mac FROM uploads WHERE filename=? AND email=?")) { ps.setString(1, filename); ps.setString(2, email); @@ -297,7 +297,7 @@ public static synchronized HashMap selectUploadProgress(String f public static synchronized void deleteUpload(String filename, String email) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE FROM uploads WHERE filename=? AND email=?")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE FROM uploads WHERE filename=? AND email=?")) { ps.setString(1, filename); @@ -309,7 +309,7 @@ public static synchronized void deleteUpload(String filename, String email) thro public static synchronized void deleteUploads(String[][] uploads) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE FROM uploads WHERE filename=? AND email=?")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE FROM uploads WHERE filename=? AND email=?")) { for (String[] upload : uploads) { @@ -326,7 +326,7 @@ public static synchronized String selectSettingValue(String key) { String value = null; - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("SELECT value from settings WHERE key=?")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("SELECT value from settings WHERE key=?")) { ps.setString(1, key); @@ -344,7 +344,7 @@ public static synchronized String selectSettingValue(String key) { public static synchronized void insertSettingValue(String key, String value) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO settings (key,value) VALUES (?, ?)")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO settings (key,value) VALUES (?, ?)")) { ps.setString(1, key); @@ -360,7 +360,7 @@ public static synchronized HashMap selectSettingsValues() throws ResultSet res; - try ( Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { res = stat.executeQuery("SELECT * FROM settings"); @@ -375,7 +375,7 @@ public static synchronized HashMap selectSettingsValues() throws public static synchronized void insertSettingsValues(HashMap settings) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO settings (key,value) VALUES (?, ?)")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO settings (key,value) VALUES (?, ?)")) { for (Map.Entry entry : settings.entrySet()) { @@ -394,7 +394,7 @@ public static synchronized HashMap> selectDownlo ResultSet res; - try ( Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { res = stat.executeQuery("SELECT * FROM downloads"); @@ -424,7 +424,7 @@ public static synchronized HashMap> selectUpload ResultSet res; - try ( Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { res = stat.executeQuery("SELECT * FROM uploads"); @@ -455,7 +455,7 @@ public static synchronized HashMap selectMegaAccounts() throws S ResultSet res; - try ( Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { res = stat.executeQuery("SELECT * FROM mega_accounts"); @@ -476,7 +476,7 @@ public static synchronized HashMap selectMegaAccounts() throws S public static synchronized void insertMegaAccounts(HashMap accounts) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO mega_accounts (email,password,password_aes,user_hash) VALUES (?, ?, ?, ?)")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO mega_accounts (email,password,password_aes,user_hash) VALUES (?, ?, ?, ?)")) { if (!accounts.isEmpty()) { @@ -500,7 +500,7 @@ public static synchronized void insertMegaAccounts(HashMap accou public static synchronized void insertELCAccounts(HashMap accounts) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO elc_accounts (host,user,apikey) VALUES (?, ?, ?)")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO elc_accounts (host,user,apikey) VALUES (?, ?, ?)")) { if (!accounts.isEmpty()) { @@ -527,7 +527,7 @@ public static synchronized HashMap selectELCAccounts() throws SQ ResultSet res; - try ( Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { res = stat.executeQuery("SELECT * FROM elc_accounts"); @@ -547,7 +547,7 @@ public static synchronized HashMap selectELCAccounts() throws SQ public static synchronized void insertMegaAccount(String email, String password, String password_aes, String user_hash) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO mega_accounts (email,password,password_aes,user_hash) VALUES (?, ?, ?, ?)")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO mega_accounts (email,password,password_aes,user_hash) VALUES (?, ?, ?, ?)")) { ps.setString(1, email); @@ -565,7 +565,7 @@ public static synchronized void insertMegaAccount(String email, String password, public static synchronized void insertELCAccount(String host, String user, String apikey) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO elc_accounts (host,user,apikey) VALUES (?, ?, ?)")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("INSERT OR REPLACE INTO elc_accounts (host,user,apikey) VALUES (?, ?, ?)")) { ps.setString(1, host); @@ -580,7 +580,7 @@ public static synchronized void insertELCAccount(String host, String user, Strin public static synchronized void deleteMegaAccount(String email) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE from mega_accounts WHERE email=?")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE from mega_accounts WHERE email=?")) { ps.setString(1, email); @@ -590,7 +590,7 @@ public static synchronized void deleteMegaAccount(String email) throws SQLExcept public static synchronized void deleteELCAccount(String host) throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE from elc_accounts WHERE host=?")) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); PreparedStatement ps = conn.prepareStatement("DELETE from elc_accounts WHERE host=?")) { ps.setString(1, host); @@ -600,7 +600,7 @@ public static synchronized void deleteELCAccount(String host) throws SQLExceptio public static synchronized void truncateMegaAccounts() throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { stat.execute("DELETE FROM mega_accounts"); } @@ -608,7 +608,7 @@ public static synchronized void truncateMegaAccounts() throws SQLException { public static synchronized void truncateELCAccounts() throws SQLException { - try ( Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { + try (Connection conn = SqliteSingleton.getInstance().getConn(); Statement stat = conn.createStatement()) { stat.execute("DELETE FROM elc_accounts"); } diff --git a/src/main/java/com/tonikelope/megabasterd/Download.java b/src/main/java/com/tonikelope/megabasterd/Download.java index 476b100a4..0946b13fc 100644 --- a/src/main/java/com/tonikelope/megabasterd/Download.java +++ b/src/main/java/com/tonikelope/megabasterd/Download.java @@ -620,7 +620,7 @@ public void run() { getView().printStatusNormal("Truncating temp file..."); - try ( FileChannel out_truncate = new FileOutputStream(temp_filename, true).getChannel()) { + try (FileChannel out_truncate = new FileOutputStream(temp_filename, true).getChannel()) { out_truncate.truncate(max_size); } } @@ -1359,7 +1359,7 @@ private boolean verifyFileCBCMAC(String filename) throws FileNotFoundException, Cipher cryptor = genCrypter("AES", "AES/CBC/NoPadding", byte_file_key, i32a2bin(cbc_iv)); - try ( BufferedInputStream is = new BufferedInputStream(new FileInputStream(filename))) { + try (BufferedInputStream is = new BufferedInputStream(new FileInputStream(filename))) { long chunk_id = 1L; long tot = 0L; diff --git a/src/main/java/com/tonikelope/megabasterd/FileMergerDialog.java b/src/main/java/com/tonikelope/megabasterd/FileMergerDialog.java index b84d8b9f7..fb652bb92 100644 --- a/src/main/java/com/tonikelope/megabasterd/FileMergerDialog.java +++ b/src/main/java/com/tonikelope/megabasterd/FileMergerDialog.java @@ -106,7 +106,7 @@ private void monitorProgress(Path file) { private boolean _mergeFile() throws IOException { - try ( RandomAccessFile targetFile = new RandomAccessFile(_file_name_full, "rw")) { + try (RandomAccessFile targetFile = new RandomAccessFile(_file_name_full, "rw")) { FileChannel targetChannel = targetFile.getChannel(); diff --git a/src/main/java/com/tonikelope/megabasterd/FileSplitterDialog.java b/src/main/java/com/tonikelope/megabasterd/FileSplitterDialog.java index beb18320a..6017098be 100644 --- a/src/main/java/com/tonikelope/megabasterd/FileSplitterDialog.java +++ b/src/main/java/com/tonikelope/megabasterd/FileSplitterDialog.java @@ -124,7 +124,7 @@ private boolean _splitFile(int i) throws IOException { }); - try ( RandomAccessFile sourceFile = new RandomAccessFile(this._files[i].getAbsolutePath(), "r"); FileChannel sourceChannel = sourceFile.getChannel()) { + try (RandomAccessFile sourceFile = new RandomAccessFile(this._files[i].getAbsolutePath(), "r"); FileChannel sourceChannel = sourceFile.getChannel()) { for (; position < numSplits && !_exit; position++, conta_split++) { _writePartToFile(i, bytesPerSplit, position * bytesPerSplit, sourceChannel, conta_split, numSplits + (remainingBytes > 0 ? 1 : 0)); @@ -195,7 +195,7 @@ private void _writePartToFile(int f, long byteSize, long position, FileChannel s monitorProgress(f, byteSize); if (!_exit) { - try ( RandomAccessFile toFile = new RandomAccessFile(fileName.toFile(), "rw"); FileChannel toChannel = toFile.getChannel()) { + try (RandomAccessFile toFile = new RandomAccessFile(fileName.toFile(), "rw"); FileChannel toChannel = toFile.getChannel()) { sourceChannel.position(position); toChannel.transferFrom(sourceChannel, 0, byteSize); } diff --git a/src/main/java/com/tonikelope/megabasterd/MainPanel.java b/src/main/java/com/tonikelope/megabasterd/MainPanel.java index 7761cc99f..9f69278d9 100644 --- a/src/main/java/com/tonikelope/megabasterd/MainPanel.java +++ b/src/main/java/com/tonikelope/megabasterd/MainPanel.java @@ -67,7 +67,7 @@ */ public final class MainPanel { - public static final String VERSION = "7.74"; + public static final String VERSION = "7.76"; public static final boolean FORCE_SMART_PROXY = false; //TRUE FOR DEBUGING SMART PROXY public static final int THROTTLE_SLICE_SIZE = 16 * 1024; public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024; @@ -399,7 +399,6 @@ public MainPanel() { openBrowserURL("https://mega.nz/sdk"); }*/ - } public static Boolean getResume_uploads() { diff --git a/src/main/java/com/tonikelope/megabasterd/MegaAPI.java b/src/main/java/com/tonikelope/megabasterd/MegaAPI.java index fee057954..e6ce99697 100644 --- a/src/main/java/com/tonikelope/megabasterd/MegaAPI.java +++ b/src/main/java/com/tonikelope/megabasterd/MegaAPI.java @@ -367,6 +367,8 @@ public void fetchNodes() throws IOException { private String _rawRequest(String request, URL url_api) throws MegaAPIException { + System.out.println(request); + String response = null, current_smart_proxy = null; int mega_error = 0, http_error = 0, conta_error = 0, http_status; @@ -480,7 +482,7 @@ private String _rawRequest(String request, URL url_api) throws MegaAPIException } else { - try ( InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) { + try (InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) { byte[] buffer = new byte[MainPanel.DEFAULT_BYTE_BUFFER_SIZE]; @@ -793,12 +795,12 @@ public String uploadThumbnails(Upload upload, String node_handle, String filenam int reads; - try ( OutputStream out = new ThrottledOutputStream(con.getOutputStream(), upload.getMain_panel().getStream_supervisor())) { + try (OutputStream out = new ThrottledOutputStream(con.getOutputStream(), upload.getMain_panel().getStream_supervisor())) { out.write(file_bytes[h]); } - try ( InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) { + try (InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) { while ((reads = is.read(buffer)) != -1) { byte_res.write(buffer, 0, reads); @@ -1039,7 +1041,8 @@ public String shareFolder(String node, byte[] node_key, byte[] share_key) { String ha = cryptoHandleauth(node); - String request = "[{\"a\":\"s2\",\"n\":\"" + node + "\",\"s\":[{\"u\":\"EXP\",\"r\":0}],\"i\":\"" + _req_id + "\",\"ok\":\"" + ok + "\",\"ha\":\"" + ha + "\",\"cr\":[[\"" + node + "\"],[\"" + node + "\"],[0,0,\"" + enc_nk + "\"]]}]"; + //OJO + String request = "[{\"a\":\"s2\",\"n\":\"" + node + "\",\"s\":[{\"u\":\"EXP\",\"r\":0}],\"i\":\"" + _req_id + "\",\"ok\":\"AAAAAAAAAAAAAAAAAAAAAA\",\"ha\":\"AAAAAAAAAAAAAAAAAAAAAA\",\"cr\":[[\"" + node + "\"],[\"" + node + "\"],[0,0,\"" + enc_nk + "\"]]}]"; URL url_api = new URL(API_URL + "/cs?id=" + String.valueOf(_seqno) + (_sid != null ? "&sid=" + _sid : "") + (API_KEY != null ? "&ak=" + API_KEY : "")); diff --git a/src/main/java/com/tonikelope/megabasterd/MegaCrypterAPI.java b/src/main/java/com/tonikelope/megabasterd/MegaCrypterAPI.java index 2cede3cd4..e88ebe586 100644 --- a/src/main/java/com/tonikelope/megabasterd/MegaCrypterAPI.java +++ b/src/main/java/com/tonikelope/megabasterd/MegaCrypterAPI.java @@ -81,7 +81,7 @@ private static String _rawRequest(String request, URL url_api) throws MegaCrypte } else { - try ( InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) { + try (InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) { byte[] buffer = new byte[MainPanel.DEFAULT_BYTE_BUFFER_SIZE]; diff --git a/src/main/java/com/tonikelope/megabasterd/MiscTools.java b/src/main/java/com/tonikelope/megabasterd/MiscTools.java index d7dbee679..7b3a6b76a 100644 --- a/src/main/java/com/tonikelope/megabasterd/MiscTools.java +++ b/src/main/java/com/tonikelope/megabasterd/MiscTools.java @@ -196,7 +196,7 @@ public static String getFechaHoraActual(String format) { public static void deleteDirectoryRecursion(Path path) throws IOException { if (Files.isDirectory(path, LinkOption.NOFOLLOW_LINKS)) { - try ( DirectoryStream entries = Files.newDirectoryStream(path)) { + try (DirectoryStream entries = Files.newDirectoryStream(path)) { for (Path entry : entries) { deleteDirectoryRecursion(entry); } @@ -1111,7 +1111,7 @@ public static String getMyPublicIP() { con.setUseCaches(false); - try ( InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) { + try (InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) { byte[] buffer = new byte[MainPanel.DEFAULT_BYTE_BUFFER_SIZE]; @@ -1165,7 +1165,7 @@ public static String checkNewVersion(String url) { con.setUseCaches(false); - try ( InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) { + try (InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) { byte[] buffer = new byte[MainPanel.DEFAULT_BYTE_BUFFER_SIZE]; @@ -1435,7 +1435,7 @@ public static MegaAPI checkMegaAccountLoginAndShowMasterPassDialog(MainPanel mai ByteArrayInputStream bs = new ByteArrayInputStream(CryptTools.aes_cbc_decrypt_pkcs7((byte[]) old_session_data.get("ma"), main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV)); - try ( ObjectInputStream is = new ObjectInputStream(bs)) { + try (ObjectInputStream is = new ObjectInputStream(bs)) { old_ma = (MegaAPI) is.readObject(); @@ -1447,7 +1447,7 @@ public static MegaAPI checkMegaAccountLoginAndShowMasterPassDialog(MainPanel mai ByteArrayInputStream bs = new ByteArrayInputStream((byte[]) old_session_data.get("ma")); - try ( ObjectInputStream is = new ObjectInputStream(bs)) { + try (ObjectInputStream is = new ObjectInputStream(bs)) { old_ma = (MegaAPI) is.readObject(); } catch (Exception ex) { unserialization_error = true; @@ -1488,7 +1488,7 @@ public static MegaAPI checkMegaAccountLoginAndShowMasterPassDialog(MainPanel mai ByteArrayOutputStream bs = new ByteArrayOutputStream(); - try ( ObjectOutputStream os = new ObjectOutputStream(bs)) { + try (ObjectOutputStream os = new ObjectOutputStream(bs)) { os.writeObject(ma); } diff --git a/src/main/java/com/tonikelope/megabasterd/SettingsDialog.form b/src/main/java/com/tonikelope/megabasterd/SettingsDialog.form index e20dc4009..62c8b2c5e 100644 --- a/src/main/java/com/tonikelope/megabasterd/SettingsDialog.form +++ b/src/main/java/com/tonikelope/megabasterd/SettingsDialog.form @@ -1099,10 +1099,13 @@ - - + + + + + @@ -1141,12 +1144,12 @@ - - + - + + @@ -1578,6 +1581,9 @@ + + + @@ -1620,9 +1626,6 @@ - - - @@ -1630,6 +1633,7 @@ + @@ -1640,16 +1644,16 @@ + + + - + - - - diff --git a/src/main/java/com/tonikelope/megabasterd/SettingsDialog.java b/src/main/java/com/tonikelope/megabasterd/SettingsDialog.java index e3f26f90f..9b303f530 100644 --- a/src/main/java/com/tonikelope/megabasterd/SettingsDialog.java +++ b/src/main/java/com/tonikelope/megabasterd/SettingsDialog.java @@ -1599,28 +1599,22 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { debug_file_checkbox.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N debug_file_checkbox.setText("Save debug info to file"); + mega_api_key_panel.setOpaque(false); + mega_api_key_label.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N mega_api_key_label.setText("MEGA API KEY:"); mega_api_key_label.setDoubleBuffered(true); - mega_api_key_label.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - mega_api_key_labelMouseClicked(evt); - } - }); mega_api_key.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N mega_api_key.setDoubleBuffered(true); + mega_api_key.setEnabled(false); mega_api_key_warning.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + mega_api_key_warning.setForeground(new java.awt.Color(0, 0, 255)); mega_api_key_warning.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); - mega_api_key_warning.setText("WARNING: USING MEGA API WITHOUT API KEY MAY VIOLATE ITS TERM OF USE. YOU SHOULD GET A KEY -> https://mega.nz/sdk"); + mega_api_key_warning.setText("MEGA API KEY IS NO LONGER REQUIRED (DISABLED)"); mega_api_key_warning.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); mega_api_key_warning.setDoubleBuffered(true); - mega_api_key_warning.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - mega_api_key_warningMouseClicked(evt); - } - }); javax.swing.GroupLayout mega_api_key_panelLayout = new javax.swing.GroupLayout(mega_api_key_panel); mega_api_key_panel.setLayout(mega_api_key_panelLayout); @@ -1684,10 +1678,12 @@ public void mouseClicked(java.awt.event.MouseEvent evt) { .addGroup(advanced_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(start_frozen_checkbox) .addComponent(debug_file_checkbox) - .addComponent(custom_chunks_dir_checkbox) .addGroup(advanced_panelLayout.createSequentialGroup() - .addComponent(custom_chunks_dir_button) + .addComponent(custom_chunks_dir_checkbox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(custom_chunks_dir_button)) + .addGroup(advanced_panelLayout.createSequentialGroup() + .addGap(165, 165, 165) .addComponent(custom_chunks_dir_current_label)) .addComponent(rec_zoom_label) .addGroup(advanced_panelLayout.createSequentialGroup() @@ -1716,11 +1712,11 @@ public void mouseClicked(java.awt.event.MouseEvent evt) { .addComponent(language_combo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton1)) .addGap(18, 18, 18) - .addComponent(custom_chunks_dir_checkbox) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(advanced_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(custom_chunks_dir_button) - .addComponent(custom_chunks_dir_current_label)) + .addComponent(custom_chunks_dir_checkbox) + .addComponent(custom_chunks_dir_button)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(custom_chunks_dir_current_label) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(mega_api_key_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) @@ -2152,7 +2148,7 @@ private void save_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F ByteArrayOutputStream bs = new ByteArrayOutputStream(); - try ( ObjectOutputStream os = new ObjectOutputStream(bs)) { + try (ObjectOutputStream os = new ObjectOutputStream(bs)) { os.writeObject(ma); } @@ -2239,7 +2235,7 @@ private void save_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F ByteArrayOutputStream bs = new ByteArrayOutputStream(); - try ( ObjectOutputStream os = new ObjectOutputStream(bs)) { + try (ObjectOutputStream os = new ObjectOutputStream(bs)) { os.writeObject(ma); } @@ -2850,7 +2846,7 @@ private void export_settings_buttonActionPerformed(java.awt.event.ActionEvent ev file.createNewFile(); - try ( BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(file)); ObjectOutputStream oos = new ObjectOutputStream(fos)) { + try (BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(file)); ObjectOutputStream oos = new ObjectOutputStream(fos)) { HashMap settings = new HashMap<>(); @@ -2901,7 +2897,7 @@ private void import_settings_buttonActionPerformed(java.awt.event.ActionEvent ev try { - try ( InputStream fis = new BufferedInputStream(new FileInputStream(file)); ObjectInputStream ois = new ObjectInputStream(fis)) { + try (InputStream fis = new BufferedInputStream(new FileInputStream(file)); ObjectInputStream ois = new ObjectInputStream(fis)) { HashMap settings = (HashMap) ois.readObject(); @@ -3070,16 +3066,6 @@ private void megacrypter_reverse_checkboxStateChanged(javax.swing.event.ChangeEv megacrypter_reverse_warning_label.setEnabled(megacrypter_reverse_checkbox.isSelected()); }//GEN-LAST:event_megacrypter_reverse_checkboxStateChanged - private void mega_api_key_warningMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_mega_api_key_warningMouseClicked - // TODO add your handling code here: - openBrowserURL("https://mega.nz/sdk"); - }//GEN-LAST:event_mega_api_key_warningMouseClicked - - private void mega_api_key_labelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_mega_api_key_labelMouseClicked - // TODO add your handling code here: - mega_api_key_warningMouseClicked(evt); - }//GEN-LAST:event_mega_api_key_labelMouseClicked - private void import_mega_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_import_mega_buttonActionPerformed // TODO add your handling code here: diff --git a/src/main/java/com/tonikelope/megabasterd/SmartMegaProxyManager.java b/src/main/java/com/tonikelope/megabasterd/SmartMegaProxyManager.java index d84ecd036..082dca3ec 100644 --- a/src/main/java/com/tonikelope/megabasterd/SmartMegaProxyManager.java +++ b/src/main/java/com/tonikelope/megabasterd/SmartMegaProxyManager.java @@ -185,7 +185,7 @@ public synchronized void refreshProxyList() { con.setRequestProperty("User-Agent", MainPanel.DEFAULT_USER_AGENT); - try ( InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) { + try (InputStream is = con.getInputStream(); ByteArrayOutputStream byte_res = new ByteArrayOutputStream()) { byte[] buffer = new byte[MainPanel.DEFAULT_BYTE_BUFFER_SIZE]; diff --git a/src/main/java/com/tonikelope/megabasterd/StreamChunkDownloader.java b/src/main/java/com/tonikelope/megabasterd/StreamChunkDownloader.java index 902c6d6ac..6f570c864 100644 --- a/src/main/java/com/tonikelope/megabasterd/StreamChunkDownloader.java +++ b/src/main/java/com/tonikelope/megabasterd/StreamChunkDownloader.java @@ -201,7 +201,7 @@ public void run() { } else { - try ( InputStream is = con.getInputStream()) { + try (InputStream is = con.getInputStream()) { int chunk_writes = 0; diff --git a/src/main/java/com/tonikelope/megabasterd/UploadMACGenerator.java b/src/main/java/com/tonikelope/megabasterd/UploadMACGenerator.java index 2002bca2d..599cc1c3c 100644 --- a/src/main/java/com/tonikelope/megabasterd/UploadMACGenerator.java +++ b/src/main/java/com/tonikelope/megabasterd/UploadMACGenerator.java @@ -151,11 +151,11 @@ public void run() { long conta_chunk = 0L; - try ( ByteArrayOutputStream baos = CHUNK_QUEUE.remove(chunk_offset)) { + try (ByteArrayOutputStream baos = CHUNK_QUEUE.remove(chunk_offset)) { chunk_bytes = baos.toByteArray(); } - try ( ByteArrayInputStream bais = new ByteArrayInputStream(chunk_bytes)) { + try (ByteArrayInputStream bais = new ByteArrayInputStream(chunk_bytes)) { while (conta_chunk < chunk_size && (reads = bais.read(byte_block)) != -1) { if (reads < byte_block.length) { diff --git a/src/main/resources/images/mbasterd_screen.png b/src/main/resources/images/mbasterd_screen.png index 8d778b4eb..8ddbf20c8 100644 Binary files a/src/main/resources/images/mbasterd_screen.png and b/src/main/resources/images/mbasterd_screen.png differ