(Q) How to convert backup to flashable zip - Android Q&A, Help & Troubleshooting

Anyone know how to do it? I tried google but didn't get the correct info. Any info is welcomed.
If I helped, give thanks, if you please.
........Death before dishonor........

is it nandroid backup ?

I think there are two kinds of backups- yaffs and ext3/4 images. I think most of the more recent recovery versions have switched to ext3/4 or tar.
Overall, the procedure would be to extract the data and then pack it into a zip.
The yaffs images can be extracted using unyaffs- google for the source. The ext3/4 images can be mounted using the loop option "mount -o loop path/to/image path/to/mountpoint"
At this point, you'll have the extracted image on your computer. Arrange it into a zip and be sure to update the updater-script. You will most likely have to fix some of the permissions, which you can see from another updater-script or look at the running rom. I'm not sure if you can rely on the permissions from the yaff/loop image.
This is a pretty high level overview- you'll have to fill in the details.

That seems a bit over my head, maybe in time I'll be able to do it.
If I helped, give thanks, if you please.
........Death before dishonor........

Why do you need to convert the backups into flashable zips?

sashank said:
Why do you need to convert the backups into flashable zips?
Click to expand...
Click to collapse
There's some icon png files I want to change, they way I do it is different.
If I helped, give thanks, if you please.
........Death before dishonor........

Is it something that you can push with adb? If you are only changing a few files, then adb push will be fine.
You could extract them from a backup files with the unyaffs or mount commands I listed above.

gee one said:
Is it something that you can push with adb? If you are only changing a few files, then adb push will be fine.
You could extract them from a backup files with the unyaffs or mount commands I listed above.
Click to expand...
Click to collapse
Using adb is possible, but I'm not so good with it. I have an idea of what the command would be. I just prefer being able to see the outcome my self, do I can verify it.
If I helped, give thanks, if you please.
........Death before dishonor........

try this:
before:
adb shell ls -l /path/to/your/target
push:
adb push /your/files/on/your/computer /target/on/your/phone
after:
adb shell ls -l /path/to/your/target
this will show you size and creation date changes so you can verify that it worked.
If you are really paranoid, you can use "adb shell md5sum /path/to/your/target" instead to verify the md5 hash. You have to have the md5sum binary installed- I think it's usually installed via busybox.

I'll keep that in mind, but there's still one issue. I need to knew the exact file name, the main icon.png file differs per apk
If I helped, give thanks, if you please.
........Death before dishonor........

got it- you're trying to change the icons for the apks. I don't know much about theming, but you might be able to use a script to update the apk/zip- something like zip -u email.apk /res/blah/mdpi/icon.png
Although I'm not 100% sure that you can update zips in the rom. I think some versions of busybox/toolbox are capable.

Normally I do it though 7zip,with a ROM that I already have on my sdcard. That why I wanted to create a flashable from a back up. I could try adb though
If I helped, give thanks, if you please.
........Death before dishonor........

Related

edit system.img

