diff --git a/build.sh b/build.sh index f37854a..2ce63b2 100755 --- a/build.sh +++ b/build.sh @@ -15,7 +15,7 @@ mv originalHotfix/* newHotfix mkdir build rm -rf originalHotfix echo "building the new hotfix for the devices specified in the official firmware" -./utils/buildHotfix.sh &> /dev/null +./utils/buildHotfix.sh $1 &> /dev/null rm -rf newHotfix echo "moving patched uks to LanguageBreak directory" cp LanguageBreak build/ -r diff --git a/utils/buildHotfix.sh b/utils/buildHotfix.sh index 01c13c4..970a672 100755 --- a/utils/buildHotfix.sh +++ b/utils/buildHotfix.sh @@ -1,4 +1,9 @@ -DEVICES=$(./utils/kindletool convert update_kindle*.bin --info -k 2>&1 | python utils/parseKindleToolDevices.py) +if [ $1 == "--universal" ] ; then + DEVICES=$(echo "ALL" | python utils/parseKindleToolDevices.py) +else + DEVICES=$(./utils/kindletool convert update_kindle*.bin --info -k 2>&1 | python utils/parseKindleToolDevices.py) +fi +echo $DEVICES cp utils/install-languagebreak-cleanup.sh newHotfix cd newHotfix ../utils/kindletool create ota2 $DEVICES -b FC04 . ../build/update_hotfix_languagebreak.bin \ No newline at end of file diff --git a/utils/devices.json b/utils/devices.json index d662f6b..24b7563 100644 --- a/utils/devices.json +++ b/utils/devices.json @@ -145,6 +145,5 @@ "Kindle Scribe (Unknown Variant 2BM)": 2421, "Kindle Scribe (Unknown Variant 23L)": 2164, "Kindle Scribe (Unknown Variant 23M)": 2165, - "Kindle Scribe (Unknown Variant 270)": 2272, - "Unknown": 0 + "Kindle Scribe (Unknown Variant 270)": 2272 } \ No newline at end of file diff --git a/utils/parseKindleToolDevices.py b/utils/parseKindleToolDevices.py index f0a1594..c5f2d57 100644 --- a/utils/parseKindleToolDevices.py +++ b/utils/parseKindleToolDevices.py @@ -4,11 +4,16 @@ devices = json.load(open("utils/devices.json", "r")) devs = [] deviceNames = [] -for line in sys.stdin: - match = re.search("^Device\s(.*?)$", line) - if match is not None: - deviceNames.append(match.group(1).strip(" ") + "\n") - devs.append(devices[match.group(1).strip(" ")]) + +if "ALL" in sys.stdin.readline(): + deviceNames = [f"{x}\n" for x in devices] + devs = [devices[x] for x in devices] +else: + for line in sys.stdin: + match = re.search("^Device\s(.*?)$", line) + if match is not None: + deviceNames.append(match.group(1).strip(" ") + "\n") + devs.append(devices[match.group(1).strip(" ")]) with open("build/DEVICES.txt", "w") as f: f.writelines(deviceNames)