Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ed2155b83e | |||
| 05d977030c | |||
| c77bbceeb2 | |||
| 7f36a1ff3c | |||
| d68f42c368 | |||
| c9a3db2f37 | |||
| 677ff4c16b | |||
| 65eaf17d85 | |||
| 72cf1e0881 | |||
| c53ad469e5 | |||
| 34e4d83104 | |||
| 5b85af521e | |||
| 158e99c3c4 | |||
| 5e31ca90c5 | |||
| 35fc896aaa | |||
| 9510660321 | |||
| 282bb35444 | |||
| bb813fc866 | |||
| d081862a4a |
1
.idea/vcs.xml
generated
@@ -2,5 +2,6 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
<mapping directory="$PROJECT_DIR$/Internet/random-questions/Question" vcs="Git" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
BIN
1/a78482dagy1h1boqumoo7j20jh0xctb6.jpg
Executable file
|
After Width: | Height: | Size: 99 KiB |
BIN
1/我好命苦.png
Executable file
|
After Width: | Height: | Size: 513 KiB |
BIN
1/气死我了.png
Executable file
|
After Width: | Height: | Size: 870 KiB |
BIN
Help/1-1-1.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
Help/1-1-2.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
Help/1-1-3.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
Help/1-1-4.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
Help/1-1-5.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
Help/1-2-1.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
Help/1-2-2.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Help/1-3-1.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
Help/1-4-1.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
Help/1-5-1.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
Help/1-5-2.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
Help/1-6-1.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
Help/1-6-2.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
Help/1-6-3.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
Help/1-7-1.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
Help/1-8-1.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
Help/1-9-1.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
Help/1-9-2.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
Help/1-9-3.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
Help/1-9-4.png
Normal file
|
After Width: | Height: | Size: 115 KiB |
BIN
Help/1-9-5.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
Help/1-9-6.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
Help/1-9-7.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
165
Help/index.html
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
|
||||||
|
<title>index</title>
|
||||||
|
</head>
|
||||||
|
<body><h1 id='uengine-运行器帮助'>UEngine 运行器帮助</h1>
|
||||||
|
<hr />
|
||||||
|
<h2 id='帮助简述'>帮助简述</h2>
|
||||||
|
<blockquote><p>安装APK:点浏览按钮,选中需要安装的APK,然后点安装按钮<br/>卸载APK:在卸载APK下面的输入框内输入需要卸载的APK包名,点卸载按钮,如果无法获取包名,可以通过浏览APK文件程序自动获取包名进行卸载。<br/>保存APK图标:在安装APK下面的输入框浏览或输入APK的路径,然后点击“保存图标”按钮,选择保存位置即可<br/>重置(删除)UEngine数据:点击菜单栏的“UEngine”的“清空UEngine数据”,输入密码重启即可<br/>注意:如果任何安卓一遍打不开,多打开几遍应该就可以重新加载UEngine配置了<br/>打开UEngine应用列表:打开系统已安装的应用列表(安卓界面)<br/><strong>提示:</strong> <br/><strong>※1、近期升级的 UEngine 安装时会自动把要安装的 apk 删除,如果这个 apk 文件非常重要请拷贝一个备份版并安装这个备份版</strong> <br/><strong>2、需要你有使用 root 权限的能力;</strong><br/><strong>3、需要安装 UEngine 才能使用;</strong><br/><strong>4、提取 apk 图标的 apk 路径以“安装 apk”那栏为准;</strong><br/><strong>5、如果想要使用adb连接UEngine或其他手机,请使用 1.2.0 以前的版本。(如需连接UEngine请安装adb补丁)</strong> </p>
|
||||||
|
</blockquote>
|
||||||
|
<hr />
|
||||||
|
<h2 id='详细帮助'>详细帮助</h2>
|
||||||
|
<h3 id='如何安装自己的-apk'>如何安装自己的 Apk</h3>
|
||||||
|
<p><em>请保证您已经把要安装的Apk下载到电脑本地并保证Apk完整且有权限</em></p>
|
||||||
|
<h4 id='方法一-1'>方法一</h4>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 <br/><img src="1-1-1.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击浏览按钮,找到想要安装的Apk<br/><img src="1-1-2.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击安装按钮,输入密码
|
||||||
|
<img src="1-1-3.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>提示“操作完成”,在启动器找到新安装的图标启动即可<br/><img src="1-1-4.png" referrerpolicy="no-referrer"><br/><img src="1-1-5.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<h4 id='方法二-1'>方法二</h4>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开要安装的Apk所在目录,右击=>打开方式=>安装或卸载 APK(UEngine 运行器)<br/><img src="1-2-1.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击安装按钮,输入密码<br/><img src="1-1-3.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>提示“操作完成”,在启动器找到新安装的图标启动即可<br/><img src="1-1-4.png" referrerpolicy="no-referrer"><br/><img src="1-2-2.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<h3 id='卸载apk'>卸载Apk</h3>
|
||||||
|
<h4 id='方法一-2'>方法一</h4>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 <br/><img src="1-1-1.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击浏览按钮,找到想要卸载的Apk<br/><img src="1-1-2.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击卸载按钮,输入密码<br/><img src="1-1-3.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>提示“操作完成”,卸载完成 <br/><img src="1-1-4.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<h4 id='方法二-2'>方法二</h4>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开要安装的Apk所在目录,右击=>打开方式=>安装或卸载 APK(UEngine 运行器)<br/><img src="1-2-1.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击卸载按钮,输入密码<br/><img src="1-1-3.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>提示“操作完成”,卸载完成<br/><img src="1-1-4.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<h3 id='查询apk信息'>查询Apk信息</h3>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 <br/><img src="1-1-1.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击“Apk 信息” 按钮即可查询Apk信息</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-3-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h3 id='查看程序评分'>查看程序评分</h3>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 <br/><img src="1-1-1.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击“Apk 信息” 按钮即可查询Apk信息
|
||||||
|
<img src="1-3-1.png" referrerpolicy="no-referrer"></li>
|
||||||
|
<li>点击“查看程序评分情况”即可查看其他用户对程序的评分</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-4-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h3 id='上传用户评分'>上传用户评分</h3>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 </li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-1-1.png" referrerpolicy="no-referrer"> </p>
|
||||||
|
<ol start='2' >
|
||||||
|
<li>点击“Apk 信息” 按钮即可查询Apk信息</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-3-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='3' >
|
||||||
|
<li>点击“上传程序评分情况”,按照要求进行评分</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-5-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='4' >
|
||||||
|
<li>如果提示“提交成功!感谢您的提交”就代表评分成功</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-5-2.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h3 id='更新程序'>更新程序</h3>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 </li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-1-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='2' >
|
||||||
|
<li>点击“关于”=>“检查更新”,打开更新窗口</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-6-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='3' >
|
||||||
|
<li><strong>保证您的电脑没有运行其它Python应用以及本程序所有工作都已经完成</strong>,再点击“更新(更新过程中会关闭所有Python应用,包括这个应用)”,输入密码以进行更新</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-6-2.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='4' >
|
||||||
|
<li>提示“更新完毕!”后重新启动 UEngine 运行器就更新完毕了</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-6-3.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h3 id='保存图标'>保存图标</h3>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 </li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-1-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='2' >
|
||||||
|
<li>选择要保存图标的Apk,点击“保存图标”按钮,选择要保存的位置即可</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-7-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h3 id='打开已安装的程序列表'>打开已安装的程序列表</h3>
|
||||||
|
<h4 id='方法一-3'>方法一</h4>
|
||||||
|
<p>打开启动器=>UEngine 程序菜单 即可</p>
|
||||||
|
<h4 id='方法二-3'>方法二</h4>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 <br/><img src="1-1-1.png" referrerpolicy="no-referrer"></li>
|
||||||
|
<li>点击“打开 UEngine 应用列表”即可</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-8-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h3 id='将-apk-打包成可以无需本应用即可安装的-deb-包'>将 Apk 打包成可以无需本应用即可安装的 deb 包</h3>
|
||||||
|
<h4 id='打开-uengine-打包器的三种方法'>打开 UEngine 打包器的三种方法</h4>
|
||||||
|
<h5 id='方法一-4'>方法一</h5>
|
||||||
|
<p>启动器=>UEngine 应用打包器</p>
|
||||||
|
<h5 id='方法二-4'>方法二</h5>
|
||||||
|
<p>打开要打包的 Apk 所在目录,右击=>“打开方式”=>“打包 deb(UEngine 运行器)”(接下来可以略过步骤一)</p>
|
||||||
|
<p><img src="1-9-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h5 id='方式三'>方式三</h5>
|
||||||
|
<p>打开 UEngine 运行器,点击菜单栏的“UEngine”=>“UEngine 应用打包”</p>
|
||||||
|
<p><img src="1-9-2.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h4 id='打包-deb'>打包 deb</h4>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开“UEngine Apk 应用打包器”,点击“浏览按钮”选择apk</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-9-3.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='2' >
|
||||||
|
<li>根据实际情况勾选选项,然后点击“打包”进行打包</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-9-4.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='3' >
|
||||||
|
<li>当提示“打包完成”时,打包完成,可以在桌面(一般是<code>/home/XXX/Desktop</code>)找到您打包的 deb 包,可以双击安装</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-9-5.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<p> <img src="1-9-6.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<p> <img src="1-9-7.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> ©2021-2022</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
193
Help/index.md
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
# UEngine 运行器帮助
|
||||||
|
---
|
||||||
|
## 帮助简述
|
||||||
|
> 安装APK:点浏览按钮,选中需要安装的APK,然后点安装按钮
|
||||||
|
> 卸载APK:在卸载APK下面的输入框内输入需要卸载的APK包名,点卸载按钮,如果无法获取包名,可以通过浏览APK文件程序自动获取包名进行卸载。
|
||||||
|
> 保存APK图标:在安装APK下面的输入框浏览或输入APK的路径,然后点击“保存图标”按钮,选择保存位置即可
|
||||||
|
> 重置(删除)UEngine数据:点击菜单栏的“UEngine”的“清空UEngine数据”,输入密码重启即可
|
||||||
|
> 注意:如果任何安卓一遍打不开,多打开几遍应该就可以重新加载UEngine配置了
|
||||||
|
> 打开UEngine应用列表:打开系统已安装的应用列表(安卓界面)
|
||||||
|
> **提示:**
|
||||||
|
> **※1、近期升级的 UEngine 安装时会自动把要安装的 apk 删除,如果这个 apk 文件非常重要请拷贝一个备份版并安装这个备份版**
|
||||||
|
> **2、需要你有使用 root 权限的能力;**
|
||||||
|
> **3、需要安装 UEngine 才能使用;**
|
||||||
|
> **4、提取 apk 图标的 apk 路径以“安装 apk”那栏为准;**
|
||||||
|
> **5、如果想要使用adb连接UEngine或其他手机,请使用 1.2.0 以前的版本。(如需连接UEngine请安装adb补丁)**
|
||||||
|
|
||||||
|
---
|
||||||
|
## 详细帮助
|
||||||
|
### 如何安装自己的 Apk
|
||||||
|
*请保证您已经把要安装的Apk下载到电脑本地并保证Apk完整且有权限*
|
||||||
|
#### 方法一
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|

|
||||||
|
2. 点击浏览按钮,找到想要安装的Apk
|
||||||
|

|
||||||
|
3. 点击安装按钮,输入密码
|
||||||
|

|
||||||
|
4. 提示“操作完成”,在启动器找到新安装的图标启动即可
|
||||||
|

|
||||||
|

|
||||||
|
#### 方法二
|
||||||
|
1. 打开要安装的Apk所在目录,右击=>打开方式=>安装或卸载 APK(UEngine 运行器)
|
||||||
|

|
||||||
|
2. 点击安装按钮,输入密码
|
||||||
|

|
||||||
|
3. 提示“操作完成”,在启动器找到新安装的图标启动即可
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
### 卸载Apk
|
||||||
|
#### 方法一
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|

|
||||||
|
2. 点击浏览按钮,找到想要卸载的Apk
|
||||||
|

|
||||||
|
3. 点击卸载按钮,输入密码
|
||||||
|

|
||||||
|
4. 提示“操作完成”,卸载完成
|
||||||
|

|
||||||
|
#### 方法二
|
||||||
|
1. 打开要安装的Apk所在目录,右击=>打开方式=>安装或卸载 APK(UEngine 运行器)
|
||||||
|

|
||||||
|
2. 点击卸载按钮,输入密码
|
||||||
|

|
||||||
|
3. 提示“操作完成”,卸载完成
|
||||||
|

|
||||||
|
|
||||||
|
### 查询Apk信息
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|

|
||||||
|
|
||||||
|
2. 点击“Apk 信息” 按钮即可查询Apk信息
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 查看程序评分
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|

|
||||||
|
|
||||||
|
2. 点击“Apk 信息” 按钮即可查询Apk信息
|
||||||
|

|
||||||
|
|
||||||
|
3. 点击“查看程序评分情况”即可查看其他用户对程序的评分
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 上传用户评分
|
||||||
|
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
2. 点击“Apk 信息” 按钮即可查询Apk信息
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. 点击“上传程序评分情况”,按照要求进行评分
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
4. 如果提示“提交成功!感谢您的提交”就代表评分成功
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 更新程序
|
||||||
|
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
2. 点击“关于”=>“检查更新”,打开更新窗口
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. **保证您的电脑没有运行其它Python应用以及本程序所有工作都已经完成**,再点击“更新(更新过程中会关闭所有Python应用,包括这个应用)”,输入密码以进行更新
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
4. 提示“更新完毕!”后重新启动 UEngine 运行器就更新完毕了
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 保存图标
|
||||||
|
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
2. 选择要保存图标的Apk,点击“保存图标”按钮,选择要保存的位置即可
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 打开已安装的程序列表
|
||||||
|
|
||||||
|
#### 方法一
|
||||||
|
|
||||||
|
打开启动器=>UEngine 程序菜单 即可
|
||||||
|
|
||||||
|
#### 方法二
|
||||||
|
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|

|
||||||
|
|
||||||
|
2. 点击“打开 UEngine 应用列表”即可
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 将 Apk 打包成可以无需本应用即可安装的 deb 包
|
||||||
|
|
||||||
|
#### 打开 UEngine 打包器的三种方法
|
||||||
|
|
||||||
|
##### 方法一
|
||||||
|
|
||||||
|
启动器=>UEngine 应用打包器
|
||||||
|
|
||||||
|
##### 方法二
|
||||||
|
|
||||||
|
打开要打包的 Apk 所在目录,右击=>“打开方式”=>“打包 deb(UEngine 运行器)”(接下来可以略过步骤一)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
##### 方式三
|
||||||
|
|
||||||
|
打开 UEngine 运行器,点击菜单栏的“UEngine”=>“UEngine 应用打包”
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
#### 打包 deb
|
||||||
|
|
||||||
|
1. 打开“UEngine Apk 应用打包器”,点击“浏览按钮”选择apk
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
2. 根据实际情况勾选选项,然后点击“打包”进行打包
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. 当提示“打包完成”时,打包完成,可以在桌面(一般是`/home/XXX/Desktop`)找到您打包的 deb 包,可以双击安装
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
©2021-2022
|
||||||
@@ -18,7 +18,8 @@
|
|||||||
"Name": "程序",
|
"Name": "程序",
|
||||||
"Menu": [
|
"Menu": [
|
||||||
"清空软件历史记录",
|
"清空软件历史记录",
|
||||||
"退出程序"
|
"退出程序",
|
||||||
|
"程序设置"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -112,7 +113,9 @@
|
|||||||
"Menu": [
|
"Menu": [
|
||||||
"程序官网",
|
"程序官网",
|
||||||
"关于",
|
"关于",
|
||||||
"反馈程序问题和建议"
|
"反馈程序问题和建议",
|
||||||
|
"检查更新",
|
||||||
|
"更多帮助"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -152,7 +155,8 @@
|
|||||||
"Name": "Program",
|
"Name": "Program",
|
||||||
"Menu": [
|
"Menu": [
|
||||||
"Clean Program History",
|
"Clean Program History",
|
||||||
"Exit The Program"
|
"Exit The Program",
|
||||||
|
"Program Setting"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -246,7 +250,9 @@
|
|||||||
"Menu": [
|
"Menu": [
|
||||||
"Program WebSize",
|
"Program WebSize",
|
||||||
"Program Help",
|
"Program Help",
|
||||||
"Upload Problem And Advice"
|
"Upload Problem And Advice",
|
||||||
|
"ABout This Program",
|
||||||
|
"More Help"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
57
README.md
@@ -1,19 +1,47 @@
|
|||||||
# uengine 运行器 1.5.3
|
# UEngine 运行器 1.6.1
|
||||||
|
|
||||||
### 介绍
|
### 介绍
|
||||||
新版本Deepin/UOS发布后,可以在应用商店安装部分官方已适配的安卓应用,对爱好者来说,不能自己安装APK软件包始终差点意思,本程序可以为Deepin/UOS上的UEngine安卓运行环境安装自定义APK软件包,并能发送安装的APK包启动菜单到桌面或系统菜单。
|
新版本Deepin/UOS发布后,可以在应用商店安装部分官方已适配的安卓应用,对爱好者来说,不能自己安装APK软件包始终差点意思,本程序可以为Deepin/UOS上的UEngine安卓运行环境安装自定义APK软件包,并能发送安装的APK包启动菜单到桌面或系统菜单。
|
||||||

|

|
||||||
(测试平台:UOS 家庭版 21.1,deepin 20.3,UOS 专业版 1040)
|
(测试平台:UOS 家庭版 21.1,deepin 20.6,UOS 专业版 1040)
|
||||||
(自己美术功底太差,图标直接用 anbox 的了)
|
(自己美术功底太差,图标直接用 anbox 的了)
|
||||||
|
|
||||||
## 安装前必读
|
## 安装前必读
|
||||||
+ releases 里有两个 deb 包,**是一样的除了包名和打包标准不同**,**只能选择其中一个安装**,**两个都安装会产生冲突**,两个deb包的作用如下:
|
+ releases 里有两个 deb 包,**是一样的除了包名和打包标准不同**,**只能选择其中一个安装**,**两个都安装会产生冲突**,两个deb包的作用如下:
|
||||||
- 包名为`spark-uengine-runner`的,是旧包,按照**正常标准打包**,适用于从**星火应用商店安装**以及**从低版本(即1.3.2即以下版本升级上来的用户)升级**或者**之前就安装该版本的用户**甚至**想跨平台的用户**等等
|
- 包名为`spark-uengine-runner`的,是旧包,按照**正常标准打包**,适用于从**星火应用商店安装**以及**从低版本(即1.3.2即以下版本升级上来的用户)升级**或者**之前就安装该版本的用户**甚至**想跨平台的用户**等等
|
||||||
- 包名为`com.gitee.uengine.runner.spark`的,是按照**deepin/UOS的标准打包的**,适用于**之前就安装该版本并升级上来的用户**以及**希望按照该方法打包的用户**等等
|
- 包名为`com.gitee.uengine.runner.spark`的,是按照**deepin/UOS的标准打包的**,适用于**之前就安装该版本并升级上来的用户**以及**希望按照该方法打包的用户**等等
|
||||||
+ **近期升级的 UEngine 安装时会自动把要安装的 apk 删除**,如果这个 apk 文件非常重要请**拷贝一个备份版并安装这个备份版**
|
+ **近期升级的 UEngine 安装时会自动把要安装的 apk 删除**,如果这个 apk 文件非常重要请**拷贝一个备份版并安装这个备份版或者在程序设置里面选择“备份APK包然后在安装后自动拷贝原先目录”选项**
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
### 更新内容
|
### 更新内容
|
||||||
#### V1.5.3(2021-12-12,DDUC11版,未完全完工):
|
#### V1.6.1(2022年05月21日,521)
|
||||||
|
**※1、修复了打包 deb 包在 APK 的包名有大写时无法启动的问题**
|
||||||
|
**※2、提供新版本的 UEngine Root 镜像**
|
||||||
|
**※3、更新了 UEngine Root 的下载地址**
|
||||||
|
**※4、修复了本程序的“UEngine 键盘映射”无法启动的问题**
|
||||||
|
5、把构建 UEngine Root 镜像修改为多线程下载(wget=>aria2)
|
||||||
|
6、提供了 UEngine 运行器的 API(可以从项目地址中获取)
|
||||||
|
7、补上遗漏的项目参与者“星空露光”,新加项目参与者“为什么您不喜欢熊出没和阿布呢”
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
#### V1.6.0(开学版,开学前一天完成)
|
||||||
|
**※1、更换了新的图标已完成(感谢[@星空露光](https://gitee.com/Cynorkyle))**
|
||||||
|
**※2、支持程序的评分和查看分数详情的功能**
|
||||||
|
**※3、修复了在安装奇奇怪怪的安装包(如格式、标识不正确的)时的快捷方式图标为空以及快捷方式文本的变化**
|
||||||
|
**※4、添加更新功能,可以自行升级到最新版本**
|
||||||
|
**※5、新增程序帮助**
|
||||||
|
6、新填彩蛋(在“关于”=>“关于”显示的窗口双击“关于”开启)
|
||||||
|
7、修复了“UEngine 打包器”前缀选项勾选设置不生效的问题
|
||||||
|
8、修复了“UEngine 打包器” 打包的安装包版本号带 V 无法打包的情况
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.5.3(2021-12-12,DDUC11版):
|
||||||
##### 更新内容
|
##### 更新内容
|
||||||
**※1、修复了在 UOS 家庭版安装 apk 文件安装包信息为 None 的问题**
|
**※1、修复了在 UOS 家庭版安装 apk 文件安装包信息为 None 的问题**
|
||||||
**※2、“添加/删除 UEngine 图标”窗口的写入按钮在目录**`~/.local/share/icons/hicolor/256x256/apps`**不存在时点击无反应,参考报错1.5.3-1**
|
**※2、“添加/删除 UEngine 图标”窗口的写入按钮在目录**`~/.local/share/icons/hicolor/256x256/apps`**不存在时点击无反应,参考报错1.5.3-1**
|
||||||
@@ -154,8 +182,14 @@ FileNotFoundError: [Errno 2] No such file or directory: '/home/gfdgd_xi/.local/s
|
|||||||
1. 安装所需依赖
|
1. 安装所需依赖
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt install python3 python3-tk git python3-pip aapt uengine
|
sudo apt install deepin-elf-verify python3 python3-tk python3-pip
|
||||||
python3 -m pip install ttkthemes
|
sudo apt install aapt uengine python3-setuptools deepin-terminal curl
|
||||||
|
sudo apt install python3-pil python3-pil.imagetk python3-requests adb
|
||||||
|
sudo apt install translate-shell python3-xlib python3-requests fonts-noto-cjk python3-numpy
|
||||||
|
python3 -m pip install pip -U
|
||||||
|
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
|
||||||
```
|
```
|
||||||
|
|
||||||
2. 下载本程序
|
2. 下载本程序
|
||||||
@@ -194,13 +228,13 @@ pip3 uninstall ttkthemes
|
|||||||
如果出现故障,尝试终端运行,如果是可以自行解决的问题,就**自行解决**,如果可以就**提 issues 并提供解决方案**,不行就**提 isscue 并提供程序和终端报错以及程序版本**
|
如果出现故障,尝试终端运行,如果是可以自行解决的问题,就**自行解决**,如果可以就**提 issues 并提供解决方案**,不行就**提 isscue 并提供程序和终端报错以及程序版本**
|
||||||
|
|
||||||
### 下载量
|
### 下载量
|
||||||
这里只统计蓝奏云的下载量,链接(每周更新一次):
|
这里只统计蓝奏云的下载量,链接(懒得更了):
|
||||||
[https://kdocs.cn/l/smrvazWGuKcY](https://kdocs.cn/l/smrvazWGuKcY)
|
[https://kdocs.cn/l/smrvazWGuKcY](https://kdocs.cn/l/smrvazWGuKcY)
|
||||||
|
|
||||||
### 已知问题
|
### 已知问题
|
||||||
<p align="center"><img src='https://bbs.deepin.org/assets/image/raccoon/[sad].gif'></p>
|
<p align="center"><img src='https://bbs.deepin.org/assets/image/raccoon/[sad].gif'></p>
|
||||||
|
|
||||||

|

|
||||||
部分 app 无法读取出图片,已知:
|
部分 app 无法读取出图片,已知:
|
||||||
| 程序 | 下载链接 |
|
| 程序 | 下载链接 |
|
||||||
| :-: | :-: |
|
| :-: | :-: |
|
||||||
@@ -232,7 +266,8 @@ pip3 uninstall ttkthemes
|
|||||||
| Root UEngine | https://gitee.com/Limexb/root-uengine |
|
| Root UEngine | https://gitee.com/Limexb/root-uengine |
|
||||||
|
|
||||||
### 附测试生成图标无问题列表:
|
### 附测试生成图标无问题列表:
|
||||||
**至于能不能用就不测试了,这暂时不是重点**
|
**至于能不能用就不测试了,这暂时不是重点**
|
||||||
|
**现在新加了评分功能,就看大家的评分了!**
|
||||||
| 程序 | 下载链接 |
|
| 程序 | 下载链接 |
|
||||||
|:-:|:-:|
|
|:-:|:-:|
|
||||||
| QQ 全家桶(完整版、极速版、Android Pad 版) | https://im.qq.com |
|
| QQ 全家桶(完整版、极速版、Android Pad 版) | https://im.qq.com |
|
||||||
@@ -254,4 +289,4 @@ pip3 uninstall ttkthemes
|
|||||||
| WPS Office For Android | https://www.wps.cn/ |
|
| WPS Office For Android | https://www.wps.cn/ |
|
||||||
| 钉钉 for android | https://page.dingtalk.com/wow/dingtalk/act/download?spm=a3140.8196062.0.0.6f4c5c3dWBhYUM |
|
| 钉钉 for android | https://page.dingtalk.com/wow/dingtalk/act/download?spm=a3140.8196062.0.0.6f4c5c3dWBhYUM |
|
||||||
|
|
||||||
### ©2021-2021
|
### ©2021-2022
|
||||||
@@ -3,7 +3,7 @@ Categories=System;
|
|||||||
Comment=UEngine 程序菜单
|
Comment=UEngine 程序菜单
|
||||||
Encoding=UTF-8
|
Encoding=UTF-8
|
||||||
Exec=/usr/bin/uengine launch.sh --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
|
Exec=/usr/bin/uengine launch.sh --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
|
||||||
Icon=/opt/apps/uengine-runner/icon.png
|
Icon=/opt/apps/uengine-runner/menu.svg
|
||||||
MimeType=
|
MimeType=
|
||||||
Name=UEngine 程序菜单
|
Name=UEngine 程序菜单
|
||||||
StartupWMClass=UEngine 程序菜单
|
StartupWMClass=UEngine 程序菜单
|
||||||
|
|||||||
2
api-test.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
import api
|
||||||
|
xxx = api.APK()
|
||||||
109
api/README.md
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
# API 介绍
|
||||||
|
# 必知
|
||||||
|
1. 此 API 只支持可以运行 UEngine 的 Linux 上,Windows 上无法使用
|
||||||
|
2. 部分函数需要 root 权限
|
||||||
|
3. 这是 UEngine 运行器的函数重构,所以一些 UEngine 运行器上没有的 bug 可能在这个 API 里有
|
||||||
|
## ProgramInformation
|
||||||
|
用于获取一些程序信息,详细如下(未特殊表明的是变量,否则是函数):
|
||||||
|
| 变量/函数名 | 变量/函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| programPath | 获取程序所在路径 |
|
||||||
|
| version | API 版本 |
|
||||||
|
| updateTime | 更新时间 |
|
||||||
|
| websize | 程序官网 |
|
||||||
|
| home | 用户 home(用户文件)目录 |
|
||||||
|
| developer | 参与的开发者列表 |
|
||||||
|
| language | 当前语言 |
|
||||||
|
| DesktopPath() | (函数)用户桌面目录 |
|
||||||
|
|
||||||
|
## Check
|
||||||
|
用于检查 API 所需的东西是否完整,详细如下:
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| CheckDepend() | 检查 API 所需的依赖是否完整 |
|
||||||
|
|
||||||
|
## ROOT
|
||||||
|
用于检查 ROOT 方面问题,详细如下:
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| GetRoot() | 检查程序/API是否以 ROOT 权限运行 |
|
||||||
|
|
||||||
|
## APK
|
||||||
|
这是面向对象的写法,所以应用方式也不一样:
|
||||||
|
```python
|
||||||
|
import api
|
||||||
|
xxx = api.APK("APK 所在路径")
|
||||||
|
```
|
||||||
|
具体函数介绍:
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| xxx.install() | 安装这个 APK 包(需要 Root) |
|
||||||
|
| xxx.uninstall()| 卸载这个 APK 包(需要 Root) |
|
||||||
|
| xxx.information()| 获取从 aapt 获取到的 APK 信息 |
|
||||||
|
| xxx.activityName() | 获取 APK 的 Activity 信息 |
|
||||||
|
| xxx.packageName() | 获取 APK 包名 |
|
||||||
|
| xxx.chineseLabel() | 获取 APK 中文名称 |
|
||||||
|
| xxx.saveApkIcon("图标保存路径") | 保存 APK 的图标到指定路径 |
|
||||||
|
| xxx.version() | 获取 APK 版本号 |
|
||||||
|
| xxx.saveDesktopFile("图标保存路径", "快捷方式保存路径") | 保存支持 UEngine 启动的 APK 快捷方式 |
|
||||||
|
| xxx.run() | 运行该应用(需要保证已经安装) |
|
||||||
|
| xxx.buildDeb("deb 包保存路径", qianZhui) | 打包为 deb 包(“qianZhui”是布尔值,可略,True代表有前缀为“uengine-dc”,False代表没有前缀) |
|
||||||
|
|
||||||
|
## UEngine
|
||||||
|
用于对 UEngine 进行一点点操控,详细如下:
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| UengineAppManager() | 显示 UEngine 安装应用程序管理器 |
|
||||||
|
| OpenApp("应用包名", "应用Activity") | 运行指定的应用(需要保证程序已经安装) |
|
||||||
|
| UengineDataClean() | 清空 UEngine 数据(需要 Root) |
|
||||||
|
| RemoveUengineCheck() | 删除 UEngine 的检查脚本(需要 Root) |
|
||||||
|
| CPUCheck() | 检查 CPU 是否支持运行 UEngine |
|
||||||
|
| BuildUengineRootImage() | 构建 UEngine 的 Root 镜像 |
|
||||||
|
| OpenUengineRootData() | 打开 UEngine 数据目录 |
|
||||||
|
| InstallRootUengineImage() | 安装已经被 Root 过的 UEngine 镜像(需要 Root) |
|
||||||
|
| Services | 用于操控 UEngine 服务的类,见下(需要 Root) |
|
||||||
|
| InternetBridge | 用于操控 UEngine 网络桥接的类,见下(需要 Root) |
|
||||||
|
### Services
|
||||||
|
关于 UEngine 的服务控制:
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| Services.Open() | 打开 UEngine 服务(需要 Root) |
|
||||||
|
| Services.Close() | 关闭 UEngine 服务(需要 Root) |
|
||||||
|
| Services.Restart() | 重启 UEngine 服务(需要 Root) |
|
||||||
|
### InternetBridge
|
||||||
|
关于 UEngine 的网络桥接控制:
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| InternetBridge.Open() | 打开 UEngine 网络桥接(需要 Root) |
|
||||||
|
| InternetBridge.Close() | 关闭 UEngine 网络桥接(需要 Root) |
|
||||||
|
| InternetBridge.Restart() | 重启 UEngine 网络桥接(需要 Root) |
|
||||||
|
| InternetBridge.Reload() | 重新加载 UEngine 网络桥接(需要 Root) |
|
||||||
|
| InternetBridge.ForceReload() | 强制加载 UEngine 网络桥接(需要 Root) |
|
||||||
|
## Adb
|
||||||
|
用于对 Adb 的部分操控
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| Services | 用于操控 Adb 服务的类,见下 |
|
||||||
|
### Service
|
||||||
|
关于 Adb 的服务控制:
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| Services.Open() | 打开 Adb 服务 |
|
||||||
|
| Services.Close() | 关闭 Adb 服务 |
|
||||||
|
| Services.Kill() | 杀死 Adb 进程 |
|
||||||
|
## File
|
||||||
|
关于文件的读取和写入,这是面向对象的写法,所以应用方式也不一样:
|
||||||
|
```python
|
||||||
|
import api
|
||||||
|
xxx = api.File("文件所在路径")
|
||||||
|
```
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| xxx.read() | 读取这个文件 |
|
||||||
|
| xxx.write("写入内容") | 写入这个文件 |
|
||||||
|
|
||||||
|
## UengineRunner
|
||||||
|
用于 UEngine 运行器的部分操控(请保证安装了 UEngine 运行器)
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| CleanHistory() | 清理 UEngine 运行器的历史记录 |
|
||||||
356
api/__init__.py
Normal file
@@ -0,0 +1,356 @@
|
|||||||
|
import os
|
||||||
|
import random
|
||||||
|
import shutil
|
||||||
|
import zipfile
|
||||||
|
import traceback
|
||||||
|
import subprocess
|
||||||
|
from getxmlimg import getsavexml
|
||||||
|
|
||||||
|
class ProgramInformation:
|
||||||
|
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||||
|
version = "1.6.0Alpha2"
|
||||||
|
updateTime = "2022年05月21日"
|
||||||
|
websize = ["https://gitee.com/gfdgd-xi/uengine-runner", "https://github.com/gfdgd-xi/uengine-runner"]
|
||||||
|
home = os.path.expanduser('~')
|
||||||
|
developer = ["gfdgd xi<3025613752@qq.com>", "为什么您不喜欢熊出没和阿布呢<https://weibo.com/u/7755040136>", "星空露光<https://gitee.com/Cynorkyle>", "actionchen<917981399@qq.com>", "柚子<https://gitee.com/Limexb>"]
|
||||||
|
lang = os.getenv('LANG')
|
||||||
|
# 获取用户桌面目录
|
||||||
|
def DesktopPath() -> "获取用户桌面目录":
|
||||||
|
for line in open(get_home() + "/.config/user-dirs.dirs"): # 以行来读取配置文件
|
||||||
|
desktop_index = line.find("XDG_DESKTOP_DIR=\"") # 寻找是否有对应项,有返回 0,没有返回 -1
|
||||||
|
if desktop_index != -1: # 如果有对应项
|
||||||
|
break # 结束循环
|
||||||
|
if desktop_index == -1: # 如果是提前结束,值一定≠-1,如果是没有提前结束,值一定=-1
|
||||||
|
return -1
|
||||||
|
else:
|
||||||
|
get = line[17:-2] # 截取桌面目录路径
|
||||||
|
get_index = get.find("$HOME") # 寻找是否有对应的项,需要替换内容
|
||||||
|
if get != -1: # 如果有
|
||||||
|
get = get.replace("$HOME", get_home()) # 则把其替换为用户目录(~)
|
||||||
|
return get # 返回目录
|
||||||
|
|
||||||
|
# 判断程序以正确方式运行
|
||||||
|
class Check:
|
||||||
|
def CheckDepend():
|
||||||
|
depend = ["/usr/bin/uengine", "UEngine", "/usr/bin/adb", "adb", "/usr/bin/uengine-session-launch-helper", "UEngine", "/usr/bin/aapt", "aapt"]
|
||||||
|
for i in range(0, len(depend), 2):
|
||||||
|
if not os.path.exists(depend[i]):
|
||||||
|
print("依赖{}不存在".format(depend[i + 1]))
|
||||||
|
|
||||||
|
class ROOT:
|
||||||
|
def GetRoot():
|
||||||
|
return os.geteuid() == 0
|
||||||
|
|
||||||
|
class APK:
|
||||||
|
def __init__(self, apkPath):
|
||||||
|
self.apkPath = apkPath
|
||||||
|
def install(self):
|
||||||
|
os.system("pkexec /usr/bin/uengine-session-launch-helper -- uengine install --apk='{}'".format(self.apkPath))
|
||||||
|
def uninstall(self):
|
||||||
|
os.system("pkexec /usr/bin/uengine-session-launch-helper -- uengine uninstall --pkg='{}'".format(self.packageName()))
|
||||||
|
def information(self):
|
||||||
|
return subprocess.getoutput("aapt dump badging '{}'".format(self.apkPath))
|
||||||
|
def activityName(self):
|
||||||
|
info = self.information()
|
||||||
|
for line in info.split('\n'):
|
||||||
|
if "launchable-activity" in line:
|
||||||
|
line = line[0: line.index("label='")]
|
||||||
|
line = line.replace("launchable-activity: ", "")
|
||||||
|
line = line.replace("'", "")
|
||||||
|
line = line.replace(" ", "")
|
||||||
|
line = line.replace("name=", "")
|
||||||
|
line = line.replace("label=", "")
|
||||||
|
line = line.replace("icon=", "")
|
||||||
|
return line
|
||||||
|
# 获取 apk 包名
|
||||||
|
def packageName(self):
|
||||||
|
info = self.information()
|
||||||
|
for line in info.split('\n'):
|
||||||
|
if "package:" in line:
|
||||||
|
line = line[0: line.index("versionCode='")]
|
||||||
|
line = line.replace("package:", "")
|
||||||
|
line = line.replace("name=", "")
|
||||||
|
line = line.replace("'", "")
|
||||||
|
line = line.replace(" ", "")
|
||||||
|
return line
|
||||||
|
# 获取软件的中文名称
|
||||||
|
def chineseLabel(self) -> "获取软件的中文名称":
|
||||||
|
info = self.information()
|
||||||
|
for line in info.split('\n'):
|
||||||
|
if "application-label:" in line:
|
||||||
|
line = line.replace("application-label:", "")
|
||||||
|
line = line.replace("'", "")
|
||||||
|
return line
|
||||||
|
# 保存apk图标
|
||||||
|
def saveApkIcon(self, iconSavePath) -> "保存 apk 文件的图标":
|
||||||
|
try:
|
||||||
|
if os.path.exists(iconSavePath):
|
||||||
|
os.remove(iconSavePath)
|
||||||
|
info = self.information()
|
||||||
|
for line in info.split('\n'):
|
||||||
|
if "application:" in line:
|
||||||
|
xmlpath = line.split(":")[-1].split()[-1].split("=")[-1].replace("'", "")
|
||||||
|
if xmlpath.endswith('.xml'):
|
||||||
|
xmlsave = getsavexml()
|
||||||
|
print(xmlpath)
|
||||||
|
xmlsave.savexml(self.apkPath, xmlpath, iconSavePath)
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
zip = zipfile.ZipFile(self.apkPath)
|
||||||
|
iconData = zip.read(xmlpath)
|
||||||
|
with open(iconSavePath, 'w+b') as saveIconFile:
|
||||||
|
saveIconFile.write(iconData)
|
||||||
|
return
|
||||||
|
print("None Icon! Show defult icon")
|
||||||
|
shutil.copy(ProgramInformation.programPath + "/defult.png", iconSavePath)
|
||||||
|
except:
|
||||||
|
traceback.print_exc()
|
||||||
|
print("Error, show defult icon")
|
||||||
|
shutil.copy(ProgramInformation.programPath + "/defult.png", iconSavePath)
|
||||||
|
def version(self):
|
||||||
|
info = self.information()
|
||||||
|
for line in info.split('\n'):
|
||||||
|
if "package:" in line:
|
||||||
|
if "compileSdkVersion='" in line:
|
||||||
|
line = line.replace(line[line.index("compileSdkVersion='"): -1], "")
|
||||||
|
if "platform" in line:
|
||||||
|
line = line.replace(line[line.index("platform"): -1], "")
|
||||||
|
line = line.replace(line[0: line.index("versionName='")], "")
|
||||||
|
line = line.replace("versionName='", "")
|
||||||
|
line = line.replace("'", "")
|
||||||
|
line = line.replace(" ", "")
|
||||||
|
return line
|
||||||
|
def saveDesktopFile(self, desktopPath, iconPath):
|
||||||
|
showName = self.chineseLabel()
|
||||||
|
if showName == "" or showName == None:
|
||||||
|
showName = "未知应用"
|
||||||
|
self.saveApkIcon(iconPath)
|
||||||
|
things = '''[Desktop Entry]
|
||||||
|
Categories=app;
|
||||||
|
Encoding=UTF-8
|
||||||
|
Exec=uengine launch --action=android.intent.action.MAIN --package={} --component={}
|
||||||
|
GenericName={}
|
||||||
|
Icon={}
|
||||||
|
MimeType=
|
||||||
|
Name={}
|
||||||
|
StartupWMClass={}
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
'''.format(self.packageName(), self.activityName(), showName, iconPath, showName, showName)
|
||||||
|
File(desktopPath).write(things)
|
||||||
|
def run(self):
|
||||||
|
UEngine.OpenApp(self.packageName(), self.activityName())
|
||||||
|
|
||||||
|
def buildDeb(self, savePath, qianZhui = True):
|
||||||
|
tempPath = "/tmp/uengine-apk-builder-{}".format(int(random.randint(0, 1024)))
|
||||||
|
#RunCommandShow("echo '======================================New===================================='")
|
||||||
|
#RunCommandShow("echo '创建目录'")
|
||||||
|
os.makedirs("{}/DEBIAN".format(tempPath))
|
||||||
|
os.makedirs("{}/usr/share/applications".format(tempPath))
|
||||||
|
os.makedirs("{}/usr/share/uengine/apk".format(tempPath))
|
||||||
|
os.makedirs("{}/usr/share/uengine/icons".format(tempPath))
|
||||||
|
apkPackageName = self.packageName()
|
||||||
|
if qianZhui:
|
||||||
|
apkPackageNameNew = "uengine-dc-" + self.packageName().lower()
|
||||||
|
else:
|
||||||
|
apkPackageNameNew = self.packageName().lower()
|
||||||
|
apkPackageVersion = self.version()
|
||||||
|
if apkPackageVersion[0].upper() == "V":
|
||||||
|
package = list(apkPackageVersion)
|
||||||
|
package.pop(0)
|
||||||
|
apkPackageVersion = "".join(package)
|
||||||
|
apkChineseLabel = self.chineseLabel()
|
||||||
|
apkActivityName = self.activityName()
|
||||||
|
iconSavePath = "{}/usr/share/uengine/icons/{}.png".format(tempPath, apkPackageNameNew)
|
||||||
|
debControl = '''Package: {}
|
||||||
|
Version: {}
|
||||||
|
Architecture: all
|
||||||
|
Maintainer: {}
|
||||||
|
Depends: deepin-elf-verify (>= 0.0.16.7-1), uengine (>= 1.0.1)
|
||||||
|
Section: utils
|
||||||
|
Priority: optional
|
||||||
|
Description: {}\n'''.format(apkPackageNameNew, apkPackageVersion, apkChineseLabel, apkChineseLabel)
|
||||||
|
debPostinst = '''#!/bin/sh
|
||||||
|
|
||||||
|
APK_DIR="/usr/share/uengine/apk"
|
||||||
|
APK_NAME="{}"
|
||||||
|
APK_PATH="$APK_DIR/$APK_NAME"
|
||||||
|
DESKTOP_FILE="{}"
|
||||||
|
|
||||||
|
|
||||||
|
if [ -f $APK_PATH ]; then
|
||||||
|
echo "Installing $APK_NAME"
|
||||||
|
else
|
||||||
|
echo "ERROR: $APK_NAME does not exist."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
session_manager=`ps -ef | grep "uengine session-manager" | grep -v grep`
|
||||||
|
if test -z "$session_manager"; then
|
||||||
|
echo "ERROR: app install failed(session-manager is not running)."
|
||||||
|
sess_dir="/usr/share/uengine/session_install"
|
||||||
|
if [ ! -d $sess_dir ]; then
|
||||||
|
mkdir $sess_dir
|
||||||
|
chmod 777 $sess_dir
|
||||||
|
fi
|
||||||
|
apk_name=${{APK_PATH##*/}}
|
||||||
|
fileName="$sess_dir/$apk_name"
|
||||||
|
echo $DESKTOP_FILE > $fileName
|
||||||
|
abistr=""
|
||||||
|
if test -n "$abistr"; then
|
||||||
|
abi=`echo $abistr |awk -F \= '{{print $2}}'`
|
||||||
|
echo $abi >> $fileName
|
||||||
|
fi
|
||||||
|
chmod 766 $fileName
|
||||||
|
fi
|
||||||
|
|
||||||
|
/usr/bin/uengine-session-launch-helper -- uengine install --apk="$APK_PATH"
|
||||||
|
|
||||||
|
exit 0'''.format(apkPackageNameNew + ".apk", "/usr/share/applications/{}.desktop".format(apkPackageNameNew))
|
||||||
|
debPrerm = '''#!/bin/sh
|
||||||
|
|
||||||
|
APP_NAME="{}"
|
||||||
|
DESKTOP_FILE="{}"
|
||||||
|
|
||||||
|
session_manager=`ps -ef | grep "uengine session-manager" | grep -v grep`
|
||||||
|
if test -z "$session_manager"; then
|
||||||
|
echo "ERROR: app uninstall failed(session-manager is not running)."
|
||||||
|
sess_dir="/usr/share/uengine/session_uninstall"
|
||||||
|
if [ ! -d $sess_dir ]; then
|
||||||
|
mkdir $sess_dir
|
||||||
|
chmod 777 $sess_dir
|
||||||
|
fi
|
||||||
|
fileName="$sess_dir/$APP_NAME"
|
||||||
|
echo $DESKTOP_FILE > $fileName
|
||||||
|
chmod 766 $fileName
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Uninstalling $APP_NAME"
|
||||||
|
/usr/bin/uengine-session-launch-helper -- uengine uninstall --pkg="$APP_NAME"
|
||||||
|
|
||||||
|
exit 0'''.format(apkPackageName, "/usr/share/applications/{}.desktop".format(apkPackageNameNew))
|
||||||
|
desktopFile = '''[Desktop Entry]
|
||||||
|
Categories=Other;
|
||||||
|
Exec=uengine launch --action=android.intent.action.MAIN --package={} --component={}
|
||||||
|
Icon=/usr/share/uengine/icons/{}.png
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
GenericName={}
|
||||||
|
Name={}
|
||||||
|
'''
|
||||||
|
# RunCommandShow("echo '{}' > '{}/DEBIAN/control'".format(debControl, tempPath))
|
||||||
|
#RunCommandShow("echo 正在写入文件:'{}/DEBIAN/control'".format(tempPath))
|
||||||
|
File("{}/DEBIAN/control".format(tempPath)).write(debControl)
|
||||||
|
#RunCommandShow("echo 正在写入文件:'{}/DEBIAN/postinst'".format(tempPath))
|
||||||
|
File("{}/DEBIAN/postinst".format(tempPath)).write(debPostinst)
|
||||||
|
#RunCommandShow("echo 正在写入文件:'{}/DEBIAN/prerm'".format(tempPath))
|
||||||
|
File("{}/DEBIAN/prerm".format(tempPath)).write(debPrerm)
|
||||||
|
#RunCommandShow("echo 正在写入文件:'/usr/share/applications/{}.desktop'".format(apkPackageNameNew))
|
||||||
|
# write_txt("{}/usr/share/applications/{}.desktop".format(tempPath, apkPackageNameNew), desktopFile)
|
||||||
|
self.saveDesktopFile("{}/usr/share/applications/{}.desktop".format(tempPath, apkPackageNameNew),
|
||||||
|
"{}/usr/share/uengine/icons/{}.png".format(tempPath, apkPackageNameNew))
|
||||||
|
#BuildUengineDesktop(apkPackageName, apkActivityName, apkChineseLabel,
|
||||||
|
# "/usr/share/uengine/icons/{}.png".format(apkPackageNameNew),
|
||||||
|
# "{}/usr/share/applications/{}.desktop".format(tempPath, apkPackageNameNew))
|
||||||
|
#RunCommandShow("echo '复制文件'")
|
||||||
|
#RunCommandShow("echo '写入 APK 软件图标'")
|
||||||
|
#SaveApkIcon(apkPath, iconSavePath)
|
||||||
|
self.saveApkIcon(iconSavePath)
|
||||||
|
#RunCommandShow("echo '复制 APK 文件'")
|
||||||
|
shutil.copy(self.apkPath, "{}/usr/share/uengine/apk/{}.apk".format(tempPath, apkPackageNameNew))
|
||||||
|
#RunCommandShow("cp -rv '{}' '{}/usr/share/uengine/apk/{}.apk'".format(apkPath, tempPath, apkPackageNameNew))
|
||||||
|
#RunCommandShow("echo '正在设置文件权限……'")
|
||||||
|
os.system("chmod 0775 -vR '{}/DEBIAN/postinst'".format(tempPath))
|
||||||
|
os.system("chmod 0775 -vR '{}/DEBIAN/prerm'".format(tempPath))
|
||||||
|
#RunCommandShow("echo '打包 deb 到桌面……'")
|
||||||
|
os.system(
|
||||||
|
"dpkg -b '{}' '{}'".format(tempPath, savePath))
|
||||||
|
#RunCommandShow("echo '正在删除临时目录……'")
|
||||||
|
#shutil.rmtree(tempPath)
|
||||||
|
#RunCommandShow("rm -rfv '{}'".format(tempPath))
|
||||||
|
#RunCommandShow("echo '完成!'")
|
||||||
|
#findApkHistory.append(apkPath)
|
||||||
|
#combobox1['value'] = findApkHistory
|
||||||
|
#write_txt(get_home() + "/.config/uengine-runner/FindApkBuildHistory.json",
|
||||||
|
# str(json.dumps(ListToDictionary(findApkHistory)))) # 将历史记录的数组转换为字典并写入
|
||||||
|
#messagebox.showinfo(title="提示", message="打包完成")
|
||||||
|
#DisabledAndEnbled(False)
|
||||||
|
|
||||||
|
|
||||||
|
class UEngine:
|
||||||
|
def UengineAppManager():
|
||||||
|
os.system("uengine launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity")
|
||||||
|
def OpenApp(appPackage, appActivity):
|
||||||
|
os.system("uengine launch --package={} --component={}".format(appPackage, appActivity))
|
||||||
|
# 清空 uengine 数据
|
||||||
|
def UengineDataClean() -> "清空 uengine 数据":
|
||||||
|
shutil.rmtree("{}/.local/share/applications/uengine/".format(ProgramInformation.home))
|
||||||
|
shutil.rmtree("/data/uengine")
|
||||||
|
def RemoveUengineCheck():
|
||||||
|
os.remove("/usr/share/uengine/uengine-check-runnable.sh")
|
||||||
|
def CPUCheck():
|
||||||
|
return subprocess.getoutput("uengine check-features")
|
||||||
|
def BuildUengineRootImage():
|
||||||
|
os.system(ProgramInformation.programPath + "/root-uengine.sh")
|
||||||
|
def OpenUengineRootData():
|
||||||
|
os.system("xdg-open /data/uengine/data/data")
|
||||||
|
def InstallRootUengineImage():
|
||||||
|
if not os.path.exists:
|
||||||
|
os.mkdir("/tmp/uengine-runner")
|
||||||
|
File("/tmp/uengine-runner/install.sh").write("sudo dpkg -i /tmp/uengine-runner/u*.deb\nsudo apt install -f")
|
||||||
|
os.system("wget -P '/tmp/uengine-runner' 'https://hub.fastgit.org/gfdgd-xi/uengine-runner/releases/download/U1.2.15/uengine-android-image_1.2.15_amd64.deb' && pkexec bash '/tmp/uengine-runner/install.sh'")
|
||||||
|
class Services:
|
||||||
|
def Open():
|
||||||
|
os.system("pkexec systemctl enable uengine-container uengine-session && systemctl start uengine-container uengine-session")
|
||||||
|
def Close():
|
||||||
|
os.system("pkexec systemctl disable uengine-container uengine-session")
|
||||||
|
def Restart():
|
||||||
|
os.system("pkexec systemctl restart uengine*")
|
||||||
|
class InternetBridge:
|
||||||
|
def Open():
|
||||||
|
os.system("pkexec uengine-bridge.sh start")
|
||||||
|
def Close():
|
||||||
|
os.system("pkexec uengine-bridge.sh stop")
|
||||||
|
def Restart():
|
||||||
|
os.system("pkexec uengine-bridge.sh restart")
|
||||||
|
def Reload():
|
||||||
|
os.system("pkexec uengine-bridge.sh reload")
|
||||||
|
def ForceReload():
|
||||||
|
os.system("pkexec uengine-bridge.sh force-reload")
|
||||||
|
|
||||||
|
class Adb:
|
||||||
|
class Service:
|
||||||
|
def Open():
|
||||||
|
os.system("adb start-server")
|
||||||
|
def Close():
|
||||||
|
os.system("adb kill-server")
|
||||||
|
def Kill():
|
||||||
|
os.system("killall adb")
|
||||||
|
|
||||||
|
class File:
|
||||||
|
def __init__(self, filePath):
|
||||||
|
self.filePath = filePath
|
||||||
|
def read(self):
|
||||||
|
f = open(self.filePath, "r") # 设置文件对象
|
||||||
|
str = f.read() # 获取内容
|
||||||
|
f.close() # 关闭文本对象
|
||||||
|
return str # 返回结果
|
||||||
|
def write(self, things) -> "写入文本文档":
|
||||||
|
TxtDir = os.path.dirname(self.filePath)
|
||||||
|
print(TxtDir)
|
||||||
|
if not os.path.exists(TxtDir):
|
||||||
|
os.makedirs(TxtDir, exist_ok=True)
|
||||||
|
file = open(self.filePath, 'w', encoding='UTF-8') # 设置文件对象
|
||||||
|
file.write(things) # 写入文本
|
||||||
|
file.close() # 关闭文本对象
|
||||||
|
|
||||||
|
class UengineRunner:
|
||||||
|
def CleanHistory():
|
||||||
|
shutil.rmtree(ProgramInformation.home + "/.config/uengine-runner")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print("本 API 不支持直接运行,请通过引入的方式使用此 API")
|
||||||
|
quit()
|
||||||
|
|
||||||
|
if not ROOT.GetRoot():
|
||||||
|
print("请获取 ROOT 权限以便更好的使用该 API")
|
||||||
BIN
api/__pycache__/getxmlimg.cpython-37.pyc
Normal file
BIN
api/defult.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
118
api/getxmlimg.py
Executable file
@@ -0,0 +1,118 @@
|
|||||||
|
import PIL.Image as Image
|
||||||
|
import PIL.ImageDraw as ImageDraw
|
||||||
|
import zipfile
|
||||||
|
import subprocess
|
||||||
|
import re
|
||||||
|
|
||||||
|
class getsavexml():
|
||||||
|
|
||||||
|
def savexml(self,apkFilePath,xmlpath,iconSavePath):
|
||||||
|
cmddumpid = "aapt dump xmltree "+ apkFilePath + " " + xmlpath
|
||||||
|
print(cmddumpid)
|
||||||
|
xmltree = subprocess.getoutput(cmddumpid)
|
||||||
|
xmls = xmltree.splitlines()
|
||||||
|
# find strs ,print next line
|
||||||
|
def FindStrs(lines,strs):
|
||||||
|
i=0
|
||||||
|
while i < len(lines):
|
||||||
|
if re.search(strs,lines[i]):
|
||||||
|
tmpstr = lines[i+1]
|
||||||
|
i += 1
|
||||||
|
Resultstr = tmpstr.split(":")[-1].split("=")[-1].split("0x")[-1]
|
||||||
|
return Resultstr
|
||||||
|
else:
|
||||||
|
i += 1
|
||||||
|
#从apk的信息中获取前后景图片的ID号
|
||||||
|
backimgid = FindStrs(xmls,"background")
|
||||||
|
foreimgid = FindStrs(xmls,"foreground")
|
||||||
|
print(backimgid)
|
||||||
|
print(foreimgid)
|
||||||
|
|
||||||
|
# 直接从apk resource文件获取前后两层图片路径及ID字符串
|
||||||
|
resource = subprocess.getoutput("aapt dump --values resources " + apkFilePath + "| grep -iE -A1 " + "\"" + backimgid + "|" + foreimgid + "\"")
|
||||||
|
resourcelines = resource.splitlines()
|
||||||
|
print(resourcelines)
|
||||||
|
|
||||||
|
# 从过滤出的字符串中获取所有相同ID的图片路径
|
||||||
|
def Findpicpath(lines,imgid):
|
||||||
|
i=0
|
||||||
|
Resultstr = []
|
||||||
|
while i < len(lines):
|
||||||
|
if re.search(imgid,lines[i]) and re.search("string8",lines[i+1]) :
|
||||||
|
print(lines[i+1])
|
||||||
|
tmpstr = lines[i+1].replace("\"","")
|
||||||
|
i += 1
|
||||||
|
Resultstr.append(tmpstr.split()[-1])
|
||||||
|
else:
|
||||||
|
i += 1
|
||||||
|
return Resultstr
|
||||||
|
|
||||||
|
#获取所有带前后图片ID的图片路径(相同背景或者前景的图片ID但分辨率不一样)
|
||||||
|
backimgs = Findpicpath(resourcelines,backimgid)
|
||||||
|
foreimgs = Findpicpath(resourcelines,foreimgid)
|
||||||
|
print(backimgs)
|
||||||
|
print(foreimgs)
|
||||||
|
#获取分辨率最高的图片路径
|
||||||
|
def getmaxsize(imgs):
|
||||||
|
j = 0
|
||||||
|
size=(0,0)
|
||||||
|
zipapk = zipfile.ZipFile(apkFilePath)
|
||||||
|
imgpath = ""
|
||||||
|
while j < len(imgs):
|
||||||
|
print(imgs[j])
|
||||||
|
img = Image.open(zipapk.open(imgs[j]))
|
||||||
|
print(imgs[j])
|
||||||
|
print(img.size)
|
||||||
|
if size < img.size:
|
||||||
|
size = img.size
|
||||||
|
imgpath = imgs[j]
|
||||||
|
j += 1
|
||||||
|
return imgpath
|
||||||
|
|
||||||
|
# 获取到文件列表后,进行比较分辨率,选取分辨率最高的张图片
|
||||||
|
iconbackpath = getmaxsize(backimgs)
|
||||||
|
iconforepath = getmaxsize(foreimgs)
|
||||||
|
print(iconbackpath + " " + iconforepath)
|
||||||
|
|
||||||
|
#从APK文件获取最终图片
|
||||||
|
zipapk = zipfile.ZipFile(apkFilePath)
|
||||||
|
iconback = zipapk.open(iconbackpath)
|
||||||
|
iconfore = zipapk.open(iconforepath)
|
||||||
|
|
||||||
|
|
||||||
|
# 叠加图片,mask 设置前景为蒙版
|
||||||
|
iconbackimg = Image.open(iconback).convert("RGBA")
|
||||||
|
iconforeimg = Image.open(iconfore).convert("RGBA")
|
||||||
|
iconbackimg.paste(iconforeimg,mask=iconforeimg)
|
||||||
|
|
||||||
|
|
||||||
|
# 圆角图片函数,网上拷贝的
|
||||||
|
def circle_corner(img, radii): #把原图片变成圆角,这个函数是从网上找的,原址 https://www.pyget.cn/p/185266
|
||||||
|
"""
|
||||||
|
圆角处理
|
||||||
|
:param img: 源图象。
|
||||||
|
:param radii: 半径,如:30。
|
||||||
|
:return: 返回一个圆角处理后的图象。
|
||||||
|
"""
|
||||||
|
# 画圆(用于分离4个角)
|
||||||
|
circle = Image.new('L', (radii * 2, radii * 2), 0) # 创建一个黑色背景的画布
|
||||||
|
draw = ImageDraw.Draw(circle)
|
||||||
|
draw.ellipse((0, 0, radii * 2, radii * 2), fill=255) # 画白色圆形
|
||||||
|
# 原图
|
||||||
|
img = img.convert("RGBA")
|
||||||
|
w, h = img.size
|
||||||
|
# 画4个角(将整圆分离为4个部分)
|
||||||
|
alpha = Image.new('L', img.size, 255)
|
||||||
|
alpha.paste(circle.crop((0, 0, radii, radii)), (0, 0)) # 左上角
|
||||||
|
alpha.paste(circle.crop((radii, 0, radii * 2, radii)), (w - radii, 0)) # 右上角
|
||||||
|
alpha.paste(circle.crop((radii, radii, radii * 2, radii * 2)), (w - radii, h - radii)) # 右下角
|
||||||
|
alpha.paste(circle.crop((0, radii, radii, radii * 2)), (0, h - radii)) # 左下角
|
||||||
|
# alpha.show()
|
||||||
|
img.putalpha(alpha) # 白色区域透明可见,黑色区域不可见
|
||||||
|
return img
|
||||||
|
|
||||||
|
# 圆角半径1/8边长,保存icon图片
|
||||||
|
w,h = iconbackimg.size
|
||||||
|
iconimg = circle_corner(iconbackimg,int(w/8))
|
||||||
|
iconimg.save(iconSavePath)
|
||||||
|
|
||||||
76
api/root-uengine.sh
Executable file
@@ -0,0 +1,76 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#sudo apt install squashfs-tools
|
||||||
|
|
||||||
|
mkdir -p ~/temp
|
||||||
|
cd ~/temp
|
||||||
|
echo "正在下载supersu"
|
||||||
|
aria2c -x 16 -s 16 -d ~/temp http://supersuroot.org/downloads/SuperSU-v2.82-201705271822.zip
|
||||||
|
cd ..
|
||||||
|
mkdir -p ~/temp/work/dabao/extract/DEBIAN
|
||||||
|
echo "正在解压supersu"
|
||||||
|
unzip ~/temp/SuperSU-v2.82-201705271822.zip -d ~/temp/work/su
|
||||||
|
WORKDIR=~/temp/work
|
||||||
|
cd "$WORKDIR"
|
||||||
|
echo "正在下载uengine-android-image"
|
||||||
|
apt download uengine-android-image
|
||||||
|
echo "正在解压uengine-android-image"
|
||||||
|
cd dabao
|
||||||
|
dpkg-deb -x $WORKDIR/uengine-android-image*.deb extract/
|
||||||
|
dpkg-deb -e $WORKDIR/uengine-android-image*.deb extract/DEBIAN
|
||||||
|
cd ..
|
||||||
|
cp dabao/extract/usr/share/uengine/android.img android.img
|
||||||
|
|
||||||
|
echo "正在解压android镜像"
|
||||||
|
sudo unsquashfs android.img
|
||||||
|
|
||||||
|
sudo mkdir -p ./squashfs-root/system/app/SuperSU
|
||||||
|
sudo mkdir -p ./squashfs-root/system/bin/.ext/
|
||||||
|
|
||||||
|
echo "正在将supersu安装到android镜像"
|
||||||
|
sudo cp ./su/common/Superuser.apk ./squashfs-root/system/app/SuperSU/SuperSU.apk
|
||||||
|
sudo cp ./su/common/install-recovery.sh ./squashfs-root/system/etc/install-recovery.sh
|
||||||
|
sudo cp ./su/common/install-recovery.sh ./squashfs-root/system/bin/install-recovery.sh
|
||||||
|
sudo cp ./su/x64/su ./squashfs-root/system/xbin/su
|
||||||
|
sudo cp ./su/x64/su ./squashfs-root/system/bin/.ext/.su
|
||||||
|
sudo cp ./su/x64/su ./squashfs-root/system/xbin/daemonsu
|
||||||
|
sudo cp ./su/x64/supolicy ./squashfs-root/system/xbin/supolicy
|
||||||
|
sudo cp ./su/x64/libsupol.so ./squashfs-root/system/lib64/libsupol.so
|
||||||
|
sudo cp ./squashfs-root/system/bin/app_process64 ./squashfs-root/system/bin/app_process_init
|
||||||
|
sudo cp ./squashfs-root/system/bin/app_process64 ./squashfs-root/system/bin/app_process64_original
|
||||||
|
sudo cp ./squashfs-root/system/xbin/daemonsu ./squashfs-root/system/bin/app_process
|
||||||
|
sudo cp ./squashfs-root/system/xbin/daemonsu ./squashfs-root/system/bin/app_process64
|
||||||
|
|
||||||
|
sudo chmod +x ./squashfs-root/system/app/SuperSU/SuperSU.apk
|
||||||
|
sudo chmod +x ./squashfs-root/system/etc/install-recovery.sh
|
||||||
|
sudo chmod +x ./squashfs-root/system/bin/install-recovery.sh
|
||||||
|
sudo chmod +x ./squashfs-root/system/xbin/su
|
||||||
|
sudo chmod +x ./squashfs-root/system/bin/.ext/.su
|
||||||
|
sudo chmod +x ./squashfs-root/system/xbin/daemonsu
|
||||||
|
sudo chmod +x ./squashfs-root/system/xbin/supolicy
|
||||||
|
sudo chmod +x ./squashfs-root/system/lib64/libsupol.so
|
||||||
|
sudo chmod +x ./squashfs-root/system/bin/app_process_init
|
||||||
|
sudo chmod +x ./squashfs-root/system/bin/app_process64_original
|
||||||
|
sudo chmod +x ./squashfs-root/system/bin/app_process
|
||||||
|
sudo chmod +x ./squashfs-root/system/bin/app_process64
|
||||||
|
|
||||||
|
echo "正在打包android镜像"
|
||||||
|
sudo rm android.img
|
||||||
|
sudo mksquashfs squashfs-root android.img -b 131072 -comp xz -Xbcj ia64
|
||||||
|
|
||||||
|
|
||||||
|
cp android.img dabao/extract/usr/share/uengine/android.img
|
||||||
|
|
||||||
|
echo "正在打包uengine-android-image"
|
||||||
|
cd dabao/extract
|
||||||
|
find usr -type f -print0 |xargs -0 md5sum >md5sums
|
||||||
|
cd ..
|
||||||
|
mkdir build
|
||||||
|
dpkg-deb -b extract/ build/
|
||||||
|
|
||||||
|
cp build/*.deb ~/
|
||||||
|
|
||||||
|
echo "正在清理垃圾"
|
||||||
|
sudo rm -rf ~/temp
|
||||||
|
|
||||||
|
echo "已在用户主目录生成新的安装包,安装后重启即可生效"
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
Package: spark-uengine-runner
|
Package: spark-uengine-runner
|
||||||
Version: 1.5.3
|
Version: 1.6.1
|
||||||
Maintainer: gfdgd xi <3025613752@qq.com>, actionchen<917981399@qq.com>
|
Maintainer: gfdgd xi <3025613752@qq.com>, actionchen<917981399@qq.com>, 柚子<https://gitee.com/Limexb>, 为什么您不喜欢熊出没和阿布呢<https://weibo.com/u/7755040136>, 星空露光<https://gitee.com/Cynorkyle>
|
||||||
Homepage: [https://gitee.com/gfdgd-xi/uengine-runner, https://github.com/gfdgd-xi/uengine-runner]
|
Homepage: [https://gitee.com/gfdgd-xi/uengine-runner, https://github.com/gfdgd-xi/uengine-runner]
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Conflicts: com.gitee.uengine.runner.spark, spark-uengine-apk-builder
|
Conflicts: com.gitee.uengine.runner.spark, spark-uengine-apk-builder
|
||||||
Depends: python3, python3-tk, python3-pip, aapt, uengine, python3-setuptools, deepin-terminal, curl, python3-pil, python3-pil.imagetk, python3-requests, adb, translate-shell, python3-xlib
|
Depends: python3, python3-tk, python3-pip, aapt, uengine, python3-setuptools, deepin-terminal, curl, python3-pil, python3-pil.imagetk, python3-requests, adb, translate-shell, python3-xlib, fonts-noto-cjk, python3-numpy, python3-matplotlib, wget, inotify-tools, aria2
|
||||||
Description: UEngine Runner for deepin and UOS
|
Description: UEngine Runner for deepin and UOS
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# 安装所需库
|
# 安装所需库
|
||||||
|
python3 -m pip install --upgrade pip -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
||||||
python3 -m pip install --upgrade ttkthemes -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
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 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 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
|
python3 -m pip install --upgrade easygui -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
||||||
# 刷新图标缓存
|
# 刷新图标缓存
|
||||||
gtk-update-icon-cache /usr/share/icons/bloom
|
gtk-update-icon-cache /usr/share/icons/bloom
|
||||||
# 向服务器返回安装数加1(不显示内容且忽略错误)
|
# 向服务器返回安装数加1(不显示内容且忽略错误)
|
||||||
curl http://120.25.153.144/uengine-runner/Install.php?Version=1.5.3 -s > /dev/null | true
|
curl http://120.25.153.144/uengine-runner/Install.php?Version=1.6.1 -s > /dev/null | true
|
||||||
BIN
build/opt/apps/uengine-runner/Help/1-1-1.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-1-2.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-1-3.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-1-4.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-1-5.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-2-1.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-2-2.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-3-1.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-4-1.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-5-1.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-5-2.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-6-1.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-6-2.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-6-3.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-7-1.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-8-1.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-9-1.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-9-2.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-9-3.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-9-4.png
Normal file
|
After Width: | Height: | Size: 115 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-9-5.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-9-6.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
build/opt/apps/uengine-runner/Help/1-9-7.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
165
build/opt/apps/uengine-runner/Help/index.html
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
|
||||||
|
<title>index</title>
|
||||||
|
</head>
|
||||||
|
<body><h1 id='uengine-运行器帮助'>UEngine 运行器帮助</h1>
|
||||||
|
<hr />
|
||||||
|
<h2 id='帮助简述'>帮助简述</h2>
|
||||||
|
<blockquote><p>安装APK:点浏览按钮,选中需要安装的APK,然后点安装按钮<br/>卸载APK:在卸载APK下面的输入框内输入需要卸载的APK包名,点卸载按钮,如果无法获取包名,可以通过浏览APK文件程序自动获取包名进行卸载。<br/>保存APK图标:在安装APK下面的输入框浏览或输入APK的路径,然后点击“保存图标”按钮,选择保存位置即可<br/>重置(删除)UEngine数据:点击菜单栏的“UEngine”的“清空UEngine数据”,输入密码重启即可<br/>注意:如果任何安卓一遍打不开,多打开几遍应该就可以重新加载UEngine配置了<br/>打开UEngine应用列表:打开系统已安装的应用列表(安卓界面)<br/><strong>提示:</strong> <br/><strong>※1、近期升级的 UEngine 安装时会自动把要安装的 apk 删除,如果这个 apk 文件非常重要请拷贝一个备份版并安装这个备份版</strong> <br/><strong>2、需要你有使用 root 权限的能力;</strong><br/><strong>3、需要安装 UEngine 才能使用;</strong><br/><strong>4、提取 apk 图标的 apk 路径以“安装 apk”那栏为准;</strong><br/><strong>5、如果想要使用adb连接UEngine或其他手机,请使用 1.2.0 以前的版本。(如需连接UEngine请安装adb补丁)</strong> </p>
|
||||||
|
</blockquote>
|
||||||
|
<hr />
|
||||||
|
<h2 id='详细帮助'>详细帮助</h2>
|
||||||
|
<h3 id='如何安装自己的-apk'>如何安装自己的 Apk</h3>
|
||||||
|
<p><em>请保证您已经把要安装的Apk下载到电脑本地并保证Apk完整且有权限</em></p>
|
||||||
|
<h4 id='方法一-1'>方法一</h4>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 <br/><img src="1-1-1.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击浏览按钮,找到想要安装的Apk<br/><img src="1-1-2.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击安装按钮,输入密码
|
||||||
|
<img src="1-1-3.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>提示“操作完成”,在启动器找到新安装的图标启动即可<br/><img src="1-1-4.png" referrerpolicy="no-referrer"><br/><img src="1-1-5.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<h4 id='方法二-1'>方法二</h4>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开要安装的Apk所在目录,右击=>打开方式=>安装或卸载 APK(UEngine 运行器)<br/><img src="1-2-1.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击安装按钮,输入密码<br/><img src="1-1-3.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>提示“操作完成”,在启动器找到新安装的图标启动即可<br/><img src="1-1-4.png" referrerpolicy="no-referrer"><br/><img src="1-2-2.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<h3 id='卸载apk'>卸载Apk</h3>
|
||||||
|
<h4 id='方法一-2'>方法一</h4>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 <br/><img src="1-1-1.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击浏览按钮,找到想要卸载的Apk<br/><img src="1-1-2.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击卸载按钮,输入密码<br/><img src="1-1-3.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>提示“操作完成”,卸载完成 <br/><img src="1-1-4.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<h4 id='方法二-2'>方法二</h4>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开要安装的Apk所在目录,右击=>打开方式=>安装或卸载 APK(UEngine 运行器)<br/><img src="1-2-1.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击卸载按钮,输入密码<br/><img src="1-1-3.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>提示“操作完成”,卸载完成<br/><img src="1-1-4.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<h3 id='查询apk信息'>查询Apk信息</h3>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 <br/><img src="1-1-1.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击“Apk 信息” 按钮即可查询Apk信息</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-3-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h3 id='查看程序评分'>查看程序评分</h3>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 <br/><img src="1-1-1.png" referrerpolicy="no-referrer"> </li>
|
||||||
|
<li>点击“Apk 信息” 按钮即可查询Apk信息
|
||||||
|
<img src="1-3-1.png" referrerpolicy="no-referrer"></li>
|
||||||
|
<li>点击“查看程序评分情况”即可查看其他用户对程序的评分</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-4-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h3 id='上传用户评分'>上传用户评分</h3>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 </li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-1-1.png" referrerpolicy="no-referrer"> </p>
|
||||||
|
<ol start='2' >
|
||||||
|
<li>点击“Apk 信息” 按钮即可查询Apk信息</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-3-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='3' >
|
||||||
|
<li>点击“上传程序评分情况”,按照要求进行评分</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-5-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='4' >
|
||||||
|
<li>如果提示“提交成功!感谢您的提交”就代表评分成功</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-5-2.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h3 id='更新程序'>更新程序</h3>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 </li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-1-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='2' >
|
||||||
|
<li>点击“关于”=>“检查更新”,打开更新窗口</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-6-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='3' >
|
||||||
|
<li><strong>保证您的电脑没有运行其它Python应用以及本程序所有工作都已经完成</strong>,再点击“更新(更新过程中会关闭所有Python应用,包括这个应用)”,输入密码以进行更新</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-6-2.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='4' >
|
||||||
|
<li>提示“更新完毕!”后重新启动 UEngine 运行器就更新完毕了</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-6-3.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h3 id='保存图标'>保存图标</h3>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 </li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-1-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='2' >
|
||||||
|
<li>选择要保存图标的Apk,点击“保存图标”按钮,选择要保存的位置即可</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-7-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h3 id='打开已安装的程序列表'>打开已安装的程序列表</h3>
|
||||||
|
<h4 id='方法一-3'>方法一</h4>
|
||||||
|
<p>打开启动器=>UEngine 程序菜单 即可</p>
|
||||||
|
<h4 id='方法二-3'>方法二</h4>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开 UEngine 运行器 <br/><img src="1-1-1.png" referrerpolicy="no-referrer"></li>
|
||||||
|
<li>点击“打开 UEngine 应用列表”即可</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-8-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h3 id='将-apk-打包成可以无需本应用即可安装的-deb-包'>将 Apk 打包成可以无需本应用即可安装的 deb 包</h3>
|
||||||
|
<h4 id='打开-uengine-打包器的三种方法'>打开 UEngine 打包器的三种方法</h4>
|
||||||
|
<h5 id='方法一-4'>方法一</h5>
|
||||||
|
<p>启动器=>UEngine 应用打包器</p>
|
||||||
|
<h5 id='方法二-4'>方法二</h5>
|
||||||
|
<p>打开要打包的 Apk 所在目录,右击=>“打开方式”=>“打包 deb(UEngine 运行器)”(接下来可以略过步骤一)</p>
|
||||||
|
<p><img src="1-9-1.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h5 id='方式三'>方式三</h5>
|
||||||
|
<p>打开 UEngine 运行器,点击菜单栏的“UEngine”=>“UEngine 应用打包”</p>
|
||||||
|
<p><img src="1-9-2.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<h4 id='打包-deb'>打包 deb</h4>
|
||||||
|
<ol start='' >
|
||||||
|
<li>打开“UEngine Apk 应用打包器”,点击“浏览按钮”选择apk</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-9-3.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='2' >
|
||||||
|
<li>根据实际情况勾选选项,然后点击“打包”进行打包</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-9-4.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<ol start='3' >
|
||||||
|
<li>当提示“打包完成”时,打包完成,可以在桌面(一般是<code>/home/XXX/Desktop</code>)找到您打包的 deb 包,可以双击安装</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
<p> <img src="1-9-5.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<p> <img src="1-9-6.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<p> <img src="1-9-7.png" referrerpolicy="no-referrer"></p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> </p>
|
||||||
|
<p> ©2021-2022</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
193
build/opt/apps/uengine-runner/Help/index.md
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
# UEngine 运行器帮助
|
||||||
|
---
|
||||||
|
## 帮助简述
|
||||||
|
> 安装APK:点浏览按钮,选中需要安装的APK,然后点安装按钮
|
||||||
|
> 卸载APK:在卸载APK下面的输入框内输入需要卸载的APK包名,点卸载按钮,如果无法获取包名,可以通过浏览APK文件程序自动获取包名进行卸载。
|
||||||
|
> 保存APK图标:在安装APK下面的输入框浏览或输入APK的路径,然后点击“保存图标”按钮,选择保存位置即可
|
||||||
|
> 重置(删除)UEngine数据:点击菜单栏的“UEngine”的“清空UEngine数据”,输入密码重启即可
|
||||||
|
> 注意:如果任何安卓一遍打不开,多打开几遍应该就可以重新加载UEngine配置了
|
||||||
|
> 打开UEngine应用列表:打开系统已安装的应用列表(安卓界面)
|
||||||
|
> **提示:**
|
||||||
|
> **※1、近期升级的 UEngine 安装时会自动把要安装的 apk 删除,如果这个 apk 文件非常重要请拷贝一个备份版并安装这个备份版**
|
||||||
|
> **2、需要你有使用 root 权限的能力;**
|
||||||
|
> **3、需要安装 UEngine 才能使用;**
|
||||||
|
> **4、提取 apk 图标的 apk 路径以“安装 apk”那栏为准;**
|
||||||
|
> **5、如果想要使用adb连接UEngine或其他手机,请使用 1.2.0 以前的版本。(如需连接UEngine请安装adb补丁)**
|
||||||
|
|
||||||
|
---
|
||||||
|
## 详细帮助
|
||||||
|
### 如何安装自己的 Apk
|
||||||
|
*请保证您已经把要安装的Apk下载到电脑本地并保证Apk完整且有权限*
|
||||||
|
#### 方法一
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|

|
||||||
|
2. 点击浏览按钮,找到想要安装的Apk
|
||||||
|

|
||||||
|
3. 点击安装按钮,输入密码
|
||||||
|

|
||||||
|
4. 提示“操作完成”,在启动器找到新安装的图标启动即可
|
||||||
|

|
||||||
|

|
||||||
|
#### 方法二
|
||||||
|
1. 打开要安装的Apk所在目录,右击=>打开方式=>安装或卸载 APK(UEngine 运行器)
|
||||||
|

|
||||||
|
2. 点击安装按钮,输入密码
|
||||||
|

|
||||||
|
3. 提示“操作完成”,在启动器找到新安装的图标启动即可
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
### 卸载Apk
|
||||||
|
#### 方法一
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|

|
||||||
|
2. 点击浏览按钮,找到想要卸载的Apk
|
||||||
|

|
||||||
|
3. 点击卸载按钮,输入密码
|
||||||
|

|
||||||
|
4. 提示“操作完成”,卸载完成
|
||||||
|

|
||||||
|
#### 方法二
|
||||||
|
1. 打开要安装的Apk所在目录,右击=>打开方式=>安装或卸载 APK(UEngine 运行器)
|
||||||
|

|
||||||
|
2. 点击卸载按钮,输入密码
|
||||||
|

|
||||||
|
3. 提示“操作完成”,卸载完成
|
||||||
|

|
||||||
|
|
||||||
|
### 查询Apk信息
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|

|
||||||
|
|
||||||
|
2. 点击“Apk 信息” 按钮即可查询Apk信息
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 查看程序评分
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|

|
||||||
|
|
||||||
|
2. 点击“Apk 信息” 按钮即可查询Apk信息
|
||||||
|

|
||||||
|
|
||||||
|
3. 点击“查看程序评分情况”即可查看其他用户对程序的评分
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 上传用户评分
|
||||||
|
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
2. 点击“Apk 信息” 按钮即可查询Apk信息
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. 点击“上传程序评分情况”,按照要求进行评分
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
4. 如果提示“提交成功!感谢您的提交”就代表评分成功
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 更新程序
|
||||||
|
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
2. 点击“关于”=>“检查更新”,打开更新窗口
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. **保证您的电脑没有运行其它Python应用以及本程序所有工作都已经完成**,再点击“更新(更新过程中会关闭所有Python应用,包括这个应用)”,输入密码以进行更新
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
4. 提示“更新完毕!”后重新启动 UEngine 运行器就更新完毕了
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 保存图标
|
||||||
|
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
2. 选择要保存图标的Apk,点击“保存图标”按钮,选择要保存的位置即可
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 打开已安装的程序列表
|
||||||
|
|
||||||
|
#### 方法一
|
||||||
|
|
||||||
|
打开启动器=>UEngine 程序菜单 即可
|
||||||
|
|
||||||
|
#### 方法二
|
||||||
|
|
||||||
|
1. 打开 UEngine 运行器
|
||||||
|

|
||||||
|
|
||||||
|
2. 点击“打开 UEngine 应用列表”即可
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 将 Apk 打包成可以无需本应用即可安装的 deb 包
|
||||||
|
|
||||||
|
#### 打开 UEngine 打包器的三种方法
|
||||||
|
|
||||||
|
##### 方法一
|
||||||
|
|
||||||
|
启动器=>UEngine 应用打包器
|
||||||
|
|
||||||
|
##### 方法二
|
||||||
|
|
||||||
|
打开要打包的 Apk 所在目录,右击=>“打开方式”=>“打包 deb(UEngine 运行器)”(接下来可以略过步骤一)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
##### 方式三
|
||||||
|
|
||||||
|
打开 UEngine 运行器,点击菜单栏的“UEngine”=>“UEngine 应用打包”
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
#### 打包 deb
|
||||||
|
|
||||||
|
1. 打开“UEngine Apk 应用打包器”,点击“浏览按钮”选择apk
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
2. 根据实际情况勾选选项,然后点击“打包”进行打包
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. 当提示“打包完成”时,打包完成,可以在桌面(一般是`/home/XXX/Desktop`)找到您打包的 deb 包,可以双击安装
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
©2021-2022
|
||||||
@@ -18,7 +18,8 @@
|
|||||||
"Name": "程序",
|
"Name": "程序",
|
||||||
"Menu": [
|
"Menu": [
|
||||||
"清空软件历史记录",
|
"清空软件历史记录",
|
||||||
"退出程序"
|
"退出程序",
|
||||||
|
"程序设置"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -112,7 +113,9 @@
|
|||||||
"Menu": [
|
"Menu": [
|
||||||
"程序官网",
|
"程序官网",
|
||||||
"关于",
|
"关于",
|
||||||
"反馈程序问题和建议"
|
"反馈程序问题和建议",
|
||||||
|
"检查更新",
|
||||||
|
"更多帮助"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -152,7 +155,8 @@
|
|||||||
"Name": "Program",
|
"Name": "Program",
|
||||||
"Menu": [
|
"Menu": [
|
||||||
"Clean Program History",
|
"Clean Program History",
|
||||||
"Exit The Program"
|
"Exit The Program",
|
||||||
|
"Program Setting"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -246,7 +250,9 @@
|
|||||||
"Menu": [
|
"Menu": [
|
||||||
"Program WebSize",
|
"Program WebSize",
|
||||||
"Program Help",
|
"Program Help",
|
||||||
"Upload Problem And Advice"
|
"Upload Problem And Advice",
|
||||||
|
"ABout This Program",
|
||||||
|
"More Help"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
273
build/opt/apps/uengine-runner/README.md
Executable file
@@ -0,0 +1,273 @@
|
|||||||
|
# uengine 运行器 1.5.3
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
新版本Deepin/UOS发布后,可以在应用商店安装部分官方已适配的安卓应用,对爱好者来说,不能自己安装APK软件包始终差点意思,本程序可以为Deepin/UOS上的UEngine安卓运行环境安装自定义APK软件包,并能发送安装的APK包启动菜单到桌面或系统菜单。
|
||||||
|

|
||||||
|
(测试平台:UOS 家庭版 21.1,deepin 20.3,UOS 专业版 1040)
|
||||||
|
(自己美术功底太差,图标直接用 anbox 的了)
|
||||||
|
|
||||||
|
## 安装前必读
|
||||||
|
+ releases 里有两个 deb 包,**是一样的除了包名和打包标准不同**,**只能选择其中一个安装**,**两个都安装会产生冲突**,两个deb包的作用如下:
|
||||||
|
- 包名为`spark-uengine-runner`的,是旧包,按照**正常标准打包**,适用于从**星火应用商店安装**以及**从低版本(即1.3.2即以下版本升级上来的用户)升级**或者**之前就安装该版本的用户**甚至**想跨平台的用户**等等
|
||||||
|
- 包名为`com.gitee.uengine.runner.spark`的,是按照**deepin/UOS的标准打包的**,适用于**之前就安装该版本并升级上来的用户**以及**希望按照该方法打包的用户**等等
|
||||||
|
+ **近期升级的 UEngine 安装时会自动把要安装的 apk 删除**,如果这个 apk 文件非常重要请**拷贝一个备份版并安装这个备份版**
|
||||||
|
|
||||||
|
### 更新内容
|
||||||
|
#### V1.6.0(开学版,即将完成!!!)
|
||||||
|
##### 目前更新内容
|
||||||
|
**※1、更换了新的图标(暂未全部更新完成!)**
|
||||||
|
**※2、支持程序的评分和查看分数详情的功能(如果炸了我的服务器,这个就作废了)**
|
||||||
|
**※3、修复了在安装奇奇怪怪的安装包(如格式、标识不正确的)时的快捷方式图标为空以及快捷方式文本的变化**
|
||||||
|
**※4、添加更新功能,可以自行升级到最新版本(如果炸了我的服务器,这个就作废了)**
|
||||||
|
**※5、新增程序帮助**
|
||||||
|
6、新填彩蛋(在“关于”=>“关于”显示的窗口双击“关于”开启)(如果炸了我的服务器,这个就作废了)
|
||||||
|
|
||||||
|
#### V1.5.3(2021-12-12,DDUC11版):
|
||||||
|
##### 更新内容
|
||||||
|
**※1、修复了在 UOS 家庭版安装 apk 文件安装包信息为 None 的问题**
|
||||||
|
**※2、“添加/删除 UEngine 图标”窗口的写入按钮在目录**`~/.local/share/icons/hicolor/256x256/apps`**不存在时点击无反应,参考报错1.5.3-1**
|
||||||
|
**※3、修复了“UEngine APK 应用打包器”打包的deb包的.desktop文件的**`Icon`**和**`Exec`**字段有误的问题以及使用“使用前缀‘uengine-dc’”前缀的问题**
|
||||||
|
4、“UEngine APK 应用打包器”支持打包完后自动删除临时目录
|
||||||
|
5、“UEngine APK 应用打包器”以及“添加/删除 UEngine 图标”支持在运行出现错误时显示报错
|
||||||
|
##### 报错:
|
||||||
|
*1.5.3-1*
|
||||||
|
```bash
|
||||||
|
Exception in Tkinter callback
|
||||||
|
Traceback (most recent call last):
|
||||||
|
File "/usr/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
|
||||||
|
return self.func(*args)
|
||||||
|
File "/home/gfdgd_xi/Desktop/uengine-runner/main.py", line 865, in SaveDesktopLink
|
||||||
|
shutil.copy(programPath + "/defult.png", iconSavePath)
|
||||||
|
File "/usr/lib/python3.7/shutil.py", line 245, in copy
|
||||||
|
copyfile(src, dst, follow_symlinks=follow_symlinks)
|
||||||
|
File "/usr/lib/python3.7/shutil.py", line 121, in copyfile
|
||||||
|
with open(dst, 'wb') as fdst:
|
||||||
|
FileNotFoundError: [Errno 2] No such file or directory: '/home/gfdgd_xi/.local/share/icons/hicolor/256x256/apps/com.miHoYo.cloudgames.ys.png'
|
||||||
|
```
|
||||||
|
##### 截图
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.5.2(2021-11-28):
|
||||||
|
**※1、支持安装和构建带 Root 的 UEngine 的镜像**
|
||||||
|
2、更新了反馈链接
|
||||||
|

|
||||||
|
|
||||||
|
#### 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、修复在英语状态下启动器图标名称异常的问题
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.4.3(2021-09-11,开学第一版):
|
||||||
|
**※1、支持打包器打包的包名带前缀“uengine-dc”**
|
||||||
|
**※2、修复了两种情况可能导致程序卡住/出错无法继续运行的情况(配置文件夹不齐全和获取版本信息卡住两种情况)**
|
||||||
|
**※3、修改了 UEngine 打包器打包的应用包名可能有大写的情况**
|
||||||
|
4、支持一键使用 Scrcpy 连接 UEngine(①先安装 adb 破解补丁;②请确保是使用snap安装的 Scrcpy【目前只支持 snap 安装的 Scrcpy 进行连接】)
|
||||||
|
5、支持右键打包 apk
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.4.2(2021-08-30,快开学了):
|
||||||
|
**※1、添加adb破解补丁(用于可以让adb连接UEngine)并支持adb的部分操作;**
|
||||||
|
2、菜单栏的项目添加以及外观优化;
|
||||||
|
3、修复键盘映射无法添加新映射的问题并修改键盘映射启动方式;
|
||||||
|
4、把 uengine 改为 UEngine;
|
||||||
|
5、修改 pkexec 获取密码时显示的图标和文本;
|
||||||
|
6、添加了 UEngine 系统设置的快捷方式;
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.4.1(2021-08-26):
|
||||||
|
**※1、初步支持键盘映射**
|
||||||
|
2、修复新版包在发送uengine列表快捷方式时会提示找不到文件
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.4.0(2021-08-19):
|
||||||
|
**※1、添加新版打包方式(deepin打包方式);**
|
||||||
|
**※2、支持测试运行/创建/删除uengine图标;**
|
||||||
|
**※3、支持提取安装的apk;**
|
||||||
|
**※4、支持打包deb包;**
|
||||||
|
5、修改菜单栏布局;
|
||||||
|
6、支持打开uengine数据目录和用户数据目录;
|
||||||
|
7、程序信息保存到json,非直接写入程序本体;
|
||||||
|
8、更多命令操作;
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.3.2(2021-08-16):
|
||||||
|
**※1、支持uengine数据重置;**
|
||||||
|
**※2、支持修改uengine网络桥接的启动状态;**
|
||||||
|
**※3、支持右键安装/卸载;**
|
||||||
|
**※4、支持启用或禁用uengine;**
|
||||||
|
**※5、修复打包问题,不会出现“dpkg:警告:卸载spark-uengine-runner时,目录/opt/apps/uengine-runner非空,因而不会删除该目录”的错误;**
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.3.1(2021-08-12):
|
||||||
|
**※1、修复打包问题,防止部分用户安装出错的问题;**
|
||||||
|
**※2、修复了程序无法提取图标时可以提取默认图标使用;**
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.3.0(2021-08-08):
|
||||||
|
**※1、修改了界面布局;**
|
||||||
|
**※2、修复大多数新安装普通用户的路图标及启动菜单文件路径不存在导致安装APK报错的bugs;**
|
||||||
|
3、删除少量冗余代码,调整代码顺序;
|
||||||
|
4、支持提取 apk 图标。
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.2.3(2021-08-02):
|
||||||
|
1、调整部分控件名称;
|
||||||
|
2、调整界面布局及界面风格;
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.2.2(2021-07-11):
|
||||||
|
1、对程序错误的显示更加人性化;
|
||||||
|
2、对 icon 的获取方式进行了升级;
|
||||||
|
3、增加了注释、删除部分冗余代码。
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.2.1(2021-07-02):
|
||||||
|
**※1、进行了安装方式的修改(不使用 adb),修复原无法安装和卸载的问题;**
|
||||||
|
2、进行了部分优化;
|
||||||
|
3、进行了功能缩水;
|
||||||
|
4、修复 deb 打包错误。
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.2.0(2021-06-06):
|
||||||
|
1、支持安装自动添加快捷方式、卸载删除快捷方式;
|
||||||
|
2、支持使用包名或 APK 文件卸载程序;
|
||||||
|
3、支持查看安装的所有包名;
|
||||||
|
4、进行了部分优化
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.1.0(2021-05-30):
|
||||||
|
1、修改了因编写时出现的中、英文混用的情况
|
||||||
|
2、支持一键连接默认 IP
|
||||||
|
3、修复在不连接设备直接选择 apk 安装时会卡住的问题
|
||||||
|
4、修复在把“uengine 程序菜单”发送到桌面或启动器如果询问覆盖时点击取消会卡住的问题
|
||||||
|
5、修改了程序界面为白色调,不和标题栏冲突矛盾
|
||||||
|

|
||||||
|
|
||||||
|
#### V1.0.0(2021-05-29):
|
||||||
|

|
||||||
|
|
||||||
|
### 源码安装教程
|
||||||
|
按下 <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>T</kbd> 打开终端,按以下内容操作:
|
||||||
|
1. 安装所需依赖
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install deepin-elf-verify python3 python3-tk python3-pip
|
||||||
|
sudo apt install aapt uengine python3-setuptools deepin-terminal curl
|
||||||
|
sudo apt install python3-pil python3-pil.imagetk python3-requests adb
|
||||||
|
sudo apt install translate-shell python3-xlib python3-requests fonts-noto-cjk python3-numpy
|
||||||
|
python3 -m pip install pip -U
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 下载本程序
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://gitee.com/gfdgd-xi/uengine-runner.git
|
||||||
|
```
|
||||||
|
|
||||||
|
3. 运行本程序
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo mkdir /opt/apps/uengine-runner
|
||||||
|
sudo cp uengine-runner /opt/apps/uengine-runner -rv
|
||||||
|
sudo cp getxmlimg.py /opt/apps/uengine-runner -rv
|
||||||
|
sudo cp icon.png /opt/apps/uengine-runner -rv
|
||||||
|
chmod 777 /opt/apps/uengine-runner/main.py
|
||||||
|
sudo cp /opt/apps/uengine-runner/main.py /usr/bin/uengine-runner
|
||||||
|
./main.py
|
||||||
|
```
|
||||||
|
|
||||||
|
4. 卸载本程序
|
||||||
|
```bash
|
||||||
|
sudo rm /usr/bin/uengine-runner -v
|
||||||
|
sudo rm /opt/apps/uengine-runner/ -rfv
|
||||||
|
pip3 uninstall ttkthemes
|
||||||
|
```
|
||||||
|
|
||||||
|
### 使用说明
|
||||||
|
1、需要你有使用 root 权限的能力;
|
||||||
|
2、需要安装 UEngine 才能使用,UOS建议在商店安装一个安卓应用,让系统自动安装 UEngine 及相关的依赖包;
|
||||||
|
3、提取 apk 图标的 apk 路径以“安装 apk”那栏为准;
|
||||||
|
4、如果报错是有关产生 .deksotp 文件有关,一般可以打开程序列表运行。如果想要连接其他手机,请使用 1.2.0 以前的版本,可以使用 adb 连接。
|
||||||
|
|
||||||
|
### 故障排除
|
||||||
|
提 issue 最好,当然有些问题自己无法解决,请大佬 push 一下
|
||||||
|
如果出现故障,尝试终端运行,如果是可以自行解决的问题,就**自行解决**,如果可以就**提 issues 并提供解决方案**,不行就**提 isscue 并提供程序和终端报错以及程序版本**
|
||||||
|
|
||||||
|
### 下载量
|
||||||
|
这里只统计蓝奏云的下载量,链接(懒得更了):
|
||||||
|
[https://kdocs.cn/l/smrvazWGuKcY](https://kdocs.cn/l/smrvazWGuKcY)
|
||||||
|
|
||||||
|
### 已知问题
|
||||||
|
<p align="center"><img src='https://bbs.deepin.org/assets/image/raccoon/[sad].gif'></p>
|
||||||
|
|
||||||
|

|
||||||
|
部分 app 无法读取出图片,已知:
|
||||||
|
| 程序 | 下载链接 |
|
||||||
|
| :-: | :-: |
|
||||||
|
| Firefox For Android | https://www.firefox.com.cn/download/ |
|
||||||
|
| 网易云音乐 For Android | https://music.163.com/#/download |
|
||||||
|
| 抖音 | https://www.wandoujia.com/apps/7461948 |
|
||||||
|
| 360 手机浏览器 | https://mse.360.cn/ |
|
||||||
|
| E-Go | 忘了 |
|
||||||
|
| 其他待测试…… | 其他待测试…… |
|
||||||
|
**注意:提取不出图标不代表未安装成功!**
|
||||||
|
|
||||||
|
|
||||||
|
### 贡献
|
||||||
|
<p align="center"><img src='https://bbs.deepin.org/assets/image/raccoon/blush.gif'></p>
|
||||||
|
|
||||||
|
非常欢迎大家的贡献
|
||||||
|
贡献的开发者列表:
|
||||||
|
| 开发者 | 邮箱 |
|
||||||
|
| :-: | :-: |
|
||||||
|
| gfdgd xi | 3025613752@qq.com |
|
||||||
|
| actionchen | 917981399@qq.com |
|
||||||
|
| 柚子 | https://gitee.com/Limexb |
|
||||||
|
|
||||||
|
### 相关项目
|
||||||
|
| 项目名称 | 项目地址 |
|
||||||
|
| :-: | :-:|
|
||||||
|
| uengine-installer | https://gitee.com/Maicss/uengine-installer |
|
||||||
|
| uengine APK 打包器 | https://gitee.com/gfdgd-xi/uengine-apk-builder |
|
||||||
|
| Root UEngine | https://gitee.com/Limexb/root-uengine |
|
||||||
|
|
||||||
|
### 附测试生成图标无问题列表:
|
||||||
|
**至于能不能用就不测试了,这暂时不是重点**
|
||||||
|
**现在新加了评分功能,就看大家的评分了!**
|
||||||
|
| 程序 | 下载链接 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| QQ 全家桶(完整版、极速版、Android Pad 版) | https://im.qq.com |
|
||||||
|
| TIM | 忘了 |
|
||||||
|
| 微信 | https://weixin.qq.com |
|
||||||
|
| 百度翻译 | 忘了 |
|
||||||
|
| 百度网盘 | https://pan.baidu.com |
|
||||||
|
| 腾讯课堂 | 忘了 |
|
||||||
|
| 抖音极速版 | 忘了 |
|
||||||
|
| 豌豆荚 | 忘了 |
|
||||||
|
| 小猿口算 | 忘了 |
|
||||||
|
| Hyperbowl | 忘了 |
|
||||||
|
| bilibili | https://d.bilibili.com/download_app.html?bsource=app_bili |
|
||||||
|
| 蓝奏云 | https://up.woozooo.com/lanzouh5.apk |
|
||||||
|
| QQ 音乐(完整版、Android Pad 版、TV 版、车载版) | https://y.qq.com/download/index.html |
|
||||||
|
| 360 手机卫士(完整版、极速版) | https://shouji.360.cn/v6/index.html |
|
||||||
|
| 360 清理大师(稳定版、尝鲜版) | http://shouji.360.cn/360cleandroid/ |
|
||||||
|
| 360 手机助手 | http://sj.360.cn/index.html |
|
||||||
|
| WPS Office For Android | https://www.wps.cn/ |
|
||||||
|
| 钉钉 for android | https://page.dingtalk.com/wow/dingtalk/act/download?spm=a3140.8196062.0.0.6f4c5c3dWBhYUM |
|
||||||
|
|
||||||
|
### ©2021-2022
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Categories=System;
|
|
||||||
Comment=UEngine 程序菜单
|
|
||||||
Encoding=UTF-8
|
|
||||||
Exec=/usr/bin/uengine launch.sh --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
|
|
||||||
Icon=/opt/apps/uengine-runner/icon.png
|
|
||||||
MimeType=
|
|
||||||
Name=UEngine 程序菜单
|
|
||||||
StartupWMClass=UEngine 程序菜单
|
|
||||||
Terminal=false
|
|
||||||
Type=Application
|
|
||||||
14
build/opt/apps/uengine-runner/UpdateApkProgram.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import ttkthemes
|
||||||
|
import tkinter as tk
|
||||||
|
import tkinter.ttk as ttk
|
||||||
|
window = tk.Tk()
|
||||||
|
win = tk.Frame(window)
|
||||||
|
|
||||||
|
chooseFrame = ttk.Frame(win)
|
||||||
|
fiveStar = ttk.Radiobutton(chooseFrame, text="五星(正常安装、运行、卸载且无任何问题)")
|
||||||
|
fourStar = ttk.Radiobutton(chooseFrame, text="四星(正常安装、运行、卸载,但在运行时有小问题)")
|
||||||
|
threeStar = ttk.Radiobutton(chooseFrame, text="三星(正常安装、运行、卸载,但运行时体验不佳,很多功能有问题)")
|
||||||
|
twoStar = ttk.Radiobutton(chooseFrame, text="二星(正常安装、卸载,但运行难以使用甚至完全无法运行)")
|
||||||
|
oneStar = ttk.Radiobutton(chooseFrame, text="一星(无法正常安装、运行、卸载)")
|
||||||
|
|
||||||
|
window.mainloop()
|
||||||
109
build/opt/apps/uengine-runner/api/README.md
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
# API 介绍
|
||||||
|
# 必知
|
||||||
|
1. 此 API 只支持可以运行 UEngine 的 Linux 上,Windows 上无法使用
|
||||||
|
2. 部分函数需要 root 权限
|
||||||
|
3. 这是 UEngine 运行器的函数重构,所以一些 UEngine 运行器上没有的 bug 可能在这个 API 里有
|
||||||
|
## ProgramInformation
|
||||||
|
用于获取一些程序信息,详细如下(未特殊表明的是变量,否则是函数):
|
||||||
|
| 变量/函数名 | 变量/函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| programPath | 获取程序所在路径 |
|
||||||
|
| version | API 版本 |
|
||||||
|
| updateTime | 更新时间 |
|
||||||
|
| websize | 程序官网 |
|
||||||
|
| home | 用户 home(用户文件)目录 |
|
||||||
|
| developer | 参与的开发者列表 |
|
||||||
|
| language | 当前语言 |
|
||||||
|
| DesktopPath() | (函数)用户桌面目录 |
|
||||||
|
|
||||||
|
## Check
|
||||||
|
用于检查 API 所需的东西是否完整,详细如下:
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| CheckDepend() | 检查 API 所需的依赖是否完整 |
|
||||||
|
|
||||||
|
## ROOT
|
||||||
|
用于检查 ROOT 方面问题,详细如下:
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| GetRoot() | 检查程序/API是否以 ROOT 权限运行 |
|
||||||
|
|
||||||
|
## APK
|
||||||
|
这是面向对象的写法,所以应用方式也不一样:
|
||||||
|
```python
|
||||||
|
import api
|
||||||
|
xxx = api.APK("APK 所在路径")
|
||||||
|
```
|
||||||
|
具体函数介绍:
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| xxx.install() | 安装这个 APK 包(需要 Root) |
|
||||||
|
| xxx.uninstall()| 卸载这个 APK 包(需要 Root) |
|
||||||
|
| xxx.information()| 获取从 aapt 获取到的 APK 信息 |
|
||||||
|
| xxx.activityName() | 获取 APK 的 Activity 信息 |
|
||||||
|
| xxx.packageName() | 获取 APK 包名 |
|
||||||
|
| xxx.chineseLabel() | 获取 APK 中文名称 |
|
||||||
|
| xxx.saveApkIcon("图标保存路径") | 保存 APK 的图标到指定路径 |
|
||||||
|
| xxx.version() | 获取 APK 版本号 |
|
||||||
|
| xxx.saveDesktopFile("图标保存路径", "快捷方式保存路径") | 保存支持 UEngine 启动的 APK 快捷方式 |
|
||||||
|
| xxx.run() | 运行该应用(需要保证已经安装) |
|
||||||
|
| xxx.buildDeb("deb 包保存路径", qianZhui) | 打包为 deb 包(“qianZhui”是布尔值,可略,True代表有前缀为“uengine-dc”,False代表没有前缀) |
|
||||||
|
|
||||||
|
## UEngine
|
||||||
|
用于对 UEngine 进行一点点操控,详细如下:
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| UengineAppManager() | 显示 UEngine 安装应用程序管理器 |
|
||||||
|
| OpenApp("应用包名", "应用Activity") | 运行指定的应用(需要保证程序已经安装) |
|
||||||
|
| UengineDataClean() | 清空 UEngine 数据(需要 Root) |
|
||||||
|
| RemoveUengineCheck() | 删除 UEngine 的检查脚本(需要 Root) |
|
||||||
|
| CPUCheck() | 检查 CPU 是否支持运行 UEngine |
|
||||||
|
| BuildUengineRootImage() | 构建 UEngine 的 Root 镜像 |
|
||||||
|
| OpenUengineRootData() | 打开 UEngine 数据目录 |
|
||||||
|
| InstallRootUengineImage() | 安装已经被 Root 过的 UEngine 镜像(需要 Root) |
|
||||||
|
| Services | 用于操控 UEngine 服务的类,见下(需要 Root) |
|
||||||
|
| InternetBridge | 用于操控 UEngine 网络桥接的类,见下(需要 Root) |
|
||||||
|
### Services
|
||||||
|
关于 UEngine 的服务控制:
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| Services.Open() | 打开 UEngine 服务(需要 Root) |
|
||||||
|
| Services.Close() | 关闭 UEngine 服务(需要 Root) |
|
||||||
|
| Services.Restart() | 重启 UEngine 服务(需要 Root) |
|
||||||
|
### InternetBridge
|
||||||
|
关于 UEngine 的网络桥接控制:
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| InternetBridge.Open() | 打开 UEngine 网络桥接(需要 Root) |
|
||||||
|
| InternetBridge.Close() | 关闭 UEngine 网络桥接(需要 Root) |
|
||||||
|
| InternetBridge.Restart() | 重启 UEngine 网络桥接(需要 Root) |
|
||||||
|
| InternetBridge.Reload() | 重新加载 UEngine 网络桥接(需要 Root) |
|
||||||
|
| InternetBridge.ForceReload() | 强制加载 UEngine 网络桥接(需要 Root) |
|
||||||
|
## Adb
|
||||||
|
用于对 Adb 的部分操控
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| Services | 用于操控 Adb 服务的类,见下 |
|
||||||
|
### Service
|
||||||
|
关于 Adb 的服务控制:
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| Services.Open() | 打开 Adb 服务 |
|
||||||
|
| Services.Close() | 关闭 Adb 服务 |
|
||||||
|
| Services.Kill() | 杀死 Adb 进程 |
|
||||||
|
## File
|
||||||
|
关于文件的读取和写入,这是面向对象的写法,所以应用方式也不一样:
|
||||||
|
```python
|
||||||
|
import api
|
||||||
|
xxx = api.File("文件所在路径")
|
||||||
|
```
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| xxx.read() | 读取这个文件 |
|
||||||
|
| xxx.write("写入内容") | 写入这个文件 |
|
||||||
|
|
||||||
|
## UengineRunner
|
||||||
|
用于 UEngine 运行器的部分操控(请保证安装了 UEngine 运行器)
|
||||||
|
| 函数名 | 函数介绍 |
|
||||||
|
|:-:|:-:|
|
||||||
|
| CleanHistory() | 清理 UEngine 运行器的历史记录 |
|
||||||
356
build/opt/apps/uengine-runner/api/__init__.py
Normal file
@@ -0,0 +1,356 @@
|
|||||||
|
import os
|
||||||
|
import random
|
||||||
|
import shutil
|
||||||
|
import zipfile
|
||||||
|
import traceback
|
||||||
|
import subprocess
|
||||||
|
from getxmlimg import getsavexml
|
||||||
|
|
||||||
|
class ProgramInformation:
|
||||||
|
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||||
|
version = "1.6.0Alpha2"
|
||||||
|
updateTime = "2022年05月21日"
|
||||||
|
websize = ["https://gitee.com/gfdgd-xi/uengine-runner", "https://github.com/gfdgd-xi/uengine-runner"]
|
||||||
|
home = os.path.expanduser('~')
|
||||||
|
developer = ["gfdgd xi<3025613752@qq.com>", "为什么您不喜欢熊出没和阿布呢<https://weibo.com/u/7755040136>", "星空露光<https://gitee.com/Cynorkyle>", "actionchen<917981399@qq.com>", "柚子<https://gitee.com/Limexb>"]
|
||||||
|
lang = os.getenv('LANG')
|
||||||
|
# 获取用户桌面目录
|
||||||
|
def DesktopPath() -> "获取用户桌面目录":
|
||||||
|
for line in open(get_home() + "/.config/user-dirs.dirs"): # 以行来读取配置文件
|
||||||
|
desktop_index = line.find("XDG_DESKTOP_DIR=\"") # 寻找是否有对应项,有返回 0,没有返回 -1
|
||||||
|
if desktop_index != -1: # 如果有对应项
|
||||||
|
break # 结束循环
|
||||||
|
if desktop_index == -1: # 如果是提前结束,值一定≠-1,如果是没有提前结束,值一定=-1
|
||||||
|
return -1
|
||||||
|
else:
|
||||||
|
get = line[17:-2] # 截取桌面目录路径
|
||||||
|
get_index = get.find("$HOME") # 寻找是否有对应的项,需要替换内容
|
||||||
|
if get != -1: # 如果有
|
||||||
|
get = get.replace("$HOME", get_home()) # 则把其替换为用户目录(~)
|
||||||
|
return get # 返回目录
|
||||||
|
|
||||||
|
# 判断程序以正确方式运行
|
||||||
|
class Check:
|
||||||
|
def CheckDepend():
|
||||||
|
depend = ["/usr/bin/uengine", "UEngine", "/usr/bin/adb", "adb", "/usr/bin/uengine-session-launch-helper", "UEngine", "/usr/bin/aapt", "aapt"]
|
||||||
|
for i in range(0, len(depend), 2):
|
||||||
|
if not os.path.exists(depend[i]):
|
||||||
|
print("依赖{}不存在".format(depend[i + 1]))
|
||||||
|
|
||||||
|
class ROOT:
|
||||||
|
def GetRoot():
|
||||||
|
return os.geteuid() == 0
|
||||||
|
|
||||||
|
class APK:
|
||||||
|
def __init__(self, apkPath):
|
||||||
|
self.apkPath = apkPath
|
||||||
|
def install(self):
|
||||||
|
os.system("pkexec /usr/bin/uengine-session-launch-helper -- uengine install --apk='{}'".format(self.apkPath))
|
||||||
|
def uninstall(self):
|
||||||
|
os.system("pkexec /usr/bin/uengine-session-launch-helper -- uengine uninstall --pkg='{}'".format(self.packageName()))
|
||||||
|
def information(self):
|
||||||
|
return subprocess.getoutput("aapt dump badging '{}'".format(self.apkPath))
|
||||||
|
def activityName(self):
|
||||||
|
info = self.information()
|
||||||
|
for line in info.split('\n'):
|
||||||
|
if "launchable-activity" in line:
|
||||||
|
line = line[0: line.index("label='")]
|
||||||
|
line = line.replace("launchable-activity: ", "")
|
||||||
|
line = line.replace("'", "")
|
||||||
|
line = line.replace(" ", "")
|
||||||
|
line = line.replace("name=", "")
|
||||||
|
line = line.replace("label=", "")
|
||||||
|
line = line.replace("icon=", "")
|
||||||
|
return line
|
||||||
|
# 获取 apk 包名
|
||||||
|
def packageName(self):
|
||||||
|
info = self.information()
|
||||||
|
for line in info.split('\n'):
|
||||||
|
if "package:" in line:
|
||||||
|
line = line[0: line.index("versionCode='")]
|
||||||
|
line = line.replace("package:", "")
|
||||||
|
line = line.replace("name=", "")
|
||||||
|
line = line.replace("'", "")
|
||||||
|
line = line.replace(" ", "")
|
||||||
|
return line
|
||||||
|
# 获取软件的中文名称
|
||||||
|
def chineseLabel(self) -> "获取软件的中文名称":
|
||||||
|
info = self.information()
|
||||||
|
for line in info.split('\n'):
|
||||||
|
if "application-label:" in line:
|
||||||
|
line = line.replace("application-label:", "")
|
||||||
|
line = line.replace("'", "")
|
||||||
|
return line
|
||||||
|
# 保存apk图标
|
||||||
|
def saveApkIcon(self, iconSavePath) -> "保存 apk 文件的图标":
|
||||||
|
try:
|
||||||
|
if os.path.exists(iconSavePath):
|
||||||
|
os.remove(iconSavePath)
|
||||||
|
info = self.information()
|
||||||
|
for line in info.split('\n'):
|
||||||
|
if "application:" in line:
|
||||||
|
xmlpath = line.split(":")[-1].split()[-1].split("=")[-1].replace("'", "")
|
||||||
|
if xmlpath.endswith('.xml'):
|
||||||
|
xmlsave = getsavexml()
|
||||||
|
print(xmlpath)
|
||||||
|
xmlsave.savexml(self.apkPath, xmlpath, iconSavePath)
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
zip = zipfile.ZipFile(self.apkPath)
|
||||||
|
iconData = zip.read(xmlpath)
|
||||||
|
with open(iconSavePath, 'w+b') as saveIconFile:
|
||||||
|
saveIconFile.write(iconData)
|
||||||
|
return
|
||||||
|
print("None Icon! Show defult icon")
|
||||||
|
shutil.copy(ProgramInformation.programPath + "/defult.png", iconSavePath)
|
||||||
|
except:
|
||||||
|
traceback.print_exc()
|
||||||
|
print("Error, show defult icon")
|
||||||
|
shutil.copy(ProgramInformation.programPath + "/defult.png", iconSavePath)
|
||||||
|
def version(self):
|
||||||
|
info = self.information()
|
||||||
|
for line in info.split('\n'):
|
||||||
|
if "package:" in line:
|
||||||
|
if "compileSdkVersion='" in line:
|
||||||
|
line = line.replace(line[line.index("compileSdkVersion='"): -1], "")
|
||||||
|
if "platform" in line:
|
||||||
|
line = line.replace(line[line.index("platform"): -1], "")
|
||||||
|
line = line.replace(line[0: line.index("versionName='")], "")
|
||||||
|
line = line.replace("versionName='", "")
|
||||||
|
line = line.replace("'", "")
|
||||||
|
line = line.replace(" ", "")
|
||||||
|
return line
|
||||||
|
def saveDesktopFile(self, desktopPath, iconPath):
|
||||||
|
showName = self.chineseLabel()
|
||||||
|
if showName == "" or showName == None:
|
||||||
|
showName = "未知应用"
|
||||||
|
self.saveApkIcon(iconPath)
|
||||||
|
things = '''[Desktop Entry]
|
||||||
|
Categories=app;
|
||||||
|
Encoding=UTF-8
|
||||||
|
Exec=uengine launch --action=android.intent.action.MAIN --package={} --component={}
|
||||||
|
GenericName={}
|
||||||
|
Icon={}
|
||||||
|
MimeType=
|
||||||
|
Name={}
|
||||||
|
StartupWMClass={}
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
'''.format(self.packageName(), self.activityName(), showName, iconPath, showName, showName)
|
||||||
|
File(desktopPath).write(things)
|
||||||
|
def run(self):
|
||||||
|
UEngine.OpenApp(self.packageName(), self.activityName())
|
||||||
|
|
||||||
|
def buildDeb(self, savePath, qianZhui = True):
|
||||||
|
tempPath = "/tmp/uengine-apk-builder-{}".format(int(random.randint(0, 1024)))
|
||||||
|
#RunCommandShow("echo '======================================New===================================='")
|
||||||
|
#RunCommandShow("echo '创建目录'")
|
||||||
|
os.makedirs("{}/DEBIAN".format(tempPath))
|
||||||
|
os.makedirs("{}/usr/share/applications".format(tempPath))
|
||||||
|
os.makedirs("{}/usr/share/uengine/apk".format(tempPath))
|
||||||
|
os.makedirs("{}/usr/share/uengine/icons".format(tempPath))
|
||||||
|
apkPackageName = self.packageName()
|
||||||
|
if qianZhui:
|
||||||
|
apkPackageNameNew = "uengine-dc-" + self.packageName().lower()
|
||||||
|
else:
|
||||||
|
apkPackageNameNew = self.packageName().lower()
|
||||||
|
apkPackageVersion = self.version()
|
||||||
|
if apkPackageVersion[0].upper() == "V":
|
||||||
|
package = list(apkPackageVersion)
|
||||||
|
package.pop(0)
|
||||||
|
apkPackageVersion = "".join(package)
|
||||||
|
apkChineseLabel = self.chineseLabel()
|
||||||
|
apkActivityName = self.activityName()
|
||||||
|
iconSavePath = "{}/usr/share/uengine/icons/{}.png".format(tempPath, apkPackageNameNew)
|
||||||
|
debControl = '''Package: {}
|
||||||
|
Version: {}
|
||||||
|
Architecture: all
|
||||||
|
Maintainer: {}
|
||||||
|
Depends: deepin-elf-verify (>= 0.0.16.7-1), uengine (>= 1.0.1)
|
||||||
|
Section: utils
|
||||||
|
Priority: optional
|
||||||
|
Description: {}\n'''.format(apkPackageNameNew, apkPackageVersion, apkChineseLabel, apkChineseLabel)
|
||||||
|
debPostinst = '''#!/bin/sh
|
||||||
|
|
||||||
|
APK_DIR="/usr/share/uengine/apk"
|
||||||
|
APK_NAME="{}"
|
||||||
|
APK_PATH="$APK_DIR/$APK_NAME"
|
||||||
|
DESKTOP_FILE="{}"
|
||||||
|
|
||||||
|
|
||||||
|
if [ -f $APK_PATH ]; then
|
||||||
|
echo "Installing $APK_NAME"
|
||||||
|
else
|
||||||
|
echo "ERROR: $APK_NAME does not exist."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
session_manager=`ps -ef | grep "uengine session-manager" | grep -v grep`
|
||||||
|
if test -z "$session_manager"; then
|
||||||
|
echo "ERROR: app install failed(session-manager is not running)."
|
||||||
|
sess_dir="/usr/share/uengine/session_install"
|
||||||
|
if [ ! -d $sess_dir ]; then
|
||||||
|
mkdir $sess_dir
|
||||||
|
chmod 777 $sess_dir
|
||||||
|
fi
|
||||||
|
apk_name=${{APK_PATH##*/}}
|
||||||
|
fileName="$sess_dir/$apk_name"
|
||||||
|
echo $DESKTOP_FILE > $fileName
|
||||||
|
abistr=""
|
||||||
|
if test -n "$abistr"; then
|
||||||
|
abi=`echo $abistr |awk -F \= '{{print $2}}'`
|
||||||
|
echo $abi >> $fileName
|
||||||
|
fi
|
||||||
|
chmod 766 $fileName
|
||||||
|
fi
|
||||||
|
|
||||||
|
/usr/bin/uengine-session-launch-helper -- uengine install --apk="$APK_PATH"
|
||||||
|
|
||||||
|
exit 0'''.format(apkPackageNameNew + ".apk", "/usr/share/applications/{}.desktop".format(apkPackageNameNew))
|
||||||
|
debPrerm = '''#!/bin/sh
|
||||||
|
|
||||||
|
APP_NAME="{}"
|
||||||
|
DESKTOP_FILE="{}"
|
||||||
|
|
||||||
|
session_manager=`ps -ef | grep "uengine session-manager" | grep -v grep`
|
||||||
|
if test -z "$session_manager"; then
|
||||||
|
echo "ERROR: app uninstall failed(session-manager is not running)."
|
||||||
|
sess_dir="/usr/share/uengine/session_uninstall"
|
||||||
|
if [ ! -d $sess_dir ]; then
|
||||||
|
mkdir $sess_dir
|
||||||
|
chmod 777 $sess_dir
|
||||||
|
fi
|
||||||
|
fileName="$sess_dir/$APP_NAME"
|
||||||
|
echo $DESKTOP_FILE > $fileName
|
||||||
|
chmod 766 $fileName
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Uninstalling $APP_NAME"
|
||||||
|
/usr/bin/uengine-session-launch-helper -- uengine uninstall --pkg="$APP_NAME"
|
||||||
|
|
||||||
|
exit 0'''.format(apkPackageName, "/usr/share/applications/{}.desktop".format(apkPackageNameNew))
|
||||||
|
desktopFile = '''[Desktop Entry]
|
||||||
|
Categories=Other;
|
||||||
|
Exec=uengine launch --action=android.intent.action.MAIN --package={} --component={}
|
||||||
|
Icon=/usr/share/uengine/icons/{}.png
|
||||||
|
Terminal=false
|
||||||
|
Type=Application
|
||||||
|
GenericName={}
|
||||||
|
Name={}
|
||||||
|
'''
|
||||||
|
# RunCommandShow("echo '{}' > '{}/DEBIAN/control'".format(debControl, tempPath))
|
||||||
|
#RunCommandShow("echo 正在写入文件:'{}/DEBIAN/control'".format(tempPath))
|
||||||
|
File("{}/DEBIAN/control".format(tempPath)).write(debControl)
|
||||||
|
#RunCommandShow("echo 正在写入文件:'{}/DEBIAN/postinst'".format(tempPath))
|
||||||
|
File("{}/DEBIAN/postinst".format(tempPath)).write(debPostinst)
|
||||||
|
#RunCommandShow("echo 正在写入文件:'{}/DEBIAN/prerm'".format(tempPath))
|
||||||
|
File("{}/DEBIAN/prerm".format(tempPath)).write(debPrerm)
|
||||||
|
#RunCommandShow("echo 正在写入文件:'/usr/share/applications/{}.desktop'".format(apkPackageNameNew))
|
||||||
|
# write_txt("{}/usr/share/applications/{}.desktop".format(tempPath, apkPackageNameNew), desktopFile)
|
||||||
|
self.saveDesktopFile("{}/usr/share/applications/{}.desktop".format(tempPath, apkPackageNameNew),
|
||||||
|
"{}/usr/share/uengine/icons/{}.png".format(tempPath, apkPackageNameNew))
|
||||||
|
#BuildUengineDesktop(apkPackageName, apkActivityName, apkChineseLabel,
|
||||||
|
# "/usr/share/uengine/icons/{}.png".format(apkPackageNameNew),
|
||||||
|
# "{}/usr/share/applications/{}.desktop".format(tempPath, apkPackageNameNew))
|
||||||
|
#RunCommandShow("echo '复制文件'")
|
||||||
|
#RunCommandShow("echo '写入 APK 软件图标'")
|
||||||
|
#SaveApkIcon(apkPath, iconSavePath)
|
||||||
|
self.saveApkIcon(iconSavePath)
|
||||||
|
#RunCommandShow("echo '复制 APK 文件'")
|
||||||
|
shutil.copy(self.apkPath, "{}/usr/share/uengine/apk/{}.apk".format(tempPath, apkPackageNameNew))
|
||||||
|
#RunCommandShow("cp -rv '{}' '{}/usr/share/uengine/apk/{}.apk'".format(apkPath, tempPath, apkPackageNameNew))
|
||||||
|
#RunCommandShow("echo '正在设置文件权限……'")
|
||||||
|
os.system("chmod 0775 -vR '{}/DEBIAN/postinst'".format(tempPath))
|
||||||
|
os.system("chmod 0775 -vR '{}/DEBIAN/prerm'".format(tempPath))
|
||||||
|
#RunCommandShow("echo '打包 deb 到桌面……'")
|
||||||
|
os.system(
|
||||||
|
"dpkg -b '{}' '{}'".format(tempPath, savePath))
|
||||||
|
#RunCommandShow("echo '正在删除临时目录……'")
|
||||||
|
#shutil.rmtree(tempPath)
|
||||||
|
#RunCommandShow("rm -rfv '{}'".format(tempPath))
|
||||||
|
#RunCommandShow("echo '完成!'")
|
||||||
|
#findApkHistory.append(apkPath)
|
||||||
|
#combobox1['value'] = findApkHistory
|
||||||
|
#write_txt(get_home() + "/.config/uengine-runner/FindApkBuildHistory.json",
|
||||||
|
# str(json.dumps(ListToDictionary(findApkHistory)))) # 将历史记录的数组转换为字典并写入
|
||||||
|
#messagebox.showinfo(title="提示", message="打包完成")
|
||||||
|
#DisabledAndEnbled(False)
|
||||||
|
|
||||||
|
|
||||||
|
class UEngine:
|
||||||
|
def UengineAppManager():
|
||||||
|
os.system("uengine launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity")
|
||||||
|
def OpenApp(appPackage, appActivity):
|
||||||
|
os.system("uengine launch --package={} --component={}".format(appPackage, appActivity))
|
||||||
|
# 清空 uengine 数据
|
||||||
|
def UengineDataClean() -> "清空 uengine 数据":
|
||||||
|
shutil.rmtree("{}/.local/share/applications/uengine/".format(ProgramInformation.home))
|
||||||
|
shutil.rmtree("/data/uengine")
|
||||||
|
def RemoveUengineCheck():
|
||||||
|
os.remove("/usr/share/uengine/uengine-check-runnable.sh")
|
||||||
|
def CPUCheck():
|
||||||
|
return subprocess.getoutput("uengine check-features")
|
||||||
|
def BuildUengineRootImage():
|
||||||
|
os.system(ProgramInformation.programPath + "/root-uengine.sh")
|
||||||
|
def OpenUengineRootData():
|
||||||
|
os.system("xdg-open /data/uengine/data/data")
|
||||||
|
def InstallRootUengineImage():
|
||||||
|
if not os.path.exists:
|
||||||
|
os.mkdir("/tmp/uengine-runner")
|
||||||
|
File("/tmp/uengine-runner/install.sh").write("sudo dpkg -i /tmp/uengine-runner/u*.deb\nsudo apt install -f")
|
||||||
|
os.system("wget -P '/tmp/uengine-runner' 'https://hub.fastgit.org/gfdgd-xi/uengine-runner/releases/download/U1.2.15/uengine-android-image_1.2.15_amd64.deb' && pkexec bash '/tmp/uengine-runner/install.sh'")
|
||||||
|
class Services:
|
||||||
|
def Open():
|
||||||
|
os.system("pkexec systemctl enable uengine-container uengine-session && systemctl start uengine-container uengine-session")
|
||||||
|
def Close():
|
||||||
|
os.system("pkexec systemctl disable uengine-container uengine-session")
|
||||||
|
def Restart():
|
||||||
|
os.system("pkexec systemctl restart uengine*")
|
||||||
|
class InternetBridge:
|
||||||
|
def Open():
|
||||||
|
os.system("pkexec uengine-bridge.sh start")
|
||||||
|
def Close():
|
||||||
|
os.system("pkexec uengine-bridge.sh stop")
|
||||||
|
def Restart():
|
||||||
|
os.system("pkexec uengine-bridge.sh restart")
|
||||||
|
def Reload():
|
||||||
|
os.system("pkexec uengine-bridge.sh reload")
|
||||||
|
def ForceReload():
|
||||||
|
os.system("pkexec uengine-bridge.sh force-reload")
|
||||||
|
|
||||||
|
class Adb:
|
||||||
|
class Service:
|
||||||
|
def Open():
|
||||||
|
os.system("adb start-server")
|
||||||
|
def Close():
|
||||||
|
os.system("adb kill-server")
|
||||||
|
def Kill():
|
||||||
|
os.system("killall adb")
|
||||||
|
|
||||||
|
class File:
|
||||||
|
def __init__(self, filePath):
|
||||||
|
self.filePath = filePath
|
||||||
|
def read(self):
|
||||||
|
f = open(self.filePath, "r") # 设置文件对象
|
||||||
|
str = f.read() # 获取内容
|
||||||
|
f.close() # 关闭文本对象
|
||||||
|
return str # 返回结果
|
||||||
|
def write(self, things) -> "写入文本文档":
|
||||||
|
TxtDir = os.path.dirname(self.filePath)
|
||||||
|
print(TxtDir)
|
||||||
|
if not os.path.exists(TxtDir):
|
||||||
|
os.makedirs(TxtDir, exist_ok=True)
|
||||||
|
file = open(self.filePath, 'w', encoding='UTF-8') # 设置文件对象
|
||||||
|
file.write(things) # 写入文本
|
||||||
|
file.close() # 关闭文本对象
|
||||||
|
|
||||||
|
class UengineRunner:
|
||||||
|
def CleanHistory():
|
||||||
|
shutil.rmtree(ProgramInformation.home + "/.config/uengine-runner")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print("本 API 不支持直接运行,请通过引入的方式使用此 API")
|
||||||
|
quit()
|
||||||
|
|
||||||
|
if not ROOT.GetRoot():
|
||||||
|
print("请获取 ROOT 权限以便更好的使用该 API")
|
||||||
BIN
build/opt/apps/uengine-runner/api/defult.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
118
build/opt/apps/uengine-runner/api/getxmlimg.py
Executable file
@@ -0,0 +1,118 @@
|
|||||||
|
import PIL.Image as Image
|
||||||
|
import PIL.ImageDraw as ImageDraw
|
||||||
|
import zipfile
|
||||||
|
import subprocess
|
||||||
|
import re
|
||||||
|
|
||||||
|
class getsavexml():
|
||||||
|
|
||||||
|
def savexml(self,apkFilePath,xmlpath,iconSavePath):
|
||||||
|
cmddumpid = "aapt dump xmltree "+ apkFilePath + " " + xmlpath
|
||||||
|
print(cmddumpid)
|
||||||
|
xmltree = subprocess.getoutput(cmddumpid)
|
||||||
|
xmls = xmltree.splitlines()
|
||||||
|
# find strs ,print next line
|
||||||
|
def FindStrs(lines,strs):
|
||||||
|
i=0
|
||||||
|
while i < len(lines):
|
||||||
|
if re.search(strs,lines[i]):
|
||||||
|
tmpstr = lines[i+1]
|
||||||
|
i += 1
|
||||||
|
Resultstr = tmpstr.split(":")[-1].split("=")[-1].split("0x")[-1]
|
||||||
|
return Resultstr
|
||||||
|
else:
|
||||||
|
i += 1
|
||||||
|
#从apk的信息中获取前后景图片的ID号
|
||||||
|
backimgid = FindStrs(xmls,"background")
|
||||||
|
foreimgid = FindStrs(xmls,"foreground")
|
||||||
|
print(backimgid)
|
||||||
|
print(foreimgid)
|
||||||
|
|
||||||
|
# 直接从apk resource文件获取前后两层图片路径及ID字符串
|
||||||
|
resource = subprocess.getoutput("aapt dump --values resources " + apkFilePath + "| grep -iE -A1 " + "\"" + backimgid + "|" + foreimgid + "\"")
|
||||||
|
resourcelines = resource.splitlines()
|
||||||
|
print(resourcelines)
|
||||||
|
|
||||||
|
# 从过滤出的字符串中获取所有相同ID的图片路径
|
||||||
|
def Findpicpath(lines,imgid):
|
||||||
|
i=0
|
||||||
|
Resultstr = []
|
||||||
|
while i < len(lines):
|
||||||
|
if re.search(imgid,lines[i]) and re.search("string8",lines[i+1]) :
|
||||||
|
print(lines[i+1])
|
||||||
|
tmpstr = lines[i+1].replace("\"","")
|
||||||
|
i += 1
|
||||||
|
Resultstr.append(tmpstr.split()[-1])
|
||||||
|
else:
|
||||||
|
i += 1
|
||||||
|
return Resultstr
|
||||||
|
|
||||||
|
#获取所有带前后图片ID的图片路径(相同背景或者前景的图片ID但分辨率不一样)
|
||||||
|
backimgs = Findpicpath(resourcelines,backimgid)
|
||||||
|
foreimgs = Findpicpath(resourcelines,foreimgid)
|
||||||
|
print(backimgs)
|
||||||
|
print(foreimgs)
|
||||||
|
#获取分辨率最高的图片路径
|
||||||
|
def getmaxsize(imgs):
|
||||||
|
j = 0
|
||||||
|
size=(0,0)
|
||||||
|
zipapk = zipfile.ZipFile(apkFilePath)
|
||||||
|
imgpath = ""
|
||||||
|
while j < len(imgs):
|
||||||
|
print(imgs[j])
|
||||||
|
img = Image.open(zipapk.open(imgs[j]))
|
||||||
|
print(imgs[j])
|
||||||
|
print(img.size)
|
||||||
|
if size < img.size:
|
||||||
|
size = img.size
|
||||||
|
imgpath = imgs[j]
|
||||||
|
j += 1
|
||||||
|
return imgpath
|
||||||
|
|
||||||
|
# 获取到文件列表后,进行比较分辨率,选取分辨率最高的张图片
|
||||||
|
iconbackpath = getmaxsize(backimgs)
|
||||||
|
iconforepath = getmaxsize(foreimgs)
|
||||||
|
print(iconbackpath + " " + iconforepath)
|
||||||
|
|
||||||
|
#从APK文件获取最终图片
|
||||||
|
zipapk = zipfile.ZipFile(apkFilePath)
|
||||||
|
iconback = zipapk.open(iconbackpath)
|
||||||
|
iconfore = zipapk.open(iconforepath)
|
||||||
|
|
||||||
|
|
||||||
|
# 叠加图片,mask 设置前景为蒙版
|
||||||
|
iconbackimg = Image.open(iconback).convert("RGBA")
|
||||||
|
iconforeimg = Image.open(iconfore).convert("RGBA")
|
||||||
|
iconbackimg.paste(iconforeimg,mask=iconforeimg)
|
||||||
|
|
||||||
|
|
||||||
|
# 圆角图片函数,网上拷贝的
|
||||||
|
def circle_corner(img, radii): #把原图片变成圆角,这个函数是从网上找的,原址 https://www.pyget.cn/p/185266
|
||||||
|
"""
|
||||||
|
圆角处理
|
||||||
|
:param img: 源图象。
|
||||||
|
:param radii: 半径,如:30。
|
||||||
|
:return: 返回一个圆角处理后的图象。
|
||||||
|
"""
|
||||||
|
# 画圆(用于分离4个角)
|
||||||
|
circle = Image.new('L', (radii * 2, radii * 2), 0) # 创建一个黑色背景的画布
|
||||||
|
draw = ImageDraw.Draw(circle)
|
||||||
|
draw.ellipse((0, 0, radii * 2, radii * 2), fill=255) # 画白色圆形
|
||||||
|
# 原图
|
||||||
|
img = img.convert("RGBA")
|
||||||
|
w, h = img.size
|
||||||
|
# 画4个角(将整圆分离为4个部分)
|
||||||
|
alpha = Image.new('L', img.size, 255)
|
||||||
|
alpha.paste(circle.crop((0, 0, radii, radii)), (0, 0)) # 左上角
|
||||||
|
alpha.paste(circle.crop((radii, 0, radii * 2, radii)), (w - radii, 0)) # 右上角
|
||||||
|
alpha.paste(circle.crop((radii, radii, radii * 2, radii * 2)), (w - radii, h - radii)) # 右下角
|
||||||
|
alpha.paste(circle.crop((0, radii, radii, radii * 2)), (0, h - radii)) # 左下角
|
||||||
|
# alpha.show()
|
||||||
|
img.putalpha(alpha) # 白色区域透明可见,黑色区域不可见
|
||||||
|
return img
|
||||||
|
|
||||||
|
# 圆角半径1/8边长,保存icon图片
|
||||||
|
w,h = iconbackimg.size
|
||||||
|
iconimg = circle_corner(iconbackimg,int(w/8))
|
||||||
|
iconimg.save(iconSavePath)
|
||||||
|
|
||||||
76
build/opt/apps/uengine-runner/api/root-uengine.sh
Executable file
@@ -0,0 +1,76 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#sudo apt install squashfs-tools
|
||||||
|
|
||||||
|
mkdir -p ~/temp
|
||||||
|
cd ~/temp
|
||||||
|
echo "正在下载supersu"
|
||||||
|
aria2c -x 16 -s 16 -d ~/temp http://supersuroot.org/downloads/SuperSU-v2.82-201705271822.zip
|
||||||
|
cd ..
|
||||||
|
mkdir -p ~/temp/work/dabao/extract/DEBIAN
|
||||||
|
echo "正在解压supersu"
|
||||||
|
unzip ~/temp/SuperSU-v2.82-201705271822.zip -d ~/temp/work/su
|
||||||
|
WORKDIR=~/temp/work
|
||||||
|
cd "$WORKDIR"
|
||||||
|
echo "正在下载uengine-android-image"
|
||||||
|
apt download uengine-android-image
|
||||||
|
echo "正在解压uengine-android-image"
|
||||||
|
cd dabao
|
||||||
|
dpkg-deb -x $WORKDIR/uengine-android-image*.deb extract/
|
||||||
|
dpkg-deb -e $WORKDIR/uengine-android-image*.deb extract/DEBIAN
|
||||||
|
cd ..
|
||||||
|
cp dabao/extract/usr/share/uengine/android.img android.img
|
||||||
|
|
||||||
|
echo "正在解压android镜像"
|
||||||
|
sudo unsquashfs android.img
|
||||||
|
|
||||||
|
sudo mkdir -p ./squashfs-root/system/app/SuperSU
|
||||||
|
sudo mkdir -p ./squashfs-root/system/bin/.ext/
|
||||||
|
|
||||||
|
echo "正在将supersu安装到android镜像"
|
||||||
|
sudo cp ./su/common/Superuser.apk ./squashfs-root/system/app/SuperSU/SuperSU.apk
|
||||||
|
sudo cp ./su/common/install-recovery.sh ./squashfs-root/system/etc/install-recovery.sh
|
||||||
|
sudo cp ./su/common/install-recovery.sh ./squashfs-root/system/bin/install-recovery.sh
|
||||||
|
sudo cp ./su/x64/su ./squashfs-root/system/xbin/su
|
||||||
|
sudo cp ./su/x64/su ./squashfs-root/system/bin/.ext/.su
|
||||||
|
sudo cp ./su/x64/su ./squashfs-root/system/xbin/daemonsu
|
||||||
|
sudo cp ./su/x64/supolicy ./squashfs-root/system/xbin/supolicy
|
||||||
|
sudo cp ./su/x64/libsupol.so ./squashfs-root/system/lib64/libsupol.so
|
||||||
|
sudo cp ./squashfs-root/system/bin/app_process64 ./squashfs-root/system/bin/app_process_init
|
||||||
|
sudo cp ./squashfs-root/system/bin/app_process64 ./squashfs-root/system/bin/app_process64_original
|
||||||
|
sudo cp ./squashfs-root/system/xbin/daemonsu ./squashfs-root/system/bin/app_process
|
||||||
|
sudo cp ./squashfs-root/system/xbin/daemonsu ./squashfs-root/system/bin/app_process64
|
||||||
|
|
||||||
|
sudo chmod +x ./squashfs-root/system/app/SuperSU/SuperSU.apk
|
||||||
|
sudo chmod +x ./squashfs-root/system/etc/install-recovery.sh
|
||||||
|
sudo chmod +x ./squashfs-root/system/bin/install-recovery.sh
|
||||||
|
sudo chmod +x ./squashfs-root/system/xbin/su
|
||||||
|
sudo chmod +x ./squashfs-root/system/bin/.ext/.su
|
||||||
|
sudo chmod +x ./squashfs-root/system/xbin/daemonsu
|
||||||
|
sudo chmod +x ./squashfs-root/system/xbin/supolicy
|
||||||
|
sudo chmod +x ./squashfs-root/system/lib64/libsupol.so
|
||||||
|
sudo chmod +x ./squashfs-root/system/bin/app_process_init
|
||||||
|
sudo chmod +x ./squashfs-root/system/bin/app_process64_original
|
||||||
|
sudo chmod +x ./squashfs-root/system/bin/app_process
|
||||||
|
sudo chmod +x ./squashfs-root/system/bin/app_process64
|
||||||
|
|
||||||
|
echo "正在打包android镜像"
|
||||||
|
sudo rm android.img
|
||||||
|
sudo mksquashfs squashfs-root android.img -b 131072 -comp xz -Xbcj ia64
|
||||||
|
|
||||||
|
|
||||||
|
cp android.img dabao/extract/usr/share/uengine/android.img
|
||||||
|
|
||||||
|
echo "正在打包uengine-android-image"
|
||||||
|
cd dabao/extract
|
||||||
|
find usr -type f -print0 |xargs -0 md5sum >md5sums
|
||||||
|
cd ..
|
||||||
|
mkdir build
|
||||||
|
dpkg-deb -b extract/ build/
|
||||||
|
|
||||||
|
cp build/*.deb ~/
|
||||||
|
|
||||||
|
echo "正在清理垃圾"
|
||||||
|
sudo rm -rf ~/temp
|
||||||
|
|
||||||
|
echo "已在用户主目录生成新的安装包,安装后重启即可生效"
|
||||||
BIN
build/opt/apps/uengine-runner/builer.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
25
build/opt/apps/uengine-runner/builer.svg
Executable file
|
After Width: | Height: | Size: 19 KiB |
BIN
build/opt/apps/uengine-runner/defult-old.png
Executable file
|
After Width: | Height: | Size: 312 KiB |
BIN
build/opt/apps/uengine-runner/defult.png
Executable file → Normal file
|
Before Width: | Height: | Size: 312 KiB After Width: | Height: | Size: 35 KiB |
25
build/opt/apps/uengine-runner/icon.svg
Executable file
|
After Width: | Height: | Size: 15 KiB |
@@ -1,9 +1,10 @@
|
|||||||
{
|
{
|
||||||
|
"Package": "spark-uengine-runner",
|
||||||
"Url": [
|
"Url": [
|
||||||
"https://gitee.com/gfdgd-xi/uengine-runner",
|
"https://gitee.com/gfdgd-xi/uengine-runner",
|
||||||
"https://github.com/gfdgd-xi/uengine-runner"
|
"https://github.com/gfdgd-xi/uengine-runner"
|
||||||
],
|
],
|
||||||
"Version": "1.5.3",
|
"Version": "1.6.1",
|
||||||
"System": "Linux(deepin/UOS)",
|
"System": "Linux(deepin/UOS)",
|
||||||
"Tips": [
|
"Tips": [
|
||||||
"更多可见:https://gitee.com/gfdgd-xi/uengine-runner/wikis",
|
"更多可见:https://gitee.com/gfdgd-xi/uengine-runner/wikis",
|
||||||
@@ -21,6 +22,23 @@
|
|||||||
"5、如果想要使用adb连接UEngine或其他手机,请使用 1.2.0 以前的版本。(如需连接UEngine请安装adb补丁)"
|
"5、如果想要使用adb连接UEngine或其他手机,请使用 1.2.0 以前的版本。(如需连接UEngine请安装adb补丁)"
|
||||||
],
|
],
|
||||||
"Update": [
|
"Update": [
|
||||||
|
"V1.6.1:",
|
||||||
|
"※1、修复了打包 deb 包在 APK 的包名有大写时无法启动的问题",
|
||||||
|
"※2、提供新版本的 UEngine Root 镜像",
|
||||||
|
"※3、更新了 UEngine Root 的下载地址",
|
||||||
|
"※4、修复了本程序的“UEngine 键盘映射”无法启动的问题",
|
||||||
|
"5、把构建 UEngine Root 镜像修改为多线程下载(wget=>aria2)",
|
||||||
|
"6、提供了 UEngine 运行器的 API(可以从项目地址中获取)",
|
||||||
|
"7、补上遗漏的项目参与者“星空露光”,新加项目参与者“为什么您不喜欢熊出没和阿布呢”",
|
||||||
|
"V1.6.0:",
|
||||||
|
"※1、更换了新的图标",
|
||||||
|
"※2、支持程序的评分和查看分数详情的功能(如果炸了我的服务器,这个就作废了)",
|
||||||
|
"※3、修复了在安装奇奇怪怪的安装包(如格式、标识不正确的)时的快捷方式图标为空以及快捷方式文本的变化",
|
||||||
|
"※4、添加更新功能,可以自行升级到最新版本(如果炸了我的服务器,这个就作废了)",
|
||||||
|
"※5、新增程序帮助",
|
||||||
|
"6、新填彩蛋(在“关于”=>“关于”显示的窗口双击“关于”开启)(如果炸了我的服务器,这个就作废了)",
|
||||||
|
"7、修复了“UEngine 打包器”前缀选项勾选设置不生效的问题",
|
||||||
|
"",
|
||||||
"V1.5.3:",
|
"V1.5.3:",
|
||||||
"※1、修复了在 UOS 家庭版安装 apk 文件安装包信息为 None 的问题",
|
"※1、修复了在 UOS 家庭版安装 apk 文件安装包信息为 None 的问题",
|
||||||
"※2、“添加/删除 UEngine 图标”窗口的写入按钮在目录~/.local/share/icons/hicolor/256x256/apps不存在时点击无反应,参考报错",
|
"※2、“添加/删除 UEngine 图标”窗口的写入按钮在目录~/.local/share/icons/hicolor/256x256/apps不存在时点击无反应,参考报错",
|
||||||
@@ -137,6 +155,8 @@
|
|||||||
"Contribute": [
|
"Contribute": [
|
||||||
"gfdgd xi<3025613752@qq.com>",
|
"gfdgd xi<3025613752@qq.com>",
|
||||||
"actionchen<917981399@qq.com>",
|
"actionchen<917981399@qq.com>",
|
||||||
"柚子<https://gitee.com/Limexb>"
|
"柚子<https://gitee.com/Limexb>",
|
||||||
|
"为什么您不喜欢熊出没和阿布呢<https://weibo.com/u/7755040136>",
|
||||||
|
"星空露光<https://gitee.com/Cynorkyle>"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
BIN
build/opt/apps/uengine-runner/menu.png
Normal file
|
After Width: | Height: | Size: 111 KiB |
25
build/opt/apps/uengine-runner/menu.svg
Executable file
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@@ -1,11 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#sudo apt install squashfs-tools
|
sudo apt install squashfs-tools
|
||||||
|
|
||||||
mkdir -p ~/temp
|
mkdir -p ~/temp
|
||||||
cd ~/temp
|
cd ~/temp
|
||||||
echo "正在下载supersu"
|
echo "正在下载supersu"
|
||||||
wget -P ~/temp http://supersuroot.org/downloads/SuperSU-v2.82-201705271822.zip
|
aria2c -x 16 -s 16 -d ~/temp http://supersuroot.org/downloads/SuperSU-v2.82-201705271822.zip
|
||||||
cd ..
|
cd ..
|
||||||
mkdir -p ~/temp/work/dabao/extract/DEBIAN
|
mkdir -p ~/temp/work/dabao/extract/DEBIAN
|
||||||
echo "正在解压supersu"
|
echo "正在解压supersu"
|
||||||
|
|||||||
BIN
build/opt/apps/uengine-runner/runner.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
25
build/opt/apps/uengine-runner/runner.svg
Executable file
|
After Width: | Height: | Size: 19 KiB |
@@ -2,8 +2,8 @@
|
|||||||
# 使用系统默认的 python3 运行
|
# 使用系统默认的 python3 运行
|
||||||
###########################################################################################
|
###########################################################################################
|
||||||
# 作者:gfdgd xi
|
# 作者:gfdgd xi
|
||||||
# 版本:1.5.3
|
# 版本:1.6.1
|
||||||
# 更新时间:2021年12月12日(DDUC11了)
|
# 更新时间:2022年04月30日(五一了)
|
||||||
# 感谢:anbox、deepin 和 统信
|
# 感谢:anbox、deepin 和 统信
|
||||||
# 基于 Python3 的 tkinter 构建
|
# 基于 Python3 的 tkinter 构建
|
||||||
###########################################################################################
|
###########################################################################################
|
||||||
@@ -67,8 +67,15 @@ def BuildApkDeb(apkPath):
|
|||||||
RunCommandShow("mkdir -pv '{}/usr/share/uengine/icons'".format(tempPath))
|
RunCommandShow("mkdir -pv '{}/usr/share/uengine/icons'".format(tempPath))
|
||||||
RunCommandShow("echo '写入文件,因为写入过程过于复杂,不显示写入命令……'")
|
RunCommandShow("echo '写入文件,因为写入过程过于复杂,不显示写入命令……'")
|
||||||
apkPackageName = GetApkPackageName(apkPath, False)
|
apkPackageName = GetApkPackageName(apkPath, False)
|
||||||
apkPackageNameNew = GetApkPackageName(apkPath, True)
|
if qianZhui.get():
|
||||||
|
apkPackageNameNew = GetApkPackageName(apkPath, True).lower()
|
||||||
|
else:
|
||||||
|
apkPackageNameNew = GetApkPackageName(apkPath, False).lower()
|
||||||
apkPackageVersion = GetApkVersion(apkPath)
|
apkPackageVersion = GetApkVersion(apkPath)
|
||||||
|
if apkPackageVersion[0].upper() == "V":
|
||||||
|
package = list(apkPackageVersion)
|
||||||
|
package.pop(0)
|
||||||
|
apkPackageVersion = "".join(package)
|
||||||
apkChineseLabel = GetApkChineseLabel(apkPath)
|
apkChineseLabel = GetApkChineseLabel(apkPath)
|
||||||
apkActivityName = GetApkActivityName(apkPath)
|
apkActivityName = GetApkActivityName(apkPath)
|
||||||
iconSavePath = "{}/usr/share/uengine/icons/{}.png".format(tempPath, apkPackageNameNew)
|
iconSavePath = "{}/usr/share/uengine/icons/{}.png".format(tempPath, apkPackageNameNew)
|
||||||
@@ -267,8 +274,8 @@ def GetApkPackageName(apkFilePath, setting):
|
|||||||
line = line.replace(" ", "")
|
line = line.replace(" ", "")
|
||||||
# 此较为特殊,因为需要判断用户是否要添加前缀
|
# 此较为特殊,因为需要判断用户是否要添加前缀
|
||||||
if setting:
|
if setting:
|
||||||
return "uengine-dc-{}".format(line).lower()
|
return "uengine-dc-{}".format(line)
|
||||||
return line.lower()
|
return line
|
||||||
|
|
||||||
def GetApkVersion(apkFilePath):
|
def GetApkVersion(apkFilePath):
|
||||||
info = GetApkInformation(apkFilePath)
|
info = GetApkInformation(apkFilePath)
|
||||||
@@ -285,6 +292,8 @@ def GetApkVersion(apkFilePath):
|
|||||||
return line
|
return line
|
||||||
|
|
||||||
def BuildUengineDesktop(packageName, activityName, showName, iconPath, savePath):
|
def BuildUengineDesktop(packageName, activityName, showName, iconPath, savePath):
|
||||||
|
if showName == "" or showName == None:
|
||||||
|
showName = "未知应用"
|
||||||
things = '''
|
things = '''
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Categories=app;
|
Categories=app;
|
||||||
@@ -308,17 +317,6 @@ def GetApkChineseLabel(apkFilePath):
|
|||||||
line = line.replace("'", "")
|
line = line.replace("'", "")
|
||||||
return line
|
return line
|
||||||
|
|
||||||
#def GetApkIconInApk(apkFilePath):
|
|
||||||
# info = GetApkInformation(apkFilePath)
|
|
||||||
# for line in info.split('\n'):
|
|
||||||
# if "application:" in line:
|
|
||||||
# line = line[line.index("icon='"): -1]
|
|
||||||
# line = line.replace("icon='", "")
|
|
||||||
# if "'" in line:
|
|
||||||
# line = line[0: line.index("'")]
|
|
||||||
# return line
|
|
||||||
# return line
|
|
||||||
|
|
||||||
#合并两个函数到一起
|
#合并两个函数到一起
|
||||||
def SaveApkIcon(apkFilePath, iconSavePath)->"获取 apk 文件的图标":
|
def SaveApkIcon(apkFilePath, iconSavePath)->"获取 apk 文件的图标":
|
||||||
try:
|
try:
|
||||||
@@ -335,18 +333,14 @@ def SaveApkIcon(apkFilePath, iconSavePath)->"获取 apk 文件的图标":
|
|||||||
iconData = zip.read(xmlpath)
|
iconData = zip.read(xmlpath)
|
||||||
with open(iconSavePath, 'w+b') as saveIconFile:
|
with open(iconSavePath, 'w+b') as saveIconFile:
|
||||||
saveIconFile.write(iconData)
|
saveIconFile.write(iconData)
|
||||||
|
return
|
||||||
|
print("Show defult icon")
|
||||||
|
shutil.copy(programPath + "/defult.png", iconSavePath)
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
print("Error, show defult icon")
|
print("Error, show defult icon")
|
||||||
shutil.copy(programPath + "/defult.png", iconSavePath)
|
shutil.copy(programPath + "/defult.png", iconSavePath)
|
||||||
|
|
||||||
|
|
||||||
#def SaveApkIcon(apkFilePath, iconSavePath):
|
|
||||||
# zip = zipfile.ZipFile(apkFilePath)
|
|
||||||
# iconData = zip.read(GetApkIconInApk(apkFilePath))
|
|
||||||
# with open(iconSavePath, 'w+b') as saveIconFile:
|
|
||||||
# saveIconFile.write(iconData)
|
|
||||||
|
|
||||||
def TextboxAddText1(message):
|
def TextboxAddText1(message):
|
||||||
global textbox1
|
global textbox1
|
||||||
textbox1.configure(state=tk.NORMAL)
|
textbox1.configure(state=tk.NORMAL)
|
||||||
@@ -383,7 +377,7 @@ if not lang in langFile.keys():
|
|||||||
information = json.loads(readtxt(programPath + "/information.json"))
|
information = json.loads(readtxt(programPath + "/information.json"))
|
||||||
version = information["Version"]
|
version = information["Version"]
|
||||||
title = "{} {}".format(langFile[lang]["Uengine Apk Builder"]["Title"], version)
|
title = "{} {}".format(langFile[lang]["Uengine Apk Builder"]["Title"], version)
|
||||||
iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0])
|
iconPath = "{}/builer.png".format(os.path.split(os.path.realpath(__file__))[0])
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
# 加载配置
|
# 加载配置
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Categories=system;Utility;
|
|
||||||
Encoding=UTF-8
|
|
||||||
Exec=uengine-runner -ci %F
|
|
||||||
GenericName=APK Install(UEngine)
|
|
||||||
GenericName[zh_CN]=APK 安装(UEngine)
|
|
||||||
Icon=/opt/apps/uengine-runner/icon.png
|
|
||||||
MimeType=application/apk;
|
|
||||||
Name=APK Install(UEngine)
|
|
||||||
Name[zh_CN]=APK 安装(UEngine)
|
|
||||||
NoDisplay=true
|
|
||||||
OnlyShowIn=Unity;
|
|
||||||
StartupNotify=false
|
|
||||||
StartupWMClass=APK 安装(UEngine)
|
|
||||||
Terminal=false
|
|
||||||
Type=Application
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
#########################################
|
#########################################
|
||||||
# 版本:1.5.1
|
# 版本:1.6.1
|
||||||
# 更新时间:2021年10月06日
|
# 更新时间:2022年10月06日
|
||||||
# Need: unix, python3-tk, python3-pip, pymouse, keyboard
|
# Need: unix, python3-tk, python3-pip, pymouse, keyboard
|
||||||
#########################################
|
#########################################
|
||||||
import os
|
import os
|
||||||
@@ -57,7 +57,10 @@ def Mouse(key):
|
|||||||
print(keybo[key.name]["MousePlace"])
|
print(keybo[key.name]["MousePlace"])
|
||||||
pyautogui.FAILSAFE = False
|
pyautogui.FAILSAFE = False
|
||||||
#os.system(programPath + "/mouse.py {} {}".format(keybo[key.name]["MousePlace"][0], keybo[key.name]["MousePlace"][1]))
|
#os.system(programPath + "/mouse.py {} {}".format(keybo[key.name]["MousePlace"][0], keybo[key.name]["MousePlace"][1]))
|
||||||
pyautogui.click(keybo[key.name]["MousePlace"][0], keybo[key.name]["MousePlace"][1])
|
try:
|
||||||
|
pyautogui.click(keybo[key.name]["MousePlace"][0], keybo[key.name]["MousePlace"][1])
|
||||||
|
except:
|
||||||
|
pass
|
||||||
#pyautogui.click(1500, 800)
|
#pyautogui.click(1500, 800)
|
||||||
#m.click(keybo[key.name]["MousePlace"][0],keybo[key.name]["MousePlace"][1])
|
#m.click(keybo[key.name]["MousePlace"][0],keybo[key.name]["MousePlace"][1])
|
||||||
|
|
||||||
@@ -72,6 +75,7 @@ def Setting(key):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def ShowTips():
|
def ShowTips():
|
||||||
|
global close
|
||||||
try:
|
try:
|
||||||
if setting:
|
if setting:
|
||||||
settingLabelText.set('''设置方法:把鼠标移动带所需位置然后按下需要设置的按键即可({}x{})
|
settingLabelText.set('''设置方法:把鼠标移动带所需位置然后按下需要设置的按键即可({}x{})
|
||||||
@@ -90,15 +94,23 @@ def ShowTips():
|
|||||||
4、映射时会占用鼠标,所以在使用时最好不要使用鼠标;'''.format(pyautogui.position()[0], pyautogui.position()[1]))
|
4、映射时会占用鼠标,所以在使用时最好不要使用鼠标;'''.format(pyautogui.position()[0], pyautogui.position()[1]))
|
||||||
settingButton.configure(state=tk.NORMAL)
|
settingButton.configure(state=tk.NORMAL)
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
ShowTips()
|
if not close:
|
||||||
|
ShowTips()
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
print(close)
|
||||||
if not close:
|
if not close:
|
||||||
ShowTips()
|
ShowTips()
|
||||||
|
|
||||||
def Closing():
|
def Closing():
|
||||||
|
global close
|
||||||
close = True
|
close = True
|
||||||
window.destroy()
|
window.destroy()
|
||||||
|
#key.close()
|
||||||
|
#stop_thread(keys)
|
||||||
|
keyboard.unhook(Inputt)
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
def Key():
|
def Key():
|
||||||
keyboard.hook(Inputt)
|
keyboard.hook(Inputt)
|
||||||
@@ -150,6 +162,7 @@ programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
|||||||
iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0])
|
iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0])
|
||||||
keybo = json.loads(readtxt("{}/.config/uengine-keyboard/key.json".format(get_home())))
|
keybo = json.loads(readtxt("{}/.config/uengine-keyboard/key.json".format(get_home())))
|
||||||
version = json.loads(readtxt("{}/information.json".format(programPath)))["Version"]
|
version = json.loads(readtxt("{}/information.json".format(programPath)))["Version"]
|
||||||
|
pyautogui.PAUSE = 0
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# 判断是不是 root
|
# 判断是不是 root
|
||||||
@@ -214,7 +227,8 @@ settingButton.grid(row=0, column=1)
|
|||||||
|
|
||||||
win.pack(fill="both", expand="yes")
|
win.pack(fill="both", expand="yes")
|
||||||
#threaded.lock.allocate_lock()
|
#threaded.lock.allocate_lock()
|
||||||
threading.Thread(target=Key).start()
|
keys = threading.Thread(target=Key)
|
||||||
|
keys.start()
|
||||||
threading.Thread(target=ShowTips).start()
|
threading.Thread(target=ShowTips).start()
|
||||||
pyautogui.FAILSAFE = False
|
pyautogui.FAILSAFE = False
|
||||||
'''def B(key):
|
'''def B(key):
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
# 使用系统默认的 python3 运行
|
# 使用系统默认的 python3 运行
|
||||||
###########################################################################################
|
###########################################################################################
|
||||||
# 作者:gfdgd xi<3025613752@qq.com>
|
# 作者:gfdgd xi<3025613752@qq.com>
|
||||||
# 版本:1.5.3
|
# 版本:1.6.1
|
||||||
# 更新时间:2021年12月12日(DDUC11了)
|
# 更新时间:2022年5月21日(要开学了)
|
||||||
# 感谢:anbox、deepin 和 UOS
|
# 感谢:anbox、deepin 和 UOS
|
||||||
# 基于 Python3 的 tkinter 构建
|
# 基于 Python3 的 tkinter 构建
|
||||||
# 更新:gfdgd xi<3025613752@qq.com>、actionchen<917981399@qq.com>
|
# 更新:gfdgd xi<3025613752@qq.com>、actionchen<917981399@qq.com>、为什么您不喜欢熊出没和阿布呢
|
||||||
###########################################################################################
|
###########################################################################################
|
||||||
#################
|
#################
|
||||||
# 引入所需的库
|
# 引入所需的库
|
||||||
@@ -19,9 +19,16 @@ import shutil
|
|||||||
import zipfile
|
import zipfile
|
||||||
import traceback
|
import traceback
|
||||||
import threading
|
import threading
|
||||||
|
import easygui
|
||||||
import ttkthemes
|
import ttkthemes
|
||||||
import webbrowser
|
import webbrowser
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import matplotlib
|
||||||
|
import requests
|
||||||
|
import numpy
|
||||||
|
import matplotlib.figure
|
||||||
|
import matplotlib.pylab
|
||||||
|
import matplotlib.font_manager
|
||||||
import PIL.Image as Image
|
import PIL.Image as Image
|
||||||
import PIL.ImageTk as ImageTk
|
import PIL.ImageTk as ImageTk
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
@@ -31,6 +38,7 @@ import tkinter.filedialog as filedialog
|
|||||||
import tkinter.simpledialog as simpledialog
|
import tkinter.simpledialog as simpledialog
|
||||||
from getxmlimg import getsavexml
|
from getxmlimg import getsavexml
|
||||||
|
|
||||||
|
win = tk.Tk() # 创建窗口
|
||||||
|
|
||||||
# 卸载程序
|
# 卸载程序
|
||||||
def UninstallProgram(package: "apk 包名")->"卸载程序":
|
def UninstallProgram(package: "apk 包名")->"卸载程序":
|
||||||
@@ -38,8 +46,8 @@ def UninstallProgram(package: "apk 包名")->"卸载程序":
|
|||||||
global fineUninstallApkHistory
|
global fineUninstallApkHistory
|
||||||
Return = GetCommandReturn("pkexec /usr/bin/uengine-session-launch-helper -- uengine uninstall --pkg='{}'".format(package))
|
Return = GetCommandReturn("pkexec /usr/bin/uengine-session-launch-helper -- uengine uninstall --pkg='{}'".format(package))
|
||||||
print(Return)
|
print(Return)
|
||||||
if os.path.exists("{}/.local/share/applications/{}.desktop".format(get_home(), package)):
|
if os.path.exists("{}/.local/share/applications/uengine/{}.desktop".format(get_home(), package)):
|
||||||
os.remove("{}/.local/share/applications/{}.desktop".format(get_home(), package))
|
os.remove("{}/.local/share/applications/uengine/{}.desktop".format(get_home(), package))
|
||||||
if os.path.exists("{}/{}.desktop".format(get_desktop_path(), package)):
|
if os.path.exists("{}/{}.desktop".format(get_desktop_path(), package)):
|
||||||
os.remove("{}/{}.desktop".format(get_desktop_path(), package))
|
os.remove("{}/{}.desktop".format(get_desktop_path(), package))
|
||||||
findApkHistory.append(ComboInstallPath.get())
|
findApkHistory.append(ComboInstallPath.get())
|
||||||
@@ -53,16 +61,6 @@ def UninstallProgram(package: "apk 包名")->"卸载程序":
|
|||||||
messagebox.showerror(title="错误", message=traceback.format_exc())
|
messagebox.showerror(title="错误", message=traceback.format_exc())
|
||||||
DisabledAndEnbled(False)
|
DisabledAndEnbled(False)
|
||||||
|
|
||||||
# 卸载文本框的浏览按钮事件
|
|
||||||
#def BtnFindUninstallApkClk():
|
|
||||||
# path = filedialog.askopenfilename(title="选择 Apk", filetypes=[("APK 文件", "*.apk"), ("所有文件", "*.*")], initialdir=json.loads(readtxt(get_home() + "/.config/uengine-runner/FindUninstallApk.json"))["path"])
|
|
||||||
# if path != "" and path != "()":
|
|
||||||
# try:
|
|
||||||
# ComboUninstallPath.set(path)
|
|
||||||
# write_txt(get_home() + "/.config/uengine-runner/FindUninstallApk.json", json.dumps({"path": os.path.dirname(path)})) # 写入配置文件
|
|
||||||
# except:
|
|
||||||
# pass
|
|
||||||
|
|
||||||
# 卸载按钮事件
|
# 卸载按钮事件
|
||||||
def ButtonClick8():
|
def ButtonClick8():
|
||||||
if ComboInstallPath.get() is "":
|
if ComboInstallPath.get() is "":
|
||||||
@@ -73,6 +71,7 @@ def ButtonClick8():
|
|||||||
path = GetApkPackageName(ComboInstallPath.get())
|
path = GetApkPackageName(ComboInstallPath.get())
|
||||||
else:
|
else:
|
||||||
path = ComboInstallPath.get()
|
path = ComboInstallPath.get()
|
||||||
|
print(path)
|
||||||
threading.Thread(target=UninstallProgram, args=[path]).start()
|
threading.Thread(target=UninstallProgram, args=[path]).start()
|
||||||
|
|
||||||
# 浏览窗口
|
# 浏览窗口
|
||||||
@@ -100,9 +99,14 @@ def Button3Install():
|
|||||||
# 安装应用
|
# 安装应用
|
||||||
def InstallApk(path: "apk 路径", quit: "是否静默安装" = False):
|
def InstallApk(path: "apk 路径", quit: "是否静默安装" = False):
|
||||||
try:
|
try:
|
||||||
|
if not os.path.exists("/tmp/uengine-runner"):
|
||||||
|
os.makedirs("/tmp/uengine-runner")
|
||||||
if not os.path.exists("{}/.local/share/applications/uengine/".format(get_home())):
|
if not os.path.exists("{}/.local/share/applications/uengine/".format(get_home())):
|
||||||
print("Mkdir")
|
print("Mkdir")
|
||||||
os.makedirs("{}/.local/share/applications/uengine/".format(get_home()))
|
os.makedirs("{}/.local/share/applications/uengine/".format(get_home()))
|
||||||
|
# 读取设置
|
||||||
|
setting = json.loads(readtxt(get_home() + "/.config/uengine-runner/setting.json"))
|
||||||
|
# 安装应用
|
||||||
print("start install apk")
|
print("start install apk")
|
||||||
global findApkHistory
|
global findApkHistory
|
||||||
print("start install apk12")
|
print("start install apk12")
|
||||||
@@ -113,6 +117,14 @@ def InstallApk(path: "apk 路径", quit: "是否静默安装" = False):
|
|||||||
if not os.path.exists(iconSaveDir):
|
if not os.path.exists(iconSaveDir):
|
||||||
os.makedirs(iconSaveDir,exist_ok=True)
|
os.makedirs(iconSaveDir,exist_ok=True)
|
||||||
SaveApkIcon(path, iconSavePath)
|
SaveApkIcon(path, iconSavePath)
|
||||||
|
try:
|
||||||
|
if setting["SaveApk"]:
|
||||||
|
shutil.copy(path, "/tmp/uengine-runner/bak.apk")
|
||||||
|
except:
|
||||||
|
if not messagebox.askyesno(title="错误", message="无法备份安装包,是否不备份安装包继续安装?\n提示:新版UEngine安装后会自动删除安装包"):
|
||||||
|
DisabledAndEnbled(False)
|
||||||
|
return
|
||||||
|
setting["SaveApk"] = False
|
||||||
print("start install apk2")
|
print("start install apk2")
|
||||||
BuildUengineDesktop(GetApkPackageName(path), GetApkActivityName(path), GetApkChineseLabel(path), iconSavePath,
|
BuildUengineDesktop(GetApkPackageName(path), GetApkActivityName(path), GetApkChineseLabel(path), iconSavePath,
|
||||||
"{}/{}.desktop".format(get_desktop_path(), GetApkPackageName(path)))
|
"{}/{}.desktop".format(get_desktop_path(), GetApkPackageName(path)))
|
||||||
@@ -121,6 +133,11 @@ def InstallApk(path: "apk 路径", quit: "是否静默安装" = False):
|
|||||||
"{}/.local/share/applications/uengine/{}.desktop".format(get_home(), GetApkPackageName(path)))
|
"{}/.local/share/applications/uengine/{}.desktop".format(get_home(), GetApkPackageName(path)))
|
||||||
commandReturn = GetCommandReturn("pkexec /usr/bin/uengine-session-launch-helper -- uengine install --apk='{}'".format(path))
|
commandReturn = GetCommandReturn("pkexec /usr/bin/uengine-session-launch-helper -- uengine install --apk='{}'".format(path))
|
||||||
print(commandReturn)
|
print(commandReturn)
|
||||||
|
try:
|
||||||
|
if setting["SaveApk"]:
|
||||||
|
shutil.copy("/tmp/uengine-runner/bak.apk", path)
|
||||||
|
except:
|
||||||
|
messagebox.showerror(title="错误", message="无法还原安装包\n提示:新版UEngine安装后会自动删除安装包,备份的Apk在/tmp/uengine-runner/bak.apk,电脑重启后就会丢失!")
|
||||||
print("\nprint install complete")
|
print("\nprint install complete")
|
||||||
if quit:
|
if quit:
|
||||||
print(commandReturn)
|
print(commandReturn)
|
||||||
@@ -314,7 +331,7 @@ def InstallRootUengineImage():
|
|||||||
if not os.path.exists:
|
if not os.path.exists:
|
||||||
os.mkdir("/tmp/uengine-runner")
|
os.mkdir("/tmp/uengine-runner")
|
||||||
write_txt("/tmp/uengine-runner/install.sh", "sudo dpkg -i /tmp/uengine-runner/u*.deb\nsudo apt install -f")
|
write_txt("/tmp/uengine-runner/install.sh", "sudo dpkg -i /tmp/uengine-runner/u*.deb\nsudo apt install -f")
|
||||||
threading.Thread(target=os.system, args=["deepin-terminal -C \"wget -P '/tmp/uengine-runner' 'https://hub.fastgit.org/gfdgd-xi/uengine-runner/releases/download/U1.1.14/uengine-android-image_1.1.14_amd64.deb' && pkexec bash '/tmp/uengine-runner/install.sh'\""]).start()
|
threading.Thread(target=os.system, args=["deepin-terminal -C \"wget -P '/tmp/uengine-runner' 'https://hub.fastgit.xyz/gfdgd-xi/uengine-runner/releases/download/U1.2.15/uengine-android-image_1.2.15_amd64.deb' && pkexec bash '/tmp/uengine-runner/install.sh'\""]).start()
|
||||||
|
|
||||||
def BuildRootUengineImage():
|
def BuildRootUengineImage():
|
||||||
threading.Thread(target=os.system, args=["deepin-terminal -C \"bash '{}'\"".format(programPath + "/root-uengine.sh")]).start()
|
threading.Thread(target=os.system, args=["deepin-terminal -C \"bash '{}'\"".format(programPath + "/root-uengine.sh")]).start()
|
||||||
@@ -324,6 +341,8 @@ def ReinstallUengineImage():
|
|||||||
|
|
||||||
# 生成 uengine 启动文件到桌面
|
# 生成 uengine 启动文件到桌面
|
||||||
def BuildUengineDesktop(packageName: "软件包名", activityName: "activity", showName: "显示名称", iconPath: "程序图标所在目录", savePath:".desktop 文件保存路径")->"生成 uengine 启动文件到桌面":
|
def BuildUengineDesktop(packageName: "软件包名", activityName: "activity", showName: "显示名称", iconPath: "程序图标所在目录", savePath:".desktop 文件保存路径")->"生成 uengine 启动文件到桌面":
|
||||||
|
if showName == "" or showName == None:
|
||||||
|
showName = "未知应用"
|
||||||
things = '''[Desktop Entry]
|
things = '''[Desktop Entry]
|
||||||
Categories=app;
|
Categories=app;
|
||||||
Encoding=UTF-8
|
Encoding=UTF-8
|
||||||
@@ -350,6 +369,8 @@ def GetApkChineseLabel(apkFilePath)->"获取软件的中文名称":
|
|||||||
# 保存apk图标
|
# 保存apk图标
|
||||||
def SaveApkIcon(apkFilePath, iconSavePath)->"保存 apk 文件的图标":
|
def SaveApkIcon(apkFilePath, iconSavePath)->"保存 apk 文件的图标":
|
||||||
try:
|
try:
|
||||||
|
if os.path.exists(iconSavePath):
|
||||||
|
os.remove(iconSavePath)
|
||||||
info = GetApkInformation(apkFilePath)
|
info = GetApkInformation(apkFilePath)
|
||||||
for line in info.split('\n'):
|
for line in info.split('\n'):
|
||||||
if "application:" in line:
|
if "application:" in line:
|
||||||
@@ -358,11 +379,15 @@ def SaveApkIcon(apkFilePath, iconSavePath)->"保存 apk 文件的图标":
|
|||||||
xmlsave = getsavexml()
|
xmlsave = getsavexml()
|
||||||
print(xmlpath)
|
print(xmlpath)
|
||||||
xmlsave.savexml(apkFilePath,xmlpath,iconSavePath)
|
xmlsave.savexml(apkFilePath,xmlpath,iconSavePath)
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
zip = zipfile.ZipFile(apkFilePath)
|
zip = zipfile.ZipFile(apkFilePath)
|
||||||
iconData = zip.read(xmlpath)
|
iconData = zip.read(xmlpath)
|
||||||
with open(iconSavePath, 'w+b') as saveIconFile:
|
with open(iconSavePath, 'w+b') as saveIconFile:
|
||||||
saveIconFile.write(iconData)
|
saveIconFile.write(iconData)
|
||||||
|
return
|
||||||
|
print("None Icon! Show defult icon")
|
||||||
|
shutil.copy(programPath + "/defult.png", iconSavePath)
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
print("Error, show defult icon")
|
print("Error, show defult icon")
|
||||||
@@ -628,14 +653,111 @@ def GetApkVersion(apkFilePath):
|
|||||||
line = line.replace(" ", "")
|
line = line.replace(" ", "")
|
||||||
return line
|
return line
|
||||||
|
|
||||||
|
def VersionCheck(version1, version2):
|
||||||
|
return version1 == version2
|
||||||
|
|
||||||
|
def ShowHelp():
|
||||||
|
webbrowser.open_new_tab(programPath + "/Help/index.html")
|
||||||
|
|
||||||
|
class SettingWindow():
|
||||||
|
saveApkOption = tk.IntVar()
|
||||||
|
def ShowWindow():
|
||||||
|
setting = tk.Toplevel()
|
||||||
|
setting.resizable(0, 0)
|
||||||
|
setting.iconphoto(False, tk.PhotoImage(file=iconPath))
|
||||||
|
setting.title("设置 UEngine 运行器" + version)
|
||||||
|
saveApkFrame = ttk.LabelFrame(setting, text="Apk 安装设置")
|
||||||
|
try:
|
||||||
|
data = json.loads(readtxt(get_home() + "/.config/uengine-runner/setting.json"))
|
||||||
|
except:
|
||||||
|
messagebox.showerror(title="错误", message="读取设置错误!无法打开设置窗口!")
|
||||||
|
setting.destroy()
|
||||||
|
SettingWindow.saveApkOption = tk.IntVar()
|
||||||
|
SettingWindow.saveApkOption.set(int(data["SaveApk"]))
|
||||||
|
ttk.Radiobutton(saveApkFrame, text="不备份Apk包直接安装", value=0, variable=SettingWindow.saveApkOption).pack(anchor=tk.W)
|
||||||
|
ttk.Radiobutton(saveApkFrame, text="备份Apk包然后在安装后自动拷贝原先目录", value=1, variable=SettingWindow.saveApkOption).pack(anchor=tk.W)
|
||||||
|
controlFrame = ttk.Frame(setting)
|
||||||
|
ttk.Button(controlFrame, text="取消", command=setting.destroy).grid(row=0, column=0)
|
||||||
|
ttk.Button(controlFrame, text="保存", command=SettingWindow.SaveSetting).grid(row=0, column=1)
|
||||||
|
saveApkFrame.pack()
|
||||||
|
controlFrame.pack(anchor=tk.E)
|
||||||
|
def SaveSetting():
|
||||||
|
try:
|
||||||
|
write_txt(get_home() + "/.config/uengine-runner/setting.json", json.dumps({"SaveApk": bool(SettingWindow.saveApkOption.get())}))
|
||||||
|
except:
|
||||||
|
traceback.print_exc()
|
||||||
|
messagebox.showerror(title="错误", message="保存设置错误!")
|
||||||
|
return
|
||||||
|
messagebox.showinfo(title="提示", message="设置保存完毕!")
|
||||||
|
|
||||||
|
class UpdateWindow():
|
||||||
|
data = {}
|
||||||
|
def ShowWindow():
|
||||||
|
update = tk.Toplevel()
|
||||||
|
update.title("检查更新")
|
||||||
|
update.resizable(0, 0)
|
||||||
|
update.iconphoto(False, tk.PhotoImage(file=iconPath))
|
||||||
|
versionLabel = ttk.Label(update, text="当前版本:{}\n最新版本:未知\n更新内容:".format(version))
|
||||||
|
updateText = tk.Text(update)
|
||||||
|
controlFrame = ttk.Frame(update)
|
||||||
|
ok = ttk.Button(controlFrame, text="更新(更新过程中会关闭所有Python应用,包括这个应用)", command=UpdateWindow.Update)
|
||||||
|
cancel = ttk.Button(controlFrame, text="取消", command=update.destroy)
|
||||||
|
try:
|
||||||
|
UpdateWindow.data = json.loads(requests.get("http://120.25.153.144/uengine-runner/update.json").text)
|
||||||
|
versionLabel = ttk.Label(update, text="当前版本:{}\n最新版本:{}\n更新内容:".format(version, UpdateWindow.data["Version"]))
|
||||||
|
if UpdateWindow.data["Version"] == version:
|
||||||
|
updateText.insert("0.0", "此为最新版本,无需更新")
|
||||||
|
ok.configure(state=tk.DISABLED)
|
||||||
|
else:
|
||||||
|
updateText.insert("0.0", UpdateWindow.data["New"].replace("\\n", "\n"))
|
||||||
|
except:
|
||||||
|
traceback.print_exc()
|
||||||
|
messagebox.showerror(title="错误", message="无法连接服务器!")
|
||||||
|
|
||||||
|
updateText.configure(state=tk.DISABLED)
|
||||||
|
versionLabel.pack(anchor=tk.W)
|
||||||
|
updateText.pack()
|
||||||
|
controlFrame.pack(anchor=tk.E)
|
||||||
|
cancel.grid(row=0, column=0)
|
||||||
|
ok.grid(row=0, column=1)
|
||||||
|
update.mainloop()
|
||||||
|
def Update():
|
||||||
|
if not os.path.exists("/tmp/uengine-runner/update"):
|
||||||
|
os.makedirs("/tmp/uengine-runner/update")
|
||||||
|
try:
|
||||||
|
write_txt("/tmp/uengine-runner/update.sh", """#!/bin/bash
|
||||||
|
echo 删除多余的安装包
|
||||||
|
rm -rfv /tmp/uengine-runner/update/*
|
||||||
|
echo 关闭“UEngine 运行器”以及其它“Python 应用”
|
||||||
|
killall python3
|
||||||
|
echo 下载安装包
|
||||||
|
wget -P /tmp/uengine-runner/update {}
|
||||||
|
echo 安装安装包
|
||||||
|
dpkg -i /tmp/uengine-runner/update/*.deb
|
||||||
|
echo 修复依赖关系
|
||||||
|
apt install -f -y
|
||||||
|
notify-send -i uengine "更新完毕!"
|
||||||
|
zenity --info --text=\"更新完毕!\" --ellipsize
|
||||||
|
""".format(UpdateWindow.data["Url"][int(information["Package"] == "com.gitee.uengine.runner.spark")], iconPath))
|
||||||
|
except:
|
||||||
|
traceback.print_exc()
|
||||||
|
easygui.textbox(title="错误", msg="更新出现错误,无法继续更新!", text=traceback.format_exc())
|
||||||
|
os.system("deepin-terminal -e pkexec bash /tmp/uengine-runner/update.sh")
|
||||||
|
|
||||||
|
image = None
|
||||||
class ApkInformation():
|
class ApkInformation():
|
||||||
def ShowWindows():
|
def ShowWindows():
|
||||||
global fullInformation
|
global fullInformation
|
||||||
global path
|
global path
|
||||||
global tab1
|
global tab1
|
||||||
path = ComboInstallPath.get()
|
path = ComboInstallPath.get()
|
||||||
|
package = GetApkPackageName(path)
|
||||||
|
if package == None or package == "":
|
||||||
|
messagebox.showerror(title="错误", message="该应用安装包异常,无法查询相关数据!")
|
||||||
|
return
|
||||||
message = tk.Toplevel()
|
message = tk.Toplevel()
|
||||||
|
message.title("“{}“的Apk信息".format(GetApkChineseLabel(path)))
|
||||||
|
message.iconphoto(False, tk.PhotoImage(file=iconPath))
|
||||||
|
|
||||||
tab = ttk.Notebook(message)
|
tab = ttk.Notebook(message)
|
||||||
|
|
||||||
@@ -663,16 +785,64 @@ class ApkInformation():
|
|||||||
# 获取图标
|
# 获取图标
|
||||||
SaveApkIcon(path, "/tmp/uengine-runner-android-app-icon.png")
|
SaveApkIcon(path, "/tmp/uengine-runner-android-app-icon.png")
|
||||||
# 读取图标
|
# 读取图标
|
||||||
|
global image
|
||||||
image = Image.open("/tmp/uengine-runner-android-app-icon.png")
|
image = Image.open("/tmp/uengine-runner-android-app-icon.png")
|
||||||
if image.size[0] + image.size[1] <= 512:
|
if image.size[0] + image.size[1] <= 512:
|
||||||
ttk.Label(tab1, image=ImageTk.PhotoImage(image)).pack()
|
ttk.Label(tab1, image=ImageTk.PhotoImage(Image.open("/tmp/uengine-runner-android-app-icon.png"))).pack()
|
||||||
else:
|
else:
|
||||||
ttk.Label(tab1, image=ImageTk.PhotoImage(image.resize((256, 256), Image.ANTIALIAS))).pack()
|
ttk.Label(tab1, image=ImageTk.PhotoImage(Image.open("/tmp/uengine-runner-android-app-icon.png").resize((256, 256), Image.ANTIALIAS))).pack()
|
||||||
|
image.close()
|
||||||
info = '''包名:{}
|
info = '''包名:{}
|
||||||
中文名:{}
|
中文名:{}
|
||||||
Activity:{}
|
Activity:{}
|
||||||
版本:{}'''.format(GetApkPackageName(path), GetApkChineseLabel(path), GetApkActivityName(path), GetApkVersion(path))
|
版本:{}'''.format(GetApkPackageName(path), GetApkChineseLabel(path), GetApkActivityName(path), GetApkVersion(path))
|
||||||
ttk.Label(tab1, text=info).pack()
|
ttk.Label(tab1, text=info).pack()
|
||||||
|
ttk.Button(tab1, text="查看程序评分情况", command=ApkInformation.ShowMap).pack()
|
||||||
|
ttk.Button(tab1, text="上传程序评分情况", command=ApkInformation.UpdateMark).pack()
|
||||||
|
|
||||||
|
def UpdateMark():
|
||||||
|
#message = tk.Toplevel()
|
||||||
|
#message.iconphoto(False, tk.PhotoImage(file=iconPath))
|
||||||
|
choose = easygui.indexbox(title="选择评分", choices=["含有不良信息", "0分", "1分", "2分", "3分", "4分", "5分", "取消"], msg="""选择应用“{}”的使用评分。建议参考如下规范进行评分:
|
||||||
|
含有不良信息(-1分):含有违法违规信息(如果有就不要选择其它选项了)
|
||||||
|
0星:完全无法使用,连安装都有问题
|
||||||
|
1星:完全无法使用,但是能正常安装
|
||||||
|
2星:可以打开,但只能使用一点点功能
|
||||||
|
3星:勉强能使用,运行也不大流畅
|
||||||
|
4星:大部分功能正常,运行流畅(可能会有点小卡)
|
||||||
|
5星:完全正常且非常流畅,没有任何功能和性能问题,就和直接在手机上用一样
|
||||||
|
""".format(GetApkChineseLabel(path)))
|
||||||
|
print(choose)
|
||||||
|
if choose == None or choose == 7:
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
messagebox.showinfo(title="提示", message=requests.post("http://120.25.153.144/uengine-runner/app/check/add.php", {"Package": GetApkPackageName(path), "Type": choose}).text)
|
||||||
|
except:
|
||||||
|
messagebox.showerror(title="错误", message="无法连接服务器!无法进行评分!")
|
||||||
|
|
||||||
|
def ShowMap():
|
||||||
|
package = GetApkPackageName(path)
|
||||||
|
if package == None or package == "":
|
||||||
|
messagebox.showerror(title="错误", message="该应用安装包异常,无法查询相关数据!")
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
data = json.loads(requests.get("http://120.25.153.144/uengine-runner/app/check/" + package +"/data.json").text)
|
||||||
|
print(data)
|
||||||
|
except:
|
||||||
|
messagebox.showinfo(title="错误", message="此程序暂时没有评分,欢迎您贡献第一个评分!")
|
||||||
|
return
|
||||||
|
index = numpy.arange(len(data))
|
||||||
|
print(index)
|
||||||
|
chinese = GetApkChineseLabel(path)
|
||||||
|
fig = matplotlib.pylab.figure()
|
||||||
|
fig.canvas.set_window_title("“" + chinese + "”的用户评分(数据只供参考)")
|
||||||
|
fonts = matplotlib.font_manager.FontProperties(fname='/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc') # 用于支持中文显示,需要依赖fonts-noto-cjk
|
||||||
|
matplotlib.pylab.barh(index, data)
|
||||||
|
matplotlib.pylab.yticks(index, ["不良信息", "0分", "1分", "2分", "3分", "4分", "5分"], fontproperties=fonts)
|
||||||
|
matplotlib.pylab.xlabel("用户评分数", fontproperties=fonts)
|
||||||
|
matplotlib.pylab.ylabel("等级", fontproperties=fonts)
|
||||||
|
matplotlib.pylab.title("“" + chinese + "”的用户评分(数据只供参考)", fontproperties=fonts)
|
||||||
|
matplotlib.pylab.show()
|
||||||
|
|
||||||
|
|
||||||
class AdbChangeUengineDisplaySize():
|
class AdbChangeUengineDisplaySize():
|
||||||
@@ -681,6 +851,7 @@ class AdbChangeUengineDisplaySize():
|
|||||||
global displayY
|
global displayY
|
||||||
global displaySize
|
global displaySize
|
||||||
message = tk.Toplevel()
|
message = tk.Toplevel()
|
||||||
|
message.iconphoto(False, tk.PhotoImage(file=iconPath))
|
||||||
messageFrame = ttk.Frame(message)
|
messageFrame = ttk.Frame(message)
|
||||||
|
|
||||||
displaySize = tk.StringVar()
|
displaySize = tk.StringVar()
|
||||||
@@ -819,6 +990,7 @@ class AddNewUengineDesktopLink():
|
|||||||
global activityName
|
global activityName
|
||||||
global packageName
|
global packageName
|
||||||
message = tk.Toplevel()
|
message = tk.Toplevel()
|
||||||
|
message.iconphoto(False, tk.PhotoImage(file=iconPath))
|
||||||
|
|
||||||
tipsLabel = ttk.Label(message, text=AddNewUengineDesktopLink.addTips)
|
tipsLabel = ttk.Label(message, text=AddNewUengineDesktopLink.addTips)
|
||||||
packageName = ttk.Combobox(message, width=30)
|
packageName = ttk.Combobox(message, width=30)
|
||||||
@@ -974,7 +1146,7 @@ updateThingsString = "\n".join(information["Update"])
|
|||||||
title = "{} {}".format(langFile[lang]["Main"]["MainWindow"]["Title"], version)
|
title = "{} {}".format(langFile[lang]["Main"]["MainWindow"]["Title"], version)
|
||||||
updateTime = information["Time"]
|
updateTime = information["Time"]
|
||||||
updateThings = "{} 更新内容:\n{}\n更新时间:{}".format(version, updateThingsString, updateTime, time.strftime("%Y"))
|
updateThings = "{} 更新内容:\n{}\n更新时间:{}".format(version, updateThingsString, updateTime, time.strftime("%Y"))
|
||||||
iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0])
|
iconPath = "{}/runner.png".format(os.path.split(os.path.realpath(__file__))[0])
|
||||||
desktop = programPath + "/UengineAndroidProgramList.desktop"
|
desktop = programPath + "/UengineAndroidProgramList.desktop"
|
||||||
desktopName = "UengineAndroidProgramList.desktop"
|
desktopName = "UengineAndroidProgramList.desktop"
|
||||||
contribute = "\n".join(information["Contribute"])
|
contribute = "\n".join(information["Contribute"])
|
||||||
@@ -1006,6 +1178,24 @@ if not os.path.exists(get_home() + "/.config/uengine-runner/SaveApkIcon.json"):
|
|||||||
write_txt(get_home() + "/.config/uengine-runner/SaveApkIcon.json", json.dumps({"path": "~"})) # 写入(创建)一个配置文件
|
write_txt(get_home() + "/.config/uengine-runner/SaveApkIcon.json", json.dumps({"path": "~"})) # 写入(创建)一个配置文件
|
||||||
if not os.path.exists(get_home() + "/.config/uengine-runner/SaveApk.json"): # 如果没有配置文件
|
if not os.path.exists(get_home() + "/.config/uengine-runner/SaveApk.json"): # 如果没有配置文件
|
||||||
write_txt(get_home() + "/.config/uengine-runner/SaveApk.json", json.dumps({"path": "~"})) # 写入(创建)一个配置文件
|
write_txt(get_home() + "/.config/uengine-runner/SaveApk.json", json.dumps({"path": "~"})) # 写入(创建)一个配置文件
|
||||||
|
if not os.path.exists(get_home() + "/.config/uengine-runner/setting.json"):
|
||||||
|
choose = None
|
||||||
|
choose = easygui.indexbox(msg="""在使用本程序前,请选择安装Apk包的设置以便更好的运行,下列选项的详细介绍:
|
||||||
|
|
||||||
|
不备份Apk包直接安装:适用于Deepin(旧版UEngine),安装较快,不受/tmp大小所限,但Deepin23和UOS(新版UEngine)不推荐此选项,因为安装后会自动删除Apk安装包;
|
||||||
|
备份Apk包然后在安装后自动拷贝原先目录:适用于Deepin23和UOS(新版UEngine),安装较慢,受/tmp大小所限,安装后不会丢失Apk,Deepin(旧版UEngine)不推荐使用该选项;
|
||||||
|
|
||||||
|
|
||||||
|
后期可以在程序主界面的菜单栏的“程序”=>“设置”里进行修改,
|
||||||
|
如果不知道正在使用的系统是什么版本可以打开系统设置查看。
|
||||||
|
""", title="设置", choices=["不备份Apk包直接安装", "备份Apk包然后在安装后自动拷贝原先目录"])
|
||||||
|
if choose == None:
|
||||||
|
root = tk.Tk()
|
||||||
|
root.withdraw()
|
||||||
|
messagebox.showinfo(title="提示", message="必须选择一个选项!否则无法进入程序!")
|
||||||
|
sys.exit()
|
||||||
|
write_txt(get_home() + "/.config/uengine-runner/setting.json", json.dumps({"SaveApk": int(choose)}))
|
||||||
|
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
# 设置变量
|
# 设置变量
|
||||||
@@ -1079,12 +1269,32 @@ def showhelp():
|
|||||||
def ChgTips():
|
def ChgTips():
|
||||||
HelpStr.set(tips)
|
HelpStr.set(tips)
|
||||||
LabText.config(wraplength=350)
|
LabText.config(wraplength=350)
|
||||||
|
def Egg(event):
|
||||||
|
try:
|
||||||
|
lists = json.loads(requests.get("http://120.25.153.144/uengine-runner/VersionList.json").text)
|
||||||
|
data = []
|
||||||
|
for i in lists:
|
||||||
|
data.append(int(requests.get("http://120.25.153.144/uengine-runner/{}/data.txt".format(i)).text))
|
||||||
|
except:
|
||||||
|
messagebox.showerror(title="错误", message="服务器出错!数据获取失败!")
|
||||||
|
return
|
||||||
|
fig = matplotlib.pylab.figure()
|
||||||
|
fig.canvas.set_window_title("“UEngine 运行器”安装数(数据只供参考)")
|
||||||
|
matplotlib.pylab.plot(lists, data)
|
||||||
|
index = numpy.arange(len(lists))
|
||||||
|
fonts = matplotlib.font_manager.FontProperties(fname='/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc') # 用于支持中文显示,需要依赖fonts-noto-cjk
|
||||||
|
matplotlib.pylab.xlabel("版本号", fontproperties=fonts)
|
||||||
|
matplotlib.pylab.ylabel("安装数", fontproperties=fonts)
|
||||||
|
|
||||||
|
matplotlib.pylab.title("“UEngine 运行器”安装数(数据只供参考)", fontproperties=fonts)
|
||||||
|
matplotlib.pylab.show()
|
||||||
|
|
||||||
BtnReadme = ttk.Button(FrmMenu, text="使用说明",width=14,command=ChgTips)
|
BtnReadme = ttk.Button(FrmMenu, text="使用说明",width=14,command=ChgTips)
|
||||||
BtnLog = ttk.Button(FrmMenu, text="更新内容",width=14,command=ChgLog)
|
BtnLog = ttk.Button(FrmMenu, text="更新内容",width=14,command=ChgLog)
|
||||||
BtnZujian = ttk.Button(FrmMenu, text="程序依赖的组件",width=14,command=ChgDep)
|
BtnZujian = ttk.Button(FrmMenu, text="程序依赖的组件",width=14,command=ChgDep)
|
||||||
BtnGongxian = ttk.Button(FrmMenu, text="有贡献的开发者",width=14,command=ChgCon)
|
BtnGongxian = ttk.Button(FrmMenu, text="有贡献的开发者",width=14,command=ChgCon)
|
||||||
BtnAbout = ttk.Button(FrmMenu, text="关于",width=14,command=ChgAbout)
|
BtnAbout = ttk.Button(FrmMenu, text="关于",width=14,command=ChgAbout)
|
||||||
|
BtnAbout.bind("<Double-Button-1>", Egg)
|
||||||
|
|
||||||
|
|
||||||
#layout
|
#layout
|
||||||
@@ -1109,7 +1319,7 @@ def showhelp():
|
|||||||
###########################
|
###########################
|
||||||
# 窗口创建
|
# 窗口创建
|
||||||
###########################
|
###########################
|
||||||
win = tk.Tk() # 创建窗口
|
|
||||||
|
|
||||||
# 设置窗口
|
# 设置窗口
|
||||||
style = ttkthemes.ThemedStyle(win)
|
style = ttkthemes.ThemedStyle(win)
|
||||||
@@ -1134,13 +1344,10 @@ win.geometry(""+"+{:.0f}+{:.0f}".format(x, y))
|
|||||||
FrmInstall = ttk.Frame(window)
|
FrmInstall = ttk.Frame(window)
|
||||||
#FrmUninstall = ttk.Frame(window)
|
#FrmUninstall = ttk.Frame(window)
|
||||||
LabApkPath = ttk.Label(window, text=langFile[lang]["Main"]["MainWindow"]["LabApkPath"])
|
LabApkPath = ttk.Label(window, text=langFile[lang]["Main"]["MainWindow"]["LabApkPath"])
|
||||||
#LabUninstallPath = ttk.Label(window, text=langFile[lang]["Main"]["MainWindow"]["LabUninstallPath"])
|
|
||||||
ComboInstallPath = ttk.Combobox(window, width=50)
|
ComboInstallPath = ttk.Combobox(window, width=50)
|
||||||
#ComboUninstallPath = ttk.Combobox(window, width=50)
|
|
||||||
BtnFindApk = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnFindApk"], command=FindApk)
|
BtnFindApk = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnFindApk"], command=FindApk)
|
||||||
BtnInstall = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnInstall"], command=Button3Install)
|
BtnInstall = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnInstall"], command=Button3Install)
|
||||||
BtnShowUengineApp = ttk.Button(window, text=langFile[lang]["Main"]["MainWindow"]["BtnShowUengineApp"], command=Button5Click)
|
BtnShowUengineApp = ttk.Button(window, text=langFile[lang]["Main"]["MainWindow"]["BtnShowUengineApp"], command=Button5Click)
|
||||||
#BtnUninstallApkBrowser = ttk.Button(FrmUninstall, text=langFile[lang]["Main"]["MainWindow"]["BtnUninstallApkBrowser"], command=BtnFindUninstallApkClk)
|
|
||||||
BtnUninstall = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnUninstall"], command=ButtonClick8)
|
BtnUninstall = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnUninstall"], command=ButtonClick8)
|
||||||
Btngeticon = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["Btngeticon"], command=SaveIconToOtherPath)
|
Btngeticon = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["Btngeticon"], command=SaveIconToOtherPath)
|
||||||
BtnSaveApk = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnSaveApk"], command=SaveInstallUengineApp)
|
BtnSaveApk = ttk.Button(FrmInstall, text=langFile[lang]["Main"]["MainWindow"]["BtnSaveApk"], command=SaveInstallUengineApp)
|
||||||
@@ -1168,6 +1375,7 @@ menu.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Name"],
|
|||||||
menu.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Name"], menu=help)
|
menu.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Name"], menu=help)
|
||||||
|
|
||||||
programmenu.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][0]["Menu"][0], command=CleanProgramHistory)
|
programmenu.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][0]["Menu"][0], command=CleanProgramHistory)
|
||||||
|
programmenu.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][0]["Menu"][2], command=SettingWindow.ShowWindow)
|
||||||
programmenu.add_separator() # 设置分界线
|
programmenu.add_separator() # 设置分界线
|
||||||
programmenu.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][0]["Menu"][1], command=window.quit) # 设置“退出程序”
|
programmenu.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][0]["Menu"][1], command=window.quit) # 设置“退出程序”
|
||||||
|
|
||||||
@@ -1188,7 +1396,6 @@ 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"][1], command=AdbStopServer)
|
||||||
adbServer.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][1]["Menu"][1]["Menu"][2], command=AdbKillAdbProgress)
|
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"][1], command=OpenUengineDebBuilder)
|
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"][7], command=KeyboardToMouse)
|
||||||
uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][8], command=UengineCheckCpu)
|
uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][8], command=UengineCheckCpu)
|
||||||
@@ -1202,7 +1409,9 @@ uengine.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"
|
|||||||
uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][11]["Name"], menu=uengineRoot)
|
uengine.add_cascade(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][11]["Name"], menu=uengineRoot)
|
||||||
|
|
||||||
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"][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"][2], command=UengineRunnerBugUpload) # 设置“传bug”项
|
||||||
|
help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][4], command=ShowHelp) # 设置“更多帮助”项
|
||||||
|
help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][3], command=UpdateWindow.ShowWindow)
|
||||||
help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][1], command=showhelp) # 设置“关于这个程序”项
|
help.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][3]["Menu"][1], command=showhelp) # 设置“关于这个程序”项
|
||||||
|
|
||||||
uengineService.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Menu"][0], command=StartUengine)
|
uengineService.add_command(label=langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][2]["Menu"][0], command=StartUengine)
|
||||||
@@ -1249,7 +1458,6 @@ uengineUseAdb.configure(activebackground="dodgerblue")
|
|||||||
uengineData.configure(activebackground="dodgerblue")
|
uengineData.configure(activebackground="dodgerblue")
|
||||||
|
|
||||||
# 设置控件
|
# 设置控件
|
||||||
#ComboUninstallPath['value'] = fineUninstallApkHistory
|
|
||||||
ComboInstallPath['value'] = findApkHistory
|
ComboInstallPath['value'] = findApkHistory
|
||||||
try:
|
try:
|
||||||
if sys.argv[1] == "-i":
|
if sys.argv[1] == "-i":
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ updateThingsString = "\n".join(information["Update"])
|
|||||||
title = "UEngine 运行器 {}".format(version)
|
title = "UEngine 运行器 {}".format(version)
|
||||||
updateTime = information["Time"]
|
updateTime = information["Time"]
|
||||||
updateThings = "{} 更新内容:\n{}\n更新时间:{}".format(version, updateThingsString, updateTime, time.strftime("%Y"))
|
updateThings = "{} 更新内容:\n{}\n更新时间:{}".format(version, updateThingsString, updateTime, time.strftime("%Y"))
|
||||||
iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0])
|
iconPath = "{}/runner.png".format(os.path.split(os.path.realpath(__file__))[0])
|
||||||
desktop = "/opt/apps/uengine-runner/UengineAndroidProgramList.desktop"
|
desktop = "/opt/apps/uengine-runner/UengineAndroidProgramList.desktop"
|
||||||
desktopName = "UengineAndroidProgramList.desktop"
|
desktopName = "UengineAndroidProgramList.desktop"
|
||||||
contribute = "\n".join(information["Contribute"])
|
contribute = "\n".join(information["Contribute"])
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ def OpenGithubIssues():
|
|||||||
###########################
|
###########################
|
||||||
# 程序信息
|
# 程序信息
|
||||||
###########################
|
###########################
|
||||||
iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0])
|
iconPath = "{}/runner.png".format(os.path.split(os.path.realpath(__file__))[0])
|
||||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||||
information = json.loads(readtxt(programPath + "/information.json"))
|
information = json.loads(readtxt(programPath + "/information.json"))
|
||||||
version = information["Version"]
|
version = information["Version"]
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
# 更新时间:2021年08月30日
|
# 更新时间:2021年08月30日
|
||||||
#########################################
|
#########################################
|
||||||
import os
|
import os
|
||||||
import shutil
|
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
import ttkthemes
|
import ttkthemes
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Comment=UEngine App List
|
|||||||
Comment[zh]=UEngine 程序菜单
|
Comment[zh]=UEngine 程序菜单
|
||||||
Encoding=UTF-8
|
Encoding=UTF-8
|
||||||
Exec=/usr/bin/uengine launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
|
Exec=/usr/bin/uengine launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
|
||||||
Icon=/opt/apps/uengine-runner/icon.png
|
Icon=/opt/apps/uengine-runner/menu.svg
|
||||||
MimeType=
|
MimeType=
|
||||||
Name=UEngine App List
|
Name=UEngine App List
|
||||||
Name[zh]=UEngine 程序菜单
|
Name[zh]=UEngine 程序菜单
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Encoding=UTF-8
|
|||||||
Categories=System;
|
Categories=System;
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Exec=/usr/bin/uengine-apk-builder %F
|
Exec=/usr/bin/uengine-apk-builder %F
|
||||||
Icon=/opt/apps/uengine-runner/icon.png
|
Icon=/opt/apps/uengine-runner/builer.svg
|
||||||
Name=Build Apk To Deb(UEngine Runner)
|
Name=Build Apk To Deb(UEngine Runner)
|
||||||
Comment=Build Apk To Deb(UEngine Runner)
|
Comment=Build Apk To Deb(UEngine Runner)
|
||||||
Comment[zh]=打包 deb(UEngine 运行器)
|
Comment[zh]=打包 deb(UEngine 运行器)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Encoding=UTF-8
|
|||||||
Categories=System;
|
Categories=System;
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Exec=/usr/bin/uengine-runner -i %F
|
Exec=/usr/bin/uengine-runner -i %F
|
||||||
Icon=/opt/apps/uengine-runner/icon.png
|
Icon=/opt/apps/uengine-runner/runner.svg
|
||||||
Name=Install Or Uninstall APK(UEngine runner)
|
Name=Install Or Uninstall APK(UEngine runner)
|
||||||
Comment=Install Or Uninstall APK(UEngine runner)
|
Comment=Install Or Uninstall APK(UEngine runner)
|
||||||
Comment[zh]=安装/卸载 APK(UEngine 运行器)
|
Comment[zh]=安装/卸载 APK(UEngine 运行器)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Encoding=UTF-8
|
|||||||
Categories=System;
|
Categories=System;
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Exec=/usr/bin/uengine-apk-builder %F
|
Exec=/usr/bin/uengine-apk-builder %F
|
||||||
Icon=/opt/apps/uengine-runner/icon.png
|
Icon=/opt/apps/uengine-runner/builer.svg
|
||||||
Name=uengine Apk Builder
|
Name=uengine Apk Builder
|
||||||
Comment=UEngine Apk Builder
|
Comment=UEngine Apk Builder
|
||||||
Comment[zh]=UEngine 应用打包器
|
Comment[zh]=UEngine 应用打包器
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Encoding=UTF-8
|
|||||||
Categories=System;
|
Categories=System;
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Exec=/usr/bin/uengine-runner
|
Exec=/usr/bin/uengine-runner
|
||||||
Icon=/opt/apps/uengine-runner/icon.png
|
Icon=/opt/apps/uengine-runner/runner.svg
|
||||||
Name=UEngine Runner
|
Name=UEngine Runner
|
||||||
Comment=UEngine Runner
|
Comment=UEngine Runner
|
||||||
Comment[zh]=UEngine 运行器
|
Comment[zh]=UEngine 运行器
|
||||||
|
|||||||