[GUIDE] How to extract, create or edit android adb backups - Android Software/Hacking General [Developers Only]

What is an android adb backup?
An adb backup is a file with ab extension, generated by android's backup manager when we request it via adb shell. This allows you to backup some data of the phone, but is not a replacement of a clockworkmod backup:
- Java 7 or higher is required because of SYNC_FLUSH mode for the Deflater.
- If the backup contains apk+data for an app, restore will work. If contains only the data, you must install the app first on the device and then restore. Installing the app later won't work.
- Some apps include a policy where the apk is never backed up even if specified.
- Inside an ab file is a tar file, which contains files and folders in a certain order. You have you respect that order, which is not necessarily alphabetical like tar does by default. Such order is listed in "Full local backup infrastructure".
- Inside the tar file, directories must not have trailing slash, for that reason pax, star or equivalent has to be used.
- There are some bugs present in the android source code.
- 'adb backup' or 'adb restore' are pretty slow, between 1 and 2.6 MBps.
- The adb backups (usually with .ab extension) can be password protected or not. If the device is encrypted this is a must and has to be the same used for the device.
- Star is recommended instead of pax, which supports path length only up to 100 characters, so will fail in some cases. This usually happens with browsers history.
- ADB backups are not a replacement for a Nandroid backup. The whole /data partition is not backed up, only a part of it. Also, other partitions like /system, /preload, /cache, modem, RIL, efs, kernel or recovery are never backed up because are not user data. This is to prevent issue when restoring on a different device. It has also the biggest
- If you have the device encrypted with a password, you must use that particular one for backup creation and restore. You can't create a backup without password or a different one in that particular case, or if you try to restore will fail.
- star for cygwin for windows is attached (move it to C:\cygwin\bin\star.exe) since there is no package available. It can be compiled from the schily (ftp://ftp.berlios.de/pub/schily/).
- The best way to test if an adb backup has errors, is to convert it to tar and then check.advantage that doesn't require root to operate, so is totally compatible with stock roms, locked bootloaders and device encryption.
- There's also a bash script called adb-split.sh that creates individual adb backups for each recognized app from the full one, so you can restore apps individually. Same encryption is preserved to them, if any.
You can use java or perl, although with perl can be more complicated because requires downloading some modules from cpan and some ssl headers.
To know more information about types of android backups:
[Guide] Types of Android backups
Software needed
The entire process can be done from Windows, but is better to use a unix-like operating system, like Linux, OS X or BSD, since we should extract the files on a filesystem that preservers file permissions and owners and repack the tar archive. Furthermore some tools like star are easier to get for linux. In such cases, using Virtualbox or VMWare Workstation is highly recommended. Using Windows should work in any case whatsoever.
Cygwin
Preferably 32 bits: has more packages and is less prone to errors. Furthermore, the star for cygwin attached is 32 bits.
Java 7 or higher
Java 7 or OpenJDK 7 (more builds here)
Oracle Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7 if you are going to work with password encrypted backups.
You need to install the files local_policy.jar and US_export_policy.jar under jre's lib/security folder, for example:
- For Windows:
C:\Program Files\Java\jdk1.7.0_09\jre\lib\security\
C:\Program Files\Java\jre7\lib\security\
C:\Program Files (x86)\Java\jdk1.7.0_07\jre\lib\security\
C:\Program Files (x86)\Java\jre7\lib\security\
- For Linux or BSD:
/usr/local/jdk1.7/jre/lib/security/
/usr/lib/jvm/java-7-openjdk-*/jre/lib/security/
/usr/local/openjdk7/jre/lib/security/
- For OS X:
/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/security/
Perl
Perl is available for several operating systems
libssl or openssl headers. If you are using Linux or Cygwin is much more easier
cpan modules required by use functions
pax or star
pax is an archiving utility that compresses in ustar by default. In this case is extremely useful because stores directories without trailing slash. Is available for all operating systems, and in windows can be installed via cygwin's setup.exe or download a native version like gnuwin32 (sometimes available via bsdtar with pax option). pax doesn't work when paths are more than 100 characters lenght, so I recommend star instead.
star allows storing directories without trailing slash. You can get the ubuntu version 1.5 here. For Windows you can use Cygwin's version included.
Android Backup Extractor
Android Backup Extractor is the java application that does all the job. It includes the perl scripts.
How it works, better with an example
I will use an example to demonstrate how it works, with java version. If you like to use perl, just grab the perl scripts and is nearly the same.
This is extracted from the readme file, and will extract a whole adb backup and repack only the data for the game Grand Theft Auto III for android.
1) Convert the original adb backup to tar format:
Code:
java -jar abe.jar unpack nexus7.ab nexus7.tar <password>
2) Extract the contents of the tar archive. This should be done on a filesystem where the permissions of the files inside the tar are preserved, for example using linux, mac or bsd. Up to two folders may appear, apps and shared:
Code:
tar -xvf nexus7.tar
3) Make a list of all the contents of the original archive in the order they are archived:
Code:
tar -tf nexus7.tar > nexus7.list
4) Create a new list only with the files and folders you want, in proper order. For example for the GTA 3 (you can try savegames instead of all data):
Code:
cat nexus7.list | grep com.rockstar.gta3 > gta3.list
5) Create the new tar archive. The directories stored on tar shouldn't contain trailing slashes, so I use pax or star instead of tar. Pax works also if paths are up to 100 of lenght:
Code:
cat gta.list | pax -wd > gta3.tar
OR
Code:
star -c -v -f gta3.tar -no-dirslash list=gta3.list
6) Create the adb backup from the tar archive. Password is optional:
Code:
java -jar abe.jar pack gta3.tar gta3.ab <password>
Note: if the backup is not encrypted zlib can be used instead for both unpack and pack the ab archive:
- Quick unpacking:
Code:
dd if=nexus7.ab bs=24 skip=1 | openssl zlib -d > nexus7.tar
- Quick packing:
Code:
dd if=nexus7.ab bs=24 count=1 of=gta3.ab ; openssl zlib -in gta3.tar >> gta3.ab
Split an Android backup
Use Android Backup Splitter (is a shell script). Works on Cygwin too:
sh adb-split.sh backup.ab [password if needed]
Resulting files go in app-ab folder
# ADB Backup Splitter:
#
# This bash script utility generates an adb backup for each item
# on apps/ folder. That equals to generating an adb backup for
# each app.
#
# shared/0 and shared/1 (sdcards) are ignored, so that means that
# external data and OBB files, although may be backed up, may not
# be restored. For doing so backup the folder Android of the sdcards.
# Creating a backup with -shared flag has know issues (corruption)
# so is not recommended. Future releases of this script may add
# the option to automatically detect things from sdcards inside
# the adb backup file.
#
# This script works on Cygwin also, and in general where star does.
#
# There may be apps in the backup that don't include the apk. In that
# particular case, the data won't be restored, so the individual backup
# is generated for testing purposes only. Installing the apk afterwards won't work.
# There is generated an html file called apk-missing.html so you can open it and
# install all applications from Play Store on any of your devices.
Patch apps to allow adb backup
Some apps specify in the AndroidManifest.xml android:allowBackup="false" so it won't be backed up by adb backup. If you have root and use Titanium Backup or CWM or TWRP they will do the job, but if you don't want root the only solution is to modify the apk to edit that string. Read here how to do that and the pros and cons:
[GUIDE] How to enable adb backup for any app changing android:allowBackup
Links
Android Backup Splitter (@ Sourceforge)
Android Backup Extractor (@ Sourceforge)
Android Backup Extractor (@ GitHub)
Documentation at Blogspot
Full local backup infrastructure
[Guide] Types of Android backups
Backing Up Android Games
Titanium Backup Decrypter
Perl scripts to encrypt/decrypt adb backup files
[GUIDE] Full Phone Backup without Unlock or Root
[GUIDE] Internal Memory Data Recovery - Yes We Can!
[Q] [adb] backup not working for Temple Run
Related adb backup and restore bugs:
Issue 55860: adb backup skips the apk for certain apps and doesn't prompt for download when restoring
Issue 48126: device adb connecting to localhost adbd cannot execute commands anymore since 4.2.2 (error device offline)
Issue 3254: adb shell doesn't return exit code of program
Issue 53065: Debugging via ADB stopping the onClick action on ImageView widget
Issue 53668: ADB : An existing connection was forcibly closed by the remote host
Issue 54781: adb install: single quotes in filenames cause quoting issues
Issue 55173: (Game) Offroad Legends does not detect obb when restored via adb restore
Issue 55178: (Game) Carmageddon Promo does not detect obb when restored via adb restore
Issue 28303: adb backup doesn't respect -noshared flag
Issue 32830: adb restore errors not displayed on device
Issue 34311: Galaxy Nexus gets stuck when restoring adb backup
Issue 25780: BackupManager causes reboot when BackupAgent missing
Issue 40691: ab backup and restore Ski Safari does not restore saved data
Issue 16286: Restoration of phone not working properly
Issue 39014: Nexus 7 adb restore freezes when restoring udk.android.reader
Warning about Helium (Carbon): helium backups are just android adb backups that are not compressed with Java Deflater. It means they were created with the option static final boolean COMPRESS_FULL_BACKUPS = false.
A normal adb restore should work.

