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

Support for official aapt #1225

Merged
merged 3 commits into from Apr 23, 2016
Merged

Support for official aapt #1225

merged 3 commits into from Apr 23, 2016

Conversation

BurgerZ
Copy link
Contributor

@BurgerZ BurgerZ commented Apr 17, 2016

Create fake AndroidManifest.xml file inside each installed framework file to support official aapt from Google.
This should fix such issues as #1224

Create fake AndroidManifest.xml file inside each installed framework file to support official aapt from Google.
@BurgerZ BurgerZ changed the title Support of official aapt Support for official aapt Apr 17, 2016
@iBotPeaches
Copy link
Owner

Hi, Thanks for the PR.

I see frameworks that are manually tagged are the only ones affected. In the getFrameworkApk function we actually return the internal framework if no framework already exists on the system. We should probably update that as well, but there is no easy way in the current code base since its just copying streams.

We can probably refactor the installFramework function a bit to just allow passing of the resources.arsc data so it can support both internal frameworks and frameworks installed via parameter.

Secondly, we have to generate a real bogus AndroidManifest.xml file so it can be read. I think it can be short as this

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"  />

Though I haven't tested, because if you have an invalid AndroidManifest.xml then you get this error while trying to use a stock aapt binary.

I: Building resources...
W: W/ResourceType( 5563): Bad XML block: header size 29284 or total size 1298426223 is larger than data size 37
W: ERROR: Platform AndroidManifest.xml is corrupt

I can do these changes too, just let me know.

@BurgerZ
Copy link
Contributor Author

BurgerZ commented Apr 18, 2016

Hi,

I tested it and found out that AndroidManifest.xml have to be compiled, e.g. binary xml (and it's enough to have it only inside 1.apk)

Copy AndroidManifest.xml along with resources.arsc from the framework apk file instead of creating the fake entry.
@BurgerZ
Copy link
Contributor Author

BurgerZ commented Apr 22, 2016

Updated the code. Now we can pull AndroidManifest.xml from the framework apk file, like we do with resources.arsc.

@iBotPeaches iBotPeaches merged commit 513e4b7 into iBotPeaches:master Apr 23, 2016
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

2 participants