darvincisec/DetectMagiskHide

Android 11

Closed this issue · 9 comments

Hello @darvincisec ,

I tried to test the sample code on Android 11 , it does not work when magisk Hide is used.
I know it is not tested on Android 11 as bel the your blog (https://darvincitech.wordpress.com/2019/11/04/detecting-magisk-hide/)
but is there any way to make it work on Android 11?

Thanks,
Charbel

@charbelmkh , Is it tested with the latest code ? If there are logs, can you share?
Also lwhat exactly is the toast msg you get?

Hello @darvincisec,
Yes I'm using the latest code,
it seems to be working when compile with api level 29 but when I changed to api level 30 with hide it does't seems to be working.
I have a pixel phone rooted with android 11
and the toast message that I'm getting is "Magisk Not Found" (again this is when I compile with api level 30 and hide root ).

magisk.log

I compiled with api level 30, added more logs and generated an apk. Can you check with the apk pushed into the repo ? What version of Magisk are you using?

The uploaded APK is release (can't find any logs),
I have updated the code and build it. same behaviour as before.
below are some logs (with and without hide).
WITH_HIDE.log
WIHTOUT_HIDE.log
image

Seems only not working if set the targetSdkVersion to 30, not related to the compileSdkVersion.

I just tried it, yes it seems when changing the targetSdkVersion to 30.
it's a bit weird thought.

Maybe means that it is Android 11's behavior as it will run the compatibility mode in Android 11 if not specifying the targetSdkVersion to 30.

It's a little bit late, but for Android 11 cases the Magisk Hide detection through mounts aren't present over /sbin folder. Maybe that's the reason why it can't be detected. Instead, by reading /proc/.../mounts, you should aim to look for any trace of magisk instead of looking specific paths.
When no Magisk Hide is enabled, the symlink su binary is present on /system/bin, but its default place is on /dev folder which host another folder inside with a random name and fully root access (it isn't allowed to access, neither adb shell can reach).

Fixed it in the latest changeset