Edit Hosts file - Click Themes and Apps

Can someone explain the easiest way to modify hosts file please.I have used ES File Explorer which can edit it but after editing file,it can not be saved & gives me an error message.

Don't you need root for this?
Well, since I don't know if you have custom boot and busybox and alike you can do the following:
cd /pathtohostfile
cat hosts > /sdcard/hosts
Then you can either edit it when you mount sdcard or pull it via adb. To replace it just rename the old hosts file (mv hosts old.old) and then cat /sdcard/hosts ./hosts
Voilá
The cool thing is that cat doesn't give a f*** if this concerns a cross-link reference.
Regards

Related

[Q] Mounting RW

I am trying to install TapNTap keyboard in Vegan Ginger. (yeah, I know but I want to anyway). I need to copy two files to /system/app and system/lib. I presently have the files stored in /mnt/sdcard/download. I have terminal emulator installed and when I su I appear to get root (prompt changes to #). I was able to create an empty directory in /. When I try to copy the file to /system/app I get a message that it is a Read-only file system. When I do an ls -l the permissions show drwxr-xr-x for the directory. The owner is root and the group is root. It would seem that as su I should be able to copy the file there. Possibly it is mounted as RO. I tried to use a remount command but it failed. I'm not well versed in that so I may have done something wrong. Long and short - how do I get the file copied into the directory?
http://lmgtfy.com/?q=remount+system+rw+android

[q] problem editting build.prop

cannot edit build.prop. i get an error when trying to edit it with es file explorer (there was an error when trying to save this file.)
any help? ive edited it before, but i dont know how. im pretty sure i did it this way but im not sure why its not saving properly this time.
running calk+clemsyn rom/kernel combo.
thanks!
Copy it to another folder edit the copy and then move the edited file in the correct folder.
tried that already, didnt work. got another error
I use Root Explorer to do any editing.
Any other suggestions? I'd rather not have to pay for it
joshtb86 said:
cannot edit build.prop. i get an error when trying to edit it with es file explorer (there was an error when trying to save this file.)
any help? ive edited it before, but i dont know how. im pretty sure i did it this way but im not sure why its not saving properly this time.
running calk+clemsyn rom/kernel combo.
thanks!
Click to expand...
Click to collapse
If the build.prop you want to edit is in /system, then you'll have to mount /system read-write before you can modify any files there:
Code:
$ su [I]Become superuser. Prompt will change to '#'.[/I]
# /system/xbin/mount -w -o remount /system
[I]Edit the file[/I]
# /system/xbin/mount -r -o remount /system
You must have the Superuser app from Market and busybox installed on the gTablet for the commands to work. If you can't edit the file in ES File Explorer because of permission errors, copy the file into /mnt/sdcard via the command line, edit it there (or on the PC after removing the card), then move it back into place in /system and restore the old permissions:
Code:
$ cp /system/build.prop /mnt/sdcard/.
[I]a) The build.prop file in /mnt/sdcard should be editable now in ES File Explorer.
Edit the file, then do:
OR
b) Unmount the SD card via Settings > Storage, then remove the SD card and
edit the file elsewhere. Plug it back in, and, after it mounts do:[/I]
$ su
# /system/xbin/mount -w -o remount /system
# /system/xbin/mv /mnt/sdcard/build.prop /system/build.prop
# chown root.root /system/build.prop
# chmod 644 /system/build.prop
# /system/xbin/mount -r -o remount /system
All this is much easier through adb if you have that setup.
Note: Do not type the prompts--the '$' and '#' characters--in; they're just there to tell you what the Terminal screen should look like.
joshtb86 said:
Any other suggestions? I'd rather not have to pay for it
Click to expand...
Click to collapse
Did you have ES file explorer in Root mode?
In Es file explorer
Settings->Root Options -> both boxes checked, (HiAPK mode for first box)
I usually copy the file to sdcard and modify it, get ES explorer in root mode and copy it back. Do a backup before, in case you mess it up.
I usually use a terminal in su mode for editiing/copying, but that might not be needed.
cbay said:
Did you have ES file explorer in Root mode?
In Es file explorer
Settings->Root Options -> both boxes checked, (HiAPK mode for first box)
I usually copy the file to sdcard and modify it, get ES explorer in root mode and copy it back. Do a backup before, in case you mess it up.
I usually use a terminal in su mode for editiing/copying, but that might not be needed.
Click to expand...
Click to collapse
if i use CM Mod, i cant see any files. if i use HiAPK, all the files have -rw and a lot of stuff before it and i cant read anything, but it does mount. CW had problems mounting the drive. im gonna try out the terminal commands
rajeevvp said:
If the build.prop you want to edit is in /system, then you'll have to mount /system read-write before you can modify any files there:
Code:
$ su [I]Become superuser. Prompt will change to '#'.[/I]
# /system/xbin/mount -w -o remount /system
[I]Edit the file[/I]
# /system/xbin/mount -r -o remount /system
You must have the Superuser app from Market and busybox installed on the gTablet for the commands to work. If you can't edit the file in ES File Explorer because of permission errors, copy the file into /mnt/sdcard via the command line, edit it there (or on the PC after removing the card), then move it back into place in /system and restore the old permissions:
Code:
$ cp /system/build.prop /mnt/sdcard/.
[I]a) The build.prop file in /mnt/sdcard should be editable now in ES File Explorer.
Edit the file, then do:
OR
b) Unmount the SD card via Settings > Storage, then remove the SD card and
edit the file elsewhere. Plug it back in, and, after it mounts do:[/I]
$ su
# /system/xbin/mount -w -o remount /system
# mv /mnt/sdcard/build.prop /system/build.prop
# chown root.root /system/build.prop
# chmod 644 /system/build.prop
# /system/xbin/mount -r -o remount /system
All this is much easier through adb if you have that setup.
Note: Do not type the prompts--the '$' and '#' characters--in; they're just there to tell you what the Terminal screen should look like.
Click to expand...
Click to collapse
when i tried the mv command to move it back, i still got errors in moving it and was not able to
joshtb86 said:
when i tried the mv command to move it back, i still got errors in moving it and was not able to
Click to expand...
Click to collapse
Try
Code:
/system/xbin/mv /mnt/sdcard/build.prop /system/build.prop
instead of plain 'mv'. The default Android mv command is idiotically implemented. (See this post if you're interested in the details):
http://forum.xda-developers.com/showpost.php?p=13956585&postcount=4
Using 'cp' command instead of 'mv' should also work; this way, you'll also have a backup of build.prop in /mnt/sdcard/.
rajeevvp said:
Try
Code:
/system/xbin/mv /mnt/sdcard/build.prop /system/build.prop
instead of plain 'mv'. The default Android mv command is idiotically implemented. (See this post if you're interested in the details):
http://forum.xda-developers.com/showpost.php?p=13956585&postcount=4
Using 'cp' command instead of 'mv' should also work; this way, you'll also have a backup of build.prop in /mnt/sdcard/.
Click to expand...
Click to collapse
thanks so much again. i finally got it to work, but i just wanted to get netflix to work, and it still doesnt. after all that work. ugh.
JoTeC said:
I use Root Explorer to do any editing.
Click to expand...
Click to collapse
Thanks, I tried two other applications and they didn't work. Was able to edit with Root Explorer. didnt fix the Netflix playback. Bummer.
***** changing the Nexus S to HTC Vision and samsung to HTC did the trick.
Root explorer will work, and is a great app. Worht the money.
Also, ADB from a PC will work as well. Just install the android sdk and use ADB.
From windows cmd prompts the commands are just adb remount (to remount as root) then "adb pull /system/build.prop" (this will pull it to the sdk platform-tools folder that adb.exe is in) and then edit to your hearts delite.
"adb push build.prop /system/build.prop" to send it back.
I was able to use ES File System by unchecking the Mount File System option in the Root options menu and then rechecking it. I imagine that it forced a remount of the file system in a writable mode.
This worked on our nabi big tab hd24
We now have true multiuser, where everyone has their own login, files, emails, bookmarks, web history, etc; as it should be.
I first did a factory reset, then installed kingo root, then another reset, did the build prop edit this suggested (es file explorer did not work) but build prop editor did....
We now have the nabi big tab hd 24 running as our primary desktop workstation computer...
No we just wish for a room update to be made available with the latest version of Android.
4.4.2 is getting old, and as is common little manufacturer long term support...

Hosts file

I am trying to update my hosts file and have done so on CM7.1RC1 (the best Rom so far), its proporly formatted as I do this all the time on my linux boxes but for some reason on my gtab it does not work. With oenvpn enabled and working I cannot reach items by name as stated in my hosts file.
Question .. does the /etc/hosts file work the same on the gtab as it does on all other operating systems? If so then ideas of what to look for to resolve this?
brwatters said:
With oenvpn enabled and working I cannot reach items by name as stated in my hosts file.
Click to expand...
Click to collapse
Try both pings (the android one in /system/bin and the busybox one in /system/xbin--you may only have one on some firmwares) to check.
Question .. does the /etc/hosts file work the same on the gtab as it does on all other operating systems? If so then ideas of what to look for to resolve this?
Click to expand...
Click to collapse
Yes--but programs have to use it. The busybox utilities all use it and the stock browser also; don't know about openvpn.
Are the permissions set correctly on /etc/hosts (actually, /system/etc/hosts)? It should be readable for all users.
The issue is that the hosts file (/etc/hosts) in GTab is readonly and the device has to be rooted to edit the file. Now I have not been able to root my GTab running Gingerbread. This makes it impossible to effectively use VPN to access the corporate network. I tried to create another hosts file in /system/bin folder but it would not let me save anything in that folder. Without being able to edit the /etc/hosts file VPN seems to be of limited value in GTab.
Any ideas?
There is no need to "root" a gTab running a custom ROM. If an "adb shell" command works, then you have root permissions. Same thing if you download and install the Superuser app from Market.
To edit /system/etc/hosts, install Root Explorer from the Market. This will let you remount /system read-write easily. Once remounted, just edit the hosts file.
To edit the hosts file on the command line:
Code:
C:\> [B]adb pull /system/etc/hosts .[/B] [I]Get the hosts file[/I]
[I]Edit the file on the PC[/I]
C:\> [B]adb remount[/B] [I]Remount /system read-write[/I]
C:\> [B]adb push hosts /system/etc/hosts[/B] [I]Put the file back[/I]
C:\> [B]adb shell chmod 644 /system/etc/hosts[/B] [I]Set the correct permissions[/I]
Reboot the tablet after this.

[SOLVED] Filesystem - problem with /system/bin - nested bin folders (SE LwW)

Hello everybody,
I have a "problem" with /system/bin/ and bin folders (however, the phone works just fine, hence those quotation marks :angel.
Let's stick with /system/bin/: Inside I have the files that should be there, but there is also another bin folder with exactly the same files inside and another bin folder inside ... and so on, about 20 times/levels(?) nested.
Not sure what it is ... some hardlink problem?
The same is in /bin/ folder.
ES File Explorer says that there are about 7000 files/ 230 MB in the first nested bin subfolder.
I tried the following:
1. Delete the nested bin folders from ES File Explorer (root access granted) - unsuccessful ("can't delete ...")
2. From CWM: format /system/ + Factory reset + wipe + ROM reflash
3. Search the forum for this issue - maybe I can't search properly, but found nothing ... sorry
As I said, the phone works fine. But I think that it is not good to have such a mess inside the system folders.
I didn't try complete reflash (ftf file) ... I'm trying to avoid doing everything from scratch .
Can you help me, please?
Thanks a lot,
J.
Phone: Sony Ericsson Live With Walkman WT19i, unlocked bootloader (the Sony way), MESA Kernel 3.6 stock, Real ICS lite r4.
Update: It's a chain of symlinks. The depth of the chain is 40 (counted in DroidExplorer).
What else didn't work:
mount /system in TWRP, then starting file editor, deleting bin (even with chmod)
All attempts to delete the symlink via PC file managers (e.g. Droid Commander)
Solution {rooted phone):
It was a symlink in system/bin pointing to self,
1. Install Android Terminal Emulator (free at Google Play)
2. Start it
3. Then
Code:
# su
(allow root access)
Code:
# mount -o remount, rw /system
# cd /system/bin
# rm bin
That's it

[Q] Can't paste file in /system/etc. after setting permissions to RW

I can't copy the file 'hosts' back to system/etc. after I cut it out of the folder a couple mins ago. When I use ES File Explorer (don't wanna pay 4euros for Root Explorer..) to try and paste it back (with everything set to RW and having root permissions) it says 'permission denied'. I don't know what I'm doing wrong.. Help is greatly appreciated.
j0nthn said:
I can't copy the file 'hosts' back to system/etc. after I cut it out of the folder a couple mins ago. When I use ES File Explorer (don't wanna pay 4euros for Root Explorer..) to try and paste it back (with everything set to RW and having root permissions) it says 'permission denied'. I don't know what I'm doing wrong.. Help is greatly appreciated.
Click to expand...
Click to collapse
Theres other apps that use root that are free,just use google or try android/apps on here,the search function is your best friend.ES gives me issues also.
j0nthn said:
I can't copy the file 'hosts' back to system/etc. after I cut it out of the folder a couple mins ago. When I use ES File Explorer (don't wanna pay 4euros for Root Explorer..) to try and paste it back (with everything set to RW and having root permissions) it says 'permission denied'. I don't know what I'm doing wrong.. Help is greatly appreciated.
Click to expand...
Click to collapse
You can use the terminal emulator, this way (assuming the host file is located in your sdcard):
Code:
su
mount -o rw,remount /system
cp /sdcard/hosts /system/etc/hosts
--set permissions here if you need
mount -o ro,remount /system
Personaly, I don't face any problem with ES File Explorer, but you can try this one (free, lightweight and useful)
cant is cant
RoberGalarga said:
You can use the terminagoing to be lator, this way (assuming the host file is located in your sdcard):
Code:
su
mount -o rw,remount /system
cp /sdcard/hosts /system/etc/hosts
--set permissions here if you need
mount -o ro,remount /system
Personaly, I don't face any problem with ES File Explorer, but you can try this one (free, lightweight and useful)
Click to expand...
Click to collapse
The problen was defined, he said he is rooted he set the permissions, set the system or as mounted read write... the answer is not just use this app, if you are rooted # not $ and you can not read or write something it is not going to be a standard answer... I have tje same problem, I thonk it is because I used a rooter for chines operating system, and it gained root but has some issues. A hint to this was that I had to run ot 2ce to do the rooting. This is for sure tho, if ypu cant do it in terminal as su, np app is going to be sble to do it for you. I suggest to do as I am going to to do, and that is to hard reset, and find a non chinese tablet rooter.
j0nthn said:
I can't copy the file 'hosts' back to system/etc. after I cut it out of the folder a couple mins ago. When I use ES File Explorer (don't wanna pay 4euros for Root Explorer..) to try and paste it back (with everything set to RW and having root permissions) it says 'permission denied'. I don't know what I'm doing wrong.. Help is greatly appreciated.
Click to expand...
Click to collapse
its due to root permission............try reseting root permission through superuser app.................

Categories

Resources