You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Harden CFW/firmware updates with size verification and error logging
The CFW updater could fail with a bare "Extraction failed" and no
explanation. Root cause: a truncated/corrupt download passed downloadFile's
checks (it only inspected curl's return + HTTP status, never the size), then
minizip's unzOpen rejected the bad zip and extractZip returned a generic -1 —
aborting before any file was written and leaving the SD untouched.
Changes:
- download: add downloadFileChecked() which verifies the saved file matches
the asset's expected size (from the GitHub release JSON) and retries up to
DOWNLOAD_MAX_ATTEMPTS, transparently surviving flaky transfers. Capture each
asset's "size" in cfw_mgr/firmware_mgr.
- extract: extractZip now returns distinct codes (EXTRACT_ERR_OPEN/INDEX/
MEMORY) so callers can say *why* it failed instead of "Extraction failed".
- applog: new best-effort logger writing /config/AetherBlock/last_error.log
(rotated past APP_LOG_MAX_SIZE) capturing the failing step, expected vs
actual sizes, and extract codes — so a failure leaves a diagnosable trail.
- error_text now includes the specific reason for both CFW and firmware flows.
Bump APP_VERSION to 2.0.8.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments