Hi there, I recently started again playing with custom roms and I needed to extract official UPDATE.APP files in Linux. Here there is a perl script to extract and verify imgs from update packages.
How To Use
Code:
# copy splitupdate, crc and UPDATE.APP files
chmod +x splitupdate
chmod +x crc
./splitupdate UPDATE.APP
Sources/Download
The tool has been forked from JoeyJiao and available at https://github.com/marcominetti/split_updata.pl.
Windows GUI
If you prefer to use a GUI, you can use the excellent Huawei Update Extractor from @worstenbrood (http://forum.xda-developers.com/showthread.php?t=2433454).
As usual, you use it at your own risk.
Reserved.
AFAIK there is official Huawei Extract Tool available...
trurl3 said:
AFAIK there is official Huawei Extract Tool available...
Click to expand...
Click to collapse
Can you provide a link for reference? Thanks!
marco.minetti said:
Can you provide a link for reference? Thanks!
Click to expand...
Click to collapse
I am sorry - I was mistaken.
hi i would like to know how to open .img after that i mean for system etc... thank you!
desalesouche said:
hi i would like to know how to open .img after that i mean for system etc... thank you!
Click to expand...
Click to collapse
You have to mount and extract the system.img in linux with sim2img. It's complicated.
ajsmsg78 said:
You have to mount and extract the system.img in linux with sim2img. It's complicated.
Click to expand...
Click to collapse
i already found how to do it properly,notcomplicated at all, i will provide how-to asap provided by @Blefish( i am actually in two weeks holidays...so some patience is needed).
desalesouche said:
i already found how to do it properly,notcomplicated at all, i will provide how-to asap provided by @Blefish( i am actually in two weeks holidays...so some patience is needed).
Click to expand...
Click to collapse
Well, I meant complicated for the average user but I guess you're not the average user then
desalesouche said:
i already found how to do it properly,notcomplicated at all, i will provide how-to asap provided by @Blefish( i am actually in two weeks holidays...so some patience is needed).
Click to expand...
Click to collapse
here is how-to:
I was able to use simg2img like this:
simg2img SYSTEM.img SYSTEM.img_raw
Then you can do
sudo mkdir /media/<username>/temp
and afterwards
sudo mount SYSTEM.img_raw /media/<username>/temp
open it via terminal such as
nautilus /media/<username>/temp
You should be able to copy out of the mounted directory.
You cannot make dirs and files in the mounted dir
But if there is a problem you can do
chown <username>:<username> /media/<username>/temp
I get the error message
Code:
extracting SHA256RSA (256.00B)...Unable to create SHA256RSA.img: No such file or directory
You're awesome. and... Perl?
Code:
./splitupdate UPDATE.APP
000000FE SHA256RSA 256.00B 2017.03.02 20.46.16
000000FE CRC 191.20KB 2017.03.02 20.46.16
F0FFFFFF CURVER 15.00B 2017.03.02 20.46.16
F1FFFFFF VERLIST 2.43KB 2017.03.02 20.46.16
00000000 EFI 17.00KB 2017.03.02 20.46.16
16000000 MODEMNVM_UPDATE 20.13MB 2017.03.02 20.46.16
19000000 SENSORHUB 416.44KB 2017.03.02 20.46.17
14000000 FW_HIFI 2.51MB 2017.03.02 20.46.17
0F000000 CUST 415.91MB 2017.03.02 20.46.17
extracting SYSTEM (2.36GB)...[B][COLOR="Red"]Negative length at ./splitupdate line 118.[/COLOR][/B]
What does it mean?
How to solve it?
Help me please
marco.minetti said:
Hi there, I recently started again playing with custom roms and I needed to extract official UPDATE.APP files in Linux. Here there is a perl script to extract and verify imgs from update packages.
How To Use
Code:
# copy splitupdate, crc and UPDATE.APP files
chmod +x splitupdate
chmod +x crc
./splitupdate UPDATE.APP
Sources/Download
The tool has been forked from JoeyJiao and available at https://github.com/marcominetti/split_updata.pl.
Windows GUI
If you prefer to use a GUI, you can use the excellent Huawei Update Extractor from @worstenbrood (http://forum.xda-developers.com/showthread.php?t=2433454).
As usual, you use it at your own risk.
Click to expand...
Click to collapse
Sorry for reviving this thread, but this tool has helped me a ton.
I was wondering, do you have a source for the crc binary, or happen to know where it came from?
I'm porting this to Android, well I have already, but that executable doesn't run on Android. It works great without it but would be nice if it actually checked checksum xD
This is awesome. Really grateful to what you've done. I always used to switch to Windows just for extracting the update app. Can't thank you enough.
I was trying to extract some UPDATE.APP files for the Huawei Ascend Y300, but all the files seem to be named "INPUT" leading to each file in ./output overwriting its predecessor. So I changed line 119 to
Code:
open(OUTFILE, ">$BASEPATH$fileType$fileLoc.img") or die "Unable to create $fileType.img: $!\n";
to have unique filenames. I'm sure there is a more elegant way to do that, maybe by checking whether the file already exists, but this was the quickest fix I could think of.
Now I only need a way to find out what these files are. Any hints how to do that? I found an old thread with a similar script that had another script that "guessed" the files, but everything is dead google docs links (those seem to be a pattern on dated android-related projects...).
Hey guys,
The script works and thank you for your job. However, I don't like Perl and I decided to re-write this tool from scratch using Rust (as an exercise).
The script that I made is multi-threaded, i.e. faster in the extraction, and specially it doesn't require so much memory. In fact, I have a computer with a small amount of memory and I couldn't use your script, because it uses too much RAM (e.g. when it extracts SYSTEM.img that is big).
The negative aspect of my script is that actually the error handling is weak, so for example I don't even check the crc of the extracted files. Btw, it should work, also if I'm not gonna take any responsability.
The script is open-source, thus you can change it as you wish, submitting pull requests or forking it.
Click here to be redirected on the github page, there is also a pre-compiled version for Linux 64 bit.
Helped me a lot actually, thank you!
Great work.
I tried: Huawei_MediaPad T1 8.0_Firmware_Android 4.3_EMUI 1.6.
OS: Sabayon Linux.
(Ottimo lavoro. Grazie!)
For me, it just gives a single file (input.img), because it tries to extract all files with the same name (each overwriting the last one). Tested with Huawei Y210D update.app
btw Rust version by Nrin does the same.
Related
There you go
http://www.lgmobiles.com/gsm/download/P920 V20B (Gingerbread Version).zip
To root the bin file (instructions based on the one here)
Requirements: WinHex, a Linux distro (VMs work fine), drivers and flasher.
Instructions
1. Extract and open LGP920AT-00-V20b-ESA-XXX-JAN-10-2012+0_AP.bin in WinHex or any other hex editor.
2. Use WinHex to dump the content from offset B80000 (hexadecimal) to the end (select B80000 as start block and 22ABFFFF as end block and copy it to a new file), and save the dump as system.img.
3. Copy the .img to your Linux distro. Place it in the desktop. Now open terminal, cd to Desktop and enter the following commands one by one:
sudo mkdir temp
sudo mount -o loop system.img temp
Click to expand...
Click to collapse
What this does is mount the img into the temp folder. However, the files are read only. To copy su and superuser.apk, download both file, place them in the Desktop and enter the following commands:
sudo cp superuser.apk temp/app
sudo cp su temp/bin
Click to expand...
Click to collapse
Now, you have to set permissions for su and superuser.apk.
cd temp/app
sudo chmod 0644 superuser.apk
cd
cd Desktop/temp/bin
sudo chmod 6755 su
Click to expand...
Click to collapse
To save the changes, enter this:
sudo umount temp
Click to expand...
Click to collapse
Now, copy image.img back to Windows or whichever environment you prefer.
4. Copy the contents of the img file in WinHex. Go back to the bin file in WinHex and remove any data from offset B80000 onwards. You should be left with offsets 0 to B7FFFF. Right click block B7FFFF, select clipboard data > paste and accept all the prompts. You can now save the .bin file.
5. Now, it's time to flash the .bin. Extract the drivers somewhere and install "LGUnitedMobileDriver_S497CA20_WHQL_ML_Ver_1.0 .exe" and "LGUnitedMobileDriver_S497MA20_WHQL_ML_Ver_1.0.exe". Then, extract the flasher to another location.
6. With the .bin and .fls (found in the zip file containing the .bin as well) in hand, turn your phone off and remove both SD and SIM cards.
MAKE A BACKUP BEFORE PROCEEDING. THIS PROCEDURE WIPES SYSTEM AND APPS. DATA SUCH AS MUSIC AND IMAGES WILL REMAIN INTACT.
Click to expand...
Click to collapse
7. Hold volume up button while inserting the usb cable. When your computer detects the phone, let go of the button.
8. Once the driver installs, run B_SmartFlashTool_Extern.exe, go to the ROM copy D/L tab
9. Select the .bin file under CP bin and the .fls file under AP .bin.
10. Click start. Don't touch anything.
11. Once it's done, close the flasher, unplug your phone and insert the SIM and SD cards and turn it on.
12. Done
Zip file contains both .fls and .bin files.
So it seems roms based on v20B might be in the works
EDIT: Not going to upload, has been superseded by v20E and the Megatron exploit.
Hello! Please laid out links to the program.
http://file.karelia.ru/3jw96r/
LGP920AT-00-V20e (no patched)
Please patch file!
Sent from my LG-P920 using xda premium
he's uploading the v20b bin as we speak, also someone might need to make a thread on "patched firmware" if people are finding more .bin files
I'm 30% through the second zip file, Mediafire only allows maximum 200MB per file so I had to split up the .bin. It should be up in about an hours' time.
SnegovikRZN said:
http://file.karelia.ru/3jw96r/
LGP920AT-00-V20e (no patched)
Click to expand...
Click to collapse
Can somebody patch this bin. I think this is newest ROM 18.01.2012.
dr_jerremy said:
Can somebody patch this bin. I think this is newest ROM 18.01.2012.
Click to expand...
Click to collapse
I'm downloading it now, download speeds are really slow. I'll take a look once it finishes downloading.
pandaball said:
I'm downloading it now, download speeds are really slow. I'll take a look once it finishes downloading.
Click to expand...
Click to collapse
I'm almost done with dowloading,but i dont know how to patch :S..... I will try
EDIT: Bin. V20E 18.01.2012
Follow the updated instructions, they should be concise enough to follow.
In other news, I realised I forgot to set permissions for superuser.apk and su. So, I have to reupload everything due to my mistake. Sorry guys, I can only upload everything tomorrow as it's getting late
@SnegovikRZN If you could create patched ROMs for P920 as you did with the P970 that would be great
pandaball said:
Follow the updated instructions, they should be concise enough to follow.
In other news, I realised I forgot to set permissions for superuser.apk and su. So, I have to reupload everything due to my mistake. Sorry guys, I can only upload everything tomorrow as it's getting late
@SnegovikRZN If you could create patched ROMs for P920 as you did with the P970 that would be great
Click to expand...
Click to collapse
Can I say I'm first?
pandaball said:
Can I say I'm first?
Click to expand...
Click to collapse
i'll bring my thumbdrive over jk
Я не могу создать прошивку для p920, так как там немножко другая структура...
Ohh the ANDROID! string is missing... ok, no problem
in the 20e the entry 22ABFFFF is missing..
Maybe for V20E:
2249FFF0
I can't flash patched rom with Lg flash tool..
Oh I figured out what's the problem
Seem V20B having more options to root it.
hondymondy said:
Seem V20B having more options to root it.
Click to expand...
Click to collapse
Not really, most new roms would be rebased on v20E so I would recommend those
Can dev teach me ..
How can I extra the system.img file under windows 7 OS.
dickluo said:
Can dev teach me ..
How can I extra the system.img file under windows 7 OS.
Click to expand...
Click to collapse
You will need the android SDK and adb.
You can either do this through the terminal app on the phone or by using adb...
With adb:
From windows command line, and the phone connected via usb.
adb shell
su
cat /dev/block/system > /sdcard/system.img
If you use the terminal, you run the same commands as above, except the adb command.
To get the file on your hard drive, run this from the windows command prompt:
adb pull /sdcard/system.img .
Jim
Sent from my MB865 using xda premium
EDIT- lol, Jim and I had two different perspectives on your question . Are you asking how to create a system.img based off of your current /system, or are you asking how to extract an .img you already have and set up a working directory for ROM building?
Under Win7? Good luck with that. The system.img contains a filesystem that Windows doesn't natively support. You can use an app like Ext2Read to open and extract .img's, but if you do that all the symlinking will get messed up because Windows filesystems don't support symlinks. Also, Ext2Read might freeze or not fully extract the image just because of compatibility issues.
I highly recommend you use VirtualBox or set up a dual-boot with a Linux OS like Ubuntu. From there, you can install the ROM Kitchen which makes building ROMs a lot easier. It will let you set up a working directory based off of a system .img, and it detects all symlinks and adds them to the updater-script.
cogeary said:
EDIT- lol, Jim and I had two different perspectives on your question . Are you asking how to create a system.img based off of your current /system, or are you asking how to extract an .img you already have and set up a working directory for ROM building?
Under Win7? Good luck with that. The system.img contains a filesystem that Windows doesn't natively support. You can use an app like Ext2Read to open and extract .img's, but if you do that all the symlinking will get messed up because Windows filesystems don't support symlinks. Also, Ext2Read might freeze or not fully extract the image just because of compatibility issues.
I highly recommend you use VirtualBox or set up a dual-boot with a Linux OS like Ubuntu. From there, you can install the ROM Kitchen which makes building ROMs a lot easier. It will let you set up a working directory based off of a system .img, and it detects all symlinks and adds them to the updater-script.
Click to expand...
Click to collapse
Thanks cogeary .
I need the ext2read to explorer the *.img file and it can extra anyone file from *.img to my disk.
And can I use the *.apk from other *.img to create/use on my phone/system.
dickluo said:
Thanks cogeary .
I need the ext2read to explorer the *.img file and it can extra anyone file from *.img to my disk.
And can I use the *.apk from other *.img to create/use on my phone/system.
Click to expand...
Click to collapse
Sometimes. You can probably use apps like the alarm clock or browser that come from a different firmware, but don't try using framework files (like framework-res, systemui, etc) and important apps (like the dialer or phone) from different firmwares.
I have not seen this posted anywhere, so I thought I would post it here. This is NOT purely my work, and I do not take credit for it as such.
Included in the attached ZIP are the following files:
boot_info - prints information about the boot.img passed to it, including the base address and ramdisk address. This tool prints out everything needed to repack the boot.img correctly.
split_boot - More commonly known as split_bootimg.pl, this rips apart the boot.img to extract the ramdisk and zImage. It has been modified by me to split the boot.img into a separate folder (specified by the file name of the boot.img passed to it) and to extract the ramdisk into a sub-folder as well (extracts the cpio from the gz and then extracts the actual files from the cpio archive)
unpack_ramdisk - unpacks the given ramdisk file.
Code:
Usage: unpack_ramdisk <ramdiskFile>
repack_ramdisk - repacks the ramdisk from the given directory (found online and modified slightly to take a directory)
Code:
Usage: repack_ramdisk <ramdiskDirectory> [outputFile]
mkbootimg - mkbootimg binary that creates a boot.img file from the given ramdisk and zImage. Updated to a version compiled by me to support the --ramdiskaddr option (ramdisk address) so that even nonstandard boot.img's can be repacked correctly (Use with boot_info for best results).
umkbootimg - included for convenience. Not made by me. Original thread here.
unpack - wrapper script made by me for the umkbootimg binary^ to unpack the boot.img into a separate directory and then unpack the ramdisk into a sub-directory.
Note: These tools were made for Linux. They may also work on Cygwin, but I have not personally tested them.
ANYONE is free to use / modify / kang these files as they see fit. No need to ever ask or do anything more than download.
Enjoy.
UPDATE: If you downloaded, please redownload. There was an error with my repack_ramdisk script, but it's fixed now.
Updated tools with a new boot_info script, also added my own mkbootimg binary compiled with the ramdisk address option.
Boot_info now displays the following information:
Commandline
Pagesize
Base address
Ramdisk address.
Which is everything you need to make a functional boot.img, even when the original boot.img is packed with a non-standard mkbootimg (ie, the ramdisk offset is different than the normal offset).
How exactly do we use these files to unpack and repack?
I've tried running the scripts with chmod at 755 but it doesn't work.
I am i missing something?
All the scripts must be in a folder in your path (~/bin for example)
Then it should work, because they call on each other. I keep all of them in my ~/bin folder, but they can be anywhere in your PATH
Sent from my buttered S3
if Android Magic Word not found at offset 0, it fail.
twins.7 said:
if Android Magic Word not found at offset 0, it fail.
Click to expand...
Click to collapse
No, if you use unmkbootimg instead split_boot, it also finds embedded images.
CNexus said:
No, if you use unmkbootimg instead split_boot, it also finds embedded images.
Click to expand...
Click to collapse
OK, it work. But .... sorry to much complain
My boot.img has magic word in offset 2048. so it mean, there is additional header in first 2048 byte.
umkbootimg succesfully extract embedded boot.img, but in repacking, I lost the first 2048 byte, because magic header placed in offset 0.
Actually, what is the additional header for? really asking...
I fail to fastboot flash if the image have no additional header.
And it will fail to verify, if the additional header is wrong. or is it called signed boot.img?
If I change the content of boot.img, I can't flash it to device. It always said verify fail. I though, the additional header has CRC or hash or anything.
If you have spare time and want to help me, I'll post my image
Thanks for this tools
Send from my AMOI N828 using Xda Premium
twins.7 said:
OK, it work. But .... sorry to much complain
My boot.img has magic word in offset 2048. so it mean, there is additional header in first 2048 byte.
umkbootimg succesfully extract embedded boot.img, but in repacking, I lost the first 2048 byte, because magic header placed in offset 0.
Actually, what is the additional header for? really asking...
I fail to fastboot flash if the image have no additional header.
And it will fail to verify, if the additional header is wrong. or is it called signed boot.img?
If I change the content of boot.img, I can't flash it to device. It always said verify fail. I though, the additional header has CRC or hash or anything.
If you have spare time and want to help me, I'll post my image
Click to expand...
Click to collapse
I'm not sure. No tool will work for all devices, and since I've never had a device that has this special packing, it would be best if you asked one of your kernel devs for help unpacking/repacking
CNexus said:
I'm not sure. No tool will work for all devices, and since I've never had a device that has this special packing, it would be best if you asked one of your kernel devs for help unpacking/repacking
Click to expand...
Click to collapse
ok thank's
CNexus said:
I have not seen this posted anywhere, so I thought I would post it here. This is NOT purely my work, and I do not take credit for it as such.
Included in the attached ZIP are the following files:
boot_info - prints information about the boot.img passed to it, including the base address and ramdisk address. This tool prints out everything needed to repack the boot.img correctly.
split_boot - More commonly known as split_bootimg.pl, this rips apart the boot.img to extract the ramdisk and zImage. It has been modified by me to split the boot.img into a separate folder (specified by the file name of the boot.img passed to it) and to extract the ramdisk into a sub-folder as well (extracts the cpio from the gz and then extracts the actual files from the cpio archive)
unpack_ramdisk - unpacks the given ramdisk file.
Code:
Usage: unpack_ramdisk <ramdiskFile>
repack_ramdisk - repacks the ramdisk from the given directory (found online and modified slightly to take a directory)
Code:
Usage: repack_ramdisk <ramdiskDirectory> [outputFile]
mkbootimg - mkbootimg binary that creates a boot.img file from the given ramdisk and zImage. Updated to a version compiled by me to support the --ramdiskaddr option (ramdisk address) so that even nonstandard boot.img's can be repacked correctly (Use with boot_info for best results).
umkbootimg - included for convenience. Not made by me. Original thread here.
unpack - wrapper script made by me for the umkbootimg binary^ to unpack the boot.img into a separate directory and then unpack the ramdisk into a sub-directory.
Note: These tools were made for Linux. They may also work on Cygwin, but I have not personally tested them.
ANYONE is free to use / modify / kang these files as they see fit. No need to ever ask or do anything more than download.
Enjoy.
Click to expand...
Click to collapse
is it possible to make these run on the device?
i have tried
adb root
adb remount
adb push * /sdcard/tmp/
adb push * /system/xbin/
adb push * /system/bin/
adb shell
cd /sdcard/tmp/
for f in $(ls)
do
chmod 755 /system/bin/$f
chmod 775 /system/xbin/$f
done
cd /
rm -r /sdcard/tmp
cd /sdcard/working
split_bootimg.pl boot.img
returns "Permission denied"
hmmmmm???????? what could be the problem????????
ricky310711 said:
is it possible to make these run on the device?
i have tried
adb root
adb remount
adb push * /sdcard/tmp/
adb push * /system/xbin/
adb push * /system/bin/
adb shell
cd /sdcard/tmp/
for f in $(ls)
do
chmod 755 /system/bin/$f
chmod 775 /system/xbin/$f
done
cd /
rm -r /sdcard/tmp
cd /sdcard/working
split_bootimg.pl boot.img
returns "Permission denied"
hmmmmm???????? what could be the problem????????
Click to expand...
Click to collapse
The Perl script should work if you have Perl (compiled for ARM x86) on your device.
The binaries will not work as they are not compiled for ARM. The scripts (at least some of them) should work if you change all instances of "#!/bin/bash" and "#!/usr/bin/env bash" to "#!/system/bin/sh".
CNexus said:
The Perl script should work if you have Perl (compiled for ARM x86) on your device.
The binaries will not work as they are not compiled for ARM. The scripts (at least some of them) should work if you change all instances of "#!/bin/bash" and "#!/usr/bin/env bash" to "#!/system/bin/sh".
Click to expand...
Click to collapse
will see if i can get it working tonight! this could be pretty good if i can get it to unpack on device!
ricky310711 said:
will see if i can get it working tonight! this could be pretty good if i can get it to unpack on device!
Click to expand...
Click to collapse
No need...download this zip and extract http://www12.zippyshare.com/v/37266634/file.html
It already contains an unmkbootimg binary compiled for ARM. Then you would just need to unpack the ramdisk to finish it off.
CNexus said:
No need...download this zip and extract http://www12.zippyshare.com/v/37266634/file.html
It already contains an unmkbootimg binary compiled for ARM. Then you would just need to unpack the ramdisk to finish it off.
Click to expand...
Click to collapse
no way, ive been looking for something like this for ages, who is the author?
ricky310711 said:
no way, ive been looking for something like this for ages, who is the author?
Click to expand...
Click to collapse
I don't know who originally compiled that unmkbootimg binary for ARM.
CNexus said:
I don't know who originally compiled that unmkbootimg binary for ARM.
Click to expand...
Click to collapse
hmm, gotta findout! i wanna use it in my tool!
Is this boot.img tool compatible with Microsoft windows as well?
Sent from my SPH-L710 using XDA Premium 4 mobile app
shakim24 said:
Is this boot.img tool compatible with Microsoft windows as well?
Sent from my SPH-L710 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Read the OP.
Hi/Hello/good evening!
I have a broken MTK phone waiting for spareparts and one backup file from its SDCard made with CWM
name userdata_20130615_140224.backup where I need to extract contact data from.
How to do it?
I have been searching a whole while now but could not find one single post about opening this archive.
Pls help!
Thank you,
Erwin
If u have any spare phone with Titanium Backup installed then u can transfer ur backup to tat mobile's sd card and use TB to extract data from Nanoid Backup..
Sent from my WT19i using xda premium
expanding file
hi,
unyaffs doesnt work on that .backup file and I dont have a spare phone lying around. I got the file on windows
and please after reading 20.000 tuts on "backups" can there be one that explains how to extract the file
with windows?
thank you,
Erwin
NOW!!!
ewoewo said:
hi,
unyaffs doesnt work on that .backup file and i dont have a spare phone lying around. I got the file on windows
and please after reading 20.000 tuts on "backups" can there be one that explains how to extract the file
with windows?
Thank you,
erwin
Click to expand...
Click to collapse
tell me the tec solution internet!
ewoewo said:
Hi/Hello/good evening!
I have a userdata#######.backup and I cant enter into recovery mode. once i try toenter recovery mode in boots and shuts down without entering into recovery mode. I want to restore this backup file. Help me out
Thank you!!
Click to expand...
Click to collapse
It's a 512 byte header in front of a "tar.gz"
hexdump -C userdata_xxxxxxxx_yyyyyy.backup | lessshowed the magical zip header "1f8b0800 00000000" at offset 0x200
So, skipping 512 bytes, the rest can be gunzip | tar
dd if=userdata_xxxxxxxx_yyyyyy.backup bs=512 skip=1 | gunzip -c | tar xv
Code:
dd if=/home/user/_backups/E380-android-phone/userdata_20160126_223433.backup bs=512 skip=1 > /home/user/_backups/E380-android-phone/userdata_20160126_223433.backup.dd-out.tar.gz
Worked for me. Then just used KDE's archive opener (Ark) to view the files, looks to have everything in there except keys and whatnot.
if you prefer a linux solution use this script it converts android backup to nandroid backup
http://forum.xda-developers.com/showthread.php?p=65374561
Hello! Super-Developers, mega-programmers and smart hackers!
Nobody does not know how to open *. backup file?
No one can't help in this problem suffering millions of android/windows users?
You suggest them to install Unix/Linux system, - everybody to become hackers and programmers?!
maybe in the World exists GUI- programme to open *. backup file?
Someone can solve this problem of the century?
Philoandr said:
Hello! Super-Developers, mega-programmers and smart hackers!
Nobody does not know how to open *. backup file?
No one can't help in this problem suffering millions of android/windows users?
You suggest them to install Unix/Linux system, - everybody to become hackers and programmers?!
maybe in the World exists GUI- programme to open *. backup file?
Someone can solve this problem of the century?
Click to expand...
Click to collapse
What do you expect. You are trying to edit a Linux based file. Not to mention a closed sourced compressed file.
There are free programs like OSFMount or DiskInternals Linux Reader for mounting (android) linux file system images on Windows. Also 7-Zip for Windows can extract files from linux file system images.
However, there is metadata like user identifier and group ownership, file permissions, SELinux context (user role type range) stored for each file, which gets lost once you have saved linux files to windows disk. Without this metadata you can not restore files to phone.
Regardless you can extract files in windows if you just care about pictures, music files etc. Maybe one day there is a developer who may write such a program no matter its useless for restoring complete user data to phone.
Regarding the userdata*.backup files (no cwm) this is a chinese feature not provided by google android open source project. Without source code its nearly impossible to analyze the checksum algorithm. You can not re-create a userdata*.backup file.
What you can do is unpacking it. make a guess. cut off the first 512 byte header of each file which is probably the checksum. then merge the files together. Now you have a file for further analysis. Its probably either a ext4 disk image or a (gz compressed) tarball archive. a disk image can be mounted as a new drive, metadata keeps preserved in this case. a tarball archive must extracted with gnu tar to linux file system. when extracting with 7-Zip you will lose metadata.
There is a risk of tarball archive is unheadered Tar, in this case 7-zip will not extract it. If your phone is encrypted, the disk image is probably encrypted disk image (thats where the hacker stuff starts).
If you want to remove the checksum in windows, there is a small problem. There is no such command. You can use a third party command line utility Trunc to try it. (truncate deletes only from tail)
Another way for Windows, you can use some linux utils with cygwin. I don't know exactly how to do it, but @Doc_cheilvenerdi.org released a Windows script Odinatrix which converts unheadered Tar to Ustar Tar. From this you can use some linux utils (i don't know if it works for converting backups, too)
1. unpack the Odinatrix-WINDOWS.zip file. copy the folder named "files" containing cygwin linux utils. rename the folder to bash (or any meaningful name)
2. create a new folder on Windows Desktop
3. move the backup files to <some folder>
4. open the Windows Command Prompt
goto Windows Start - Run...
type: %SystemRoot%\system32\cmd.exe - press OK
now type the following commands in Windows terminal console:
5. add bash folder to windows environment variable %PATH%
(example: PATH=%PATH%;C:\Program Files\bash)
Code:
PATH=%PATH%;<path to bash folder>
6. change directory and list backup files
Code:
cd %UserProfile%\Desktop\<some folder>
dir /a userdata*.backup*
7. cut off 512 byte header from each file using (cygwin) gnu "dd" linux util like @ektoric suggest in post #6.
do this for each file, skipping 512 bytes only (without unpacking). replace the wildcard * with <date>_<time>
Code:
dd if=userdata*.backup of=userdata*.part0 bs=512 skip=1
dd if=userdata*.backup1 of=userdata*.part1 bs=512 skip=1
dd if=userdata*.backup2 of=userdata*.part2 bs=512 skip=1
dd if=userdata*.backup3 of=userdata*.part3 bs=512 skip=1
8. merge the files with windows
Code:
copy /v /y userdata*.part0 /b + userdata*.part1 /b + userdata*.part2 /b + userdata*.part3 /b userdata*.img /b
9. try to mount the userdata*.img with OSFMount. if not working, try extracting with 7-zip.
Besides this linux is no hacker-os and just as easily operated as windows. You can boot a live distribution from usb-stick without installing.
for further questions, please visit the main thread
[Q] How to Extract data from .Backup file ? - Created with android system recovery
zelendel said:
What do you expect. You are trying to edit a Linux based file. Not to mention a closed sourced compressed file.
Click to expand...
Click to collapse
Thank you for the answer!
Please comment next:
1) Video how to extract files from
"Linux based, Not to mention, a closed sourced compressed" backup file with metadata:
Распаковка и извлечение файлов из резервной копии - YouTube
m.youtube.com/watch?v=HNXed7RGR2g
2) quote from Android Backup Extractor's README-TXT-instruction:
"Usage:-- Windows: very easy"?
Android Backup Extractor - -- sourceforge.net/projects/adbextractor/files
-sourceforge.net/projects/adbextractor/reviews?source=navbar
I tried to use Android Backup Extractor In WinXp SP3
but windows version of this app shows cygwin&some other files missing.
Do you know why it doesn't work?
I don't need to recover backup on its own place.
My target is to extract and open few files: photos, videos, documents...
Strangely 7zip also doesn't work. Thank you in advance!
adbextractor is for adb backups *.ab only (btw open source).
cygwin is a implementation of linux utils running in windows.
the above solution uses cygwin, did you try?
aIecxs said:
adbextractor is for adb backups *.ab only (btw open source).
cygwin is a implementation of linux utils running in windows.
the above solution uses cygwin, did you try?
Click to expand...
Click to collapse
Thank you for first very detailed answer!
It seems that you have a remarkable grasp of this subject,
that's why I ask you to comment my previous post about video and Android Backup Extractor.
Your second post is not clear for me: adbextractor is only for *.ab files??
I have few files cygwin, is it a separate program??
I attempted to run file start.exe - windows version of Android Backup Extractor with those few cygwin files
but unsuccessful.
I read and test a lot, but The problem is still unsettled.
i came up two years ago with same question, how to unpack, and ended up with learning linux. i have uploaded a bash script, but i don't know if it works. i am not a developer and still learning, and nobody give feedback.
what is exactly file name of your backup? suffix *.ab or *.backup? these are completely different, don't mix up tools.
if you mean userdata_20180313_161000.backup files, please try mini tut above beginning 1.
aIecxs said:
i came up two years ago with same question, how to unpack, and ended up with learning linux. ... i am not a developer and still learning
Click to expand...
Click to collapse
It is classic aphorismic sentence!! I like it.
What's the bash script? for what goal? it is for Windows? If yes, I'll try it. give me the link.
my files are userdata_20100102_045926.backup, -=-=.backup1, 2, 3......
I'm not Englishman, "mini tut" is mini tutorial?
You have 100 posts and 25 thanks - super rate for notdeveloper.
the tool in video (adbextractor) can not unpack your backup. your backup is a splitted ext4 partition image. OSFMount can open ext4 partition images from Windows
bckp2cwm.sh script is basically doing the same steps like mini tutorial above. unfortunately it is for linux. main goal is convert userdata*.backup to cwm backup, but its paused in the middle (after unpacking, before repacking)
as windows user, all you need is a usb-stick. there is a tool unetbootin running in windows. it is a one-click-solution for downloading and copying any linux distribution to usb-stick. you can boot into linux from this usb-stick, for example ubuntu
aIecxs said:
OSFMount can open ext4 partition images from Windows
Click to expand...
Click to collapse
OSFMount can extract few files from my backup?
Thank you very much for efficient advices!!!:highfive:
I'll try them in sequence.
although Linux is not my :angel:dream.
Solution for Windows
1. Download and install free hhd hex editor neo.
2. Open each of your .backup files, in select menu select range at 0 offset size 512 decimal, delete and save.
3. Use Windows copy command to join files as described in post#11 (Thanks to the author for free education).
4. Use any program that reads Linux disk image files. I used diskinternals (mount image from the drive menu first). Openext worked too.
This won't work on tar archives if I understand correctly. This took me days to figure out and only minutes to execute. No thanks to confusing android prompts while upgrading to a new OS.
yoyohelp said:
1. Download and install free hhd hex editor neo.
2. Open each of your .backup files, in select menu select range at 0 offset size 512 decimal, delete and save.
3. Use Windows copy command to join files as described in post#11 (Thanks to the author for free education).
4. Use any program that reads Linux disk image files. I used diskinternals (mount image from the drive menu first). Openext worked too.
This won't work on tar archives if I understand correctly. This took me days to figure out and only minutes to execute. No thanks to confusing android prompts while upgrading to a new OS.
Click to expand...
Click to collapse
Hi i have a problem i have 5 files from the backup each with 2gb when i do the command from post 11 it works nice but when goes to backup part 3 it gives an error, what could it be? Im i doing something wrong?
# FYT-Firmware-Workbench
PLEASE DO NOT USE WITH T'EYES CC3 FIRMWARE
Scripts intended to mount the FYT UIS7862 firmware, make modifications and reassemble it back
They can retrieve the firmware from specified location and after modification, they can put the packed and signed firmware into another specified location
Files:
1-) config.ini = A file to setup parameters, paths for the original firmware and patched firmware, temp directory to work with firmware files and mount point to edit the firmware
2-) import_original.sh = Retrieves the ZIP file from the location specified in config.ini
3-) import_patched.sh = Retrieves the same files that 'import_original.sh' but from the patched location specified in the config.ini (normally a firmware that you've already patched before)
4-) unpack.sh = (autorun after import*) Unpack the imported firmware and create the mount moints (as specified in the config.ini file) to work with the firmware
5-) tweaker.sh = Allows change Locale, Language, Country and allows enabling ADB and OTG (if hardware supports it)
6-) inject_mods = Copies all contents of "_mods" folder into system partition, like gps.conf or even bootanimation, up to you to creat the same folder structure with your own files to inject
7-) repack.sh = Unmount the modified firmware from the mount points, delete the mount points, assembly the new ZIP file, sign it and move it to the patched directory as specified in config.ini
clean_local.sh = This script will unmount the firmware and delete it, it will also delete temporary files. as its name says, it cleans the local workbench !
N'joy it !
[CHANGELOG]
2.0 Introduces a different ZIP signature method
1.0 Initial release
Did you already try to flash it? I seed that you sign with the test keys but does that now work on the 7862?
On the previous architectures the recovery did not allow self signed zips.
Yes it works well, of course I flashed a modified 6315_1 befor make this post. You can trust the scripts, take a look at the tweaker.sh who allow you to modify some settings, Locale,Region, Coutry, and more to come !
Hi,
I tried your tools. Nice work.
I first did the "import_original.sh" and then the "unpack.sh". I did use this on a RPi4 running Debian Linux. All my Linux machines are currently RPi boxes and I use my headless server RPi4 for most stuff I do myself on images. (Next to that I have a Chromebook running Linux as well, but that one doesn't allow me to mount images in the linux sandbox.)
In the unpack.sh I get errors after brotli on the resizing of all the images:
Bash:
**********************************************
Processing 'system' image ...
BROTLI -- Handling system.new.dat.br...
Converting system.new.dat file into system.img file
When tring the "Converting .." is where it goes wrong without error message. The sdat2img is using "#!/usr/bin/env python" which, on an python3 only system gives "/usr/bin/env: ‘python’: No such file or directory"
When I change the call to "python3 sdat2img.py <etcetera>" it works. It might be better to use something like
Code:
if [ `which python` ]; then
./tools/sdat2img.py
elif [ `which python3`]; then
python3 ./tools/sdat2img.py
else
printf "\n\nNo python found!!\n\n"
exit 1
fi
Otherwise your created dat file is 0 bytes (simply an echo of 0 bytes to a new file), then giving corrupt empty images of 128 MB when trying to resize them.
And about the resizing/shrinking of the images: Why do you do that?
Simply leave the img as is and mount it read-write, not read-only.
Please use
Code:
mount -t ext4 -o loop,rw $unzippedPath$i.img $MOUNTPOINT/$i
and then simply copy (as root) your stuff in or make the modifications directly (as root). After unmounting you can immediately repack and brotli-compress it again. No extra intermediate steps necessary.
****
And some other remarks (actually a bit of nit-picking, please don't feel offended. I think you did a great job):
You use and pack a 64bit jdk with it, which is of course very convenient in most cases but doesn't work on my ARM raspberry pi.
I would put something in the shell script like
Bash:
echo "Singning '${FIRMWAREZIPFILENAME}' file..."
if [ -n `which java` ]; then
# Not found. Use packed version and hope it is a 64bit system
tools/jdk64/bin/java -jar tools/SignApkv2.jar <etcetera>
else
# Use system version
java -jar <etcetera>
fi
You also use
Bash:
echo " "
echo "READY !!!."
echo " "
Why not use
Code:
printf "\n\nREADY !!!\n\n"
Don't feel offended at all fellow, that's normal you're improving the scripts so suit your needs, that's normal, and your code (above) seems much more adapted than mine, I packed a 64bit java 8 cause java 11 does not sign the ZIP, (or at least I didn't reach the sign correctly)
Y have a giltab at home with that projects (FYT, TS10 etc....) y you want to participate and pull-request your changes, os help me improving that scripts, you're welcome and I'll send you the link via PM
mariodantas said:
I packed a 64bit java 8 cause java 11 does not sign the ZIP, (or at least I didn't reach the sign correctly)
Click to expand...
Click to collapse
Yes, you are right. the signapkv2 is already very old. I forgot that. I just tested and java V11 comes without the sun packages.
Will add and arm64 java 8 and detect the proc architecture by scripts to select the right java
@surfer63 I forgot to tell you that I released FYT Firmware Workbench 2.0 which includes another 6315_1 signature method (no more signapkV2), (as required with lsec6315update after Jul/2/22) thos signs well the new 6315_1 files, so we can still modify their contents and repack again and flash without the message: "Please use legal system"
I finally got my images to mount. (had to sudo)
I used the modifications @surfer63 suggested. (python3 was the trick here)
edit: are the mountpoints supposed to be RO? I'm getting "no space.." error running the tweaker.
j-5 said:
I finally got my images to mount. (had to sudo)
I used the modifications @surfer63 suggested. (python3 was the trick here)
edit: are the mountpoints supposed to be RO? I'm getting "no space.." error running the tweaker.
Click to expand...
Click to collapse
No, they shoud have 128Mb + each uhntil repack
NOTE: before running FYT Firmware Workbench do a "sudo su" (you must run as ROOT) that's why it didn't work flawlessly, I'll modify the scripts to ask for sudo su if needed !
@mariodantas : Your FYT workbench was still in the Android head units section. I had it moved to the FYT forum.
mariodantas said:
No, they shoud have 128Mb + each uhntil repack
NOTE: before running FYT Firmware Workbench do a "sudo su" (you must run as ROOT) that's why it didn't work flawlessly, I'll modify the scripts to ask for sudo su if needed !
Click to expand...
Click to collapse
OK, got it.
I had commented out the "expand' part, my bad .
Is there a github repo for the latest scripts? I'd love to try this out.
No Github, I'll release some fixes soon !
mariodantas said:
I'll release some fixes soon !
Click to expand...
Click to collapse
this is very good, thanks for your hard work!
I am also having trouble parsing the system.new.dat.br file (I only chose to edit it in config). After changing to python3, file began to be mounted and repack. But I get an error on the device in the middle of installation related to "dynamic_partitions_op_list" even though I didn't change anything
Where are the 2.0 tools?
Andy826 said:
Where are the 2.0 tools?
Click to expand...
Click to collapse
In the OP
surfer63 said:
And about the resizing/shrinking of the images: Why do you do that?
Click to expand...
Click to collapse
@surfer63 I do that to allow me to add content inside, if not, the free size is 0Kb after mount
@mariodantas The CC3 Firmware Tools don't seem to work with the January firmware. The error when using them on the January firmware is:
Code:
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open _tmp/_firmware/elable.img
Any chance of this being fixed please?
ahmed123 said:
Any chance of this being fixed please?
Click to expand...
Click to collapse
Not compatible with CC3 anymore