Intercept android network traffic (firebase calls)

1k Views Asked by At

I need to intercep firebase requests from an android app.

I tried HTTP Toolkit, but it doesn't track firebase requests.

2

There are 2 best solutions below

0
On

com.google.firebase.FirebaseException: An internal error has occurred. [ java.security.cert.CertPathValidatorException:Trust anchor for certification path not found. ]

This is how I solved the error I mentioned above.

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
  <domain-config cleartextTrafficPermitted="true">
    <domain includeSubdomains="true">example.com</domain>
  </domain-config>
</network-security-config>


<application
        android:name=".example"
        android:networkSecurityConfig="@xml/network_security_config"
</application>
2
On

You can use PCACDroid. It offers an Android VPNService to be able to intercept any network traffic. As proxy to record TLS encrypted traffic you can use MitmProxy.

Starting with Android 7 user defined CAs for MITM solution are not working anymore easily. Take a look at tls decryption or how to tweak your application to use a NetworkSecurityConfig

You could also just use an older device if you have one. This simplifies the process a lot.