Compare commits

...

27 Commits
2.1.0 ... 2.1.2

Author SHA1 Message Date
96cf7dfe74 2.1.2 2023-08-14 17:03:00 +08:00
576470f70a 引导用户到Gitee反馈bug 2023-08-14 16:55:12 +08:00
625e456e6b 修复deepin23缺失pil的问题 2023-08-14 16:46:20 +08:00
Bail
2a17547da3 修复添加应用图标时activity名称错误的问题 2023-07-28 17:58:47 +08:00
Bail
fb46147547 修复 #I6ZRZX
根据对报错信息的分析,我认为这个问题可能是由于程序退出时由于updatekiller.py已将pid文件删除,导致要退出的程序在atexit模块注册的函数要删除记录到pid时找不到pid文件,导致报错。
但经过复现尝试,发现不是杀进程时触发的。因为杀进程时被杀的进程不会执行atexit。
由于已更新至最新版本,无法通过更新进行复现。所以具体报错原因尚未探究清楚,问题尚未完全修复。
2023-07-18 21:57:53 +08:00
d37c7514f3 修改deb打包格式 2023-07-10 09:40:45 +08:00
7fe6187f98 修复bug提交问题 2023-07-09 06:41:43 +08:00
0bbb560b48 auto building 2023-07-06 15:36:29 +08:00
d583c396b1 忘改control了 2023-07-06 11:48:59 +08:00
2096022bd4 修改README 2023-07-06 11:39:08 +08:00
e3c342c07b 修复postinst在无网状态下导致uengine-loading-ubuntu出错的问题 2023-07-06 11:34:58 +08:00
ee6c7c45d8 postrm 2023-07-06 11:28:09 +08:00
76d5d60c2b 2.1.1 2023-07-06 11:16:36 +08:00
00dd3283e9 添加更新内容 2023-07-06 11:00:31 +08:00
b2998ffe80 优化postinst 2023-07-06 10:48:21 +08:00
579663c32c 修改dtk获取的url 2023-07-06 10:45:30 +08:00
717284ad14 修复UEngine在debian12无法正常开启的问题 2023-07-06 10:44:45 +08:00
197f0a9dca 修复 https://gitee.com/gfdgd-xi/uengine-runner/issues/I6B6C8 的问题 2023-06-25 12:02:30 +08:00
b1e455ca48 治标 2023-06-25 11:57:34 +08:00
86bc122c5f 修复在DEEPIN/UOS程序菜单检查到UENGINE不存在但是无法安装的问题 2023-06-23 16:51:13 +08:00
0ca2e4f01b 修改README 2023-06-03 22:09:57 +08:00
4e14f35021 修改README 2023-06-03 20:21:41 +08:00
10d94886a5 修复缺少zentiy依赖的问题 2023-06-03 17:33:53 +08:00
e57ac28cde Merge branch 'main' of https://gitee.com/gfdgd-xi/uengine-runner 2023-05-27 22:43:51 +08:00
5853fc68c2 修改README 2023-05-27 22:43:41 +08:00
aa039277a9 Repair UEngine Installer System Check Problem 2023-05-21 18:28:23 +08:00
d759f81905 修改程序文案 2023-05-13 15:04:11 +08:00
29 changed files with 215 additions and 78 deletions

26
.github/workflows/auto-building.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Auto Building Wine Runner
run-name: ${{ github.actor }} Auto Building Wine Runner 🚀
on:
push:
workflow_dispatch:
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- name: Building DEB
run: |
# 配置环境
sudo apt update
sudo apt install git dpkg-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qt5-qmake -y
git clone https://github.com/gfdgd-xi/uengine-runner
cd uengine-runner
make build
mv com.gitee.uengine.runner.spark.deb ~
- name: upload result
uses: actions/upload-artifact@v1
with:
name: com.gitee.uengine.runner.spark.deb
path: /home/runner/com.gitee.uengine.runner.spark.deb

View File

@@ -541,7 +541,7 @@ def ChangeSources():
ui.searchList.setModel(nmodel)
urlSourcesIndex = i
except:
[ui.actionGitlink, ui.actionGitee, ui.actionGithub, ui.action_IPv6, ui.action_2, ui.action_3, ui.action][urlSourcesIndex].setChecked(True)
#[ui.actionGitlink, ui.actionGitee, ui.actionGithub, ui.action_IPv6, ui.action_2, ui.action_3, ui.action][urlSourcesIndex].setChecked(True)
traceback.print_exc()
QtWidgets.QMessageBox.critical(window, "提示", "无法连接服务器")
urlSources = old_urlSources #如果源不可用则换回来

View File

