Unable to succesfully Unpack Boot image and ramdisk and then repack - Samsung Galaxy J2 Questions & Answers

I have a boot.img file that i can use to root my Samsung J2 SM-J260F - if I flash this with Odin everything is Ok. Now I want to edit a file in the ramdisk of the boot.img to make the phone boot on power. However simply unpacking the Boot.img and unzipping the ramdisk then repacking fails - even when i do not edit anything in the ramdisk. When the repacked boot.img is flashed with Odin the device gets into a boot loop.
I am using the Carliv Image Kitchen for Androidv1.3 tool to do the packing and unpacking.
Is there some specific aspect of the Samsung boot.img such as a signature that is causing this to fail?
Progress update
The only unpacking tool that seemed to correctly repack the image was MTK_Extractor_V2.63 - all of the other (many) utilities I tried did not seem to repack the ramdisk correctly and caused the phone to boot into the recovery screen.
Changing the init.rc and init_samsungexynos7570.rc files as follows finally led to success.
In file init.rc
delete everything under "on charger" then add back setprop sys.powerctl reboot
Under "service lpm /system/bin/lpm"
delete class sec-charger critical and replace with trigger late-init
In file init_samsungexynos7570.rc
delete everything under "on property:ro.bootmode=charger"

AndyJN said:
I have a boot.img file that i can use to root my Samsung J2 SM-J260F - if I flash this with Odin everything is Ok. Now I want to edit a file in the ramdisk of the boot.img to make the phone boot on power. However simply unpacking the Boot.img and unzipping the ramdisk then repacking fails - even when i do not edit anything in the ramdisk. When the repacked boot.img is flashed with Odin the device gets into a boot loop.
I am using the Carliv Image Kitchen for Androidv1.3 tool to do the packing and unpacking.
Is there some specific aspect of the Samsung boot.img such as a signature that is causing this to fail?
Click to expand...
Click to collapse
Did you unlocked the bootloader?
Also i would recommend you to use a custom recovery like TWRP to flash boot.img

AndyJN said:
I have a boot.img file that i can use to root my Samsung J2 SM-J260F - if I flash this with Odin everything is Ok. Now I want to edit a file in the ramdisk of the boot.img to make the phone boot on power. However simply unpacking the Boot.img and unzipping the ramdisk then repacking fails - even when i do not edit anything in the ramdisk. When the repacked boot.img is flashed with Odin the device gets into a boot loop.
I am using the Carliv Image Kitchen for Androidv1.3 tool to do the packing and unpacking.
Is there some specific aspect of the Samsung boot.img such as a signature that is causing this to fail?
Click to expand...
Click to collapse
TBM 13 said:
Did you unlocked the bootloader?
Also i would recommend you to use a custom recovery like TWRP to flash boot.img
Click to expand...
Click to collapse
Which.... does not exist. J2 Core doesnt get the same love.
I recommend Android Image Kitchen (AIK) by Osmosis. Havent failed me once in my case.

Prove N. said:
Which.... does not exist. J2 Core doesnt get the same love.
Click to expand...
Click to collapse
I'm sorry, my bad.

has anyone tried to port the 9 pie firmware from J260A to other J260F/M/G?

Related

JRO03C (GSM) [OTA] unsecured boot.img to insecure: (FBoot)

