Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rockchip support #26

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion extractor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# kdz
# RUU
# Amlogic upgrade package
# Rockchip upgrade package

superimage() {
if [ -f super.img ]; then
Expand All @@ -33,7 +34,7 @@ superimage() {
($lpunpack --partition="$partition"_a super.img.raw || $lpunpack --partition="$partition" super.img.raw) 2>/dev/null
if [ -f "$partition"_a.img ]; then
mv "$partition"_a.img "$partition".img
else
elif [ -f "$romzip" ]; then
foundpartitions=$(7z l -ba "$romzip" | rev | gawk '{ print $1 }' | rev | grep $partition.img)
7z e -y "$romzip" $foundpartitions dummypartition 2>/dev/null >> $tmpdir/zip.log
fi
Expand Down Expand Up @@ -86,6 +87,8 @@ kdz_extract="$toolsdir/kdztools/unkdz.py"
dz_extract="$toolsdir/kdztools/undz.py"
ruu="$toolsdir/$HOST/bin/RUU_Decrypt_Tool"
aml_extract="$toolsdir/aml-upgrade-package-extract"
afptool_extract="$toolsdir/$HOST/bin/afptool"
rk_extract="$toolsdir/$HOST/bin/rkImageMaker"

romzip="$(realpath $1)"
romzipext="${romzip##*.}"
Expand Down Expand Up @@ -144,6 +147,26 @@ if [[ $(echo "$romzip" | grep -i ruu_ | grep -i exe) ]]; then
exit 0
fi

if grep -q "rockchip" $romzip; then
echo "Rockchip detected"
cp "$romzip" $tmpdir
romzip="$tmpdir/$(basename $romzip)"
$rk_extract -unpack "$romzip" $tmpdir
$afptool_extract -unpack $tmpdir/firmware.img $tmpdir
rm $romzip
romzip=""
if [[ -f $tmpdir/Image/super.img ]]; then
mv "$tmpdir/Image/super.img" "$tmpdir/super.img"
superimage
fi
for partition in $PARTITIONS; do
[[ -e "$tmpdir/Image/$partition.img" ]] && mv "$tmpdir/Image/$partition.img" "$outdir/$partition.img"
[[ -e "$tmpdir/$partition.img" ]] && mv "$tmpdir/$partition.img" "$outdir/$partition.img"
done
rm -rf $tmpdir
exit 0
fi

if [[ $(7z l -ba "$romzip" | grep -i aml) ]]; then
echo "aml detected"
cp "$romzip" $tmpdir
Expand Down
Binary file added tools/Linux/bin/afptool
Binary file not shown.
Binary file added tools/Linux/bin/rkImageMaker
Binary file not shown.
Binary file added tools/Windows/bin/afptool.exe
Binary file not shown.
Binary file added tools/Windows/bin/rkImageMaker.exe
Binary file not shown.