All pastes #2101578 Raw Edit

Mine

public text v1 · immutable
#2101578 ·published 2012-01-09 15:09 UTC
rendered paste body
package whatsapp;

import com.whatsapp.org.kxml2.io.KXmlParser;
import com.whatsapp.org.xmlpull.v1.XmlPullParser;
import com.whatsapp.org.xmlpull.v1.XmlPullParserException;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.util.Date;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Random;
import java.util.Vector;
import org.bouncycastle.util.encoders.Base64;

public class FunXMPP
{
  public static String[] dictionary;
  public static Hashtable message_store = new Hashtable();

  static
  {
    String[] arrayOfString = new String['ó'];
    arrayOfString[0] = null;
    arrayOfString[1] = null;
    arrayOfString[2] = null;
    arrayOfString[3] = null;
    arrayOfString[4] = null;
    arrayOfString[5] = "1";
    arrayOfString[6] = "1.0";
    arrayOfString[7] = "ack";
    arrayOfString[8] = "action";
    arrayOfString[9] = "active";
    arrayOfString[10] = "add";
    arrayOfString[11] = "all";
    arrayOfString[12] = "allow";
    arrayOfString[13] = "apple";
    arrayOfString[14] = "audio";
    arrayOfString[15] = "auth";
    arrayOfString[16] = "author";
    arrayOfString[17] = "available";
    arrayOfString[18] = "bad-request";
    arrayOfString[19] = "base64";
    arrayOfString[20] = "Bell.caf";
    arrayOfString[21] = "bind";
    arrayOfString[22] = "body";
    arrayOfString[23] = "Boing.caf";
    arrayOfString[24] = "cancel";
    arrayOfString[25] = "category";
    arrayOfString[26] = "challenge";
    arrayOfString[27] = "chat";
    arrayOfString[28] = "clean";
    arrayOfString[29] = "code";
    arrayOfString[30] = "composing";
    arrayOfString[31] = "config";
    arrayOfString[32] = "conflict";
    arrayOfString[33] = "contacts";
    arrayOfString[34] = "create";
    arrayOfString[35] = "creation";
    arrayOfString[36] = "default";
    arrayOfString[37] = "delay";
    arrayOfString[38] = "delete";
    arrayOfString[39] = "delivered";
    arrayOfString[40] = "deny";
    arrayOfString[41] = "DIGEST-MD5";
    arrayOfString[42] = "DIGEST-MD5-1";
    arrayOfString[43] = "dirty";
    arrayOfString[44] = "en";
    arrayOfString[45] = "enable";
    arrayOfString[46] = "encoding";
    arrayOfString[47] = "error";
    arrayOfString[48] = "expiration";
    arrayOfString[49] = "expired";
    arrayOfString[50] = "failure";
    arrayOfString[51] = "false";
    arrayOfString[52] = "favorites";
    arrayOfString[53] = "feature";
    arrayOfString[54] = "field";
    arrayOfString[55] = "free";
    arrayOfString[56] = "from";
    arrayOfString[57] = "g.us";
    arrayOfString[58] = "get";
    arrayOfString[59] = "Glass.caf";
    arrayOfString[60] = "google";
    arrayOfString[61] = "group";
    arrayOfString[62] = "groups";
    arrayOfString[63] = "g_sound";
    arrayOfString[64] = "Harp.caf";
    arrayOfString[65] = "http://etherx.jabber.org/streams";
    arrayOfString[66] = "http://jabber.org/protocol/chatstates";
    arrayOfString[67] = "id";
    arrayOfString[68] = "image";
    arrayOfString[69] = "img";
    arrayOfString[70] = "inactive";
    arrayOfString[71] = "internal-server-error";
    arrayOfString[72] = "iq";
    arrayOfString[73] = "item";
    arrayOfString[74] = "item-not-found";
    arrayOfString[75] = "jabber:client";
    arrayOfString[76] = "jabber:iq:last";
    arrayOfString[77] = "jabber:iq:privacy";
    arrayOfString[78] = "jabber:x:delay";
    arrayOfString[79] = "jabber:x:event";
    arrayOfString[80] = "jid";
    arrayOfString[81] = "jid-malformed";
    arrayOfString[82] = "kind";
    arrayOfString[83] = "leave";
    arrayOfString[84] = "leave-all";
    arrayOfString[85] = "list";
    arrayOfString[86] = "location";
    arrayOfString[87] = "max_groups";
    arrayOfString[88] = "max_participants";
    arrayOfString[89] = "max_subject";
    arrayOfString[90] = "mechanism";
    arrayOfString[91] = "mechanisms";
    arrayOfString[92] = "media";
    arrayOfString[93] = "message";
    arrayOfString[94] = "message_acks";
    arrayOfString[95] = "missing";
    arrayOfString[96] = "modify";
    arrayOfString[97] = "name";
    arrayOfString[98] = "not-acceptable";
    arrayOfString[99] = "not-allowed";
    arrayOfString[100] = "not-authorized";
    arrayOfString[101] = "notify";
    arrayOfString[102] = "Offline Storage";
    arrayOfString[103] = "order";
    arrayOfString[104] = "owner";
    arrayOfString[105] = "owning";
    arrayOfString[106] = "paid";
    arrayOfString[107] = "participant";
    arrayOfString[108] = "participants";
    arrayOfString[109] = "participating";
    arrayOfString[110] = "fail";
    arrayOfString[111] = "paused";
    arrayOfString[112] = "picture";
    arrayOfString[113] = "ping";
    arrayOfString[114] = "PLAIN";
    arrayOfString[115] = "platform";
    arrayOfString[116] = "presence";
    arrayOfString[117] = "preview";
    arrayOfString[118] = "probe";
    arrayOfString[119] = "prop";
    arrayOfString[120] = "props";
    arrayOfString[121] = "p_o";
    arrayOfString[122] = "p_t";
    arrayOfString[123] = "query";
    arrayOfString[124] = "raw";
    arrayOfString[125] = "receipt";
    arrayOfString[126] = "receipt_acks";
    arrayOfString[127] = "received";
    arrayOfString['€'] = "relay";
    arrayOfString[''] = "remove";
    arrayOfString['‚'] = "Replaced by new connection";
    arrayOfString['ƒ'] = "request";
    arrayOfString['„'] = "resource";
    arrayOfString['…'] = "resource-constraint";
    arrayOfString['†'] = "response";
    arrayOfString['‡'] = "result";
    arrayOfString['ˆ'] = "retry";
    arrayOfString['‰'] = "rim";
    arrayOfString['Š'] = "s.whatsapp.net";
    arrayOfString['‹'] = "seconds";
    arrayOfString['Œ'] = "server";
    arrayOfString[''] = "session";
    arrayOfString['Ž'] = "set";
    arrayOfString[''] = "show";
    arrayOfString[''] = "sid";
    arrayOfString['‘'] = "sound";
    arrayOfString['’'] = "stamp";
    arrayOfString['“'] = "starttls";
    arrayOfString['”'] = "status";
    arrayOfString['•'] = "stream:error";
    arrayOfString['–'] = "stream:features";
    arrayOfString['—'] = "subject";
    arrayOfString['˜'] = "subscribe";
    arrayOfString['™'] = "success";
    arrayOfString['š'] = "system-shutdown";
    arrayOfString['›'] = "s_o";
    arrayOfString['œ'] = "s_t";
    arrayOfString[''] = "t";
    arrayOfString['ž'] = "TimePassing.caf";
    arrayOfString['Ÿ'] = "timestamp";
    arrayOfString[' '] = "to";
    arrayOfString['¡'] = "Tri-tone.caf";
    arrayOfString['¢'] = "type";
    arrayOfString['£'] = "unavailable";
    arrayOfString['¤'] = "uri";
    arrayOfString['¥'] = "url";
    arrayOfString['¦'] = "urn:ietf:params:xml:ns:xmpp-bind";
    arrayOfString['§'] = "urn:ietf:params:xml:ns:xmpp-sasl";
    arrayOfString['¨'] = "urn:ietf:params:xml:ns:xmpp-session";
    arrayOfString['©'] = "urn:ietf:params:xml:ns:xmpp-stanzas";
    arrayOfString['ª'] = "urn:ietf:params:xml:ns:xmpp-streams";
    arrayOfString['«'] = "urn:xmpp:delay";
    arrayOfString['¬'] = "urn:xmpp:ping";
    arrayOfString['­'] = "urn:xmpp:receipts";
    arrayOfString['®'] = "urn:xmpp:whatsapp";
    arrayOfString['¯'] = "urn:xmpp:whatsapp:dirty";
    arrayOfString['°'] = "urn:xmpp:whatsapp:mms";
    arrayOfString['±'] = "urn:xmpp:whatsapp:push";
    arrayOfString['²'] = "value";
    arrayOfString['³'] = "vcard";
    arrayOfString['´'] = "version";
    arrayOfString['µ'] = "video";
    arrayOfString['¶'] = "w";
    arrayOfString['·'] = "w:g";
    arrayOfString['¸'] = "w:p:r";
    arrayOfString['¹'] = "wait";
    arrayOfString['º'] = "x";
    arrayOfString['»'] = "xml-not-well-formed";
    arrayOfString['¼'] = "xml:lang";
    arrayOfString['½'] = "xmlns";
    arrayOfString['¾'] = "xmlns:stream";
    arrayOfString['¿'] = "Xylophone.caf";
    arrayOfString['À'] = "account";
    arrayOfString['Á'] = "digest";
    arrayOfString['Â'] = "g_notify";
    arrayOfString['Ã'] = "method";
    arrayOfString['Ä'] = "password";
    arrayOfString['Å'] = "registration";
    arrayOfString['Æ'] = "stat";
    arrayOfString['Ç'] = "text";
    arrayOfString['È'] = "user";
    arrayOfString['É'] = "username";
    arrayOfString['Ê'] = "event";
    arrayOfString['Ë'] = "latitude";
    arrayOfString['Ì'] = "longitude";
    arrayOfString['Í'] = "true";
    arrayOfString['Î'] = "after";
    arrayOfString['Ï'] = "before";
    arrayOfString['Ð'] = "broadcast";
    arrayOfString['Ñ'] = "count";
    arrayOfString['Ò'] = "features";
    arrayOfString['Ó'] = "first";
    arrayOfString['Ô'] = "index";
    arrayOfString['Õ'] = "invalid-mechanism";
    arrayOfString['Ö'] = "last";
    arrayOfString['×'] = "max";
    arrayOfString['Ø'] = "offline";
    arrayOfString['Ù'] = "proceed";
    arrayOfString['Ú'] = "required";
    arrayOfString['Û'] = "sync";
    arrayOfString['Ü'] = "elapsed";
    arrayOfString['Ý'] = "ip";
    arrayOfString['Þ'] = "microsoft";
    arrayOfString['ß'] = "mute";
    arrayOfString['à'] = "nokia";
    arrayOfString['á'] = "off";
    arrayOfString['â'] = "pin";
    arrayOfString['ã'] = "pop_mean_time";
    arrayOfString['ä'] = "pop_plus_minus";
    arrayOfString['å'] = "port";
    arrayOfString['æ'] = "reason";
    arrayOfString['ç'] = "server-error";
    arrayOfString['è'] = "silent";
    arrayOfString['é'] = "timeout";
    arrayOfString['ê'] = "lc";
    arrayOfString['ë'] = "lg";
    arrayOfString['ì'] = "bad-protocol";
    arrayOfString['í'] = "none";
    arrayOfString['î'] = "remote-server-timeout";
    arrayOfString['ï'] = "service-unavailable";
    arrayOfString['ð'] = "w:p";
    arrayOfString['ñ'] = "w:profile:picture";
    arrayOfString['ò'] = "notification";
    dictionary = arrayOfString;
  }

  public static void destroyMessage(FMessage paramFMessage)
  {
    message_store.remove(paramFMessage.key);
  }

  public static String getResourceFromJID(String paramString)
  {
    int i = paramString.indexOf('/');
    String str;
    if (i != -1)
      str = paramString.substring(i + 1);
    else
      str = "";
    return str;
  }

  public static String getTextAndEntities(XmlPullParser paramXmlPullParser)
    throws IOException, XmlPullParserException
  {
    StringBuffer localStringBuffer = new StringBuffer();
    paramXmlPullParser.nextToken();
    while (true)
    {
      if (paramXmlPullParser.getEventType() == 3)
        return localStringBuffer.toString();
      if ((paramXmlPullParser.getEventType() != 6) && (paramXmlPullParser.getEventType() != 4))
        throw new XmlPullParserException("getTextAndEntities bad type: " + paramXmlPullParser.getEventType());
      localStringBuffer.append(paramXmlPullParser.getText());
      paramXmlPullParser.nextToken();
    }
  }

  public static void ignoreElement(XmlPullParser paramXmlPullParser, String paramString)
    throws IOException, XmlPullParserException
  {
    int i = 0;
    while (true)
    {
      paramXmlPullParser.nextToken();
      if ((paramXmlPullParser.getEventType() == 4) || (paramXmlPullParser.getEventType() == 6))
        continue;
      if (paramXmlPullParser.getEventType() != 2)
      {
        if (i != 0)
        {
          paramXmlPullParser.require(3, null, null);
          i--;
          continue;
        }
        paramXmlPullParser.require(3, null, paramString);
        return;
      }
      i++;
    }
  }

  public static String removeResourceFromJID(String paramString)
  {
    int i = paramString.indexOf('/');
    String str;
    if (i != -1)
      str = paramString.substring(0, i);
    else
      str = paramString;
    return str;
  }

  public static final class KeyValue
  {
    public final String key;
    public final String value;

    public KeyValue(String paramString1, String paramString2)
    {
      if ((paramString2 != null) && (paramString1 != null))
      {
        this.key = paramString1;
        this.value = paramString2;
        return;
      }
      throw new NullPointerException();
    }
  }

  public static final class ProtocolTreeNode
  {
    public final FunXMPP.KeyValue[] attributes;
    public final ProtocolTreeNode[] children;
    public final byte[] data;
    public final String tag;

    public ProtocolTreeNode(String paramString, FunXMPP.KeyValue[] paramArrayOfKeyValue)
    {
      this.tag = paramString;
      this.attributes = paramArrayOfKeyValue;
      this.children = null;
      this.data = null;
    }

    public ProtocolTreeNode(String paramString1, FunXMPP.KeyValue[] paramArrayOfKeyValue, String paramString2)
      throws UnsupportedEncodingException
    {
      this.tag = paramString1;
      this.attributes = paramArrayOfKeyValue;
      this.children = null;
      if (paramString2 == null)
        this.data = null;
      else
        this.data = paramString2.getBytes("UTF-8");
    }

    public ProtocolTreeNode(String paramString, FunXMPP.KeyValue[] paramArrayOfKeyValue, ProtocolTreeNode paramProtocolTreeNode)
    {
      this.tag = paramString;
      this.attributes = paramArrayOfKeyValue;
      ProtocolTreeNode[] arrayOfProtocolTreeNode = new ProtocolTreeNode[1];
      arrayOfProtocolTreeNode[0] = paramProtocolTreeNode;
      this.children = arrayOfProtocolTreeNode;
      this.data = null;
    }

    public ProtocolTreeNode(String paramString, FunXMPP.KeyValue[] paramArrayOfKeyValue, byte[] paramArrayOfByte)
    {
      this.tag = paramString;
      this.attributes = paramArrayOfKeyValue;
      this.children = null;
      this.data = paramArrayOfByte;
    }

    public ProtocolTreeNode(String paramString, FunXMPP.KeyValue[] paramArrayOfKeyValue, ProtocolTreeNode[] paramArrayOfProtocolTreeNode)
    {
      this.tag = paramString;
      this.attributes = paramArrayOfKeyValue;
      this.children = paramArrayOfProtocolTreeNode;
      this.data = null;
    }

    public static void require(ProtocolTreeNode paramProtocolTreeNode, String paramString)
      throws FunXMPP.CorruptStreamException
    {
      if (tagEquals(paramProtocolTreeNode, paramString))
        return;
      throw new FunXMPP.CorruptStreamException("failed require. node: " + paramProtocolTreeNode + " string: " + paramString);
    }

    public static ProtocolTreeNode safeGetChild(ProtocolTreeNode paramProtocolTreeNode, int paramInt)
      throws FunXMPP.CorruptStreamException
    {
      if ((paramProtocolTreeNode != null) && (paramProtocolTreeNode.children != null) && (paramProtocolTreeNode.children.length > paramInt))
        return paramProtocolTreeNode.children[paramInt];
      throw new FunXMPP.CorruptStreamException("safeGetChild sees null node/child");
    }

    public static boolean tagEquals(ProtocolTreeNode paramProtocolTreeNode, String paramString)
    {
      int i;
      if ((paramProtocolTreeNode == null) || (paramProtocolTreeNode.tag == null) || (!paramProtocolTreeNode.tag.equals(paramString)))
        i = 0;
      else
        i = 1;
      return i;
    }

    public Vector getAllChildren(String paramString)
    {
      Vector localVector = new Vector();
      if (this.children != null);
      for (int i = 0; ; i++)
      {
        if (i >= this.children.length)
          return localVector;
        if (!paramString.equals(this.children[i].tag))
          continue;
        localVector.addElement(this.children[i]);
      }
    }

    public String getAttributeValue(String paramString)
    {
      Object localObject;
      if (this.attributes != null)
      {
        for (int i = 0; ; i++)
        {
          if (i >= this.attributes.length)
          {
            localObject = null;
            break label57;
          }
          localObject = this.attributes[i];
          if (paramString.equals(((FunXMPP.KeyValue)localObject).key))
            break;
        }
        localObject = ((FunXMPP.KeyValue)localObject).value;
      }
      else
      {
        localObject = null;
      }
      label57: return (String)localObject;
    }

    public ProtocolTreeNode getChild(int paramInt)
    {
      ProtocolTreeNode localProtocolTreeNode;
      if ((this.children != null) && (this.children.length > paramInt))
        localProtocolTreeNode = this.children[paramInt];
      else
        localProtocolTreeNode = null;
      return localProtocolTreeNode;
    }

    public ProtocolTreeNode getChild(String paramString)
    {
      ProtocolTreeNode localProtocolTreeNode;
      if (this.children != null)
      {
        for (int i = 0; ; localProtocolTreeNode++)
        {
          if (i >= this.children.length)
          {
            localProtocolTreeNode = null;
            break label57;
          }
          if (paramString.equals(this.children[localProtocolTreeNode].tag))
            break;
        }
        localProtocolTreeNode = this.children[localProtocolTreeNode];
      }
      else
      {
        localProtocolTreeNode = null;
      }
      label57: return localProtocolTreeNode;
    }

    public String getDataStr()
      throws UnsupportedEncodingException
    {
      String str;
      if (this.data != null)
        str = new String(this.data, "UTF-8");
      else
        str = null;
      return str;
    }
  }

  public static class XmlTreeNodeReader
    implements FunXMPP.TreeNodeReader
  {
    final Reader in;
    final KXmlParser parser = new KXmlParser();

    public XmlTreeNodeReader(Reader paramReader)
      throws XmlPullParserException
    {
      this.in = paramReader;
    }

    private FunXMPP.ProtocolTreeNode nextInternalTree()
      throws XmlPullParserException, IOException, FunXMPP.CorruptStreamException
    {
      String str = this.parser.getName();
      int i = this.parser.getAttributeCount();
      Object localObject1 = new FunXMPP.KeyValue[i];
      FunXMPP.ProtocolTreeNode[] arrayOfProtocolTreeNode;
      for (int j = 0; ; arrayOfProtocolTreeNode++)
      {
        if (j >= i)
        {
          i = this.parser.next();
          if ((i == 4) && (this.parser.isWhitespace()))
            i = this.parser.next();
          Object localObject2;
          if (i != 4)
          {
            if (i != 2)
            {
              if (i != 3)
                throw new FunXMPP.CorruptStreamException("unexpected tag in nextInternalTree", lastStanza());
              localObject1 = new FunXMPP.ProtocolTreeNode(str, localObject1);
            }
            else
            {
              localObject2 = new Vector();
              do
              {
                ((Vector)localObject2).addElement(nextInternalTree());
                j = this.parser.nextTag();
              }
              while (j == 2);
              if ((j == 3) && (this.parser.getName() == str))
              {
                int k = ((Vector)localObject2).size();
                arrayOfProtocolTreeNode = new FunXMPP.ProtocolTreeNode[k];
                for (int m = 0; ; m++)
                {
                  if (m >= k)
                  {
                    localObject1 = new FunXMPP.ProtocolTreeNode(str, localObject1, arrayOfProtocolTreeNode);
                    break;
                  }
                  arrayOfProtocolTreeNode[m] = ((FunXMPP.ProtocolTreeNode)((Vector)localObject2).elementAt(m));
                }
              }
              throw new FunXMPP.CorruptStreamException("expecting END_TAG in nextInternalTree START_TAG", lastStanza());
            }
          }
          else
          {
            localObject2 = this.parser.getText();
            if ((this.parser.nextTag() != 3) || (!this.parser.getName().equals(str)))
              break label269;
            localObject1 = new FunXMPP.ProtocolTreeNode(str, localObject1, (String)localObject2);
          }
          return localObject1;
          label269: throw new FunXMPP.CorruptStreamException("expecting END_TAG in nextInternalTree TEXT", lastStanza());
        }
        localObject1[arrayOfProtocolTreeNode] = new FunXMPP.KeyValue(this.parser.getAttributeName(arrayOfProtocolTreeNode), this.parser.getAttributeValue(arrayOfProtocolTreeNode));
      }
    }

    public String lastStanza()
    {
      return "";
    }

    public FunXMPP.ProtocolTreeNode nextTree()
      throws FunXMPP.CorruptStreamException, IOException
    {
      try
      {
        int i = this.parser.nextTag();
        String str = this.parser.getName();
        if ((i == 3) && (str.equals("stream:stream")))
        {
          str = null;
          break label96;
        }
        if (i != 2)
          throw new FunXMPP.CorruptStreamException("expecting START_TAG in nextTree", lastStanza());
      }
      catch (XmlPullParserException localXmlPullParserException)
      {
        throw new FunXMPP.CorruptStreamException("got XmlPullParseX : " + localXmlPullParserException.toString(), lastStanza());
      }
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = nextInternalTree();
      localProtocolTreeNode = localProtocolTreeNode;
      label96: return localProtocolTreeNode;
    }

    public void streamStart()
      throws IOException, FunXMPP.CorruptStreamException
    {
      try
      {
        this.parser.setInput(this.in);
        this.parser.nextTag();
        this.parser.require(2, null, "stream:stream");
        return;
      }
      catch (XmlPullParserException localXmlPullParserException)
      {
      }
      throw new FunXMPP.CorruptStreamException("streamStart got xml error: " + localXmlPullParserException.toString(), lastStanza());
    }
  }

