Hosts file - T-Mobile LG G3

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.

Related

How do I overwrite a file "in ROM memory"?

There are a number of TP2 tweaks which require the editing or replacement of files - for example, there is supposedly a way of increasing the loudspeaker volume which involves replacing a file called AudioPara3.csv with an edited version. This file sits in the Windows folder.
I'm using Resco File Explorer on my TP2, with the corresponding shell extensions installed on my desktop Windows, but nothing I do will allow me to edit that file. Trying to overwrite it (by dragging the copy into the appropriate Explorer window on my desktop PC) fails, telling me that I don't have the necessary permissions. If I look at the file properties on my TP2, it's set to read-only. If I try clearing the read-only checkbox this looks as if it's going to work, but actually if I go back into properties again, it's still set to read-only. There's another (disabled) checkbox in the properties labeled "ROM" which is ticked - I assume it's this that is causing the problem.
I've also tried renaming the file - that, again, appears to work but what it actually does is to create a duplicate of the file with the new name while leaving the old file intact.
There must presumably be a way of overwriting this file, otherwise no one would have been able to install the tweak!
I have a similar problem with the weather database file - so I can't add in extra locations.
What am I missing?
Try doing it on the TP2 itself with Resco File Explorer. I do not have any problem so far. Not too sure when you use it on the desktop.
weenween said:
Try doing it on the TP2 itself with Resco File Explorer. I do not have any problem so far. Not too sure when you use it on the desktop.
Click to expand...
Click to collapse
Several options in Resco File Explorer failed, but using the Copy To option worked, for some reason.
Don't think it actually made the speakers any louder, though.
You can also try Total Commander (not like it'll make the speakers louder, but for future reference).
Total Commander will work OR you can rename the original file, then copy the new one in.
I recommend (strongly!) the former since if you screw up you can fix it without a hard reset!
What is wrong with this file?
Hello,
I'd like to ask for some expert help.
I finally managed to edit an EXE file from Windows - just translating Japanese text to English. I used the MEditor suite. After saving, I "dropped" the file onto the SignCode.exe as per instructions.
When I transferred the file to its original location and overwrote the original one, I get:
"Cannot open... A critical component is either missing or cannot start because program memory is unavailable...."
I am sure I didn't change anything else but texts. So what could be wrong?
I am attaching the two files - the original and the edited - for someone to please look at them and let me know if there's anything I can do. This is Sharp's Barcode Reader.exe
Thanks!

HTC TP2 ROM manipulation

Yesterday, I tried copying the HTCSendorSDK.dll through ActiveSync. I got Access Denied and though that the dll must be in use. Then I used File Browser on the phone to copy the file to another folder. It said that it can't copy a file included in the ROM. I haven't made any other changes and since then Opera and Weather don't connect. Internet Explorer is able to browse the web, vxUtils says I have two valid IPs and I'm able to use HTTP GET and Ip lookups.
Any ideas if me attempting to copy the ROM included file screwed something up?
Any other ideas for troubleshooting?
Thanks
Chris
use something like total commander to copy the file.
you should be able to find a .cab to install total commander, which will allow you to copy or move the file.
fixitchris said:
Yesterday, I tried copying the HTCSendorSDK.dll through ActiveSync. I got Access Denied and though that the dll must be in use. Then I used File Browser on the phone to copy the file to another folder. It said that it can't copy a file included in the ROM. I haven't made any other changes and since then Opera and Weather don't connect. Internet Explorer is able to browse the web, vxUtils says I have two valid IPs and I'm able to use HTTP GET and Ip lookups.
Any ideas if me attempting to copy the ROM included file screwed something up?
Any other ideas for troubleshooting?
Thanks
Chris
Click to expand...
Click to collapse
You can always delete replaced files that were in rom. This will make the system revert to the original file that was overwritten. This always works without issue unless the overwritten file was something that gets changed or updated like certain .ini files, etc...
for overwritting system files, I recommend Resco file explorer. It is hands down the best file/registry explorer/editor. Google beta 2 for a free trial.

[Q] Edit hosts file

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) ?

Can't move some files, can't create some folders

I don't know how else to describe this issue I'm having:
Essentially sometimes I cannot create new folders, either in an explorer app (ES File Manager, Explorer (free, not Root Explorer), or other file manager) or when connected to my computers via USB. Sometimes I can do both. Similarly, sometimes I cannot move files from one directory to another, both using file manager or when connected to computer over USB. It seems random, I think?
An example of this is I downloaded a PDF file from SharePoint using Chrome. The file is downloaded to the /Downloads directory by default. I wanted to move this to a different directory (/Documents), but the cut+paste operation failed. ES File Manager says the operation can't be completed, Explorer just sits there and doesn't say anything. When trying to do the same thing over USB connection, Windows just sits there saying the device is busy, and it'll sit there indefinitely. But an OGG file I downloaded from Dropbox was free to be moved to and from several directories when I was testing file operations.
Basically it's like my device doesn't want to play nice with files and folders. I tried doing a factory reset, but that didn't seem to help. Do you think completely reformatting the phone (as in fastboot format userdata, and a fresh ROM + kernel install) would help? It seems drastic, but at the same time being unable to move files and folders is very strange and likely hard to pinpoint the culprit.
I'm rooted (using traditional SuperSU root) running Pure Nexus 12/01/2015 ROM and ElementalX 0.07 kernel (Enforcing disabled). I doubt any of those 3 factors are the cause of it, but every detail might help, right?
Update: It looks like a permissions issue. Please see post below.
OK an update to this, I discovered that some folders that I thought I had deleted using ES File Manager are still showing up in USB storage when I'm hooked up to a computer. That is to say that what I see using a file manager versus what I see while connected to a computer are different.
Further to this, I am now getting "Permission denied" by the file managers when I try to copy and paste anything from anywhere to any other place. I have booted into TWRP to run Fix Permissions already. It looks like everything now has rwxrwx---, which means to me 770? It should be 775, no?
Any ideas what might be causing this permissions issue?
daver68 said:
OK an update to this, I discovered that some folders that I thought I had deleted using ES File Manager are still showing up in USB storage when I'm hooked up to a computer. That is to say that what I see using a file manager versus what I see while connected to a computer are different.
Click to expand...
Click to collapse
For this, I read somewhere that the latest ES File app has a recycling bin for when you delete apps. So, that needs to be emptied too.
Sent from my Nexus 5X using Tapatalk
SlimSnoopOS said:
For this, I read somewhere that the latest ES File app has a recycling bin for when you delete apps. So, that needs to be emptied too.
Sent from my Nexus 5X using Tapatalk
Click to expand...
Click to collapse
I did indeed clean out the Recycle Bin (and subsequently disabled it), but the problem persists. But thanks for pointing that out!
OK, an interesting discovery:
If I am on my device and using ES File Explorer and if I am in the path /storage/emulated/0/* then I am unable to copy/move files and directories, as I've described above.
If I am on my device and using ES File Explorer and if I am in the path /sdcard/* then I am unable to copy/move files and directories, as I've described above.
If I am on my device and using ES File Explorer and if I am in the path /data/media/0/* then I am able to do anything I damn well please.
Now this makes a bit of sense to me, given the permissions for each directory. For example, when viewing the permissions of a file or folder when in /sdcard or /storage/emulated/0, I can only see the permissions as "Readable: Yes, Writeable: Yes", but I cannot change said permissions. However, when I view the permissions for something when under /data/media/0 then not only can I see the explicit permissions "rw-rw-r--" I can also change it if I wanted to.
I suspect this might be more than just the ROM. Perhaps I did not flash the system.img correctly when I first went through the process? Is this possible?

Marshmallow not reading /system/etc/hosts?

This is a weird one. I can't seem to get my T-Mobile One M8 running Marshmallow to use the entries in the hosts file.
First I rooted my phone and installed Adaway. Went through and made the sym link from /system/etc/hosts to /data/data/hosts, Adaway succeeded - but no ads were blocked. I opened both the raw file and the symlink in Root Explorer, and they looked fine, but pinging any of the entries went to the real server instead of 127.0.0.1.
So I tried more basic and put the stock /system/etc/hosts file back in place, then copied over StevenBlack's host file over it. Same result. It's like Marshmallow doesn't even give a crap that there's a hosts file there and refuses to load anything from it. I even verified it was saved in UNIX format via Notepad++.
For all the steps, I only made changes in TWRP after mounting the system rw, and the changes in the hosts files stayed after a reboot.
Any ideas? I'm really stumped.
Did you ever figure this out? I have the same issue...
Hi!
I've had the same problem on my M8s. Checked multiple times the permissions, file formatting and nothing worked. Then I've added a line
Code:
net.tethering.noprovisioning=true
to the /system/build.prop file and now hosts file is working as it should
Since I can't post links in my posts due to xda policy PM me if you need link to a full guide how to do this.
Spend long time to figure out why ad blocking doesn't work on mine HTC one. Thanks !

Categories

Resources