Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement automatic resource resolution #3574

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kosovo0275
Copy link

No description provided.

Copy link
Owner

@iBotPeaches iBotPeaches left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does look a lot smaller than the last attempt. The override of the method on baksmali seems much more elegant than last time.

One thing I'm curious about

public void loadResourceIds(ResTable resTable, File outDir) throws SAXException, IOException, AndrolibException {
this.loadFrameworkResources(resTable);
Map<String, File> resourceFiles = new HashMap<>();
resourceFiles.put(outDir.getName(), new File(outDir, "res/values/public.xml"));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this part? I'm not following why we'd generate our own res/values/public.xml. Wouldn't that conflict with the natural generation of it? Is that solely done to keep the API happy with baksmali that needs it?

It seems (albeit maybe memory heavy) - we can keep the resources in memory during disassembly and just reference them during this override of loadResourceIds with some dummy null file that actually queries that hashmap

throw new AndrolibException("Could not parse framework resources", ex);
}
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit - can we kill newline?

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.

None yet

3 participants