mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 17:27:43 +00:00
keyword search - change attribute ordering, cleanup escaping (now done in BB), do not write selector attribute (should go to gen info)
This commit is contained in:
parent
dd6222da75
commit
8f101145e2
@ -131,10 +131,7 @@ public class KeywordSearchUtil {
|
|||||||
//TODO escaping should be handled by blackboard
|
//TODO escaping should be handled by blackboard
|
||||||
public static String escapeForBlackBoard(String text) {
|
public static String escapeForBlackBoard(String text) {
|
||||||
try {
|
try {
|
||||||
//text = text.replaceAll("\\\\'", URLEncoder.encode("\\'", "UTF-8"));
|
|
||||||
text = text.replaceAll("'", URLEncoder.encode("'", "UTF-8"));
|
text = text.replaceAll("'", URLEncoder.encode("'", "UTF-8"));
|
||||||
//text = text.replaceAll("\"", URLEncoder.encode("\"", "UTF-8"));
|
|
||||||
//text = text.replaceAll("\\\\", URLEncoder.encode("\\", "UTF-8"));
|
|
||||||
} catch (UnsupportedEncodingException ex) {
|
} catch (UnsupportedEncodingException ex) {
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
|
@ -195,12 +195,9 @@ public class TermComponentQuery implements KeywordSearchQuery {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//regex keyword, escape and store
|
|
||||||
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_REGEXP.getTypeID(), MODULE_NAME, "", KeywordSearchUtil.escapeForBlackBoard(termsQuery)));
|
|
||||||
|
|
||||||
//regex match
|
//regex match
|
||||||
final String regexMatchEscaped = KeywordSearchUtil.escapeForBlackBoard(regexMatch);
|
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID(), MODULE_NAME, "", regexMatch));
|
||||||
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID(), MODULE_NAME, "", regexMatchEscaped));
|
|
||||||
//list
|
//list
|
||||||
if (listName == null) {
|
if (listName == null) {
|
||||||
listName = "";
|
listName = "";
|
||||||
@ -208,17 +205,20 @@ public class TermComponentQuery implements KeywordSearchQuery {
|
|||||||
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_SET.getTypeID(), MODULE_NAME, "", listName));
|
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_SET.getTypeID(), MODULE_NAME, "", listName));
|
||||||
|
|
||||||
//preview
|
//preview
|
||||||
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW.getTypeID(), MODULE_NAME, "", KeywordSearchUtil.escapeForBlackBoard(snippet)));
|
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW.getTypeID(), MODULE_NAME, "", snippet));
|
||||||
|
|
||||||
|
//regex keyword
|
||||||
|
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_REGEXP.getTypeID(), MODULE_NAME, "", termsQuery));
|
||||||
|
|
||||||
//selector
|
//selector TODO move to general info artifact
|
||||||
|
/*
|
||||||
if (keywordQuery != null) {
|
if (keywordQuery != null) {
|
||||||
BlackboardAttribute.ATTRIBUTE_TYPE selType = keywordQuery.getType();
|
BlackboardAttribute.ATTRIBUTE_TYPE selType = keywordQuery.getType();
|
||||||
if (selType != null) {
|
if (selType != null) {
|
||||||
BlackboardAttribute selAttr = new BlackboardAttribute(selType.getTypeID(), MODULE_NAME, "", regexMatchEscaped);
|
BlackboardAttribute selAttr = new BlackboardAttribute(selType.getTypeID(), MODULE_NAME, "", regexMatch);
|
||||||
attributes.add(selAttr);
|
attributes.add(selAttr);
|
||||||
}
|
}
|
||||||
}
|
} */
|
||||||
|
|
||||||
try {
|
try {
|
||||||
bba.addAttributes(attributes);
|
bba.addAttributes(attributes);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user