feat: support non-rooted device

This commit is contained in:
2024-07-01 20:36:33 +07:00
parent e02d6c15ec
commit a18b87fa61
14 changed files with 84 additions and 25 deletions

View File

@ -11,6 +11,12 @@ from shutil import which
APP_UUID="a6db95c2-27db-4b88-a687-c8107d1bc9d6"
def is_root_available():
output = subprocess.check_output(['su', '-c', 'echo', '"iamgroot"']).decode("utf-8").strip()
if output == "iamgroot":
return True
return False
def Popen(args: list | str, root=False, shell=False, cwd=Path.cwd()):
if root:
if shell:
@ -120,6 +126,10 @@ def main():
show_notification("Checking for current adb port...")
adb_port = None
try:
if not is_root_available():
print("Root access is not available, assuming the port is 5555")
print("You'll have to start adbd manually as instructed in the README.md")
adb_port = 5555
adb_port = get_port_from_process_name("adbd")
except:
pass