[Discussion] Magisk Delta - Another unofficial third-party Magisk fork

Search This thread

uschipower

Senior Member
Mar 14, 2009
110
5
I just installed and TrebleDroid-GSI on a TB-X605F.
Where do I find a compatible Version of Delta Magisk which can be used with TD-GSI?

After I had successfully installed GSI, I made a backup of all partitions with TWRP.
I installed DeltaMagisk-Apk and selected the boot-partition-file from TWRP-backup for Patching DeltaMagisk.
Then I installed the patched boot, but Device will not start with this boot-file.

Whan can I do?
Where did I make a mistake?
 

Roidred

Senior Member
Sep 4, 2012
242
52
I just installed and TrebleDroid-GSI on a TB-X605F.
Where do I find a compatible Version of Delta Magisk which can be used with TD-GSI?

After I had successfully installed GSI, I made a backup of all partitions with TWRP.
I installed DeltaMagisk-Apk and selected the boot-partition-file from TWRP-backup for Patching DeltaMagisk.
Then I installed the patched boot, but Device will not start with this boot-file.

Whan can I do?
Where did I make a mistake?
you should try to rename the file from .apk to .zip and then flash the same file from twrp itself.
 

zgfg

Senior Member
Oct 10, 2016
9,571
7,416
Redmi K20 / Xiaomi Mi 9T
Xiaomi Mi 11 Ultra
just tried this way too, do everything in TWRP.
The device doesnt boot any more after DeltaMagisk has modified boot-partition

Whan can I do?
Where did I make a mistake?
Use the same boot.img that you patched, but the original, not patched img file

And flash to restore. There will be no Magisk but the phone should boot if it was indeed the correct/corresponding boot.img from your ROM
 

uschipower

Senior Member
Mar 14, 2009
110
5
Use the same boot.img that you patched, but the original, not patched img file
??
For GSI-Image, I have downloaded a *.xy-File to PC and extracted it. There was a *.img-File in archieve.
I flashed this *.img to "system" with TWRP.

You think of I should extract boot-partition from *.img-File?
How does this work?

Or do you think of boot.img from stockRom which is basis for GSI-Images?
 
Last edited:

zgfg

Senior Member
Oct 10, 2016
9,571
7,416
Redmi K20 / Xiaomi Mi 9T
Xiaomi Mi 11 Ultra
??
For GSI-Image, I have downloaded a *.xy-File to PC and extracted it. There was a *.img-File in archieve.
I flashed this *.img to "system" with TWRP.

You think of I should extract boot-partition from *.img-File?
How does this work?

Or do you think of boot.img from stockRom which is basis for GSI-Images?
Generally, System and Boot are different partitions and flashing System image to Boot partition is a way to brick the phone

However, in that case Magisk should have recognized that the given img file cannot be patched and should have printed an error (did you watch what Magisk wrote when patching!) - but there should be also no patched img then

Anyway, instead of flashing permanently the img file (patched or not) to Boot, it is always good to test it first by one-time booting to:
fastboot boot <IMG file>

Now, to un-brick, you should try to dirty-flash the ROM again, it should fix your Boot partition

Btw, ROMs may come with the compound payload.bin and one must use Payload Dumper to extract particular images - but again, Magisk should IMO report an error when trying to patch the payload.bin
 
Last edited:

uschipower

Senior Member
Mar 14, 2009
110
5
However, in that case Magisk should have recognized that the given img file cannot be patched and should have printed an error (did you watch what Magisk wrote when patching!) - but there should be also no patched img then
I do not patch img, i install gsi-img over stockrom. And then, I made a backup of boot partition with TWRP. This file I used for patching with DeltaMagisk.
This patched boot partition file do not work

Now, to un-brick, you should try to dirty-flash the ROM again, it should fix your Boot partition

I do not have to make a dirty flash. I restore unpatched boot from TWRP and device does boot.


Generally, System and Boot are different partitions and flashing System image to Boot partition is a way to brick the phone

