diff --git a/Language.json b/Language.json index 0c25096..60aa763 100644 --- a/Language.json +++ b/Language.json @@ -94,14 +94,17 @@ ] }, "UEngine 键盘映射", - "UEngine 检测 CPU 是否支持运行" + "UEngine 检测 CPU 是否支持运行", + "删除 UEngine 运行检查", + "重新安装 UEngine" ] }, { "Name": "关于", "Menu": [ "程序官网", - "关于" + "关于", + "反馈程序问题和建议" ] } ] @@ -217,14 +220,17 @@ ] }, "UEngine Keyboard", - "UEngine Check CPU Can Or Can't Run" + "UEngine Check CPU Can Or Can't Run", + "Delete UEngine Runing Checking", + "Reinstall UEngine" ] }, { "Name": "About", "Menu": [ "Program WebSize", - "Program Help" + "Program Help", + "Upload Problem And Advice" ] } ] diff --git a/README.md b/README.md index 46fd080..917e463 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# uengine 运行器 1.5.0 +# uengine 运行器 1.5.1 ### 介绍         新版本Deepin/UOS发布后,可以在应用商店安装部分官方已适配的安卓应用,对爱好者来说,不能自己安装APK软件包始终差点意思,本程序可以为Deepin/UOS上的UEngine安卓运行环境安装自定义APK软件包,并能发送安装的APK包启动菜单到桌面或系统菜单。 @@ -7,10 +7,21 @@ (自己美术功底太差,图标直接用 anbox 的了) ### 更新内容 +#### V1.5.1(2021-10-05,国庆节版): +**※1、精简用户界面,合并安装和卸载输入框和浏览按钮等** +**※2、修复安装以其的程序图标无法点击进入的问题(deepin 社区版不存在此问题)** +**※3、支持在程序本体反馈问题** +4、修复了菜单栏的部分显示问题 +5、支持显示 apk 的部分信息 +6、支持删除 UEngine 程序运行检查以及重新安装 UEngine 的功能 +7、自带有跳过家庭版必须有指定包名才能运行程序限制的脚本 +8、补回依赖包“adb” +![]() + #### V1.5.0(2021-09-21,中秋节版): **没有什么实质性的功能,只是开始有多语言支持** **※1、部分窗口支持英语** -2、修复在英语状态下启动器图标名称异常的问题 +2、修复在英语状态下启动器图标名称异常的问题 ![1.5.0](https://storage.deepin.org/thread/202109202157289430_截图_选择区域_20210920215550.png) #### V1.4.3(2021-09-11,开学第一版): diff --git a/build/DEBIAN/control b/build/DEBIAN/control index cc057c3..ea7341b 100644 --- a/build/DEBIAN/control +++ b/build/DEBIAN/control @@ -5,6 +5,6 @@ Homepage: [https://gitee.com/gfdgd-xi/uengine-runner, https://github.com/gfdgd-x Architecture: all Priority: optional Conflicts: com.gitee.uengine.runner.spark, spark-uengine-apk-builder -Depends: python3, python3-tk, python3-pip, aapt, uengine, python3-pil, python3-setuptools, deepin-terminal, curl, python3-pil, python3-pil.imagetk +Depends: python3, python3-tk, python3-pip, aapt, uengine, python3-setuptools, deepin-terminal, curl, python3-pil, python3-pil.imagetk, python3-requests, adb, translate-shell Description: UEngine Runner for deepin and UOS diff --git a/build/DEBIAN/postinst b/build/DEBIAN/postinst index 0836180..ceea762 100755 --- a/build/DEBIAN/postinst +++ b/build/DEBIAN/postinst @@ -1,8 +1,10 @@ #!/bin/sh # 安装所需库 -python3 -m pip install --upgrade ttkthemes -python3 -m pip install --upgrade pyautogui -python3 -m pip install --upgrade keyboard -python3 -m pip install --upgrade requests +python3 -m pip install --upgrade ttkthemes -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com +python3 -m pip install --upgrade pyautogui -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com +python3 -m pip install --upgrade keyboard -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com +python3 -m pip install --upgrade requests -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com +# 刷新图标缓存 +gtk-update-icon-cache /usr/share/icons/bloom # 向服务器返回安装数加1(不显示内容且忽略错误) curl http://gfdgdxi.qicp.vip/uengine/Install.php -s > /dev/null | true \ No newline at end of file diff --git a/build/DEBIAN/postrm b/build/DEBIAN/postrm new file mode 100755 index 0000000..eb683d7 --- /dev/null +++ b/build/DEBIAN/postrm @@ -0,0 +1,14 @@ +#!/bin/sh +# 删除软链接 +rm -fv /usr/bin/uengine-runner +rm -fv /usr/bin/uengine-apk-builder +rm -fv /usr/bin/uengine-app-uninstall +rm -fv /usr/bin/uengine-app-install +rm -fv /usr/bin/uengine-clean +rm -fv /usr/bin/uengine-runner-about +rm -fv /usr/bin/uengine-keyboard +rm -fv /usr/bin/uengine-useadb +rm -fv /usr/bin/uengine-runner-launch.sh +rm -fv /usr/bin/uengine-runner-update-bug +# 刷新图标缓存 +gtk-update-icon-cache /usr/share/icons/bloom \ No newline at end of file diff --git a/build/opt/apps/uengine-runner/Language.json b/build/opt/apps/uengine-runner/Language.json index 5e4a2e7..60aa763 100644 --- a/build/opt/apps/uengine-runner/Language.json +++ b/build/opt/apps/uengine-runner/Language.json @@ -93,14 +93,18 @@ "清空 UEngine 数据(需要 Root)" ] }, - "UEngine 键盘映射" + "UEngine 键盘映射", + "UEngine 检测 CPU 是否支持运行", + "删除 UEngine 运行检查", + "重新安装 UEngine" ] }, { "Name": "关于", "Menu": [ "程序官网", - "关于" + "关于", + "反馈程序问题和建议" ] } ] @@ -215,14 +219,18 @@ "Delete All UEngine Data (It Need Run With Root)" ] }, - "UEngine Keyboard" + "UEngine Keyboard", + "UEngine Check CPU Can Or Can't Run", + "Delete UEngine Runing Checking", + "Reinstall UEngine" ] }, { "Name": "About", "Menu": [ "Program WebSize", - "Program Help" + "Program Help", + "Upload Problem And Advice" ] } ] diff --git a/build/opt/apps/uengine-runner/information.json b/build/opt/apps/uengine-runner/information.json index e9a5b16..19a922a 100755 --- a/build/opt/apps/uengine-runner/information.json +++ b/build/opt/apps/uengine-runner/information.json @@ -26,6 +26,16 @@ "4、如果想要使用adb连接UEngine或其他手机,请使用 1.2.0 以前的版本。(如需连接UEngine请安装adb补丁)" ], "Update": [ + "V1.5.1:", + "※1、精简用户界面,合并安装和卸载输入框和浏览按钮等", + "※2、修复安装以其的程序图标无法点击进入的问题(deepin 社区版不存在此问题)", + "※3、支持在程序本体反馈问题", + "4、修复了菜单栏的部分显示问题", + "5、支持显示 apk 的部分信息", + "6、支持删除 UEngine 程序运行检查以及重新安装 UEngine 的功能", + "7、自带有跳过家庭版必须有指定包名才能运行程序限制的脚本", + "8、补回依赖包“adb”", + "", "V1.5.0:", "※1、部分窗口支持英语", "2、修复在英语状态下启动器图标名称异常的问题", diff --git a/build/opt/apps/uengine-runner/setting-new.json b/build/opt/apps/uengine-runner/setting-new.json new file mode 100755 index 0000000..5edfd97 --- /dev/null +++ b/build/opt/apps/uengine-runner/setting-new.json @@ -0,0 +1,6 @@ +{ + "Package": "com.gitee.uengine.runner.spark", + "Update": true, + "Version": "1.5.1", + "Url": "https://gfdgd-xi.github.io/update-program/data/UpdateInformation.json" +} \ No newline at end of file diff --git a/build/opt/apps/uengine-runner/uengine-runner b/build/opt/apps/uengine-runner/uengine-runner index 50ff1c7..9e5dc55 100755 --- a/build/opt/apps/uengine-runner/uengine-runner +++ b/build/opt/apps/uengine-runner/uengine-runner @@ -2,8 +2,8 @@ # 使用系统默认的 python3 运行 ########################################################################################### # 作者:gfdgd xi<3025613752@qq.com> -# 版本:1.4.3 -# 更新时间:2021年9月20日(中秋了) +# 版本:1.5.1 +# 更新时间:2021年10月05日(国庆了) # 感谢:anbox、deepin 和 UOS # 基于 Python3 的 tkinter 构建 # 更新:gfdgd xi<3025613752@qq.com>、actionchen<917981399@qq.com> @@ -91,8 +91,8 @@ def FindApk()->"浏览窗口": # 安装按钮事件 def Button3Install(): - if ComboInstallPath.get() is "": - messagebox.showerror(title="提示", message="信息没有填写完整,无法继续安装 APK") + if ComboInstallPath.get() is "" or not os.path.exists(ComboInstallPath.get()): + messagebox.showerror(title="提示", message="信息没有填写完整或错误,无法继续安装 APK") return DisabledAndEnbled(True) threading.Thread(target=InstallApk, args=(ComboInstallPath.get(),)).start() @@ -156,6 +156,12 @@ def GetCommandReturn(cmd: "命令")->"运行系统命令并获取返回值": # cmd 是要获取输出的命令 return subprocess.getoutput(cmd) +def GetSystemVersion(): + systemInformation = readtxt("/etc/os-release") + for systemInformation in systemInformation.split('\n'): + if "PRETTY_NAME=" in systemInformation: + return systemInformation.replace("PRETTY_NAME=", "").replace('"', '') + # 打开所有窗口事件 def Button5Click(): threading.Thread(target=OpenUengineProgramList).start() @@ -512,6 +518,14 @@ def SaveInstallUengineApp(): traceback.print_exc() messagebox.showerror(title="错误", message=traceback.format_exc()) +def UengineCheckCpu(): + english = GetCommandReturn("uengine check-features") + #chinese = GetCommandReturn("trans -b \"{}\"".format(english)) # 获取中文翻译 + #for i in chinese.split("\n"): # 删除提示 + # if "Did you mean:" in i: + # chinese = chinese.replace(i, "").replace("\n", "") + messagebox.showinfo(title="提示", message="{}".format(english)) + # 获取用户主目录 def get_home()->"获取用户主目录": return os.path.expanduser('~') @@ -567,6 +581,16 @@ def AdbStartServer(): os.system("adb start-server") messagebox.showinfo(title="提示", message="完成!") +def ReinstallUengine(): + threading.Thread(target=os.system, args=["deepin-terminal -C 'pkexec apt reinstall uengine uengine-android-image uengine-modules-dkms -y && notify-send -i uengine \"安装完毕!\"'"]).start() + +def DelUengineCheck(): + if not os.path.exists("/usr/share/uengine/uengine-check-runnable.sh"): + messagebox.showinfo(title="提示", message="本功能已经被删除,无法重复删除!") + return + if messagebox.askokcancel(title="警告", message="删除后将无法使用本软件恢复\n如果需要恢复本功能,请重新安装 UEngine!"): + threading.Thread(target=InstallWindow.ShowWindows, args=["pkexec rm -v /usr/share/uengine/uengine-check-runnable.sh"]).start() + # 使用 adb 连接 uengine def UengineConnectAdb(): messagebox.showinfo(title="提示", message=subprocess.getoutput("adb connect 192.168.250.2:5555")) @@ -586,6 +610,9 @@ def UengineDoNotUseAdb(): return threading.Thread(target=os.system, args=["pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY {}/uengine-useadb 1".format(programPath)]).start() +def UengineRunnerBugUpload(): + threading.Thread(target=os.system, args=[programPath + "/uengine-runner-update-bug"]).start() + def AdbConnectDeviceShow(): ShowTextTipsWindow.ShowWindow(subprocess.getoutput("adb devices -l")) @@ -929,15 +956,20 @@ programUrl = information["Url"][0] version = information["Version"] goodRunSystem = information["System"] aaptVersion = GetCommandReturn("aapt version") +SystemVersion = GetSystemVersion() about = '''介绍 :一个基于 Python3 的 tkinter 制作的 UEngine 运行器,在新版本Deepin/UOS发布后,可以在应用商店安装部分官方已适配的安卓应用,对爱好者来说,不能自己安装APK软件包始终差点意思,本程序可以为Deepin/UOS上的UEngine安卓运行环境安装自定义APK软件包,并能发送安装的APK包启动菜单到桌面或系统菜单。 版本 :{} 适用平台 :{} +Tk 版本 :{} + 程序官网 :{} -©2021-{}'''.format(version, goodRunSystem, tk.TkVersion, programUrl, time.strftime("%Y")) +系统版本 :{} + +©2021-{}'''.format(version, goodRunSystem, tk.TkVersion, programUrl, SystemVersion, time.strftime("%Y")) tips = "\n".join(information["Tips"]) updateThingsString = "\n".join(information["Update"]) title = "{} {}".format(langFile[lang]["Main"]["MainWindow"]["Title"], version) @@ -1084,7 +1116,6 @@ win = tk.Tk() # 创建窗口 style = ttkthemes.ThemedStyle(win) style.set_theme("breeze") window = ttk.Frame(win) -win.attributes('-alpha', 0.5) win.title(title) win.resizable(0, 0) win.iconphoto(False, tk.PhotoImage(file=iconPath)) @@ -1157,16 +1188,20 @@ adbServer.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Men adbServer.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][1]["Menu"][1], command=AdbStopServer) adbServer.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][1]["Menu"][2], command=AdbKillAdbProgress) -uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][0], command=UengineSettingShow) +#uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][0], command=UengineSettingShow) uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][1], command=OpenUengineDebBuilder) uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][7], command=KeyboardToMouse) +uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][8], command=UengineCheckCpu) uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Name"], menu=uengineService) uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][3]["Name"], menu=uengineInternet) uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][4]["Name"], menu=uengineIcon) uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][5]["Name"], menu=uengineUseAdb) uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][6]["Name"], menu=uengineData) +uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][9], command=DelUengineCheck) +uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][10], command=ReinstallUengine) help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][0], command=OpenProgramURL) # 设置“程序官网”项 +help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][2], command=UengineRunnerBugUpload) # 设置“程序官网”项 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) diff --git a/build/opt/apps/uengine-runner/uengine-runner-update-bug b/build/opt/apps/uengine-runner/uengine-runner-update-bug new file mode 100755 index 0000000..9c6b1af --- /dev/null +++ b/build/opt/apps/uengine-runner/uengine-runner-update-bug @@ -0,0 +1,113 @@ +#!/usr/bin/env python3 +import os +import json +import base64 +import requests +import ttkthemes +import traceback +import webbrowser +import tkinter as tk +import tkinter.ttk as ttk +import tkinter.messagebox as messagebox +import urllib.parse as parse + +# 读取文本文档 +def readtxt(path: "路径")->"读取文本文档": + f = open(path, "r") # 设置文件对象 + str = f.read() # 获取内容 + f.close() # 关闭文本对象 + return str # 返回结果 + +def Update(name, stars, contact, things, version): + # post 内容 + data = { + "Name": name, + "Starts": stars, + "Contact": contact, + "Things": things, + "Version": version + } + try: + messagebox.showinfo(message=requests.post(parse.unquote(base64.b64decode("aHR0cCUzQS8vZ2ZkZ2R4aS5xaWNwLnZpcC91ZW5naW5lL2J1Zy91cGxvYWQucGhw").decode("utf-8")), data=data).text) + except: + traceback.print_exc() + messagebox.showerror(title="错误", message="服务器疑似出现错误,可以进行以下尝试:①多尝试几次;②使用其他反馈途径\n错误信息:{}".format(traceback.format_exc())) + +def UpdateButtonClick(): + #判断是否为空 + if nameThings.get() == "" or starValue.get() == "" or contactThings.get() == "" or updateThings.get(1.0, "end").replace(" ", "").replace("\n", "") == "": + messagebox.showerror(title="错误", message="反馈信息未填写完整!") + return + Update(name=nameThings.get(), stars=starValue.get(), contact=contactThings.get(), things=updateThings.get(1.0, "end"), version=version) + +def OpenGiteeIssues(): + webbrowser.open_new_tab("https://gitee.com/gfdgd-xi/uengine-runner/issues") + +def OpenGithubIssues(): + webbrowser.open_new_tab("https://github.com/gfdgd-xi/uengine-runner/issues") + +########################### +# 程序信息 +########################### +iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0]) +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +information = json.loads(readtxt(programPath + "/information.json")) +version = information["Version"] + +########################### +# 窗口创建 +########################### +window = tk.Tk() +win = ttk.Frame() + +starValue = tk.StringVar() +starValue.set("5分") + +name = ttk.Label(win, text="你的昵称:") +nameThings = ttk.Entry(win, width=25) + +contact = ttk.Label(win, text="联系方式:") +contactThings = ttk.Entry(win, width=25) + +star = ttk.Label(win, text="评分:") +starMenu = ttk.OptionMenu(win, starValue, "5分", "5分", "4分", "3分", "2分", "1分") + +updateThingsTips = ttk.Label(win, text="反馈内容(支持 Markdown 格式):") +updateThings = tk.Text(win) + +otherUpload = ttk.Frame(win) +# 所属内容 +tips = ttk.Label(otherUpload, text="如果无法正常反馈,可以用其他方式反馈:") +giteeButton = ttk.Button(otherUpload, text="Gitee Issues", command=OpenGiteeIssues) +githubButton = ttk.Button(otherUpload, text="Github Issues", command=OpenGithubIssues) + +updateButton = ttk.Button(win, text="提交", command=UpdateButtonClick) + +# 设置窗口 +style = ttkthemes.ThemedStyle(window) +style.set_theme("breeze") +window.title("UEngine 运行器 {} 问题/建议反馈".format(version)) +window.resizable(0, 0) +window.iconphoto(False, tk.PhotoImage(file=iconPath)) + +tips.grid(row=0, column=0) +giteeButton.grid(row=0, column=1) +githubButton.grid(row=0, column=2) + +name.grid(row=0, column=0) +nameThings.grid(row=0, column=1) + +contact.grid(row=0, column=2) +contactThings.grid(row=0, column=3) + +star.grid(row=0, column=4) +starMenu.grid(row=0, column=5) + +updateThingsTips.grid(row=1, column=0, columnspan=2) +updateThings.grid(row=2, column=0, columnspan=6) + +otherUpload.grid(row=3, column=0, columnspan=4) +updateButton.grid(row=3, column=5) + +win.pack(expand="yes", fill="both") +window.mainloop() \ No newline at end of file diff --git a/build/usr/bin/uengine-runner-update-bug b/build/usr/bin/uengine-runner-update-bug new file mode 120000 index 0000000..f3d5efa --- /dev/null +++ b/build/usr/bin/uengine-runner-update-bug @@ -0,0 +1 @@ +/opt/apps/uengine-runner/uengine-runner-update-bug \ No newline at end of file diff --git a/build/usr/share/applications/UengineAndroidSetting.desktop b/build/usr/share/applications/UengineAndroidSetting.desktop deleted file mode 100644 index 3d9253c..0000000 --- a/build/usr/share/applications/UengineAndroidSetting.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Categories=System; -Comment=UEngine 系统设置 -Encoding=UTF-8 -Exec=/usr/bin/uengine launch --action=android.intent.action.MAIN --package=com.android.settings --component=com.android.settings.Settings -Icon=/opt/apps/uengine-runner/icon.png -MimeType= -Name=UEngine System Control Panel -Name[zh]=UEngine 系统设置 -StartupWMClass=UEngine 系统设置 -Terminal=false -Type=Application diff --git a/build/usr/share/icons/apps/256/uengine.svg b/build/usr/share/icons/apps/256/uengine.svg new file mode 100644 index 0000000..c77d1fe --- /dev/null +++ b/build/usr/share/icons/apps/256/uengine.svg @@ -0,0 +1,153 @@ + + + APPS_安卓容器_bonund256pt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/usr/share/icons/uengine.svg b/build/usr/share/icons/uengine.svg new file mode 100644 index 0000000..c77d1fe --- /dev/null +++ b/build/usr/share/icons/uengine.svg @@ -0,0 +1,153 @@ + + + APPS_安卓容器_bonund256pt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/usr/share/polkit-1/actions/com.deepin.pkexec.apt.policy b/build/usr/share/polkit-1/actions/com.deepin.pkexec.apt.policy new file mode 100644 index 0000000..da7935b --- /dev/null +++ b/build/usr/share/polkit-1/actions/com.deepin.pkexec.apt.policy @@ -0,0 +1,21 @@ + + + + gfdgd xi + https://gitee.com/gfdgd-xi/uengine-runner/ + + Authentication is required to Install or Reinstall Program + 安装或卸载软件需要输入密码 + preferences-system + + no + no + auth_admin_keep + + /usr/bin/apt + true + + + \ No newline at end of file diff --git a/build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-bridge.policy b/build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-bridge.policy index 2a140e4..b5ff17a 100644 --- a/build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-bridge.policy +++ b/build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-bridge.policy @@ -8,7 +8,7 @@ Authentication is required to Setting UEngine Internet Bridge 设置 UEngine 桥接需要输入密码 - /usr/share/uengine/ui/uengine_logo.svg + uengine no no diff --git a/build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-session-launch-helper.policy b/build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-session-launch-helper.policy index 2b57ffe..9f61433 100644 --- a/build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-session-launch-helper.policy +++ b/build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-session-launch-helper.policy @@ -8,7 +8,7 @@ Authentication is required to Change UEngine 设置 UEngine 需要输入密码 - /usr/share/uengine/ui/uengine_logo.svg + uengine no no diff --git a/com.gitee.uengine.runner.spark.deb b/com.gitee.uengine.runner.spark.deb index c031819..07ff5f2 100755 Binary files a/com.gitee.uengine.runner.spark.deb and b/com.gitee.uengine.runner.spark.deb differ diff --git a/information.json b/information.json index 4be55e0..19a922a 100755 --- a/information.json +++ b/information.json @@ -27,10 +27,14 @@ ], "Update": [ "V1.5.1:", - "※1、修复安装以其的程序图标无法点击进入的问题(deepin 社区版不存在此问题)", - "※2、支持在程序本体反馈问题", - "3、修复了菜单栏的部分显示问题", - "4、支持显示 apk 的部分信息", + "※1、精简用户界面,合并安装和卸载输入框和浏览按钮等", + "※2、修复安装以其的程序图标无法点击进入的问题(deepin 社区版不存在此问题)", + "※3、支持在程序本体反馈问题", + "4、修复了菜单栏的部分显示问题", + "5、支持显示 apk 的部分信息", + "6、支持删除 UEngine 程序运行检查以及重新安装 UEngine 的功能", + "7、自带有跳过家庭版必须有指定包名才能运行程序限制的脚本", + "8、补回依赖包“adb”", "", "V1.5.0:", "※1、部分窗口支持英语", diff --git a/main.py b/main.py index 96d3fa9..9e5dc55 100755 --- a/main.py +++ b/main.py @@ -2,8 +2,8 @@ # 使用系统默认的 python3 运行 ########################################################################################### # 作者:gfdgd xi<3025613752@qq.com> -# 版本:1.4.3 -# 更新时间:2021年10月03日(国庆了) +# 版本:1.5.1 +# 更新时间:2021年10月05日(国庆了) # 感谢:anbox、deepin 和 UOS # 基于 Python3 的 tkinter 构建 # 更新:gfdgd xi<3025613752@qq.com>、actionchen<917981399@qq.com> @@ -520,11 +520,11 @@ def SaveInstallUengineApp(): def UengineCheckCpu(): english = GetCommandReturn("uengine check-features") - chinese = GetCommandReturn("trans -b \"{}\"".format(english)) # 获取中文翻译 - for i in chinese.split("\n"): # 删除提示 - if "Did you mean:" in i: - chinese = chinese.replace(i, "").replace("\n", "") - messagebox.showinfo(title="提示", message="{}\n{}".format(english, chinese)) + #chinese = GetCommandReturn("trans -b \"{}\"".format(english)) # 获取中文翻译 + #for i in chinese.split("\n"): # 删除提示 + # if "Did you mean:" in i: + # chinese = chinese.replace(i, "").replace("\n", "") + messagebox.showinfo(title="提示", message="{}".format(english)) # 获取用户主目录 def get_home()->"获取用户主目录": @@ -581,6 +581,16 @@ def AdbStartServer(): os.system("adb start-server") messagebox.showinfo(title="提示", message="完成!") +def ReinstallUengine(): + threading.Thread(target=os.system, args=["deepin-terminal -C 'pkexec apt reinstall uengine uengine-android-image uengine-modules-dkms -y && notify-send -i uengine \"安装完毕!\"'"]).start() + +def DelUengineCheck(): + if not os.path.exists("/usr/share/uengine/uengine-check-runnable.sh"): + messagebox.showinfo(title="提示", message="本功能已经被删除,无法重复删除!") + return + if messagebox.askokcancel(title="警告", message="删除后将无法使用本软件恢复\n如果需要恢复本功能,请重新安装 UEngine!"): + threading.Thread(target=InstallWindow.ShowWindows, args=["pkexec rm -v /usr/share/uengine/uengine-check-runnable.sh"]).start() + # 使用 adb 连接 uengine def UengineConnectAdb(): messagebox.showinfo(title="提示", message=subprocess.getoutput("adb connect 192.168.250.2:5555")) @@ -600,6 +610,9 @@ def UengineDoNotUseAdb(): return threading.Thread(target=os.system, args=["pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY {}/uengine-useadb 1".format(programPath)]).start() +def UengineRunnerBugUpload(): + threading.Thread(target=os.system, args=[programPath + "/uengine-runner-update-bug"]).start() + def AdbConnectDeviceShow(): ShowTextTipsWindow.ShowWindow(subprocess.getoutput("adb devices -l")) @@ -1103,7 +1116,6 @@ win = tk.Tk() # 创建窗口 style = ttkthemes.ThemedStyle(win) style.set_theme("breeze") window = ttk.Frame(win) -win.attributes('-alpha', 0.5) win.title(title) win.resizable(0, 0) win.iconphoto(False, tk.PhotoImage(file=iconPath)) @@ -1176,7 +1188,7 @@ adbServer.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Men adbServer.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][1]["Menu"][1], command=AdbStopServer) adbServer.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][1]["Menu"][2], command=AdbKillAdbProgress) -uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][0], command=UengineSettingShow) +#uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][0], command=UengineSettingShow) uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][1], command=OpenUengineDebBuilder) uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][7], command=KeyboardToMouse) uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][8], command=UengineCheckCpu) @@ -1185,8 +1197,11 @@ uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu" uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][4]["Name"], menu=uengineIcon) uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][5]["Name"], menu=uengineUseAdb) uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][6]["Name"], menu=uengineData) +uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][9], command=DelUengineCheck) +uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][10], command=ReinstallUengine) help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][0], command=OpenProgramURL) # 设置“程序官网”项 +help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][2], command=UengineRunnerBugUpload) # 设置“程序官网”项 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) diff --git a/new-deb-build/DEBIAN/control b/new-deb-build/DEBIAN/control index 903680b..f1e51f8 100644 --- a/new-deb-build/DEBIAN/control +++ b/new-deb-build/DEBIAN/control @@ -3,7 +3,7 @@ Source: com.gitee.uengine.runner.spark Version: 1.5.1 Architecture: all 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, curl +Depends: deepin-elf-verify (>= 0.0.16.7-1), python3, python3-tk, python3-pip, aapt, uengine, python3-setuptools, deepin-terminal, curl, python3-pil, python3-pil.imagetk, python3-requests, adb, translate-shell Section: utils Priority: optional Conflicts: spark-uengine-runner, spark-uengine-apk-builder diff --git a/new-deb-build/DEBIAN/postinst b/new-deb-build/DEBIAN/postinst index c14b9ee..73c67df 100755 --- a/new-deb-build/DEBIAN/postinst +++ b/new-deb-build/DEBIAN/postinst @@ -1,9 +1,9 @@ #!/bin/sh # 使用 pip 安装所需库 -python3 -m pip install --upgrade ttkthemes -python3 -m pip install --upgrade requests -python3 -m pip install --upgrade pyautogui -python3 -m pip install --upgrade keyboard +python3 -m pip install --upgrade ttkthemes -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com +python3 -m pip install --upgrade requests -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com +python3 -m pip install --upgrade pyautogui -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com +python3 -m pip install --upgrade keyboard -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com # 建立软链接 ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner /usr/bin/uengine-runner ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-apk-builder /usr/bin/uengine-apk-builder @@ -14,5 +14,8 @@ ln -s /opt/apps/com.gitee.uengine.runner.spark/files/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-useadb /usr/bin/uengine-useadb ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-launch.sh /usr/bin/uengine-runner-launch.sh +ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-update-bug /usr/bin/uengine-runner-update-bug +# 刷新图标缓存 +#gtk-update-icon-cache /usr/share/icons/bloom # 向服务器返回安装数加1(不显示内容且忽略错误) curl http://gfdgdxi.qicp.vip/uengine/Install.php -s > /dev/null | true \ No newline at end of file diff --git a/new-deb-build/DEBIAN/postrm b/new-deb-build/DEBIAN/postrm index b3730ca..eb683d7 100755 --- a/new-deb-build/DEBIAN/postrm +++ b/new-deb-build/DEBIAN/postrm @@ -7,4 +7,8 @@ rm -fv /usr/bin/uengine-app-install rm -fv /usr/bin/uengine-clean rm -fv /usr/bin/uengine-runner-about rm -fv /usr/bin/uengine-keyboard -rm -fv /usr/bin/uengine-useadb \ No newline at end of file +rm -fv /usr/bin/uengine-useadb +rm -fv /usr/bin/uengine-runner-launch.sh +rm -fv /usr/bin/uengine-runner-update-bug +# 刷新图标缓存 +gtk-update-icon-cache /usr/share/icons/bloom \ No newline at end of file diff --git a/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/entries/applications/UengineAndroidSetting.desktop b/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/entries/applications/UengineAndroidSetting.desktop deleted file mode 100644 index 956e612..0000000 --- a/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/entries/applications/UengineAndroidSetting.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Categories=System; -Comment=UEngine System Control Panel -Comment[zh]=UEngine 系统设置 -Encoding=UTF-8 -Exec=/usr/bin/uengine launch --action=android.intent.action.MAIN --package=com.android.settings --component=com.android.settings.Settings -Icon=/opt/apps/com.gitee.uengine.runner.spark/files/icon.png -MimeType= -Name=UEngine System Control Panel -Name[zh]=UEngine 系统设置 -StartupWMClass=UEngine 系统设置 -Terminal=false -Type=Application diff --git a/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/Language.json b/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/Language.json index 5e4a2e7..60aa763 100644 --- a/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/Language.json +++ b/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/Language.json @@ -93,14 +93,18 @@ "清空 UEngine 数据(需要 Root)" ] }, - "UEngine 键盘映射" + "UEngine 键盘映射", + "UEngine 检测 CPU 是否支持运行", + "删除 UEngine 运行检查", + "重新安装 UEngine" ] }, { "Name": "关于", "Menu": [ "程序官网", - "关于" + "关于", + "反馈程序问题和建议" ] } ] @@ -215,14 +219,18 @@ "Delete All UEngine Data (It Need Run With Root)" ] }, - "UEngine Keyboard" + "UEngine Keyboard", + "UEngine Check CPU Can Or Can't Run", + "Delete UEngine Runing Checking", + "Reinstall UEngine" ] }, { "Name": "About", "Menu": [ "Program WebSize", - "Program Help" + "Program Help", + "Upload Problem And Advice" ] } ] diff --git a/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/information.json b/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/information.json index e9a5b16..19a922a 100755 --- a/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/information.json +++ b/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/information.json @@ -26,6 +26,16 @@ "4、如果想要使用adb连接UEngine或其他手机,请使用 1.2.0 以前的版本。(如需连接UEngine请安装adb补丁)" ], "Update": [ + "V1.5.1:", + "※1、精简用户界面,合并安装和卸载输入框和浏览按钮等", + "※2、修复安装以其的程序图标无法点击进入的问题(deepin 社区版不存在此问题)", + "※3、支持在程序本体反馈问题", + "4、修复了菜单栏的部分显示问题", + "5、支持显示 apk 的部分信息", + "6、支持删除 UEngine 程序运行检查以及重新安装 UEngine 的功能", + "7、自带有跳过家庭版必须有指定包名才能运行程序限制的脚本", + "8、补回依赖包“adb”", + "", "V1.5.0:", "※1、部分窗口支持英语", "2、修复在英语状态下启动器图标名称异常的问题", diff --git a/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/setting-new.json b/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/setting-new.json new file mode 100755 index 0000000..5edfd97 --- /dev/null +++ b/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/setting-new.json @@ -0,0 +1,6 @@ +{ + "Package": "com.gitee.uengine.runner.spark", + "Update": true, + "Version": "1.5.1", + "Url": "https://gfdgd-xi.github.io/update-program/data/UpdateInformation.json" +} \ No newline at end of file diff --git a/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/setting.json b/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/setting.json index 5edfd97..d4f0364 100755 --- a/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/setting.json +++ b/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/setting.json @@ -1,6 +1,7 @@ { - "Package": "com.gitee.uengine.runner.spark", + "Package": "spark-uengine-runner", "Update": true, "Version": "1.5.1", "Url": "https://gfdgd-xi.github.io/update-program/data/UpdateInformation.json" + } \ No newline at end of file diff --git a/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner b/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner index 50ff1c7..9e5dc55 100755 --- a/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner +++ b/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner @@ -2,8 +2,8 @@ # 使用系统默认的 python3 运行 ########################################################################################### # 作者:gfdgd xi<3025613752@qq.com> -# 版本:1.4.3 -# 更新时间:2021年9月20日(中秋了) +# 版本:1.5.1 +# 更新时间:2021年10月05日(国庆了) # 感谢:anbox、deepin 和 UOS # 基于 Python3 的 tkinter 构建 # 更新:gfdgd xi<3025613752@qq.com>、actionchen<917981399@qq.com> @@ -91,8 +91,8 @@ def FindApk()->"浏览窗口": # 安装按钮事件 def Button3Install(): - if ComboInstallPath.get() is "": - messagebox.showerror(title="提示", message="信息没有填写完整,无法继续安装 APK") + if ComboInstallPath.get() is "" or not os.path.exists(ComboInstallPath.get()): + messagebox.showerror(title="提示", message="信息没有填写完整或错误,无法继续安装 APK") return DisabledAndEnbled(True) threading.Thread(target=InstallApk, args=(ComboInstallPath.get(),)).start() @@ -156,6 +156,12 @@ def GetCommandReturn(cmd: "命令")->"运行系统命令并获取返回值": # cmd 是要获取输出的命令 return subprocess.getoutput(cmd) +def GetSystemVersion(): + systemInformation = readtxt("/etc/os-release") + for systemInformation in systemInformation.split('\n'): + if "PRETTY_NAME=" in systemInformation: + return systemInformation.replace("PRETTY_NAME=", "").replace('"', '') + # 打开所有窗口事件 def Button5Click(): threading.Thread(target=OpenUengineProgramList).start() @@ -512,6 +518,14 @@ def SaveInstallUengineApp(): traceback.print_exc() messagebox.showerror(title="错误", message=traceback.format_exc()) +def UengineCheckCpu(): + english = GetCommandReturn("uengine check-features") + #chinese = GetCommandReturn("trans -b \"{}\"".format(english)) # 获取中文翻译 + #for i in chinese.split("\n"): # 删除提示 + # if "Did you mean:" in i: + # chinese = chinese.replace(i, "").replace("\n", "") + messagebox.showinfo(title="提示", message="{}".format(english)) + # 获取用户主目录 def get_home()->"获取用户主目录": return os.path.expanduser('~') @@ -567,6 +581,16 @@ def AdbStartServer(): os.system("adb start-server") messagebox.showinfo(title="提示", message="完成!") +def ReinstallUengine(): + threading.Thread(target=os.system, args=["deepin-terminal -C 'pkexec apt reinstall uengine uengine-android-image uengine-modules-dkms -y && notify-send -i uengine \"安装完毕!\"'"]).start() + +def DelUengineCheck(): + if not os.path.exists("/usr/share/uengine/uengine-check-runnable.sh"): + messagebox.showinfo(title="提示", message="本功能已经被删除,无法重复删除!") + return + if messagebox.askokcancel(title="警告", message="删除后将无法使用本软件恢复\n如果需要恢复本功能,请重新安装 UEngine!"): + threading.Thread(target=InstallWindow.ShowWindows, args=["pkexec rm -v /usr/share/uengine/uengine-check-runnable.sh"]).start() + # 使用 adb 连接 uengine def UengineConnectAdb(): messagebox.showinfo(title="提示", message=subprocess.getoutput("adb connect 192.168.250.2:5555")) @@ -586,6 +610,9 @@ def UengineDoNotUseAdb(): return threading.Thread(target=os.system, args=["pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY {}/uengine-useadb 1".format(programPath)]).start() +def UengineRunnerBugUpload(): + threading.Thread(target=os.system, args=[programPath + "/uengine-runner-update-bug"]).start() + def AdbConnectDeviceShow(): ShowTextTipsWindow.ShowWindow(subprocess.getoutput("adb devices -l")) @@ -929,15 +956,20 @@ programUrl = information["Url"][0] version = information["Version"] goodRunSystem = information["System"] aaptVersion = GetCommandReturn("aapt version") +SystemVersion = GetSystemVersion() about = '''介绍 :一个基于 Python3 的 tkinter 制作的 UEngine 运行器,在新版本Deepin/UOS发布后,可以在应用商店安装部分官方已适配的安卓应用,对爱好者来说,不能自己安装APK软件包始终差点意思,本程序可以为Deepin/UOS上的UEngine安卓运行环境安装自定义APK软件包,并能发送安装的APK包启动菜单到桌面或系统菜单。 版本 :{} 适用平台 :{} +Tk 版本 :{} + 程序官网 :{} -©2021-{}'''.format(version, goodRunSystem, tk.TkVersion, programUrl, time.strftime("%Y")) +系统版本 :{} + +©2021-{}'''.format(version, goodRunSystem, tk.TkVersion, programUrl, SystemVersion, time.strftime("%Y")) tips = "\n".join(information["Tips"]) updateThingsString = "\n".join(information["Update"]) title = "{} {}".format(langFile[lang]["Main"]["MainWindow"]["Title"], version) @@ -1084,7 +1116,6 @@ win = tk.Tk() # 创建窗口 style = ttkthemes.ThemedStyle(win) style.set_theme("breeze") window = ttk.Frame(win) -win.attributes('-alpha', 0.5) win.title(title) win.resizable(0, 0) win.iconphoto(False, tk.PhotoImage(file=iconPath)) @@ -1157,16 +1188,20 @@ adbServer.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Men adbServer.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][1]["Menu"][1], command=AdbStopServer) adbServer.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][1]["Menu"][2], command=AdbKillAdbProgress) -uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][0], command=UengineSettingShow) +#uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][0], command=UengineSettingShow) uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][1], command=OpenUengineDebBuilder) uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][7], command=KeyboardToMouse) +uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][8], command=UengineCheckCpu) uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Name"], menu=uengineService) uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][3]["Name"], menu=uengineInternet) uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][4]["Name"], menu=uengineIcon) uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][5]["Name"], menu=uengineUseAdb) uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][6]["Name"], menu=uengineData) +uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][9], command=DelUengineCheck) +uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][10], command=ReinstallUengine) help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][0], command=OpenProgramURL) # 设置“程序官网”项 +help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][2], command=UengineRunnerBugUpload) # 设置“程序官网”项 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) diff --git a/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-update-bug b/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-update-bug new file mode 100755 index 0000000..9c6b1af --- /dev/null +++ b/new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-update-bug @@ -0,0 +1,113 @@ +#!/usr/bin/env python3 +import os +import json +import base64 +import requests +import ttkthemes +import traceback +import webbrowser +import tkinter as tk +import tkinter.ttk as ttk +import tkinter.messagebox as messagebox +import urllib.parse as parse + +# 读取文本文档 +def readtxt(path: "路径")->"读取文本文档": + f = open(path, "r") # 设置文件对象 + str = f.read() # 获取内容 + f.close() # 关闭文本对象 + return str # 返回结果 + +def Update(name, stars, contact, things, version): + # post 内容 + data = { + "Name": name, + "Starts": stars, + "Contact": contact, + "Things": things, + "Version": version + } + try: + messagebox.showinfo(message=requests.post(parse.unquote(base64.b64decode("aHR0cCUzQS8vZ2ZkZ2R4aS5xaWNwLnZpcC91ZW5naW5lL2J1Zy91cGxvYWQucGhw").decode("utf-8")), data=data).text) + except: + traceback.print_exc() + messagebox.showerror(title="错误", message="服务器疑似出现错误,可以进行以下尝试:①多尝试几次;②使用其他反馈途径\n错误信息:{}".format(traceback.format_exc())) + +def UpdateButtonClick(): + #判断是否为空 + if nameThings.get() == "" or starValue.get() == "" or contactThings.get() == "" or updateThings.get(1.0, "end").replace(" ", "").replace("\n", "") == "": + messagebox.showerror(title="错误", message="反馈信息未填写完整!") + return + Update(name=nameThings.get(), stars=starValue.get(), contact=contactThings.get(), things=updateThings.get(1.0, "end"), version=version) + +def OpenGiteeIssues(): + webbrowser.open_new_tab("https://gitee.com/gfdgd-xi/uengine-runner/issues") + +def OpenGithubIssues(): + webbrowser.open_new_tab("https://github.com/gfdgd-xi/uengine-runner/issues") + +########################### +# 程序信息 +########################### +iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0]) +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +information = json.loads(readtxt(programPath + "/information.json")) +version = information["Version"] + +########################### +# 窗口创建 +########################### +window = tk.Tk() +win = ttk.Frame() + +starValue = tk.StringVar() +starValue.set("5分") + +name = ttk.Label(win, text="你的昵称:") +nameThings = ttk.Entry(win, width=25) + +contact = ttk.Label(win, text="联系方式:") +contactThings = ttk.Entry(win, width=25) + +star = ttk.Label(win, text="评分:") +starMenu = ttk.OptionMenu(win, starValue, "5分", "5分", "4分", "3分", "2分", "1分") + +updateThingsTips = ttk.Label(win, text="反馈内容(支持 Markdown 格式):") +updateThings = tk.Text(win) + +otherUpload = ttk.Frame(win) +# 所属内容 +tips = ttk.Label(otherUpload, text="如果无法正常反馈,可以用其他方式反馈:") +giteeButton = ttk.Button(otherUpload, text="Gitee Issues", command=OpenGiteeIssues) +githubButton = ttk.Button(otherUpload, text="Github Issues", command=OpenGithubIssues) + +updateButton = ttk.Button(win, text="提交", command=UpdateButtonClick) + +# 设置窗口 +style = ttkthemes.ThemedStyle(window) +style.set_theme("breeze") +window.title("UEngine 运行器 {} 问题/建议反馈".format(version)) +window.resizable(0, 0) +window.iconphoto(False, tk.PhotoImage(file=iconPath)) + +tips.grid(row=0, column=0) +giteeButton.grid(row=0, column=1) +githubButton.grid(row=0, column=2) + +name.grid(row=0, column=0) +nameThings.grid(row=0, column=1) + +contact.grid(row=0, column=2) +contactThings.grid(row=0, column=3) + +star.grid(row=0, column=4) +starMenu.grid(row=0, column=5) + +updateThingsTips.grid(row=1, column=0, columnspan=2) +updateThings.grid(row=2, column=0, columnspan=6) + +otherUpload.grid(row=3, column=0, columnspan=4) +updateButton.grid(row=3, column=5) + +win.pack(expand="yes", fill="both") +window.mainloop() \ No newline at end of file diff --git a/new-deb-build/usr/share/icons/apps/256/uengine.svg b/new-deb-build/usr/share/icons/apps/256/uengine.svg new file mode 100644 index 0000000..c77d1fe --- /dev/null +++ b/new-deb-build/usr/share/icons/apps/256/uengine.svg @@ -0,0 +1,153 @@ + + + APPS_安卓容器_bonund256pt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/new-deb-build/usr/share/polkit-1/actions/com.deepin.pkexec.apt.policy b/new-deb-build/usr/share/polkit-1/actions/com.deepin.pkexec.apt.policy new file mode 100644 index 0000000..da7935b --- /dev/null +++ b/new-deb-build/usr/share/polkit-1/actions/com.deepin.pkexec.apt.policy @@ -0,0 +1,21 @@ + + + + gfdgd xi + https://gitee.com/gfdgd-xi/uengine-runner/ + + Authentication is required to Install or Reinstall Program + 安装或卸载软件需要输入密码 + preferences-system + + no + no + auth_admin_keep + + /usr/bin/apt + true + + + \ No newline at end of file diff --git a/new-deb-build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-bridge.policy b/new-deb-build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-bridge.policy index 2a140e4..b5ff17a 100644 --- a/new-deb-build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-bridge.policy +++ b/new-deb-build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-bridge.policy @@ -8,7 +8,7 @@ Authentication is required to Setting UEngine Internet Bridge 设置 UEngine 桥接需要输入密码 - /usr/share/uengine/ui/uengine_logo.svg + uengine no no diff --git a/new-deb-build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-session-launch-helper.policy b/new-deb-build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-session-launch-helper.policy index 2b57ffe..9f61433 100644 --- a/new-deb-build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-session-launch-helper.policy +++ b/new-deb-build/usr/share/polkit-1/actions/com.deepin.pkexec.uengine-session-launch-helper.policy @@ -8,7 +8,7 @@ Authentication is required to Change UEngine 设置 UEngine 需要输入密码 - /usr/share/uengine/ui/uengine_logo.svg + uengine no no diff --git a/pkexec/com.deepin.pkexec.apt.policy b/pkexec/com.deepin.pkexec.apt.policy new file mode 100644 index 0000000..da7935b --- /dev/null +++ b/pkexec/com.deepin.pkexec.apt.policy @@ -0,0 +1,21 @@ + + + + gfdgd xi + https://gitee.com/gfdgd-xi/uengine-runner/ + + Authentication is required to Install or Reinstall Program + 安装或卸载软件需要输入密码 + preferences-system + + no + no + auth_admin_keep + + /usr/bin/apt + true + + + \ No newline at end of file diff --git a/spark-uengine-runner.deb b/spark-uengine-runner.deb index bc1a239..865fff0 100755 Binary files a/spark-uengine-runner.deb and b/spark-uengine-runner.deb differ diff --git a/uengine-runner-update-bug b/uengine-runner-update-bug new file mode 100755 index 0000000..9c6b1af --- /dev/null +++ b/uengine-runner-update-bug @@ -0,0 +1,113 @@ +#!/usr/bin/env python3 +import os +import json +import base64 +import requests +import ttkthemes +import traceback +import webbrowser +import tkinter as tk +import tkinter.ttk as ttk +import tkinter.messagebox as messagebox +import urllib.parse as parse + +# 读取文本文档 +def readtxt(path: "路径")->"读取文本文档": + f = open(path, "r") # 设置文件对象 + str = f.read() # 获取内容 + f.close() # 关闭文本对象 + return str # 返回结果 + +def Update(name, stars, contact, things, version): + # post 内容 + data = { + "Name": name, + "Starts": stars, + "Contact": contact, + "Things": things, + "Version": version + } + try: + messagebox.showinfo(message=requests.post(parse.unquote(base64.b64decode("aHR0cCUzQS8vZ2ZkZ2R4aS5xaWNwLnZpcC91ZW5naW5lL2J1Zy91cGxvYWQucGhw").decode("utf-8")), data=data).text) + except: + traceback.print_exc() + messagebox.showerror(title="错误", message="服务器疑似出现错误,可以进行以下尝试:①多尝试几次;②使用其他反馈途径\n错误信息:{}".format(traceback.format_exc())) + +def UpdateButtonClick(): + #判断是否为空 + if nameThings.get() == "" or starValue.get() == "" or contactThings.get() == "" or updateThings.get(1.0, "end").replace(" ", "").replace("\n", "") == "": + messagebox.showerror(title="错误", message="反馈信息未填写完整!") + return + Update(name=nameThings.get(), stars=starValue.get(), contact=contactThings.get(), things=updateThings.get(1.0, "end"), version=version) + +def OpenGiteeIssues(): + webbrowser.open_new_tab("https://gitee.com/gfdgd-xi/uengine-runner/issues") + +def OpenGithubIssues(): + webbrowser.open_new_tab("https://github.com/gfdgd-xi/uengine-runner/issues") + +########################### +# 程序信息 +########################### +iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0]) +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +information = json.loads(readtxt(programPath + "/information.json")) +version = information["Version"] + +########################### +# 窗口创建 +########################### +window = tk.Tk() +win = ttk.Frame() + +starValue = tk.StringVar() +starValue.set("5分") + +name = ttk.Label(win, text="你的昵称:") +nameThings = ttk.Entry(win, width=25) + +contact = ttk.Label(win, text="联系方式:") +contactThings = ttk.Entry(win, width=25) + +star = ttk.Label(win, text="评分:") +starMenu = ttk.OptionMenu(win, starValue, "5分", "5分", "4分", "3分", "2分", "1分") + +updateThingsTips = ttk.Label(win, text="反馈内容(支持 Markdown 格式):") +updateThings = tk.Text(win) + +otherUpload = ttk.Frame(win) +# 所属内容 +tips = ttk.Label(otherUpload, text="如果无法正常反馈,可以用其他方式反馈:") +giteeButton = ttk.Button(otherUpload, text="Gitee Issues", command=OpenGiteeIssues) +githubButton = ttk.Button(otherUpload, text="Github Issues", command=OpenGithubIssues) + +updateButton = ttk.Button(win, text="提交", command=UpdateButtonClick) + +# 设置窗口 +style = ttkthemes.ThemedStyle(window) +style.set_theme("breeze") +window.title("UEngine 运行器 {} 问题/建议反馈".format(version)) +window.resizable(0, 0) +window.iconphoto(False, tk.PhotoImage(file=iconPath)) + +tips.grid(row=0, column=0) +giteeButton.grid(row=0, column=1) +githubButton.grid(row=0, column=2) + +name.grid(row=0, column=0) +nameThings.grid(row=0, column=1) + +contact.grid(row=0, column=2) +contactThings.grid(row=0, column=3) + +star.grid(row=0, column=4) +starMenu.grid(row=0, column=5) + +updateThingsTips.grid(row=1, column=0, columnspan=2) +updateThings.grid(row=2, column=0, columnspan=6) + +otherUpload.grid(row=3, column=0, columnspan=4) +updateButton.grid(row=3, column=5) + +win.pack(expand="yes", fill="both") +window.mainloop() \ No newline at end of file diff --git a/uengine-update-bug b/uengine-update-bug deleted file mode 100644 index 476f4a5..0000000 --- a/uengine-update-bug +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python3 -import base64 -import urllib.parse as parse -import requests -import ttkthemes -import tkinter as tk -import tkinter.ttk as ttk -import tkinter.messagebox as messagebox - -def 加密(): - url = "http://" - bytes_url = url.encode("utf-8") - str_url = base64.b64encode(bytes_url) - print(str_url) - -def 解密(): - url = "" - str_url = base64.b64decode(url).decode("utf-8") - print(str_url) - -def Update(name, stars, contact, things): - # 替换换行符 - things = things.replace("\n", "\\n") - # url 编码 - print(parse.quote(name)) - print(parse.quote(stars)) - print(parse.quote(contact)) - print(parse.quote(things)) - # post 内容 - data = { - "Name": name, - "Starts": stars, - "Contact": contact, - "Things": things - } - requests.post(url, data=data) - -def UpdateButtonClick(): - Update(name=nameThings.get(), stars=starValue.get(), contact=contactThings.get(), things=updateThings.get(1.0, "end")) - -window = tk.Tk() -win = ttk.Frame() - -starValue = tk.StringVar() -starValue.set("5分") - -name = ttk.Label(win, text="你的昵称:") -nameThings = ttk.Entry(win, width=25) - -contact = ttk.Label(win, text="联系方式:") -contactThings = ttk.Entry(win, width=25) - -star = ttk.Label(win, text="评分:") -starMenu = ttk.OptionMenu(win, starValue, "5分", "5分", "4分", "3分", "2分", "1分") - -updateThingsTips = ttk.Label(win, text="反馈内容(支持 Markdown 格式):") -updateThings = tk.Text(win) - -updateButton = ttk.Button(win, text="提交", command=UpdateButtonClick) - -name.grid(row=0, column=0) -nameThings.grid(row=0, column=1) - -contact.grid(row=0, column=2) -contactThings.grid(row=0, column=3) - -star.grid(row=0, column=4) -starMenu.grid(row=0, column=5) - -updateThingsTips.grid(row=1, column=0, columnspan=2) -updateThings.grid(row=2, column=0, columnspan=6) - -updateButton.grid(row=3, column=5) - -win.pack(expand="yes", fill="both") -window.mainloop() \ No newline at end of file