We develop an application with Cordova and Ionic 3, and after updating a new version of our app into the Play Store we got the following warning.
Here follows a screenshot of the warning:
We use as environment:
cordova-android: 7.1.4
cordova-cli: 8.0.0
ionic: 3.20.0
Only related code I found was in the file SystemWebViewClient.java under cordova engine, which we can’t really alter and have never altered, since it’s under the generated folder platforms/android/CordovaLib/src/org/apache/cordova/engine/ .
And this is the code that can be found:
/**
* Notify the host application that an SSL error occurred while loading a resource.
* The host application must call either handler.cancel() or handler.proceed().
* Note that the decision may be retained for use in response to future SSL errors.
* The default behavior is to cancel the load.
*
* @param view The WebView that is initiating the callback.
* @param handler An SslErrorHandler object that will handle the user's response.
* @param error The SSL error object.
*/
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
final String packageName = parentEngine.cordova.getActivity().getPackageName();
final PackageManager pm = parentEngine.cordova.getActivity().getPackageManager();
ApplicationInfo appInfo;
try {
appInfo = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
if ((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
// debug = true
handler.proceed();
return;
} else {
// debug = false
super.onReceivedSslError(view, handler, error);
}
} catch (NameNotFoundException e) {
// When it doubt, lock it out!
super.onReceivedSslError(view, handler, error);
}
}
Has anyone ever found a solution to this?