I found this tool that runs under Windows for extracting the Oreo system.img. Just put the system image into the program folder and run the convert.bat. The result is a system.ext4.img with could be opened and extracted with 7zip. You could also convert every other image like cust.img, boot.img, etc. But you have to rename every image to system.img. The convert.bat only works with this name.
Regards
You can just open a command prompt in the same folder as simg2img.exe and run:
simg2img.exe input_sparse.img raw_output.img
Then you can either use the included Ext2Explorer, or extract it using 7zip (this will not keep permissions/ownership).
You can not convert boot/recovery/ramdisk using this. Use Android Image Kitchen for that.
ante0 said:
You can just open a command prompt in the same folder as simg2img.exe and run:
simg2img.exe input_sparse.img raw_output.img
Then you can either use the included Ext2Explorer, or extract it using 7zip (this will not keep permissions/ownership).
You can not convert boot/recovery/ramdisk using this. Use Android Image Kitchen for that.
Click to expand...
Click to collapse
But cust.img worked without problems. Thought it works for every image from the firmware.
Coredown said:
But cust.img worked without problems. Thought it works for every image from the firmware.
Click to expand...
Click to collapse
system, vendor, cust, product, odm and version will convert fine.
For ramdisk/kernel/recovery partitions you need to use Android Image Kitchen as they're not sparse images.
ante0 said:
system, vendor, cust, product, odm and version will convert fine.
For ramdisk/kernel/recovery partitions you need to use Android Image Kitchen as they're not sparse images.
Click to expand...
Click to collapse
Alright, thanks for the information. I will give it a try.
It doesn't work for android 9 .img
D:\convert>simg2img.exe system.img raw_output.img
Bad magic
Edit: I've just extracted system.img with 7 zip
It Finally worked
other methods only extracted apps!
Related
I know how to fastboot flash .img files and understand it includes the radio and kernel components. I'm rooted and have TWRP recovery. But which .img file contains the radio and which the kernel? I ask because I'll be going from the latest T-Mo rom (LYZ28J) to Project Fi having just received my sim. If I flash just the system.img from LYV48E (Fi rom) will I have the correct kernel and radio or will I have to flash boot.img also or something else? Since kernels and radios can be flashed separately I'm just not sure where everything comes from. I would appreciate some clarity.
Groid said:
I know how to fastboot flash .img files and understand it includes the radio and kernel components. I'm rooted and have TWRP recovery. But which .img file contains the radio and which the kernel? I ask because I'll be going from the latest T-Mo rom (LYZ28J) to Project Fi having just received my sim. If I flash just the system.img from LYV48E (Fi rom) will I have the correct kernel and radio or will I have to flash boot.img also or something else? Since kernels and radios can be flashed separately I'm just not sure where everything comes from. I would appreciate some clarity.
Click to expand...
Click to collapse
have you ever unzipped a factory.img .tar file to see what files it contains?
Groid said:
I know how to fastboot flash .img files and understand it includes the radio and kernel components. I'm rooted and have TWRP recovery. But which .img file contains the radio and which the kernel? I ask because I'll be going from the latest T-Mo rom (LYZ28J) to Project Fi having just received my sim. If I flash just the system.img from LYV48E (Fi rom) will I have the correct kernel and radio or will I have to flash boot.img also or something else? Since kernels and radios can be flashed separately I'm just not sure where everything comes from. I would appreciate some clarity.
Click to expand...
Click to collapse
simms22 said:
have you ever unzipped a factory.img .tar file to see what files it contains?
Click to expand...
Click to collapse
If I were a betting man, I'd be backing the horse called "Wish I'd done that before posting"
Tiptonian said:
If I were a betting man, I'd be backing the horse called "Wish I'd done that before posting"
Click to expand...
Click to collapse
Hahaa. Unzip and you shall receive. LMAO
simms22 said:
have you ever unzipped a factory.img .tar file to see what files it contains?
Click to expand...
Click to collapse
Not sure what you mean by this. I have the system, boot, recovery, and userdata .img files. I don't know which one has the kernel or which one has the radio. You imply I can unzip, for example, system.img to see what files are there, but I cannot unzip it or any of the .img files. My main question still is unanswered which is which .img files do I need to (m)fastboot flash to insure I have the correct (stock) kernel and radio for the Project Fi rom? I may just flash them all, flash TWRP, re-root and start clean, but I wanted to consider the option of keeping data. Any helpful answers?
Tiptonian said:
If I were a betting man, I'd be backing the horse called "Wish I'd done that before posting"
Click to expand...
Click to collapse
prdog1 said:
Hahaa. Unzip and you shall receive. LMAO
Click to expand...
Click to collapse
So glad my post was such a source of amusement for you. Sorry I didn't make it clear I know how download factory images, unzip the .tgz file to get the .tar file. Unzip the .tar file to get to the .zip file. Unzip the .zip file to get the boot, recovery, system, and userdata .img files. But no one actually tried to answer my question.
Groid said:
So glad my post was such a source of amusement for you. Sorry I didn't make it clear I know how download factory images, unzip the .tgz file to get the .tar file. Unzip the .tar file to get to the .zip file. Unzip the .zip file to get the boot, recovery, system, and userdata .img files. But no one actually tried to answer my question.
Click to expand...
Click to collapse
kernel is boot.img, radio is radio.img
Thank you for your reply. I suspected boot.img is the kernel but wanted to make sure. I notice that the radio-shamu-. . .02.78.02.img and boot-shamu. . .71.10.img are in the shamu-lvy48e folder in the .tar file with the flash batch files. The enclosed .zip file has the system, boot, userdata, recovery, and cache .img files along with the text file specifying the bootloader (kernel) and baseband (radio). I now understand that the boot.img is the kernel which is the same version my current one in LYZ28J, so I need not flash it. The radio is different based on the android-info.txt file. So, the last piece of the puzzle for me is will I get the updated radio by flashing the system.img or must I separately flash the radio-shamu -. . .-02.78.02.img?
Groid said:
Thank you for your reply. I suspected boot.img is the kernel but wanted to make sure. I notice that the radio-shamu-. . .02.78.02.img and boot-shamu. . .71.10.img are in the shamu-lvy42e folder in the .tar file with the flash batch files. The enclosed .zip file has the system, boot, userdata, recovery, and cache .img files along with the text file specifying the bootloader (kernel) and baseband (radio). I now understand that the boot.img is the kernel which is the same version my current one in LYZ28J, so I need not flash it. The radio is different based on the android-info.txt file. So, the last piece of the puzzle for me is will I get the updated radio by flashing the system.img or must I separately flash the radio-shamu -. . .-02.78.02.img?
Click to expand...
Click to collapse
youll get the updated radio in the factory.img, but you can always flash the radio itsrlf via fastboot(fastboot flash radio radioname.img).
Groid said:
Thank you for your reply. I suspected boot.img is the kernel but wanted to make sure. I notice that the radio-shamu-. . .02.78.02.img and boot-shamu. . .71.10.img are in the shamu-lvy48e folder in the .tar file with the flash batch files. The enclosed .zip file has the system, boot, userdata, recovery, and cache .img files along with the text file specifying the bootloader (kernel) and baseband (radio). I now understand that the boot.img is the kernel which is the same version my current one in LYZ28J, so I need not flash it. The radio is different based on the android-info.txt file. So, the last piece of the puzzle for me is will I get the updated radio by flashing the system.img or must I separately flash the radio-shamu -. . .-02.78.02.img?
Click to expand...
Click to collapse
If have updated SDK will get everything in flash-all.bat. If not and have to do all separate they are all separate. Bootloader, radio, boot, system, cache, userdata. There is no radio in system.img. It is the radio. img. On first unzip get bootloader, radio, flash-all and the folder for the rest of the images. If want radio fastboot flash radio (radio.img).
Thank you for answering my question about whether or not the radio gets updated by flashing system.img. Unfortunately, I cannot get ADB to work properly. I initially seem to have it working with the ADB devices statement from the command prompt, it returns the serial #, but when I try to execute the batch file ADB seems to be disconnected. At least I have experience with (m)fastboot and will just flash the radio and system .imgs since the bootloader is the same. I'll keep TWRP recovery, format cache, update supersu for root and I should be good to go.
Groid said:
Thank you for answering my question about whether or not the radio gets updated by flashing system.img. Unfortunately, I cannot get ADB to work properly. I initially seem to have it working with the ADB devices statement from the command prompt, it returns the serial #, but when I try to execute the batch file ADB seems to be disconnected. At least I have experience with (m)fastboot and will just flash the radio and system .imgs since the bootloader is the same. I'll keep TWRP recovery, format cache, update supersu for root and I should be good to go.
Click to expand...
Click to collapse
well, adb doesnt work in the bootloader, and its only fastboot that can flash those files..
Thanks, I was responding to using adb to sideload with the flash(all).bat. Fastboot works fine for me so I don't really miss using adb commands.
hi guys, all custom roms are flashable. how can i fastboot flash the system partition of any custom rom, lile aicp or others? is that possible someway? tia!
I believe unpacking the system.new.dat from a ROM zip gives you a system.img, which I can only assume is fastboot flashable with fastboot command
can't open the .dat file as archive here with 7zip how could I unpack it?
EDIT: I see now you said "unpack" not uncompress... googling for that now!
FcukBloat said:
can't open the .dat file as archive here with 7zip how could I unpack it?
EDIT: I see now you said "unpack" not uncompress... googling for that now!
Click to expand...
Click to collapse
you can extract your system.new.dat by following this guide
thanks both! I suceeded in installing aicp's system image via fastboot after unpacking system.new.dat with a tool found on xda similar to the one you linked
thanks again!
Hi all, I want to clean install stock rom via fastboot. I used to do this on my oneplus one a while back. I think that I need to install img files to five partitions (boot.img, recovery.img, system.img, userdata.img and cache.img). Are there any other files that need to installed (eg bin or mbn files)?
I think I should be able to get the img files by unzipping the stock rom files. Has anyone tried to get the img files from unzipped stock rom and install via fastboot?
Any help is greatly appreciated.
Thanks
Don't know exactly, but also interested to learn about this!
OnePlus does not provide fastboot flashable roms, the only way to get them would be to update uusing the recovery first and extracting the .img files afterwards, but then you don't need them anymore since you are already upgraded.
Jo_Jo_2000 said:
OnePlus does not provide fastboot flashable roms, the only way to get them would be to update uusing the recovery first and extracting the .img files afterwards, but then you don't need them anymore since you are already upgraded.
Click to expand...
Click to collapse
The system.new.dat format is not unique to oneplus, but the standard for flashable android zips since version 6 (aka marshmellow). The system.new.dat, system.patch.dat and system.transfare.list are build from system.img while building a rom (aka compile rom from source). This process is NOT unidirectional; you can easily revert it. I'm on linux, so you have to google, how this is accomblished on win or darwin. For linux users:
https://github.com/xpirt/sdat2img
Hey there everyone! Seeing as there's not a publicly released 9.0.6 Fastboot only ROM for the T-Mobile variant users, I've taken the liberty to package something up for you!
This tool includes the most recent fastboot for Windows, Linux, and Mac.
Please do not unzip the images.zip file, as it will be done by the tool automatically!
This tool can be used to correct a soft brick (as long as you can get into fastboot you can fix it!), as well as simply flash the International Variant to both the T-Mobile version, as well as the International model.
You must be in fastboot mode prior to running these scripts!
On Windows:
Simply unzip the zip and double click the windows-flash-all-partitions.bat file.
Wait for the images.zip file to finish extracting. (This requires powershell, if you don't have it, unzip the images.zip file to the images directory)
You will be prompted with the option to format your device. Type Y or y for Yes, N or n for No.
Fastboot will begin flashing the partitions for you!
Your device will reboot at the end.
On Linux:
Simply unzip the zip and then cd to the directory with your console.
Ensure you have the unzip command available. If you don't, for some reason, unzip the images.zip file to the images directory.
cd to the unzipped folder and run the following command: sudo ./linux-flash-all-partitions.sh
You will be prompted with the option to format your device. You can type the following: Y,y for Yes, N,n for no.
Fastboot will begin flashing the partitions for you!
Your device will reboot at the end!
For Mac Users: (Console/Terminal Use)
Simply unzip the zip and then cd to the directory with your console.
Ensure you have the unzip command available. If you don't, for some reason, unzip the images.zip file to the images directory.
Run the following command: sudo ./mac-flash-all-partitions.sh
You will be prompted with the option to format your device. You can type the following: Y,y for Yes, N,n for no.
Fastboot will begin flashing the partitions for you!
Your device will reboot at the end!
Upgrading from 9.0.5 should not require a data wipe, but your mileage may vary.
This does not touch any critical partitions, nor does it even try to.
While this should work for the International version as well, it does not flash any critical partitions.
Google Drive Link v1.1: https://drive.google.com/open?id=1oGMQ80He9ORD2yT7jEeOtvUPvRa4U9h_
Of course, let me know if you have any trouble!
Dameon87 said:
Hey there everyone! Seeing as there's not a publicly released 9.0.6 Fastboot only ROM for the T-Mobile variant users, I've taken the liberty to package something up for you!
This tool includes the most recent fastboot for both Windows and Linux.
Please do not unzip the images.zip file, as it will be done by the tool automatically!
On Windows:
* Simply unzip the zip and double click the windows-flash-all-partitions.bat file.
* Wait for the images.zip file to finish extracting. (This requires powershell, if you don't have it, unzip the images.zip file to the images directory)
* You will be prompted with the option to format your device. Type Y or y for Yes, N or n for No.
* Fastboot will begin flashing the partitions for you!
* Your device will reboot at the end.
On Linux:
* Simply unzip the zip and then cd to the directory with your console.
* Ensure you have the unzip command available. If you don't, for some reason, unzip the images.zip file to the images directory.
* run the following command: sudo ./linux-flash-all-partitions.sh
* You will be prompted with the option to format your device. You can type the following: Y,y for Yes, N,n for no.
* Fastboot will begin flashing the partitions for you!
* Your device will reboot at the end!
Upgrading from 9.0.5 should not require a data wipe, but your mileage may vary.
This does not touch any critical partitions, nor does it even try to.
While this should work for the International version as well, it does not flash any critical partitions.
Google Drive Link: https://drive.google.com/file/d/1ii59cmGVUcohZAiJB47fKoJQyikJVaLR/view?usp=sharing
Of course, let me know if you have any trouble!
Click to expand...
Click to collapse
Says TMO. Is this the t-mobile rom?
lollyjay said:
Says TMO. Is this the t-mobile rom?
Click to expand...
Click to collapse
No, it the international version! Sorry!
Dameon87 said:
No, it the international version! Sorry!
Click to expand...
Click to collapse
Thanks you might want to rename it to avoid any confusion
Sent from my crosshatch using XDA Labs
lollyjay said:
Thanks you might want to rename it to avoid any confusion
Sent from my crosshatch using XDA Labs
Click to expand...
Click to collapse
Already done!
So can I follow this to flash 9.0.6 on my TMobile 9.0 version? I just received the unlock bin.
Sent from my ONEPLUS A6013 using Tapatalk
Have tmobile purchased phone. unlocked of course and already running 9.0.5 international rom with no issues.
I am rooted with magisk.
when updating from 9.0.5 to 9.0.6 do I need to do any prep work? Uninstall magisk first?
OR just do what's in the OP and choose not to wipe?
raing said:
Have tmobile purchased phone. unlocked of course and already running 9.0.5 international rom with no issues.
I am rooted with magisk.
when updating from 9.0.5 to 9.0.6 do I need to do any prep work? Uninstall magisk first?
OR just do what's in the OP and choose not to wipe?
Click to expand...
Click to collapse
As long as you don't have any magisk modules that are known to bootloop when uninstalled (The Always on Display one will do this), you should be just fine! I was rooted with Magisk and upgraded to 9.0.6 without a wipe just fine.
Of course afterwards you will need to root again!
_nkay_ said:
So can I follow this to flash 9.0.6 on my TMobile 9.0 version? I just received the unlock bin.
Sent from my ONEPLUS A6013 using Tapatalk
Click to expand...
Click to collapse
Yes. After you unlock your bootloader you can use this to flash 9.0.6 to your device. You will -need- to wipe, though. So when the question is prompted to format your device, type Y.
@DaeMon87 your instructions say if you do not have power shell, I am on windows 7, so extract the image to the working adb folder?
Some strange reason didnt work for me. im on 9.0.5 right now..
phillymade said:
@DaeMon87 your instructions say if you do not have power shell, I am on windows 7, so extract the image to the working adb folder?
Click to expand...
Click to collapse
Windows 7 has powershell I believe. Try running the bat file. It's safe. It literally won't let you continue if the files don't exist.
djhotsauce said:
Some strange reason didnt work for me. im on 9.0.5 right now..
Click to expand...
Click to collapse
Gimme 5. When I made a find/replace I accidentally deleted a part of each command! Sorry about that! I'll upload an updated bat here in a min for you.
Updated Tools attached to post.
Dameon87 said:
Gimme 5. When I made a find/replace I accidentally deleted a part of each command! Sorry about that! I'll upload an updated bat here in a min for you.
Updated Tools attached to post.
Click to expand...
Click to collapse
fastboot: error: cannot load 'images/vbmeta.img': No such file or directory
fastboot: error: cannot load 'images/vbmeta.img': No such file or directory
fastboot: error: cannot load 'images/vendor.img': No such file or directory
fastboot: error: cannot load 'images/vendor.img': No such file or directory
still getting two errors
***nevermind i just got the file from the .zip.***
djhotsauce said:
fastboot: error: cannot load 'images/vbmeta.img': No such file or directory
fastboot: error: cannot load 'images/vbmeta.img': No such file or directory
fastboot: error: cannot load 'images/vendor.img': No such file or directory
fastboot: error: cannot load 'images/vendor.img': No such file or directory
still getting two errors
Click to expand...
Click to collapse
Likely those files were not properly unzipped. Try extracting them directly from images.zip and putting them into the images directory.
Dameon87 said:
Windows 7 has powershell I believe. Try running the bat file. It's safe. It literally won't let you continue if the files don't exist.
Click to expand...
Click to collapse
How do I force the .bat file to load in powershell rather than cmd. I am on Windows 10 so I know I have powershell just not familiar with it. Second question, since I used the OnePlus one rooter before to install magisk can I use that again or do I have to do it the old fashioned way ? Thank you for putting this together by the way!
OP updated with a new copy of the files including the mac version and the fixes for the flashing files.
feezler said:
How do I force the .bat file to load in powershell rather than cmd. I am on Windows 10 so I know I have powershell just not familiar with it. Second question, since I used the OnePlus one rooter before to install magisk can I use that again or do I have to do it the old fashioned way ? Thank you for putting this together by the way!
Click to expand...
Click to collapse
You don't need to! Just double click the .bat file. It simply runs the unzip command in powershell to avoid having to package anything else in the zip.
However, if you haven't grabbed the fixed bat file from the OP, please do so!
As for the OnePlus rooter, you can just use it again
Dameon87 said:
OP updated with a new copy of the files including the mac version and the fixes for the flashing files.
Click to expand...
Click to collapse
Does the google drive link have the updated tools? Or should users also download the updated tools?
Sent from my crosshatch using XDA Labs
Dameon87 said:
You don't need to! Just double click the .bat file. It simply runs the unzip command in powershell to avoid having to package anything else in the zip.
However, if you haven't grabbed the fixed bat file from the OP, please do so!
As for the OnePlus rooter, you can just use it again
Click to expand...
Click to collapse
Fantastic! I will give this a shot tonight ...fingers crossed!
I easily flash any roms via twrp, but recently some rom come with payload.bin inside the zip. I cant manage to flash it via twrp, it ends up with error with zip format?
I saw a thread that mentions to unpack the payload.bin and put all unpacked files into fastboot folder, then fastboot these files separately.
Is there any way to make it as easy as it used to.
stevedat said:
I easily flash any roms via twrp, but recently some rom come with payload.bin inside the zip. I cant manage to flash it via twrp, it ends up with error with zip format?
I saw a thread that mentions to unpack the payload.bin and put all unpacked files into fastboot folder, then fastboot these files separately.
Is there any way to make it as easy as it used to.
Click to expand...
Click to collapse
Actually. Its not that hard the using the fastboot version. You will just extract the file then run the batch file. Then wait to finish. Better than ota. Retain my data.
Identity77 said:
Actually. Its not that hard the using the fastboot version. You will just extract the file then run the batch file. Then wait to finish. Better than ota. Retain my data.
Click to expand...
Click to collapse
You mean that if I come from other Rom, just wipe all in twro, then flash it by using batch file and just connected the phone to pc as fastboot mode.
stevedat said:
You mean that if I come from other Rom, just wipe all in twro, then flash it by using batch file and just connected the phone to pc as fastboot mode.
Click to expand...
Click to collapse
I Didnt try with other rom. It has the a and b thing. I got problem with ota because im rooted with magisk. Got into bootlloop. This fastboot thing saves me. And i was able to upgrade to latest.