If you want to delete an app, change a file or whatever when you get root, please be smart about it. Think before you delete something. Have a plan B (a failback plan). If you don't know how you will fix whatever you're about to potentially break, DON'T DO IT.
Try to learn ADB. I know it's not for everyone, but it may pull you out of the fire later. Think before you do anything.
No matter what Android device it is, someone always has a post saying "Help! I deleted <insert app here> and I need it back!" Here are some tips:
Don't freeze or delete an app using Titanium Backup without knowing if it will crash your phone or not
If you're using ADB, rename a file instead of deleting it if you're not sure if it will crash your phone or not
Your /system folder is like the base operating system folder (think C:\Windows); before you change something BACK IT UP!
Code:
adb pull /system <destination_folder>
Since we only have temp root for now, if you're disabling packages, back up the packages.xml file
Code:
adb pull /data/system/packages.xml <destination_folder>
Learn from others' mistakes; if someone bricks their phone, read the thread and figure out how NOT to screw yourself and your phone
Heard of measure twice, cut once? Read three times, execute once. Listen to the Devs. Be nice to them. Don't piss them off. They do this on their own time.
Please be smart about whatever you do to your phone. We can't be dumb smart phone users. If you don't know something, ask in the appropriate section or thread. If you know something, don't tease others for not knowing. The occasional flame is funny and all, but at some point someone has to learn whatever they don't know - someone is going to have to step up and help them.
Thanks dawg...
I think and SD backup and Nandroid recovery backup on root will be good enough? <not condascending...just asking from your adb opinion?>
ROM_Guest said:
Thanks dawg...
I think and SD backup and Nandroid recovery backup on root will be good enough? <not condascending...just asking from your adb opinion?>
Click to expand...
Click to collapse
I think of that as another layer. We're not there with the Sensation yet, but I always think it's a good idea to use any and all methods best suited for what you're doing.
For example, if you're flashing a theme someone customized which could change multiple apk and jar files, a Nandroid backup is best.
When someone goes to remove an apk or freeze an app, they usually don't think to take a Nandroid backup (because deleting or freezing takes only a second - Nandroid backups take longer).
1) we don't have that functionality yet and 2) it's very common for someone to try to freeze a critical app which can cause a boot loop, which can easily be fixed by adb (if a Nandroid is not available).
i tried:
adb pull / backup/
it started building a file list and then started the copy. after a time (dont know excatly when because i let it run beside) it stoped working at:
pull: /sys/devices/platform/msm_adc/batt_id -> backup/sys/devices/platform/msm_adc/batt_id
nothing more happend. now i got 4883 files, a total of 3.1 GB, backup directory. but it seems not all files are in. when i browse through the phone dir i see much more files in the dirs.
is there any other way of getting a complete backup? when i rerun the command will it skip the files it allready dumped to disk? any other command?
thx!!!
daSn00p said:
i tried:
adb pull / backup/
it started building a file list and then started the copy. after a time (dont know excatly when because i let it run beside) it stoped working at:
pull: /sys/devices/platform/msm_adc/batt_id -> backup/sys/devices/platform/msm_adc/batt_id
nothing more happend. now i got 4883 files, a total of 3.1 GB, backup directory. but it seems not all files are in. when i browse through the phone dir i see much more files in the dirs.
is there any other way of getting a complete backup? when i rerun the command will it skip the files it allready dumped to disk? any other command?
thx!!!
Click to expand...
Click to collapse
All you really need is /system and /data if you want a complete backup. I know you see other files+folders, but those are mounted by the OS and kernel... or whatever. Someone with more Linux experience can explain better than I can. But if you want a complete backup, just get /system and /data.
The /system folder is like getting the base OS. The /data is all your user/personal data.
dumping /system worked fine: 1366 files pulled. 0 files skipped.
when trying to dump /data it freezes again and allways again at:
pull: /data/d/smem_log/dump_cont -> ../backup2/data/d/smem_log/dump_cont
so i dumped every dir in data manually only /data/d is missing now. but there are so many dirs in it, i dont want to dump every dir on its own
any idea?
daSn00p said:
dumping /system worked fine: 1366 files pulled. 0 files skipped.
when trying to dump /data it freezes again and allways again at:
pull: /data/d/smem_log/dump_cont -> ../backup2/data/d/smem_log/dump_cont
so i dumped every dir in data manually only /data/d is missing now. but there are so many dirs in it, i dont want to dump every dir on its own
any idea?
Click to expand...
Click to collapse
That should be good enough for now. No one else is doing this manually, so until we get an official root this is all you can do to backup. Once we get permanent root, titanium backup will do most of this for us.
I would only make backups of anything you change or delete at this point, but that's just me.
Sent from my HTC Sensation 4G using XDA App
Related
I'm using Fresh Rom 2.1 and I accidentally used Fresh Kitchen to install a 1.5 version of Sprint TV and the Sprint TV Widget on my Hero. After the automatic reboot, it goes to a black screen and never finishes booting.
After talking with fresh, i used adb to remove the Sprint_TV.apk and Sprint_TVWidget.apk from the system/app directory but the phone still does not boot.
Do the apk's need to be unregistered somewhere? Is there anything I can do to get this to boot without using a nandroid restoration? (my last one is two months old :/ )
re:
have you tried also removing the .odex of those files. I dunno if it would acttally make the .odex's during boot but worth a try right?
where are the odex files located? sorry for still being a little noob at the FS
In my honest opinion, this is why noobs shouldn't learn how to mod their phones with 1-click solutions. You learn more about the phone doing it the manual way.
But to answer your question, the .odex files are in the same directory that the app itself was. For example, Cats.apk and Cats.odex are both in /system/app. The commands to remove them would be:
adb shell
cd system/app
rm Cats.apk
rm Cats.odex
Please note that I'm only using Cats.apk and .odex as an example
Check /data/app and /data/app-private for any thing to do with the apps.
Try to wipe dalvik cache and reboot first.
@mrinehart - all us noobs have to start somewhere but thank you for the location of the odex files. After doing an ls determining the name of the apk file the first time, no odex files were listed in that directory.
@Jus10o - There was a second copy of Sprint_TV.apk in the data/app-private. I removed this file and the phone still did not want to come up. At this point i'm assuming its not necessarily the app that corrupted the boot but the way it was installed. I'm doing a factory reset and starting over tonight.
Thank you both for your time!
savesheep said:
@mrinehart - all us noobs have to start somewhere but thank you for the location of the odex files. After doing an ls determining the name of the apk file the first time, no odex files were listed in that directory.
@Jus10o - There was a second copy of Sprint_TV.apk in the data/app-private. I removed this file and the phone still did not want to come up. At this point i'm assuming its not necessarily the app that corrupted the boot but the way it was installed. I'm doing a factory reset and starting over tonight.
Thank you both for your time!
Click to expand...
Click to collapse
I hope I didn't come off as rude but before you RUU (if thats what you mean by factory reset), try clearing your dalvik-cache and wipe DATA.
It's alright, you had a valid point.
Unfortunately I didn't see the first post about clearing the dalvik-cache folder It's been almost a day without the phone so I had to go ahead and RUU it.
HOWVER, I DID do a nandroid backup of the system while it was in its reboot loop phase. I'm very curious as to what caused it and if clearing the dalvik-cache folder would fix it or not so I may revert to that nandroid backup at a later time just to attempt a solvent. I'll update you if I do.
Thanks again
Hi there,
Is there a way to temporary root my Nexus S [I9020XXKD1] or alternatively a non-root way to access /data so that I can copy a file in and out? Essentially I want to be able to backup and restore some game saves
Most posts I've read basically have folks saying "Just root it", which is good advice to most but isn't right for me - I really don't want to have to wipe my phone and I'd also like to be able to dip my toe into rooting before taking a full leap. That, and aside from needing this one file in /data my phone works exactly as I'd like it to
I only need "su" access for a brief moment to copy off a file to and from /data. I set up the android sdk but ADB didn't work because of the protection of "production builds".
VISIONary seemed like the right kind of thing, but I don't believe it works for the Nexus S or recent firmware, so while temp rooting would be nice so would any solution that allows me to backup and restore some files in /data.
At the moment I am wondering if writing an apk of my own that copies/replaces this one file is the way to go - but that seems perversely long way around!
So any help/suggestions most appreciated
There is no temporary root for the Nexus S. You're either rooted, or you're not. However, if, perchance, you are on Android 2.3.2 or earlier, you might be able to root without wiping.
Without root, you cannot see the files in /data, but you can read/write the files directly if they have the proper permissions and you know the exact path/filenames. After poking around a bit, it seems that read & write permissions vary among apps. Most apps have full permissions reserved for the parent app. Some allow other apps/user to read some files, and read+write others. (The permissions being app-specific, if it can't be done by command line, I doubt it could be done by creating an app, either.)
So, what is the game? Perhaps I can do some exploring.
If you have the old bootloader (2.3.2 i think) you can boot a recovery without flashing. From you computer use "adb boot recovery.img" and boot clockwork recovery. From there you can mount and access the filysystems.
Sent from my Nexus S using XDA App
Maximilian Mary said:
There is no temporary root for the Nexus S. You're either rooted, or you're not. However, if, perchance, you are on Android 2.3.2 or earlier, you might be able to root without wiping.
Without root, you cannot see the files in /data, but you can read/write the files directly if they have the proper permissions and you know the exact path/filenames. After poking around a bit, it seems that read & write permissions vary among apps. Most apps have full permissions reserved for the parent app. Some allow other apps/user to read some files, and read+write others. (The permissions being app-specific, if it can't be done by command line, I doubt it could be done by creating an app, either.)
So, what is the game? Perhaps I can do some exploring.
Click to expand...
Click to collapse
Thanks I figured as much. The game is Dungeon Hunter 2 and essentially I am trying to implement a simple fix to make my save game work again (the fix is here: http://forum.xda-developers.com/showthread.php?t=1042675 a few posts down) but it requires root. So I do know the exact paths and filename.
Thank you for your helpful answer
Ok, I'm not having any luck here, and it's pissing me off. FYI, I don't have that game, so I'm testing it with Angry Birds. I can read and copy the file just fine, but I can't modify it without using root. The data file itself has read/write access, but the containing folder (files/) is read-only, so I can't overwrite the file after I've modified it. Since the file itself has r/w access, I wonder if it would work to modify the file directly, instead of using an outside program to modify it then overwriting it. (I'm a bit ignorant of the finer points of linux permissions.) This would require an app that would allow you to open and modify a file by typing the full path & filename, instead of just browsing the directory tree. You could also try < adb pull /data/data/com.gameloft.android.TBFV.GloftD2HP.ML/files/dh2_000.savegame dh2_000.savegame > (using the correct path, if that's not it). Then see if < adb push dh2_000.savegame /data/data/com.gameloft.android.TBFV.GloftD2HP.ML/files/dh2_000.savegame > works. The fact that you can copy the file out is promising, anyway. So even if you had to root, you could backup the file before rooting wipes everything, then fix it & back it up after you had root.
Btw, what version of Android are you on?
Edit: I think I'm getting somewhere. While you can't modify the file itself, you can modify the file contents. So something like this might work: < adb shell >
< more /sdcard/dh2_000.savegame > /data/data/com.gameloft.android.TBFV.GloftD2HP.ML/files/dh2_000.savegame >
So the next step is to get some help from someone who has the game and is rooted as to the exact path to the savegame file. Once we have that, I think we're golden. (Or, let me know if adb pull works with the path I guessed at.)
wow! Thank you for your help
In answer to your questions: my Nexus s is running 2.3.4 and you are correct about the file path (many other kind xda users died to bring us those paths ) is /data/data/com.gameloft.android.TB with the filename being dh2_000.savegame
I don't want to drive you to distraction! If I could back it up I probably would go ahead then and root the phone given how complexplaying with a non-rooted phone is!
I will try the adb pull method and let you know how I get on.
Thank you again for your help and for showing me why I probably do want to root!
I don't know if ADB is even the best tool to do this, but I want to be able to copy the entire file system off the EEE pad onto a pc. I want everything, starting from the "/" root directory. I want the entire file system and all files copied over so I can work with them on the pc.
I have root (verified by # when entering adb shell and various root apps successfully running.)
My thought was to do "adb pull /" from a dos shell (running windows 7), but not everything copies over. I get lots of messages about "skipping special file", I dont get the /data/data directory, etc etc.
Is there a tool or some way to copy over the entire file system starting from "/" ?
Thank you.
Nvflash will let you download the APP partition which is the system folder. It's an ext4 filesystem that you can mount and poke around.
USP is the data partition.
Be careful not to format your TF!
Clockwork mod will backup the system.img and you can either mount or unyaffs this. I forget which one. Same for data.img
sent from my cyanogen(mod) vision
Is the data.img same as the USP partition? Is the system.img same as the APP partition?
which I can then mount and explore?
I don't want to edit anything, I only want to examine.
In particular, I want to take a snapshot of all the files and filesystem (directory structures, files, etc) before an app is run. After the app is run and exited, I want to take another snapshot and look at what has changed. If there are new files created, existing files edited, etc. I want to search for strings (grep), etc.
I was hoping I could copy all the files to do this, but perhaps there is another way like one of those you suggested (nvlash, clockwordmod, ??)
Thank you.
Nvflash and clockworkmod wouldn't be used on a running system. You might want to look in the /proc and caches, but I'm not an expert on this.
sent from my cyanogen(mod) vision
gee one said:
Nvflash and clockworkmod wouldn't be used on a running system. You might want to look in the /proc and caches, but I'm not an expert on this.
Click to expand...
Click to collapse
Expert or not, I really appreciate your advice.
I took your initial suggestion to be to use NVflash and/or clockworkmod to make backups of the device. It seems from some other threads I've read that the tablet drive consists of up to 15 or 16 partitions, two of which are USP and APP.
So conceivably I could back those up "before", and mount the backup images somewhere to look at, preferably on a pc.
Then, I could install and run the app in question, and use NvFlash and/or CWM again to make backup images, and look at them for comparison.
On another note, I tried installing busybox and running cp to move, for example, /data to the external SD card, but I think I need a bigger SD card.
I wonder if
busybox cp / /Removable/MicroSD/targetdirectory
would work to copy everything?
The danger with that is that some directories and files are virtual- /proc and I think /var are virtual directories. Files like dev/null dev/zero would be problematic!
You might want to do specific parts, such as /data, or even /data/data/your.app's.java.name.here
You could use "find ." and write a script to pull everything with adb, but it would take forever, so it might not be a true snapshot.
Have you looked at the ddms or some of the other tools in the android SDK?
Sorry to confuse. By snapshot I did not mean screenshot. I meant just a record of the state of the device at that point in time. Meaning, all the files before the app was run. Then all the files (any new ones, changes to existing ones, any deleted) AFTER the app was run. I want to look at what has changed.
Still, thanks for the ddms idea. I have to look at any other tools in the adb environment that could be useful.
I'm posting this information because 1 I was asked to and 2 I feel it could be helpful for the "MORE ADVANCED" users.
Do Not try any of my methods, None of them. Unless you WANT to brick your phone.
With that said, here to the best of my memory is what I have done.
I pulled my framework-res file as well as the other 3 that relate to it and tried to theme them. It worked a few times and after tweaking I eventually broke the permission of the files.. Hence putting me in a bootloop.
What I did..
Thankfully I had the Bionic Safestrap installed. (DO NOT INSTALL THE SAFESTRAP) So, I was able to boot into the safestrap and use adb commands. This took some toying around. For the sake of saving people from bricking i'm not going to list all of the adb commands. But I had to mount both the /sdcard and /systemorig. Now simple enough, I just went through and rm every file from inside the folders. (Do not rm the folder, You will not be able to recover the folder and no you can not push the folder) rm all files from /systemorig /apps /osh etc.. then push all my restore files (backup made with safestrap) to the /sdcard. (For some reason they have to be placed on the sdcard before being copied to the root directory otherwise it breaks the permission of the files, idk y?) A few times in order to mount /systemorig as full rw I had to quick toggle safe mode. Now cp all files from the sdcard to their places on the phone turn safe mode off if you had to enable it and reboot. Bam, You just recovered from a soft brick. I have also used this method to restore webtop after breaking that also. Yes it does take a long time to restore and it is cumbersome but at least you can do it. I was also able to mount /emmc to /sdcard and flash a rom from the razr (yes i knew at this point it wouldn't work, this was a test) although it did not boot it did unpack and fully install the rom in the correct locations and it looked as though it would with a little more code boot from the sdcard. What i'm playing with now is trying to use the overclock method from the razr on my a2 but seems how I don't know exactly what files are being changed i'm being cautious. Sorry guys I'm not exactly a linux guy, I do what I can and I am always learning.
I'll edit this post as more info comes to mind. But to let you know I have been able to play with most files w/o fear of bricking so long as you don't mess up the .rc files in /systemorig you will always be able to boot into safestrap.
OK so after doing some research about random rooting tips and apps and what not i stumbled on a thread on xda and part of it said the following:
"EFS Folder (Important)*Ok this is more of a you must do and not a what you can now do. So the efs folder is a very important folder within your android system that contains infomation like your IMEI number, and just well important infomation trust me it's important. When people start to mod their phone such as flashing roms, kernels e.t.c, this folder can become corrupt, making you phone usless. So backing up this folder is important and their is an easy way in which you can do this, a more user friendly way using a great app by hellcatdroid. You can get this app from google play*here(ktool), and it will give you all the tools to back up the folder. I will also include a guide on further reading for you to have a look over, so please backup your efs folder."
Everyone was mentioning the importance of backing up this file, so I was gonna try. I looked up the app but I read the description and its only compatible with some devices. Would there be a way to backup our blaze EFS folder to SD card or something?
Thanks in advance for even reading this lenghy question
For my build 1 of dknight I had back up efs as a step but everyone was confused so I took it off lol the easiest way to do it is use root explorer and copy the whole efs folder to ur sdcard and that's it
----------------------------------------------
If helped don't be afraid to hit the thanks button it doesn't bite lol
Thanks ill do that then. I hate questioning you since you obviously have more knowledge on this topic, but I also read that wasn't the best way because it didn't copy permissions or something like that?
LiveFaster said:
Thanks ill do that then. I hate questioning you since you obviously have more knowledge on this topic, but I also read that wasn't the best way because it didn't copy permissions or something like that?
Click to expand...
Click to collapse
It's not the best way but it is the easiest way like I mentioned but if you're good with adb you can pull the folder through recovery and that way I think perms stay...either way it's better to save it like that then to not save it at all you know
----------------------------------------------
If helped don't be afraid to hit the thanks button it doesn't bite lol
Use Termimal Emulator or ADB (as su) and run this command:
busybox tar -cv -f efs.tar -C /sdcard /efs
Don't miss any spaces and remember that the command is case sensitive. You should have a file called efs.tar in /sdcard when the command completes. It should take under a second.
Using tar will preserve permissions. Just remember to pull the efs.tar file ASAP as it saves to the internal SD... if you leave it on the device there is the potential that the file will get wiped if something happens to the device.
Might be a good thing to incorporate into the update script ... automatically back it up just in case.
merwin said:
Use Termimal Emulator or ADB (as su) and run this command:
busybox tar -cv -f efs.tar -C /sdcard /efs
Don't miss any spaces and remember that the command is case sensitive. You should have a file called efs.tar in /sdcard when the command completes. It should take under a second.
Using tar will preserve permissions. Just remember to pull the efs.tar file ASAP as it saves to the internal SD... if you leave it on the device there is the potential that the file will get wiped if something happens to the device.
Might be a good thing to incorporate into the update script ... automatically back it up just in case.
Click to expand...
Click to collapse
I'm working on adding aroma and have it check if there is an efs backup if not then it'll back it up
----------------------------------------------
If helped don't be afraid to hit the thanks button it doesn't bite lol
erikmm said:
I'm working on adding aroma and have it check if there is an efs backup if not then it'll back it up
Click to expand...
Click to collapse
That's one of the things I miss about the Sensation. All of the ROMs used Aroma