Rooting Multiple Phones Quickly - Magisk

Hi all,
Thanks for the great work on Magisk.
Predicament - need to be rooting multiple S20 devices often.
Current Process - Unlock Bootloader, Setup Phone (install Magisk) -> Copy AP File -> Patch File in Magisk App ->> Copy Patched TAR to PC -> Use Odin to Flash. Rinse and Repeat...
So my question is.... is there a better way to do this and speed up the process for multiple phones?
My main queries...
1 . Does the patch process do the same thing (i.e. generate the same AP file) on all of the devices (same model)
1a. If so then can i just flash the same patched file to all phones?
2. Can the patching file from within the Magisk app be done on a PC instead to prevent needing to copy file to/from the phone and use the Magisk app - i.e. can i emulate it or extract the patching logic to run elsewhere?
3. Any other suggestions to automate/speed up this process??
Many thanks!

1. Patching can be done from any phone and not just the target device.
2. If all phones are on same firmware version and are same device without any changes (same model, same region etc...), Then you can use the same patch file used on 1 successful phone to other.
3. Patching can only be done by Android app.

Thanks for the quick response, that's good news!

Out of interest why the is patching only possible from Android? can this process not be extracted and ran on a PC to modify the boot file?

Related

Samsung Galaxy Active Tab2 (SM T395) Latest Android 9 Pie full ROOT using Magisk

If there's anyone out there with some experience of rooting, and your reading and wanting to know if it's possible to update to the very latest Android 9 Pie on the Samsung Galaxy Active Tab2 (SM T395).
https://www.sammobile.com/samsung/g...are/SM-T395/BTU/download/T395XXU4CSF1/275287/
Well I can confirm it's possible as I have just done it. :good:
Make sure OEM unlock is on > developers page
Make sure USB debugging is on
Make sure FRP lock is off i.e no google accounts attached to device
Install Magisk apk on your device and patch the boot.img ( remove the boot.img from the boot.img.LZ4 file from the stock AP)
Software needed to remove the boot.img file from the LZ4 file - https://glamourrom.eu/how-to/extract-lz4-image/
Convert the patched boot.img into a recognisable MD5.tar file
Software needed to make MD5.tar file - http://www.droidthunder.com/convert-img-to-tar-md5/
Then reflash the patched boot.img using Odin on PC.
You DO NOT NEED TO RE COMPRESS TO LZ4 file !
Your device will show a verification reset page, all data on your device will be reformatted. :crying:
Nice quick and easy method for those of you who know what your doing
If you don't know what your doing, then don't try.
Happy rooting :good:
Hi tsam19,
Thank you for your guide.
With extracting the lz4 image, do you extract it to boot.img or boot.img.ext4?
When I try to reflash the patched boot.img it freezes on boot.img. any ideas?

What happened to the boot.img patching option in Magisk Manager?

