Class Icq.ICQLib
All Packages Class Hierarchy This Package Previous Next Index
Class Icq.ICQLib
Object
|
+----Icq.ICQLib
- public class ICQLib
- extends Object
Forms V4/V3 ICQ UDP packets. Has some methods to analyze packets
- Version:
- 1.0
- Author:
- Egidijus Neniskis - Lithuania
-
Icq.ICQLib(byte[], byte[], int)
-
-
calculateInsertCheckcode(byte[])
- calculates and inserts check code into packet
-
cmdAckToSrv_X2(int)
- forms and returns - safe to delete offline messages at server - packet
-
cmdAcknowledge(int, int, int)
-
-
cmdFinalLogin(int)
- forms Login2 packet
-
cmdKeepAlive(int)
- Send this packet every ~2 minutes, regardless of activity and CmdKeepAlive2 too
-
cmdKeepAlive2(int)
- Send this packet every ~2 minutes (regardless of activity) and CmdKeepAlive too
-
cmdLogin(String, int)
- forms Login packet
-
cmdLogout(int)
- Send this packet if you want logout
-
cmdSendContactList(int, int[], int)
- forms contact list packet
-
cmdSendInvisibleList(int, int[], int)
- forms invisibleList packet
-
cmdSendTextMessage(String, int, int)
- forms and returns - send text message - packet
-
cmdSendVisibleList(int, int[], int)
- forms visibleList packet
-
decryptPacket(byte[], int, int)
- decodes or encodes packet
-
getKey32(byte[], int)
-
-
getSeqFromPacketV3(byte[])
-
-
getSeqFromPacketV4(byte[])
-
-
getTextFromMessage(byte[])
- Can be used with Cmd220 and Cmd260 otherwise will return ""
-
getTimeFromMessage(byte[])
- Can be used only with Cmd220 and Cmd270, otherwise will return 0,0,0,0,0
-
getUinFromMessage(byte[])
- Can be used with Cmd220 and Cmd260 otherwise will return 0
-
getV3MultiPacketAllCmds(byte[])
-
-
getV3MultiPacketInnerPacket(byte[], int)
- returns inner packet; first packet's number=0
-
insertDWord(int, int, byte[])
- inserts dword into packet
-
insertWord(int, int, byte[])
- inserts word into packet
-
makePacket(byte[], int, int, int, int)
- forms Icq packet
-
reverseInt32(int)
-
ICQLib
public ICQLib(byte tarIP,
byte locIP,
int socketPort)
- Parameters:
- tarIP[] - servers IP
- locIP[] - client IP (your computer)
- socketPort - server socket number
calculateInsertCheckcode
protected byte[] calculateInsertCheckcode(byte pkt)
- calculates and inserts check code into packet
- Parameters:
- pkt[] - packet without check code
- Returns:
- packet with check code
cmdAckToSrv_X2
public byte[] cmdAckToSrv_X2(int uin)
- forms and returns - safe to delete offline messages at server - packet
- Parameters:
- uin - user uin
- Returns:
- Icq packet
cmdAcknowledge
public byte[] cmdAcknowledge(int number1,
int number2,
int uin)
- Parameters:
- number1 - packet number1
- number2 - packet number2
- uin - user uin
- Returns:
- ACK packet
cmdFinalLogin
public byte[] cmdFinalLogin(int uin)
- forms Login2 packet
- Parameters:
- uin - user uin
- Returns:
- Icq packet
cmdKeepAlive
public byte[] cmdKeepAlive(int uin)
- Send this packet every ~2 minutes, regardless of activity and CmdKeepAlive2 too
- Parameters:
- uin - client uin
- Returns:
- Icq packet
cmdKeepAlive2
public byte[] cmdKeepAlive2(int uin)
- Send this packet every ~2 minutes (regardless of activity) and CmdKeepAlive too
- Parameters:
- uin - client uin
- Returns:
- Icq packet
cmdLogin
public byte[] cmdLogin(String password,
int uin)
- forms Login packet
- Parameters:
- password - user login password
- uin - user uin
- Returns:
- Icq packet
cmdLogout
public byte[] cmdLogout(int uin)
- Send this packet if you want logout
- Parameters:
- uin - client uin
- Returns:
- Icq packet
cmdSendContactList
public byte[] cmdSendContactList(int number,
int contacts,
int uin)
- forms contact list packet
- Parameters:
- number - size of contacts[]
- contacts[] - array of user personal contacts
- uin - user uin
- Returns:
- Icq packet
cmdSendInvisibleList
public byte[] cmdSendInvisibleList(int number,
int contacts,
int uin)
- forms invisibleList packet
- Parameters:
- number - size of contacts[]
- contacts[] - array of user personal contacts
- uin - user uin
- Returns:
- Icq packet
cmdSendTextMessage
public byte[] cmdSendTextMessage(String text,
int destuin,
int uin)
- forms and returns - send text message - packet
- Parameters:
- text - message text
- destuin - destination uin
- uin - senders uin
- Returns:
- Icq packet
cmdSendVisibleList
public byte[] cmdSendVisibleList(int number,
int contacts,
int uin)
- forms visibleList packet
- Parameters:
- number - size of contacts[]
- contacts[] - array of user personal contacts
- uin - user uin
- Returns:
- Icq packet
decryptPacket
protected synchronized byte[] decryptPacket(byte pkt,
int size,
int key)
- decodes or encodes packet
- Parameters:
- pkt[] - packet to encode, decode
- size - packet size in bytes
- key - key for encrypting or decrypting
- Returns:
- Icq packet
getKey32
protected synchronized int getKey32(byte bfr,
int size)
- Parameters:
- bfr[] - packet with check code
- size - packet size in bytes
- Returns:
- key for encoding
getSeqFromPacketV3
public int[] getSeqFromPacketV3(byte packet)
- Parameters:
- packet[] - Icq packet
- Returns:
- seq_numbers from V3 packet
getSeqFromPacketV4
public int[] getSeqFromPacketV4(byte packet)
- Parameters:
- packet[] - Icq V4 packet
- Returns:
- seq_numbers from coded V4 packet
getTextFromMessage
public java.lang.String getTextFromMessage(byte data)
- Can be used with Cmd220 and Cmd260 otherwise will return ""
- Parameters:
- data[] - packet with message
- Returns:
- message text
getTimeFromMessage
public short[] getTimeFromMessage(byte data)
- Can be used only with Cmd220 and Cmd270, otherwise will return 0,0,0,0,0
- Parameters:
- data[] - packet with message
- Returns:
- array {year,month,day,hour,minute} with time
getUinFromMessage
public int getUinFromMessage(byte data)
- Can be used with Cmd220 and Cmd260 otherwise will return 0
- Parameters:
- data[] - message packet
- Returns:
- sender's uin
getV3MultiPacketAllCmds
public int[] getV3MultiPacketAllCmds(byte packet)
- Parameters:
- packet[] - Icq multipacket
- Returns:
- array of commands in multipacket
getV3MultiPacketInnerPacket
public byte[] getV3MultiPacketInnerPacket(byte packet,
int number)
- returns inner packet; first packet's number=0
- Parameters:
- packet - icq packet
- number - inner packet number
- Returns:
- Icq packet with number 'number'
insertDWord
protected byte[] insertDWord(int position,
int dword,
byte packet)
- inserts dword into packet
- Parameters:
- position - first byte position
- dword - what to insert
- packet[] - where to insert
- Returns:
- packet
insertWord
protected byte[] insertWord(int position,
int word,
byte packet)
- inserts word into packet
- Parameters:
- position - first byte position
- word - what to insert
- packet[] - where to insert
- Returns:
- packet
makePacket
protected synchronized byte[] makePacket(byte data,
int cmd,
int uin,
int seq_number1,
int seq_number2)
- forms Icq packet
- Parameters:
- data[] - packet data(not header)
- cmd - packet command
- uin - user uin
- seq_number1 - packet first sequence number
- seq_number2 - packet second sequence number
- Returns:
- formed and enscrypted packet
reverseInt32
protected int reverseInt32(int l)
- Parameters:
- dword - to operate with
- Returns:
- dword in reverse byte order
All Packages Class Hierarchy This Package Previous Next Index