初步的未知来源安装开启功能完成

This commit is contained in:
2022-06-19 14:03:40 +08:00
parent 8747f69065
commit c030ab2c16
5 changed files with 63 additions and 6 deletions

View File

@@ -319,6 +319,12 @@ class UEngine:
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")
@@ -327,6 +333,12 @@ class Adb:
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
@@ -350,6 +362,9 @@ class UengineRunner:
if __name__ == "__main__":
print("本 API 不支持直接运行,请通过引入的方式使用此 API")
adb = Adb("192.168.250.2:5555")
print(adb.boolAndroidInstallOtherAppSetting())
quit()
if not ROOT.GetRoot():

Binary file not shown.