Magisk General Support / Discussion

Search This thread

exist2resist

Senior Member
Nov 18, 2010
285
58
Calgary
Google Pixel 3 XL
To extract img files from payload.bin you have to use Payload Dumper. There are several threads (under different devices) with download links on XDA (you should search for) - for Windows, Linux, even for Android (not working great with bin files of several GBs), and with instructions

Link to my copy (for Windows) I downloaded months ago from XDA and happily used couple of times:

Thanks for that worked really well, and solved my issue.
 
  • Like
Reactions: ipdev and zgfg

evil-google

Member
Jul 3, 2019
29
8
Bit vague on your setup now...

Guess RN7 with ramdisk=no (since launched w/ A9... unless has A/B(?))

So default instructions are install magisk in recovery ramdisk (recovery mode selected)... Zip install can't do this... Did you ever do that (patch recovery.img)?... But being Xiaomi you won't actually need this... Best to patch boot.img (recovery mode un-selected) using M. App and flash...

And I wouldn't use .zip install for your device... It's legacy SAR... May be fine, but zip install is fraught since legacy ramdisk booting devices (any device w/ Launch Version A8 or less, but not updated to A10+)... Whether this could impact on SD card, BT issues etc, I'm not sure, but I'd start again w/ proper patch / flash for SAR / 2SI devices...

You can use Uninstall Magisk from App; Nb. Restore Images leaves android configuration in /data/adb, so you'll want to take Complete Uninstall... (Or, if you first want to test if issue is that magisk.db or other config files are corrupted / causing issues, with root explorer or twrp simply delete everything in /data/adb and reboot and magisk daemon will rebuild config files... You'll have cleanly installed root and modules, superuser, deny lists etc will be gone too...)

For full uninstall you can also delete everything in /data/adb and flash unpatched boot image (recovery.img or boot.img or both these boot images)... If deleting data with root, don't reboot before flashing original boot image...

Issue does sound VERY like a mismatched kernel to me... Often this gives associated hardware issues...

Kernel is in boot image, so this is a common issue where users restore images to take an OTA update (even a minor one), then flash back previous boot image instead of sourcing the ROM corresponding with the OTA to obtain boot.img (or recovery.img) to patch and flash... or simply mix up boot images on the PC... Failing to restore unpatched images before an OTA can cause issues too...

