Flashing Patched Boot.img in ODIN Not Working

Search This thread

Brianmagoon

Member
Nov 30, 2016
34
8
Shot in the dark. But will this method work getting root on SM-G935P on the latest firmware? I have been around the world looking for a root method that works. I think Im screwed because of the binary 5 thing. I really hope not. I need to get root. I feel naked without it lol. I tried doing it through odin but got denied.
 

ForeverYangGo

Member
Mar 19, 2017
13
0
when I reboot phone ,It get in looping

I use ODIN AP and choose patched_boot.img.tar
It flash OK
but when I reboot phone ,It get in looping



In MagiskManager's settings chose the .img.tar output format. The patched image should be named "patched_boot.img.tar", if it's just "patched_boot.img" you can not directly flash it!
 

mattman1978

Member
Aug 18, 2017
22
5
Can you by any chance send me the boot-image, stock, patched, tared ?
Or do you have the possibility to untar the image (or create just the boot.img) and use a "real" gnu-tar (preferred on linux).
Or give me the exact firmware, so I can try to create the image and tar it with the tar on my Fedora system ?

When doing the (internal) beta-tests I had the same issue, because of incorrect tar-headers (gnu-tar does not care about it). That should be fixed in MagiskManager, but Odin seems to be extremely nitpicking about the tar-header.

It might also be a problem with signed (or better not signed) bot-image, but I guess this would lead to another error.

I'm having the same problem. Or similar at least. I downloaded the stock firmware for my Samsung galaxy J7 Sky pro, SM-S727VL. There are two varients of this, with two different firmware packages available for download as seen in this link:
https://updato.com/firmware-archive-select-model?q=S727VL&exact=1
I checked the baseband version of my phone in developer options and matched up the number: S727VLUDU1AQB5
Downloaded the correct one to my windows box and used 7zip to unpack it. I Found the 5 .tar.md5 files and found the boot.img in the AP file. I extracted my boot.img file and then transferred it to the phone via the USB cable that came with it. I changed the setting in Magisk to create an odin-flashable image. I used Magisk manager to patch the file, which it did. I then moved the patched_boot.img.tar back to my computer using the same USB cable.

I flipped the OEM UNLOCK to unlock.
I fired up the most recent version of Odin (I already have the samsung drivers installed). Odin3_v3.12.3 I right-clicked and selected "Run as Administrator" just in case.
Turned off my anti-virus protection.
I put the phone in download mode.
Phone displays
FRP LOCK: OFF
SECURE DOWNLOAD : ENABLE
QUALCOMM SECUREBOOT: ENABLE
(some other stuff that looks pretty normal)

Connect to the USB cable and ODIN finds the phone. (Added!!)
Selected the Patched_boot.Img file in the AP box and click Start.
I get this as a response:
<ID:0/005> Added!!
<ID:0/005> Odin engine v(ID:3.1203)..
<ID:0/005> File analysis..
<ID:0/005> SetupConnection..
<ID:0/005> Initialzation..
<ID:0/005> Get PIT for mapping..
<ID:0/005> Firmware update start..
<ID:0/005> SingleDownload.
<ID:0/005> boot.img
<ID:0/005> RQT_CLOSE !!
<ID:0/005>
<ID:0/005> Complete(Write) operation failed.
<OSM> All threads completed. (succeed 0 / failed 1)

Phone still boots normally and works fine, but obviously, the flash fails every time.
I have tried older versions of ODIN, including 1.something.
I honestly believe I have followed all the instructions to the letter and I am not successful.

Here is a download link for the PATCHED image from my dropbox:
https://www.dropbox.com/s/f60m5ek3q99dbuf/patched_boot.img.tar?dl=2

This is the UNPATCHED, stock boot.img from the factory firmware download.
https://www.dropbox.com/s/ws9q1dmpm7v7kx9/boot.img?dl=2

There is no TWRP for my phone (at this time). Any help with this Magisk method would be GREATLY appreciated.
Thank you
 
Last edited:
  • Like
Reactions: Holm182

Jopponius

Member
May 3, 2018
9
0
Am on the same boat.
Wondering if anyone has success to flash Magisk through Odin WITHOUT having Twrp on a S7 exynos.
 

varadinum

Senior Member
Sep 16, 2011
773
258
Graz-Budapest
Xiaomi Poco F3
odin fail

Hi,odin can not flash patched_boot.img. With magisk the patched_boot.img created. Odin launched -AP selected-patched selected-start-fail. Why does not work? can someone help me?
Thanks

Samsung A9 2018 A920F Bootloader unlocked

the mobile phone must be switched on or be off in download mode?
 