hy everybody.
i try mod the system.img on ubuntu linux with unyaffs and mkfs.yaffs2, i "hacked" the symlinks(because the armv6 unyaffs doen't like) so now everything is ok, unyaffs works well. BUT:
when i flash the other sin files with flashtool, my x8 is restart after a green sony ball. i gave to all file in bin folder: rwx-rx-rx and the all other files got rw-r-r permissions.
so, i don't know what is the problem with this method.
//my system.img was flashed with a method in "clean and pre-rooted 2.1 rom" thread.//
in attachment the filesunyaffs and mkfs.yaffs2.x86)
unfortunately unyaffs-x86 does NOT preserve all file permissions if image is extracted and reassembled in Linux x86.
You have to extract/assemble on the phone to keep permissions.
Or, alternatively, you can fix permissions by using xRecovery tool, there's a menu "fix permissions".
To see why exactly your phone reboots, use adb logcat from PC.
racht said:
unfortunately unyaffs-x86 does NOT preserve all file permissions if image is extracted and reassembled in Linux x86.
You have to extract/assemble on the phone to keep permissions.
Or, alternatively, you can fix permissions by using xRecovery tool, there's a menu "fix permissions".
To see why exactly your phone reboots, use adb logcat from PC.
Click to expand...
Click to collapse
yess, thank you! now i found a mkfs.yaffs2 for arm processors for android. it's verry slow.
so i made my sdcard to ext2, and now i try to "extract" my img.
so ... It's used to ?
trapacska said:
hy everybody.
i try mod the system.img on ubuntu linux with unyaffs and mkfs.yaffs2, i "hacked" the symlinks(because the armv6 unyaffs doen't like) so now everything is ok, unyaffs works well. BUT:
when i flash the other sin files with flashtool, my x8 is restart after a green sony ball. i gave to all file in bin folder: rwx-rx-rx and the all other files got rw-r-r permissions.
so, i don't know what is the problem with this method.
//my system.img was flashed with a method in "clean and pre-rooted 2.1 rom" thread.//
in attachment the filesunyaffs and mkfs.yaffs2.x86)
Click to expand...
Click to collapse
i've created sh script to view your current permissions.
it could be useful to re-set the permission manually to create the ROM
how:
upload to root of sdcard
run
Code:
su
cd /sdcard
sh plist.sh
it will create folder "permissions" on your sdcard.
all files permission listed there
open with notepad++
propc said:
i've created sh script to view your current permissions.
it could be useful to re-set the permission manually to create the ROM
how:
upload to root of sdcard
run
Code:
su
cd /sdcard
sh plist.sh
it will create folder "permissions" on your sdcard.
all files permission listed there
open with notepad++
Click to expand...
Click to collapse
it's cool! thank you. now i try to debrand the oroginal x8 rom.
trapacska said:
it's cool! thank you. now i try to debrand the oroginal x8 rom.
Click to expand...
Click to collapse
you know what. i've found a better method to change permissions
1-mount original system.img
Code:
mkdir tmp/1
sudo mount -o loop /your/system.img/path /tmp/1
2-clone permissions from original system.img to your system folder
Code:
chmod -R --reference /tmp/1 /your/new/system/path
and the permission fix done!
EDIT: tested. and worked. I've finally created my own modified ROM (running on sdcard)
EDIT2: some problem with root permissions, will work on it
thank you i found a way to fix permissions too:
1. unyaffs original system.img
2. in busybox shell mount it to r/w
3. copy xrecovery and su and superuser to fresh rom.
(for me it works well without xrecovery fix permissions)
if there is some error, you can fix it with xrecovery
Hello,
Can you try to change the /system image with one from froyo ? You can find such image in the X10 forum. I thing that if we change the contents of the /system with such from froyo it should work. With the standard kernel from eclair.
Please try this and let me know.
bnight said:
Hello,
Can you try to change the /system image with one from froyo ? You can find such image in the X10 forum. I thing that if we change the contents of the /system with such from froyo it should work. With the standard kernel from eclair.
Please try this and let me know.
Click to expand...
Click to collapse
i tried it. no luck. too many files. where are the files that need to be edited?
/system/lib?
propc said:
i tried it. no luck. too many files. where are the files that need to be edited?
/system/lib?
Click to expand...
Click to collapse
/system/framework (for a skin)((but the all folder))
trapacska said:
/system/framework (for a skin)((but the all folder))
Click to expand...
Click to collapse
thanks. will try porting from htc legend 2.2 rom later.

[How-To] Extracting/Accessing Recovery/Nandroid backup (.img) files

