From 3f756fd680c5beaad875bb7ece1bc88e0f2f2c98 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Wed, 18 Jan 2023 15:29:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E6=9B=B4=E6=96=B0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AutoConfig.py | 8 +++- Download.py | 6 +++ Model/__init__.py | 4 +- Model/__pycache__/__init__.cpython-37.pyc | Bin 1103 -> 1198 bytes mainwindow.py | 46 ++++++++++++++++------ uengine-apk-builder | 8 ++++ uengine-installer | 2 +- 7 files changed, 58 insertions(+), 16 deletions(-) diff --git a/AutoConfig.py b/AutoConfig.py index 75380f5..406ceb8 100755 --- a/AutoConfig.py +++ b/AutoConfig.py @@ -26,7 +26,13 @@ try: except: print("未安装此依赖库") webeng = False - +print("""太常引·建康中秋夜为吕叔潜赋 +一轮秋影转金波,飞镜又重磨。把酒问姮娥:被白发、欺人奈何? +乘风好去,长空万里,直下看山河。斫去桂婆娑,人道是、清光更多。""") +print("") +print("""译文:一轮缓缓移动的秋月洒下万里金波,就像那刚磨亮的铜镜又飞上了天廓。我举起酒杯问那月中的嫦娥:怎么办呢?白发日增,好像故意欺负我。 +我要乘风飞上万里长空,俯视祖国的大好山河。还要砍去月中摇曳的桂树枝柯,人们说,这将使月亮洒下人间的光辉更多。""") +print("================================") urlSourcesList = [ "https://code.gitlink.org.cn/gfdgd_xi/uengine-runner-list/raw/branch/master/auto", # Gitlink 源 "https://gitee.com/gfdgd-xi/uengine-wine-runner-auto-configuration-script/raw/master/", # Gitee 源 diff --git a/Download.py b/Download.py index 5e27126..fb6da69 100755 --- a/Download.py +++ b/Download.py @@ -2,4 +2,10 @@ import sys import base64 import requests +print("""浣溪沙 +一曲新词酒一杯,去年天气旧亭台。夕阳西下几时回? +无可奈何花落去,似曾相识燕归来。小园香径独徘徊。""") +print("") +print("听一支新曲喝一杯美酒,还是去年的天气旧日的亭台,西落的夕阳何时再回来?那花儿落去我也无可奈何,那归来的燕子似曾相识,在小园的花径上独自徘徊。") +print("================================") print(requests.get(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3VlbmdpbmUtcnVubmVyL0luc3RhbGwucGhwP1ZlcnNpb249").decode("utf-8") + sys.argv[1]).text) \ No newline at end of file diff --git a/Model/__init__.py b/Model/__init__.py index 73d092e..e6f57d3 100755 --- a/Model/__init__.py +++ b/Model/__init__.py @@ -4,14 +4,16 @@ import PyQt5.QtWidgets as QtWidgets def OpenTerminal(command): if terminalEnd[terminal][1]: os.system(f"\"{terminal}\" \"{terminalEnd[terminal][0]}\" \"{command}\"") + print(f"\"{terminal}\" \"{terminalEnd[terminal][0]}\" \"{command}\"") return os.system(f"\"{terminal}\" \"{terminalEnd[terminal][0]}\" {command}") + print(f"\"{terminal}\" \"{terminalEnd[terminal][0]}\" {command}") programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string # 对终端的获取 # 优先为深度终端 terminal = "" terminalList = [ - "deepin-terminal", + "deepin-terminal1", "mate-terminal", "gnome-terminal", "xfce4-terminal" diff --git a/Model/__pycache__/__init__.cpython-37.pyc b/Model/__pycache__/__init__.cpython-37.pyc index 5bcc16f9115751efa278435dcfd537655c986525..ccc5d022549bd4ac59c959305134722d8a38bebd 100644 GIT binary patch delta 312 zcmX@lv5u3^iIk7XFsr5@{1W`Z$qB()s8HkIQ0ErTY5=Kde6d*2&nq0#uIXRn=m#Kthas#6%kjcr| zJh_xn8zLYBc#lXnJsK%(m$O6PgAc0#9RRSrgsRfyN zx+SSaxtV#1Ifj$dm{J9+_|b$XpJtlI$TK;KIgqu81E_QIE@oQ+kj-H0Aq4kib{1J? Lb_wRm>MR-n+D}U@ delta 290 zcmZ3-d7gvMiI-hL~{bMGY}WY0f`cZ5=Kde6d*1#o4kNga&kW-C*#7&Ga0ofKVy_* zWSPv$q-?0k7{#8PpPQSQm$H(fhy$qYm!*D2er~FMdRj_)N_<78zDsIxc1eDLeoAU; zfo}QaI3|4+kU9oN9!51r7RDlwn{P2x@q^?u^K?s6i*hsb5_2YRV@jQ@!#s_VYw}^{ zK=xa#1x1;8C6gstYz;u#!FE9ikgIQT*yQG?l;)(`f&5Wy1SB{ZIe=Dhuu8B@Ze!5^ E0F#PCVE_OC diff --git a/mainwindow.py b/mainwindow.py index c961e0e..bb7d4a8 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -2,7 +2,7 @@ # 使用系统默认的 python3 运行 ########################################################################################### # 作者:gfdgd xi<3025613752@qq.com> -# 版本:1.8.0 +# 版本:2.0.0 # 更新时间:2022年07月25日 # 感谢:anbox、deepin 和 UOS # 基于 Python3 的 PyQt5 构建 @@ -58,6 +58,24 @@ if sys.version_info[0] < 3: if sys.version_info[1] < 6: PythonLower() +print("""观沧海 曹操 +东临碣石,以观沧海。 +水何澹澹,山岛竦峙。 +树木丛生,百草丰茂。 +秋风萧瑟,洪波涌起。 +日月之行,若出其中; +星汉灿烂,若出其里。 +幸甚至哉,歌以咏志。""") +print("") +print("""译文:东行登上碣石山,来观赏那苍茫的海。 +海水多么宽阔浩荡,山岛高高地挺立在海边。 +树木和百草丛生,十分繁茂。 +秋风吹动树木发出悲凉的声音,海中涌着巨大的海浪。 +太阳和月亮的运行,好像是从这浩瀚的海洋中发出的。 +银河星光灿烂,好像是从这浩瀚的海洋中产生出来的。 +我很幸运,就用这首诗歌来表达自己内心的志向。""") +print("================================") + class UninstallProgram(QtCore.QThread): info = QtCore.pyqtSignal(str) error = QtCore.pyqtSignal(str) @@ -455,13 +473,13 @@ def UengineUbuntuInstallRoot(): threading.Thread(target=OpenTerminal, args=[f"bash '{programPath + '/uengine-installer'}' SuperSU"]).start() def UbuntuInstallUengine(): - threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -e bash '{programPath + '/uengine-installer'}'"]).start() + threading.Thread(target=OpenTerminal, args=[f"bash '{programPath + '/uengine-installer'}'"]).start() def BuildRootUengineImage(): - threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -e bash '{programPath}/root-uengine.sh'"]).start() + threading.Thread(target=OpenTerminal, args=[f"bash '{programPath}/root-uengine.sh'"]).start() def ReinstallUengineImage(): - threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -e pkexec apt reinstall uengine-android-image -y"]).start() + threading.Thread(target=OpenTerminal, args=[f"pkexec apt reinstall uengine-android-image -y"]).start() # 生成 uengine 启动文件到桌面 @@ -579,7 +597,7 @@ def BackUengineClean()->"清空 uengine 数据": except: traceback.print_exc() QtWidgets.QMessageBox.critical(widget, "错误", traceback.format_exc()) - os.system(f"'{programPath}/launch.sh' deepin-terminal -C \"pkexec rm -rfv /data/uengine\"") + OpenTerminal(f"pkexec rm -rfv /data/uengine") return print("Choose False") @@ -642,7 +660,7 @@ def ScrcpyConnectUengine(): sudo apt install snapd -y sudo snap refresh sudo snap install scrcpy''') - threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -C \"chmod 777 /tmp/uengine-runner/InstallScrcpy.sh -Rv && pkexec /tmp/uengine-runner/InstallScrcpy.sh\""]).start() + threading.Thread(target=OpenTerminal, args=[f"chmod 777 /tmp/uengine-runner/InstallScrcpy.sh -Rv && pkexec /tmp/uengine-runner/InstallScrcpy.sh"]).start() return # 获取用户桌面目录 @@ -715,12 +733,12 @@ def OpenUengineUserData(): # 终端显示 adb 命令行 def AdbShellShowInTer(): os.system("adb connect 192.168.250.2:5555") - threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -w ~ -e 'adb -s 192.168.250.2:5555 shell'"]).start() + threading.Thread(target=OpenTerminal, args=[f"adb -s 192.168.250.2:5555 shell"]).start() # 终端显示 adb top def AdbCPUAndRAWShowInTer(): os.system("adb connect 192.168.250.2:5555") - threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -w ~ -e 'adb -s 192.168.250.2:5555 shell top'"]).start() + threading.Thread(target=OpenTerminal, args=[f"adb -s 192.168.250.2:5555 shell top"]).start() def UengineSettingShow(): threading.Thread(target=os.system, args=["/usr/bin/uengine launch --action=android.intent.action.MAIN --package=com.android.settings --component=com.android.settings.Settings"]).start() @@ -741,14 +759,14 @@ def AdbStartServer(): QtWidgets.QMessageBox.information(widget, "提示", "完成!") def ReinstallUengine(): - threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -C 'pkexec apt reinstall uengine uengine-android-image uengine-modules-dkms -y && notify-send -i uengine \"安装完毕!\"'"]).start() + threading.Thread(target=OpenTerminal, args=[f"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"): QtWidgets.QMessageBox.information(widget, "提示", "本功能已经被删除,无法重复删除!") return if QtWidgets.QMessageBox.warning(widget, "警告", "删除后将无法使用本软件恢复\n如果需要恢复本功能,请重新安装 UEngine!", QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel, QtWidgets.QMessageBox.Ok) == QtWidgets.QMessageBox.Ok: - threading.Thread(target=os.system, args=["'{programPath}/launch.sh' deepin-terminal -C 'pkexec rm -v /usr/share/uengine/uengine-check-runnable.sh'"]).start() + threading.Thread(target=OpenTerminal, args=[f"pkexec rm -v /usr/share/uengine/uengine-check-runnable.sh"]).start() # 使用 adb 连接 uengine def UengineConnectAdb(): @@ -1205,7 +1223,7 @@ zenity --info --text=\"更新完毕!\" --ellipsize except: traceback.print_exc() QtWidgets.QMessageBox.critical(widget, "错误,无法继续更新", traceback.format_exc()) - os.system(f"'{programPath}/launch.sh' deepin-terminal -e pkexec bash /tmp/uengine-runner/update.sh") + OpenTerminal(f"pkexec bash /tmp/uengine-runner/update.sh") image = None class ApkInformation(): @@ -1787,7 +1805,7 @@ if not os.path.exists("/usr/bin/uengine"): # Deepin/UOS 用户 if "deepin" in SystemVersion.lower() or "uos" in SystemVersion.lower(): if QtWidgets.QMessageBox.question(None, "提示", "您的电脑没有安装 UEngine,是否安装 UEngine 以便更好的使用\n安装完后重新启动该程序即可") == QtWidgets.QMessageBox.Yes: - os.system(f"'{programPath}/launch.sh' deepin-terminal -C \"pkexec apt install uengine -y\"") + OpenTerminal(f"'pkexec apt install uengine -y") sys.exit(0) # 非 Deepin/UOS 用户 # 因为安装器出现问题,所以废弃 @@ -1796,7 +1814,8 @@ if not os.path.exists("/usr/bin/uengine"): #sys.exit(0) #if QtWidgets.QMessageBox.question(None, "提示", "您的电脑没有安装 UEngine,是否安装 UEngine 以便更好的使用\n这里将会使用 shenmo 提供的脚本进行安装\n安装完后重新启动该程序即可\n提示:无法保证此安装脚本安装的 UEngine 可以使用") == QtWidgets.QMessageBox.Yes: if QtWidgets.QMessageBox.question(None, "提示", "您的电脑没有安装 UEngine,是否安装 UEngine 以便更好的使用\n这里将会安装移植版本(之前由 Shenmo 编写)\n安装完后重新启动该程序即可\n提示:需要在 Ubuntu 22.04 及以上版本才能正常安装") == QtWidgets.QMessageBox.Yes: - os.system(f"'{programPath}/launch.sh' deepin-terminal -C \"bash '{programPath}/uengine-installer'\"") + #os.system(f"'{programPath}/launch.sh' deepin-terminal -C \"bash '{programPath}/uengine-installer'\"") + OpenTerminal(f"bash '{programPath}/uengine-installer'") sys.exit(0) ########################### @@ -1976,6 +1995,7 @@ uengineOpenDebBuilder.triggered.connect(OpenUengineDebBuilder) uengineKeyboardToMouse.triggered.connect(KeyboardToMouse) uengineCheckCpu.triggered.connect(UengineCheckCpu) uengineUbuntuInstall.triggered.connect(UengineUbuntuInstall) +uengineUbuntuInstallRoot.triggered.connect(UengineUbuntuInstallRoot) uengineDeleteUengineCheck.triggered.connect(DelUengineCheck) uengineReinstall.triggered.connect(ReinstallUengine) uengineWindowSizeSetting.triggered.connect(UengineWindowSizeSetting.ShowWindow) diff --git a/uengine-apk-builder b/uengine-apk-builder index 2928655..342ca2b 100755 --- a/uengine-apk-builder +++ b/uengine-apk-builder @@ -24,6 +24,14 @@ import PyQt5.QtCore as QtCore import PyQt5.QtWidgets as QtWidgets from getxmlimg import getsavexml +print("""渔家傲·秋思 +塞下秋来风景异,衡阳雁去无留意。四面边声连角起。千嶂里,长烟落日孤城闭。 +浊酒一杯家万里,燕然未勒归无计。羌管悠悠霜满地。人不寐,将军白发征夫泪。""") +print("") +print("""眼看秋天到了,西北边塞的风光和江南风光自然大不相同。头顶的大雁又飞回南方衡阳去了,一点也没有停留意思。此情此景,不禁又勾起戍边人思乡的情绪。黄昏时分,军中号角催吹,周围的边声也随之而起。层峦叠嶂里,暮霭沉沉,山衔落日,孤零零的城门紧闭。 +饮一杯浊酒,我不由得想起万里之外的亲人。可是,眼下外患未平,功不成名不就,又怎能半途而废。远方传来羌笛的悠悠之声,天气寒冷,军营里早已结满寒霜。夜深了,我还不能安睡,为操持军计,我的须发都变白了。戍边人思念亲人,也久久难以成眠,多少次梦里流下眼泪。""") +print("================================") + def FindApk(): path = QtWidgets.QFileDialog.getOpenFileName(widget, "选择 APK", json.loads(readtxt(get_home() + "/.config/uengine-runner/FindApkBuild.json"))["path"], "APK 可执行文件(*.apk);;所有文件(*.*)") if path != "" and path != "()": diff --git a/uengine-installer b/uengine-installer index 4b68c3b..134a26e 100755 --- a/uengine-installer +++ b/uengine-installer @@ -9,7 +9,7 @@ rm -rf /tmp/uengine #read tar_path mkdir -p /tmp/uengine # 区分是下载 Root 镜像还是普通镜像 -if[[ $1 == "SuperSU" ]]; then +if [[ $1 == "SuperSU" ]]; then aria2c -x 16 -s 16 -d /tmp/uengine -o uenginetar.xz https://code.gitlink.org.cn/gfdgd_xi/uengine-installer/raw/branch/master/uengine2.1.2.2007-supersu.tar.xz else aria2c -x 16 -s 16 -d /tmp/uengine -o uenginetar.xz https://code.gitlink.org.cn/gfdgd_xi/uengine-installer/raw/branch/master/uengine2.1.2.2007.tar.xz