  public static class XmlTreeNodeWriter
    implements FunXMPP.TreeNodeWriter
  {
    final Writer out;

    public XmlTreeNodeWriter(Writer paramWriter)
      throws IOException
    {
      this.out = paramWriter;
    }

    static String getEntity(char paramChar)
    {
      String str;
      switch (paramChar)
      {
      default:
        str = null;
        break;
      case '"':
        str = """;
        break;
      case '&':
        str = "&";
        break;
      case '\'':
        str = "'";
        break;
      case '<':
        str = "&lt;";
        break;
      case '>':
        str = "&gt;";
      }
      return str;
    }

    private void writeInternal(FunXMPP.ProtocolTreeNode paramProtocolTreeNode)
      throws IOException
    {
      writeNode(paramProtocolTreeNode);
    }

    private void writeNode(FunXMPP.ProtocolTreeNode paramProtocolTreeNode)
      throws IOException
    {
      this.out.write(60);
      this.out.write(paramProtocolTreeNode.tag);
      if (paramProtocolTreeNode.attributes != null);
      for (int i = 0; ; i++)
      {
        if (i >= paramProtocolTreeNode.attributes.length)
        {
          if ((paramProtocolTreeNode.data != null) || (paramProtocolTreeNode.children != null))
          {
            this.out.write(62);
            if (paramProtocolTreeNode.data != null)
              sendTextConvertEntities(paramProtocolTreeNode.getDataStr());
            if (paramProtocolTreeNode.children != null)
              i = 0;
          }
          while (true)
            if (i >= paramProtocolTreeNode.children.length)
            {
              this.out.write("</");
              this.out.write(paramProtocolTreeNode.tag);
              this.out.write(62);
            }
            else
            {
              writeInternal(paramProtocolTreeNode.children[i]);
              i++;
              continue;
              this.out.write("/>");
            }
          return;
        }
        this.out.write(32);
        this.out.write(paramProtocolTreeNode.attributes[i].key);
        this.out.write("='");
        sendTextConvertEntities(paramProtocolTreeNode.attributes[i].value);
        this.out.write(39);
      }
    }

    void sendTextConvertEntities(String paramString)
      throws IOException
    {
      int i = 0;
      for (int j = 0; ; j++)
      {
        if (j >= paramString.length())
        {
          this.out.write(paramString, i, j - i);
          return;
        }
        String str = getEntity(paramString.charAt(j));
        if (str == null)
          continue;
        this.out.write(paramString, i, j - i);
        i = j + 1;
        this.out.write(str);
      }
    }

    /** @deprecated */
    public void streamEnd()
      throws IOException
    {
      monitorenter;
      try
      {
        this.out.write("</stream:stream>");
        this.out.flush();
        monitorexit;
        return;
      }
      finally
      {
        localObject = finally;
        monitorexit;
      }
      throw localObject;
    }

    /** @deprecated */
    public void streamStart(String paramString1, String paramString2)
      throws IOException
    {
      monitorenter;
      try
      {
        this.out.write("<stream:stream to=\"");
        this.out.write(paramString1);
        this.out.write("\" version=\"1.0\" xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\">");
        this.out.flush();
        monitorexit;
        return;
      }
      finally
      {
        localObject = finally;
        monitorexit;
      }
      throw localObject;
    }

    /** @deprecated */
    public void write(FunXMPP.ProtocolTreeNode paramProtocolTreeNode)
      throws IOException
    {
      monitorenter;
      try
      {
        write(paramProtocolTreeNode, true);
        monitorexit;
        return;
      }
      finally
      {
        localObject = finally;
        monitorexit;
      }
      throw localObject;
    }

    /** @deprecated */
    public void write(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, boolean paramBoolean)
      throws IOException
    {
      monitorenter;
      if (paramProtocolTreeNode == null);
      try
      {
        this.out.write(" ");
        while (true)
        {
          if (paramBoolean)
            this.out.flush();
          return;
          writeInternal(paramProtocolTreeNode);
        }
      }
      finally
      {
        monitorexit;
      }
      throw localObject;
    }
  }

  public static class BinTreeNodeReader
    implements FunXMPP.TreeNodeReader
  {
    byte[] buf = new byte['ÿ'];
    int bufSize = 0;
    InputStream in;
    InputStream rawIn;
    String[] tokenMap;

    public BinTreeNodeReader(InputStream paramInputStream, String[] paramArrayOfString)
    {
      this.rawIn = new FunXMPP.EofIsExceptionInputStream(paramInputStream);
      this.tokenMap = paramArrayOfString;
    }

    private static void fillArray(byte[] paramArrayOfByte, int paramInt, InputStream paramInputStream)
      throws IOException
    {
      int i = 0;
      while (true)
      {
        if (i >= paramInt)
          return;
        i += paramInputStream.read(paramArrayOfByte, i, paramInt - i);
      }
    }

    private static void fillArray(byte[] paramArrayOfByte, InputStream paramInputStream)
      throws IOException
    {
      fillArray(paramArrayOfByte, paramArrayOfByte.length, paramInputStream);
    }

    private void fillBuffer(int paramInt)
      throws IOException
    {
      if (this.buf.length < paramInt)
        this.buf = new byte[Math.max(3 * this.buf.length / 2, paramInt)];
      this.bufSize = paramInt;
      fillArray(this.buf, paramInt, this.rawIn);
      this.in = new ByteArrayInputStream(this.buf, 0, paramInt);
    }

    private String getToken(int paramInt)
      throws FunXMPP.CorruptStreamException
    {
      String str;
      if ((paramInt < 0) || (paramInt >= this.tokenMap.length))
        str = null;
      else
        str = this.tokenMap[paramInt];
      if (str != null)
        return str;
      throw new FunXMPP.CorruptStreamException("invalid token/length in getToken", lastStanza());
    }

    private boolean isListTag(int paramInt)
    {
      int i;
      if ((paramInt != 248) && (paramInt != 0) && (paramInt != 249))
        i = 0;
      else
        i = 1;
      return i;
    }

    private FunXMPP.ProtocolTreeNode nextTreeInternal()
      throws FunXMPP.CorruptStreamException, IOException
    {
      int j = readListSize(this.in.read());
      int i = this.in.read();
      Object localObject;
      if (i != 2)
      {
        localObject = readString(i);
        if ((j != 0) && (localObject != null))
        {
          FunXMPP.KeyValue[] arrayOfKeyValue = readAttributes((j - 2 + j % 2) / 2);
          if (j % 2 != 1)
          {
            j = this.in.read();
            byte[] arrayOfByte;
            if (!isListTag(j))
            {
              if (j != 252)
              {
                if (j != 253)
                {
                  localObject = new FunXMPP.ProtocolTreeNode((String)localObject, arrayOfKeyValue, readString(j));
                }
                else
                {
                  arrayOfByte = new byte[readInt24(this.in)];
                  fillArray(arrayOfByte, this.in);
                  localObject = new FunXMPP.ProtocolTreeNode((String)localObject, arrayOfKeyValue, arrayOfByte);
                }
              }
              else
              {
                arrayOfByte = new byte[readInt8(this.in)];
                fillArray(arrayOfByte, this.in);
                localObject = new FunXMPP.ProtocolTreeNode((String)localObject, arrayOfKeyValue, arrayOfByte);
              }
            }
            else
              localObject = new FunXMPP.ProtocolTreeNode((String)localObject, arrayOfKeyValue, readList(arrayOfByte));
          }
          else
          {
            localObject = new FunXMPP.ProtocolTreeNode((String)localObject, arrayOfKeyValue);
          }
        }
        else
        {
          throw new FunXMPP.CorruptStreamException("nextTree sees 0 list or null tag", lastStanza());
        }
      }
      else
      {
        localObject = null;
      }
      return (FunXMPP.ProtocolTreeNode)localObject;
    }

    private FunXMPP.KeyValue[] readAttributes(int paramInt)
      throws IOException, FunXMPP.CorruptStreamException
    {
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[paramInt];
      for (int i = 0; ; i++)
      {
        if (i >= paramInt)
          return arrayOfKeyValue;
        arrayOfKeyValue[i] = new FunXMPP.KeyValue(readString(), readString());
      }
    }

    private static int readInt16(InputStream paramInputStream)
      throws IOException
    {
      int i = paramInputStream.read();
      return paramInputStream.read() + (i << 8);
    }

    private static int readInt24(InputStream paramInputStream)
      throws IOException
    {
      int i = paramInputStream.read();
      int k = paramInputStream.read();
      int j = paramInputStream.read();
      return (i << 16) + (k << 8) + (j << 0);
    }

    private static int readInt8(InputStream paramInputStream)
      throws IOException
    {
      return paramInputStream.read();
    }

    private FunXMPP.ProtocolTreeNode[] readList()
      throws IOException, FunXMPP.CorruptStreamException
    {
      return readList(this.in.read());
    }

    private FunXMPP.ProtocolTreeNode[] readList(int paramInt)
      throws FunXMPP.CorruptStreamException, IOException
    {
      int j = readListSize(paramInt);
      FunXMPP.ProtocolTreeNode[] arrayOfProtocolTreeNode = new FunXMPP.ProtocolTreeNode[j];
      for (int i = 0; ; i++)
      {
        if (i >= j)
          return arrayOfProtocolTreeNode;
        arrayOfProtocolTreeNode[i] = nextTreeInternal();
      }
    }

    private int readListSize(int paramInt)
      throws IOException, FunXMPP.CorruptStreamException
    {
      int i;
      if (paramInt != 0)
      {
        if (paramInt != 248)
        {
          if (paramInt != 249)
            throw new FunXMPP.CorruptStreamException("invalid list size in readListSize: token " + paramInt, lastStanza());
          i = readInt16(this.in);
        }
        else
        {
          i = readInt8(this.in);
        }
      }
      else
        i = 0;
      return i;
    }

    private String readString()
      throws IOException, FunXMPP.CorruptStreamException
    {
      return readString(this.in.read());
    }

    private String readString(int paramInt)
      throws IOException, FunXMPP.CorruptStreamException
    {
      if (paramInt != -1)
      {
        if ((paramInt <= 4) || (paramInt >= 245));
        Object localObject;
        switch (paramInt)
        {
        default:
          throw new FunXMPP.CorruptStreamException("readString couldn't match token", lastStanza());
        case 0:
          localObject = null;
          break;
        case 250:
          String str = readString();
          localObject = readString();
          if ((str == null) || (localObject == null))
          {
            if (localObject == null)
              throw new FunXMPP.CorruptStreamException("readString couldn't reconstruct jid", lastStanza());
            localObject = localObject;
          }
          else
          {
            localObject = str + "@" + (String)localObject;
          }
          break;
        case 252:
          localObject = new byte[readInt8(this.in)];
          fillArray(localObject, this.in);
          localObject = new String(localObject, "UTF-8");
          break;
        case 253:
          localObject = new byte[readInt24(this.in)];
          fillArray(localObject, this.in);
          localObject = new String(localObject, "UTF-8");
          break;
        case 254:
          localObject = getToken(245 + (byte)this.in.read());
          break;
          localObject = getToken(paramInt);
        }
        return localObject;
      }
      throw new FunXMPP.CorruptStreamException("-1 token in readString", lastStanza());
    }

    public String lastStanza()
    {
      if (this.buf != null)
      {
        localObject = new StringBuffer();
        ((StringBuffer)localObject).append("size = ").append(Integer.toString(this.bufSize)).append('<');
        for (int i = 0; ; i++)
        {
          if (i >= this.bufSize)
          {
            ((StringBuffer)localObject).append('>');
            localObject = ((StringBuffer)localObject).toString();
            break;
          }
          if (i > 0)
            ((StringBuffer)localObject).append(", ");
          ((StringBuffer)localObject).append(Integer.toString(0xFF & this.buf[i]));
        }
      }
      Object localObject = "null";
      return (String)localObject;
    }

    public FunXMPP.ProtocolTreeNode nextTree()
      throws FunXMPP.CorruptStreamException, IOException
    {
      fillBuffer(readInt16(this.rawIn));
      return nextTreeInternal();
    }

    public void streamStart()
      throws IOException, FunXMPP.CorruptStreamException
    {
      fillBuffer(readInt16(this.rawIn));
      int i = readListSize(this.in.read());
      if (this.in.read() == 1)
      {
        readAttributes((i - 2 + i % 2) / 2);
        return;
      }
      throw new FunXMPP.CorruptStreamException("expecting STREAM_START in streamStart", lastStanza());
    }
  }

  public static class EofIsExceptionInputStream extends InputStream
  {
    InputStream inner;

    public EofIsExceptionInputStream(InputStream paramInputStream)
    {
      this.inner = paramInputStream;
    }

    public int available()
      throws IOException
    {
      return this.inner.available();
    }

    public void close()
      throws IOException
    {
      this.inner.close();
    }

    /** @deprecated */
    public void mark(int paramInt)
    {
      monitorenter;
      try
      {
        this.inner.mark(paramInt);
        monitorexit;
        return;
      }
      finally
      {
        localObject = finally;
        monitorexit;
      }
      throw localObject;
    }

    public boolean markSupported()
    {
      return this.inner.markSupported();
    }

    public int read()
      throws IOException
    {
      int i = this.inner.read();
      if (i != -1)
        return i;
      throw new EOFException();
    }

    public int read(byte[] paramArrayOfByte)
      throws IOException
    {
      int i = this.inner.read(paramArrayOfByte);
      if (i != -1)
        return i;
      throw new EOFException();
    }

    public int read(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
      throws IOException
    {
      int i = this.inner.read(paramArrayOfByte, paramInt1, paramInt2);
      if (i != -1)
        return i;
      throw new EOFException();
    }

    /** @deprecated */
    public void reset()
      throws IOException
    {
      monitorenter;
      try
      {
        this.inner.reset();
        monitorexit;
        return;
      }
      finally
      {
        localObject = finally;
        monitorexit;
      }
      throw localObject;
    }

    public long skip(long paramLong)
      throws IOException
    {
      return this.inner.skip(paramLong);
    }
  }

  public static class BinTreeNodeWriter
    implements FunXMPP.TreeNodeWriter
  {
    private static final int BINARY_24 = 253;
    private static final int BINARY_8 = 252;
    private static final int JID_PAIR = 250;
    private static final int LIST_16 = 249;
    private static final int LIST_8 = 248;
    private static final int LIST_EMPTY = 0;
    private static final int STREAM_END = 2;
    private static final int STREAM_START = 1;
    private static final int TOKEN_8 = 254;
    FunXMPP.WAByteArrayOutputStream out;
    OutputStream realOut;
    Hashtable tokenMap;

    public BinTreeNodeWriter(OutputStream paramOutputStream, String[] paramArrayOfString)
    {
      this.realOut = paramOutputStream;
      this.out = new FunXMPP.WAByteArrayOutputStream();
      this.tokenMap = new Hashtable();
      for (int i = 0; ; i++)
      {
        if (i >= paramArrayOfString.length)
          return;
        if (paramArrayOfString[i] == null)
          continue;
        this.tokenMap.put(paramArrayOfString[i], new Integer(i));
      }
    }

    private void writeAttributes(FunXMPP.KeyValue[] paramArrayOfKeyValue)
      throws IOException
    {
      if (paramArrayOfKeyValue != null);
      for (int i = 0; ; i++)
      {
        if (i >= paramArrayOfKeyValue.length)
          return;
        writeString(paramArrayOfKeyValue[i].key);
        writeString(paramArrayOfKeyValue[i].value);
      }
    }

    private void writeBytes(byte[] paramArrayOfByte)
      throws IOException
    {
      int i = paramArrayOfByte.length;
      if (i < 256)
      {
        this.out.write(252);
        writeInt8(i);
      }
      else
      {
        this.out.write(253);
        writeInt24(i);
      }
      this.out.write(paramArrayOfByte);
    }

    private void writeInt16(int paramInt)
      throws IOException
    {
      writeInt16(this.out, paramInt);
    }

    private static void writeInt16(OutputStream paramOutputStream, int paramInt)
      throws IOException
    {
      paramOutputStream.write((0xFF00 & paramInt) >> 8);
      paramOutputStream.write((paramInt & 0xFF) >> 0);
    }

    private void writeInt24(int paramInt)
      throws IOException
    {
      this.out.write((0xFF0000 & paramInt) >> 16);
      this.out.write((0xFF00 & paramInt) >> 8);
      this.out.write((paramInt & 0xFF) >> 0);
    }

    private void writeInt8(int paramInt)
      throws IOException
    {
      this.out.write(paramInt & 0xFF);
    }

    private void writeInternal(FunXMPP.ProtocolTreeNode paramProtocolTreeNode)
      throws IOException
    {
      if (paramProtocolTreeNode.attributes != null)
        i = 2 * paramProtocolTreeNode.attributes.length;
      else
        i = 0;
      int j = i + 1;
      if (paramProtocolTreeNode.children != null)
        i = 1;
      else
        i = 0;
      j += i;
      if (paramProtocolTreeNode.data != null)
        i = 1;
      else
        i = 0;
      writeListStart(j + i);
      writeString(paramProtocolTreeNode.tag);
      writeAttributes(paramProtocolTreeNode.attributes);
      if (paramProtocolTreeNode.data != null)
        writeBytes(paramProtocolTreeNode.data);
      if (paramProtocolTreeNode.children != null)
        writeListStart(paramProtocolTreeNode.children.length);
      for (int i = 0; ; i++)
      {
        if (i >= paramProtocolTreeNode.children.length)
          return;
        writeInternal(paramProtocolTreeNode.children[i]);
      }
    }

    private void writeJid(String paramString1, String paramString2)
      throws IOException
    {
      this.out.write(250);
      if (paramString1 == null)
        writeToken(0);
      else
        writeString(paramString1);
      writeString(paramString2);
    }

    private void writeListStart(int paramInt)
      throws IOException
    {
      if (paramInt != 0)
      {
        if (paramInt >= 256)
        {
          this.out.write(249);
          writeInt16(paramInt);
        }
        else
        {
          this.out.write(248);
          writeInt8(paramInt);
        }
      }
      else
        this.out.write(0);
    }

    private void writeString(String paramString)
      throws IOException
    {
      try
      {
        Integer localInteger = (Integer)this.tokenMap.get(paramString);
        if (localInteger != null)
        {
          writeToken(localInteger.intValue());
          return;
        }
        int i = paramString.indexOf('@');
        if (i < 1)
          writeBytes(paramString.getBytes("UTF-8"));
      }
      catch (UnsupportedEncodingException localUnsupportedEncodingException)
      {
        throw new RuntimeException(localUnsupportedEncodingException.getMessage());
      }
      int j = localUnsupportedEncodingException + 1;
      String str = paramString.substring(j);
      writeJid(paramString.substring(0, localUnsupportedEncodingException), str);
    }

    private void writeToken(int paramInt)
      throws IOException
    {
      if (paramInt >= 245)
      {
        if (paramInt <= 500)
        {
          this.out.write(254);
          this.out.write((byte)(paramInt - 245));
        }
      }
      else
        this.out.write((byte)paramInt);
    }

    /** @deprecated */
    public void flushBuffer(boolean paramBoolean)
      throws IOException
    {
      monitorenter;
      try
      {
        int i = this.out.getCount();
        if ((0xFFFF0000 & i) != 0)
          throw new IOException("Buffer too large: " + i);
      }
      finally
      {
        monitorexit;
      }
      writeInt16(this.realOut, localObject);
      this.realOut.write(this.out.getBuffer(), 0, localObject);
      this.out.reset();
      if (paramBoolean)
        this.realOut.flush();
      monitorexit;
    }

    /** @deprecated */
    public void streamEnd()
      throws IOException
    {
      monitorenter;
      try
      {
        writeListStart(1);
        this.out.write(2);
        flushBuffer(true);
        monitorexit;
        return;
      }
      finally
      {
        localObject = finally;
        monitorexit;
      }
      throw localObject;
    }

    /** @deprecated */
    public void streamStart(String paramString1, String paramString2)
      throws IOException
    {
      monitorenter;
      try
      {
        Object localObject1 = new byte[4];
        localObject1[0] = 87;
        localObject1[1] = 65;
        localObject1[2] = 1;
        localObject1[3] = 1;
        this.realOut.write(localObject1);
        localObject1 = new FunXMPP.KeyValue[2];
        localObject1[0] = new FunXMPP.KeyValue("to", paramString1);
        localObject1[1] = new FunXMPP.KeyValue("resource", paramString2);
        writeListStart(1 + 2 * localObject1.length);
        this.out.write(1);
        writeAttributes(localObject1);
        flushBuffer(false);
        monitorexit;
        return;
      }
      finally
      {
        localObject2 = finally;
        monitorexit;
      }
      throw localObject2;
    }

    /** @deprecated */
    public void write(FunXMPP.ProtocolTreeNode paramProtocolTreeNode)
      throws IOException
    {
      monitorenter;
      try
      {
        write(paramProtocolTreeNode, true);
        monitorexit;
        return;
      }
      finally
      {
        localObject = finally;
        monitorexit;
      }
      throw localObject;
    }

    /** @deprecated */
    public void write(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, boolean paramBoolean)
      throws IOException
    {
      monitorenter;
      if (paramProtocolTreeNode == null);
      try
      {
        this.out.write(0);
        while (true)
        {
          flushBuffer(paramBoolean);
          return;
          writeInternal(paramProtocolTreeNode);
        }
      }
      finally
      {
        monitorexit;
      }
      throw localObject;
    }
  }

  public static class WAByteArrayOutputStream extends ByteArrayOutputStream
  {
    public byte[] getBuffer()
    {
      return this.buf;
    }

    public int getCount()
    {
      return this.count;
    }
  }

  public static abstract interface TreeNodeReader
  {
    public abstract String lastStanza();

    public abstract FunXMPP.ProtocolTreeNode nextTree()
      throws FunXMPP.CorruptStreamException, IOException;

    public abstract void streamStart()
      throws IOException, FunXMPP.CorruptStreamException;
  }

  public static abstract interface TreeNodeWriter
  {
    public abstract void streamEnd()
      throws IOException;

    public abstract void streamStart(String paramString1, String paramString2)
      throws IOException;

    public abstract void write(FunXMPP.ProtocolTreeNode paramProtocolTreeNode)
      throws IOException;

    public abstract void write(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, boolean paramBoolean)
      throws IOException;
  }

  public static abstract class Login
  {
    static String nonce_key = "nonce=\"";
    FunXMPP.Connection connection;
    MessageDigest digest;
    FunXMPP.TreeNodeReader in;
    FunXMPP.TreeNodeWriter out;

    public Login(MessageDigest paramMessageDigest, FunXMPP.TreeNodeReader paramTreeNodeReader, FunXMPP.TreeNodeWriter paramTreeNodeWriter)
    {
      this.in = paramTreeNodeReader;
      this.out = paramTreeNodeWriter;
      this.digest = paramMessageDigest;
    }

    byte[] bytesToHex(byte[] paramArrayOfByte)
    {
      byte[] arrayOfByte = new byte[2 * paramArrayOfByte.length];
      int k = 0;
      for (int j = 0; ; j++)
      {
        if (j >= paramArrayOfByte.length)
          return arrayOfByte;
        int i = paramArrayOfByte[j];
        if (i < 0)
          i += 256;
        arrayOfByte[k] = forDigit(i >> 4);
        k += 1;
        arrayOfByte[k] = forDigit(i % 16);
        k += 1;
      }
    }

    byte forDigit(int paramInt)
    {
      int i;
      if (paramInt >= 10)
        i = (byte)(paramInt + 97 - 10);
      else
        i = (byte)(paramInt + 48);
      return i;
    }

    protected String getResponse(String paramString)
      throws IOException
    {
      int i = paramString.indexOf(nonce_key);
      if (i != -1)
      {
        int j = i + nonce_key.length();
        i = paramString.indexOf('"', j);
        if (i != -1)
        {
          String str3 = paramString.substring(j, i);
          String str1 = Long.toString(Math.abs(new Random().nextLong()), 36);
          Object localObject1 = new ByteArrayOutputStream();
          ((ByteArrayOutputStream)localObject1).write(md5Digest((this.connection.user + ":" + this.connection.domain + ":" + this.connection.password).getBytes()));
          ((ByteArrayOutputStream)localObject1).write(58);
          ((ByteArrayOutputStream)localObject1).write(str3.getBytes());
          ((ByteArrayOutputStream)localObject1).write(58);
          ((ByteArrayOutputStream)localObject1).write(str1.getBytes());
          String str2 = "xmpp/" + this.connection.domain;
          Object localObject2 = ((ByteArrayOutputStream)localObject1).toByteArray();
          localObject1 = "AUTHENTICATE:" + str2;
          localObject1 = new String(bytesToHex(md5Digest((new String(bytesToHex(md5Digest(localObject2))) + ":" + str3 + ":" + "00000001" + ":" + str1 + ":auth:" + new String(bytesToHex(md5Digest(((String)localObject1).getBytes())))).getBytes())));
          localObject2 = new StringBuffer();
          ((StringBuffer)localObject2).append("realm=\"");
          ((StringBuffer)localObject2).append(this.connection.domain);
          ((StringBuffer)localObject2).append("\",response=");
          ((StringBuffer)localObject2).append((String)localObject1);
          ((StringBuffer)localObject2).append(",nonce=\"");
          ((StringBuffer)localObject2).append(str3);
          ((StringBuffer)localObject2).append("\",digest-uri=\"");
          ((StringBuffer)localObject2).append(str2);
          ((StringBuffer)localObject2).append("\",cnonce=\"");
          ((StringBuffer)localObject2).append(str1);
          ((StringBuffer)localObject2).append("\",qop=auth");
          ((StringBuffer)localObject2).append(",username=\"");
          ((StringBuffer)localObject2).append(this.connection.user);
          ((StringBuffer)localObject2).append("\",nc=");
          ((StringBuffer)localObject2).append("00000001");
          return ((StringBuffer)localObject2).toString();
        }
        throw new IOException("bad nonce in challenge");
      }
      throw new IOException("no nonce in challenge");
    }

    public FunXMPP.TreeNodeReader getTreeReader()
    {
      return this.in;
    }

    public FunXMPP.TreeNodeWriter getTreeWriter()
    {
      return this.out;
    }

    abstract void login()
      throws IOException, FunXMPP.LoginFailureException, FunXMPP.CorruptStreamException;

    byte[] md5Digest(byte[] paramArrayOfByte)
    {
      this.digest.reset();
      this.digest.update(paramArrayOfByte);
      return this.digest.digest();
    }

    public void setConnection(FunXMPP.Connection paramConnection)
    {
      this.connection = paramConnection;
    }

    public static final class WhatsApp extends FunXMPP.Login
    {
      public WhatsApp(FunXMPP.TreeNodeReader paramTreeNodeReader, FunXMPP.TreeNodeWriter paramTreeNodeWriter, MessageDigest paramMessageDigest)
      {
        super(paramTreeNodeReader, paramTreeNodeWriter);
      }

      private String readFeaturesAndChallenge()
        throws IOException, FunXMPP.CorruptStreamException
      {
        boolean bool = false;
        Integer localInteger = null;
        while (true)
        {
          FunXMPP.ProtocolTreeNode localProtocolTreeNode1 = this.in.nextTree();
          if (localProtocolTreeNode1 == null)
            throw new FunXMPP.CorruptStreamException("fell out of loop in readFeaturesAndChallenge", this.in.lastStanza());
          if (!FunXMPP.ProtocolTreeNode.tagEquals(localProtocolTreeNode1, "stream:features"))
          {
            if (!FunXMPP.ProtocolTreeNode.tagEquals(localProtocolTreeNode1, "challenge"))
              continue;
            FunXMPP.Connection localConnection = this.connection;
            if ((!this.connection.supports_receipt_acks) || (!bool))
              bool = false;
            else
              bool = true;
            localConnection.supports_receipt_acks = bool;
            if (localInteger != null)
              this.connection.server_properties_version = localInteger;
            return new String(Base64.decode(localProtocolTreeNode1.data));
          }
          FunXMPP.ProtocolTreeNode localProtocolTreeNode2 = localProtocolTreeNode1.getChild("receipt_acks");
          localProtocolTreeNode1 = localProtocolTreeNode1.getChild("props");
          int i;
          if (localProtocolTreeNode2 == null)
            i = 0;
          else
            i = 1;
          if (localProtocolTreeNode1 == null)
            continue;
          localInteger = new Integer(Integer.parseInt(localProtocolTreeNode1.getAttributeValue("version")));
        }
      }

      private void readSuccess()
        throws FunXMPP.CorruptStreamException, IOException, FunXMPP.LoginFailureException
      {
        Object localObject2 = this.in.nextTree();
        if (FunXMPP.ProtocolTreeNode.tagEquals((FunXMPP.ProtocolTreeNode)localObject2, "failure"))
          throw new FunXMPP.LoginFailureException(0);
        FunXMPP.ProtocolTreeNode.require((FunXMPP.ProtocolTreeNode)localObject2, "success");
        Object localObject1 = ((FunXMPP.ProtocolTreeNode)localObject2).getAttributeValue("expiration");
        if (localObject1 != null);
        while (true)
        {
          String str;
          try
          {
            this.connection.expire_date = Long.parseLong((String)localObject1);
            str = ((FunXMPP.ProtocolTreeNode)localObject2).getAttributeValue("kind");
            if ("paid".equals(str))
            {
              this.connection.account_kind = 1;
              localObject2 = ((FunXMPP.ProtocolTreeNode)localObject2).getAttributeValue("status");
              if (!"expired".equals(localObject2))
                break;
              localObject1 = new FunXMPP.LoginFailureException(1);
              ((FunXMPP.LoginFailureException)localObject1).expire_date = this.connection.expire_date;
              throw ((Throwable)localObject1);
            }
          }
          catch (NumberFormatException localNumberFormatException)
          {
            throw new IOException("invalid expire date: " + (String)localObject1);
          }
          if ("free".equals(str))
          {
            this.connection.account_kind = 0;
            continue;
          }
          this.connection.account_kind = -1;
        }
        if ("active".equals(localObject2))
        {
          if (localObject1 == null)
            throw new IOException("active account with no expiration");
        }
        else
          this.connection.account_kind = -1;
      }

      private void sendAuth()
        throws IOException
      {
        Object localObject = new FunXMPP.KeyValue[2];
        localObject[0] = new FunXMPP.KeyValue("xmlns", "urn:ietf:params:xml:ns:xmpp-sasl");
        localObject[1] = new FunXMPP.KeyValue("mechanism", "DIGEST-MD5-1");
        localObject = new FunXMPP.ProtocolTreeNode("auth", localObject);
        this.out.write((FunXMPP.ProtocolTreeNode)localObject);
      }

      private void sendFeatures()
        throws IOException
      {
        Object localObject2 = new Vector();
        if (this.connection.supports_receipt_acks)
          ((Vector)localObject2).add(new FunXMPP.ProtocolTreeNode("receipt_acks", null));
        if (this.connection.supports_group_photos)
        {
          localObject1 = new FunXMPP.KeyValue[1];
          localObject1[0] = new FunXMPP.KeyValue("type", "group");
          ((Vector)localObject2).add(new FunXMPP.ProtocolTreeNode("w:profile:picture", localObject1));
        }
        Object localObject1 = this.out;
        if (!((Vector)localObject2).isEmpty())
          localObject2 = ((Vector)localObject2).toArray(new FunXMPP.ProtocolTreeNode[0]);
        else
          localObject2 = null;
        ((FunXMPP.TreeNodeWriter)localObject1).write(new FunXMPP.ProtocolTreeNode("stream:features", null, (FunXMPP.ProtocolTreeNode[])localObject2), false);
      }

      private void sendResponse(String paramString)
        throws IOException
      {
        String str = getResponse(paramString);
        Object localObject = new FunXMPP.KeyValue[1];
        localObject[0] = new FunXMPP.KeyValue("xmlns", "urn:ietf:params:xml:ns:xmpp-sasl");
        localObject = new FunXMPP.ProtocolTreeNode("response", localObject, new String(Base64.encode(str.getBytes())));
        this.out.write((FunXMPP.ProtocolTreeNode)localObject);
      }

      public void login()
        throws IOException, FunXMPP.LoginFailureException, FunXMPP.CorruptStreamException
      {
        this.out.streamStart(this.connection.domain, this.connection.resource);
        sendFeatures();
        sendAuth();
        this.in.streamStart();
        sendResponse(readFeaturesAndChallenge());
        readSuccess();
      }
    }

    public static final class XMPP extends FunXMPP.Login
    {
      public XMPP(FunXMPP.TreeNodeReader paramTreeNodeReader, FunXMPP.TreeNodeWriter paramTreeNodeWriter, MessageDigest paramMessageDigest)
      {
        super(paramTreeNodeReader, paramTreeNodeWriter);
      }

      /** @deprecated */
      public void login()
        throws IOException, FunXMPP.LoginFailureException, FunXMPP.CorruptStreamException
      {
        monitorenter;
        try
        {
          send1();
          send2DigestMD5Mechanism();
          read1();
          send2SASLResponse(read2Challenge());
          send2UselessResponse();
          read2Challenge();
          read2();
          send3();
          read3();
          send4();
          send5();
          monitorexit;
          return;
        }
        finally
        {
          localObject = finally;
          monitorexit;
        }
        throw localObject;
      }

      public void read1()
        throws IOException, FunXMPP.CorruptStreamException
      {
        this.in.streamStart();
        FunXMPP.ProtocolTreeNode localProtocolTreeNode1 = this.in.nextTree();
        FunXMPP.ProtocolTreeNode.require(localProtocolTreeNode1, "stream:features");
        FunXMPP.ProtocolTreeNode localProtocolTreeNode2 = FunXMPP.ProtocolTreeNode.safeGetChild(localProtocolTreeNode1, 0);
        FunXMPP.ProtocolTreeNode.require(localProtocolTreeNode2, "mechanisms");
        if (localProtocolTreeNode2.children != null);
        for (int i = 0; ; i++)
        {
          if (i >= localProtocolTreeNode2.children.length)
            return;
          FunXMPP.ProtocolTreeNode.require(localProtocolTreeNode2.children[i], "mechanism");
        }
      }

      public void read2()
        throws IOException, FunXMPP.LoginFailureException, FunXMPP.CorruptStreamException
      {
        FunXMPP.ProtocolTreeNode localProtocolTreeNode = this.in.nextTree();
        if (FunXMPP.ProtocolTreeNode.tagEquals(localProtocolTreeNode, "failure"))
          throw new FunXMPP.LoginFailureException(0);
        FunXMPP.ProtocolTreeNode.require(localProtocolTreeNode, "success");
        Object localObject = localProtocolTreeNode.getAttributeValue("expiration");
        if (localObject != null);
        String str;
        while (true)
        {
          try
          {
            this.connection.expire_date = Long.parseLong((String)localObject);
            str = localProtocolTreeNode.getAttributeValue("kind");
            if ("paid".equals(str))
            {
              this.connection.account_kind = 1;
              str = localProtocolTreeNode.getAttributeValue("status");
              if (!"expired".equals(str))
                break;
              localObject = new FunXMPP.LoginFailureException(1);
              ((FunXMPP.LoginFailureException)localObject).expire_date = this.connection.expire_date;
              throw ((Throwable)localObject);
            }
          }
          catch (NumberFormatException localNumberFormatException)
          {
            throw new IOException("invalid expire date: " + (String)localObject);
          }
          if ("free".equals(str))
          {
            this.connection.account_kind = 0;
            continue;
          }
          this.connection.account_kind = -1;
        }
        if ("active".equals(str))
        {
          if (localObject == null)
            throw new IOException("active account with no expiration");
        }
        else
          this.connection.account_kind = -1;
      }

      String read2Challenge()
        throws IOException, FunXMPP.LoginFailureException, FunXMPP.CorruptStreamException
      {
        FunXMPP.ProtocolTreeNode localProtocolTreeNode = this.in.nextTree();
        if (!FunXMPP.ProtocolTreeNode.tagEquals(localProtocolTreeNode, "failure"))
        {
          FunXMPP.ProtocolTreeNode.require(localProtocolTreeNode, "challenge");
          return new String(Base64.decode(localProtocolTreeNode.data));
        }
        throw new FunXMPP.LoginFailureException(0);
      }

      void read3()
        throws IOException, FunXMPP.CorruptStreamException
      {
        this.in.streamStart();
        Object localObject = this.in.nextTree();
        FunXMPP.ProtocolTreeNode.require((FunXMPP.ProtocolTreeNode)localObject, "stream:features");
        boolean bool;
        if (((FunXMPP.ProtocolTreeNode)localObject).getChild("receipt_acks") == null)
          bool = false;
        else
          bool = true;
        localObject = this.connection;
        if ((!this.connection.supports_receipt_acks) || (!bool))
          bool = false;
        else
          bool = true;
        ((FunXMPP.Connection)localObject).supports_receipt_acks = bool;
      }

      void send1()
        throws IOException
      {
        this.out.streamStart(this.connection.domain, this.connection.resource);
      }

      void send2DigestMD5Mechanism()
        throws IOException
      {
        Object localObject = new FunXMPP.KeyValue[2];
        localObject[0] = new FunXMPP.KeyValue("xmlns", "urn:ietf:params:xml:ns:xmpp-sasl");
        localObject[1] = new FunXMPP.KeyValue("mechanism", "DIGEST-MD5");
        localObject = new FunXMPP.ProtocolTreeNode("auth", localObject);
        this.out.write((FunXMPP.ProtocolTreeNode)localObject);
      }

      void send2SASLResponse(String paramString)
        throws IOException
      {
        Object localObject = getResponse(paramString);
        FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[1];
        arrayOfKeyValue[0] = new FunXMPP.KeyValue("xmlns", "urn:ietf:params:xml:ns:xmpp-sasl");
        localObject = new FunXMPP.ProtocolTreeNode("response", arrayOfKeyValue, new String(Base64.encode(((String)localObject).getBytes())));
        this.out.write((FunXMPP.ProtocolTreeNode)localObject);
      }

      void send2UselessResponse()
        throws IOException
      {
        Object localObject = new FunXMPP.KeyValue[1];
        localObject[0] = new FunXMPP.KeyValue("xmlns", "urn:ietf:params:xml:ns:xmpp-sasl");
        localObject = new FunXMPP.ProtocolTreeNode("response", localObject);
        this.out.write((FunXMPP.ProtocolTreeNode)localObject);
      }

      void send3()
        throws IOException
      {
        this.out.streamStart(this.connection.domain, this.connection.resource);
      }

      void send4()
        throws IOException
      {
        Object localObject1 = new FunXMPP.ProtocolTreeNode("resource", null, this.connection.resource);
        Object localObject2 = null;
        if (this.connection.supports_receipt_acks)
        {
          localObject2 = new FunXMPP.ProtocolTreeNode[1];
          localObject2[0] = new FunXMPP.ProtocolTreeNode("receipt_acks", null);
        }
        FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("features", null, localObject2);
        localObject2 = new FunXMPP.KeyValue[1];
        localObject2[0] = new FunXMPP.KeyValue("xmlns", "urn:ietf:params:xml:ns:xmpp-bind");
        FunXMPP.ProtocolTreeNode[] arrayOfProtocolTreeNode = new FunXMPP.ProtocolTreeNode[2];
        arrayOfProtocolTreeNode[0] = localObject1;
        arrayOfProtocolTreeNode[1] = localProtocolTreeNode;
        localObject2 = new FunXMPP.ProtocolTreeNode("bind", localObject2, arrayOfProtocolTreeNode);
        localObject1 = new FunXMPP.KeyValue[2];
        localObject1[0] = new FunXMPP.KeyValue("type", "set");
        localObject1[1] = new FunXMPP.KeyValue("id", "0");
        localObject1 = new FunXMPP.ProtocolTreeNode("iq", localObject1, (FunXMPP.ProtocolTreeNode)localObject2);
        this.out.write((FunXMPP.ProtocolTreeNode)localObject1);
      }

      void send5()
        throws IOException
      {
        Object localObject = new FunXMPP.KeyValue[1];
        localObject[0] = new FunXMPP.KeyValue("xmlns", "urn:ietf:params:xml:ns:xmpp-session");
        localObject = new FunXMPP.ProtocolTreeNode("session", localObject);
        FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[2];
        arrayOfKeyValue[0] = new FunXMPP.KeyValue("type", "set");
        arrayOfKeyValue[1] = new FunXMPP.KeyValue("id", "1");
        FunXMPP.ProtocolTreeNode[] arrayOfProtocolTreeNode = new FunXMPP.ProtocolTreeNode[1];
        arrayOfProtocolTreeNode[0] = localObject;
        localObject = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, arrayOfProtocolTreeNode);
        this.out.write((FunXMPP.ProtocolTreeNode)localObject);
      }

      /** @deprecated */
      public void sendOpenStreamMD5Mechanism()
        throws IOException
      {
        monitorenter;
        try
        {
          send1();
          send2DigestMD5Mechanism();
          monitorexit;
          return;
        }
        finally
        {
          localObject = finally;
          monitorexit;
        }
        throw localObject;
      }
    }
  }

  public static class Connection
  {
    static final int ACCOUNT_KIND_FREE = 0;
    static final int ACCOUNT_KIND_PAID = 1;
    static final int ACCOUNT_KIND_UNKNOWN = -1;
    static final int ID_HEADER_SIZE = 4;
    public int account_kind = -1;
    FunXMPP.DateParser date_parser;
    String domain;
    FunXMPP.Listener event_handler;
    public long expire_date = 0L;
    String from;
    FunXMPP.GroupListener group_event_handler;
    FunXMPP.TreeNodeReader in;
    int iqid;
    FunXMPP.Login login;
    FunXMPP.TreeNodeWriter out;
    String password;
    Hashtable pending_server_requests = new Hashtable();
    String push_name;
    String resource;
    Integer server_properties_version = null;
    boolean supports_group_photos = false;
    boolean supports_receipt_acks = false;
    String user;
    boolean verbose_id = false;

    public Connection(FunXMPP.Login paramLogin, String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, FunXMPP.Listener paramListener, FunXMPP.GroupListener paramGroupListener, FunXMPP.DateParser paramDateParser)
      throws IOException, XmlPullParserException
    {
      this.in = paramLogin.getTreeReader();
      this.out = paramLogin.getTreeWriter();
      this.login = paramLogin;
      this.domain = paramString1;
      this.user = paramString3;
      this.push_name = paramString4;
      this.password = paramString5;
      this.resource = paramString2;
      this.event_handler = paramListener;
      this.group_event_handler = paramGroupListener;
      this.date_parser = paramDateParser;
      this.from = (paramString3 + "@" + paramString1 + "/" + paramString2);
    }

    private static FunXMPP.ProtocolTreeNode getMessageNode(FunXMPP.FMessage paramFMessage, FunXMPP.ProtocolTreeNode paramProtocolTreeNode)
      throws IOException
    {
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("server", null);
      Object localObject = new FunXMPP.KeyValue[1];
      localObject[0] = new FunXMPP.KeyValue("xmlns", "jabber:x:event");
      FunXMPP.ProtocolTreeNode[] arrayOfProtocolTreeNode2 = new FunXMPP.ProtocolTreeNode[1];
      arrayOfProtocolTreeNode2[0] = localProtocolTreeNode;
      localObject = new FunXMPP.ProtocolTreeNode("x", localObject, arrayOfProtocolTreeNode2);
      int i;
      if (0 != 0)
        i = 1;
      else
        i = 0;
      FunXMPP.ProtocolTreeNode[] arrayOfProtocolTreeNode1 = new FunXMPP.ProtocolTreeNode[i + 2];
      int k = 0;
      if (0 != 0)
      {
        arrayOfProtocolTreeNode1[k] = null;
        k = 0 + 1;
      }
      arrayOfProtocolTreeNode1[k] = localObject;
      int j = k + 1;
      arrayOfProtocolTreeNode1[j] = paramProtocolTreeNode;
      (j + 1);
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("to", paramFMessage.key.remote_jid);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "chat");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("id", paramFMessage.key.id);
      return (FunXMPP.ProtocolTreeNode)new FunXMPP.ProtocolTreeNode("message", arrayOfKeyValue, arrayOfProtocolTreeNode1);
    }

    public static FunXMPP.ProtocolTreeNode getNotificationMessage(String paramString1, String paramString2, FunXMPP.ProtocolTreeNode paramProtocolTreeNode)
      throws IOException
    {
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("to", paramString1);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "notification");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("id", paramString2);
      return new FunXMPP.ProtocolTreeNode("message", arrayOfKeyValue, paramProtocolTreeNode);
    }

    private FunXMPP.ProtocolTreeNode getReceiptAck(String paramString1, String paramString2, String paramString3)
      throws IOException
    {
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[2];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("xmlns", "urn:xmpp:receipts");
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", paramString3);
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("ack", arrayOfKeyValue);
      arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("to", paramString1);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "chat");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("id", paramString2);
      return new FunXMPP.ProtocolTreeNode("message", arrayOfKeyValue, localProtocolTreeNode);
    }

    public static FunXMPP.ProtocolTreeNode getSubjectMessage(String paramString1, String paramString2, FunXMPP.ProtocolTreeNode paramProtocolTreeNode)
      throws IOException
    {
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("to", paramString1);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "subject");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("id", paramString2);
      return new FunXMPP.ProtocolTreeNode("message", arrayOfKeyValue, paramProtocolTreeNode);
    }

    private String gidToGjid(String paramString)
    {
      return paramString + "@g.us";
    }

    private String makeId(String paramString)
    {
      this.iqid = (1 + this.iqid);
      String str;
      if (!this.verbose_id)
        str = Integer.toHexString(this.iqid);
      else
        str = paramString + this.iqid;
      return str;
    }

    private Hashtable parseCategories(FunXMPP.ProtocolTreeNode paramProtocolTreeNode)
      throws FunXMPP.CorruptStreamException, IOException
    {
      Hashtable localHashtable = new Hashtable();
      if (paramProtocolTreeNode.children != null);
      for (int i = 0; ; i++)
      {
        if (i >= paramProtocolTreeNode.children.length)
          return localHashtable;
        FunXMPP.ProtocolTreeNode localProtocolTreeNode = paramProtocolTreeNode.children[i];
        if (!FunXMPP.ProtocolTreeNode.tagEquals(localProtocolTreeNode, "category"))
          continue;
        localHashtable.put(localProtocolTreeNode.getAttributeValue("name"), localProtocolTreeNode.getAttributeValue("timestamp"));
      }
    }

    private void parseMessageInitialTagAlreadyChecked(FunXMPP.ProtocolTreeNode paramProtocolTreeNode)
      throws IOException, FunXMPP.CorruptStreamException
    {
      FunXMPP.FMessage.Builder localBuilder1 = new FunXMPP.FMessage.Builder();
      String str1 = paramProtocolTreeNode.getAttributeValue("id");
      Object localObject2 = paramProtocolTreeNode.getAttributeValue("t");
      Object localObject1 = paramProtocolTreeNode.getAttributeValue("from");
      String str2 = paramProtocolTreeNode.getAttributeValue("author");
      if (str2 == null)
        str2 = "";
      String str3 = paramProtocolTreeNode.getAttributeValue("type");
      int i;
      int j;
      if ("error".equals(str3))
      {
        i = 0;
        localObject2 = paramProtocolTreeNode.getAllChildren("error");
        j = 0;
      }
      while (true)
      {
        int n = ((Vector)localObject2).size();
        String str4;
        if (j < n)
          str4 = ((FunXMPP.ProtocolTreeNode)((Vector)localObject2).elementAt(j)).getAttributeValue("code");
        try
        {
          i = Integer.parseInt(str4);
          i = i;
          label129: j++;
          continue;
          FunXMPP.FMessage localFMessage2 = null;
          if ((localObject1 != null) && (str1 != null))
          {
            localObject1 = new FunXMPP.FMessage.Key((String)localObject1, true, str1);
            localFMessage2 = (FunXMPP.FMessage)FunXMPP.message_store.get(localObject1);
          }
          if (localFMessage2 != null)
          {
            localFMessage2.status = 7;
            this.event_handler.onMessageError(localFMessage2, i);
          }
          while (true)
          {
            return;
            int k;
            Object localObject4;
            int i5;
            Object localObject3;
            if ("subject".equals(str4))
            {
              k = 0;
              localObject4 = paramProtocolTreeNode.getAllChildren("request");
              for (i5 = 0; ; i5++)
              {
                int i1 = ((Vector)localObject4).size();
                if (i5 >= i1)
                  break;
                if (!"urn:xmpp:receipts".equals(((FunXMPP.ProtocolTreeNode)((Vector)localObject4).elementAt(i5)).getAttributeValue("xmlns")))
                  continue;
                k = 1;
              }
              localObject3 = paramProtocolTreeNode.getChild("body");
              if (localObject3 == null);
              for (localObject4 = null; ; localObject4 = ((FunXMPP.ProtocolTreeNode)localObject3).getDataStr())
              {
                if ((localObject4 != null) && (this.group_event_handler != null))
                {
                  localObject3 = this.group_event_handler;
                  m = Integer.parseInt((String)localObject2);
                  ((FunXMPP.GroupListener)localObject3).onGroupNewSubject((String)localObject1, i, (String)localObject4, m);
                }
                if (k == 0)
                  break;
                sendSubjectReceived((String)localObject1, str1);
                break;
              }
            }
            Vector localVector;
            Object localObject5;
            if ("notification".equals(localObject3))
            {
              i = 0;
              localObject4 = paramProtocolTreeNode.getAllChildren("request");
              for (k = 0; ; k++)
              {
                int i2 = ((Vector)localObject4).size();
                if (k >= i2)
                  break;
                if (!"urn:xmpp:receipts".equals(((FunXMPP.ProtocolTreeNode)((Vector)localObject4).elementAt(k)).getAttributeValue("xmlns")))
                  continue;
                i = 1;
              }
              localVector = paramProtocolTreeNode.getAllChildren("notification");
              k = 0;
              int i4 = localVector.size();
              if (k < i4)
              {
                localObject5 = (FunXMPP.ProtocolTreeNode)localVector.elementAt(k);
                if ("picture".equals(((FunXMPP.ProtocolTreeNode)localObject5).getAttributeValue("type")))
                {
                  localObject5 = ((FunXMPP.ProtocolTreeNode)localObject5).getChild(0);
                  if (localObject5 != null)
                  {
                    if (!FunXMPP.ProtocolTreeNode.tagEquals((FunXMPP.ProtocolTreeNode)localObject5, "set"))
                      break label543;
                    this.event_handler.onProfilePhotoChange(((FunXMPP.ProtocolTreeNode)localObject5).getAttributeValue("jid"), ((FunXMPP.ProtocolTreeNode)localObject5).getAttributeValue("author"), Integer.parseInt(((FunXMPP.ProtocolTreeNode)localObject5).getAttributeValue("id")), Integer.parseInt(m));
                  }
                }
                while (true)
                {
                  k++;
                  break;
                  label543: if (!FunXMPP.ProtocolTreeNode.tagEquals((FunXMPP.ProtocolTreeNode)localObject5, "delete"))
                    continue;
                  this.event_handler.onProfilePhotoChange(((FunXMPP.ProtocolTreeNode)localObject5).getAttributeValue("jid"), ((FunXMPP.ProtocolTreeNode)localObject5).getAttributeValue("author"), 0, Integer.parseInt(m));
                }
              }
              if (i == 0)
                continue;
              sendNotificationReceived((String)localObject1, str1);
              continue;
            }
            if (!"chat".equals(localVector))
              continue;
            int m = 0;
            int i3;
            label631: Object localObject6;
            if (paramProtocolTreeNode.children == null)
            {
              localObject5 = new FunXMPP.ProtocolTreeNode[0];
              i3 = 0;
              i5 = localObject5.length;
              if (i3 >= i5)
                break label1620;
              localObject6 = localObject5[i3];
              if (!FunXMPP.ProtocolTreeNode.tagEquals((FunXMPP.ProtocolTreeNode)localObject6, "composing"))
                break label694;
              if (this.event_handler != null)
                this.event_handler.onIsTyping((String)localObject1, true);
            }
            label694: FunXMPP.FMessage.Builder localBuilder2;
            while (true)
            {
              i3++;
              break label631;
              localObject5 = paramProtocolTreeNode.children;
              break;
              if (FunXMPP.ProtocolTreeNode.tagEquals((FunXMPP.ProtocolTreeNode)localObject6, "paused"))
              {
                if (this.event_handler == null)
                  continue;
                this.event_handler.onIsTyping((String)localObject1, false);
                continue;
              }
              Object localObject8;
              if ((FunXMPP.ProtocolTreeNode.tagEquals((FunXMPP.ProtocolTreeNode)localObject6, "body")) && (str1 != null))
              {
                localObject6 = ((FunXMPP.ProtocolTreeNode)localObject6).getDataStr();
                localObject8 = new FunXMPP.FMessage.Key((String)localObject1, false, str1);
                FunXMPP.FMessage localFMessage3 = (FunXMPP.FMessage)FunXMPP.message_store.get(localObject8);
                if (localFMessage3 == null)
                {
                  k.key((FunXMPP.FMessage.Key)localObject8).remote_resource(i).newIncomingInstance().data((String)localObject6);
                  continue;
                }
                localBuilder2 = new FunXMPP.FMessage.Builder().setInstance(localFMessage3);
                m = 1;
                continue;
              }
              if ((FunXMPP.ProtocolTreeNode.tagEquals((FunXMPP.ProtocolTreeNode)localObject6, "media")) && (str1 != null))
              {
                byte b = FunXMPP.FMessage.getMessage_WA_Type(((FunXMPP.ProtocolTreeNode)localObject6).getAttributeValue("type"));
                localBuilder2.media_wa_type(b).media_url(((FunXMPP.ProtocolTreeNode)localObject6).getAttributeValue("url"));
                try
                {
                  long l3 = Long.parseLong(((FunXMPP.ProtocolTreeNode)localObject6).getAttributeValue("size"));
                  localBuilder2.media_size(l3);
                }
                catch (NumberFormatException localObject7)
                {
                  try
                  {
                    String str6 = ((FunXMPP.ProtocolTreeNode)localObject6).getAttributeValue("seconds");
                    if (str6 != null)
                    {
                      int i6 = Integer.parseInt(str6);
                      localBuilder2.media_duration_seconds(i6);
                    }
                    if (localBuilder2.media_wa_type().byteValue() == 5)
                    {
                      str8 = ((FunXMPP.ProtocolTreeNode)localObject6).getAttributeValue("latitude");
                      str7 = ((FunXMPP.ProtocolTreeNode)localObject6).getAttributeValue("longitude");
                      if ((str8 == null) || (str7 == null))
                      {
                        throw new FunXMPP.CorruptStreamException("location message missing lat or long attribute", this.in.lastStanza());
                        localNumberFormatException1 = localNumberFormatException1;
                        localObject8 = localNumberFormatException1.getMessage();
                        PrintStream localPrintStream = System.err;
                        if (localObject8 == null);
                        for (localObject8 = "NumberFormatException"; ; localObject8 = localObject8)
                        {
                          localPrintStream.println((String)localObject8);
                          break;
                        }
                      }
                    }
                  }
                  catch (NumberFormatException localObject7)
                  {
                    String str8;
                    String str7;
                    localObject8 = localNumberFormatException2.getMessage();
                    localObject7 = System.err;
                    if (localObject8 == null);
                    for (localObject8 = "NumberFormatException"; ; localObject8 = localObject8)
                    {
                      ((PrintStream)localObject7).println((String)localObject8);
                      break;
                    }
                    while (true)
                    {
                      try
                      {
                        localObject7 = Double.valueOf(str8);
                        localObject8 = Double.valueOf(str7);
                        localBuilder2.latitude((Double)localObject7).longitude((Double)localObject8);
                        if (localBuilder2.media_wa_type().byteValue() == 4)
                        {
                          localObject6 = ((FunXMPP.ProtocolTreeNode)localObject6).getChild(0);
                          if (localObject6 == null)
                            continue;
                          localObject7 = ((FunXMPP.ProtocolTreeNode)localObject6).getAttributeValue("name");
                          localBuilder2.media_name((String)localObject7).data(((FunXMPP.ProtocolTreeNode)localObject6).data);
                          localObject7 = new FunXMPP.FMessage.Key((String)localObject1, false, str1);
                          localObject6 = (FunXMPP.FMessage)FunXMPP.message_store.get(localObject7);
                          if (localObject6 != null)
                            break label1258;
                          localBuilder2.key((FunXMPP.FMessage.Key)localObject7).remote_resource(i).newIncomingInstance();
                        }
                      }
                      catch (NumberFormatException localNumberFormatException3)
                      {
                        throw new FunXMPP.CorruptStreamException("location message exception parsing lat or long attribute: " + str8 + " " + str7, this.in.lastStanza());
                      }
                      localObject6 = ((FunXMPP.ProtocolTreeNode)localObject6).data;
                      localBuilder2.data(localObject6);
                    }
                    label1258: localBuilder2 = new FunXMPP.FMessage.Builder().setInstance((FunXMPP.FMessage)localObject6);
                    m = 1;
                  }
                }
                continue;
              }
              if (FunXMPP.ProtocolTreeNode.tagEquals((FunXMPP.ProtocolTreeNode)localObject6, "active"))
                continue;
              if (FunXMPP.ProtocolTreeNode.tagEquals((FunXMPP.ProtocolTreeNode)localObject6, "request"))
              {
                localBuilder2.wants_receipt(true);
                continue;
              }
              if (FunXMPP.ProtocolTreeNode.tagEquals((FunXMPP.ProtocolTreeNode)localObject6, "notify"))
                continue;
              long l2;
              if (FunXMPP.ProtocolTreeNode.tagEquals((FunXMPP.ProtocolTreeNode)localObject6, "x"))
              {
                localObject7 = ((FunXMPP.ProtocolTreeNode)localObject6).getAttributeValue("xmlns");
                if (("jabber:x:event".equals(localObject7)) && (str1 != null))
                {
                  localObject6 = new FunXMPP.FMessage.Key((String)localObject1, true, str1);
                  localObject6 = (FunXMPP.FMessage)FunXMPP.message_store.get(localObject6);
                  if (localObject6 == null)
                    continue;
                  ((FunXMPP.FMessage)localObject6).status = 4;
                  if (this.event_handler == null)
                    continue;
                  this.event_handler.onMessageStatusUpdate((FunXMPP.FMessage)localObject6);
                  continue;
                }
                if (!"jabber:x:delay".equals(localObject7))
                  continue;
                localObject6 = ((FunXMPP.ProtocolTreeNode)localObject6).getAttributeValue("stamp");
                if (localObject6 == null)
                  continue;
                localObject6 = this.date_parser.parse((String)localObject6);
                if (localObject6 == null)
                  continue;
                l2 = ((Date)localObject6).getTime();
                localBuilder2.timestamp(l2).offline(Boolean.TRUE);
                continue;
              }
              if ((FunXMPP.ProtocolTreeNode.tagEquals(l2, "delay")) || (!FunXMPP.ProtocolTreeNode.tagEquals(l2, "received")) || (str1 == null))
                continue;
              Object localObject7 = new FunXMPP.FMessage.Key((String)localObject1, true, str1);
              localObject7 = (FunXMPP.FMessage)FunXMPP.message_store.get(localObject7);
              if (localObject7 != null)
              {
                ((FunXMPP.FMessage)localObject7).status = 5;
                if (this.event_handler != null)
                  this.event_handler.onMessageStatusUpdate((FunXMPP.FMessage)localObject7);
              }
              if (!this.supports_receipt_acks)
                continue;
              String str5 = l2.getAttributeValue("type");
              if ((str5 == null) || (str5.equals("delivered")))
              {
                sendDeliveredReceiptAck((String)localObject1, str1);
                continue;
              }
              if (!str5.equals("visible"))
                continue;
              sendVisibleReceiptAck((String)localObject1, str1);
            }
            label1620: if (localBuilder2.timestamp() == null)
            {
              long l1 = System.currentTimeMillis();
              localBuilder2.timestamp(l1).offline(Boolean.FALSE);
            }
            FunXMPP.FMessage localFMessage1 = localBuilder2.build();
            if ((localFMessage1 == null) || (this.event_handler == null))
              continue;
            this.event_handler.onMessageForMe(localFMessage1, m);
          }
        }
        catch (Exception localException)
        {
          break label129;
        }
      }
    }

    private void readAttributeList(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, Vector paramVector, String paramString1, String paramString2)
      throws IOException
    {
      Vector localVector = paramProtocolTreeNode.getAllChildren(paramString1);
      for (int i = 0; ; i++)
      {
        if (i >= localVector.size())
          return;
        paramVector.addElement(((FunXMPP.ProtocolTreeNode)localVector.elementAt(i)).getAttributeValue(paramString2));
      }
    }

    private void readGroupList(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, Vector paramVector)
      throws IOException
    {
      Vector localVector = paramProtocolTreeNode.getAllChildren("group");
      for (int i = 0; ; i++)
      {
        if (i >= localVector.size())
          return;
        Object localObject = (FunXMPP.ProtocolTreeNode)localVector.elementAt(i);
        String str3 = gidToGjid(((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("id"));
        String str5 = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("owner");
        String str2 = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("subject");
        String str1 = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("s_t");
        String str4 = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("s_o");
        localObject = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("creation");
        this.group_event_handler.onGroupInfoFromList(str3, str5, str2, str4, Integer.parseInt(str1), Integer.parseInt((String)localObject));
        paramVector.addElement(str3);
      }
    }

    private void readSuccessAndFailure(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, Vector paramVector, Hashtable paramHashtable, String paramString)
      throws IOException
    {
      Vector localVector = paramProtocolTreeNode.getAllChildren(paramString);
      int i = 0;
      if (i < localVector.size())
      {
        Object localObject2 = (FunXMPP.ProtocolTreeNode)localVector.elementAt(i);
        Object localObject1 = ((FunXMPP.ProtocolTreeNode)localObject2).getAttributeValue("type");
        String str = ((FunXMPP.ProtocolTreeNode)localObject2).getAttributeValue("participant");
        localObject2 = ((FunXMPP.ProtocolTreeNode)localObject2).getAttributeValue("code");
        if ("success".equals(localObject1))
          paramVector.addElement(str);
        while (true)
        {
          i++;
          break;
          try
          {
            localObject1 = Integer.valueOf((String)localObject2);
            localObject1 = localObject1;
            paramHashtable.put(str, localObject1);
          }
          catch (Exception localException)
          {
            while (true)
              localObject1 = new Integer(499);
          }
        }
      }
    }

    private void sendGetGroups(String paramString1, String paramString2)
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[2];
      localObject[0] = new FunXMPP.KeyValue("xmlns", "w:g");
      localObject[1] = new FunXMPP.KeyValue("type", paramString2);
      localObject = new FunXMPP.ProtocolTreeNode("list", localObject);
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", paramString1);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "get");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("to", "g.us");
      localObject = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, (FunXMPP.ProtocolTreeNode)localObject);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    private void sendMessageWithBody(FunXMPP.FMessage paramFMessage)
      throws IOException
    {
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("body", null, paramFMessage.data);
      this.out.write(getMessageNode(paramFMessage, localProtocolTreeNode));
    }

    private void sendMessageWithMedia(FunXMPP.FMessage paramFMessage)
      throws IOException
    {
      if (7 != paramFMessage.media_wa_type)
      {
        FunXMPP.KeyValue localKeyValue = new FunXMPP.KeyValue("xmlns", "urn:xmpp:whatsapp:mms");
        Object localObject2 = new FunXMPP.KeyValue("type", FunXMPP.FMessage.getMessage_WA_Type_StrValue(paramFMessage.media_wa_type));
        Object localObject1;
        if (5 != paramFMessage.media_wa_type)
        {
          if ((4 == paramFMessage.media_wa_type) || (paramFMessage.media_url == null) || (paramFMessage.media_size <= 0L))
          {
            FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[2];
            arrayOfKeyValue[0] = localKeyValue;
            arrayOfKeyValue[1] = localObject2;
          }
          else
          {
            int i = paramFMessage.media_url.lastIndexOf('/');
            String str;
            if (i >= 0)
              str = paramFMessage.media_url.substring(i + 1);
            else
              str = "missing";
            if (paramFMessage.media_duration_seconds > 0)
            {
              localObject1 = new FunXMPP.KeyValue[6];
              localObject1[0] = localKeyValue;
              localObject1[1] = localObject2;
              localObject1[2] = new FunXMPP.KeyValue("file", str);
              localObject1[3] = new FunXMPP.KeyValue("size", Long.toString(paramFMessage.media_size));
              localObject1[4] = new FunXMPP.KeyValue("url", paramFMessage.media_url);
              localObject1[5] = new FunXMPP.KeyValue("seconds", Integer.toString(paramFMessage.media_duration_seconds));
            }
            else
            {
              localObject1 = new FunXMPP.KeyValue[5];
              localObject1[0] = localKeyValue;
              localObject1[1] = localObject2;
              localObject1[2] = new FunXMPP.KeyValue("file", str);
              localObject1[3] = new FunXMPP.KeyValue("size", Long.toString(paramFMessage.media_size));
              localObject1[4] = new FunXMPP.KeyValue("url", paramFMessage.media_url);
            }
          }
        }
        else
        {
          localObject1 = new FunXMPP.KeyValue[4];
          localObject1[0] = localKeyValue;
          localObject1[1] = localObject2;
          localObject1[2] = new FunXMPP.KeyValue("latitude", Double.toString(paramFMessage.latitude));
          localObject1[3] = new FunXMPP.KeyValue("longitude", Double.toString(paramFMessage.longitude));
        }
        if ((4 != paramFMessage.media_wa_type) || (paramFMessage.media_name == null))
        {
          localObject1 = new FunXMPP.ProtocolTreeNode("media", localObject1, paramFMessage.data);
        }
        else
        {
          localObject2 = new FunXMPP.KeyValue[1];
          localObject2[0] = new FunXMPP.KeyValue("name", paramFMessage.media_name);
          localObject1 = new FunXMPP.ProtocolTreeNode("media", localObject1, new FunXMPP.ProtocolTreeNode("vcard", localObject2, paramFMessage.data));
        }
        this.out.write(getMessageNode(paramFMessage, (FunXMPP.ProtocolTreeNode)localObject1));
        return;
      }
      throw new RuntimeException("Cannot send system message over the network");
    }

    private void sendVerbParticipants(String paramString1, Vector paramVector, String paramString2, String paramString3)
      throws IOException
    {
      int j = paramVector.size();
      Object localObject1 = new FunXMPP.ProtocolTreeNode[j];
      Object localObject2;
      for (int i = 0; ; localObject2++)
      {
        if (i >= j)
        {
          localObject2 = new FunXMPP.KeyValue[1];
          localObject2[0] = new FunXMPP.KeyValue("xmlns", "w:g");
          localObject2 = new FunXMPP.ProtocolTreeNode(paramString3, localObject2, localObject1);
          localObject1 = new FunXMPP.KeyValue[3];
          localObject1[0] = new FunXMPP.KeyValue("id", paramString2);
          localObject1[1] = new FunXMPP.KeyValue("type", "set");
          localObject1[2] = new FunXMPP.KeyValue("to", paramString1);
          localObject1 = new FunXMPP.ProtocolTreeNode("iq", localObject1, (FunXMPP.ProtocolTreeNode)localObject2);
          this.out.write((FunXMPP.ProtocolTreeNode)localObject1);
          return;
        }
        FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[1];
        arrayOfKeyValue[0] = new FunXMPP.KeyValue("jid", (String)paramVector.elementAt(localObject2));
        localObject1[localObject2] = new FunXMPP.ProtocolTreeNode("participant", arrayOfKeyValue);
      }
    }

    public void login(boolean paramBoolean)
      throws IOException, XmlPullParserException, FunXMPP.LoginFailureException, FunXMPP.CorruptStreamException
    {
      this.login.login();
      sendPushName(paramBoolean);
    }

    // ERROR //
    public boolean read()
      throws IOException, FunXMPP.CorruptStreamException
    {
      // Byte code:
      //   0: aload_0
      //   1: getfield 127	whatsapp/FunXMPP$Connection:in	Lwhatsapp/FunXMPP$TreeNodeReader;
      //   4: invokeinterface 708 1 0
      //   9: astore_2
      //   10: aload_2
      //   11: ifnonnull +34 -> 45
      //   14: iconst_0
      //   15: istore_1
      //   16: iload_1
      //   17: ireturn
      //   18: astore_1
      //   19: aload_1
      //   20: athrow
      //   21: astore_1
      //   22: aload_1
      //   23: athrow
      //   24: astore_1
      //   25: new 710	whatsapp/FunXMPP$FunRuntimeException
      //   28: dup
      //   29: aload_1
      //   30: aload_0
      //   31: getfield 127	whatsapp/FunXMPP$Connection:in	Lwhatsapp/FunXMPP$TreeNodeReader;
      //   34: invokeinterface 476 1 0
      //   39: invokespecial 713	whatsapp/FunXMPP$FunRuntimeException:<init>	(Ljava/lang/Throwable;Ljava/lang/String;)V
      //   42: astore_1
      //   43: aload_1
      //   44: athrow
      //   45: aload_2
      //   46: ldc_w 627
      //   49: invokestatic 286	whatsapp/FunXMPP$ProtocolTreeNode:tagEquals	(Lwhatsapp/FunXMPP$ProtocolTreeNode;Ljava/lang/String;)Z
      //   52: ifeq +628 -> 680
      //   55: aload_2
      //   56: ldc 238
      //   58: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   61: astore 4
      //   63: aload_2
      //   64: ldc 242
      //   66: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   69: astore_1
      //   70: aload_2
      //   71: ldc_w 309
      //   74: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   77: astore_3
      //   78: aload 4
      //   80: ifnonnull +23 -> 103
      //   83: new 172	whatsapp/FunXMPP$CorruptStreamException
      //   86: dup
      //   87: ldc_w 715
      //   90: aload_0
      //   91: getfield 127	whatsapp/FunXMPP$Connection:in	Lwhatsapp/FunXMPP$TreeNodeReader;
      //   94: invokeinterface 476 1 0
      //   99: invokespecial 477	whatsapp/FunXMPP$CorruptStreamException:<init>	(Ljava/lang/String;Ljava/lang/String;)V
      //   102: athrow
      //   103: aload 4
      //   105: ldc_w 717
      //   108: invokevirtual 321	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   111: ifeq +189 -> 300
      //   114: aload_0
      //   115: getfield 113	whatsapp/FunXMPP$Connection:pending_server_requests	Ljava/util/Hashtable;
      //   118: aload_1
      //   119: invokevirtual 720	java/util/Hashtable:containsKey	(Ljava/lang/Object;)Z
      //   122: ifeq +24 -> 146
      //   125: aload_0
      //   126: getfield 113	whatsapp/FunXMPP$Connection:pending_server_requests	Ljava/util/Hashtable;
      //   129: aload_1
      //   130: invokevirtual 723	java/util/Hashtable:remove	(Ljava/lang/Object;)Ljava/lang/Object;
      //   133: checkcast 725	whatsapp/FunXMPP$IqResultHandler
      //   136: aload_2
      //   137: aload_3
      //   138: invokevirtual 728	whatsapp/FunXMPP$IqResultHandler:parse	(Lwhatsapp/FunXMPP$ProtocolTreeNode;Ljava/lang/String;)V
      //   141: iconst_1
      //   142: istore_1
      //   143: goto -127 -> 16
      //   146: aload_1
      //   147: aload_0
      //   148: getfield 139	whatsapp/FunXMPP$Connection:user	Ljava/lang/String;
      //   151: invokevirtual 732	java/lang/String:startsWith	(Ljava/lang/String;)Z
      //   154: ifeq -13 -> 141
      //   157: aload_2
      //   158: iconst_0
      //   159: invokevirtual 385	whatsapp/FunXMPP$ProtocolTreeNode:getChild	(I)Lwhatsapp/FunXMPP$ProtocolTreeNode;
      //   162: astore_1
      //   163: aload_1
      //   164: ldc_w 734
      //   167: invokestatic 737	whatsapp/FunXMPP$ProtocolTreeNode:require	(Lwhatsapp/FunXMPP$ProtocolTreeNode;Ljava/lang/String;)V
      //   170: aload_1
      //   171: ldc_w 739
      //   174: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   177: astore_2
      //   178: ldc_w 741
      //   181: aload_2
      //   182: invokevirtual 321	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   185: ifeq +31 -> 216
      //   188: aload_0
      //   189: iconst_1
      //   190: putfield 115	whatsapp/FunXMPP$Connection:account_kind	I
      //   193: aload_1
      //   194: ldc_w 743
      //   197: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   200: astore_1
      //   201: aload_1
      //   202: ifnonnull +41 -> 243
      //   205: new 95	java/io/IOException
      //   208: dup
      //   209: ldc_w 745
      //   212: invokespecial 746	java/io/IOException:<init>	(Ljava/lang/String;)V
      //   215: athrow
      //   216: ldc_w 748
      //   219: aload_2
      //   220: invokevirtual 321	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   223: ifeq +11 -> 234
      //   226: aload_0
      //   227: iconst_0
      //   228: putfield 115	whatsapp/FunXMPP$Connection:account_kind	I
      //   231: goto -38 -> 193
      //   234: aload_0
      //   235: bipush 255
      //   237: putfield 115	whatsapp/FunXMPP$Connection:account_kind	I
      //   240: goto -47 -> 193
      //   243: aload_0
      //   244: aload_1
      //   245: invokestatic 446	java/lang/Long:parseLong	(Ljava/lang/String;)J
      //   248: putfield 119	whatsapp/FunXMPP$Connection:expire_date	J
      //   251: aload_0
      //   252: getfield 147	whatsapp/FunXMPP$Connection:event_handler	Lwhatsapp/FunXMPP$Listener;
      //   255: aload_0
      //   256: getfield 115	whatsapp/FunXMPP$Connection:account_kind	I
      //   259: aload_0
      //   260: getfield 119	whatsapp/FunXMPP$Connection:expire_date	J
      //   263: invokeinterface 752 4 0
      //   268: goto -127 -> 141
      //   271: pop
      //   272: new 95	java/io/IOException
      //   275: dup
      //   276: new 153	java/lang/StringBuilder
      //   279: dup
      //   280: invokespecial 154	java/lang/StringBuilder:<init>	()V
      //   283: ldc_w 754
      //   286: invokevirtual 158	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
      //   289: aload_1
      //   290: invokevirtual 158	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
      //   293: invokevirtual 166	java/lang/StringBuilder:toString	()Ljava/lang/String;
      //   296: invokespecial 746	java/io/IOException:<init>	(Ljava/lang/String;)V
      //   299: athrow
      //   300: aload 4
      //   302: ldc_w 315
      //   305: invokevirtual 321	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   308: ifeq +32 -> 340
      //   311: aload_0
      //   312: getfield 113	whatsapp/FunXMPP$Connection:pending_server_requests	Ljava/util/Hashtable;
      //   315: aload_1
      //   316: invokevirtual 720	java/util/Hashtable:containsKey	(Ljava/lang/Object;)Z
      //   319: ifeq -178 -> 141
      //   322: aload_0
      //   323: getfield 113	whatsapp/FunXMPP$Connection:pending_server_requests	Ljava/util/Hashtable;
      //   326: aload_1
      //   327: invokevirtual 723	java/util/Hashtable:remove	(Ljava/lang/Object;)Ljava/lang/Object;
      //   330: checkcast 725	whatsapp/FunXMPP$IqResultHandler
      //   333: aload_2
      //   334: invokevirtual 756	whatsapp/FunXMPP$IqResultHandler:error	(Lwhatsapp/FunXMPP$ProtocolTreeNode;)V
      //   337: goto -196 -> 141
      //   340: aload 4
      //   342: ldc_w 623
      //   345: invokevirtual 321	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   348: ifeq +193 -> 541
      //   351: aload_2
      //   352: iconst_0
      //   353: invokevirtual 385	whatsapp/FunXMPP$ProtocolTreeNode:getChild	(I)Lwhatsapp/FunXMPP$ProtocolTreeNode;
      //   356: astore 4
      //   358: aload 4
      //   360: ldc_w 758
      //   363: invokestatic 286	whatsapp/FunXMPP$ProtocolTreeNode:tagEquals	(Lwhatsapp/FunXMPP$ProtocolTreeNode;Ljava/lang/String;)Z
      //   366: ifeq +16 -> 382
      //   369: aload_0
      //   370: getfield 147	whatsapp/FunXMPP$Connection:event_handler	Lwhatsapp/FunXMPP$Listener;
      //   373: aload_1
      //   374: invokeinterface 761 2 0
      //   379: goto -238 -> 141
      //   382: aload 4
      //   384: ldc_w 763
      //   387: invokestatic 286	whatsapp/FunXMPP$ProtocolTreeNode:tagEquals	(Lwhatsapp/FunXMPP$ProtocolTreeNode;Ljava/lang/String;)Z
      //   390: ifeq +26 -> 416
      //   393: aload_3
      //   394: ifnull +22 -> 416
      //   397: ldc_w 765
      //   400: aload 4
      //   402: ldc 213
      //   404: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   407: invokevirtual 321	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   410: ifeq -269 -> 141
      //   413: goto -272 -> 141
      //   416: aload 4
      //   418: ldc_w 767
      //   421: invokestatic 286	whatsapp/FunXMPP$ProtocolTreeNode:tagEquals	(Lwhatsapp/FunXMPP$ProtocolTreeNode;Ljava/lang/String;)Z
      //   424: ifeq -283 -> 141
      //   427: aload_3
      //   428: ifnull -287 -> 141
      //   431: aload 4
      //   433: ldc_w 769
      //   436: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   439: astore_2
      //   440: aload 4
      //   442: ldc_w 771
      //   445: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   448: astore 5
      //   450: aload 4
      //   452: ldc_w 773
      //   455: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   458: astore_3
      //   459: aload 5
      //   461: ifnonnull +27 -> 488
      //   464: iconst_0
      //   465: istore 4
      //   467: aload_2
      //   468: ifnull -327 -> 141
      //   471: aload_0
      //   472: getfield 147	whatsapp/FunXMPP$Connection:event_handler	Lwhatsapp/FunXMPP$Listener;
      //   475: aload_2
      //   476: aload_3
      //   477: iload 4
      //   479: aload_1
      //   480: invokeinterface 777 5 0
      //   485: goto -344 -> 141
      //   488: aload 5
      //   490: invokestatic 341	java/lang/Integer:parseInt	(Ljava/lang/String;)I
      //   493: istore 4
      //   495: iload 4
      //   497: istore 4
      //   499: goto -32 -> 467
      //   502: pop
      //   503: new 172	whatsapp/FunXMPP$CorruptStreamException
      //   506: dup
      //   507: new 153	java/lang/StringBuilder
      //   510: dup
      //   511: invokespecial 154	java/lang/StringBuilder:<init>	()V
      //   514: ldc_w 779
      //   517: invokevirtual 158	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
      //   520: aload 5
      //   522: invokevirtual 158	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
      //   525: invokevirtual 166	java/lang/StringBuilder:toString	()Ljava/lang/String;
      //   528: aload_0
      //   529: getfield 127	whatsapp/FunXMPP$Connection:in	Lwhatsapp/FunXMPP$TreeNodeReader;
      //   532: invokeinterface 476 1 0
      //   537: invokespecial 477	whatsapp/FunXMPP$CorruptStreamException:<init>	(Ljava/lang/String;Ljava/lang/String;)V
      //   540: athrow
      //   541: aload 4
      //   543: ldc_w 387
      //   546: invokevirtual 321	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   549: ifeq +93 -> 642
      //   552: aload_2
      //   553: iconst_0
      //   554: invokevirtual 385	whatsapp/FunXMPP$ProtocolTreeNode:getChild	(I)Lwhatsapp/FunXMPP$ProtocolTreeNode;
      //   557: astore_1
      //   558: aload_1
      //   559: ldc_w 763
      //   562: invokestatic 286	whatsapp/FunXMPP$ProtocolTreeNode:tagEquals	(Lwhatsapp/FunXMPP$ProtocolTreeNode;Ljava/lang/String;)Z
      //   565: ifeq -424 -> 141
      //   568: ldc_w 781
      //   571: aload_1
      //   572: ldc 213
      //   574: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   577: invokevirtual 321	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   580: ifeq -439 -> 141
      //   583: aload_1
      //   584: ldc_w 783
      //   587: invokevirtual 325	whatsapp/FunXMPP$ProtocolTreeNode:getAllChildren	(Ljava/lang/String;)Ljava/util/Vector;
      //   590: astore_1
      //   591: iconst_0
      //   592: istore_2
      //   593: aload_1
      //   594: invokevirtual 331	java/util/Vector:size	()I
      //   597: istore_3
      //   598: iload_2
      //   599: iload_3
      //   600: if_icmpge -459 -> 141
      //   603: aload_1
      //   604: iload_2
      //   605: invokevirtual 335	java/util/Vector:elementAt	(I)Ljava/lang/Object;
      //   608: checkcast 204	whatsapp/FunXMPP$ProtocolTreeNode
      //   611: astore_3
      //   612: aload_3
      //   613: ldc_w 389
      //   616: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   619: pop
      //   620: aload_3
      //   621: ldc_w 785
      //   624: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   627: pop
      //   628: aload_3
      //   629: ldc_w 787
      //   632: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   635: pop
      //   636: iinc 2 1
      //   639: goto -46 -> 593
      //   642: new 172	whatsapp/FunXMPP$CorruptStreamException
      //   645: dup
      //   646: new 153	java/lang/StringBuilder
      //   649: dup
      //   650: invokespecial 154	java/lang/StringBuilder:<init>	()V
      //   653: ldc_w 789
      //   656: invokevirtual 158	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
      //   659: aload 4
      //   661: invokevirtual 158	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
      //   664: invokevirtual 166	java/lang/StringBuilder:toString	()Ljava/lang/String;
      //   667: aload_0
      //   668: getfield 127	whatsapp/FunXMPP$Connection:in	Lwhatsapp/FunXMPP$TreeNodeReader;
      //   671: invokeinterface 476 1 0
      //   676: invokespecial 477	whatsapp/FunXMPP$CorruptStreamException:<init>	(Ljava/lang/String;Ljava/lang/String;)V
      //   679: athrow
      //   680: aload_2
      //   681: ldc_w 791
      //   684: invokestatic 286	whatsapp/FunXMPP$ProtocolTreeNode:tagEquals	(Lwhatsapp/FunXMPP$ProtocolTreeNode;Ljava/lang/String;)Z
      //   687: ifeq +217 -> 904
      //   690: aload_2
      //   691: ldc 213
      //   693: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   696: astore_3
      //   697: aload_2
      //   698: ldc_w 309
      //   701: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   704: astore_1
      //   705: aload_3
      //   706: ifnull +13 -> 719
      //   709: ldc_w 793
      //   712: aload_3
      //   713: invokevirtual 321	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   716: ifeq +66 -> 782
      //   719: aload_1
      //   720: ifnull +62 -> 782
      //   723: aload_2
      //   724: ldc 238
      //   726: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   729: astore_2
      //   730: ldc_w 795
      //   733: aload_2
      //   734: invokevirtual 321	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   737: ifeq +17 -> 754
      //   740: aload_0
      //   741: getfield 147	whatsapp/FunXMPP$Connection:event_handler	Lwhatsapp/FunXMPP$Listener;
      //   744: aload_1
      //   745: iconst_0
      //   746: invokeinterface 798 3 0
      //   751: goto -610 -> 141
      //   754: aload_2
      //   755: ifnull +13 -> 768
      //   758: ldc_w 800
      //   761: aload_2
      //   762: invokevirtual 321	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   765: ifeq -624 -> 141
      //   768: aload_0
      //   769: getfield 147	whatsapp/FunXMPP$Connection:event_handler	Lwhatsapp/FunXMPP$Listener;
      //   772: aload_1
      //   773: iconst_1
      //   774: invokeinterface 798 3 0
      //   779: goto -638 -> 141
      //   782: ldc_w 802
      //   785: aload_3
      //   786: invokevirtual 321	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   789: ifeq -648 -> 141
      //   792: aload_1
      //   793: ifnull -652 -> 141
      //   796: aload_2
      //   797: ldc_w 804
      //   800: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   803: astore_3
      //   804: aload_2
      //   805: ldc_w 805
      //   808: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   811: astore 4
      //   813: aload_2
      //   814: ldc_w 806
      //   817: invokevirtual 291	whatsapp/FunXMPP$ProtocolTreeNode:getAttributeValue	(Ljava/lang/String;)Ljava/lang/String;
      //   820: astore 5
      //   822: aload_3
      //   823: ifnull +24 -> 847
      //   826: aload_0
      //   827: getfield 149	whatsapp/FunXMPP$Connection:group_event_handler	Lwhatsapp/FunXMPP$GroupListener;
      //   830: ifnull -689 -> 141
      //   833: aload_0
      //   834: getfield 149	whatsapp/FunXMPP$Connection:group_event_handler	Lwhatsapp/FunXMPP$GroupListener;
      //   837: aload_1
      //   838: aload_3
      //   839: invokeinterface 809 3 0
      //   844: goto -703 -> 141
      //   847: aload 4
      //   849: ifnull +25 -> 874
      //   852: aload_0
      //   853: getfield 149	whatsapp/FunXMPP$Connection:group_event_handler	Lwhatsapp/FunXMPP$GroupListener;
      //   856: ifnull -715 -> 141
      //   859: aload_0
      //   860: getfield 149	whatsapp/FunXMPP$Connection:group_event_handler	Lwhatsapp/FunXMPP$GroupListener;
      //   863: aload_1
      //   864: aload 4
      //   866: invokeinterface 812 3 0
      //   871: goto -730 -> 141
      //   874: ldc_w 814
      //   877: aload 5
      //   879: invokevirtual 321	java/lang/String:equals	(Ljava/lang/Object;)Z
      //   882: ifeq -741 -> 141
      //   885: aload_0
      //   886: aload_2
      //   887: invokespecial 176	whatsapp/FunXMPP$Connection:parseCategories	(Lwhatsapp/FunXMPP$ProtocolTreeNode;)Ljava/util/Hashtable;
      //   890: astore_1
      //   891: aload_0
      //   892: getfield 147	whatsapp/FunXMPP$Connection:event_handler	Lwhatsapp/FunXMPP$Listener;
      //   895: aload_1
      //   896: invokeinterface 818 2 0
      //   901: goto -760 -> 141
      //   904: aload_2
      //   905: ldc 246
      //   907: invokestatic 286	whatsapp/FunXMPP$ProtocolTreeNode:tagEquals	(Lwhatsapp/FunXMPP$ProtocolTreeNode;Ljava/lang/String;)Z
      //   910: ifeq -769 -> 141
      //   913: aload_0
      //   914: aload_2
      //   915: invokespecial 820	whatsapp/FunXMPP$Connection:parseMessageInitialTagAlreadyChecked	(Lwhatsapp/FunXMPP$ProtocolTreeNode;)V
      //   918: goto -777 -> 141
      //
      // Exception table:
      //   from	to	target	type
      //   0	10	18	java/io/IOException
      //   0	10	21	whatsapp/FunXMPP$CorruptStreamException
      //   0	10	24	java/lang/Throwable
      //   243	251	271	java/lang/NumberFormatException
      //   488	495	502	java/lang/NumberFormatException
    }

    public void sendActive()
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[1];
      localObject[0] = new FunXMPP.KeyValue("type", "active");
      localObject = new FunXMPP.ProtocolTreeNode("presence", localObject);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendAddParticipants(String paramString, Vector paramVector)
      throws IOException
    {
      sendAddParticipants(paramString, paramVector, null, null);
    }

    public void sendAddParticipants(String paramString, Vector paramVector, Runnable paramRunnable, FunXMPP.IntRunnable paramIntRunnable)
      throws IOException
    {
      String str = makeId("add_group_participants_");
      this.pending_server_requests.put(str, new FunXMPP.IqResultHandler(paramRunnable, paramIntRunnable)
      {
        public void error(int paramInt)
        {
          if (this.val$onError != null)
            this.val$onError.run(paramInt);
        }

        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws FunXMPP.CorruptStreamException, IOException
        {
          Vector localVector = new Vector();
          Hashtable localHashtable = new Hashtable();
          FunXMPP.Connection.this.readSuccessAndFailure(paramProtocolTreeNode, localVector, localHashtable, "add");
          FunXMPP.Connection.this.group_event_handler.onAddGroupParticipants(paramString, localVector, localHashtable);
          if (this.val$onSuccess != null)
            this.val$onSuccess.run();
        }
      });
      sendVerbParticipants(paramString, paramVector, str, "add");
    }

    public void sendAvailableForChat()
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[1];
      localObject[0] = new FunXMPP.KeyValue("type", "available");
      localObject = new FunXMPP.ProtocolTreeNode("presence", localObject);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendClearDirty(String paramString)
      throws IOException
    {
      Vector localVector = new Vector();
      localVector.addElement(paramString);
      sendClearDirty(localVector);
    }

    public void sendClearDirty(Vector paramVector)
      throws IOException
    {
      Object localObject1 = makeId("clean_dirty_");
      this.pending_server_requests.put(localObject1, new FunXMPP.IqResultHandler()
      {
        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws FunXMPP.CorruptStreamException, IOException
        {
        }
      });
      int j = paramVector.size();
      Object localObject2 = new FunXMPP.ProtocolTreeNode[j];
      for (int i = 0; ; i++)
      {
        if (i >= j)
        {
          arrayOfKeyValue = new FunXMPP.KeyValue[1];
          arrayOfKeyValue[0] = new FunXMPP.KeyValue("xmlns", "urn:xmpp:whatsapp:dirty");
          localObject2 = new FunXMPP.ProtocolTreeNode("clean", arrayOfKeyValue, localObject2);
          arrayOfKeyValue = new FunXMPP.KeyValue[3];
          arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject1);
          arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "set");
          arrayOfKeyValue[2] = new FunXMPP.KeyValue("to", "s.whatsapp.net");
          localObject1 = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, (FunXMPP.ProtocolTreeNode)localObject2);
          this.out.write((FunXMPP.ProtocolTreeNode)localObject1);
          return;
        }
        FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[1];
        arrayOfKeyValue[0] = new FunXMPP.KeyValue("name", (String)paramVector.elementAt(i));
        localObject2[i] = new FunXMPP.ProtocolTreeNode("category", arrayOfKeyValue);
      }
    }

    public void sendClientConfig(String paramString1, String paramString2)
      throws IOException
    {
      Object localObject1 = makeId("config_");
      this.pending_server_requests.put(localObject1, new FunXMPP.IqResultHandler(paramString1, paramString2)
      {
        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws IOException, FunXMPP.CorruptStreamException
        {
          FunXMPP.Connection.this.event_handler.onClientConfigSet(this.val$pushID, this.val$platform);
        }
      });
      Object localObject2 = new FunXMPP.KeyValue[3];
      localObject2[0] = new FunXMPP.KeyValue("xmlns", "urn:xmpp:whatsapp:push");
      localObject2[1] = new FunXMPP.KeyValue("id", paramString1);
      localObject2[2] = new FunXMPP.KeyValue("platform", paramString2);
      localObject2 = new FunXMPP.ProtocolTreeNode("config", localObject2);
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject1);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "set");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("to", this.domain);
      localObject1 = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, (FunXMPP.ProtocolTreeNode)localObject2);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject1);
    }

    public void sendClose()
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[1];
      localObject[0] = new FunXMPP.KeyValue("type", "unavailable");
      localObject = new FunXMPP.ProtocolTreeNode("presence", localObject);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
      this.out.streamEnd();
    }

    public void sendComposing(String paramString)
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[1];
      localObject[0] = new FunXMPP.KeyValue("xmlns", "http://jabber.org/protocol/chatstates");
      localObject = new FunXMPP.ProtocolTreeNode("composing", localObject);
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[2];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("to", paramString);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "chat");
      localObject = new FunXMPP.ProtocolTreeNode("message", arrayOfKeyValue, (FunXMPP.ProtocolTreeNode)localObject);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendCreateGroupChat(String paramString)
      throws IOException
    {
      sendCreateGroupChat(paramString, null, null);
    }

    public void sendCreateGroupChat(String paramString, FunXMPP.StringRunnable paramStringRunnable, FunXMPP.IntRunnable paramIntRunnable)
      throws IOException
    {
      Object localObject1 = makeId("create_group_");
      this.pending_server_requests.put(localObject1, new FunXMPP.IqResultHandler(paramString, paramStringRunnable, paramIntRunnable)
      {
        public void error(int paramInt)
        {
          if (this.val$onError != null)
            this.val$onError.run(paramInt);
        }

        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws FunXMPP.CorruptStreamException, IOException
        {
          Object localObject = paramProtocolTreeNode.getChild(0);
          FunXMPP.ProtocolTreeNode.require((FunXMPP.ProtocolTreeNode)localObject, "group");
          localObject = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("id");
          FunXMPP.Connection.this.group_event_handler.onGroupCreated(FunXMPP.Connection.this.gidToGjid((String)localObject), this.val$subject);
          if (this.val$onSuccess != null)
            this.val$onSuccess.run(FunXMPP.Connection.this.gidToGjid((String)localObject));
        }
      });
      Object localObject2 = new FunXMPP.KeyValue[3];
      localObject2[0] = new FunXMPP.KeyValue("xmlns", "w:g");
      localObject2[1] = new FunXMPP.KeyValue("action", "create");
      localObject2[2] = new FunXMPP.KeyValue("subject", paramString);
      localObject2 = new FunXMPP.ProtocolTreeNode("group", localObject2);
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject1);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "set");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("to", "g.us");
      localObject1 = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, (FunXMPP.ProtocolTreeNode)localObject2);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject1);
    }

    public void sendDeleteFromRoster(String paramString)
      throws IOException
    {
      Object localObject1 = makeId("roster_");
      Object localObject2 = new FunXMPP.KeyValue[2];
      localObject2[0] = new FunXMPP.KeyValue("jid", paramString);
      localObject2[1] = new FunXMPP.KeyValue("subscription", "remove");
      localObject2 = new FunXMPP.ProtocolTreeNode("item", localObject2);
      Object localObject3 = new FunXMPP.KeyValue[1];
      localObject3[0] = new FunXMPP.KeyValue("xmlns", "jabber:iq:roster");
      localObject3 = new FunXMPP.ProtocolTreeNode("query", localObject3, (FunXMPP.ProtocolTreeNode)localObject2);
      localObject2 = new FunXMPP.KeyValue[2];
      localObject2[0] = new FunXMPP.KeyValue("type", "set");
      localObject2[1] = new FunXMPP.KeyValue("id", (String)localObject1);
      localObject1 = new FunXMPP.ProtocolTreeNode("iq", localObject2, (FunXMPP.ProtocolTreeNode)localObject3);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject1);
    }

    public void sendDeliveredReceiptAck(String paramString1, String paramString2)
      throws IOException
    {
      this.out.write(getReceiptAck(paramString1, paramString2, "delivered"));
    }

    public void sendEndGroupChat(String paramString)
      throws IOException
    {
      sendEndGroupChat(paramString, null, null);
    }

    public void sendEndGroupChat(String paramString, Runnable paramRunnable, FunXMPP.IntRunnable paramIntRunnable)
      throws IOException
    {
      Object localObject1 = makeId("remove_group_");
      this.pending_server_requests.put(localObject1, new FunXMPP.IqResultHandler(paramRunnable, paramIntRunnable)
      {
        public void error(int paramInt)
        {
          if (this.val$onError != null)
            this.val$onError.run(paramInt);
        }

        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws FunXMPP.CorruptStreamException, IOException
        {
          if (this.val$onSuccess != null)
            this.val$onSuccess.run();
        }
      });
      Object localObject2 = new FunXMPP.KeyValue[2];
      localObject2[0] = new FunXMPP.KeyValue("xmlns", "w:g");
      localObject2[1] = new FunXMPP.KeyValue("action", "delete");
      localObject2 = new FunXMPP.ProtocolTreeNode("group", localObject2);
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject1);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "set");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("to", paramString);
      localObject1 = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, (FunXMPP.ProtocolTreeNode)localObject2);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject1);
    }

    public void sendGetClientConfig()
      throws IOException
    {
      Object localObject1 = makeId("get_config_");
      this.pending_server_requests.put(localObject1, new FunXMPP.IqResultHandler()
      {
        public void error(FunXMPP.ProtocolTreeNode paramProtocolTreeNode)
          throws FunXMPP.CorruptStreamException, IOException
        {
          Vector localVector = paramProtocolTreeNode.getAllChildren("config");
          for (int i = 0; ; i++)
          {
            if (i >= localVector.size())
              return;
            Object localObject = (FunXMPP.ProtocolTreeNode)localVector.elementAt(i);
            if (localObject == null)
              continue;
            localObject = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("id");
            FunXMPP.Connection.this.event_handler.onClientConfigReceived((String)localObject);
          }
        }

        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws FunXMPP.CorruptStreamException, IOException
        {
          Object localObject = paramProtocolTreeNode.getChild(0);
          FunXMPP.ProtocolTreeNode.require((FunXMPP.ProtocolTreeNode)localObject, "config");
          localObject = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("id");
          FunXMPP.Connection.this.event_handler.onClientConfigReceived((String)localObject);
        }
      });
      Object localObject2 = new FunXMPP.KeyValue[1];
      localObject2[0] = new FunXMPP.KeyValue("xmlns", "urn:xmpp:whatsapp:push");
      localObject2 = new FunXMPP.ProtocolTreeNode("config", localObject2);
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject1);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "get");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("to", this.domain);
      localObject1 = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, (FunXMPP.ProtocolTreeNode)localObject2);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject1);
    }

    public void sendGetDirty()
      throws IOException
    {
      Object localObject = makeId("get_dirty_");
      this.pending_server_requests.put(localObject, new FunXMPP.IqResultHandler()
      {
        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws FunXMPP.CorruptStreamException, IOException
        {
          Object localObject = paramProtocolTreeNode.getChild(0);
          FunXMPP.ProtocolTreeNode.require((FunXMPP.ProtocolTreeNode)localObject, "dirty");
          localObject = FunXMPP.Connection.this.parseCategories((FunXMPP.ProtocolTreeNode)localObject);
          FunXMPP.Connection.this.event_handler.onDirtyResponse((Hashtable)localObject);
        }
      });
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[1];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("xmlns", "urn:xmpp:whatsapp:dirty");
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("status", arrayOfKeyValue);
      arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "get");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("to", "s.whatsapp.net");
      localObject = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, localProtocolTreeNode);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendGetGroupInfo(String paramString)
      throws IOException
    {
      Object localObject = makeId("get_g_info_");
      this.pending_server_requests.put(localObject, new FunXMPP.IqResultHandler()
      {
        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws FunXMPP.CorruptStreamException, IOException
        {
          Object localObject = paramProtocolTreeNode.getChild(0);
          FunXMPP.ProtocolTreeNode.require((FunXMPP.ProtocolTreeNode)localObject, "group");
          ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("id");
          String str3 = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("owner");
          String str4 = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("subject");
          String str2 = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("s_t");
          String str1 = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("s_o");
          localObject = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("creation");
          FunXMPP.Connection.this.group_event_handler.onGroupInfo(paramString, str3, str4, str1, Integer.parseInt(str2), Integer.parseInt((String)localObject));
        }
      });
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[1];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("xmlns", "w:g");
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("query", arrayOfKeyValue);
      arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "get");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("to", paramString);
      localObject = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, localProtocolTreeNode);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    /** @deprecated */
    public void sendGetGroups()
      throws IOException
    {
      monitorenter;
      try
      {
        sendGetGroups((Runnable)null, (FunXMPP.IntRunnable)null);
        monitorexit;
        return;
      }
      finally
      {
        localObject = finally;
        monitorexit;
      }
      throw localObject;
    }

    /** @deprecated */
    public void sendGetGroups(Runnable paramRunnable, FunXMPP.IntRunnable paramIntRunnable)
      throws IOException
    {
      monitorenter;
      try
      {
        String str = makeId("get_groups_");
        this.pending_server_requests.put(str, new FunXMPP.IqResultHandler(paramRunnable, paramIntRunnable)
        {
          public void error(int paramInt)
          {
            if (this.val$onError != null)
              this.val$onError.run(paramInt);
          }

          public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
            throws FunXMPP.CorruptStreamException, IOException
          {
            Vector localVector = new Vector();
            FunXMPP.Connection.this.readGroupList(paramProtocolTreeNode, localVector);
            FunXMPP.Connection.this.group_event_handler.onParticipatingGroups(localVector);
            if (this.val$onSuccess != null)
              this.val$onSuccess.run();
          }
        });
        sendGetGroups(str, "participating");
        monitorexit;
        return;
      }
      finally
      {
        localObject = finally;
        monitorexit;
      }
      throw localObject;
    }

    public void sendGetOwningGroups()
      throws IOException
    {
      String str = makeId("get_owning_groups_");
      this.pending_server_requests.put(str, new FunXMPP.IqResultHandler()
      {
        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws FunXMPP.CorruptStreamException, IOException
        {
          Vector localVector = new Vector();
          FunXMPP.Connection.this.readGroupList(paramProtocolTreeNode, localVector);
          FunXMPP.Connection.this.group_event_handler.onOwningGroups(localVector);
        }
      });
      sendGetGroups(str, "owning");
    }

    public void sendGetParticipants(String paramString)
      throws IOException
    {
      Object localObject = makeId("get_participants_");
      this.pending_server_requests.put(localObject, new FunXMPP.IqResultHandler()
      {
        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws IOException
        {
          Vector localVector = new Vector();
          FunXMPP.Connection.this.readAttributeList(paramProtocolTreeNode, localVector, "participant", "jid");
          FunXMPP.Connection.this.group_event_handler.onGetParticipants(paramString, localVector);
        }
      });
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[1];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("xmlns", "w:g");
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("list", arrayOfKeyValue);
      arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "get");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("to", paramString);
      localObject = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, localProtocolTreeNode);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendGetPrivacyList()
      throws IOException
    {
      Object localObject = makeId("privacylist_");
      this.pending_server_requests.put(localObject, new FunXMPP.IqResultHandler()
      {
        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws FunXMPP.CorruptStreamException, IOException
        {
          FunXMPP.ProtocolTreeNode localProtocolTreeNode1 = paramProtocolTreeNode.getChild(0);
          FunXMPP.ProtocolTreeNode.require(localProtocolTreeNode1, "query");
          FunXMPP.ProtocolTreeNode localProtocolTreeNode2 = localProtocolTreeNode1.getChild(0);
          FunXMPP.ProtocolTreeNode.require(localProtocolTreeNode2, "list");
          FunXMPP.Connection.this.event_handler.onPrivacyBlockListClear();
          if (localProtocolTreeNode2.children != null);
          for (int i = 0; ; i++)
          {
            if (i >= localProtocolTreeNode2.children.length)
              return;
            Object localObject = localProtocolTreeNode2.children[i];
            FunXMPP.ProtocolTreeNode.require((FunXMPP.ProtocolTreeNode)localObject, "item");
            if (!"jid".equals(((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("type")))
              continue;
            localObject = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("value");
            if (localObject == null)
              continue;
            FunXMPP.Connection.this.event_handler.onPrivacyBlockListAdd((String)localObject);
          }
        }
      });
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[1];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("name", "default");
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("list", arrayOfKeyValue);
      arrayOfKeyValue = new FunXMPP.KeyValue[1];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("xmlns", "jabber:iq:privacy");
      localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("query", arrayOfKeyValue, localProtocolTreeNode);
      arrayOfKeyValue = new FunXMPP.KeyValue[2];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "get");
      localObject = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, localProtocolTreeNode);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendGetProfilePhoto(String paramString, int paramInt)
      throws IOException
    {
      Object localObject = makeId("get_picture_");
      this.pending_server_requests.put(localObject, new FunXMPP.IqResultHandler(paramString)
      {
        public void error(int paramInt)
        {
          if (paramInt != 404)
            FunXMPP.Connection.this.event_handler.onProfilePhotoError(this.val$jid, paramInt);
          else
            FunXMPP.Connection.this.event_handler.onProfilePhotoReceived(this.val$jid, 0, null);
        }

        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws IOException, FunXMPP.CorruptStreamException
        {
          FunXMPP.ProtocolTreeNode localProtocolTreeNode = paramProtocolTreeNode.getChild(0);
          FunXMPP.ProtocolTreeNode.require(localProtocolTreeNode, "picture");
          String str = localProtocolTreeNode.getAttributeValue("id");
          if ((str != null) && (paramString != null));
          try
          {
            FunXMPP.Connection.this.event_handler.onProfilePhotoReceived(paramString, Integer.parseInt(str), localProtocolTreeNode.data);
            label51: return;
          }
          catch (NumberFormatException localNumberFormatException)
          {
            break label51;
          }
        }
      });
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[2];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("xmlns", "w:profile:picture");
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("id", Integer.toString(paramInt));
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("picture", arrayOfKeyValue);
      arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("to", paramString);
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("type", "get");
      localObject = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, localProtocolTreeNode);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    /** @deprecated */
    public void sendGetProfilePhotoIds(String[] paramArrayOfString)
      throws IOException
    {
      monitorenter;
      try
      {
        Object localObject1 = makeId("get_picture_ids_");
        this.pending_server_requests.put(localObject1, new FunXMPP.IqResultHandler()
        {
          public void error(int paramInt)
          {
            FunXMPP.Connection.this.event_handler.onProfilePhotoError(null, paramInt);
          }

          public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
            throws FunXMPP.CorruptStreamException, IOException
          {
            FunXMPP.ProtocolTreeNode localProtocolTreeNode = paramProtocolTreeNode.getChild("list");
            Vector localVector;
            int i;
            if (localProtocolTreeNode != null)
            {
              localVector = localProtocolTreeNode.getAllChildren("user");
              i = 0;
            }
            while (true)
            {
              Object localObject;
              String str1;
              String str2;
              if (i < localVector.size())
              {
                localObject = (FunXMPP.ProtocolTreeNode)localVector.elementAt(i);
                str1 = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("jid");
                str2 = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("id");
              }
              try
              {
                localObject = FunXMPP.Connection.this.event_handler;
                int j;
                if (str2 == null)
                  j = 0;
                while (true)
                {
                  ((FunXMPP.Listener)localObject).onProfilePhotoId(str1, j);
                  break;
                  j = Integer.parseInt(j);
                  j = j;
                  continue;
                  return;
                }
              }
              catch (NumberFormatException localNumberFormatException)
              {
                i++;
              }
            }
          }
        });
        Object localObject3 = new FunXMPP.ProtocolTreeNode[paramArrayOfString.length];
        for (int i = 0; i < paramArrayOfString.length; i++)
        {
          localObject4 = paramArrayOfString[i];
          FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[1];
          arrayOfKeyValue[0] = new FunXMPP.KeyValue("jid", (String)localObject4);
          localObject3[i] = new FunXMPP.ProtocolTreeNode("user", arrayOfKeyValue);
        }
        Object localObject4 = new FunXMPP.KeyValue[1];
        localObject4[0] = new FunXMPP.KeyValue("xmlns", "w:profile:picture");
        if (localObject3.length == 0)
        {
          localObject3 = null;
          localObject4 = new FunXMPP.ProtocolTreeNode("list", localObject4, localObject3);
          localObject3 = new FunXMPP.KeyValue[2];
          localObject3[0] = new FunXMPP.KeyValue("id", (String)localObject1);
          localObject3[1] = new FunXMPP.KeyValue("type", "get");
          localObject1 = new FunXMPP.ProtocolTreeNode("iq", localObject3, (FunXMPP.ProtocolTreeNode)localObject4);
          this.out.write((FunXMPP.ProtocolTreeNode)localObject1);
          return;
        }
        localObject3 = localObject3;
      }
      finally
      {
        monitorexit;
      }
    }

    public void sendGetServerProperties()
      throws IOException
    {
      Object localObject = makeId("get_server_properties_");
      this.pending_server_requests.put(localObject, new FunXMPP.IqResultHandler()
      {
        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws FunXMPP.CorruptStreamException, IOException
        {
          Object localObject = paramProtocolTreeNode.getChild("props");
          if (localObject != null)
          {
            String str = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("version");
            try
            {
              i = Integer.parseInt(str);
              i = i;
              Vector localVector = ((FunXMPP.ProtocolTreeNode)localObject).getAllChildren("prop");
              localObject = new Hashtable();
              for (int j = 0; j < localVector.size(); j++)
              {
                FunXMPP.ProtocolTreeNode localProtocolTreeNode = (FunXMPP.ProtocolTreeNode)localVector.elementAt(j);
                ((Hashtable)localObject).put(localProtocolTreeNode.getAttributeValue("name"), localProtocolTreeNode.getAttributeValue("value"));
              }
            }
            catch (NumberFormatException localNumberFormatException)
            {
              int i;
              while (true)
                i = 0;
              FunXMPP.Connection.this.group_event_handler.onServerProperties(i, (Hashtable)localObject);
            }
          }
        }
      });
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[1];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("xmlns", "w");
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("props", arrayOfKeyValue);
      arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "get");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("to", "s.whatsapp.net");
      localObject = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, localProtocolTreeNode);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendInactive()
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[1];
      localObject[0] = new FunXMPP.KeyValue("type", "inactive");
      localObject = new FunXMPP.ProtocolTreeNode("presence", localObject);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendLeaveGroup(String paramString)
      throws IOException
    {
      sendLeaveGroup(paramString, null, null);
    }

    public void sendLeaveGroup(String paramString, Runnable paramRunnable, FunXMPP.IntRunnable paramIntRunnable)
      throws IOException
    {
      Vector localVector = new Vector();
      localVector.addElement(paramString);
      sendLeaveGroups(localVector, paramRunnable, paramIntRunnable);
    }

    public void sendLeaveGroups(Vector paramVector, Runnable paramRunnable, FunXMPP.IntRunnable paramIntRunnable)
      throws IOException
    {
      Object localObject1 = makeId("leave_group_");
      this.pending_server_requests.put(localObject1, new FunXMPP.IqResultHandler(paramRunnable, paramIntRunnable)
      {
        public void error(int paramInt)
        {
          if (this.val$onError != null)
            this.val$onError.run(paramInt);
        }

        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
        {
          Object localObject = paramProtocolTreeNode.getChild("leave");
          if (localObject != null)
            localObject = ((FunXMPP.ProtocolTreeNode)localObject).getAllChildren("group");
          for (int i = 0; ; i++)
          {
            if (i >= ((Vector)localObject).size())
            {
              if (this.val$onSuccess != null)
                this.val$onSuccess.run();
              return;
            }
            FunXMPP.Connection.this.group_event_handler.onLeaveGroup(((FunXMPP.ProtocolTreeNode)((Vector)localObject).elementAt(i)).getAttributeValue("id"));
          }
        }
      });
      int i = paramVector.size();
      Object localObject2 = new FunXMPP.ProtocolTreeNode[i];
      for (int j = 0; ; j++)
      {
        if (j >= i)
        {
          Object localObject3 = new FunXMPP.KeyValue[1];
          localObject3[0] = new FunXMPP.KeyValue("xmlns", "w:g");
          localObject3 = new FunXMPP.ProtocolTreeNode("leave", localObject3, localObject2);
          localObject2 = new FunXMPP.KeyValue[3];
          localObject2[0] = new FunXMPP.KeyValue("id", (String)localObject1);
          localObject2[1] = new FunXMPP.KeyValue("type", "set");
          localObject2[2] = new FunXMPP.KeyValue("to", "g.us");
          localObject1 = new FunXMPP.ProtocolTreeNode("iq", localObject2, (FunXMPP.ProtocolTreeNode)localObject3);
          this.out.write((FunXMPP.ProtocolTreeNode)localObject1);
          return;
        }
        FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[1];
        arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)paramVector.elementAt(j));
        localObject2[j] = new FunXMPP.ProtocolTreeNode("group", arrayOfKeyValue);
      }
    }

    public void sendMessage(FunXMPP.FMessage paramFMessage)
      throws IOException
    {
      if (paramFMessage.media_wa_type == 0)
        sendMessageWithBody(paramFMessage);
      else
        sendMessageWithMedia(paramFMessage);
    }

    public void sendMessageReceived(FunXMPP.FMessage paramFMessage)
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[1];
      localObject[0] = new FunXMPP.KeyValue("xmlns", "urn:xmpp:receipts");
      localObject = new FunXMPP.ProtocolTreeNode("received", localObject);
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("to", paramFMessage.key.remote_jid);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "chat");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("id", paramFMessage.key.id);
      localObject = new FunXMPP.ProtocolTreeNode("message", arrayOfKeyValue, (FunXMPP.ProtocolTreeNode)localObject);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendNop()
      throws IOException
    {
      this.out.write(null);
    }

    public void sendNotificationReceived(String paramString1, String paramString2)
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[1];
      localObject[0] = new FunXMPP.KeyValue("xmlns", "urn:xmpp:receipts");
      localObject = getNotificationMessage(paramString1, paramString2, new FunXMPP.ProtocolTreeNode("received", localObject));
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendPaused(String paramString)
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[1];
      localObject[0] = new FunXMPP.KeyValue("xmlns", "http://jabber.org/protocol/chatstates");
      localObject = new FunXMPP.ProtocolTreeNode("paused", localObject);
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[2];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("to", paramString);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "chat");
      localObject = new FunXMPP.ProtocolTreeNode("message", arrayOfKeyValue, (FunXMPP.ProtocolTreeNode)localObject);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendPing()
      throws IOException
    {
      Object localObject = makeId("ping_");
      this.pending_server_requests.put(localObject, new FunXMPP.IqResultHandler()
      {
        public void error(FunXMPP.ProtocolTreeNode paramProtocolTreeNode)
          throws FunXMPP.CorruptStreamException, IOException
        {
          FunXMPP.Connection.this.event_handler.onPingResponseReceived();
        }

        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws FunXMPP.CorruptStreamException, IOException
        {
          FunXMPP.Connection.this.event_handler.onPingResponseReceived();
        }
      });
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[1];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("xmlns", "w:p");
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("ping", arrayOfKeyValue);
      arrayOfKeyValue = new FunXMPP.KeyValue[2];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "get");
      localObject = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, localProtocolTreeNode);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendPong(String paramString)
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[3];
      localObject[0] = new FunXMPP.KeyValue("type", "result");
      localObject[1] = new FunXMPP.KeyValue("to", this.domain);
      localObject[2] = new FunXMPP.KeyValue("id", paramString);
      localObject = new FunXMPP.ProtocolTreeNode("iq", localObject);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendPresenceSubscriptionRequest(String paramString)
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[2];
      localObject[0] = new FunXMPP.KeyValue("type", "subscribe");
      localObject[1] = new FunXMPP.KeyValue("to", paramString);
      localObject = new FunXMPP.ProtocolTreeNode("presence", localObject);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendPushName(boolean paramBoolean)
      throws IOException
    {
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[2];
      if (!paramBoolean)
        localObject = "unavailable";
      else
        localObject = "available";
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("type", (String)localObject);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("name", this.push_name);
      Object localObject = new FunXMPP.ProtocolTreeNode("presence", arrayOfKeyValue);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendQueryLastOnline(String paramString)
      throws IOException
    {
      Object localObject = makeId("last_");
      this.pending_server_requests.put(localObject, new FunXMPP.IqResultHandler()
      {
        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws FunXMPP.CorruptStreamException, IOException
        {
          Object localObject = paramProtocolTreeNode.getChild(0);
          FunXMPP.ProtocolTreeNode.require((FunXMPP.ProtocolTreeNode)localObject, "query");
          String str = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("seconds");
          localObject = ((FunXMPP.ProtocolTreeNode)localObject).getDataStr();
          if ((str != null) && (paramString != null));
          try
          {
            FunXMPP.Connection.this.event_handler.onLastSeen(paramString, Integer.parseInt(str), (String)localObject);
            label56: return;
          }
          catch (NumberFormatException localNumberFormatException)
          {
            break label56;
          }
        }
      });
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[1];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("xmlns", "jabber:iq:last");
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("query", arrayOfKeyValue);
      arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "get");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("to", paramString);
      localObject = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, localProtocolTreeNode);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendRelayCapable(String paramString, boolean paramBoolean)
      throws IOException
    {
      Object localObject1 = makeId("relay_");
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("xmlns", "urn:xmpp:whatsapp:push");
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("platform", paramString);
      if (!paramBoolean)
        localObject2 = "0";
      else
        localObject2 = "1";
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("relay", (String)localObject2);
      Object localObject2 = new FunXMPP.ProtocolTreeNode("config", arrayOfKeyValue);
      arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject1);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "set");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("to", this.domain);
      localObject1 = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, (FunXMPP.ProtocolTreeNode)localObject2);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject1);
    }

    public void sendRelayComplete(String paramString, int paramInt)
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[1];
      localObject[0] = new FunXMPP.KeyValue("elapsed", Integer.toString(paramInt));
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("relay", localObject);
      localObject = new FunXMPP.KeyValue[4];
      localObject[0] = new FunXMPP.KeyValue("xmlns", "w:p:r");
      localObject[1] = new FunXMPP.KeyValue("type", "result");
      localObject[2] = new FunXMPP.KeyValue("to", "s.whatsapp.net");
      localObject[3] = new FunXMPP.KeyValue("id", paramString);
      localObject = new FunXMPP.ProtocolTreeNode("iq", localObject, localProtocolTreeNode);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendRelayTimeout(String paramString1, String paramString2)
      throws IOException
    {
      Object localObject1 = new FunXMPP.KeyValue[1];
      localObject1[0] = new FunXMPP.KeyValue("xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas");
      Object localObject2 = new FunXMPP.ProtocolTreeNode("remote-server-timeout", localObject1);
      localObject1 = new FunXMPP.KeyValue[3];
      localObject1[0] = new FunXMPP.KeyValue("code", "504");
      localObject1[1] = new FunXMPP.KeyValue("type", "wait");
      localObject1[2] = new FunXMPP.KeyValue("status", paramString2);
      localObject1 = new FunXMPP.ProtocolTreeNode("error", localObject1, (FunXMPP.ProtocolTreeNode)localObject2);
      localObject2 = new FunXMPP.KeyValue[4];
      localObject2[0] = new FunXMPP.KeyValue("xmlns", "w:p:r");
      localObject2[1] = new FunXMPP.KeyValue("type", "error");
      localObject2[2] = new FunXMPP.KeyValue("to", "s.whatsapp.net");
      localObject2[3] = new FunXMPP.KeyValue("id", paramString1);
      localObject1 = new FunXMPP.ProtocolTreeNode("iq", localObject2, (FunXMPP.ProtocolTreeNode)localObject1);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject1);
    }

    public void sendRemoveParticipants(String paramString, Vector paramVector)
      throws IOException
    {
      sendRemoveParticipants(paramString, paramVector, null, null);
    }

    public void sendRemoveParticipants(String paramString, Vector paramVector, Runnable paramRunnable, FunXMPP.IntRunnable paramIntRunnable)
      throws IOException
    {
      String str = makeId("remove_group_participants_");
      this.pending_server_requests.put(str, new FunXMPP.IqResultHandler(paramRunnable, paramIntRunnable)
      {
        public void error(int paramInt)
        {
          if (this.val$onError != null)
            this.val$onError.run(paramInt);
        }

        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws FunXMPP.CorruptStreamException, IOException
        {
          Vector localVector = new Vector();
          Hashtable localHashtable = new Hashtable();
          FunXMPP.Connection.this.readSuccessAndFailure(paramProtocolTreeNode, localVector, localHashtable, "remove");
          FunXMPP.Connection.this.group_event_handler.onRemoveGroupParticipants(paramString, localVector, localHashtable);
          if (this.val$onSuccess != null)
            this.val$onSuccess.run();
        }
      });
      sendVerbParticipants(paramString, paramVector, str, "remove");
    }

    public void sendSetGroupSubject(String paramString1, String paramString2)
      throws IOException
    {
      sendSetGroupSubject(paramString1, paramString2, null, null);
    }

    public void sendSetGroupSubject(String paramString1, String paramString2, Runnable paramRunnable, FunXMPP.IntRunnable paramIntRunnable)
      throws IOException
    {
      Object localObject = makeId("set_group_subject_");
      this.pending_server_requests.put(localObject, new FunXMPP.IqResultHandler(paramRunnable, paramIntRunnable)
      {
        public void error(int paramInt)
        {
          if (this.val$onError != null)
            this.val$onError.run(paramInt);
        }

        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws FunXMPP.CorruptStreamException, IOException
        {
          FunXMPP.Connection.this.group_event_handler.onSetSubject(paramString);
          if (this.val$onSuccess != null)
            this.val$onSuccess.run();
        }
      });
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[2];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("xmlns", "w:g");
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("value", paramString2);
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("subject", arrayOfKeyValue);
      arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("type", "set");
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("to", paramString1);
      localObject = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, localProtocolTreeNode);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendSetPrivacyBlockedList(Hashtable paramHashtable)
      throws IOException
    {
      sendSetPrivacyBlockedList(paramHashtable, null, null);
    }

    public void sendSetPrivacyBlockedList(Hashtable paramHashtable, Runnable paramRunnable, FunXMPP.IntRunnable paramIntRunnable)
      throws IOException
    {
      Object localObject1 = makeId("privacy_");
      Object localObject2 = this.pending_server_requests;
      Object localObject3 = new FunXMPP.IqResultHandler(paramRunnable, paramIntRunnable)
      {
        public void error(int paramInt)
        {
          if (this.val$onError != null)
            this.val$onError.run(paramInt);
        }

        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws IOException, FunXMPP.CorruptStreamException
        {
          if (this.val$onSuccess != null)
            this.val$onSuccess.run();
        }
      };
      ((Hashtable)localObject2).put(localObject1, localObject3);
      localObject2 = new FunXMPP.ProtocolTreeNode[paramHashtable.size()];
      Enumeration localEnumeration = paramHashtable.elements();
      for (int i = 0; ; i++)
      {
        if (!localEnumeration.hasMoreElements())
        {
          localObject3 = new FunXMPP.KeyValue[1];
          localObject3[0] = new FunXMPP.KeyValue("name", "default");
          if (localObject2.length != 0)
            localObject2 = localObject2;
          else
            localObject2 = null;
          localObject2 = new FunXMPP.ProtocolTreeNode("list", localObject3, localObject2);
          localObject3 = new FunXMPP.KeyValue[1];
          localObject3[0] = new FunXMPP.KeyValue("xmlns", "jabber:iq:privacy");
          localObject3 = new FunXMPP.ProtocolTreeNode("query", localObject3, (FunXMPP.ProtocolTreeNode)localObject2);
          localObject2 = new FunXMPP.KeyValue[2];
          localObject1 = new FunXMPP.KeyValue("id", (String)localObject1);
          localObject2[0] = localObject1;
          localObject2[1] = new FunXMPP.KeyValue("type", "set");
          localObject1 = new FunXMPP.ProtocolTreeNode("iq", localObject2, (FunXMPP.ProtocolTreeNode)localObject3);
          this.out.write((FunXMPP.ProtocolTreeNode)localObject1);
          return;
        }
        Object localObject4 = (String)localEnumeration.nextElement();
        localObject3 = new FunXMPP.KeyValue[4];
        localObject3[0] = new FunXMPP.KeyValue("type", "jid");
        localObject4 = new FunXMPP.KeyValue("value", (String)localObject4);
        localObject3[1] = localObject4;
        localObject3[2] = new FunXMPP.KeyValue("action", "deny");
        localObject3[3] = new FunXMPP.KeyValue("order", Integer.toString(i));
        localObject2[i] = new FunXMPP.ProtocolTreeNode("item", localObject3);
      }
    }

    public void sendSetProfilePhoto(String paramString, byte[] paramArrayOfByte, FunXMPP.StringRunnable paramStringRunnable, FunXMPP.IntRunnable paramIntRunnable)
      throws IOException
    {
      Object localObject = makeId("set_picture_");
      this.pending_server_requests.put(localObject, new FunXMPP.IqResultHandler(paramStringRunnable, paramArrayOfByte, paramIntRunnable)
      {
        public void error(int paramInt)
        {
          if (this.val$onError != null)
            this.val$onError.run(paramInt);
        }

        public void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
          throws IOException, FunXMPP.CorruptStreamException
        {
          if (this.val$onSuccess != null)
          {
            Object localObject = null;
            if (this.val$photoData != null)
            {
              localObject = paramProtocolTreeNode.getChild(0);
              FunXMPP.ProtocolTreeNode.require((FunXMPP.ProtocolTreeNode)localObject, "picture");
              localObject = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("id");
            }
            this.val$onSuccess.run((String)localObject);
          }
        }
      });
      FunXMPP.KeyValue[] arrayOfKeyValue = new FunXMPP.KeyValue[1];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("xmlns", "w:profile:picture");
      FunXMPP.ProtocolTreeNode localProtocolTreeNode = new FunXMPP.ProtocolTreeNode("picture", arrayOfKeyValue, paramArrayOfByte);
      arrayOfKeyValue = new FunXMPP.KeyValue[3];
      arrayOfKeyValue[0] = new FunXMPP.KeyValue("id", (String)localObject);
      arrayOfKeyValue[1] = new FunXMPP.KeyValue("to", paramString);
      arrayOfKeyValue[2] = new FunXMPP.KeyValue("type", "set");
      localObject = new FunXMPP.ProtocolTreeNode("iq", arrayOfKeyValue, localProtocolTreeNode);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendSubjectReceived(String paramString1, String paramString2)
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[1];
      localObject[0] = new FunXMPP.KeyValue("xmlns", "urn:xmpp:receipts");
      localObject = getSubjectMessage(paramString1, paramString2, new FunXMPP.ProtocolTreeNode("received", localObject));
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendUnavailableForChat()
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[1];
      localObject[0] = new FunXMPP.KeyValue("type", "unavailable");
      localObject = new FunXMPP.ProtocolTreeNode("presence", localObject);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendUnsubscribeHim(String paramString)
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[2];
      localObject[0] = new FunXMPP.KeyValue("type", "unsubscribed");
      localObject[1] = new FunXMPP.KeyValue("to", paramString);
      localObject = new FunXMPP.ProtocolTreeNode("presence", localObject);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendUnsubscribeMe(String paramString)
      throws IOException
    {
      Object localObject = new FunXMPP.KeyValue[2];
      localObject[0] = new FunXMPP.KeyValue("type", "unsubscribe");
      localObject[1] = new FunXMPP.KeyValue("to", paramString);
      localObject = new FunXMPP.ProtocolTreeNode("presence", localObject);
      this.out.write((FunXMPP.ProtocolTreeNode)localObject);
    }

    public void sendVisibleReceiptAck(String paramString1, String paramString2)
      throws IOException
    {
      this.out.write(getReceiptAck(paramString1, paramString2, "visible"));
    }

    public void setGroupPhotosCapable(boolean paramBoolean)
    {
      this.supports_group_photos = paramBoolean;
    }

    public void setPushName(String paramString)
    {
      this.push_name = paramString;
      try
      {
        sendPushName(true);
        label10: return;
      }
      catch (IOException localIOException)
      {
        break label10;
      }
    }

    public void setReceiptAckCapable(boolean paramBoolean)
    {
      this.supports_receipt_acks = paramBoolean;
    }

    public void setVerboseId(boolean paramBoolean)
    {
      this.verbose_id = paramBoolean;
    }
  }

  public static class FMessage
  {
    public static final int STATUS_NEVER_SEND = 6;
    public static final int STATUS_RECEIVED_BY_SERVER = 4;
    public static final int STATUS_RECEIVED_BY_TARGET = 5;
    public static final int STATUS_SENT_BY_CLIENT = 3;
    public static final int STATUS_SERVER_BOUNCE = 7;
    public static final int STATUS_UNSENT = 0;
    public static final int STATUS_UPLOADED = 2;
    public static final int STATUS_UPLOADING = 1;
    public static final byte WA_TYPE_AUDIO = 2;
    public static final byte WA_TYPE_CONTACT = 4;
    public static final byte WA_TYPE_IMAGE = 1;
    public static final byte WA_TYPE_LOCATION = 5;
    public static final byte WA_TYPE_SYSTEM = 7;
    public static final byte WA_TYPE_UNDEFINED = 0;
    public static final byte WA_TYPE_VIDEO = 3;
    static String generating_header = System.currentTimeMillis() / 1000L + "-";
    static int generating_id = 0;
    static Object generating_lock = new Object();
    public String data;
    public boolean gap_behind = true;
    public Key key;
    public double latitude;
    public double longitude;
    public int media_duration_seconds;
    public String media_mime_type;
    public String media_name;
    public long media_size;
    public String media_url;
    public byte media_wa_type;
    public final boolean needs_push = false;
    public boolean offline;
    public String remote_resource;
    public int status;
    public Object thumb_image;
    public long timestamp;
    public boolean wants_receipt = false;

    public FMessage(String paramString1, String paramString2, Object paramObject)
    {
      this(paramString1, true);
      this.data = paramString2;
      this.thumb_image = paramObject;
      this.timestamp = System.currentTimeMillis();
    }

    private FMessage(String paramString, boolean paramBoolean)
    {
      synchronized (generating_lock)
      {
        Key localKey;
        do
        {
          generating_id = 1 + generating_id;
          localKey = new Key(paramString, paramBoolean, generating_header + Integer.toString(generating_id));
        }
        while (FunXMPP.message_store.get(localKey) != null);
        FunXMPP.message_store.put(localKey, this);
        this.key = localKey;
        return;
      }
    }

    public FMessage(Key paramKey)
    {
      this.key = paramKey;
      synchronized (generating_lock)
      {
        FunXMPP.message_store.put(paramKey, this);
        return;
      }
    }

    public static byte getMessage_WA_Type(String paramString)
    {
      int i;
      if ((paramString != null) && (paramString.length() != 0))
      {
        if (!paramString.equalsIgnoreCase("system"))
        {
          if (!paramString.equalsIgnoreCase("image"))
          {
            if (!paramString.equalsIgnoreCase("audio"))
            {
              if (!paramString.equalsIgnoreCase("video"))
              {
                if (!paramString.equalsIgnoreCase("vcard"))
                {
                  if (!paramString.equalsIgnoreCase("location"))
                    i = 0;
                  else
                    i = 5;
                }
                else
                  i = 4;
              }
              else
                i = 3;
            }
            else
              i = 2;
          }
          else
            i = 1;
        }
        else
          i = 7;
      }
      else
        i = 0;
      return i;
    }

    public static String getMessage_WA_Type_StrValue(byte paramByte)
    {
      String str;
      if (paramByte != 0)
      {
        if (paramByte != 7)
        {
          if (paramByte != 1)
          {
            if (paramByte != 2)
            {
              if (paramByte != 3)
              {
                if (paramByte != 4)
                {
                  if (paramByte != 5)
                    str = null;
                  else
                    str = "location";
                }
                else
                  str = "vcard";
              }
              else
                str = "video";
            }
            else
              str = "audio";
          }
          else
            str = "image";
        }
        else
          str = "system";
      }
      else
        str = null;
      return str;
    }

    public void acceptVisitor(FunXMPP.FMessageVisitor paramFMessageVisitor)
    {
      switch (this.media_wa_type)
      {
      case 6:
      default:
        paramFMessageVisitor.undefined(this);
        break;
      case 1:
        paramFMessageVisitor.image(this);
        break;
      case 2:
        paramFMessageVisitor.audio(this);
        break;
      case 3:
        paramFMessageVisitor.video(this);
        break;
      case 4:
        paramFMessageVisitor.contact(this);
        break;
      case 5:
        paramFMessageVisitor.location(this);
        break;
      case 7:
        paramFMessageVisitor.system(this);
      }
    }

    public static class Key
    {
      public final boolean from_me;
      public final String id;
      public final String remote_jid;

      public Key(String paramString1, boolean paramBoolean, String paramString2)
      {
        this.remote_jid = paramString1;
        this.from_me = paramBoolean;
        this.id = paramString2;
      }

      static boolean exists(Key paramKey)
      {
        int i;
        if (FunXMPP.message_store.get(paramKey) == null)
          i = 0;
        else
          i = 1;
        return i;
      }

      public boolean equals(Object paramObject)
      {
        int i;
        if (this != paramObject)
        {
          if (paramObject != null)
          {
            if (getClass() == paramObject.getClass())
            {
              Key localKey = (Key)paramObject;
              if (this.from_me == localKey.from_me)
              {
                if (this.id != null)
                {
                  if (!this.id.equals(localKey.id))
                  {
                    i = 0;
                    break label134;
                  }
                }
                else
                  if (i.id != null)
                    break label112;
                if (this.remote_jid != null)
                {
                  if (!this.remote_jid.equals(i.remote_jid))
                  {
                    i = 0;
                    break label134;
                  }
                }
                else
                  if (i.remote_jid != null)
                    break label107;
                i = 1;
                break label134;
                label107: i = 0;
                break label134;
                label112: i = 0;
              }
              else
              {
                i = 0;
              }
            }
            else
            {
              i = 0;
            }
          }
          else
            i = 0;
        }
        else
          i = 1;
        label134: return i;
      }

      public int hashCode()
      {
        (1 * 31);
        int i;
        if (!this.from_me)
          i = 1237;
        else
          i = 1231;
        int j = 31 * (i + 31);
        if (this.id != null)
          i = this.id.hashCode();
        else
          i = 0;
        j = 31 * (j + i);
        if (this.remote_jid != null)
          i = this.remote_jid.hashCode();
        else
          i = 0;
        return j + i;
      }

      public String toString()
      {
        return "Key[id=" + this.id + ", from_me=" + this.from_me + ", remote_jid=" + this.remote_jid + "]";
      }
    }

    public static class Builder
    {
      private String data;
      private Boolean from_me;
      private String id;
      private Double latitude;
      private Double longitude;
      private Integer media_duration_seconds;
      private String media_name;
      private Long media_size;
      private String media_url;
      private Byte media_wa_type;
      private FunXMPP.FMessage message;
      private Boolean offline;
      private String remote_jid;
      private String remote_resource;
      private String thumb_image;
      private Long timestamp;
      private Boolean wants_receipt;

      public FunXMPP.FMessage build()
      {
        FunXMPP.FMessage localFMessage;
        if (this.message != null)
        {
          if ((this.remote_jid != null) && (this.from_me != null) && (this.id != null))
            this.message.key = new FunXMPP.FMessage.Key(this.remote_jid, this.from_me.booleanValue(), this.id);
          if (this.remote_resource != null)
            this.message.remote_resource = this.remote_resource;
          if (this.wants_receipt != null)
            this.message.wants_receipt = this.wants_receipt.booleanValue();
          if (this.data != null)
            this.message.data = this.data;
          if (this.thumb_image != null)
            this.message.thumb_image = this.thumb_image;
          if (this.timestamp != null)
            this.message.timestamp = this.timestamp.longValue();
          if (this.offline != null)
            this.message.offline = this.offline.booleanValue();
          if (this.media_wa_type != null)
            this.message.media_wa_type = this.media_wa_type.byteValue();
          if (this.media_size != null)
            this.message.media_size = this.media_size.longValue();
          if (this.media_duration_seconds != null)
            this.message.media_duration_seconds = this.media_duration_seconds.intValue();
          if (this.media_url != null)
            this.message.media_url = this.media_url;
          if (this.media_name != null)
            this.message.media_name = this.media_name;
          if (this.latitude != null)
            this.message.latitude = this.latitude.doubleValue();
          if (this.longitude != null)
            this.message.longitude = this.longitude.doubleValue();
          localFMessage = this.message;
        }
        else
        {
          localFMessage = null;
        }
        return localFMessage;
      }

      public String data()
      {
        return this.data;
      }

      public Builder data(String paramString)
      {
        this.data = paramString;
        return this;
      }

      public Builder data(byte[] paramArrayOfByte)
        throws UnsupportedEncodingException
      {
        if (paramArrayOfByte != null)
          this.data = new String(paramArrayOfByte, "UTF-8");
        else
          this.data = null;
        return this;
      }

      public Boolean from_me()
      {
        return this.from_me;
      }

      public Builder from_me(boolean paramBoolean)
      {
        Boolean localBoolean;
        if (!paramBoolean)
          localBoolean = Boolean.FALSE;
        else
          localBoolean = Boolean.TRUE;
        this.from_me = localBoolean;
        return this;
      }

      public String id()
      {
        return this.id;
      }

      public Builder id(String paramString)
      {
        this.id = paramString;
        return this;
      }

      public boolean instantiated()
      {
        int i;
        if (this.message == null)
          i = 0;
        else
          i = 1;
        return i;
      }

      public Builder key(FunXMPP.FMessage.Key paramKey)
      {
        this.remote_jid = paramKey.remote_jid;
        Boolean localBoolean;
        if (!paramKey.from_me)
          localBoolean = Boolean.FALSE;
        else
          localBoolean = Boolean.TRUE;
        this.from_me = localBoolean;
        this.id = paramKey.id;
        return this;
      }

      public FunXMPP.FMessage.Key key()
      {
        return new FunXMPP.FMessage.Key(this.remote_jid, this.from_me.booleanValue(), this.id);
      }

      public Double latitude()
      {
        return this.latitude;
      }

      public Builder latitude(Double paramDouble)
      {
        this.latitude = paramDouble;
        return this;
      }

      public Double longitude()
      {
        return this.longitude;
      }

      public Builder longitude(Double paramDouble)
      {
        this.longitude = paramDouble;
        return this;
      }

      public Integer media_duration_seconds()
      {
        return this.media_duration_seconds;
      }

      public Builder media_duration_seconds(int paramInt)
      {
        this.media_duration_seconds = new Integer(paramInt);
        return this;
      }

      public String media_name()
      {
        return this.media_name;
      }

      public Builder media_name(String paramString)
      {
        this.media_name = paramString;
        return this;
      }

      public Long media_size()
      {
        return this.media_size;
      }

      public Builder media_size(long paramLong)
      {
        this.media_size = new Long(paramLong);
        return this;
      }

      public String media_url()
      {
        return this.media_url;
      }

      public Builder media_url(String paramString)
      {
        this.media_url = paramString;
        return this;
      }

      public Byte media_wa_type()
      {
        return this.media_wa_type;
      }

      public Builder media_wa_type(byte paramByte)
      {
        this.media_wa_type = new Byte(paramByte);
        return this;
      }

      public Builder newIncomingInstance()
        throws UnsupportedOperationException
      {
        if ((this.remote_jid != null) && (this.from_me != null) && (this.id != null))
        {
          this.message = new FunXMPP.FMessage(new FunXMPP.FMessage.Key(this.remote_jid, this.from_me.booleanValue(), this.id));
          return this;
        }
        throw new UnsupportedOperationException("missing required property before instantiating new incoming message");
      }

      public Builder newOutgoingInstance()
      {
        if ((this.remote_jid != null) && (this.data != null) && (this.thumb_image != null))
        {
          if ((this.id == null) && ((this.from_me == null) || (this.from_me.booleanValue())))
          {
            this.message = new FunXMPP.FMessage(this.remote_jid, this.data, this.thumb_image);
            return this;
          }
          throw new UnsupportedOperationException("invalid property set before instantiating new outgoing message");
        }
        throw new UnsupportedOperationException("missing required property before instantiating new outgoing message");
      }

      public Boolean offline()
      {
        return this.offline;
      }

      public Builder offline(Boolean paramBoolean)
      {
        this.offline = paramBoolean;
        return this;
      }

      public String remote_jid()
      {
        return this.remote_jid;
      }

      public Builder remote_jid(String paramString)
      {
        this.remote_jid = paramString;
        return this;
      }

      public String remote_resource()
      {
        return this.remote_resource;
      }

      public Builder remote_resource(String paramString)
      {
        this.remote_resource = paramString;
        return this;
      }

      public Builder setInstance(FunXMPP.FMessage paramFMessage)
      {
        this.message = paramFMessage;
        return this;
      }

      public String thumb_image()
      {
        return this.thumb_image;
      }

      public Builder thumb_image(String paramString)
      {
        this.thumb_image = paramString;
        return this;
      }

      public Long timestamp()
      {
        return this.timestamp;
      }

      public Builder timestamp(long paramLong)
      {
        this.timestamp = new Long(paramLong);
        return this;
      }

      public Boolean wants_receipt()
      {
        return this.wants_receipt;
      }

      public Builder wants_receipt(boolean paramBoolean)
      {
        Boolean localBoolean;
        if (!paramBoolean)
          localBoolean = Boolean.FALSE;
        else
          localBoolean = Boolean.TRUE;
        this.wants_receipt = localBoolean;
        return this;
      }
    }
  }

  public static class FunRuntimeException extends RuntimeException
  {
    String bufString;
    Throwable t;

    public FunRuntimeException(Throwable paramThrowable, String paramString)
    {
      this.bufString = paramString;
      this.t = paramThrowable;
    }

    public Throwable getInner()
    {
      return this.t;
    }

    public String getMessage()
    {
      return "Wrapping: " + this.t.getClass().getName() + "\nFunRuntimeException last stanza: " + this.bufString;
    }
  }

  public static class CorruptStreamException extends Exception
  {
    String bufString;

    public CorruptStreamException()
    {
    }

    public CorruptStreamException(String paramString)
    {
      super();
    }

    public CorruptStreamException(String paramString1, String paramString2)
    {
      super();
      this.bufString = paramString2;
    }

    public String getStanza()
    {
      return this.bufString;
    }
  }

  public static class LoginFailureException extends Exception
  {
    public static final int TYPE_EXPIRED = 1;
    public static final int TYPE_PASSWORD;
    public long expire_date;
    public int type;

    public LoginFailureException(int paramInt)
    {
      this.type = paramInt;
    }
  }

  public static abstract interface FMessageVisitor
  {
    public abstract void audio(FunXMPP.FMessage paramFMessage);

    public abstract void contact(FunXMPP.FMessage paramFMessage);

    public abstract void image(FunXMPP.FMessage paramFMessage);

    public abstract void location(FunXMPP.FMessage paramFMessage);

    public abstract void system(FunXMPP.FMessage paramFMessage);

    public abstract void undefined(FunXMPP.FMessage paramFMessage);

    public abstract void video(FunXMPP.FMessage paramFMessage);
  }

  public static abstract class IqResultHandler
  {
    public void error(int paramInt)
    {
    }

    public void error(FunXMPP.ProtocolTreeNode paramProtocolTreeNode)
      throws IOException, FunXMPP.CorruptStreamException
    {
      Vector localVector = paramProtocolTreeNode.getAllChildren("error");
      for (int i = 0; ; i++)
      {
        if (i >= localVector.size())
          return;
        Object localObject = (FunXMPP.ProtocolTreeNode)localVector.elementAt(i);
        if (localObject == null)
          continue;
        localObject = ((FunXMPP.ProtocolTreeNode)localObject).getAttributeValue("code");
        if (localObject == null)
          continue;
        error(Integer.parseInt((String)localObject));
      }
    }

    public abstract void parse(FunXMPP.ProtocolTreeNode paramProtocolTreeNode, String paramString)
      throws IOException, FunXMPP.CorruptStreamException;
  }

  public static abstract interface StringRunnable
  {
    public abstract void run(String paramString);
  }

  public static abstract interface IntRunnable
  {
    public abstract void run(int paramInt);
  }

  public static abstract interface GroupListener
  {
    public abstract void onAddGroupParticipants(String paramString, Vector paramVector, Hashtable paramHashtable);

    public abstract void onGetParticipants(String paramString, Vector paramVector);

    public abstract void onGroupAddUser(String paramString1, String paramString2);

    public abstract void onGroupCreated(String paramString1, String paramString2);

    public abstract void onGroupInfo(String paramString1, String paramString2, String paramString3, String paramString4, int paramInt1, int paramInt2);

    public abstract void onGroupInfoFromList(String paramString1, String paramString2, String paramString3, String paramString4, int paramInt1, int paramInt2);

    public abstract void onGroupNewSubject(String paramString1, String paramString2, String paramString3, int paramInt);

    public abstract void onGroupRemoveUser(String paramString1, String paramString2);

    public abstract void onLeaveGroup(String paramString);

    public abstract void onOwningGroups(Vector paramVector);

    public abstract void onParticipatingGroups(Vector paramVector);

    public abstract void onRemoveGroupParticipants(String paramString, Vector paramVector, Hashtable paramHashtable);

    public abstract void onServerProperties(int paramInt, Hashtable paramHashtable);

    public abstract void onSetSubject(String paramString);
  }

  public static abstract interface Listener
  {
    public abstract void onAccountChange(int paramInt, long paramLong);

    public abstract void onAvailable(String paramString, boolean paramBoolean);

    public abstract void onClientConfigReceived(String paramString);

    public abstract void onClientConfigSet(String paramString1, String paramString2);

    public abstract void onDirty(Hashtable paramHashtable);

    public abstract void onDirtyResponse(Hashtable paramHashtable);

    public abstract void onIsTyping(String paramString, boolean paramBoolean);

    public abstract void onLastSeen(String paramString1, int paramInt, String paramString2);

    public abstract void onMessageError(FunXMPP.FMessage paramFMessage, int paramInt);

    public abstract void onMessageForMe(FunXMPP.FMessage paramFMessage, boolean paramBoolean)
      throws IOException;

    public abstract void onMessageStatusUpdate(FunXMPP.FMessage paramFMessage);

    public abstract void onPing(String paramString)
      throws IOException;

    public abstract void onPingResponseReceived();

    public abstract void onPrivacyBlockListAdd(String paramString);

    public abstract void onPrivacyBlockListClear();

    public abstract void onProfilePhotoChange(String paramString1, String paramString2, int paramInt1, int paramInt2);

    public abstract void onProfilePhotoError(String paramString, int paramInt);

    public abstract void onProfilePhotoId(String paramString, int paramInt);

    public abstract void onProfilePhotoReceived(String paramString, int paramInt, byte[] paramArrayOfByte);

    public abstract void onRelayRequest(String paramString1, String paramString2, int paramInt, String paramString3);
  }

  public static abstract interface DateParser
  {
    public abstract Date parse(String paramString);
  }
}