Magisk General Support / Discussion

Search This thread

pndwal

Senior Member
@zgfg @pndwal

How does hiding root work?
When target app on hidelist / denylist is opened, Magisk will immediately unmount Magisk tmpfs mountpoint, dummy skeleton tmpfs and magisk created mount bind so there are no /sbin/su or /system/bin/su (Android 11+) in target apps.

See the source code:
Denylist unmount: zygisk/deny/revert.cpp
MagiskHide: magiskhide/hide_policy.cpp

Momo is abusing isolated process and app zygote process to bypass MagiskHide and detect Magisk. And the fact that not all banking apps use isolated process or app zygote.
Sure; but fact is many banks do do this (detect mount 'leaks' etc), which is why vvb2060 and other LSP Devs experimented w/ unshare modules, Magisk Lite etc, and why they've incorporated such functionality in Canyie's Shamiko and Magisk Bravo now...

Isn't Momo simply doing whatever Google/ Android allows, just like Bank apps, with the stated purpose:
This app uses correct methods to detect root and Xposed, but the goal is not to against root or Xposed.

By making detection methods public (some methods are private), our goal is to improve user knowledge and force the community to make correct improvements...

Also, this helps modders understand what can (possibly) be detected by bank apps etc... Not sure why such an initiatives by key Magisk / LSP / XHook framework Devs would be considered to be an abuse... 🤔 PW
 
  • Like
Reactions: J.Michael

pndwal

Senior Member
Scanning proc mount leeks is no longer possible on Android 8+ and proc is mounted with hidepid=2 flag
Still, if "abusing isolated process and app zygote process to bypass MagiskHide and detect Magisk" can be done, why is this abuse for Momo where the stated goal is "making detection methods public... to improve user knowledge and force the community to make correct improvements"?...

Isn't the point that if it can be done by Momo, at least some banks will try it? PW
 
  • Like
Reactions: J.Michael

huskydg

Senior Member
Feb 17, 2021
192
199
Still, if "abusing isolated process and app zygote process to bypass MagiskHide and detect Magisk" can be done, why is this abuse for Momo where the stated goal is "making detection methods public... to improve user knowledge and force the community to make correct improvements"?...

Isn't the point that if it can be done by Momo, at least some banks will try it? PW
And... Aren't there already 3rd modules that workaround this issues??
Bonus: You can make DenyList to handle isolated process by just adding a small code into zygisk/hook.cpp


// Ensure separated namespace, allow denylist to handle isolated process before Android 11 if (args->mount_external == 0 /* MOUNT_EXTERNAL_NONE */) { // Only apply the fix before Android 11, as it can cause undefined behaviour in later versions char sdk_ver_str[92]; // PROPERTY_VALUE_MAX if (__system_property_get("ro.build.version.sdk", sdk_ver_str) && atoi(sdk_ver_str) < 30) { args->mount_external = 1 /* MOUNT_EXTERNAL_DEFAULT */; } }
 
Last edited:
  • Like
Reactions: dr4go

pndwal

Senior Member
And... Aren't there already 3rd modules that workaround this issues??
Bonus: You can make DenyList to handle isolated process by just adding a small code into zygisk/hook.cpp


// Ensure separated namespace, allow denylist to handle isolated process before Android 11 if (args->mount_external == 0 /* MOUNT_EXTERNAL_NONE */) { // Only apply the fix before Android 11, as it can cause undefined behaviour in later versions char sdk_ver_str[92]; // PROPERTY_VALUE_MAX if (__system_property_get("ro.build.version.sdk", sdk_ver_str) && atoi(sdk_ver_str) < 30) { args->mount_external = 1 /* MOUNT_EXTERNAL_DEFAULT */; } }
Just like Canyie's Bravo Magisk I mentioned?
Allow denylist to handle isolated processes before Android 11
canyie committed on 4 Apr...

...Just care what can/can't be done... to much misinformation here already... PW
 
Last edited:
  • Like
Reactions: dr4go and ipdev

vMAC

Senior Member
Oct 21, 2007
338
34
So currently I have Magisk installed on my phone. I also have a Work Profile with Intune setup. The problem is that it restricts my ability to install apps from "unknown sources." So with the last update to Magisk Canary I keep getting the alert that I need to update. I currently have Magisk hidden also, so it doesn't come up with the Magisk name.

