Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Able to intercept network traffic on emulators #100

Open
gnair03 opened this issue Aug 10, 2023 · 5 comments
Open

Able to intercept network traffic on emulators #100

gnair03 opened this issue Aug 10, 2023 · 5 comments

Comments

@gnair03
Copy link

gnair03 commented Aug 10, 2023

Hi,
I am using version 1.1.1 of appmattus/certificateTransparency in my android app. In the onCreate of my application class, I add this interceptor as follows:

private void addCertificateTransparency() {
        OkHttpClientProvider.setOkHttpClientFactory(new CertificateTransparencyInterceptorFactory());
    }

class CertificateTransparencyInterceptorFactory : OkHttpClientFactory {
    override fun createNewNetworkModuleClient(): OkHttpClient {
        val interceptor = certificateTransparencyInterceptor {
            +"abc.com"
            +"api.xyz.com"
        }

        return OkHttpClientProvider.createClientBuilder()
            .addNetworkInterceptor(interceptor)
            .build()
    }
}

On the release apks, when I use a network interceptor tool (like HttpToolkit/Charles), I find that the network calls are intercepted on emulators. But they are not intercepted on real devices. This interception on emulators also should not happen with Certificate transparency, right?

More info:
I have also added a network security.xml file for the release variant, that adds trust anchors as follows:

<trust-anchors>
          <certificates src="system" />
</trust-anchors>

Am I doing anything wrong here or is any part of setup incomplete? Why am I able to intercept network calls on my emulator? And how do I fix this? Please help here.

@gnair03
Copy link
Author

gnair03 commented Aug 11, 2023

@mattmook : Any help here?

@gnair03
Copy link
Author

gnair03 commented Aug 11, 2023

@mattmook -
I am not able to intercept network traffic on emulators that have Google Play store installed
But i am able to intercept network traffic on emulators that dont have Google play store

Pls help here.

@gnair03
Copy link
Author

gnair03 commented Aug 14, 2023

@mattmook - Any help here pls!

@sangcx5
Copy link

sangcx5 commented Feb 19, 2024

@gnair03 how do you intercept network traffic?

@gnair03
Copy link
Author

gnair03 commented Feb 19, 2024

Using tools like Charles, Http Toolkit, burpsuite etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants