Hosts file - G Tablet Q&A, Help & Troubleshooting

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.

Related

Edit Hosts file

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

[ROOKIE][DEV][HOWTO] Permenant BN-OTA Update Block

From this thread:
http://forum.xda-developers.com/showthread.php?t=874871
Attached is a working sqlite3 binary.
Copy it to /system/bin
(I transfered it to my SD, then used rootexplorer (mount R/W) to copy into /system/bin))
you will now be able to edit sqlite databases on the nook itself.
--------------------------------------------------------------------------------
Attached Files sqlite3.7z (11.9 KB, 56 views)
--------------------------------------------------------------------------------
In your terminal:
$ adb pull /data/data/com.bn.devicemanager/databases/devicemanager.db devicemanager.db
$ sqlite3 devicemanager.db
sqlite> update registry set value='manual' where name='com.bn.device.fota.mode';
sqlite> .q
$ adb push devicemanager.db /data/data/com.bn.devicemanager/databases/devicemanager.db
$ adb reboot
Congrats Your NC is now permanently blocked from any future BN OTA auto updates.
No more build.prop spoof hacks for each release (sideload only),,,,,, yada yada
sleep like a baby.........with yur wifi on.
Nook got pissed and reset itself. Good thing I have backups.
bonzer2u, thanks! Just did it on my rooted (1.0.1 version) nook and so far no issues.
That reminds me that the prereqs are you need to be rooted with SU and ADB working.....DOH
Jeeeez and of course credit where credit is due...
JoshMiers - for providing the sqlite3 binary post.
and
ixampl - for providing the clues that lead me to find the appropriate db and setting to hack.
Finally, disclaimer: Apply and/or feel free to incorporate into your projects at your own risk, if your NC self distructs, yur on yur own......NOT
Instructions don't use sqlite3 binary on device
Your instructions work fine assuming that the computer connected to the NC has the sqlite3 binary installed. The sqlite3 binary you link to could be used to make the changes inside adb shell but it's not documented as such. Just wanted to give that note to help clear up anyone's confusion if they run into issues with the given instructions. Other than that, thanks for the tip!
The sqlite3 binary I posted is for use on the Nook itself. If you want to do that instead of doing adb pull/push just do this in an adb shell:
Code:
# sqlite3 /data/data/com.bn.devicemanager/databases/devicemanager.db
sqlite> update registry set value='manual' where name='com.bn.device.fota.mode';
sqlite> .q
# reboot
JoshMiers said:
The sqlite3 binary I posted is for use on the Nook itself. If you want to do that instead of doing adb pull/push just do this in an adb shell:
Code:
# sqlite3 /data/data/com.bn.devicemanager/databases/devicemanager.db
sqlite> update registry set value='manual' where name='com.bn.device.fota.mode';
sqlite> .q
# reboot
Click to expand...
Click to collapse
Easier then I thought, thanks again Josh....
hoban_eris said:
Your instructions work fine assuming that the computer connected to the NC has the sqlite3 binary installed. The sqlite3 binary you link to could be used to make the changes inside adb shell but it's not documented as such. Just wanted to give that note to help clear up anyone's confusion if they run into issues with the given instructions. Other than that, thanks for the tip!
Click to expand...
Click to collapse
If I understand you correctly, my PC is a dell win7-32 laptop and it doesn't have any sqlite3 installed binary on it? I did however use it to download and transfer the sqlite3 binary Josh posted to my nook??
Yes Josh mentioned the adb shell version above.
I did initially forget to mention you need to be rooted and have SU and ADB functioning as a prereq, my bad, but it is pretty obvious.....
If you have adb working on your PC, the chances are that you have sqlite binary on your PC since it seems to come with the android sdk in the tools folder (for example, android-sdk_r07-windows\android-sdk-windows\tools). When I did it on mine, I used the commands from the OP, and did it on the PC with nook connected, but didn't use the linked sqlite3 binary for nook).
droidseban said:
If you have adb working on your PC, the chances are that you have sqllite binary on your PC since it comes with the android sdk in the tools folder (for example, android-sdk_r07-windows\android-sdk-windows\tools). When I did it on mine, I followed your directions, and did it on the PC with nook connected, but didn't use the linked sqllite3 binary for nook).
Click to expand...
Click to collapse
Ahh I see now and didnt know that... I understand what you guys are referring to now.
Thanks for clearing that up, like my post title suggests, still just a rookie with the nook that is.....
We are all here to learn from each other.
Looking through the rest of the entries in the registry table, there is this entry: "com.bn.device.fota.next_connect_default_interval" which is set to the value 604800000. Assuming this is in milliseconds as usual, it translates to 7 days. So, nook is set to check for updates once every week. I guess you can try upping this number also to avoid the updates.
Adding a command to raise the udate check interval to a year to the steps from OP (NOTE: no space in "...default_interval". Not sure why the forum software is inserting it):
$ adb pull /data/data/com.bn.devicemanager/databases/devicemanager.db devicemanager.db
$ sqlite3 devicemanager.db
sqlite> update registry set value='manual' where name='com.bn.device.fota.mode';
sqlite> update registry set value='31557600000' where name='com.bn.device.fota.next_connect_default_interval';
sqlite> .q
$ adb push devicemanager.db /data/data/com.bn.devicemanager/databases/devicemanager.db
$ adb reboot
excellent, did you notice the download URL in the table as well?????
Someone suggested another way to perma-stop OTA would be to add the url
https://csqaint.barnesandnoble.com/bncloud/serviceG 127.0.0.1
to our hosts file?
Do you think this would work as well?
I would think so, but it might crash the process that checks for the updates.
bonzer2u said:
Someone suggested another way to perma-stop OTA would be to add the url
https://csqaint.barnesandnoble.com/bncloud/serviceG 127.0.0.1
to our hosts file? Do you think this would work as well?
Click to expand...
Click to collapse
No -- the hostname csqaint does not resolve outside BN.
I don't think it is directly going to https://csqaint.barnesandnoble.com/bncloud/serviceG. My guess is Nook goes to https://bncs.barnesandnoble.com/bncloud/oauthpage/BnOAuthMgmt.jsp to authorize the connection, establishes a VPN, and then move on to https://csqaint.barnesandnoble.com/bncloud/serviceG.
bonzer2u said:
From this thread:
http://forum.xda-developers.com/showthread.php?t=874871
Attached is a working sqlite3 binary.
Copy it to /system/bin
(I transfered it to my SD, then used rootexplorer (mount R/W) to copy into /system/bin))
you will now be able to edit sqlite databases on the nook itself.
--------------------------------------------------------------------------------
Attached Files sqlite3.7z (11.9 KB, 56 views)
--------------------------------------------------------------------------------
In your terminal:
$ adb pull /data/data/com.bn.devicemanager/databases/devicemanager.db devicemanager.db
$ sqlite3 devicemanager.db
sqlite> update registry set value='manual' where name='com.bn.device.fota.mode';
sqlite> .q
$ adb push devicemanager.db /data/data/com.bn.devicemanager/databases/devicemanager.db
$ adb reboot
Congrats Your NC is now permanently blocked from any future BN OTA auto updates.
No more build.prop spoof hacks for each release (sideload only),,,,,, yada yada
sleep like a baby.........with yur wifi on.
Click to expand...
Click to collapse
I like your method better than spoofing the build.prop of 1.1.
Would it be okay with you if I make this into a Clockwork update.zip ?
thecubed said:
I like your method better than spoofing the build.prop of 1.1.
Would it be okay with you if I make this into a Clockwork update.zip ?
Click to expand...
Click to collapse
Absolutely and goes for anyone it might be useful for......
I dont get sqlite 2
Hi All,
Noob quiestion,
I go in adb shell promt "#" by typing "adb shell" in command line.
when I type sqlite3 I get "sqlite3 : not found"
Am I missing anything?