Actually this info is already present on other device forums but is unavailable @X10 forum. So I thought I will put it up here,
* If the MODS feel this thread is redundant please delete it *
Nandroid backups files (.img) created via Recovery are yaffs file system images. A tool called Unyaffs can be used to extract the files within these images (data.img / cache.img / system.img).
linux users can d/l the source code from: http://code.google.com/p/unyaffs/downloads/list
and compile using:
Code:
gcc -o unyaffs unyaffs.c
for windows users:
you can download the attached rar file and extract it...
usage:
1) copy the compiled unyaffs file/exe (along with cygwin1.dll) to a new directory
2) copy the nandroid backup image (data.img / cache.img / system.img) into that directory
3) go to terminal/command prompt, change directory to where those files are and execute:
e.g. for system.img
Code:
unyaffs system.img
the contents of the .img file will be extracted in that directory
there is also an app in the market YaffsExpert with which you can extract the .img files using phone
Inspired from:
guide at EVO 4G forums http://forum.xda-developers.com/showthread.php?t=890508
Extracting files from a nandroid backup using unyaffs http://bit.ly/gTLFkc
How to extract the files of Nandroid backup on Windows @ androidforums.com http://bit.ly/fT7udF
xlnt
+1 nice post! very useful info for any Android owner, anyone ever backed up with nandroid or xRecovery and felt like they forgot something from one of their earlier backups...? This is what you need
Pretty nice and useful. I actually was tinkering around with these files the other day as I contemplated running either Z's Froyo Beta 4 OR J's GB
Thank you. It is very useful.
Great topic! Thanks
now i don't have to google for this thanx...
How To Repack Files?
Will this check for the md5?
velnens123 said:
How To Repack Files?
Click to expand...
Click to collapse
i didnt follow...
do u want to place/add/remove files to make ur own yaffs img?
mohdameer said:
Will this check for the md5?
Click to expand...
Click to collapse
this will just extract the contents of nandroid/recovery backups...
u can use md5summer or similar progs to check md5 sums..
i searched a tool like this... thank for this HOW TO!
DooMLoRD said:
this will just extract the contents of nandroid/recovery backups...
u can use md5summer or similar progs to check md5 sums..
Click to expand...
Click to collapse
thanks. the reason i asked was that, everytime i try any rom from z, i get md5 error while restoring old backup. after extensive search in this forum and loosing my sms messages, i found a way. using adb shell, then using "busybox md5sum" i was able to generate the correct md5 hashes or whatever its called then restore the xrecovery backups. if i use the md5sum directly from the adb shell then xrecovery gives me mismatch.
may be z can look into this. i beleive the md5 mismatches are caused due to different md5sum command in adb shell and in busybox.
mohdameer said:
thanks. the reason i asked was that, everytime i try any rom from z, i get md5 error while restoring old backup. after extensive search in this forum and loosing my sms messages, i found a way. using adb shell, then using "busybox md5sum" i was able to generate the correct md5 hashes or whatever its called then restore the xrecovery backups. if i use the md5sum directly from the adb shell then xrecovery gives me mismatch.
may be z can look into this. i beleive the md5 mismatches are caused due to different md5sum command in adb shell and in busybox.
Click to expand...
Click to collapse
no need... the problem is with blanks /spaces " " in ur file name/ folder name... check that... if u have renamed the backups (folder name) and have space in it u will get md5 error... spaces in folder names are not supported...
no didnt change a single thing. even the filename which is the default timestamp.
Which version of recovery is that? Sounds maybe messed up. Using latest version helps.. just a thought
mohdameer said:
no didnt change a single thing. even the filename which is the default timestamp.
Click to expand...
Click to collapse
dude thanks a lot.it was useful
MrHassell said:
Which version of recovery is that? Sounds maybe messed up. Using latest version helps.. just a thought
Click to expand...
Click to collapse
i am using the latest one.
mohdameer said:
i am using the latest one.
Click to expand...
Click to collapse
xRecovery v0.3 Recovery
or
FreeXperia Recovery
DooMLoRD said:
xRecovery v0.3 Recovery
or
FreeXperia Recovery
Click to expand...
Click to collapse
xRecovery v0.3 Recovery
i didnt knew there was a different freexperia one.
i downloaded from z xrecovery thread , the unified one.
sorry if i am hijacking this thread in wrong direction. i found the solution as i mentioned earlier.
DooMLoRD said:
Actually this info is already present on other device forums but is unavailable @X10 forum. So I thought I will put it up here,
* If the MODS feel this thread is redundant please delete it *
Nandroid backups files (.img) created via Recovery are yaffs file system images. A tool called Unyaffs can be used to extract the files within these images (data.img / cache.img / system.img).
linux users can d/l the source code from: http://code.google.com/p/unyaffs/downloads/list
and compile using:
Code:
gcc -o unyaffs unyaffs.c
for windows users:
you can download the attached rar file and extract it...
usage:
1) copy the compiled unyaffs file/exe (along with cygwin1.dll) to a new directory
2) copy the nandroid backup image (data.img / cache.img / system.img) into that directory
3) go to terminal/command prompt, change directory to where those files are and execute:
e.g. for system.img
Code:
unyaffs system.img
the contents of the .img file will be extracted in that directory
there is also an app in the market YaffsExpert with which you can extract the .img files using phone
Inspired from:
guide at EVO 4G forums http://forum.xda-developers.com/showthread.php?t=890508
Extracting files from a nandroid backup using unyaffs http://bit.ly/gTLFkc
How to extract the files of Nandroid backup on Windows @ androidforums.com http://bit.ly/fT7udF
Click to expand...
Click to collapse
Thank you very much!

[SOLVED]ClockWorkMod recovery commands used

Hey guys,
Does anybody know what commands the ClockWorkMod recovery uses to generate backup images? Like when you browse to your /mnt/sdcard/Clockworkmod/backups/ directory and see your *.img files, what command is used to generate that file? I know in linux you can use dd and cat (block partition) > *.img and that would generate it, but i want to know the exact command used by ClockWorkMod recovery.
Thanks all for your time!
ANSWER: mkyaffs2image
Bumpy bump bump bump :/
HELOO!?!?!?!?!!??
I take it you're looking to replicate the functionality of the nandroid backup? If so this thread contains a script to do so.
If you want to find out for some other reason, I suggest you examine the script and/or CWM source files.
Bloved said:
I take it you're looking to replicate the functionality of the nandroid backup? If so this thread contains a script to do so.
If you want to find out for some other reason, I suggest you examine the script and/or CWM source files.
Click to expand...
Click to collapse
THANK YOU VERY MUCH FOUND MY ANSER
mkyaffs2image is the command used to generate an image file from your partitions thanks! no i can make my app

[Q][NVFLASH]Gain root on stock system image

Hi all, researcher and enthusiast,
I own a complete backup of all partition of the LG P990 with stock ICS, made it with nvflash with a command like this,
Code:
nvflash -r -read <-partition number-> my_partition.img
for all the partition listed in the partition table.
I guess that in someone of that raw image file, (outputted by nvflash), is located the entry system partition, (PartitionId=23 for the LG P990 ICS partition layout).
It's easy for every linux user to mount the raw image file, simply with 'mount' utility.
Browsing them we can find as already hypothesized the entrie android system partition!
If I copying in it the 'su' executable compiled for my platform, it could work?
Yes. Simple as that. Just be careful with permissions.
There's a topic I made on the ancient v28g time with stock v28g rooted system, on dev section. There you'll find useful info.
Do not say "thanks"; just press it under here.
louiscypherbr said:
Yes. Simple as that. Just be careful with permissions.
There's a topic I made on the ancient v28g time with stock v28g rooted system, on dev section. There you'll find useful info.
Do not say "thanks"; just press it under here.
Click to expand...
Click to collapse
Thanks! I'll have a close look to your work now, for others that consider this stuff interesting, louiscypherbr's work is here:
http://forum.xda-developers.com/showthread.php?t=2010671
Nice job!
louiscypherbr said:
Yes. Simple as that. Just be careful with permissions.
Click to expand...
Click to collapse
Ok louis, but the partition23 image file after adding su binary or other things is bigger than the previous that we had read with nvflash, right?
If I flash back it with
--bl fastboot.bin --download 23 image.img
how can this work..?
In the part table is write that have been reserved 536.870.912 bytes for the partiton 23, but we want flash an img file bigger than that size (because we added some stuff), this not causes problem?
And what do you mean for careful?
The extracted file is a dd partition image, meaning it's extracted byte by byte. So it includes the empty space, which you can see with "df" command after mounting it.
You can add files that fit in that position and it will be ok when flashed.
Do not say "thanks"; just press it under here.
Stupid thing! You're right!
And, what you mean for careful with perm?
The su binary should be have the setuid bit set in addition to the obvious x, is this enough?
Have you compiled su by yourself...?
louiscypherbr said:
There's a topic I made on the ancient v28g time with stock v28g rooted system, on dev section. There you'll find useful info.
Click to expand...
Click to collapse
Where have you found the executable of su packed in your v28g louis...???
Hey, sorry for being far from this.
What I was talking about permissions is that you should keep su permissions/owner. I did this just copying the su from a rooted Rom zip to /system/xbin and pasting inside your loop mounted /system with file manager (I'm kde fan, so I used dolphin, the kde graphical file manager, but you can use any other as well).
Sent from my LG-P990 using xda app-developers app

[Q] How to Extract data from .Backup file ? - Created with android system recovery

I Backup-ed my Acer tab b1-A71 using android system recovery - Just like CWM.
The file name ends with .Backup, and i wanted to extract some files from it..
How to Extract data from .Backup file ? - Created with android system recovery
looking for the same
reena0307 said:
I Backup-ed my Acer tab b1-A71 using android system recovery - Just like CWM.
The file name ends with .Backup, and i wanted to extract some files from it..
How to Extract data from .Backup file ? - Created with android system recovery
Click to expand...
Click to collapse
me too looking for the same thing ..how to extract from or decompile .backup file which we get thru recovery.
hi loverboyritesh :: i and you are in same position.. but some advaaanced users are here that we are telling rumors and lies.. dont worry bro.. even i'm trying to get solution.. will tel you after geeing one.. Still no one can tell me hoe to extract .BACKUP file..
same
i am looking for how to reinstall .backup myself so i can have my original rom install.
but i have notice my .backup is 700+mb while custom rom is 200+mb
do you know how to?
reena0307 said:
I Backup-ed my Acer tab b1-A71 using android system recovery - Just like CWM.
The file name ends with .Backup, and i wanted to extract some files from it..
How to Extract data from .Backup file ? - Created with android system recovery
Click to expand...
Click to collapse
same here. dunno how to open and extract the files from a .backup file. hoping you know already
siiingkeeet said:
same here. dunno how to open and extract the files from a .backup file. hoping you know already
Click to expand...
Click to collapse
Nope.. Still i'm having that file but no one knew
reena0307 said:
Nope.. Still i'm having that file but no one knew
Click to expand...
Click to collapse
been searching for 5 days now :<
not a single answer found on google and forums
cant even post a new thread yet. just joined
hope someone will drop by this thread
still no solution?
got same problem here
Got a bootloop issue with an ASUS MeMo Pad 7 HD and I've booted in recovery <3e> to make a backup.
I've got a userdata_YYYYMMDD_HHMMSS.backup. I tried opening it with a bunch of tools like unyaffs, abe (Android backup extractor), going live on the file using linux tools (open as 7zip, zip, rar, tar, tar.gz, gz, bz2 , mount as iso, ext4 and so on....)
Still no luck :-/
Only clue is that the file seems compressed. During the backup under recovery, it told me 3600MB to backup and the file userdata_xxxxxxxx_xxxxxx.backup show only 2.61GB
I did this backup 3 time to ensure there were no corruption during the write process from the pad and did again the same "tests" to open the file...Not better.
If any dev' have any clue of the file format, I'd be glad to help
It doesn't seem to be a valid unix img file. Tried mounting it to no avail. When it's restored by the recovery it also extracts the individual files because i fails on one in my case and stops the entire restore... I tried unzipping it, changed extension to ,jar, .tar, .zip, etc., none of them are recognised...amazing for a standard android feature to find so little info about it
Any solution?
I called Alcatel's technical service today and they told me that you can use the backup file only from the phone. Mine gives me the following error when I try to restore it: Error Magic header
If anyone knows how to unpack the backup file I would be more than grateful.
It's a 512 byte header in front of a "tar.gz"
hexdump -C userdata_xxxxxxxx_yyyyyy.backup | less​showed 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​
Sir ektoric what d u mean on ur post?
Sorry cant understand it..
Can u please d a step by step procedure? Please...pls...plss
Thanks in advance...
Steps?
@ektoric sir im a noob in this... Can u show a step by step procedure?
@killen00 sorry, I assume you have a linux machine (or have access to one). The command is actually all there is to it.
Code:
dd if=userdata_xxxxxxxx_yyyyyy.backup bs=512 skip=1 | gunzip -c | tar xv
If you don't have a linux machine available, might I suggest one of the many distros of your choice, most of which have LiveCDs which you can run without installing.
script for gunzip method
maybe on xda it is common sense, but for me it was necessary to know, that these stock android recovery extracted files can be restored with nandroid custom recovery, if you simply repack them into tar archive.
i put this two command lines in a dirty shell script (extract + repack as tar).
thanks to ektoric figuring out his gunzip method!
edit: notamamasboy's mount method added (but not tested yet). if script not works come back few days later, download again and check version, maybe it has changed meanwhile.
with this you're able to transfer data of non-rooted phone to (rooted) similar one.
this is useful in case touchscreen is broken, you haven't custom recovery installed, usb-debugging is disabled and connecting usb-otg-mouse doesn't work.
tested on my Archos 50 b Oxygen (Mediatek MT6582).
it works for me, feel free to improve, port to busybox and publish. no support. use at own risk.
edit: bckp2cwm.sh is deprecated it is FOR JELLY BEAN ONLY (no selinux support)
a newer (selinux) version bckp2win.sh for TWRP you can find here:
http://forum.xda-developers.com/showthread.php?t=3775129
How did you go about determining the magic number found at 0x200? My hexdump output does not have that magic number (1f 8b) in any instance. Leads me to believe my backup is not a tar file. Any suggestions then?
@notamamasboy, you are unfortunately correct.
Someone else also mentioned that their
Code:
userdata_xxxxxxxx_yyyyyy.backup
file was not of the same format I tried some "known magic headers", and could not find anything tell-tale. In which case, without some clues, you are back at square one.
ektoric said:
@notamamasboy, you are unfortunately correct.
Someone else also mentioned that their
Code:
userdata_xxxxxxxx_yyyyyy.backup
file was not of the same format I tried some "known magic headers", and could not find anything tell-tale. In which case, without some clues, you are back at square one.
Click to expand...
Click to collapse
Even more peculiarly, two backups were created a .backup and a .backup2, I wonder if combining with cat I can get somewhere...

Categories

Resources