Help! App won't install after native library modification

ArsonMods

Solid & Active Platinian
Original poster
May 25, 2023
50
1,416
183
New Mexico, United States
Ok so I have an app that's doing something rather unusual. If I try to at all mod the native library, the package will not install. Meanwhile if I try to make a modification to the dex file or install the antisplitted APK without modifications, it installs.

My procedure:

  • Download app from Google Play
  • Extract split APK zip to internal storage with X-Plore
  • Run the APK through antisplit G2 (signing doesnt work on it, but I always sign later with MT)
  • Take the output of antisplit and modify it (either a dex file mod or putting in a modded native library)
  • Sign it with MT
  • Install it
So that last step is where my issue is. If I just modify something in the dex file or don't mod anything at all, it installs after being signed with MT. Meanwhile, if I put in a modded native library, once the APK is signed with MT it won't install at all and gives me an invalid package error. I have no idea how this is happening. I've modded a few native libraries on different apps and games and even if I make a mistake in the mod it usually makes the app malfunction or crash, but never fail to install. I've tried killing signature verification in numerous ways, which didn't help as this doesn't even seem to have it. Not sure why dex mods would work but the Android package manager writes off the APK as invalid if I put in a library where I simply change a b.ne (branch if not equal) instruction to b.eq (branch if equal) using HxD after I reverse engineered the binary with Ghidra for a few hours.

Does anyone know how to fix this?



(Now yes I understand that no legitimate downloads of mods for this app exist and only some 4PDA users cracked some versions, it's not easy at all to reverse engineer, but still I want to at least be able to install this to see if my first patch attempt unlocked the video settings.)
 

NotAWeeb!

1/3 Games Approved
Aug 31, 2023
202
34,852
1,193
japaneseland
Does the exact same thing. I also tried zipaligning with APKTool M and then signing again with apk-signer. Doesnt work.
May it be that you're accidentaly adding bytes when modding the lib instead of only replacing?

I know, pretty obvious questions, but we need to sort the basics first
 

ArsonMods

Solid & Active Platinian
Original poster
May 25, 2023
50
1,416
183
New Mexico, United States
May it be that you're accidentaly adding bytes when modding the lib instead of only replacing?

I know, pretty obvious questions, but we need to sort the basics first
Bytes are equal between original and modified.

Hold on. Did you know you can download the .apk version of the app? So you don't have to use the .xapk or .apks file through antisplit, which may be the cause of the problem.

Download the armeabi-v7a APK here: https://apkcombo.com/downloader/#package=io.recompiled.redream&arches=armeabi-v7a&gl=US

Also, if you want you can bookmark that tool for any other APK files. It's very useful.
I know I will try it again with that to see if it makes a difference. Usually I never have an issue with my existing setup other than having to use APK sites when I need ARMv7 support.
 

ArsonMods

Solid & Active Platinian
Original poster
May 25, 2023
50
1,416
183
New Mexico, United States
Hey @NotAWeeb! wow that site fixed my problem. Such a weird issue. My original patch didnt work but I just reverse engineered some of the menu item placement code and so far got the paid resolution option going.
Screenshot_20231113_191429_redream.jpg
 

NotAWeeb!

1/3 Games Approved
Aug 31, 2023
202
34,852
1,193
japaneseland
Hey @NotAWeeb! wow that site fixed my problem. Such a weird issue. My original patch didnt work but I just reverse engineered some of the menu item placement code and so far got the paid resolution option going. View attachment 572786
AWESOME!! :pepe007: Now we know the problem was at Antisplit. That app actually gave me problems some time ago first time I used it, and since then I don't trust it.

You now can make sure to either always try to download the .apk version of the app on the internet (or using that tool), or consider other options of merging the .xapk/.apks file, like this one, and merge it before trying to mod it. That merging method always works perfectly, though I don't know if it can work on Android with a command line like Termux.
 

ArsonMods

Solid & Active Platinian
Original poster
May 25, 2023
50
1,416
183
New Mexico, United States
AWESOME!! :pepe007: Now we know the problem was at Antisplit. That app actually gave me problems some time ago first time I used it, and since then I don't trust it.

You now can make sure to either always try to download the .apk version of the app on the internet (or using that tool), or consider other options of merging the .xapk/.apks file, like this one, and merge it before trying to mod it. That merging method always works perfectly, though I don't know if it can work on Android with a command line like Termux.
Haha yeah thanks. I will make sure to use that site if I run into the same issue again (antisplit works for 99% of what I mod) and also if I need ARMv7 versions of apps since I do have some devices that aren't 64-bit and it's not always easy to find ARMv7 or universal APKs on other sites.
 
  • Like
Reactions: NotAWeeb!