mirror of
https://github.com/bkerler/mtkclient.git
synced 2024-11-30 19:26:56 -05:00
use '"' instead of'\"'
This commit is contained in:
parent
af78467668
commit
a0d25a39fa
6 changed files with 10 additions and 12 deletions
|
@ -198,7 +198,7 @@ class DA_handler(metaclass=LogBase):
|
|||
rpartition = gptentry
|
||||
break
|
||||
if rpartition is not None:
|
||||
self.info(f"Dumping partition \"{rpartition.name}\"")
|
||||
self.info(f'Dumping partition "{rpartition.name}"')
|
||||
if self.mtk.daloader.readflash(addr=rpartition.sector * self.config.pagesize,
|
||||
length=rpartition.sectors * self.config.pagesize,
|
||||
filename=partfilename, parttype=parttype):
|
||||
|
@ -646,7 +646,7 @@ class DA_handler(metaclass=LogBase):
|
|||
elif cmd == "printgpt":
|
||||
data, guid_gpt = mtk.daloader.get_gpt()
|
||||
if not guid_gpt:
|
||||
self.error("Error reading gpt, please read whole flash using \"mtk rf flash.bin\".")
|
||||
self.error('Error reading gpt, please read whole flash using "mtk rf flash.bin".')
|
||||
else:
|
||||
guid_gpt.print()
|
||||
elif cmd == "r":
|
||||
|
|
|
@ -229,7 +229,7 @@ class DAloader(metaclass=LogBase):
|
|||
if self.mtk.config.chipconfig.damode == damodes.XFLASH:
|
||||
self.da = DAXFlash(self.mtk, self.daconfig, self.loglevel)
|
||||
if porttype not in ["off", "usb", "uart"]:
|
||||
self.error("Only \"off\",\"usb\" or \"uart\" are allowed.")
|
||||
self.error('Only "off","usb" or "uart" are allowed.')
|
||||
if self.da.set_meta(porttype):
|
||||
self.info(f"Successfully set meta mode to {porttype}")
|
||||
return True
|
||||
|
|
|
@ -354,8 +354,7 @@ class DAXFlash(metaclass=LogBase):
|
|||
if self.daconfig.flashtype == "emmc":
|
||||
length = min(length, self.emmc.rpmb_size)
|
||||
else:
|
||||
self.error("Unknown parttype. Known parttypes are \"boot1\",\"boot2\",\"gp1\"," +
|
||||
"\"gp2\",\"gp3\",\"gp4\",\"rpmb\"")
|
||||
self.error('Unknown parttype. Known parttypes are "boot1","boot2","gp1","gp2","gp3","gp4","rpmb"')
|
||||
return []
|
||||
elif storage == DaStorage.MTK_DA_STORAGE_UFS:
|
||||
if parttype is None or parttype == "lu3" or parttype == "user": # USER
|
||||
|
@ -371,7 +370,7 @@ class DAXFlash(metaclass=LogBase):
|
|||
parttype = UFS_PartitionType.UFS_LU4
|
||||
length = min(length, self.ufs.lu2_size)
|
||||
else:
|
||||
self.error("Unknown parttype. Known parttypes are \"lu1\",\"lu2\",\"lu3\",\"lu4\"")
|
||||
self.error('Unknown parttype. Known parttypes are "lu1","lu2","lu3","lu4"')
|
||||
return []
|
||||
elif storage in [DaStorage.MTK_DA_STORAGE_NAND, DaStorage.MTK_DA_STORAGE_NAND_MLC,
|
||||
DaStorage.MTK_DA_STORAGE_NAND_SLC, DaStorage.MTK_DA_STORAGE_NAND_TLC,
|
||||
|
|
|
@ -783,8 +783,7 @@ class DAXML(metaclass=LogBase):
|
|||
if self.daconfig.flashtype == "emmc":
|
||||
length = min(length, self.emmc.gp1_size)
|
||||
else:
|
||||
self.error("Unknown parttype. Known parttypes are \"boot1\",\"boot2\",\"gp1\"," +
|
||||
"\"gp2\",\"gp3\",\"gp4\",\"rpmb\"")
|
||||
self.error('Unknown parttype. Known parttypes are "boot1","boot2","gp1","gp2","gp3","gp4","rpmb"')
|
||||
return []
|
||||
elif storage == DaStorage.MTK_DA_STORAGE_UFS:
|
||||
if parttype is None or parttype == "lu3" or parttype == "user": # USER
|
||||
|
|
|
@ -59,7 +59,7 @@ class Mtk(metaclass=LogBase):
|
|||
idx = -1
|
||||
else:
|
||||
data[idx:idx + len(patchval)] = patchval
|
||||
self.info(f"Patched \"{patchval[2]}\" in preloader")
|
||||
self.info(f'Patched "{patchval[2]}" in preloader')
|
||||
patched = True
|
||||
else:
|
||||
pattern = bytes.fromhex(patchval[0])
|
||||
|
@ -67,7 +67,7 @@ class Mtk(metaclass=LogBase):
|
|||
if idx != -1:
|
||||
patch = bytes.fromhex(patchval[1])
|
||||
data[idx:idx + len(patch)] = patch
|
||||
self.info(f"Patched \"{patchval[2]}\" in preloader")
|
||||
self.info(f'Patched "{patchval[2]}" in preloader')
|
||||
patched = True
|
||||
# break
|
||||
i += 1
|
||||
|
@ -101,7 +101,7 @@ class Mtk(metaclass=LogBase):
|
|||
if idx != -1:
|
||||
patch = bytes.fromhex(patchval[1])
|
||||
data[idx:idx + len(patch)] = patch
|
||||
self.info(f"Patched \"{patchval[2]}\" in preloader")
|
||||
self.info(f'Patched "{patchval[2]}" in preloader')
|
||||
patched = True
|
||||
# break
|
||||
i += 1
|
||||
|
|
|
@ -666,7 +666,7 @@ class Main(metaclass=LogBase):
|
|||
if logs != b"":
|
||||
with open(filename, "wb") as wf:
|
||||
wf.write(logs)
|
||||
self.info(f"Successfully wrote logs to \"{filename}\"")
|
||||
self.info(f'Successfully wrote logs to "{filename}"')
|
||||
else:
|
||||
self.info("No logs found.")
|
||||
|
||||
|
|
Loading…
Reference in a new issue