@@ -41,8 +41,8 @@ programEnv = [
["($PROGRAMPATH)", programPath],
["($VERSION)", version],
["($THANK)", thankText],
["($MAKER)", "RacoonGX 团队By gfdgd xi"],
["($COPYRIGHT)", f"©2020~{time.strftime('%Y')} RacoonGX 团队By gfdgd xi"],
["($MAKER)", "gfdgd xi"],
["($COPYRIGHT)", f"©2020~{time.strftime('%Y')} gfdgd xi"],
["($?)", "0"],
["($PLATFORM)", platform.system()],
["($DEBUG)", "1"]

View File

@@ -5,9 +5,13 @@ if [[ `whoami` != root ]]; then
fi
if [ -d /dev/binderfs ]; then
echo 已启动 binderend
systemctl start uengine-container.service
systemctl start uengine-session.service
exit
fi
modprobe binder_linux
modprobe ashmem_linux
mkdir /dev/binderfs
mount -t binder binder /dev/binderfs
systemctl start uengine-container.service
systemctl start uengine-session.service

View File

@@ -1,17 +1,16 @@
<p width=100px align="center"><img src="runner.svg"></p>
<h1 align="center">UEngine 运行器 2.1.0</h1>
<h1 align="center">UEngine 运行器 2.1.2</h1>
<hr>
<a href='https://gitee.com/gfdgd-xi-org/uengine-runner/stargazers'><img src='https://gitee.com/gfdgd-xi-org/uengine-runner/badge/star.svg?theme=dark' alt='star'></img></a>
<a href='https://gitee.com/gfdgd-xi/uengine-runner/members'><img src='https://gitee.com/gfdgd-xi/uengine-runner/badge/fork.svg?theme=dark' alt='fork'></img></a>
## 介绍
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;新版本Deepin/UOS发布后可以在应用商店安装部分官方已适配的安卓应用对爱好者来说不能自己安装APK软件包始终差点意思本程序可以为Deepin/UOS上的UEngine安卓运行环境安装自定义APK软件包并能发送安装的APK包启动菜单到桌面或系统菜单
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;虽然通过Deepin/UOS应用商店已经能够安装部分安卓应用但对于安卓应用爱好者来说不能自由地安装任意APK软件包实在是不尽如人意。本软件可以实现在Deepin/UOS上安装任意APK软件包并能将其启动图标发送到系统桌面或启动器中方便用户快速启动它
![图片.png](https://storage.deepin.org/thread/202212181918041904_图片.png)
测试平台UOS 家庭版 21.3.1deepin 20.8,UOS 专业版 1050
适配架构amd64、arm64
支持系统Deepinamd64、UOSamd64/arm64、Debianamd64≥debian 10、Ubuntuamd64≥Ubuntu 20.04
Debian 10、Debian 11、Ubuntu 20.04 需要从 http://dtk.gfdgdxi.top/ 下载 dtk版本≥5.5)并安装才能通过运行器的安装程序正确安装 UEngine
## 程序相关网站
作者个人站https://www.gfdgdxi.top
@@ -21,12 +20,29 @@
Deepin 官网https://www.deepin.org
Deepin 论坛https://bbs.deepin.org
## 在 Deepin 23 Alpha2 安装 UEngine 运行器?
## 在 Deepin 23 Alpha2/Beta 安装 UEngine 运行器?
> 例如https://gitee.com/gfdgd-xi/uengine-runner/issues/I6MBBC
需要从以下链接补充依赖:
https://gfdgdxi.lanzoue.com/b01qiu22f
密码:dihl
或者从星火应用商店下载安装,星火应用商店的源里已经补齐 UEngine 运行器在 Deepin 23 Alpha2/Beta 缺少的依赖
然后输入:
```bash
python3 -m pip install pillow
```
## 上架到的应用商店
> 可以从下列应用商店获取 UEngine 运行器
### Deepin/UOS 应用商店
![图片.png](https://storage.deepin.org/thread/20230603201852396_图片.png)
### 星火应用商店
![图片.png](https://storage.deepin.org/thread/202306032021155134_图片.png)
## 安装前必读
@@ -64,6 +80,31 @@ sudo apt upgrade
![image.png](https://storage.deepin.org/thread/202205220801513371_image.png)
### 更新内容
#### V2.1.22023年08月14日
**※1、修复 https://gitee.com/gfdgd-xi/uengine-runner/issues/I6ZRZX**
**※2、修复添加应用图标时activity名称错误的问题**
**※3、修复 UEngine 运行器在 23 运行时提示缺失 PIL.Image 库的问题**
![图片.png](https://storage.deepin.org/thread/202308141701411843_图片.png)
#### V2.1.12023年07月06日
**※1、修复在 Ubuntu/Debian 安装 UEngine 时提示“该脚本不支持 deepin”的问题**
**※2、修复 UEngine 在 debian12 安装无法正常开启 UEngine 的问题;**
**※3、修复在 UEngine 程序菜单检查到 UEngine 不存在但是无法安装的问题;**
**※4、修复了 https://gitee.com/gfdgd-xi/uengine-runner/issues/I6B6C8 的问题;**
**※5、优化了 postinst 和 postrm 脚本;**
6、添加 zenity 依赖;
7、屏蔽在更新程序过程中杀死程序中输出的错误
8、修改下载 dtk 的网址。
![图片.png](https://storage.deepin.org/thread/202307061119021692_图片.png)
![图片.png](https://storage.deepin.org/thread/202307061138408182_图片.png)
#### V2.1.02023年05月13日
**※1、修复源地址迁出 Gitlink**
**※2、优化 UEngine 安装器,可以在 Debian/Ubuntu 使用Debian11/Debian10/Ubuntu20.04 需要安装 dtk≥5.5dtk 可以从 https://gitee.com/gfdgd-xi/dtk-sources-for-uos-apt/releases 获取);**
@@ -503,4 +544,4 @@ make install
[![星火社区作品集/spark-webapp-runtime 运行器](https://gitee.com/spark-community-works-collections/spark-webapp-runtime-runner/widgets/widget_card.svg?colors=4183c4,ffffff,ffffff,e3e9ed,666666,9b9b9b)](https://gitee.com/spark-community-works-collections/spark-webapp-runtime-runner)
[![gfdgd xi/定时器](https://gitee.com/gfdgd-xi/timer/widgets/widget_card.svg?colors=4183c4,ffffff,ffffff,e3e9ed,666666,9b9b9b)](https://gitee.com/gfdgd-xi/timer)
### ©2021-Now gfdgd xi
## ©2021-Now gfdgd xi

View File

@@ -1,5 +1,11 @@
import PIL.Image as Image
import PIL.ImageDraw as ImageDraw
import os
try:
import PIL.Image as Image
import PIL.ImageDraw as ImageDraw
except:
os.system("python3 -m pip install --upgrade pillow --break-system-packages --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple")
import PIL.Image as Image
import PIL.ImageDraw as ImageDraw
import zipfile
import subprocess
import re

View File

@@ -2,11 +2,10 @@
"Package": "com.gitee.uengine.runner.spark",
"Url": [
"https://gitee.com/gfdgd-xi/uengine-runner",
"https://github.com/gfdgd-xi/uengine-runner",
"https://gitlink.org.cn/gfdgd_xi/uengine-runner"
"https://github.com/gfdgd-xi/uengine-runner"
],
"Version": "2.1.0",
"System": "Linuxdeepin/UOS/Ubuntu22.04",
"Version": "2.1.2",
"System": "Linuxdeepin/UOS/Ubuntu/Debian",
"Tips": [
"更多可见https://gitee.com/gfdgd-xi/uengine-runner/wikis 或程序的更多帮助",
"安装APK点浏览按钮选中需要安装的APK然后点安装按钮",
@@ -23,6 +22,21 @@
"5、如果想要使用adb连接UEngine或其他手机请使用 1.2.0 以前的版本。如需连接UEngine请安装adb补丁"
],
"Update": [
"<b>V2.1.2</b>",
"※1、修复 https://gitee.com/gfdgd-xi/uengine-runner/issues/I6ZRZX",
"※2、修复添加应用图标时activity名称错误的问题",
"※3、修复 UEngine 运行器在 23 运行时提示缺失 PIL.Image 库的问题",
"",
"<b>V2.1.1</b>",
"※1、修复在 Ubuntu/Debian 安装 UEngine 时提示“该脚本不支持 deepin”的问题",
"※2、修复 UEngine 在 debian12 安装无法正常开启 UEngine 的问题;",
"※3、修复在 UEngine 程序菜单检查到 UEngine 不存在但是无法安装的问题;",
"※4、修复了 https://gitee.com/gfdgd-xi/uengine-runner/issues/I6B6C8 的问题;",
"※5、优化了 postinst 脚本;",
"6、添加 zenity 依赖;",
"7、屏蔽在更新程序过程中杀死程序中输出的错误",
"8、修改下载 dtk 的网址。",
"",
"<b>V2.1.0</b>",
"※1、修复源地址迁出 Gitlink",
"※2、优化 UEngine 安装器,可以在 Debian/Ubuntu 使用Debian11/Debian10/Ubuntu20.04 需要安装 dtk≥5.5dtk 可以从 https://gitee.com/gfdgd-xi/dtk-sources-for-uos-apt/releases 获取);",
@@ -253,6 +267,7 @@
"Contribute": [
"<b>感谢以下用户提供的问题、建议、图标、代码等,如果有遗漏,请及时与开发者联系添加,以及如果侵犯到您的合法权益,也及时与开发者联系:</p>",
"<hr>",
"感谢 @鹤舞白沙 优化了程序文案",
"感谢 @Bail 修复了修复应用商店换源的问题,实现了微型应用商店更新关闭进程的功能",
"感谢 RacoonGX 团队的付出和贡献",
"感谢 cleverwwh 反馈的 UEngine 打包器在部分系统无法打开的问题",

View File

@@ -1470,9 +1470,9 @@ class AddNewUengineDesktopLink():
global activityName
iconSavePath = "{}/.local/share/icons/hicolor/256x256/apps/{}.png".format(get_home(), packageName.text())
shutil.copy(programPath + "/defult.png", iconSavePath)
BuildUengineDesktop(packageName.text(), activityName, packageName.text(), iconSavePath,
BuildUengineDesktop(packageName.text(), activityName.text(), packageName.text(), iconSavePath,
"{}/.local/share/applications/uengine/{}.desktop".format(get_home(), packageName.text()))
BuildUengineDesktop(packageName.text(), activityName, packageName.text(), iconSavePath,
BuildUengineDesktop(packageName.text(), activityName.text(), packageName.text(), iconSavePath,
"{}/{}.desktop".format(get_desktop_path(), packageName.text()))
AddNewUengineDesktopLink.SaveHistory()
QtWidgets.QMessageBox.information(widget, "提示", "创建完毕!")
@@ -1586,7 +1586,7 @@ aaptVersion = GetCommandReturn("aapt version")
SystemVersion = GetSystemVersion()
iconPath = "{}/runner.svg".format(os.path.split(os.path.realpath(__file__))[0])
about = f'''<p align="center"><img width=256 src="{iconPath}"/></p>
<p>介绍:一个基于 Python3 的 PyQt5 制作的 UEngine 运行器在新版本Deepin/UOS发布后可以在应用商店安装部分官方已适配的安卓应用对爱好者来说不能自己安装APK软件包始终差点意思本程序可以为Deepin/UOS上的UEngine安卓运行环境安装自定义APK软件包并能发送安装的APK包启动菜单到桌面或系统菜单。</p>
<p>介绍:虽然通过Deepin/UOS应用商店已经能够安装部分安卓应用但对于安卓应用爱好者来说不能自由地安装任意APK软件包实在是不尽如人意。本软件可以实现在Deepin/UOS上安装任意APK软件包并能将其启动图标发送到系统桌面或启动器中方便用户快速启动它。 </p>
<p>程序开源许可证GPLV3</p>
<p>版本:{version}</p>
<p>适用平台:{goodRunSystem}</p>
@@ -1825,7 +1825,7 @@ if not os.path.exists("/usr/bin/uengine"):
#QtWidgets.QMessageBox.critical(None, "错误", "请安装 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 20.04 或 debian10 及以上版本才能正常安装\nUbuntu 20.04 和 debian10 需要手动安装 dtk≥5.5),可以从 https://gitee.com/gfdgd-xi/dtk-sources-for-uos-apt/releases 获取") == QtWidgets.QMessageBox.Yes:
if QtWidgets.QMessageBox.question(None, "提示", "您的电脑没有安装 UEngine是否安装 UEngine 以便更好的使用\n这里将会安装移植版本(之前由 Shenmo 编写)\n安装完后重新启动该程序即可\n提示:需要在 Ubuntu 20.04 或 debian10 及以上版本才能正常安装\nUbuntu 20.04 和 debian10 需要手动安装 dtk≥5.5),可以从 http://dtk.gfdgdxi.top 获取") == QtWidgets.QMessageBox.Yes:
#os.system(f"'{programPath}/launch.sh' deepin-terminal -C \"bash '{programPath}/uengine-installer'\"")
OpenTerminal(f"bash '{programPath}/uengine-installer'")
sys.exit(0)
@@ -1975,8 +1975,8 @@ uengineCheckCpu = QtWidgets.QAction(QtGui.QIcon.fromTheme("cpu"), langFile[lang]
uengineDeleteUengineCheck = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(40), langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][9])
uengineReinstall = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][10])
uengineUbuntuInstall = QtWidgets.QAction(QtGui.QIcon.fromTheme("ubuntu-logo-icon"), langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][14])
uengineUbuntuRemove = QtWidgets.QAction(QtGui.QIcon.fromTheme("ubuntu-logo-icon"), "移除在 Ubuntu 上安装的 UEngine 及其附属脚本")
uengineUbuntuInstallRoot = QtWidgets.QAction(QtGui.QIcon.fromTheme("ubuntu-logo-icon"), "在 Ubuntu 上安装 UEngineSuperSU 镜像)")
uengineUbuntuRemove = QtWidgets.QAction(QtGui.QIcon.fromTheme("ubuntu-logo-icon"), "移除在 Ubuntu/Debian 上安装的 UEngine 及其附属脚本")
uengineUbuntuInstallRoot = QtWidgets.QAction(QtGui.QIcon.fromTheme("ubuntu-logo-icon"), "在 Ubuntu/Debian 上安装 UEngineSuperSU 镜像)")
uengineWindowSizeSetting = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][16])
uengine.addAction(uengineOpenDebBuilder)
uengine.addAction(uengineOpenDebBuilderMore)

View File

@@ -1,12 +1,12 @@
Package: com.gitee.uengine.runner.spark
Source: com.gitee.uengine.runner.spark
Replaces: spark-uengine-runner, com.gitee.uengine.runner.spark.ubuntu
Version: 2.1.0
Version: 2.1.2
Architecture: all
Section: utils
Installed-Size: 2920
Maintainer: gfdgd xi <3025613752@qq.com>
Depends: python3, python3-tk, python3-pip, aapt, python3-setuptools, deepin-terminal | mate-terminal | gnome-terminal | xfce4-terminal, curl, python3-pil, python3-requests, adb, fonts-noto-cjk, python3-numpy, wget, inotify-tools, aria2, python3-pyqt5, python3-matplotlib, python3-urllib3
Depends: python3, python3-tk, python3-pip, aapt, python3-setuptools, deepin-terminal | mate-terminal | gnome-terminal | xfce4-terminal, curl, python3-pil, python3-requests, adb, fonts-noto-cjk, python3-numpy, wget, inotify-tools, aria2, python3-pyqt5, python3-matplotlib, python3-urllib3, zenity, python3-pil.imagetk
Recommends: uengine, deepin-elf-verify, python3-pyqt5.qtwebengine
Priority: optional
Conflicts: spark-uengine-apk-builder, com.gitee.uengine.runner.spark.ubuntu

View File

@@ -1,10 +1,10 @@
#!/bin/bash
# 使用 pip 安装所需库
echo 安装组件
python3 -m pip install --upgrade pip --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple
python3 -m pip install --upgrade ttkthemes --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple
python3 -m pip install --upgrade pyautogui --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple
python3 -m pip install --upgrade keyboard --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple
python3 -m pip install --upgrade ttkthemes --break-system-packages --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
python3 -m pip install --upgrade pyautogui --break-system-packages --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
python3 -m pip install --upgrade keyboard --break-system-packages --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
python3 -m pip install --upgrade pillow --break-system-packages --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
echo 执行完成
# 建立软链接
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner /usr/bin/uengine-runner
@@ -35,28 +35,32 @@ if [[ $? != 0 ]] && [[ -f /usr/bin/uengine-loading-ubuntu ]]; then
done
fi
# 更新 uengine-loading-ubuntu如果存在
if [[ -f /usr/bin/uengine-loading-ubuntu ]]; then
if [[ -f /usr/bin/uengine-loading-ubuntu ]] || [[ -f /usr/bin/uengine-loading-binder ]]; then
echo 更新 uengine-loading-ubuntu
cp /opt/apps/com.gitee.uengine.runner.spark/files/LoadingBinder/load.sh /usr/bin/uengine-loading-binder
if [ -f /tmp/upgrade-uengine-loading-ubuntu ]; then
rm /tmp/upgrade-uengine-loading-ubuntu
fi
# 下载新版
aria2c -x 16 -s 16 -d /tmp -o upgrade-uengine-loading-ubuntu https://code.gitlink.org.cn/gfdgd_xi/uengine-installer-bak/raw/branch/master/run_daemon.sh
aria2c -x 16 -s 16 -d /tmp -o upgrade-uengine-loading-ubuntu http://uengine-runner.gfdgdxi.top/shell/run_daemon.sh
if [ $? == 0 ]; then
# 替换
cp /tmp/upgrade-uengine-loading-ubuntu /usr/bin/uengine-loading-ubuntu
chmod 755 /usr/bin/uengine-loading-ubuntu
for username in $(ls /home)
do
echo /home/$username
cp /usr/bin/uengine-loading-ubuntu /home/$username/uengine-launch/run_daemon.sh
chmod 755 /home/$username/uengine-launch/run_daemon.sh
done
else
cp /opt/apps/com.gitee.uengine.runner.spark/files/Help/shell/run_daemon.sh /usr/bin/uengine-loading-ubuntu
fi
rm /tmp/upgrade-uengine-loading-ubuntu
chmod 755 /usr/bin/uengine-loading-ubuntu
for username in $(ls /home)
do
echo /home/$username
cp /usr/bin/uengine-loading-ubuntu /home/$username/uengine-launch/run_daemon.sh
chmod 755 /home/$username/uengine-launch/run_daemon.sh
done
rm -f /tmp/upgrade-uengine-loading-ubuntu
fi
# 刷新图标缓存
# 因为 Ubuntu 的问题,省略
gtk-update-icon-cache /usr/share/icons/bloom > /dev/null | true
# 向服务器返回安装数加1不显示内容且忽略错误
python3 /opt/apps/com.gitee.uengine.runner.spark/files/Download.py 2.1.0 > /dev/null | true
python3 /opt/apps/com.gitee.uengine.runner.spark/files/Download.py 2.1.2 > /dev/null | true

View File

@@ -22,7 +22,7 @@ rm -fr /opt/apps/com.gitee.uengine.runner.spark/files/api/__pycache__
rm -fr /opt/apps/com.gitee.uengine.runner.spark/files/__pycache__
rm -f /usr/bin/uengine-runner-applist-launch.sh
rm -f /usr/bin/uengine-runner-auto-install-bash
rm -f /usr/bin/uengine-loading-ubuntu
#rm -f /usr/bin/uengine-loading-ubuntu
# 删除软件残留,简单粗暴一点直接全部删掉,防止出现警告
# 加判断是为了怕 reinstall 后程序就再也打不开了(除非卸载后重新安装)
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then

View File

@@ -541,7 +541,7 @@ def ChangeSources():
ui.searchList.setModel(nmodel)
urlSourcesIndex = i
except:
[ui.actionGitlink, ui.actionGitee, ui.actionGithub, ui.action_IPv6, ui.action_2, ui.action_3, ui.action][urlSourcesIndex].setChecked(True)
#[ui.actionGitlink, ui.actionGitee, ui.actionGithub, ui.action_IPv6, ui.action_2, ui.action_3, ui.action][urlSourcesIndex].setChecked(True)
traceback.print_exc()
QtWidgets.QMessageBox.critical(window, "提示", "无法连接服务器")
urlSources = old_urlSources #如果源不可用则换回来

View File

@@ -41,8 +41,8 @@ programEnv = [
["($PROGRAMPATH)", programPath],
["($VERSION)", version],
["($THANK)", thankText],
["($MAKER)", "RacoonGX 团队By gfdgd xi"],
["($COPYRIGHT)", f"©2020~{time.strftime('%Y')} RacoonGX 团队By gfdgd xi"],
["($MAKER)", "gfdgd xi"],
["($COPYRIGHT)", f"©2020~{time.strftime('%Y')} gfdgd xi"],
["($?)", "0"],
["($PLATFORM)", platform.system()],
["($DEBUG)", "1"]

View File

@@ -5,9 +5,13 @@ if [[ `whoami` != root ]]; then
fi
if [ -d /dev/binderfs ]; then
echo 已启动 binderend
systemctl start uengine-container.service
systemctl start uengine-session.service
exit
fi
modprobe binder_linux
modprobe ashmem_linux
mkdir /dev/binderfs
mount -t binder binder /dev/binderfs
systemctl start uengine-container.service
systemctl start uengine-session.service

View File

@@ -1,5 +1,11 @@
import PIL.Image as Image
import PIL.ImageDraw as ImageDraw
import os
try:
import PIL.Image as Image
import PIL.ImageDraw as ImageDraw
except:
os.system("python3 -m pip install --upgrade pillow --break-system-packages --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple")
import PIL.Image as Image
import PIL.ImageDraw as ImageDraw
import zipfile
import subprocess
import re

View File

@@ -2,11 +2,10 @@
"Package": "com.gitee.uengine.runner.spark",
"Url": [
"https://gitee.com/gfdgd-xi/uengine-runner",
"https://github.com/gfdgd-xi/uengine-runner",
"https://gitlink.org.cn/gfdgd_xi/uengine-runner"
"https://github.com/gfdgd-xi/uengine-runner"
],
"Version": "2.1.0",
"System": "Linuxdeepin/UOS/Ubuntu22.04",
"Version": "2.1.2",
"System": "Linuxdeepin/UOS/Ubuntu/Debian",
"Tips": [
"更多可见https://gitee.com/gfdgd-xi/uengine-runner/wikis 或程序的更多帮助",
"安装APK点浏览按钮选中需要安装的APK然后点安装按钮",
@@ -23,6 +22,21 @@
"5、如果想要使用adb连接UEngine或其他手机请使用 1.2.0 以前的版本。如需连接UEngine请安装adb补丁"
],
"Update": [
"<b>V2.1.2</b>",
"※1、修复 https://gitee.com/gfdgd-xi/uengine-runner/issues/I6ZRZX",
"※2、修复添加应用图标时activity名称错误的问题",
"※3、修复 UEngine 运行器在 23 运行时提示缺失 PIL.Image 库的问题",
"",
"<b>V2.1.1</b>",
"※1、修复在 Ubuntu/Debian 安装 UEngine 时提示“该脚本不支持 deepin”的问题",
"※2、修复 UEngine 在 debian12 安装无法正常开启 UEngine 的问题;",
"※3、修复在 UEngine 程序菜单检查到 UEngine 不存在但是无法安装的问题;",
"※4、修复了 https://gitee.com/gfdgd-xi/uengine-runner/issues/I6B6C8 的问题;",
"※5、优化了 postinst 脚本;",
"6、添加 zenity 依赖;",
"7、屏蔽在更新程序过程中杀死程序中输出的错误",
"8、修改下载 dtk 的网址。",
"",
"<b>V2.1.0</b>",
"※1、修复源地址迁出 Gitlink",
"※2、优化 UEngine 安装器,可以在 Debian/Ubuntu 使用Debian11/Debian10/Ubuntu20.04 需要安装 dtk≥5.5dtk 可以从 https://gitee.com/gfdgd-xi/dtk-sources-for-uos-apt/releases 获取);",
@@ -249,10 +263,11 @@
"11、deepin 终端",
"……"
],
"Time": "2023-05-13 13:28:55 Linux-5.15.77-amd64-desktop-x86_64-with-Deepin-20.9-apricot",
"Time": "2023-08-14 17:02:40 Linux-6.1.32-amd64-desktop-hwe-x86_64-with-glibc2.35",
"Contribute": [
"<b>感谢以下用户提供的问题、建议、图标、代码等,如果有遗漏,请及时与开发者联系添加,以及如果侵犯到您的合法权益,也及时与开发者联系:</p>",
"<hr>",
"感谢 @鹤舞白沙 优化了程序文案",
"感谢 @Bail 修复了修复应用商店换源的问题,实现了微型应用商店更新关闭进程的功能",
"感谢 RacoonGX 团队的付出和贡献",
"感谢 cleverwwh 反馈的 UEngine 打包器在部分系统无法打开的问题",

View File

@@ -207,7 +207,7 @@ Name={}
self.RunCommandShow("chmod 0775 -vR '{}/DEBIAN/postinst'".format(tempPath))
self.RunCommandShow("chmod 0775 -vR '{}/DEBIAN/prerm'".format(tempPath))
self.RunCommandShow("echo '打包 deb 到桌面……'")
self.RunCommandShow("dpkg -b '{}' '{}/{}_{}.deb'".format(tempPath, get_desktop_path(),apkPackageNameNew, apkPackageVersion))
self.RunCommandShow("dpkg-deb -Z xz -b '{}' '{}/{}_{}.deb'".format(tempPath, get_desktop_path(),apkPackageNameNew, apkPackageVersion))
self.RunCommandShow("echo '正在删除临时目录……'")
self.RunCommandShow("rm -rfv '{}'".format(tempPath))
self.RunCommandShow("echo '完成!'")

View File

@@ -227,7 +227,7 @@ Name={}
self.RunCommandShow("chmod 0775 -vR '{}/DEBIAN/postinst'".format(tempPath))
self.RunCommandShow("chmod 0775 -vR '{}/DEBIAN/prerm'".format(tempPath))
self.RunCommandShow("echo '打包 deb 到桌面……'")
self.RunCommandShow("dpkg -b '{}' '{}/{}_{}_all.deb'".format(tempPath, get_desktop_path(),apkPackageNameNew, versionText.text()))
self.RunCommandShow("dpkg-deb -Z xz -b '{}' '{}/{}_{}_all.deb'".format(tempPath, get_desktop_path(),apkPackageNameNew, versionText.text()))
self.RunCommandShow("echo '正在删除临时目录……'")
self.RunCommandShow("rm -rfv '{}'".format(tempPath))
self.RunCommandShow("echo '完成!'")

View File

@@ -3,7 +3,7 @@
CheckEnv(){
# 检测是不是 Deepin
lsb_release -i | grep -i deepin
if [[ $? != 0 ]]; then
if [[ $? == 0 ]]; then
zenity --error --no-wrap '--text=您的系统无法安装 UEngine原因此脚本不支持 Deepin'
exit
fi
@@ -32,7 +32,7 @@ CheckEnv(){
#kernel=`uname -r`
python3 "${programPath}/CompareVersion.py" "${newestDtkVersion}" "5.5"
if [[ $? != 0 ]]; then
zenity --error --no-wrap "--text=提示:您当前的 dtk 版本过老,请更新 dtk 版本后再试(版本需要大于等于 5.5),可以从 https://gitee.com/gfdgd-xi/dtk-sources-for-uos-apt/ 获取编译好的 dtk"
zenity --error --no-wrap "--text=提示:您当前的 dtk 版本过老,请更新 dtk 版本后再试(版本需要大于等于 5.5),可以从 http://dtk.gfdgdxi.top 获取编译好的 dtk"
exit
fi
#exit

View File

@@ -1470,9 +1470,9 @@ class AddNewUengineDesktopLink():
global activityName
iconSavePath = "{}/.local/share/icons/hicolor/256x256/apps/{}.png".format(get_home(), packageName.text())
shutil.copy(programPath + "/defult.png", iconSavePath)
BuildUengineDesktop(packageName.text(), activityName, packageName.text(), iconSavePath,
BuildUengineDesktop(packageName.text(), activityName.text(), packageName.text(), iconSavePath,
"{}/.local/share/applications/uengine/{}.desktop".format(get_home(), packageName.text()))
BuildUengineDesktop(packageName.text(), activityName, packageName.text(), iconSavePath,
BuildUengineDesktop(packageName.text(), activityName.text(), packageName.text(), iconSavePath,
"{}/{}.desktop".format(get_desktop_path(), packageName.text()))
AddNewUengineDesktopLink.SaveHistory()
QtWidgets.QMessageBox.information(widget, "提示", "创建完毕!")
@@ -1586,7 +1586,7 @@ aaptVersion = GetCommandReturn("aapt version")
SystemVersion = GetSystemVersion()
iconPath = "{}/runner.svg".format(os.path.split(os.path.realpath(__file__))[0])
about = f'''<p align="center"><img width=256 src="{iconPath}"/></p>
<p>介绍:一个基于 Python3 的 PyQt5 制作的 UEngine 运行器在新版本Deepin/UOS发布后可以在应用商店安装部分官方已适配的安卓应用对爱好者来说不能自己安装APK软件包始终差点意思本程序可以为Deepin/UOS上的UEngine安卓运行环境安装自定义APK软件包并能发送安装的APK包启动菜单到桌面或系统菜单。</p>
<p>介绍:虽然通过Deepin/UOS应用商店已经能够安装部分安卓应用但对于安卓应用爱好者来说不能自由地安装任意APK软件包实在是不尽如人意。本软件可以实现在Deepin/UOS上安装任意APK软件包并能将其启动图标发送到系统桌面或启动器中方便用户快速启动它。 </p>
<p>程序开源许可证GPLV3</p>
<p>版本:{version}</p>
<p>适用平台:{goodRunSystem}</p>
@@ -1825,7 +1825,7 @@ if not os.path.exists("/usr/bin/uengine"):
#QtWidgets.QMessageBox.critical(None, "错误", "请安装 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 20.04 或 debian10 及以上版本才能正常安装\nUbuntu 20.04 和 debian10 需要手动安装 dtk≥5.5),可以从 https://gitee.com/gfdgd-xi/dtk-sources-for-uos-apt/releases 获取") == QtWidgets.QMessageBox.Yes:
if QtWidgets.QMessageBox.question(None, "提示", "您的电脑没有安装 UEngine是否安装 UEngine 以便更好的使用\n这里将会安装移植版本之前由 Shenmo 编写)\n安装完后重新启动该程序即可\n提示需要在 Ubuntu 20.04 或 debian10 及以上版本才能正常安装\nUbuntu 20.04 和 debian10 需要手动安装 dtk≥5.5),可以从 http://dtk.gfdgdxi.top 获取") == QtWidgets.QMessageBox.Yes:
#os.system(f"'{programPath}/launch.sh' deepin-terminal -C \"bash '{programPath}/uengine-installer'\"")
OpenTerminal(f"bash '{programPath}/uengine-installer'")
sys.exit(0)
@@ -1975,8 +1975,8 @@ uengineCheckCpu = QtWidgets.QAction(QtGui.QIcon.fromTheme("cpu"), langFile[lang]
uengineDeleteUengineCheck = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(40), langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][9])
uengineReinstall = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][10])
uengineUbuntuInstall = QtWidgets.QAction(QtGui.QIcon.fromTheme("ubuntu-logo-icon"), langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][14])
uengineUbuntuRemove = QtWidgets.QAction(QtGui.QIcon.fromTheme("ubuntu-logo-icon"), "移除在 Ubuntu 上安装的 UEngine 及其附属脚本")
uengineUbuntuInstallRoot = QtWidgets.QAction(QtGui.QIcon.fromTheme("ubuntu-logo-icon"), "在 Ubuntu 上安装 UEngineSuperSU 镜像)")
uengineUbuntuRemove = QtWidgets.QAction(QtGui.QIcon.fromTheme("ubuntu-logo-icon"), "移除在 Ubuntu/Debian 上安装的 UEngine 及其附属脚本")
uengineUbuntuInstallRoot = QtWidgets.QAction(QtGui.QIcon.fromTheme("ubuntu-logo-icon"), "在 Ubuntu/Debian 上安装 UEngineSuperSU 镜像)")
uengineWindowSizeSetting = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][16])
uengine.addAction(uengineOpenDebBuilder)
uengine.addAction(uengineOpenDebBuilderMore)

View File

@@ -14,16 +14,16 @@ else
if [ "$versionLower" = "deepin" ] || [ "$versionLower" = "uos" ]; then
echo "此系统为 Deepin/UOS使用 apt 安装"
zenity --question --text="您还未安装 UEngine是否现在安装" --no-wrap
if [[ $? = 0 ]]; then
"$dir/uengine-runner-applist-launch.sh" deepin-terminal -C "pkexec apt install uengine -y"
if [[ $? == 0 ]]; then
"$dir/launch.sh" deepin-terminal -C "pkexec apt install uengine -y"
fi
else
# 因为安装器出现问题,所以废弃
zenity --error --text="请安装 UEngine 后继续" --no-wrap
echo "非 Deepin/UOS 系统,使用 shenmo 提供的脚本安装\n暂未保证此安装脚本一定安装成功"
zenity --question --text="您还未安装 UEngine是否现在安装" --no-wrap
if [[ $? = 0 ]]; then
deepin-terminal -C "bash /opt/apps/com.gitee.uengine.runner.spark/files/uengine-installer"
if [[ $? == 0 ]]; then
"$dir/launch.sh" deepin-terminal -C "bash /opt/apps/com.gitee.uengine.runner.spark/files/uengine-installer"
fi
fi
fi

View File

@@ -33,7 +33,7 @@ def Update(name, stars, contact, things, version):
"Version": version
}
try:
QtWidgets.QMessageBox.information(widget, "提示", requests.post(parse.unquote(base64.b64decode("aHR0cHM6Ly8zMDQ2MjZwOTI3LmdvaG8uY28vdWVuZ2luZS1ydW5uZXIvYnVnL3VwbG9hZC5waHA=").decode("utf-8")), data=data).text)
QtWidgets.QMessageBox.information(widget, "提示", requests.post(parse.unquote(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3VlbmdpbmUtcnVubmVyL2J1Zy91cGxvYWQucGhw").decode("utf-8")), data=data).text)
print(data)
except:
traceback.print_exc()
@@ -104,4 +104,11 @@ window.setCentralWidget(widget)
window.setWindowTitle(f"UEngine 运行器 {version} 问题/建议反馈")
window.setWindowIcon(QtGui.QIcon(iconPath))
window.show()
starMenu.setDisabled(True)
contactThings.setDisabled(True)
#otherUpload.setDisabled(True)
nameThings.setDisabled(True)
updateButton.setDisabled(True)
updateThings.setDisabled(True)
updateThings.setText("请移步到 Gitee 或 Github 提交 Bug推荐使用 Gitee")
sys.exit(app.exec_())

View File

@@ -8,9 +8,10 @@ PIDFILE = '/tmp/uengine-runner.pid'
#程序结束时清理pid
@atexit.register
def remove_pid():
'''程序结束时清理pid'''
with open(PIDFILE) as pidfile:
pidlst = pidfile.readlines()
pidlst.remove(str(PID)+'\n')
pidlst.remove(str(PID)+'\n') #移除记录中的pid
with open(PIDFILE,'w') as pidfile:
pidfile.writelines(pidlst)
@@ -21,7 +22,7 @@ def main():
os.kill(int(i),15)
except ProcessLookupError:
pass
os.remove(PIDFILE)
## os.remove(PIDFILE) #因修复#I6ZRZX而注释
#当该程序被直接执行时执行结束进程操作。如果是导入的形式则只是记录pid
if __name__ == '__main__':

View File

@@ -207,7 +207,7 @@ Name={}
self.RunCommandShow("chmod 0775 -vR '{}/DEBIAN/postinst'".format(tempPath))
self.RunCommandShow("chmod 0775 -vR '{}/DEBIAN/prerm'".format(tempPath))
self.RunCommandShow("echo '打包 deb 到桌面……'")
self.RunCommandShow("dpkg -b '{}' '{}/{}_{}.deb'".format(tempPath, get_desktop_path(),apkPackageNameNew, apkPackageVersion))
self.RunCommandShow("dpkg-deb -Z xz -b '{}' '{}/{}_{}.deb'".format(tempPath, get_desktop_path(),apkPackageNameNew, apkPackageVersion))
self.RunCommandShow("echo '正在删除临时目录……'")
self.RunCommandShow("rm -rfv '{}'".format(tempPath))
self.RunCommandShow("echo '完成!'")

View File

@@ -227,7 +227,7 @@ Name={}
self.RunCommandShow("chmod 0775 -vR '{}/DEBIAN/postinst'".format(tempPath))
self.RunCommandShow("chmod 0775 -vR '{}/DEBIAN/prerm'".format(tempPath))
self.RunCommandShow("echo '打包 deb 到桌面……'")
self.RunCommandShow("dpkg -b '{}' '{}/{}_{}_all.deb'".format(tempPath, get_desktop_path(),apkPackageNameNew, versionText.text()))
self.RunCommandShow("dpkg-deb -Z xz -b '{}' '{}/{}_{}_all.deb'".format(tempPath, get_desktop_path(),apkPackageNameNew, versionText.text()))
self.RunCommandShow("echo '正在删除临时目录……'")
self.RunCommandShow("rm -rfv '{}'".format(tempPath))
self.RunCommandShow("echo '完成!'")

View File

@@ -3,7 +3,7 @@
CheckEnv(){
# 检测是不是 Deepin
lsb_release -i | grep -i deepin
if [[ $? != 0 ]]; then
if [[ $? == 0 ]]; then
zenity --error --no-wrap '--text=您的系统无法安装 UEngine原因此脚本不支持 Deepin'
exit
fi
@@ -32,7 +32,7 @@ CheckEnv(){
#kernel=`uname -r`
python3 "${programPath}/CompareVersion.py" "${newestDtkVersion}" "5.5"
if [[ $? != 0 ]]; then
zenity --error --no-wrap "--text=提示:您当前的 dtk 版本过老,请更新 dtk 版本后再试(版本需要大于等于 5.5),可以从 https://gitee.com/gfdgd-xi/dtk-sources-for-uos-apt/ 获取编译好的 dtk"
zenity --error --no-wrap "--text=提示:您当前的 dtk 版本过老,请更新 dtk 版本后再试(版本需要大于等于 5.5),可以从 http://dtk.gfdgdxi.top 获取编译好的 dtk"
exit
fi
#exit

View File

@@ -14,16 +14,16 @@ else
if [ "$versionLower" = "deepin" ] || [ "$versionLower" = "uos" ]; then
echo "此系统为 Deepin/UOS使用 apt 安装"
zenity --question --text="您还未安装 UEngine是否现在安装" --no-wrap
if [[ $? = 0 ]]; then
"$dir/uengine-runner-applist-launch.sh" deepin-terminal -C "pkexec apt install uengine -y"
if [[ $? == 0 ]]; then
"$dir/launch.sh" deepin-terminal -C "pkexec apt install uengine -y"
fi
else
# 因为安装器出现问题,所以废弃
zenity --error --text="请安装 UEngine 后继续" --no-wrap
echo "非 Deepin/UOS 系统,使用 shenmo 提供的脚本安装\n暂未保证此安装脚本一定安装成功"
zenity --question --text="您还未安装 UEngine是否现在安装" --no-wrap
if [[ $? = 0 ]]; then
deepin-terminal -C "bash /opt/apps/com.gitee.uengine.runner.spark/files/uengine-installer"
if [[ $? == 0 ]]; then
"$dir/launch.sh" deepin-terminal -C "bash /opt/apps/com.gitee.uengine.runner.spark/files/uengine-installer"
fi
fi
fi

View File

@@ -33,7 +33,7 @@ def Update(name, stars, contact, things, version):
"Version": version
}
try:
QtWidgets.QMessageBox.information(widget, "提示", requests.post(parse.unquote(base64.b64decode("aHR0cHM6Ly8zMDQ2MjZwOTI3LmdvaG8uY28vdWVuZ2luZS1ydW5uZXIvYnVnL3VwbG9hZC5waHA=").decode("utf-8")), data=data).text)
QtWidgets.QMessageBox.information(widget, "提示", requests.post(parse.unquote(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3VlbmdpbmUtcnVubmVyL2J1Zy91cGxvYWQucGhw").decode("utf-8")), data=data).text)
print(data)
except:
traceback.print_exc()
@@ -104,4 +104,11 @@ window.setCentralWidget(widget)
window.setWindowTitle(f"UEngine 运行器 {version} 问题/建议反馈")
window.setWindowIcon(QtGui.QIcon(iconPath))
window.show()
starMenu.setDisabled(True)
contactThings.setDisabled(True)
#otherUpload.setDisabled(True)
nameThings.setDisabled(True)
updateButton.setDisabled(True)
updateThings.setDisabled(True)
updateThings.setText("请移步到 Gitee 或 Github 提交 Bug推荐使用 Gitee")
sys.exit(app.exec_())

View File

@@ -8,9 +8,10 @@ PIDFILE = '/tmp/uengine-runner.pid'
#程序结束时清理pid
@atexit.register
def remove_pid():
'''程序结束时清理pid'''
with open(PIDFILE) as pidfile:
pidlst = pidfile.readlines()
pidlst.remove(str(PID)+'\n')
pidlst.remove(str(PID)+'\n') #移除记录中的pid
with open(PIDFILE,'w') as pidfile:
pidfile.writelines(pidlst)
@@ -21,7 +22,7 @@ def main():
os.kill(int(i),15)
except ProcessLookupError:
pass
os.remove(PIDFILE)
## os.remove(PIDFILE) #因修复#I6ZRZX而注释
#当该程序被直接执行时执行结束进程操作。如果是导入的形式则只是记录pid
if __name__ == '__main__':