How to Root Nexus 4 in Linux the Linux way. - Nexus 4 Q&A, Help & Troubleshooting

Note read other installation methods for windows and mac. This might help fill in the blanks.
I know us linux users don't understand all the wordy talk in android so I will be short and specific.
Because adb and fastboot are not native to ubuntu or any linux distro you must place these executable files in /bin or /usr/bin folder.
Open terminal type sudo Nautilus.
You must be superuser to copy and paste to /bin file system.
Next select View>Extra Panel
Third step go into Home>Downloads adt-bundle-linux-x86.zip
Unzip and extract file
Now Open extracted folder adt-bundle-linux-x86>sdk>platform-tools
The folder above is where you will find both adb and fastboot just drag and drop them into /bin
Must also get Supersu.zip
As well as ClockworkMod
Ready to Unlock Bootloader, flash image and gain Root access.
Type:
1. adb reboot bootloader = will show if any items are unlocked will be in red writing.
Unlock Bootloader
2. fastboot oem unlock - will unlock bootloader and flash information. Means you lose the data.
Root Device
1. adb reboot bootloader - at this point the bootloader should be in red because it is unlocked.
2. sudo fastboot flash recovery '/home/unityman/Downloads/recovery-clockwork-6.0.2.0-mako.img'
What should follow is
sending 'recovery (7804 KB)... OKAY
writing 'recovery'... OKAY
This point proceed to Clockworkmod by selecting it with the up and down volume
When in Clockworkmod select from sdcard again use up and down arrows and power button to confirm selection.
It should load the SuperSu.zip and show you have superuser permissions. Not when reboot SuperSu will ask if you want to grant su permissions select yes.
Note for ubuntu users. Because you loaded foreign terminal commands such as adb and fastboot. U will get error msg something wrong with file system. Nothing happens Ubuntu just complains about error in file system. I've ignored message and updated ubuntu twice.
Well got to run and load Ubuntu emulator
Cheers!
Happy Holidays
PS. What the biggest misunderstanding between linux and android is we don't grant Su or root permissions permanently. We grant superuser or temporary root permissions. Could you imagine if every person got onto your personal computer had root access system would be toast in 10 mins.

Thanks for the write up bro. I just wanted to point out that adb and fastboot are natively supported in Ubuntu 12.10.
Sent from my Nexus 4 using Tapatalk 2

culaterout said:
Note read other installation methods for windows and mac. This might help fill in the blanks.
I know us linux users don't understand all the wordy talk in android so I will be short and specific.
Because adb and fastboot are not native to ubuntu or any linux distro you must place these executable files in /bin or /usr/bin folder.
Open terminal type sudo Nautilus.
You must be superuser to copy and paste to /bin file system.
Next select View>Extra Panel
Third step go into Home>Downloads adt-bundle-linux-x86.zip
Unzip and extract file
Now Open extracted folder adt-bundle-linux-x86>sdk>platform-tools
The folder above is where you will find both adb and fastboot just drag and drop them into /bin
Must also get Supersu.zip
As well as ClockworkMod
Ready to Unlock Bootloader, flash image and gain Root access.
Type:
1. adb reboot bootloader = will show if any items are unlocked will be in red writing.
Unlock Bootloader
2. fastboot oem unlock - will unlock bootloader and flash information. Means you lose the data.
Root Device
1. adb reboot bootloader - at this point the bootloader should be in red because it is unlocked.
2. sudo fastboot flash recovery '/home/unityman/Downloads/recovery-clockwork-6.0.2.0-mako.img'
What should follow is
sending 'recovery (7804 KB)... OKAY
writing 'recovery'... OKAY
This point proceed to Clockworkmod by selecting it with the up and down volume
When in Clockworkmod select from sdcard again use up and down arrows and power button to confirm selection.
It should load the SuperSu.zip and show you have superuser permissions. Not when reboot SuperSu will ask if you want to grant su permissions select yes.
Note for ubuntu users. Because you loaded foreign terminal commands such as adb and fastboot. U will get error msg something wrong with file system. Nothing happens Ubuntu just complains about error in file system. I've ignored message and updated ubuntu twice.
Well got to run and load Ubuntu emulator
Cheers!
Happy Holidays
PS. What the biggest misunderstanding between linux and android is we don't grant Su or root permissions permanently. We grant superuser or temporary root permissions. Could you imagine if every person got onto your personal computer had root access system would be toast in 10 mins.
Click to expand...
Click to collapse
Thanks for the guide. I used this on my Ubuntu 12.10 box.
A few notes:
- I had to do add "sudo" for fastboot oem unlock so:
Code:
sudo fastboot oem unlock
- fastboot and adb are part of Ubuntu now as mentioned above, so I just installed using
Code:
sudo apt-get install android-tools-fastboot
sudo apt-get install android-tools-adb
Thanks again!

Thanks guys. I just successfully installed CWM and rooted my phone using the combination of your instructions.

I agree. Simple and clear instructions. Thanks for writing this up.
I downloaded the Android ADT package for Linux x64 (I run Debian Wheezy/Testing). Google distributes this as a zip, and it includes ADB etc, along with eclipse to start developing apps. I want to do that at some point so decided to download the whole thing. The problem though is that while the Eclipse binary included in the package is built for x64, adb and other tools are instead built for i386. So if you ./adb in the platform-tools directory, you will get a 'file or directory not found' error. To fix this -
Code:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install ia32-libs
You should now be able to execute adb, fastboot etc. I also recommend creating symlinks in the /usr/bin or similar for the tools you use frequently.

Please do never ever use sudo nautilus !!!
This might override the rights of some of your ~/ directory.
Use gksu/ gksudo instead.
Sent from my Nexus 4 using xda app-developers app