I know Magisk can be flashed via TWRP, and that is the preferred way for me, usually. But on Magisk 19.3 I don't see an option to patch the boot.img without flashing the Magisk installer zip from TWRP. I just want to patch the img and flash it via Odin (I have a Samsung device, fastboot not available on those). I would like to keep the recovery as stock and system partition unmodified with dm-verity enabled. That way I can just use system less modules.
I normally prefer Phh's Superuser or SuperSU, I like old fashioned, traditional root without systemless or modules. But there are some tests I would like to run, and modules I would like to try.
Thanks!
It's right there if you press the install button and choose "Install"... If it it isn't on your setup you need to provide more information.
And both phh's and SuperSU are systemless root.
My setup:
Samsung Galaxy Note 4 N910F (international unbranded variant, latest stock Marshmallow firmware)
When I press install in Magisk Manager, it only offers the option to download a zip, no boot.img patching. I need the output file as tar or tar.md5, not img, so it can be flashed with Odin (no need for TWRP if flashed that way).
You're right, Phh is systemless, but it doesn't offer modules. SuperSU can be systemless or forced as system-installed.
So you don't have the "Select and patch a file" option at all? If you're looking for a specific tar file option there isn't one anymore. Just pick the file and let the Manager do the rest.
Didgeridoohan said:
So you don't have the "Select and patch a file" option at all? If you're looking for a specific tar file option there isn't one anymore. Just pick the file and let the Manager do the rest.
Click to expand...
Click to collapse
Hi, I am confused. I did use Manager 7.3.5 with Magisk 19 and now latest 20 .
When I use "select and patch a file". Use a stock boot.img file from my Tab 4 8.0 T330 Android v5.1.1 last version available. Whilst patched file is being created, a message flashes on screen img or tar file can be selected.
The problem is there is No option to "select img or tar file in output" as was the case in earlier versions of Manager v5 or 6. Which I previously used to create either patched img or tar files.
I have created different img files using the same original boot.img, only created using different Manager updates as they are created and released. Each time a new version creates a different file size.
Therefore you comment "tar file option is no more". WHY NOT.???
Next comment Just pick the file and let the Manager do the rest". Please explain or provide link to method you are referring to.
Another Question. Can I use an earlier img or tar file created on earlier Manager version with the latest Magisk version to install Magisk 20 on the Tablet. I have also used "img to tar to md5" convertor software and use ODIN to update the patched boot file, or install TWRP and use patched img file.
Any comments would be appreciated. Cheers
@BeeJ1109 It just means that the Manager will detect what type of file you're providing and outputs an img or tar file depending on the input. Tar in, tar out, etc.
There's no specific option for it in the settings anymore, since it is handled automatically now.
Didgeridoohan said:
@BeeJ1109 It just means that the Manager will detect what type of file you're providing and outputs an img or tar file depending on the input. Tar in, tar out, etc.
There's no specific option for it in the settings anymore, since it is handled automatically now.
Click to expand...
Click to collapse
Hi, Didgeridoohan, Thanks for your reply.
So I understand that if I use boot.img it will convert to patched.boot.img or patched.magisk.img.
If I use boot.tar it will convert to patched.boot.tar or patched.magisk.tar.
Question 1: So you are now saying I have to use another app to convert img to tar before patching or after patching.
Seems to me a backward function of your latest Manager, when previously you had a choice to select which option you received as the output file. So much extra time and effort to achieve the same result.
Question 2: This the case then I have to install latest manager and reinstall older version that worked. Create patched file as tar. Use ODIN to install patched boot file.
Do I need to rename magisk to boot, so ODIN will accept the patched tar file.
I use latest ODIN 13 on my Samsung Galaxy Tabs 4 & S4 and Phones S3, S4, & S8.
Question 3: Will older version created Tar file work with latest version Magisk to Root device, Then update both Magisk and Manager as normal when updates are released.
Or do I root using same version Magisk and Manager that created the patched boot file, then update to latest version.
I have successfully updated Stock and RR or Lineage OS Firmwares for years.
Samsung devices do not allow sideload installs and ODIN is so easy to use to install updates or new versions for all devices.
I also used other methods to root devices ie TWRP, Flashfire, but now Magisk is updated regularly, Hide Apps works on 7.1 thru 10, whereas old apps don't work past Android 4.4.
Thanks for your assistance, Cheers BJ.
@BeeJ1109 I know very little about Samsung so I can't really answer most of your questions, but wouldn't the file be a tar file to start with?
Anyway, if you wish for some functions to work differently than they currently do I would suggest opening a feature request issue in GitHub (with a detailed description of what you want).
Any solution?
Hi there, i know this is an old thread, but i was wondering if anyone found a solution for this.
I am also trying to install Magisk Manager, modifying the boot.img file from my firmware. The problem i find is that the boot.img is inside a boot.img.lz4 (which i open with the modified 7zip), and that is inside another img.tar file.
Now, i seem to understand the old Magisk Manager (version 6 for example), would allow to decide the output file, while the v7 does not anymore. I would just receive a repatched_boot.img file, which i cannot use to flash using Odin.
I also tried installing Magisk v6, but it will force to update upon doing the repatching.
Do you have any other solution?
PS: all reason i'm trying to do this is trying to install (any) TWRP on my tablet SM-P580 will show a blue/black screen.
walty80 said:
Hi there, i know this is an old thread, but i was wondering if anyone found a solution for this.
I am also trying to install Magisk Manager, modifying the boot.img file from my firmware. The problem i find is that the boot.img is inside a boot.img.lz4 (which i open with the modified 7zip), and that is inside another img.tar file.
Now, i seem to understand the old Magisk Manager (version 6 for example), would allow to decide the output file, while the v7 does not anymore. I would just receive a repatched_boot.img file, which i cannot use to flash using Odin.
I also tried installing Magisk v6, but it will force to update upon doing the repatching.
Do you have any other solution?
PS: all reason i'm trying to do this is trying to install (any) TWRP on my tablet SM-P580 will show a blue/black screen.
Click to expand...
Click to collapse
Hi.
Use Magisk Manager to create a modified stock boot.img. as you have mentioned.
What I do is search for Windoows PC "img to tar converter" app. on Google search.
Lots will be found. They a small executable batch file. Which you Right click on the "convert tar".exe file to run on a Windows PC.
Best one will have Input and Output directories. You can inset your patched boot .img file, you have just downloaded for your device. Add this file into Input directory of the app using Windows Explorer File Manager. May have to setup the location of resultant output directory. Then run Img to Tar converter . The application will convert your patched_boot img file into a patched_boot.tar file.
That newly modified .tar can now use ODIN. To install patched_boot.tar onto your connected device via PC USB port using the Latest version of ODIN 3.14.1.
Hope that helps. CHEERS

Magisk 19.3 and Samsung GT-I9001 (LineageOS 14.1, TWRP 2.8.1.0) does not work

Hi,
my Samsung GT-I9001 runs with LineageOS 14.1 (Nougat 7.1.2):
https://forum.xda-developers.com/ga...opment/i9001-lineageos-galaxy-s-plus-t3793783
As recovery TWRP 2.8.1.0 (F2FS-support) is installed.
Wenn trying to install Magisk 19.3 using magisk-v19.3.zip via TWRP it does not work: Error message ""Error execute updater binary in zip" and no flash is done.
Any idea what is the reason? The TWRP 2.8.1.0 is the latest version I found for the I9001.
The I tried patching the stock-bootloader via the Magisk-Manager. The bootloader-file is a .tar-file, e.g. in
https://forum.xda-developers.com/showpost.php?p=24831012&postcount=1330.
Magisk works with .tar, too, but seems to exspect an .img-file inside. But inside the I9001-"Boot_loader.tar" is no .img-file but 3 .mbn-files and 1 .bin-file.
So I am asking for help. Is there no way using Magisk with the I9001 (and LineageOS 14.1/TWRP)?
You're not supposed to use the bootloader, but the boot image. Two very different parts of the system setup...
And since you have such an old TWRP you're going to have to use the patching method, but it is very far from certain that your device is compatible. Only way to know is to try though.
Oops. Sorry, my mistake. I am a newbie with this and until I was not aware of boot.img ... I supposed it as the "real" filename of the bootloader. And again learning something new. Thank a lot for teaching.
Fortunately I have made a backup of the stock-ROM with TWRP before flashing the ROM. In the backup I find the file boot.emmc.win. This seems to be the stock-boot.img. Is it corrcect that I only have to rename the file to boot.img?
If the I9001 is not compatible with Magisk, means patching of the boot.img would result in a not working code/boot.img (the patching-procedure itself worked w/o errors, but does thos mean, that the result is o.k.?) - is the real risk bricking the device?
That should be the boot image and it should work fine by just renaming it. But, if it's the boot image from the stock Samsung system it won't work with LineageOS. You'll find the boot image for the ROM inside the ROM zip.
If the boot image is incompatible the Manager will let you know by an error message. Save the installation log if that happens and it could possibly tell you in more detail what went wrong.
If everything goes smoothly and the Manager manages to patch the file without issue and you still end up not being able to boot your device after flashing it you can simply restore the unpatched boot image and everything will be back to normal again.
Thanks for the further explanations. But I am not sure understanding correct.
In my understanding of the Magisk-installation manual I have to use the original boot.img always, in every case.
Do I understand correct that this understanding is wrong and that I have to use for patching with the Magisk-Manager the specific boot.img of the actual running OS? So I have to extract the boot.img of the lineageos-14.1-.tar-file (or rename the boot.emmc.win from one of my later backups of the lineagos-14.1-system)?
I have tested patching meanwhile with the "original" boot.img from the old ("original") backup and also with a boot.img extracted from a complete stock-ROM I have found in the web. Magisk Manager patched both fles w/o problems.
btw: Need the patched file the name "boot.img" or doesn´t matter the ame of the patched file (when flashing with fastboot or Odin)?
Unfortunately - or fortunately - I was not able to flash the patched boot.img to the i9001:
adb can communicate with the i9001 when it is running normal (USB debug enabled) and attached via USB. But although Odin is realizing the i9001 attached in download-mode (what means that the USB-cable is working and the driver are installed) fastboot does not realize the i9001 attached in download-mode. I have tested a lot of cables, ports and USB-drivers - no success.
So I tried to flash the boot.img with Odin. For this the boot.img must be converted to a .tar- (or .tar.md5-)file. When searching for converting-tools I found the explanation how to change the output-format of the patched boot.img in Magisk-Manager to .tar. Unfortunately I do not find this option in the current/latest version of Magisk-Manager. What is wrong - is there a secret, a hidden way to activate this option or is this option available in older versions of Magisk Manager only - and if so can I use an older version only for patching and getting a .tar-boot-image-file?
What the documentation is talking about is indeed the untouched boot image of your currently running OS. Don't mix and match.
When flashing with Odin the image indeed need to be in tar-format. With the current Manager there is no option to change the output format because the Manager will take care of that itself. Feed it a tar file and it'll output a tar file. Unfortunately you'll likely get plain image files from the TWRP backups, so those files will be no good unless you convert them before patching.
But, you might not have to use Odin since you have TWRP. It can flash the patched boot image for you. No computer required...
Again thanks a lot for this teaching. I am a newbie in modifying, tuning, flashing smartphones, and although I have learned a lot in the last weeks there are yet a lot of thing I do not know.
I know that I can flash new OS as .zip-file with TWRP (and other files if the manual says that I have/can do it with TWRP ) but I did not know that I can flash with TWRP a boot.img-file. So I would like to ask for a brief guide how to do this. Or is this the same procedure as flashing any .zip-file?
Addition 1: TWRP 2.8.1.0 does not see/list the .img-Files ....
O.k., found in the web: Directly flashing .img: Version 2.8.4.0 and above ....
So I am back again where I started ... fastboot does not see the i9001 and Odin needs a .tar ...
Addition 2: In reg. of the boot.img of the actual used OS:
I have looked into the "original" flashed lineage-14.1-20180523-UNOFFICIAL-ariesve.zip and found the boot.img. But this boot.img is smaller (4.670 byte) than the boot.emmc.win of it´s backup (5.120 byte). In fact every boot.emmc.win of every TWRP-backup (doesn´t matter what OS I have tested) ist 5.120 bytes and larger than the boot.img of the .tar/.zip-file for flashing (different sizes). So if the files are not identical - how can just simply renaming the boot.emmc.win in boot.img result in a valid boot.img?
It's practically the same thing. You just have to switch to "Image" after choosing the install option and then pick what partition to flash to after selecting the file.
Didgeridoohan said:
It's practically the same thing. You just have to switch to "Image" after choosing the install option and then pick what partition to flash to after selecting the file.
Click to expand...
Click to collapse
But not in version 2.8.1.0 - and there is no newer TWRP for the i9001.
MarkFalk said:
But not in version 2.8.1.0 - and there is no newer TWRP for the i9001.
Click to expand...
Click to collapse
Yes. I'm going to forcefully introduce my palm to my face for a moment... Forgot about that tiny but crucial detail.
Just use the boot image file from the LineageOS zip. Patch it and flash the patched image to your device. If you can't get that working I'm going to have to hand this over to someone else, because I have practically zero knowledge on working with Samsung devices and their shenanigans.
Thanks. The small detail of "flashing" into the i9001 is the remaining problem.
As said fastboot does not see the i9001 in it´s download-mode although Odin sees the device and can flash e.g. the bootloader. Odin on the other hand needs a .tar-file and I do not find a way how to converting the (patched) boot.img into a .tar-file that Odin would accept as valid file.
In these cases I usually ask someone like @jenslody or @ianmacd. They usually have a lot more knowledge about Samsung stuff...
I have found a workaround:
1. Make a pure boot-backup with TWRP
2. Copy the backup-folder into/with a new name
3. Copy boot.emmc.win and boot.emmc.win.md5 from the backup to pc or root
4. Rename boot.emmc.win to boot.img
5. Patch boot.img with Magisk-Manager
6. Rename the result to boot.emmc.win
7. Copy boot.emmc.win to the new backup-folder
8. Make a RD5-hash of boot.emmc.win
9. Replace the hash in boot.emmc.win.rd5 with the new hash
10. Copy boot.emmc.win.rd5 to the new backup-folder
11. Boot into TWRP and restore boot from the new folder
It works with the i9001 and lineageOS14.1 and TWRP 2.8.1.0 and the newest Magisk, but it should work with all devices.

Question how i can update with rooted S21 Ultra exynos

hello there ..
plz hlp how i cat update software with keep rooted
Unroot and go back to stock.
If it's running well... leave it alone.
You'll have to root again probably.
So it's a waste of time to update it and lose the Root unless there is a major upgrade like Android 12.
As Samsung has NO full project treble there are no a/b partitions. So you can't update and keep root. You need to use ODIN to update and then root again which takes about 5 minutes. Just don't wipe your storage with Odin
If you have rooted with magisk it is easy.
Download latest firmware and extract it.
Copy file starts with AP_xxx to phone.
Open magisk and select install
Select option "Select and patch file"
Browse to AP_xxx file which you have copied to phone and patch it.
Locate file normally named as magisk_patched-xxxx.tar to PC again.
open odin and add files to their specific slot.
For AP slot used magisk patched file
For CSC there are two files, here you need to select which have HOME_CSC file not CSC.
If you flash only CSC this is wipe your device so Use HOME_CSC file.
Once flashing process complete, your device will reboot and Voila.
Enjoy upgraded firmware with root retained and without data wiped.
P.S. While coping file to or from device, use adb push or pull respectively as some user report corrupted file while coping it through MTP.
have you found a solution to root galaxy s21 5G us? 6 bit security?

Difference: Get Magisk through custom recovery vs patched firmware?

