Skip to content

Add mappings compacting and compression#399

Draft
770grappenmaker wants to merge 1 commit intobartoostveen:masterfrom
770grappenmaker:mappings
Draft

Add mappings compacting and compression#399
770grappenmaker wants to merge 1 commit intobartoostveen:masterfrom
770grappenmaker:mappings

Conversation

@770grappenmaker
Copy link

Title. Achieves (after compression with xz) a reduction in file size of ~99.1%

A few concerns I still have:

  • The code to optionally compress is janky (hardcoded xz + shell delegation with try-catch)
  • I am not 100% convinced of the correctness of the mappings pruning
  • Part of the pipeline to build the reduced/compacted mappings is stripping redundant and/or duplicated entries as well as line number table information, unsure if this is desired
  • The structure of the tasks might not be preferable

For this reason, this pull request is not marked as ready for merge and is marked as a draft pull request.

@770grappenmaker
Copy link
Author

One major issue is that R8 (my library is primarily written for handling proguard output) likes to output mappings for inlined (?) methods, like so (these do not exist in the bytecode, they mean: "if you see a stack trace entry at this line with onCreate, it actually corresponds to this inlined method):

250:254:void onCreate():0:0 -> onCreate
255:270:void maybeRestorePlayerQueue():0:0 -> onCreate

So before this pull request is ready for merge, dependencies should be included to the inheritance search in order to detect these ridiculous mappings (android os classes are obviously not packaged with the app).
Right now, PlayerService, the class file with the largest dex representation byte size, according to dexlib2, deobfuscates correctly using the pruned/compacted mappings, except for onCreate.

@Wqttzicue
Copy link

Why is this pull request staying in here for so long?

@bartoostveen
Copy link
Owner

@Wqttzicue This PR is a draft. I won't review this in the meantime.

@Wqttzicue
Copy link

@Wqttzicue This PR is a draft. I won't review this in the meantime.

Ah, k, ty, im far away from all that computernerd stuff

@dtomvan
Copy link

dtomvan commented Dec 11, 2024

screenshot-2024-12-11-09-30-47

You are telling me that this app will compile to almost 54 KiB?! I can't really believe that TBH...

@770grappenmaker
Copy link
Author

screenshot-2024-12-11-09-30-47

You are telling me that this app will compile to almost 54 KiB?! I can't really believe that TBH...

No, the mappings achieve that amount of file size reduction.

@Silver-M6
Copy link

Safe to say that this will never get merged

@770grappenmaker
Copy link
Author

Safe to say that this will never get merged

So why exactly does this matter, this doesn't add features to the app at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants