Skip to content

Commit

Permalink
ICQ 16 chars password support, app ID update.
Browse files Browse the repository at this point in the history
  • Loading branch information
snuk182 committed Aug 22, 2017
1 parent 66d8e9b commit 5e4359c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Ace IM ICQ Module/pom.xml
Expand Up @@ -11,7 +11,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<version>0.9.3</version>
<version>0.9.3.1</version>
<api.version>0.9.3</api.version>
</properties>

Expand All @@ -27,7 +27,7 @@
<artifactId>support-v4</artifactId>
<version>v17</version>
<scope>system</scope>
<systemPath>c:/android-sdk-windows/android-compatibility/v4/android-support-v4.jar</systemPath>
<systemPath>C:/android-sdk-windows/extras/android/support/v4/android-support-v4.jar</systemPath>
</dependency>
<dependency>
<groupId>aceim</groupId>
Expand Down
2 changes: 1 addition & 1 deletion Ace IM ICQ Module/res/values/version.xml
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="version">0.9.3</string>
<string name="version">0.9.3.1</string>
</resources>
Expand Up @@ -169,7 +169,6 @@ public short getFlapSeqNumber() {
if (flapSeqNumber >= 0x8000) {
flapSeqNumber = 0;
}
;
return flapSeqNumber++;
}

Expand Down Expand Up @@ -665,9 +664,8 @@ public Object request(short action, final Object... args) throws ICQException {
un = (String) args[0];
pw = (String) args[1];

// ICQ does not support passwords longer than 8 symbols
if (pw != null && pw.length() > 8) {
pw = pw.substring(0, 8);
if (pw != null && pw.length() > AuthenticationProcessor.MAX_PASSWORD_LEN) {
pw = pw.substring(0, AuthenticationProcessor.MAX_PASSWORD_LEN);
}

if (args[2] != null) {
Expand Down
Expand Up @@ -28,6 +28,8 @@ public class AuthenticationProcessor extends AbstractFlapProcessor {
private int reconnectPort = 0;

public boolean isSecureLogin = false;

public static final int MAX_PASSWORD_LEN = 16;

private static final String AIM_MD5_STRING = "AOL Instant Messenger (SM)";

Expand Down Expand Up @@ -80,7 +82,7 @@ private Flap createPlainAuthRequest(boolean sendAuthData) throws ICQException {

tlvs[2] = new TLV(ICQConstants.TLV_NEWPASSWORD, roastPw(service.getPw()));

tlvs[3] = new TLV(ICQConstants.TLV_CLIENTIDENTITY, new String("Asia 0.5.2a").getBytes());
tlvs[3] = new TLV(ICQConstants.TLV_CLIENTIDENTITY, new String("Ace IM").getBytes());

byte[] clientid = { (byte) 0x88, (byte) 0x88 };
tlvs[4] = new TLV(ICQConstants.TLV_CLIENTID, clientid);
Expand Down Expand Up @@ -130,9 +132,9 @@ private byte[] roastPw(String pws) throws ICQException {
byte[] pwhash = new byte[pw.length];

int ln;
// they don't support passwords longer than 8 symbols (facepalm)
if (pw.length > 8) {
ln = 8;

if (pw.length > MAX_PASSWORD_LEN) {
ln = MAX_PASSWORD_LEN;
} else {
ln = pw.length;
}
Expand Down

0 comments on commit 5e4359c

Please sign in to comment.