'Cordova Android: Can I get any information on underlying Java/HTTP exceptions

I have an Ionic/Cordova Android application that is deployed on various different client internal networks, where the application connects to a http service running on that internal network, using the Angular HTTP client.

Recently one of our clients finally upgraded from Android 5 to Android 12, and the application would no longer connect to the server, where they were using a self-signed HTTP certificate.

Following information here, we see the following:

The default configuration for apps targeting Android 6.0 (API level 23) and lower is as follows:

<base-config cleartextTrafficPermitted="true">
    <trust-anchors>
        <certificates src="system" />
        <certificates src="user" />
    </trust-anchors>
</base-config>

So I added this to the manifest file, ie in config.xml I added

<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
        <application android:networkSecurityConfig="@xml/network_security_config" />
  </edit-config>

And this solved the problem on that particular network.

I also tested this on my office using both http and https and all worked fine.

Now I have another client where they are not using certificates, just unsecured http (I also have android:usesCleartextTraffic="true"), and their connection no longer works. The Angular http client just returns status code 0. Whenever there are any weird issues with network, this is all I ever get, with absolutely no information as to what is wrong.

My question is, underneath, would there be any extra native (Java) exception information logged to any sort of application/system, log, where I could see what is going wrong here, as I have no idea and connect reproduce the problem (I cannot get to the server in question, is is behind a firewall in another country), so any diagnostics need to be run on a client's mobile device, so I cannot install any SDK, root the phone etc, turn on dev mode etc. I just want to see if there are any errors logged (as you could, for example on a Windows desktop event viewer).

Is there any way to get any extra information on what may be going with the HTTP call here?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source