Hey!
I don't know is there posted the insecure boot image file to make "unsecured boot.img" (JRO03C) to "insecure" so I gonna post it here if somebody needs it: (just extract it from the .zip file and flash it via Fastboot/toolkit/.. ADB?..)
So you have to flash this via "Fastboot/toolkit" (for stock JRO03C..)
If you want you can test it does it work on your Nexus if you are using Jelly Bean:
To test the insecure boot image "rooted.img" then write this to fastboot:
fastboot boot rooted.img
To Flash it to phone then just write this..:
fastboot flash boot rooted.img
I always flash image files (.IMG) via Fastboot so others who uses toolkit then it can be flashed with that too..
So the "rooted.img" does not include any kernel, it just includes the ramdisk files and I edited the default.prop to make it to insecured. All other files are stock files in this .img file, "only default.prop is edited".
Test this before you flash this! if you need I can give you the boot.img with the kernel but it is unsecured so then you can't use some commands via ADB..
When you flash this then it replaces the ramdisk files...
Flash this at your own risk if you want to flash this...
This was just what I was looking for to follow these manual root instructions. I prefer doing it this way to better understand each step of the process. Much appreciated for providing the unsecured boot image!
If you have time, would you describe how you create the unsecured boot image to begin with? Or simply link some of the resources you used to learn?
Thanks again!
Idoiocracy said:
This was just what I was looking for to follow these manual root instructions. I prefer doing it this way to better understand each step of the process. Much appreciated for providing the unsecured boot image!
If you have time, would you describe how you create the unsecured boot image to begin with? Or simply link some of the resources you used to learn?
Thanks again!
Click to expand...
Click to collapse
Sorry I didn't notice your reply before..
I followed this instruction: http://www.mydroidworld.com/topic/9778-how-to-create-an-insecure-boot-image/
My guide: http://www.jetdroid.org/forum/viewtopic.php?f=11&t=8005

rooting ( after unlocking bootloader)

