mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
Merge branch 'develop' of github.com:sleuthkit/autopsy into 7567-artifactTypeConstructorDeprecation
This commit is contained in:
commit
d939da3019
@ -29,6 +29,7 @@ import java.awt.event.ActionListener;
|
|||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.beans.PropertyChangeSupport;
|
import java.beans.PropertyChangeSupport;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.nio.file.InvalidPathException;
|
import java.nio.file.InvalidPathException;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
@ -1215,8 +1216,6 @@ public class Case {
|
|||||||
* Update the GUI to to reflect the current case.
|
* Update the GUI to to reflect the current case.
|
||||||
*/
|
*/
|
||||||
private static void updateGUIForCaseOpened(Case newCurrentCase) {
|
private static void updateGUIForCaseOpened(Case newCurrentCase) {
|
||||||
if (RuntimeProperties.runningWithGUI()) {
|
|
||||||
SwingUtilities.invokeLater(() -> {
|
|
||||||
/*
|
/*
|
||||||
* If the case database was upgraded for a new schema and a
|
* If the case database was upgraded for a new schema and a
|
||||||
* backup database was created, notify the user.
|
* backup database was created, notify the user.
|
||||||
@ -1242,6 +1241,14 @@ public class Case {
|
|||||||
String path = entry.getValue();
|
String path = entry.getValue();
|
||||||
boolean fileExists = (new File(path).isFile() || DriveUtils.driveExists(path));
|
boolean fileExists = (new File(path).isFile() || DriveUtils.driveExists(path));
|
||||||
if (!fileExists) {
|
if (!fileExists) {
|
||||||
|
try {
|
||||||
|
// Using invokeAndWait means that the dialog will
|
||||||
|
// open on the EDT but this thread will wait for an
|
||||||
|
// answer. Using invokeLater would cause this loop to
|
||||||
|
// end before all of the dialogs appeared.
|
||||||
|
SwingUtilities.invokeAndWait(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
int response = JOptionPane.showConfirmDialog(
|
int response = JOptionPane.showConfirmDialog(
|
||||||
mainFrame,
|
mainFrame,
|
||||||
NbBundle.getMessage(Case.class, "Case.checkImgExist.confDlg.doesntExist.msg", path),
|
NbBundle.getMessage(Case.class, "Case.checkImgExist.confDlg.doesntExist.msg", path),
|
||||||
@ -1254,6 +1261,12 @@ public class Case {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
} catch (InterruptedException | InvocationTargetException ex) {
|
||||||
|
logger.log(Level.SEVERE, "Failed to show missing image confirmation dialog", ex); //NON-NLS
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1277,7 +1290,9 @@ public class Case {
|
|||||||
* open/create case dialog.
|
* open/create case dialog.
|
||||||
*/
|
*/
|
||||||
RecentCases.getInstance().addRecentCase(newCurrentCase.getDisplayName(), newCurrentCase.getMetadata().getFilePath().toString());
|
RecentCases.getInstance().addRecentCase(newCurrentCase.getDisplayName(), newCurrentCase.getMetadata().getFilePath().toString());
|
||||||
|
final boolean hasData = newCurrentCase.hasData();
|
||||||
|
|
||||||
|
SwingUtilities.invokeLater(() -> {
|
||||||
/*
|
/*
|
||||||
* Open the top components (windows within the main application
|
* Open the top components (windows within the main application
|
||||||
* window).
|
* window).
|
||||||
@ -1286,7 +1301,7 @@ public class Case {
|
|||||||
* opened via the DirectoryTreeTopComponent 'propertyChange()'
|
* opened via the DirectoryTreeTopComponent 'propertyChange()'
|
||||||
* method on a DATA_SOURCE_ADDED event.
|
* method on a DATA_SOURCE_ADDED event.
|
||||||
*/
|
*/
|
||||||
if (newCurrentCase.hasData()) {
|
if (hasData) {
|
||||||
CoreComponentControl.openCoreWindows();
|
CoreComponentControl.openCoreWindows();
|
||||||
} else {
|
} else {
|
||||||
//ensure that the DirectoryTreeTopComponent is open so that it's listener can open the core windows including making it visible.
|
//ensure that the DirectoryTreeTopComponent is open so that it's listener can open the core windows including making it visible.
|
||||||
@ -1301,7 +1316,6 @@ public class Case {
|
|||||||
mainFrame.setTitle(newCurrentCase.getDisplayName() + " - " + getNameForTitle());
|
mainFrame.setTitle(newCurrentCase.getDisplayName() + " - " + getNameForTitle());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Update the GUI to to reflect the lack of a current case.
|
* Update the GUI to to reflect the lack of a current case.
|
||||||
|
@ -15,6 +15,7 @@ RejTreeKeyView.columns.type=Type
|
|||||||
RejTreeKeyView.columns.value=Value
|
RejTreeKeyView.columns.value=Value
|
||||||
RejTreeKeyView.failedToParse.keyName=FAILED TO PARSE KEY NAME
|
RejTreeKeyView.failedToParse.keyName=FAILED TO PARSE KEY NAME
|
||||||
RejTreeKeyView.metadataBorder.title=Metadata
|
RejTreeKeyView.metadataBorder.title=Metadata
|
||||||
|
RejTreeKeyView.template.dateTime=Modification Time:
|
||||||
RejTreeKeyView.template.name=Name:
|
RejTreeKeyView.template.name=Name:
|
||||||
RejTreeKeyView.template.numberOfSubkeys=Number of subkeys:
|
RejTreeKeyView.template.numberOfSubkeys=Number of subkeys:
|
||||||
RejTreeKeyView.template.numberOfValues=Number of values:
|
RejTreeKeyView.template.numberOfValues=Number of values:
|
||||||
|
@ -28,6 +28,8 @@ import java.awt.Dimension;
|
|||||||
import javax.swing.table.TableColumn;
|
import javax.swing.table.TableColumn;
|
||||||
import javax.swing.table.TableColumnModel;
|
import javax.swing.table.TableColumnModel;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import javax.swing.BorderFactory;
|
import javax.swing.BorderFactory;
|
||||||
@ -54,7 +56,8 @@ public final class RejTreeKeyView extends RejTreeNodeView {
|
|||||||
"RejTreeKeyView.valuesBorder.title=Values",
|
"RejTreeKeyView.valuesBorder.title=Values",
|
||||||
"RejTreeKeyView.template.name=Name:",
|
"RejTreeKeyView.template.name=Name:",
|
||||||
"RejTreeKeyView.template.numberOfSubkeys=Number of subkeys:",
|
"RejTreeKeyView.template.numberOfSubkeys=Number of subkeys:",
|
||||||
"RejTreeKeyView.template.numberOfValues=Number of values:"})
|
"RejTreeKeyView.template.numberOfValues=Number of values:",
|
||||||
|
"RejTreeKeyView.template.dateTime=Modification Time:"})
|
||||||
public RejTreeKeyView(RejTreeKeyNode node) {
|
public RejTreeKeyView(RejTreeKeyNode node) {
|
||||||
super(new BorderLayout());
|
super(new BorderLayout());
|
||||||
|
|
||||||
@ -62,6 +65,7 @@ public final class RejTreeKeyView extends RejTreeNodeView {
|
|||||||
* param 1 Name
|
* param 1 Name
|
||||||
* param 2 Number of subkeys
|
* param 2 Number of subkeys
|
||||||
* param 3 Number of values
|
* param 3 Number of values
|
||||||
|
* param 4 Date/time
|
||||||
*/
|
*/
|
||||||
String metadataTemplate = "<html><i>"
|
String metadataTemplate = "<html><i>"
|
||||||
+ Bundle.RejTreeKeyView_template_name()
|
+ Bundle.RejTreeKeyView_template_name()
|
||||||
@ -69,10 +73,13 @@ public final class RejTreeKeyView extends RejTreeNodeView {
|
|||||||
+ Bundle.RejTreeKeyView_template_numberOfSubkeys()
|
+ Bundle.RejTreeKeyView_template_numberOfSubkeys()
|
||||||
+ "</i> %2$d<br/><i>"
|
+ "</i> %2$d<br/><i>"
|
||||||
+ Bundle.RejTreeKeyView_template_numberOfValues()
|
+ Bundle.RejTreeKeyView_template_numberOfValues()
|
||||||
+ "</i> %3$d<br/></html>";
|
+ "</i> %3$d<br/><i>"
|
||||||
|
+ Bundle.RejTreeKeyView_template_dateTime()
|
||||||
|
+ "</i> %4$s</br></html>";
|
||||||
String keyName;
|
String keyName;
|
||||||
int numSubkeys;
|
int numSubkeys;
|
||||||
int numValues;
|
int numValues;
|
||||||
|
String dateTime;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
keyName = node.getKey().getName();
|
keyName = node.getKey().getName();
|
||||||
@ -95,7 +102,12 @@ public final class RejTreeKeyView extends RejTreeNodeView {
|
|||||||
numValues = -1;
|
numValues = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
JLabel metadataLabel = new JLabel(String.format(metadataTemplate, keyName, numSubkeys, numValues), JLabel.LEFT);
|
Date date = new java.util.Date(node.getKey().getTimestamp().getTimeInMillis());
|
||||||
|
SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
|
||||||
|
sdf.setTimeZone(java.util.TimeZone.getTimeZone("GMT+0"));
|
||||||
|
dateTime = sdf.format(date);
|
||||||
|
|
||||||
|
JLabel metadataLabel = new JLabel(String.format(metadataTemplate, keyName, numSubkeys, numValues, dateTime), JLabel.LEFT);
|
||||||
metadataLabel.setBorder(BorderFactory.createTitledBorder(Bundle.RejTreeKeyView_metadataBorder_title()));
|
metadataLabel.setBorder(BorderFactory.createTitledBorder(Bundle.RejTreeKeyView_metadataBorder_title()));
|
||||||
metadataLabel.setVerticalAlignment(SwingConstants.TOP);
|
metadataLabel.setVerticalAlignment(SwingConstants.TOP);
|
||||||
|
|
||||||
|
@ -742,7 +742,7 @@ class ExtractRegistry extends Extract {
|
|||||||
} else {
|
} else {
|
||||||
results.get(0).addAttributes(bbattributes);
|
results.get(0).addAttributes(bbattributes);
|
||||||
}
|
}
|
||||||
for (Map.Entry userMap : userNameMap.entrySet()) {
|
for (Map.Entry userMap : getUserNameMap().entrySet()) {
|
||||||
String sid = "";
|
String sid = "";
|
||||||
try{
|
try{
|
||||||
sid = (String)userMap.getKey();
|
sid = (String)userMap.getKey();
|
||||||
@ -1116,17 +1116,6 @@ class ExtractRegistry extends Extract {
|
|||||||
accountMgr.newOsAccountInstance(osAccount, (DataSource)dataSource, OsAccountInstance.OsAccountInstanceType.LAUNCHED);
|
accountMgr.newOsAccountInstance(osAccount, (DataSource)dataSource, OsAccountInstance.OsAccountInstanceType.LAUNCHED);
|
||||||
updateOsAccount(osAccount, userInfo, groupMap.get(userInfo.get(SID_KEY)), regAbstractFile);
|
updateOsAccount(osAccount, userInfo, groupMap.get(userInfo.get(SID_KEY)), regAbstractFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a mapping of user sids to user names and save globally so it can be used for other areas
|
|
||||||
// of the registry, ie: BAM key
|
|
||||||
try {
|
|
||||||
userNameMap = makeUserNameMap(dataSource);
|
|
||||||
} catch (TskCoreException ex) {
|
|
||||||
logger.log(Level.WARNING, "Unable to create OS Account user name map", ex);
|
|
||||||
// This is not the end of the world we will just continue without
|
|
||||||
// user names
|
|
||||||
userNameMap = new HashMap<>();
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
} catch (FileNotFoundException ex) {
|
} catch (FileNotFoundException ex) {
|
||||||
logger.log(Level.WARNING, "Error finding the registry file.", ex); //NON-NLS
|
logger.log(Level.WARNING, "Error finding the registry file.", ex); //NON-NLS
|
||||||
@ -1261,7 +1250,7 @@ class ExtractRegistry extends Extract {
|
|||||||
// We can add the S- back to the string that we split on since S- is a valid beginning of a User SID
|
// We can add the S- back to the string that we split on since S- is a valid beginning of a User SID
|
||||||
String fileNameSid[] = tokens[4].split("\\s+\\(S-");
|
String fileNameSid[] = tokens[4].split("\\s+\\(S-");
|
||||||
String userSid = "S-" + fileNameSid[1].substring(0, fileNameSid[1].length() - 1);
|
String userSid = "S-" + fileNameSid[1].substring(0, fileNameSid[1].length() - 1);
|
||||||
String userName = userNameMap.get(userSid);
|
String userName = getUserNameMap().get(userSid);
|
||||||
if (userName == null) {
|
if (userName == null) {
|
||||||
userName = userSid;
|
userName = userSid;
|
||||||
}
|
}
|
||||||
@ -1739,6 +1728,28 @@ class ExtractRegistry extends Extract {
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a mapping of user sids to user names.
|
||||||
|
*
|
||||||
|
* @return username man or empty list if none where found.
|
||||||
|
*/
|
||||||
|
private Map<String, String> getUserNameMap() {
|
||||||
|
if(userNameMap == null) {
|
||||||
|
// Get a mapping of user sids to user names and save globally so it can be used for other areas
|
||||||
|
// of the registry, ie: BAM key
|
||||||
|
try {
|
||||||
|
userNameMap = makeUserNameMap(dataSource);
|
||||||
|
} catch (TskCoreException ex) {
|
||||||
|
logger.log(Level.WARNING, "Unable to create OS Account user name map", ex);
|
||||||
|
// This is not the end of the world we will just continue without
|
||||||
|
// user names
|
||||||
|
userNameMap = new HashMap<>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return userNameMap;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the attribute for the given type from the given artifact.
|
* Gets the attribute for the given type from the given artifact.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user