Support parsing mergedClasses metadata to better de-obfuscate heap dumps. - #6911
Open
MichaelFQuigley wants to merge 5 commits into
Open
Support parsing mergedClasses metadata to better de-obfuscate heap dumps.#6911MichaelFQuigley wants to merge 5 commits into
MichaelFQuigley wants to merge 5 commits into
Conversation
Move implementation of array helper methods into simple_json_parser.h
to make simple_json_parser a header-only source set and avoid ODR
violations when included by multiple components.
This is in preparation for an upcoming change to parse JSON comments from
Proguard mapping (.map) files, such as:
# {"id":"com.android.tools.r8.mergedClasses", "class_id_field": "$cid", "merged_classes": [{ "name": "ClassA", "class_id": 0 }, { "name": "ClassB", "class_id": 1 }]}
Add parsing for R8 mergedClasses JSON comments in Proguard mapping files to extract class merging information into ObfuscatedClass.
🎨 Perfetto UI Builds
|
…scator-merged-classes
| if (current_class_ == nullptr) { | ||
| return base::Status(); | ||
| } | ||
| size_t json_start = line.find('{'); |
Member
There was a problem hiding this comment.
There can be other metadata with this prefix # { .
So, trying to parse this json can be costly. What about a early substring check for the kMergedClassesId?
| std::string_view json_sv = std::string_view(line).substr(json_start); | ||
| base::Status s = ParseMergedClassesComment(json_sv, *current_class_); | ||
| if (!s.ok()) { | ||
| PERFETTO_DLOG("Failed to parse merged classes comment: %s\non line %s", |
Member
There was a problem hiding this comment.
nit, push a import_logs like RecordAnalysisLog instead.
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.
This supports parsing of JSON comments in the Proguard mapping (.map) files, such as:
This will allow for disambiguation of de-obfuscated classes in heap dumps.