File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -306,11 +306,12 @@ export async function injectSystemCertificate(
306306 # First we get the Zygote process(es), which launch each app
307307 ZYGOTE_PID=$(pidof zygote || true)
308308 ZYGOTE64_PID=$(pidof zygote64 || true)
309- # N.b. some devices appear to have both!
309+ Z_PIDS="$ZYGOTE_PID $ZYGOTE64_PID"
310+ # N.b. some devices appear to have both, some have >1 of each (!)
310311
311312 # Apps inherit the Zygote's mounts at startup, so we inject here to ensure all newly
312313 # started apps will see these certs straight away:
313- for Z_PID in "$ZYGOTE_PID" "$ZYGOTE64_PID" ; do
314+ for Z_PID in $Z_PIDS ; do
314315 if [ -n "$Z_PID" ]; then
315316 nsenter --mount=/proc/$Z_PID/ns/mnt -- \
316317 /bin/mount --bind /system/etc/security/cacerts /apex/com.android.conscrypt/cacerts
@@ -323,7 +324,7 @@ export async function injectSystemCertificate(
323324
324325 # Get the PID of every process whose parent is one of the Zygotes:
325326 APP_PIDS=$(
326- echo "$ZYGOTE_PID $ZYGOTE64_PID" | \
327+ echo $Z_PIDS | \
327328 xargs -n1 ps -o 'PID' -P | \
328329 grep -v PID
329330 )
You can’t perform that action at this time.
0 commit comments