From 123f39a21b658bdf36ac559372c94b3454d6ed05 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Tue, 10 Jan 2017 22:56:48 +0800 Subject: [PATCH] We can see the token through logs anyway, no need to encrypt --- .../topjohnwu/magisk/utils/ModuleHelper.java | 2 +- .../com/topjohnwu/magisk/utils/Utils.java | 26 ------------------- app/src/main/res/values/strings.xml | 2 +- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/ModuleHelper.java b/app/src/main/java/com/topjohnwu/magisk/utils/ModuleHelper.java index eb23b9198..06f81a5e4 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/ModuleHelper.java +++ b/app/src/main/java/com/topjohnwu/magisk/utils/ModuleHelper.java @@ -82,7 +82,7 @@ public class ModuleHelper { } // Making a request to url and getting response - jsonString = WebRequest.makeWebServiceCall(context.getString(R.string.url_main, Utils.getToken()), WebRequest.GET); + jsonString = WebRequest.makeWebServiceCall(context.getString(R.string.url_main), WebRequest.GET); if (jsonString != null && !jsonString.isEmpty()) { // Have internet access diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java b/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java index 2f7a35fbd..5118ae54e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java +++ b/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java @@ -37,9 +37,6 @@ public class Utils { public static boolean isDownloading = false; public static boolean isDarkTheme; - private static final String cryptoPass = "MagiskRox666"; - private static final String secret = "GTYybRBTYf5his9kQ16ZNO7qgkBJ/5MyVe4CGceAOIoXgSnnk8FTd4F1dE9p5Eus"; - public static boolean itemExist(String path) { return itemExist(true, path); } @@ -118,29 +115,6 @@ public class Utils { context.registerReceiver(receiver, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE)); } - public static String getToken() { - - try { - DESKeySpec keySpec = new DESKeySpec(cryptoPass.getBytes("UTF8")); - SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); - SecretKey key = keyFactory.generateSecret(keySpec); - - byte[] encrypedPwdBytes = Base64.decode(secret, Base64.DEFAULT); - // cipher is not thread safe - Cipher cipher = Cipher.getInstance("DES"); - cipher.init(Cipher.DECRYPT_MODE, key); - byte[] decrypedValueBytes = (cipher.doFinal(encrypedPwdBytes)); - - return new String(decrypedValueBytes); - - } catch (InvalidKeyException | UnsupportedEncodingException | NoSuchAlgorithmException - | BadPaddingException | NoSuchPaddingException | IllegalBlockSizeException - | InvalidKeySpecException e) { - e.printStackTrace(); - } - return secret; - } - public static String getLegalFilename(CharSequence filename) { return filename.toString().replace(" ", "_").replace("'", "").replace("\"", "") .replace("$", "").replace("`", "").replace("(", "").replace(")", "") diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bdb08f4a7..8503ca7d1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -111,7 +111,7 @@ Check release notes - https://api.github.com/orgs/Magisk-Modules-Repo/repos?access_token=%1$s + https://api.github.com/orgs/Magisk-Modules-Repo/repos?access_token=8f3c379fbeb80754b45b02486482584893af142a https://raw.githubusercontent.com/Magisk-Modules-Repo/%1$s/master/%2$s https://github.com/Magisk-Modules-Repo/%1$s/archive/master.zip