I open a socket and track network calls in the Android application. Currently, I can view the hostname and IP address of the coming network traffic using the DatagramPacket
class. Is it possible to get the application id
or package name
using it? Or is it possible to get the application ID
or package name
from IPPacket in DNSResolver?
Track application id or package name using DatagramPacket in android
60 views Asked by FaaiqKhan At
1
After a long search and reading documentation of Android related to networks, I found the solution to get the application ID that the OS assigns. Through this ID it's possible to find the network packet's source. It's not possible to get the package name through
DatagramPacket
or any network calls.The ID is an integer before comparing the ID it's important to get the application ID which was assigned by the OS using
PackageManager
.Protocol TCP = 6 UDP = 17