package com.datatheorem.android.trustkit.pinning;


import android.net.SSLCertificateSocketFactory;

import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import javax.net.ssl.TrustManager;


public class TrustKitSSLSocketFactory extends SSLCertificateSocketFactory {

    // TODO(ad): Figure this out
    // REVIEW(bj): resolve this TODO or remove it. ;P
    public TrustKitSSLSocketFactory() {
        super(0);
    }

    @Override
    public Socket createSocket(String host, int port, InetAddress localAddr, int localPort)
            throws IOException {
        // Force the use of our trust manager
        setTrustManagers(new TrustManager[]{TrustManagerBuilder.getTrustManager(host)});

        // Try to create the socket, which will trigger the SSL handshake
        return super.createSocket(host, port, localAddr, localPort);
    }

    @Override
    public Socket createSocket(Socket k, String host, int port, boolean close) throws IOException {
        // Force the use of our trust manager
        setTrustManagers(new TrustManager[]{TrustManagerBuilder.getTrustManager(host)});

        // Try to create the socket, which will trigger the SSL handshake
        return super.createSocket(k, host, port, close);
    }

    @Override
    public Socket createSocket(String host, int port) throws IOException {
        // Force the use of our trust manager
        setTrustManagers(new TrustManager[]{TrustManagerBuilder.getTrustManager(host)});

        // Try to create the socket, which will trigger the SSL handshake
        return super.createSocket(host, port);
    }
}

@@ -297,130 +297,185 @@
     
-// TODO(ad): Figure this out%0A    // REVIEW(bj): resolve this TODO or remove it. ;P%0A    public TrustKitSSLSocketFactory() %7B
+public TrustKitSSLSocketFactory() %7B%0A        // Inheritance is the only way to customize the SSLCertificateSocketFactory but it requires%0A        // calling this deprecated method
 %0A   

Remove and TODO and add explanation