Skip to content

Commit 9dc1764

Browse files
feat: add support for 'system/' directory
* Some archives (e.g. 'update-kindle-32.4.6.5_user_465000520.bin') do not contain an image, rather a directory with all of 'system' content. Apparenlty, this is usual for Android 5.1 and lower archives. * As an easy solution, just archive the content of 'system/' and then rename it to 'system.img'. Change-Id: Iea84954c4c143d260c21a017ae9280ecfebe9b73
1 parent 161850c commit 9dc1764

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

extractor.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,15 @@ elif 7z l -ba "${romzip}" 2>/dev/null | grep -q "system.sin\|.*system_.*\.sin";
497497
fi
498498
elif 7z l -ba "${romzip}" 2>/dev/null | grep -q ".pac$"; then
499499
unisoc
500+
elif 7z l -ba "${romzip}" 2>/dev/null | grep -q "system/*"; then
501+
echo "[INFO] 'system/' directory detected"
502+
7z x -y "${romzip}" 2>/dev/null >> "${tmpdir}"/zip.log
503+
504+
# Archive the content of the directory and "spoof" it as an image
505+
cd "${tmpdir}/system" || exit
506+
7z a "system.zip" -- * >> "${tmpdir}"/zip.log
507+
mv system.zip system.img
508+
cd ${tmpdir}
500509
elif 7z l -ba "${romzip}" 2>/dev/null | grep -q "*system.bin*"; then
501510
echo "bin images detected"
502511
7z x -y "${romzip}" 2>/dev/null >> "$tmpdir"/zip.log

0 commit comments

Comments
 (0)