1.5.1初步

This commit is contained in:
gfdgd xi 2021-09-26 20:16:29 +08:00
parent 4845337d73
commit 712f2d25cc
8 changed files with 148 additions and 77 deletions

View File

@ -3,7 +3,7 @@
"Main": { "Main": {
"MainWindow": { "MainWindow": {
"Title": "UEngine 运行器", "Title": "UEngine 运行器",
"LabApkPath": "安装 APK", "LabApkPath": "安装/卸载 APK",
"LabUninstallPath": "卸载 Apk", "LabUninstallPath": "卸载 Apk",
"BtnFindApk": "浏览", "BtnFindApk": "浏览",
"BtnInstall": "安装", "BtnInstall": "安装",
@ -12,6 +12,7 @@
"BtnUninstall": "卸载", "BtnUninstall": "卸载",
"Btngeticon": "保存图标", "Btngeticon": "保存图标",
"BtnSaveApk": "保存Apk", "BtnSaveApk": "保存Apk",
"BtnApkInformation": "Apk 信息",
"Menu": [ "Menu": [
{ {
"Name": "程序", "Name": "程序",
@ -125,8 +126,7 @@
"Main": { "Main": {
"MainWindow": { "MainWindow": {
"Title": "UEngine Runner", "Title": "UEngine Runner",
"LabApkPath": "Install Apk:", "LabApkPath": "Install Or Uninstall Apk:",
"LabUninstallPath": "Uninstall Apk",
"BtnFindApk": "Find", "BtnFindApk": "Find",
"BtnInstall": "Install", "BtnInstall": "Install",
"BtnShowUengineApp": "Open UEngine App List", "BtnShowUengineApp": "Open UEngine App List",
@ -134,6 +134,7 @@
"BtnUninstall": "Uninstall", "BtnUninstall": "Uninstall",
"Btngeticon": "Save Apk Icon", "Btngeticon": "Save Apk Icon",
"BtnSaveApk": "Saving Installed App Apk", "BtnSaveApk": "Saving Installed App Apk",
"BtnApkInformation": "Apk Information",
"Menu": [ "Menu": [
{ {
"Name": "Program", "Name": "Program",

View File

@ -10,7 +10,7 @@
#### V1.5.02021-09-21中秋节版 #### V1.5.02021-09-21中秋节版
**没有什么实质性的功能,只是开始有多语言支持** **没有什么实质性的功能,只是开始有多语言支持**
**※1、部分窗口支持英语** **※1、部分窗口支持英语**
**2、修复在英语状态下启动器图标名称异常的问题** 2、修复在英语状态下启动器图标名称异常的问题
![1.5.0](https://storage.deepin.org/thread/202109202157289430_截图_选择区域_20210920215550.png) ![1.5.0](https://storage.deepin.org/thread/202109202157289430_截图_选择区域_20210920215550.png)
#### V1.4.32021-09-11开学第一版 #### V1.4.32021-09-11开学第一版

View File

@ -5,6 +5,6 @@ Homepage: [https://gitee.com/gfdgd-xi/uengine-runner, https://github.com/gfdgd-x
Architecture: all Architecture: all
Priority: optional Priority: optional
Conflicts: com.gitee.uengine.runner.spark, spark-uengine-apk-builder Conflicts: com.gitee.uengine.runner.spark, spark-uengine-apk-builder
Depends: python3, python3-tk, python3-pip, aapt, uengine, python3-pil, python3-setuptools, deepin-terminal Depends: python3, python3-tk, python3-pip, aapt, uengine, python3-pil, python3-setuptools, deepin-terminal, curl
Description: UEngine Runner for deepin and UOS Description: UEngine Runner for deepin and UOS

View File

@ -1,5 +1,8 @@
#!/bin/sh #!/bin/sh
# 安装所需库
python3 -m pip install --upgrade ttkthemes python3 -m pip install --upgrade ttkthemes
python3 -m pip install --upgrade pyautogui python3 -m pip install --upgrade pyautogui
python3 -m pip install --upgrade keyboard python3 -m pip install --upgrade keyboard
python3 -m pip install --upgrade requests python3 -m pip install --upgrade requests
# 向服务器返回安装数加1不显示内容且忽略错误
curl http://gfdgdxi.qicp.vip/uengine/Install.php -s > /dev/null | true

181
main.py
View File

@ -22,6 +22,8 @@ import threading
import ttkthemes import ttkthemes
import webbrowser import webbrowser
import subprocess import subprocess
import PIL.Image as Image
import PIL.ImageTk as ImageTk
import tkinter as tk import tkinter as tk
import tkinter.ttk as ttk import tkinter.ttk as ttk
import tkinter.messagebox as messagebox import tkinter.messagebox as messagebox
@ -39,37 +41,38 @@ def UninstallProgram(package: "apk 包名")->"卸载程序":
os.remove("{}/.local/share/applications/{}.desktop".format(get_home(), package)) os.remove("{}/.local/share/applications/{}.desktop".format(get_home(), package))
if os.path.exists("{}/{}.desktop".format(get_desktop_path(), package)): if os.path.exists("{}/{}.desktop".format(get_desktop_path(), package)):
os.remove("{}/{}.desktop".format(get_desktop_path(), package)) os.remove("{}/{}.desktop".format(get_desktop_path(), package))
fineUninstallApkHistory.append(ComboUninstallPath.get()) findApkHistory.append(ComboInstallPath.get())
ComboUninstallPath['value'] = fineUninstallApkHistory ComboInstallPath['value'] = findApkHistory
write_txt(get_home() + "/.config/uengine-runner/FindUninstallApkHistory.json", str(json.dumps(ListToDictionary(fineUninstallApkHistory)))) # 将历史记录的数组转换为字典并写入 write_txt(get_home() + "/.config/uengine-runner/FindApkHistory.json", str(json.dumps(ListToDictionary(findApkHistory)))) # 将历史记录的数组转换为字典并写入
messagebox.showinfo(message="操作执行完毕!", title="提示")
DisabledAndEnbled(False)
return Return return Return
except: except:
traceback.print_exc() traceback.print_exc()
messagebox.showerror(title="错误", message=traceback.format_exc()) messagebox.showerror(title="错误", message=traceback.format_exc())
DisabledAndEnbled(False)
# 卸载文本框的浏览按钮事件 # 卸载文本框的浏览按钮事件
def BtnFindUninstallApkClk(): #def BtnFindUninstallApkClk():
path = filedialog.askopenfilename(title="选择 Apk", filetypes=[("APK 文件", "*.apk"), ("所有文件", "*.*")], initialdir=json.loads(readtxt(get_home() + "/.config/uengine-runner/FindUninstallApk.json"))["path"]) # path = filedialog.askopenfilename(title="选择 Apk", filetypes=[("APK 文件", "*.apk"), ("所有文件", "*.*")], initialdir=json.loads(readtxt(get_home() + "/.config/uengine-runner/FindUninstallApk.json"))["path"])
if path != "" and path != "()": # if path != "" and path != "()":
try: # try:
ComboUninstallPath.set(path) # ComboUninstallPath.set(path)
write_txt(get_home() + "/.config/uengine-runner/FindUninstallApk.json", json.dumps({"path": os.path.dirname(path)})) # 写入配置文件 # write_txt(get_home() + "/.config/uengine-runner/FindUninstallApk.json", json.dumps({"path": os.path.dirname(path)})) # 写入配置文件
except: # except:
pass # pass
# 卸载按钮事件 # 卸载按钮事件
def ButtonClick8(): def ButtonClick8():
if ComboUninstallPath.get() is "": if ComboInstallPath.get() is "":
messagebox.showerror(title="提示", message="信息没有填写完整,无法继续卸载 APK") messagebox.showerror(title="提示", message="信息没有填写完整,无法继续卸载 APK")
return return
DisabledAndEnbled(True) DisabledAndEnbled(True)
if os.path.exists(ComboUninstallPath.get()): if os.path.exists(ComboInstallPath.get()):
path = GetApkPackageName(ComboUninstallPath.get()) path = GetApkPackageName(ComboInstallPath.get())
else: else:
path = ComboUninstallPath.get() path = ComboInstallPath.get()
UninstallProgram(path) threading.Thread(target=UninstallProgram, args=[path]).start()
messagebox.showinfo(message="操作执行完毕!", title="提示")
DisabledAndEnbled(False)
# 浏览窗口 # 浏览窗口
# temp strs # temp strs
@ -136,14 +139,16 @@ def DisabledAndEnbled(choose: "启动或者禁用")->"禁用或启动所有控
userChoose = {True: tk.DISABLED, False: tk.NORMAL} userChoose = {True: tk.DISABLED, False: tk.NORMAL}
a = userChoose[choose] a = userChoose[choose]
ComboInstallPath.configure(state=a) ComboInstallPath.configure(state=a)
ComboUninstallPath.configure(state=a) #ComboUninstallPath.configure(state=a)
BtnFindApk.configure(state=a) BtnFindApk.configure(state=a)
BtnInstall.configure(state=a) BtnInstall.configure(state=a)
BtnShowUengineApp.configure(state=a) BtnShowUengineApp.configure(state=a)
BtnUninstallApkBrowser.configure(state=a) #BtnUninstallApkBrowser.configure(state=a)
BtnUninstall.configure(state=a) BtnUninstall.configure(state=a)
Btngeticon.configure(state=a) Btngeticon.configure(state=a)
BtnSaveApk.configure(state=a) BtnSaveApk.configure(state=a)
BtnApkInformation.configure(state=a)
LabApkPath.configure(state=a)
# 需引入 subprocess # 需引入 subprocess
# 运行系统命令并获取返回值 # 运行系统命令并获取返回值
@ -160,24 +165,24 @@ def OpenUengineProgramList()->"打开“uengine 所有程序列表”":
os.system("/usr/bin/uengine-launch.sh --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity") os.system("/usr/bin/uengine-launch.sh --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity")
# 显示“关于这个程序”窗口 # 显示“关于这个程序”窗口
def about_this_program()->"显示“关于这个程序”窗口": #def about_this_program()->"显示“关于这个程序”窗口":
global about # global about
global title # global title
global iconPath # global iconPath
mess = tk.Toplevel() # mess = tk.Toplevel()
message = ttk.Frame(mess) # message = ttk.Frame(mess)
mess.resizable(0, 0) # mess.resizable(0, 0)
mess.title("关于 {}".format(title)) # mess.title("关于 {}".format(title))
#mess.iconphoto(False, tk.PhotoImage(file=iconPath)) # #mess.iconphoto(False, tk.PhotoImage(file=iconPath))
img = ImageTk.PhotoImage(Image.open(iconPath)) # img = ImageTk.PhotoImage(Image.open(iconPath))
LabApkPath = ttk.Label(message, image=img) # LabApkPath = ttk.Label(message, image=img)
label2 = ttk.Label(message, text=about) # label2 = ttk.Label(message, text=about)
button1 = ttk.Button(message, text="确定", command=mess.withdraw) # button1 = ttk.Button(message, text="确定", command=mess.withdraw)
LabApkPath.pack() # LabApkPath.pack()
label2.pack() # label2.pack()
button1.pack(side="bottom") # button1.pack(side="bottom")
message.pack() # message.pack()
mess.mainloop() # mess.mainloop()
# 显示“提示”窗口 # 显示“提示”窗口
def helps()->"显示“提示”窗口": def helps()->"显示“提示”窗口":
@ -594,6 +599,63 @@ def AdbAndroidInstallAppList():
subprocess.getoutput("adb -s 192.168.250.2:5555 shell pm list package -3"), subprocess.getoutput("adb -s 192.168.250.2:5555 shell pm list package -3"),
subprocess.getoutput("adb -s 192.168.250.2:5555 shell pm list packages -f"))) subprocess.getoutput("adb -s 192.168.250.2:5555 shell pm list packages -f")))
def GetApkVersion(apkFilePath):
info = GetApkInformation(apkFilePath)
for line in info.split('\n'):
if "package:" in line:
if "compileSdkVersion='" in line:
line = line.replace(line[line.index("compileSdkVersion='"): -1], "")
if "platform" in line:
line = line.replace(line[line.index("platform"): -1], "")
line = line.replace(line[0: line.index("versionName='")], "")
line = line.replace("versionName='", "")
line = line.replace("'", "")
line = line.replace(" ", "")
return line
class ApkInformation():
def ShowWindows():
global fullInformation
global path
global tab1
path = ComboInstallPath.get()
message = tk.Toplevel()
tab = ttk.Notebook(message)
tab1 = ttk.Frame(message)
tab2 = ttk.Frame(message)
fullInformation = tk.Text(tab2)
tab.add(tab1, text="简化版")
tab.add(tab2, text="完整版")
fullInformation.pack(expand="yes", fill="both")
tab.pack(expand="yes", fill="both")
threading.Thread(target=ApkInformation.GetInformation).start()
message.mainloop()
def GetInformation():
# 获取详细信息
fullInformation.configure(state=tk.NORMAL)
fullInformation.insert("1.0", GetApkInformation(path))
fullInformation.configure(state=tk.DISABLED)
# 获取图标
SaveApkIcon(path, "/tmp/uengine-runner-android-app-icon.png")
# 读取图标
ttk.Label(tab1, image=ImageTk.PhotoImage(Image.open("/tmp/uengine-runner-android-app-icon.png").resize((256, 256), Image.ANTIALIAS))).pack()
info = '''包名:{}
中文名{}
Activity{}
版本{}'''.format(GetApkPackageName(path), GetApkChineseLabel(path), GetApkActivityName(path), GetApkVersion(path))
ttk.Label(tab1, text=info).pack()
class AdbChangeUengineDisplaySize(): class AdbChangeUengineDisplaySize():
def ShowWindows(): def ShowWindows():
global displayX global displayX
@ -1036,18 +1098,19 @@ win.geometry(""+"+{:.0f}+{:.0f}".format(x, y))
# 创建控件 # 创建控件
FrmInstall = ttk.Frame(window) FrmInstall = ttk.Frame(window)
FrmUninstall = ttk.Frame(window) #FrmUninstall = ttk.Frame(window)
LabApkPath = ttk.Label(window, text=langFile[lang]["Main"]["MainWindow"]["LabApkPath"]) LabApkPath = ttk.Label(window, text=langFile[lang]["Main"]["MainWindow"]["LabApkPath"])
LabUninstallPath = ttk.Label(window, text=langFile[lang]["Main"]["MainWindow"]["LabUninstallPath"]) #LabUninstallPath = ttk.Label(window, text=langFile[lang]["Main"]["MainWindow"]["LabUninstallPath"])
ComboInstallPath = ttk.Combobox(window, width=50) ComboInstallPath = ttk.Combobox(window, width=50)
ComboUninstallPath = ttk.Combobox(window, width=50) #ComboUninstallPath = ttk.Combobox(window, width=50)
BtnFindApk = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnFindApk"], command=FindApk) BtnFindApk = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnFindApk"], command=FindApk)
BtnInstall = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnInstall"], command=Button3Install) BtnInstall = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnInstall"], command=Button3Install)
BtnShowUengineApp = ttk.Button(window, text=langFile[lang]["Main"]["MainWindow"]["BtnShowUengineApp"], command=Button5Click) BtnShowUengineApp = ttk.Button(window, text=langFile[lang]["Main"]["MainWindow"]["BtnShowUengineApp"], command=Button5Click)
BtnUninstallApkBrowser = ttk.Button(FrmUninstall, text=langFile[lang]["Main"]["MainWindow"]["BtnUninstallApkBrowser"], command=BtnFindUninstallApkClk) #BtnUninstallApkBrowser = ttk.Button(FrmUninstall, text=langFile[lang]["Main"]["MainWindow"]["BtnUninstallApkBrowser"], command=BtnFindUninstallApkClk)
BtnUninstall = ttk.Button(FrmUninstall, text=langFile[lang]["Main"]["MainWindow"]["BtnUninstall"], command=ButtonClick8) BtnUninstall = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnUninstall"], command=ButtonClick8)
Btngeticon = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["Btngeticon"], command=SaveIconToOtherPath) Btngeticon = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["Btngeticon"], command=SaveIconToOtherPath)
BtnSaveApk = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnSaveApk"], command=SaveInstallUengineApp) BtnSaveApk = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnSaveApk"], command=SaveInstallUengineApp)
BtnApkInformation = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnApkInformation"], command=ApkInformation.ShowWindows)
# 设置菜单栏 # 设置菜单栏
menu = tk.Menu(window, background="white") menu = tk.Menu(window, background="white")
@ -1103,8 +1166,8 @@ help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][0
help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][1], command=showhelp) # 设置“关于这个程序”项 help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][1], command=showhelp) # 设置“关于这个程序”项
uengineService.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Menu"][0], command=StartUengine) uengineService.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Menu"][0], command=StartUengine)
uengineService.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Menu"][0], command=StopUengine) uengineService.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Menu"][1], command=StopUengine)
uengineService.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Menu"][0], command=UengineRestart) uengineService.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Menu"][2], command=UengineRestart)
uengineInternet.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][3]["Menu"][0], command=UengineBridgeStart) uengineInternet.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][3]["Menu"][0], command=UengineBridgeStart)
uengineInternet.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][3]["Menu"][1], command=UengineBridgeStop) uengineInternet.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][3]["Menu"][1], command=UengineBridgeStop)
@ -1141,14 +1204,15 @@ uengineUseAdb.configure(activebackground="dodgerblue")
uengineData.configure(activebackground="dodgerblue") uengineData.configure(activebackground="dodgerblue")
# 设置控件 # 设置控件
ComboUninstallPath['value'] = fineUninstallApkHistory #ComboUninstallPath['value'] = fineUninstallApkHistory
ComboInstallPath['value'] = findApkHistory ComboInstallPath['value'] = findApkHistory
try: try:
if sys.argv[1] == "-i": if sys.argv[1] == "-i":
ComboInstallPath.set(sys.argv[2]) ComboInstallPath.set(sys.argv[2])
print("Install Path: " + sys.argv[2]) print("Install Path: " + sys.argv[2])
elif sys.argv[1] == "-u": elif sys.argv[1] == "-u":
ComboUninstallPath.set(sys.argv[2]) #ComboUninstallPath.set(sys.argv[2])
ComboInstallPath.set(sys.argv[2])
print("Unstall Path: " + sys.argv[2]) print("Unstall Path: " + sys.argv[2])
else: else:
print("Command Format Error") print("Command Format Error")
@ -1159,25 +1223,26 @@ win.config(menu=menu) # 显示菜单栏
LabApkPath.grid(row=1, column=0,sticky= tk.W,padx=3) LabApkPath.grid(row=0, column=0,sticky= tk.W,padx=3)
ComboInstallPath.grid(row=2, column=0,padx=3) ComboInstallPath.grid(row=1, column=0,padx=3)
FrmInstall.grid(row=2, column=1,padx=3, rowspan=2) FrmInstall.grid(row=0, column=1,padx=3, rowspan=3)
BtnFindApk.grid(row=0, column=0) BtnFindApk.grid(row=0, column=0)
BtnInstall.grid(row=0, column=1) BtnInstall.grid(row=0, column=1)
LabUninstallPath.grid(row=4, column=0,sticky= tk.W,padx=3) #LabUninstallPath.grid(row=4, column=0,sticky= tk.W,padx=3)
ComboUninstallPath.grid(row=5, column=0,padx=3) #ComboUninstallPath.grid(row=5, column=0,padx=3)
FrmUninstall.grid(row=5, column=1,padx=3) #FrmUninstall.grid(row=5, column=1,padx=3)
BtnUninstallApkBrowser.grid(row=0, column=0) #BtnUninstallApkBrowser.grid(row=0, column=0)
BtnUninstall.grid(row=0, column=1) BtnUninstall.grid(row=1, column=0)
BtnShowUengineApp.grid(row=6, column=0,sticky= tk.W,padx=3,pady=2) BtnShowUengineApp.grid(row=2, column=0,sticky= tk.W,padx=3,pady=2)
Btngeticon.grid(row=1, column=0,sticky= tk.W,padx=3,pady=2) BtnApkInformation.grid(row=2, column=1,sticky= tk.W,padx=3,pady=2)
BtnSaveApk.grid(row=1, column=1,sticky= tk.W,padx=3,pady=2) Btngeticon.grid(row=1, column=1,sticky= tk.W,padx=3,pady=2)
BtnSaveApk.grid(row=2, column=0,sticky= tk.W,padx=3,pady=2)
window.pack() window.pack()

