Please help, I have the below implementation in MainApplication.java file. I am checking fixed hostnames and then returning true or false accordingly.
Error Insecure hostname verifier
Security Your app is using an unsafe implementation of hostnameverifier. Please see this Google Help Centre article for details,including the deadline for fixing the vulnerability.
Ld/a/a/a/a/c/e$1; Ld/a/a/a/a/c/f$1; sv:deadline:12/10/2020
@Override public void onCreate() { super.onCreate(); hostnameVerifier(); MobileCore.setApplication(this); SoLoader.init(this, /* native exopackage */ false); ReactNativeFirebaseApp.setApplicationContext(this); }private void hostnameVerifier(){ HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() { @Override public boolean verify(String arg0, SSLSession arg1) { String hostList[] = {"in.appcenter.ms", "graph.facebook.com","assets.adobedtm.com", "codepushupdates.azureedge.net", "app-measurement.com","forter.com", "dmn1", "dmn2", "dmn3", "quantummetric.com", "urbanairship.com", "demdex.net", "search.unbxd.io","monetate.net", "bazaarvoice.com", "google.com", "stylitics.com", "getcandid.com","braintreegateway.com" }; for (String host : hostList) { if (host.contains(arg0) || arg0.endsWith(host)) { return true; } } return false; } }); }
What should I change, please help.