iBotPeaches / Apktool

A tool for reverse engineering Android apk files

Home Page:https://apktool.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please explain "-m" further

privacyguy123 opened this issue · comments

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?

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

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?

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:

  • Named keys
  • Dummy resources
  • Inline of string resources (since a by-product of apktool makes them public)

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.

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?

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