Great guide, and can confirm that it does work!
I managed to use this method to restore my angry birds data from a Froyo phone (HTC Desire), to a Jelly Bean phone (HTC One X+). This is no easy task since you cannot use adb backup/restore on Froyo, but you can use adb pull, and you can't use adb push on Jelly Bean, but you can use adb backup/restore. Just in case anyone is looking to do the same, here is the process I used (requires having adb up and running but does not require root)...
As the adb backup function doesn't work on Froyo, I had to use adb pull to grab the angry birds data files (highscores.lua and settings.lua). Then, making sure that you have angry birds installed on the jelly bean phone and have played the first level, use the adb backup command to backup just the angry birds app. You can then use scandiuns guide to extract a tar file from the backup file, and then extract the "app" folder from the tar file.
Once this is done, you will find the highscores.lua and settings.lua files in the apps/com.rovio.angrybirds/f directory. Replace these two files with your original ones that you pulled from the old device. Then package up the app folder using the guide. Then just use adb restore to restore the modified backup file to your new device, and you should have all your old scores restored!
Hope that helps and thanks to scandiun for the great guide! :good:

cn198 said:
Great guide, and can confirm that it does work!
I managed to use this method to restore my angry birds data from a Froyo phone (HTC Desire), to a Jelly Bean phone (HTC One X+). This is no easy task since you cannot use adb backup/restore on Froyo, but you can use adb pull, and you can't use adb push on Jelly Bean, but you can use adb backup/restore. Just in case anyone is looking to do the same, here is the process I used (requires having adb up and running but does not require root)...
As the adb backup function doesn't work on Froyo, I had to use adb pull to grab the angry birds data files (highscores.lua and settings.lua). Then, making sure that you have angry birds installed on the jelly bean phone and have played the first level, use the adb backup command to backup just the angry birds app. You can then use scandiuns guide to extract a tar file from the backup file, and then extract the "app" folder from the tar file.
Once this is done, you will find the highscores.lua and settings.lua files in the apps/com.rovio.angrybirds/f directory. Replace these two files with your original ones that you pulled from the old device. Then package up the app folder using the guide. Then just use adb restore to restore the modified backup file to your new device, and you should have all your old scores restored!
Hope that helps and thanks to scandiun for the great guide! :good:
Click to expand...
Click to collapse
I have tried similar attempt to restore my save of another game but that doesn't work.
How did you replace the files in the .tar file? I am using 7z to replace the .tar file but nothing happen after i restored.
Thanks.

ball3t said:
I have tried similar attempt to restore my save of another game but that doesn't work.
How did you replace the files in the .tar file? I am using 7z to replace the .tar file but nothing happen after i restored.
Thanks.
Click to expand...
Click to collapse
Read the guide. 7z is not compatible, you have to use star or equivalent and meet the requirements.

scandiun said:
Read the guide. 7z is not compatible, you have to use star or equivalent and meet the requirements.
Click to expand...
Click to collapse
star
star is required since GNU Tar does not allow storing directories without trailing slash. You can get the ubuntu version 1.5 here. For windows or Cygwin I haven't found it yet, if exists.
Because i am using windows, so does it mean that i couldn't modify the .tar file in any way?
thanks.

ball3t said:
Because i am using windows, so does it mean that i couldn't modify the .tar file in any way?
thanks.
Click to expand...
Click to collapse
Yes, from windows you can use pax. You can download it from cygwin's setup.exe. I've updated the guide, see the step 5.

scandiun said:
Yes, from windows you can use pax. You can download it from cygwin's setup.exe. I've updated the guide, see the step 5.
Click to expand...
Click to collapse
it worked!!
thank you so much.

Maybe I'm missing something.
I've installed Java, ran cygwins setup.exe and I think it installed everything. Also downloaded the Android Backup Extractor. I try running a windows command prompt with:
java -jar abe.jar unpack nexus7.ab nexus7.tar
All I get is "java is not an internal or external command". I'm running the command prompt in the android backup extractor folder. Does everything have to be in the same folder? Where do I dump everything?

AAhrens said:
Maybe I'm missing something.
I've installed Java, ran cygwins setup.exe and I think it installed everything. Also downloaded the Android Backup Extractor. I try running a windows command prompt with:
java -jar abe.jar unpack nexus7.ab nexus7.tar
All I get is "java is not an internal or external command". I'm running the command prompt in the android backup extractor folder. Does everything have to be in the same folder? Where do I dump everything?
Click to expand...
Click to collapse
Probably java is not in your path, try
Code:
which java
It should result something like
Code:
$ which java
/cygdrive/c/Windows/system32/java
Add Java to the Windows Path
Then restart cygwin

Omg omg omg! Thanks for the guide you just saved my ass, i love you!!!!!

scandiun said:
2) Extract the contents of the tar archive. This should be done on a filesystem where the permissions of the files inside the tar are preserved, for example using linux, mac or bsd. Up to two folders may appear, apps and shared:
Code:
tar -xvf nexus7.tar
Click to expand...
Click to collapse
Hi,
I'd like to try this out on a Windows 7 (virtual) machine. All software installed an clear what to do. But how do I manage to preserve the file permissions? Does Cygwin take care of that?
Thanks

ttv said:
Hi,
I'd like to try this out on a Windows 7 (virtual) machine. All software installed an clear what to do. But how do I manage to preserve the file permissions? Does Cygwin take care of that?
Thanks
Click to expand...
Click to collapse
You can't preserve the exact permissions because of the operating system and the filesystem. While permissions will be somewhat similar the owner will change completely. While android has the owner encoded by a number windows will use your windows username. I made simple modifications of backups on windows and luckily worked, but of course can't promise you that will apply for all the cases.
If you know how to use virtual machines, why just don't use linux / unix? For example if you use PC-BSD or Linux Mint you can download directly the Virtualbox image and then share a folder or use ftp server.
http://virtualboximages.com/LinuxMint+14+KDE+Desktop+32bit+Virtual+Appliance

scandiun said:
If you know how to use virtual machines, why just don't use linux / unix? For example if you use PC-BSD or Linux Mint you can download directly the Virtualbox image and then share a folder or use ftp server.
http://virtualboximages.com/LinuxMint+14+KDE+Desktop+32bit+Virtual+Appliance
Click to expand...
Click to collapse
Thanks for the answer.
I didn't understand the bit about sharing a folder on Unix before, but now I think it clicks.... The Linux/Unix VM is only used to share a folder in which I can extract the Android backup from my Windows machine right? So that way I can still use the installed software and drivers for my Nexus 4 on the Windows machine. Do I understand this correctly?
If that's the case I am going to try right away. Otherwise I have to make the Nexus 4 software installation work on the Unix/Linux VM and that will take a lot more time I think.....

ttv said:
Thanks for the answer.
I didn't understand the bit about sharing a folder on Unix before, but now I think it clicks.... The Linux/Unix VM is only used to share a folder in which I can extract the Android backup from my Windows machine right? So that way I can still use the installed software and drivers for my Nexus 4 on the Windows machine. Do I understand this correctly?
If that's the case I am going to try right away. Otherwise I have to make the Nexus 4 software installation work on the Unix/Linux VM and that will take a lot more time I think.....
Click to expand...
Click to collapse
Yes, I mean to access from linux the folder you share in windows, but then remember to copy the backup inside linux to extract it there, to preserve permissions.
You have the option to share folders in Virtualbox and VMWare Workstation. In case you use virtualbox, make sure the guest has Guest Additions installed. Some virtualbox images already come with it.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

Well I got the java command to work, but now the "cat" command will not work? Your link to add java to the path worked for the latter, but how do I get 'cat' to work?

AAhrens said:
Well I got the java command to work, but now the "cat" command will not work? Your link to add java to the path worked for the latter, but how do I get 'cat' to work?
Click to expand...
Click to collapse
What exact error are you getting?

scandiun said:
What exact error are you getting?
Click to expand...
Click to collapse
"Cat is not an internal or external command"

AAhrens said:
"Cat is not an internal or external command"
Click to expand...
Click to collapse
What shell are you using? cat is included on any default linux installation.

scandiun said:
What shell are you using? cat is included on any default linux installation.
Click to expand...
Click to collapse
Windows 8

On Cygwin you have cat and the other utilities you have to install them from the setup.

Related

Testing ROM Images in the SDK Emulator!

I started looking at Android Development and got the whole Dev kit and the Eclipse enrionment setup and working fine.
The question I have is that I would try different apps I develop on the different ROMs available.
How do I get any of the new ROMs, like the HERO ROM ZIP files I can download to run in the emulator or is it even possible?
Im assuming that the system.img file in the SDK id the file I need to replace or re-create, but how is this done?
I am a noob to the develop stuff so step by step instructions would be much appreciated.
I also think this would be great for other developers and ROM makers to be able to test in this way.
Thanks
Simon
Hopefully THIS one dont get closed, it IS asking a development question...anyway,
I would like to know this as well. I would like to test things myself (getting better at manipulating them), and would like to know what he is asking as well.
Thanks.
I don't think this would work, as the ROMs are hardware depending, me thinks. Or at the least the kernel and drivers are.
maybe this will help, maybe not, just an emulator primer, so maybe people can jump on board with this
under <sdk path>/tools
to list out your AVD(android virtual device)
android list targets
will return:
Available Android targets:
id:1
Name: Android 1.1
Type: platform
API level: 2
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
id:2
Name: Android 1.5
Type: platform
API level: 3
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
id:3
Name: Google APIs
Type: add-on
Vendor: Google Inc.
Description: Android + Google APIs
Based on Android 1.5 (API level 3)
Libraries:
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA (default), HVGA-L, QVGA-P, HVGA-P, QVGA-L
from here we choose our integer target, lets say 2
creating an AVD:
android create avd -n your_chosen_name_here -t 2
When you create an AVD, the android tool creates a dedicated directory for it on your development computer. The directory contains the AVD configuration file, the user data image and SD card image (if available), and any other files associated with the device. Note that the directory does not contain a system image — instead, the AVD configuration file contains a mapping to the system image, which it loads when the AVD is launched.
By default, the android tool creates the AVD directory inside ~/.android/avd/ (on Linux/Mac), C:\Documents and Settings\<user>\.android\ on Windows XP, and C:\Users\<user>\.android\ on Windows Vista
Click to expand...
Click to collapse
to run your newly created AVD:
emulator -avd your_chosen_name_here
maybe this will help, but I'm guessing everyone here already knows all of this.
references:
http://developer.android.com/guide/developing/tools/emulator.html#starting
Yeah, I understand that you can specify the AVD.
The only thing now is to edit the AVD to point to a different image. This is easy!
The system image file is a *.img file.
So how do we get our ROM images compiled into the IMG file format?
There must be a tool, but I cant find anything.
And what hardware does the emulator, emulate? Maybe it ignores the hardware specific calls throu an API so the ROM image target hardware shouldn't matter.
I just started messing around with rom's and after I build one I put system.img userdata.img and ramdisk.img from my /mydroid/out folder into the sdk's image folder and start the and it uses the new rom when I start the emulator
thats the easy part
do a nandroid backup
copy the sdk/platforms/android-1.5
to something like sdk/platforms/MINE
go to your AVD directory AVD/whateveryoucalledit
open up the config.ini
edit:
skin.name=HVGA
skin.path=platforms\MINE\skins\HVGA
image.sysdir.1=platforms\MINE\images\
go to your nandroid backup on your sdcard
copy system.img
go to sdk/platforms/MINE/images/
and paste the nandroid system.img
now run your AVD and it will boot that system.img
im running CyanogenMod rom right now in the emulator
hint* number pad 7 with numlock off in the emulator is how to open up the hardware keyboard
Awesome. I'll be giving this a try later.
One question: The apps are in the system.img file on the SDK images as far as I can tell. What do you do with all the apps in the new ROMs?
whatever you want to do with them, they're all there, even android market works perfectly
And where are you guys getting the system.img file from?
The ROM zip files dont have them.
Sorry....Im noob to this. LOL
ggolemg said:
whatever you want to do with them, they're all there, even android market works perfectly
Click to expand...
Click to collapse
OK, Im confused. Can you just unzip the ROM files and place in the folder that you point using the same folder structure?
OR
Do you have to have a system.img ?
Another thought:
I dont want to have to install all the ROMs just to create a Nandroid backup to get the images. There must be a way to create the images from the raw files in the ZIP files.
Any ideas?
UPDATE: The same technology used by Nandroid itself!
The google android emulator included in the google android sdk is limited. Although you can use 'adb push' to upload more tools, but one has to do it again next time. Follow the steps to create a enhanced system.img:
1. system.img is yaffs2 flash file system, so firstly you need the mkfs.yaffs2 tool, download it in the following link: Release Android Yaffs2 Tool (Both X86 And ARM). One has to be a registered user to download the tools.
2. use the 'adb push' to upload tools to android emulator, executables in /system/bin/, libraries in /system/lib, one can also create folder. One need change the file mode necessary.
3. upload the ARM mkfs.yaffs2 tool, use the following command to create system.img: # mkfs.yaffs2 /system /system.img
4. download the system.img to local with command 'adb pull', replace the system.img in your emulator folder/tools/lib/images/
Click to expand...
Click to collapse
so it seems like it would be just as much fun doing a nandroid backup
*edit*
so now the real question is, how do we go about ripping out the nandroid functionality to be able to do this locally?
*edit 2*
it is the mkfs.yaffs2 tool
Usage:
mkfs.yaffs2 yourdir yourimage
Ohsaka said:
NANDROID - CYGWIN DIRECTIONS (not not not, I repeat, not fully tested and verified yet)
Changes so far if you are using cygwin:
1) Make sure you have the 'netcat' and 'gcc' packages, else just run cygwin.exe again and get them.
You can test if you have them by running 'which nc' and 'which gcc', both commands should return /usr/bin/<command>
2) Compile the mkyaffs2image executable.
Inside the extracted nandroid archive directory, goto the tartools\yaffs2\utils\ directory (inside a cygwin prompt) and type 'make'.
This should generate a file named "mkyaffs2image.exe" which you need to place somewhere on your path.
(Hint: If you haven't downloaded the Android SDK, abort now. Wait for more explicit directions... Else, place the .exe where adb is, since it should be on your path already)
3) Edit the nandroid.sh script. (else you get a permission denied error when the script tries to run the dump_image-arm file)
Find the line:
adb push ./$tool /cache/$tool
Add the following line after it:
adb shell chmod 777 /cache/$tool
4) Make a managed mount named /tmp (else windows will puke on the long unix filenames with colons, etc)
mkdir /tmp
mount -o managed c:/cygwin/tmp /tmp (Note: change c:/cygwin to be the directory cygwin was installed to, you can find it by typing 'cd /' and then 'explorer .')
5) Follow the standard "tar + mkyaffs2image" directions to generate the last three .img files. They refer to the /tmp directory which you created in the previous step.
Viola! Looks like I have a complete backup image now...
$ ls -l
total 117504
-rw-r--r-- 1 Osaka None 2621440 Jun 12 21:31 boot.img
-rw------- 1 Osaka None 737088 Jun 12 22:07 cache.img
-rw------- 1 Osaka None 53570880 Jun 12 22:06 data.img
-rw-r--r-- 1 Osaka None 262144 Jun 12 21:31 misc.img
-rw-r--r-- 1 Osaka None 5242880 Jun 12 21:31 recovery.img
-rw------- 1 Osaka None 57885696 Jun 12 22:06 system.img
Now I just need to drink up the courage to test it on my phone!
Click to expand...
Click to collapse
ggolemg said:
so it seems like it would be just as much fun doing a nandroid backup
*edit*
so now the real question is, how do we go about ripping out the nandroid functionality to be able to do this locally?
*edit 2*
it is the mkfs.yaffs2 tool
Usage:
mkfs.yaffs2 yourdir yourimage
Click to expand...
Click to collapse
Is this for Linux (which I don't have) and if so, is there a Windows version?
short answer: yes its only for linux
long answer is a plea for help i posted in the nandroid thread about it:
I was wondering if there was a method to use the yaffs3 command to make a system.img from an unzipped rom placed on the sdcard through ADB, from what I've seen nandroid is almost exactly what I'm after.
The issue of why I can not just do this through linux, i can. I just want to be able to do it through windows some way without loading the entire rom on the phone and nandroiding the system.img out.
Either the aforementioned method, or the ability to mount a portion of my computers hard drive as a recognizable mountable partition within android running on the usb connected phone, loading the rom on that partition, unzipping it there, running ADB and making the system.img. But this way seems to bring up more problems than it's worth.
Or.. running the make yaffs3 command through ADB running the emulator with the rom unzipped on the virtual sdcard. This would actually be the best option as it would not require an actual phone.
I hope someone can help. Thank you very much.
Click to expand...
Click to collapse
hopefully someone knows the answer, I'm still trying though.
so on windows we would adb push the update.zip to the sdcard on the emulator
unzip it on the sdcard, there are apps for that
adb shell mkfs.yaffs2 sdcard/<extractedzipfilename>/system/ sdcard/system.img
adb pull the newly created system.img and proceed to load it in the emulator
i know im missing a ton here, please someone correct me
I'd love to be able to run these images in the emulator on windows!
ggolemg said:
thats the easy part
do a nandroid backup
copy the sdk/platforms/android-1.5
to something like sdk/platforms/MINE
go to your AVD directory AVD/whateveryoucalledit
open up the config.ini
edit:
skin.name=HVGA
skin.path=platforms\MINE\skins\HVGA
image.sysdir.1=platforms\MINE\images\
go to your nandroid backup on your sdcard
copy system.img
go to sdk/platforms/MINE/images/
and paste the nandroid system.img
now run your AVD and it will boot that system.img
im running CyanogenMod rom right now in the emulator
hint* number pad 7 with numlock off in the emulator is how to open up the hardware keyboard
Click to expand...
Click to collapse
Hm, the emulator just hangs on the ANDROID.. message, similar to when the standard system.img was in.
anyone figure out how to do this on a mac?
thanks if anyone can.
johnnylicious said:
anyone figure out how to do this on a mac?
thanks if anyone can.
Click to expand...
Click to collapse
I found this somewhere else and take no credit for it. I did shorten the steps.
Of course this is once you have the sdk installed on your mac
1. Run Terminal, and change to the 'tools' directory of the SDK (or add the tools directory to the path settings in ~/.profile).
2. Type './android list target'
3. Note the 'id' number of the '1.5' target (in my case it's '2')
4. Type './android create avd -n enhanced -t 2' (substitute 2 with the target number determined above if required)
5. You will be prompted to create a hardware profile. {You can leave as default no}
6. Use nandroid to create a backup then copy system.img
7. Copy file to ~/.android/avd/enhanced.avd/system.img
8. You're ready! Type './emulator -avd enhanced' to run! Note: inital boot may take a few minutes!
Can anyone post up the
Android Yaffs2 Tool (Both X86 And ARM)
for download? The above link doesn't work. I did a google search and all the D/L links are referring to the same location.
thanks!

GUIDES & FAQs [Android]: ADB Workshop by Adrynalyne and Guide by Captainkrtek

DO NOT POST IN THIS THREAD BEFORE READING THE WHOLE POST
PLEASE ADD GUIDES TO COMMON ISSUES YOURSELVES
To my recollection, the previous WM Guides thread was successful.. so we'll be moving on to android as well - from beginner to pro.
I hope this thread will provide answers to a decent percentage of your questions.
Please hold until guide collecting is finished..
In the meanwhile you are ALL invited to send me links or full guides to add to this thread.. remember, we are all about sharing.
COMING SOON! (in the meanwhile, you've got a great battery life guide at http://forum.xda-developers.com/showthread.php?t=471521 - be sure to thank BruceElliot for it!)
also, if you decide to post a guide, please keep the guide as neat as possible, with a title containing the LEVEL ([BEGINNER], [INTERMEDIATE], [PRO]) and the commonly searched words so that people who look for it can find it easily. (if you can, use the same color (dark orange) and same size (4) and Bold.. for the main title.. tho that's not a must )
post #2. [BEGINNERS+INTERMEDIATE] Replacing System Files using Android Commander
post #3. [EVERYONE] ADB Workshop by Adrynalyne and Guide by Captainkrtek
post #4. [QUICK FAQ's] Common QnA's for beginners by Timmymarsh (work in progress)
[BEGINNERS] Replacing system files using Android Commander
Replacing system files using Android Commander:
(This post was formally based in the HD2's RTL support thread and revolved around our need to replace frameworks)
so:
1. Download the android SDK from: http://dl.google.com/android/android...08-windows.zip
2. EXTRACT(!!!) the android-sdk-windows to c:\
(make sure you extract the dir - not run the setup from inside the zip file)
3. install Android Commander from http://androidcommander.com
4. Connect your device and make sure it's set to Debugging mode in /settings/applications/development/
5. You might have to set a dir containing your adb.exe file. set it to c:\android-sdk-windows\tools\
6. You will see a Total Commander-like interface. you can then copy the framework.jar file to the correct directory (there's no difference between SD android builds and androids in ROM - the system dir will be shown the same way)
a. Yes, you can replace/delete system files while android is running.
b. (for androids running from SD) Any file copied to /sdcard/android/root/system/X will be copied to /system/X in the system file. The sdcard/android root dir is JUST LIKE your root in ROM androids.
c. Make sure you either created a backup or verified a match in any other way before replacing files like frameworks, zimage, modules, etc.. your android might not boot afterwards (I keep all system.ext2 files backed up so that i can restore them incase i screw something up.)
enjoy
[EVERYONE] ADB Workshop by Adrynalyne and Guide by Captainkrtek
This following guide was rewritten by Captainkrtek, please make sure to thank him for it
Original Post:
(http://forum.xda-developers.com/showthread.php?t=879701)
This workshop was held in #android-learning on irc.freenode.net by XDA Member Adrynalyne. All credit to him for this guide, I simply am taking it and turning it into a guide. Here we go!
You can find the raw IRC log here
Good evening folks, and welcome to my ADB workshop. This is by no means a full explanation on the subject, but more of a crash course to help folks get up to speed, and get more from their devices. There may be some things you already know here, so please be patient and respect those who do not.
Reference Files
http://adrynalyne.us/files/How to install adb.pdf
http://adrynalyne.us/files/Using ADB.pdf
So, lets just start with the basics.
What is ADB?
ADB stands for the android debugging bridge and is used for testing and debugging purposes by developers.
However, we like to get more out of our devices, and its a great way to fix things.
Knowing adb can mean the difference between a paperweight and a working phone.
So, to start with, we will look at installing ADB.
Generally speaking, the Sun/Oracle JDK is required to run all SDK functions.
ADB is but one tool in the SDK arsenal.
So, we begin by downloading and installing the JDK. This can be found here:
https://cds.sun.com/is-bin/[email protected]_Developer
Choose your OS, download and install. I recommend that 64 bit users use the regular x86/32 bit version as well.
Moving ahead, we download the Windows sdk from here:
http://dl.google.com/android/installer_r08-windows.exe
Due to already installing JDK, you won't be stopped by the install process.
Now, if you notice, I installed it to:
C:\android-sdk-windows
I did this because it makes things easier when setting up path variables.
I encourage everyone to do the same, but obviously it is not required.
So, this SDK is handy, but is only good up to 2.2. We want the latest and greatest! (Well I do)
So, we navigate to:
C:\android-sdk-windows\
and we run SDK Manager.exe
If you notice in your PDF file for installing adb, you will notice that you can update, and I made a choice not to include earlier sdk versions.
I won't go into full detail on that, but depending on the version of SDK you have, 8 or 9, it WILL make a difference in using adb.
By default, for version 8 adb.exe resides in C:\android-sdk-windows\tools
By default, for version 9 adb.exe resides in C:\android-sdk-windows\platform-tools
We will assume version 9 in this guide
Really, the SDK is installed and adb is usable right now, but in my humble opinion, its not enough
I like the ability to use adb in ANY directory on my machine.
To do this, we edit Windows's environment variables.
Specifically, the system path.
To do this, we click on start, or the orb (depending on OS), and right click on Computer, left clicking on properties in the menu.
If its windows XP, I believe it brings you into advanced system properties immediatly. Vista and 7 need a second step.
On the left hand side, as you notice I have highlighted in the pdf, left click advanced system settings.
Under advanced tab, we left click environment variables...
There are two boxes here.
We are concerned with system variables, however.
So we scroll down the list and highlight path and click edit.
Ignoring all the extra stuff in here, make sure you are at the end of the line, and type
Code:
;C:\android-sdk-windows\platform-tools
The semicolon allows us to separate it
from the previous path statement.
Click ok all the way out.
We now have ADB setup globally. We can use cmd.exe (I use powershell) and no matter what directory we are in, adb is recognized.
If it is not, make certain you entered the path into system variables, and made no typos.
If you installed to a different location, you will need to adjust the path accordingly.
This concludes the section on installing the Android SDK to use ADB.
This next section will be on using ADB, so please open that pdf now.
Now, this applies to any OS, not just Windows.
Well, with the exception of the USB drivers.
I will not go too much into that, but if you take a look at the PDF, it goes through installing usb drivers for the sdk, and how to download them.
Fiarly straightforward, in that rspect.
Now, to setup our phones to use with the SDK and ADB, we must change some settings.
First, we go to menu softkey, then settings.
We scroll down to Applications and tap it.
Under Development, we will check Enable USB Debugging. Please note the SGS phones are different in this respect.
The USB cable must be unplugged before enabling or disabling this setting.
Once this is done, we are now ready to play with adb
One quick note: If you get device not found/conencted, please reboot your phone. DJ05 has a quirk in it where ADBD randomly crashes on boot.
A reboot will fix this
ADBD= ADB Daemon
Ok, continuing on.
Lets look at installing applications. This is also known as sideloading.
Unlike installing from the SD card, it does not require unknown sources to be enabled.
The command for this is
Code:
adb install packagename
This assumes that you are working from the directory where the file is located.
This will install the application to /data/app.
It will also show sometimes useful errors if install fails.
That is not something you will see from the Android GUI.
Now, a lot of us have probably deleted files with apps like Root Explorer. While this isn't really a bad thing, it leaves behind databases and data for the application removed.
This is where the 0kb applicaiton entries come from.
If you take that application entry name, you can uninstall the extra data via adb.
First we go to the adb shell which logs into the phone.
Code:
adb shell
If we end up with a $, we will want admin rights, in many cases. This is not one of them, I don't beleive.
To get admin rights, you want to type
Code:
su
Look at your phone if this is the first time, it may prompt you to allow access. Else you will get permission denied.
If you are not rooted, this will not work either.
Ok, now that we are logged in, we will type
Code:
pm uninstall packagename
where packagename is the name of the 0kb listing.
Now this seems like a pain in the a** and I agree.
HOWEVER
There will be a time where Manage applications crashes when you try to uninstall it from the phone. In this case, a factory reset, or this method is the only effective way to fix the problem.
Moving on.
How many of us have removed system applications or renamed them? Did you know that you can simply disable them from the system?
Code:
adb shell
su
pm disable appllicationname
This will disable it, and the system will ignore it.
This can be seen as safer than deleting or renaming things, but your mileage may vary.
On the other hand, you can also re-enable these applications.
Code:
adb shell
su
pm enable applicationname
Please note: Not all applications will properly re-enable. I believe a factory reset or reinstall of said application will fix the issue.
Also, application names are absolutely case sensitive.
*nix based Operating Systems see the letter 'a' and 'A' as two different things.
when you log into adb shell, you are playing by android rules
Ok, a lot of us tweak and mod our phones and turning off the device to get to clockwork recovery, or battery pulls, or multiple button holds to get into Download mode are troublesome and annoying at best.
ADB can help us here.
Here, we do not need to be logged into the shell
If we want to merely reboot the phone:
Code:
adb reboot
If we want to go to recovery (works well with voodoo5)
Code:
adb reboot recovery
If we want to go to Download Mode because we need Odin, heaven forbid:
Code:
adb reboot download
Its instant. No waiting on animations or anything else.
Its also handy if Android has locked up, but yet still works in adb.
I for one hate taking my case off to battery pull.
So now we move on to pushing and pulling files.
Sometimes, I don't feel like mounting my sd card to copy a file over to my phone.
I can use this command to push a file straight to my sd card:
Code:
adb push filename /pathtodirectoryonphone
So for instance, if I have test.txt that I want to send, I would type:
Code:
adb push test.txt /sdcard/
and there it goes.
Ok moving on
Pushing files can be done to any directory, however, some are protected.
For instance, /system is going to give you a permission denied or a read only filesystem error.
To get around this, the easiest thing to do is push the file to your sdcard, then log into the shell:
Code:
adb shell
Code:
su
We will then mount the system as writable
Code:
mount -o rw,remount /dev/block/stl9 /system
Then we can use something like
Code:
cp /sdcard/test.txt /system/app/test.txt
cp stands for copy
and it requires the path of the file and destination path. The name of the file is optional
When you copy it, you can rename it to whatever you like.
For instance, if we wanted to backup a file
Code:
cp /sdcard/test.txt /sdcard/backuptest.txt
Now, lets assume you do not have busybox installed.
You non rooted users will not.
Then you must use a slightly more complicated command called dd
This is used like this:
Code:
dd if=/sdcard/test.txt of=/system/app/test.txt
if is for inputfile
of= output file
Not every user friendly, but probably one of the safer copy commands.
Ok, moving on to pulling files.
Lets say you want to get a file from your phone, to modify, backup, etc.
To do this, we simply use adb in this manner:
Code:
adb pull /pathtofile/filename destinationname
For instance, if I wanted to backup ADW launcher in system/app
I would do this
Code:
adb pull /system/app/ADWLaucnher.apk ADWLauncher.apk
And it will pull the file from the phone and put it in the current directory.
Like above, you can specifcy where it goes.
pushing files to the sdcard, it seems prudent to talk about changing permissions.
sdcards are typically fat32, which destroys permisisons, and Android is heavily permission based.
So if you push an application to your sd card, then try to copy it to /system/app/ bad things are going to happen, or the app may not even show up.
So in that case, we use something called chmod.
This is used in this manner
Code:
adb shell
su
chmod 755 /pathtoapplication/applicationname
Keep in mind
you dont want to do this while its still on your sd card.
an example
Code:
adb shell
su
chmod 755 /system/app/ADWLauncher.apk
755 is good for applications and script files.
Just a couple more topics to cover.
Lets go over deleting files.
This becomes especially handy for removing rogue applications.
To do this, we must be in the adb shell.
Code:
adb shell
su
rm /system/app/ADWLauncher.apk
You may need to remount system as writable with:
Code:
mount -o rw,remount /dev/block/stl9 /system
That applies when using chmod as well.
So what I did above was delete ADW Launcher from system/app
However, what if I wanted to delete the entire contents of a directory?
Same thing as before, except
Code:
adb shell
rm -f /data/dalvik-cache/*.*
I just cleared my dalvik-cache with that command
very quick, very effective.
If you just tried that, please reboot your phone now
Ok....this leaves us with the final topic: logcat
logcat allows us to log what the OS is doing, and possibly delve information for when things are not working
its quite simple Reading it is another.
To use logcat
Code:
adb shell
logcat
To logcat to a certain file do
Code:
adb shell
logcat > /sdcard/logcat.txt
Now we let the log settle down to a reasonable amount of data coming in and not a wall of scrolling, then start the app in question. When it gives an error, we hit ctrl-C and kill the adb shell session.
This should have captured enough data to see the error. Now, I prepared an example. A user came to me on IRC, and Google Maps was force closing. Clearing data didnt fix it, Clearing dalvik-cache, and fix permissions did not fix it. In this case, the user did not know how to use adb So I had him grab an app called alogcat from the market and email me the log. This is also a very valid method.
this file explains what the problem was, and highlights what to look for as an example.
http://adrynalyne.us/files/logcat.pdf
___________________________________________________________________
This concludes the guide from Adrynalyne, there will be more workshops such as this one in irc.freenode.net #android-learning.
Thanks to everyone in #samsung-fascinate !
QUICK FAQ's
sources: Q&A Section, The Weekly Q&A Section by XDA News Writers (thanks guys)
Q: ‘Is there any way to block specific apps from using my data connection?’
A: Try the Droid Wall application.
Q: ‘I read how you can make changes in the build.prop file on my Android device. How exactly do I get to it?’
A: Install ASTRO file manager, browse to /system, long press on build.prop – Edit – Copy. Press on the home icon then Edit icon – Paste. Connect sd card, edit it, and paste it over from where you copied build.prop
Q: What happens if I update my phone? will I need to re-root it and get the ROM again? will all of my applications get erased? If so, is there a way around this?
A: You will lose your root, but not apps if it is just an update.
Q: I just tried to flash a ROM from recovery on my Android phone and got “Verification Failed, Installation Aborted” What happened?
A: Before you can flash a custom ROM the .zip file must be digitally signed in the ROM kitchen, if unzipped and re-zipped it will lose its verification, this happens often using the Safari browser as it likes to decompress .zip’s. Or if your download is corrupted (download the ROM again) it will fail the Verification.
Q - HTC Location Widget shows "map data unavailable"
A - On the widget, click the pin/then click the windows button/click get more/scroll to download maps/download relevant map (care, maybe a big file). Now exit and click onto map, your location should now be visible :)
Q:So, I moved all the apps on the SD, but is still not enough. How can I free some memory? I could delete the cache of the older upgrade or something else?
A:Do you have pictures and videos? If so, check if they are on the SD card and not on your internal memory. Cleaning your cache helps, and try deleting your text messages threads.
Q: ‘What exactly is a kernel and what are the benefits in changing it?’
A: A kernel is a bridge between the applications and the actual data processing done at the hardware level. The kernel’s responsibilities include managing the system’s resources – the communication between hardware and software components. Flashing different kernels gives you different operating speeds, better battery life, the ability to overclock, and more.
Android control other device with IOIO Board.
It use ADB.
http://androidcontrol.blogspot.com/2011/10/ioio-board-for-android-control-io.html
timmymarsh said:
QUICK FAQ's
sources: Q&A Section, The Weekly Q&A Section by XDA News Writers (thanks guys)
Q: ‘Is there any way to block specific apps from using my data connection?’
A: Try the Droid Wall application.
Q: ‘I read how you can make changes in the build.prop file on my Android device. How exactly do I get to it?’
A: Install ASTRO file manager, browse to /system, long press on build.prop – Edit – Copy. Press on the home icon then Edit icon – Paste. Connect sd card, edit it, and paste it over from where you copied build.prop
Q: What happens if I update my phone? will I need to re-root it and get the ROM again? will all of my applications get erased? If so, is there a way around this?
A: You will lose your root, but not apps if it is just an update.
Q: I just tried to flash a ROM from recovery on my Android phone and got “Verification Failed, Installation Aborted” What happened?
A: Before you can flash a custom ROM the .zip file must be digitally signed in the ROM kitchen, if unzipped and re-zipped it will lose its verification, this happens often using the Safari browser as it likes to decompress .zip’s. Or if your download is corrupted (download the ROM again) it will fail the Verification.
Q - HTC Location Widget shows "map data unavailable"
A - On the widget, click the pin/then click the windows button/click get more/scroll to download maps/download relevant map (care, maybe a big file). Now exit and click onto map, your location should now be visible :)
Q:So, I moved all the apps on the SD, but is still not enough. How can I free some memory? I could delete the cache of the older upgrade or something else?
A:Do you have pictures and videos? If so, check if they are on the SD card and not on your internal memory. Cleaning your cache helps, and try deleting your text messages threads.
Q: ‘What exactly is a kernel and what are the benefits in changing it?’
A: A kernel is a bridge between the applications and the actual data processing done at the hardware level. The kernel’s responsibilities include managing the system’s resources – the communication between hardware and software components. Flashing different kernels gives you different operating speeds, better battery life, the ability to overclock, and more.
Click to expand...
Click to collapse
Thank you for your patience and taking the time to answer those questions. I loved your simple and easily digestible format.
There is a note
*nix based Operating Systems see the letter 'a' and 'A' as two different things.
when you log into adb shell, you are playing by android rules
Click to expand...
Click to collapse
this note is all wrong..
1. linNUX is not *NIX.
2. Mac OS-X is a *NIX OS, it is based upon UNIX, they use their own variant called Darwin. Darwin does not require capitolization.
3. The word should be POSIX. Linux is POSIX compliant and POSIX defines the capitolization standardards
soft brick
Taioba said:
Is there any way to use ADB even though I can not enable USB debugging by the android?
I have an Atrix with soft-brick. How can I restore a file (framework-res.apk) knowing that my USB debugging is off?
I can enable ADB via fastboot?
Thanks!
Click to expand...
Click to collapse
I found this for atrix 4g....
http://forum.xda-developers.com/showthread.php?t=965546
hope it helps
knoknot said:
i have a bricked s2 not so sure how to go about reviving it via adb
Click to expand...
Click to collapse
check this thread
http://forum.xda-developers.com/showthread.php?t=1237815
thanks. searched for that
Thanks for it.
Great Guys............ :good:
Thanks for sharing.
Thanks for sharing this guild :d, i am new member for reccod
Great job~ Sometimes could be used this.
I'm using Windows 10 RTM and I've set the path, yet I still get the "unrecognized application" error in the command console. What am I missing?
Nevermind, a restart fixed it. Used to be you didn't have to.... sheesh.
nir36 said:
Replacing system files using Android Commander:
(This post was formally based in the HD2's RTL support thread and revolved around our need to replace frameworks)
so:
1. Download the android SDK from: http://dl.google.com/android/android...08-windows.zip
2. EXTRACT(!!!) the android-sdk-windows to c:\
(make sure you extract the dir - not run the setup from inside the zip file)
3. install Android Commander from http://androidcommander.com
4. Connect your device and make sure it's set to Debugging mode in /settings/applications/development/
5. You might have to set a dir containing your adb.exe file. set it to c:\android-sdk-windows\tools\
6. You will see a Total Commander-like interface. you can then copy the framework.jar file to the correct directory (there's no difference between SD android builds and androids in ROM - the system dir will be shown the same way)
a. Yes, you can replace/delete system files while android is running.
b. (for androids running from SD) Any file copied to /sdcard/android/root/system/X will be copied to /system/X in the system file. The sdcard/android root dir is JUST LIKE your root in ROM androids.
c. Make sure you either created a backup or verified a match in any other way before replacing files like frameworks, zimage, modules, etc.. your android might not boot afterwards (I keep all system.ext2 files backed up so that i can restore them incase i screw something up.)
enjoy
Click to expand...
Click to collapse
Thanks, this Guide is very informative
Help with LG D722
I'm using LG D722 phone and I somehow unlocked bootloader and installed twrp recovery. I backed up Lollipop that's what I'm using and i want to restore custom ROM
I know I need to install Google Apps after installing Custom ROM. But Do I also need to install Modem files on my device ? Because I can't find them on XDA Forums. Please give me a link or something. The help is not just appreciated but seriously needed.
Success. Thanks
Hello, I walk testing one recovery but I'm booting before flashing, the question is, will the recovery feel same when booted vs flashed? I've booted and used to flash a pair of zips but felt very laggy and bugged although did the work right. Thanks
Edit: solved, tried myself
Sent from my SHIELD Tablet K1 using XDA-Developers mobile app
http://forum.xda-developers.com/showthread.php?t=872128&page=2

Ubuntu / Backtrack on Android [Complete Solution]

This guide had been on the Thunderbolt forum for quite some time and I decided it was time to share with the rest of the community
Having reviewed almost every other option I can safely and honestly say this is the most simplified, thorough, and customizable install available since its original launch. I will gladly retract this statement when it becomes false, but until then...
Installing Ubuntu onto Thunderbolt/Droid/Droid2/Etc:
Create a folder on the sdcard named ext2ubuntu, which is /sdcard/ext2ubuntu when listed in terminal or adb
Required files for Ubuntu install:
Ubuntu.sh http://db.tt/KgDNlMtb
Custom Packages for AutoConfig:
Coming soon
You will also want to download either an ubuntu image or archive. The major difference is that the image must be the same size as your ubuntu installation, so they are larger downloads, or need to be resized before you use them.
Ubuntu Prebuilt tar and img downloads:
(img: Extract only ubuntu.img and place in /sdcard/ext2ubuntu)
(tar: Rename, if desired, and put archive in /sdcard/ext2ubuntu)
10.04: http://android-cruft.googlecode.com/files/lucid-on-android-0.1.tar
(This image DOES need to be resized, see next post)
10.10 img: http://www.megaupload.com/?d=56AT71WD
(This image file does NOT need to be resized)
11.04 tar: http://db.tt/fuzoy8Te
Backtrack img: http://bit.ly/kJweA9
Borrowed from http://forum.xda-developers.com/showthread.php?t=1146255
(This image file does NOT need to be resized)
How to build your own Ubuntu Image:
http://androlinux.com/android-ubuntu-development/how-to-build-chroot-arm-ubuntu-images-for-android/
Notice:
The ubuntu mount folder is symlinked to /system/sd-ext allowing access to it there also.
First off you should have a running ubuntu install on your computer or at least a live cd running to create the ext2 partition.
Use gparted to add a 4gb (or whatever size you want) ext2 partition to your sdcard. I did this while the phone was mounted in disk drive mode, so you dont need to take the card out.
Ubuntu: Get gparted in synaptics or in terminal enter:
Code:
sudo apt-get install gparted
Widows: *Paragon Partition Manager*
If you do not need to partition, skip this step.
Use adb to run /sdcard/ext2ubuntu/ubuntu.sh
Code:
adb shell
su
sh /sdcard/ext2ubuntu/ubuntu.sh
Or from terminal (only supported on some ROMs)
Code:
su
bash /sdcard/ext2ubuntu/ubuntu.sh
All required scripts will download and install themselves automatically. Currently only ubuntu.sh and the chosen ubuntu image need to be placed in /sdcard/ext2ubuntu for proper install. Scripts include an autoupdate feature that will also keep them current.
Follow the instructions and select the appropriate options for your system configuration and download choices.
You can now open terminal and type "bootubuntu" to test install
A new Sdcard Direct option was added allowing user to replace the installed scripts with a unified "ubuntu" command that runs the scripts directly from the sdcard. This option was offered due to the frequency of updates to allow the user to simply replace the files in /sdcard/ext2ubuntu with newer versions that would run without any further steps.
If you get a localhost prompt, you are in but still need a couple things to move past command line.
Here is where we part from borrowed and modified instructions that recommend lxde and ice and all the dinky handheld ubuntu shells, and move to the Thunderbolt method.
Update vs Restore scripts: Update will base what scripts are put in system on the ones currently there, while restore determines what scripts are currently available on the sdcard.
For automatic installation of ubuntu applications, you will want to enter these commands next:
Code:
su
backubuntu
4
Choose your options
To view your ubuntu desktop, you will want a vnc viewer for android. I use real vnc, but android-vnc-viewer is free and has all the same features (i just liked the layout of realvnc)
The address for ubuntu is 127.0.0.1
The port is 5901
The password is the tightvncserver one you set.
i recommend making a folder named android in "your mounted ubuntu folder"/home/ for your personal files since /root is your local folder, but causes permission issues.
From your new ubuntu you can use synaptics and download eclipse there, but it can also be downloaded from the localhost prompt using "apt-get install eclipse" I also recommend downloading the android-sdk. To run the sdk from the localhost prompt, simply cd to the android-sdk directory and issue the command:
Code:
tools/android update sdk -u -s
and if you want to specify the downloads performed add
Code:
-t [specific items such as platform, platform-tool]
If you need help with any commands you can add
Code:
-h
to your existing command
The htc kitchen can be downloaded from ubuntu using the same instructions found: http://forum.xda-developers.com/showthread.php?t=633246
After it is installed, you have the option to launch this kitchen either from inside your ubuntu install, or from the localhost prompt, which avoids having to run vnc to use it.
A compiler toolchain is available http://www.codesourcery.com/sgpp/lite/arm by choosing download the latest release. I use gnu/linux even though it seems to be eabi included in the android source, but I have never used it to be sure. I have been told this one is a lot easier to use anyway.
I recommend backing up the ext2 once everything is done. This can be done by (entering "exit" at the localhost prompt and then) entering "backubuntu" in terminal.
backubuntu can also update newly downloaded scripts without having to use root explorer or worry about permissions. Just put any new versions in your sdcard/ubuntu folder and select the update option.
This replaces the ubuntu2.img with your backup so you dont have to "apt-get" everything over again. This will also save your tightvnc password so make sure you remember it.
Sent from my ADR6400L using Tapatalk
Screenshots:
https://picasaweb.google.com/110545...authkey=Gv1sRgCLDd48n2oMWzpAE&feat=directlink
References:
Personal insanity and the inability to accept whats already available
http://code.google.com/p/android-cruft/wiki/LucidWithAndroid
http://androlinux.com/android-ubuntu-development/how-to-install-ubuntu-on-android/
http://nexusonehacks.net/nexus-one-hacks/how-to-install-ubuntu-on-your-android/
http://forum.cyanogenmod.com/topic/15702-ubuntu-on-your-g2-anyone/
http://forum.xda-developers.com/showthread.php?t=633246
http://www.codesourcery.com/sgpp/lite/arm
http://forum.xda-developers.com/showthread.php?t=987740
http://androidclone.com/forums/showthread.php?tid=23
Sent from my ADR6400L using Tapatalk

[Q]How can I extra the system.img file

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.

[Q] unpack userdata***.backup from cwm on windows

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 | 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​
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?

Categories

Resources