Skip to content

Commit

Permalink
extractor.sh: images higher priority
Browse files Browse the repository at this point in the history
Signed-off-by: ShivamKumarJha <[email protected]>
  • Loading branch information
ShivamKumarJha authored and erfanoabdi committed Jan 21, 2020
1 parent c10bdec commit cf292e9
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions extractor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,19 @@ elif [[ $(7z l -ba $romzip | grep system | grep chunk | grep -v ".*\.so$") ]]; t
fi
fi
done
elif [[ $(7z l -ba $romzip | gawk '{print $NF}' | grep "system_new.img\|^system.img\|\/system.img") ]]; then
echo "Image detected"
for partition in $PARTITIONS; do
foundpartitions=$(7z l -ba $romzip | gawk '{ print $NF }' | grep $partition.img)
7z e -y $romzip $foundpartitions dummypartition 2>/dev/null >> $tmpdir/zip.log
if [[ -f $partition_new.img ]]; then
mv $partition_new.img $partition.img
fi
if [[ -f $partition.img.ext4 ]]; then
mv $partition.img.ext4 $partition.img
fi
done
romzip=""
elif [[ $(7z l -ba $romzip | grep "system.sin") ]]; then
echo "sin detected"
cd $tmpdir
Expand Down Expand Up @@ -198,19 +211,6 @@ elif [[ $(7z l -ba $romzip | grep "system-sign.img") ]]; then
for partition in $PARTITIONS; do
[[ -e "$tmpdir/$partition.img" ]] && mv "$tmpdir/$partition.img" "$outdir/$partition.img"
done
elif [[ $(7z l -ba $romzip | gawk '{print $NF}' | grep "system_new.img\|^system.img\|\/system.img") ]]; then
echo "Image detected"
for partition in $PARTITIONS; do
foundpartitions=$(7z l -ba $romzip | gawk '{ print $NF }' | grep $partition.img)
7z e -y $romzip $foundpartitions dummypartition 2>/dev/null >> $tmpdir/zip.log
if [[ -f $partition_new.img ]]; then
mv $partition_new.img $partition.img
fi
if [[ -f $partition.img.ext4 ]]; then
mv $partition.img.ext4 $partition.img
fi
done
romzip=""
elif [[ $(7z l -ba $romzip | grep "super.img") ]]; then
echo "super detected"
foundsupers=$(7z l -ba $romzip | gawk '{ print $NF }' | grep "super.img")
Expand Down

0 comments on commit cf292e9

Please sign in to comment.