Do GSI-Images only modify system partition, do they not contain boot partition?

If yes, boot-partition is part of stock rom, not GSI-Image part, right?

As far as i know, Magisk and DeltaMagisk only modify boot partition.
When I flash stockrom without GSI, DeltaMagisk can modify boot partition and device can boot.

When flashed GSI, it should be still the same boot partition. But when I modify boot partition the same way, device doesnt boot.
So i suppose there is a problem with GSI



When using official magisk, there is a notice that for GSI-Images you have to use a special version:
As you can see, the main developer of GSI/TrebleDroid, Phh, made the last version 2 years ago. Now he is retired in that project.
I suppose, he never made a modified Delta-Magisk version.
So it would be kindly if HuskyDG makes a Version working with GSI-Images.
 
Last edited:

pndwal

Senior Member
I do not patch img, i install gsi-img over stockrom. And then, I made a backup of boot partition with TWRP. This file I used for patching
This is a good method... Will always get matched image...
I do not have to make a dirty flash. I restore unpatched boot from TWRP and device does boot.
👍
When flashed GSI, it should be still the same boot partition. But when I modify boot partition the same way, device doesnt boot.
Did you try with patched image made without GSI?... See comments below re wipes needed too...
So i suppose there is a problem with GSI
Yup, these need special fixes in Magisk it seems... More below...
When using official magisk, there is a notice that for GSI-Images you have to use a special version:
As you can see, the main developer of GSI/TrebleDroid, Phh, made the last version 2 years ago. Now he is retired in that project.
I suppose, he never made a modified Delta-Magisk version.
So it would be kindly if HuskyDG makes a Version working with GSI-Images.
Doubt you need that old mod of Magisk 23.0... many GSI compatibility fixes (and newer GKI and other Treble compatibility fixes) have been added in official Magisk since (like this important one: Skip loading Magisk when detecting DSU)... In the past Magisk was basically incompatible with GSIs... Some issues likely still exist... Some users find phh builds are more difficult to get to boot than Google GSIs, even w/o Magisk patching... Apparently wiping /data, dalvik etc is often needed to get Magisk booting w/ GSIs...

Try wipes, try a Google GSI for comparison... 👍 PW
 

zgfg

Senior Member
Oct 10, 2016
9,571
7,416
Redmi K20 / Xiaomi Mi 9T
Xiaomi Mi 11 Ultra

Attachments

  • Screenshot_2023-03-28-20-30-32-648_com.comdirect.phototan.jpg
    Screenshot_2023-03-28-20-30-32-648_com.comdirect.phototan.jpg
    369.1 KB · Views: 69
  • Screenshot_2023-03-28-20-32-28-145_com.comdirect.phototan.jpg
    Screenshot_2023-03-28-20-32-28-145_com.comdirect.phototan.jpg
    253.5 KB · Views: 69
  • Like
Reactions: uschipower

eliezerjk90

Senior Member
Feb 28, 2015
939
591
Duisburg
  • Love
Reactions: uschipower

useroso987

Member
Oct 28, 2022
14
3
Hi, i just installed LineageOS 20 and will proceed to root.

Should i take Official or Delta one?
Is there any list of differences between them?

Thanks.
 
  • Wow
Reactions: pndwal

Timmmmaaahh!

Sr. Mod / Mod Cmte / Recognized Xmas Avatar Themer
Staff member
Sep 11, 2012
6,437
1
17,691
From From eh... Belgium!
OnePlus One
OnePlus 6T
Hi, i just installed LineageOS 20 and will proceed to root.

Should i take Official or Delta one?
Is there any list of differences between them?

Thanks.
No silver platters here 🤷‍♂️
It's a personal preference. For some applications, official will work better, for others Delta will do the trick. Why don't you just try the one that seems best to you, it's possible to switch later. Also, read the documentation and FAQ, those will likely answer most of your questions.
 

shadyrexman

