Lanchon / haystack

Signature Spoofing Patcher for Android
GNU General Public License v3.0
234 stars 45 forks source link

exception: lanchon.multidexlib2.EmptyMultiDexContainerException #18

Closed MatthiasHGW closed 7 years ago

MatthiasHGW commented 7 years ago

Hi!

Thank you for this great tool. I am trying to patch (the rooted) Android 7.1.1 on my Xperia Z5 compact. Pulling the files worked without problems, but when I applied the patch for the hook using

./patch-fileset patches/sigspoof-hook-7.0-7.1/ 25 kompakt/

I get the following error message:

info: read 'kompakt/services.jar' fatal: exception: lanchon.multidexlib2.EmptyMultiDexContainerException: kompakt/services.jar

I have to admit that I have no idea what this means. Could you please help me to solve this?

Thank you, Matthias

Lanchon commented 7 years ago

hi,

as stated in the docs...

Requirements:

  • An Android device with a deodex rom that supports root adb.

your rom is most likely not deodex.

Lanchon commented 7 years ago

maybe this helps? i don't know...

https://forum.xda-developers.com/showthread.php?t=2213235

MatthiasHGW commented 7 years ago

Thank you for the quick reply. I had read the requirement for a deodexed rom and checked if there are any .odex files below /system/app. Since I could not find any, I had assumed that I am running a deodexed rom already. It seems that (with Nougat?) the .odex files were replaced with *.oat files. I have spent the last hours trying to find out how to deodex my rom, but the more I read, the more confused I get. I will keep reading and then come back to haystack.

MatthiasHGW commented 7 years ago

So I have made some progress: I found a way to deodex my rom using superR's kitchen. Unfortunately, I was not able to produce a working system.img or even a full ROM zip. My phone got stuck during boot, so I

Is there a way to debug the patches somehow so I can find out what went wrong? Can I maybe activate Signature spoofing via adb, asuming that the patch itself is working and the problem is with the menu entry?

Lanchon commented 7 years ago

you CAN'T deodex partially: if you change one piece of code (like, by deodexing it) you invalidate ALL odexed code in the rom; deodexing is an all or nothing affair.

regarding your question, you can decide not to apply the UI (the 3rd) patch (it's optional), and spoofing will be always enabled.

it's easy to deodex a rom with smali directly, but there are lots of files to deodex and rebuild. there are tools to help (like the one you tried) but they must use the latest smali if you have nougat.

unfortunately, if you can't deodex your rom, you won't be able to patch it.

MatthiasHGW commented 7 years ago

Hi!

It took me a while, but I finally managed to deodex the complete ROM and flash it back to my phone. Applying your patches worked without any problems, and signature spoofing is "ENABLED" according to your Signature Spoofing Checker. The only thing still missing is the UI. There is no entry in the developer options to disable signature spoofing. While I could live without it, it would be nice to have the full functionality of you patch. Is there a way for me to find out why I do not get the UI?

Thank you, Matthias

Lanchon commented 7 years ago

hola Matt,

your issue is very weird. haystack patches are applied in 2 or 3 steps: 1) hook for a particular android version (required) 2) the signature spoofing code (required) 3) the UI (optional)

did you actually apply the 3rd patch? or have you forgotten? because when you apply the 3rd patch, the state of sigspoof becomes dependent on a setting, which by default is DISABLED. i can imagine a modded settings app that can be patched correctly... ok that could happen. what i don't get is then sigspoof to be ENABLED by default! (since you can't configure the setting.) this makes me very suspicious of your applying the 3rd patch. could you maybe have applied it but then pushed the wrong fileset to the phone?

thanks!

MatthiasHGW commented 7 years ago

Well, this is embarrassing! I just repeated the whole process and used your script to write the patched files back to the phone (I had copied them manually in my first attempt). Now everything works perfectly: signature spoofing and the GUI. Sorry for the confusion! Thank you very much again for the patches and your support.

Matthias

Lanchon commented 7 years ago

thanks!