[Q] Edit hosts file - Upgrading, Modifying and Unlocking

Hello,
After reading theads about this universal problem.
I'm still looking for a solution to edit hosts file.
I don't want to pay for root explorer app (sorry).
I've tried AdFree but it adds only "127.0.0.1 localhost"
is there a way to edit this f*** file. I've a hosts file to use but no possibilies to use it...
If someone can help me, (s)he will be very kind....

re Hello,
I've seen a thead a patch to make a link to a file on the sdcard (I don't know where on the forum exactly)
Is there someone to help me ?

I recently have been looking into changing my own hosts file. I use Astro with the root option enabled to copy the hosts file in /system/etc/ to my SD card. With Astro you can change file extensions. Rename your SD copy to hosts.txt and you can edit it with ThinkFree. As for copying that back over, I'm not sure if it's as direct. I would suggest using an Android terminal to do the edits because you can edit without having to use ADB (I found all this out through other threads). Make sure you're root(ed) as well (su command). Also you might have to reboot after copying over your new file. My PC has trouble with my hosts file.
Basically what I've seen is that there's a line in the file that the device can't "understand" (or find) perhaps. My PC file has a couple groups of sites that I copied from a website (after checking for loopback). All in all there was a box or something somewhere because the encoding wasn't the right one. (If you add the .txt extension on the device ThinkFree will ask you what encoding. I use the suggested but that's probably my issue on my PC.) My PC kept making a new, blank copy of my hosts and turning my custom one into an iCal file (?).
Hope this helps a little, even though you're only adding one line...
Sent from my SPH-M910 using Tapatalk

Hello
Thanks for the info.
I've manage to do a link to a hosts file located in the sdcard using adb when I'm in recovery mode.
Now When I use AdFree, the app can update without problem the file

Lol you could do adb shell
cd /etc/
cat hosts
and see what it outputs. If it's wrong just do echo urlhere 127.0.0.1 >> hosts

Indirect said:
Lol you could do adb shell
cd /etc/
cat hosts
and see what it outputs. If it's wrong just do echo urlhere 127.0.0.1 >> hosts
Click to expand...
Click to collapse
It's Ok,
when I do this, it outputs all the adress associated with 127.0.0.1
It displays the content of /sdcard/etc/hosts file.

Easy Host File
I have been able to change my hosts file with no paid apps,adb, or recovery. This will work with Astro or ES File Explorer.
Find and download the hosts file you wish to use; I use mvps. If you want to edit it or add entries do so now. To save it with no file extension on Windows under tools-->folder options enable "show file extensions for known types". Control click and select "rename"; rename "hosts.txt" as "hosts". Window will warn you about changing the extension but clear the warning. Copy this to the root of your sdcard.
On your rooted phone open your file manager (Astro or ES) and click menu. Allow root permission. You will see a legend that says your app has been granted superuser privileges. Navigate to sdcard and copy your desired hosts file. Go to root directory and paste the new file in /system/etc. You will get a warning that files will be overwritten/folders merged. Allow. Now you're done, easy money!
---------- Post added at 06:21 PM ---------- Previous post was at 06:15 PM ----------
To avoid a "blank" you have to show file types for known extensions. Editing is easy in Notepad++. This way you can add new annoyances at will. There's no place like 127.0.0.1!

I Understand the good side of your method.
Just a question. Can we do a link (ln -s....) via ADB with the original recovery ( the unrooted one) ?

Related

hosts

I have a question, i need to edit my hosts file
I have find 2 hosts files, the first in /etc and the other one in /system/etc
What the difference ?
When i tried to edit with root explorer the file disappear in the folder after saving !
When i reboot the device the file is back again but not modified

[Q] How To Make a .txt file?

I tried searching and didnt find what I was looking for
Can someone explain how to make a .txt file? I was wanting to modify my power widgets in MikFroyo and I am lost as to what program to use to make it. Thanks for the help
You can use any word processor, the easiest one is probably notepad or wordpad. When you save the file make sure to select .txt as the file type
If you mean on your phone, get es file explorer from the market. Then you just hit: menu new and name it with a .txt at the end of the file name
Ok, so I got how to make the .txt file but using ES file explorer it wont let me paste/move it into the system>customize directory... It just says "copy failed"...
Also, the permission set on the existing widget.txt file are set to read only so I cant just modify that one...
I got it to copy one time and upon reboot the phone stuck at the white HTC EVO screen.. had to android back to pre-messed up copied file...
Anybody already done this and know what I'm missing?
The reason it is not copying is because the system is mounted read only.you can try going into settings in es and go to root options at the bottom. Those options don't work on all roms but you can check it out and see. Mount as read write and then you should be able to copy to system
elegantai said:
The reason it is not copying is because the system is mounted read only.you can try going into settings in es and go to root options at the bottom. Those options don't work on all roms but you can check it out and see. Mount as read write and then you should be able to copy to system
Click to expand...
Click to collapse
Alright, so I used the "experimental" feature to copy the .txt file into the system>customize directory and it actually worked, I have my power widgets the way I want them now..
But, I tried it again a little bit ago and ES file Exlp wouldnt let me use that feature... It kept saying that "mounting failed, this feature wont work on your phone."... Any idea what's up with that?
thanks for the help BTW

Text editor for terminal on customer ROM

Hi,
I am using Sandvold's ICS ROM for HTC Desire. The browser isn't any good so I found this post on how to enable Chrome beta: http://forum.xda-developers.com/showpost.php?p=22936668&postcount=13
Trouble is how to edit this file (/system/build.prop) on the phone?
I could transfer it off and put it back, but would be easier just to edit using terminal or another simple text editor. I noticed "Vi" is there, but it is way too cryptic for me. "Nano" is also installed, but it comes with an error message when I try to run it.
How to make nano work, or is there some other text editor people can recommend for this purpose?
Mons
What file explorer do you use? With a file explorer which can get root rights (e.g. Root Explorer or ES File Explorer), you could edit that file with their inbuild text-editors.
HI,
did you try vim or vi ?
It works on BCM.
Code:
vim /system/build.prop
i --> to edit the file
ESC --> to exit edit mode
:q! --> to exit vim without save
:wq --> to save and exit vim
Hi,
Managed to change it in the end, so I can run chrome now.
I installed ES File Explorer, very nice app, but found that the file system was mounted read-only. Only way around it that I found was to use the adb tool from my desktop. Pull the build.prop, modify it on the desktop and push it back.
Chrome is sluggish though, no better then the built in browser on ICS, so not sure the exercise was worth much. Although I did find a lot of other settings in that build.prop file.
Mons
You can mount /system as writable in ES File Explorer's settings.
I missed that setting. At least I know for next time.
Cheers,
Mons

can delete file/ folder in sd card!

Its really bothering me. When flashing a Rom in the aroma I choose this red theme I never used. Well in the vrtheme folder on my SD card (internal storage) there is a bunch of. PNG files that show up in my gallery. If I try to delete from gallery they just come back. And if try to delete from file explorer with root permissions. It says file can not be deleted. This doesn't make sense or am I missing something?
Help would be appreciated.
Thank you
Give this a shot (assuming you are rooted)
find the folder they are in (for arguments' sake let's say they are in /storage/sdcard0/vrtheme/
download terminal emulator app
open it and type the following commands without quotes...
"su"
"rm /storage/sdcard0/vrtheme/*.png"
see if they are gone now.
Admiral Sir Manley Power said:
Give this a shot (assuming you are rooted)
find the folder they are in (for arguments' sake let's say they are in /storage/sdcard0/vrtheme/
download terminal emulator app
open it and type the following commands without quotes...
"su"
"rm /storage/sdcard0/vrtheme/*.png"
see if they are gone now.
Click to expand...
Click to collapse
Thank for trying to help. But if I go to directory all the way down to the PNG file I would have to repeat like 150 times
But anyways when I tried it. I was granted rights for su. Then received the # in terminal.
Then I did rm followed by file path.
It said permissions denied :/
Just wanted to report my findings. If you do a search for aroma file manager on xda. With that you can delete anyfile on SD card if given operation denied with any normal file explorer with root access.
FYI - sdcard0 is not really your SD Card at all. sdcard0 is the internal storage memory. extSdCard is your actual SD Card. And UsbDriveA, UsbDriveB, etc.. are your external drives like USB thumb drive, USB external drive, etc.
If you deleted file/s and then later came back that is because the file/s are being put back with the related app/s that the file/s are related too. Deal with the related app/s in order to stop the deleted file/s from reappearing.
If you can't delete the file/s at all then change the permissions of the file/s you want to delete and/or change the permissions with the folder that holds the file/s to be deleted. Then you can delete the file/s. You can change permissions with a file manager like Root Explorer, though you need to be rooted to change some permissions. Be careful. Deleting the wrong file/s can make your device bricked.
---------- Post added at 01:08 PM ---------- Previous post was at 12:34 PM ----------
trevor7428 said:
Thank for trying to help. But if I go to directory all the way down to the PNG file I would have to repeat like 150 times
But anyways when I tried it. I was granted rights for su. Then received the # in terminal.
Then I did rm followed by file path.
It said permissions denied :/
Click to expand...
Click to collapse
You wouldn't have to delete each .png file separately. Just type exactly what Admiral Sir Manley Power typed. The line command he wrote uses the wild card ( * ) so the command would delete all .png files within that folder at the same time.
Change the permissions of the folder that holds the files. Then try it. Make sure the app related to the files are not still caching the files. Caching the files would make the files to be currently in use. That would make the files not available to be deleted. You can also use another theme app, force kill the app related to the .png files, then delete the files. Then go back to that theme app.
JaguarXT said:
FYI - sdcard0 is not really your SD Card at all. sdcard0 is the internal storage memory. extSdCard is your actual SD Card. And UsbDriveA, UsbDriveB, etc.. are your external drives like USB thumb drive, USB external drive, etc.
If you deleted file/s and then later came back that is because the file/s are being put back with the related app/s that the file/s are related too. Deal with the related app/s in order to stop the deleted file/s from reappearing.
If you can't delete the file/s at all then change the permissions of the file/s you want to delete and/or change the permissions with the folder that holds the file/s to be deleted. Then you can delete the file/s. You can change permissions with a file manager like Root Explorer, though you need to be rooted to change some permissions. Be careful. Deleting the wrong file/s can make your device bricked.
Click to expand...
Click to collapse
I no SD card should be external. But on our note 2 the directory for internal is labeled SD card. Then vrtheme was in a folder named. " 0" I tried to change permissions and even the owner of file and folder, but it wouldn't let me with root permissions. That's why I was so stumped I had to post on xda.
And its not that the file would get deleted then put back it was I couldn't delete at all. There was no app to my knowledge for vrtheme.
trevor7428 said:
Thank for trying to help. But if I go to directory all the way down to the PNG file I would have to repeat like 150 times
But anyways when I tried it. I was granted rights for su. Then received the # in terminal.
Then I did rm followed by file path.
It said permissions denied :/
Click to expand...
Click to collapse
try this instead...
rm -f /storage/sdcard0/vrtheme/*.png"
if that doesn't work... try this....
chmod 777 /storage0/vrtheme
chmod 777 /storage0/vrtheme/*.png
rm -rf /storage/storage0/vrtheme
Admiral Sir Manley Power said:
try this instead...
rm -f /storage/sdcard0/vrtheme/*.png"
if that doesn't work... try this....
chmod 777 /storage0/vrtheme
chmod 777 /storage0/vrtheme/*.png
rm -rf /storage/storage0/vrtheme
Click to expand...
Click to collapse
I thanked everyone who replied, but I actually got it figured out. I flashed this zip file in recovery called aroma file manager. While let me delete whole folder from recovery. I appreciate all who helped.

Hosts file

I have recently acquired a custom hosts file that I would like to use in place of the built-in one. Of course, the hosts file on the phone is read-only I believe, so it can't just be replaced. I can access it with ES File Explorer, and change the attributes, but no matter what I try, it will not save. I have used the adb "push" command from my computer but I still get an error trying to replace the file. I have tried using ES File Explorer as a remote ftp server also. No luck so far. Short of manually typing the information from the custom hosts file, or copying and pasting chunks at a time, I am at a loss. I don't understand why this can't be done since I have changed the attributes of the file. Please forgive my ignorance if there is an obvious solution for this that I am overlooking. Any help would be appreciated.

Categories

Resources