mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Modified ContactNode so that all attributes are correctly being displayed from vcards and contacts with multiple attrbutes of the same type
This commit is contained in:
parent
d96e9f19d3
commit
24c256f3d2
@ -34,6 +34,8 @@ public final class ContactDetailsPane extends javax.swing.JPanel implements Expl
|
|||||||
public ContactDetailsPane() {
|
public ContactDetailsPane() {
|
||||||
initComponents();
|
initComponents();
|
||||||
this.setEnabled(false);
|
this.setEnabled(false);
|
||||||
|
|
||||||
|
nameLabel.setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.communications;
|
package org.sleuthkit.autopsy.communications;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@ -63,7 +65,7 @@ final class ContactNode extends BlackboardArtifactNode {
|
|||||||
super(artifact);
|
super(artifact);
|
||||||
|
|
||||||
String name = getAttributeDisplayString(artifact, TSK_NAME);
|
String name = getAttributeDisplayString(artifact, TSK_NAME);
|
||||||
if(name == null || name.trim().isEmpty()) {
|
if (name == null || name.trim().isEmpty()) {
|
||||||
// VCards use TSK_NAME_PERSON instead of TSK_NAME
|
// VCards use TSK_NAME_PERSON instead of TSK_NAME
|
||||||
name = getAttributeDisplayString(artifact, TSK_NAME_PERSON);
|
name = getAttributeDisplayString(artifact, TSK_NAME_PERSON);
|
||||||
}
|
}
|
||||||
@ -85,9 +87,56 @@ final class ContactNode extends BlackboardArtifactNode {
|
|||||||
sheet.put(sheetSet);
|
sheet.put(sheetSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sorting the attributes by type so that the duplicates can be removed
|
||||||
|
// and they can be grouped by type for display.
|
||||||
try {
|
try {
|
||||||
|
HashMap<String, BlackboardAttribute> phoneNumList = new HashMap<>();
|
||||||
|
HashMap<String, BlackboardAttribute> emailList = new HashMap<>();
|
||||||
|
HashMap<String, BlackboardAttribute> nameList = new HashMap<>();
|
||||||
|
HashMap<String, BlackboardAttribute> otherList = new HashMap<>();
|
||||||
for (BlackboardAttribute bba : artifact.getAttributes()) {
|
for (BlackboardAttribute bba : artifact.getAttributes()) {
|
||||||
sheetSet.put(new NodeProperty<>(bba.getAttributeType().getTypeName(), bba.getAttributeType().getDisplayName(), "", bba.getDisplayString()));
|
if (bba.getAttributeType().getTypeName().contains("TSK_PHONE")) {
|
||||||
|
phoneNumList.put(bba.getDisplayString(), bba);
|
||||||
|
} else if (bba.getAttributeType().getTypeName().contains("TSK_EMAIL")) {
|
||||||
|
emailList.put(bba.getDisplayString(), bba);
|
||||||
|
} else if (bba.getAttributeType().getTypeName().contains("TSK_NAME")) {
|
||||||
|
nameList.put(bba.getDisplayString(), bba);
|
||||||
|
} else {
|
||||||
|
otherList.put(bba.getDisplayString(), bba);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String propertyID = BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME.getLabel();
|
||||||
|
int count = 0;
|
||||||
|
for (BlackboardAttribute bba : nameList.values()) {
|
||||||
|
if (count++ > 0) {
|
||||||
|
sheetSet.put(new NodeProperty<>(propertyID + "_" + count, bba.getAttributeType().getDisplayName(), "", bba.getDisplayString()));
|
||||||
|
} else {
|
||||||
|
sheetSet.put(new NodeProperty<>(propertyID, bba.getAttributeType().getDisplayName(), "", bba.getDisplayString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
propertyID = BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER.getLabel();
|
||||||
|
count = 0;
|
||||||
|
for (BlackboardAttribute bba : phoneNumList.values()) {
|
||||||
|
if (count++ > 0) {
|
||||||
|
sheetSet.put(new NodeProperty<>(propertyID + "_" + count, bba.getAttributeType().getDisplayName(), "", bba.getDisplayString()));
|
||||||
|
} else {
|
||||||
|
sheetSet.put(new NodeProperty<>(propertyID, bba.getAttributeType().getDisplayName(), "", bba.getDisplayString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
propertyID = BlackboardAttribute.ATTRIBUTE_TYPE.TSK_EMAIL.getLabel();
|
||||||
|
count = 0;
|
||||||
|
for (BlackboardAttribute bba : emailList.values()) {
|
||||||
|
if (count++ > 0) {
|
||||||
|
sheetSet.put(new NodeProperty<>(propertyID + "_" + count, bba.getAttributeType().getDisplayName(), "", bba.getDisplayString()));
|
||||||
|
} else {
|
||||||
|
sheetSet.put(new NodeProperty<>(propertyID, bba.getAttributeType().getDisplayName(), "", bba.getDisplayString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (BlackboardAttribute bba1 : otherList.values()) {
|
||||||
|
sheetSet.put(new NodeProperty<>(bba1.getAttributeType().getTypeName(), bba1.getAttributeType().getDisplayName(), "", bba1.getDisplayString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user