Nexus 4 Root via Linux Notes
I rooted my Nexus 4 with my Linux machine (Linux Mint) earlier today. I had a couple hiccups, notably:
If you download the 64-bit/x86_64 version of ADT (Android Developer Tools, i.e. adb/Eclipse/etc. for Android development), the executable tools such as adb and fastboot are actually 32-bit. If you have a relatively fresh Linux install, you need to install the 32-bit executable binaries (see note below). Otherwise you will get strange errors even though the files are marked executable.
I sometimes had issues with my computer connecting to the phone via USB, especially after rebooting the phone. I found simply swapping USB ports (switching between the mouse and the phone, for example) would cause the phone to be recognized again.
Otherwise the process was smooth.
Here are the notes I collected as I searched the forums and web for how to root the phone in case they are helpful to someone. They're not really in any particular order; it's just a collection of what I found.
I used the following instructions:
http://makegadgetswork.blogspot.com/2013/01/root-nexus-4-on-linux-mint-13-and.html
Code:
# It had been so long since I used my personal Linux box that I
# forgot the root password :).
# Reset root password and main user password
http://community.linuxmint.com/tutorial/view/339
# Boils down to:
1) Enter grub by holding down shift key during boot.
2) Change:
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=[letters and numbers]\[letters and numbers] ro quiet splash vt.handoff=7
to:
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=[letters and numbers]\[letters and numbers] rw init=/bin/bash
# In x86_64 disto of ADT (Android Developer Tools), ADB libs are 32-bit.
#
# Running the 32-bit libs without 32-bit support will cause strange errors
# such as 'adb: No such file or directory'
#
# Here is how to install 32-bit binary runtime support on your 64-bit OS:
apt-get install ia32-libs
# Also install Java:
apt-get install sun-java6-jdk
# How to mount Nexus 4 in Linux
http://forum.xda-developers.com/showthread.php?t=2004182
# How to backup phone prior to unlocking (unlocking will cause a factory reset)
http://forum.xda-developers.com/showpost.php?p=34744848&postcount=4
# Linux root guide (this is what I followed)
http://makegadgetswork.blogspot.com/2013/01/root-nexus-4-on-linux-mint-13-and.html
# Another good root guide (Windows oriented)
http://forum.xda-developers.com/showthread.php?t=2018179
# Linux root guide on XDA
http://forum.xda-developers.com/showthread.php?t=35217628
# Root guides (didn't really use these)
http://www.cultofandroid.com/23782/rooting-the-google-nexus-4-the-right-way-how-to/
http://forum.xda-developers.com/showthread.php?t=2010312&highlight=+waiting+for+device+
# How to fix Android devices not recognized by ADB
# (check that ~/.android is not owned by root)
http://www.tuxtrix.com/2013/03/how-to-fix-android-devices-not.html
# SuperSU download link:
http://download.chainfire.eu/282/SuperSU/
# CWM link:
http://www.clockworkmod.com/rommanager
# Setup device support for N4
sudo vi /etc/udev/rules.d/51-android.rules
# My /etc/udev/rules.d/51-android.rules
> cat /etc/udev/rules.d/51-android.rules
#LG - Nexus 4 - MTP (mount as media device)
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
# Bootloader Nexus 4
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee0", MODE="0660", OWNER="ankit"
# Normal Nexus 4
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee1", MODE="0660", OWNER="ankit"
# Debug & Recovery Nexus 4
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee2", MODE="0660", OWNER="ankit"
# Aliases to mount device as MTP
alias n4_mt 'sudo mtpfs -o allow_other /media/nexus4'
alias n4_umt 'sudo umount /media/nexus4'
# File that contains USB/device settings for N4
/etc/udev/rules.d/51-android.rules
# Restart devices
sudo service udev restart
# Print USB devices
lsusb
# Print ADB help
adb
# Print connected devices
adb devices
# Print device serial number
adb get-serialno
# Print device state
adb get-state
# Restart ADB server
adb kill-server ; adb start-server
# Restore sdcard backup
adb push ~/n4_bak_7_28/sdcard /sdcard/
# Reboot device to bootloader mode (needed to run fastboot)
adb reboot bootloader
# Reboot device to recovery (needed for flashing partitions (i.e. custom recovery, ROM)
adb reboot recovery
# Restore backed up data
adb restore ~/n4_bak_7_28/backup.ab
# Run shell on device
adb shell
# Show devices connected to fastboot
sudo fastboot devices
# Unlock phone (must be running in bootloader mode)
sudo fastboot oem unlock
# Flash custom recovery
sudo fastboot flash recovery /home/femtodude/install_adb/adt-bundle-linux-x86_64-20130717/sdk/platform-tools/recovery-clockwork-touch-6.0.3.4-mako.img

Related

Can't access fastboot through Ubuntu 9.10

