I'm trying to find resources or library which could permit me to capture the traffic of all the network packets of a device programmatically either it be from wifi or mobile network. I believe there no need to be root to be in this promiscuous mode as shark for root would request because there is this app on the play store which can capture all network traffic (even decrypt SSL with MITM) without needing to be root. I simply cannot figure out how to do the same.
My question is: How did this app achieve this capture? What API did they use?
Thank you for your help.