Simplify Xiaomi .tgz firmware extraction

Signed-off-by: rokibhasansagar <rokibhasansagar2014@outlook.com>
This commit is contained in:
rokibhasansagar 2020-12-14 21:01:43 +06:00
parent d216ebfeb3
commit de16b52adc
No known key found for this signature in database
GPG Key ID: 2A43163956D6C2A7
2 changed files with 22 additions and 4 deletions

View File

@ -49,11 +49,12 @@ Help Context:
2. Filehosters like - mega.nz | mediafire | google drive | androidfilehost
>> Must Wrap Website Link Inside Single-quotes ('')
>> Supported File Formats For Direct Operation:
*.zip | *.rar | *.tar | *.7z | *.tar.md5 | *.ozip | *.ofp | *.kdz | ruu_*exe
*.zip | *.rar | *.7z | *.tar | *.tar.gz | *.tgz | *.tar.md5
*.ozip | *.ofp | *.ops | *.kdz | ruu_*exe
system.new.dat | system.new.dat.br | system.new.dat.xz
system.new.img | system.img | system-sign.img | UPDATE.APP
*.emmc.img | *.img.ext4 | system.bin | system-p | payload.bin
*.nb0 | .*chunk* | *.ops | *.pac | *super*.img | *system*.sin
*.nb0 | .*chunk* | *.pac | *super*.img | *system*.sin
```
## How to use it to Upload the Dump in GitHub

View File

@ -35,11 +35,12 @@ function _usage() {
printf "\t\e[33m >> Must Wrap Website Link Inside Single-quotes ('')\e[0m\n"
sleep .2s
printf " \e[1;34m >> Supported File Formats For Direct Operation:\e[0m\n"
printf "\t\e[36m *.zip | *.rar | *.tar | *.7z | *.tar.md5 | *.ozip | *.ofp | *.kdz | ruu_*exe\n"
printf "\t\e[36m *.zip | *.rar | *.7z | *.tar | *.tar.gz | *.tgz | *.tar.md5\n"
printf "\t *.ozip | *.ofp | *.ops | *.kdz | ruu_*exe\n"
printf "\t system.new.dat | system.new.dat.br | system.new.dat.xz\n"
printf "\t system.new.img | system.img | system-sign.img | UPDATE.APP\n"
printf "\t *.emmc.img | *.img.ext4 | system.bin | system-p | payload.bin\n"
printf "\t *.nb0 | .*chunk* | *.ops | *.pac | *super*.img | *system*.sin\e[0m\n\n"
printf "\t *.nb0 | .*chunk* | *.pac | *super*.img | *system*.sin\e[0m\n\n"
}
# Welcome Banner
@ -309,6 +310,22 @@ if [[ "${EXTENSION}" == "ofp" ]]; then
( bash "${0}" "${PROJECT_DIR}/input/" ) || exit 1
exit
fi
# Xiaomi .tgz Check
if [[ "${FILE##*.}" == "tgz" || "${FILE#*.}" == "tar.gz" ]]; then
printf "Xiaomi gzipped tar archive found.\n"
if [[ -f "${INPUTDIR}"/"${FILE}" ]]; then
tar xzvf "${INPUTDIR}"/"${FILE}" -C "${INPUTDIR}"/ --transform='s/.*\///'
rm -rf "${INPUTDIR}"/"${FILE}"
elif [[ -f "${FILEPATH}" ]]; then
tar xzvf "${FILEPATH}" -C "${INPUTDIR}"/ --transform='s/.*\///'
fi
find "${INPUTDIR}"/ -type d -empty -delete # Delete Empth Folder Leftover
rm -rf "${TMPDIR:?}"/*
printf "Re-Loading The Extracted Contents.\n"
cd "${PROJECT_DIR}"/ || exit
( bash "${0}" "${PROJECT_DIR}/input/" ) || exit 1
exit
fi
# LG KDZ Check
if echo "${FILEPATH}" | grep -q ".*.kdz" || [[ "${EXTENSION}" == "kdz" ]]; then
printf "LG KDZ Detected.\n"