mirror of
https://github.com/tonikelope/megabasterd.git
synced 2025-05-17 06:47:11 +02:00
1.46
-Fix
This commit is contained in:
parent
bfa1fc84b6
commit
ef84b2dbb4
@ -125,8 +125,6 @@ public class ChunkDownloader implements Runnable, SecureNotifiable {
|
|||||||
|
|
||||||
HttpGet httpget = new HttpGet(new URI(chunk.getUrl()));
|
HttpGet httpget = new HttpGet(new URI(chunk.getUrl()));
|
||||||
|
|
||||||
httpget.addHeader("Connection", "close");
|
|
||||||
|
|
||||||
error = false;
|
error = false;
|
||||||
|
|
||||||
try (CloseableHttpResponse httpresponse = httpclient.execute(httpget)) {
|
try (CloseableHttpResponse httpresponse = httpclient.execute(httpget)) {
|
||||||
|
@ -59,8 +59,6 @@ public class ChunkDownloaderMono extends ChunkDownloader {
|
|||||||
|
|
||||||
httpget = new HttpGet(new URI(worker_url + "/" + chunk.getOffset()));
|
httpget = new HttpGet(new URI(worker_url + "/" + chunk.getOffset()));
|
||||||
|
|
||||||
httpget.addHeader("Connection", "close");
|
|
||||||
|
|
||||||
httpresponse = httpclient.execute(httpget);
|
httpresponse = httpclient.execute(httpget);
|
||||||
|
|
||||||
is = new ThrottledInputStream(httpresponse.getEntity().getContent(), getDownload().getMain_panel().getStream_supervisor());
|
is = new ThrottledInputStream(httpresponse.getEntity().getContent(), getDownload().getMain_panel().getStream_supervisor());
|
||||||
|
@ -147,8 +147,6 @@ public class ChunkUploader implements Runnable, SecureNotifiable {
|
|||||||
|
|
||||||
final long postdata_length = chunk.getSize();
|
final long postdata_length = chunk.getSize();
|
||||||
|
|
||||||
httppost.addHeader("Connection", "close");
|
|
||||||
|
|
||||||
tot_bytes_up = 0;
|
tot_bytes_up = 0;
|
||||||
|
|
||||||
error = false;
|
error = false;
|
||||||
|
@ -84,8 +84,6 @@ public class ChunkUploaderMono extends ChunkUploader {
|
|||||||
|
|
||||||
final long postdata_length = getUpload().getFile_size() - chunk.getOffset();
|
final long postdata_length = getUpload().getFile_size() - chunk.getOffset();
|
||||||
|
|
||||||
httppost.addHeader("Connection", "close");
|
|
||||||
|
|
||||||
final PipedInputStream pipein = new PipedInputStream();
|
final PipedInputStream pipein = new PipedInputStream();
|
||||||
|
|
||||||
PipedOutputStream pipeout = new PipedOutputStream(pipein);
|
PipedOutputStream pipeout = new PipedOutputStream(pipein);
|
||||||
|
@ -301,7 +301,7 @@ public final class CryptTools {
|
|||||||
HashSet<String> links = new HashSet<>();
|
HashSet<String> links = new HashSet<>();
|
||||||
|
|
||||||
if ((elc = findFirstRegex("mega://elc\\?([0-9a-zA-Z,_-]+)", link, 1)) != null) {
|
if ((elc = findFirstRegex("mega://elc\\?([0-9a-zA-Z,_-]+)", link, 1)) != null) {
|
||||||
System.out.println(elc);
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
byte[] elc_byte = UrlBASE642Bin(elc);
|
byte[] elc_byte = UrlBASE642Bin(elc);
|
||||||
@ -345,6 +345,11 @@ public final class CryptTools {
|
|||||||
|
|
||||||
byte[] url_bin = Arrays.copyOfRange(elc_byte, 4 + bin_links_length + 2, 4 + bin_links_length + 2 + url_bin_length);
|
byte[] url_bin = Arrays.copyOfRange(elc_byte, 4 + bin_links_length + 2, 4 + bin_links_length + 2 + url_bin_length);
|
||||||
|
|
||||||
|
if(!new String(url_bin).contains("http")) {
|
||||||
|
|
||||||
|
throw new Exception("BAD ELC HOST URL!");
|
||||||
|
}
|
||||||
|
|
||||||
short pass_bin_length = ByteBuffer.wrap(recReverseArray(Arrays.copyOfRange(elc_byte, 4 + bin_links_length + 2 + url_bin_length, 4 + bin_links_length + 2 + url_bin_length + 2), 0, 1)).getShort();
|
short pass_bin_length = ByteBuffer.wrap(recReverseArray(Arrays.copyOfRange(elc_byte, 4 + bin_links_length + 2 + url_bin_length, 4 + bin_links_length + 2 + url_bin_length + 2), 0, 1)).getShort();
|
||||||
|
|
||||||
byte[] pass_bin = Arrays.copyOfRange(elc_byte, 4 + bin_links_length + 2 + url_bin_length + 2, 4 + bin_links_length + 2 + url_bin_length + 2 + pass_bin_length);
|
byte[] pass_bin = Arrays.copyOfRange(elc_byte, 4 + bin_links_length + 2 + url_bin_length + 2, 4 + bin_links_length + 2 + url_bin_length + 2 + pass_bin_length);
|
||||||
@ -353,6 +358,8 @@ public final class CryptTools {
|
|||||||
|
|
||||||
HttpPost httppost = new HttpPost(new String(url_bin));
|
HttpPost httppost = new HttpPost(new String(url_bin));
|
||||||
|
|
||||||
|
httppost.setHeader("Custom-User-Agent", MainPanel.DEFAULT_USER_AGENT);
|
||||||
|
|
||||||
ArrayList<NameValuePair> nameValuePairs = new ArrayList<>();
|
ArrayList<NameValuePair> nameValuePairs = new ArrayList<>();
|
||||||
|
|
||||||
nameValuePairs.add(new BasicNameValuePair("OPERATION_TYPE", "D"));
|
nameValuePairs.add(new BasicNameValuePair("OPERATION_TYPE", "D"));
|
||||||
@ -483,7 +490,7 @@ public final class CryptTools {
|
|||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Logger.getLogger(MiscTools.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(MiscTools.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
JOptionPane.showMessageDialog(main_panel.getView(), ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
|
JOptionPane.showMessageDialog(main_panel.getView(), ex.getMessage(), "ELC decryption Error", JOptionPane.ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,8 +504,6 @@ public final class KissVideoStreamServer implements HttpHandler, SecureNotifiabl
|
|||||||
|
|
||||||
httpget = new HttpGet(url.toURI());
|
httpget = new HttpGet(url.toURI());
|
||||||
|
|
||||||
httpget.addHeader("Connection", "close");
|
|
||||||
|
|
||||||
try (CloseableHttpResponse httpresponse = httpclient.execute(httpget)) {
|
try (CloseableHttpResponse httpresponse = httpclient.execute(httpget)) {
|
||||||
|
|
||||||
is = httpresponse.getEntity().getContent();
|
is = httpresponse.getEntity().getContent();
|
||||||
|
@ -59,7 +59,7 @@ import static megabasterd.Transference.MAX_TRANSFERENCE_SPEED_DEFAULT;
|
|||||||
*/
|
*/
|
||||||
public final class MainPanel {
|
public final class MainPanel {
|
||||||
|
|
||||||
public static final String VERSION = "1.45";
|
public static final String VERSION = "1.46";
|
||||||
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
|
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
|
||||||
public static final int STREAMER_PORT = 1337;
|
public static final int STREAMER_PORT = 1337;
|
||||||
public static final int WATCHDOG_PORT = 1338;
|
public static final int WATCHDOG_PORT = 1338;
|
||||||
|
@ -291,8 +291,6 @@ public final class MegaAPI {
|
|||||||
|
|
||||||
httppost.setHeader("Content-type", "application/json");
|
httppost.setHeader("Content-type", "application/json");
|
||||||
|
|
||||||
httppost.addHeader("Connection", "close");
|
|
||||||
|
|
||||||
httppost.setEntity(new StringEntity(request));
|
httppost.setEntity(new StringEntity(request));
|
||||||
|
|
||||||
try (CloseableHttpResponse httpresponse = httpclient.execute(httppost)) {
|
try (CloseableHttpResponse httpresponse = httpclient.execute(httppost)) {
|
||||||
|
@ -61,9 +61,7 @@ public final class MegaCrypterAPI {
|
|||||||
|
|
||||||
httppost.setHeader("Content-type", "application/json");
|
httppost.setHeader("Content-type", "application/json");
|
||||||
|
|
||||||
httppost.setHeader("User-Agent", MainPanel.DEFAULT_USER_AGENT);
|
httppost.setHeader("Custom-User-Agent", MainPanel.DEFAULT_USER_AGENT);
|
||||||
|
|
||||||
httppost.addHeader("Connection", "close");
|
|
||||||
|
|
||||||
httppost.setEntity(new StringEntity(request));
|
httppost.setEntity(new StringEntity(request));
|
||||||
|
|
||||||
|
@ -563,8 +563,6 @@ public final class MiscTools {
|
|||||||
|
|
||||||
httpget.addHeader("Custom-User-Agent", MainPanel.DEFAULT_USER_AGENT);
|
httpget.addHeader("Custom-User-Agent", MainPanel.DEFAULT_USER_AGENT);
|
||||||
|
|
||||||
httpget.addHeader("Connection", "close");
|
|
||||||
|
|
||||||
try (CloseableHttpResponse httpresponse = httpclient.execute(httpget)) {
|
try (CloseableHttpResponse httpresponse = httpclient.execute(httpget)) {
|
||||||
|
|
||||||
InputStream is = httpresponse.getEntity().getContent();
|
InputStream is = httpresponse.getEntity().getContent();
|
||||||
@ -914,8 +912,6 @@ public final class MiscTools {
|
|||||||
|
|
||||||
HttpGet httpget = new HttpGet(new URI(string_url + "/0"));
|
HttpGet httpget = new HttpGet(new URI(string_url + "/0"));
|
||||||
|
|
||||||
httpget.addHeader("Connection", "close");
|
|
||||||
|
|
||||||
try (CloseableHttpResponse httpresponse = httpclient.execute(httpget)) {
|
try (CloseableHttpResponse httpresponse = httpclient.execute(httpget)) {
|
||||||
|
|
||||||
url_ok = (httpresponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK);
|
url_ok = (httpresponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK);
|
||||||
|
@ -1004,22 +1004,26 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
|||||||
|
|
||||||
String user = (String) elc_account_data.get("user");
|
String user = (String) elc_account_data.get("user");
|
||||||
|
|
||||||
|
String apikey = (String) elc_account_data.get("apikey");
|
||||||
|
|
||||||
if (_main_panel.getMaster_pass() != null) {
|
if (_main_panel.getMaster_pass() != null) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
user = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin(user), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
user = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin(user), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||||
|
|
||||||
|
apikey = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin(apikey), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Logger.getLogger(SettingsDialog.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(SettingsDialog.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!user.equals(user_table)) {
|
if (!user.equals(user_table) || !apikey.equals(apikey_table)) {
|
||||||
|
|
||||||
user = user_table;
|
user = user_table;
|
||||||
|
|
||||||
String apikey = apikey_table;
|
apikey = apikey_table;
|
||||||
|
|
||||||
if (_main_panel.getMaster_pass() != null) {
|
if (_main_panel.getMaster_pass() != null) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user