程序更新功能

This commit is contained in:
gfdgd_xi 2023-01-18 15:29:44 +08:00
parent ef0f359fa5
commit 3f756fd680
7 changed files with 58 additions and 16 deletions

View File

@ -26,7 +26,13 @@ try:
except: except:
print("未安装此依赖库") print("未安装此依赖库")
webeng = False webeng = False
print("""太常引·建康中秋夜为吕叔潜赋
一轮秋影转金波飞镜又重磨把酒问姮娥被白发欺人奈何
乘风好去长空万里直下看山河斫去桂婆娑人道是清光更多""")
print("")
print("""译文:一轮缓缓移动的秋月洒下万里金波,就像那刚磨亮的铜镜又飞上了天廓。我举起酒杯问那月中的嫦娥:怎么办呢?白发日增,好像故意欺负我。
我要乘风飞上万里长空俯视祖国的大好山河还要砍去月中摇曳的桂树枝柯人们说这将使月亮洒下人间的光辉更多""")
print("================================")
urlSourcesList = [ urlSourcesList = [
"https://code.gitlink.org.cn/gfdgd_xi/uengine-runner-list/raw/branch/master/auto", # Gitlink 源 "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 源 "https://gitee.com/gfdgd-xi/uengine-wine-runner-auto-configuration-script/raw/master/", # Gitee 源

View File

@ -2,4 +2,10 @@
import sys import sys
import base64 import base64
import requests import requests
print("""浣溪沙
一曲新词酒一杯去年天气旧亭台夕阳西下几时回
无可奈何花落去似曾相识燕归来小园香径独徘徊""")
print("")
print("听一支新曲喝一杯美酒,还是去年的天气旧日的亭台,西落的夕阳何时再回来?那花儿落去我也无可奈何,那归来的燕子似曾相识,在小园的花径上独自徘徊。")
print("================================")
print(requests.get(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3VlbmdpbmUtcnVubmVyL0luc3RhbGwucGhwP1ZlcnNpb249").decode("utf-8") + sys.argv[1]).text) print(requests.get(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3VlbmdpbmUtcnVubmVyL0luc3RhbGwucGhwP1ZlcnNpb249").decode("utf-8") + sys.argv[1]).text)

View File

@ -4,14 +4,16 @@ import PyQt5.QtWidgets as QtWidgets
def OpenTerminal(command): def OpenTerminal(command):
if terminalEnd[terminal][1]: if terminalEnd[terminal][1]:
os.system(f"\"{terminal}\" \"{terminalEnd[terminal][0]}\" \"{command}\"") os.system(f"\"{terminal}\" \"{terminalEnd[terminal][0]}\" \"{command}\"")
print(f"\"{terminal}\" \"{terminalEnd[terminal][0]}\" \"{command}\"")
return return
os.system(f"\"{terminal}\" \"{terminalEnd[terminal][0]}\" {command}") 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 programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
# 对终端的获取 # 对终端的获取
# 优先为深度终端 # 优先为深度终端
terminal = "" terminal = ""
terminalList = [ terminalList = [
"deepin-terminal", "deepin-terminal1",
"mate-terminal", "mate-terminal",
"gnome-terminal", "gnome-terminal",
"xfce4-terminal" "xfce4-terminal"

View File

@ -2,7 +2,7 @@
# 使用系统默认的 python3 运行 # 使用系统默认的 python3 运行
########################################################################################### ###########################################################################################
# 作者gfdgd xi<3025613752@qq.com> # 作者gfdgd xi<3025613752@qq.com>
# 版本:1.8.0 # 版本:2.0.0
# 更新时间2022年07月25日 # 更新时间2022年07月25日
# 感谢anbox、deepin 和 UOS # 感谢anbox、deepin 和 UOS
# 基于 Python3 的 PyQt5 构建 # 基于 Python3 的 PyQt5 构建
@ -58,6 +58,24 @@ if sys.version_info[0] < 3:
if sys.version_info[1] < 6: if sys.version_info[1] < 6:
PythonLower() PythonLower()
print("""观沧海 曹操
东临碣石以观沧海
水何澹澹山岛竦峙
树木丛生百草丰茂
秋风萧瑟洪波涌起
日月之行若出其中
星汉灿烂若出其里
幸甚至哉歌以咏志""")
print("")
print("""译文:东行登上碣石山,来观赏那苍茫的海。
海水多么宽阔浩荡山岛高高地挺立在海边
树木和百草丛生十分繁茂
秋风吹动树木发出悲凉的声音海中涌着巨大的海浪
太阳和月亮的运行好像是从这浩瀚的海洋中发出的
银河星光灿烂好像是从这浩瀚的海洋中产生出来的
我很幸运就用这首诗歌来表达自己内心的志向""")
print("================================")
class UninstallProgram(QtCore.QThread): class UninstallProgram(QtCore.QThread):
info = QtCore.pyqtSignal(str) info = QtCore.pyqtSignal(str)
error = 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() threading.Thread(target=OpenTerminal, args=[f"bash '{programPath + '/uengine-installer'}' SuperSU"]).start()
def UbuntuInstallUengine(): 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(): 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(): 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 启动文件到桌面 # 生成 uengine 启动文件到桌面
@ -579,7 +597,7 @@ def BackUengineClean()->"清空 uengine 数据":
except: except:
traceback.print_exc() traceback.print_exc()
QtWidgets.QMessageBox.critical(widget, "错误", traceback.format_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 return
print("Choose False") print("Choose False")
@ -642,7 +660,7 @@ def ScrcpyConnectUengine():
sudo apt install snapd -y sudo apt install snapd -y
sudo snap refresh sudo snap refresh
sudo snap install scrcpy''') 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 return
# 获取用户桌面目录 # 获取用户桌面目录
@ -715,12 +733,12 @@ def OpenUengineUserData():
# 终端显示 adb 命令行 # 终端显示 adb 命令行
def AdbShellShowInTer(): def AdbShellShowInTer():
os.system("adb connect 192.168.250.2:5555") 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 # 终端显示 adb top
def AdbCPUAndRAWShowInTer(): def AdbCPUAndRAWShowInTer():
os.system("adb connect 192.168.250.2:5555") 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(): 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() 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, "提示", "完成!") QtWidgets.QMessageBox.information(widget, "提示", "完成!")
def ReinstallUengine(): 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(): def DelUengineCheck():
if not os.path.exists("/usr/share/uengine/uengine-check-runnable.sh"): if not os.path.exists("/usr/share/uengine/uengine-check-runnable.sh"):
QtWidgets.QMessageBox.information(widget, "提示", "本功能已经被删除,无法重复删除!") QtWidgets.QMessageBox.information(widget, "提示", "本功能已经被删除,无法重复删除!")
return return
if QtWidgets.QMessageBox.warning(widget, "警告", "删除后将无法使用本软件恢复\n如果需要恢复本功能,请重新安装 UEngine", QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel, QtWidgets.QMessageBox.Ok) == QtWidgets.QMessageBox.Ok: 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 # 使用 adb 连接 uengine
def UengineConnectAdb(): def UengineConnectAdb():
@ -1205,7 +1223,7 @@ zenity --info --text=\"更新完毕!\" --ellipsize
except: except:
traceback.print_exc() traceback.print_exc()
QtWidgets.QMessageBox.critical(widget, "错误,无法继续更新", traceback.format_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 image = None
class ApkInformation(): class ApkInformation():
@ -1787,7 +1805,7 @@ if not os.path.exists("/usr/bin/uengine"):
# Deepin/UOS 用户 # Deepin/UOS 用户
if "deepin" in SystemVersion.lower() or "uos" in SystemVersion.lower(): if "deepin" in SystemVersion.lower() or "uos" in SystemVersion.lower():
if QtWidgets.QMessageBox.question(None, "提示", "您的电脑没有安装 UEngine是否安装 UEngine 以便更好的使用\n安装完后重新启动该程序即可") == QtWidgets.QMessageBox.Yes: 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) sys.exit(0)
# 非 Deepin/UOS 用户 # 非 Deepin/UOS 用户
# 因为安装器出现问题,所以废弃 # 因为安装器出现问题,所以废弃
@ -1796,7 +1814,8 @@ if not os.path.exists("/usr/bin/uengine"):
#sys.exit(0) #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提示无法保证此安装脚本安装的 UEngine 可以使用") == QtWidgets.QMessageBox.Yes:
if QtWidgets.QMessageBox.question(None, "提示", "您的电脑没有安装 UEngine是否安装 UEngine 以便更好的使用\n这里将会安装移植版本(之前由 Shenmo 编写)\n安装完后重新启动该程序即可\n提示:需要在 Ubuntu 22.04 及以上版本才能正常安装") == 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) sys.exit(0)
########################### ###########################
@ -1976,6 +1995,7 @@ uengineOpenDebBuilder.triggered.connect(OpenUengineDebBuilder)
uengineKeyboardToMouse.triggered.connect(KeyboardToMouse) uengineKeyboardToMouse.triggered.connect(KeyboardToMouse)
uengineCheckCpu.triggered.connect(UengineCheckCpu) uengineCheckCpu.triggered.connect(UengineCheckCpu)
uengineUbuntuInstall.triggered.connect(UengineUbuntuInstall) uengineUbuntuInstall.triggered.connect(UengineUbuntuInstall)
uengineUbuntuInstallRoot.triggered.connect(UengineUbuntuInstallRoot)
uengineDeleteUengineCheck.triggered.connect(DelUengineCheck) uengineDeleteUengineCheck.triggered.connect(DelUengineCheck)
uengineReinstall.triggered.connect(ReinstallUengine) uengineReinstall.triggered.connect(ReinstallUengine)
uengineWindowSizeSetting.triggered.connect(UengineWindowSizeSetting.ShowWindow) uengineWindowSizeSetting.triggered.connect(UengineWindowSizeSetting.ShowWindow)

View File

@ -24,6 +24,14 @@ import PyQt5.QtCore as QtCore
import PyQt5.QtWidgets as QtWidgets import PyQt5.QtWidgets as QtWidgets
from getxmlimg import getsavexml from getxmlimg import getsavexml
print("""渔家傲·秋思
塞下秋来风景异,衡阳雁去无留意。四面边声连角起。千嶂里,长烟落日孤城闭。
浊酒一杯家万里,燕然未勒归无计。羌管悠悠霜满地。人不寐,将军白发征夫泪。""")
print("")
print("""眼看秋天到了,西北边塞的风光和江南风光自然大不相同。头顶的大雁又飞回南方衡阳去了,一点也没有停留意思。此情此景,不禁又勾起戍边人思乡的情绪。黄昏时分,军中号角催吹,周围的边声也随之而起。层峦叠嶂里,暮霭沉沉,山衔落日,孤零零的城门紧闭。
饮一杯浊酒,我不由得想起万里之外的亲人。可是,眼下外患未平,功不成名不就,又怎能半途而废。远方传来羌笛的悠悠之声,天气寒冷,军营里早已结满寒霜。夜深了,我还不能安睡,为操持军计,我的须发都变白了。戍边人思念亲人,也久久难以成眠,多少次梦里流下眼泪。""")
print("================================")
def FindApk(): def FindApk():
path = QtWidgets.QFileDialog.getOpenFileName(widget, "选择 APK", json.loads(readtxt(get_home() + "/.config/uengine-runner/FindApkBuild.json"))["path"], "APK 可执行文件(*.apk);;所有文件(*.*)") path = QtWidgets.QFileDialog.getOpenFileName(widget, "选择 APK", json.loads(readtxt(get_home() + "/.config/uengine-runner/FindApkBuild.json"))["path"], "APK 可执行文件(*.apk);;所有文件(*.*)")
if path != "" and path != "()": if path != "" and path != "()":

View File

@ -9,7 +9,7 @@ rm -rf /tmp/uengine
#read tar_path #read tar_path
mkdir -p /tmp/uengine mkdir -p /tmp/uengine
# 区分是下载 Root 镜像还是普通镜像 # 区分是下载 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 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 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 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