So after you unlocked the boot loader ( see my previous post)
you can start rooting with magisk manager / patching the boot.img from the original firmware
I used this thread in order to get root ; i modified the contents so it would fit the moto phone a bit better:, but thnx goes to Ibolito over at the pixel 3 forums
1 ) Download the latest Android factory image for your device ("see this guide on where to find it.
2 ) Extract the "boot.img" file from the downloaded image and copy it to your phone.
Warning! Make absolutely sure the firmware is exactly the same as the installed one. If not, you might loose touch.
Be aware that LMSA will download the latest firmware, even if it is not yet installed. That might break your touchscreen
Click to expand...
Click to collapse
3 ) Download latest Magisk Manager application on your phone and install it :
Link
4 )Press on the Install Magisk button (the one on the top, not the Magisk Manager), then Install > Select and Patch a File and now select the Boot.img file you extracted earlier. When the process is done, just put the patched boot.img file on your computer in the same folder as your ADB and FASTBOOT tools, the file's name is magisk_patched.img
edit: i received a comment that the name might be something like Magisk_patched_somerandomletters_.img since the latest magisk update
5 ) Enable adb debugging on your phone and connect it to your computer via USB.
Open a command prompt on your computer and migrate to the folder where the ADB and Fastboot tools are located.
(for exemple, for me it's : cd C:\adb).
7 ) Reboot your phone to fastboot by typing adb reboot bootloader
8 ) Flash the Boot.img you just patched with magisk by typing fastboot flash boot magisk_patched.img
extra: You could test a single boot with that image by typing "fastboot boot magisk_patched.img"
if it boots fine you should have root for this single boot / magisk would show as installed.
9 ) When it's done, reboot by typing fastboot reboot
10 ) Open your Magisk Manager app and check if everything is good, and it should be
extra info:
I did worry a bit because the original boot.img is 64 megs , while the patched version is only 12
but i went with it, and it was fine.
good luck to you all
Edit: rewritten entire post so it would look more like a guide, and extra warning because a lot of people seem to loose touch if they don't have the exact same firmware downloaded as on their phone.
Thanks for posting this. I unlocked my bootloader and would like to root like you did.
Do you install magisk first on your phone, then get the magisk_patched file from your phone? Or is the magisk_patched file obtained somewhere else?
testtubebaby said:
Thanks for posting this. I unlocked my bootloader and would like to root like you did.
Do you install magisk first on your phone, then get the magisk_patched file from your phone? Or is the magisk_patched file obtained somewhere else?
Click to expand...
Click to collapse
You need to install the magisk manager
In magisk manager you can click on "install (magisk)"--> "by patching a file"
then you select the file to be patched ( extracted from the original rom )
after that you can copy the patched file from your phone back to the pc and install it via fastboot.
After that magisk is installed
i hope you succeed
pjottrr said:
You need to install the magisk manager
In magisk manager you can click on "install (magisk)"--> "by patching a file"
then you select the file to be patched ( extracted from the original rom )
after that you can copy the patched file from your phone back to the pc and install it via fastboot.
After that magisk is installed
i hope you succeed
Click to expand...
Click to collapse
The firmware I see is the EU firmware. I don't see the GB firmware in the link you posted (it's RETGB). Any idea where I can find the correct firmware?
Sorry, no idea, i found the provided link via google,
testtubebaby said:
The firmware I see is the EU firmware. I don't see the GB firmware in the link you posted (it's RETGB). Any idea where I can find the correct firmware?
Click to expand...
Click to collapse
https://mirrors.lolinet.com/firmware/moto/sofiar/official/
zuggi_m said:
https://mirrors.lolinet.com/firmware/moto/sofiar/official/
Click to expand...
Click to collapse
@zuggi_m , how does posting the same url help?
i don't see a retgb here ....
Maybe someone with more dev experience can tell if you need the exact same firmware or if the version numbers are the same it is ok to use that file ?
No fastbootd?
One Hyper needs fastbootd in order to flash boot and root
mingkee said:
No fastbootd?
One Hyper needs fastbootd in order to flash boot and root
Click to expand...
Click to collapse
i don't really understand the question i guess,
a magisk patched boot is flashed via fastboot. after that you have magisk installed and root access.
pjottrr said:
i don't really understand the question i guess,
a magisk patched boot is flashed via fastboot. after that you have magisk installed and root access.
Click to expand...
Click to collapse
Yours should be G8 Power (9)
Native Android 10 uses fastbootd to flash boot, dtbo, and recovery
mingkee said:
Yours should be G8 Power (9)
Native Android 10 uses fastbootd to flash boot, dtbo, and recovery
Click to expand...
Click to collapse
maybe i'm missing your point here, my description is just so people who have to figure it out can just use my steps to get root, it is indeed based on fastboot flashing . so i'm not sure what you are trying to say, or am i misinterpreting something?
https://forum.xda-developers.com/motorola-one-hyper/development/rom-omnirom-t4044405
I did root on One Hyper (shipped with Android 10) using fastbootd method
Used old method soft brick my One Hyper
That's why I'd like to know
pjottrr said:
so after you unlocked the boot loader ( see my previous post)
you can start rooting with magisk manager / patching the boot.img from the original firmware
I used this thread in order to get root
you need to download the firmware for our device,
That can be found here;
https://mirrors.lolinet.com/firmware/moto/sofiar/official/RETEU/
after that, extract, patch, fastboot install patched version, done.
I did have some issues with the current magisk manager ( from highonandroid, i did find another source, installed version 7.5.1 of the magisk manager from this source
and that one was able to patch the boot.img
I did worry a bit because the original boot.img is 64 megs , while the patched version is only 12
but i went with it, and it was fine.
good luck to you all
Click to expand...
Click to collapse
There's a head up
US version: Sofia
The rest: Sofiar
I will buy US G Power in May and let's the fun begin
Check out One Hyper general to install Dolby Atmos and it can be toggle on/off.
Has anyone tried copying something to the root of the phone or making build.prop edits? I have the Stylus and have achieved root using the same method, however there is something not quite right with the permissions. I cannot make changes to any root files.
CCivale said:
Has anyone tried copying something to the root of the phone or making build.prop edits? I have the Stylus and have achieved root using the same method, however there is something not quite right with the permissions. I cannot make changes to any root files.
Click to expand...
Click to collapse
So you should know G Stylus ROM is Sofiap.
Be aware the way Android 10 flashing is different.
Download and install the latest ADB in order to access fastbootd (fastboot reboot fastboot) and flash boot, recovery, dtbo, vbmeta, and super
Hmmmm, I will have to read more about fastbootd in your other thread.
I did use the boot.img for the sofiap.
Hello,
I followed all the instructions in the first post and was able unlock the bootloader, install magisk, and use it to make the magisk_patched.img file from a boot.img file.
The only variation, was that I got my boot.img file from mirrors.lolinet.com/firmware/moto/sofia/official/RETUS/XT2041-4_SOFIA_RETUS_10_QPM30.80-13-2_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip since my phone is a US retail model.
After flashing, the phone boots up properly but the touchscreen does not work.
The side buttons do work and I was able to reboot into recovery. In recovery, the build on the phone is indicated as QPM30.80-51. The build in the above indicated file is QPM30.80-13-2. Could this be the source of the problem?
I have tried flashing the original boot.img (from the file above) back and the touchscreen still does not work. I have also tried “wipe data/factory reset” in recovery.
hazd said:
Hello,
I followed all the instructions in the first post and was able unlock the bootloader, install magisk, and use it to make the magisk_patched.img file from a boot.img file.
The only variation, was that I got my boot.img file from mirrors.lolinet.com/firmware/moto/sofia/official/RETUS/XT2041-4_SOFIA_RETUS_10_QPM30.80-13-2_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip since my phone is a US retail model.
After flashing, the phone boots up properly but the touchscreen does not work.
The side buttons do work and I was able to reboot into recovery. In recovery, the build on the phone is indicated as QPM30.80-51. The build in the above indicated file is QPM30.80-13-2. Could this be the source of the problem?
I have tried flashing the original boot.img (from the file above) back and the touchscreen still does not work. I have also tried “wipe data/factory reset” in recovery.
Click to expand...
Click to collapse
maybe try with the "correct" firmware? ( not sure if the minor diference changes anything, but you could try....
i found it here:
https://rsdsecure-cloud.motorola.co...ubsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
pjottrr said:
maybe try with the "correct" firmware? ( not sure if the minor diference changes anything, but you could try....
i found it here:
rsdsecure-cloud.motorola.com/download/SOFIA_RETAIL_QPM30.80-51_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
Click to expand...
Click to collapse
Thanks for finding this link.
Unfortunately i am not able to download this for some reason. I get an access denied error message.
edit:
I was able to find the most recent firmware here:
github.com/AndroidDumps/motorola_sofia_dump/tree/sofia_retail-user-10-QPM30.80-51-bd0b4-release-keys
I downloaded just the boot.img file and flashed it. That fixed the touchscreen issue. I then used magisk to batch the boot.img and I now have root.
Just to be clear, this worked on a US retail moto g power purchased unlocked from best buy. The phone model number is XT2041-4.
Hope this helps.
hazd said:
Thanks for finding this link.
Unfortunately i am not able to download this for some reason. I get an access denied error message.
edit:
I was able to find the most recent firmware here:
github.com/AndroidDumps/motorola_sofia_dump/tree/sofia_retail-user-10-QPM30.80-51-bd0b4-release-keys
I downloaded just the boot.img file and flashed it. That fixed the touchscreen issue. I then used magisk to batch the boot.img and I now have root.
Just to be clear, this worked on a US retail moto g power purchased unlocked from best buy. The phone model number is XT2041-4.
Hope this helps.
Click to expand...
Click to collapse
I downloaded the kernel and waiting for the unit.
I can flash full ROM with fastboot and fastbootd, but just flashing kernel would be much faster.
Moreover, check One Hyper general to get Dolby Atmos because you can turn on and off anytime you want.

How Can I modify an APK in Stock ROM (Fastboot) and Flash It?

Hi everyone!
I need to edit an APK in stock ROM (system.img) of my device. I have unpacked system.img and repacked with some programs on Windows. But When I unpack and repack the system.img file and change it with original system.img file (even though I didn't change any APK or anything), I can flash it through fastboot or port 9008 successfully. BUT When I try to start my phone, It stuck on MI Logo screen.
So There is no problem with flash any rom. But I want to unpack rom and edit an APK then repack it. This is my issue. How can I do it? I think there is a problem on unpack/repack step. I'll be glad if anyone can help me about it.
Thanks in advance!
p.s. I can't flash a recovery rom because of I can't run phone.

Question Please I need a boot.img from 12.5.6.0. RKHEUXM Global necessarily

I need a boot.img necessarily from 12.5.6.0.RKHEUXM GLOBAL.
Nowhere is this version of ROM in FastBoot format to download.
I need extract boot.img to magisk root.
I have an installed version of 12.5.6.0.
But I mistake I flash boot.img from version 12.5.3.0. , and now I have a broken system, it's not sound,wi-fi, etc.
Thanks very much
Hi. I used the boot.img from the 12.5.6 "Stable Beta" released a few weeks ago. I read somehere, here, that it is the same built as the one released over OTA a couple of days ago. And so far it's working fine. I have wifi and sound.
It is a recovery file, but you can unzip it and then use a payload dumper tool to extract the boot.img.
The recovery: https://xiaomifirmwareupdater.com/miui/alioth/stable beta/V12.5.6.0.RKHEUXM/
And this tool on my Mac: https://github.com/ssut/payload-dumper-go/releases/tag/1.0.0
kurtschmeichel said:
Hi. I used the boot.img from the 12.5.6 "Stable Beta" released a few weeks ago. I read somehere, here, that it is the same built as the one released over OTA a couple of days ago. And so far it's working fine. I have wifi and sound.
It is a recovery file, but you can unzip it and then use a payload dumper tool to extract the boot.img.
The recovery: https://xiaomifirmwareupdater.com/miui/alioth/stable beta/V12.5.6.0.RKHEUXM/
And this tool on my Mac: https://github.com/ssut/payload-dumper-go/releases/tag/1.0.0
Click to expand...
Click to collapse
If I may go off-topic for a question, recovery files are to be flashed in recovery? fastboot files in fastboot mode? hope you can help enlighten me.
I dont need recovery type rom , there is not after unzip the boot. img.
I need fastboot type rom, there is boot. img after unzip.
Thanks
I must flash boot.img over magisk, not twrp!
Please read my previous post again.
You can get a boot.img from the recovery file!
kurtschmeichel said:
Please read my previous post again.
You can get a boot.img from the recovery file!
Click to expand...
Click to collapse
Thanks very much I'll try it.
So far I have tried to extract boot.img from China V12.5.6.0.RKHCNXM Fastboot TYPE, I flashed it via magisk and everything works fine.
If everything works OK, then it's fine
When the official 12.5.6.0.RKHEUXM is published, you can still patch and flash its boot.img again, in order to be sure you have the right one. I will do it.
Or just wait for the Android 12 update.
kurtschmeichel said:
If everything works OK, then it's fine
When the official 12.5.6.0.RKHEUXM is published, you can still patch and flash its boot.img again, in order to be sure you have the right one. I will do it.
Or just wait for the Android 12 update.
Click to expand...
Click to collapse
;-)
To complete this thread, here is how I extracted the boot.img from the recovery file:
- Download the recovery file from here: https://xiaomifirmwareupdater.com/miui/alioth/stable beta/V12.5.6.0.RKHEUXM/
- Unzip it, you will find a payload.bin file inside.
- Download this command line tool for your platform, I used it on my Mac: https://github.com/ssut/payload-dumper-go/releases
- Unpack it and put the binary inside the folder of the unpacked recovery, next to the payload.bin file
- Run the command : ./payload-dumper-go payload.bin
- Let it do its thing and you will find a series of .img files, one will be boot.img
Credits: https://forum.xda-developers.com/t/tool-a-quick-android-ota-payload-dumper.4173271/

Initial Installation of Magisk v24 - patch boot.img

Hey guys, has someone ever installed Magisk v24 by using this Guide:
I have shortened it in the way that I think it's right, NOT TESTED YET
Can anyone with the knowledge about this "proof read it"?
############################################
Get a copy of the boot.img.
You should be able to extract the file you need from official firmware packages or your custom ROM zip.
Next, we need to know whether your device has a separate vbmeta partition.
If your official firmware package contains vbmeta.img, then yes, your device has a separate vbmeta partition
You can also check by connecting your device to a PC and run the command:
adb shell ls -l /dev/block/by-name
If you find vbmeta, vbmeta_a, or vbmeta_b, then yes, your device has a separate vbmeta partition
Otherwise, your device does not have a separate vbmeta partition.
Quick recap, at this point, you should have known and prepared:
Whether your device has boot ramdisk
Whether your device has a separate vbmeta partition
A boot.img or recovery.img based on (1)
Let’s continue to Patching Images.
Patching Images​
Copy the boot image to your device
Press the Install button in the Magisk card
Choose “Select and Patch a File” in method, and select the boot image
Start the installation, and copy the patched image to your PC using ADB:
Code:
adb pull /sdcard/Download/magisk_patched_[random_strings].img
Flash the patched boot image to your device.
For most devices, reboot into fastboot mode and flash with command:
Flash the patched boot image to your device.
For most devices, reboot into fastboot mode and flash with command:
Code:
fastboot flash boot /path/to/magisk_patched.img
(Optional) If your device has a separate vbmeta partition, you can patch the vbmeta partition with command:
Code:
fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img
Reboot and voila!
Uninstallation​The easiest way to uninstall Magisk is directly through the Magisk app. If you insist on using custom recoveries, rename the Magisk APK to uninstall.zip and flash it like any other ordinary flashable zip.
Best, dj
derjango said:
Hey ...
Click to expand...
Click to collapse
Why people look for troubles ?
That guide is for people who don't have custom recovery
it's a long process and some people will make mistakes
renaming to zip and flash in recovery is the easiest way
also with patching img way you will not have a magisk folder in data/adb and magisk will tell you that the install is not complete and probably will need couple of reboots to work ...
To be honest, my trouble is, that the Magisk App does not work properly and I'm searching the reason for that.
It says:
Magsik:
Installed: N/A
Zygisk: No
Ramdisk: No
In the bottomline Superuser is inactive as well as Modules.
How can I fix this?
I've installed Magisk.zip via TWRP, Root Checker tells me that Root is not installed properly
Best, dj
/edit
got it, I had to install it after booting into rom, not directly after flash ROM
derjango said:
In the bottomline Superuser is inactive as well as Modules.
/edit
got it, I had to install it after booting into rom, not directly after flash ROM
Click to expand...
Click to collapse
Hey brother, I've been searching high and low for this problem and got excited seeing your post.
Care to elaborate on how you managed to solve the inactive SU & Modules sections problem?
loopypalm said:
Why people look for troubles ?
That guide is for people who don't have custom recovery
it's a long process and some people will make mistakes
renaming to zip and flash in recovery is the easiest way
also with patching img way you will not have a magisk folder in data/adb and magisk will tell you that the install is not complete and probably will need couple of reboots to work ...
Click to expand...
Click to collapse
I tried doing that with lineage but it stopped internet working
Nebster7 said:
I tried doing that with lineage but it stopped internet working
Click to expand...
Click to collapse
i used .ZIP method on over than 200 rom (including lineage builds) and never had such problem
maybe in new magisk builds ? or miui based rom ?
Done it now using boot_a and boot_b method https://www.getdroidtips.com/how-to-root-poco-x4-pro-5g/
Nebster7 said:
Done it now using boot_a and boot_b method https://www.getdroidtips.com/how-to-root-poco-x4-pro-5g/
Click to expand...
Click to collapse
so you look on how to root "Poco X4 Pro 5G" on "redmi note 8" forums ?

Categories

Resources