'Restore' your display - Fire HD 8 and HD 10 General

I bring to you another script, courtesy of Amazon. This one might not suit a lot of you, so be prepared. Like most of the tricks we've tried this past week or so, even resetting the reset, may not be to your liking and can only be reverted via factory reset.
Titled 'Display,' it toggles at least three modes. i didn't quite understand them so I went ahead and ran the script in Terminal Emulator. This was also in /system/bin.
Code:
[email protected]:/ $ cd /sdcard
[email protected]:/sdcard $ sh display.sh
usage: display [<device name>|reset]
<device name>: the name of device (e.g. apollo/thor/soho) reset: setting orignal value of display for this device.
It changes size, density and values. The last one sets it back to "original value." I don't have a before shot, because I wasn't expecting anything. Cleaner, brighter, crisper and in my opinion, more HD.
Edit: the picture does no justice unfortunately.

1. Go to /system/bin
2. Locate file: display
3. Rename to display.sh
4. Copy to internal storage
5. I used Terminal Emulator
Code:
$ sh /sdcard/display.sh
Enter the command that will "reset to original" and you get sharper screen, brighter and more vibrant. Your text may look a bit smaller and folders on home also. I think this is the HD the tablet was missing.

Display Configuration:
Code:
/system/etc/display_conf
Code:
# Please add new device using the same format.
# The comments begin with "#".
device=apollo, size=1600x2560, density=320
device=thor, size=1200x1920, density=320
device=soho, size=800x1280, density=240
Followed by...
Code:
/system/bin/display
Code:
[email protected]:/ $ cd /sdcard
[email protected]:/sdcard $ sh display.sh
usage: display [<device name>|reset]
<device name>: the name of device (e.g. apollo/thor/soho) reset: setting orignal value of display for this device.

Hi
Is the actual command something like ./display.sh hostname
I ran the script with the above but said permission denied.
DragonFire1024 said:
I bring to you another script, courtesy of Amazon. This one might not suit a lot of you, so be prepared. Like most of the tricks we've tried this past week or so, even resetting the reset, may not be to your liking and can only be reverted via factory reset.
Titled 'Display,' it toggles at least three modes. i didn't quite understand them so I went ahead and ran the script in Terminal Emulator. This was also in /system/bin.
Code:
[email protected]:/ $ cd /sdcard
[email protected]:/sdcard $ sh display.sh
usage: display [<device name>|reset]
<device name>: the name of device (e.g. apollo/thor/soho) reset: setting orignal value of display for this device.
It changes size, density and values. The last one sets it back to "original value." I don't have a before shot, because I wasn't expecting anything. Cleaner, brighter, crisper and in my opinion, more HD.
Edit: the picture does no justice unfortunately.
Click to expand...
Click to collapse

smileyint said:
Hi
Is the actual command something like ./display.sh hostname
I ran the script with the above but said permission denied.
Click to expand...
Click to collapse
Go to system/bin and locate display file. Copy it and paste to internal storage then rename to display.sh. Open ADB, get a shell and type:
Code:
$ cd /sdcard
$ sh display.sh
$ display reset
If your screen is already at its properly set stage, it won't change, but you shouldn't get an error. You would see something like:
Code:
$ wm change ...
Also in system/bin is the script 'wm' which you can use to manually change your DPI to whatever you want. Perform the same steps above for the wm file.
Code:
$ cd /sdcard
$ sh wm.sh
You can use this app to monitor the changes you make to your DPI in real time. Just make sure to note the starting DPI so you can go back to it.

Thanks DragonFire1024. i cannot tell the different after resetting the display though.
DragonFire1024 said:
Go to system/bin and locate display file. Copy it and paste to internal storage then rename to display.sh. Open ADB, get a shell and type:
Code:
$ cd /sdcard
$ sh display.sh
$ display reset
If your screen is already at its properly set stage, it won't change, but you shouldn't get an error. You would see something like:
Code:
$ wm change ...
Also in system/bin is the script 'wm' which you can use to manually change your DPI to whatever you want. Perform the same steps above for the wm file.
Code:
$ cd /sdcard
$ sh wm.sh
You can use this app to monitor the changes you make to your DPI in real time. Just make sure to note the starting DPI so you can go back to it.
Click to expand...
Click to collapse
---------- Post added at 08:39 AM ---------- Previous post was at 08:31 AM ----------
Thanks DragonFire1024. i cannot tell the different after resetting the display though.
DragonFire1024 said:
Go to system/bin and locate display file. Copy it and paste to internal storage then rename to display.sh. Open ADB, get a shell and type:
Code:
$ cd /sdcard
$ sh display.sh
$ display reset
If your screen is already at its properly set stage, it won't change, but you shouldn't get an error. You would see something like:
Code:
$ wm change ...
Also in system/bin is the script 'wm' which you can use to manually change your DPI to whatever you want. Perform the same steps above for the wm file.
Code:
$ cd /sdcard
$ sh wm.sh
You can use this app to monitor the changes you make to your DPI in real time. Just make sure to note the starting DPI so you can go back to it.
Click to expand...
Click to collapse

Related

[SMPLTUT] Easy Text2SD (And whatever else you want)

This is a very simple way to do Text2SD if a few steps!
It can be extremely useful to keep all of your texts between flashing roms or nandroids or a general screw up
1) Create a folder on your sdcard, you can name it whatever you want but I decided to name it Text2SD and put it in the data folder.
2) This will move your message database to the folder you chose
Code:
adb shell mv /data/data/com.android.providers.telephony/databases/mmssms.db /mnt/sdcard/*folder*/ (ie /mnt/sdcard/data/Text2SD/)
2b) Verify the file has been moved
Code:
adb shell ls /data/data/com.android.providers.telephony/databases/ (Should return telephony.db)
adb shell ls /mnt/sdcard/*folder*/ (Should return mmssms.db, aside from whatever else you might have in there)
3) This will create a soft symlink from the database file on your sd card to the directory on your phone. It has to be a soft link because a hard link cant cross 2 different drives
Code:
adb shell ln -s mnt/sdcard/Text2SD/mmssms.db /data/data/com.android.providers.telephony/databases/
3b) Verify the file has been linked
Code:
adb shell ls /data/data/com.android.providers.telephony/databases/ (Should return mmssms.db and telephony.db)
4) Reboot just to be sure and enjoy!
Code:
adb reboot
You can apply this to pretty much any other file and have things like bootanimation.zip2sd or build.prop2sd or whatever, I cant think of any good examples right now
Code:
argument explainations
mv: move or rename files (depending on inputs)
ls: list files in a directory
ln: make hard symlink
ln -s: make soft symlink
EDIT- Im having issues with messages force closing even after restoring the original file. You probably shouldnt try this unless you know what your doing
EDIT2- I was able to make it work again by fixing the permissions to rw-rw-rw- when i copied the file back. i cant get the permissions to be set right though since you cant change permissions linux style on fat fs. this can probably be fixed with an ext partition but i dont feel like copying everything off my sd card formatting and copying back on. maybe later or if someone can test

[GUIDE][ADB]Basic Linux/Unix Commands

Basic Linux/Unix Commands
[HIGHLIGHT] DISCLAIMER - You know the drill. I don't deem myself responsible in case you screw up your phone. Always make a backup if you don't trust yourself and if you know that you screwing up is your forte[/HIGHLIGHT]
Thanks -
mihir287 for his FAQ
sweetnsour for his extensively detailed thread
Shen - advice
Zayed from www.addictivetips.com
http://www.linuxtopia.org
This guide aims to give you a background on some of the linux commands available to you once you obtain an adb shell.
In order to obtain an ADB shell, you must have adb set up on your computer (all ADB really consists of in windows is adb + 2 dlls + adb drivers.
However it makes sense to fully set up the Android SDK if you plan on developing for Android.
You need to install adb or get Terminal Emulator. To install adb and get more info about it visit here.
NOTE = All commands in linux/unix are CASE SENSITIVE.
Shell Commands
These commands are to be typed after typing
Code:
adb shell
In the Command Prompt.
Or, you can proceed normally if you are using a Terminal Emulator.
1. cd - Change Directory
To change to any directory, simply type:
Code:
cd <dirname>
dir name is the path. For instance, to switch to system/etc, type:
Code:
cd /system/etc
'..' will allow you to go back one directory. In our example, typing:
Code:
cd ..
would take you back to /system
2. ls - List Files
To list all the files in whatever directory you're in, simply type:
Code:
ls
pressing enter after, of course. This will list all NON-HIDDEN files/directories.
Code:
ls /system/etc
will list the contents of system/etc
Code:
ls -l
will list all NON-HIDDEN files in your current directory with additional details
Code:
ls -a
will list all files/directories(including hidden) within your current directory
Code:
ls *.extension
will list all the files wit the specified extension in the directory
For example i wanna list all apps -
Code:
cd /system/app
ls *.apk
3. su - SuperUser
The standard adb shell (unless you're on an insecure kernel/ramdisk), will be a non-root shell ($)
To obtain root priviliges (if your phone is rooted), simply type:
Code:
su
on obtaining superuser priviliges, you will be presented with a # symbol, which represent a root shell.
4. chmod - Change Mode
The two most commonly used 'modes' you'll come across in Android are '777' and '755'
These numerical pemissions have different meanings, of course. This can be a little confusing, so I hope this explains it in a simple to understand way.
As you can see, there are three numbers in the following example; 'chmod 755'
So, to break that down: The first number in the sequence, '7', represents the USER (aka, you). The second number in the sequence, '5', represents the GROUP (users who are members of the file's group) and the third number, '5' represents OTHERS (aka, everyone else).
Now to explain why they are 755, and the significance of those numbers, see the following list:
7 Full
6 Read/Write
5 Read/Execute
4 Read Only
3 Write/Execute
2 Write Only
1 Execute
0 None
So in the instance of 777, you can see that USER, GROUP and OTHERS have FULL access to the file in question.
To change the permissions of one file (apns-conf.xml for example, type:
Code:
chmod 777 /system/etc/apns-conf.xml
To change the permissions of all files in a directory, use the -R (recursive)option:
Code:
chmod 777 -R /system/etc
5. pwd - Print Working Directory
Couldn't be more simple. if you want to find out which dirctory you're currently in, type:
Code:
pwd
and press enter.
6. cat - Concatenate (evolved from)
The cat command if used to list a file's contents on your screen; or pass via pipeline to use with other Linux commands.
cat /proc/mounts
will output the various mount points in your android OS.
Note that there are many other uses for the cat command.
7. mount - remount as r/w or r/o
The mount command is used to mount a directory as r/w[Read-Write which allows you to modify it] or r/o[Read-Only]
Mount info -
Code:
mount
To mount as r/w and r/o respectively use -
Code:
mount -o remount rw <dirname>
or
mount -o remount ro <dirname>
To mount /system i will use
Code:
mount -o remount rw /system
or
mount -o remount ro /system
8. cp, mv, rm - Copy, Move, Remove
Use the 'cp' and 'mv' commands to copy, move a file/directory respectively and 'rm' to remove one. They are equivalent to copy+paste and cut+paste and delete
If you are planning to copy/move/remove from your android to anywhere else or viceversa you need to mount as r/w prior to this and mount as r/o after it.
They can be used as
Code:
cp <source> <destination>
or
mv <source> <destination>
or
rm <source>
For example i wanna copy/move/delete my zip file to system/media [after mounting system]
Code:
cp /sdcard/bootanimation.zip system/media
or
mv /sdcard/bootanimation.zip system/media
or
rm /sdcard/bootanimation.zip
9. Auto - Install Applications To SDCard
Type the following -
Code:
pm setInstallLocation 2
10. logcat
A logcat is basically a command to view messages in one of the system logs.
Logcat is the command to view the internal log of the Android system.
Viewing logcat is often the best way - and sometimes the only way - to diagnose a problem.
Dev's always need proper and useful feedback. So if you are testing something, you can always obtain the errors an report back to the dev who in turn can solve your problem efficiently.
Code:
su
logcat > /sdcard/log.txt
Will obtain the logcat to your sdcard as log.txt
Googlers have a sense of humour so even 'lolcat' works identically as 'logcat'
Code:
lolcat
Some dev's require extensive logcat info. To know more about it continue reading here.
ADB Commands
The following commands are to be type in your adb folder directory.
For instance, mine is in C:\android-sdk-windows\platform-tools so i will type
Code:
cd C:\android-sdk-windows\platform-tools
and then proceed with the following code lines
Alternatively you can change your PATH variable
Setting Path on Windows
For Windows XP:
Start -> Control Panel -> System -> Advanced
Click on Environment Variables, under System Variables, find PATH, and click on it.
In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
Close the window.
For Windows Vista/Windows 7:
Right click “My Computer” icon
Choose “Properties” from context menu
Click “Advanced” tab (“Advanced system settings” link in Vista)
In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
Click to expand...
Click to collapse
1. Check Connected Phone
To display list of available devices, type
Code:
adb devices
You will get the following output
Code:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 21342737ft6273
where the number indicates your devices serial number usually the one one the back of your phone[needs citation]
2. Login To Android Shell
Code:
adb shell
After pressing enter you will either see '$' or '#'
If you get ‘#’ after typing adb shell, you have already get root access on the phone, no need to type su. Otherwise if you get ‘$’ , type ’su’ to get root access (only for rooted device).
3. Install Application
This command installs the app whose directory is specified by you.
Code:
adb install appname.apk
Note that the name of the application should be without any blank spaces in between. Say i have an app called pes 12.apk, I rename it to pes_12.apk - Also don't miss out the .apk extension
example
Code:
adb install C:\programfiles\pes_12.apk
4. Files From Phone To PC And Vice Versa
For Phone - PC
Code:
adb pull <source> <destination>
For PC-Phone
Code:
adb push <source> <destination>
Example
Code:
adb pull /sdcard/bootanimation.zip C:\programfiles
Code:
adb push C:\programfiles\bootanimation.zip /sdcard
^Self Explanatory
5. Reboot To (Normal/Recovery/Bootloader)
Type the following to reboot normally or to recovery/bootloader respectively
Code:
adb reboot
Code:
adb reboot recovery
Code:
adb reboot bootloader
Some Useful Codes-
I do not know many. If you have any suggestions please do tell me
Type them in line by line and don't type in the '$' and '#'
1. Rooting
Code:
adb devices
adb shell
$ echo 1 > /data/local/lge_adb.conf
Then you can proceed onto using SuperOneClick
2. Installing Custom Recovery
The recovery.img and flash_image files must be in /sdcard
Code:
adb shell
$ su
# mount -o remount rw /system
# cat /sdcard/flash_image > /system/xbin/flash_image
# chmod 755 /system/xbin/flash_image
# flash_image recovery /sdcard/recovery.img
# mount -o remount ro /system
# exit
$ exit
adb reboot recovery
Will add FAQ later if needed
Ohh ! so much detail !
As far as i can see its very well written.
Will read tomorrow
Awesome guide! Thank you!
Sent from my LG-P500 using xda premium
MaKTaiL said:
Awesome guide! Thank you!
Sent from my LG-P500 using xda premium
Click to expand...
Click to collapse
Glad You Like It
Rutuj said:
Glad You Like It
Click to expand...
Click to collapse
I knew Half of this but the way you put it is basically noob written and easy to follow through. Thumbs up for this guide. I wish someone posted this when I first started playing with android. This would've made life easier for me >.<
Sent from my LG-P500 using XDA App
purple1 said:
I knew Half of this but the way you put it is basically noob written and easy to follow through. Thumbs up for this guide. I wish someone posted this when I first started playing with android. This would've made life easier for me >.<
Sent from my LG-P500 using XDA App
Click to expand...
Click to collapse
This doesnt make life easier, if one command wrong, bam! A fresh brick phone...
Sent from my Nexus One using Tapatalk
and how to uninstall app from adb ?
nice guide btw
Great guide. I would suggest you add details on how to get logcat as well, since many developers will find it useful if users post logs of bugs
Code:
su
logcat > /sdcard/log.txt
mihir287 said:
Great guide. I would suggest you add details on how to get logcat as well, since many developers will find it useful if users post logs of bugs
Code:
su
logcat > /sdcard/log.txt
Click to expand...
Click to collapse
Thanks !
Added !
Bump !
Thanks commands working perfect.
Tell me onething..how did you get time to type all of this?
royalflusher9 said:
Thanks commands working perfect.
Tell me onething..how did you get time to type all of this?
Click to expand...
Click to collapse
Compiling info takes time.
Type time = 30 mins
Nice thread for n00bs like me !!!! Thanks very much!!!1
Bumping this thread
very helpful guide ......
thanxxxx

Android Terminal Commands

Here are a few commands for Android in terminal. If you have any commands that you think should be here, just reply. Enjoy!
chmod - give/take rights away from files. The numbers you see in the how-to's is a little complicated. It has to do with the rights you are assigning the file or folder. http://wiki.linuxquestions.org/wiki/Chmod for further reading.
cat - look at, modify, or combine a file. You can also copy files with this command by "reading" it to another file instead of to the screen.
cd - change from one directory to another
cp - Copy a file from one location to another
dd - copies exact locations to other locations. Can be an entire drive, a folder, etc.
dd if= of=. uses an input file and an output file.
exit - exits the shell you are in. When you type su you start up a shell.
ls - lists all files with in a directory try ls - l too.
mv - Move a file from one location to another. At the same time you can rename a file.
su - Substitute User. We type this to switch to the root user. You need to type this command first to do a lot of the other commands.
tar - creates taped archives. Compresses files like winzip, 7zip, winrar and others tar /? for details.
rm - followed by a file name with delete the file sync - synchronizes any data on disk with data in memory. We type this before rebooting to ensure we've got all data written
Other commands of interest:
df - how much free disk space. In linux you can add a switch "df -h" but the "-h" does nothing for me on Android. top - like task manager, it displays running processes. in Linux the q key quits. On Android I don't know how to make it quit other than closing the app. uptime - displays how long it has been since you last rebooted the system.
busybox - a tool that combines many linux commands into a single compact file. Typing this displays all the commands at your disposal.
busybox df - a much easier to read display of free diskspace. This display shows how full (use%) each file system is.
Thanks
thank you so much, well for a noob like me very informative was looking for this kind from very long :laugh:
Substitute user XD you know it is superuser right?
free - see all free Memory from the Device
mid-kid said:
Substitute user XD you know it is superuser right?
Click to expand...
Click to collapse
Actually substitute user is also correct.
"The su command, also referred to as substitute user, super user, or switch user, allows a computer operator to change the current user account associated with the running virtual console."
Source: http://en.wikipedia.org/wiki/Su_(Unix)
Sent from my Galaxy Nexus using xda premium
So practically the basic linux comands are the same with android terminal!!!
I just noticed that the ping command is working just fine
Type ping 4.2.2.4 for example
rezo609 said:
If you have any commands that you think should be here, just reply. Enjoy!
Click to expand...
Click to collapse
svc data enable - turn on mobile data
svc data disable - turn off mobile data
svc wifi enable - turn on wifi
svc wifi disable - turn off wifi
svc help - show information about subcommands
For the top command mentioned in the OP, just type "top -n 1" and it will exit, leaving you with the readout at the time you executed the command. -n is for number of updates before stopping.
Also will add that the powertop command will show the top reasons for wakeups from idle.
Tnx
Metalcorpe said:
So practically the basic linux comands are the same with android terminal!!!
Click to expand...
Click to collapse
Yep
rezo609 said:
If you have any commands that you think should be here, just reply.
Click to expand...
Click to collapse
grep - Useful to apply filters to other commands. For example, to list only the apk files inside a folder:
Code:
ls /folder/to/list | grep apk
or to search a string inside a file:
Code:
cat /file | grep stringToSearch
logcat - Debugging tool, all the system messages are shown here. To show only the debug messages (useful when an app is giving FC without apparent reason), type:
Code:
su
logcat -d
mount - The most common use for this command is remount the system partition, to modify its content (be careful, you can easily brick your device!). Common usage (needs root):
Code:
Mount /system in Read/Write mode:
mount -o rw,remount /system
Mount /system in Read Only mode:
mount -o ro,remount /system
Saving command output to file. Type
Code:
command >> /folder/to/save/file
If the file doesn't exist will be created, otherwise, the info will be added to the end of the file.
You can also use:
Code:
command > /folder/to/save/file
If the file doesn't exist also will be created, but if the file exists its content will be deleted before add the info.
mount - Mounting a partition
umount - Unmounting a mounted partition
reboot - Reboot phone
stop - Shutdowns the GUI
start - Restarts GUI
above two commands can be used to get a fast reboot.
Also you my use the reboot command to do a faster restart to the device but your are going to lose any unsaved work
You must be rooted
First type : su
Then : reboot
Sent from my GT-I9505 using XDA Premium 4 mobile app
run program with command
I want to run "Applock"s lock all command. I have widgetsoid which can create shortcut for any command. How to do it? I am rooted.
SAVED ME!
toasterwater said:
svc data enable - turn on mobile data
svc data disable - turn off mobile data
svc wifi enable - turn on wifi
svc wifi disable - turn off wifi
svc help - show information about subcommands
Click to expand...
Click to collapse
Dude, thank you so much for posting this information. I had switched my MNVO service to a newer a phone, and this one was just sitting around. There were still things on it that I needed like some notes that I had saved. Because I had not used it in a while, and there was no data/cell service on it, I was out of luck (or so I thought) when I forgot my unlock pin. It wouldn't accept my google login information because there was no data connection. I COULD NOT GET INTO MY PHONE! I was dreading the possibility of having to factory reset, which would erase my notes and other things saved on there. On a whim and after MUCH Google searching, I was trying to find a way to reset the number of attempted pin locks to no avail. I was about to give up, but luckily, I remembered I had rooted it. And after downloading the latest SDK bundle, I came across your post. It allowed me to turn the wifi on my cell phone even though I was "locked out." Wouldn't you know that it very quickly picked up my home wifi signal. Because a data connection was enabled, I was then able to use my gmail login information to get into the phone. Your post saved me and prevented me from having to factory reset my phone and losing my information. Thank you so much!
netstat - show connections status in local device
...
rezo609 said:
Here are a few commands for Android in terminal. If you have any commands that you think should be here, just reply. Enjoy!
chmod - give/take rights away from files. The numbers you see in the how-to's is a little complicated. It has to do with the rights you are assigning the file or folder. http://wiki.linuxquestions.org/wiki/Chmod for further reading.
cat - look at, modify, or combine a file. You can also copy files with this command by "reading" it to another file instead of to the screen.
cd - change from one directory to another
cp - Copy a file from one location to another
dd - copies exact locations to other locations. Can be an entire drive, a folder, etc.
dd if= of=. uses an input file and an output file.
exit - exits the shell you are in. When you type su you start up a shell.
ls - lists all files with in a directory try ls - l too.
mv - Move a file from one location to another. At the same time you can rename a file.
su - Substitute User. We type this to switch to the root user. You need to type this command first to do a lot of the other commands.
tar - creates taped archives. Compresses files like winzip, 7zip, winrar and others tar /? for details.
rm - followed by a file name with delete the file sync - synchronizes any data on disk with data in memory. We type this before rebooting to ensure we've got all data written
Other commands of interest:
df - how much free disk space. In linux you can add a switch "df -h" but the "-h" does nothing for me on Android. top - like task manager, it displays running processes. in Linux the q key quits. On Android I don't know how to make it quit other than closing the app. uptime - displays how long it has been since you last rebooted the system.
busybox - a tool that combines many linux commands into a single compact file. Typing this displays all the commands at your disposal.
busybox df - a much easier to read display of free diskspace. This display shows how full (use%) each file system is.
Click to expand...
Click to collapse
if i wanted to delete a directory with data ? what would be the syntax
Set/View Network Host Name
Run the following as root
setprop net.hostname <new_hostname> // To Change Device Hostname
getprop net.hostname // To View Device Hostname
list of all android terminal commands
Open terminal or file explorer with root access
From root folder go to /system/bin
Type command :ls
The list contains all the terminal codes available
Enjoy!!
Disclaimer1: I'm not responsible if anything goes wrong while you try out the codes.
Disclaimer:man & help pages are not available on android terminal

Android Command Line Tools

Hi all, here is a package of command line tools I've put together, here's the readme with a few of the tools listed.
Android Command Line Tools
This Is Working Prefectly On Samsung Galaxy S3 'GT-I9305'
Your Phone Should Be Rooted To Perform These Steps!!!
Installation:
1. Copy The android-tools.zip To Your SD Card (Internal Or External) And Extract It
You Should Now Have A Directory Called 'android-tools'.
2. Open A Terminal On Your Phone And Type The Following
su
mkdir /data/tmp
cat /sdcard/android-tools/busybox > /data/tmp/busybox
cat /sdcard/android-tools/busybox-installer > /data/tmp/busybox-installer
cat /sdcard/android-tools/pkgs.tar > /data/tmp/pkgs.tar
cat /sdcard/android-tools/install.sh > /data/tmp/install.sh
cd /data/tmp
chmod 755 *
./install.sh
3. In Android Terminal Emulator Preferences, Set The Shell Path to '/system/bin/bash'
And Leave The Initial Command Blank.
4. Quit Terminal Emulator And Restart.
OpenSSH: ssh-keygen Save To '/data/local/home/root/.ssh/id_rsa'.
'ssh' And 'scp' Binaries Will Look For Keys In '/data/local/home/root/.ssh/'
So You Dont Need The '-i' Option, 'ssh-copy-id' Gets It From There Too.
Arduino:
There Is A Build Environment To Build And Upload Arduino Sketches With A Script Called 'arduino' To Wrap It Up
Type 'arduino --help' In Terminal To See Its Options, It Uses The Arduino-1.0 Core Library And I have Tested
Every Board And Can Confirm It Builds For All Boards Including 'micro' And 'leonardo'. It Uses 'avrdude'
'avr-libc-1.6.7' 'gcc-avr-4.5.1', I Wrote A 'arduino.nanorc' File For Writing Sketches Which Has All The
Functions And Constants Of The Arduino Core Library With The Same Colours As In The IDE.
Other Tools:
Some Other Binaries I Have Added Or Modified Are 'tar' With All Options Enabled, 'iwconfig', 'grep egrep fgrep'
With Colour And PCRE Enabled, '7zip', 'ipctool', 'shc' For Compiling Shell Scripts, 'ssh-copy-id', 'sed' With All Options
Enabled, 'macchanger', 'bootimg_baseaddr' In bash/sh, Compiled GNU 'core-utils', 'ncurses-hexedit', 'nmap', 'ngrep', 'nano'
'strace', 'gcc', 'g++', 'unpack-bootimg' In bash, 'unrar' And 'vim'.
Backtrack 5 ARM Is Configured And Ready To Go, Just 'mkdir /sdcard/Chroot'
And Copy Your bt5.img File Into It And Type 'bootbt', Then Edit The Scripts
For VNC Server 'startvnc' And 'stopvnc' To Reflect Your Screen Size, These
Are In The pkgs.tar
Replacing '/system/etc/mkshrc' With The One Included In This Package Enables Bash As Default In ADB Shell
If The Bash Binary Is Found In '/system/bin/bash' Else The Default Shell Will Drop Back To mksh.
Nano Does Not Save Through ADB Shell Using ^O Or '^X Then y' Method, Works Fine In Terminal Emulator App On Device.
There are more tools than listed above, here's the link> https://www.dropbox.com/s/yjumfljy7e1yoyc/android-tools.zip
If you're on an custom ROM and can't use the terminal emulator when you restart terminal emulator, get /system/lib/libncurses.so from stock ROM and use adb to copy it into /system/lib on your current ROM, I will fix this tomorrow.
Sent from my GT-I9305 using xda app-developers app
Please post the right link... this one is malformed.
sciurius said:
Please post the right link... this one is malformed.
Click to expand...
Click to collapse
op just updated the link, package is now ready for download again!
thank you, andreotti09!!!
greetz,
sUsH

Backup your EFS-partition using tar and dd

This guide has been made with and for the i9505, but will most likely also work on other Galaxy S4-models.
Please be extra careful on models other than i9505 as the 'mmcblkXpXX' partition numbers might differ on your device. How to check this is written in the procedure.
As I could not find a procedure in this forum yet, I have made one myself.
Of course all of the below is 'USE AT YOUR OWN RISK'.
Requirements before you start
Install KIES software (and included driver) and connected your S4 atleast once (to see if it works)
Have ADB-executable available. It can be found in the ADT Bundle from Google. There are also much smaller packages with ADB-only which will work. I might create one myself later on and attach it to this thread..
Device is rooted and has busybox-installed (default with motochopper root method). Applications with a similar name in Play Store will allow you to install busybox manually.
Enable developer mode, go to Settings - More - Device-info - Tap 7 times on 'Build number' to unlock 'Developer options' in the previous screen. Then go to 'Developer options' and thick 'USB debugging'
Connect USB cable to your computer and smartphone with 'USB debugging' enabled
Preparations for both backup methods
Now open a ADB-shell, in Windows this would be: 'cmd' in Start-menu (or CTRL+R).
Change the directory to the ADT directory: sdk\platform-tools. In my case:
Code:
cd C:\Android\sdk\platform-tools
Then start the shell using adb:
Code:
adb shell
If you get the error:
'error: device offline'
Then, check your device and allow USB debugging for the presented device. Now try again the command 'adb shell'
If all goes well, you will see the following:
[email protected]:/ $
Now switch to root-user:
Code:
su -
It is possible that the phone now asks you to permit or deny root access. Of course, please permit.
When the switch succeeds, the '$' changes to '#', but you can also verify it by the id-command:
Code:
[email protected]:/ # id
id
uid=0(root) gid=0(root) context=u:r:shell:s0
If it shows root, all is fine.
Then, check with the following command if /efs is available and mounted:
Code:
mount | grep efs
It should show something like:
Code:
mount | grep efs
/dev/block/platform/msm_sdcc.1/by-name/efs /efs ext4 rw,seclabel,nosuid,nodev,no
atime,discard,journal_checksum,journal_async_commit,noauto_da_alloc,errors=panic
,data=ordered 0 0
Backup method using TAR
NOTE: In case you left the ADB shell, please return to it using command 'adb shell' and switch to root again via 'su -' as described above.
Run the folowing command to backup the whole efs-partition (all the files available on the system):
Code:
tar -cvf /data/media/0/efs.tar /efs
Your output will look like this:
Code:
[email protected]:/ # tar -cvf /data/media/0/efs.tar /efs
tar -cvf /data/media/0/efs.tar /efs
tar: removing leading '/' from member names
efs/
efs/imei/
efs/imei/mps_code.dat
efs/wifi/
efs/wifi/.mac.info
efs/FactoryApp/
efs/FactoryApp/test_nv
efs/FactoryApp/hist_nv
efs/FactoryApp/fdata
efs/FactoryApp/serial_no
efs/FactoryApp/factorymode
efs/FactoryApp/keystr
efs/FactoryApp/hw_ver
efs/FactoryApp/baro_delta
efs/FactoryApp/prepay
efs/FactoryApp/earjack_count
efs/FactoryApp/batt_cable_count
efs/bluetooth/
efs/bluetooth/bt_addr
efs/gyro_cal_data
efs/00000000.authtokcont
efs/carrier/
efs/carrier/HiddenMenu
efs/drm/
efs/drm/widevine/
efs/drm/widevine/5dsokxEEDXgQhkN50bp-Z2K5InM_/
efs/drm/widevine/5dsokxEEDXgQhkN50bp-Z2K5InM_/D3qpp0bxmJhbiZwIsCbXJ1434rc_
efs/drm/widevine/5dsokxEEDXgQhkN50bp-Z2K5InM_/RXFABDUxyT6Q+Zwx9ZhPGOq2Bq8_
efs/drm/playready/
efs/drm/playready/00004.PRV
efs/drm/playready/playready0.dat
efs/drm/playready/playready1.dat
efs/drm/playready/playready.hds
efs/wv.keys
efs/log/
efs/log/boot_cause
efs/.files/
efs/.files/.dx1/
efs/.files/.dm33/
efs/.files/.mp301/
efs/ss_data
efs/h2k.dat
efs/hw_offset
This will add all files in /efs to the tar archive located on your internal memory as 'efs.tar'.
Now, the permissions of this tar are incorrect (for this location) so we have to correct them:
Change owner and group:
Code:
chown media_rw:media_rw /data/media/0/efs.tar
And the file permissions:
Code:
chmod 664 /data/media/0/efs.tar
Now, your tar-backup is ready and can be copied via MTP towards your computer or you can use adb to copy it over. First type 'exit' twice to exit the adb shell. CTRL+C is an alternative to leave the 'adb shell'.
Code:
adb pull /mnt/shell/emulated/0/efs.tar .
This will copy the efs.tar to your current directory, which is in my case C:\Android\sdk\platform-tools. You can also replace the last . with the directory where you would like to put the file in.
Backup method using 'dd'
NOTE: In case you left the ADB shell, please return to it using command 'adb shell' and switch to root again via 'su -' as described above.
From the output of the earlier executed command 'mount | grep efs', you can get the path of the EFS partition. It start with '/dev/block/..' is the part which you can use to find the original partition on your device.
As you can see, in my case this is, and I do not expect it to be any different on your device:
/dev/block/platform/msm_sdcc.1/by-name/efs
To check which 'mmcblk' partition it is, we should check out this link:
Code:
ls -al /dev/block/platform/msm_sdcc.1/by-name/efs
This will show you the mmcblk which is the EFS-partition:
Code:
ls -al /dev/block/platform/msm_sdcc.1/by-name/efs
lrwxrwxrwx root root 1970-01-05 23:39 efs -> /dev/block/mmcblk0p10
As you can see, the actual partition in my case is:
Code:
/dev/block/mmcblk0p10
I expect that this is the same for all i9505-devices, but it's better safe to check it. On i9500-devices this might be a different number as they have a different partition-layout, that's why we're checking this. It is very important to save this location, also for future restores.
Now, to backup the partition using dd, run the following command, please make sure that the part directly after 'if=' is the partition you found using the 'ls -l' command. In my case '/dev/block/mmcblk0p10':
Code:
dd if=/dev/block/mmcblk0p10 of=/data/media/0/efs.img
When it finishes, it will show you something like:
Code:
27904+0 records in
27904+0 records out
14286848 bytes transferred in 1.195 secs (11955521 bytes/sec)
This command reads the efs-partition, byte-by-byte to your internal memory, which you can transfer later on to your PC using ADB or MTP.
As the file created is owned by root:root and doesn't have the default permissions used for files at this location, it can be corrected with the following 2 commands:
Change owner and group:
Code:
chown media_rw:media_rw /data/media/0/efs.img
And the file permissions:
Code:
chmod 664 /data/media/0/efs.img
Now, your DD-backup is ready and can be copied via MTP towards your computer or you can use adb to copy it over. First type 'exit' twice to exit the adb shell. CTRL+C is an alternative to leave the 'adb shell'.
Code:
adb pull /mnt/shell/emulated/0/efs.img .
This will copy the efs.img to your current directory, which is in my case C:\Android\sdk\platform-tools. You can also replace the last . with the directory where you would like to put the file in.
To restore the files
Now to restore the files, in case there is really a need to, like imei-number ****up or something with the MAC-address of your wifi, or whatever.. the following commands can be used:
Of course, once again. USE AT YOUR OWN RISK!!!! Do not use this if not really necessary, as there are risks involved in doing this.
To restore the tar-backup, open 'adb shell' and switch to root using 'su -'. Now, first switch to the root directory, which is most likely not needed, but just to make sure the files will be extracted to the right location:
Code:
cd /
Before executing the next command, I assume that you have the efs.tar file in the root-directory of your internal SD-card.
Now, extract the tar file:
Code:
tar -xvf /data/media/0/efs.tar
This will extract the efs.tar file back to it's original location. It will show you something like:
Code:
[email protected]:/ # tar -xvf /data/media/0/efs.tar
tar -xvf /data/media/0/efs.tar
efs/
efs/imei/
efs/imei/mps_code.dat
efs/wifi/
efs/wifi/.mac.info
efs/FactoryApp/
efs/FactoryApp/test_nv
efs/FactoryApp/hist_nv
efs/FactoryApp/fdata
efs/FactoryApp/serial_no
efs/FactoryApp/factorymode
efs/FactoryApp/keystr
efs/FactoryApp/hw_ver
efs/FactoryApp/baro_delta
efs/FactoryApp/prepay
efs/FactoryApp/earjack_count
efs/FactoryApp/batt_cable_count
efs/bluetooth/
efs/bluetooth/bt_addr
efs/gyro_cal_data
efs/00000000.authtokcont
efs/carrier/
efs/carrier/HiddenMenu
efs/drm/
efs/drm/widevine/
efs/drm/widevine/5dsokxEEDXgQhkN50bp-Z2K5InM_/
efs/drm/widevine/5dsokxEEDXgQhkN50bp-Z2K5InM_/D3qpp0bxmJhbiZwIsCbXJ1434rc_
efs/drm/widevine/5dsokxEEDXgQhkN50bp-Z2K5InM_/RXFABDUxyT6Q+Zwx9ZhPGOq2Bq8_
efs/drm/playready/
efs/drm/playready/00004.PRV
efs/drm/playready/playready0.dat
efs/drm/playready/playready1.dat
efs/drm/playready/playready.hds
efs/wv.keys
efs/log/
efs/log/boot_cause
efs/.files/
efs/.files/.dx1/
efs/.files/.dm33/
efs/.files/.mp301/
efs/ss_data
efs/h2k.dat
efs/hw_offset
Then reboot your phone normally and see if it works again as you would expect.
If you restored the TAR-backup succesfully, you do not need to restore the dd-image. But in case your tar did not work or your /efs is not mounted due to corruption (in recovery) you can try the dd-recovery instead.
PLEASE BE AWARE THAT YOU SHOULD BE SURE ABOUT THE LOCATION OF THE EFS-PARTITION. THIS LOCATION WAS FOUND USING the 'ls -al /dev/block/platform/msm_sdcc.1/by-name/efs'-COMMAND EARLIER DESCRIBED. If you do not know this location, there's a risk you are overwriting other partitions (MODEM, SYSTEM, RECOVERY, ETC).
If you are sure about the original location, /dev/block/mmcblk......, then use this path just straight after 'of='. On my device the partition is /dev/block/mmcblk0p10.
Code:
dd if=/data/media/0/efs.img of=/dev/block/mmcblk0p10
Output will be similar to:
Code:
27904+0 records in
27904+0 records out
14286848 bytes transferred in 1.195 secs (11955521 bytes/sec)
This will read the efs.img and put it back in the original location.
NOTE 1: This thread gives you two options of backupping the EFS-partition. It is preferred to do both, better safe than sorry.
NOTE 2: Luckily, I have never had to restore any of the backups myself (not on this phone and not on earlier phones). This means that I was never able to test the restores, which counts for the most of us.
NOTE 3: DO NOT RESTORE unless you are really sure this will solve your issue. This will never resolve any lag or other problems with your rom.
NOTE 4: It is normal that the DD-file is much larger (10MB in size) as it also copies unused space and other meta-data of the partition.
NOTE 5: USE AT YOUR OWN RISK! Although the backup part is nearly riskless.
Note X: Feel free to thank me for this post.
Reservation for second post, just in case.
Isn't rooting and using rootexplorer to zip de efs folder to external SD card and just copying that with a microSD cabel way easier?
johan81 said:
Isn't rooting and using rootexplorer to zip de efs folder to external SD card and just copying that with a microSD cabel way easier?
Click to expand...
Click to collapse
Yes, zipping is easier but you will lose your permissions (owner and file permissions (changed via chown/chmod)) so it is actually not a good backup. The permissions/ownerships are backupped with the tar- and dd-backup.
The dd-file includes more than just the file; it also contains the partition meta-data, in case your filesystem got corrupted and it is not possible to recovery it.
Good job man.
EFS Professional v2.0.35 is now support S4. You can also use this:
http://forum.xda-developers.com/showthread.php?t=1308546
shaq1907 said:
EFS Professional v2.0.35 is now support S4. You can also use this:
http://forum.xda-developers.com/showthread.php?t=1308546
Click to expand...
Click to collapse
dont seem to work crashes out while backing up
working now with new update
anybody knows how to adb read the the entire partition table of the galaxy s4?

Categories

Resources