I need some pretty thorough guidance on a project I've been tasked with. I guess ideally I am looking for either a tutorial (or set of tutorials), or else a working, self-contained, open-source codebase for an Android app that can filter all incoming internet traffic on the Android device based on keywords.
In particular, the app will stop incoming HTTPS traffic for any given web request if the requested URL or webpage (not just the domain) has certain keywords in the HTML or the URL. If a request does not have the keywords, it will be allowed through and the device will function normally. If it is not an HTML or TXT request -- if there is no text to analyze except the URL -- then it will look for keywords in the full URL alone.
By self-contained, what I mean is that it should not require a remote proxy server or remote VPN.
I have searched Google for such a thing. I've searched in GitHub.
I've seen plenty of tutorials for setting up a local proxy or VPN... all point-and-click kinds of tutorials. I need something programmatic.
I've found libraries that supposedly allow you to set up a proxy from inside an Android app, but their documentation is too cryptic and there are no step-by-step examples for them, so I can never make them work.
I've found a few open-source apps that do some of this, but aren't quite what I'm looking for. Nothing that really does what I need it to. I've tried to alter the apps that I've found to turn them into what I want, but my knowledge is so limited and the missing pieces are always too numerous.
I've been working on this for months. Sad, I know.
Can anyone point me to a fairly thorough tutorial (or a set of tutorials) that will help me to build such an app? Or, can anyone point me to an existing open-source app like what I'm looking for? Or even something that comes pretty close?
FWIW, giving me broad advice like "you need to set up a local VPN and a local proxy, with a certificate, and then use the proxy to filter traffic" won't be of any help to me. I already know the broad outline of what I should probably do. I just can't figure out how to do it, and can't find any good resources for guidance! Which is why I'm here...
Thanks in advance!