From e8755fbe2f1b51421963d8994e6c65d9ffd0ee4a Mon Sep 17 00:00:00 2001 From: Dmitry Isaenko Date: Mon, 19 Aug 2019 19:26:59 +0300 Subject: [PATCH] fixed title.keys key size --- src/main/java/konogonka/Settings/ListSelectorController.java | 3 +-- src/main/java/konogonka/Settings/SettingsController.java | 4 ++-- src/main/java/konogonka/Tools/NCA/NCAProvider.java | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/konogonka/Settings/ListSelectorController.java b/src/main/java/konogonka/Settings/ListSelectorController.java index 6847a1f..0cb07a5 100644 --- a/src/main/java/konogonka/Settings/ListSelectorController.java +++ b/src/main/java/konogonka/Settings/ListSelectorController.java @@ -107,8 +107,7 @@ public class ListSelectorController implements Initializable { } private void validateAndAdd(String addingItem){ - if (!observableList.contains(addingItem)) { + if (!observableList.contains(addingItem)) observableList.add(addingItem); - } } } diff --git a/src/main/java/konogonka/Settings/SettingsController.java b/src/main/java/konogonka/Settings/SettingsController.java index c1988f0..149f6fb 100644 --- a/src/main/java/konogonka/Settings/SettingsController.java +++ b/src/main/java/konogonka/Settings/SettingsController.java @@ -163,8 +163,8 @@ public class SettingsController implements Initializable { String[] keyValue; LinkedHashMap preparedPairsMap = new LinkedHashMap<>(); while ((fileLine = br.readLine()) != null){ - keyValue = fileLine.trim().split("\\s+?=\\s+?", 2); - if (keyValue.length == 2 && keyValue[0].length() == 32 && keyValue[1].length() == 32){ + keyValue = fileLine.trim().split("\\s*=\\s*", 2); + if (keyValue.length == 2 && keyValue[0].length() > 16 && ! (keyValue[0].length() > 32) && keyValue[1].length() == 32){ preparedPairsMap.put(keyValue[0], keyValue[1]); } } diff --git a/src/main/java/konogonka/Tools/NCA/NCAProvider.java b/src/main/java/konogonka/Tools/NCA/NCAProvider.java index 2a22f0e..b89a0f0 100644 --- a/src/main/java/konogonka/Tools/NCA/NCAProvider.java +++ b/src/main/java/konogonka/Tools/NCA/NCAProvider.java @@ -257,9 +257,9 @@ public class NCAProvider { key = decryptedKey2; // TODO: Just remember this dumb hack } else { - byte[] rightsIDkey = hexStrToByteArray(keys.get(byteArrToHexString(rightsId))); - try { + byte[] rightsIDkey = hexStrToByteArray(keys.get(byteArrToHexString(rightsId))); // throws NullPointerException + SecretKeySpec skSpec = new SecretKeySpec( hexStrToByteArray(keys.get(String.format("titlekek_%02d", cryptoTypeReal)) ), "AES");