Did you ever use App to patch images? (... Old .zip installation doesn't allow such a mismatch/ user error).

... Remember to treat your Xiaomi SAR A only device as ramdisk=yes for your clean setup, and patch / flash boot.img exactly matching or extracted from current ROM...

🤠 PW
Hope you will have patience with my ignorance on this matter :oops:...so, will the following help?

1. open Magisk app and select recovery mode and do a direct install
2. then again using Magisk app uncheck the recovery mode and do a direct install

Or will it be just better to uninstall magisk completely, re-install the apk and use boot image patching method? Again, when creating the boot image patch file do I need to select the recovery mode option?

Once again, thanks for your patience. As you can see, I am clueless on how Magisk does its tricks!

EDIT : You are correct, in my case ramdisk=no.
 

pndwal

Senior Member
Hope you will have patience with my ignorance on this matter :oops:...
First, I asked : Did you ever use App to patch images? (Answer will eliminate some possible issue causes...)
so, will the following help?

1. open Magisk app and select recovery mode and do a direct install
No... Treat you device as ramdisk = yes...

- Magisk manually added a basic ramdisk to boot partition (it always does when missing, yous in case it can be used for Magisk init... Still says no to indicate no OEM ramdisk as most A-only legacy SAR booting type devices won't be able to use the ramdisk due to incompatible bootloader... Xiaomi inexplicably has boot-ramdisk compatible bootloader despite OEM not utilising it...

So, don't use recovery mode (for patching recovery image)...
2. then again using Magisk app uncheck the recovery mode and do a direct install
Well you can, but won't be clean... Thought you wanted to eliminate any issues with configuration which is in /data/adb...
Or will it be just better to uninstall magisk completely, re-install the apk and use boot image patching method?
Uninstall Magisk, so do as you said (select Complete Uninstall) or simply patch correct image, delete /data/adb but leave app if correct version and flash newly patched image before any reboot... (Am I repeating all this?)
Again, when creating the boot image patch file do I need to select the recovery mode option?
No! ... Only if you want to use the troublesome Magisk in Recovery ramdisk option, but why do this when bootloader allows Magisk in boot??
Once again, thanks for your patience. As you can see, I am clueless on how Magisk does its tricks!
No worries, but do take time to read official Installation instruction(s) 3 or 4 times till you get your head around pertinent instructions... Many clues I've given are just from these...
EDIT : You are correct, in my case ramdisk=no.
👍

PS Google is your friend! (Not Evil)... And FWIW, Android is their (adopted) baby, their mobile OS!... What's not to like?! 😛 PW
 
  • Like
Reactions: ipdev

J.Michael

Recognized Contributor
Jan 20, 2018
1,312
1,245
Samsung Galaxy Tab A series
@evil-google If you use the Magisk manager app to patch an image, and there is a checkbox for "Recovery mode", it is your responsibility to use that checkbox to tell Magisk what kind of file it is patching. Only check that box if you are giving Magisk a recovery image to patch. And make sure that you flash a recovery image to the recovery partition.
 
  • Like
Reactions: ipdev

evil-google

Member
Jul 3, 2019
29
8
First, I asked : Did you ever use App to patch images? (Answer will eliminate some possible issue causes...)
No, I did not. As I mentioned, I took the quick and dirty option since someone posted that it worked of them without any issues and now I know that it was the wrong choice!

Thanks again for going through the responses in detail and it makes a lot more sense to me. I will uninstall it and then patch the LOS boot.img file and flash it as you have mentioned rather than trying to fix what may be broken.

Appreciate your help.(y)
 
  • Like
Reactions: J.Michael

evil-google

Member
Jul 3, 2019
29
8
@evil-google If you use the Magisk manager app to patch an image, and there is a checkbox for "Recovery mode", it is your responsibility to use that checkbox to tell Magisk what kind of file it is patching. Only check that box if you are giving Magisk a recovery image to patch. And make sure that you flash a recovery image to the recovery partition.
Is there any advantage of patching the recovery image over patching the boot image?
 

pndwal

Senior Member
No, I did not. As I mentioned, I took the quick and dirty option since someone posted that it worked of them without any issues and now I know that it was the wrong choice!
To be clear, issues may not stem from .zip installer recovery installation, but it is not recommended even by John for post ramdisk boot type devices... Modern installation can patch other partitions where needed also (zip installer doesn't), and also eliminates issues stemming from 3rd party Recoveries of which there are many that magisk cannot control (flashing, mounting, etc etc).
Thanks again for going through the responses in detail and it makes a lot more sense to me. I will uninstall it and then patch the LOS boot.img file and flash it as you have mentioned rather than trying to fix what may be broken.

Appreciate your help.(y)
👍 PW
 

J.Michael

Recognized Contributor
Jan 20, 2018
1,312
1,245
Samsung Galaxy Tab A series
Is there any advantage of patching the recovery image over patching the boot image?
I think not.
If anything, patching the recovery image is a last resort, used only when patching the boot image cannot work.

(All right, if Magisk is installed in recovery, it might be possible to boot in a way that leaves Magisk inactive. It is possible that some "tamper detection" processes will be satisfied if Magisk is not active. So, you could make the case that there is some advantage to installing Magisk to recovery.)
 

pndwal

Senior Member
Is there any advantage of patching the recovery image over patching the boot image?
No! (except possibly benefits of having boot to both system with root and system without it mentioned in following posts)... Booting system via recovery is also quite awkward ...

This mode was provided because most devices with no OEM ramdisk (A only legacy SAR) cannot support an added one, so there is no other option for running Magisk since it always resides in a ramdisk... John calls this "The worst type of device to ever exist as far as Magisk is concerned".
https://topjohnwu.github.io/Magisk/boot.html#piecing-things-together

Fortunately for you:
"Some Type III devices’ bootloader will still accept and provide initramfs that was manually added to the boot image to the kernel (e.g. some [actually all(?) or most] Xiaomi phones), but many device don’t (e.g. Samsung S10, Note 10). It solely depends on how the OEM implements its bootloader."...

Recovery mode is simply for installing it to ramdisk in recovery partition and Magisk app toggle signals system to reboot via recovery, patch recovery.img instead of boot.img when taking Direct Install etc... PW
 
Last edited:
  • Like
Reactions: ipdev

pndwal

Senior Member
I think not.
If anything, patching the recovery image is a last resort, used only when patching the boot image cannot work.

(All right, if Magisk is installed in recovery, it might be possible to boot in a way that leaves Magisk inactive. It is possible that some "tamper detection" processes will be satisfied if Magisk is not active. So, you could make the case that there is some advantage to installing Magisk to recovery.)
This is correct... Normal bootup will boot system without Magisk, and this may have some limited-use benefits... PW
 
  • Like
Reactions: ipdev

zgfg

Senior Member
Oct 10, 2016
7,787
5,191
Is there any advantage of patching the recovery image over patching the boot image?
Not unless you want the following:

- Normal booting will boot to Android without Magisk

- Booting through Recovery (Vol+ & Power) to boot into Android with Magisk

Usually, it is not practical

Also, you may probably have troubles with OTA
 
  • Like
Reactions: ipdev
May 25, 2022
31
19
PS Google is your friend! (Not Evil)... And FWIW, Android is their (adopted) baby, their mobile OS!... What's not to like?! 😛 PW
:LOL::ROFLMAO: So trueeeeeeeeeee.
NVM 450 services inside Play Services alone ..each a gem! As stated by Ed Snowden on Utube- Guugle does a brilliant job of shielding its users from others but guugle itself collects, analyses & sells private info on its users for ad revenue, and so does Appel and many others. Thats how they got so rich & powerful so fast. (sorry,off-topic though but living with the pain u knw)

@pndwal said:
Yup, your parents held your hand and spied on you but weren't (necessarily) evil. 😜...

Wadiya spect Tech = Spy-biz? 😁 PW
Me replied :
:LOL::ROFLMAO: As a kid I was too young & naive to not realize that my parents were actually spying on me & even selling my data to AdMob , AdSense, Pentgon & agencies. Where did all that Ad money they received go? I didn't get any of if in the "Will" they left behind. My parents can't be so evil .:LOL::ROFLMAO:
 
Last edited:

pndwal

Senior Member
:LOL::ROFLMAO: So trueeeeeeeeeee.
NVM 450 services inside Play Services alone ..each a gem! As stated by Ed Snowden on Utube- Guugle does a brilliant job of shielding its users from others but guugle itself collects, analyses & sells private info on its users for ad revenue, and so does Appel and many others. Thats how they got so rich & powerful so fast. (sorry,off-topic though but living with the pain u knw)
Yup, your parents held your hand and spied on you but weren't (necessarily) evil. 😜...

Wadiya spect Tech = Spy-biz? 😁 PW
 

pndwal

Senior Member
Off-Topic: I always thought that 'The Problem' colloquially known as Zoomers were the 'ones' that prefer to use abbreviations and/or acronyms for every other word typed or spoken.
like i totes dont like even get you right now....Bruh
Not just zoomers... the olds too... at least the Googlers...
  • The GKI kernel is built from the ACK sources.
  • The GKI kernel is a S-KB plus associated LMs per architecture, per LTS release (currently only arm64 for A11-5.4 and A12-5.4).
  • The GKI kernel is tested with all AP releases that are supported for the associated ACK. There’s no feature deprecation for the lifetime of a GKI kernel version.
  • The GKI kernel exposes a stable KMI to drivers within a given LTS.
  • The GKI kernel doesn't contain SoC-specific or BS code....
... well maybe I took some license with this. 😁 ... Here you go:
https://source.android.com/docs/core/architecture/kernel/generic-kernel-image 😛 PW
 

pndwal

Senior Member
... But seriously, Magisk prepared for GKI (Generic Kernel Image) 2.0 w/ v 25.0:
[MagiskInit] Support Android 13 GKIs (Pixel 6)
- this:
Support GKIs without ramdisk
Fix #5819
topjohnwu committed on 12 May

This is because
For devices launching with Android 13, the generic ramdisk is removed from the boot image and placed in a separate init_boot image. This change leaves the boot image with only the GKI kernel.

So users of Pixel 7(?) and future devices launching w/ A13+ will need to patch / flash new init_boot.img for Magisk installation instead of boot.img per vvb2060's note (Translated):
https://source.android.com/docs/core/bootloader/partitions/generic-boot

Magisk has been adapted in advance and supports the new partition layout of Android 13.

Please extract the init_boot.img first if you manually patch the image, if not, then extract the boot.img
https://t.me/magiskalpha/530

Nb. Updated devices can use ramdisk in original boot partitions as per John's fix for Pixel 6...

👀 PW
 
Last edited:

zgfg

Senior Member
Oct 10, 2016
7,787
5,191
... But seriously, Magisk prepared for GKI (Generic Kernel Image) 2.0 w/ v 25.0:
[MagiskInit] Support Android 13 GKIs (Pixel 6)
- this:
Support GKIs without ramdisk
Fix #5819
topjohnwu committed on 12 May

This is because


So users of Pixel 6 etc and future devices launching w/ A13+ will need to patch / flash new init_boot.img for Magisk installation instead of boot.img per vvb2060's note (Translated):

https://t.me/magiskalpha/530

Nb. Updated devices retain generic ramdisk in original boot partitions.

👀 PW
Putting that simple, it probably means that if on A13 and higher init_boot img exists - patch the init_boot; otherwise patch the boot (or recovery) img as usual

I didn't check the doc - on a/b devices should there be again init_boot_a and init_boot_b?
 

CSX321

Senior Member
Aug 21, 2009
641
300
Southern IL USA
So users of Pixel 6 etc and future devices launching w/ A13+ will need to patch / flash new init_boot.img for Magisk installation instead of boot.img per vvb2060's note (Translated):

https://t.me/magiskalpha/530

Bit confused by that. There's no init_boot.img in the Pixel 6 Android 13 zip. When I updated mine yesterday, I just extracted and patched boot.img as always, and everything seems normal.
 
  • Like
Reactions: ipdev and pndwal

Top Liked Posts

  • 1
    Installing on Samsung S7 (SM-G930F) with /e/OS?
    (I've done a bit of installed custom ROMs on all my phones, but I've steered clear of Samsungs up until now so I'm a bit nervous of their 'Download' stuff.)

    Preliminaries:
    /e/OS: e-1.3-q-20220905216076-stable-herolte.zip
    (based on lineageos 18.1)
    I've followed these install instructions because it says here that 'Github is the only source where you can get official Magisk information and downloads.'
    But, the install instructions here seem pretty complete and 'official'.
    (Method 2 Install seems the same as Github install instructions, but Method 1 Install isn't reported on Github. What's official?)
    So, first up I am using a Samsung device with Andriod 9.0 or latter, but as I'm using it with /e/OS, I ignored the warning that said: 'If you are using a Samsung device that is launched with Android 9.0 or higher, you can now jump to its own section.' I hope that was correct - but if not, someone please shout!

    Steps so far:
    1. Magisk App reports 'Ramdisk: Yes' so, I need a copy of boot.img. Done, extracted from here.
    2. Device does not have separate vbmeta
      Code:
      $ adb shell ls -l /dev/block/by-name|grep vbmeta
      $
    3. At Patching Images I did not have either “Recovery Mode” or “Patch vbmeta in boot image” options so I hope these settings were detected automagically, please shout otherwise
    4. 'Choose “Select and Patch a File” in method, and select the boot/recovery image' was the only option
    5. This is where things got difficult, I couldn't adb pull /sdcard/Download/magisk_patched_[random_strings].img because the output file was written to /storage/emulated/0/Download/magisk_patched-25200_UjUVt.img and /storage/emulated/0/ is only accessible to root via adb and I don't yet have root access... :-/
    6. So, I copied via MTD mount device - like it says not to here... :-/ (Any workarounds?)
    7. Now, I've got my magisk_patched patched image on my PC, what? I'm using a Samsung device with doesn't seem to have normal fastboot but instead has 'Download.' If I boot to fastboot from recovery (it's an /e/OS recovery) it just boots straight to the system; if I boot to fastboot from adb, it just boots straight to the system... I can reboot to Download from Android via the extended reboot menu - but, then when I'm in Download what do I do? fastboot flash boot /path/to/magisk_patched.img isn't going to work...
    8. The /e/OS recovery does offer the option to apply an update from internal storage - should follow the Method 1 Install install from here?
    9. The /e/OS recovery does offer the option to apply an update from ADB Sideload - but... which partition:
      Code:
      heroltexx:/ # ls -l /dev/block/by-name
      total 0
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 BOOT -> /dev/block/sda5
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 BOTA0 -> /dev/block/sda1
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 BOTA1 -> /dev/block/sda2
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 CACHE -> /dev/block/sda15
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 CPEFS -> /dev/block/sdd1
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 CP_DEBUG -> /dev/block/sda17
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 DNT -> /dev/block/sda10
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 EFS -> /dev/block/sda3
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 HIDDEN -> /dev/block/sda16
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 OTA -> /dev/block/sda7
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 PARAM -> /dev/block/sda4
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 PERSDATA -> /dev/block/sda13
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 PERSISTENT -> /dev/block/sda11
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 RADIO -> /dev/block/sda8
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 RECOVERY -> /dev/block/sda6
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 STEADY -> /dev/block/sda12
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 SYSTEM -> /dev/block/sda14
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 TOMBSTONES -> /dev/block/sda9
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 USERDATA -> /dev/block/sda18
      lrwxrwxrwx 1 root root 14 2022-09-24 16:39 sda -> /dev/block/sda
      lrwxrwxrwx 1 root root 14 2022-09-24 16:39 sdb -> /dev/block/sdb
      lrwxrwxrwx 1 root root 14 2022-09-24 16:39 sdc -> /dev/block/sdc
      lrwxrwxrwx 1 root root 14 2022-09-24 16:39 sdd -> /dev/block/sdd
      heroltexx:/ #
      /dev/block/sda5?

    Attached screenshot of what the Magisk App looks like:
    View attachment 5719443
    Any ideas about how to install Magisk?
    The web site magiskapp.com declares (at the very bottom) "This Website Isn't Owned Or Affiliated With Topjohnwu". My immediate reaction is that it is the work of a parasite, and should be avoided.

    Did this Samsung device come with /e/OS installed? If not, how did you isntall it?

    The John Wu installation instructions describe using Odin. As far as I know, Odin (or Heimdall on Linux) runs on a desktop computer and downloads tar files to an attached device.

    You should find an /e/OS forum to ask about what their recovery supports. It does seem reasonable to assume they will "flash" a .ZIP file the way TWRP does, but you know what "assume" does...
    1
    Installing on Samsung S7 (SM-G930F) with /e/OS?
    (I've done a bit of installed custom ROMs on all my phones, but I've steered clear of Samsungs up until now so I'm a bit nervous of their 'Download' stuff.)

    Preliminaries:
    /e/OS: e-1.3-q-20220905216076-stable-herolte.zip
    (based on lineageos 18.1)
    I've followed these install instructions because it says here that 'Github is the only source where you can get official Magisk information and downloads.'
    But, the install instructions here seem pretty complete and 'official'.
    (Method 2 Install seems the same as Github install instructions, but Method 1 Install isn't reported on Github. What's official?)
    So, first up I am using a Samsung device with Andriod 9.0 or latter, but as I'm using it with /e/OS, I ignored the warning that said: 'If you are using a Samsung device that is launched with Android 9.0 or higher, you can now jump to its own section.' I hope that was correct - but if not, someone please shout!

    Steps so far:
    1. Magisk App reports 'Ramdisk: Yes' so, I need a copy of boot.img. Done, extracted from here.
    2. Device does not have separate vbmeta
      Code:
      $ adb shell ls -l /dev/block/by-name|grep vbmeta
      $
    3. At Patching Images I did not have either “Recovery Mode” or “Patch vbmeta in boot image” options so I hope these settings were detected automagically, please shout otherwise
    4. 'Choose “Select and Patch a File” in method, and select the boot/recovery image' was the only option
    5. This is where things got difficult, I couldn't adb pull /sdcard/Download/magisk_patched_[random_strings].img because the output file was written to /storage/emulated/0/Download/magisk_patched-25200_UjUVt.img and /storage/emulated/0/ is only accessible to root via adb and I don't yet have root access... :-/
    6. So, I copied via MTD mount device - like it says not to here... :-/ (Any workarounds?)
    7. Now, I've got my magisk_patched patched image on my PC, what? I'm using a Samsung device with doesn't seem to have normal fastboot but instead has 'Download.' If I boot to fastboot from recovery (it's an /e/OS recovery) it just boots straight to the system; if I boot to fastboot from adb, it just boots straight to the system... I can reboot to Download from Android via the extended reboot menu - but, then when I'm in Download what do I do? fastboot flash boot /path/to/magisk_patched.img isn't going to work...
    8. The /e/OS recovery does offer the option to apply an update from internal storage - should follow the Method 1 Install install from here?
    9. The /e/OS recovery does offer the option to apply an update from ADB Sideload - but... which partition:
      Code:
      heroltexx:/ # ls -l /dev/block/by-name
      total 0
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 BOOT -> /dev/block/sda5
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 BOTA0 -> /dev/block/sda1
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 BOTA1 -> /dev/block/sda2
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 CACHE -> /dev/block/sda15
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 CPEFS -> /dev/block/sdd1
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 CP_DEBUG -> /dev/block/sda17
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 DNT -> /dev/block/sda10
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 EFS -> /dev/block/sda3
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 HIDDEN -> /dev/block/sda16
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 OTA -> /dev/block/sda7
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 PARAM -> /dev/block/sda4
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 PERSDATA -> /dev/block/sda13
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 PERSISTENT -> /dev/block/sda11
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 RADIO -> /dev/block/sda8
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 RECOVERY -> /dev/block/sda6
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 STEADY -> /dev/block/sda12
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 SYSTEM -> /dev/block/sda14
      lrwxrwxrwx 1 root root 15 2022-09-24 16:39 TOMBSTONES -> /dev/block/sda9
      lrwxrwxrwx 1 root root 16 2022-09-24 16:39 USERDATA -> /dev/block/sda18
      lrwxrwxrwx 1 root root 14 2022-09-24 16:39 sda -> /dev/block/sda
      lrwxrwxrwx 1 root root 14 2022-09-24 16:39 sdb -> /dev/block/sdb
      lrwxrwxrwx 1 root root 14 2022-09-24 16:39 sdc -> /dev/block/sdc
      lrwxrwxrwx 1 root root 14 2022-09-24 16:39 sdd -> /dev/block/sdd
      heroltexx:/ #
      /dev/block/sda5?

    Attached screenshot of what the Magisk App looks like:
    View attachment 5719443
    Any ideas about how to install Magisk?

    #1 - dont reference anything on magiskapp.com

    #2 - you'll need to use ODIN to flash to a Samsung if you want to do the boot.img malarkey - best place to find out how to do that for your Samsung is in the Samsung S7 threads for your device. Ideally you would look for a post on how to install custom Recovery (TWRP) and then just simply flash the magisk.apk (renamed to magisk.zip) from TWRP which would bypass all the patching malarkey and root you automagically....i still do this on my S20, rather than patch the boot image and flash via ODIN, because im notoriously lazy


    I would change topjohnwu's instructions to read (because patching a multi gigabyte AP file is a LONG wait - my devices AP is 7gb long) (my changes in orange, this is how i do it on my S20 if i do use boot image patch and ODIN):​

    • [On your PC] Use either samfirm.js, Frija, or Samloader to download the latest firmware zip of your device directly from Samsung servers
    • [On your PC] Install z-7ip
    • [On your PC] Unzip the firmware and extract the AP tar file. It is normally named as AP_[device_model_sw_ver].tar.md5
    • [On your PC] Open the AP_[device_model_sw_ver].tar.md5 from right click context menu select 7-zip -> Open Archive and extract:
    boot.img.lz4
    vbmeta.img.lz4 (if its listed)
    • [On your PC] Select both files and right click and from right click context menu select 7-zip -> Add To Archive
    • change Archive (name -1st box onscreen) to something like boot.tar and Archive Format to tar, and click OK to create tar archive
    • move boot.tar to mobile device
    • Press the Install button in the Magisk card
    • If your device does NOT have boot ramdisk, check the “Recovery Mode” option
    • Choose “Select and Patch a File” in method, and select the boot.tar file
    • Move the /sdcard/Download/magisk_patched.tar file to PC
    • Code:
      adb pull /sdcard/Download/magisk_patched_[random_strings].tar)
    • Reboot to download mode. Open Odin on your PC, and flash magisk_patched.tar as AP.
    • Your device should reboot automatically once Odin finished flashing.
    • Install the Magisk app you’ve already downloaded and launch the app. It should show a dialog asking for additional setup.
    • Let the app do its job and automatically reboot the device. Voila!
  • 6
    Can someone either provide actual proof that zygisk/shamiko etc does anything to GPS (i havent had a single issue and i use it daily) or i dunno, maybe stop spreading FUD because of personal gripes you have against people on other platforms that dont take part here, and therefore wont get any of the swipes youre taking at them here that only further add to the aforementioned FUD.

    We've all had our moments with those folk and its fine to mention the odd bit of spice you may come across when trying to submit an issue on github (ive done this myself), but to then to continually poison magisk proper/shamiko because of that person/persons taking part is not helping anyone. Thats a personal gripe, and shouldnt colour the entire magisk (proper) project/shamiko. What we dont need is spice here....

    Please, you know who you are...

    I think we've all had enough, now
    5
    I'm sorry I didn't realize that.

    I've been so used to generic steps (boot recovery -> flash recovery -> reboot recovery -> wipe all -> flash firmware -> flash ROM -> flash GApps -> flash dm-verity disabler -> boot system -> boot recovery -> flash Magisk -> flash *Posed) that I didn't bother checking if steps have changed.

    Therefore, neither.

    Honestly I think it's too bad that we can't just flash ZIPs anymore, that was so easy.

    Anyway, thank you for your response.
    For everyone, a bit of

    Insight into Custom Recovery installation method Depreciation:

    Yup... Method was fine for old legacy ramdisk booting devices, but does rely on custom recovery compatibility, and John ended up fielding the TWRP issues; plenty from official TWRP builds not to mention broken unofficial ones... Then Dees Troy needed to attend to real life and Team Win simply couldn't adapt to Google's ever changing system architecture, boot methods etc fast enough and lagged way behind Magisk. (See John's Android Booting Shenanigans)...

    This precipitated the move to an installation solution that doesn't rely on other custom development, but wasn't the only practical consideration; 'Manager' and now 'App' patching w/ fastboot (etc) flashing meant owners of
    devices with no custom recovery can start rooting and do further modification
    https://forum.xda-developers.com/t/magisk-the-magic-mask-for-android.3473445/post-72587983
    and users can also preserve stock recovery to apply OTAs etc... Thus 'Magisk Manual Injection' was born...

    Next, support was added for patching Samsung AP firmware which recovery/zip installation couldn't achieve. Then with Project Treble came efforts to
    update Magisk to be modular and adaptive to follow Google's Pixel concept... modding a device has changed completely. I am a strong advocate of these new changes, praising the effort Google has put into designing such weird but fascinating setup despite many view this as "moves against developers".

    With the announcement of Project Treble, all devices will go through the same "Pixel-ize" treatment, so this future is inevitable. Project Treble is all about "modular", and Magisk has been rewritten to embrace this concept. I have spent extra effort to backport the changes made requires to run on these new modern devices to downward support all devices, so we do not need 2 drastically different installation methods...
    https://forum.xda-developers.com/t/magisk-the-magic-mask-for-android.3473445/post-74961572
    ... and then 'recovery mode' support for many A-only legacy SAR devices (A9 / 2018) w/ ramdisk only in recovery partition (again not supported by recovery/zip installation)... And it is now noted:
    This installation method is deprecated and is maintained with minimum effort. YOU HAVE BEEN WARNED!

    Installing using custom recoveries is only possible if your device has boot ramdisk.

    Installing Magisk through custom recoveries on modern devices is no longer recommended. If you face any issues, please use the proper Patch Image method.
    ...

    Note that even (old) legacy ramdisk boot-type devices are to be considered 'modern' once running Android 10+ as they are automatically converted to current 2SI "SAR" boot-type!...

    👀 PW
    5
    Hello good people,

    I'm trying my luck here hoping that someone more knowledgeable with magisk can give me a hint about my issue.
    I succeed to build a Samsung S22 Ultra (S908B) rom with f2fs rw partitions (stock rom has locked ro dynamic partitions) but it boots only on permissive kernel patched with magisk 24.3, more precisely 24301. I mention that it boots ok but zygisk cannot be activated. (activation ok in magisk app settings but it says Zygisk = No on magisk app home page)
    As soon I update and patch the kernel with a higher version of magisk, the phone bootloops. Tried all v24 and v25 magisk versions and it bootloops on any version higher than 24301.

    Here are the differences between magisk 24301 (boots ok) and 24302 (bootloop).

    Diffs 24301 --> 24302

    - Support multiple CPIO concatenated
    - Use /data as tmpfs mount point in 2SI setup
    - Cleanup inheritance
    - Introduce new sepolicy injection mechanism
    - Add hijack sepolicy support for rootfs devices
    - Remove unused code
    - Reorganize magiskinit code
    - Fix #5589 (WARNING: linker: su unsupported flags DT_FLAGS_1=0x8000001 after typing su on terminal emulator)
    - Log if failed to dlopen a zygisk module
    - Use standalone magiskpolicy
    - Make magiskinit not magiskpolicy
    - SAR can also have monolithic sepolicy
    - Also hijack plat_file_contexts if necessary

    PS. On stock rooted rom magisk update to v24 and v25 is ok but all partitions are ro. Although it still need permissive kernel to boot.

    Thank you in advance for any hint/advice.
    FWIW, I found older info I posted in addition to link above re. problems getting r/w /system at least w/ stock Android 10 or later any more due to shared blocks implementation:
    https://forum.xda-developers.com/t/magisk-general-support-discussion.3432382/post-85049195

    ... and re. Magic Mount, the new way to 'write' to /system w/ Magisk systemlessly.

    Of course you can rebuild whole filesystem to overcome OEMs locking /system to read only (by using an automated bash script by XDA member @lebigmac to "Universally Mount System read write"... BUT (big but), you MUST be adventurous / maverick / a 'Power User' / know your stuff) as mentioned, but you should be able to make just about any needed changes to /system systemlessly using Magisk without the myriad issues/pitfalls inherent in R/W mounted /system... Of course for simple property manipulation @Didgeridoohan's MagiskHide Props Config module is probably all you need, but you can overlay /system (hence Magisk description 'The Magic Mask for Android') with just about any files / code using Magisk Tools provided.

    Interestingly, the link following refers to how John Wu has even overlayed a stock system with an entire custom ROM as Proof of Concept for a projected Universal MultiROM (Magisk powered custom ROM)... Unfortunately he didn't take that much further...

    I posted (earlier) info on these two methods here:
    https://forum.xda-developers.com/t/magisk-general-support-discussion.3432382/post-84859571

    🤠 PW
    5
    How does PixelFlasher invoke boot_patch.sh?
    Does it invoke it as an "executable", creating a new process? Or does it "source" it, so changes to the environment will survive?

    Does PixelFlasher create an environment variable named "SHA1"?

    My copy of boot_patch.sh has a compound statement that tests whether SHA1 has a non-zero length value before setting it to the sha1 of the boot image. If the environment variable is already set, it will not be overwritten. I don't know why.
    I wouldn't source. The script is supposed to be called as an executable

    Eg, my following code is rather primitive but it dumps the active Boot partition (it supports A/B and non-A/B devices), then it patches by invoking the boot_patch.sh script, finally it dumps back to the Boot partition and automatically reboots

    Ie, it updates me the Magisk and it also leaves me the patched-boot img in the Download folder

    Code:
    #!/system/bin/sh
    
    # Boot partition
    AB=$(getprop ro.boot.slot_suffix)
    BOOT_PART=/dev/block/bootdevice/by-name/boot"$AB"
    
    # Boot and patched boot images
    DOWNLOAD=/sdcard/Download/
    BOOT_IMG="$DOWNLOAD"boot.img
    PATCHED_BOOT_IMG="$DOWNLOAD"patched-boot.img
    
    # Magisk path
    MAGISK_PATH=/data/adb/magisk/
    
    # Disk-dump boot image to Download folder
    dd if="$BOOT_PART" of="$BOOT_IMG"
    
    # Patch the boot image and move to Download folder
    "$MAGISK_PATH"boot_patch.sh "$BOOT_IMG"
    mv "$MAGISK_PATH"new-boot.img "$PATCHED_BOOT_IMG"
    
    # Flash the patched boot image
    dd if="$PATCHED_BOOT_IMG" of="$BOOT_PART"
    
    # Reboot
    reboot
  • 1085
    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