Host file - Android Q&A, Help & Troubleshooting

How can you edit your host file?
Sent from my PC36100 using xda premium

By rooting+text editor with root capability

Clarification: You need root to write to \system\etc (I think that's the location in Linux). AdFree (better) and AdAway (open source) are two free tools that will do it for you, replacing your HOSTS file with a ton of ad servers. Manual editing is the way to go if you just want a couple things rerouted, but ad blocking is the big(gest) draw of editing HOSTS, in my experience.

Or you can pull it via adb open it with a program like notepad ++(or normal notepad) ,edit it and push it back to the device
Sent from my Optimus Me using xda premium

Related

[Q] rar files being downloaded as .bin

Whenever I download a rar file, it just shows up as a .bin on both the notification bar and in root explorer. Is there a setting I need to change to allow rar files tobe downloaded?
Sent from my ADR6400L using XDA App
There's no reason why you would need to, usually just changing the extension works for me.
*note* there has to be something in front of the .bin for it to work in a lot of cases "randomname.bin" for example
Sent from my Toshiba Handibook
You shouldn't even have to change the extension. I use unrar pro, point to the file using estrongs file explorer and it extracts the contents.
Sent from my ADR6400L using XDA App

[Q] create an apk file

How can I create an apk file of an application installed in my phone... I don't want to back it up, I want to create an apk...plz help
If you want to 'create' an apk-file from an application that is installed on your phone, I believe you it's possible to pull it from the phone via ADB.
http://developer.android.com/guide/developing/tools/adb.html
Locate the apk in /data/app and copy it (needs root)
Use rootexplore or terminal emulator.
^ or pull it with adb.
Sent from my GT-I9100 using XDA Premium App

Block Ads

Hey guys I am sharing these host files to block ads
**Disclaimer**
**I Take NO Responsibility in bricking your device**
**If there is any connectivity problems, replace the old hosts file**
Needed:
Rooted Device
Root Explorer (Or another file manager that has /system/ directory access)
Attached hosts File
Installation
Step 1: Download and unpack hosts.zip.
Step 1: Copy the hosts file to /system/etc/.
Step 1: Reboot and enjoy.
What it does?
The Hosts file contains the mappings of IP addresses to host names. This file is loaded into memory at startup, then Android checks the Hosts file before it queries any DNS servers, which enables it to override addresses in the DNS. This prevents access to the listed sites by redirecting any connection attempts back to the local (your) phone. Another feature of the HOSTS file is its ability to block other apps from displaying ads .
Or you download/install "adfree" from the market.
hasjee said:
Or you download/install "adfree" from the market.
Click to expand...
Click to collapse
For me maybe it is better this way. 1 app less but the same thing, and im not depending of loosing adfree if i delete app.
Sent from my GT-I5800
alen1901 said:
For me maybe it is better this way. 1 app less but the same thing, and im not depending of loosing adfree if i delete app.
Sent from my GT-I5800
Click to expand...
Click to collapse
u can uninstall addfree right after you aply it
Yes you can remove adfree after placing the host files.
swapnilraj said:
Yes you can remove adfree after placing the host files.
Click to expand...
Click to collapse
Really? One time i tried that, but ads came back. Nevermind, i dont use it.
Sent from my GT-I5800
Thank you!! I've been looking for it for a long time!

[Q] Android Stock Browser - help please!

Hi to all
My Streak 5 is running DSC ROM v1.1 and am using the included Android stock browser (v2.3.3).
When I try to view adfly web pages (eg *******/), I am not able to see them - I get the 'web page not available' error message.
What do I need to do to both view these kind of web pages and also for them to load properly in the Android browser? I can see the pages on any PC but have singularly failed to find a way via the browser on my phone
Many many thanks to anyone who can put me out my misery..
This may be due to the modified hosts file that is included with DSC. Look in /system/etc/ and find a file named hosts. Make a backup of it. Open the original in a text editor and remove everything but this line:
127.0.0.1 localhost
Leave a blank line at the end of the file, save and exit.
It may require a reboot to be effective. If it doesn't work, just revert to your backup.
lordmorphous said:
This may be due to the modified hosts file that is included with DSC. Look in /system/etc/ and find a file named hosts. Make a backup of it. Open the original in a text editor and remove everything but this line:
127.0.0.1 localhost
Leave a blank line at the end of the file, save and exit.
It may require a reboot to be effective. If it doesn't work, just revert to your backup.
Click to expand...
Click to collapse
Thanks very much for the quick reply - much appreciated. Your suggestion about the hosts file gave me a clue.
I have AdAway installed, which blocks ads (on both webpages and those sent/displayed by apps and games) by modifying the hosts file. I disabled AdAway and reverted to the DSC ROM hosts file - and I can now see adfly pages on the browser.
However, I still wish to block ads on web pages, while still being able to use adfly-type sites. I also don't want to lose the ability to block ads shown/sent by apps & games. Is there an alternative method to block these?
AdAway was extremely effective at doing its job and I'd be loath to lose that functionality. For example on my PC, I use Chrome with AdBlockPlus extension which allows me to see and navigate through adfly-type sites while not being subject to ads.
Any advice or suggestions would be gratefully received. Thanks again for your help.
Cheers
AdAway and other such programs only combine the lists of blocked sites compiled by well-known sites into a single HOSTS file. They currently cannot exclude specific sites. For that, you have to edit the file manually.
Continue using AdAway, but use a text editor afterward to manually update the HOSTS file to exclude the site you want to see.
Strephon Alkhalikoi said:
AdAway and other such programs only combine the lists of blocked sites compiled by well-known sites into a single HOSTS file. They currently cannot exclude specific sites. For that, you have to edit the file manually.
Continue using AdAway, but use a text editor afterward to manually update the HOSTS file to exclude the site you want to see.
Click to expand...
Click to collapse
Actually AdAway has a whitelist facility. I've added ******* to it but can still see all the ads, unlike when I use AdBlock Plus under Chrome on a PC. Guess that'll have to do, unless anyone knows of a more elegant solution..
Cheers
I've used AdAway for months now and didn't realize it had a whitelist. Good to know the feature exists, though I am unlikely EVER to use it.
lordmorphous said:
This may be due to the modified hosts file that is included with DSC. Look in /system/etc/ and find a file named hosts. Make a backup of it. Open the original in a text editor and remove everything but this line:
127.0.0.1 localhost
Leave a blank line at the end of the file, save and exit.
It may require a reboot to be effective. If it doesn't work, just revert to your backup.
Click to expand...
Click to collapse
thanks bro!!!
I stop using adaway due to this problem. SO many website can't be opened. MOdify the host file and now things work again or just click disable adaway and it will modify the host file for you
For the app, you might want to use lucky patcher to block the ads
lordmorphous said:
This may be due to the modified hosts file that is included with DSC. Look in /system/etc/ and find a file named hosts. Make a backup of it. Open the original in a text editor and remove everything but this line:
127.0.0.1 localhost
Leave a blank line at the end of the file, save and exit.
It may require a reboot to be effective. If it doesn't work, just revert to your backup.
Click to expand...
Click to collapse
Can't find system , can you be more specific , not able to find in file manager
pramodb said:
Can't find system , can you be more specific , not able to find in file manager
Click to expand...
Click to collapse
You need to be using a file manager that allows root functions, such as ES File Explorer, Root Explorer, etc. A non-root enabled file explorer won't allow you to see /system/
lordmorphous said:
You need to be using a file manager that allows root functions, such as ES File Explorer, Root Explorer, etc. A non-root enabled file explorer won't allow you to see /system/
Click to expand...
Click to collapse
Dude , I used es explorer and I'm still not able to find system
pramodb said:
Dude , I used es explorer and I'm still not able to find system
Click to expand...
Click to collapse
Did you enable the root explorer features of ES? I'm not sure where to go from here to help you. Finding /system/ is pretty basic stuff.
If you are familiar with using adb, you can use it to pull the file to your computer, edit it, and push it back into place. The command would be:
adb pull /system/etc/hosts
adb push hosts /system/etc/hosts
There are lots of guides available for using adb and it is a worthwhile tool to know and use.
I like Notepad ++ for editing files on my computer. It's free and simple to use.
I'm willing to help, but keep in mind that I no longer have this phone as I moved on to the S3 last July.
lordmorphous said:
Did you enable the root explorer features of ES? I'm not sure where to go from here to help you. Finding /system/ is pretty basic stuff.
If you are familiar with using adb, you can use it to pull the file to your computer, edit it, and push it back into place. The command would be:
adb pull /system/etc/hosts
adb push hosts /system/etc/hosts
There are lots of guides available for using adb and it is a worthwhile tool to know and use.
I like Notepad ++ for editing files on my computer. It's free and simple to use.
I'm willing to help, but keep in mind that I no longer have this phone as I moved on to the S3 last July.
Click to expand...
Click to collapse
Okay , got it but it is already in the way you said of should he , what do you suggest I do now
lordmorphous said:
Did you enable the root explorer features of ES? I'm not sure where to go from here to help you. Finding /system/ is pretty basic stuff.
If you are familiar with using adb, you can use it to pull the file to your computer, edit it, and push it back into place. The command would be:
adb pull /system/etc/hosts
adb push hosts /system/etc/hosts
There are lots of guides available for using adb and it is a worthwhile tool to know and use.
I like Notepad ++ for editing files on my computer. It's free and simple to use.
I'm willing to help, but keep in mind that I no longer have this phone as I moved on to the S3 last July.
Click to expand...
Click to collapse
Okay , I got it and its in the way you said it should be , so any suggestions. And BTW I'm using gt-p5100 on job 4.2.2 via CyanogenMod
Well, that ruled out the hosts file. I'm stumped now. If I think of something I'll post it.
lordmorphous said:
Well, that ruled out the hosts file. I'm stumped now. If I think of something I'll post it.
Click to expand...
Click to collapse
Hi
I had the same problem like others had so what i did , i just move the host file from system/etc to just system , now i can open adf and other sites but now i can see ads running in my apps and games . Now i want to manually edit the hosts file so that the ads won't run in apps & games but it won't block adf . So can u tell me which data to remove from the host file ??
Okay i just remove the adf (dot)ly and cdn(dot)adf(dot)ly from the hosts and now i can open adf and also no ads in the apps or games.
But has problem with the linkbucks , still can't open it and can't find it in the hosts also
easy video tutorial made by me
https://www.youtube.com/watch?v=Kaochdv3cbs
Hi
hi
after doing that i have this error
unable to connect proxy server
how to fix this?

Modify apk

Is theres a way to modify and run this apks without unlocking secrecy or auth token? i pulled it from my oppo and when i run the app it'll update the existing app
norimee said:
Is theres a way to modify and run this apks without unlocking secrecy or auth token? i pulled it from my oppo and when i run the app it'll update the existing app
Click to expand...
Click to collapse
You can't modify an APK, as it's in binary. You could remove it though - Let me know if you need help.
An APK ( read: Android Application Package ) file by nature is a ZIP file - not a binray - what can get extracted with any zip utility (e.g. 7zip), you can view all resources correctly but all java files are not correctly decompiled.
Content of an APK file looks like
You can also see the contents of an APK file within the Android device itself, which helps a lot in debugging, using
https://play.google.com/store/apps/details?id=com.dasmic.android.apkpeek
All files including the manifest of an app can be viewed and also shared using email, cloud etc., no rooting required.

Categories

Resources