How to modify hosts file?
Posted: 29 Sep 2020 23:47
I want to apply a certain hosts file (that I have on my SD card) when I open a particular app, and restore the original hosts file on exit.
I thought Automagic would be the perfect tool to do it.
My idea was:
App launch -> Copy/rename /etc/hosts to /etc/hosts1 -> Copy /emulated/0/my-hosts to /etc/hosts
App exit -> Rename /etc/hosts1 back to /etc/hosts
I tried using "Move files" hoping to rename /etc/hosts to /etc/hosts1 but it didn't even work (/etc/hosts1: open failed: EROFS (Read-only file system))
Could someone help me please?
(I found this Tasker task that seems to modify hosts file but couldn't find an Automagic one https://forum.xda-developers.com/u/task ... e-t3659602)
I thought Automagic would be the perfect tool to do it.
My idea was:
App launch -> Copy/rename /etc/hosts to /etc/hosts1 -> Copy /emulated/0/my-hosts to /etc/hosts
App exit -> Rename /etc/hosts1 back to /etc/hosts
I tried using "Move files" hoping to rename /etc/hosts to /etc/hosts1 but it didn't even work (/etc/hosts1: open failed: EROFS (Read-only file system))
Could someone help me please?
(I found this Tasker task that seems to modify hosts file but couldn't find an Automagic one https://forum.xda-developers.com/u/task ... e-t3659602)