Hey everyone , so I installed Android SDK on my Ubuntu 9.10 machine, the IDE works fine, my problem arises when I want to send commands to the phone using the fastboot command in the terminal. I get command not found error.
I followed both of these procedures:
http://forum.xda-developers.com/showthread.php?t=537508
http://wiki.cyanogenmod.com/index.php/Fastboot
any help would be greatly appreciated.
try this out......(link)
Follow this its better . Just got passed to me I think its cool. Try it out.
http://dennis.christilaw.com/?p=135
blackerwater said:
Follow this its better . Just got passed to me I think its cool. Try it out.
http://dennis.christilaw.com/?p=135
Click to expand...
Click to collapse
well i did try it , and still nothing it still says adb:command not found , fastboot: command not found
i don't know how good your linux skills are. but you might need to
Code:
chmod +x adp
, then you can run it from it's dir with
Code:
./adb
or you can ln or cp it to your bin dir. for fastboot the same applies (mutatis mutandis).
you might have to use sudo, too.
hope that helps
tried that too
Ubuntu still doesnt recognize it
i should tell you im trying to run it from the terminal window.
pk198105 said:
tried that too
Ubuntu still doesnt recognize it
i should tell you im trying to run it from the terminal window.
Click to expand...
Click to collapse
do this:for jaunty/karmic..
step 1
sudo touch /etc/udev/rules.d/51-android.rules
step 2
sudo gedit /etc/udev/rules.d/51-android.rules
#and add this line and save/close:
SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0666″
step 3 (modified permission)
sudo chmod a+rx /etc/udev/rules.d/51-android.rules
step 4( testing device)
./adb devices
step 5 (if works say thanks!))
note: some linux terminal accept ./adb devices or adb devices
Also before that you might want to check and see if the device ids show up when you plug the phone in. Might be something else with your device or rom your running......good luck.
pk198105 said:
Hey everyone , so I installed Android SDK on my Ubuntu 9.10 machine, the IDE works fine, my problem arises when I want to send commands to the phone using the fastboot command in the terminal. I get command not found error.
I followed both of these procedures:
http://forum.xda-developers.com/showthread.php?t=537508
http://wiki.cyanogenmod.com/index.php/Fastboot
any help would be greatly appreciated.
Click to expand...
Click to collapse
These are the best instructions I've found for setting up the Android SDK on Ubuntu:
http://www.futuredesktop.org/developing_android_apps_on_ubuntu.html
The bit you need to get right it setting up the "udev" policy file. The permissions you set here allow you to access the phone from Ubuntu's point of view.
Also....Do you know that to run a program FROM ITS FOLDER from the command prompt in Linux you need to put "./" in front of it? This is telling to look in the current folder for the program to execute it. But you have to be in that folder.
So you would go to [sdk-folder]\tools and type in (you may have to use 'sudo') "sudo ./fastboot devices" and it should list any attached phones that have USB debug turned on in the phone settings (you do have it turned on, right?)
You should see something like (from my phone):
[email protected]:~/android-sdk-linux/tools$ sudo ./fastboot devices
HT95SKF07937 fastboot
If you see this, then you can move to booting a recovery on your phone. If fastboot doesn't list any devices, then your udev probably isn't set up right.
Here is an extract. This works *every* time. The lines below mean you must use sudo to run fastboot or adb....and to start the adb server ("sudo ./adb start-server"). Butif you add GROUP="plugdev" to the end of each line and also add your username to the group "plugdev" (via SYSTEM -> Administration -> Users and Groups), then you don't need to use sudo.
*****
10d) In Ubuntu, create a new rules file for these vendor:device IDs.
Type this command to create the file.
$ sudo gedit /etc/udev/rules.d/51-android.rules
Add the following blue lines (rules) to it and save the file. If your lsusb command reports other, newer product IDs for vendor 0bb4, add them also to the file.
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0c01", MODE="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0c02", MODE="0666"
--
10e) Re-connect your phone.
Your phone should be detected if you unplug and reconnect it to the computer.
*****
List devices again and you should be fine.
If you're reading and understanding the instructions, it should work. If you're skipping the bits you don't understand.....then go back and understand them. No other way. I'm assuming here that your phone is able to handle fastboot. If you see the three dancing androids, it most likely can.
Try this write up by Google. Hope this one helps. If not then ill do an easy step by step. ....good luck. You know now that I think about it its easy doing it on windows witch doesn't make since it should be easier on a unix box for crap sakes!
http://www.google.com/gwt/n?u=http://developer.android.com/sdk/eclipse-adt.html
finally got it to work. It seems I was missing a file from the Android SDK. Everything is running smoothly, thank you all for your help.
Unfortunately it didnt say which file was missing..
pk198105 said:
finally got it to work. It seems I was missing a file from the Android SDK. Everything is running smoothly, thank you all for your help.
Unfortunately it didnt say which file was missing..
Click to expand...
Click to collapse
try using the sdk manager to update your sdk...see if that gets you the missing file...
-BMFC
i can't get fastboot to work. i placed it in the tools folder. if i enter "fastboot" in a terminal, i get the command line options. "fastboot devices" does not work, though adb and the android sdk are running fine. i'm able to make screenshots, but i'm not able to explore the phone or use fastboot. ideas?
when it says "adb: command not found" it usually isn't in your .bashrc path, or if you did put it in possibly you didn't log out/log back in or restart your computer.
PATH=”$HOME/bin:$PATH:/home/{USERNAME}/android-sdk-linux_86:/home/{USERNAME}/android-sdk-linux_86/tools"
glad you got it working though
could you help me, too?
if i enter fastboot in my terminal i get all the options:
Code:
[email protected]:~$ fastboot
usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall flash boot + recovery + system
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
reboot reboot device normally
reboot-bootloader reboot device into bootloader
options:
-w erase userdata and cache
-s <serial number> specify device serial number
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
so the program is working, executable and in my path.
adb does work, as well as the sdk.
i can connect to my phone via ddms and adb, but not via fastboot. it does not find anything....

Adb commands for beginners

