[Q] Hosts file help! - Android Software Development

Hey guys,
I am working on an app that edits host files.. would this require root? And what is the proper format for entering a new domain into the host file? All help appreciated!
Thanks guys!

hazard96 said:
Hey guys,
I am working on an app that edits host files.. would this require root? And what is the proper format for entering a new domain into the host file? All help appreciated!
Thanks guys!
Click to expand...
Click to collapse
nope , no need to root again. as for the format. you'd better refer to http://m.myweb.localhost
i am not sure this could help you, but i wish.

Thank you!

The hosts file resides on the system partition and most (all?) un-rooted androids will NOT have read/write access to anthing on the system partition.
Surviveland, what are you basing that on? (and your link fails to load)

Gene Poole,you r right , need to root. as for the format , can you be more specific?

Like, if I didn't want my phone to access Facebook. How would I put that into my host file? And is there anyway of blocking access to a website without root?

hazard96 said:
Like, if I didn't want my phone to access Facebook. How would I put that into my host file? And is there anyway of blocking access to a website without root?
Click to expand...
Click to collapse
if you don't know how to write code, i suggest you use add-ons to do it for you, such as, AdFree Android,CacheMate,Root Explorer and so on .
the format is txt file .

Related

[Q] Replacing build.prop?

hi!
in order to test something, i need to replace the build.prop in root/system with a modified one. but trying to delete this file with astro manager displays an error message, and just copying the modified build.prop over the old one doesn't work too (nothing happens).
so my question is: how do you replace such a file?
thanks in advance for your help
are you serious!?!?!?
If the build.prop is located on the Android folder IT HAS TO BE A SYSTEM FILE !!!
if you mod the system files you could break android or the system just won't let you do it, you will need R and W privileges to do that.
edit the system files from your PC or just boot up in to windows mobile.
use some common scene next time.
hope it helps!
Sent from my HTC HD2 using XDA App
Do you use a cyanogen build?
yes and there is already a cyanogen rom posted with the proper build.prop fixed, so you won't have to edit anything, just search for it.
Sent from my HTC HD2 using XDA App
mmmh actually cyanogen made things easy to replace a system file, just copy your file into sdcard/android/root/system and reboot.
thanks for your help / posts. but unfortunately they're not helpful.
yes, i am serious! and yes, of course it's a system file. i know as well that modification might brick android.
there are reasons for modifying this file. some people seem to be able to, e.g. for chaning screen point density or modify the data passthrough.
so, please tell me, how can i edit/modify a system file from pc or windows mobile when its within the data.img-file?
thanks for any tips / hints on this.
use root explorer
Sichroteph said:
mmmh actually cyanogen made things easy to replace a system file, just copy your file into sdcard/android/root/system and reboot.
Click to expand...
Click to collapse
Thank you VERY much for your help - I finally got it to work by listening your instructions. It is simply different if you have HD2 and plus CM mod. That figures why it was going back all the time to 180 instead of changing it - because it runs from sd card and that's where it needs to be replaced as well ...
Droid Explorer

WebView help needed

Hi guys and gals I am having a issue with my app I'm making. The app uses webview to load a special web page to let a user download files mostly .pkg files but some zip files and exe's as well. I have the app built and it loads the website url I need it to but when I click on a file to download it to the storage card it does nothing at all. I know I need to do something with the DownloadListener I'm just not sure what or how. The snippets of code I have found on the net to try to understand it has not worked. I have given permission to the net and SD card in the manifest file. Any help with this would be great Thanks
p.s. for some reason it wont let me post my code. if anyone can help + rep for you
No one on this? ok well I know I need to set up a downloadlistener but I am unsure how to do this everything I have found is only to force media to be played somewhere but I need to just make it download the file to the root of the sdcard. any help even to a good tutorial or link with a code snippet for a different file type that i could modify to work would be very helpful

[Q] Fix DNS Facebook, we need an developer to help

Hi everybody.
I'm come from Vietnam, where the Facebook is now banned.
We need someone to write a program to update the host file in /system/etc/ by just a touch.
Please copy the IP from http://armabloggin.com/2009/07/facebook-dns-block-fix/
to the host file (like AdFree program).
We cannot edit this file by Astro because it read-only. We don't know how to S-OFF our Android.
Thank you so much.
I thought that AdFree is for rooted phones only.
Here's the host file
I've modified the host file for you but I don't think you can get much further until you root your phone, giving yourself access to system/etc/ where the "hosts" file is for replacement.
Remove the .txt extension and replace it with your hosts file in /system/etc/ after rooting.
If your phone cannot be rooted at http://unrevoked.com/ have a look on the sub forum here for your phone.
As previously stated, changing any system file is impossible without root.
Why can't you use a one-click-rooting program? There are plenty around that work for quite a lot of phones. If that doesn't work there will be device specific guides available, unless it's a phone that can't be rooted (is there any?).
Sorry, I've already root the HTC Desire by Unrevoked.com and have RA-recovery.
I mean that I don't have S-OFF in my device.
I also used Astro to copy the host file to SD Card and edited it. But I cannot replace the host file to system/etc/.
So I need you help write a mini-soft like AdFree.
Have you tried using adb to push the hosts file (in recovery) or root explorer? No need to S-OFF.
I think a soft will easy to use for everyone, don't need experiment in adb, root or s-off.
Anyone developer can make it easy?
Sent from my HTC Desire using Tapatalk
I think the problem is that you didn't mounted the system partition. Try ES FileExplorer, it can work as root and can mount partitions
Sent from my GT-I5700 using XDA Premium App
Hi,I am vietnamese too,if you can't root your phone you can follow the full instruction on tinhte.vn forum.
I whipped this up for you.
It doesn't look great but it does the job. Put the 'hosts' file on your sdcard (not in any folder) that you want to move and rename it 'hosts.txt'. Then run the app and press the button. You'll probably need to reboot afterwards.
Enjoy.
This doesn't back up the hosts file on your phone so you may want to do that manually.
[YOU NEED ROOT ACCESS]
Thank you so much.
Meltus said:
I whipped this up for you.
It doesn't look great but it does the job. Put the 'hosts' file on your sdcard (not in any folder) that you want to move and rename it 'hosts.txt'. Then run the app and press the button. You'll probably need to reboot afterwards.
Enjoy.
This doesn't back up the hosts file on your phone so you may want to do that manually.
[YOU NEED ROOT ACCESS]
Click to expand...
Click to collapse
Dear Meltus,
Firstly, I thank you very much to write this apk for me. You're so kind.
But it's maybe something wrong!
I install your apk, put the hosts.txt in SDCard (in the root, not in any folder).
Then run the app and press the button, reboot afterwards.
I used Astro to view the hosts file. But this file is error. It has 0 byte and can be read.
Please fix it. Thank you so much, again.
P/S: Maybe you make an options to chose folder of hosts file.
Further, you can develop this apk to change any file of system by chose the source and destiny paths.

[Q] /mnt/.lfs cleared

