赞
踩
用python开发的windows版本高通平台fastboot刷机工具, 点击按钮即可单独烧录模块或者全部烧录,方便日常
的开发调试工作,在win7、Win10系统中测试烧录msm8909平台正常。开发工具为JetBrains PyCharm 2019.1.1,
源码工程包含两个py文件,分别是fastboot_tool.py和fastboot_cmd.py ,打包好的exe文件下载地址如下。
https://download.csdn.net/download/hismee/16335703
软件界面:
打包好后的烧录工具目录结构:
烧录的镜像文件列表:
boot.img
cache.img
emmc_appsboot.mbn
logo.raw
persist.img
recovery.img
system.img
userdata.img
源码:
1、fastboot_tool.py #GUI主界面
- # -*- coding: UTF-8 -*-
- from tkinter import *
- from fastboot_cmd import *
-
- import configparser
- import threading
- import os
- import tkinter.filedialog
- import time
-
-
- # ------------------define global variate-----------------------
- btn_select_image_dir = None
- btn_download_boot = None
- btn_download_aboot = None
- btn_download_system = None
- btn_download_logo = None
- btn_download_userdata = None
- btn_download_all = None
- btn_reboot_device = None
- btn_sn_write = None
- btn_sn_read = None
-
- image_file_path = None
- download_running_flag = None
-
- login_top = None
- login_ok_flag = None
- # ------------------define function-----------------------
- def Log(str):
- print(str)
- log_text.insert(END, '\n' + str)
- log_text.see(END)
- if ('ErrorFFFF' in str) and ('error' in str):
- index = log_text.get('1.0', 'end').count('\n')
- #print index
- index1 = '%d.0' %index
- index2 = '%d.end' %index
- log_text.tag_add('tag1', index1, index2 )
- log_text.tag_config('tag1',foreground='red')
-
- def LogE(str):
- print(str)
- star = int(float(log_text.index(END)))
- log_text.insert(END, '\n' + str)
- log_text.see(END)
- end = int(float(log_text.index(END)))
-
- for i in range(star, end, 1):
- index1 = '%d.0' %i
- index2 = '%d.end' %i
- log_text.tag_add('tag_red', index1, index2 )
- #print("LogE:%d" %i )
- log_text.tag_config('tag_red', foreground='red')
-
- def LogB(str):
- print(str)
- star = int(float(log_text.index(END)))
- log_text.insert(END, "\n" + str)
- log_text.see(END)
- end = int(float(log_text.index(END)))
- for i in range(star, end, 1):
- index1 = '%d.0' %i
- index2 = '%d.end' %i
- log_text.tag_add('tag_blue', index1, index2 )
- log_text.tag_config('tag_blue', foreground='blue')
-
-
- def Log_dot():
- print('.',)
- log_text.insert(END, ".")
- log_text.see(END)
-
-
- def set_button_onoff(onoff):
- if onoff == "on":
- btn_select_image_dir.config(state="normal")
- btn_download_boot.config(state="normal")
- btn_download_aboot.config(state="normal")
- btn_download_system.config(state="normal")
- btn_download_logo.config(state="normal")
- btn_download_userdata.config(state="normal")
- btn_download_all.config(state="normal")
- btn_reboot_device.config(state="normal")
- if (login_ok_flag == 1):
- btn_sn_write.config(state="normal")
- btn_sn_read.config(state="normal")
- pass
- if onoff == "off":
- btn_select_image_dir.config(state="disabled")
- btn_download_boot.config(state="disabled")
- btn_download_aboot.config(state="disabled")
- btn_download_system.config(state="disabled")
- btn_download_logo.config(state="disabled")
- btn_download_userdata.config(state="disabled")
- btn_download_all.config(state="disabled")
- btn_reboot_device.config(state="disabled")
- if (login_ok_flag == 1):
- btn_sn_write.config(state="disabled")
- btn_sn_read.config(state="disabled")
- pass
-
- def btn_select_image_dir_click():
- options = {}
- options['initialdir'] = text_path.get(0.0, END).strip()
- dir_name=tkinter.filedialog.askdirectory(**options)
- #Log(dir_name)
- if dir_name != "":
- text_path.config(state=NORMAL)
- text_path.delete(1.0,END)
- text_path.insert(END, dir_name)
- text_path.config(state=DISABLED)
- Log("\nSelect directory:\n" + text_path.get(0.0, END))
- config_save('image_file_path', dir_name)
- global image_file_path
- image_file_path = dir_name
-
- # ----------------------------------------------------------------
- def progress_bar_thread_fun():
- time.sleep(2)
- if download_running_flag:
- Log('')
- for i in range(0,40):
- if download_running_fl
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。