topjohnwu / Magisk

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

MagiskManager constantly gets killed by OS (loses root, etc) #242

Closed sou7611 closed 7 years ago

sou7611 commented 7 years ago

Consistently, MagiskManager is getting killed by the OS

This results in no root access (since Manager provides SU), no MagiskHide, etc.

The only fix is to either reboot, or swipe-right the app in the recent apps list, and relaunch Manager, then all works correctly until the OS kills the manager app again. This can happen within minutes.

There is no logging as to what is going on, because when the OS kills the app (and root/SU is lost), there is no more logging (there is no access to the log file to write log entries).

This has progressively gotten worse as v13 development has progressed. It is not fixed with latest source.

DeicPro commented 7 years ago

yeah, but really you don't lost root.. is a gui stuff only..

sou7611 commented 7 years ago

While it's true the device doesn't lose root, the fact that magisk manager handles MagiskSU tasks means you effectively lose access to root, because all su requests fail.

DeicPro commented 7 years ago

Yeah, it is a problem... BTW I would like the su database was a Magisk part and not Magisk Manager, to if I want all CLI not to have to ininstall the app and left /data/data/com.topjohnwu.magisk/databases/su.db file only.. So Magisk Manager to be 100% GUI and nothing more.

sou7611 commented 7 years ago

That would seemingly solve the su issue.

DeicPro commented 7 years ago

Nope, it would the same, is only a suggestion apart of this issue, because the "BTW" (By The Way).

sou7611 commented 7 years ago

Been trying Memory Locker to see if it helps prevent the app from being killed .... early results seem positive. This is the app that changes an application's priority level, so the OS memory manager would be less likely to kill the app when scavenging memory, vs normal.

sou7611 commented 7 years ago

Memory Locker does not solve the issue, just delays it.

Magisk Manager is still (apparently) a high priority kill target for the OS.

When it's killed, ALL SU REQUESTES ARE DENIED, and everything stops working as a result ... anything using magiskhide, su, etc.

This needs to be a high priority fix.

DeicPro commented 7 years ago

The only stuff is related to the app is ask to allow su permissions... Saved su permissions, Magisk Hide, etc, are working correctly without the app.

sou7611 commented 7 years ago

Not in my experience.

when MagiskManager is killed by OS, all su operations case working.

You can't request SU, can't execute anything as root, etc.

It's like when Manager dies, so does MagiskSU

On Mon, Jun 19, 2017 at 4:44 PM, Deiki-kun notifications@github.com wrote:

The only stuff is related to the app is ask to allow su permissions... Saved su permissions, Magisk Hide, etc, are working correctly without the app.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/topjohnwu/Magisk/issues/242#issuecomment-309568264, or mute the thread https://github.com/notifications/unsubscribe-auth/AFoatP4uvEQuUhqvXUG00kgTagfUrj1Zks5sFt2-gaJpZM4N9ZVJ .

sou7611 commented 7 years ago

Also worth noting - when this happens SafetyNet starts failing as well (unknown if this is due to magiskhide failing, or some other cause).

DeicPro commented 7 years ago

Is not in your experience, is a fact. All works without Magisk Manager but new MagiskSU request. If you uninstall the app, but keep /data/data/com.topjohnwu.magisk/databases/su.db, you can use root in an app which you allowed request before.

Magisk Hide works, modules works, etc... Are related with Magisk daemon all those.

sou7611 commented 7 years ago

No you can't .... I've tested this ...

you CANNOT get a su request to pass when MagiskManager is taskkilled by the OS, nor after you swipe -right to kill the app.

It DOES NOT WORK.

It will not work until you restart MagiskManager.

Try it - force-stop MagiskManager, and try and open something like Adaway or TitaniumBackup. You su request will get rejected.

On Tue, Jun 20, 2017 at 3:26 PM, Deiki-kun notifications@github.com wrote:

Is not in your experience, is a fact. All works without Magisk Manager but new MagiskSU request. If you uninstall the app, but keep /data/data/com.topjohnwu.magisk/databases/su.db, you can use root in an app which you allowed request before.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/topjohnwu/Magisk/issues/242#issuecomment-309862401, or mute the thread https://github.com/notifications/unsubscribe-auth/AFoatJ8iHNKB6nKLdNMipTOeJk2qE5Pdks5sGBzWgaJpZM4N9ZVJ .

DeicPro commented 7 years ago

Rejected if was not allow before as I said... If is previously allowed, MagiskSU (Magisk daemon) read the database and give the root permissions.

sou7611 commented 7 years ago

NO IT IS NOT .... you're not reading what I'm typing or testing yourself.

A previously approved SU request, from a previously approved app is NOT ALLOWED SU ACCESS when MagiskManager is taskkilled.

This breaks ALL su requests.

Don't just blindly reply to me, try it. It's broken.