ADB COMMANDS
This is just a simple guide on how to open up and run adb commands from your windows based operating system.
Open up run by simultaneously pressing the windows flag key and r.
In the window that pops up type cmd. Now command prompt is open
type the commands each followed by the enter key: cd\
cd androidsdk/tools
Now your in your in your androidsdk/tools folder. You can do several things in here but i'll start with some basics each
of the following commands is to be followed by the enter key
adb devices (this lets you know what devices are attached to the computer in usbdebugging)
How to get your logcat (this will put your logcat in txt format in your sdk tools folder)
adb logcat > logcat.txt
copy an app from your phone to your computer
adb pull /system/app/whatever.apk C:\ateam (replace whatever.apk with the app your pulling also replace ateam with the
folder your placing the app in
Install an app from your computer on your phone
adb install whatever.apk (put an apk in your sdk tools and replace"whatever" with the name of the apk and it will install it)
also you can add either -r or -s to reinstall or install on the sdcard for instance: adb install -r Rosie.apk
this command will reinstall the new rosie from your tools file and still keep the same user data as before.
-r for reinstall
-s for sdcard (gotta test this)
Push an app from your computer to your phones filesystem (in some cases also installs)
adb remount
adb push whatever.apk /system/app (put an apk in your sdk tools and replace "whatever" with the name of the apk and this
will push it to your system app folder. You can change the destination as well for example: You want to push Launcher2.apk
to your data/app folder: adb remount
adb push Launcher2.apk /data/app )
Remove an app from your phone
adb remount
adb shell
cd /system/app (this will change your disk to system/app you may also change to another folder as well)
ls -a ( a list will show of all the apps inside your system app folder)
rm whatever.* (replace the whatever.* with the name of a apk you want to remove )
Flash a recovery image to your phone
First pace the recovery image in your sdcard root and rename it to recovery (so the full name will now be recovery.img)
adb shell
flash_image recovery /sdcard/recovery.img (wait till this# sign shows up again before you type the next command)
reboot recovery
get your current battery level
adb shell cat /sys/class/power_supply/battery/capacity
get your current rom build
adb shell getprop ro.build.description
Reboot into fastboot ruu
adb shell reboot oem-78
How to run the ruu via adb
First thing first start the ruu give it permissions and so fourth
When it gets to the part where it says "Follow the instructons below..."
Move the ruu window out of the way and start your task manager
Go to processes right click on ARUWizard.exe and choose open file location
A new window will open scroll till you see ROM.zip
Copy and paste Rom.zip to your desktop
Once you have copied it to your desktop shutdown the ruu and task manager
Click start menu then click computer
A window will open up click the c drive
now click create new folder and name it test
put the rom.zip in the test folder
plug your phone in and open command prompt and type
Code:
adb devices
adb shell reboot oem-78
fastboot devices
fastboot getvar boot-mode
fastboot erase cache
fastboot flashzip C:\test\rom.zip
fastboot devices
fastboot getvar boot-mode
fastboot reboot
Very useful man thanks for the guide. I also think newbies would use this guide as its in the right catagory and not in some G1 section or Mt3g section.
Edit** isnt this already in the tuorials section?
sandboxlove said:
i think its a great idea, we need a more compilied list to refer to
add more!!!!
Click to expand...
Click to collapse
I'm going to try to add one everyday. tomorrows lesson how to run the ruu from adb
Powers16 said:
Very useful man thanks for the guide. I also think newbies would use this guide as its in the right catagory and not in some G1 section or Mt3g section.
Edit** isnt this already in the tuorials section?
Click to expand...
Click to collapse
Where? Pagelink
http://forum.xda-developers.com/showthread.php?p=5799939#post5799939
but its a less in depth reference so i hope this gets added into the tutorial section as here are no in depth tuts about adb in there..
also to remove apk
adb shell rm /system/ (then put in either app or media or what ever folder name /whatever.apk
Papa Smurf151 said:
also to remove apk
adb shell rm -r /system/ (then put in either app or media or what ever folder name /whatever.apk
Click to expand...
Click to collapse
rm -r is a recursive deletion and can have a lot of unwanted and harmful side-effects if used incorrectly. To just remove apks, a simple rm works just fine. If they typed the wrong directory, file name, whatever, a recursive deletion would clear the entire folder... Not really something you'd want.
This is great, I will be coming back for more.
Thanks a lot
DevinXtreme said:
rm -r is a recursive deletion and can have a lot of unwanted and harmful side-effects if used incorrectly. To just remove apks, a simple rm works just fine. If they typed the wrong directory, file name, whatever, a recursive deletion would clear the entire folder... Not really something you'd want.
Click to expand...
Click to collapse
thanks...i knew that but wasnt paying attention. I just copied and pasted from my adb notepad file. i edited my post and removed the -r
DevinXtreme said:
rm -r is a recursive deletion and can have a lot of unwanted and harmful side-effects if used incorrectly. To just remove apks, a simple rm works just fine. If they typed the wrong directory, file name, whatever, a recursive deletion would clear the entire folder... Not really something you'd want.
Click to expand...
Click to collapse
LOL, yeah, I've done that
Might want to also include a note that says when using linux or mac shell you replace the "adb" with "./adb" (I believe that is correct or at least what I do now when reading the windows cmd guides)
tejasrichard said:
LOL, yeah, I've done that
Click to expand...
Click to collapse
I wiped out 16 years of source code with it once....I got fired.
Kcarpenter said:
I wiped out 16 years of source code with it once....I got fired.
Click to expand...
Click to collapse
Oh damn that's crucial man. Hope they had backups
Screwin around
So I was screwin around with adb tryin to learn this stuff and I stumbled across this by just typing adb after cd'ing in. Hopefully its useful. Mind you I am a total noob to android/linux and this was a total accident. I am sure you all know about it though. Useful info though
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\>cd\
C:\>cd android-sdk-windows
C:\android-sdk-windows>adb
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB device.
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with the given serial number. Overrides ANDROID_SERIAL environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must be an
absolute path.
devices - list all connected devices
connect <host>:<port> - connect to a device via TCP/IP
disconnect <host>:<port> - disconnect from a TCP/IP device
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloade or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
C:\android-sdk-windows>
Hi, I'm abcdfv, and I approve this thread.
abcdfv said:
Hi, I'm abcdfv, and I approve this thread.
Click to expand...
Click to collapse
LOL Thanks
I've always been an advocator of EVERYONE learning the ADB basics at least.
updated with run the run the ruu via adb commands
I'm trying to flash my recovery image. I need help. What is the first comand I type at C:\Windows\System32> normally I type cd:\android-sdk-windows\tools
then i adb remount, then adb shell. When I do that now I get "remount failed: Invalid argument" I'm not TOTALLY clueless, although it may turn out that I am after this. any help would be great. I am booted in recovery, but since my recovery image is gone, its just an exclamation in a triangle. if i adb devices, i can see my phone and it says i'm in recovery. Thanks.
I need some serious help with this.....do you need to download anything on your computer?? can you explain all the stuff you need to do leading up to what you type into command prompt...anyone..i need help..i flashed darchstar froyo build and the recovery is all messed up..i cant flash anything..so i need to push a new recovery img.but i don't know anything about adb shell or anything .....please........ive never had to push anything..everyone always just puts flashable zips out for you...HELP

[HOW-TO] Lenovo IdeaTab A1000 Rooting

HOW TO ROOT YOUR LENOVO IDEATAB A1000​
<DISCLAIMER>​
By attempting these steps, your warranty will be void. Even worse than that, it might cause crashes, freezes, random explosions, 2nd degree burns, or even turn your beloved tab into $100+ paperweight. What works on mine might not work on yours, so don't attempt if you don't know what you're doing. Do at your own risk. Corrections are welcome. I must admit that I'm not an expert, so any info I posted might be wrong, and I can't offer you much help. I'm not responsible for anything arising from the use of this how-to. I can only wish you good luck.
<WHY ROOT?>​
- Without root or OTA upgrades (at time of writing, Indonesian customers still can't get it), you'll be stuck with ~500MB internal memory. That's annoying.
- You're stuck with the default IO scheduler (cfq) and governor (hybrid, haven't heard that one..)
- You have an incredibly large amount of bloatware you can't get rid of, in that already cramped up internal storage
- Did I mention freedom?
<REQUIREMENTS>​
This method is originally used to root Acer Iconia B1-A71. Somehow I noticed that the two actually has the same chipset, MTK8317 (if it really was relevant ). So I tried the method, and through sheer n00b's luck, it worked like a charm!
Lenovo IdeaPad A1000-G --> 4GB storage, 2G/EDGE. This method haven't been tested on A1000-T/F, different storage cap (16GB, etc.) or other variants, but it should work with slight modification. Screenshots of my specs are attached below. Remember, proceed at your own risk!
A Linux System. Never tried on Windows or Mac. I personally used Linux Mint 15. The source post uses Ubuntu.
working ADB (android-tools-adb). You can get this from synaptics, apt-get, etc. If your system can detect adb devices, you should be fine.
Superuser Binary
Busybox Binary (You can get these two from the links on original post. XDA says noobs can't post links :'( )
ORIGINAL THREAD
<CREDITS>​
XDA Senior Member entonjackson, for writing such a noob-friendly how-to for rooting Acer Iconia B1-A71 and for allowing me to use it for this how-to.
XDA Member alba81, for discovering the method as acknowledged on the original post by entonjackson
All awesome gurus on XDA which I can't mention one by one.
<THE STEPS>​
1. Extract the android sdk to your home folder, e.g. a user named Bob will use like /home/bob
2. Open a terminal
3. Now plug your A1000 into your machine and turn on Debugging Mode (Go into Settings -> Developer Tools, turn on Developer tools, then turn on USB Debugging Mode)
4. Now back at the keyboard of your Linux machine in your terminal type:
Code:
sudo adb devices
The output should be something like:
Code:
123456789ABCDEF device
If it's not, google for it. Somehow your Linux hasn't detected the A1000, although the android sdk for Linux brings all needed drivers with it.
If your device was found, congratulations. The adb connection between your linux machine and your tablet is intact.
5. Now extract the downloaded busybox archive to your home folder, in it there should be a busybox binary. So Bob does:
Code:
sudo ./adb push /home/bob/busybox /data/local/tmp
Code:
sudo ./adb shell
Code:
chmod 755 /data/local/tmp/busybox
6. You should copy the busybox binary into a directory where you can access it as a plain non-root user on the tablet. We need this binary. so we can apply unix tools like telnet, dd, cat, etc. But for now we need it to establish a telnet session between our tablet and our linux machine.
(This point is written on original post. Seems important, but as soon as I finished step 5, I can use those tools)
7. Dial *#*#3646633#*#* to enter Engineer Mode
8. Go to Connectivity -> CDS Information -> Network Utility
9. type the following command:
Code:
/data/local/tmp/busybox telnetd -l /system/bin/sh -p 1234
Advice from original poster: copy and paste it from the browser on your tablet, because dependent on which keyboard app installed, this can be freakin tricky. In the next step you will learn, why it's so important why this command should be correct.
10. Tap on Run. You won't get any feedback, so you will never know if the entered command runs properly or not. That's why you should make sure the command is ok.
Now we have started our telnet server on the tablet.
11. Back in the terminal type:
Code:
/data/local/tmp/busybox telnet 127.0.0.1 1234
If you now get an error like couldn't find busybox or something, then either adb push failed or you forgot to chmod, in step 5
12. Now enter:
Code:
cat /proc/dumchar_info
You should get a bunch of lines, try to find a line containing the partition named android
{..... partition list .....}
android 0x0000000028A00000 0x00000000020E8000 2 /dev/block/mmcblk0p3
{..... partition list .....}
13. We will create a dump of our android system. This is the point where different variants *MIGHT* have different parameters. This step is important, as wrong parameter will result in unmountable image.
Stop. Take a deep breath. If you're not familiar with dd, find a good doc of it. There's a plethora of them.
Get yourself a programmer's calculator (Linux Mint 15 has one built in).
Here's what you'll do :
Convert the hex number on the 3rd column into decimal. In my case (0x20E8000) will yield 34504704. Divide by 4096. The result (8424) goes to the skip parameter.
Convert the hex number on the 2nd column. In my case (0x28A00000) will yield 681574400. Divide by 4096. The result (166400) goes to the count parameter.
So the full dd command will look like :
Code:
dd if=/dev/block/mmcblk0 bs=4096 skip=8424 count=166400 | gzip > /cache/system.img.gz
Do a full sanity check before hitting enter! It will take about 5 minutes.
14. After it's finished we must make the image readable for adb, so we do:
Code:
chmod 777 /cache
and
Code:
chmod 777 /cache/system.img.gz
15. Leave the telnet, and then adb shell session by:
Code:
exit
Code:
exit
16. Now we pull our image by
Code:
sudo adb pull /cache/system.img.gz
wait 1-2 minutes.
It should be then located inside /home/bob. It did for me. If not, do a search . It should be a .gz, extract it right there (or /home/bob if it isn't there)
17. Now we need to modify our system image by adding the tiny but helpful su binary. Extract the SU binary to /home/bob.
18. We create a folder where we will mount our system image to. To create it do:
Code:
sudo mkdir /media/a1000
19. Now we mount it:
Code:
sudo mount -o loop /home/bob/system.img /media/a1000
if it fails, then you entered wrong parameters on step 13
20. Now we copy our SU binary to our mounted system image:
Code:
sudo cp /home/bob/su /media/a1000/bin
21. the su binary needs to have the proper rights to make it usable, so we 'suid' it with:
Code:
sudo chmod 06755 /media/a1000/bin/su
22. Let's unmount our baby by:
Code:
sudo umount /media/a1000
and because bob doesn't like a messed up system, he does:
Code:
sudo rm -rf /media/a1000
because he hopefully won't need it anymore.
23. We have to gzip it again to bring it back to where it belongs to. this we do by:
Code:
cd /home/bob
Code:
gzip /home/bob/system.img
24. So here we are now, we made it to the final Boss fight! The next steps are dangerous and should be performed with caution. We copy back our modified system image, which can brick your device, if you do a mistake! Enter adb shell again :
Code:
sudo adb shell
25. Remove the old boring image:
Code:
rm /cache/system.img.gz
26. Leave adb shell
Code:
exit
27. copy our cool new system image containing the su binary:
Code:
sudo adb push /home/bob/system.img.gz /cache
28. Enter adb shell again
Code:
sudo adb shell
29. Usually the telnet server on the tablet is still running, at least in my case it's been like that. That's why we can directly connect to the telnet server with:
Code:
/data/local/tmp/busybox telnet 127.0.0.1 1234
If this doesn't work, then obviously your telnet server isn't running anymore. So on your tablet if the telnet command is still entered (see step 9), tap on Run again and repeat step 29.
30. Now this is the most dangerous step in this how to (no it wasn't the mkdir one). You can copy following command to make sure everything is fine and paste it into your telnet session on your linux terminal.
<WARNING! SANITY CHECK! MAKE SURE *ALL* THE DD PARAMETERS MATCH THE FIRST DD (STEP 13) OR YOUR A1000 WILL TURN INTO A VERY EXPENSIVE PAPERWEIGHT!>
Code:
[B]/data/local/tmp/busybox zcat /cache/system.img.gz | dd of=/dev/block/mmcblk0 bs=4096 seek=8424 count=166400[/B]
After 1-2 minutes you're done, if your tablet or pc or yourself didn't catch fire, everything's fine.
31. Leave telnet / adb shell by doing
Code:
exit
Code:
exit
32. Reboot your A1000 via ADB, then exit
Code:
sudo adb reboot
Code:
exit
33. Unplug your tablet from PC
34. Install Superuser (No, not SuperSU, cause it won't work!). I personally use Superuser by ChainsDD, from Play Store
35. Be lucky. Your tablet and thus you are now free!
Don't forget to hit thanks, if this helps ​
hi, after step 13 (i double checked the command), i get this error
Code:
/system/bin/sh: can't create /cache/system.img.gz: Permission denied
/dev/block/mmcblk0: cannot open for read: Permission denied
I have the WiFi 4G version
Im too stuck in step 13.....nothing wrong with the script, can u give me a solution?
Im using A1000G also
@ts
Your guide work perfectl, in windows enviroment but mount step still need linux,
I've question are you using DirectoryBinding? Mine always close when playing Real Racing, its very annoying
You have suggeztion or alternative for DirectoryBinding?
Root with Windows ?
Hi,
I am a new member because i bought this tblet but i can't root. I don't have a linux environment, so there is a solution with W8 Pro 64 ?
Thanks a lot for you help,
ulisez said:
hi, after step 13 (i double checked the command), i get this error
Code:
/system/bin/sh: can't create /cache/system.img.gz: Permission denied
/dev/block/mmcblk0: cannot open for read: Permission denied
I have the WiFi 4G version
Click to expand...
Click to collapse
have you chmod-ed the busybox (or is the chmod successful without error)? Try chmod-ing the /cache before attempting step 13. It seems that you still don't have access to the NAND device (mmcblk0). Have you updated firmware via OTA?
artonelico said:
Im too stuck in step 13.....nothing wrong with the script, can u give me a solution?
Im using A1000G also
Click to expand...
Click to collapse
Do you encounter the same error message like ulisez had? Could you post the screenshot of the partition list (the lines after you execute dumchar_info)?
rmage said:
@ts
Your guide work perfectl, in windows enviroment but mount step still need linux,
I've question are you using DirectoryBinding? Mine always close when playing Real Racing, its very annoying
You have suggeztion or alternative for DirectoryBinding?
Click to expand...
Click to collapse
I personally use Link2SD by Bulent Akpinar to link apps to 2nd partition on my SDcard.
Letsar said:
Hi,
I am a new member because i bought this tblet but i can't root. I don't have a linux environment, so there is a solution with W8 Pro 64 ?
Thanks a lot for you help,
Click to expand...
Click to collapse
The original developer who posted the method (entonjackson) plans to integrate the method in the next release his toolkit, the Acer Iconia Toolkit. I think you should check his thread : http://forum.xda-developers.com/showthread.php?t=2240029
sammymaddog said:
have you chmod-ed the busybox (or is the chmod successful without error)? Try chmod-ing the /cache before attempting step 13. It seems that you still don't have access to the NAND device (mmcblk0). Have you updated firmware via OTA?
Do you encounter the same error message like ulisez had? Could you post the screenshot of the partition list (the lines after you execute dumchar_info)?
I personally use Link2SD by Bulent Akpinar to link apps to 2nd partition on my SDcard.
The original developer who posted the method (entonjackson) plans to integrate the method in the next release his toolkit, the Acer Iconia Toolkit. I think you should check his thread : http://forum.xda-developers.com/showthread.php?t=2240029
Click to expand...
Click to collapse
Link2SD doesn't link app data, do you have any option?
yes i had same message with ulyses, by the way im from indonesia too can i contact you through chat client?
oh yeah im using windows 7 and using cmd as a terminal in linux
thx before bro
sammymaddog said:
The original developer who posted the method (entonjackson) plans to integrate the method in the next release his toolkit, the Acer Iconia Toolkit. I think you should check his thread : http://forum.xda-developers.com/showthread.php?t=2240029
Click to expand...
Click to collapse
Ok, i see his toolkit. It's very good. I'll wait
rmage said:
Link2SD doesn't link app data, do you have any option?
Click to expand...
Click to collapse
I'm not sure whether the stock kernel of our devices supports init.d, thus supports CronMod/Data2SD. Lenovo locked our bootloader, and currently there's no way around it. So I personally think, Link2SD method are the best option for now.
Let's give it several months until our dev gurus bring their miracles upon this device
The attached image shows mt6577 Hardware, can u provide the Soc details please
Hi, Can any one upload Lenovo ideatab A1000 system.img
in step 20, it appears you are writing to a /bin directory on the android system. However such a directory is not visible either through shell or the system telnet account.
Do I need to understand something else about android to make sense of this.
regards
vidya
one month gone past but the op seems to be in caves or has bricked the device
STOCK ROM
CAN ANY BODY PROVIDE ME A STOCK ROM OF THIS DEVISE
I HV ROOTED SUCCESSFULLY BY A VERY EASY METHOD
BUT SCREWED UP WHILE UPDATING IT SO PLZ PLZ HELP ME OUT
THE DEVICE BOOTS BUT ALL THE APP CRASHES :crying::crying:
VR.gtmini said:
The attached image shows mt6577 Hardware, can u provide the Soc details please
Click to expand...
Click to collapse
VR.gtmini said:
one month gone past but the op seems to be in caves or has bricked the device
Click to expand...
Click to collapse
sorry to make you wait. I'm a last grader university student, and final project stuffs have got me pinned down. Hope you understand
Actually the SoC is MT8317. For some god-knows reason Mediatek have made this SoC with signatures similar to MT6577. But somehow CPU tweaker correctly detects the SoC (MT8317). Maybe it's the CPU-Z bug?
unknown_world said:
Hi, Can any one upload Lenovo ideatab A1000 system.img
Click to expand...
Click to collapse
zod0070 said:
CAN ANY BODY PROVIDE ME A STOCK ROM OF THIS DEVISE
I HV ROOTED SUCCESSFULLY BY A VERY EASY METHOD
BUT SCREWED UP WHILE UPDATING IT SO PLZ PLZ HELP ME OUT
THE DEVICE BOOTS BUT ALL THE APP CRASHES :crying::crying:
Click to expand...
Click to collapse
I'm uploading the modified .img. Let's pray my old HSPA modem won't catch fire by the morning.
vidyadhara said:
in step 20, it appears you are writing to a /bin directory on the android system. However such a directory is not visible either through shell or the system telnet account.
Do I need to understand something else about android to make sense of this.
regards
vidya
Click to expand...
Click to collapse
I think you got it wrong. The write process does not take place on the device. It's on the loop-mounted .img in /mnt/a1000 on your computer (step 18-19). Cheers!
Here's the ALREADY BUSYBOX-ED .img for Ideapad A1000-G 4GB EDGE version. Hope it helps :
www dropbox com/s/rmpnz7c285t5sqz/system.7z
sammymaddog said:
Here's the ALREADY BUSYBOX-ED .img for Ideapad A1000-G 4GB EDGE version. Hope it helps :
www.dropbox.com/s/rmpnz7c285t5sqz/system.7z
Click to expand...
Click to collapse
Thanks for coming back, could u post the MD5 of the system.7z & system.zip.
Also could u provide simple way/steps to directly flash this .img without extracting existing stock system image
My tab A1000-G
do you have stockROM for lenovo A1000G
I need this :crying:
raffly said:
do you have stockROM for lenovo A1000G
I need this :crying:
Click to expand...
Click to collapse
Don't worry, the above link is a stock Lenovo A1000 G ROM, but with pre-root files having no superuser app. Just extract the .7z file
System.7z MD5: 658CA71AC8A230B244F267513857F9A5

How to install ROM, root and backup using LINUX OS?

I'm a daily Linux user and don't have installed Windows on my PC.
So I would like to ask first how to backup my X720 phone into my Linux PC? Then install root and new custom rom using the same OS?
Before I had Samsung phone and was using application called Heimdall in Linux, similar like Odin for Windows.
Is there any similar app for Le Eco or can I use commands in Terminal?
https://www.xda-developers.com/install-adb-windows-macos-linux/
https://www.xda-developers.com/adb-fastboot-any-directory-windows-linux/
Follow the links above, all you really need is adb. There are some Chinese Windows recovery programs and scripts for certain variants of the Pro3 (like the x722 and the x720) but you probably won't need to use them unless you catastrophically brick the phone somehow. As long as you're following instructions from ROM threads properly, all you'll ever need is adb and the rest you can do through your phone via TWRP or Magisk or whatever.
Well there is one additional hangup...the phone will not appear in "adb devices" at least on Linux Mint/ubuntu...the solution is as follows.
sudo apt-get install android-tools-adb android-tools-fastboot
tar -jxvf lepro3.tar.gz
cp abd_usb.ini /home/<your username>/.android
sudo cp 51-android.rules /etc/udev/rules.d
sudo killall adb
sudo adb devices
Basically you are manually adding the vendor id so adb can find it. Plan on having to use sudo in front of any adb or fastboot commands to avoid possible errors.
It should then find the device and you can follow a tutorial like the one here: https://docs.google.com/document/d/1qFJ7ULjU57XSkm-j8P9vDbnV1JU1YZYQS70StWRlrbo/edit?usp=sharing
I did not create this. It's a copy of the one created by Abel408 on slickdeals but I used it to take my factory phone and install omnirom about 5 days ago on linux.
famewolf said:
Well there is one additional hangup...the phone will not appear in "adb devices" at least on Linux Mint/ubuntu...the solution is as follows.
sudo apt-get install android-tools-adb android-tools-fastboot
tar -jxvf lepro3.tar.gz
cp abd_usb.ini /home/<your username>/.android
sudo cp 51-android.rules /etc/udev/rules.d
sudo killall adb
sudo adb devices
Basically you are manually adding the vendor id so adb can find it. Plan on having to use sudo in front of any adb or fastboot commands to avoid possible errors.
It should then find the device and you can follow a tutorial like the one here: https://docs.google.com/document/d/1qFJ7ULjU57XSkm-j8P9vDbnV1JU1YZYQS70StWRlrbo/edit?usp=sharing
I did not create this. It's a copy of the one created by Abel408 on slickdeals but I used it to take my factory phone and install omnirom about 5 days ago on linux.
Click to expand...
Click to collapse
Hello
I'm new in this community and me too, I have a LeEco Le Pro 3, never flashed, so it has the new updates of EUI 5.9s and all chinese apps.
I'd like to put this ROM
Me too, I'm a linux user, I've Ubuntu 16.04 LTS
Before I never flashed a phone, so I don't know how to do well even if I read a lot of procedures, but all for Win.
How do to the same with my OS?
I'd prefer to follow a complete list of instructions not to make errors and problems to my phone.
I've a LeEco Le Pro 3 (X720) original and never flashed, with 6GB of RAM, and 64GB of memory
Thanks to who wants to help me accurately
Hello,
no one could help me?
Is there no solution for Linux users? How is it possible?
spsturbo said:
Hello,
no one could help me?
Is there no solution for Linux users? How is it possible?
Click to expand...
Click to collapse
In short install ADB&fastboot tools, reboot to bootloader, unlock it via fastboot, flash TWRP, boot into TWRP, do a factory reset, flash your ROM, you're done
BlueFlame4 said:
In short install ADB&fastboot tools, reboot to bootloader, unlock it via fastboot, flash TWRP, boot into TWRP, do a factory reset, flash your ROM, you're done
Click to expand...
Click to collapse
And in more detailed manner?
Could you list the exact commands to type on the terminal?
spsturbo said:
And in more detailed manner?
Could you list the exact commands to type on the terminal?
Click to expand...
Click to collapse
Whoa, no offense but I don't have time for that. Just search for each of these things and you will find an answer. I will also answer specific questions but I don't like unspecific ones like "post the whole process please".
spsturbo said:
And in more detailed manner?
Could you list the exact commands to type on the terminal?
Click to expand...
Click to collapse
Just google it and you will find all that you need.
spsturbo said:
And in more detailed manner?
Could you list the exact commands to type on the terminal?
Click to expand...
Click to collapse
https://ubuntuforums.org/showthread.php?t=2326450
famewolf said:
Well there is one additional hangup...the phone will not appear in "adb devices" at least on Linux Mint/ubuntu...the solution is as follows.
sudo apt-get install android-tools-adb android-tools-fastboot
tar -jxvf lepro3.tar.gz
cp abd_usb.ini /home/<your username>/.android
sudo cp 51-android.rules /etc/udev/rules.d
sudo killall adb
sudo adb devices
Basically you are manually adding the vendor id so adb can find it. Plan on having to use sudo in front of any adb or fastboot commands to avoid possible errors.
It should then find the device and you can follow a tutorial like the one here: https://docs.google.com/document/d/1qFJ7ULjU57XSkm-j8P9vDbnV1JU1YZYQS70StWRlrbo/edit?usp=sharing
I did not create this. It's a copy of the one created by Abel408 on slickdeals but I used it to take my factory phone and install omnirom about 5 days ago on linux.
Click to expand...
Click to collapse
Thank you for your great help! I tried this but it still didn't recognized the device if you use the command "adb devices", instead you need to use "fastboot devices" and add to your file USB id for fastboot.
First you need to find your USB id number by running phone in fastboot mode and use command "lsusb" in terminal. Here are instructions: https://android.stackexchange.com/questions/144966/how-do-i-get-my-device-detected-by-adb-on-linux
Then put those number into your two files:
Put in "adb_usb.ini" your first ID number in my case
Code:
0x18d1
(Don't root directory /home/USERNAME/.android)
for opening file 51-android.rules in /etc/udev/rules.d you need to use root and put this inside:
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d00d", MODE="0666", GROUP="plugdev", SYMLINK+="android"
In the end restart the udev service in terminal "service udev restart" and restart the ADB server: adb kill-server && adb start-server. Disconnect and reconnect the device again.
For recovery used this tutorial: https://forum.xda-developers.com/le-pro3/how-to/leeco-le-pro-3-root-t3476560
I was unable to get info from
Code:
fastboot oem device info
, but manage to unlock the bootloader:
Code:
fastboot oem unlock-go
and successfully installed Lineage 15.1 OS.

[Guide]Temporary root(Dirty COW) Marshmallow , Honor 5x

This is a guide on how to obtain temporary root on marshmallow stock ROM for the Honor5x. Works on KIW-L24 and should work fine for other models.
1. Install Android Studio.
2. Install NDK within android studio.
3. If you run
Code:
ndk-build
and it says command not found, you'll need to add the ndk-build path to your environmental variable. After you install NDK, 'ndk-build' file will exist on your computer. In Linux, the path location is ~/Android/Sdk/ndk/22.1.7171670/build/ndk-build
Ex.
Code:
export PATH=$PATH:/home/user123/Android/Sdk/ndk/22.1.7171670/build/
4. Download Dirty COW exploit and extract zip to a folder: https://github.com/timwr/CVE-2016-5195
5. Open terminal and navigate to 'CVE-2016-5195' directory.
6. Plug your phone in and make sure you can 'adb devices'.
7.
Code:
make root && adb shell;
8.a If you get error 'CANNOT LINK EXECUTABLE cannot locate symbol'. Then go to ~/Android/Sdk/ndk/22.1.7171670/build/gmsl and modify line 512 of '__gmsl' to say:
Code:
int_encode = $(__gmsl_tr1)$(wordlist 1,$(words $1),$(__gmsl_input_int))
More Info See: https://stackoverflow.com/questions/17131691/non-numeric-second-argument-to-wordlist
8.b.
Code:
make root && adb shell;
9. If everything goes right, you should be inside the shell of the phone and you should see '#' instead of '$', which indicates root.
The command that gets executed that puts you in temporary root is
Code:
adb shell /system/bin/run-as
Now what I don't know is how to obtain permanent root from here. Most people are going to say 'unlock your bootloader and flash a different ROM'. While I agree, this is the ideal solution. But if you can't unlock bootloader then the next best thing is permanent root on your current build.
I got # after step 9. But how that is temporary root? Root checker app doesn't recognize as rooted device.

Categories

Resources