Skip to content

worker: put the install verifier back after a batch restore - #9

Draft
ash-iir wants to merge 1 commit into
mainfrom
fix-batch-verifier
Draft

ash-iir wants to merge 1 commit into
mainfrom
fix-batch-verifier

Conversation

@ash-iir

@ash-iir ash-iir commented Nov 19, 2026

Copy link
Copy Markdown
Owner

restore() turns off verifier_verify_adb_installs and package_verifier_enable and relies on the EXIT trap (cleanup → verifier_restore) to put them back. In restore-batch each item runs restore() in a ( … ) & subshell, which runs no EXIT trap, so they were never restored, and the second item saved 0 as the "old" value. After any batch restore, both settings stayed at 0.

  • restore_batch calls verifier_off once before the loop and verifier_restore after it (the parent's EXIT trap still covers a kill).
  • restore() skips its own verifier_off when IN_BATCH=1.

Testing

  • sh -n on worker.sh.
  • Checked under mksh and busybox sh that a ( … ) & subshell does not run the parent's EXIT trap.
  • Not tested on a rooted device.

Each batch item runs restore() in a subshell, which runs no EXIT trap,
so verifier_restore never ran and the next item saved 0 as the old value.
verifier_verify_adb_installs and package_verifier_enable stayed off.
Turn the verifier off once in restore_batch and restore it there.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant