fix: detect real Flutter snapshot hash in elff() - #387
Open
4B3R4M4-607D wants to merge 1 commit into
Open
4B3R4M4-607D wants to merge 1 commit into
4B3R4M4-607D wants to merge 1 commit into
Conversation
The old elff() opened the binary in text mode with errors='ignore', which dropped non-UTF8 bytes and concatenated printable segments that were separated by binary bytes. This produced fake 32-hex strings that are not real snapshot hashes, causing 'This engine is currently not supported' even when the real hash exists in enginehash.csv. Read the file as binary and collect contiguous 32-hex ASCII runs, preferring candidates that appear in enginehash.csv.
4B3R4M4-607D
marked this pull request as ready for review
August 28, 2026 08:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
elff()currently opens the target binary in text mode (errors="ignore"), which silently drops non-UTF8 bytes and then concatenates printable segments that were originally separated by binary bytes. When those concatenated segments happen to form a 32-character hex string, it is returned as the engine snapshot hash — even though it is not a real hash.This makes reFlutter report
This engine is currently not supported.for apps whose real snapshot hash is present inenginehash.csv. Any app whose binary layout triggers this false-positive string is wrongly rejected.What Changed
elff()now reads the file as binary and collects only contiguous 32-hex ASCII runs.enginehash.csv(cached module-wide) so the real snapshot hash wins even when other 32-hex runs appear earlier in the file.Verification
Reproduced on an iOS app (Flutter 3.24.0 engine):
elff)release.RE.ipaproducedThe fix was independently confirmed by scanning both
App.framework/AppandFlutter.framework/Flutterfor contiguous 32-hex runs, and matching the result againstenginehash.csv.