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!
All right... I guess it's time to "ask the experts". My linux background has not been very much help here... ARGH!
Okay, I have two script that I have written that are supposed to mount /system as RO and RW respectively. Very simple:
To mount rw:
Code:
#!/system/bin/sh
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
To mount ro:
Code:
#!/system/bin/sh
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
I manually ran the mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system command and adb pushed them to /system/xbin as mountro and mountrw and chmod both to 755.
In ADB I try to execute:
Code:
/system/xbin/mountrw
and get an error stating:
Code:
/system/xbin/mountrw: not found
I even try:
Code:
/system/bin/sh /system/xbin/mountrw
and I get this error:
Code:
mount: No such file or directory
Okay, so I figured out that it is having a problem trying to find the mount command, so I modify the script to:
Code:
#!/system/bin/sh
/system/bin/mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
I then re-run this:
Code:
/system/bin/sh /system/xbin/mountrw
and I'm still getting this friggin' error message!
Code:
mount: No such file or directory
When I run it through Script Manager I get the same error:
Code:
mount: No such file or directory
This should just friggin' work damn it! (Sorry, very frustrated.)
Also, it would be nice NOT to have to type the path to the script. I can run ZepplinRox V6_SuperCharger script from the ADB command line just by typing from the directory I have it in:
Code:
sh V6_SuperCharger_for_Android-update9_RC3.2.sh
No absolute path, no ./ path... WTF? ARGH!
Okay, I KNOW this is friggin' possible just by the fact that I can run Zep's script in ADB...
So, any takers? Thanks in advanced...
Friggin' Ciao.
[EDIT]
Okay, I figured out a work around for this... I probably should not work on this after working at work all day... But, that is another story...
I have heavily modified the script files I have created. They are still called mountrw and mountro and the contents are as follows:
mountrw:
Code:
#!/system/bin/sh
# This mounts the /system file system as Read Write in order to modify or add
# files to the /system file system.
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
mountro:
Code:
#!/system/bin/sh
# This mounts the /system file system as Read Only which is the default when
# Android is booted.
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
So, after poking around in ZepplinRox's V6_SuperCharger script, I found those values repeated several times, so that helped point me in the right direction. The next problem I had was getting the scripts to "run from anywhere". I still haven't figured that one out yet, and the VERY MESSY solution to that is to put the two scripts in /. I know, I know, I know... that is the most dangerous place to put it.
So, when I first log into the ADB shell all I have to type is
Code:
sh mountrw
and when I'm done, type
Code:
sh mountro
So, As the work around, this works. I really don't recommend anyone else doing this because of the data security risks that you open your phone up to... Yes, I'm aware of them and that is why I am asking now for some help in having the ability to run a script globally, from anywhere in the android file structure. I don't mind typing the "sh" in front of the script since I sometimes must do that in linux. I have noticed that the $PATH of Android doesn't allow scripts to be executed unless you type the absolute path to the script, or are in the same directory as the script.
Okay, so again to ask: Is there any way to execute a script without having to type the absolute path to it? Thanks!
Ciao! (MUCH calmer now then when I first wrote this post...)
[/EDIT]
I don't use adb much at all.
Usually I move stuff around with root explorer and use terminal emulator a lot.
I assume you ran everything as superuser as I sometimes forget to type su first
Maybe the sh command work on the supercharger script because it has the .sh extention.
You can try typing "bash mountrw" since that works when I install the script to /system/xbin/V6
But after reading your post I looked and saw I forgot about permissions so I did chmod 755 and now this works...
su
V6
heh..
I don't have tp type "bash V6" anymore
zeppelinrox said:
I don't use adb much at all.
Usually I move stuff around with root explorer and use terminal emulator a lot.
I assume you ran everything as superuser as I sometimes forget to type su first
Maybe the sh command work on the supercharger script because it has the .sh extention.
You can try typing "bash mountrw" since that works when I install the script to /system/xbin/V6
But after reading your post I looked and saw I forgot about permissions so I did chmod 755 and now this works...
su
V6
heh..
I don't have tp type "bash V6" anymore
Click to expand...
Click to collapse
Yes, I ran everything as su. (I'm a linux admin guy, so su and sudo is next to natural for me...)
Okay, so you put the mountrw script in /system/xbin/V6/ ??
Also, it is an sh script. I identify that in the first line of
Code:
#!/system/bin/sh
I have changed it to bash and same problem. Oh well. I think I can live with the scripts at /
Thanks though!
Ciao!
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.
First off, yes i am a noob, I own that! I have safestrap install on my S4 (verizon). I am trying to sell the phone but i can't seem to get safestrap removed before I get rid of it. The buyer wants it off of the phone. I have uninstalled the recovery, but when the phone boots it still gives me the option to go into the recovery. How do i get rid of safestrap? I can't make sense of the manual removal process through the adb shell.
Please help!!
Thank you
Odin is your friend.
Download terminal emulator from Play.
Go here:
http://forum.xda-developers.com/showthread.php?t=2441441
Run this on Terminal Emulator:
su
mount -o remount,rw /system
mv /system/etc/init.qcom.modem_links.sh.bin /system/etc/init.qcom.modem_links.sh
rm -rf /system/etc/safestrap
rm /system/etc/firmware/q6.mdt
ln -s /firmware/image/q6.mdt /system/etc/firmware/q6.mdt
mount -o remount,ro /system
su granted but permission denied?
Tool Belt said:
su
mount -o remount,rw /system
mv /system/etc/init.qcom.modem_links.sh.bin /system/etc/init.qcom.modem_links.sh
rm -rf /system/etc/safestrap
rm /system/etc/firmware/q6.mdt
ln -s /firmware/image/q6.mdt /system/etc/firmware/q6.mdt
mount -o remount,ro /system
Click to expand...
Click to collapse
I'm a bit confused...just ran these commands on my ATT MF3 s4 running 4.2.2 after uninstalling the safestrap app, and when i start the terminal emulator it asks for SU access, which i grant...but after running this command:
rm -rf /system/etc/safestrap
i ALWAYS get "permission denied"
How is that possible? if i'm granting SU access..what more permissions do i need that i'm missing?
Anyone else get this when entering that specific command?
If so....any help would be appreciated....
Cheers!
Hi, I have a huawei y6
I rooted with kingroot, root checker says I have my phone rooted and i even managed to uninstall some apps like google movies and google music who were just wasting space but now I can't do anything because it only shows as read only and can't change to read/ write.
I have tried with
Root Browser, it was the one I was using at first
Root explorer
es file explorer
total command
super manager
also tried with
Code:
adb shell
su
mount -o rw,remount rootfs /
chmod 777 /system
and
Code:
su
mount -o remount,rw /system
only returns:
Code:
mount: Read-only file system
I don't know what else to do
docHolmes said:
Hi, I have a huawei y6
I rooted with kingroot, root checker says I have my phone rooted and i even managed to uninstall some apps like google movies and google music who were just wasting space but now I can't do anything because it only shows as read only and can't change to read/ write.
I have tried with
Root Browser, it was the one I was using at first
Root explorer
es file explorer
total command
super manager
also tried with
Code:
adb shell
su
mount -o rw,remount rootfs /
chmod 777 /system
and
Code:
su
mount -o remount,rw /system
only returns:
Code:
mount: Read-only file system
I don't know what else to do
Click to expand...
Click to collapse
make sure that u still have root access on ur device