Member
Mar 29, 2023
13
12
Pixel 6 Pro T3B2 here, tried many times to root my p6p and failed , I patched the p7p boot.img and fastboot it, after restarted and I press direct install. After reboot then the root is gone. Any suggestions? Thanks a lot .
 

Attachments

  • Screenshot_20230331-081701.png
    Screenshot_20230331-081701.png
    216.6 KB · Views: 61
  • Screenshot_20230331-091229.png
    Screenshot_20230331-091229.png
    530.2 KB · Views: 62

zgfg

Senior Member
Oct 10, 2016
9,571
7,416
Redmi K20 / Xiaomi Mi 9T
Xiaomi Mi 11 Ultra
Pixel 6 Pro T3B2 here, tried many times to root my p6p and failed , I patched the p7p boot.img and fastboot it, after restarted and I press direct install. After reboot then the root is gone. Any suggestions? Thanks a lot .
On your screenshot it says:
Magisk
Installed Delta 25210

Zygisk Yes
Ramdisk Yes

Hence, as per that screenshot, Magisk (and the root) is installed
 

Top Liked Posts

  • 1
    Thanks for the link.

    I was thinking HDFC app has implemented some really powerful logic/mechanism to detect root and was scratching my head to figure out what to do.

    Finally I ended up Uninstalling Magisk (removing root) in the process and HDFC app was working fine. They I installed Magisk app (just the app not patched it yet). Now HDFC app throws the same error :D
    Which means it just checking Magisk app itseems even though I renamed the Magisk to different package name.
    I tried HMA then HDFC throws some other error. Need to try it again.

    Update: Fixed the issue with HMA. I was doing it wrong earlier
  • 2
    Just sharing my current set up with new rom PixelOS on Pixel 7
    - magisk delta 26.3
    - zygisk enabled
    - youtube/music revanced/pixelify submodules
    - Unmount options ticked on both
    - Under mount list, only configured app that requires root such as Swift Backup
    - safetynet passed basic by default (PixelOS)

    TnG, MAE work
    HLB work (only version 1.1.51, newer like 52 will not work for now)
    Google Wallet works too for my CIMB CC
    2
    Magisk Delta has been updated to Magisk v26.3.
    They say the known bug from previous build should be fixed
    https://github.com/HuskyDG/magisk-files/releases/tag/24b5daf6-delta

    Things seem fine for me on my earlier device. Riru mode; not Zygisk. (All testing apps behave as before.)
    1
    Thanks for the link.

    I was thinking HDFC app has implemented some really powerful logic/mechanism to detect root and was scratching my head to figure out what to do.

    Finally I ended up Uninstalling Magisk (removing root) in the process and HDFC app was working fine. They I installed Magisk app (just the app not patched it yet). Now HDFC app throws the same error :D
    Which means it just checking Magisk app itseems even though I renamed the Magisk to different package name.
    I tried HMA then HDFC throws some other error. Need to try it again.

    Update: Fixed the issue with HMA. I was doing it wrong earlier
    1
    I just switched from Magisk Delta to the latest Magisk Alpha build, and installed Shamiko. libshamiko.so is still detected.

    This was on launch.
    I don't use/mind for Magisk Alpha

    See my previous post, I tested with straight Magisk Canary and I had no problems (and no popup detection as you have)

    I don't see that you commented/confirmed anything about your use of HMA and DenyList for hiding (for Delta, it would be Unmount Modules)

    Hiding does not end by installing Shamiko and Play Integrity Fix (btw, check do you pass Basic and Device Integrity)

    ---

    Note:
    Since you are/were using Delta, you can fully live without Zygisk and Shamiko. Please look into the older posts in this thread (I don't know does it also apply to Alpha).
    That way you can get rid of troubles with Shamiko

    However, as I answered above, I do have Zygisk enabled and Shamiko installed and your Blind app did not complain me anything (specially not for Shamiko as on your screenshot)

    Sorry, cannot help you further - I tested, it was all ok for me and I uninstalled the Blind app since I'm not interested to use it
    1
    If you run core only mode but choose to unload modules for certain applications then can you still have modules enabled for everything else?
    Core only mode disables ALL modules and GENERALLY

    If you're not sure how certain settings do, please experiment yourself, it will not cause a nuclear explosion
  • 61
    This is not an officially supported topjohnwu project.
    If you are looking for official Magisk source, please go to this page


    Introduction

    Custom Magisk fork by HuskyDG. Sync with official Magisk adding back MagiskHide.
    http://huskydg.github.io/magisk-files

    REPORT BUG IS STILL ACCEPTED ON XDA THREAD BUT PLEASE INCLUDE ADDITIONAL INFORMATION SUCH AS LOGCAT AND MAGISK LOG
    7
    Ptrace MagiskHide ported as Magisk module which allows user to hide without enabling Zygisk on Official Magisk v24.0+

    7
    Revive MagiskHide from Magisk v23.0
    • The implementation of MagiskHide is ptrace Zygote process, every forks of Zygote will be notified and traced also.
    • MagiskHide from Magisk v23.0 which monitors every thread spawn event of Zygote fork (app process is heavily a multithreads process which will spawn threads to trigger MagiskHide to check UID and cmdline)
    • There is an exception that app zygote does not spawn threads and thus it won’t trigger MagiskHide to unmount Magisk and detach. (MagiskDetector and Momo take advantages of this fact to detect MagiskHide through ptrace)
    • To fix this problem, we trace the syscalls prctl() instead of thread spawn event of Zygote fork like MagiskHide in Magisk v23.0
    • After processes has been forked from zygote, there will be atleast prctl() is called to change the process name. For normal app process and isolated process, the process name will be changed as followed:
      • zygote -> (unknown name) -> <pre-initialized> -> (process name). So the key is <pre-initialized>, after that we can guess it is target process or not.
    • For app zygote, there is only once prctl() is called to change process name: zygote -> package.name_zygote.
    • The changing process name happens before apk is being loaded so we can detach it from ptrace, do unmount all Magisk files and nearly there is no traces left after that.
    6
    And now Bingo, with today's Magisk-017cca27-delta(25205), Momo does no more detect Zygisk

    - Zygisk and MagiskHide enabled, Shamiko disabled
    👍
    Btw, maybe I should start thinking of Livin' by Mandiri 😁
    Interesting analysis from @5ec1cff here:
    https://github.com/5ec1cff/my-notes/blob/master/analyse-livin.md

    Seems Livin / others may use smap for detection... This study discusses TJW's sanitize environment commit not working properly and LSP fixes in Shamiko as well as efforts needed to hide zygisk hooks, esp for functions of libandroid_runtime.so:
    https://github.com/5ec1cff/my-notes/blob/master/new-idea-detect-zygisk.md
    ... I note dev refers to @canye's (Magisk Bravo) analysis of environment variables too...

    This article analyses more recent Zygisk changes and Dev's attempts to hide zygisk /proc/self/attr/current exposure etc:
    https://github.com/5ec1cff/my-notes/blob/master/zygisk-new-start-mode.md
    ... it ends with this conjecture:
    "Maybe it's time to consider loading zygisk with native bridge?"
    More on this and comparison w/ riru hiding / methods and plans for hiding Zygisk here:
    https://github.com/5ec1cff/my-notes/blob/master/maru.md

    Many of the ideas revealed in Dev's notes above are implemented in Magisk Maru fork (and adopted for now in Delta)... See top 4 commits here:
    https://github.com/5ec1cff/Magisk/commits/maru
    ... use of complete native/src/zygisk/elf_util.cpp file from LSPosed in inject with native bridge Is interesting...

    ... Many other interesting notes here:
    https://github.com/5ec1cff/my-notes
    incl. "build-magisk-on-windows" etc...

    ... I've only taken a cursory glance at notes I mentioned...

    Very credible Zygisk hiding efforts for a fork like Delta however... 👍 👀 PW