j-hc / zygisk-detach

Zygisk module to detach installed apps from Play Store, hooking binder
https://t.me/rv_magisk
Apache License 2.0
1.05k stars 30 forks source link

Breaks Play Integrity API for some devices (needs to be tested for >v1.15.0) #18

Closed pmsobrado closed 2 months ago

pmsobrado commented 9 months ago

Screenshot of Play Store page of the app you are trying to detach:

Not applicable.

Screenshot of the helper CLI showing detached apps (from Option 2):

Not applicable.

Logs taken with su -c logcat -s "zygisk-detach" > /sdcard/log.txt:

Not applicable.

I used this module to detach an app. After that, the Play Integrity API request from Play store (in developer tools/options) fails with error -100 (internal error). After trying some stuff I checked logcat, and found an error trying to read the detached app from somewhere, some database I guess. The app had the first two characters modified to unknown ones, which I guess is the method this module uses to detach.

In any case, this seesm to break Play Integrity API request from official Play store app.

j-hc commented 9 months ago

cant reproduce. even if that was the case i cant fix it. i already did whats possible to not break play integrity.

pmsobrado commented 9 months ago

It was a weird coincidence I guess...

yuzamei2854 commented 8 months ago

I have the same issue, after enabling the module and rebooting the system, the issue with Play Integrity API starts happening, I tried using SPIC and this error shows up:

20240115_231819

For now, SafetyNet works fine.

I'm using a Samsung phone with custom ROM and Magisk.

pmsobrado commented 8 months ago

Even without reboot, the moment I detach, I get a -100 error. The moment I reattach, the error is gone.

In logcat I saw an error with weird characters on the detached package name, my guess is this module breaks the package name in a way that google play does not detect it, making the app detached, but the package name change with weird characters also breaks integrity api call, for some reason.

Issue still happens to me.

EDIT

I don't have much time but, if @j-hc wants it and would like to check this, I can upload the log I'm talking about.

pmsobrado commented 8 months ago

@j-hc Sorry, still the same, here's the log:

imagen

Let's see how it goes for @yuzamei2854

yuzamei2854 commented 8 months ago

Hi, forgive me if I'm not able to give useful information, I'm still new to root and Magisk.

The problem still persists after the v1.10.0 update, I did the same test as the OP about detach and reattach, and I can confirm that when the application is detached, the error -100 starts to appear, after reattaching the error disappears.

As I still don't know how to get logs, I used the same app as the OP, here's a screenshot of a part I suspect from the log.

20240116_124139

I will try to provide information if necessary.

j-hc commented 8 months ago

probably wont work but try this module: zygisk-detach-v1.10.0t.zip

yuzamei2854 commented 8 months ago

probably wont work but try this module: zygisk-detach-v1.10.0t.zip

I reattached the app, deleted the module, installed this test version and detached the app again, still the same.

j-hc commented 8 months ago

probably wont work but try this module: zygisk-detach-v1.10.0t.zip

I reattached the app, deleted the module, installed this test version and detached the app again, still the same.

you rebooted after flashing right? what do the logs show now

yuzamei2854 commented 8 months ago

probably wont work but try this module: zygisk-detach-v1.10.0t.zip

I reattached the app, deleted the module, installed this test version and detached the app again, still the same.

you rebooted after flashing right? what do the logs show now

Yes, I rebooted after flashing it, here is the logs:

20240116_155555 20240116_155220

pmsobrado commented 8 months ago

Hmm, still issues when the package name is not recognized...

Is Play Integrity verifying package names??

pmsobrado commented 8 months ago

BTW, in case it helps. I'm on MIUI 12 / Android 10 (xiaomi.eu rom).

j-hc commented 8 months ago

@pmsobrado @yuzamei2854 try this one zygisk-detach-v1.11.0t.zip

pmsobrado commented 8 months ago

@j-hc Still no dice 😩

IMG_20240131_183341

Same -100 error:

![Uploading IMG_20240131_183524.jpg…]()

j-hc commented 8 months ago

@pmsobrado how about this one zygisk-detach-v1.11.0t.zip

pmsobrado commented 8 months ago

It works! How did you do it?

j-hc commented 8 months ago

It works! How did you do it?

by using a hackish way to return a fake app's info. it works for you but will crash for other android versions. what does the logs show now?

pmsobrado commented 8 months ago

That's weird... I do have Android 10 and MIUI 12, but Play Store version should be the same, or similar to modern phones, right? Why this different behaviour?

BTW, the app shows as "disabled" on Play Store, is that a part of the hackish ways?

j-hc commented 8 months ago

That's weird... I do have Android 10 and MIUI 12, but Play Store version should be the same, or similar to modern phones, right? Why this different behaviour?

because im not hooking play store but libbinder. im still not yet sure about the proper solution.

BTW, the app shows as "disabled" on Play Store, is that a part of the hackish ways?

yes

pmsobrado commented 8 months ago

Well, if you need testing, logs or want me to debug something, please ask :)

yuzamei2854 commented 8 months ago

@pmsobrado @yuzamei2854 try this one zygisk-detach-v1.11.0t.zip

Doesn't work, same error.

yuzamei2854 commented 8 months ago

@pmsobrado how about this one zygisk-detach-v1.11.0t.zip

Working on Android 9.

pmsobrado commented 8 months ago

So I guess older versions of Android need different methods... but I still don't get it, isn't Play Store app version the same as on recent phones? Shouldn't this only affect Play Store app, and not anything of the Android system/ROM?

j-hc commented 8 months ago

So I guess older versions of Android need different methods... but I still don't get it, isn't Play Store app version the same as on recent phones? Shouldn't this only affect Play Store app, and not anything of the Android system/ROM?

like i said play store version is irrelevant. zygisk-detach hooks binder driver of the kernel which changes across android versions. i have the fix, just dont have time to experiment yet. for now you can keep using the latest test version i sent.

pmsobrado commented 8 months ago

Yes, don't worry, take all the time you need. I just though you we're binding some Play Store process (on normal versions of your module, not these latest test ones) renaming packages on some db relative to Play Store, without affecting the system.

N0nd commented 8 months ago

I also ran into this problem on Android 9 https://github.com/chiteroman/PlayIntegrityFix/issues/254

MrManinBlack1337 commented 7 months ago

I am getting the same issue, tested with release and all tests versions all break integrity API. My rom is android 10 non-MIUI, Xiaomi Redmi Note 7

yuzamei2854 commented 7 months ago

@N0nd, @MrManinBlack1337, the developer has already said that the test version can't work on every device and he needs time to find a good solution, for now, logs could help the developer.

N0nd commented 7 months ago

@N0nd, @MrManinBlack1337, the developer has already said that the test version can't work on every device and he needs time to find a good solution, for now, logs could help the developer.

actually, the test version helped me, I just reported that I had such a problem. but the test version works well.

j-hc commented 7 months ago

ok i decided on a solution. new test build here: zygisk-detach-v1.12.0t.zip

if working fine, i will merge the changes.

@yuzamei2854 @pmsobrado

MrManinBlack1337 commented 7 months ago

The newest test version works for me, play integrity remained intact! Thank you

j-hc commented 7 months ago

aight merged the changes. closing the issue.

pmsobrado commented 7 months ago

Works for me too.

j-hc commented 6 months ago

i reverted the fix as it doesnt stop play store from updating detached apps: https://github.com/j-hc/zygisk-detach/issues/37 users with affected play integrity can keep using v1.13.0 until i implement some other fix

j-hc commented 2 months ago

closing the issues as nobody reported anything