I connected my computer to my phone and did a "adb install magisk.apk" for the canary app. The problem is that after doing this, while it states that it was successful, the app still says that I need to upgrade the app.

Can someone help me? What am I doing wrong?

I hope the answer isn't that I need to uninstall Intune every time I want to upgrade Magisk.
 

zgfg

Senior Member
Oct 10, 2016
7,572
4,977
You should use which -a su to see all the directories in your path containing su, not just the first one.
which -a su
/system/bin/su

Momo detecting su in the path

Magisk Canary 25101 with DenyList Unmount (not Shamiko).
Momo in DenyList, DenyList not enforced

@pndwal how to inspect is it 2SI device
 

Attachments

  • IMG_20220628_064753.jpg
    IMG_20220628_064753.jpg
    37 KB · Views: 26
Last edited:

zgfg

Senior Member
Oct 10, 2016
7,572
4,977
...The problem is that it restricts my ability to install apps from "unknown sources."

I connected my computer to my phone and did a "adb install magisk.apk" for the canary app. The problem is that after doing this, while it states that it was successful, the app still says that I need to upgrade the app...
As you stated, you only updated Magisk APPLICATION, not the Magisk itself

Magisk main window, doesn't it show you Update at the top?

And btw, what does it show for your version of Magisk, vs the version of Magisk app?

They should be the same - see my screenshot

If Magisk version is older, it will show you Update on the right, you should click on that Update and do eg Install Direct

Please read Installation documentation on Magisk Github to understand that what is Magisk app vs the Magisk itself

---

You could google for Install from unknown sources or for Install unknown apps to find how to enable (on A8+ it is disabled by default, for all apps)

Hopefully, your Intune does not block you from enabling. If it does, your adb workaround is nice 👍
 

Attachments

  • IMG_20220628_070542.jpg
    IMG_20220628_070542.jpg
    124.4 KB · Views: 23
Last edited:

vMAC

Senior Member
Oct 21, 2007
338
34
As you stated, you only updated Magisk APPLICATION, not the Magisk itself

Magisk main window, doesn't it show you Update at the top?

And btw, what does it show for your version of Magisk, vs the version of Magisk app?

They should be the same - see my screenshot

If Magisk version is older, it will show you Update on the right, you should click on that Update and do eg Install Direct

Please read Installation documentation on Magisk Github to understand that what is Magisk app vs the Magisk itself

---

You could google for Install from unknown sources or for Install unknown apps to find how to enable (on A8+ it is disabled by default, for all apps)

Hopefully, your Intune does not block you from enabling. If it does, your adb workaround is nice 👍
Yes my company's Intune blocks installing from unknown sources even on my personal side.

I downloaded the latest version of Canary from the Github........That is what I installed via adb install magisk.apk, and this is what shows in my magisk:

Screenshot_20220627-230510.png
 

zgfg

Senior Member
Oct 10, 2016
7,572
4,977
Yes my company's Intune blocks installing from unknown sources even on my personal side.

I downloaded the latest version of Canary from the Github........That is what I installed via adb install magisk.apk, and this is what shows in my magisk:

View attachment 5647573
Please look at your screenshot. It shows everything - please read

Your installed app is v25001 but it shows that latest is v25101

If you are blocked from Installing from unknown sources, go to Magisk GitHub and download Canary APK 25101 (not stable 25001) and install by adb

Or, if you already downloaded Canary 25101 and attempted to install by adb, then check if adb installing reported you an error (due to Intune?!)- that could be also the reason why you still have Magisk app 25001, not 25101

Also, your Magisk app is hidden. For many reasons it is better to unhide before updating. If Install from unknown sources blocks you to unhide, then uninstall the old Magisk app and then install the new 25101

Again, Magisk app (former mngr) is not Magisk itself. Uninstalling Magisk app will not uninstall Magisk itself (but you have to uninstall the app, like any app - and not through adb, bcs it will only disable the old app package but will leave it present on the system)
 
  • Like
Reactions: J.Michael

huskydg

