Repository navigation
Conversation
Recover now puts back the settings, live props and binds an apply or trial changed, not only its files: a trial's persist.* prop stayed set after "trial undone", and the next apply took it for stock. Stock backups are copied beside, checked against the stock md5, then renamed, as install.sh's backup() does. An app's odex backup has its md5 recorded, and every backup is checked before a restore or rebuild; a NEMESIS copy with the recorded md5 stands in for a damaged one, else the engine stops and names it. The journal's saved copies are checked the same way. An apply checks room on /system and /data before writing anything; recover removes a cut-off copy, and on a full /system the file, before its saved copy goes back. A damaged journal, or a saved copy that's gone, is set aside (state/journal.bad.json) instead of failing at every start. build.prop and live props refuse dalvik.* and persist.sys.dalvik.* without overrides.allow_critical; CRITICAL takes framework-res.apk, libz, libcrypto, the ICU files, libgui, libEGL, lib/hw and lib/egl, and the boot daemons Android waits for. update-hmgapi refuses while a journal is pending. The Dalvik cache clean-up touches only the app's own entry, priv-app included. Tests: core/runtime/journal-test.sh, plus safety-test.sh and usb-test.sh. Off-car only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both sides added a CHANGELOG entry and a test to test-all.sh: kept both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Open-HMG/maintainers, input wanted on one design question before this goes in. When a stock backup is damaged and no NEMESIS copy fits, what should stop? As written, Options:
Which do you prefer, and why? |
When a stock backup isn't the recorded md5 and no NEMESIS copy has it, the plan used to stop as a whole, so every later apply and the uninstall waited until the owner copied a stock file over by hand. Now only that file waits: it's left as it is and never written from the bad copy, the warning names the backup and the md5 it should have, and the rest of the apply or restore goes on. files.json keeps the file's record with "held" (why), `engine status` shows it as CHANGED, and the next apply clears it once a stock copy is in place. `engine restore` ends with code 4 while anything is held, so the uninstall stops before removing HMG-API and its backups. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
My vote: 1.
I won't change anything until the maintainers agree. |
…inds; checked backups; room checks From AwsomeFox/fix/journal-backups (Open-HMG#430).
release/2.0 turned the Unreleased section into 1.1.0 (rc.10's code). This branch's entries, and the root-service entry that came in with main after 1.1.0, go in a new Unreleased section above it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Decision: option 1, as you voted. A damaged backup with no copy that fits stops only that file: it's left as it is and named (CHANGED in the status, with why), and the rest of the plan, the other restores and the uninstall go on. A damaged backup is never written back, and there's no override to do it. Please have the status say what the owner can do about that file. |
A file held back by a damaged stock backup now carries what the owner can do, beside why: copy the stock file (its md5 named, or the odex the app came with) to the backup's path and run `engine apply`, or open an issue with that line, the car and its software version. The apply's warning ends with it, files.json keeps it as "fix", and `engine status` prints it under the CHANGED line until the file is built or put back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What this changes
Fixes the problems from the 2026-11-26 review of the engine's journal and backups (
core/runtime/java/hmgapi/engine/Engine.java,UsbUpdates.java).binds.txt/binds.failed;engine recoverwrites them back (and has hmgapid redo the binds). Before, a trial'spersist.test.x=1stayed set after "trial undone", the next apply recorded"stock": "1", andengine restoreleft it set. An apply cut off between the settings and the state left the same.install/common/install.shbackup()does. The odex backup's md5 is recorded infiles.json("odex"). Every backup is checked against its recorded md5 before a restore, uninstall or rebuild. A damaged one is replaced by a NEMESIS copy with that md5 if there is one, else the plan stops and names the backup and the md5 it should have. For older records with no odex md5, a Dalvik odex shorter than its header says is refused./system(new files; a held app's old apk/odex counts as freed, other files count whole) and/data(journal copies, backups, Dalvik cache).recoverremoves the cut-off.hmgapi-newcopy beside each file and, when/systemstill has no room, the file before its saved copy goes back.recoversets the journal aside (state/journal.bad.json, copies instate/prev.bad/) with a clear message, so apply, restore and uninstall aren't refused forever. A missing or damaged saved copy is skipped and named, and the rest are still put back.statusandkeepno longer crash on a bad journal.overrides.allow_critical.build.proprefusesdalvik.*andpersist.sys.dalvik.*keys as well asro.*. Live props refusepersist.sys.dalvik.*("prop:<key>"). CRITICAL addsframework-res.apk,libz,libcrypto,libssl,libicuuc/libicui18n,icudt51l.dat,libgui,libui,libEGL,libGLESv2,libhardware,libsqlite,libexpat, everything under/system/lib/hw/and/system/lib/egl/, andnetd,mediaserver,logwrapper,e2fsck. The daemon list was picked without a stockinit.rcto hand, so it's worth a look against a real one.update-hmgapirefuses,--forceincluded. The catalogue'supdateHmgApi(catalog/app,catalog/engine) goes throughUsbUpdates.updateHmgApi, so it's covered on rebase; calling the newUsbUpdates.pendingWhybefore downloading would avoid a wasted download.system@app@X.apk@classes.dex) is deleted, not a*X.apk*glob, and priv-apps getsystem@priv-app@….Also: an uncommitted trial (cut off mid-apply) now reports "unfinished apply rolled back" instead of "trial undone";
boot.shrestarts on either. Off-car tests can stop the engine dead at a point (HMGAPI_TEST_CUT, host only) and fake free space (HMGAPI_TEST_FREE, host only).Tested on
tools/test-all.sh --fastpasses (32 ok, 1 skipped for no ImageMagick). Newcore/runtime/journal-test.sh(89 checks; 39 of them fail against main's engine, including the"stock": "1"repro), plus new cases insafety-test.shandusb-test.sh. The rest of the full suite (hmgapid, zygote, lpatch, installers, SDK) can't run on the Mac this was written on (no qemu-arm); those 6 fail the same way on untouched main there, so CI is the check for them.Tested on cars
Off-car only.
Checklist
/systemkeeps a stock check, a backup and an exact restoreCHANGELOG.mdupdated (the wiki has no page on these rules)🤖 Generated with Claude Code