X
X
xverizex2019-11-14 22:52:00
Android
xverizex, 2019-11-14 22:52:00

How to make root socket work on android?

I remembered a problem that somehow I could not solve for a long time. Right now I thought that maybe they would help me on the toaster. The problem is this. I wanted to track the network packets that are coming from the device. Later I made a console utility and installed it via adb and ran it and saw which programs are sending data. But still the problem remained. I made special permissions for a device like internet or something like that to make network functions available. I rooted the device and gave permission to one program that required root. And in the code I write like this.

int socket = socket ( AF_PACKET, SOCK_RAW, htons ( ETH_P_ALL ) );

But it returns an error, though I don't remember which one. But it seems that it is not allowed to use such a socket, but why? ROOT access is! I also don’t understand how they made a program that wakes up computers on a local network using, for example, a magic package. But to make such a package, you need access to the channel level like. Since in sleep mode only mac addresses of hosts are available. Please write, I'm very interested in how it all works. By the way, about waking up computers, root access is not required there, while I don’t understand how it makes up a package?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question