topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
47.68k stars 12.1k forks source link

GooglePlayServices Force Close On Enabling Magisk Hide #4465

Closed TheHitMan7 closed 3 years ago

TheHitMan7 commented 3 years ago

Device: Redmi Note 8 (Ginkgo) Android version: 11 Magisk version name: f822ca5b Magisk version code: 23001

GMS started to force close when magisk hide is enabled and upon reverting magisk hide, there is no force close at all. I have systemlessly installed GApps package and noticed that when someone reported about it. The GMS Apk seems to be missing after enabling magisk hide. That is what i saw in logcat. But this isn't true at all. This issue is very much similar to this one.

Logcat: https://hastebin.com/ehavijigol.apache

Logcat: https://hastebin.com/topohalequ.apache

osm0sis commented 3 years ago

Wouldn't that be expected and desired since it's hiding some "Google Play services" services?

androidacy-user commented 3 years ago

Wouldn't you know it, hiding apps from themselves makes said apps crash. Funny how these things work isn't it?

TheHitMan7 commented 3 years ago

Wouldn't that be expected and desired since it's hiding some "Google Play services" services?

Yes, but i didn't expect that force close and it didn't happen, when installation made into system.

TheHitMan7 commented 3 years ago

Wouldn't you know it, hiding apps from themselves makes said apps crash. Funny how these things work isn't it?

I didn't know about that. Clearly unaware of this until now. What if i kept GMS in system and rest as module ? It doesn't break when installation made directly into system.

osm0sis commented 3 years ago

What? What are you doing? By the sound of it you're using a Magisk module to install Google Play services and/or installing Magisk to system. Either way that's all crazy and this is clearly an invalid issue.

TheHitMan7 commented 3 years ago

What? What are you doing? By the sound of it you're using a Magisk module to install Google Play services and/or installing Magisk to system. Either way that's all crazy and this is clearly an invalid issue.

All i am saying is, keeping GooglePlayServices in system and rest of the stuff in module. Obviously this is some sort of hack and also that implementation is just upto me. I didn't even mention once that, i am "installing Magisk to system". Still i don't get any satisfactory explanation on, why this does not happen in system install but systemless install.

Thanks for your time

Didgeridoohan commented 3 years ago

@TheHitMan7 As you seem confused as to why your issue occurred, here's a small explanation:

When Magisk hides from an app, one of the things that happens is that module files will be unmounted so that they're not visible to the app in question. If the app you're trying to hide from is installed as a Magisk module, Magisk will unmount the app as you're trying to open it. Result: crash.

TheHitMan7 commented 3 years ago

@TheHitMan7 As you seem confused as to why your issue occurred, here's a small explanation:

When Magisk hides from an app, one of the things that happens is that module files will be unmounted so that they're not visible to the app in question. If the app you're trying to hide from is installed as a Magisk module, Magisk will unmount the app as you're trying to open it. Result: crash.

It is clear now :)

Thanks

atom-smasher commented 3 years ago

This ticket is closed, but is there a fix in the works? If I enable MagiskHide, microG crashes. That's not good.

TheHitMan7 commented 3 years ago

This ticket is closed, but is there a fix in the works? If I enable MagiskHide, microG crashes. That's not good.

keeping microG GMS in system and rest of the stuff in module prevents crash. It's a dirty hack but does the job.

atom-smasher commented 3 years ago

keeping microG GMS in system and rest of the stuff in module prevents crash. It's a dirty hack but does the job.

That's what I'd call a "workaround". Is a "fix" in the works?

It seems absurd that anything would be automatically hidden from Magisk when enabling the hide, but it's especially absurd that it would effect microG.

atom-smasher commented 3 years ago

keeping microG GMS in system and rest of the stuff in module prevents crash. It's a dirty hack but does the job.

Most absurd of all, is that even after I de-select microG from the list of apps to hide, it automatically re-hides after rebooting.

Didgeridoohan commented 3 years ago

This ticket is closed, but is there a fix in the works? If I enable MagiskHide, microG crashes. That's not good.

Doesn't sound like your problem has anything to do with this issue ticket...

Microg used to be on the Hide list automatically (and that has been shown to cause it to crash), but hasn't been since Magisk v22.1 (relevant commit: https://github.com/topjohnwu/Magisk/commit/8ddab847457a84814fc65649523daa58875e963e).

atom-smasher commented 3 years ago

Microg used to be on the Hide list automatically (and that has been shown to cause it to crash), but hasn't been since Magisk v22.1 (relevant commit: 8ddab84).

Here I am, with a fresh install of Magisk 23.0 (23000) and Magisk Manager 23.0 (23000), and this is the problem I'm having.

fwiw, I'm not having this problem on an Android 10 phone, but I am having this problem on an Android 11 phone.

Didgeridoohan commented 3 years ago

@atom-smasher In that case it sounds like you have some investigating to do before you can open a proper bug report of your own...