Help, I have in my samsung galaxy y accidentally deleted the contents of /mnt/.lfs because I wanted to replace in logo.jpeg via android commander, but then when it was rejected, the whole content has been deleted.
Now I do not dare turn off my galaxy y.
(luckily I still have a backup on my computer from the content)
[Q] How can I restore the content without flash with odin / heimdall
Thanks in advance
superboom said:
Help, I have in my samsung galaxy y accidentally deleted the contents of /mnt/.lfs because I wanted to replace in logo.jpeg via android commander, but then when it was rejected, the whole content has been deleted.
Now I do not dare turn off my galaxy y.
(luckily I still have a backup on my computer from the content)
[Q] How can I restore the content without flash with odin / heimdall
Thanks in advance
Click to expand...
Click to collapse
you can try to push the contents from a custom or stock rom
deathnotice01 said:
you can try to push the contents from a custom or stock rom
Click to expand...
Click to collapse
i have a backup from content, but with root explorer with root i cant copy it (failed)
superboom said:
i have a backup from content, but with root explorer with root i cant copy it (failed)
Click to expand...
Click to collapse
try Android Debugging Bridge- adb push command,
or airdroid via wireless
@deathnotice: do you know what .lfs content is?
1. I can't with adb (doesnt know the mount command) (pessimisions denied)
2. I know the content, i've the backup on my mashine
kurotsugi said:
@deathnotice: do you know what .lfs content is?
Click to expand...
Click to collapse
correct me if im wrong but based in my observations,
it is the bootscreen or recovery?
i was asking him...not you
his advice are lil bit vague. it seems that he didn't know what is it. well...no one ever messed up their .lfs partition before. no one could help you with any workin advices. as far as I know the partition is non-modifiable. is it the content gone or the lfs folder gone?
EDIT:
correct me if im wrong but based in my observations,
it is the bootscreen or recovery?
Click to expand...
Click to collapse
if you already know what it is, then you should remember that part was stored inside the kernel ramdisk and cannot modified by any means except kernel customization. sorry, but it's a lil bit unpleasant to see such random advice like above one.
kurotsugi said:
i was asking him...not you
his advice are lil bit vague. it seems that he didn't know what is it. well...no one ever messed up their .lfs partition before. no one could help you with any workin advices. as far as I know the partition is non-modifiable. is it the content gone or the lfs folder gone?
EDIT:
if you already know what it is, then you should remember that part was stored inside the kernel ramdisk and cannot modified by any means except kernel customization. sorry, but it's a lil bit unpleasant to see such random advice like above one.
Click to expand...
Click to collapse
sorry but my knowledge in linux based systems is limited,
and how can a partition which enables deletion of files not able to restore files in the same partition,
at least that's what i know,
can a installation of a kernel work?
out of something random i think LFS means linux-from-scratch?
deathnotice01 said:
correct me if im wrong but based in my observations,
it is the bootscreen or recovery?
Click to expand...
Click to collapse
bootscreen
EDIT:
Airdroid says the .lfs folder is gone...
Root explorer lite says, the content is gone but it says it modifited on Jan 01, 1970 01:00:00 AM (Y2K bug?)
EDIT2: Can I entry the Download mode when the jigusb_dl_flag was in .lfs?
well...if we didn't have the knowledge to answer a question, it will be better if we didn't answer that. or else, he will confused by our answer or make us looks stupid. honestly, I didn't even know what lfs partition is. it seems that you know it better than me (lol).
back to the topic...I don't know what it is but lfs partition is locked and cannot modified without certain program. that's what they told to me about our device hidden partition. if the folder is gone, it could be simply accidentally unmounted. after reboot you'll get it again under /mnt
kurotsugi said:
well...if we didn't have the knowledge to answer a question, it will be better if we didn't answer that. or else, he will confused by our answer or make us looks stupid. honestly, I didn't even know what lfs partition is. it seems that you know it better than me (lol).
back to the topic...I don't know what it is but lfs partition is locked and cannot modified without certain program. that's what they told to me about our device hidden partition. if the folder is gone, it could be simply accidentally unmounted. after reboot you'll get it again under /mnt
Click to expand...
Click to collapse
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
THANKS!!
It works!!!
Reboot your phone. Then go to root explorer then it goes ba k because it is from kernel not frm phone.
Hello
When you try to modify that partition...all images will be gone....
As sir kurotsugi said its kernel issue....
Just reboot your phone you will see all the files again
You have to reboot your phone to see those files again
Globally recognised and certified NOOB
Simple answers..
Someone with knowledge on kernel hack that part and u already know who is the person..
Only change kernel or change hacking file with original (on kernel of course) can solve the problem..

Access Root files without having to root?

So I want to access the root files under /data/data/~ and modify the files to my liking (delete/rename/etc), is that possible? I've tried a number of file explorers and they don't even let me view the files that are in it, let alone modify them.
SnipeySnake said:
So I want to access the root files under /data/data/~ and modify the files to my liking (delete/rename/etc), is that possible? I've tried a number of file explorers and they don't even let me view the files that are in it, let alone modify them.
Click to expand...
Click to collapse
As far as I know you cannot access root files and/or modify them without rooting your device.
DiMilo said:
As far as I know you cannot access root files and/or modify them without rooting your device.
Click to expand...
Click to collapse
Even having a KNOX license won't work?
SnipeySnake said:
Even having a KNOX license won't work?
Click to expand...
Click to collapse
I don't really know about Knox licence but my guess is that since file management and access isn't just Knox's matter in the first place but rather the whole android's system matter you won't be able to access sensitive files even if you have that license.
But anyway that is just my guess.

Categories

Resources