修复 deepin 23 安装的 APK 无法正常在启动器显示图标的问题
This commit is contained in:
BIN
new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/aapt/aapt
Executable file
BIN
new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/aapt/aapt
Executable file
Binary file not shown.
BIN
new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/aapt/aapt2
Executable file
BIN
new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/aapt/aapt2
Executable file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
libaapt.so.0
|
||||
Binary file not shown.
Binary file not shown.
14
new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/aapt/run-aapt.sh
Executable file
14
new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/aapt/run-aapt.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# 判断是不是 Deepin23
|
||||
cat /etc/deepin_version | grep 23
|
||||
if [[ $? != 0 ]]; then
|
||||
# 如果不是
|
||||
aapt "$@"
|
||||
exit $?
|
||||
fi
|
||||
# 如果是
|
||||
programPath=$(cd $(dirname $0); pwd)
|
||||
echo $programPath
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$programPath"
|
||||
$programPath/aapt "$@"
|
||||
exit $?
|
||||
@@ -6,6 +6,12 @@ import traceback
|
||||
import subprocess
|
||||
from getxmlimg import getsavexml
|
||||
|
||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||
|
||||
# 获取用户主目录
|
||||
def get_home()->"获取用户主目录":
|
||||
return os.path.expanduser('~')
|
||||
|
||||
class ProgramInformation:
|
||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||
version = "1.6.0Alpha2"
|
||||
@@ -49,7 +55,7 @@ class APK:
|
||||
def uninstall(self):
|
||||
return os.system("uengine uninstall --pkg='{}'".format(self.packageName()))
|
||||
def information(self):
|
||||
return subprocess.getoutput("aapt dump badging '{}'".format(self.apkPath))
|
||||
return subprocess.getoutput("'{}/aapt/run-aapt.sh' dump badging '{}'".format(programPath, self.apkPath))
|
||||
def activityName(self):
|
||||
info = self.information()
|
||||
for line in info.split('\n'):
|
||||
|
||||
@@ -10,10 +10,12 @@ import zipfile
|
||||
import subprocess
|
||||
import re
|
||||
|
||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||
|
||||
class getsavexml():
|
||||
|
||||
def savexml(self,apkFilePath,xmlpath,iconSavePath):
|
||||
cmddumpid = "aapt dump xmltree "+ apkFilePath + " " + xmlpath
|
||||
cmddumpid = f"'{programPath}/aapt/run-aapt.sh' dump xmltree "+ apkFilePath + " " + xmlpath
|
||||
print(cmddumpid)
|
||||
xmltree = subprocess.getoutput(cmddumpid)
|
||||
xmls = xmltree.splitlines()
|
||||
@@ -35,7 +37,7 @@ class getsavexml():
|
||||
print(foreimgid)
|
||||
|
||||
# 直接从apk resource文件获取前后两层图片路径及ID字符串
|
||||
resource = subprocess.getoutput("aapt dump --values resources " + apkFilePath + "| grep -iE -A1 " + "\"" + backimgid + "|" + foreimgid + "\"")
|
||||
resource = subprocess.getoutput(f"'{programPath}/aapt/run-aapt.sh' dump --values resources " + apkFilePath + "| grep -iE -A1 " + "\"" + backimgid + "|" + foreimgid + "\"")
|
||||
resourcelines = resource.splitlines()
|
||||
print(resourcelines)
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@
|
||||
"11、deepin 终端",
|
||||
"……"
|
||||
],
|
||||
"Time": "2024-01-29 18:34:06 Linux-6.1.32-amd64-desktop-hwe-x86_64-with-glibc2.35",
|
||||
"Time": "2024-01-29 19:04:32 Linux-6.1.32-amd64-desktop-hwe-x86_64-with-glibc2.35",
|
||||
"Contribute": [
|
||||
"<b>感谢以下用户提供的问题、建议、图标、代码等,如果有遗漏,请及时与开发者联系添加,以及如果侵犯到您的合法权益,也及时与开发者联系:</p>",
|
||||
"<hr>",
|
||||
|
||||
@@ -289,7 +289,7 @@ def write_txt(path, things):
|
||||
file.close() # 关闭文本对象
|
||||
|
||||
def GetApkInformation(apkFilePath):
|
||||
return GetCommandReturn("aapt dump badging '{}'".format(apkFilePath))
|
||||
return GetCommandReturn("'{}/aapt/run-aapt.sh' dump badging '{}'".format(programPath, apkFilePath))
|
||||
|
||||
def GetApkActivityName(apkFilePath):
|
||||
info = GetApkInformation(apkFilePath)
|
||||
|
||||
@@ -313,7 +313,7 @@ def write_txt(path, things):
|
||||
file.close() # 关闭文本对象
|
||||
|
||||
def GetApkInformation(apkFilePath):
|
||||
return GetCommandReturn("aapt dump badging '{}'".format(apkFilePath))
|
||||
return GetCommandReturn("'{}/aapt/run-aapt.sh' dump badging '{}'".format(programPath, apkFilePath))
|
||||
|
||||
def GetApkActivityName(apkFilePath):
|
||||
info = GetApkInformation(apkFilePath)
|
||||
|
||||
@@ -418,7 +418,7 @@ def write_txt(path: "路径", things: "内容")->"写入文本文档":
|
||||
|
||||
# 获取 aapt 的所有信息
|
||||
def GetApkInformation(apkFilePath: "apk 所在路径")->"获取 aapt 的所有信息":
|
||||
return GetCommandReturn("aapt dump badging '{}'".format(apkFilePath))
|
||||
return GetCommandReturn("'{}/aapt/run-aapt.sh' dump badging '{}'".format(programPath, apkFilePath))
|
||||
|
||||
# 获取 apk Activity
|
||||
def GetApkActivityName(apkFilePath: "apk 所在路径")->"获取 apk Activity":
|
||||
@@ -1559,7 +1559,7 @@ def UseProgram():
|
||||
<p>10、deepin 终端:{}</p>'''.format(subprocess.getoutput("uengine version"),
|
||||
subprocess.getoutput("python3 --version"),
|
||||
QtCore.qVersion,
|
||||
subprocess.getoutput("aapt version"),
|
||||
subprocess.getoutput(f"'{programPath}/aapt/run-aapt.sh' version"),
|
||||
subprocess.getoutput("dpkg --version"),
|
||||
subprocess.getoutput("mkdir --version"),
|
||||
subprocess.getoutput("chmod --version"),
|
||||
@@ -1582,7 +1582,7 @@ if not lang in langFile.keys():
|
||||
programUrl = information["Url"][0]
|
||||
version = information["Version"]
|
||||
goodRunSystem = information["System"]
|
||||
aaptVersion = GetCommandReturn("aapt version")
|
||||
aaptVersion = GetCommandReturn(f"'{programPath}/aapt/run-aapt.sh' version")
|
||||
SystemVersion = GetSystemVersion()
|
||||
iconPath = "{}/runner.svg".format(os.path.split(os.path.realpath(__file__))[0])
|
||||
about = f'''<p align="center"><img width=256 src="{iconPath}"/></p>
|
||||
|
||||
@@ -35,7 +35,7 @@ information = json.loads(readtxt(programPath + "/information.json"))
|
||||
programUrl = information["Url"][0]
|
||||
version = information["Version"]
|
||||
goodRunSystem = information["System"]
|
||||
aaptVersion = subprocess.getoutput("aapt version")
|
||||
aaptVersion = subprocess.getoutput(f"'{programPath}/aapt/run-aapt.sh' version")
|
||||
about = '''介绍 :一个基于 Python3 的 tkinter 制作的 UEngine 运行器,在新版本Deepin/UOS发布后,可以在应用商店安装部分官方已适配的安卓应用,对爱好者来说,不能自己安装APK软件包始终差点意思,本程序可以为Deepin/UOS上的UEngine安卓运行环境安装自定义APK软件包,并能发送安装的APK包启动菜单到桌面或系统菜单。
|
||||
|
||||
版本 :{}
|
||||
@@ -75,7 +75,7 @@ def UseProgram():
|
||||
10、deepin 终端:{}'''.format(subprocess.getoutput("uengine version"),
|
||||
subprocess.getoutput("python3 --version"),
|
||||
tk.TkVersion,
|
||||
subprocess.getoutput("aapt version"),
|
||||
subprocess.getoutput(f"'{programPath}/aapt/run-aapt.sh' version"),
|
||||
subprocess.getoutput("dpkg --version"),
|
||||
subprocess.getoutput("mkdir --version"),
|
||||
subprocess.getoutput("chmod --version"),
|
||||
|
||||
Reference in New Issue
Block a user