mirror of
https://github.com/tonikelope/megabasterd.git
synced 2025-05-21 16:57:11 +02:00
6.33
-Trying to fix UTF-8 Windows
This commit is contained in:
parent
f95789c162
commit
c082c65451
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.tonikelope</groupId>
|
||||
<artifactId>MegaBasterd</artifactId>
|
||||
<version>6.32</version>
|
||||
<version>6.33</version>
|
||||
<packaging>jar</packaging>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -204,7 +204,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
if (MainPanel.getProxy_user() != null && !"".equals(MainPanel.getProxy_user())) {
|
||||
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes()));
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes("UTF-8")));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -71,7 +71,7 @@ public class ChunkDownloaderMono extends ChunkDownloader {
|
||||
|
||||
if (MainPanel.getProxy_user() != null && !"".equals(MainPanel.getProxy_user())) {
|
||||
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes()));
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes("UTF-8")));
|
||||
}
|
||||
} else {
|
||||
|
||||
|
@ -137,7 +137,7 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
if (MainPanel.getProxy_user() != null && !"".equals(MainPanel.getProxy_user())) {
|
||||
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes()));
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes("UTF-8")));
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -212,7 +212,7 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
|
||||
byte_res.write(buffer, 0, reads);
|
||||
}
|
||||
|
||||
httpresponse = new String(byte_res.toByteArray());
|
||||
httpresponse = new String(byte_res.toByteArray(), "UTF-8");
|
||||
|
||||
}
|
||||
|
||||
|
@ -261,7 +261,7 @@ public final class CryptTools {
|
||||
|
||||
byte[] decrypted_data = decrypter.doFinal(UrlBASE642Bin(findFirstRegex("mega://f?enc[0-9]*\\?([\\da-zA-Z_,-]*)", link, 1)));
|
||||
|
||||
dec_link = new String(decrypted_data).trim();
|
||||
dec_link = new String(decrypted_data, "UTF-8").trim();
|
||||
|
||||
return "https://mega.nz/#" + (folder != null ? "f" : "") + dec_link;
|
||||
|
||||
@ -323,7 +323,7 @@ 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")) {
|
||||
if (!new String(url_bin, "UTF-8").contains("http")) {
|
||||
|
||||
throw new Exception("BAD ELC HOST URL!");
|
||||
}
|
||||
@ -332,7 +332,7 @@ public final class CryptTools {
|
||||
|
||||
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);
|
||||
|
||||
URL url = new URL(new String(url_bin).trim());
|
||||
URL url = new URL(new String(url_bin, "UTF-8").trim());
|
||||
|
||||
if (MainPanel.isUse_proxy()) {
|
||||
|
||||
@ -340,7 +340,7 @@ public final class CryptTools {
|
||||
|
||||
if (MainPanel.getProxy_user() != null && !"".equals(MainPanel.getProxy_user())) {
|
||||
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes()));
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes("UTF-8")));
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -389,9 +389,9 @@ public final class CryptTools {
|
||||
|
||||
dialog.dispose();
|
||||
|
||||
user = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin(elc_account_data.get("user")), main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
user = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin(elc_account_data.get("user")), main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV), "UTF-8");
|
||||
|
||||
api_key = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin(elc_account_data.get("apikey")), main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
api_key = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin(elc_account_data.get("apikey")), main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV), "UTF-8");
|
||||
|
||||
if (!remember_master_pass) {
|
||||
|
||||
@ -407,9 +407,9 @@ public final class CryptTools {
|
||||
|
||||
} else {
|
||||
|
||||
user = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin(elc_account_data.get("user")), main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
user = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin(elc_account_data.get("user")), main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV), "UTF-8");
|
||||
|
||||
api_key = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin(elc_account_data.get("apikey")), main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
api_key = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin(elc_account_data.get("apikey")), main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV), "UTF-8");
|
||||
|
||||
}
|
||||
|
||||
@ -425,9 +425,9 @@ public final class CryptTools {
|
||||
throw new Exception("NO valid ELC account available!");
|
||||
}
|
||||
|
||||
String postdata = "OPERATION_TYPE=D&DATA=" + new String(pass_bin) + "&USER=" + user + "&APIKEY=" + api_key;
|
||||
String postdata = "OPERATION_TYPE=D&DATA=" + new String(pass_bin, "UTF-8") + "&USER=" + user + "&APIKEY=" + api_key;
|
||||
|
||||
con.getOutputStream().write(postdata.getBytes());
|
||||
con.getOutputStream().write(postdata.getBytes("UTF-8"));
|
||||
|
||||
con.getOutputStream().close();
|
||||
|
||||
@ -444,7 +444,7 @@ public final class CryptTools {
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
HashMap res_map = objectMapper.readValue(new String(out.toByteArray()), HashMap.class);
|
||||
HashMap res_map = objectMapper.readValue(new String(out.toByteArray(), "UTF-8"), HashMap.class);
|
||||
|
||||
String dec_pass = (String) res_map.get("d");
|
||||
|
||||
@ -464,7 +464,7 @@ public final class CryptTools {
|
||||
|
||||
byte[] bin_links_dec = CryptTools.aes_cbc_decrypt_nopadding(bin_links, key, iv);
|
||||
|
||||
String[] links_string = (new String(bin_links_dec).trim()).split("\\|");
|
||||
String[] links_string = (new String(bin_links_dec, "UTF-8").trim()).split("\\|");
|
||||
|
||||
for (String s : links_string) {
|
||||
|
||||
@ -472,7 +472,7 @@ public final class CryptTools {
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new Exception(url.getAuthority() + " ELC SERVER ERROR " + new String(out.toByteArray()));
|
||||
throw new Exception(url.getAuthority() + " ELC SERVER ERROR " + new String(out.toByteArray(), "UTF-8"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -517,7 +517,7 @@ public final class CryptTools {
|
||||
|
||||
if (MainPanel.getProxy_user() != null && !"".equals(MainPanel.getProxy_user())) {
|
||||
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes()));
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes("UTF-8")));
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -550,7 +550,7 @@ public final class CryptTools {
|
||||
|
||||
String postdata = "destType=jdtc6&b=JD&srcType=dlc&data=" + dlc_id + "&v=" + dlc_rev;
|
||||
|
||||
con.getOutputStream().write(postdata.getBytes());
|
||||
con.getOutputStream().write(postdata.getBytes("UTF-8"));
|
||||
|
||||
con.getOutputStream().close();
|
||||
|
||||
@ -563,12 +563,12 @@ public final class CryptTools {
|
||||
|
||||
out.write(buffer, 0, reads);
|
||||
}
|
||||
enc_dlc_key = findFirstRegex("< *rc *>(.+?)< */ *rc *>", new String(out.toByteArray()), 1);
|
||||
enc_dlc_key = findFirstRegex("< *rc *>(.+?)< */ *rc *>", new String(out.toByteArray(), "UTF-8"), 1);
|
||||
}
|
||||
|
||||
String dec_dlc_key = new String(CryptTools.aes_ecb_decrypt_nopadding(BASE642Bin(enc_dlc_key), hex2bin(dlc_master_key))).trim();
|
||||
String dec_dlc_key = new String(CryptTools.aes_ecb_decrypt_nopadding(BASE642Bin(enc_dlc_key), hex2bin(dlc_master_key)), "UTF-8").trim();
|
||||
|
||||
String dec_dlc_data = new String(CryptTools.aes_cbc_decrypt_nopadding(BASE642Bin(enc_dlc_data), BASE642Bin(dec_dlc_key), BASE642Bin(dec_dlc_key))).trim();
|
||||
String dec_dlc_data = new String(CryptTools.aes_cbc_decrypt_nopadding(BASE642Bin(enc_dlc_data), BASE642Bin(dec_dlc_key), BASE642Bin(dec_dlc_key)), "UTF-8").trim();
|
||||
|
||||
String dec_dlc_data_file = findFirstRegex("< *file *>(.+?)< */ *file *>", new String(BASE642Bin(dec_dlc_data), "UTF-8"), 1);
|
||||
|
||||
@ -576,7 +576,7 @@ public final class CryptTools {
|
||||
|
||||
for (String s : urls) {
|
||||
|
||||
links.add(new String(BASE642Bin(s)));
|
||||
links.add(new String(BASE642Bin(s), "UTF-8"));
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
@ -1143,7 +1143,7 @@ public final class Download implements Transference, Runnable, SecureSingleThrea
|
||||
download_url = _ma.getMegaFileDownloadUrl(_url);
|
||||
|
||||
} else {
|
||||
download_url = MegaCrypterAPI.getMegaFileDownloadUrl(_url, _file_pass, _file_noexpire, _ma.getSid(), getMain_panel().getMega_proxy_server() != null ? (getMain_panel().getMega_proxy_server().getPort() + ":" + Bin2BASE64(("megacrypter:" + getMain_panel().getMega_proxy_server().getPassword()).getBytes()) + ":" + MiscTools.getMyPublicIP()) : null);
|
||||
download_url = MegaCrypterAPI.getMegaFileDownloadUrl(_url, _file_pass, _file_noexpire, _ma.getSid(), getMain_panel().getMega_proxy_server() != null ? (getMain_panel().getMega_proxy_server().getPort() + ":" + Bin2BASE64(("megacrypter:" + getMain_panel().getMega_proxy_server().getPassword()).getBytes("UTF-8")) + ":" + MiscTools.getMyPublicIP()) : null);
|
||||
}
|
||||
|
||||
if (checkMegaDownloadUrl(download_url)) {
|
||||
@ -1457,7 +1457,7 @@ public final class Download implements Transference, Runnable, SecureSingleThrea
|
||||
|
||||
} else {
|
||||
|
||||
file_info = MegaCrypterAPI.getMegaFileMetadata(link, panel, getMain_panel().getMega_proxy_server() != null ? (getMain_panel().getMega_proxy_server().getPort() + ":" + Bin2BASE64(("megacrypter:" + getMain_panel().getMega_proxy_server().getPassword()).getBytes())) : null);
|
||||
file_info = MegaCrypterAPI.getMegaFileMetadata(link, panel, getMain_panel().getMega_proxy_server() != null ? (getMain_panel().getMega_proxy_server().getPort() + ":" + Bin2BASE64(("megacrypter:" + getMain_panel().getMega_proxy_server().getPassword()).getBytes("UTF-8"))) : null);
|
||||
}
|
||||
|
||||
} catch (APIException ex) {
|
||||
@ -1552,7 +1552,7 @@ public final class Download implements Transference, Runnable, SecureSingleThrea
|
||||
dl_url = _ma.getMegaFileDownloadUrl(link);
|
||||
|
||||
} else {
|
||||
dl_url = MegaCrypterAPI.getMegaFileDownloadUrl(link, _file_pass, _file_noexpire, _ma.getSid(), getMain_panel().getMega_proxy_server() != null ? (getMain_panel().getMega_proxy_server().getPort() + ":" + Bin2BASE64(("megacrypter:" + getMain_panel().getMega_proxy_server().getPassword()).getBytes()) + ":" + MiscTools.getMyPublicIP()) : null);
|
||||
dl_url = MegaCrypterAPI.getMegaFileDownloadUrl(link, _file_pass, _file_noexpire, _ma.getSid(), getMain_panel().getMega_proxy_server() != null ? (getMain_panel().getMega_proxy_server().getPort() + ":" + Bin2BASE64(("megacrypter:" + getMain_panel().getMega_proxy_server().getPassword()).getBytes("UTF-8")) + ":" + MiscTools.getMyPublicIP()) : null);
|
||||
}
|
||||
|
||||
} catch (APIException ex) {
|
||||
|
@ -157,7 +157,7 @@ public final class KissVideoStreamServer implements HttpHandler, SecureSingleThr
|
||||
|
||||
} else {
|
||||
|
||||
file_info = MegaCrypterAPI.getMegaFileMetadata(link, panel, getMain_panel().getMega_proxy_server() != null ? (getMain_panel().getMega_proxy_server().getPort() + ":" + Bin2BASE64(("megacrypter:" + getMain_panel().getMega_proxy_server().getPassword()).getBytes())) : null);
|
||||
file_info = MegaCrypterAPI.getMegaFileMetadata(link, panel, getMain_panel().getMega_proxy_server() != null ? (getMain_panel().getMega_proxy_server().getPort() + ":" + Bin2BASE64(("megacrypter:" + getMain_panel().getMega_proxy_server().getPassword()).getBytes("UTF-8"))) : null);
|
||||
|
||||
}
|
||||
|
||||
@ -203,7 +203,7 @@ public final class KissVideoStreamServer implements HttpHandler, SecureSingleThr
|
||||
dl_url = ma.getMegaFileDownloadUrl(link);
|
||||
|
||||
} else {
|
||||
dl_url = MegaCrypterAPI.getMegaFileDownloadUrl(link, pass_hash, noexpire_token, ma.getSid(), getMain_panel().getMega_proxy_server() != null ? (getMain_panel().getMega_proxy_server().getPort() + ":" + Bin2BASE64(("megacrypter:" + getMain_panel().getMega_proxy_server().getPassword()).getBytes()) + ":" + MiscTools.getMyPublicIP()) : null);
|
||||
dl_url = MegaCrypterAPI.getMegaFileDownloadUrl(link, pass_hash, noexpire_token, ma.getSid(), getMain_panel().getMega_proxy_server() != null ? (getMain_panel().getMega_proxy_server().getPort() + ":" + Bin2BASE64(("megacrypter:" + getMain_panel().getMega_proxy_server().getPassword()).getBytes("UTF-8")) + ":" + MiscTools.getMyPublicIP()) : null);
|
||||
}
|
||||
|
||||
} catch (APIException ex) {
|
||||
@ -276,7 +276,7 @@ public final class KissVideoStreamServer implements HttpHandler, SecureSingleThr
|
||||
|
||||
String link;
|
||||
|
||||
String[] url_parts = new String(UrlBASE642Bin(url_path.substring(url_path.indexOf("/video/") + 7))).split("\\|");
|
||||
String[] url_parts = new String(UrlBASE642Bin(url_path.substring(url_path.indexOf("/video/") + 7)), "UTF-8").split("\\|");
|
||||
|
||||
mega_account = url_parts[0];
|
||||
|
||||
|
@ -329,7 +329,7 @@ public final class LinkGrabberDialog extends javax.swing.JDialog implements Clip
|
||||
out.write(buffer, 0, reads);
|
||||
}
|
||||
|
||||
String dlc = new String(out.toByteArray());
|
||||
String dlc = new String(out.toByteArray(), "UTF-8");
|
||||
|
||||
Set<String> links = CryptTools.decryptDLC(dlc, ((MainPanelView) getParent()).getMain_panel());
|
||||
|
||||
|
@ -50,7 +50,7 @@ import javax.swing.UIManager;
|
||||
*/
|
||||
public final class MainPanel {
|
||||
|
||||
public static final String VERSION = "6.32";
|
||||
public static final String VERSION = "6.33";
|
||||
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
|
||||
public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;
|
||||
public static final int STREAMER_PORT = 1337;
|
||||
|
@ -394,7 +394,7 @@ public final class MegaAPI implements Serializable {
|
||||
|
||||
if (MainPanel.getProxy_user() != null && !"".equals(MainPanel.getProxy_user())) {
|
||||
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes()));
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes("UTF-8")));
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -450,7 +450,7 @@ public final class MegaAPI implements Serializable {
|
||||
byte_res.write(buffer, 0, reads);
|
||||
}
|
||||
|
||||
response = new String(byte_res.toByteArray());
|
||||
response = new String(byte_res.toByteArray(), "UTF-8");
|
||||
|
||||
if (response.length() > 0) {
|
||||
|
||||
@ -593,16 +593,16 @@ public final class MegaAPI implements Serializable {
|
||||
|
||||
private byte[] _encAttr(String attr, byte[] key) {
|
||||
|
||||
byte[] attr_byte = ("MEGA" + attr).getBytes();
|
||||
|
||||
int l = (int) (16 * Math.ceil((double) attr_byte.length / 16));
|
||||
|
||||
byte[] new_attr_byte = Arrays.copyOfRange(attr_byte, 0, l);
|
||||
|
||||
byte[] ret = null;
|
||||
|
||||
try {
|
||||
|
||||
byte[] attr_byte = ("MEGA" + attr).getBytes("UTF-8");
|
||||
|
||||
int l = (int) (16 * Math.ceil((double) attr_byte.length / 16));
|
||||
|
||||
byte[] new_attr_byte = Arrays.copyOfRange(attr_byte, 0, l);
|
||||
|
||||
ret = aes_cbc_encrypt_nopadding(new_attr_byte, key, AES_ZERO_IV);
|
||||
|
||||
} catch (Exception ex) {
|
||||
@ -622,7 +622,7 @@ public final class MegaAPI implements Serializable {
|
||||
|
||||
decrypted_at = aes_cbc_decrypt_nopadding(UrlBASE642Bin(encAttr), key, AES_ZERO_IV);
|
||||
|
||||
String att = new String(decrypted_at).replaceAll("\0+$", "").replaceAll("^MEGA", "");
|
||||
String att = new String(decrypted_at, "UTF-8").replaceAll("\0+$", "").replaceAll("^MEGA", "");
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
@ -880,7 +880,7 @@ public final class MegaAPI implements Serializable {
|
||||
|
||||
try {
|
||||
|
||||
ch = Bin2UrlBASE64(encryptKey((h + h).getBytes(), i32a2bin(getMaster_key())));
|
||||
ch = Bin2UrlBASE64(encryptKey((h + h).getBytes("UTF-8"), i32a2bin(getMaster_key())));
|
||||
|
||||
} catch (Exception ex) {
|
||||
LOG.log(Level.SEVERE, null, ex);
|
||||
|
@ -45,7 +45,7 @@ public final class MegaCrypterAPI {
|
||||
|
||||
if (MainPanel.getProxy_user() != null && !"".equals(MainPanel.getProxy_user())) {
|
||||
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes()));
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes("UTF-8")));
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -66,7 +66,7 @@ public final class MegaCrypterAPI {
|
||||
|
||||
con.setDoOutput(true);
|
||||
|
||||
con.getOutputStream().write(request.getBytes());
|
||||
con.getOutputStream().write(request.getBytes("UTF-8"));
|
||||
|
||||
con.getOutputStream().close();
|
||||
|
||||
@ -86,7 +86,7 @@ public final class MegaCrypterAPI {
|
||||
byte_res.write(buffer, 0, reads);
|
||||
}
|
||||
|
||||
response = new String(byte_res.toByteArray());
|
||||
response = new String(byte_res.toByteArray(), "UTF-8");
|
||||
|
||||
if (response.length() > 0) {
|
||||
|
||||
@ -132,7 +132,7 @@ public final class MegaCrypterAPI {
|
||||
|
||||
byte[] decrypted_url = aes_cbc_decrypt_pkcs7(BASE642Bin(dl_url), BASE642Bin(pass_hash), BASE642Bin(pass));
|
||||
|
||||
dl_url = new String(decrypted_url);
|
||||
dl_url = new String(decrypted_url, "UTF-8");
|
||||
|
||||
} catch (Exception ex) {
|
||||
throw new MegaCrypterAPIException(25);
|
||||
@ -292,12 +292,12 @@ public final class MegaCrypterAPI {
|
||||
|
||||
byte[] decrypted_name = decrypter.doFinal(BASE642Bin(fname));
|
||||
|
||||
fname = new String(decrypted_name);
|
||||
fname = new String(decrypted_name, "UTF-8");
|
||||
|
||||
if (fpath != null) {
|
||||
byte[] decrypted_fpath = decrypter.doFinal(BASE642Bin(fpath));
|
||||
|
||||
fpath = new String(decrypted_fpath);
|
||||
fpath = new String(decrypted_fpath, "UTF-8");
|
||||
}
|
||||
|
||||
pass = Bin2BASE64(info_key);
|
||||
|
@ -149,7 +149,7 @@ public class MegaProxyServer implements Runnable {
|
||||
|
||||
if (matcher_auth.matches()) {
|
||||
|
||||
proxy_auth = new String(BASE642Bin(matcher_auth.group(1).trim()));
|
||||
proxy_auth = new String(BASE642Bin(matcher_auth.group(1).trim()), "UTF-8");
|
||||
|
||||
}
|
||||
|
||||
|
@ -887,7 +887,7 @@ public final class MiscTools {
|
||||
|
||||
if (MainPanel.getProxy_user() != null && !"".equals(MainPanel.getProxy_user())) {
|
||||
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes()));
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes("UTF-8")));
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -903,7 +903,7 @@ public final class MiscTools {
|
||||
|
||||
if (MainPanel.getProxy_user() != null && !"".equals(MainPanel.getProxy_user())) {
|
||||
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes()));
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes("UTF-8")));
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -958,7 +958,7 @@ public final class MiscTools {
|
||||
|
||||
if (MainPanel.getProxy_user() != null && !"".equals(MainPanel.getProxy_user())) {
|
||||
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes()));
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes("UTF-8")));
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -978,7 +978,7 @@ public final class MiscTools {
|
||||
byte_res.write(buffer, 0, reads);
|
||||
}
|
||||
|
||||
public_ip = new String(byte_res.toByteArray());
|
||||
public_ip = new String(byte_res.toByteArray(), "UTF-8");
|
||||
}
|
||||
|
||||
} catch (MalformedURLException ex) {
|
||||
@ -1012,7 +1012,7 @@ public final class MiscTools {
|
||||
|
||||
if (MainPanel.getProxy_user() != null && !"".equals(MainPanel.getProxy_user())) {
|
||||
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes()));
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes("UTF-8")));
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -1032,7 +1032,7 @@ public final class MiscTools {
|
||||
byte_res.write(buffer, 0, reads);
|
||||
}
|
||||
|
||||
String latest_version_res = new String(byte_res.toByteArray());
|
||||
String latest_version_res = new String(byte_res.toByteArray(), "UTF-8");
|
||||
|
||||
String latest_version = findFirstRegex("releases\\/tag\\/v?([0-9]+\\.[0-9]+)", latest_version_res, 1);
|
||||
|
||||
|
@ -388,7 +388,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
try {
|
||||
|
||||
pass = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("password")), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
pass = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("password")), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV), "UTF-8");
|
||||
|
||||
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException ex) {
|
||||
LOG.log(Level.SEVERE, null, ex);
|
||||
@ -409,9 +409,9 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
try {
|
||||
|
||||
user = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("user")), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
user = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("user")), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV), "UTF-8");
|
||||
|
||||
apikey = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("apikey")), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
apikey = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("apikey")), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV), "UTF-8");
|
||||
|
||||
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException ex) {
|
||||
LOG.log(Level.SEVERE, null, ex);
|
||||
@ -1741,9 +1741,9 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
if (_main_panel.getMaster_pass_hash() != null) {
|
||||
|
||||
user_table = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(user_table.getBytes(), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
user_table = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(user_table.getBytes("UTF-8"), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
|
||||
apikey_table = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(apikey_table.getBytes(), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
apikey_table = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(apikey_table.getBytes("UTF-8"), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
}
|
||||
|
||||
DBTools.insertELCAccount(host_table, user_table, apikey_table);
|
||||
@ -1760,9 +1760,9 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
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), "UTF-8");
|
||||
|
||||
apikey = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin(apikey), _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), "UTF-8");
|
||||
|
||||
} catch (Exception ex) {
|
||||
LOG.log(Level.SEVERE, null, ex);
|
||||
@ -1777,9 +1777,9 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
if (_main_panel.getMaster_pass() != null) {
|
||||
|
||||
user = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(user_table.getBytes(), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
user = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(user_table.getBytes("UTF-8"), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
|
||||
apikey = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(apikey_table.getBytes(), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
apikey = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(apikey_table.getBytes("UTF-8"), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
|
||||
}
|
||||
|
||||
@ -1889,7 +1889,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
if (_main_panel.getMaster_pass_hash() != null) {
|
||||
|
||||
password = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(pass.getBytes(), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
password = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(pass.getBytes("UTF-8"), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
|
||||
password_aes = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(i32a2bin(ma.getPassword_aes()), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
|
||||
@ -1917,7 +1917,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
try {
|
||||
|
||||
password = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin(password), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
password = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin(password), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV), "UTF-8");
|
||||
|
||||
} catch (Exception ex) {
|
||||
LOG.log(Level.SEVERE, null, ex);
|
||||
@ -1976,7 +1976,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
if (_main_panel.getMaster_pass() != null) {
|
||||
|
||||
password = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(pass.getBytes(), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
password = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(pass.getBytes("UTF-8"), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
|
||||
password_aes = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(i32a2bin(ma.getPassword_aes()), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
|
||||
@ -2301,7 +2301,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
try {
|
||||
|
||||
pass = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("password")), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
pass = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("password")), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV), "UTF-8");
|
||||
|
||||
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException ex) {
|
||||
LOG.log(Level.SEVERE, null, ex);
|
||||
@ -2322,9 +2322,9 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
try {
|
||||
|
||||
user = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("user")), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
user = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("user")), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV), "UTF-8");
|
||||
|
||||
apikey = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("apikey")), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
apikey = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("apikey")), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV), "UTF-8");
|
||||
|
||||
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException ex) {
|
||||
LOG.log(Level.SEVERE, null, ex);
|
||||
@ -2480,7 +2480,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
if (old_master_pass_hash != null) {
|
||||
|
||||
password = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("password")), old_master_pass, CryptTools.AES_ZERO_IV));
|
||||
password = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("password")), old_master_pass, CryptTools.AES_ZERO_IV), "UTF-8");
|
||||
|
||||
password_aes = Bin2BASE64(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("password_aes")), old_master_pass, CryptTools.AES_ZERO_IV));
|
||||
|
||||
@ -2497,7 +2497,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
if (_main_panel.getMaster_pass() != null) {
|
||||
|
||||
password = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(password.getBytes(), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
password = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(password.getBytes("UTF-8"), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
|
||||
password_aes = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(BASE642Bin(password_aes), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
|
||||
@ -2523,9 +2523,9 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
if (old_master_pass_hash != null) {
|
||||
|
||||
user = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("user")), old_master_pass, CryptTools.AES_ZERO_IV));
|
||||
user = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("user")), old_master_pass, CryptTools.AES_ZERO_IV), "UTF-8");
|
||||
|
||||
apikey = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("apikey")), old_master_pass, CryptTools.AES_ZERO_IV));
|
||||
apikey = new String(CryptTools.aes_cbc_decrypt_pkcs7(BASE642Bin((String) data.get("apikey")), old_master_pass, CryptTools.AES_ZERO_IV), "UTF-8");
|
||||
|
||||
} else {
|
||||
|
||||
@ -2537,9 +2537,9 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
if (_main_panel.getMaster_pass() != null) {
|
||||
|
||||
user = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(user.getBytes(), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
user = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(user.getBytes("UTF-8"), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
|
||||
apikey = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(apikey.getBytes(), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
apikey = Bin2BASE64(CryptTools.aes_cbc_encrypt_pkcs7(apikey.getBytes("UTF-8"), _main_panel.getMaster_pass(), CryptTools.AES_ZERO_IV));
|
||||
}
|
||||
|
||||
data.put("user", user);
|
||||
|
@ -98,7 +98,7 @@ public final class SmartMegaProxyManager {
|
||||
byte_res.write(buffer, 0, reads);
|
||||
}
|
||||
|
||||
data = new String(byte_res.toByteArray());
|
||||
data = new String(byte_res.toByteArray(), "UTF-8");
|
||||
}
|
||||
|
||||
String[] proxy_list = data.split("\n");
|
||||
|
@ -108,7 +108,7 @@ public class StreamChunkDownloader implements Runnable {
|
||||
|
||||
if (MainPanel.getProxy_user() != null && !"".equals(MainPanel.getProxy_user())) {
|
||||
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes()));
|
||||
con.setRequestProperty("Proxy-Authorization", "Basic " + MiscTools.Bin2BASE64((MainPanel.getProxy_user() + ":" + MainPanel.getProxy_pass()).getBytes("UTF-8")));
|
||||
}
|
||||
} else {
|
||||
|
||||
|
@ -233,7 +233,7 @@ public final class StreamerDialog extends javax.swing.JDialog implements Clipboa
|
||||
|
||||
String selected_account = (String) use_mega_account_down_combobox.getSelectedItem();
|
||||
|
||||
data = Bin2UrlBASE64(((selected_account != null ? selected_account : "") + "|" + link).getBytes());
|
||||
data = Bin2UrlBASE64(((selected_account != null ? selected_account : "") + "|" + link).getBytes("UTF-8"));
|
||||
|
||||
stream_link = "http://localhost:1337/video/" + data;
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 190 KiB After Width: | Height: | Size: 193 KiB |
Loading…
x
Reference in New Issue
Block a user