download时可以不用指定 -k 选项

This commit is contained in:
ranchuan
2024-12-18 17:21:35 +08:00
parent cad2880edf
commit 6c49b8fe94
2 changed files with 31 additions and 9 deletions

View File

@@ -561,6 +561,7 @@ def bin_to_hex_file(bin_file_name:str,hex_file_name:str,layout_index:int):
else:
myprint(f"oem_tool not found: {oem_tool}")
# 固件解密
def bin_file_decrypt(bin_file:str):
with open(bin_file,mode='rb') as f:
bin=bytearray(f.read())
@@ -578,6 +579,21 @@ def bin_file_decrypt(bin_file:str):
return "tmp.bin"
# 判断一个固件是kl1还是kl3的,需要解密后的固件
def check_bin_type(file:str):
with open(file,mode='rb') as f:
bin=bytearray(f.read())
while len(bin)>32:
tmp=img_header_check(bin[:32])
if(tmp=="V1"):
return '3'
elif(tmp=="V0"):
return '1'
bin=bin[32:]
return None
def clear_tmp():
tmp_list=['tmp.bin']
for item in tmp_list: