Implemented support for new login method used from 6.43
This commit is contained in:
parent
afad1e6d30
commit
81efcd6c73
|
|
@ -56,12 +56,14 @@ public final class ApiConnectionImpl extends ApiConnection {
|
||||||
throw new ApiConnectionException("API username cannot be empty");
|
throw new ApiConnectionException("API username cannot be empty");
|
||||||
}
|
}
|
||||||
List<Map<String, String>> list = execute("/login name=" + username + " password=" + password);
|
List<Map<String, String>> list = execute("/login name=" + username + " password=" + password);
|
||||||
Map<String, String> res = list.get(0);
|
if (!list.isEmpty()) {
|
||||||
if (res.containsKey("ret")) {
|
Map<String, String> res = list.get(0);
|
||||||
String hash = res.get("ret");
|
if (res.containsKey("ret")) {
|
||||||
String chal = Util.hexStrToStr("00") + new String(password.toCharArray()) + Util.hexStrToStr(hash);
|
String hash = res.get("ret");
|
||||||
chal = Util.hashMD5(chal);
|
String chal = Util.hexStrToStr("00") + new String(password.toCharArray()) + Util.hexStrToStr(hash);
|
||||||
execute("/login name=" + username + " response=00" + chal);
|
chal = Util.hashMD5(chal);
|
||||||
|
execute("/login name=" + username + " response=00" + chal);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue