Skip to content
Snippets Groups Projects
Unverified Commit 6fd4da5d authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #4921 from kellykelly3/1262-andriod-threading

1262 Adding a threadID to andriod SMS artifacts
parents a750904a 52d5252c
No related branches found
No related tags found
No related merge requests found
...@@ -87,7 +87,9 @@ protected Sheet createSheet() { ...@@ -87,7 +87,9 @@ protected Sheet createSheet() {
sheetSet.put(new NodeProperty<>("Type", Bundle.MessageNode_Node_Property_Type(), "", getDisplayName())); //NON-NLS sheetSet.put(new NodeProperty<>("Type", Bundle.MessageNode_Node_Property_Type(), "", getDisplayName())); //NON-NLS
BlackboardArtifact artifact = this.getArtifact(); sheetSet.put(new NodeProperty<>("ThreadID", "ThreadID","",threadID == null ? UNTHREADED_ID : threadID)); //NON-NLS
final BlackboardArtifact artifact = getArtifact();
BlackboardArtifact.ARTIFACT_TYPE fromID = BlackboardArtifact.ARTIFACT_TYPE.fromID(artifact.getArtifactTypeID()); BlackboardArtifact.ARTIFACT_TYPE fromID = BlackboardArtifact.ARTIFACT_TYPE.fromID(artifact.getArtifactTypeID());
if (null != fromID) { if (null != fromID) {
...@@ -107,8 +109,6 @@ protected Sheet createSheet() { ...@@ -107,8 +109,6 @@ protected Sheet createSheet() {
} catch (TskCoreException ex) { } catch (TskCoreException ex) {
logger.log(Level.WARNING, "Error loading attachment count for " + artifact, ex); //NON-NLS logger.log(Level.WARNING, "Error loading attachment count for " + artifact, ex); //NON-NLS
} }
sheetSet.put(new NodeProperty<>("ThreadID", "ThreadID","",threadID == null ? "" : threadID)); //NON-NLS
break; break;
case TSK_MESSAGE: case TSK_MESSAGE:
......
...@@ -99,13 +99,14 @@ def __findTextsInDB(self, databasePath, abstractFile, dataSource): ...@@ -99,13 +99,14 @@ def __findTextsInDB(self, databasePath, abstractFile, dataSource):
resultSet = None resultSet = None
try: try:
resultSet = statement.executeQuery( resultSet = statement.executeQuery(
"SELECT address, date, read, type, subject, body FROM sms;") "SELECT address, date, read, type, subject, body, thread_id FROM sms;")
while resultSet.next(): while resultSet.next():
address = resultSet.getString("address") # may be phone number, or other addresses address = resultSet.getString("address") # may be phone number, or other addresses
date = Long.valueOf(resultSet.getString("date")) / 1000 date = Long.valueOf(resultSet.getString("date")) / 1000
read = resultSet.getInt("read") # may be unread = 0, read = 1 read = resultSet.getInt("read") # may be unread = 0, read = 1
subject = resultSet.getString("subject") # message subject subject = resultSet.getString("subject") # message subject
body = resultSet.getString("body") # message body body = resultSet.getString("body") # message body
thread_id = "{0}_{1}".format(abstractFile.getId(), resultSet.getInt("thread_id"))
attributes = ArrayList() attributes = ArrayList()
artifact = abstractFile.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_MESSAGE); #create Message artifact and then add attributes from result set. artifact = abstractFile.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_MESSAGE); #create Message artifact and then add attributes from result set.
if resultSet.getString("type") == "1": if resultSet.getString("type") == "1":
...@@ -119,6 +120,7 @@ def __findTextsInDB(self, databasePath, abstractFile, dataSource): ...@@ -119,6 +120,7 @@ def __findTextsInDB(self, databasePath, abstractFile, dataSource):
attributes.add(BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SUBJECT, general.MODULE_NAME, subject)) attributes.add(BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SUBJECT, general.MODULE_NAME, subject))
attributes.add(BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT, general.MODULE_NAME, body)) attributes.add(BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT, general.MODULE_NAME, body))
attributes.add(BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_MESSAGE_TYPE, general.MODULE_NAME, "SMS Message")) attributes.add(BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_MESSAGE_TYPE, general.MODULE_NAME, "SMS Message"))
attributes.add(BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_THREAD_ID, general.MODULE_NAME, thread_id))
artifact.addAttributes(attributes) artifact.addAttributes(attributes)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment