Modify file hosts - OnePlus 8T Questions & Answers

Hi to all, after root permission, I used Lucky Patcher to block ads, in the previous smartphone worked perfectly, but not in this one.. file hosts remains empty, and cannot copy paste an old copy he. Any ideas?

Feduz said:
Hi to all, after root permission, I used Lucky Patcher to block ads, in the previous smartphone worked perfectly, but not in this one.. file hosts remains empty, and cannot copy paste an old copy he. Any ideas?
Click to expand...
Click to collapse
Enable "Systemless hosts" in Magisk settings.

Related

[MOD] Enable / Disable AdBlock in your rooted ROM

This MOD is two files:
Enable Adblock Update File
Disable Adblock Update File
Download this two files to your SD card, apply (flash from recovery) first file if you need AdBlock, apply second if you don't need AdBlock. This files works at all rooted Android ROM's and phones, not only for Desire.
Source for AdBlock hosts file:
http://www.mvps.org/winhelp2002/hosts.txt
http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts
See also my B&W Theme for Desire :-D.
Thank you
Thanks, works like a charm!
this block adds in apps?
Works very good! Thank you!
pinkolin said:
This MOD is two files:
Enable Adblock Update File
Disable Adblock Update File
Download this two files to your SD card, apply (flash from recovery) first file if you need AdBlock, apply second if you don't need AdBlock. This files works at all rooted Android ROM's and phones, not only for Desire.
Source for AdBlock hosts file:
http://www.mvps.org/winhelp2002/hosts.txt
http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts
See also my B&W Theme for Desire :-D.
Click to expand...
Click to collapse
where do we put hosts.txt file?
pinkolin, there are extra lines at the end of the hosts file:
Code:
</pre>
</body>
</html>
I suppose they should not be there, even if they do not cause issues.
kmetek said:
where do we put hosts.txt file?
Click to expand...
Click to collapse
It's in /system/etc but if you flash the ZIP file above, it will put the file at the right place by itself.
Thank you
what is the difference between adblock and ad free? does one block website adverts and the other block adverts in apps, or do they do the same thing?
Another way to do it...
And with this solution you can use AdFree with no freeze :
With ROM Manager, reboot in clockworkmod recovery...
From your computer with adb in DOS mode (adb-windows.exe for me) do this :
> adb-windows.exe shell
you should have now a # prompt
# mount /system
# mount /data
# cd /system/etc/
# mv hosts /data/data/
# ln -s /data/data/hosts hosts
# cd /
# umount /data
# umount /system
Now you can reboot your system from Clockworkmod recovery menu
Install ADFree from the market, and it should work.
It worked well for me.
Use it at your own risk.
Just to explain what it does :
When phone is working the partition /system is in read only. ADFree tries to write in it, it crash.
The solution I give is the same as for bootanimation.zip
Move the file "hosts" from read-only file-system (/system) to a writable file-system (/data) and make a symbolic link to it in /system to fake it position.
Phone believes "hosts" is still in /system. and ADFree can write in it because it is in /data for real....
Thank you so much Orphee. This eventually fixed it for me after struggling for a couple of hours without success. Couldn't write hosts to system/etc/ while system running; couldn't get Droid explorer to mount files (device in recovery mode). Tried with Root Explorer and couldn't copy hosts to /system/etc/ due to 'file too large/not enough room' error. Tried with adb and again couldn't successfully copy hosts file. All very frustrating, and I wish I understood the problem better.
Anyway, your symbolic link solution finally cracked it, though I had to try twice. FIrst time Adfree stalled. Second time I ran 'Revert' first and it then it worked fine.
Hi there. I can't get this to flash. I get:
Code:
E:Failure at line 3:
copy_dir PACKAGE:system SYSTEM:
Installation aborted.
What now?
Orphee said:
Another way to do it......
Click to expand...
Click to collapse
Best explanation and instructions I've seen on this - thanks a lot!
hey guys,
I don;'t know if you already knew this but,
if i've installed adfree on my phone the application
pingchat! wont work anymore it cant get connected to the server
to send the messages :s and when i delete adfree it works normally...
I used the 'enable' zip, but my hosts file still cannot be changed. Using CM 6.0.2
Can this be applied from ClockworkMod recovery mode to a stock Froyo sense rooted phone that is odexed and s-on?
Also not answered is does it block website ads when in browser or/& ads that appear when running apps.
Anyone???
Edit: Worked like a charm! No more damm ads.
Thanks
Worked like a charm!!
carlos67 said:
Can this be applied from ClockworkMod recovery mode to a stock Froyo sense rooted phone that is odexed and s-on?
Also not answered is does it block website ads when in browser or/& ads that appear when running apps.
Anyone???
Click to expand...
Click to collapse
Yes it blocks the ads from apps & browser
Woah! Great! so, no ads when im playng Angry Birds!
Pure Calendar Widget (Agenda)
I use the "Pure Calendar Widget (Agenda)" from the market, after flashing the MOD and rebooting the widget fails to load my calendar. Have flashed the disable MOD and it's back to working as normal. Weird as its a paid app and there is no advertising in it.

[Q] Can you watch HULU from the G tab?

I tried and I got the unsupported platform message.
I could never get it to work but look here
http://forum.xda-developers.com/showthread.php?t=856318
Hulu Tips
The trick for getting Hulu working is to do these things:
1) Use Either Dolphin Browser or SkyFire
2) In the browser, Settings...set User Agent to "Desktop"
3) In Advanced Settings set Plugins to "Always On"(Default is "on demand"))
4) Install either the Adobe flash player hacked apk or hexedit the libflashplayer.so file yourself. I had issues using the hacked apk, I just hexedited my own on the PC and moved it over. Instruction and hacked apk in first post of this thread: http://forum.xda-developers.com/showthread.php?t=856318&highlight=hulu
5) Install AdFree from the marketplace
6) Delete/Rename the Host file in /system/etc (TNT Lite Builds)
7) Start AdFree, it will want to create the Host file. If it exists when you run it, it will hang and not complete the installation.
8) When AdFree comes up there is an option to "Revert" click this button to allow ads, Hulu needs this to work.
9) Reboot to clear the host cache.
10) Turn back on AdFree Host file restrictions if you like after you're done with the Hulu Goodness! Enjoy!
rooted?
Is there anything special that needs to be done in order to delete "system/etc/hosts" file? I am running TNT lite 2.4 with Cwm, and/\ have had superuser capabilities for everything else, I'm assuming it's not root related?
I did it - I can see the video but when clicked after waiting for a while to run I'm getting the "unfortunately Hulu is not supported on your platform...
Well it works, sort of. It played real nice until it reached a commercial. Then it paused for a few seconds and Dolphin crashed. Tried again and had no sound. Re-booted, tried again and it worked again. Haven't watched long enough to see if it crashes at the commercials again.
Full screen sort of worked. Had to disable the popup blocker in Dolphin. Then it played for a few seconds until the video froze. Still had sound, but frozen video.
I wish there was something not as touchy as flash too...
Update.. Made it past the commercials this time. Seems pretty touchy but it works...
thaigai - you can use root explorer to delete the hosts file. All the firmware distros get you to root. You will need root in order to access the /system/etc and the /data/data/com.adobe.flashplayer/lib directories.
jcarlospr - Unfortunately.... message is usually caused by either the User Agent is not set to "Desktop" or your libflashplayer.so is not set correctly.
Download this file, unzip it, and use Root Explorer to copy it into the /data/data/com.adobe.flashplayer/lib directory
http://www.megaupload.com/?d=K4C7N34D
You can use this with both the Folio 100 Adobe Flash apk and the GLES Optimized Flash apk. The GLES Optimized is linked in Roebeet's TNT Lite Thread - http://forum.xda-developers.com/showthread.php?t=842004
Copy the libflashplayer.so file after installing the Adobe Flash Player apk.
dkhilo said:
thaigai - you can use root explorer to delete the hosts file
jcarlospr - Unfortunately.... message is usually caused by either the User Agent is not set to "Desktop" or your libflashplayer.so is not set correctly.
Download this file, unzip it, and use Root Explorer to copy it into the /data/data/com.adobe.flashplayer/lib directory
http://www.megaupload.com/?d=K4C7N34D
You can use this with both the Folio 100 Adobe Flash apk and the GLES Optimized Flash apk. The GLES Optimized is linked in Roebeet's TNT Lite Thread - http://forum.xda-developers.com/showthread.php?t=842004
Copy the libflashplayer.so file after installing the Adobe Flash Player apk.
Click to expand...
Click to collapse
No luck!!!
But I also notice that I didn't have the /data/data/com.adobe.flashplayer/lib directory - so I create it myself - is that right??
jcarlospr said:
No luck!!!
But I also notice that I didn't have the /data/data/com.adobe.flashplayer/lib directory - so I create it myself - is that right??
Click to expand...
Click to collapse
That doesn't sound right. Try uninstalling your flash player and reinstalling with the new GLES optimized Flash apk, then copy the libflashplayer.so file. Like I mentioned I had issues with the hacked apk.
dkhilo said:
That doesn't sound right. Try uninstalling your flash player and reinstalling with the new GLES optimized Flash apk, then copy the libflashplayer.so file. Like I mentioned I had issues with the hacked apk.
Click to expand...
Click to collapse
Ok, This is what I did
1. Re-downloaded Adobe Flash Player 10.1.12.1 from http://forum.xda-developers.com/showthread.php?t=842004
2. Went to settings/Applications/downloaded applications and uninstall the Adobe Flash Palyer 10.1
3. Using ES File Explorer I put the adobe flash player 10.1.120.1.apk
4. Went to the data/data/com.adobe.flashplayer/lib/ I renamed the libflashplayer.so that I got from http://www.megaupload.com/?d=K4C7N34D
5. Using the app App Installer I install the apk from step 3
6. Turn off the table after reboot I went back to the data/data/com.adobe.flashplayer/lib/ and rename back the file.
7. Went to hulu using skyfire (first, I verified that the option selected by default is desktop).
8. I selected a video from hulu and after 30 seconds I got the unsupported message.
Something else, I created data/data/com.adobe.flashplayer/lib/ directory because it was not there.
I am using TnT Lite V2.2.0
jcarlospr said:
Ok, This is what I did
1. Re-downloaded Adobe Flash Player 10.1.12.1 from http://forum.xda-developers.com/showthread.php?t=842004
2. Went to settings/Applications/downloaded applications and uninstall the Adobe Flash Palyer 10.1
3. Using ES File Explorer I put the adobe flash player 10.1.120.1.apk
4. Went to the data/data/com.adobe.flashplayer/lib/ I renamed the libflashplayer.so that I got from http://www.megaupload.com/?d=K4C7N34D
5. Using the app App Installer I install the apk from step 3
6. Turn off the table after reboot I went back to the data/data/com.adobe.flashplayer/lib/ and rename back the file.
7. Went to hulu using skyfire (first, I verified that the option selected by default is desktop).
8. I selected a video from hulu and after 30 seconds I got the unsupported message.
Something else, I created data/data/com.adobe.flashplayer/lib/ directory because it was not there.
I am using TnT Lite V2.2.0
Click to expand...
Click to collapse
I don't see where you are doing the adfree part. I got it to work using the Flash apk that was already modded without having to play with the lib file.
My bad - for some reason is not letting me to delete the host file or even rename it and I don't have anything else open - I tried right after turning on the tablet
jcarlospr said:
My bad - for some reason is not letting me to delete the host file or even rename it and I don't have anything else open - I tried right after turning on the tablet
Click to expand...
Click to collapse
Are you trying to delete the host file with something like androot, or root explorer? The folder has to be set to read/write or it won't let you change it.
thaigai said:
Is there anything special that needs to be done in order to delete "system/etc/hosts" file? I am running TNT lite 2.4 with Cwm, and/\ have had superuser capabilities for everything else, I'm assuming it's not root related?
Click to expand...
Click to collapse
Folder has to be set to read/write with something like root explorer.
dkhilo said:
The trick for getting Hulu working is to do these things:
1) Use Either Dolphin Browser or SkyFire
2) In the browser, Settings...set User Agent to "Desktop"
3) In Advanced Settings set Plugins to "Always On"(Default is "on demand"))
4) Install either the Adobe flash player hacked apk or hexedit the libflashplayer.so file yourself. I had issues using the hacked apk, I just hexedited my own on the PC and moved it over. Instruction and hacked apk in first post of this thread: http://forum.xda-developers.com/showthread.php?t=856318&highlight=hulu
5) Install AdFree from the marketplace
6) Delete/Rename the Host file in /system/etc (TNT Lite Builds)
7) Start AdFree, it will want to create the Host file. If it exists when you run it, it will hang and not complete the installation.
8) When AdFree comes up there is an option to "Revert" click this button to allow ads, Hulu needs this to work.
9) Reboot to clear the host cache.
10) Turn back on AdFree Host file restrictions if you like after you're done with the Hulu Goodness! Enjoy!
Click to expand...
Click to collapse
Is this in general for most devices?
Sent from my HTC HD2 using XDA App
ceo4eva said:
Is this in general for most devices?
Sent from my HTC HD2 using XDA App
Click to expand...
Click to collapse
The hack original came form those that discovered it on the Nexus One Phones(rcgabriel thx for correction). It just edits what Adobe Flash Reports to the website the client using it, in this case it reports WIN instead of AND. So, I believe it would work for all mobile devices as long as they use a libflashplayer.so file as well. You might want to hexedit your particular libflashplayer.so file since it may be different from the one posted here. This apk is specific to the tegra2 devices.
jcarlospr said:
My bad - for some reason is not letting me to delete the host file or even rename it and I don't have anything else open - I tried right after turning on the tablet
Click to expand...
Click to collapse
Also make sure your firewall is not doing some kind of ad blocking either. Some firewalls like Untangle have a ad blocker or if you use OpenDNS, you might have problems also if you have the restrictions to block the ad sites. Anything that blocks ads might prevent hulu from showing you the video.
Strangely enough, I needed to delete the host in order to have the AdFree even get to the point where it gives me the option to "revert" or load the updated hosts file. I'm not sure if the hosts file itself was blocking things, or the hosts file had some permissions preventing AdFree from modifying it. Either way, using Root Explorer after making sure the directory is R/W and not R/O is probably the easiest route for deleting this file.
dkhilo said:
Also make sure your firewall is not doing some kind of ad blocking either. Some firewalls like Untangle have a ad blocker or if you use OpenDNS, you might have problems also if you have the restrictions to block the ad sites. Anything that blocks ads might prevent hulu from showing you the video.
Strangely enough, I needed to delete the host in order to have the AdFree even get to the point where it gives me the option to "revert" or load the updated hosts file. I'm not sure if the hosts file itself was blocking things, or the hosts file had some permissions preventing AdFree from modifying it. Either way, using Root Explorer after making sure the directory is R/W and not R/O is probably the easiest route for deleting this file.
Click to expand...
Click to collapse
How I switch from r/o to r/w?
dkhilo said:
The hack original came form those that discovered it on the Galaxy S Phones. It just edits what Adobe Flash Reports to the website the client using it, in this case it reports WIN instead of AND. So, I believe it would work for all mobile devices as long as they use a libflashplayer.so file as well. You might want to hexedit your particular libflashplayer.so file since it may be different from the one posted here. This apk is specific to the tegra2 devices.
Click to expand...
Click to collapse
Minor historical correction - the hack originally came from the Nexus One forums. http://forum.xda-developers.com/showthread.php?t=687842&page=3
Fancast works great without all the BS, hulu is a waste of time.

Why does Adaway not work with su folder in bin folder?

So I setup my phone and had Adaway working fine. Then, in order to get Secure Settings to work with a systemless root, I had to add a folder called su in my system/bin directory. When I do that, Adaway immediately stops working and says it does not detect root, basically. See attached screenshot. Why does this happen by adding that empty folder? Has anyone found a way to get Adaway and Secure Settings to coexist on their Pixel?
You don't want to add a folder called su but rather a blank file called su. Ran into this same problem before and this fixed it.
tacofart said:
You don't want to add a folder called su but rather a blank file called su. Ran into this same problem before and this fixed it.
Click to expand...
Click to collapse
I just tried this and now neither work. How did you make the blank file and did you put it in the root of the system/bin folder?
PsiPhiDan said:
I just tried this and now neither work. How did you make the blank file and did you put it in the root of the system/bin folder?
Click to expand...
Click to collapse
I did it with Solid Explorer but you should be able to do it with any root file explorer. navigate to /bin. Delete the su folder. then press new and create a new file named su. Restart. After I did that, I haven't had any issues with SS, adawy or any other root apps working
tacofart said:
I did it with Solid Explorer but you should be able to do it with any root file explorer. navigate to /bin. Delete the su folder. then press new and create a new file named su. Restart. After I did that, I haven't had any issues with SS, adawy or any other root apps working
Click to expand...
Click to collapse
Thank you so much! The reboot was all I was forgetting. It all works now! ?
PsiPhiDan said:
Thank you so much! The reboot was all I was forgetting. It all works now! ?
Click to expand...
Click to collapse
Awesome, glad it worked out!

I'm rooted, trying to install Xposed Framework, how do I delete a file from /system/?

I tried installing it with both Flashify and Magisk, but both methods failed.
When I tried installing it via the included Xposed Installer, it also failed, but gave me the message:
> Error: Xposed_Framework.jar already exists in /system/framework
I'm guessing a previous installation failed, but left the file there.
My next idea is to delete that file from /system/framework and try again, but since it's in an RO directory I don't have permission.
I tried using a terminal emulator to mount the drive in rw mode, and also tried using a root file explorer, but either both methods don't work, or I just couldn't figure it out.
Anyone have an idea of how to remove or rename that file so I can try to install the .zip ?
-Thanks
Highfiverobot said:
I tried installing it with both Flashify and Magisk, but both methods failed.
When I tried installing it via the included Xposed Installer, it also failed, but gave me the message:
> Error: Xposed_Framework.jar already exists in /system/framework
I'm guessing a previous installation failed, but left the file there.
My next idea is to delete that file from /system/framework and try again, but since it's in an RO directory I don't have permission.
I tried using a terminal emulator to mount the drive in rw mode, and also tried using a root file explorer, but either both methods don't work, or I just couldn't figure it out.
Anyone have an idea of how to remove or rename that file so I can try to install the .zip ?
-Thanks
Click to expand...
Click to collapse
In the Xposed app you should be able to just run the uninstaller script. If that doesn't work, boot TRWP and delete it from there.
D3RP_ said:
In the Xposed app you should be able to just run the uninstaller script. If that doesn't work, boot TRWP and delete it from there.
Click to expand...
Click to collapse
Unfortunately, the uninstaller also fails.
It says it can't remove that file from a read only directory..
Highfiverobot said:
Unfortunately, the uninstaller also fails.
It says it can't remove that file from a read only directory..
Click to expand...
Click to collapse
flash installer or uninstaller through TWRP
wmcdrugs said:
flash installer or uninstaller through TWRP
Click to expand...
Click to collapse
Root Explorer....
This app does wonders, it allows you to modify directories in /system and other root folders. You can even change permissions of specific folders/files from read/write/read-only....etc. I've had this app since the earliest of android days and it has been my go to file explorer. Root Explorer of course requires root....but it completely unlocks your phone and allows you to modify any system file that is set to any permission. Of course there are other file explorers that allow you to modify system files, but this is the one that i have the most experience with. You should be able to access the system folder where the Xposed file remains and modify it so it can fix your problem.
djer34 said:
Root Explorer....
This app does wonders, it allows you to modify directories in /system and other root folders. You can even change permissions of specific folders/files from read/write/read-only....etc. I've had this app since the earliest of android days and it has been my go to file explorer. Root Explorer of course requires root....but it completely unlocks your phone and allows you to modify and system file that is set to any permission. Of course there are other file explorers that allow you to modify system files, but this is the one that i have the most experience with. You should be able to access the system folder where the Xposed file remains and modify it so it can fix your problem.
Click to expand...
Click to collapse
This!. I've used it for years. Not muss no fuss. It's not bloated like a certain couple others I know of. It just does what it does and does it well. Manages files. No extra garbage.Give it a try. I'd be surprised if you can't delete it with Root Explorer. If you do try it, go to the folder you want to delete the file from. Once in there, look at the top right of the screen. Somewhere up there It will say MOUNT R/W. Touch that and you should be able to do whatever you want to within that folder.
Do you have the magisk DNSCrypt module installed? If so, thats why you cant modify anything in /system. Not sure why or how it breaks it, but it does. Took me for ever to figure out what was causing it. Now that i removed the module, i can modify anything i want again.
Sent from my [device_name] using XDA-Developers Legacy app

I Can't Get Root Back

I have a Motorola Edge (regular not +) running LineageOS 17.1 (20210528). I had it rooted and decided I wanted to use the hosts file for ad blocking. I couldn't figure out how to get the OS to allow me to modify the host file. While I was doing so, I some how corrupted to OS and couldn't boot into it. That was easily fixed by flashing the the OS, but now I can't get root back. When I reboot after I flash the patched boot.img (to both partitions), I get "Can't load Android system. Your data maybe corrupt..." (This happens when I try to boot into both partitions). Before I see the error message, it goes into a bootloop.
I'd also like to know how to modify the hosts file.
Thanks
Heat84 said:
I'd also like to know how to modify the hosts file.
Click to expand...
Click to collapse
Once phone is rooted
1. You mount Android's directory /system/etc as RW
2. Pull out the hosts file what is located therein to PC
3. Edit the hosts file according to your needs
4. Make sure hosts file gets saved in UNIX-file format
5. Push back the hosts file to Android's /system/etc directory
6. Make hosts file RW
Thanks. Any clue about the rooting problem?
I forgot to mention that I patched boot.img with Magisk.
TWRP has a file system repair function. Does that have anything to do with this?

Categories

Resources