Any difference?
It depends on the device.
For devices where flashing individual partitions can be done directly via bootloader, patching the boot image is generally preferred. However, some devices don't allow this, such as Samsung, so you have 3 options, which may or may not work well:
Extract the boot image from the AP.tar and repack it, then flash in Odin (easy to get wrong)
Patch the AP.tar in Magisk (difficult because this is the "main" firmware package and is quite large)
Flash a custom recovery if one is available, then flash Magisk in recovery (seems to work pretty well)
V0latyle said:
It depends on the device.
For devices where flashing individual partitions can be done directly via bootloader, patching the boot image is generally preferred. However, some devices don't allow this, such as Samsung, so you have 3 options, which may or may not work well:
Extract the boot image from the AP.tar and repack it, then flash in Odin (easy to get wrong)
Patch the AP.tar in Magisk (difficult because this is the "main" firmware package and is quite large)
Flash a custom recovery if one is available, then flash Magisk in recovery (seems to work pretty well)
Click to expand...
Click to collapse
I did number 2. How is it difficult? How is 1 more dangerous than 2?
Arealhooman said:
I did number 2. How is it difficult? How is 1 more dangerous than 2?
Click to expand...
Click to collapse
It's difficult because it's a large file, and since Magisk doesn't run on PC, there's no easy and quick way to patch it.
I never said 1 is dangerous, just easy to get wrong. Samsung repackages their images as lz4 files, so while you can extract boot.img.lz4 from the AP.tar using 7Zip, extracting boot.img from the lz4 file is another story. I tried using a 7zip plugin; it didn't work for me. Then, once you've patched it, you have to figure out how to flash it to the device. If you want to use Odin, you have to repackage the file. You can use TWRP to install images, but at that point you might as well just install Magisk via TWRP and skip the whole process.
V0latyle said:
It's difficult because it's a large file, and since Magisk doesn't run on PC, there's no easy and quick way to patch it.
I never said 1 is dangerous, just easy to get wrong. Samsung repackages their images as lz4 files, so while you can extract boot.img.lz4 from the AP.tar using 7Zip, extracting boot.img from the lz4 file is another story. I tried using a 7zip plugin; it didn't work for me. Then, once you've patched it, you have to figure out how to flash it to the device. If you want to use Odin, you have to repackage the file. You can use TWRP to install images, but at that point you might as well just install Magisk via TWRP and skip the whole process.
Click to expand...
Click to collapse
I did it the Al way becasue I don’t have twrp for my device. I used Adb push and pull for magisk. Btw after I rooted my device is expired int little problems (eg. When swiping out apps, the one on the top doesn’t move down, my device restarts upon connecting wifi). Do you think I’m okay like I am or I should redo?
Arealhooman said:
I did it the Al way becasue I don’t have twrp for my device. I used Adb push and pull for magisk. Btw after I rooted my device is expired int little problems (eg. When swiping out apps, the one on the top doesn’t move down, my device restarts upon connecting wifi). Do you think I’m okay like I am or I should redo?
Click to expand...
Click to collapse
No idea how to help with that, sorry.
Thanks for explaination anyway

Categories

Resources