• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Editing system file

xefe

Well-Known Member
Jun 27, 2010
159
21
I am trying to edit my root\system\customize\widgets.txt file. However it is showing read only. What program can i use to change a file to not be read only. I have tried astro and es file explorer; neither appears to have an option to do this.
 
There are several ways to actually change permissions on the file, but the safest (and non permanent) way is to use root explorer. ES *does* have an option to use it in root mode (menu->settings->root options-> check "Root Explorer"), BUT I've heard it can cause all kind of problems.

If you have both a terminal emulator and busybox installed, you can definitely do what you need to do. It's more time consuming, but it *will* work. There are many ways to do what you want, including actually changing permissions, but that's not a great idea.

So, install a terminal emulator if you don't have one:

Android Terminal Emulator - Android app on AppBrain

Open it, and verify you have busybox by typing "busybox" without quotes, then enter. If just says anything about not being able to find it, it's not installed. If you get some general information, then a list of commands, you're good. If you need it, here it is:

BusyBox - Android app on AppBrain

Now, you should modify a widget.txt file either from your phone or from your PC. Be careful when doing it from your computer. If you have windows, and you make it in notepad, you could end up with junk character. Make sure to put the widget.txt file on /sdcard. You can copy it there from where ever you have it using ES.

Once that is done, open the terminal again, and type "su" then enter. The prompt should change from $ to #. type the following commands:

cd /system/customize/
cp /sdcard/widget.txt ./
cat widget.txt (note: the output should be the contents of the new widget.txt)

If you get any errors or anything, do this command then try the cp command again:

rm -f widget.txt

Once you have copied the file, type:

ls -l widget.txt

the first column should look something like this:

-r--rwxr-x. The second, third, and fourth characters (-r-) are the most important, as they generally end up getting reset to --- when you copy a file from elsewhere outside of /system. It basically means the system won't be able to read the file, and it will be useless. If you see something like that (----rwxr-x), run this command:

chmod u+r widget.txt

then check again. You should see -r--rwxr-x. If that's the case, you're done.

I know this is very complicated if you've never done anything from the command line, but it *does* work and it's free.
 
  • Like
Reactions: xefe
Upvote 0
Thanks for the info above but I had these problems:
First busybox won't install on my HTC evo. It says root access required.

I tried the commands anyway but after changing to my folder the copy command and rm and ls commands got an access denied - system. Error message


There must be a way to edit or replace
My hosts file in /system/etc folder without rooting this phone.

I paid for the root access program but it also fails with a message saying the phone isn't rooted.

Any more ideas?
Thanks
 
Upvote 0
Thanks for the info above but I had these problems:
First busybox won't install on my HTC evo. It says root access required.

I tried the commands anyway but after changing to my folder the copy command and rm and ls commands got an access denied - system. Error message


There must be a way to edit or replace
My hosts file in /system/etc folder without rooting this phone.

I paid for the root access program but it also fails with a message saying the phone isn't rooted.

Any more ideas?
Thanks

Are you absolutely sure that you are rooted? Try getting an app off the Market like Wifi Tether or CacheMate just to test and see if you truly are.
 
Upvote 0
Thanks for the info above but I had these problems:
First busybox won't install on my HTC evo. It says root access required.

I tried the commands anyway but after changing to my folder the copy command and rm and ls commands got an access denied - system. Error message


There must be a way to edit or replace
My hosts file in /system/etc folder without rooting this phone.

I paid for the root access program but it also fails with a message saying the phone isn't rooted.

Any more ideas?
Thanks

1) Welcome to the forums :).
2) You need busybox before running those commands, so you're going to need to get that installed first.
3) There is no way to modify /system without rooting.
4) Do as others have suggested, and check if you have root by opening the terminal emulator, and typing "su". I'm going to guess you don't have root yet. If you *do*, I forgot a step in the above instructions. You'd need to mount /system as rw by typing this command after su:

mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system

5) What root method did you try? It sounds like it never rooted your phone. It's probably old. What was it? Do you have a link?
 
  • Like
Reactions: xefe
Upvote 0
Thanks for the info above but I had these problems:
First busybox won't install on my HTC evo. It says root access required.

