Compare commits

..

62 Commits

Author SHA1 Message Date
c3800a2514 加ubuntu安装包 2022-06-21 18:28:50 +08:00
6b42f7eef6 改README 2022-06-21 18:18:35 +08:00
a6baf834c7 基本完工 2022-06-21 10:24:27 +08:00
3f9aa55d8d 即将打包 2022-06-21 10:01:24 +08:00
9660c8fb72 制作平滑升级包ing…… 2022-06-20 22:29:10 +08:00
acaa13e8ae 新增启动脚本 2022-06-20 09:22:23 +08:00
176025a3c5 更新开源许可证 2022-06-20 00:03:25 +00:00
8fb872d8ec 初步打包调试deb 2022-06-19 21:46:58 +08:00
79674c1c2f 小改deb脚本 2022-06-19 21:20:28 +08:00
b7f01d0ff6 更新了UEngine的Ubuntu安装程序 2022-06-19 21:04:16 +08:00
c030ab2c16 初步的未知来源安装开启功能完成 2022-06-19 14:03:40 +08:00
8747f69065 先立flag 2022-06-19 08:48:38 +08:00
b851b12a62 又加了一点点翻译 2022-06-18 23:01:23 +08:00
da0db9b0fb 没更新什么 2022-06-15 21:56:01 +08:00
22d1f1ab87 修改语言配置文件 2022-06-12 22:25:02 +08:00
4a5d060c43 API有误 2022-05-22 20:34:12 +08:00
d5b37e3951 更新README 2022-05-22 08:04:17 +08:00
ed2155b83e 1.6.1更新+API更新 2022-05-21 18:11:11 +08:00
05d977030c 添加忘记了的开发者名单以及添加了部分函数 2022-05-21 12:37:08 +08:00
c77bbceeb2 添加函数(包括打包deb的函数) 2022-05-21 12:06:17 +08:00
7f36a1ff3c 加了一点函数 2022-05-16 22:21:59 +08:00
d68f42c368 添加了API函数以及文档 2022-05-15 21:54:04 +08:00
c9a3db2f37 首次添加 API 接口 2022-05-15 20:14:02 +08:00
677ff4c16b 首次添加 API 接口 2022-05-15 20:13:18 +08:00
65eaf17d85 目前包没问题 2022-02-18 13:21:23 +08:00
72cf1e0881 修复巨大bug 2022-02-15 21:56:32 +08:00
c53ad469e5 deb包有一点小问题 2022-02-12 22:21:12 +08:00
34e4d83104 更新一下README 2022-02-12 22:15:17 +08:00
5b85af521e 完成1.6.0 2022-02-12 22:03:40 +08:00
158e99c3c4 即将完成! 2022-02-12 21:55:33 +08:00
5e31ca90c5 完善帮助文档 2022-02-11 19:25:47 +08:00
35fc896aaa 即将完成1.6.0 2022-02-11 16:38:03 +08:00
9510660321 新增程序彩蛋、更新窗口<初步>(昨天忘记上传了) 2022-02-09 11:50:23 +08:00
282bb35444 改一下README的老旧部分 2022-02-07 22:43:23 +08:00
bb813fc866 新增评分功能 2022-02-07 22:35:15 +08:00
d081862a4a 添加图标 2022-02-06 10:33:53 +08:00
09857468f7 1.5.3完成 2021-12-12 12:33:21 +08:00
2abc67e426 初步完成1.5.3 2021-12-12 11:28:22 +08:00
c4ab276ab5 更新 README 2021-11-28 20:47:52 +08:00
016c397529 1.5.2 2021-11-28 16:11:01 +08:00
4f0fafbf17 一点点东西 2021-10-26 20:19:42 +08:00
ad5f08ca38 改个README.md 2021-10-05 18:31:25 +08:00
618a8c4941 Merge branch 'ChangeTestUpload' into main 2021-10-05 18:29:02 +08:00
9ef3c45ff6 Change 2021-10-05 18:26:32 +08:00
ac677c1bb1 1.5.1 2021-10-05 18:16:50 +08:00
655b45de4d 初步添加反馈功能 2021-10-03 20:51:46 +08:00
278e1722a5 初步添加反馈功能 2021-10-03 20:34:07 +08:00
34937827d9 初步修复安装图标无法正常点击运行等问题 2021-10-03 17:42:30 +08:00
712f2d25cc 1.5.1初步 2021-09-26 20:16:29 +08:00
4845337d73 README 日期错误 2021-09-20 22:01:25 +08:00
4fd7840bbe 1.5.0雏形 2021-09-20 21:58:32 +08:00
4ec0887a58 初步支持英语 2021-09-20 17:10:05 +08:00
d105f85510 1.4.3 2021-09-11 16:38:31 +08:00
8057f2a596 初传 2021-09-11 15:51:23 +08:00
74831ea4c2 修改 deb 包 2021-08-30 18:05:13 +08:00
bcaae02aec 1.4.2 2021-08-30 17:51:50 +08:00
4b889b6056 1.4.2 2021-08-30 17:49:12 +08:00
76d3710963 改一下菜单栏 2021-08-27 09:18:31 +08:00
89aa00ebf5 1.4.1 2021-08-26 15:24:26 +08:00
a2038ac40e 小改README和传GITHUB 2021-08-19 16:03:43 +08:00
530c3ad384 1.4.0(1.3.3没了) 2021-08-19 14:21:03 +08:00
c9a1316022 1.4.0(1.3.3没了) 2021-08-19 14:08:05 +08:00
265 changed files with 17035 additions and 2082 deletions

1
.idea/vcs.xml generated
View File

@@ -2,5 +2,6 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/Internet/random-questions/Question" vcs="Git" />
</component>
</project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

BIN
1/我好命苦.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 KiB

BIN
1/气死我了.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 870 KiB

129
Android X86/main.py Normal file
View File

@@ -0,0 +1,129 @@
import os
import sys
import threading
#import ttkthemes
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.messagebox as messagebox
class AddVirtualMachine():
def ShowWindow():
messgae = tk.Toplevel()
chooseImageString = tk.StringVar()
chooseImageString.set("请选择……")
nameTips = tk.Label(messgae, text="虚拟机名称")
nameEntry = tk.Entry(messgae, width=50)
memoryTips = tk.Label(messgae, text="虚拟机内存分配")
memoryDefultValue = tk.Checkbutton(messgae, text="默认值")
memoryValue = tk.Scale(messgae, from_=1, orient=tk.HORIZONTAL)
chooseImageTips = tk.Label(messgae, text="选择虚拟机镜像:")
chooseImage = tk.OptionMenu(messgae, chooseImageString, [""])
quicklyFasterSpeed = tk.Checkbutton(messgae, text="启动 kvm 加速")
tipsThings = tk.Label(messgae, text="虚拟机备注:")
tipsThingsTips = tk.Text(messgae, height=5, width=50)
controlFrame = tk.Frame(messgae)
cancal = tk.Button(controlFrame ,text="取消")
ok = tk.Button(controlFrame, text="确定")
messgae.title("添加 Android X86 虚拟机")
messgae.resizable(0, 0)
memoryValue.set(33)
cancal.grid(row=0, column=0)
ok.grid(row=0, column=1)
nameTips.grid(row=0, column=0)
nameEntry.grid(row=0, column=1, columnspan=3)
memoryTips.grid(row=1, column=0)
memoryDefultValue.grid(row=1, column=1)
memoryValue.grid(row=1, column=2)
chooseImageTips.grid(row=2, column=0)
chooseImage.grid(row=2, column=1)
quicklyFasterSpeed.grid(row=2, column=2)
tipsThings.grid(row=3, column=0)
tipsThingsTips.grid(row=3, column=1, columnspan=3, rowspan=2, sticky=tk.W)
controlFrame.grid(row=5, column=3, sticky=tk.E)
#controlFrame.grid(row=5, column=2)
messgae.mainloop()
class DelVirtualMachine():
def Tips():
if messagebox.askokcancel(title="提示", message="你确定要删除此虚拟机吗?\n删除后将无法恢复!"):
messagebox.showinfo(title="提示", message="删除完毕!")
class AddVirtualImage():
def ShowWindow():
message = tk.Toplevel()
urlImageDownloadTips = tk.Label(message, text="可下载镜像:")
urlImageDownloadList = ttk.Treeview(message)
addImage = tk.Button(message, text="")
delImage = tk.Button(message, text="")
ImageTips = tk.Label(message, text="已下载镜像:")
ImageList = ttk.Treeview(message)
ok = tk.Button(message, text="确定")
message.title("下载新的镜像")
message.resizable(0, 0)
urlImageDownloadTips.grid(row=0, column=0, sticky=tk.W)
urlImageDownloadList.grid(row=1, column=0, rowspan=4)
addImage.grid(row=2, column=1)
delImage.grid(row=3, column=1)
ImageTips.grid(row=0, column=2, sticky=tk.W)
ImageList.grid(row=1, column=2, rowspan=4)
ok.grid(row=5, column=2, sticky=tk.E)
message.mainloop()
class SettingVirtualMachine():
pass
def RunVirtualMachine():
threading.Thread(target=os.system, args=["kvm --cdrom {} --hda {} -m {}G".format("", "", "")]).start()
window = tk.Tk()
virtualMachineList = ttk.Treeview(window)
addVirtualMachine = tk.Button(window, text="", command=AddVirtualMachine.ShowWindow)
delVirtualMachine = tk.Button(window, text="", command=DelVirtualMachine.Tips)
addVirtualMachineImage = tk.Button(window, text="", command=AddVirtualImage.ShowWindow)
settingVirtualMachine = tk.Button(window, text="⚙️")
runVirtualMachine = tk.Button(window, text="", command=RunVirtualMachine)
tipsThings = tk.Text(window, height=5, width=30)
menu = tk.Menu(window)
programMenu = tk.Menu(menu, tearoff=0)
yuanMenu = tk.Menu(menu, tearoff=0)
menu.add_cascade(label="程序", menu=programMenu)
menu.add_cascade(label="", menu=yuanMenu)
programMenu.add_command(label="退出程序", command=sys.exit)
yuanMenu.add_command(label="更换源")
yuanMenu.add_command(label="修改默认源")
#window.configure(bg="white")
#ttkthemes.ThemedStyle(window).set_theme("ubuntu")
window.title("Android X86 Runner")
window.resizable(0, 0)
window.config(menu=menu)
runVirtualMachine.configure(foreground="green")
#tipsThings.configure(bg="white", foreground="black", state=tk.DISABLED)
virtualMachineList.grid(row=0, column=0, rowspan=3)
addVirtualMachine.grid(row=0, column=1)
delVirtualMachine.grid(row=0, column=2)
addVirtualMachineImage.grid(row=0, column=3)
settingVirtualMachine.grid(row=0, column=4)
runVirtualMachine.grid(row=0, column=5)
tipsThings.grid(row=2, column=1, columnspan=5, sticky=tk.W)
window.mainloop()

BIN
Help/1-1-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
Help/1-1-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
Help/1-1-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
Help/1-1-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
Help/1-1-5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
Help/1-2-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
Help/1-2-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
Help/1-3-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
Help/1-4-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
Help/1-5-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
Help/1-5-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

BIN
Help/1-6-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
Help/1-6-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
Help/1-6-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
Help/1-7-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
Help/1-8-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
Help/1-9-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
Help/1-9-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
Help/1-9-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
Help/1-9-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

BIN
Help/1-9-5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
Help/1-9-6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
Help/1-9-7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

165
Help/index.html Normal file
View 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所在目录右击=&gt;打开方式=&gt;安装或卸载 APKUEngine 运行器)<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所在目录右击=&gt;打开方式=&gt;安装或卸载 APKUEngine 运行器)<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>点击“关于”=&gt;“检查更新”,打开更新窗口</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>打开启动器=&gt;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>启动器=&gt;UEngine 应用打包器</p>
<h5 id='方法二-4'>方法二</h5>
<p>打开要打包的 Apk 所在目录,右击=&gt;“打开方式”=&gt;“打包 debUEngine 运行器)”(接下来可以略过步骤一)</p>
<p><img src="1-9-1.png" referrerpolicy="no-referrer"></p>
<h5 id='方式三'>方式三</h5>
<p>打开 UEngine 运行器点击菜单栏的“UEngine”=&gt;“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
View 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 运行器
![](1-1-1.png)
2. 点击浏览按钮找到想要安装的Apk
![](1-1-2.png)
3. 点击安装按钮,输入密码
![](1-1-3.png)
4. 提示“操作完成”,在启动器找到新安装的图标启动即可
![](1-1-4.png)
![](1-1-5.png)
#### 方法二
1. 打开要安装的Apk所在目录右击=>打开方式=>安装或卸载 APKUEngine 运行器)
![](1-2-1.png)
2. 点击安装按钮,输入密码
![](1-1-3.png)
3. 提示“操作完成”,在启动器找到新安装的图标启动即可
![](1-1-4.png)
![](1-2-2.png)
### 卸载Apk
#### 方法一
1. 打开 UEngine 运行器
![](1-1-1.png)
2. 点击浏览按钮找到想要卸载的Apk
![](1-1-2.png)
3. 点击卸载按钮,输入密码
![](1-1-3.png)
4. 提示“操作完成”,卸载完成
![](1-1-4.png)
#### 方法二
1. 打开要安装的Apk所在目录右击=>打开方式=>安装或卸载 APKUEngine 运行器)
![](1-2-1.png)
2. 点击卸载按钮,输入密码
![](1-1-3.png)
3. 提示“操作完成”,卸载完成
![](1-1-4.png)
### 查询Apk信息
1. 打开 UEngine 运行器
![](1-1-1.png)
2. 点击“Apk 信息” 按钮即可查询Apk信息
![](1-3-1.png)
### 查看程序评分
1. 打开 UEngine 运行器
![](1-1-1.png)
2. 点击“Apk 信息” 按钮即可查询Apk信息
![](1-3-1.png)
3. 点击“查看程序评分情况”即可查看其他用户对程序的评分
![](1-4-1.png)
### 上传用户评分
1. 打开 UEngine 运行器
![](1-1-1.png)
2. 点击“Apk 信息” 按钮即可查询Apk信息
![](1-3-1.png)
3. 点击“上传程序评分情况”,按照要求进行评分
![](1-5-1.png)
4. 如果提示“提交成功!感谢您的提交”就代表评分成功
![](1-5-2.png)
### 更新程序
1. 打开 UEngine 运行器
![](1-1-1.png)
2. 点击“关于”=>“检查更新”,打开更新窗口
![](1-6-1.png)
3. **保证您的电脑没有运行其它Python应用以及本程序所有工作都已经完成**再点击“更新更新过程中会关闭所有Python应用包括这个应用输入密码以进行更新
![](1-6-2.png)
4. 提示“更新完毕!”后重新启动 UEngine 运行器就更新完毕了
![](1-6-3.png)
### 保存图标
1. 打开 UEngine 运行器
![](1-1-1.png)
2. 选择要保存图标的Apk点击“保存图标”按钮选择要保存的位置即可
![](1-7-1.png)
### 打开已安装的程序列表
#### 方法一
打开启动器=>UEngine 程序菜单 即可
#### 方法二
1. 打开 UEngine 运行器
![](1-1-1.png)
2. 点击“打开 UEngine 应用列表”即可
![](1-8-1.png)
### 将 Apk 打包成可以无需本应用即可安装的 deb 包
#### 打开 UEngine 打包器的三种方法
##### 方法一
启动器=>UEngine 应用打包器
##### 方法二
打开要打包的 Apk 所在目录,右击=>“打开方式”=>“打包 debUEngine 运行器)”(接下来可以略过步骤一)
![](1-9-1.png)
##### 方式三
打开 UEngine 运行器点击菜单栏的“UEngine”=>“UEngine 应用打包”
![](1-9-2.png)
#### 打包 deb
1. 打开“UEngine Apk 应用打包器”点击“浏览按钮”选择apk
![](1-9-3.png)
2. 根据实际情况勾选选项,然后点击“打包”进行打包
![](1-9-4.png)
3. 当提示“打包完成”时,打包完成,可以在桌面(一般是`/home/XXX/Desktop`)找到您打包的 deb 包,可以双击安装
![](1-9-5.png)
![](1-9-6.png)
![](1-9-7.png)
©2021-2022

