jivekb
一个人恢复代码,好无聊,还有没谁正玩这个的,一起啦。
一个人恢复代码,好无聊,还有没谁正玩这个的,一起啦。
我们来打靶吧
jivekb.jar
kb.action.KbSearch
kb.action.EditCategories
kb.database.CommentBlockIterator
kb.database.DbEntry
kb.database.DbCategory
kb.database.DbQuery
kb.database.DbQueryLogger
kb.database.DbSearchManager
kb.database.DbWatchManager
kb.database.EntryBlockIterator
kb.database.EntryPartBlockIterator
kb.database.KbCategoryBlockIterator
kb.database.RecommendationBlockIterator
kb.database.WatchListener
jivebase.jar
com.jivesoftware.base.AuthFactory
com.jivesoftware.base.JivePropertyClusterTask
com.jivesoftware.base.util.PDFExtractor
com.jivesoftware.base.log.output.AsyncLogTarget
com.jivesoftware.base.database.ConnectionPool
com.jivesoftware.base.database.DbPresenceManager
com.jivesoftware.base.database.DbRoster
com.jivesoftware.base.database.SSOAuthFactory
差不多就剩这些啦。
开始打啦。
我用的工具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;
}
JivePropertyClusterTask
编译后run()
public void run()
{
int i;
if(name != null && (value == null || "".equals(value.trim())))
{
JiveGlobals.deleteJiveProperty(name, false);
break MISSING_BLOCK_LABEL_119;
}
if(name == null || value == null)
break MISSING_BLOCK_LABEL_119;
i = 0;
_L2:
if(i >= excludedProperties.size())
break MISSING_BLOCK_LABEL_99;
String s = (String)excludedProperties.get(i);
if(name.equals(s))
return;
i++;
if(true) goto _L2; else goto _L1
_L1:
JiveGlobals.setJiveProperty(name, value, false);
break MISSING_BLOCK_LABEL_119;
Exception e;
e;
Log.error(e);
}
这些_L1,_L2的弄得心里真不舒服
修改后
public void run()
{
if (name != null && (value == null || "".equals(value.trim()))) {
JiveGlobals.deleteJiveProperty(name, false);
return;
}
if (name == null || value == null)
return;
for (int i = 0; i < excludedProperties.size(); i++) {
String s = (String) excludedProperties.get(i);
if (name.equals(s))
JiveGlobals.setJiveProperty(name, value, false);
}
}
哦,JiveProperty应该不会是重名吧。
再改一下,
|
JivePropertyClusterTask反编译后
private String extractTextWithNative(String filename)
throws IOException 不正确,代码如下:
|
|
搞错了,上面这个类是com.jivesoftware.base.util.PDFExtractor。
com.jivesoftware.base.log.output.AsyncLogTarget
编译后 run方法出错。
唉,无聊,用别人开源的东东,也就是啦,非得打在自己包里标上"jivesoftware 荣誉出品"
本类参看org.apache.log.output.AsyncLogTarget