Senior Member
Feb 17, 2021
192
199
LSPosed released new Shamiko which fixed Found zygisk for latest Momo but the banking apps that won't run with zygisk enabled like Livin by Madiri still not open.
 
Last edited:
  • Like
Reactions: traversone

pndwal

Senior Member

Stillhard

Senior Member
Sep 25, 2016
133
109
Latest Shamiko Changelog

### 0.5.1
- Support Magisk 25+

Nb. Rikka has removed Shana's note stating "Some modules like "storage-isolation-enhanced" will reveal the existence of Zygisk", since release, so seems she's fixed issue in her Storage Isolation app enhancement...
Update shamiko_changelog.md
RikkaW committed 2 hours ago

👀 PW
'The girls squad' attacked Rikka too now?




Go go power Rikka

Ponkles love Riru
 
  • Haha
Reactions: dr4go and pndwal

pndwal

Senior Member
@pndwal how to inspect is it 2SI device
Not sure how to test, but basic rule is Any launched with Android 10+ and Legacy ramdisk devices updated to/running Android 10+ and Pixel 3/3a series devices. Those launched with Legacy SAR (generally Android 9), apart from Pixel 3/3a series which were "retrofitted" by Google and the exception, are "stuck" as Legacy SAR boot type devices... PW
 
Last edited:

