why do I even need to do this?

This commit is contained in:
Jean-Marie Mineau 2025-05-15 14:33:04 +02:00
parent 69f1c7be10
commit 89b5487d31
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2

View file

@ -371,10 +371,19 @@ def collect_runtime(
app = get_apkid(apk)[0]
if device.enumerate_applications([app]):
# Uninstall the APK if it already exist
subprocess.run([adb, "uninstall", app], env=env)
subprocess.run([adb, "install", "-g", str(apk.absolute())], env=env)
i = 0
while not device.enumerate_applications([app]):
time.sleep(i)
subprocess.run([adb, "install", "-r", "-g", str(apk.absolute())], env=env)
i += 1
if i == 10:
print("[!] Failled to install apk")
e = RuntimeError("Failled to install apk")
e.add_note(f"apk: {app} ({str(apk.absolute())})")
e.add_note(
f"installed apk: {' '.join(map(str, device.enumerate_applications()))}"
)
raise e
with FRIDA_SCRIPT.open("r") as file:
jsscript = file.read()