There must be a way to edit or replace
My hosts file in /system/etc folder without rooting this phone.

I paid for the root access program but it also fails with a message saying the phone isn't rooted.

Any more ideas?
Thanks

Guys he just isnt rooted. He was trying to do this without rooting, though he bought an app for root users. You can not write to the /system without root, thats pretty much the whole point in root.
 
Upvote 0
Hi,
I have similar problem, but my phone is rooted for sure. In root explorer in system folders I cant switch R/O to R/W .when I edis some file and go to parent folder and back,changes are gone(everything is as before).

When i try to write commands in terminal emulator as you wrote is tell me somthing like "cant find mount"

Do you hnow where is problem?
thank for answer
 
Upvote 0
Hi,
I have similar problem, but my phone is rooted for sure. In root explorer in system folders I cant switch R/O to R/W .when I edis some file and go to parent folder and back,changes are gone(everything is as before).

When i try to write commands in terminal emulator as you wrote is tell me somthing like "cant find mount"

Do you hnow where is problem?
thank for answer

Welcome to the forums :).

1) Do you have S-OFF in hboot? Just because you might have a rooted ROM doesn't mean you have S-OFF.
2) Do you have busybox installed? I'm going to guess you don't. If not, install it from the market. Busybox will give you the ability to run a lot of different commands from the command line (and some apps even require it).
3) From the terminal, don't forget to type "su" first if you aren't. It wouldn't give you that particular error, but it's just something to remember.
 
Upvote 0
1) Welcome to the forums :).
2) You need busybox before running those commands, so you're going to need to get that installed first.
3) There is no way to modify /system without rooting.
4) Do as others have suggested, and check if you have root by opening the terminal emulator, and typing "su". I'm going to guess you don't have root yet. If you *do*, I forgot a step in the above instructions. You'd need to mount /system as rw by typing this command after su:

mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system

5) What root method did you try? It sounds like it never rooted your phone. It's probably old. What was it? Do you have a link?


I have full root with s-off running Swagged out ROM(you helped me with the S-off a few months ago) I can not write to system folder with root explorer. I get an error saying the file or folder is read only. I checked to make sure root explorer is in r/w mode, super user is good. I just want to change my boot animation but I know I'm fully rooted because you walked me through it. Any ideas why I can't write to system folder?
 
Upvote 0
I have full root with s-off running Swagged out ROM(you helped me with the S-off a few months ago) I can not write to system folder with root explorer. I get an error saying the file or folder is read only. I checked to make sure root explorer is in r/w mode, super user is good. I just want to change my boot animation but I know I'm fully rooted because you walked me through it. Any ideas why I can't write to system folder?

check your superuser app. does it list root explorer as being allowed access? sometimes it will deny apps access and it will say so in the app. and if that is not the case then try and uninstall and reinstall the root explorer.

also make sure that you have mounted as r/w.
 
Upvote 0
check your superuser app. does it list root explorer as being allowed access? sometimes it will deny apps access and it will say so in the app. and if that is not the case then try and uninstall and reinstall the root explorer.

also make sure that you have mounted as r/w.

I don't believe I'm mounted as R/W but everything else checks out. I don't even care about the new boot animation anymore, now I just want to understand it. I have S-off, I have flashed plenty of roms, flashed new radios and kernels....I'm getting a migrain. Someone help.
 
Upvote 0
I don't believe I'm mounted as R/W but everything else checks out. I don't even care about the new boot animation anymore, now I just want to understand it. I have S-off, I have flashed plenty of roms, flashed new radios and kernels....I'm getting a migrain. Someone help.

ok so at the top of root explorer there should be a button where you can mount as r/w that is what gives you the ability to read and write on to the system partitions.
 
Upvote 0
Hi

I also tried to follow akazabam's post to edit the file STATE in /sys/devices/virtual/switch/hdmi/state but the file cannot be saved (it also cannot be deleted with Operation not permitted message from the terminal screen of Android terminal emulator). I have rooted my phone, which is an Alcatel OT-995, I have busybox. Any suggestion?

welcome to AF!!!!!!

just an fyi this is the htc evo 4g root forum so be careful on what your read or follow. somethings here are specific to the evo vs your phone.

what exactly are you trying to do?
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones