开始打啦。我用的工具DJ Java Decompiler 3.5
AuthFactory反编译后,
protected AuthToken createAuthToken(HttpServletRequest request, HttpServletResponse response)不正确,结果如下:
protected AuthToken createAuthToken(HttpServletRequest request, HttpServletResponse response)
throws UnauthorizedException
{
HttpSession session;
AuthToken authToken;
Cookie cookie;
session = request.getSession();
authToken = (AuthToken)session.getAttribute("jive.authToken");
if(authToken != null)
return authToken;
cookie = CookieUtils.getCookie(request, "jive.authToken.autologin");
if(cookie == null)
break MISSING_BLOCK_LABEL_110;
String authInfo[] = decryptAuthInfo(cookie.getValue());
if(authInfo == null)
break MISSING_BLOCK_LABEL_90;
String username = authInfo[0];
String password = authInfo[1];
authToken = getAuthToken(username, password);
session.setAttribute("jive.authToken", authToken);
return authToken;
try
{
CookieUtils.deleteCookie(response, cookie);
}
catch(UnauthorizedException ue)
{
CookieUtils.deleteCookie(response, cookie);
throw ue;
}
throw new UnauthorizedException();
}
修改后:
protected AuthToken createAuthToken(HttpServletRequest request, HttpServletResponse response)
throws UnauthorizedException
{
HttpSession session;
AuthToken authToken;
Cookie cookie;
session = request.getSession();
authToken = (AuthToken)session.getAttribute("jive.authToken");
if(authToken != null)
return authToken;
cookie = CookieUtils.getCookie(request, "jive.authToken.autologin");
if(cookie == null)
throw new UnauthorizedException();
String authInfo[] = decryptAuthInfo(cookie.getValue());
if(authInfo == null)
{
CookieUtils.deleteCookie(response, cookie);
throw new UnauthorizedException();
}
String username = authInfo[0];
String password = authInfo[1];
authToken = getAuthToken(username, password);
session.setAttribute("jive.authToken", authToken);
return authToken;
}