Fix Oppo/Realme ofp extraction logic

Signed-off-by: rokibhasansagar <rokibhasansagar2014@outlook.com>
This commit is contained in:
rokibhasansagar 2021-04-05 00:56:59 +06:00
parent 2236fadaab
commit a8485297b3
No known key found for this signature in database
GPG Key ID: 2A43163956D6C2A7

View File

@ -290,8 +290,10 @@ if [[ "${EXTENSION}" == "ofp" ]]; then
# Either Move Downloaded/Re-Loaded File Or Copy Local File
mv -f "${INPUTDIR}"/"${FILE}" "${TMPDIR}"/"${FILE}" 2>/dev/null || cp -a "${FILEPATH}" "${TMPDIR}"/"${FILE}"
printf "Decrypting ofp & extracing...\n"
if ! python3 "$OFP_QC_DECRYPT" "${TMPDIR}"/"${FILE}" out/; then
if ! python3 "$OFP_MTK_DECRYPT" "${TMPDIR}"/"${FILE}" out/; then
python3 "$OFP_QC_DECRYPT" "${TMPDIR}"/"${FILE}" out
if [[ ! -f "${TMPDIR}"/out/boot.img || ! -f "${TMPDIR}"/out/userdata.img ]]; then
python3 "$OFP_MTK_DECRYPT" "${TMPDIR}"/"${FILE}" out
if [[ ! -f "${TMPDIR}"/out/boot.img || ! -f "${TMPDIR}"/out/userdata.img ]]; then
printf "ofp decryption error.\n" && exit 1
fi
fi