On Tue, Jun 20, 2017 at 4:01 PM, Deiki-kun notifications@github.com wrote:

Rejected if was not allow before as I said... If is previously allowed, MagiskSU read the database a give the root permissions.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/topjohnwu/Magisk/issues/242#issuecomment-309874585, or mute the thread https://github.com/notifications/unsubscribe-auth/AFoatI6vkQuMAvdhAecGyvSVeJGmNU4nks5sGCUogaJpZM4N9ZVJ .

DeicPro commented 7 years ago

screenshot_2017-06-20-22-23-30-435_jackpal androidterm

screenshot_2017-06-20-22-21-09-588_org adaway

sou7611 commented 7 years ago

And again, I beg to differ. This is after the OS task killer kills Magisk Manager.

[image: Inline image 1]

And this is what happens when you attempt a SU related task:

[image: Inline image 2]

In addition, any safety net related task also fails (A-pay, Pogo, etc).

Killing and restarting MagiskManager restores all functionality to normal.

This happens with ANY of the v13 betas, it happens with the version I compiled myself from the latest source. It's endemic to the current tree.

On Tue, Jun 20, 2017 at 4:22 PM, Deiki-kun notifications@github.com wrote:

[image: screenshot_2017-06-20-22-20-43-122_jackpal androidterm] https://user-images.githubusercontent.com/12710770/27354146-e35364c4-5606-11e7-98ac-d5e59736c522.png [image: screenshot_2017-06-20-22-21-09-588_org adaway] https://user-images.githubusercontent.com/12710770/27354151-e8b44e9c-5606-11e7-8a06-44a85b279c0e.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/topjohnwu/Magisk/issues/242#issuecomment-309879968, or mute the thread https://github.com/notifications/unsubscribe-auth/AFoatMTBwFjiGWWYMJPaSOJ5xuecp66Iks5sGCoLgaJpZM4N9ZVJ .

DeicPro commented 7 years ago

screenshot_2017-06-20-22-51-46-918_com scottyab rootbeer sample screenshot_2017-06-20-22-51-34-751_com scottyab safetynet sample

sou7611 commented 7 years ago

That is not what I see. I pasted what I see. It's broke.

Please stop arguing this and pasting pictures. It obviously works on your system. I have multiple devices here where it doesn't, both marshmallow and nougat.

Other people have replied on XDA that SAY THE SAME EXACT THING.

This is an issue, and you're trying to argue it into not being one.

On Tue, Jun 20, 2017 at 4:52 PM, Deiki-kun notifications@github.com wrote:

[image: screenshot_2017-06-20-22-51-46-918_com scottyab rootbeer sample] https://user-images.githubusercontent.com/12710770/27355381-19e215b8-560b-11e7-90cc-5f3a7c903085.png [image: screenshot_2017-06-20-22-51-34-751_com scottyab safetynet sample] https://user-images.githubusercontent.com/12710770/27355380-19df78f8-560b-11e7-965e-15fce056faf8.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/topjohnwu/Magisk/issues/242#issuecomment-309887927, or mute the thread https://github.com/notifications/unsubscribe-auth/AFoatNMfY6CoVw4-7UurhfqcVS0WMVKiks5sGDEGgaJpZM4N9ZVJ .

DeicPro commented 7 years ago

Yeah is an issue, but only affect to the popup of su request, not affect ALL as you says.

sou7611 commented 7 years ago

also breaks, in my experience, safetynet

On Tue, Jun 20, 2017 at 5:37 PM, Deiki-kun notifications@github.com wrote:

Yeah is an issue, but only affect to the popup of su request, not affect ALL as you says.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/topjohnwu/Magisk/issues/242#issuecomment-309899276, or mute the thread https://github.com/notifications/unsubscribe-auth/AFoatGbhL09W5ibEqZTwHFHPOZWpUGPNks5sGDuigaJpZM4N9ZVJ .

DeicPro commented 7 years ago

Your SafetyNet broken problem can't to be related with this, makes no sense.. is 100% binary stuff.

BTW, Interesting.. the Magisk Manager was killed by the system and showed me the popup request to ask... In previous releases It didn't show me nothing (except toast) and automatically rejected like you said.

nullobsi commented 7 years ago

I don't know about this, this is a heated debate. Have you tried disabling battery optimization for magisk manager in settings? although you said system task killer so that may not work... Sorry if I am repeating anything. 😃

sou7611 commented 7 years ago

There's no option to do that, plus in a week it's apparently used all of 2 seconds of time for 0.0ma of computed power usage ...

I don't think it's getting battery killed

On June 20, 2017 8:35:26 PM EDT, zjjpp notifications@github.com wrote:

I don't know about this, this is a heated debate. Have you tried disabling battery optimization for magisk manager in settings? although you said system task killer so that may not work... Sorry if I am repeating anything. 😃

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/topjohnwu/Magisk/issues/242#issuecomment-309929488

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.