[TOOL] Back up custom system files from recovery - HTC EVO 3D

This is a tool I made for myself for backing up some of the custom files... Mostly as a result of wanting to expedite the process of backing up some configuration files in /system (such as inadyn.conf or bashrc on synergy rom). It reads a text file to determine what files you want, saves them in a tar on your sdcard (necessary to tar them to keep permissions the same when transferring to fat). Then you flash the restore zip to put them back.
It's set to not backup if there already is a backup (to prevent overwriting your custom files by clicking the wrong zip). The backup.tar is deleted on successful restore.
To use, create a text file in /sdcard/custBackups called custom_files.txt, and put the full pathname of each desired file in there, seperated by a single space (no newlines). While in recovery, run the backup zip to save your custom files, and run the restore zip to restore them after flashing.
An easy way to add the files while using adb shell (with busybox installed) is to cd and ls around to find your file, then while working in the same directory run this command
echo " `realpath myfilename`" >> /sdcard/custBackups/custom_files.txt
(those are backticks, not single quotes, which may be on hackers keyboard but isn't on most android keyboards, that's why I suggested adb shell)
looks long but is pretty quick with bash completion. But only needs to be done once for each file, the text file stays in place.
Thanks to Cyanogen's team and ginger yoshi, as I got the idea from them and learned the updater script reading their files.
A dev can put this in their own updater script so it's all in one (which I do when exporting the svn for synergy). If you can't figure out how to add it reading my script, let me know. And if any devs do use, just shoot me some credit.
If this is used on any other phone, the assert command and mount command in updater script needs to be changed to suit... the rest should be pretty universal.

Is this something like Titanium Backup.apk but in zip format?

No I made this just for synergy for backing up the special configuration files for some of the special tools i'm that ROM, like inadyn and dropbear. Also any special themed files, my fonts..
Basically, catching any system files that titanium and other apps don't get.
Sent from my PG86100 using XDA App

Related

[Q] How to make an x-recovery zip off my rom

I searched the forum but i cannot find the answer.
I would like to make an xrecovery zip file off the rom i use.
Is this possible and how.
Thanks.
You can create a nandroid backup instead using Backup and Restore in xRecovery
Titanium Backup for single files.
You can also grab the files that you need to push as an update via Titanium backup. It creates an update.zip with a few files inside that you can extract to another phone if you like...
Nandroid backups are made with xRecovery for the Xperia models. It will give you three files and a checksum file, these can be added to a zip file if you like and restored using xRecovery.
I've found a good article on XDA located here on the subject. It's not specific to the X10 or Xperia models but you might find it worth reading
benz0076 said:
I searched the forum but i cannot find the answer.
I would like to make an xrecovery zip file off the rom i use.
Is this possible and how.
Thanks.
Click to expand...
Click to collapse
I'm not a Dev but this is what I'd do if I wanted to make an update zip of the changes I've made to the Rom installed on my phone. Before you try it, just remember that I could be wrong on this and if your going to create your own package, try it on your own phone before releasing it for public use.
First thing to do would be to extract the files from any ROM update package, but preferably the one that your currently installed one is based on.
If you open the zip file there will be two or more folders. One will be system and the other META-INF. If you drill down through the META-INF folder to the bottom of the folder structure you'll find a file called "update-script" This is the script that XRecovery uses when it updates your phone and you can easily read what's being done.
Eg:
Code:
format DATA:
format CACHE:
format SYSTEM:
copy_dir PACKAGE:system SYSTEM:
And it would continue on with more after that.
The script is formating the Data, Cache, and system partitions on the phone in preparation for installing the new Firmware. It is then copying the contents of the System folder included in the package to the system partition on the phone. The rest after that is setting up symbolic links and setting directory permissions.
If you use ADB to pull the /system folder from you phone, that would be the equivalent of the system folder that is included in the update package.
Code:
md system
adb pull /system system
You could, if you wanted, just replace the system folder in the update package zip with the system folder that you just pulled from your phone and you would have a packaged ROM.
If you wanted to include apps in the package that are not in the /system/app folder you would need to pull the apps that you wanted to include from the /data/app
Code:
md data\app
adb pull /data/app data\app
You would then add the data folder to the rom package so that you would then have three folder instead of two.
data
META-INF
system
After that change the the beginning of the update-script file to look something like this
Code:
format DATA:
format CACHE:
format SYSTEM:
copy_dir PACKAGE:system SYSTEM:
copy_dir PACKAGE:data DATA:
After your all done use something like 7zip to zip everything back up using no compression "Store Only" and you should have a XRecovery installable ROM.
NOTE:
If you have paid apps and are making this ROM for anybody other than yourself to use, make damn sure that you remove them from the /data/app folder before zipping everything up into a package. Including paid apps in your ROM is Warez and won't be tolerated anywhere.
GreatBigDog said:
I'm not a Dev but this is what I'd do if I wanted to make an update zip of the changes I've made to the Rom installed on my phone. Before you try it, just remember that I could be wrong on this and if your going to create your own package, try it on your own phone before releasing it for public use.
First thing to do would be to extract the files from any ROM update package, but preferably the one that your currently installed one is based on.
If you open the zip file there will be two or more folders. One will be system and the other META-INF. If you drill down through the META-INF folder to the bottom of the folder structure you'll find a file called "update-script" This is the script that XRecovery uses when it updates your phone and you can easily read what's being done.
Eg:
Code:
format DATA:
format CACHE:
format SYSTEM:
copy_dir PACKAGE:system SYSTEM:
And it would continue on with more after that.
The script is formating the Data, Cache, and system partitions on the phone in preparation for installing the new Firmware. It is then copying the contents of the System folder included in the package to the system partition on the phone. The rest after that is setting up symbolic links and setting directory permissions.
If you use ADB to pull the /system folder from you phone, that would be the equivalent of the system folder that is included in the update package.
Code:
md system
adb pull /system system
You could, if you wanted, just replace the system folder in the update package zip with the system folder that you just pulled from your phone and you would have a packaged ROM.
If you wanted to include apps in the package that are not in the /system/app folder you would need to pull the apps that you wanted to include from the /data/app
Code:
md data\app
adb pull /data/app data\app
You would then add the data folder to the rom package so that you would then have three folder instead of two.
data
META-INF
system
After that change the the beginning of the update-script file to look something like this
Code:
format DATA:
format CACHE:
format SYSTEM:
copy_dir PACKAGE:system SYSTEM:
copy_dir PACKAGE:data DATA:
After your all done use something like 7zip to zip everything back up using no compression "Store Only" and you should have a XRecovery installable ROM.
NOTE:
If you have paid apps and are making this ROM for anybody other than yourself to use, make damn sure that you remove them from the /data/app folder before zipping everything up into a package. Including paid apps in your ROM is Warez and won't be tolerated anywhere.
Click to expand...
Click to collapse
Thanks i am going to try this and will let you know if it works..
Sent from my X10i using XDA App
Zip for xrecovery
I have some modified .png files for a theme and I need to make a zip for xrecovery, can someone explain IN DETAIL PLZ, on how to do this. this is what i think im supposed to do so far. change .apk to .zip, use 7zip edit files inside, change zip back to apk? thats about where i get lost
CAYCE_VII said:
I have some modified .png files for a theme and I need to make a zip for xrecovery, can someone explain IN DETAIL PLZ, on how to do this. this is what i think im supposed to do so far. change .apk to .zip, use 7zip edit files inside, change zip back to apk? thats about where i get lost
Click to expand...
Click to collapse
Follow this thread... http://forum.xda-developers.com/showthread.php?t=714288

[TOOL] System apps update.zip auto creator

Hi all
I have created for my first java program a update.zip creator for the nexus one.
This will create a flashable update.zip for updating the system apps on your choice.
I created it for my self to save me time making them every time I wanted to save memory on my phone by moving apps from /data to /system partition (could just of written a script), so thought I would share it.
This is a console tool written in java and only for linux, it will only work on a rooted nexus one running clockwork mod recovery (have not tried any other recovery).
Tested on: nexus one, clockwork mod, CM 7
Programs you can choose to add to the update.zip:
Amazon mp3
Maps
Facebook
Gmail
Rom manager
Android market
Twitter
Youtube
Voice search
Super user
Read the README on how to use it.
Don't forget to run the adb server as root!
Download: http://www.mediafire.com/?pekm9ehswe49x
Any questions,problems,suggestions let me know.
README
Code:
This is a tool I have created for my self to speed up making update.zips for my nexus one and am now sharing.
It is my first java program so it's not perfect but it will improve over time as I learn.
This program will create and sign an update.zip file that will move apps you choose from the /data/app patition to the /system/app partition
It has only been designed to work with the nexus one using Cyanogen mod.
How it works
First it pulls all apps from the /data/app partition on your phone into a created directory with in the PWD
it then scans all the apps for key names of the apps
then if it finds certain apps, it will then ask you if you would like to add it to the update.zip
it then creates the update-script with the commands to delete the apps from the /data/app and copy them to the /system/partition
then it zips the contents and finaly uses the testsign.jar to sign the package.
In the PWD the following programs are needed to run updater-creator:
adb
testsign.jar
update-binary
**** RUNNING THE PROGRAM *****
You must download the apps from the market that you want to update
Leave updater-creator.jar in the directory with ADB and other programs, moving it will prevent the program from finding the programs it needs to run.
You must enable USB debugging on your phone as this program uses ADB.
To run updater creator:
*unzip the file and contents into a directory .
*cd to the dir you unzipped the files to.
*Plug phone in
*Run 'sudo ./adb kill-server' then 'sudo ./adb start-server'
*run the updater-creator.jar file using the following command: java -jar updater-creator.jar
This will create folders and files needed with in the PWD.
Each time you run updater-creator it will over write all previously created files.
I'll give it a try, thank you for sharing your hard work any chance of adding the "read me instructions" to your first post?
Thanks again
Gr8 work,definitely will try it once I get back home
Sent from my Nexus One using XDA App
tina333 said:
I'll give it a try, thank you for sharing your hard work any chance of adding the "read me instructions" to your first post?
Thanks again
Click to expand...
Click to collapse
README now added. Let me know if it works ok or if there are any problems with it, I have tested it my self and had a friend test it with out any problems
If there are any more common apps or features you would like me to add let me know and I will see what I can do.
thank you!! I think this would be pretty useful for myself

Changing where OTA updates get stored on LG Spectrum and possibly other phones

Ok, this will be a bit of a technical thread, so bear with me. This is so people have an understanding of how to find and look at the update files that get put on a phone. If you are reading thru this, I will assume that you have a basic understanding of ADB and possibly of shell commands like ls and cd
When you go into settings -> About Phone - Software update, your phone does many checks to the file system. One of them is at a file /data/fota/ipth-muc.prop . Most people do not know this directory exists as when you are in ADB you can not do a list command on the /data directory without root. This file is re-created each time you boot your phone. If we do the following command, we can dowload the file to our computer:
ADB pull /data/fota/ipth-muc.prop
If we open the file, it will look a lot like this.
firmware.version=VS920ZV3
max.pkg.size=157286400
This file can also contain additional data. The string we want to add in there is where to download and place update packages. This can be defined as such:
pkg.location=
If this line does not exist, it will default to /cache/fota . Being as we can not cd into /cache or pull/push files there, this is a bad spot to put it. How ever, we can make directories and read/write to them under /data/local . Using this info we can do the following.
ADB shell
mkdir /data/local/temp
exit
From there, we can edit the original ipth-muc.prop file we pulled to look like this:
firmware.version=VS920ZV3
max.pkg.size=157286400
pkg.location=/data/local/temp
If you edit the file, use a true file editor. Notepad will not save it correctly, but Wordpad had no issues. From there we do the following
ADB push ipth-muc.prop /data/fota
Now when we do the update, it will place the downloaded files into our temp directory (note, you must do this after the phone is fully booted, but before you have the phone look for an update). Once the files are done downloading, click remind me later. Then we can go into ADB and pull the files.
ADB pull /data/local/temp
You will get two files. One will be the update "ipth_package.bin" and the manifest files "ipth_package.bin.dd" . The manifest file also contains the link to the original file name as link to it on the host server. The ipth_package.bin file is a simple zip file that can be opened with almost any archiving program.
The zip is signed by LG using their personal key, so modifying it and pushing it back to the phone is not currently possible. We can however see the contents of an update and see what is being change. I hope to use this in the near future to either break the LG key or find a way to find a glitch in a patch being done.

[Q] Can you make a recovery zip that alters .xml or other system files?

So I know that I can make a recovery zip to install packages, but I was wondering if I can make a zip that will extract and replace database files on my phone that are not packaged. The reason I want to do this is so that when I flash a new ROM, I can easily restore certain phone settings like altered APN databases. Thanks
Theoretically u can, by writing a bash script to handle the job and instructing the updater-script to run the bash script.

Browse and extract contents of TWRP Nandroid backup on Windows PC?

Very simply, how do I browse and extract the contents of a TWRP Nandroid backup on my Windows PC?
I am trying to browse a TWRP backup but I have a feeling I need to do a bit more fussing around. The backup is split into data.ext4.win000 through data.ext4.win007 and each of the parts has an accompanying .md5 with the same naming structure (ie. data.ext4.win000 and data.ext4.win000.md5.) There's also a data.info file as well.
The system backup is the exact same as described above for the data, except it's only 2 parts (system.ext4.win000 and system.ext4.win001, with the accompanying md5 files and the info file.)
Can someone provide a bit of guidance? I'm using a Windows 7 Home Premium machine.
kwest12 said:
Very simply, how do I browse and extract the contents of a TWRP Nandroid backup on my Windows PC?
I am trying to browse a TWRP backup but I have a feeling I need to do a bit more fussing around. The backup is split into data.ext4.win000 through data.ext4.win007 and each of the parts has an accompanying .md5 with the same naming structure (ie. data.ext4.win000 and data.ext4.win000.md5.) There's also a data.info file as well.
The system backup is the exact same as described above for the data, except it's only 2 parts (system.ext4.win000 and system.ext4.win001, with the accompanying md5 files and the info file.)
Can someone provide a bit of guidance? I'm using a Windows 7 Home Premium machine.
Click to expand...
Click to collapse
Simply rename the file to data.ext4.tar and use winrar to extract it.
I'm revamping this thread because I'm...desperate!
I have a nandroid backup (TWRP 2.8.7.0) and I would like to browse it on my PC. I'm focusing on files with structure data.ext4.win000x (where x goes from 0 to 2).
I'm able to open with 7-zip (should be equivalent to winrar) every individual file but size is faulty: every file is nearly 1.5 Gb while the content of the zipped file that I see it's around 50 kb. If I concatenate the files with the command copy /b data.ext4.win000? outputfile regardless the extension I give to "outputfile" I'm no longer able to open it with 7-zip.
Any suggestion/hint please ????
Not finding entire folders/files while browsing backup
I find the same thing regardless of the mechanism I am using to browse the backup. I am looking in /data/data for my own apps' data. Here is what I have tried so far:
1. Nandroid Manager app
2. TWRP Explorer app
3. ZArchive app
4. In a terminal, cat data.ext4.win??? | tar -tv > less (and then searching for my apps' package names
I was looking inside my nightly full backup to extract and recover some files I accidentally deleted. Cannot even find folders for the package names (except for 1 app). However, when I do a full restore from the same backup inside of TWRP Recovery, the missing files are indeed restored. So I know they are in the backup.
Why can I not find them and get at them any way else? I must be missing something simple.
Thanks
BTW - in the recovery.log file in the backup folder, I see the folders/files in question being "added". Very odd.
BTW2 - at least with regards Nandroid Manager app, I noticed that I was seeing some files I know I had removed from my apps some time ago. How could that be? I decided to clear data/cache for Nandroid manager and try again. It took much longer to process the backup for exploring. But now at least that app seems to be doing the right thing and I can see all folders/files.

Categories

Resources