1047
LICENSE Normal file → Executable file

File diff suppressed because it is too large Load Diff

336
Language.json Normal file
View File

@@ -0,0 +1,336 @@
{
"zh_CN.UTF-8": {
"Main": {
"MainWindow": {
"Title": "UEngine 运行器",
"LabApkPath": "安装/卸载 APK",
"LabUninstallPath": "卸载 Apk",
"BtnFindApk": "浏览",
"BtnInstall": "安装",
"BtnShowUengineApp": "打开 UEngine 应用列表",
"BtnUninstallApkBrowser": "浏览",
"BtnUninstall": "卸载",
"Btngeticon": "保存图标",
"BtnSaveApk": "保存Apk",
"BtnApkInformation": "Apk 信息",
"Error": {
"InstallError": "信息没有填写完整,无法继续安装 APK",
"UninstallError": "信息没有填写完整,无法继续卸载 APK",
"BackApkError": "无法还原安装包\n提示新版UEngine安装后会自动删除安装包备份的Apk在/tmp/uengine-runner/bak.apk电脑重启后就会丢失",
"ChooseApkError": "你没有选择 apk 文件",
"SaveApkIconError": "本程序不支持保存该 apk 的图标",
"PathError": "路径不存在,请重试!",
"SettingReadError": "读取设置错误!无法打开设置窗口!",
"SettingSaveError": "保存设置错误!",
"ConnectServerError": "无法连接服务器!",
"ConnectServerStarError": "无法连接服务器!无法进行评分!",
"ApkFileError": "该应用安装包异常,无法查询相关数据!",
"InputDataError": "你输入的数值不正确!"
},
"Information": {
"Title": "提示",
"CompleteInformation": "完成"
},
"Answer": {
"Title": "提示",
"AllowOrDisallowUpdateAndroidAppAnswer": [
"你确定要启用 UEngine 可以安装以及使用默认的更新程序升级应用?(即允许未知来源)",
"你确定要禁用 UEngine 可以安装以及使用默认的更新程序升级应用?(即禁止未知来源)"
],
"UseAdbPackageAnswer": "你没有安装 adb 补丁,必须安装才能继续。是否安装?"
},
"Menu": [
{
"Name": "程序",
"Menu": [
"清空软件历史记录",
"退出程序",
"程序设置"
]
},
{
"Name": "adb",
"Menu": [
"Adb 连接 UEngine",
{
"Name": "Adb 服务",
"Menu": [
"打开 Adb 服务",
"停止 Adb 服务",
"杀死 Adb 进程"
]
},
"显示 Adb 连接的设备",
"Adb 修改 UEngine 分辨率",
"Adb 查看 UEngine 应用列表",
"Adb 查看 UEngine 资源使用情况",
"打开 Adb 连接 UEngine 的终端",
"使用 Scrcpy 连接 UEngine只支持使用 Snap 安装的 Scrcpy",
{
"Name": "UEngine 使用 Adb",
"Menu": [
"Adb 连接 Connect UEngine",
"允许此设备使用 Adb 连接本 UEngine需要 Root",
"禁止任何设备使用 Adb 连接本 UEngine需要 Root"
]
}
]
},
{
"Name": "UEngine",
"Menu": [
"UEngine 系统设置",
"UEngine 应用打包",
{
"Name": "UEngine 服务",
"Menu": [
"启动 UEngine 服务(需要 Root",
"关闭 UEngine 服务(需要 Root",
"重启 UEngine 服务(需要 Root"
]
},
{
"Name": "UEngine 网络桥接",
"Menu": [
"启动 UEngine 网络桥接(需要 Root",
"关闭 UEngine 网络桥接(需要 Root",
"重启 UEngine 网络桥接(需要 Root",
"加载 UEngine 网络桥接(需要 Root",
"强制加载 UEngine 网络桥接(需要 Root"
]
},
{
"Name": "UEngine 快捷方式",
"Menu": [
"发送 UEngine 应用列表到桌面",
"发送 UEngine 应用列表到启动器",
"添加/删除指定的 UEngine 快捷方式",
"清空所有 UEngine 快捷方式"
]
},
{
"Name": "UEngine 使用 Adb",
"Menu": null
},
{
"Name": "UEngine 数据",
"Menu": [
"打开 UEngine 根目录",
"打开 UEngine 用户数据目录",
"清空 UEngine 数据(需要 Root"
]
},
"UEngine 键盘映射",
"UEngine 检测 CPU 是否支持运行",
"删除 UEngine 运行检查",
"重新安装 UEngine",
{
"Name": "获取 UEngine 最高权限",
"Menu": [
"安装已经制作好的 UEngine 带最高权限的镜像",
"构建 UEngine 带最高权限的镜像到用户主目录",
"安装默认的 UEngine 镜像"
]
},
"在 Ubuntu 上安装 UEngine",
"启动/禁用UEngine安装的安卓程序程序更新",
"在 Ubuntu 上安装 UEngine"
]
},
{
"Name": "关于",
"Menu": [
"程序官网",
"关于",
"反馈程序问题和建议",
"检查更新",
"更多帮助"
]
}
]
}
},
"Uengine Apk Builder": {
"Title": "UEngine APK 应用打包器",
"label1": "要打包的 apk 路径:",
"button2": "浏览",
"button3": " 打包",
"check": "使用前缀“uengine-dc”",
"Menu": [
{
"Name": "程序",
"Menu": [
"退出程序"
]
}
]
}
},
"en_US.UTF-8": {
"Main": {
"MainWindow": {
"Title": "UEngine Runner",
"LabApkPath": "Install Or Uninstall Apk:",
"BtnFindApk": "Find",
"BtnInstall": "Install",
"BtnShowUengineApp": "Open UEngine App List",
"BtnUninstallApkBrowser": "Find",
"BtnUninstall": "Uninstall",
"Btngeticon": "Save Apk Icon",
"BtnSaveApk": "Saving Installed App Apk",
"BtnApkInformation": "Apk Information",
"Error": {
"InstallError": "You don't input the APK file path, Can't install Android program by now.",
"UninstallError": "You don't input the APK file path or android program package name, Can't uninstall Android program by now.",
"BackApkError": "Can't recover the apk\nTips: Newer UEngine will delete the APK installing file when finish install, recover apk is in \"tmp/uengine-runner/bak.apk\", but it will be lose when you restart your computer.",
"ChooseApkError": "You don't choose any APK file.",
"SaveApkIconError": "This APK file isn't allow to save the icon file.",
"PathError": "Path not found, please try again",
"SettingReadError": "Read user setting error! Can't to continue to set!",
"SettingSaveError": "Setting can't save",
"ConnectServerError": "Can't connect the cloud server!",
"ConnectServerStarError": "Can't connect the cloud server! So can't give star for the app!",
"ApkFileError": "This apk file is error and can't find any data about the apk file!",
"InputDataError": "Your input error data!"
},
"Information": {
"Title": "Tips",
"CompleteInformation": "Complete!"
},
"Answer": {
"Title": "Tips",
"AllowOrDisallowUpdateAndroidAppAnswer": [
"Are you sure to allow UEngine to install or update other android program? (Allow )(即允许未知来源)",
"Are you sure to disallow UEngine to install or update other android program? (Allow )(即允许未知来源)"
],
"UseAdbPackageAnswer": "You don't install adb package with UEngine, you must install, and after install you can connect to set.\nDo you want to install?"
},
"Menu": [
{
"Name": "Program",
"Menu": [
"Clean Program History",
"Exit The Program",
"Program Setting"
]
},
{
"Name": "adb",
"Menu": [
"Use Adb To Connect UEngine",
{
"Name": "Adb Services",
"Menu": [
"Open Adb Service",
"Close Adb Service",
"Kill Adb Program"
]
},
"Show Adb To Connect Devices",
"Use Adb To Change UEngine Display Size",
"Use Adb To Show UEngine Installing Program List",
"Use Adb To Show UEngine Using System Resources",
"Open Adb Console With UEngine",
"Use Scrcpy Connect UEngine (Only Support Using Scrcpy With Installing the Scrcpy)",
{
"Name": "UEngine Use Adb",
"Menu": [
"Use Adb To Connect UEngine",
"Allow This Devices Using Adb To Connect The UEngine (Allow Need Using For Root)",
"Unallow Any Devices Using Adb To Connect The UEngine (Unallow Need Using For Root)"
]
}
]
},
{
"Name": "UEngine",
"Menu": [
"UEngine System Control Panel",
"UEngine Android App Builder",
{
"Name": "UEngine Service",
"Menu": [
"Open UEngine Service (It Need Run With Root)",
"Close UEngine Service (It Need Run With Root)",
"Restart UEngine Service (It Need Run With Root)"
]
},
{
"Name": "UEngine Internet Connecting",
"Menu": [
"Open UEngine Internet Bridge (It Need Run With Root)",
"Close UEngine Internet Bridge (It Need Run With Root)",
"Restart UEngine Internet Bridge (It Need Run With Root)",
"Load UEngine Internet Bridge (It Need Run With Root)",
"Force Loading UEngine Internet Bridge (It Need Run With Root)"
]
},
{
"Name": "UEngine App Link",
"Menu": [
"Send UEngine Program List To Desktop",
"Send UEngine Program List To Launcher",
"Add Or Delete UEngine App Link",
"Delete All UEngine App Link"
]
},
{
"Name": "UEngine Use Adb",
"Menu": null
},
{
"Name": "UEngine Data",
"Menu": [
"Open UEngine Root Folder",
"Open UEngine User Folder",
"Delete All UEngine Data (It Need Run With Root)"
]
},
"UEngine Keyboard",
"UEngine Check CPU Can Or Can't Run",
"Delete UEngine Runing Checking",
"Reinstall UEngine",
{
"Name": "Get UEngine Root User",
"Menu": [
"Install UEngine Image With Root User",
"Build An UEngine Image With Root User In Your Home Path",
"Install Defult UEngine Image"
]
},
"Install UEngine On Ubuntu",
"Allow/Disallow UEngine To Install Or Update Other Android Program",
"Install UEngine On Ubuntu"
]
},
{
"Name": "About",
"Menu": [
"Program WebSize",
"About This Program",
"Upload Problem And Advice",
"Update This Program",
"More Help"
]
}
]
}
},
"Uengine Apk Builder": {
"Title": "UEngine APK Builder",
"label1": "Will Build APK Path",
"button2": "Find",
"button3": " Build",
"check": "Use Prefix With \"uengine-dc\"",
"Menu": [
{
"Name": "Program",
"Menu": [
"Exit The Program"
]
}
]
}
}
}

232
README.md Normal file → Executable file
View File

@@ -1,14 +1,156 @@
# uengine 运行器 1.3.2
# UEngine 运行器 1.6.1
### 介绍
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;新版本Deepin/UOS发布后可以在应用商店安装部分官方已适配的安卓应用对爱好者来说不能自己安装APK软件包始终差点意思本程序可以为Deepin/UOS上的Uengine安卓运行环境安装自定义APK软件包并能发送安装的APK包启动菜单到桌面或系统菜单。
![主界面](https://storage.deepin.org/thread/202108152141139401_截图_选择区域_20210815213948.png)
测试平台UOS 家庭版deepin 20.2.2,UOS 专业版 1040
(自己美术功底太差,图标直接用 anbox 的了)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;新版本Deepin/UOS发布后可以在应用商店安装部分官方已适配的安卓应用对爱好者来说不能自己安装APK软件包始终差点意思本程序可以为Deepin/UOS上的UEngine安卓运行环境安装自定义APK软件包并能发送安装的APK包启动菜单到桌面或系统菜单。
![image.png](https://storage.deepin.org/thread/202206211816301171_image.png)
测试平台UOS 家庭版 21.1deepin 20.6,UOS 专业版 1040
## 安装前必读
+ **UEngine 安装时会自动把要安装的 apk 删除**,如果这个 apk 文件非常重要请**拷贝一个备份版并安装这个备份版或者在程序设置里面选择“备份APK包然后在安装后自动拷贝原先目录”选项**
![image.png](https://storage.deepin.org/thread/202205211808393526_image.png)
## 如何升级至最新版本
### 一、使用星火应用商店更新到最新版本
**1、打开星火应用商店并打开到对应的界面点击“升级”**
![image.png](https://storage.deepin.org/thread/202205220755222083_image.png)
**2、然后安装**
![image.png](https://storage.deepin.org/thread/202205220756248090_image.png)
**3、结束**
### 二、通过源更新(需要添加星火应用商店源)
输入以下命令即可:
```bash
sudo apt update
sudo apt upgrade
```
![image.png](https://storage.deepin.org/thread/202205220758088497_image.png)
### 三、使用程序自带的更新程序更新
**1、打开 UEngine 运行器然后点击“关于”=>“检查更新”点击“更新更新过程中会关闭所有Python应用包括这个应用”**
![image.png](https://storage.deepin.org/thread/202205220759382269_image.png)
**2、输入密码进行更新**
![image.png](https://storage.deepin.org/thread/202205220801175784_image.png)
**3、提示更新完毕即可**
![image.png](https://storage.deepin.org/thread/202205220801513371_image.png)
### 更新内容
#### V1.6.22022年06月21日中考假期+即将期末考试)
**※1、优化了 UEngine 运行器的英语翻译**
**※2、新增加了可以打开或关闭第三方应用安装的功能使用此功能后在UEngine里可以使用默认的APK安装程序安装应用此操作需要使用程序的Adb补丁**
**※3、新增加了 UEngine 的 Ubuntu 安装程序**
**※4、双包合一只保留了UOS打包标准可以从旧标准无缝升级推荐使用本程序的升级程序进行升级**
5、修复了本程序在 Ubuntu 上安装和卸载报错而无法继续的问题
6、优化帮助/关于窗口在高分辨率电脑上显示不全的问题
![image.png](https://storage.deepin.org/thread/202206211816301171_image.png)
#### V1.3.2
#### V1.6.12022年05月21日521
**※1、修复了打包 deb 包在 APK 的包名有大写时无法启动的问题**
**※2、提供新版本的 UEngine Root 镜像**
**※3、更新了 UEngine Root 的下载地址**
**※4、修复了本程序的“UEngine 键盘映射”无法启动的问题**
5、把构建 UEngine Root 镜像修改为多线程下载wget=>aria2
6、提供了 UEngine 运行器的 API可以从项目地址中获取
7、补上遗漏的项目参与者“星空露光”新加参与者
![截图_选择区域_20220521175308.png](https://storage.deepin.org/thread/202205211806261045_截图_选择区域_20220521175308.png)
![截图_选择区域_20220521175238.png](https://storage.deepin.org/thread/202205211806269003_截图_选择区域_20220521175238.png)
![截图_选择区域_20220521175156.png](https://storage.deepin.org/thread/202205211806255140_截图_选择区域_20220521175156.png)
![截图_tk_20220521175128.png](https://storage.deepin.org/thread/202205211806252353_截图_tk_20220521175128.png)
![截图_选择区域_20220521175342.png](https://storage.deepin.org/thread/202205211806254882_截图_选择区域_20220521175342.png)
#### V1.6.0(开学版,开学前一天完成)
**※1、更换了新的图标已完成感谢[@星空露光](https://gitee.com/Cynorkyle)**
**※2、支持程序的评分和查看分数详情的功能**
**※3、修复了在安装奇奇怪怪的安装包如格式、标识不正确的时的快捷方式图标为空以及快捷方式文本的变化**
**※4、添加更新功能可以自行升级到最新版本**
**※5、新增程序帮助**
6、新填彩蛋在“关于”=>“关于”显示的窗口双击“关于”开启)
7、修复了“UEngine 打包器”前缀选项勾选设置不生效的问题
8、修复了“UEngine 打包器” 打包的安装包版本号带 V 无法打包的情况
![1.6.0](https://storage.deepin.org/thread/202202122214208076_截图_选择区域_20220212221349.png)
#### V1.5.32021-12-12DDUC11版
##### 更新内容
**※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'
```
##### 截图
![1.5.3](https://storage.deepin.org/thread/202112121231595786_截图_选择区域_20211212123106.png)
#### V1.5.22021-11-28
**※1、支持安装和构建带 Root 的 UEngine 的镜像**
2、更新了反馈链接
![](https://storage.deepin.org/thread/202111281607295590_截图_选择区域_20211128160706.png)
#### V1.5.12021-10-05国庆节版
**※1、精简用户界面合并安装和卸载输入框和浏览按钮等**
**※2、修复安装以其的程序图标无法点击进入的问题deepin 社区版不存在此问题)**
**※3、支持在程序本体反馈问题**
4、修复了菜单栏的部分显示问题
5、支持显示 apk 的部分信息
6、支持删除 UEngine 程序运行检查以及重新安装 UEngine 的功能
7、自带有跳过家庭版必须有指定包名才能运行程序限制的脚本
8、补回依赖包“adb”
![1.5.1](https://storage.deepin.org/thread/202110051821076836_截图_dde-desktop_20211005182021.png)
#### V1.5.02021-09-21中秋节版
**没有什么实质性的功能,只是开始有多语言支持**
**※1、部分窗口支持英语**
2、修复在英语状态下启动器图标名称异常的问题
![1.5.0](https://storage.deepin.org/thread/202109202157289430_截图_选择区域_20210920215550.png)
#### V1.4.32021-09-11开学第一版
**※1、支持打包器打包的包名带前缀“uengine-dc”**
**※2、修复了两种情况可能导致程序卡住/出错无法继续运行的情况(配置文件夹不齐全和获取版本信息卡住两种情况)**
**※3、修改了 UEngine 打包器打包的应用包名可能有大写的情况**
4、支持一键使用 Scrcpy 连接 UEngine①先安装 adb 破解补丁②请确保是使用snap安装的 Scrcpy【目前只支持 snap 安装的 Scrcpy 进行连接】)
5、支持右键打包 apk
![1.4.3](https://storage.deepin.org/thread/202109111635389828_截图_选择区域_20210911163449.png)
#### V1.4.22021-08-30快开学了
**※1、添加adb破解补丁用于可以让adb连接UEngine并支持adb的部分操作;**
2、菜单栏的项目添加以及外观优化;
3、修复键盘映射无法添加新映射的问题并修改键盘映射启动方式;
4、把 uengine 改为 UEngine;
5、修改 pkexec 获取密码时显示的图标和文本;
6、添加了 UEngine 系统设置的快捷方式;
![1.4.2](https://storage.deepin.org/thread/202108301750554993_截图_选择区域_20210830134502.png)
#### V1.4.12021-08-26
**※1、初步支持键盘映射**
2、修复新版包在发送uengine列表快捷方式时会提示找不到文件
![1.4.1](https://storage.deepin.org/thread/20210826151947783_截图_选择区域_20210826151312.png)
#### V1.4.02021-08-19
**※1、添加新版打包方式deepin打包方式;**
**※2、支持测试运行/创建/删除uengine图标;**
**※3、支持提取安装的apk;**
**※4、支持打包deb包;**
5、修改菜单栏布局;
6、支持打开uengine数据目录和用户数据目录;
7、程序信息保存到json,非直接写入程序本体;
8、更多命令操作;
![1.4.0](https://storage.deepin.org/thread/202108191410327464_截图_选择区域_20210819140938.png)
#### V1.3.22021-08-16
**※1、支持uengine数据重置;**
**※2、支持修改uengine网络桥接的启动状态;**
**※3、支持右键安装/卸载;**
@@ -16,50 +158,69 @@
**※5、修复打包问题不会出现“dpkg:警告:卸载spark-uengine-runner时目录/opt/apps/uengine-runner非空因而不会删除该目录”的错误;**
![1.3.2](https://storage.deepin.org/thread/202108152141139401_截图_选择区域_20210815213948.png)
#### V1.3.1
#### V1.3.12021-08-12
**※1、修复打包问题防止部分用户安装出错的问题;**
**※2、修复了程序无法提取图标时可以提取默认图标使用;**
![1.3.1](https://storage.deepin.org/thread/202108121509217807_截图_选择区域_20210812150849.png)
#### V1.3.0
#### V1.3.02021-08-08
**※1、修改了界面布局;**
**※2、修复大多数新安装普通用户的路图标及启动菜单文件路径不存在导致安装APK报错的bugs;**
3、删除少量冗余代码调整代码顺序;
4、支持提取 apk 图标。
![1.3.0](https://storage.deepin.org/thread/202108082100582804_截图_tk_20210808210047.png)
#### V1.2.3
#### V1.2.32021-08-02
1、调整部分控件名称
2、调整界面布局及界面风格
![1.2.3](https://images.gitee.com/uploads/images/2021/0802/080620_1dd289ca_7896131.png)
#### V1.2.2
#### V1.2.22021-07-11
1、对程序错误的显示更加人性化
2、对 icon 的获取方式进行了升级;
3、增加了注释、删除部分冗余代码。
![1.2.2](https://images.gitee.com/uploads/images/2021/0711/145140_b04e51b7_7896131.png)
#### V1.2.1
#### V1.2.12021-07-02
**※1、进行了安装方式的修改不使用 adb修复原无法安装和卸载的问题**
2、进行了部分优化
3、进行了功能缩水
4、修复 deb 打包错误。
![1.2.1](https://images.gitee.com/uploads/images/2021/0702/204040_6abb6f3f_7896131.png)
#### V1.2.0
#### V1.2.02021-06-06
1、支持安装自动添加快捷方式、卸载删除快捷方式
2、支持使用包名或 APK 文件卸载程序;
3、支持查看安装的所有包名
4、进行了部分优化
![1.2.0](https://images.gitee.com/uploads/images/2021/0606/115536_0c0ddf38_7896131.png)
#### V1.1.02021-05-30
1、修改了因编写时出现的中、英文混用的情况
2、支持一键连接默认 IP
3、修复在不连接设备直接选择 apk 安装时会卡住的问题
4、修复在把“uengine 程序菜单”发送到桌面或启动器如果询问覆盖时点击取消会卡住的问题
5、修改了程序界面为白色调不和标题栏冲突矛盾
![1.1.0](https://images.gitee.com/uploads/images/2021/0530/133429_7e6bf629_7896131.png)
#### V1.0.02021-05-29
![1.0.0](https://images.gitee.com/uploads/images/2021/0529/173756_2e333c86_7896131.png)
### 源码安装教程
按下 <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>T</kbd> 打开终端,按以下内容操作:
1. 安装所需依赖
```bash
sudo apt install python3 python3-tk git python3-pip aapt uengine
python3 -m pip install ttkthemes
sudo apt install python3 python3-tk python3-pip aapt uengine
sudo apt install python3-setuptools deepin-terminal curl python3-pil
sudo apt install python3-pil.imagetk python3-requests adb
sudo apt install translate-shell python3-xlib fonts-noto-cjk
sudo apt install python3-numpy python3-matplotlib wget inotify-tools aria2
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 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 easygui -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
```
2. 下载本程序
@@ -71,25 +232,13 @@ 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
chmod 777 uengine-runner/main.py
./uengine-runner/main.py
```
### 使用说明
1、需要你有使用 root 权限的能力;
2、需要安装 uengine 才能使用UOS建议在商店安装一个安卓应用让系统自动安装uengine及相关的依赖包
2、需要安装 UEngine 才能使用UOS建议在商店安装一个安卓应用让系统自动安装 UEngine 及相关的依赖包;
3、提取 apk 图标的 apk 路径以“安装 apk”那栏为准;
4、如果报错是有关产生 .deksotp 文件有关,一般可以打开程序列表运行。如果想要连接其他手机,请使用 1.2.0 以前的版本,可以使用 adb 连接。
@@ -97,12 +246,10 @@ pip3 uninstall ttkthemes
提 issue 最好,当然有些问题自己无法解决,请大佬 push 一下
如果出现故障,尝试终端运行,如果是可以自行解决的问题,就**自行解决**,如果可以就**提 issues 并提供解决方案**,不行就**提 isscue 并提供程序和终端报错以及程序版本**
### 下载量
这里只统计蓝奏云的下载量,链接(每周更新一次):
[https://kdocs.cn/l/smrvazWGuKcY](https://kdocs.cn/l/smrvazWGuKcY)
### 已知问题
![Error](https://storage.deepin.org/thread/202108101105396531_截图___tk__messagebox_20210810110449.png)
<p align="center"><img src='https://bbs.deepin.org/assets/image/raccoon/[sad].gif'></p>
![Error](https://storage.deepin.org/thread/202108101105396531_截图___tk__messagebox_20210810110449.png)
部分 app 无法读取出图片,已知:
| 程序 | 下载链接 |
| :-: | :-: |
@@ -116,21 +263,28 @@ pip3 uninstall ttkthemes
### 贡献
我非常欢迎大家的贡献
有通过贡献的开发者列表:
<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 |
| 星空露光 | https://gitee.com/Cynorkyle |
| 为什么您不喜欢熊出没和阿布呢 | https://weibo.com/u/7755040136 |
### 相关项目
| 项目名称 | 项目地址 |
| :-: | :-:|
| uengine-installer | https://gitee.com/Maicss/uengine-installer |
| uengine APK 打包器 | https://gitee.com/gfdgd-xi/uengine-apk-builder |
| 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 |
@@ -152,4 +306,4 @@ pip3 uninstall ttkthemes
| 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-2021
### ©2021-2022

10
UengineAndroidProgramList.desktop Normal file → Executable file
View File

@@ -1,11 +1,11 @@
[Desktop Entry]
Categories=System;
Comment=uengineanbox 程序菜单
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
Exec=/usr/bin/uengine launch.sh --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
Icon=/opt/apps/uengine-runner/menu.svg
MimeType=
Name=uengine 程序菜单
StartupWMClass=uengine 程序菜单
Name=UEngine 程序菜单
StartupWMClass=UEngine 程序菜单
Terminal=false
Type=Application

14
UpdateApkProgram.py Normal file
View 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()

Binary file not shown.

2
api-test.py Normal file
View File

@@ -0,0 +1,2 @@
import api
xxx = api.APK()

109
api/README.md Normal file
View 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 运行器的历史记录 |

371
api/__init__.py Normal file
View File

@@ -0,0 +1,371 @@
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.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'")
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:
def __init__(self, ip=""):
self.ip = ip
def connect(self):
os.system(f"adb connect {self.ip}")
class Service:
def Open():
os.system("adb start-server")
def Close():
os.system("adb kill-server")
def Kill():
os.system("killall adb")
def boolAndroidInstallOtherAppSetting(self):
return subprocess.getoutput(f"adb -s {self.ip} shell settings get secure install_non_market_apps").replace(" ", "") == "1"
def setAndroidInstallOtherAppSetting(self, op: bool):
os.system(f"adb -s {self.ip} shell settings put secure install_non_market_apps {int(op)}")
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")
adb = Adb("192.168.250.2:5555")
print(adb.boolAndroidInstallOtherAppSetting())
quit()
if not ROOT.GetRoot():
print("请获取 ROOT 权限以便更好的使用该 API")

Binary file not shown.

Binary file not shown.

BIN
api/defult.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -50,13 +50,16 @@ class getsavexml():
#获取所有带前后图片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)

76
api/root-uengine.sh Executable file
View 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 "已在用户主目录生成新的安装包,安装后重启即可生效"

View File

@@ -1,10 +0,0 @@
Package: spark-uengine-runner
Version: 1.3.2
Maintainer: gfdgd xi <3025613752@qq.com>, actionchen<917981399@qq.com>
Homepage: [https://gitee.com/gfdgd-xi/uengine-runner, https://github.com/gfdgd-xi/uengine-runner]
Architecture: all
Priority: optional
Conflicts: com.gitee.uengine.runner.spark
Depends: python3, python3-tk, python3-pip, aapt, uengine, python3-pil, python3-setuptools
Description: uengine runner for deepin and UOS

View File

@@ -1,2 +0,0 @@
#!/bin/sh
python3 -m pip install --upgrade ttkthemes

View File

@@ -1,11 +0,0 @@
[Desktop Entry]
Categories=System;
Comment=uengineanbox 程序菜单
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

View File

@@ -1,823 +0,0 @@
#!/usr/bin/env python3
# 使用系统默认的 python3 运行
###########################################################################################
# 作者gfdgd xi<3025613752@qq.com>
# 版本1.3.2
# 更新时间2021年8月15日
# 感谢anbox、deepin 和 UOS
# 基于 Python3 的 tkinter 构建
# 更新actionchen<917981399@qq.com>
###########################################################################################
#################
# 引入所需的库
#################
import os
import sys
import time
import json
import shutil
import zipfile
import traceback
import threading
import ttkthemes
import webbrowser
import subprocess
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.messagebox as messagebox
import tkinter.filedialog as filedialog
from getxmlimg import getsavexml
from tkinter.constants import TOP
# 卸载程序
def UninstallProgram(package: "apk 包名")->"卸载程序":
try:
global fineUninstallApkHistory
Return = GetCommandReturn("pkexec /usr/bin/uengine-session-launch-helper -- uengine uninstall --pkg='{}'".format(package))
if os.path.exists("{}/.local/share/applications/{}.desktop".format(get_home(), package)):
os.remove("{}/.local/share/applications/{}.desktop".format(get_home(), package))
if os.path.exists("{}/{}.desktop".format(get_desktop_path(), package)):
os.remove("{}/{}.desktop".format(get_desktop_path(), package))
fineUninstallApkHistory.append(ComboUninstallPath.get())
ComboUninstallPath['value'] = fineUninstallApkHistory
write_txt(get_home() + "/.config/uengine-runner/FindUninstallApkHistory.json", str(json.dumps(ListToDictionary(fineUninstallApkHistory)))) # 将历史记录的数组转换为字典并写入
return Return
except:
traceback.print_exc()
messagebox.showerror(title="错误", message=traceback.format_exc())
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():
if ComboUninstallPath.get() is "":
messagebox.showerror(title="提示", message="信息没有填写完整,无法继续卸载 APK")
return
DisabledAndEnbled(True)
if os.path.exists(ComboUninstallPath.get()):
path = GetApkPackageName(ComboUninstallPath.get())
else:
path = ComboUninstallPath.get()
UninstallProgram(path)
messagebox.showinfo(message="操作执行完毕!", title="提示")
DisabledAndEnbled(False)
# 浏览窗口
# temp strs
temppath=""
def FindApk()->"浏览窗口":
path = filedialog.askopenfilename(title="选择 Apk", filetypes=[("APK 文件", "*.apk"), ("所有文件", "*.*")], initialdir=json.loads(readtxt(get_home() + "/.config/uengine-runner/FindApk.json"))["path"])
global temppath
temppath = path
print("apk path is find:" + path)
if path != "" and path != "()":
try:
ComboInstallPath.set(path)
write_txt(get_home() + "/.config/uengine-runner/FindApk.json", json.dumps({"path": os.path.dirname(path)})) # 写入配置文件
except:
pass
def Button3Install():
if ComboInstallPath.get() is "":
messagebox.showerror(title="提示", message="信息没有填写完整,无法继续安装 APK")
return
DisabledAndEnbled(True)
threading.Thread(target=InstallApk, args=(ComboInstallPath.get(),)).start()
# 安装应用
def InstallApk(path: "apk 路径", quit: "是否静默安装" = False):
try:
if not os.path.exists("{}/.local/share/applications/uengine/".format(get_home())):
print("Mkdir")
os.mkdir("{}/.local/share/applications/uengine/".format(get_home()))
print("start install apk")
global findApkHistory
commandReturn = GetCommandReturn("pkexec /usr/bin/uengine-session-launch-helper -- uengine install --apk='{}'".format(path))
print(commandReturn)
print("start install apk12")
iconSavePath = "{}/.local/share/icons/hicolor/256x256/apps/{}.png".format(get_home(), GetApkPackageName(path))
tempstr1 = iconSavePath
print("start install apk1")
iconSaveDir = os.path.dirname(iconSavePath)
if not os.path.exists(iconSaveDir):
os.makedirs(iconSaveDir,exist_ok=True)
SaveApkIcon(path, iconSavePath)
print("start install apk2")
BuildUengineDesktop(GetApkPackageName(path), GetApkActivityName(path), GetApkChineseLabel(path), iconSavePath,
"{}/{}.desktop".format(get_desktop_path(), GetApkPackageName(path)))
print("start install apk3")
BuildUengineDesktop(GetApkPackageName(path), GetApkActivityName(path), GetApkChineseLabel(path), iconSavePath,
"{}/.local/share/applications/uengine/{}.desktop".format(get_home(), GetApkPackageName(path)))
print("\nprint install complete")
if quit:
print(commandReturn)
return
messagebox.showinfo(title="提示", message="操作完成!")
findApkHistory.append(ComboInstallPath.get())
ComboInstallPath['value'] = findApkHistory
write_txt(get_home() + "/.config/uengine-runner/FindApkHistory.json", str(json.dumps(ListToDictionary(findApkHistory)))) # 将历史记录的数组转换为字典并写入
except:
traceback.print_exc()
messagebox.showerror(title="错误", message=traceback.format_exc())
DisabledAndEnbled(False)
# 禁用或启动所有控件
def DisabledAndEnbled(choose: "启动或者禁用")->"禁用或启动所有控件":
userChoose = {True: tk.DISABLED, False: tk.NORMAL}
a = userChoose[choose]
ComboInstallPath.configure(state=a)
ComboUninstallPath.configure(state=a)
BtnFindApk.configure(state=a)
BtnInstall.configure(state=a)
BtnShowUengineApp.configure(state=a)
BtnUninstallApkBrowser.configure(state=a)
BtnUninstall.configure(state=a)
Btngeticon.configure(state=a)
# 需引入 subprocess
# 运行系统命令并获取返回值
def GetCommandReturn(cmd: "命令")->"运行系统命令并获取返回值":
# cmd 是要获取输出的命令
return subprocess.getoutput(cmd)
def Button5Click():
threading.Thread(target=OpenUengineProgramList).start()
# 打开“uengine 所有程序列表”
def OpenUengineProgramList()->"打开“uengine 所有程序列表”":
os.system("/usr/bin/uengine-launch.sh --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity")
# 显示“关于这个程序”窗口
def about_this_program()->"显示“关于这个程序”窗口":
global about
global title
global iconPath
mess = tk.Toplevel()
message = ttk.Frame(mess)
mess.resizable(0, 0)
mess.title("关于 {}".format(title))
#mess.iconphoto(False, tk.PhotoImage(file=iconPath))
img = ImageTk.PhotoImage(Image.open(iconPath))
LabApkPath = ttk.Label(message, image=img)
label2 = ttk.Label(message, text=about)
button1 = ttk.Button(message, text="确定", command=mess.withdraw)
LabApkPath.pack()
label2.pack()
button1.pack(side="bottom")
message.pack()
mess.mainloop()
# 显示“提示”窗口
def helps()->"显示“提示”窗口":
global tips
messagebox.showinfo(title="提示", message=tips)
# 显示更新内容窗口
def UpdateThings()->"显示更新内容窗口":
messagebox.showinfo(title="更新内容", message=updateThings)
# 打开程序官网
def OpenProgramURL()->"打开程序官网":
webbrowser.open_new_tab(programUrl)
# 重启本应用程序
def ReStartProgram()->"重启本应用程序":
python = sys.executable
os.execl(python, python, * sys.argv)
# 清理历史记录
def CleanProgramHistory()->"清理历史记录":
try:
if messagebox.askokcancel(title="警告", message="删除后将无法恢复,你确定吗?\n删除后软件将会自动重启。"):
shutil.rmtree(get_home() + "/.config/uengine-runner")
ReStartProgram()
except:
traceback.print_exc()
messagebox.showerror(title="错误", message=traceback.format_exc())
# 获取用户主目录
def get_home()->"获取用户主目录":
return os.path.expanduser('~')
# 发送“启动 uengine 所有程序”的 .desktop 文件到桌面
def SendUengineAndroidListForDesktop()->"发送“启动 uengine 所有程序”的 .desktop 文件到桌面":
global desktop
global desktopName
DisabledAndEnbled(True)
try:
if os.path.exists("{}/{}".format(get_desktop_path(), desktopName)):
if not messagebox.askokcancel(title="提示", message="桌面已经存在快捷方式,你确定要覆盖吗?"):
DisabledAndEnbled(False)
return
shutil.copy(desktop, get_desktop_path())
messagebox.showinfo(title="提示", message="发送成功!")
except:
traceback.print_exc()
messagebox.showerror(title="错误", message=traceback.format_exc())
DisabledAndEnbled(False)
# 获取用户桌面目录
def get_desktop_path()->"获取用户桌面目录":
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 # 返回目录
# 发送“启动 uengine 所有程序”的 .desktop 文件到启动器
def SendUengineAndroidListForLauncher()->"发送“启动 uengine 所有程序”的 .desktop 文件到启动器":
DisabledAndEnbled(True)
try:
if os.path.exists("{}/.local/share/applications/{}".format(get_home(), desktopName)):
if not messagebox.askokcancel(title="提示", message="启动器已经存在快捷方式,你确定要覆盖吗?"):
DisabledAndEnbled(False)
return
if not os.path.exists("{}/.local/share/applications/".format(get_home())):
os.makedirs("{}/.local/share/applications/".format(get_home()))
shutil.copy(desktop, "{}/.local/share/applications/{}".format(get_home(), desktopName))
os.system("chmod 755 {}/.local/share/applications/{}".format(get_home(), desktopName))
messagebox.showinfo(title="提示", message="发送成功!")
except:
traceback.print_exc()
messagebox.showerror(title="错误", message=traceback.format_exc())
DisabledAndEnbled(False)
# 数组转字典
def ListToDictionary(list: "需要转换的数组")->"数组转字典":
dictionary = {}
for i in range(len(list)):
dictionary[i] = list[i]
return dictionary
# 读取文本文档
def readtxt(path: "路径")->"读取文本文档":
f = open(path, "r") # 设置文件对象
str = f.read() # 获取内容
f.close() # 关闭文本对象
return str # 返回结果
# 写入文本文档
def write_txt(path: "路径", things: "内容")->"写入文本文档":
TxtDir = os.path.dirname(path)
print(TxtDir)
if not os.path.exists(TxtDir):
os.makedirs(TxtDir,exist_ok=True)
file = open(path, 'w', encoding='UTF-8') # 设置文件对象
file.write(things) # 写入文本
file.close() # 关闭文本对象
# 获取 aapt 的所有信息
def GetApkInformation(apkFilePath: "apk 所在路径")->"获取 aapt 的所有信息":
return GetCommandReturn("aapt dump badging '{}'".format(apkFilePath))
# 获取 apk Activity
def GetApkActivityName(apkFilePath: "apk 所在路径")->"获取 apk Activity":
info = GetApkInformation(apkFilePath)
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 GetApkPackageName(apkFilePath: "apk 所在路径")->"获取 apk 包名":
info = GetApkInformation(apkFilePath)
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
# 生成 uengine 启动文件到桌面
def BuildUengineDesktop(packageName: "软件包名", activityName: "activity", showName: "显示名称", iconPath: "程序图标所在目录", savePath:".desktop 文件保存路径")->"生成 uengine 启动文件到桌面":
things = '''[Desktop Entry]
Categories=app;
Encoding=UTF-8
Exec=/usr/bin/uengine-launch.sh --action=android.intent.action.MAIN --package={} --component={}
GenericName={}
Icon={}
MimeType=
Name={}
StartupWMClass={}
Terminal=false
Type=Application
'''.format(packageName, activityName, showName, iconPath, showName, showName)
write_txt(savePath, things)
# 获取软件的中文名称
def GetApkChineseLabel(apkFilePath)->"获取软件的中文名称":
info = GetApkInformation(apkFilePath)
for line in info.split('\n'):
if "application-label:" in line:
line = line.replace("application-label:", "")
line = line.replace("'", "")
return line
# 获取图标在包内的路径
#def GetApkIconInApk(apkFilePath)->"获取图标在包内的路径":
#合并两个函数到一起
def SaveApkIcon(apkFilePath, iconSavePath)->"获取 apk 文件的图标":
try:
info = GetApkInformation(apkFilePath)
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(apkFilePath,xmlpath,iconSavePath)
else:
zip = zipfile.ZipFile(apkFilePath)
iconData = zip.read(xmlpath)
with open(iconSavePath, 'w+b') as saveIconFile:
saveIconFile.write(iconData)
except:
traceback.print_exc()
print("Error, show defult icon")
shutil.copy(programPath + "/defult.png", iconSavePath)
def saveicon():
global temppath
global tempstr1
iconSavePath = "{}/.local/share/icons/hicolor/256x256/apps/{}.png".format(get_home(), GetApkPackageName(temppath))
print(iconSavePath+"iconpaths")
SaveApkIcon(temppath, iconSavePath)
def SaveIconToOtherPath():
apkPath = ComboInstallPath.get()
if apkPath == "":
messagebox.showerror(title="错误", message="你没有选择 apk 文件")
return
path = filedialog.asksaveasfilename(title="保存图标", filetypes=[("PNG 图片", "*.png"), ("所有文件", "*.*")], initialdir=json.loads(readtxt(get_home() + "/.config/uengine-runner/SaveApkIcon.json"))["path"])
if not path == "":
try:
SaveApkIcon(apkPath, path)
except:
traceback.print_exc()
messagebox.showerror(title="错误", message="本程序不支持保存该 apk 的图标")
return
write_txt(get_home() + "/.config/uengine-runner/SaveApkIcon.json", json.dumps({"path": os.path.dirname(path)})) # 写入配置文件
findApkHistory.append(ComboInstallPath.get())
ComboInstallPath['value'] = findApkHistory
write_txt(get_home() + "/.config/uengine-runner/FindApkHistory.json", str(json.dumps(ListToDictionary(findApkHistory)))) # 将历史记录的数组转换为字典并写入
messagebox.showinfo(title="提示", message="保存成功!")
## 获取 apk 文件的图标(部分程序不支持)
# def SaveApkIcon(apkFilePath, iconSavePath)->"获取 apk 文件的图标(部分程序不支持)":
# zip = zipfile.ZipFile(apkFilePath)
# iconData = zip.read(GetApkIconInApk(apkFilePath))
# with open(iconSavePath, 'w+b') as saveIconFile:
# saveIconFile.write(iconData)
def BackUengineClean()->"清空 uengine 数据":
print("Choose")
if messagebox.askokcancel(title="警告", message="清空后数据将会完全丢失,确定要继续吗?"):
DisabledAndEnbled(True)
try:
if os.path.exists("{}/.local/share/applications/uengine/".format(get_home())):
shutil.rmtree("{}/.local/share/applications/uengine/".format(get_home()))
except:
traceback.print_exc()
messagebox.showerror(title="错误", message=traceback.format_exc())
InstallWindow.ShowWindows("pkexec rm -rfv /data/uengine")
return
print("Choose False")
def UengineBridgeStart():
DisabledAndEnbled(True)
os.system("pkexec uengine-bridge.sh start")
DisabledAndEnbled(False)
def UengineBridgeStop():
DisabledAndEnbled(True)
os.system("pkexec uengine-bridge.sh stop")
DisabledAndEnbled(False)
def UengineBridgeRestart():
DisabledAndEnbled(True)
os.system("pkexec uengine-bridge.sh restart")
DisabledAndEnbled(False)
def UengineBridgeReload():
DisabledAndEnbled(True)
os.system("pkexec uengine-bridge.sh reload")
DisabledAndEnbled(False)
def UengineBridgeForceReload():
DisabledAndEnbled(True)
os.system("pkexec uengine-bridge.sh force-reload")
DisabledAndEnbled(False)
class InstallWindow():
def ShowWindows(command):
global message
global text
global installTipsText
global progressbar
message = tk.Toplevel()
message.iconphoto(False, tk.PhotoImage(file=iconPath))
messageFrame = ttk.Frame(message)
installTipsText = tk.StringVar()
message.title("正在操作……")
installTipsText.set("正在操作……")
installTips = ttk.Label(messageFrame, textvariable=installTipsText)
progressbar = ttk.Progressbar(messageFrame, length=500, mode='indeterminate')
text = tk.Text(messageFrame)
text.config(background="black", foreground="white")
installTips.pack()
progressbar.pack(fill="x")
text.pack(expand='yes', fill='both')
messageFrame.pack(expand='yes', fill='both')
print("Run!")
threading.Thread(target=InstallWindow.RunCommand, args=[command]).start()
message.mainloop()
def RunCommand(command):
global message
global text
global progressbar
global installTipsText
InstallWindow.AddText("$>" + command + "\n")
progressbar.start()
result = subprocess.getoutput(command)
InstallWindow.AddText(result)
messagebox.showinfo(title="提示", message="操作完毕!")
installTipsText.set("操作完毕!")
message.title("操作完毕!")
progressbar.stop()
progressbar["value"] = 100
# 特意添加!
DisabledAndEnbled(False)
print("Clean!")
if messagebox.askyesno(title="提示", message="清空完毕,将会在重启后生效,是否要重启?"):
print("reboot")
os.system("reboot")
def AddText(things):
global text
text.configure(state=tk.NORMAL)
text.insert("end", things)
text.configure(state=tk.DISABLED)
# 获取用户桌面目录
def get_desktop_path()->"获取用户桌面目录":
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 # 返回目录
# 获取用户主目录
def get_home()->"获取用户主目录":
return os.path.expanduser('~')
def StartUengine():
os.system("systemctl enable uengine-container uengine-session && systemctl start uengine-container uengine-session")
def StopUengine():
os.system("systemctl disable uengine-container uengine-session")
###########################
# 程序信息
###########################
programUrl = "https://gitee.com/gfdgd-xi/uengine-runner"
version = "1.3.2"
goodRunSystem = "Linuxdeepin/UOS"
aaptVersion = GetCommandReturn("aapt version")
about = ''' 一个基于 Python3 的 tkinter 制作的 uengine APK 安装器
版本 {}
适用平台 {}
tkinter版本{}
aapt 版本 {}
程序官网 {}
©2021-{}'''.format(version, goodRunSystem, tk.TkVersion, aaptVersion,programUrl, time.strftime("%Y"))
tips = ''' 新版本Deepin/UOS发布后可以在应用商店安装部分官方已适配的安卓应用对爱好者来说不能自己安装APK软件包始终差点意思本程序可以为Deepin/UOS上的Uengine安卓运行环境安装自定义APK软件包并能发送安装的APK包启动菜单到桌面或系统菜单。
安装APK
点浏览按钮选中需要安装的APK然后点安装按钮
卸载APK
在卸载APK下面的输入框内输入需要卸载的APK包名点卸载按钮如果无法获取包名可以通过浏览APK文件程序自动获取包名进行卸载。
保存APK图标
在安装APK下面的输入框浏览或输入APK的路径然后点击“保存图标”按钮选择保存位置即可
重置删除uengine 数据:
点击菜单栏的“uengine”的“清空uengine数据”输入密码重启即可
注意如果任何安卓一遍打不开多打开几遍应该就可以重新加载uengine配置了
打开Uengine应用列表
打开系统已安装的应用列表(安卓界面)
提示:
1、需要你有使用 root 权限的能力;
2、需要安装 uengine 才能使用;
3、提取 apk 图标的 apk 路径以“安装 apk”那栏为准;
4、如果想要连接其他手机请使用 1.2.0 以前的版本,可以使用 adb 连接。
'''
updateThingsString = '''V.1.3.2
※1、支持uengine数据重置;
※2、支持修改uengine网络桥接的启动状态;
※3、支持右键安装/卸载;
※4、支持启用或禁用uengine;
※5、修复打包问题不会出现“dpkg:警告:卸载spark-uengine-runner时目录/opt/apps/uengine-runner非空因而不会删除该目录”的错误;
V1.3.1
※1、修复打包问题防止部分用户安装出错的问题;
※2、修复了程序无法提取图标时可以提取默认图标使用;
V1.3.0
※1、修改了界面布局;
※2、修复大多数新安装普通用户的路图标及启动菜单文件路径不存在导致安装APK报错的bugs;
3、删除少量冗余代码调整代码顺序;
4、支持提取apk图标。
V1.2.3
1、调整部分控件名称
2、调整界面布局及界面风格
V1.2.2
1、对程序错误的显示更加人性化
2、对icon的获取方式进行了升级
3、增加了注释、删除部分冗余代码。
'''
title = "uengine 安装器 {}".format(version)
updateTime = "2021年08月15日"
updateThings = "{} 更新内容:\n{}\n更新时间{}".format(version, updateThingsString, updateTime, time.strftime("%Y"))
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0])
desktop = "/opt/apps/uengine-runner/UengineAndroidProgramList.desktop"
desktopName = "UengineAndroidProgramList.desktop"
contribute = '''gfdgd xi<3025613752@qq.com>
actionchen<917981399@qq.com>'''
useProgram = '''1、uengine相关软件包基于anbox开发
2、Python3
3、tkintertkinter.tk、ttkthemes 和 tkinter.ttk
4、aapt
……'''
###########################
# 加载配置
###########################
if not os.path.exists("{}/.local/share/applications/uengine/".format(get_home())):
os.mkdir("{}/.local/share/applications/uengine/".format(get_home()))
if not os.path.exists(get_home() + "/.config/uengine-runner"): # 如果没有配置文件夹
os.mkdir(get_home() + "/.config/uengine-runner") # 创建配置文件夹
if not os.path.exists(get_home() + "/.config/uengine-runner/FindApkHistory.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/uengine-runner/FindApkHistory.json", json.dumps({})) # 创建配置文件
if not os.path.exists(get_home() + "/.config/uengine-runner/FindUninstallApkHistory.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/uengine-runner/FindUninstallApkHistory.json", json.dumps({})) # 创建配置文件
if not os.path.exists(get_home() + "/.config/uengine-runner/FindApk.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/uengine-runner/FindApk.json", json.dumps({"path": "~"})) # 写入(创建)一个配置文件
if not os.path.exists(get_home() + "/.config/uengine-runner/FindUninstallApk.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/uengine-runner/FindUninstallApk.json", json.dumps({"path": "~"})) # 写入(创建)一个配置文件
if not os.path.exists(get_home() + "/.config/uengine-runner/SaveApkIcon.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/uengine-runner/SaveApkIcon.json", json.dumps({"path": "~"})) # 写入(创建)一个配置文件
###########################
# 设置变量
###########################
findApkHistory = list(json.loads(readtxt(get_home() + "/.config/uengine-runner/FindApkHistory.json")).values())
fineUninstallApkHistory = list(json.loads(readtxt(get_home() + "/.config/uengine-runner/FindUninstallApkHistory.json")).values())
# add sub window
#添加窗口开启关闭开关,防止重复开启
windowflag = "close"
def showhelp():
#define window and frame and button label
#
global windowflag
if windowflag == "close":
helpwindow=tk.Toplevel()
helpwindow.resizable(0, 0)
helpwindow.title("帮助")
# get screen width and height
screen_width = helpwindow.winfo_screenwidth()
screen_height = helpwindow.winfo_screenheight()
# calculate position x and y coordinates 假设主窗口大小固定 570x236像素 ,设置窗口位置为屏幕中心。
winwith=550
winhigh=700
x = (screen_width/2) - (winwith/2)
y = (screen_height/2) - (winhigh/2)
helpwindow.geometry("550x700"+"+{:.0f}+{:.0f}".format(x, y))
style = ttkthemes.ThemedStyle(helpwindow)
style.set_theme("breeze")
Frmroot=ttk.Frame(helpwindow)
FrmMenu = ttk.Frame(Frmroot)
FrmText = ttk.Frame(Frmroot)
LabFrmText=ttk.LabelFrame(FrmText,text="帮助",height=800,borderwidth=3)
HelpStr = tk.StringVar()
HelpStr.set(tips)
LabText = ttk.Label(LabFrmText, textvariable=HelpStr,width=55)
LabText.config(wraplength=350)
def on_closing():
global windowflag
windowflag = "close"
print(windowflag)
helpwindow.destroy()
# define button func
def ChgLog():
HelpStr.set(updateThingsString)
def ChgAbout():
HelpStr.set(about)
def ChgDep():
HelpStr.set(useProgram)
def ChgCon():
HelpStr.set(contribute)
def ChgTips():
HelpStr.set(tips)
LabText.config(wraplength=350)
BtnReadme = ttk.Button(FrmMenu, text="使用说明",width=14,command=ChgTips)
BtnLog = ttk.Button(FrmMenu, text="更新内容",width=14,command=ChgLog)
BtnZujian = ttk.Button(FrmMenu, text="程序依赖的组件",width=14,command=ChgDep)
BtnGongxian = ttk.Button(FrmMenu, text="有贡献的开发者",width=14,command=ChgCon)
BtnAbout = ttk.Button(FrmMenu, text="关于",width=14,command=ChgAbout)
#layout
FrmMenu.grid(row=0,column=0,sticky=tk.NW)
BtnReadme.grid(row=0,column=0,sticky=tk.NW,padx=3)
BtnLog.grid(row=1,column=0,sticky=tk.NW,padx=3)
BtnZujian.grid(row=2,column=0,sticky=tk.NW,padx=3)
BtnGongxian.grid(row=3,column=0,sticky=tk.NW,padx=3)
BtnAbout.grid(row=4,column=0,sticky=tk.NW,padx=3)
FrmText.grid(row=0,column=1,sticky=tk.NW)
LabFrmText.grid(row=0,column=0,sticky=tk.NW,padx=3,pady=3)
LabText.grid(row=0,column=0,sticky=tk.NW)
Frmroot.pack()
windowflag = "open"
print(windowflag)
#helpwindow.mainloop()
helpwindow.protocol("WM_DELETE_WINDOW", on_closing)
###########################
# 窗口创建
###########################
win = tk.Tk() # 创建窗口
# 设置窗口
style = ttkthemes.ThemedStyle(win)
style.set_theme("breeze")
window = ttk.Frame(win)
win.attributes('-alpha', 0.5)
win.title(title)
win.resizable(0, 0)
win.iconphoto(False, tk.PhotoImage(file=iconPath))
# get screen width and height
screen_width = win.winfo_screenwidth()
screen_height = win.winfo_screenheight()
# calculate position x and y coordinates 假设主窗口大小固定 570x236像素 ,设置窗口位置为屏幕中心。
winwith=570
winhigh=236
x = (screen_width/2) - (winwith/2)
y = (screen_height/2) - (winhigh/2)
win.geometry(""+"+{:.0f}+{:.0f}".format(x, y))
# 创建控件
FrmInstall = ttk.Frame(window)
FrmUninstall = ttk.Frame(window)
LabApkPath = ttk.Label(window, text="安装APK")
LabUninstallPath = ttk.Label(window, text="卸载APK")
ComboInstallPath = ttk.Combobox(window, width=50)
ComboUninstallPath = ttk.Combobox(window, width=50)
BtnFindApk = ttk.Button(FrmInstall, text="浏览", command=FindApk)
BtnInstall = ttk.Button(FrmInstall, text="安装", command=Button3Install)
BtnShowUengineApp = ttk.Button(window, text="打开 uengine 应用列表", command=Button5Click)
BtnUninstallApkBrowser = ttk.Button(FrmUninstall, text="浏览", command=BtnFindUninstallApkClk)
BtnUninstall = ttk.Button(FrmUninstall, text="卸载", command=ButtonClick8)
Btngeticon = ttk.Button(window, text="保存图标", command=SaveIconToOtherPath)
# 设置菜单栏
menu = tk.Menu(window, background="white")
programmenu = tk.Menu(menu, tearoff=0, background="white") # 设置“程序”菜单栏
uengine = tk.Menu(menu, tearoff=0, background="white")
help = tk.Menu(menu, tearoff=0, background="white") # 设置“帮助”菜单栏
menu.add_cascade(label="程序", menu=programmenu)
menu.add_cascade(label="uengine", menu=uengine)
menu.add_cascade(label="关于", menu=help)
programmenu.add_command(label="清空软件历史记录", command=CleanProgramHistory)
programmenu.add_separator() # 设置分界线
programmenu.add_command(label="退出程序", command=window.quit) # 设置“退出程序”
uengine.add_command(label="发送 uengine 应用列表到桌面", command=SendUengineAndroidListForDesktop)
uengine.add_command(label="发送 uengine 应用列表到启动器", command=SendUengineAndroidListForLauncher)
uengine.add_separator()
uengine.add_command(label="启用 uengine", command=StartUengine)
uengine.add_command(label="禁用 uengine", command=StopUengine)
uengine.add_separator()
uengine.add_command(label="启用 uengine 网络桥接", command=UengineBridgeStart)
uengine.add_command(label="关闭 uengine 网络桥接", command=UengineBridgeStop)
uengine.add_command(label="重启 uengine 网络桥接", command=UengineBridgeRestart)
uengine.add_command(label="加载 uengine 网络桥接", command=UengineBridgeReload)
uengine.add_command(label="强制加载 uengine 网络桥接", command=UengineBridgeForceReload)
uengine.add_separator()
uengine.add_command(label="清空 uengine 数据", command=BackUengineClean)
help.add_command(label="程序官网", command=OpenProgramURL) # 设置“程序官网”项
help.add_command(label="帮助", command=showhelp) # 设置“关于这个程序”项
menu.configure(activebackground="dodgerblue")
help.configure(activebackground="dodgerblue")
uengine.configure(activebackground="dodgerblue")
programmenu.configure(activebackground="dodgerblue")
# 设置控件
ComboUninstallPath['value'] = fineUninstallApkHistory
ComboInstallPath['value'] = findApkHistory
try:
if sys.argv[1] == "-i":
ComboInstallPath.set(sys.argv[2])
print("Install Path: " + sys.argv[2])
elif sys.argv[1] == "-u":
ComboUninstallPath.set(sys.argv[2])
print("Unstall Path: " + sys.argv[2])
else:
print("Command Format Error")
except:
print("Not Command Or Command Format Error")
# 显示控件
win.config(menu=menu) # 显示菜单栏
LabApkPath.grid(row=1, column=0,sticky= tk.W,padx=3)
ComboInstallPath.grid(row=2, column=0,padx=3)
FrmInstall.grid(row=2, column=1,padx=3)
BtnFindApk.grid(row=0, column=0)
BtnInstall.grid(row=0, column=1)
LabUninstallPath.grid(row=3, column=0,sticky= tk.W,padx=3)
ComboUninstallPath.grid(row=4, column=0,padx=3)
FrmUninstall.grid(row=4, column=1,padx=3)
BtnUninstallApkBrowser.grid(row=0, column=0)
BtnUninstall.grid(row=0, column=1)
BtnShowUengineApp.grid(row=5, column=0,sticky= tk.W,padx=3,pady=2)
Btngeticon.grid(row=3, column=1,sticky= tk.W,padx=3,pady=2)
window.pack()
win.mainloop()

View File

@@ -1 +0,0 @@
/opt/apps/uengine-runner/uengine-runner

View File

@@ -1,11 +0,0 @@
[Desktop Entry]
Categories=System;
Comment=uengineanbox 程序菜单
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

View File

@@ -1,15 +0,0 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Categories=System;
Terminal=false
Exec=/usr/bin/uengine-runner -i %F
Icon=/opt/apps/uengine-runner/icon.png
Name=Install APK(uengine runner)
Comment=Install APK(uengine runner)
Comment[zh]=安装 APKuengine 运行器)
Name[zh]=安装 APKuengine 运行器)
StartupNotify=true
Hidden=false
NoDisplay=true
MimeType=application/vnd.android.package-archive

View File

@@ -1,15 +0,0 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Categories=System;
Terminal=false
Exec=/usr/bin/uengine-runner -u %F
Icon=/opt/apps/uengine-runner/icon.png
Name=Uninstall APK(uengine runner)
Comment=Uninstall APK(uengine runner)
Comment[zh]=卸载 APKuengine 运行器)
Name[zh]=卸载 APKuengine 运行器)
StartupNotify=true
Hidden=false
NoDisplay=true
MimeType=application/vnd.android.package-archive

View File

@@ -1,13 +0,0 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Categories=System;
Terminal=false
Exec=/usr/bin/uengine-runner
Icon=/opt/apps/uengine-runner/icon.png
Name=uengine runner
Comment=uengine runner
Comment[zh]=uengine 运行器
Name[zh]=uengine 运行器
StartupNotify=true
MimeType=

BIN
builer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

25
builer.svg Executable file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

BIN
com.gitee.uengine.runner.spark.deb Normal file → Executable file

Binary file not shown.

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 312 KiB

After

Width:  |  Height:  |  Size: 312 KiB

BIN
defult.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 KiB

After

Width:  |  Height:  |  Size: 35 KiB

25
defult.svg Executable file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,10 @@
#!/bin/bash
file="/data/uengine/data/data/data/com.tencent.mm/shared_prefs/"
inotifywait -mq -e modify $file | while read event
do
if [[ "$event" == *notify_sync_pref.xml ]];then
notify-send -i '/home/tensor/Documents/notify/mm.jpg' ‘主银’ ‘你有微信消息哦~~’
fi
done

0
getxmlimg.py Normal file → Executable file
View File

BIN
icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 36 KiB

170
information.json Executable file
View File

@@ -0,0 +1,170 @@
{
"Package": "com.gitee.uengine.runner.spark",
"Url": [
"https://gitee.com/gfdgd-xi/uengine-runner",
"https://github.com/gfdgd-xi/uengine-runner"
],
"Version": "1.6.2",
"System": "Linuxdeepin/UOS",
"Tips": [
"更多可见https://gitee.com/gfdgd-xi/uengine-runner/wikis",
"安装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补丁"
],
"Update": [
"V1.6.2",
"※1、优化了 UEngine 运行器的英语翻译",
"※2、新增加了可以打开或关闭第三方应用安装的功能使用此功能后在UEngine里可以使用默认的APK安装程序安装应用此操作需要使用程序的Adb补丁",
"※3、新增加了 UEngine 的 Ubuntu 安装程序",
"※4、双包合一只保留了UOS打包标准可以从旧标准无缝升级推荐使用本程序的升级程序进行升级",
"5、修复了本程序在 Ubuntu 上安装和卸载报错而无法继续的问题",
"6、优化帮助/关于窗口在高分辨率电脑上显示不全的问题",
"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",
"※1、修复了在 UOS 家庭版安装 apk 文件安装包信息为 None 的问题",
"※2、“添加/删除 UEngine 图标”窗口的写入按钮在目录~/.local/share/icons/hicolor/256x256/apps不存在时点击无反应参考报错",
"※3、修复了“UEngine APK应用打包器”打包的deb包的.desktop文件的Icon和Exec字段有误的问题以及使用“使用前缀uengine-dc”前缀的问题",
"4、“UEngine APK应用打包器”支持打包完后自动删除临时目录",
"5、“UEngine APK应用打包器”以及“添加/删除UEngine图标”支持在运行出现错误时显示报错",
"",
"V1.5.2",
"※1、支持安装和构建带Root的UEngine的镜像",
"2、更新了反馈链接",
"",
"V1.5.1",
"※1、精简用户界面合并安装和卸载输入框和浏览按钮等",
"※2、修复安装以其的程序图标无法点击进入的问题deepin 社区版不存在此问题)",
"※3、支持在程序本体反馈问题",
"4、修复了菜单栏的部分显示问题",
"5、支持显示 apk 的部分信息",
"6、支持删除 UEngine 程序运行检查以及重新安装 UEngine 的功能",
"7、自带有跳过家庭版必须有指定包名才能运行程序限制的脚本",
"8、补回依赖包“adb”",
"",
"V1.5.0",
"※1、部分窗口支持英语",
"2、修复在英语状态下启动器图标名称异常的问题",
"",
"V1.4.3",
"※1、支持打包器打包的包名带前缀“uengine-dc”",
"※2、修复了两种情况可能导致程序卡住/出错无法继续运行的情况(配置文件夹不齐全和获取版本信息卡住两种情况)",
"※3、修改了 UEngine 打包器打包的应用包名可能有大写的情况",
"4、支持一键使用 Scrcpy 连接 UEngine①先安装 adb 破解补丁②请确保是使用snap安装的 Scrcpy【目前只支持 snap 安装的 Scrcpy 进行连接】)",
"5、支持右键打包 apk",
"",
"V1.4.2",
"※1、添加adb破解补丁用于可以让adb连接UEngine并支持adb的部分操作;",
"2、菜单栏的项目添加以及外观优化;",
"3、修复键盘映射无法添加新映射的问题并修改键盘映射启动方式;",
"4、把 uengine 改为 UEngine;",
"5、修改 pkexec 获取密码时显示的图标和文本;",
"6、添加了 UEngine 系统设置的快捷方式;",
"",
"V1.4.1",
"※1、初步支持键盘映射",
"2、修复新版包在发送uengine列表快捷方式时会提示找不到文件",
"",
"V1.4.0",
"※1、添加新版打包方式deepin打包方式;",
"※2、支持测试运行/创建/删除uengine图标;",
"※3、支持提取安装的apk;",
"※4、支持打包deb包;",
"5、修改菜单栏布局;",
"6、支持打开uengine数据目录和用户数据目录;",
"7、程序信息保存到json,非直接写入程序本体;",
"8、更多命令操作;",
"",
"V.1.3.2",
"※1、支持uengine数据重置;",
"※2、支持修改uengine网络桥接的启动状态;",
"※3、支持右键安装/卸载;",
"※4、支持启用或禁用uengine;",
"※5、修复打包问题不会出现“dpkg:警告:卸载spark-uengine-runner时目录/opt/apps/uengine-runner非空因而不会删除该目录”的错误;",
"",
"V1.3.1",
"※1、修复打包问题防止部分用户安装出错的问题;",
"※2、修复了程序无法提取图标时可以提取默认图标使用;",
"",
"V1.3.0",
"※1、修改了界面布局;",
"※2、修复大多数新安装普通用户的路图标及启动菜单文件路径不存在导致安装APK报错的bugs;",
"3、删除少量冗余代码调整代码顺序;",
"4、支持提取apk图标。",
"",
"V1.2.3",
"1、调整部分控件名称",
"2、调整界面布局及界面风格",
"",
"V1.2.2",
"1、对程序错误的显示更加人性化",
"2、对 icon 的获取方式进行了升级;",
"3、增加了注释、删除部分冗余代码。",
"",
"V1.2.1",
"※1、进行了安装方式的修改不使用 adb修复原无法安装和卸载的问题",
"2、进行了部分优化",
"3、进行了功能缩水",
"4、修复 deb 打包错误。",
"",
"V1.2.0",
"1、支持安装自动添加快捷方式、卸载删除快捷方式",
"2、支持使用包名或 APK 文件卸载程序;",
"3、支持查看安装的所有包名",
"4、进行了部分优化",
"",
"V1.1.0",
"暂无数据",
"",
"V1.0.0",
"暂无数据"
],
"Use": [
"1、UEngine相关软件包基于anbox开发",
"2、Python3",
"3、tkintertkinter.tk、ttkthemes、tkinter.messagebox、tkinter.simpledialog、tkinter.filedialog 和 tkinter.ttk",
"4、aapt",
"5、dpkg",
"6、tree",
"7、mkdir",
"8、echo",
"9、chmod",
"10、adb",
"11、deepin 终端",
"……"
],
"Time": "2021年08月30日",
"Contribute": [
"gfdgd xi<3025613752@qq.com>",
"actionchen<917981399@qq.com>",
"柚子<https://gitee.com/Limexb>",
"为什么您不喜欢熊出没和阿布呢<https://weibo.com/u/7755040136>",
"星空露光<https://gitee.com/Cynorkyle>",
"shenmo<jifengshenmo@outlook.com>"
]
}

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

21
kbox/information.json Executable file
View File

@@ -0,0 +1,21 @@
{
"Url": [
"https://gitee.com/gfdgd-xi/uengine-runner",
"https://github.com/gfdgd-xi/uengine-runner"
],
"Version": "1.0.0 For arm64",
"System": "Linuxdeepin/UOS",
"Tips": [
"提示:",
""
],
"Update": [
""
],
"Use": [
""
],
"Time": "2021年10月17日",
"Contribute": ["gfdgd xi<3025613752@qq.com>",
"actionchen<917981399@qq.com>"]
}

113
kbox/kbox-runner-update-bug Executable file
View File

@@ -0,0 +1,113 @@
#!/usr/bin/env python3
import os
import json
import base64
import requests
import ttkthemes
import traceback
import webbrowser
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.messagebox as messagebox
import urllib.parse as parse
# 读取文本文档
def readtxt(path: "路径")->"读取文本文档":
f = open(path, "r") # 设置文件对象
str = f.read() # 获取内容
f.close() # 关闭文本对象
return str # 返回结果
def Update(name, stars, contact, things, version):
# post 内容
data = {
"Name": name,
"Starts": stars,
"Contact": contact,
"Things": things,
"Version": version
}
try:
messagebox.showinfo(message=requests.post(parse.unquote(base64.b64decode("aHR0cCUzQS8vZ2ZkZ2R4aS5xaWNwLnZpcC91ZW5naW5lL2J1Zy91cGxvYWQucGhw").decode("utf-8")), data=data).text)
except:
traceback.print_exc()
messagebox.showerror(title="错误", message="服务器疑似出现错误,可以进行以下尝试:①多尝试几次;②使用其他反馈途径\n错误信息{}".format(traceback.format_exc()))
def UpdateButtonClick():
#判断是否为空
if nameThings.get() == "" or starValue.get() == "" or contactThings.get() == "" or updateThings.get(1.0, "end").replace(" ", "").replace("\n", "") == "":
messagebox.showerror(title="错误", message="反馈信息未填写完整!")
return
Update(name=nameThings.get(), stars=starValue.get(), contact=contactThings.get(), things=updateThings.get(1.0, "end"), version=version)
def OpenGiteeIssues():
webbrowser.open_new_tab("https://gitee.com/gfdgd-xi/uengine-runner/issues")
def OpenGithubIssues():
webbrowser.open_new_tab("https://github.com/gfdgd-xi/uengine-runner/issues")
###########################
# 程序信息
###########################
iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0])
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
information = json.loads(readtxt(programPath + "/information.json"))
version = information["Version"]
###########################
# 窗口创建
###########################
window = tk.Tk()
win = ttk.Frame()
starValue = tk.StringVar()
starValue.set("5分")
name = ttk.Label(win, text="你的昵称:")
nameThings = ttk.Entry(win, width=25)
contact = ttk.Label(win, text="联系方式:")
contactThings = ttk.Entry(win, width=25)
star = ttk.Label(win, text="评分:")
starMenu = ttk.OptionMenu(win, starValue, "5分", "5分", "4分", "3分", "2分", "1分")
updateThingsTips = ttk.Label(win, text="反馈内容(支持 Markdown 格式):")
updateThings = tk.Text(win)
otherUpload = ttk.Frame(win)
# 所属内容
tips = ttk.Label(otherUpload, text="如果无法正常反馈,可以用其他方式反馈:")
giteeButton = ttk.Button(otherUpload, text="Gitee Issues", command=OpenGiteeIssues)
githubButton = ttk.Button(otherUpload, text="Github Issues", command=OpenGithubIssues)
updateButton = ttk.Button(win, text="提交", command=UpdateButtonClick)
# 设置窗口
style = ttkthemes.ThemedStyle(window)
style.set_theme("breeze")
window.title("KBox 运行器 {} 问题/建议反馈".format(version))
window.resizable(0, 0)
window.iconphoto(False, tk.PhotoImage(file=iconPath))
tips.grid(row=0, column=0)
giteeButton.grid(row=0, column=1)
githubButton.grid(row=0, column=2)
name.grid(row=0, column=0)
nameThings.grid(row=0, column=1)
contact.grid(row=0, column=2)
contactThings.grid(row=0, column=3)
star.grid(row=0, column=4)
starMenu.grid(row=0, column=5)
updateThingsTips.grid(row=1, column=0, columnspan=2)
updateThings.grid(row=2, column=0, columnspan=6)
otherUpload.grid(row=3, column=0, columnspan=4)
updateButton.grid(row=3, column=5)
win.pack(expand="yes", fill="both")
window.mainloop()

482
kbox/main.py Executable file
View File

@@ -0,0 +1,482 @@
#!/usr/bin/env python3
# 使用系统默认的 python3 运行
###########################################################################################
# 作者gfdgd xi<3025613752@qq.com>
# 版本1.5.2
# 更新时间2021年10月16日国庆了
# 感谢kbox 和 UOS
# 基于 Python3 的 tkinter 构建
# 更新gfdgd xi<3025613752@qq.com>、actionchen<917981399@qq.com>
###########################################################################################
#################
# 引入所需的库
#################
import os
import sys
import time
import json
import shutil
import zipfile
import traceback
import threading
import ttkthemes
import webbrowser
import subprocess
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.messagebox as messagebox
import tkinter.filedialog as filedialog
temppath=""
def FindApk()->"浏览窗口":
path = filedialog.askopenfilename(title="选择 Apk", filetypes=[("APK 文件", "*.apk"), ("所有文件", "*.*")], initialdir=json.loads(readtxt(get_home() + "/.config/uengine-runner/FindApk.json"))["path"])
global temppath
temppath = path
print("apk path is find:" + path)
if path != "" and path != "()":
try:
ComboInstallPath.set(path)
write_txt(get_home() + "/.config/kbox-runner/FindApk.json", json.dumps({"path": os.path.dirname(path)})) # 写入配置文件
except:
pass
# 安装应用
def InstallApk(path: "apk 路径", quit: "是否静默安装" = False):
try:
print("start install apk")
global findApkHistory
commandReturn = GetCommandReturn("pkexec android-appmgr.sh install '{}'".format(path))
print(commandReturn)
print("start install apk1")
print("\nprint install complete")
if quit:
print(commandReturn)
return
messagebox.showinfo(title="提示", message="操作完成!")
findApkHistory.append(ComboInstallPath.get())
ComboInstallPath['value'] = findApkHistory
write_txt(get_home() + "/.config/kbox-runner/FindApkHistory.json", str(json.dumps(ListToDictionary(findApkHistory)))) # 将历史记录的数组转换为字典并写入
except:
traceback.print_exc()
messagebox.showerror(title="错误", message=traceback.format_exc())
DisabledAndEnbled(False)
# 安装按钮事件
def Button3Install():
if ComboInstallPath.get() is "" or not os.path.exists(ComboInstallPath.get()):
messagebox.showerror(title="提示", message="信息没有填写完整或错误,无法继续安装 APK")
return
DisabledAndEnbled(True)
threading.Thread(target=InstallApk, args=(ComboInstallPath.get(),)).start()
# 禁用或启动所有控件
def DisabledAndEnbled(choose: "启动或者禁用")->"禁用或启动所有控件":
userChoose = {True: tk.DISABLED, False: tk.NORMAL}
a = userChoose[choose]
ComboInstallPath.configure(state=a)
BtnFindApk.configure(state=a)
BtnInstall.configure(state=a)
BtnShowUengineApp.configure(state=a)
LabApkPath.configure(state=a)
# 需引入 subprocess
# 运行系统命令并获取返回值
def GetCommandReturn(cmd: "命令")->"运行系统命令并获取返回值":
# cmd 是要获取输出的命令
return subprocess.getoutput(cmd)
def GetSystemVersion():
systemInformation = readtxt("/etc/os-release")
for systemInformation in systemInformation.split('\n'):
if "PRETTY_NAME=" in systemInformation:
return systemInformation.replace("PRETTY_NAME=", "").replace('"', '')
# 打开所有窗口事件
def Button5Click():
threading.Thread(target=OpenUengineProgramList).start()
# 打开“uengine 所有程序列表”
def OpenUengineProgramList()->"打开“uengine 所有程序列表”":
os.system("uengine launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity")
# 打开程序官网
def OpenProgramURL()->"打开程序官网":
webbrowser.open_new_tab(programUrl)
# 重启本应用程序
def ReStartProgram()->"重启本应用程序":
python = sys.executable
os.execl(python, python, * sys.argv)
# 清理历史记录
def CleanProgramHistory()->"清理历史记录":
try:
if messagebox.askokcancel(title="警告", message="删除后将无法恢复,你确定吗?\n删除后软件将会自动重启。"):
shutil.rmtree(get_home() + "/.config/kbox-runner")
ReStartProgram()
except:
traceback.print_exc()
messagebox.showerror(title="错误", message=traceback.format_exc())
# 获取用户主目录
def get_home()->"获取用户主目录":
return os.path.expanduser('~')
# 获取用户桌面目录
def get_desktop_path()->"获取用户桌面目录":
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 # 返回目录
# 数组转字典
def ListToDictionary(list: "需要转换的数组")->"数组转字典":
dictionary = {}
for i in range(len(list)):
dictionary[i] = list[i]
return dictionary
# 读取文本文档
def readtxt(path: "路径")->"读取文本文档":
f = open(path, "r") # 设置文件对象
str = f.read() # 获取内容
f.close() # 关闭文本对象
return str # 返回结果
# 写入文本文档
def write_txt(path: "路径", things: "内容")->"写入文本文档":
TxtDir = os.path.dirname(path)
print(TxtDir)
if not os.path.exists(TxtDir):
os.makedirs(TxtDir,exist_ok=True)
file = open(path, 'w', encoding='UTF-8') # 设置文件对象
file.write(things) # 写入文本
file.close() # 关闭文本对象
# 获取 aapt 的所有信息
def GetApkInformation(apkFilePath: "apk 所在路径")->"获取 aapt 的所有信息":
return GetCommandReturn("aapt dump badging '{}'".format(apkFilePath))
# 获取 apk Activity
def GetApkActivityName(apkFilePath: "apk 所在路径")->"获取 apk Activity":
info = GetApkInformation(apkFilePath)
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 GetApkPackageName(apkFilePath: "apk 所在路径")->"获取 apk 包名":
info = GetApkInformation(apkFilePath)
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 GetApkChineseLabel(apkFilePath)->"获取软件的中文名称":
info = GetApkInformation(apkFilePath)
for line in info.split('\n'):
if "application-label:" in line:
line = line.replace("application-label:", "")
line = line.replace("'", "")
return line
# 保存apk图标
def SaveApkIcon(apkFilePath, iconSavePath)->"保存 apk 文件的图标":
try:
info = GetApkInformation(apkFilePath)
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(apkFilePath,xmlpath,iconSavePath)
else:
zip = zipfile.ZipFile(apkFilePath)
iconData = zip.read(xmlpath)
with open(iconSavePath, 'w+b') as saveIconFile:
saveIconFile.write(iconData)
except:
traceback.print_exc()
print("Error, show defult icon")
shutil.copy(programPath + "/defult.png", iconSavePath)
# 获取用户主目录
def get_home()->"获取用户主目录":
return os.path.expanduser('~')
def UengineRunnerBugUpload():
threading.Thread(target=os.system, args=[programPath + "/kbox-runner-update-bug"]).start()
def GetApkVersion(apkFilePath):
info = GetApkInformation(apkFilePath)
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
###########################
# 程序信息
###########################
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
information = json.loads(readtxt(programPath + "/information.json"))
programUrl = information["Url"][0]
version = information["Version"]
goodRunSystem = information["System"]
aaptVersion = GetCommandReturn("aapt version")
SystemVersion = GetSystemVersion()
about = '''介绍 :一个基于 Python3 的 tkinter 制作的 KBox 运行器在新版本Deepin/UOS发布后可以在应用商店安装部分官方已适配的安卓应用对爱好者来说不能自己安装APK软件包始终差点意思本程序可以为UOS上的KBox安卓运行环境安装自定义APK软件包并能发送安装的APK包启动菜单到桌面或系统菜单。
版本 {}
适用平台 {}
Tk 版本 :{}
程序官网 {}
系统版本 :{}
©2021-{}'''.format(version, goodRunSystem, tk.TkVersion, programUrl, SystemVersion, time.strftime("%Y"))
tips = "\n".join(information["Tips"])
updateThingsString = "\n".join(information["Update"])
title = "KBox 安装器 {}".format(version)
updateTime = information["Time"]
updateThings = "{} 更新内容:\n{}\n更新时间:{}".format(version, updateThingsString, updateTime, time.strftime("%Y"))
iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0])
desktop = programPath + "/UengineAndroidProgramList.desktop"
desktopName = "UengineAndroidProgramList.desktop"
contribute = "\n".join(information["Contribute"])
###########################
# 加载配置
###########################
if not os.path.exists("{}/.local/share/applications/uengine/".format(get_home())):
os.makedirs("{}/.local/share/applications/uengine/".format(get_home()))
if not os.path.exists(get_home() + "/.config/uengine-runner"): # 如果没有配置文件夹
os.makedirs(get_home() + "/.config/uengine-runner") # 创建配置文件夹
if not os.path.exists(get_home() + "/.config/uengine-runner/FindApkHistory.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/uengine-runner/FindApkHistory.json", json.dumps({})) # 创建配置文件
if not os.path.exists(get_home() + "/.config/uengine-runner/FindApkNameHistory.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/uengine-runner/FindApkNameHistory.json", json.dumps({})) # 创建配置文件
if not os.path.exists(get_home() + "/.config/uengine-runner/FindApkActivityHistory.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/uengine-runner/FindApkActivityHistory.json", json.dumps({})) # 创建配置文件
if not os.path.exists(get_home() + "/.config/uengine-runner/FindUninstallApkHistory.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/uengine-runner/FindUninstallApkHistory.json", json.dumps({})) # 创建配置文件
if not os.path.exists(get_home() + "/.config/uengine-runner/FindApkName.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/uengine-runner/FindApkName.json", json.dumps({"path": "~"})) # 写入(创建)一个配置文件
if not os.path.exists(get_home() + "/.config/uengine-runner/FindApk.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/uengine-runner/FindApk.json", json.dumps({"path": "~"})) # 写入(创建)一个配置文件
if not os.path.exists(get_home() + "/.config/uengine-runner/FindUninstallApk.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/uengine-runner/FindUninstallApk.json", json.dumps({"path": "~"})) # 写入(创建)一个配置文件
if not os.path.exists(get_home() + "/.config/uengine-runner/SaveApkIcon.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/uengine-runner/SaveApkIcon.json", json.dumps({"path": "~"})) # 写入(创建)一个配置文件
if not os.path.exists(get_home() + "/.config/uengine-runner/SaveApk.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/uengine-runner/SaveApk.json", json.dumps({"path": "~"})) # 写入(创建)一个配置文件
###########################
# 设置变量
###########################
findApkHistory = list(json.loads(readtxt(get_home() + "/.config/uengine-runner/FindApkHistory.json")).values())
findApkNameHistory = list(json.loads(readtxt(get_home() + "/.config/uengine-runner/FindApkNameHistory.json")).values())
findApkActivityHistory = list(json.loads(readtxt(get_home() + "/.config/uengine-runner/FindApkActivityHistory.json")).values())
# add sub window
#添加窗口开启关闭开关,防止重复开启
windowflag = "close"
def showhelp():
#define window and frame and button label
#
global windowflag
if windowflag == "close":
helpwindow=tk.Toplevel()
helpwindow.resizable(0, 0)
helpwindow.title("帮助")
helpwindow.iconphoto(False, tk.PhotoImage(file=iconPath))
# get screen width and height
screen_width = helpwindow.winfo_screenwidth()
screen_height = helpwindow.winfo_screenheight()
# calculate position x and y coordinates 假设主窗口大小固定 570x236像素 ,设置窗口位置为屏幕中心。
winwith=550
winhigh=700
x = (screen_width/2) - (winwith/2)
y = (screen_height/2) - (winhigh/2)
helpwindow.geometry("550x700"+"+{:.0f}+{:.0f}".format(x, y))
style = ttkthemes.ThemedStyle(helpwindow)
style.set_theme("breeze")
Frmroot=ttk.Frame(helpwindow)
FrmMenu = ttk.Frame(Frmroot)
FrmText = ttk.Frame(Frmroot)
LabFrmText=ttk.LabelFrame(FrmText,text="帮助",height=800,borderwidth=3)
HelpStr = tk.StringVar()
HelpStr.set(tips)
LabText = ttk.Label(LabFrmText, textvariable=HelpStr,width=55)
LabText.config(wraplength=350)
def on_closing():
global windowflag
windowflag = "close"
print(windowflag)
helpwindow.destroy()
# define button func
def ChgLog():
HelpStr.set(updateThingsString)
def ChgAbout():
HelpStr.set(about)
def ChgCon():
HelpStr.set(contribute)
def ChgTips():
HelpStr.set(tips)
LabText.config(wraplength=350)
BtnReadme = ttk.Button(FrmMenu, text="使用说明",width=14,command=ChgTips)
BtnLog = ttk.Button(FrmMenu, text="更新内容",width=14,command=ChgLog)
BtnGongxian = ttk.Button(FrmMenu, text="有贡献的开发者",width=14,command=ChgCon)
BtnAbout = ttk.Button(FrmMenu, text="关于",width=14,command=ChgAbout)
#layout
FrmMenu.grid(row=0,column=0,sticky=tk.NW)
BtnReadme.grid(row=0,column=0,sticky=tk.NW,padx=3)
BtnLog.grid(row=1,column=0,sticky=tk.NW,padx=3)
BtnGongxian.grid(row=3,column=0,sticky=tk.NW,padx=3)
BtnAbout.grid(row=4,column=0,sticky=tk.NW,padx=3)
FrmText.grid(row=0,column=1,sticky=tk.NW)
LabFrmText.grid(row=0,column=0,sticky=tk.NW,padx=3,pady=3)
LabText.grid(row=0,column=0,sticky=tk.NW)
Frmroot.pack()
windowflag = "open"
print(windowflag)
#helpwindow.mainloop()
helpwindow.protocol("WM_DELETE_WINDOW", on_closing)
###########################
# 窗口创建
###########################
win = tk.Tk() # 创建窗口
# 设置窗口
style = ttkthemes.ThemedStyle(win)
style.set_theme("breeze")
window = ttk.Frame(win)
win.title(title)
win.resizable(0, 0)
win.iconphoto(False, tk.PhotoImage(file=iconPath))
# get screen width and height
screen_width = win.winfo_screenwidth()
screen_height = win.winfo_screenheight()
# calculate position x and y coordinates 假设主窗口大小固定 570x236像素 ,设置窗口位置为屏幕中心。
winwith=570
winhigh=236
x = (screen_width/2) - (winwith/2)
y = (screen_height/2) - (winhigh/2)
win.geometry(""+"+{:.0f}+{:.0f}".format(x, y))
# 创建控件
FrmInstall = ttk.Frame(window)
LabApkPath = ttk.Label(window, text="安装 APK")
ComboInstallPath = ttk.Combobox(window, width=50)
BtnFindApk = ttk.Button(FrmInstall, text="浏览", command=FindApk)
BtnInstall = ttk.Button(FrmInstall, text="安装", command=Button3Install)
BtnShowUengineApp = ttk.Button(window, text="打开程序列表", command=Button5Click)
# 设置菜单栏
menu = tk.Menu(window, background="white")
programmenu = tk.Menu(menu, tearoff=0, background="white") # 设置“程序”菜单栏
help = tk.Menu(menu, tearoff=0, background="white") # 设置“帮助”菜单栏
menu.add_cascade(label="程序", menu=programmenu)
menu.add_cascade(label="关于", menu=help)
programmenu.add_command(label="清空软件历史记录", command=CleanProgramHistory)
programmenu.add_separator() # 设置分界线
programmenu.add_command(label="退出程序", command=window.quit) # 设置“退出程序”
help.add_command(label="程序官网", command=OpenProgramURL) # 设置“程序官网”项
help.add_command(label="反馈程序问题和建议", command=UengineRunnerBugUpload) # 设置“程序官网”项
help.add_command(label="关于", command=showhelp) # 设置“关于这个程序”项
menu.configure(activebackground="dodgerblue")
help.configure(activebackground="dodgerblue")
programmenu.configure(activebackground="dodgerblue")
# 设置控件
#ComboUninstallPath['value'] = fineUninstallApkHistory
ComboInstallPath['value'] = findApkHistory
try:
if sys.argv[1] == "-i":
ComboInstallPath.set(sys.argv[2])
print("Install Path: " + sys.argv[2])
elif sys.argv[1] == "-u":
#ComboUninstallPath.set(sys.argv[2])
ComboInstallPath.set(sys.argv[2])
print("Unstall Path: " + sys.argv[2])
else:
print("Command Format Error")
except:
print("Not Command Or Command Format Error")
# 显示控件
win.config(menu=menu) # 显示菜单栏
LabApkPath.grid(row=0, column=0,sticky= tk.W,padx=3)
ComboInstallPath.grid(row=1, column=0,padx=3)
FrmInstall.grid(row=1, column=1,padx=3, rowspan=1)
BtnFindApk.grid(row=0, column=0)
BtnInstall.grid(row=0, column=1)
BtnShowUengineApp.grid(row=2, column=0,sticky= tk.W,padx=3,pady=2)
window.pack()
win.mainloop()

1119
main.py

File diff suppressed because it is too large Load Diff

BIN
menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

25
menu.svg Executable file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 16 KiB

57
mount-disk-uengine.py Normal file
View File

@@ -0,0 +1,57 @@
import os
import psutil
import string
import ttkthemes
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.messagebox as messagebox
class Program:
def GetRoot():
return os.geteuid() == 0
def MountDisk():
Disk.MountDisk(diskChoose.get(), "/data/uengine/安卓应用文件/media/" + name.get())
class Disk:
def MountDisk(disk, path):
if not os.path.exists(path):
os.makedirs(path)
os.system("mount \"{}\" \"{}\"".format(disk, path))
class File:
def DiskList():
diskList = []
partitions = psutil.disk_partitions()
for p in partitions:
if not "loop" in p.device and not "boot" in p.device and not p.device in diskList:
#print(p.device)
diskList.append(p.device)
#print(p.mountpoint)
return diskList
if __name__ == "__main__":
window = tk.Tk()
print(File.DiskList())
if not Program.GetRoot():
window.withdraw()
messagebox.showerror(title="错误", message="此程序必须在 root 下运行!")
quit()
if not os.path.exists("/data/uengine/安卓应用文件/media"):
os.makedirs("/data/uengine/安卓应用文件/media")
#window.withdraw()
#messagebox.showerror(title="错误", message="目录不存在,无法继续操作!")
#quit()
window.title("挂载磁盘")
diskList = File.DiskList()
diskChoose = tk.StringVar()
diskChoose.set(diskList[0])
weight = ttk.Frame(window)
ttk.Label(weight, text="挂载磁盘:").grid(row=0, column=0)
ttk.OptionMenu(weight, diskChoose, diskList[0], *diskList).grid(row=0, column=1)
ttk.Label(weight, text="挂载名称:").grid(row=1, column=0)
name = ttk.Entry(weight)
ttk.Button(weight, text="挂载", command=Program.MountDisk).grid(row=2, column=1)
name.grid(row=1, column=1)
weight.pack()
window.mainloop()

View File

@@ -1,11 +1,18 @@
Package: com.gitee.uengine.runner.spark
Source: spark-uengine-runner
Version: 1.3.2
Source: com.gitee.uengine.runner.spark
Replaces: spark-uengine-runner
Version: 1.6.2
Architecture: all
Maintainer: gfdgd xi <3025613752@qq.com>, actionchen<917981399@qq.com>
Depends: deepin-elf-verify (>= 0.0.16.7-1), python3, python3-tk, python3-pip, aapt, adb, python3-pil, python3-setuptools, uengine
Section: utils
Maintainer: gfdgd xi <3025613752@qq.com>, actionchen<917981399@qq.com>, 柚子<https://gitee.com/Limexb>, 为什么您不喜欢熊出没和阿布呢<https://weibo.com/u/7755040136>, 星空露光<https://gitee.com/Cynorkyle>, shenmo<jifengshenmo@outlook.com>
Depends: deepin-elf-verify (>= 0.0.16.7-1), python3, python3-tk, python3-pip, aapt, 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, uengine
Priority: optional
Conflicts: spark-uengine-runner
Conflicts: spark-uengine-apk-builder
Homepage: [https://gitee.com/gfdgd-xi/uengine-runner, https://github.com/gfdgd-xi/uengine-runner]
Description: uengine runner for deepin and UOS
Description: UEngine 运行器1.6.2 更新内容:
※1、优化了 UEngine 运行器的英语翻译
※2、新增加了可以打开或关闭第三方应用安装的功能使用此功能后在UEngine里可以使用默认的APK安装程序安装应用此操作需要使用程序的Adb补丁
※3、新增加了 UEngine 的 Ubuntu 安装程序
※4、双包合一只保留了UOS打包标准可以从旧标准无缝升级推荐使用本程序的升级程序进行升级
5、修复了本程序在 Ubuntu 上安装和卸载报错而无法继续的问题
6、优化帮助/关于窗口在高分辨率电脑上显示不全的问题

View File

@@ -1,3 +1,25 @@
#!/bin/sh
python3 -m pip install --upgrade ttkthemes
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner /usr/bin/uengine-runner
# 使用 pip 安装所需库
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 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 easygui -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
# 建立软链接
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner /usr/bin/uengine-runner
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-apk-builder /usr/bin/uengine-apk-builder
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-app-uninstall /usr/bin/uengine-app-uninstall
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-app-install /usr/bin/uengine-app-install
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-clean /usr/bin/uengine-clean
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-about /usr/bin/uengine-runner-about
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-keyboard /usr/bin/uengine-keyboard
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-useadb /usr/bin/uengine-useadb
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-launch.sh /usr/bin/uengine-runner-launch.sh
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-update-bug /usr/bin/uengine-runner-update-bug
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/root-uengine /usr/bin/uengine-root
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-applist-launch.sh /usr/bin/uengine-runner-applist-launch.sh
# 刷新图标缓存
# 因为 Ubuntu 的问题,省略
gtk-update-icon-cache /usr/share/icons/bloom | true
# 向服务器返回安装数加1不显示内容且忽略错误
curl http://120.25.153.144/uengine-runner/Install.php?Version=1.6.2 -s > /dev/null | true

17
new-deb-build/DEBIAN/postrm Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
# 删除软链接
rm -fv /usr/bin/uengine-runner
rm -fv /usr/bin/uengine-apk-builder
rm -fv /usr/bin/uengine-app-uninstall
rm -fv /usr/bin/uengine-app-install
rm -fv /usr/bin/uengine-clean
rm -fv /usr/bin/uengine-runner-about
rm -fv /usr/bin/uengine-keyboard
rm -fv /usr/bin/uengine-useadb
rm -fv /usr/bin/uengine-runner-launch.sh
rm -fv /usr/bin/uengine-runner-update-bug
rm -fv /usr/bin/uengine-root
rm -fv /opt/apps/com.gitee.uengine.runner.spark/files/
# 刷新图标缓存
# 因为 Ubuntu 的问题,省略
gtk-update-icon-cache /usr/share/icons/bloom | true

View File

@@ -1,11 +1,12 @@
[Desktop Entry]
Categories=System;
Comment=uengineanbox 程序菜单
Comment=UEngine 程序菜单
Encoding=UTF-8
Exec=/usr/bin/uengine-launch.sh --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
Icon=/opt/apps/com.gitee.uengine.runner.spark/files/icon.png
Exec=/usr/bin/uengine-runner-applist-launch.sh
Icon=/opt/apps/com.gitee.uengine.runner.spark/files/menu.svg
MimeType=
Name=uengine 程序菜单
StartupWMClass=uengine 程序菜单
Name=UEngine App List
Name[zh]=UEngine 程序菜单
StartupWMClass=UEngine 程序菜单
Terminal=false
Type=Application

View File

@@ -0,0 +1,15 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Categories=System;
Terminal=false
Exec=/usr/bin/uengine-apk-builder %F
Icon=/opt/apps/com.gitee.uengine.runner.spark/files/builer.svg
Name=Build Apk To Deb(UEngine Runner)
Comment=Build Apk To Deb(UEngine Runner)
Comment[zh]=打包 debUEngine 运行器)
Name[zh]=打包 debUEngine 运行器)
StartupNotify=true
Hidden=false
NoDisplay=true
MimeType=application/vnd.android.package-archive

View File

@@ -4,11 +4,11 @@ Encoding=UTF-8
Categories=System;
Terminal=false
Exec=/usr/bin/uengine-runner -i %F
Icon=/opt/apps/com.gitee.uengine.runner.spark/files/icon.png
Name=Install APK(uengine runner)
Comment=Install APK(uengine runner)
Comment[zh]=安装 APKuengine 运行器)
Name[zh]=安装 APKuengine 运行器)
Icon=/opt/apps/com.gitee.uengine.runner.spark/files/runner.svg
Name=Install Or Uninstall APK(uengine runner)
Comment=Install Or Uninstall APK(UEngine runner)
Comment[zh]=安装/卸载 APKUEngine 运行器)
Name[zh]=安装/卸载 APKUEngine 运行器)
StartupNotify=true
Hidden=false
NoDisplay=true

View File

@@ -1,15 +0,0 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Categories=System;
Terminal=false
Exec=/usr/bin/uengine-runner -u %F
Icon=/opt/apps/com.gitee.uengine.runner.spark/files/icon.png
Name=Uninstall APK(uengine runner)
Comment=Uninstall APK(uengine runner)
Comment[zh]=卸载 APKuengine 运行器)
Name[zh]=卸载 APKuengine 运行器)
StartupNotify=true
Hidden=false
NoDisplay=true
MimeType=application/vnd.android.package-archive

View File

@@ -0,0 +1,12 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Categories=System;
Terminal=false
Exec=/usr/bin/uengine-apk-builder %F
Icon=/opt/apps/com.gitee.uengine.runner.spark/files/builer.svg
Name=uengine Apk Builder
Comment=UEngine Apk Builder
Comment[zh]=UEngine 应用打包器
Name[zh]=UEngine 应用打包器
StartupNotify=true

View File

@@ -4,10 +4,10 @@ Encoding=UTF-8
Categories=System;
Terminal=false
Exec=/usr/bin/uengine-runner
Icon=/opt/apps/com.gitee.uengine.runner.spark/files/icon.png
Name=uengine runner
Comment=uengine runner
Comment[zh]=uengine 运行器
Name[zh]=uengine 运行器
Icon=/opt/apps/com.gitee.uengine.runner.spark/files/runner.svg
Name=uengine Runner
Comment=UEngine Runner
Comment[zh]=UEngine 运行器
Name[zh]=UEngine 运行器
StartupNotify=true
MimeType=

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Some files were not shown because too many files have changed in this diff Show More