Skip to content

Commit

Permalink
Let me make universal builds
Browse files Browse the repository at this point in the history
  • Loading branch information
notmarek committed Oct 27, 2023
1 parent d3ea49c commit 7c59506
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion utils/buildHotfix.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions utils/devices.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
15 changes: 10 additions & 5 deletions utils/parseKindleToolDevices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7c59506

Please sign in to comment.