Top Liked Posts

  • 3
    Never sell yourself short when sharing good/decent advice in a detailed aspect.
    No-ones paying... but I'll take that as a compliment paid. 😛 PW
    2
    @pndwal Have you ever seen an MTP transfer corrupt a file, or are you just repeating the advice I have seen elsewhere?

    I always used Windows Explorer to transfer files. I checked the md5sum at both ends, never saw a mismatch.
    Yes, I tried to help several (3?) members here who confirmed that various issues disappeared (sometimes corrupted image would flash, sometimes not) after using ADB pull... The first couple of times the members themselves found the fix; I hadn't thought of it...

    I only know it's common w/ Sammy's large binaries however; don't recall similar reports for other devices. 😉 PW
    2
    Indeed, I think i did hide the app.
    So I have to uninstall this stub app and then install again Magisk app ?
    Perhaps... But full app often works fine after simply uninstalling hidden app (or renamed stub)... 😛 PW
    2
    I'm a bumbling advisor
    Never sell yourself short when sharing good/decent advice in a detailed aspect.
    -- At least some folks on XDA will express or share further details in context from sometimes reliable sources.
    -- Unlike certain users of Social Media channels that are profoundly disconnected when it comes to sharing details.
    2
    My next area of help is safetyNet failure with LineageOS 14.1 ROM

    1. Have Magisk setup and hidden
    2. Have downloaded UniversalSafetyNet fix and it shows under modules in Magisk
    3. YASNAC fails Basic Integrity and CTS checks.

    Have reviewed the posts but not able to fix. Is this ROM so old that I cannot get it to pass?
    Search in USNF thread for USNF mod from @Displax and install it... Is spoofs a very old fingerprint that should kill two birds; 1) need for fingerprint / security patch date matching in custom and other uncertified ROMs (always in official LOS due to their policy not to alter expected signals), and 2) new Play Integrity MEETS_DEVICE_INTEGRITY failure.

    Traditional solution for CTS Profile match in official LOS etc was to configure a passing fingerprint/patch date combination using MHPC module, but this shouldn't be needed w/ @Displax modded USNF... PW
  • 6
    Its trivial to sniff or even MITM a desktop, or even just run WinPE and reset admin password and use the users own saved passwords in their browser, heck even export their passwords....

    In any event the biggest risk vector is social engineering

    Chasing root phone users only gives them a "feelgood", it does nothing to stop genuine misuse and fraud, at all.....

    I dont see Google or a bank sending out a representative every time someone makes a transaction to see if theyre genuine....trying to control the device is attacking the wrong end of the transaction and is ultimately pointless
    They're not chasing root users. They just want a guarantee that the device is secure, and they have good reason to. Rooting by nature compromises device security.

    I'm not saying your opinion is invalid; in this context however, it is irrelevant, because regardless of how you may feel about the situation, it's not going to change.
    5
    An old Chinese story called The Man who Sold Spears (momo) and Shields (shamiko).

    In the state of Chu lived a man who sold shields and spears.
    "My shields are strong," he boasted, "that nothing can pierce them. My spears are so sharp that there is nothing they cannot pierce."
    "What if one of your spears strikes one of your shields?" someone asked him.
    The man had no answer to that.🤣
    5
    @pndwal You can build Magisk app with custom name and label as you want
    MagiskHide is still effective to hide root from banking apps. It's not dead if you don't care about safetynet stuff.


    Shamiko is taking off your panties on the basic of MagiskHide. So MagiskHide is still better.
    You believe Shamiko too much, It can't really hide zygisk, only fix the zygisk detection of Momo. However, I can't blame it because that was the nature of zygisk and it will never be fixed.
    Still not sure what you're trying to tell me...

    I think we agree on most of this stuff (except your apparent impression that Shamiko Devs have some sort of sexual agenda, or that it's users are somehow prone to 'self abuse'... I won't use the other term either...).

    If you think I have misrepresented any facts regarding Magisk, Shamiko or other, please say it plainly... I think what I provided for the sake of clarity was accurate... 🙁 PW
    5
    Latest Official TJW public Stable (release) Magisk build:

    Magisk

    2022.7.20 Magisk v25.2​

    Maintenance release fixing various issues.
    • [MagiskInit] Fix a potential issue when stub cpio is used
    • [MagiskInit] Fix reboot to recovery when stub cpio is used
    • [MagiskInit] Fix sepolicy.rules symlink for rootfs devices
    • [General] Better data encryption detection
    • [General] Move the whole logging infrastructure into Rust

    Full Changelog: here

    https://topjohnwu.github.io/Magisk/releases/25200.html

    🎉🎊 PW
    5
    did all that, flashed uninstall.zip, uninstalled the Magisk app, flashed the original boot.img from LineageOS payload.bin...

    End result: root apps don't have root, "secure apps" (banking, etc.) complain about the phone being rooted.

    Example: CF.lumen stating "Could not aquire root access". But then the banking app is claiming the phone isn't secure and closes. Same for a State ID certification app I use.

    This is a disaster.

    With Magisk uninstalled and original boot you have no more Magisk

    But you don't pass SafetyNet (bcs your Bootloader is still unlocked and you still run custom ROM and you are no more hiding it by eg using Magisk module USNF), hence banking apps do complain about 'root' (they probably don't say "root" or use the meaning vaguely)

    If you want to get rid of Magisk and with that you want to pass SN and banking apps, you would need to go back to stock and relock the bootloader
    For the record.

    A few months ago, testing something.. :unsure:

    I was surprised to see the official Lineage build(s) were not user builds.
    Since they are not user builds, they can/will be considered compromised and not properly locked down.
    Some apps will report root or a custom rom.​

    It was pointed out to me (by a cm/los dev I highly respect) that the official Lineage (cyanogenmod) builds have always been debug builds.
    • Switching to user builds would be extremely difficult and way too much time and work for the maintainers.
      Reminder. Most are volunteers that freely give us their time and knowledge.​
    • Some devices might not be able to be supported as a user build.
    • Would limit what you as the user can do with the device.

    Cheers. :cowboy:
  • 1084
    This is the place for general support and discussion regarding "Public Releases", which includes both stable and beta releases.
    All information, including troubleshoot guides and notes, are in the Announcement Thread
    156
    Hello, I haven't given much support on XDA lately. It can be resulted from
    • University started and I have limited free time. In fact, I mostly develop during midnight
    • I live in Taiwan, which has large time zone differences between my European/American contributors/testers, which usually forces me to stay up late at night to discuss/test stuffs.
    • The new version is about to come, I don't want to spend effort on supporting old releases
    The planned update is delayed again and again, to some point I think I'll shed some light about what has been happening lately, also along with some announcements.

    New Forum!
    As you might have already discovered, Magisk got its own subforum on XDA! Many thanks to all the support you gave me, and much more information/features/support is about to come!
    **For developers supporting all the devices that are not using standard Android boot format, feel free to create threads in this section (actually, PLEASE do so) for your favorite devices after v7 is out. As I currently know, Asus devices require signing the boot image before flashing, and is model dependant; Sony devices seems to use ELF kernel that is unpatchable, or some has two ramdisks (inner + outer), both requires different workarounds; LG bootloader locked devices has to manually "BUMP" the boot image after flashing Magisk..... and there may be lots of other crazy boot image formats that haven't come up to my attention yet.
    It is impossible for me to support all these non-standard boot images, and I hope the community can collaborate to make Magisk running across all the devices. Overall, community collaboration is what XDA about :D

    The Pixel Phone
    Some of you might already know this news, that the next Pixel Phone right around the corner seems like it does not have ramdisk in boot image, which pretty much wrecked Magisk in all ways. However, it pretty much doomed root itself too. Kernel modifications is inevitable IMO, so I'll try to migrate my scripts to C programs that could possibly be included into the kernel itself. Note that I'm not familiar with linux kernel, I'm not even sure if my idea and concept is correct or not. But once the device is available, I think developers will find a way to bypass all the difficulties, and I'll do my best to learn things ;)

    Current Progress
    In the past month, I've spent quite some time learning SELinux, so that I can avoid using SuperSU's sepolicy patches. Thanks to the helps and tips from @phhusson and @Chainfire, I finally have a much clearer understanding of how SELinux works. The Magisk core parts (the scripts, boot image patches, new features, more supports) are actually done some time ago. What is causing all the delays is the Magisk Manager.
    To be completely honest, although I can code in Java without much issues, Magisk Manager is actually my first Android application, I had to reach out for assistance, and fortunately awesome developers like @DVDandroid and @digitalhigh contributed a lot, which makes the current Manager awesome.
    After the repo system and module management is mostly done, I was about to do some adjustments and release, but what we really done is decided to add another feature: auto-unroot with per-app settings. I decided to wait for it to be finished, and then do my adjustments. Due to reasons that'll be mentioned later, this feature will likely not be available for the next release (should come in future updates)

    Safety Net Disaster
    Those who are using Magisk for Safety Net bypass purposes must have known that Google recently updated the detection method of my Systemless Xposed. I still have no idea what Safety Net is detecting, so currently I cannot fix it on my side (also because I'm busy working on the next update). However, suhide developed by @Chainfire is able to hide Xposed and worked fine.
    However, only my Systemless Xposed v86.2, which is based on SuperSU's su.d, is supported using that method. v86.2 and v86.5 (latest, Magisk based) have nearly identical binaries, and the only difference is the path where the binaries are stored.
    I'm still not sure what's the real issue for it not being supported, I just hope it is not done intentionally.

    Conclusion
    Due to the fact that my Safety Net bypass is not 100% perfect now, I do not want to spend any more time waiting for auto-unroot to be polished. What I'm doing now is finishing up all the things I'd like to change in Magisk Manager (it has been a while since I last contributed to Manager, my fellow developers are doing all the heavy job), which might take a little more time, after that, packed with tons of information to be announced in Magisk Section, I'll release the long awaited update.

    Hope this lengthy post gives you the idea of the whole situation, and again thanks for all your support!!
    121
    Ah, some Chainfire bashing, I hope it is not too late for me to exercise additional villainy.

    First, let me make clear I have nothing against @topjohnwu, nor against Magisk. Magisk is an interesting project and it certainly displays @topjohnwu ingenuity and persistence. I don't doubt we will see more interesting things from his hands.

    -------------------------

    What has happened here is not all that dark and complicated, from either end. I returned from holidays, and someone pointed me at Magisk. My first thought: interesting!

    Among other things, the thread lists some issues with SuperSU, which in combination with the phrase The developer also requests users to not bug Chainfire with compatibility requests for SuperSU with Magisk from the portal article, raised my left eyebrow by nigh half an inch. The popular systemless xposed mod is apparently now based on it, and apparently it now no longer works with SuperSU, and apparently I'm not supposed to fix that, nor any of the other found issues. I found that a bit weird. So yes, I have told @topjohnwu that I was a bit surprised he was posting about issues with SuperSU without notifying me about them (I can't fix or help fix issues I'm not aware of, after all).

    He's also spreading a modified version of the SuperSU package, which is not all that uncommon, nor necessarily a problem. I have not looked into what he modified, I only ran a few quick tests on one of my devices, and found some commonly used commands run as root to be broken. I have informed him of this as well.

    It appears the tool of choice for Magisk is phh's Superuser, because of some of the mentioned issues with SuperSU. That's fine by itself, but fixing issues in that superuser by incorporating SuperSU's binaries into it is a somewhat questionable practise. After all, SuperSU is a commercial closed-source package that helps pay for my dinner, and superuser is a direct competitor. I have informed him that I was surprised he did this without asking for permission. I have expressed similar surprise on him spreading a modified version of LiveBoot (which helps pay for a snack now and then).
    @topjohnwu has also stated that Magisk's scripts are largely influenced by mine (I have not checked). Scripts based on mine are used all over the place on XDA, some people have crafted amazing things based on them, I have never made an issue of this (otherwise I would have just made them binaries). But yes, I have also stated to him that I don't think it's very nice to base something on one program, and then using that to (almost exclusively) push something directly competing with that program.

    tl;dr Towards @topjohnwu, I have:
    - expressed surprise he has issues getting Magisk to work with SuperSU, and has chosen not to inform me about those
    - expressed surprise he is using SuperSU binaries in a competing superuser without permission
    - expressed surprise he is posting a modified LiveBoot without permission
    - informed him of issues with the modified SuperSU he has posted
    - let him know I thought it wasn't very nice to be applying my scripts to benefit seemingly exclusively that same competing superuser

    To be crystal clear:
    - I have not asked for an apology
    - I have not asked for Magisk to be abandoned, neither the root hiding nor systemless module parts, and certainly not systemless xposed
    - I have not made an issue of any of this anywhere, until this post
    - I have not even specifically asked for anything to be taken down (though obviously in my opinion the other superuser package mixed with SuperSU's binaries, as well as the LiveBoot package, should go)
    - I have not reported this thread to XDA moderators for copyright violations or otherwise

    While my conversation with @topjohnwu may not win any awards for being friendly (though it may win some for brevity), I think all things considered my response has been rather mild. To be perfectly honest, until the apology post, I thought this was over with already. I think the apology post was triggered because I haven't replied to his last PM for a while - I was in the zone, it happens.

    To emphasize again, I have nothing against @topjohnwu, Magisk, or systemless xposed, and it is certainly not my goal to see any of them go. If it can be made to work together with SuperSU, great.

    I get it though: you think of something, you want to see if you can make it work, you finally get it to work, you publish it, it takes off - enthusiasm gets the better of you. Maybe in the rush some mistakes are made. That doesn't mean you have to just drop it and run. None of my stuff would make it past 0.1 if I stopped at the first big mistake :)

    Aside from said being in the zone coding, I usually regret actually responding to these sort of things the day after, which has made me hesitant to reply. Surprise me.
    76
    Thread temporarily closed so everyone sees this.

    The flood of "SafetyNet isn't working for me either!" posts are not helpful, at all. Please refrain from posting further, it will be looked into. Please do not forget that not passing SafetyNet is 100% NORMAL AND INTENDED when you have an unlocked booloader or running custom firmware. These are workarounds and they will be worked around in turn.

    The Flash
    Forum Moderator

    EDIT: Thread is reopened... I will be cleaning any SafetyNet posts for a while to keep the thread clean for real issues.
    75
    Hello everyone!

    I am aware that Google has updated Safety Net that makes Magisk itself a no go for Android Pay. In fact, I witnessed the change live while I am developing the new magiskhide, which should hide all Magisk modules and Magisk installed root.

    Google is serious about Safety Net now, clearly hunting down all possibility to run Xposed with Safety Net passed. I spend quite some time examining the new security measures last midnight, and fortunately it seems that it is possible to run Magisk and root along with Safety Net if no Xposed is running. I'm glad I removed the old root toggle at the right time lol, that is no longer feasible with the latest detection.

    So stay tuned for the next update, it will come with bug fixes, along with the new magiskhide to bypass that Safety Net.

    Google, how will a few systemless mods do any harm :p:p