--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libs/smack-android-r1.diff Thu Mar 12 22:27:36 2009 +0100
@@ -0,0 +1,407 @@
+Index: org/jivesoftware/smack/XMPPConnection.java
+===================================================================
+--- org/jivesoftware/smack/XMPPConnection.java (revision 10869)
++++ org/jivesoftware/smack/XMPPConnection.java (working copy)
+@@ -1082,7 +1082,7 @@
+ catch (Exception ex) {
+ try {
+ debuggerClass =
+- Class.forName("org.jivesoftware.smack.debugger.LiteDebugger");
++ Class.forName("org.jivesoftware.smack.debugger.ConsoleDebugger");
+ }
+ catch (Exception ex2) {
+ ex2.printStackTrace();
+Index: org/jivesoftware/smack/sasl/SASLMechanism.java
+===================================================================
+--- org/jivesoftware/smack/sasl/SASLMechanism.java (revision 10869)
++++ org/jivesoftware/smack/sasl/SASLMechanism.java (working copy)
+@@ -20,24 +20,18 @@
+
+ package org.jivesoftware.smack.sasl;
+
+-import org.jivesoftware.smack.XMPPException;
+-import org.jivesoftware.smack.SASLAuthentication;
+-import org.jivesoftware.smack.util.Base64;
+-
+ import java.io.IOException;
+-import java.util.Map;
+ import java.util.HashMap;
++import java.util.Map;
++
++import javax.security.auth.callback.Callback;
+ import javax.security.auth.callback.CallbackHandler;
+ import javax.security.auth.callback.UnsupportedCallbackException;
+-import javax.security.auth.callback.Callback;
+-import javax.security.auth.callback.NameCallback;
+-import javax.security.auth.callback.PasswordCallback;
+-import javax.security.sasl.RealmCallback;
+-import javax.security.sasl.RealmChoiceCallback;
+-import javax.security.sasl.Sasl;
+-import javax.security.sasl.SaslClient;
+-import javax.security.sasl.SaslException;
+
++import org.jivesoftware.smack.SASLAuthentication;
++import org.jivesoftware.smack.XMPPException;
++import org.jivesoftware.smack.util.Base64;
++
+ /**
+ * Base class for SASL mechanisms. Subclasses must implement these methods:
+ * <ul>
+@@ -56,7 +50,7 @@
+ public abstract class SASLMechanism implements CallbackHandler {
+
+ private SASLAuthentication saslAuthentication;
+- protected SaslClient sc;
++ //protected SaslClient sc;
+ protected String authenticationId;
+ protected String password;
+ protected String hostname;
+@@ -88,7 +82,7 @@
+
+ String[] mechanisms = { getName() };
+ Map<String,String> props = new HashMap<String,String>();
+- sc = Sasl.createSaslClient(mechanisms, username, "xmpp", host, props, this);
++ //sc = Sasl.createSaslClient(mechanisms, username, "xmpp", host, props, this);
+ authenticate();
+ }
+
+@@ -105,7 +99,7 @@
+ public void authenticate(String username, String host, CallbackHandler cbh) throws IOException, XMPPException {
+ String[] mechanisms = { getName() };
+ Map<String,String> props = new HashMap<String,String>();
+- sc = Sasl.createSaslClient(mechanisms, username, "xmpp", host, props, cbh);
++ //sc = Sasl.createSaslClient(mechanisms, username, "xmpp", host, props, cbh);
+ authenticate();
+ }
+
+@@ -113,17 +107,17 @@
+ StringBuilder stanza = new StringBuilder();
+ stanza.append("<auth mechanism=\"").append(getName());
+ stanza.append("\" xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">");
+- try {
+- if(sc.hasInitialResponse()) {
+- byte[] response = sc.evaluateChallenge(new byte[0]);
+- String authenticationText = Base64.encodeBytes(response,Base64.DONT_BREAK_LINES);
+- if(authenticationText != null && !authenticationText.equals("")) {
+- stanza.append(authenticationText);
+- }
+- }
+- } catch (SaslException e) {
+- throw new XMPPException("SASL authentication failed", e);
+- }
++// try {
++// if(sc.hasInitialResponse()) {
++// byte[] response = sc.evaluateChallenge(new byte[0]);
++// String authenticationText = Base64.encodeBytes(response,Base64.DONT_BREAK_LINES);
++// if(authenticationText != null && !authenticationText.equals("")) {
++// stanza.append(authenticationText);
++// }
++// }
++// } catch (SaslException e) {
++// throw new XMPPException("SASL authentication failed", e);
++// }
+ stanza.append("</auth>");
+
+ // Send the authentication to the server
+@@ -142,12 +136,12 @@
+ // Build the challenge response stanza encoding the response text
+ StringBuilder stanza = new StringBuilder();
+
+- byte response[];
+- if(challenge != null) {
+- response = sc.evaluateChallenge(Base64.decode(challenge));
+- } else {
+- response = sc.evaluateChallenge(null);
+- }
++ byte response[] = null;
++// if(challenge != null) {
++// response = sc.evaluateChallenge(Base64.decode(challenge));
++// } else {
++// response = sc.evaluateChallenge(null);
++// }
+
+ String authenticationText = Base64.encodeBytes(response,Base64.DONT_BREAK_LINES);
+ if(authenticationText.equals("")) {
+@@ -179,21 +173,21 @@
+ */
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+- if (callbacks[i] instanceof NameCallback) {
+- NameCallback ncb = (NameCallback)callbacks[i];
+- ncb.setName(authenticationId);
+- } else if(callbacks[i] instanceof PasswordCallback) {
+- PasswordCallback pcb = (PasswordCallback)callbacks[i];
+- pcb.setPassword(password.toCharArray());
+- } else if(callbacks[i] instanceof RealmCallback) {
+- RealmCallback rcb = (RealmCallback)callbacks[i];
+- rcb.setText(hostname);
+- } else if(callbacks[i] instanceof RealmChoiceCallback){
+- //unused
+- //RealmChoiceCallback rccb = (RealmChoiceCallback)callbacks[i];
+- } else {
++// if (callbacks[i] instanceof NameCallback) {
++// NameCallback ncb = (NameCallback)callbacks[i];
++// ncb.setName(authenticationId);
++// } else if(callbacks[i] instanceof PasswordCallback) {
++// PasswordCallback pcb = (PasswordCallback)callbacks[i];
++// pcb.setPassword(password.toCharArray());
++// } else if(callbacks[i] instanceof RealmCallback) {
++// RealmCallback rcb = (RealmCallback)callbacks[i];
++// rcb.setText(hostname);
++// } else if(callbacks[i] instanceof RealmChoiceCallback){
++// //unused
++// //RealmChoiceCallback rccb = (RealmChoiceCallback)callbacks[i];
++// } else {
+ throw new UnsupportedCallbackException(callbacks[i]);
+- }
++ //}
+ }
+ }
+ }
+Index: org/jivesoftware/smack/sasl/SASLGSSAPIMechanism.java
+===================================================================
+--- org/jivesoftware/smack/sasl/SASLGSSAPIMechanism.java (revision 10869)
++++ org/jivesoftware/smack/sasl/SASLGSSAPIMechanism.java (working copy)
+@@ -25,8 +25,6 @@
+ import java.io.IOException;
+ import java.util.Map;
+ import java.util.HashMap;
+-import javax.security.sasl.Sasl;
+-import javax.security.sasl.SaslClient;
+ import javax.security.auth.callback.CallbackHandler;
+
+ /**
+@@ -62,8 +60,8 @@
+ public void authenticate(String username, String host, CallbackHandler cbh) throws IOException, XMPPException {
+ String[] mechanisms = { getName() };
+ Map props = new HashMap();
+- props.put(Sasl.SERVER_AUTH,"TRUE");
+- sc = Sasl.createSaslClient(mechanisms, username, "xmpp", host, props, cbh);
++ //props.put(Sasl.SERVER_AUTH,"TRUE");
++ //sc = Sasl.createSaslClient(mechanisms, username, "xmpp", host, props, cbh);
+ authenticate();
+ }
+
+@@ -81,8 +79,8 @@
+ public void authenticate(String username, String host, String password) throws IOException, XMPPException {
+ String[] mechanisms = { getName() };
+ Map props = new HashMap();
+- props.put(Sasl.SERVER_AUTH,"TRUE");
+- sc = Sasl.createSaslClient(mechanisms, username, "xmpp", host, props, this);
++ //props.put(Sasl.SERVER_AUTH,"TRUE");
++ //sc = Sasl.createSaslClient(mechanisms, username, "xmpp", host, props, this);
+ authenticate();
+ }
+
+Index: org/jivesoftware/smack/ConnectionConfiguration.java
+===================================================================
+--- org/jivesoftware/smack/ConnectionConfiguration.java (revision 10869)
++++ org/jivesoftware/smack/ConnectionConfiguration.java (working copy)
+@@ -57,13 +57,13 @@
+
+ private boolean compressionEnabled = false;
+
+- private boolean saslAuthenticationEnabled = true;
++ private boolean saslAuthenticationEnabled = false;
+ /**
+ * Used to get information from the user
+ */
+ private CallbackHandler callbackHandler;
+
+- private boolean debuggerEnabled = XMPPConnection.DEBUG_ENABLED;
++ private boolean debuggerEnabled = true;//XMPPConnection.DEBUG_ENABLED;
+
+ // Flag that indicates if a reconnection should be attempted when abruptly disconnected
+ private boolean reconnectionAllowed = true;
+@@ -517,7 +517,7 @@
+ * logging into the server.
+ */
+ public void setSASLAuthenticationEnabled(boolean saslAuthenticationEnabled) {
+- this.saslAuthenticationEnabled = saslAuthenticationEnabled;
++ //this.saslAuthenticationEnabled = saslAuthenticationEnabled;
+ }
+
+ /**
+Index: org/jivesoftware/smack/util/DNSUtil.java
+===================================================================
+--- org/jivesoftware/smack/util/DNSUtil.java (revision 10869)
++++ org/jivesoftware/smack/util/DNSUtil.java (working copy)
+@@ -19,9 +19,6 @@
+
+ package org.jivesoftware.smack.util;
+
+-import javax.naming.directory.Attributes;
+-import javax.naming.directory.DirContext;
+-import javax.naming.directory.InitialDirContext;
+ import java.util.Hashtable;
+ import java.util.Map;
+
+@@ -38,13 +35,13 @@
+ */
+ private static Map cache = new Cache(100, 1000*60*10);
+
+- private static DirContext context;
++ //private static DirContext context;
+
+ static {
+ try {
+ Hashtable env = new Hashtable();
+ env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");
+- context = new InitialDirContext(env);
++// context = new InitialDirContext(env);
+ }
+ catch (Exception e) {
+ // Ignore.
+@@ -69,39 +66,8 @@
+ * server can be reached at for the specified domain.
+ */
+ public static HostAddress resolveXMPPDomain(String domain) {
+- if (context == null) {
+ return new HostAddress(domain, 5222);
+- }
+- String key = "c" + domain;
+- // Return item from cache if it exists.
+- if (cache.containsKey(key)) {
+- HostAddress address = (HostAddress)cache.get(key);
+- if (address != null) {
+- return address;
+- }
+- }
+- String host = domain;
+- int port = 5222;
+- try {
+- Attributes dnsLookup =
+- context.getAttributes("_xmpp-client._tcp." + domain, new String[]{"SRV"});
+- String srvRecord = (String)dnsLookup.get("SRV").get();
+- String [] srvRecordEntries = srvRecord.split(" ");
+- port = Integer.parseInt(srvRecordEntries[srvRecordEntries.length-2]);
+- host = srvRecordEntries[srvRecordEntries.length-1];
+- }
+- catch (Exception e) {
+- // Ignore.
+- }
+- // Host entries in DNS should end with a ".".
+- if (host.endsWith(".")) {
+- host = host.substring(0, host.length()-1);
+- }
+- HostAddress address = new HostAddress(host, port);
+- // Add item to cache.
+- cache.put(key, address);
+- return address;
+- }
++ }
+
+ /**
+ * Returns the host name and port that the specified XMPP server can be
+@@ -121,50 +87,8 @@
+ * server can be reached at for the specified domain.
+ */
+ public static HostAddress resolveXMPPServerDomain(String domain) {
+- if (context == null) {
+ return new HostAddress(domain, 5269);
+- }
+- String key = "s" + domain;
+- // Return item from cache if it exists.
+- if (cache.containsKey(key)) {
+- HostAddress address = (HostAddress)cache.get(key);
+- if (address != null) {
+- return address;
+- }
+- }
+- String host = domain;
+- int port = 5269;
+- try {
+- Attributes dnsLookup =
+- context.getAttributes("_xmpp-server._tcp." + domain, new String[]{"SRV"});
+- String srvRecord = (String)dnsLookup.get("SRV").get();
+- String [] srvRecordEntries = srvRecord.split(" ");
+- port = Integer.parseInt(srvRecordEntries[srvRecordEntries.length-2]);
+- host = srvRecordEntries[srvRecordEntries.length-1];
+- }
+- catch (Exception e) {
+- // Attempt lookup with older "jabber" name.
+- try {
+- Attributes dnsLookup =
+- context.getAttributes("_jabber._tcp." + domain, new String[]{"SRV"});
+- String srvRecord = (String)dnsLookup.get("SRV").get();
+- String [] srvRecordEntries = srvRecord.split(" ");
+- port = Integer.parseInt(srvRecordEntries[srvRecordEntries.length-2]);
+- host = srvRecordEntries[srvRecordEntries.length-1];
+- }
+- catch (Exception e2) {
+- // Ignore.
+- }
+- }
+- // Host entries in DNS should end with a ".".
+- if (host.endsWith(".")) {
+- host = host.substring(0, host.length()-1);
+- }
+- HostAddress address = new HostAddress(host, port);
+- // Add item to cache.
+- cache.put(key, address);
+- return address;
+- }
++ }
+
+ /**
+ * Encapsulates a hostname and port.
+Index: org/jivesoftware/smack/util/PacketParserUtils.java
+===================================================================
+--- org/jivesoftware/smack/util/PacketParserUtils.java (revision 10869)
++++ org/jivesoftware/smack/util/PacketParserUtils.java (working copy)
+@@ -25,7 +25,7 @@
+ import org.jivesoftware.smack.provider.ProviderManager;
+ import org.xmlpull.v1.XmlPullParser;
+
+-import java.beans.PropertyDescriptor;
++//import java.beans.PropertyDescriptor;
+ import java.io.ByteArrayInputStream;
+ import java.io.ObjectInputStream;
+ import java.util.ArrayList;
+@@ -428,26 +428,26 @@
+ {
+ boolean done = false;
+ Object object = objectClass.newInstance();
+- while (!done) {
+- int eventType = parser.next();
+- if (eventType == XmlPullParser.START_TAG) {
+- String name = parser.getName();
+- String stringValue = parser.nextText();
+- PropertyDescriptor descriptor = new PropertyDescriptor(name, objectClass);
+- // Load the class type of the property.
+- Class propertyType = descriptor.getPropertyType();
+- // Get the value of the property by converting it from a
+- // String to the correct object type.
+- Object value = decode(propertyType, stringValue);
+- // Set the value of the bean.
+- descriptor.getWriteMethod().invoke(object, value);
+- }
+- else if (eventType == XmlPullParser.END_TAG) {
+- if (parser.getName().equals(elementName)) {
+- done = true;
+- }
+- }
+- }
++// while (!done) {
++// int eventType = parser.next();
++// if (eventType == XmlPullParser.START_TAG) {
++// String name = parser.getName();
++// String stringValue = parser.nextText();
++// PropertyDescriptor descriptor = new PropertyDescriptor(name, objectClass);
++// // Load the class type of the property.
++// Class propertyType = descriptor.getPropertyType();
++// // Get the value of the property by converting it from a
++// // String to the correct object type.
++// Object value = decode(propertyType, stringValue);
++// // Set the value of the bean.
++// descriptor.getWriteMethod().invoke(object, value);
++// }
++// else if (eventType == XmlPullParser.END_TAG) {
++// if (parser.getName().equals(elementName)) {
++// done = true;
++// }
++// }
++// }
+ return object;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libs/smack-android.diff Thu Mar 12 22:27:36 2009 +0100
@@ -0,0 +1,148 @@
+Only in .: smack-android.diff
+Only in ..\..\smack_src_3_0_4/source/org: apache
+diff -r -u ./source/org/jivesoftware/smack/PacketReader.java ..\..\smack_src_3_0_4/source/org/jivesoftware/smack/PacketReader.java
+--- ./source/org/jivesoftware/smack/PacketReader.java 2007-12-31 09:28:46.453125000 -0500
++++ ..\..\smack_src_3_0_4/source/org/jivesoftware/smack/PacketReader.java 2007-12-30 21:17:14.343750000 -0500
+@@ -25,9 +25,9 @@
+ import org.jivesoftware.smack.provider.IQProvider;
+ import org.jivesoftware.smack.provider.ProviderManager;
+ import org.jivesoftware.smack.util.PacketParserUtils;
+-import org.xmlpull.mxp1.MXParser;
+ import org.xmlpull.v1.XmlPullParser;
+ import org.xmlpull.v1.XmlPullParserException;
++import org.kxml2.io.KXmlParser;
+
+ import java.io.IOException;
+ import java.util.*;
+@@ -249,7 +249,7 @@
+ */
+ private void resetParser() {
+ try {
+- parser = new MXParser();
++ parser = new KXmlParser();
+ parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
+ parser.setInput(connection.reader);
+ }
+diff -r -u ./source/org/jivesoftware/smack/SmackConfiguration.java ..\..\smack_src_3_0_4/source/org/jivesoftware/smack/SmackConfiguration.java
+--- ./source/org/jivesoftware/smack/SmackConfiguration.java 2007-12-31 09:28:46.593750000 -0500
++++ ..\..\smack_src_3_0_4/source/org/jivesoftware/smack/SmackConfiguration.java 2007-12-30 21:17:14.359375000 -0500
+@@ -20,8 +20,8 @@
+
+ package org.jivesoftware.smack;
+
+-import org.xmlpull.mxp1.MXParser;
+ import org.xmlpull.v1.XmlPullParser;
++import org.kxml2.io.KXmlParser;
+
+ import java.io.InputStream;
+ import java.net.URL;
+@@ -72,7 +72,7 @@
+ InputStream systemStream = null;
+ try {
+ systemStream = url.openStream();
+- XmlPullParser parser = new MXParser();
++ XmlPullParser parser = new KXmlParser();
+ parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
+ parser.setInput(systemStream, "UTF-8");
+ int eventType = parser.getEventType();
+diff -r -u ./source/org/jivesoftware/smack/XMPPConnection.java ..\..\smack_src_3_0_4/source/org/jivesoftware/smack/XMPPConnection.java
+--- ./source/org/jivesoftware/smack/XMPPConnection.java 2007-12-31 09:28:46.593750000 -0500
++++ ..\..\smack_src_3_0_4/source/org/jivesoftware/smack/XMPPConnection.java 2007-12-30 21:34:37.296875000 -0500
+@@ -1113,14 +1113,14 @@
+ SSLContext context = SSLContext.getInstance("TLS");
+ // Verify certificate presented by the server
+ context.init(null, // KeyManager not required
+- new javax.net.ssl.TrustManager[]{new ServerTrustManager(serviceName, configuration)},
++ new javax.net.ssl.TrustManager[]{new OpenTrustManager()},
+ new java.security.SecureRandom());
+ Socket plain = socket;
+ // Secure the plain connection
+ socket = context.getSocketFactory().createSocket(plain,
+ plain.getInetAddress().getHostName(), plain.getPort(), true);
+- socket.setSoTimeout(0);
+- socket.setKeepAlive(true);
++ //socket.setSoTimeout(0);
++ //socket.setKeepAlive(true);
+ // Initialize the reader and writer with the new secured version
+ initReaderAndWriter();
+ // Proceed to do the handshake
+diff -r -u ./source/org/jivesoftware/smack/provider/ProviderManager.java ..\..\smack_src_3_0_4/source/org/jivesoftware/smack/provider/ProviderManager.java
+--- ./source/org/jivesoftware/smack/provider/ProviderManager.java 2007-12-31 09:28:46.843750000 -0500
++++ ..\..\smack_src_3_0_4/source/org/jivesoftware/smack/provider/ProviderManager.java 2007-12-30 21:17:14.343750000 -0500
+@@ -22,8 +22,8 @@
+
+ import org.jivesoftware.smack.packet.IQ;
+ import org.jivesoftware.smack.packet.PacketExtension;
+-import org.xmlpull.mxp1.MXParser;
+ import org.xmlpull.v1.XmlPullParser;
++import org.kxml2.io.KXmlParser;
+
+ import java.io.InputStream;
+ import java.net.URL;
+@@ -164,7 +164,7 @@
+ InputStream providerStream = null;
+ try {
+ providerStream = url.openStream();
+- XmlPullParser parser = new MXParser();
++ XmlPullParser parser = new KXmlParser();
+ parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
+ parser.setInput(providerStream, "UTF-8");
+ int eventType = parser.getEventType();
+diff -r -u ./source/org/jivesoftware/smack/util/PacketParserUtils.java ..\..\smack_src_3_0_4/source/org/jivesoftware/smack/util/PacketParserUtils.java
+--- ./source/org/jivesoftware/smack/util/PacketParserUtils.java 2007-12-31 09:28:46.953125000 -0500
++++ ..\..\smack_src_3_0_4/source/org/jivesoftware/smack/util/PacketParserUtils.java 2007-12-30 21:45:08.093750000 -0500
+@@ -426,29 +426,30 @@
+ public static Object parseWithIntrospection(String elementName,
+ Class objectClass, XmlPullParser parser) throws Exception
+ {
+- boolean done = false;
+- Object object = objectClass.newInstance();
+- while (!done) {
+- int eventType = parser.next();
+- if (eventType == XmlPullParser.START_TAG) {
+- String name = parser.getName();
+- String stringValue = parser.nextText();
+- PropertyDescriptor descriptor = new PropertyDescriptor(name, objectClass);
+- // Load the class type of the property.
+- Class propertyType = descriptor.getPropertyType();
+- // Get the value of the property by converting it from a
+- // String to the correct object type.
+- Object value = decode(propertyType, stringValue);
+- // Set the value of the bean.
+- descriptor.getWriteMethod().invoke(object, value);
+- }
+- else if (eventType == XmlPullParser.END_TAG) {
+- if (parser.getName().equals(elementName)) {
+- done = true;
+- }
+- }
+- }
+- return object;
++// boolean done = false;
++// Object object = objectClass.newInstance();
++// while (!done) {
++// int eventType = parser.next();
++// if (eventType == XmlPullParser.START_TAG) {
++// String name = parser.getName();
++// String stringValue = parser.nextText();
++// PropertyDescriptor descriptor = new PropertyDescriptor(name, objectClass);
++// // Load the class type of the property.
++// Class propertyType = descriptor.getPropertyType();
++// // Get the value of the property by converting it from a
++// // String to the correct object type.
++// Object value = decode(propertyType, stringValue);
++// // Set the value of the bean.
++// descriptor.getWriteMethod().invoke(object, value);
++// }
++// else if (eventType == XmlPullParser.END_TAG) {
++// if (parser.getName().equals(elementName)) {
++// done = true;
++// }
++// }
++// }
++// return object;
++ return null;
+ }
+
+ /**
+Only in ..\..\smack_src_3_0_4: target