androidapkreverse-engineeringapktool

Modded APK displaying errors with minimal edits


I'm completely new to APK modding and I'm trying to edit some strings on a random app I use.

I use Apktool to decompile and recompile the APK and uber-apk-signer to sign and zipalign it.

Then, I install the modded APK on BlueStacks to test it out: it starts up fine, but when I try to access certain parts that (I suppose?) require some kind of verification, the app displays an error (no crash). This does not happen with the original unmodified app.

I tried to use apksigcopier because I figured it was a signature issue, but I couldn't get it to work because the recompiled APK's size is for some reason larger than the original, even when I don't make any changes!

I'm a little lost here... How do people manage to mod APKs and get them to work? I can't even change a single string without 80% of the app crashing...


Solution

  • Sounds like signature integrity check. Judging from info from your comments.

    If the original apps work well on emulator, then I think it may not be Play Integrity check, as suspected in one of the comments.

    Perhaps the app has it's own signature integrity check.

    Before reverse engineering/patching any apk, you must first check if it is protected by any commercial protection, before proceeding. For this, use APKiD

    If it isn't protected by any commercial product and it looks basic, then you have options to either use pre-built tools to bypass integrity checks, or manually patch it by yourself.

    For prebuit tools (easy path), you can use

    1. LSPatch's sign kill
    2. MT Manager/NP Manager sign kill
    3. SimpleHook Sign bypass
    4. Or, you can use publicly avaliable frida scripts to bypass sign check, along with frida gadgets

    How do people manage to mod APKs and get them to work? I can't even change a single string without 80% of the app crashing.

    That's what signature/self integrity checks are for. People use it so that modders can't mod their products. While it doesn't prevent modding completely, it at least makes it difficult.

    Basically, the app checks for its own integrity in its code — if it has been modified or not. You need to patch that check first before you can even change anything inside the apk statically.