View File

@ -3,7 +3,7 @@ Source: com.gitee.uengine.runner.spark
Version: 1.5.0 Version: 1.5.0
Architecture: all Architecture: all
Maintainer: gfdgd xi <3025613752@qq.com>, actionchen<917981399@qq.com> Maintainer: gfdgd xi <3025613752@qq.com>, actionchen<917981399@qq.com>
Depends: deepin-elf-verify (>= 0.0.16.7-1), python3, python3-tk, python3-pip, aapt, adb, python3-pil, python3-setuptools, uengine, deepin-terminal Depends: deepin-elf-verify (>= 0.0.16.7-1), python3, python3-tk, python3-pip, aapt, adb, python3-pil, python3-setuptools, uengine, deepin-terminal, curl
Section: utils Section: utils
Priority: optional Priority: optional
Conflicts: spark-uengine-runner, spark-uengine-apk-builder Conflicts: spark-uengine-runner, spark-uengine-apk-builder

View File

@ -13,3 +13,5 @@ ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-clean /usr/
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-about /usr/bin/uengine-runner-about ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-about /usr/bin/uengine-runner-about
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-keyboard /usr/bin/uengine-keyboard ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-keyboard /usr/bin/uengine-keyboard
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-useadb /usr/bin/uengine-useadb ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-useadb /usr/bin/uengine-useadb
# 向服务器返回安装数加1不显示内容且忽略错误
curl http://gfdgdxi.qicp.vip/uengine/Install.php -s > /dev/null | true

View File

@ -313,16 +313,16 @@ def GetApkChineseLabel(apkFilePath):
line = line.replace("'", "") line = line.replace("'", "")
return line return line
def GetApkIconInApk(apkFilePath): #def GetApkIconInApk(apkFilePath):
info = GetApkInformation(apkFilePath) # info = GetApkInformation(apkFilePath)
for line in info.split('\n'): # for line in info.split('\n'):
if "application:" in line: # if "application:" in line:
line = line[line.index("icon='"): -1] # line = line[line.index("icon='"): -1]
line = line.replace("icon='", "") # line = line.replace("icon='", "")
if "'" in line: # if "'" in line:
line = line[0: line.index("'")] # line = line[0: line.index("'")]
return line # return line
return line # return line
#合并两个函数到一起 #合并两个函数到一起
def SaveApkIcon(apkFilePath, iconSavePath)->"获取 apk 文件的图标": def SaveApkIcon(apkFilePath, iconSavePath)->"获取 apk 文件的图标":