iBotPeaches / Apktool

A tool for reverse engineering Android apk files
https://apktool.org/
Apache License 2.0
20.09k stars 3.57k forks source link

Please explain "-m" further #3608

Closed privacyguy123 closed 4 months ago

privacyguy123 commented 4 months ago

To me, it sounds quite important to "match"the original file when decompiling/recompiling and when I pass this option I am not seeing any error recompiling either as the documents seem to suggest.

Can you explain further what this is actually doing? I assume this option does not exist in Google official baksmali/smali fatjars?

iBotPeaches commented 4 months ago

Its avoiding anything Apktool does to massage a file - used for analysis mostly when you have no intent for reassembly.

I adjusted the wording - https://github.com/iBotPeaches/Apktool/commit/bcd55d050329971527300f7f5e3b02787fa1f6c1

privacyguy123 commented 4 months ago

Its avoiding anything Apktool does to massage a file - used for analysis mostly when you have no intent for reassembly.

I adjusted the wording - bcd55d0

I'm still not 100% sure what it's doing. It does sound like it should be necessary to "match original" when dealing with decompiling/recompiling any file no?

iBotPeaches commented 4 months ago

I'm still not 100% sure what it's doing. It does sound like it should be necessary to "match original" when dealing with decompiling/recompiling any file no?

Not really no - an application is increasingly stripped of more and more things. A strict 1-1 disassembly of that will match the original, but fall short of many things that make it easy to re-assemble or even analyze. Such as:

Chances are the average user who has no idea about Apktool internals or AOSP internals will have any idea what any of that means. If they do - they can look at the source and identify the exact difference of the flag.

privacyguy123 commented 4 months ago

I am decompiling and recompiling a modded framework.jar - I am not sure if it's better to use "-m" or not as they both recompile and boot fine. I guess this is my question, which should I go with?

iBotPeaches commented 4 months ago

If you aren't touching resources and only sources - -m is not relevant.