fractalwrench/ApkGolf

Do we need a classes.dex?

zhuowei opened this issue · 2 comments

My understanding of https://github.com/android/platform_frameworks_base/blob/b056324630b8adfeb38393bcab49f3b9c720f4fd/core/java/android/content/pm/PackageParser.java#L3486 is that FLAG_HAS_CODE would only be set (and a classes.dex required) if we have an element in the manifest. Since we don't have an application element, what happens if you delete classes.dex?

Nope, you're right - deleting classes.dex is OK now, and drops ~100 bytes off the final APK.

We're now at 224 bytes unsigned and 824 bytes signed.

Given that it's your idea, it would be nice to submit a PR deleting it (just remove the touch classes.dex or something). Merging is gonna be fun eventually...

@nneonneo nah, you can do it. Thanks for testing this and making it work!