-Fix
This commit is contained in:
tonikelope 2016-10-28 19:32:09 +02:00
parent bfa1fc84b6
commit ef84b2dbb4
11 changed files with 17 additions and 24 deletions

View File

@ -125,8 +125,6 @@ public class ChunkDownloader implements Runnable, SecureNotifiable {
HttpGet httpget = new HttpGet(new URI(chunk.getUrl()));
httpget.addHeader("Connection", "close");
error = false;
try (CloseableHttpResponse httpresponse = httpclient.execute(httpget)) {

View File

@ -59,8 +59,6 @@ public class ChunkDownloaderMono extends ChunkDownloader {
httpget = new HttpGet(new URI(worker_url + "/" + chunk.getOffset()));
httpget.addHeader("Connection", "close");
httpresponse = httpclient.execute(httpget);
is = new ThrottledInputStream(httpresponse.getEntity().getContent(), getDownload().getMain_panel().getStream_supervisor());

View File

@ -147,8 +147,6 @@ public class ChunkUploader implements Runnable, SecureNotifiable {
final long postdata_length = chunk.getSize();
httppost.addHeader("Connection", "close");
tot_bytes_up = 0;
error = false;

View File

@ -84,8 +84,6 @@ public class ChunkUploaderMono extends ChunkUploader {
final long postdata_length = getUpload().getFile_size() - chunk.getOffset();
httppost.addHeader("Connection", "close");
final PipedInputStream pipein = new PipedInputStream();
PipedOutputStream pipeout = new PipedOutputStream(pipein);

View File

@ -301,7 +301,7 @@ public final class CryptTools {
HashSet<String> links = new HashSet<>();
if ((elc = findFirstRegex("mega://elc\\?([0-9a-zA-Z,_-]+)", link, 1)) != null) {
System.out.println(elc);
try {
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);
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();
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);
@ -352,6 +357,8 @@ public final class CryptTools {
try (CloseableHttpClient httpclient = getApacheKissHttpClient()) {
HttpPost httppost = new HttpPost(new String(url_bin));
httppost.setHeader("Custom-User-Agent", MainPanel.DEFAULT_USER_AGENT);
ArrayList<NameValuePair> nameValuePairs = new ArrayList<>();
@ -483,7 +490,7 @@ public final class CryptTools {
} catch (Exception 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);
}
}

View File

@ -504,8 +504,6 @@ public final class KissVideoStreamServer implements HttpHandler, SecureNotifiabl
httpget = new HttpGet(url.toURI());
httpget.addHeader("Connection", "close");
try (CloseableHttpResponse httpresponse = httpclient.execute(httpget)) {
is = httpresponse.getEntity().getContent();

View File

@ -59,7 +59,7 @@ import static megabasterd.Transference.MAX_TRANSFERENCE_SPEED_DEFAULT;
*/
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 STREAMER_PORT = 1337;
public static final int WATCHDOG_PORT = 1338;

View File

@ -291,8 +291,6 @@ public final class MegaAPI {
httppost.setHeader("Content-type", "application/json");
httppost.addHeader("Connection", "close");
httppost.setEntity(new StringEntity(request));
try (CloseableHttpResponse httpresponse = httpclient.execute(httppost)) {

View File

@ -61,9 +61,7 @@ public final class MegaCrypterAPI {
httppost.setHeader("Content-type", "application/json");
httppost.setHeader("User-Agent", MainPanel.DEFAULT_USER_AGENT);
httppost.addHeader("Connection", "close");
httppost.setHeader("Custom-User-Agent", MainPanel.DEFAULT_USER_AGENT);
httppost.setEntity(new StringEntity(request));

View File

@ -563,8 +563,6 @@ public final class MiscTools {
httpget.addHeader("Custom-User-Agent", MainPanel.DEFAULT_USER_AGENT);
httpget.addHeader("Connection", "close");
try (CloseableHttpResponse httpresponse = httpclient.execute(httpget)) {
InputStream is = httpresponse.getEntity().getContent();
@ -914,8 +912,6 @@ public final class MiscTools {
HttpGet httpget = new HttpGet(new URI(string_url + "/0"));
httpget.addHeader("Connection", "close");
try (CloseableHttpResponse httpresponse = httpclient.execute(httpget)) {
url_ok = (httpresponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK);

View File

@ -1003,23 +1003,27 @@ public final class SettingsDialog extends javax.swing.JDialog {
HashMap<String, Object> elc_account_data = (HashMap) _main_panel.getElc_accounts().get(host_table);
String user = (String) elc_account_data.get("user");
String apikey = (String) elc_account_data.get("apikey");
if (_main_panel.getMaster_pass() != null) {
try {
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) {
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;
String apikey = apikey_table;
apikey = apikey_table;
if (_main_panel.getMaster_pass() != null) {