Skip to content

Commit a93640b

Browse files
authored
Merge pull request #95 from mixalbl4-127/main
fixed injecting script for devices with APEX
2 parents 5423426 + d9d7c5f commit a93640b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/interceptors/android/adb-commands.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,11 @@ export async function injectSystemCertificate(
310310
311311
# Apps inherit the Zygote's mounts at startup, so we inject here to ensure all newly
312312
# started apps will see these certs straight away:
313-
for Z_PID in "$ZYGOTE_PID $ZYGOTE64_PID"; do
314-
# We use 'echo' below to trim spaces
315-
nsenter --mount=/proc/$(echo $Z_PID)/ns/mnt -- \
316-
/bin/mount --bind /system/etc/security/cacerts /apex/com.android.conscrypt/cacerts
313+
for Z_PID in "$ZYGOTE_PID" "$ZYGOTE64_PID"; do
314+
if [ -n "$Z_PID" ]; then
315+
nsenter --mount=/proc/$Z_PID/ns/mnt -- \
316+
/bin/mount --bind /system/etc/security/cacerts /apex/com.android.conscrypt/cacerts
317+
fi
317318
done
318319
319320
echo 'Zygote APEX certificates remounted'

0 commit comments

Comments
 (0)