Skip to content

Commit

Permalink
qfil: goes back in the list
Browse files Browse the repository at this point in the history
  • Loading branch information
Vachounet authored and erfanoabdi committed Jan 21, 2020
1 parent f0a0bb6 commit 024acc3
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions extractor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,25 @@ if [[ $(7z l -ba $romzip | grep system.new.dat) ]]; then
rm -rf $line.transfer.list $line.new.dat
done
done
elif [[ $(7z l -ba $romzip | grep rawprogram) ]]; then
echo "QFIL detected"
rawprograms=$(7z l -ba $romzip | gawk '{ print $NF }' | grep rawprogram)
7z e -y $romzip $rawprograms 2>/dev/null >> $tmpdir/zip.log
for partition in $PARTITIONS; do
partitionsonzip=$(7z l -ba $romzip | gawk '{ print $NF }' | grep $partition)
if [[ ! $partitionsonzip == "" ]]; then
7z e -y $romzip $partitionsonzip 2>/dev/null >> $tmpdir/zip.log
if [[ ! -f "$partition.img" ]]; then
if [[ -f "$partition.raw.img" ]]; then
mv "$partition.raw.img" "$partition.img"
else
rawprogramsfile=$(grep -rlw $partition rawprogram*.xml)
$packsparseimg -t $partition -x $rawprogramsfile > $tmpdir/extract.log
mv "$partition.raw" "$partition.img"
fi
fi
fi
done
elif [[ $(7z l -ba $romzip | grep system | grep chunk | grep -v ".*\.so$") ]]; then
echo "chunk detected"
for partition in $PARTITIONS; do
Expand Down Expand Up @@ -263,25 +282,6 @@ elif [[ $(7z l -ba $romzip | grep tar.md5 | gawk '{ print $NF }' | grep AP_) ]];
exit 1
fi
romzip=""
elif [[ $(7z l -ba $romzip | grep rawprogram) ]]; then
echo "QFIL detected"
rawprograms=$(7z l -ba $romzip | gawk '{ print $NF }' | grep rawprogram)
7z e -y $romzip $rawprograms 2>/dev/null >> $tmpdir/zip.log
for partition in $PARTITIONS; do
partitionsonzip=$(7z l -ba $romzip | gawk '{ print $NF }' | grep $partition)
if [[ ! $partitionsonzip == "" ]]; then
7z e -y $romzip $partitionsonzip 2>/dev/null >> $tmpdir/zip.log
if [[ ! -f "$partition.img" ]]; then
if [[ -f "$partition.raw.img" ]]; then
mv "$partition.raw.img" "$partition.img"
else
rawprogramsfile=$(grep -rlw $partition rawprogram*.xml)
$packsparseimg -t $partition -x $rawprogramsfile > $tmpdir/extract.log
mv "$partition.raw" "$partition.img"
fi
fi
fi
done
elif [[ $(7z l -ba $romzip | grep .tar) && ! $(7z l -ba $romzip | grep tar.md5 | gawk '{ print $NF }' | grep AP_) ]]; then
tar=$(7z l -ba $romzip | grep .tar | gawk '{ print $NF }')
echo "non AP tar detected"
Expand Down

0 comments on commit 024acc3

Please sign in to comment.