I have a file from a library module. I am not calling any methods in this file. So I expect Proguard to strip this file. But I am still seeing references in my apk
.
The file is :
public final class DebugUtils {
private DebugUtils(){}
public static void setAcceptSSLConnections() {
SSLContext sc = null;
try {
sc = SSLContext.getInstance("SSL");
} catch (NoSuchAlgorithmException e) {
//This isn't a production error since this
// code is debug only
throw new RuntimeException(e);
}
TrustManager[] trustAllCerts = new TrustManager[]{ new X509TrustManager() {
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType)
throws CertificateException {}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType)
throws CertificateException {}
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
}};
try {
sc.init(null, trustAllCerts, new java.security.SecureRandom());
} catch (KeyManagementException e) {
//This isn't a production error since this
// code is debug only
throw new RuntimeException(e);
}
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
// Create all-trusting host name verifier
HostnameVerifier allHostsValid = new HostnameVerifier() {
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
// Install the all-trusting host verifier
HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
}
}
The usage.txt
(proguard generated output file) says:
com.....DebugUtils: 22:61:public static void setAcceptSSLConnections()
But I still see in my apk:
DebugUtils$1 (m)() (m)void checkClientTrusted(....) (m)java.security.cert.X%)(Certificate[] getAcceptedIssuers()
etc...
Is there any change that I can do so that Proguard completely removes this file