[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...

[Q] Linux/Android Question

I am adding some mod files and tweaks to an android 2.3.3 image. It is a Livesuit flashable image for the Alpha 2 Skypad. I use unimg.exe to extract the files then fileaddsum and unimg to repack the file under Windows.
I mount the extracted image in Linux Mint then make my changes. I have tried different tricks people have suggested to set the permissions of the file, but whenever I umount and repack the img, it will install, but I have to go into adb and chmod the files. I have written a simple command file so it only take a second, but being new to Linux I am not finding any way to set the permission when I copy over the files to the mounted image.
Any suggestions/ Thanks in advance.
bump..........................................
re-bump .............................................
Not sure if this will help, but in unix permissions are set with chmod. so to ad the exicutable permission you enter:
Code:
su
chmod a+x filename
exit
However if youve had suggestions on setting permissions, you must already know this?
matts95 said:
Not sure if this will help, but in unix permissions are set with chmod. so to ad the exicutable permission you enter:
Code:
su
chmod a+x filename
exit
However if youve had suggestions on setting permissions, you must already know this?
Click to expand...
Click to collapse
That wasn't working for me. But I found a cheat, I guess you could say. Once the image was open I would pull the files from the emulator or a pad directly to the image+folder. Not elegant but it worked.

Categories

Resources