android:proguard不删除空文件

问题描述

我有一个来自库模块的文件。我没有在此文件调用任何方法。因此,我希望Proguard可以删除文件。但是我仍然在我的apk中看到引用。 该文件是:

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);
}

}

usage.txt(由proguard生成输出文件)说: com ..... DebugUtils: 22:61:public static void setAcceptSSLConnections()

但是我仍然在我的apk中看到: DebugUtils 1美元 (米)() (m)避免checkClientTrusted(....) (m)java.security.cert.X%)(Certificate [] getAcceptedissuers()

等...

我是否可以做一些更改,以便Proguard完全删除文件

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)