(GUIDE) Automated Root (well kinda lol)<MAC ONLY>(GUIDE) - Android Software/Hacking General [Developers Only]

(GUIDE) Automated Root (well kinda lol)<MAC ONLY>(GUIDE)
​​
Hi everyone ,
I am VERY new here but would like to publish a project that I am working on right now. Basically what i am going to show you is a *half* done project on a auto rooter. This does not use a exploit of any kind but will do most of the commands for you, using the applescript program.
​
Now if you will, *applause* (LOL) I will tell you the instructions to get root!!!!!!!! *more applause*
1. Search on Google "android sdk". Then download mac version of the sdk. Put it on your desktop and rename it:
android-sdk-mac_x86
2. Next i will use part of siedkins's awesome guide to show you what you should do next! You can find it here
Now launch Terminal - ⌘ + space then type Terminal or Applications>Utilities>Terminal
Now drag and drop the file called "android" in the "tools" folder into your terminal window and you should see something like:
/Users/siedkins/android-sdk-mac_86/tools/android
Then hit enter - this should load Android SDK
Next go to Available Packages on the left and Android Repository > Android SDK Platform-tools, revision 1 -tick the box and hit "Install Selected"
It should download and install the Platform Tools which includes ADB !!!!
Now quit Android SDK after it has downloaded and go back into Finder. Now you should see a new folder "platform-tools" in the "android-sdk-mac_86" folder. Open that and you can now see a file called adb.
Now .... I am going to show you how to make your life a lot easier in Terminal to run ADB without having to navigate to the folder every time you want to launch it.
Go back to your Terminal window and type (or copy & paste):
Code:
cd ~
The screen should then look like
NAME_OF_YOUR_MACHINE:~ USERNAME$
For me I have:
Mac-Pro:~ siedkins$
Next, type
Code:
touch .bash_profile
to create your new bash / path file
Next, type
Code:
open -e .bash_profile
to open it in TextEdit.
Now into Text Edit please copy:
Code:
export PATH=${PATH}:
Then go into Finder and navigate your your "android-sdk-mac_86" folder. Then click on the "platform-tools" folder and drag and drop this into TextEdit at the end of the code above that you copied. Mine looks like:
export PATH=${PATH}:/Users/siedkins/android-sdk-mac_86/platform-tools/
Yours should look like:
export PATH=${PATH}:insert your path to the "platform-tools" folder in your Android SDK here
All you need is that one line. Then Save and exit TextEdit and then very importantly QUIT TERMINAL.
Click to expand...
Click to collapse
3. What you should do now is to turn on USB Debugging in your phone (Settings > Applications > Development > USB Debugging) Now once you have done this download the zip and open "See if adb works" . What you should see is your unique id number in terminal....
5. Next
NOOOOOOOOOOOOTTTTTTTTTTTTTT DONEE​

What is this I don't even

Related

Where are located the launched process at boot ?

Hi, i just rooted my hero yesterday.
I have some small capacities on linux, and i wnated to know if there is ( and where it is ) an equivalent to the /etc/init.d and different rc.x.d config. file for the process launched at boot. I wouldl ike to edit or delete some programs launching at startup which i don't need really to launch at startup Is it possible and simple ?
Ciao
Fred
Edit : stupid question... there is no vi on the system so no way to edit the file ..
I am even new than you to android rooting (just rooted my Sprint Hero 2.1 today!).
I loaded Fresh ROM 2.1.2 on my Hero today and there's an app called "ES File Explorer". It allows me to browse the unix-like filesystem, right to the directory you mentioned above.
I can click on the files and open them as Text, Executable, etc. Opening as Text even gives me two different text editors.
Unfortuantly, the file(s) you talk about are for readonly. You have to be logged in as a Superuser to edit them (as I found out today). The easiest way I found is to do it via a command-line prompt.
When you "root" your android phone, that means you are able to login remotely as another user. Such as the "superuser" account from the Android SDK. On Windows, after you have rooted your phone, you can do:
Code:
C:\android\tools\> adb remount
C:\android\tools\> adb shell
#
When you see that "#" prompt, you are now logged into your phone running the default shell (not sure which shell it is). So, now you can copy/open that file:
Code:
# cd \
# type init.rc | more
Of course u can't do squat from here. So, you have two options:
1) Change the permissions to allow you to modify it from the Android device itself (possible security issue if u download a broken app that wants to modify your phone).
Code:
# chmod 755 init.rc
Now you are able to modify the file locally, right on your device. No PC needed any longer. But again, it's a possible seucrity issue.
2) just pull the file from your device to your desktop pc, edit it, and push it back. Exit out of the # shell by typing "exit" and pressing enter. At the C prompt, pull the file:
Code:
C:\android\tools\> adb pull /init.rc C:\init.rc
That pulls the file from your android device and places it at C:\init.rc. You can obmit the C:\ part, which would place the file in your android Tools folder u are running adb from (mine is getting messy though).
Once you edit it to your liking, push it back to your device:
Code:
C:\android\tools\> adb push C:\init.rc /init.rc
And that's it.
most custom roms contain nano, which is also a possible way to edit files.
I updated my post to reflect actual directions on how to modify a system file like that.

Quick way to start adb

My adb does not start all the time. Sometimes when I plug my phone in to use adb...I have to open the command prompt and type
cd \desktop\sdk\tools then hit enter then type adb devices enter for my phone to find it. If I just type adb devices in command prompt...I alway get (List of devices attached).
I made a simple 1click file to do it all. There are 2 files...1 is call adb and 2 is call adb + pause. It's just 2 bat file. If you have a better way plz share.
Thanks
Add the adb path as a command from right-click my computer > properties > something else around there, there should be guides on google or in Q&A. I don't remember because I haven't used windows in a while.
evilkorn said:
Add the adb path as a command from right-click my computer > properties > something else around there, there should be guides on google or in Q&A. I don't remember because I haven't used windows in a while.
Click to expand...
Click to collapse
^this
I have my sdk\tools folder in my path. Then it's as simple as start, run, cmd, adb remount (i generally do this first just to make sure daemon is running).
Edit: What exactly are these files anyway? Your post says 2 batch files, but I see 2 exe files with nexus one icons.....
Scanned file: Adb files.zip
Adb files.zip/Adb files/ADB + pause.exe/ADB.bat - OK
Adb files.zip/Adb files/ADB + pause.exe - OK
Adb files.zip/Adb files/ADB + pause.exe - OK
Adb files.zip/Adb files/ADB.exe - OK
Adb files.zip/Adb files/ADB.exe - OK
Statistics:
Known viruses: 4066398 Updated: 06-05-2010
File size (Kb): 246 Virus bodies: 0
Files: 5 Warnings: 0
Archives: 2 Suspicious: 0
Looks clean to me.
It's just 2 .bat files. All i did was give the .bat file a icon. I use a program call Bat_To_Exe_Converter
cd sdk\tools
adb devices
cd sdk\tools
adb devices
pause
If you have your sdk folder on your desktop.
soloxp said:
It's just 2 .bat files. All i did was give the .bat file a icon. I use a program call Bat_To_Exe_Converter
cd sdk\tools
adb devices
cd sdk\tools
adb devices
pause
If you have your sdk folder on your desktop.
Click to expand...
Click to collapse
I assumed, was just curious
Yeah adding it to your system path is really easy and a much better way because you can run adb from anywhere.
Cool...
Thanks guys.
Thanx for the tips!
Added my sdk\tools folder to my path on Win7.
How to:
- Click Start and choose Control Panel
- In the Search box on the top right of the window type “system path” (no quotes)
- Click “Edit the system environment variables”
- The Advanced tab of the System Properties dialog box is shown. Click the Environment Variables button on the bottom right.
- In the lower box titled “System Variables” scroll down to Path and click the Edit button.
- Change your path as need be.
- Restart your system.

[How to]? ADB on Ubuntu 10.10?

Can someone provide a step-by-step guide to installing ADB on Ubunto 10.10 for a beginner please?
Thanks
Still need help
t0ph0id said:
Can someone provide a step-by-step guide to installing ADB on Ubunto 10.10 for a beginner please?
Thanks
Click to expand...
Click to collapse
It's been awhile since you posted, do you still need help. I have a simple method, let me know and I will make you instructions. It wouldn't be a problem.
blas4me said:
It's been awhile since you posted, do you still need help. I have a simple method, let me know and I will make you instructions. It wouldn't be a problem.
Click to expand...
Click to collapse
I would love a quick step-by-step. Been trying to figure this out but failing. Hard.
ADB & FASTBOOT Help: Updated 6/6/12
WORKS FOR x86 VERSION OF 12.04 - 12.10 TO MAKE IT WORK FOR x64 FOLLOW LINK BELOW, THEN COME BACK HERE AND FINISH SETUP. I ALSO ADDED A VIDEO, CHECK IT OUT
1. You must have java installed before you start set up.
http://askubuntu.com/questions/131207/android-sdk-cant-be-installed-on-ubuntu-12-04-64
I know if your new the other instructions can be confusing, so I kinda know what you guys are looking for, just a basic breakdown, I remember when I started playing around with 9.04, the adb setup had me stuck, Ubuntu used to frustrate me, because I didn't understand Unix based systems, but you catch on, especially if your a android user.
JUST A TIP: I make my SDK folder androidsdk, for simplicity and that's how I learned to install. so I'm just showing you the way I learned. I have rooted over 20 different Android devices, and I've installed this method on multiple Linux distros without a problem. For those of you that are new to Linux, know that Linux is hardwired for Andorid devices, same kernal and all, and that's why it's wise to do all things Android on Linux machines, I try to anyway
RECENT CHANGES TO SDK: updated 11/1/12: Just installed on Ubuntu 12.10, and the Linux adb installer is no longer needed, when I ran adb command after copying SDK to my /usr/local/ directory, my device showed up. Some resent changes to the SDK, also changed the way you set up, but not very much. The SDK provides all the files you need to set up, including fastboot.
NOTE: Once you've finished the setup, know that you push & pull right from your home folder, no need to put things in the tools folder like Windows, same thing when you pull, look for the files in the home folder.
1. Go here for the latest SDK
http://developer.android.com/sdk/index.html
(once download, double tap and extract right to home folder, rename to androidsdk)
a. Make android file executable
2. Open teminal.
a. Navigate to your SDK directory
Code:
cd /home/username/androidsdk/tools
you should get [ $ ] at the end of your path.
b. Type
Code:
./android
your SDK Manager should start.
ADVICE: I suggest you only download tools and platform-tools to make the setup quick, you can go back later and install what you need
NOTE: For development purposes you need a copy of ADB & Fastboot in your tools folder, Eclipse looks for ADB in the folder, so if you plan on developing, then you'll need those files there.
3. Open home folder, press ctrl & H to show hidden files, find bashrc
a. Paste in terminal from your document after you input your user name:
Code:
#AndroidDev PATH
export PATH=${PATH}:/androidsdk/tools
export PATH=${PATH}:/androidsdk/platform-tools
export PATH=${PATH}:/home/*********/androidsdk/tools
export PATH=${PATH}:/home/*********/androidsdk/platform-tools
4. Paste in terminal from your document after you input your user name:
Code:
export PATH=$PATH:/androidsdk/tools
export PATH=$PATH:/androidsdk/platform-tools
export PATH=$PATH:/home/*********/androidsdk/tools
export PATH=$PATH:/home/*********/androidsdk/platform-tools
NOTE: For this part you'll need your devices id, here's a list, if your devices id isn't here, use code below.
Acer 0502
ASUS 0b05
Dell 413c
Foxconn 0489
Fujitsu 04c5
Fujitsu Toshiba 04c5
Garmin-Asus 091e
Google 18d1
Hisense 109b
HTC 0bb4
Huawei 12d1
K-Touch 24e3
KT Tech 2116
Kyocera 0482
Lenovo 17ef
LG 1004
Motorola 22b8
NEC 0409
Nook 2080
Nvidia 0955
OTGV 2257
Pantech 10a9
Pegatron 1d4d
Philips 0471
PMC-Sierra 04da
Qualcomm 05c6
SK Telesys 1f53
Samsung 04e8
Sharp 04dd
Sony 054c
Sony Ericsson 0fce
Teleepoch 2340
Toshiba 0930
ZTE 19d2
In terminal type:
Code:
lsusb
and that will give a list of all USB devices attached to your machine.
a. In terminal, type:
Code:
gksudo gedit /etc/udev/rules.d/51-android.rules
b. Add these lines, put your device ID between quotations, then save
Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="HERE", SYMLINK+="android_adb", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="HERE", SYMLINK+="android_adb", MODE="0666"
c. In terminal type:
Code:
sudo restart udev
5. Download the Linux ADB installer zip, extract to your home folder, make script executable and to run with auto prompt (plug your phone in if it isn't already) then just double click and choose run, then let it do it's thing Takes a second, and it should ask for permissions = user password
NOTE: When you run nautilus your going into file system directory as root, so proceed with caution, and back up any file you plan on editing. Installing SDK doesn't make a folder in /usr/local/ any more, so you'll have to copy SDK to that directory as root.
6. Open terminal, type:
Code:
sudo nautilus
a. Go to :File system /usr/local
b. Copy and paste a copy of your SDK folder there
c. Close root session
d. Close terminal
7. Open terminal, type:
Code:
adb devices
you should see your device, then type fastboot devices it should just go to the next line, you have to be in fastboot to see your device
Now you should have ADB & Fastboot on your beautiful Ubuntu machine!!!!!!!!!!
With narration
http://www.youtube.com/watch?v=HsCd1nMywR8&hd=1
Without
http://www.youtube.com/watch?v=IGAiHkPuhg8
Extra goodie (Aero Snap Windows.) Extract and follow intructions. Enjoy!!!!!!!!!
TIP: For trigger delay, the lower you set it the faster your widows will resize, and I have mine set for left & right edge. Having it set @ right & left is a headache because every time your pointer touches left or right side of the screen , widows resize. So, having them set to the edges works for me.
Just wanted to say thanks, awesome post.
Thanks
star.gazer said:
Just wanted to say thanks, awesome post.
Click to expand...
Click to collapse
I've been waiting to hear feedback, was it a simple process.
I see two problems at first glance with the instructions above:
1. This will only work with two brands, the one
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", SYMLINK+="android_adb", MODE="0666"
Click to expand...
Click to collapse
being HTC ("0bb4"), the other
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", SYMLINK+="android_adb", MODE="0666"
Click to expand...
Click to collapse
not known to me. For a list of other vendors, have a look at http://developer.android.com/guide/developing/device.html .
2. You're mixing up adb-related instructions with instructions to change Ubuntu's UI, which is totally unrelated. This "Extra goodie (Aero Snap Windows.)" is neither needed for the task in question nor is it asked for by many Linux users (like me). Also, I wouldn't recommend -- at least not to an average user -- to bypass Ubuntu's package management in order to get some visual sugar. Bypassing might conflict with further updates and lead to a situation where thorough knowledge is required.
As a simple, efficient and painless way I recommend the app adbWireless. No need to install anything but the SDK (downloaded from developer.android.com and only from there) and the app. Then start adb and the app and give the command line provided by the app's display, and you're connected without any messing around with udev and permissions.
Who are you!!!!!!!!!
mizch said:
I see two problems at first glance with the instructions above:
1. This will only work with two brands, the one being HTC ("0bb4"), the other not known to me. For a list of other vendors, have a look at http://developer.android.com/guide/developing/device.html .
2. You're mixing up adb-related instructions with instructions to change Ubuntu's UI, which is totally unrelated. This "Extra goodie (Aero Snap Windows.)" is neither needed for the task in question nor is it asked for by many Linux users (like me). Also, I wouldn't recommend -- at least not to an average user -- to bypass Ubuntu's package management in order to get some visual sugar. Bypassing might conflict with further updates and lead to a situation where thorough knowledge is required.
As a simple, efficient and painless way I recommend the app adbWireless. No need to install anything but the SDK (downloaded from developer.android.com and only from there) and the app. Then start adb and the app and give the command line provided by the app's display, and you're connected without any messing around with udev and permissions.[/QUOTE/]
The other number is the new HTC id, for those who have other android devices, I included the auto script. I've been waiting for someone like you to come along, "a mister know it all", but it's kool. Just to let you know I got Aero Windows from OMGubuntu. I still get updates. as I'm typing my Update Manaer just notified me, that there are updates for me. Obviously your not familiar with setting up ADB&Fastboot on Ubuntu. And you should be smart enough to see that the instructions are just for ADB&Fastboot setup. The instructions for Aero are inside the zip. I put everything here instead of starting a new post, duh, how many members have you helped on this forum. Don't try to confuse other members, with your babble. Next time don't just glance read, read, read, Maybe you just need a friend Two words for you " Open Source "
Click to expand...
Click to collapse
I've been waiting for someone like you to come along, "a mister know it all", but it's kool.
Click to expand...
Click to collapse
Hope you feel better now.
Just a quick post to say thanks.
Easy to follow and got me working on flashing my radio from my new 10.10 installation.
nategs said:
Just a quick post to say thanks.
Easy to follow and got me working on flashing my radio from my new 10.10 installation.
Click to expand...
Click to collapse
Thanks for the feedback.
Thanks
Thank you for the easy to follow post. I am a new user to Ubuntu (and Linux in general) and this was an extremely user friendly tutorial.
blas4me said:
I know if your new the other instructions can be confusing, so I kinda know what you guys are looking for, just a basic breakdown, I remember when I started playing around with 9.04, the adb setup had me stuck, Ubuntu used to frustrate me, because I didn't understand linux based systems, but you catch on, especially if your a android user. You can just copy & paste all of the command. I've done this on 10.04 about four or five times, and 10.10 twice so far.
Edit: I just set up adb on my other lappy, and I notice the SDK is a little different. There is no adb file in the tools folder, it's just in another folder. You don't have to give it permissions, so just follow the instructions, and enjoy the new additions to the SDK.
Note: Once you've finished the setup, know that you push & pull right from your home folder, no need to put things in the tools folder like Windows, same thing when you pull, look for the files in the home folder.
1.Go here for the latest SDK
http://developer.android.com/sdk/index.html
(once download, double tap and extract right to home folder, rename to androidsdk)
2.Open folder and got to tools folder
a.right click on adb, go to properties and check allow execution, choose or add open with auto prompt, do same for android file then double click on android and choose run
b.download and install, let it finish
Note: When I say add these line, I'm saying add the lines under the alphanumeric instructions
3.Open home folder, press ctrl & H to show hidden files, find bashrc
a.add these lines to the top of file,# include, then space it from next paragraph of text
#AndroidDev PATH
export PATH=${PATH}:/androidsdk/tools
4.Open terminal, type: export PATH=$PATH:/androidsdk/tools
a.in terminal, type: gksudo gedit /etc/udev/rules.d/51-android.rules
b.add these lines, then save
c.in terminal type: sudo restart udev
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", SYMLINK+="android_adb", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", SYMLINK+="android_adb", MODE="0666"
(plug your phone or phones in if it isn't already)
5.Extract the installer zip to your home folder, make script executable and to run with auto prompt, then just double click and choose run, then let it do it's thing
Note: When you run nautilus your going into file system directory
6.Open terminal, type: sudo nautilus
a.go to /usr/local/androidsdk/tools
b.make adb file executable, and choose or add open with auto prompt, then close root session and close terminal
7.Open terminal, type: adb devices, you should see your device or devices
8.Set up fastboot, go here for the file
http://forum.xda-developers.com/showthread.php?t=537508
a.once downloaded, copy to tools folder in your home directory, and enter root session with sudo nautilus command and add fastboot to /usr/local/androidsdk/tools
b.don't forget to make both files executable, and open with auto prompt,then close root session, close terminal.
9.Open terminal, type: adb devices
a.type:fastboot devices
(if it just go's to the next line your cool, you need to be in fastboot to see your device, if you get fastboot not found, then go back to the fastboot files and make sure you did part:8b
Now you should have adb&fastboot on your beautiful Ubuntu machine!!!!!!!!!!!
Extra goodie (Aero Snap Windows.) Extract and follow intructions. Enjoy!!!!!!!!!
TIP: For trigger delay, the lower you set it the faster your widows will resize, and I have mine set for left & right edge. Having it set @ right & left is a headache because every time your pointer touches left or right side of the screen , widows resize. So, having them set to the edges works for me.
Click to expand...
Click to collapse
Excellent Post. Thank you very much.
I can't get anything but "No command 'adb' found"
I'm trying to follow your instructions, but the section with the export PATH stuff is very hard to follow.
I know that adb is located in:
Code:
/home/USERNAME/Applications/android-sdk/platform-tools
So I would put this in my .bashrc:
Code:
#AndroidDev PATH
export PATH=${PATH}:/Applications/android-sdk/platform-tools
# include
And then I'd type this into the terminal:
Code:
export PATH=$PATH:/Applications/android-sdk/platform-tools
Right?
blas4me said:
TIP: For trigger delay, the lower you set it the faster your widows will resize, and I have mine set for left & right edge. Having it set @ right & left is a headache because every time your pointer touches left or right side of the screen , widows resize. So, having them set to the edges works for me.
Click to expand...
Click to collapse
I followed your guide for adb installation and it worked great. I just want to say thanks.
In the Aero tip, I just wanted to know what you meant by setting it to the right and left edges. When I put my pointer to the edges, the windows resize like you said and I wanted to set it up like you have yours.
You'll get it
Mogomra said:
I can't get anything but "No command 'adb' found"
I'm trying to follow your instructions, but the section with the export PATH stuff is very hard to follow.
I know that adb is located in:
Code:
/home/USERNAME/Applications/android-sdk/platform-tools
So I would put this in my .bashrc:
Code:
#AndroidDev PATH
export PATH=${PATH}:/Applications/android-sdk/platform-tools
# include
And then I'd type this into the terminal:
Code:
export PATH=$PATH:/Applications/android-sdk/platform-tools
Right?
Click to expand...
Click to collapse
Your SDK folder should be in your home directory. You should rename your SDK folder to androidsdk for simplicity, if your pasting the commands from my post. I see the path you tried to export and it's not correct. I said in my post that they changed the location of the adb file, but to follow the instructions. You need to redo your bashrc file, just copy and paste my code lines, and you can't go wrong, trust me. I want your adb&fastboot up & running. Let me know what happens.
I figured it out. I should have put a ~ in front of "/Applications" or "home/USERNAME" in front of it.
Thanks
Devildog8791 said:
I followed your guide for adb installation and it worked great. I just want to say thanks.
In the Aero tip, I just wanted to know what you meant by setting it to the right and left edges. When I put my pointer to the edges, the windows resize like you said and I wanted to set it up like you have yours.
Click to expand...
Click to collapse
You can set edge bindings from two applications, SCSM or Compiz
Mogomra said:
I figured it out. I should have put a ~ in front of "/Applications" or "home/USERNAME" in front of it.
Thanks
Click to expand...
Click to collapse
That's strange I've never heard of anybody using that path, can you still just type in " adb devices " and see you phone or do you have to type " sudo adb "
blas4me said:
You can set edge bindings from two applications, SCSM or Compiz
Click to expand...
Click to collapse
So instead of going to the sides, you are going to the corners, correct?

ADB batch quick launch

So this isn't anything amazing, but it's a handy little shortcut I made for myself that might help someone else, too.
If you regularly find yourself needing to fire off a command from ADB, but don't want to have to go to the trouble of adding ADB to your path or remembering where it's saved, you can create a batch file so you only have to press three letters to get adb ready to go.
Using a text editor (I like Notepad++), create a new text file with this inside of it:
@echo off
cd "path to where your Android SDK installation is located\android-sdk-windows\platform-tools"
(I find it easiest to just navigate to where you have ADB installed and copy and paste the folder location.) For example, my adb.bat file says:
@ echo off
cd "C:\Users\(me)\Other\mod\tools\android-sdk-windows\platform-tools"
Once you have those two lines above in place, do a "Save As" command, and save the file as "adb.bat" (with quotes).
Once you have that batch file ready to go, assuming you're on Windows 7 (may work on other versions of Windows, I just haven't tried) put it in whatever location comes up by default whenever you open a command prompt (It's C:\Users\[my account] for me).
The next time you open a command prompt (Win-R, type cmd), just type adb into the prompt and hit enter, and you're sitting at the directory where ADB is installed, ready to fire off other commands.
thanks, awesome!! works perfectly minus my lack of adb skill...
We will be waiting for new ROM from you. No less.

[GUIDE] Make your android device True Root! - by Napalm

[GUIDE] Make your android device True Root! - by Napalm​
I did this on my Nexus 7 but it should all still apply to most devices. You might need to follow different driver advice for other devices.
Pre-requirements:
Installation of the SDK platform-tools.
Have platform-tools directory of the SDK in your PATH environment variable (Google this if your unsure).
This was all done a Windows installation, but access to Linux will be required later on. Mac users might be able to get away with doing the Linux portions directly on there computer. Please let me know if your a Mac user and have had success with this and I will update the guide with details.
Step 1: Driver Installation (READ THIS, do not skip)
First I needed to update to the usb_driver from SDK and then modify the installation inf with the IDs for Nexus 7.
Browse to your SDK directory and futher into <SDK>\extras\google\usb_driver
Open android_winusb.inf in your favorite text editor.
Find the appropriate section Google.NTx86 if your on 32bit or Google.NTamd64 if your on 64bit (doesnt matter that your using intel chip). Now find the ";Google Nexus 7" line inside that section and you'll see a series of settings below. Add the following lines at the end of that block.
Code:
%CompositeAdbInterface% = USB_Install, USB\VID_18D1&PID_4E44&MI_01
%CompositeAdbInterface% = USB_Install, USB\VID_18D1&PID_D001
These are the identifiers for the Nexus 7 recovery and bootloader usb connections.
Step 2: Standard Root
Next you'll need access to the bootloader and recovery mode so follow this guide to unlock and "root" your device. http://forum.xda-developers.com/showthread.php?t=1741395
Here I've laid out the steps I did instead of the above. Remember this wipes your device and its internal memory completely, so backup your data.
All local work is done from the desktop, so when you first open a command prompt or if you close it and reopen it enter the following.
Code:
cd Desktop
Download CWM recovery image to Desktop. http://goo.im/devs/birdman/CWM-grouper-recovery.img
Download SuperSU CWM update zip to Desktop. http://forum.xda-developers.com/showthread.php?t=1538053
Go to Start or Start>Run and type in: cmd
Code:
cd Desktop
fastboot oem unlock
fastboot flash recovery CWM-grouper-recovery.img
adb reboot recovery
Now the device will reboot into recovery mode. If windows asks for drivers for the "new" usb connection direct the wizard to your <SDK>\extras\google\usb_driver. And the earlier modifications made in Step 1 should mean it installs the device and adb link.
Once drivers are installed and every is good go back to the command prompt, and type
Code:
adb devices
It should list your device with the word "recovery" next to it. If it doesn't then your device is not in recovery mode. Now enter in the following commands into the command prompt and it will make your devices CWM installation permanent.
Code:
adb shell
mount /system
cd /system
mv recovery-from-boot.p recovery-from-boot.bak
umount /system
exit
Now to install SuperSU. Tap "reboot system now" on the screen (if you dont see CWM, press the power button to show/hide it). Wait for the reboot. And then enter the following into the command prompt.
Code:
adb push CWM-SuperSU-v0.94.zip /sdcard
adb reboot recovery
Wait for reboot. You should see an image in the center of the screen. You might have to press the power button to toggle the visibility of the CWM menu. If you miss-tap on the screen, the power button acts like a back button and will return you to the previous menu screen.
Tap "install zip from sdcard" and then "choose zip from sdcard". Then select the CWM-SuperSU-v0.94.zip file (You may have to use the vol-up/down keys to highlight this if the file is listed off the bottom of the screen)
Let that install and then go back on the menus and choose "reboot system now".
Now if all is well after the reboot, if you run the following commands in command prompt.
Code:
adb shell
su
SuperSU might now prompt you on your devices screen to accept the root access, and then hopefully your command prompt should end in a # (this means you are root user 0). Now type exit twice to get back to the windows command prompt.
Now if you were to type "adb root" you will notice it tells you adbd is not able to go "full root". This will be solved in the next step. This is going to get complicated. You have been warned.
Step 3: True Rooting!
Now your device is "rooted". This is true, you now have a "su" binary installed and a visible app in the OS to manage super user privileges, but as a developer I want to be able to use things like "hierarchy viewer" on my live device. And have the room to do what I need to debug complex situations. So this is where True Root comes in. This essentially turns the device into a debug device that you would get direct from the manufacturer.
You may be able to get away with doing the following in a different way and you may not need to compile anything since fastboot has a boot flash option, but since I've never used this I've done it this way. If you prefer you can explore things in that direction, but be warned I've not tried it and so I have no idea if it would work.
Now for this step you will need access to a Linux installation. If you've never used Linux before don't be too afraid. But I am going to have to gloss over a few things. If you need further help on this step you will need to post in the topic and allow the community to advise on best pratices.
If you dont have access to a Linux installation or your newb to Linux then go here and follow the steps. It will add Linux to your PCs boot options and then you can go in and out of Linux when you need it. http://www.ubuntu.com/download/help/install-ubuntu-with-windows
Remember if your working on this step from a fresh Linux install like the above then you will probably want to install the android sdk for linux, at least enough to use adb from linux. This topic might help with this: http://forum.xda-developers.com/showthread.php?t=537508
Ok now from Linux follow along. You'll need git installed for this "apt-get install git".
We now need to compile the apps needed to modify our boot image. Details can be found here https://gist.github.com/1087757 but you might just want to follow my specific instructions.
Open a console window and type.
Code:
git clone https://android.googlesource.com/platform/system/core
cd core/libmincrypt
gcc -c *.c -I../include
ar rcs libmincrypt.a *.o
cd ../mkbootimg
gcc mkbootimg.c -o mkbootimg -I../include ../libmincrypt/libmincrypt.a
cd ../cpio
gcc mkbootfs.c -o mkbootfs -I../include
cd ../..
git clone https://github.com/beide/Bootimg-scripts.git
cd Bootimg-scripts
cp ../core/mkbootimg/mkbootimg ./
cp ../core/cpio/mkbootfs ./
Ok that has prapared the a Bootimg-scripts directory with the perl scripts we need and compiled binaries they use. Now make sure you have perl installed "apt-get install perl".
This is where things are going to split and it becomes your best guess as to how to proceed. I will show you the method I used from Windows. But if you have a installation of the SDK in Linux then you should be able to just open a new console and continue from here and ignore the bits I used to transfer files between Linux and Windows.
Back to the command console on Windows. We use adb to identify our boot partition and extract it.
Code:
adb shell cat /proc/partitions
You will now be presented with a list of paritions on your Nexus 7. Each block here for my device is 1K. So I'm looking down the list and I see one thats 8192 blocks, called "mmcblk0p2". Thats 8MB and I'm taking a educated guess that this is the boot partition, and for my Nexus 7 it is. (Note: if anyone has a better way of determining the boot parition please let me know).
Now we need to take a image of the partition. From here on out replace my partition device name in the commands below with yours if it differs.
Code:
adb shell
cat /dev/block/mmcblk0p2 > /sdcard/boot.img
exit
adb pull /sdcard/boot.img
Now if you want to confirm that this is the boot partition you will need to open the image file in your favorite hex editor and confirm the first bytes of the file are "ANDROID!" in ascii.
Now I FTP'd this image file over to my Linux box and into the Bootimg-scripts directory we created previously. If your following these steps from Linux then you should be able to open up the file manager and move the file into the folder.
Now back to Linux. We'll need to modify repack-bootimg.pl with a text editor of your choice. I leave this up to the reader. We need to modify line 19 the system call so that it starts with "./mkbootimg" rather than "mkbootimg". This is so perl fines mkbootimg in the local directory rather than anywhere else.
Now type in the linux console we had open in the Bootimg-scripts directory the following command.
Code:
perl ./unpack-bootimg.pl boot.img
ls -l
You should see boot.img-kernel.gz and boot.img-ramdisk.cpio.gz and a directory boot.img-ramdisk.
Open boot.img-ramdisk/default.prop in your favorite text editor and make the following adjustments.
ro.secure=1 should be edited to ro.secure=0 and ro.debuggable=0 should be ro.debuggable=1 and if you want ro.allow.mock.location can also be changed to 1 if you like.
Now we've made the required changes to our initrd (initial ramdisk) files we need to repack them to put back on the device.
Code:
perl ./repack-bootimg.pl boot.img-kernel.gz boot.img-ramdisk boot-debug.img
You will now have a new file called boot-debug.img. This contains our modified initial ramdisk. It will probably be smaller than the original. This is no concern as the original we copied was an image of the entire disk including the unused areas, where as the new image is only the data we need.
I now FTP'd this file back to my Windows machine, but as before if your doing this from Linux then you can just carry on.
We now need to flash this image file back onto the Nexus 7 replacing our current boot image. To do this we need to put the device into bootloader mode.
Back to your console/command window, and enter in.
Code:
adb reboot bootloader
Windows might want to install drivers and as before direct the wizard to <SDK>\extras\google\usb_driver.
Once your device is in bootloader mode. Go back to the console/command and enter in.
Code:
fastboot flash boot boot-debug.img
fastboot reboot
Now cross your fingers and hopefully you will get the boot loading animation and your device will get back to the Android launcher.
Now finally from your console/command window type in:
Code:
adb root
Hopefully if all is well it should reply with "adbd is already running as root". Now if you type in:
Code:
adb shell getprop ro.debuggable
It should tell you that its set to 1, meaning it is switched on.
Congratulations!! You have now True Rooted your device!.
You can now debug even system level apps, see log messages from all processes and logcat will now resolve all app names. Use Hierarchy Viewer on a live device instead of the horrible emulator. Do absolutely everything with your device that you want.
Happy hacking,
Napalm :good:
better late than never.....a thorough quide
Thanks for this guide.
Sent from my Nexus 7
Thanks.
Napalm2 said:
[GUIDE] Make your android device True Root! - by Napalm​
I did this on my Nexus 7 but it should all still apply to most devices. You might need to follow different driver advice for other devices.
Pre-requirements:
Installation of the SDK platform-tools.
Have platform-tools directory of the SDK in your PATH environment variable (Google this if your unsure).
This was all done a Windows installation, but access to Linux will be required later on. Mac users might be able to get away with doing the Linux portions directly on there computer. Please let me know if your a Mac user and have had success with this and I will update the guide with details.
Step 1: Driver Installation (READ THIS, do not skip)
First I needed to update to the usb_driver from SDK and then modify the installation inf with the IDs for Nexus 7.
Browse to your SDK directory and futher into <SDK>\extras\google\usb_driver
Open android_winusb.inf in your favorite text editor.
Find the appropriate section Google.NTx86 if your on 32bit or Google.NTamd64 if your on 64bit (doesnt matter that your using intel chip). Now find the ";Google Nexus 7" line inside that section and you'll see a series of settings below. Add the following lines at the end of that block.
Code:
%CompositeAdbInterface% = USB_Install, USB\VID_18D1&PID_4E44&MI_01
%CompositeAdbInterface% = USB_Install, USB\VID_18D1&PID_D001
These are the identifiers for the Nexus 7 recovery and bootloader usb connections.
Step 2: Standard Root
Next you'll need access to the bootloader and recovery mode so follow this guide to unlock and "root" your device. http://forum.xda-developers.com/showthread.php?t=1741395
Here I've laid out the steps I did instead of the above. Remember this wipes your device and its internal memory completely, so backup your data.
All local work is done from the desktop, so when you first open a command prompt or if you close it and reopen it enter the following.
Code:
cd Desktop
Download CWM recovery image to Desktop. http://goo.im/devs/birdman/CWM-grouper-recovery.img
Download SuperSU CWM update zip to Desktop. http://forum.xda-developers.com/showthread.php?t=1538053
Go to Start or Start>Run and type in: cmd
Code:
cd Desktop
fastboot oem unlock
fastboot flash recovery CWM-grouper-recovery.img
adb reboot recovery
Now the device will reboot into recovery mode. If windows asks for drivers for the "new" usb connection direct the wizard to your <SDK>\extras\google\usb_driver. And the earlier modifications made in Step 1 should mean it installs the device and adb link.
Once drivers are installed and every is good go back to the command prompt, and type
Code:
adb devices
It should list your device with the word "recovery" next to it. If it doesn't then your device is not in recovery mode. Now enter in the following commands into the command prompt and it will make your devices CWM installation permanent.
Code:
adb shell
mount /system
cd /system
mv recovery-from-boot.p recovery-from-boot.bak
umount /system
exit
Now to install SuperSU. Tap "reboot system now" on the screen (if you dont see CWM, press the power button to show/hide it). Wait for the reboot. And then enter the following into the command prompt.
Code:
adb push CWM-SuperSU-v0.94.zip /sdcard
adb reboot recovery
Wait for reboot. You should see an image in the center of the screen. You might have to press the power button to toggle the visibility of the CWM menu. If you miss-tap on the screen, the power button acts like a back button and will return you to the previous menu screen.
Tap "install zip from sdcard" and then "choose zip from sdcard". Then select the CWM-SuperSU-v0.94.zip file (You may have to use the vol-up/down keys to highlight this if the file is listed off the bottom of the screen)
Let that install and then go back on the menus and choose "reboot system now".
Now if all is well after the reboot, if you run the following commands in command prompt.
Code:
adb shell
su
SuperSU might now prompt you on your devices screen to accept the root access, and then hopefully your command prompt should end in a # (this means you are root user 0). Now type exit twice to get back to the windows command prompt.
Now if you were to type "adb root" you will notice it tells you adbd is not able to go "full root". This will be solved in the next step. This is going to get complicated. You have been warned.
Step 3: True Rooting!
Now your device is "rooted". This is true, you now have a "su" binary installed and a visible app in the OS to manage super user privileges, but as a developer I want to be able to use things like "hierarchy viewer" on my live device. And have the room to do what I need to debug complex situations. So this is where True Root comes in. This essentially turns the device into a debug device that you would get direct from the manufacturer.
You may be able to get away with doing the following in a different way and you may not need to compile anything since fastboot has a boot flash option, but since I've never used this I've done it this way. If you prefer you can explore things in that direction, but be warned I've not tried it and so I have no idea if it would work.
Now for this step you will need access to a Linux installation. If you've never used Linux before don't be too afraid. But I am going to have to gloss over a few things. If you need further help on this step you will need to post in the topic and allow the community to advise on best pratices.
If you dont have access to a Linux installation or your newb to Linux then go here and follow the steps. It will add Linux to your PCs boot options and then you can go in and out of Linux when you need it. http://www.ubuntu.com/download/help/install-ubuntu-with-windows
Remember if your working on this step from a fresh Linux install like the above then you will probably want to install the android sdk for linux, at least enough to use adb from linux. This topic might help with this: http://forum.xda-developers.com/showthread.php?t=537508
Ok now from Linux follow along. You'll need git installed for this "apt-get install git".
We now need to compile the apps needed to modify our boot image. Details can be found here https://gist.github.com/1087757 but you might just want to follow my specific instructions.
Open a console window and type.
Code:
git clone https://android.googlesource.com/platform/system/core
cd core/libmincrypt
gcc -c *.c -I../include
ar rcs libmincrypt.a *.o
cd ../mkbootimg
gcc mkbootimg.c -o mkbootimg -I../include ../libmincrypt/libmincrypt.a
cd ../cpio
gcc mkbootfs.c -o mkbootfs -I../include
cd ../..
git clone https://github.com/beide/Bootimg-scripts.git
cd Bootimg-scripts
cp ../core/mkbootimg/mkbootimg ./
cp ../core/cpio/mkbootfs ./
Ok that has prapared the a Bootimg-scripts directory with the perl scripts we need and compiled binaries they use. Now make sure you have perl installed "apt-get install perl".
This is where things are going to split and it becomes your best guess as to how to proceed. I will show you the method I used from Windows. But if you have a installation of the SDK in Linux then you should be able to just open a new console and continue from here and ignore the bits I used to transfer files between Linux and Windows.
Back to the command console on Windows. We use adb to identify our boot partition and extract it.
Code:
adb shell cat /proc/partitions
You will now be presented with a list of paritions on your Nexus 7. Each block here for my device is 1K. So I'm looking down the list and I see one thats 8192 blocks, called "mmcblk0p2". Thats 8MB and I'm taking a educated guess that this is the boot partition, and for my Nexus 7 it is. (Note: if anyone has a better way of determining the boot parition please let me know).
Now we need to take a image of the partition. From here on out replace my partition device name in the commands below with yours if it differs.
Code:
adb shell
cat /dev/block/mmcblk0p2 > /sdcard/boot.img
exit
adb pull /sdcard/boot.img
Now if you want to confirm that this is the boot partition you will need to open the image file in your favorite hex editor and confirm the first bytes of the file are "ANDROID!" in ascii.
Now I FTP'd this image file over to my Linux box and into the Bootimg-scripts directory we created previously. If your following these steps from Linux then you should be able to open up the file manager and move the file into the folder.
Now back to Linux. We'll need to modify repack-bootimg.pl with a text editor of your choice. I leave this up to the reader. We need to modify line 19 the system call so that it starts with "./mkbootimg" rather than "mkbootimg". This is so perl fines mkbootimg in the local directory rather than anywhere else.
Now type in the linux console we had open in the Bootimg-scripts directory the following command.
Code:
perl ./unpack-bootimg.pl boot.img
ls -l
You should see boot.img-kernel.gz and boot.img-ramdisk.cpio.gz and a directory boot.img-ramdisk.
Open boot.img-ramdisk/default.prop in your favorite text editor and make the following adjustments.
ro.secure=1 should be edited to ro.secure=0 and ro.debuggable=0 should be ro.debuggable=1 and if you want ro.allow.mock.location can also be changed to 1 if you like.
Now we've made the required changes to our initrd (initial ramdisk) files we need to repack them to put back on the device.
Code:
perl ./repack-bootimg.pl boot.img-kernel.gz boot.img-ramdisk boot-debug.img
You will now have a new file called boot-debug.img. This contains our modified initial ramdisk. It will probably be smaller than the original. This is no concern as the original we copied was an image of the entire disk including the unused areas, where as the new image is only the data we need.
I now FTP'd this file back to my Windows machine, but as before if your doing this from Linux then you can just carry on.
We now need to flash this image file back onto the Nexus 7 replacing our current boot image. To do this we need to put the device into bootloader mode.
Back to your console/command window, and enter in.
Code:
adb reboot bootloader
Windows might want to install drivers and as before direct the wizard to <SDK>\extras\google\usb_driver.
Once your device is in bootloader mode. Go back to the console/command and enter in.
Code:
fastboot flash boot boot-debug.img
fastboot reboot
Now cross your fingers and hopefully you will get the boot loading animation and your device will get back to the Android launcher.
Now finally from your console/command window type in:
Code:
adb root
Hopefully if all is well it should reply with "adbd is already running as root". Now if you type in:
Code:
adb shell getprop ro.debuggable
It should tell you that its set to 1, meaning it is switched on.
Congratulations!! You have now True Rooted your device!.
You can now debug even system level apps, see log messages from all processes and logcat will now resolve all app names. Use Hierarchy Viewer on a live device instead of the horrible emulator. Do absolutely everything with your device that you want.
Happy hacking,
Napalm :good:
Click to expand...
Click to collapse
can't find recovery-from-boot.p. Y?
5implelove said:
can't find recovery-from-boot.p. Y?
Click to expand...
Click to collapse
Try not to quote a post that big mate, makes navigation a pain
5implelove said:
can't find recovery-from-boot.p. Y?
Click to expand...
Click to collapse
That part is only for the Nexus 7, and if you are using a Nexus 7 with custom ROM then this file may not exist. If you are using stock on a Nexus 7 then the only other question is whether you have renamed/moved/deleted it before. Once you
Code:
cd /system
type
Code:
ls -l recovery*
and see if anything is listed.
Napalm
Where did you find the info for step one?
Sent from my Nexus 7 using Tapatalk 2
I worked it out. You can find your VID and PID from your unknown device in Device Manager. You have to right click the device > Properties > Details > Choose Hardware Ids from the list. Since the driver from Google supports the same interfaces for other devices we can assume it works with the Nexus 7. I made the modifications and it works. Below is a full list of IDs if anyone wants them.
Napalm
Code:
Nexus 7
USB\VID_18D1&PID_4E40 : fastboot
USB\VID_18D1&PID_D001 : adb-recovery
USB\VID_18D1&PID_4E42 : composite-adb-interface (with mtp)
USB\VID_18D1&PID_4E42&MI_00: mtp-composite
USB\VID_18D1&PID_4E42&MI_01: adb-composite
USB\VID_18D1&PID_4E44 : composite-adb-interface (with ptp)
USB\VID_18D1&PID_4E44&MI_00: mtp-composite
USB\VID_18D1&PID_4E44&MI_01: adb-composite
USB\VID_18D1&PID_4E41 : mtp-only
USB\VID_18D1&PID_4E43 : ptp-only
Galaxy Nexus
USB\VID_18D1&PID_4E30 : fastboot
USB\VID_18D1&PID_D001 : adb-recovery
USB\VID_04E8&PID_6860 : composite-adb-interface (with mtp)
USB\VID_04E8&PID_6860&MI_00: mtp-composite
USB\VID_04E8&PID_6860&MI_01: adb-composite
USB\VID_04E8&PID_6866 : composite-adb-interface (with ptp)
USB\VID_04E8&PID_6866&MI_00: ptp-composite
USB\VID_04E8&PID_6866&MI_01: adb-composite
USB\VID_04E8&PID_685C : mtp-only
USB\VID_04E8&PID_6865 : ptp-only
Great guide, but why not just post up the new initrd for people that don't want to do this? It looks as if its the same for all devices.
As requested. Attached are the compiled tools and modified scripts used and the original and modified boot partition image files for the Nexus 7 running Android 4.1.2.
Napalm
Update for Android 4.2
Attached is the original and modified boot partition image files for the Nexus 7 running Android 4.2.
You can update yours with the following:
Code:
adb reboot-bootloader
fastboot flash boot nakasi-jop40c-android42-boot-new.img
Napalm
Attached is the original and modified boot partition image files for the Nexus 7 GSM/HSPA+ running Android 4.2.1
You can update yours with the following:
Code:
adb reboot-bootloader
fastboot flash boot nakasig-jop40d-android421-boot-new.img
Napalm
Amazing !
Is it possible to post the same file for N7 4.2.1 Wifi version?
Thanks
JulienDev said:
Amazing !
Is it possible to post the same file for N7 4.2.1 Wifi version?
Thanks
Click to expand...
Click to collapse
If I'm not mistaken, they are the same for wifi and 3g versions?
Same as before.. just an update for Android 4.2.2... as per the previous posts.. no idea if the non-GSM variant has the same boot partition. If anyone can test please post.
Attached is the original and modified boot partition image files for the Nexus 7 GSM/HSPA+ running Android 4.2.2
You can update yours with the following:
Code:
adb reboot-bootloader
fastboot flash boot nakasig-jdq39-android422-boot-mod.img
Getting a No_Command error
Hi, I am trying to true root Android M on my Nexus 7 2012 Wifi edition. I followed the steps here and was able to create the boot.img with the ro.debuggable=1 and ro.secure=0. however if i flash this boot.img the device boots and gets stuck in a android bot with a Red ! (bang) triangle. and says No command.
Any idea how to get ro.debuggable on for Android M?

Categories

Resources