How to root an Android Virtual Device? - Android Q&A, Help & Troubleshooting

I want to root my Android 4.0.4 virtual device for developing.......... How to root it?

Here you go ... ;-)
Paresh Kalinani said:
I want to root my Android 4.0.4 virtual device for developing.......... How to root it?
Click to expand...
Click to collapse
The following method is actually for 2.2 virtual machine ... but should work fine for 4.0 too ... i'll confirm after i have tested it ... meanwhile you can try it ..
You'll require
'su' binary
and
'busybox binary'
SU BINARY : See post's end
BUSY BOX BINARY : see posts end
Then, we need to start the emulator by providing extra partition size to /system. This can be done only through command-line
Code:
emulator -avd MyAndroid -partition-size 128 -no-snapshot-load
Make sure the AVD “MyAndroid” is already created. The “-no-snapshot-load” option is used if we enabled the snapshot. As a result, we will start the emulator with extra disk space for /system. By this, we can adding extra files to /system later.
Then, we need to use “adb shell” to remount the /system so that we have write access to the /system.
Code:
adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system
Then, we can push the su and busybox to the /system/xbin.
Code:
adb push su /system/xbin/
adb push busybox /system/xbin/
Now, to actually make the su work properly, we need to chmod it,
Code:
adb shell chmod 06755 /system/xbin/su
adb shell chmod 06755 /system/xbin/busybox
Now, we need to install Superuser.apk (which you can get together with “su”). We can install it with “adb install” command. It is required when the other apps request for “su”.
We can try our “su” with Root Checker Basic or Stericson Busy-box.
Now, that is rooting. You might feel happy with it. However, if we restart the emulator, without snapshot, all the “su” does not work any more. So, we are going to customise the ROM image.
Failures
Now, if we restart the emulator, everything will return to default. No more “su” and Android Market. Why? The reason is because whatever we done to the /system, it will not save to the ROM image.
The /system is actually from the system.img, installed with android-2.2 in my case. This file is mounted in emulator as yaffs2 file system format. In order to customise this ROM image, I have tried several ways.
Using unyaffs, it can only extract the image, but I cannot continue. I can simply pull the /system using adb command without it.
Using yaffs2utils, unyaffs2 produced nothing. And the image built by mkyaffs2 does not allow the emulator to boot.
Using mkyaffsimage, also not work as above.
Some resources mentioned that, we can get the mkyaffs2image utility when building the Android source. But the problem is, to get the source, it requires a lot of disk space and need a long time to download.
So, what is the best way to modify the system.img? I even tried the low level way using dd to extract the /dev/block/mtdblock0, but failed.
Solution
Finally, I tried to solve it with userdata-qemu.img. This is the /data folder that will always modified when we install apps in the emulator. Restarting the emulator does not reset /data. Therefore, we can simply create the ROM image from /data. We can done it simply clean all the /data.
Code:
adb shell busybox rm -R /data/*
This will remove everything is /data, except “lost+found” folder.
Code:
adb shell busybox ls /data
Check with ls command, make sure only “lost+found” left.
Now, since the /system contains the “su”, “busybox”, Market and Google Services Framework we have done earlier, we need to copy the whole /system to the /data.
Code:
adb shell busybox cp -a /system/* /data/
adb shell busybox ls /data
As a result, the /data is identical to the /system.
Now, we have the userdata-qemu.img file in the AVD folder, which is modified. Close the emulator. Then, we can use the userdata-qemu.img file as the system image. We can rename it to system.img, or calling it as the system with “-system” option from the emulator command-line.
Start the emulator with this customised system.img, now, we have busybox by default, and also Android Market. :good::highfive:

Tip
If you are doing this on windows make sure you CD to here for issuing the commands:
%profilename%\AppData\Local\Android\android-sdk\tools
Don't use the stuff in C:\Program Files\Android. That is the wrong location.
The below gets your GAPPS too. You can download Cyanogens GAPPS to get what you need. Just edit the necessary lines below.
cd %profilename%\AppData\Local\Android\android-sdk\
.\tools\emulator -avd MyAndroid -partition-size 2047 -no-snapshot-load -verbose
echo wait for boot
pause
.\platform-tools\adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system
.\platform-tools\adb push %~dp0platform-tools\su /system/xbin/
.\platform-tools\adb push %~dp0platform-tools\busybox /system/xbin/
.\platform-tools\adb shell chmod 06755 /system/xbin/su
.\platform-tools\adb shell chmod 06755 /system/xbin/busybox
.\platform-tools\adb shell busybox rm -R /data/*
.\platform-tools\adb shell busybox ls /data
.\platform-tools\adb shell busybox ls /data
.\platform-tools\adb push %profilename%\Downloads\gapps-ics-20120317-signed\system /system
.\platform-tools\adb shell busybox cp -a /system/* /data/

Which busybox binary?
You don't say which of the various busybox files in the .7z archive is to be used on the AVD?

I try to push the su, I got this message:
C:\adb>adb push sources\root\su /system/xbin
failed to copy 'sources\root\su' to '/system/xbin/su': Directory not empty
Then try push the Superuser.apk
C:\adb>adb push sources\root\system\app\Superuser.apk /system/app/Superuser.apk
failed to copy 'sources\root\system\app\Superuser.apk' to '/system/app/Superuser
.apk': Out of memory
I think that's because of this:
View attachment 1617834
How to make the System ROM space more freely???
----------------------------------------------------------------------------
Sorry for my noob question. Now, I see.
I have done untill rename userdata-qemu.img to system.img
But while I run from AVD Manager, my AVD got bootloop.

That's because you haven't started your emulator with additional space. Use the -partition-size option as per niranjan94's post above.
I found an even better way to make a /system image, and adapted it for use on Windows hosts and using the x86 emulator images now available.
References:
http://blog.thecobraden.com/2012/06/making-persistent-changes-to-android.html
http://code.google.com/p/android-group-korea/downloads/detail?name=mkfs.yaffs2.x86
Place this batch file in the same folder as the mkfs.yaffs2.x86 binary and you'll get an emulator image updated to your liking and ready to run.
Code:
@echo off
adb -e remount
echo Pushing mkfs.yaffs2.x86 to device...
adb -e push mkfs.yaffs2.x86 /data/local/
echo Executing chmod 770 /data/local/mkfs.yaffs2.x86
adb -e shell chmod 770 /data/local/mkfs.yaffs2.x86
echo Setting /system partition to read-only (Just to be safe!)
adb -e shell mount -o ro,remount /dev/block/mtdblock0 /system
echo Creating YAFFS2 image of /system
adb -e shell /data/local/mkfs.yaffs2.x86 /system/ /mnt/sdcard/_system.img
echo Pulling image to local directory...
adb -e pull /mnt/sdcard/_system.img
echo Cleaning....
adb -e shell rm /data/local/mkfs.yaffs2.x86
adb -e shell rm /mnt/sdcard/_system.img
echo OK
pause

Don't work on 4.2.2 emulator
Ι mean I push it, give permissions, install su.apk ... still nothing...

On 4.2.2 emulator
Hi,
I got the same error on 4.2.2 emulator.
So I tried with size 256:
emulator -avd Andy2 -partition-size 256 -no-snapshot-load
and it worked fine.
Also, I'm using CPU ARM (armeabi-v7a). So for busybox I used the binary from this thread:
http://forum.xda-developers.com/showthread.php?t=1380278

Error while trying to permanent patch rooted android
Hi,
While trying to root my android emulator where I delete all the files in the /data/ folder and copy files from /system/ to /data/, I am getting the following error,
Code:
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
Could anyone help me how to overcome this issue?

Hi,
i've followed your instructions step by step and didn't encounter any problems while executing the commands, but the emulator is not getting rooted according to the Root Checker app (see also the screenshot attached). Could you help me please to solve this issue?
Here is an enumeration of the commands I've entered into the console:
emulator -avd Huawei -partition-size 256 -no-snapshot-load
adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system
adb push "C:\Users\Admin\Desktop\Superuser-3.0.7-efghi-signed\system\bin\su" /system/xbin/
adb push "C:\Users\Admin\Desktop\busybox binary\busybox" /system/xbin/
adb shell chmod 06755 /system/xbin/su
adb shell chmod 06755 /system/xbin/busybox
adb install "C:\Users\Admin\Desktop\Superuser-3.0.7-efghi-signed\system\app\Superuser.apk"
adb install "C:\Users\Admin\Desktop\Root Checker App.apk"

Hi,
I have the device created in AVD, started, but for the life of me I cannot open ADB:
Code:
[email protected]:~$ sudo adb devices
[sudo] password for joel:
List of devices attached
[email protected]:~$
What to I have to do to trick the virtual device in advertising ADB? Developer is on, USB debugging is on. Using a virtual device as closely matching the LG Optimus F3Q as I can recall (so API 16 / Android 4.1.2 loaded).
Many thanks.
EDIT: Figured it out. Need to use the adb provided in the Android SDK (in the platform-tools directory), not any other version (I was using the Debian-provided one).

Unable to root nexus 4 avd
I tried to root Nexus_4_API_21.avd (lollipop) following commands from the post exactly.
I used latest versions of superuser, and busybox.
But at the end emulator is not rooted.
Could someone help with with this, if you have rooted avd please share it so that I can download.
Thank you.
Regards

I tried to root with Lollipop, Kitkat, and even Gingerbread, but it doesn't work.
Under Lollipop and Kitkat, it's not rooted, but under Gingerbread, I can't install any application afterwards.
When I try to, the emulator looks like it reboots, but it never goes to the end, and keeps showing the Android logo glowing.

For android 4, 5 and 6 I write manual in russian. Read it here: http://4pda.ru/forum/index.php?showtopic=318487&view=findpost&p=45421931
Worked for me with AVD Lollipop and Marshmallow.

Related

[Q] Rooting: stuck at mounting system

Hi,
I succeeded at installing the recovery image using flashrec and making the nandroid backup. Now I'm trying to go to the next step of the rooting tutorial for noobs: MODIFYING THE CODE TO GET ROOT ACCESSS
This is my cmd (administrator rights) in Fastboot USB Mode:
Code:
c:\sdk\tools>fastboot devices
HT**KL****** fastboot
c:\sdk\tools>adb devices
adb server is out of date. killing...
* daemon started successfully *
List of devices attached
This is my cmd (administrator rights) in "normal mode":
Code:
c:\sdk\tools>adb devices
List of devices attached
HT**KL****** device
c:\sdk\tools>adb shell mount /system
Usage: mount [-r] [-w] [-o options] [-t type] device directory
c:\sdk\tools>adb push su /system/bin/
failed to copy 'su' to '/system/bin//su': Read-only file system
c:\sdk\tools>adb push su /system/bin
failed to copy 'su' to '/system/bin/su': Read-only file system
c:\sdk\tools>adb shell rm /system/app/Superuser.apk
rm failed for /system/app/Superuser.apk, Read-only file system
c:\sdk\tools>adb push su /system/bin/
failed to copy 'su' to '/system/bin//su': Read-only file system
c:\sdk\tools>adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /syste
m
mount: Operation not permitted
c:\sdk\tools>adb shell chmod 777 /system
Unable to chmod /system: Read-only file system
I am running Windows 7 (x64), I downloaded the latest adb tools and usb drivers using SDK Setup.exe. I installed the ADB drivers properly (using the manual wizard to browse to the usb_driver folder and restarting my computer) for the fastboot USB and for "normal mode" with the option debugging usb active.
Information of my current Rom ("Orange Belgium")
HBOOT-1.76.0007 (HERO10000)
RADIO-6.35.06.18
Aug 4 2009,19:43:30
I couldn't find anything by google that solved the problem... I hope you guys can help me out..
First and foremost, please post questions like this in the Q&A, or GENERAL section next time. This part will be moved for you though.
Ok,... I think your making this more difficult than need be. I haven't looked at the link you provided as my phone is playing up..
Take a look at BTDAGs guide linked in my signature... If you have already successfully installed the custom recovery, all you need to do now is pick a custom ROM to download and flash using the recovery.
Sent from my HTC Hero using XDA App
That is quite an old guide you're following. Try mine, or the one here http://villainrom.co.uk/viewtopic.php?f=107&t=2028 or there is universal androot - which will just give you root access on any rom.
you should use this to mount system in read/write-mode:
Code:
# mount -o rw -t yaffs2 /dev/block/mtdblock3 /system
alternatively put adb shell in front of:
Code:
>adb shell mount -o rw -t yaffs2 /dev/block/mtdblock3 /system
And by the way, you should do this from recovery mode (which is accessed by keeping home-button pressed down while turning on. I assume that you have a custom recovery)
Moved to Q&A as not development
Managed to put the recovery rom on it, thanks!
sorry to post it this late. can you pls explain how you resolve? if its available in some other thread, can someone guide me there. have been doing search on the forum for a while now. thanks!

[DEV] Current Progress and Guides: CRACKED UBOOT!!! Roms and Kernels Comming Soon

This thread is designed for representation of the current progress on the Nook Tablet rooting and exploits, the second post will contain how to guides so you can learn to work on it for you self. REMEMBER I DO THIS FOR FUN, please respect the thread as well as others opinions
OLD UPDATES AT THE END OF THIS POST.
First off if you haven’t read the wiki yet to know what is currently in the device you should look here.
Also you should look at the http://www.nooktabletdev.orgfor information on the Nook Tablet Development process. - Thanks to dj_segfault
Rooting Scripts​Windows: Root, OTA block, De-bloat, Gapps Thanks to Indirect
Mac/Linux: Rooting script Thanks to t-r-i-c-k
Mac/Linux: Root,OTA Block, Gapps
CURRENT PROGRESS
adb connection: COMPLETE
adb root: COMPLETE
busybox:COMPLETE
permanent root: COMPLETE BY INDIRECT
GApps and Market: COMPLETE BY INDIRECT & Anlog
recovery mode: COMPLETE BY nemith
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
THANKS TO NEMITH
bootloader: Locked and Signed Irrelevant
uboot: CRACKED BY BAUWKS
THANKS TO BAUWKS​
Loglud said:
bauwks method uses the flashing_boot.img to his advantage, and since it is not checked by security, effectively he has made an insecure uboot. While this is not an unlocked bootloader, it is a way to get around the security, and enable custom recovery and higher level processes to be run.
I have been looking at this line of code for a long time, and as im sure hkvc and bauwks saw it is a large (but 100% necessary) flaw:
distro/u-boot/board/omap4430sdp/mmc.c: 559 : setenv ("bootcmd", "setenv setbootargs setenv bootargs ${sdbootargs}; run setbootargs; mmcinit 0; fatload mmc 0:1 0x81000000 flashing_boot.img; booti 0x81000000");
Without this line of code, it would be impossible for any one but the factory whom could JTAG flash (but since it is secured, most likely they also have to make a flashing_boot.img).
Click to expand...
Click to collapse
12/9/11:
UBUNTU is here, thanks to ADAMOUTLER
http://www.youtube.com/watch?v=PwUg17pVWBs&hd=1
Keep in mind this is only an overlay verson but it is prof that one day we might be able to push roms and kernels over existing ones, then hijack then (next work) and then use them.​
Please PM me or post if you know anything else, and or want to add anything.
Usefull threads
Usefull threads:
ROOTING:
Full root for Nook Tablet. [11/20/11] [Yes this is a permanent root!] Thanks to indirect
Noot Tablet - Easy root & Market on MAC (1 download, 1 script to run) Thanks to t-r-i-c-k
[Windows/Linux] Unroot and uninstall gApps for the nook tablet [Scripts] Thanks to indirect
MODS to Default Rom:
[Full Mod + Root + OTA block] Snowball-mod: Full Modification Root [1/6/2012] Thanks to cfoesch
[DEV][WIP] Enable init.d scripts and build.prop mods for Nook Tablet! Thanks to [DEV][WIP] Enable init.d scripts and build.prop mods for Nook Tablet! 1 Attachment(s) (Multi-page thread 1 2 3 ... Last Page)
Originally Posted By: diamond_lover
Kernels:​Coming Soon​
ROMS:​Coming Soon​
APPS:
[Tutorial][WIP] Installing alternative Keyboards on the NT. Thanks to robertely
[DEV] - HomeCatcher Redirect n Button to any Launcher Thanks to gojimi
Hidden Settings App Updated 12/30/11 Thanks to brianf21
Replacement SystemUI.apk v2: Permanent back and menu buttons, n as Home button Thanks to revcompgeek
DEVELOPMENT:
[Dev]Files of interest in the system Thanks to indirect
[REF] Nook Tablet Source Code Thanks to diamond_lover
BHT Installer (Basic Hacking Tools) Thanks to AdamOutler
[Stock Firmware]Restore Barnes & Nobel Nook 1.4.0 from SDCard Thanks to AdamOutler​
Guides
Table of Contents
Enableing adb Connection (eab1)
Rooting using zergRush (rug2)
Installing busyboxy (ibb3)
Permanent root (pr4) THANKS TO INDIRECT
Installing GApps (aga5) THANKS TO ANLOG
Full system restore/wipe (fsr6) THANKS TO INDIRECT
Enableing adb Connection (eab1)
Install the andriod SDK that is required for your Operating system.
NOTE: This will requries the SDK, and JDK both of which can be downloaded by clicking the links, downloading and installing it.
Run the andriod SDK Manager and Install "Andriod SDK Platform-tools"
[*]Modify your adb_usb.ini file to read such as the following:
Code:
# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE.
0x2080
This will be in your /home/{username}/.andriod/ folder for mac and linux
This will be in your C:/Users/{username}/.andriod folder for Windows.
ADB is now enabled for your device, however it is not ON your device. YOU MUST DO THIS EVERY TIME YOU WISH TO ADB INTO YOUR DEVICE.
[*]To do this you will need to download any app, and attempt to install it.
You can use this app if you need.
[*]Click on the Package Installer, and then a prompt will pop up asking if you want change the settings to allow 3rd party apps.
*DO NOT ENABLE IF YOU WISH TO ACCESS ADB*
I am working on a way to have it enabled by default.
[*]In the settings page you should see *2* USB Debuggin modes.
[*]Press them both and accept the prompt.
[*]PLUG IN YOUR DEVICE.
Note* You should see the Android Development icon on the bottom of the screen.
ADB will now be able to see your device. How ever you will need to restart the server before it sees it.
Rooting using zergRush (rug2)
This is for the poeople whom have access to adb. You will also need this file. Unzip the file.
Type in the following command (while in the folder with the zergRush Binary):
Code:
adb push ./zergRush /data/local
[*]Once thats installed run this:
Code:
adb shell chmod 777 /data/local/tmp
[*]And lastly:
Code:
adb shell /data/local/zergRush
[*]You are now rooted (only for this reboot)
Installing busyboxy (ibb3)
You will need root and the following busybox file.
Type in the following command while in the location where busy box was downloaded to:
Code:
adb push ./busybox /data/local
[*]Busybox works by calling binaries from a file outside of /system/bin/. We must make this file by issuing the following command:
Code:
adb shell mkdir /data/busybox
[*]Lets make sure we can install busybox without permission probles:
Code:
adb shell chmod 777 /data/local/busybox
[*]Next install busybox in the folder:
Code:
adb shell /data/local/busybox --install
[*]We now need to take the /system/folder, and mount it as a writeable folder:
Code:
adb shell mount -rw -o remount /dev/block/platform/mmci-omap-hs.1/by-name/system /system
[*]Link it into bin:
Code:
adb shell ln -s /data/local/busybox /system/bin/busybox
You now have busybox installed
Permanent root (pr4)
THANKS TO INDIRECT for Files and Scripts
We will need SU and Superuser.apk
First we need to install the Superuser.apk:
Code:
adb wait-for-device install Superuser.apk
adb remount
[*]Next lets go ahead and push the su application up to the /data/local/ folder
Code:
adb push su /data/local/
[*]Next we will need to change the permissions and cp su from the /data/local/ folder to the /system/bin/
Code:
adb shell chmod 4755 /data/local/su;mount -o remount,rw /dev/block/platform/mmci-omap-hs.1/by-name/system /system;busybox cp /data/local/su /system/bin
Installing GApps (eab1)
THANKS TO ANALOG and INDIRECT for Scripts
First things first we need to download the GAPPS. The most reacent one is this one or get the most recent one here.
[*] Unzip and navigate to the most root folder of that package in your shell.
[*]We need to verify that adb is booting into root. To do this we can issue the command:
Code:
adb shell id
If id doesn't return root then you will need to re-zergRush your device
[*]Now it is time for us to export the apps to the directories.
Code:
adb shell mount -o remount,rw /dev/block/platform/mmci-omap-hs.1/by-name/system /system
adb push system/app/CarHomeGoogle.apk /system/app/
adb shell chmod 644 /system/app/CarHomeGoogle.apk
adb push system/app/FOTAKill.apk /system/app/
adb shell chmod 644 /system/app/FOTAKill.apk
adb push system/app/GenieWidget.apk /system/app/
adb shell chmod 644 /system/app/GenieWidget.apk
adb push system/app/GoogleBackupTransport.apk /system/app/
adb shell chmod 644 /system/app/GoogleBackupTransport.apk
adb push system/app/GoogleCalendarSyncAdapter.apk /system/app/
adb shell chmod 644 /system/app/GoogleCalendarSyncAdapter.apk
adb push system/app/GoogleContactsSyncAdapter.apk /system/app/
adb shell chmod 644 /system/app/GoogleContactsSyncAdapter.apk
adb push system/app/GoogleFeedback.apk /system/app/
adb shell chmod 644 /system/app/GoogleFeedback.apk
adb push system/app/GooglePartnerSetup.apk /system/app/
adb shell chmod 644 /system/app/GooglePartnerSetup.apk
adb push system/app/GoogleQuickSearchBox.apk /system/app/
adb shell chmod 644 /system/app/GoogleQuickSearchBox.apk
adb push system/app/GoogleServicesFramework.apk /system/app/
adb shell chmod 644 /system/app/GoogleServicesFramework.apk
adb push system/app/LatinImeTutorial.apk /system/app/
adb shell chmod 644 /system/app/LatinImeTutorial.apk
adb push system/app/MarketUpdater.apk /system/app/
adb shell chmod 644 /system/app/MarketUpdater.apk
adb push system/app/MediaUploader.apk /system/app/
adb shell chmod 644 /system/app/MediaUploader.apk
adb push system/app/NetworkLocation.apk /system/app/
adb shell chmod 644 /system/app/NetworkLocation.apk
adb push system/app/OneTimeInitializer.apk /system/app/
adb shell chmod 644 /system/app/OneTimeInitializer.apk
adb push system/app/Talk.apk /system/app/
adb shell chmod 644 /system/app/Talk.apk
adb push system/app/Vending.apk /system/app/
adb shell chmod 644 /system/app/CarHomeGoogle.apk
adb push system/etc/permissions/com.google.android.maps.xml /system/etc/permissions/
adb push system/etc/permissions/features.xml /system/etc/permissions/
adb push system/framework/com.google.android.maps.jar /system/framework/
adb push system/lib/libvoicesearch.so /system/lib/
Now you have GApps installed from Anlog's. All Credits go to him and Indirect
Full system restore/wipe (fsr6)
THANKS TO INDIRECT
WARNING THIS WILL WIPE YOUR ENTIRE FILESYSTEM!!!
Go into adb shell or terminal emulator.
Issue command:
Code:
echo -n '0000' > /bootloader/BootCnt
Next reboot your device by conventional methods or issue:
Code:
reboot
Your nook will now restart and tell you it is resetting.
You now have a clean slate!
Got some links for howto's on the adb connection/root.
Yeah - if someone has details on how to adb connect and root, it'd be helpful to include links. I've yet to see specifics for either.
Reserved
Sent from Tapatalk, NOOK Color CM7 Nightly's!
I aplogize im still typing them up
Damn loglud, I ended up beating you to the root lol. Sorry about that! D:
The Droid 2 and Droid X had locked bootloaders with the 'e-fuse' and Koush got around them and installed CWM with this...
http://www.koushikdutta.com/2010/08/droid-x-recovery.html
What do you guys think? I don't have a NT yet to try anything (probably won't get one until sometime around x-mas).
l
Indirect said:
Damn loglud, I ended up beating you to the root lol. Sorry about that! D:
Click to expand...
Click to collapse
Its no problem at all. Hints why i posted these guides. I was hoping someone wouod figure it out. I found it last night too. It sucked cause im now back at my childhood home trying to get my macbook pro to boot fedora and windows. Im gonna repackage the root with Superoneclick. Thanks so much for your effort. Would you mind if i added that to the guides?
Loglud said:
l
Its no problem at all. Hints why i posted these guides. I was hoping someone wouod figure it out. I found it last night too. It sucked cause im now back at my childhood home trying to get my macbook pro to boot fedora and windows. Im gonna repackage the root with Superoneclick. Thanks so much for your effort. Would you mind if i added that to the guides?
Click to expand...
Click to collapse
Superoneclick...love!
Sent from my Nook Tablet using Tapatalk
Loglud said:
l
Its no problem at all. Hints why i posted these guides. I was hoping someone wouod figure it out. I found it last night too. It sucked cause im now back at my childhood home trying to get my macbook pro to boot fedora and windows. Im gonna repackage the root with Superoneclick. Thanks so much for your effort. Would you mind if i added that to the guides?
Click to expand...
Click to collapse
Not at all so long as you give proper credits.
Loglud said:
This thread is designed for representation of the current progress on the Nook Tablet rooting and exploits, the second post will contain how to guides so you can learn to work on it for you self.
First off if you haven’t read the wiki yet to know what is currently in the device you should look here.
CURRENT PROGRESS
adb connection: COMPLETE
adb root: COMPLETE
busybox: COMPLETE
permanent root: IN PROGRESS
bootloader: Locked and Signed
By the bootloader being locked and signed it is very difficult to design anything that will boot besides nook roms. In order to solve this some of the Devs have suggested the following:
kexec: RESEARCHING
2nd init: RESEARCHING
CWM: NOT STARTED
Please PM me or post if you know anything else, and or want to add anything.
Click to expand...
Click to collapse
hopefully it is cracked soon cause i dont want to buy this if i can't have a full custom rom, all of the verizon motorola phones run roms off of 2nd init and it just isnt the same to be honest. you can never run a full custom rom with second init(well you can but you have to build the rom to fit the kernel) and honestly i want my device to be mine
you should tweet cvpcs or someone who makes and maintains 2nd init roms to get more info on it though
Can't get busybox installed
I'm stuck... I get errors for #3 for busybox... errors like...
Code:
$ adb shell /data/local/busybox --install
busybox: /data/busybox/[: No such file or directory
busybox: /data/busybox/[[: No such file or directory
busybox: /data/busybox/addgroup: No such file or directory
.....
busybox: /data/busybox/yes: No such file or directory
busybox: /data/busybox/zcat: No such file or directory
busybox: /data/busybox/zcip: No such file or directory
So I logged into root via adb shell, set busybox permissions to execute and tried that but same messages?!
Also, adb won't let me 'remount' - (I thought i'd try to copy it direct to /system/bin)?
(I'm running from OSX, if that matters)
EDIT: and of course I'm getting...
Code:
$ adb shell ln -s /data/local/busybox /system/bin/busybox
link failed Read-only file system
$ adb remount
remount failed: Operation not permitted
kgingeri said:
I'm stuck... I get errors for #3 for busybox... errors like...
Code:
$ adb shell /data/local/busybox --install
busybox: /data/busybox/[: No such file or directory
busybox: /data/busybox/[[: No such file or directory
busybox: /data/busybox/addgroup: No such file or directory
.....
busybox: /data/busybox/yes: No such file or directory
busybox: /data/busybox/zcat: No such file or directory
busybox: /data/busybox/zcip: No such file or directory
So I logged into root via adb shell, set busybox permissions to execute and tried that but same messages?!
Also, adb won't let me 'remount' - (I thought i'd try to copy it direct to /system/bin)?
(I'm running from OSX, if that matters)
EDIT: and of course I'm getting...
Code:
$ adb shell ln -s /data/local/busybox /system/bin/busybox
link failed Read-only file system
$ adb remount
remount failed: Operation not permitted
Click to expand...
Click to collapse
Sorry it took me so long to get back to you. I have updatd my guide to help you out. First of you will need to make the busybox directory, then change the permissions of the binary file, then run the install. You will then have to mount -rw
Still some glitches installing busybox...
Loglud said:
Sorry it took me so long to get back to you. I have updatd my guide to help you out. First of you will need to make the busybox directory, then change the permissions of the binary file, then run the install. You will then have to mount -rw
Click to expand...
Click to collapse
Thanks Loglud, but I still had trouble using adb. It's like I don't have root from adb? I get permission errors on mkdir and remounting etc?
Weird that the 'adb shell mkdir /data/busybox' gave me permission errors?! It did work fine with the interactive adb shell - weird!?
After the initial 'push' command, I could install via:
Code:
mac-osx$ adb shell
$ su root
# cd /data/local
# chmod 755 busybox
# ls -l
-rwxr-xr-x shell shell 1745016 2011-11-21 00:21 busybox
# mount -rw -o remount /dev/block/platform/mmci-omap-hs.1/by-name/system /system
# mkdir ../busybox
# ./busybox --install
Also, is the line:
Code:
# ln -s /data/local/busybox /system/bin/busybox
not supposed to be
Code:
# ln -s /data/busybox /system/bin/busybox
Things went weird on me in the final step, but I did manage to get all the hard linked busybox files to show up in /system/bin eventually, so I'm a happy camper.
EDIT: PS my mount on data is as follows..
Code:
# mount|grep /data
/dev/block/platform/mmci-omap-hs.1/by-name/userdata /data ext4 rw,nosuid,nodev,noatime,errors=panic,barrier=1,data=ordered 0 0
EDIT2:
Hmmm... seems like maybe my /data folder has weird permissions - if so not sure why?...
Code:
# cd /
# ls -l | grep '\<data\>'
drwxrwx--x system system 2011-11-21 18:25 data
# chmod 777 data
kgingeri said:
Thanks Loglud, but I still had trouble using adb. It's like I don't have root from adb? I get permission errors on mkdir and remounting etc?
Weird that the 'adb shell mkdir /data/busybox' gave me permission errors?! It did work fine with the interactive adb shell - weird!?
After the initial 'push' command, I could install via:
Code:
mac-osx$ adb shell
$ su root
# cd /data/local
# chmod 755 busybox
# ls -l
-rwxr-xr-x shell shell 1745016 2011-11-21 00:21 busybox
# mount -rw -o remount /dev/block/platform/mmci-omap-hs.1/by-name/system /system
# mkdir ../busybox
# ./busybox --install
Also, is the line:
Code:
# ln -s /data/local/busybox /system/bin/busybox
not supposed to be
Code:
# ln -s /data/busybox /system/bin/busybox
Things went weird on me in the final step, but I did manage to get all the hard linked busybox files to show up in /system/bin eventually, so I'm a happy camper.
EDIT: PS my mount on data is as follows..
Code:
# mount|grep /data
/dev/block/platform/mmci-omap-hs.1/by-name/userdata /data ext4 rw,nosuid,nodev,noatime,errors=panic,barrier=1,data=ordered 0 0
EDIT2:
Hmmm... seems like maybe my /data folder has weird permissions - if so not sure why?...
Code:
# cd /
# ls -l | grep '\<data\>'
drwxrwx--x system system 2011-11-21 18:25 data
# chmod 777 data
Click to expand...
Click to collapse
ok so whats happening? i modified the guides and i was hopping that would help you. The command is
Code:
# ln -s /data/local/busybox /system/bin/busybox
and as for your permissions it seems as though your root since your in the # shell but, you have to change the permissions on your /system folder not the /data folder the permsisions on the data file should be fine since i think shell is a member of system, so you can put all your data in there.
Loglud said:
ok so whats happening? i modified the guides and i was hopping that would help you. The command is
Code:
# ln -s /data/local/busybox /system/bin/busybox
and as for your permissions it seems as though your root since your in the # shell but, you have to change the permissions on your /system folder not the /data folder the permsisions on the data file should be fine since i think shell is a member of system, so you can put all your data in there.
Click to expand...
Click to collapse
Yeah, I'm root in the 'adb shell' because I 'su root' but adb commands fail from the Mac shell. I'll reboot my NT and give you the script. My /data permissions get reset when I reboot...
Here you are as it happens
MBAir$ ls busybox
busybox
MBAir$ adb push ./busybox /data/local
2881 KB/s (1745016 bytes in 0.591s)
MBAir$ adb shell mkdir /data/busybox
mkdir failed for /data/busybox, Permission denied​
Of course there is no point continuing until I do the following...
MBAir$ adb shell
$ su root
# chmod 777 /data
# exit
$ exit
MBAir$ adb shell mkdir /data/busybox
MBAir$ adb shell chmod 777 /data/local/busybox
MBAir$ adb shell /data/local/busybox --install
MBAir$ adb shell mount -rw -o remount /dev/block/platform/mmci-omap-hs.1/by-name/system /system
mount: Operation not permitted​
To get around the last error, I had to do another 'adb shell', 'su root' and do 'ln' commands manually.
(I actually ran a shell 'for loop' on the tablet, using all files found in /data/busybox as a list and issued ln commands for each against a copy of busybox in /system/bin)
kgingeri said:
Yeah, I'm root in the 'adb shell' because I 'su root' but adb commands fail from the Mac shell. I'll reboot my NT and give you the script. My /data permissions get reset when I reboot...
Here you are as it happens
MBAir$ ls busybox
busybox
MBAir$ adb push ./busybox /data/local
2881 KB/s (1745016 bytes in 0.591s)
MBAir$ adb shell mkdir /data/busybox
mkdir failed for /data/busybox, Permission denied​
Of course there is no point continuing until I do the following...
MBAir$ adb shell
$ su root
# chmod 777 /data
# exit
$ exit
MBAir$ adb shell mkdir /data/busybox
MBAir$ adb shell chmod 777 /data/local/busybox
MBAir$ adb shell /data/local/busybox --install
MBAir$ adb shell mount -rw -o remount /dev/block/platform/mmci-omap-hs.1/by-name/system /system
mount: Operation not permitted​
To get around the last error, I had to do another 'adb shell', 'su root' and do 'ln' commands manually.
(I actually ran a shell 'for loop' on the tablet, using all files found in /data/busybox as a list and issued ln commands for each against a copy of busybox in /system/bin)
Click to expand...
Click to collapse
re run zergRush exploit. your adb shell is defaulting to the shell username. by rerunning the zergy you will allow for yourself to use the adb shell as root. make sure you dont run it as the root user though. you are also more then welcome to hop in irc and ask questions.
Any one having difficulty rooting or see anything that needs to be updated?

[Q] bravia engine lww

hi i'm trying to install be on my lww with SE tweaker installer but it says:
adb shell rm /data/local/tmp/*
rm failed for /data/local/tmp/*, No such file or directory
adb push "data/be_movie" /data/local/tmp/be_movie
adb push "data/be_photo" /data/local/tmp/be_photo
adb push "data/install_be" /data/local/tmp/install_be
adb shell "chmod 777 /data/local/tmp/install_be"
adb shell "su -c '/data/local/tmp/install_be'"
---Installing Bravia Engine....
---Mount RW system
---Copying files
cp: write error: No space left on device
cp: write error: No space left on device
---Chmod Files
---Modify build.prob
cp: write error: No space left on device
echo: write error: No space left on device
echo: write error: No space left on device
echo: write error: No space left on device
echo: write error: No space left on device
echo: write error: No space left on device
---Install Done ! Restarting....
adb shell rm /data/local/tmp/*
and i have 69 mb free i don't understand so please help me
i'm on stock ics 4.0.4 rom root with latest busybox
thanks in advance
ADB drivers, install Android SDK, open it and install required packages.

ADB push alternative from Android device itself (non-rooted)

I have a non-rooted Android device with stock ROM 4.4.2 and I have the following test shell script:
Code:
adb push test.sh /data/local/tmp
adb shell "cd /data/local/tmp; chmod 755 test.sh"
adb.exe shell "sh /data/local/tmp/test.sh > /dev/null 2>&1 &"
If I run this over ADB from PC to my device, it simply works.
Now convert this to:
Code:
cp test.sh /data/local/tmp
cd /data/local/tmp; chmod 755 test.sh
/system/bin/sh /data/local/tmp/test.sh > /dev/null 2>&1 &"
and it doesn't work. It says permission denied on /data/local/tmp.
Is there any other EXT4 place on a non-rooted device that I can do this?
Well, I cd to /data/local/tmp and even submitting a 'ls' command inside Terminal Emulator doesn't work, it says permission denied, but when doing it from PC to Android using ADB it's fine. Is there any workaround for this? I want to be able to do this on the device itself.
Thanks
idoit said:
I have a non-rooted Android device with stock ROM 4.4.2 and I have the following test shell script:
Code:
adb push test.sh /data/local/tmp
adb shell "cd /data/local/tmp; chmod 755 test.sh"
adb.exe shell "sh /data/local/tmp/test.sh > /dev/null 2>&1 &"
If I run this over ADB from PC to my device, it simply works.
Now convert this to:
Code:
cp test.sh /data/local/tmp
cd /data/local/tmp; chmod 755 test.sh
/system/bin/sh /data/local/tmp/test.sh > /dev/null 2>&1 &"
and it doesn't work. It says permission denied on /data/local/tmp.
Is there any other EXT4 place on a non-rooted device that I can do this?
Well, I cd to /data/local/tmp and even submitting a 'ls' command inside Terminal Emulator doesn't work, it says permission denied, but when doing it from PC to Android using ADB it's fine. Is there any workaround for this? I want to be able to do this on the device itself.
Thanks
Click to expand...
Click to collapse
No there isnt, not if you try using /data partition. ADB can read this partition (and that too was added around android kitkat itself for purpose of adb backup
etc). So ADB can read this partition, but terminal emulator and such cannot.
Assuming that you have a great reason to simply not copy the sh file to user-usable internal memory, /system partition is the one place where you can copy things without actually having root (and even access them with terminal emulator, but not manipulate them), and this isn't that simple either. Rather, the method will be device dependent. For instance, if you have a phone like Nexus phones, simply download stock firmware, open/extract it depending on what format it is (img or tar), add your sh file and repack the firmware, then flash it into the phone. The firmware should be same as your current installed so your applications dont mess up. But this method is not only long (and messy if your device has integrity checks on firmware files), but also not possible on some phones (as far as I know).
You can also try copying the sh file with adb to /data/data/com.android.terminal. Then you should be able to access this with terminal emulator (since an app has permissions inside its own data folder). However I have not tested this method and I am not sure it will work.
Besides this, every app (including terminal emulator) runs in a sandbox and does not have access to anything except /system (read-only access), emulated user-storage and its own data inside /data/data/. So in phone itself, you cannot read the file unless you copy it to /system or user-memory. And this finally implies that except above two methods, there is no other way to copy file to some other place except user-memory and be able to read it using some app inside phone itself without rooting.
Thanks for your comprehensive reply. I resolved the problem. Yes, it's right, I can simply run the shell script without even moving it to /data/local/tmp... so now I can conveniently running it directly from my phone without having to turn a computer on and do it over ADB.
thankx

Adding file permissions to a binary in ramdisk

I am trying to put a binary in ramdisk and execute that binary towards the end of kernel init to launch it from a seperate thread. But I am not able to launch the binary as the binary doesnt have execution permissions..So do you know how I can give execution permissions to a binary in ramdisk..like first stage android init in ramdisk..
What do you mean with ramdisk? My understanding of RAMDisk is that it's a segment or portion of system memory on your Android phone that is used as a disk drive. In essence, it is a virtual storage, created by software, from your device’s RAM chip.
Anyway here I show you how a binary is made executable, assumed device's Android is rooted and you can access it via ADB then
Code:
adb devices
adb shell "su -c 'cd / && mount -t auto -o rw,remount <MOUNT_POINT>'"
adb push <BINARY_FILE> <MOUNT_POINT>/
adb shell "su -c 'chmod 0755 <MOUNT_POINT>/<BINARY_FILE>'"
adb shell "su -c 'chown <USER>:<GROUP> <MOUNT_POINT>/<BINARY_FILE>'"
where <MOUNT_POINT> is the partition / dir that will house the <BINARY_FILE>, where <USER> and/or <GROUP> can be specified by name or by number.

Categories

Resources