Attachments

  • 111.PNG
    111.PNG
    79.1 KB · Views: 235
Last edited:

partcyborg

Recognized Developer
Jun 23, 2017
2,551
2,289
OnePlus 9 Pro
Woah ok hold up a second. There is some bad information in 5hid thread. Let me clear that up first, then I will help who is he until issues. .


It has to be added in AP not BL.
it doesn't, all the slots are identical the only reason they are labeled is so you flash things in order as sometimes flashing out of order could be potentially problematic. This has nothing to do with why he was having problems. The reason it was not working was that he was trying to flash a boot image file renamed with. .tar at the end instead of a boot image in a tarball. Just want to make sure everyone is clear on that: it does not matter which slot you flash a single .tar or .tar.md5 Odin handles them all exactly the same way. Odin actually uses the name of the .img file to decide where to write the image into memory, so the file inside has to always be named boot.img exactly. The .tar or .tar.md5 can be named whatever though


While playing with this I did clear the cache partition in recovery as thats the only thing it lets you do in sotck recovery other than wipe /data to do factory reset.

Wiping the cache partition (on a Samsung at least, but I'm pretty sure every modern phone is this way) does not wipe the dalvik cache. In fact, it doesn't actually wipe anything that would help a rom not have issues at all. Everyone has been doing this out of habit and not realizing it does literally nothing to fix issues, as nothing is stored in /cache but some log files and on some devices ota updates. To wipe dalvik you need to use twrp, or if that isn't an option you will have to boot up to the is and use something like L speed or flashfire to do it. If you're stuck unable to boot, I can give you a command to run over adb to do the wipe manually but it's dangerous because if you don't enter the command EXACTLY, character for character as what I tell you to enter you could easily delete everything in your phone.

I did not. I am just trying to get rid of all the force closures at this point now. I've since flashed the original boot.img that I tar'd using 7zip. I still am getting them. I've tried going to recovery and wiping cache partition and even went as far as putting on unlock to off. I've not restarted since doing that though.
My next steps I think are to factory reset in recovery or maybe just backup and flash the stock room back on.

If I do try rooting this in the future I just may do the custom recovery and flash the SU the regular way.


Whatever is going wrong with your phone, the way you flashed Magisk isn't causing it. My guess is thw firmware you downloaded to extract a boot image to flash is newer than the firmware on fire on how phone and not compatible with what is already there. This leaves you with 2 options on how to proceed:
1) look up the rom and baseband versions currently running on the device and download the same version to extract a boot image for modifying with Magisk
2) install the new stock firmware the came with the boot image you tried to mod and flash, with a stock boot image first, then once everything is working on the new stock rom, take a fresh copy of the new stock boot image and mod it in Magisk and try again.
 
Dec 6, 2018
11
1
Hi,

I'm having the same boot image patching problem. I followed the instruction given by @topjohnwu at the link https://topjohnwu.github.io/Magisk/install.html#samsung-system-as-root but to no avail. My mobile is samsung J7 duo and its stock rom is downloaded from https://www.sammobile.com/firmwares/galaxy-j7-duo/SM-J720F/XSP/download/J720FDDU3ARJ3/243170/. Attached are the screenshots. While patching with magisk manager 7.2.0 did not show error, the flashing of the patched boot image stalled.
 

Attachments

  • Odin.jpg
    Odin.jpg
    142.3 KB · Views: 204
Dec 6, 2018
11
1
This is a follow up of my last post. Good news is I managed to root my J7 Duo using topjohnwu's system as root procedure. Here's the link again https://topjohnwu.github.io/Magisk/install.html#samsung-system-as-root. The problem was suspected to be the mobile's download mode. I suspect my mobile wasn't in proper download mode when I tried to flash the patched boot image, though the downloading screen did show up. I started out by putting the mobile into download mode by using micro usb jig dongle as the 3 buttons combination didn't work on my mobile. Here's the link of a similar one https://www.ebay.com/itm/Micro-USB-...ng-Galaxy-S4-S3-S2-S-Note-3-2-1-/111378442299. Using the jig, the mobile showed the downloading screen with some status on the top left. See attached example for illustration. The flashing of the patched boot image stalled in odin by putting the mobile to download mode via usb jig. On the other hand, if I used the tool from Chimera to flash the patched boot image, it will put mobile into download mode but less the status on the top left. See attached image. I'm not sure whether there are different state of download mode for samsung mobiles. The flashing via Chimera was successful and magisk was installed into the mobile with root access. Please follow topjohnwu's procedure.
Chimera tool is a commercial product and it cost 11.9 euro for a start license. It could do most of the procedure including removal of RMM except rooting of J7 Duo. It may be able to root other mobile model, though not J7 Duo. Hope this help.
 

