diff --git a/mtkclient/Library/legacy_ext.py b/mtkclient/Library/legacy_ext.py index 906df97..45be7a9 100644 --- a/mtkclient/Library/legacy_ext.py +++ b/mtkclient/Library/legacy_ext.py @@ -181,9 +181,11 @@ class legacyext(metaclass=LogBase): if seccfg_data[:0xC] == b"AND_SECCFG_v": self.info("Detected V3 Lockstate") sc_org = seccfgV3(hwc, self.mtk) - else: + elif seccfg_data[:4] == b"\x4D\x4D\x4D\x4D": self.info("Detected V4 Lockstate") sc_org = seccfgV4(hwc, self.mtk) + else: + return False, "Unknown lockstate or no lockstate" if not sc_org.parse(seccfg_data): return False, "Device has is either already unlocked or algo is unknown. Aborting." writedata = sc_org.create(lockflag=lockflag) diff --git a/mtkclient/Library/mtk_dalegacy.py b/mtkclient/Library/mtk_dalegacy.py index 8a72564..8a24bb0 100755 --- a/mtkclient/Library/mtk_dalegacy.py +++ b/mtkclient/Library/mtk_dalegacy.py @@ -1785,7 +1785,8 @@ class DALegacy(metaclass=LogBase): else: buffer = bytearray() bytestoread = length - self.mtk.daloader.progress.show_progress("Read", 0, length, display) + if display: + self.mtk.daloader.progress.show_progress("Read", 0, length, display) while bytestoread > 0: size = bytestoread if bytestoread > packetsize: @@ -1799,6 +1800,8 @@ class DALegacy(metaclass=LogBase): rpos = length - bytestoread else: rpos = 0 - self.mtk.daloader.progress.show_progress("Read", rpos, length, display) - self.mtk.daloader.progress.show_progress("Read", length, length, display) + if display: + self.mtk.daloader.progress.show_progress("Read", rpos, length, display) + if display: + self.mtk.daloader.progress.show_progress("Read", length, length, display) return buffer diff --git a/mtkclient/Library/xflash_ext.py b/mtkclient/Library/xflash_ext.py index aa17983..4e2cdfe 100644 --- a/mtkclient/Library/xflash_ext.py +++ b/mtkclient/Library/xflash_ext.py @@ -524,9 +524,11 @@ class xflashext(metaclass=LogBase): if seccfg_data[:0xC] == b"AND_SECCFG_v": self.info("Detected V3 Lockstate") sc_org = seccfgV3(hwc, self.mtk) - else: + elif seccfg_data[:4] == b"\x4D\x4D\x4D\x4D": self.info("Detected V4 Lockstate") sc_org = seccfgV4(hwc, self.mtk) + else: + return False, "Unknown lockstate or no lockstate" if not sc_org.parse(seccfg_data): return False, "Device has is either already unlocked or algo is unknown. Aborting." writedata = sc_org.create(lockflag=lockflag)