// Path: androidpn/src/main/java/org/apache/harmony/javax/security/auth/callback/CallbackHandler.java
// public interface CallbackHandler {
// 
//     /**
//      * Handles the actual {@link org.apache.harmony.javax.security.auth.callback.Callback}. A {@code CallbackHandler} needs to
//      * implement this method. In the method, it is free to select which {@code
//      * Callback}s it actually wants to handle and in which way. For example, a
//      * console-based {@code CallbackHandler} might choose to sequentially ask
//      * the user for login and password, if it implements these {@code Callback}
//      * s, whereas a GUI-based one might open a single dialog window for both
//      * values. If a {@code CallbackHandler} is not able to handle a specific
//      * {@code Callback}, it needs to throw an
//      * {@link UnsupportedCallbackException}.
//      *
//      * @param callbacks
//      *            the array of {@code Callback}s that need handling
//      * @throws java.io.IOException
//      *             if an I/O related error occurs
//      * @throws UnsupportedCallbackException
//      *             if the {@code CallbackHandler} is not able to handle a
//      *             specific {@code Callback}
//      */
//     void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException;
// 
// }


import java.net.UnknownHostException;
import javax.net.SocketFactory;
import android.util.Log;
import org.androidpn.client.LogUtil;
import org.apache.harmony.javax.security.auth.callback.CallbackHandler;
import org.apache.http.conn.util.InetAddressUtils;
import org.jivesoftware.smack.proxy.ProxyInfo;
import org.jivesoftware.smack.util.DNSUtil;
import java.io.File;
import java.net.InetAddress;
     * to the desired host and port.
     *
     * @param host the host where the XMPP server is running.
     * @param port the port where the XMPP is listening.
     */
    public ConnectionConfiguration(String host, int port) {
        init(host, port, host, ProxyInfo.forDefaultProxy());
    }
	
	/**
     * Creates a new ConnectionConfiguration for a connection that will connect
     * to the desired host and port with desired proxy.
     *
     * @param host the host where the XMPP server is running.
     * @param port the port where the XMPP is listening.
     * @param proxy the proxy through which XMPP is to be connected
     */
    public ConnectionConfiguration(String host, int port, ProxyInfo proxy) {
        init(host, port, host, proxy);
    }

    private void init(String host, int port, String serviceName, ProxyInfo proxy) {
        this.host = host;
        this.port = port;
        this.serviceName = serviceName;
        this.proxy = proxy;

        // Build the default path to the cacert truststore file. By default we are
        // going to use the file located in $JREHOME/lib/security/cacerts.
        String javaHome = System.getProperty("java.home");
// Path: androidpn/src/main/java/org/apache/harmony/javax/security/auth/callback/CallbackHandler.java
// public interface CallbackHandler {
// 
//     /**
//      * Handles the actual {@link org.apache.harmony.javax.security.auth.callback.Callback}. A {@code CallbackHandler} needs to
//      * implement this method. In the method, it is free to select which {@code
//      * Callback}s it actually wants to handle and in which way. For example, a
//      * console-based {@code CallbackHandler} might choose to sequentially ask
//      * the user for login and password, if it implements these {@code Callback}
//      * s, whereas a GUI-based one might open a single dialog window for both
//      * values. If a {@code CallbackHandler} is not able to handle a specific
//      * {@code Callback}, it needs to throw an
//      * {@link UnsupportedCallbackException}.
//      *
//      * @param callbacks
//      *            the array of {@code Callback}s that need handling
//      * @throws java.io.IOException
//      *             if an I/O related error occurs
//      * @throws UnsupportedCallbackException
//      *             if the {@code CallbackHandler} is not able to handle a
//      *             specific {@code Callback}
//      */
//     void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException;
// 
// }


// Path: androidpn/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java
import java.net.UnknownHostException;
import javax.net.SocketFactory;
import android.util.Log;
import org.androidpn.client.LogUtil;
import org.apache.harmony.javax.security.auth.callback.CallbackHandler;
import org.apache.http.conn.util.InetAddressUtils;
import org.jivesoftware.smack.proxy.ProxyInfo;
import org.jivesoftware.smack.util.DNSUtil;
import java.io.File;
import java.net.InetAddress;

     * to the desired host and port.
     *
     * @param host the host where the XMPP server is running.
     * @param port the port where the XMPP is listening.
     */
    public ConnectionConfiguration(String host, int port) {
        init(host, port, host, ProxyInfo.forDefaultProxy());
    }
	
	/**
     * Creates a new ConnectionConfiguration for a connection that will connect
     * to the desired host and port with desired proxy.
     *
     * @param host the host where the XMPP server is running.
     * @param port the port where the XMPP is listening.
     * @param proxy the proxy through which XMPP is to be connected
     */
    public ConnectionConfiguration(String host, int port, ProxyInfo proxy) {
        init(host, port, host, proxy);
    }

    private void init(String host, int port, String serviceName, ProxyInfo proxy) {
        this.host = host;
        this.port = port;
        this.serviceName = serviceName;
        this.proxy = proxy;

        // Build the default path to the cacert truststore file. By default we are
        // going to use the file located in $JREHOME/lib/security/cacerts.
        String javaHome = System.getProperty("java.home");
        StringBuilder buffer = new StringBuilder();