Attachments

  • samsung-galaxy-j7-duo-2018.jpg
    samsung-galaxy-j7-duo-2018.jpg
    23.5 KB · Views: 156
  • saYzboP.jpg
    saYzboP.jpg
    14 KB · Views: 157
Last edited:
  • Like
Reactions: ipdev

spike1970

Member
Dec 9, 2015
5
0
s10 bricked by odin

s10 bricked by odin MagiskManager won't work on windows should i start smashing it now ? so upset nothing can be done as already had in 2 shops they say cant do nothing with it stuck in download mode and attempt to exit download mode only restarts it all over again and again no escape no hope every gude says s6 im like wtf s10 or just do this do that set fire to phone smash with lump hammer i just do not know what to do help please

---------- Post added at 12:02 PM ---------- Previous post was at 11:53 AM ----------

s10 bricked by odin MagiskManager won't work on windows should i start smashing it now ? so upset nothing can be done as already had in 2 shops they say cant do nothing with it stuck in download mode and attempt to exit download mode only restarts it all over again and again no escape no hope every gude says s6 im like wtf s10 or just do this do that set fire to phone smash with lump hammer i just do not know what to do help please
i lost my charger ordered new phone went dead new charger came all seem fine charging but pin unlock stopped working so i though oh hard reset did that s10 rebooted still stuck on pin which i could not remember changing so after searching found odin did that left phone for 2 hours in odin stuck on download mode ever since always gets stuck on boot.img not patched stock from samsung and no back up made so i guess im fecked unless some knows how to do it as so far im lost now thanks in advance
 

ayyash_tarar

Member
May 19, 2023
27
0
Dear i am also in same problem. A307FN with Android 11.
Odin say Invalid LZ4... (I patched with Magisk and rename it then .img to .lz4 and after .lz4 to .tar and flash with Odin)
Pls Help
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Woah ok hold up a second. There is some bad information in 5hid thread. Let me clear that up first, then I will help who is he until issues. .


    It has to be added in AP not BL.
    it doesn't, all the slots are identical the only reason they are labeled is so you flash things in order as sometimes flashing out of order could be potentially problematic. This has nothing to do with why he was having problems. The reason it was not working was that he was trying to flash a boot image file renamed with. .tar at the end instead of a boot image in a tarball. Just want to make sure everyone is clear on that: it does not matter which slot you flash a single .tar or .tar.md5 Odin handles them all exactly the same way. Odin actually uses the name of the .img file to decide where to write the image into memory, so the file inside has to always be named boot.img exactly. The .tar or .tar.md5 can be named whatever though


    While playing with this I did clear the cache partition in recovery as thats the only thing it lets you do in sotck recovery other than wipe /data to do factory reset.

    Wiping the cache partition (on a Samsung at least, but I'm pretty sure every modern phone is this way) does not wipe the dalvik cache. In fact, it doesn't actually wipe anything that would help a rom not have issues at all. Everyone has been doing this out of habit and not realizing it does literally nothing to fix issues, as nothing is stored in /cache but some log files and on some devices ota updates. To wipe dalvik you need to use twrp, or if that isn't an option you will have to boot up to the is and use something like L speed or flashfire to do it. If you're stuck unable to boot, I can give you a command to run over adb to do the wipe manually but it's dangerous because if you don't enter the command EXACTLY, character for character as what I tell you to enter you could easily delete everything in your phone.

    I did not. I am just trying to get rid of all the force closures at this point now. I've since flashed the original boot.img that I tar'd using 7zip. I still am getting them. I've tried going to recovery and wiping cache partition and even went as far as putting on unlock to off. I've not restarted since doing that though.
    My next steps I think are to factory reset in recovery or maybe just backup and flash the stock room back on.

    If I do try rooting this in the future I just may do the custom recovery and flash the SU the regular way.


    Whatever is going wrong with your phone, the way you flashed Magisk isn't causing it. My guess is thw firmware you downloaded to extract a boot image to flash is newer than the firmware on fire on how phone and not compatible with what is already there. This leaves you with 2 options on how to proceed:
    1) look up the rom and baseband versions currently running on the device and download the same version to extract a boot image for modifying with Magisk
    2) install the new stock firmware the came with the boot image you tried to mod and flash, with a stock boot image first, then once everything is working on the new stock rom, take a fresh copy of the new stock boot image and mod it in Magisk and try again.
    2
    But in odin in AP I am not able to import img file
    That's why you have to chose the correct patch-format in MagiskManager's settings before patching the stock boot.img .
    In the settings click/touch "Patch Boot Output Format" and chose ".img.tar", then in the main menu click/touch "Install", then again "Install", then "Patch Boot Image File", chose the stock-image and wait until it is patched.
    This should create a file named "patched_boot.img.tar" in the MagiskManager-folder of your internal storage.
    This should be flashable.
    Changing just the ending of any file does not change the format and can not work therefore.
    2
    @jenslody I have just tried flashing the patched boot.img file in ODIN under the AP/PDA field and depending on ODIN version it either crashes or is stuck at file analysis. I have named the file "magisk" to keep the filename short. Therefore the full filename is magisk.img.tar. It was created using the patcher in magisk manager with the output setting of img.tar. I prefer to flash it in ODIN as I would like to keep the stock recovery for the sake of future updates.

    How I obtained the boot.img file is from opening the stock firmware image from SAMMOBILE and extracting the AP file and grabbing the boot.img. I also grabbed the recovery.img this way just to have it. I dont have access to any other way of extracting the files as I dont have or use linux personally so its my windows 10 computer only.

    As you offered the other guy above I am including my stock extracted boot.img file as well as my exact firmware version on SAMMOBILE.
    The exact firmware filename is: J327PVPU1AQF4_J327PSPT1AQF4_BST
    Its the Samsung Galaxy J3 Emerge (2017) from Boost Mobile (J327P) with Baseband version ending in QF4. Its on Android 6.0.1.

    I was unable to attach the boot.img file here cause its too big (11.7mb) and the upload failed when I tried to ZIP it instead cause the limit there is 20mb. So here it is on DropBox instead.
    https://dl.dropboxusercontent.com/s/azyeqrx7rtvjvik/boot.img
    Once again the is extracted directly from the firmware file with winrar with no magisk patching.
    This should work, unless your ODIN-version stumbles about other things than mine.
    Nevertheless, I uploaded a patched version of your boot.img to my server: https://rpm.jenslody.de/magisk/J327PVPU1AQF4_patched_boot.img.tar .
    It's tared with the tar from my Fedora-system, but the (tar-header related) fixes @topjohnwu made to the java-tar he uses in MagiskManager made the created image flashable on my J5 (latest stock).
    I also added a tared image with md5-checksum for you to test: https://rpm.jenslody.de/magisk/J327PVPU1AQF4_patched_boot.img.tar.md5
    2
    @jenslody, just for me to understand—you get the patched version via Magisk Manager, then untar it, then tar it again with a custom built tar?

    Where are the patches you mention?
    I used the stock boot for J3, patched it through MagiskManager (one as *.img, one as *.img.tar), renamed the patched_boot.img to boot.img (taht's what Odin expects inside the tar, used Fedora's tar (I'm on Fedora 26) to create a tar archive from it and just for testing added a md5-checksum to one version of it.
    MagiskManager is the 5.30 released with/for Magisk 14.4, bot patched. The fixes I mention were made by @topjohnwu in the (internal) beta-testing for 14.4.
    To be clear:
    the released Magisk with MagiskManager create img.tar-files that work for my J5 with the Odin-version I use (Odin3 v3.10.7) without any tweaking.
    My self-tared versions are for testing purposes, to see if other Odin versions are more nitpicking than mine (about tar-headers). The included boot.img is exactly (binary) the same.
    1
    This is a follow up of my last post. Good news is I managed to root my J7 Duo using topjohnwu's system as root procedure. Here's the link again https://topjohnwu.github.io/Magisk/install.html#samsung-system-as-root. The problem was suspected to be the mobile's download mode. I suspect my mobile wasn't in proper download mode when I tried to flash the patched boot image, though the downloading screen did show up. I started out by putting the mobile into download mode by using micro usb jig dongle as the 3 buttons combination didn't work on my mobile. Here's the link of a similar one https://www.ebay.com/itm/Micro-USB-...ng-Galaxy-S4-S3-S2-S-Note-3-2-1-/111378442299. Using the jig, the mobile showed the downloading screen with some status on the top left. See attached example for illustration. The flashing of the patched boot image stalled in odin by putting the mobile to download mode via usb jig. On the other hand, if I used the tool from Chimera to flash the patched boot image, it will put mobile into download mode but less the status on the top left. See attached image. I'm not sure whether there are different state of download mode for samsung mobiles. The flashing via Chimera was successful and magisk was installed into the mobile with root access. Please follow topjohnwu's procedure.
    Chimera tool is a commercial product and it cost 11.9 euro for a start license. It could do most of the procedure including removal of RMM except rooting of J7 Duo. It may be able to root other mobile model, though not J7 Duo. Hope this help.