While recently working on integrating data from the Thorton's fuel app in Home Assistant I wanted to use mitmproxy to monitor the traffic between the app and their API to be able to retrieve some data from it.

My first step was to setup mitmproxy - which is an amazing tool - in order to capture this data but quickly hit the issue of the Thorton's app not accepting user supplied CA certificates unless specifically configured to do so.

Thankfully there is this awesome tool apk-mitm which is a wrapper around another great tool apktool which can automatically patch an APK to enable this setting.

Once you have the patched APK you just install that, fire up mitmproxy and you are good to go!