mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
Merge branch 'develop' of https://github.com/sleuthkit/autopsy into core-menuactions
This commit is contained in:
commit
8cdf16c289
@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.sleuthkit.autopsy.casemodule;
|
||||
|
||||
import org.sleuthkit.autopsy.coreutils.LocalDisk;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
|
@ -148,6 +148,9 @@
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="GeneralPanel.useGMTTimeRB.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="useGMTTimeRBActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||
<Properties>
|
||||
|
@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.corecomponents;
|
||||
|
||||
import java.util.prefs.Preferences;
|
||||
import org.openide.util.NbPreferences;
|
||||
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
||||
|
||||
final class GeneralPanel extends javax.swing.JPanel {
|
||||
|
||||
@ -33,6 +34,7 @@ final class GeneralPanel extends javax.swing.JPanel {
|
||||
GeneralPanel(GeneralOptionsPanelController controller) {
|
||||
this.controller = controller;
|
||||
initComponents();
|
||||
ContentUtils.setDisplayInLocalTime(useLocalTimeRB.isSelected());
|
||||
// TODO listen to changes in form fields and call controller.changed()
|
||||
}
|
||||
|
||||
@ -80,6 +82,11 @@ final class GeneralPanel extends javax.swing.JPanel {
|
||||
|
||||
buttonGroup3.add(useGMTTimeRB);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(useGMTTimeRB, org.openide.util.NbBundle.getMessage(GeneralPanel.class, "GeneralPanel.useGMTTimeRB.text")); // NOI18N
|
||||
useGMTTimeRB.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
useGMTTimeRBActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(GeneralPanel.class, "GeneralPanel.jLabel3.text")); // NOI18N
|
||||
|
||||
@ -144,6 +151,10 @@ final class GeneralPanel extends javax.swing.JPanel {
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_useBestViewerRBActionPerformed
|
||||
|
||||
private void useGMTTimeRBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useGMTTimeRBActionPerformed
|
||||
ContentUtils.setDisplayInLocalTime(useLocalTimeRB.isSelected());
|
||||
}//GEN-LAST:event_useGMTTimeRBActionPerformed
|
||||
|
||||
void load() {
|
||||
boolean keepPreferredViewer = prefs.getBoolean(KEEP_PREFERRED_VIEWER, false);
|
||||
keepCurrentViewerRB.setSelected(keepPreferredViewer);
|
||||
|
@ -16,7 +16,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.sleuthkit.autopsy.casemodule;
|
||||
package org.sleuthkit.autopsy.coreutils;
|
||||
|
||||
/**
|
||||
* Representation of a PhysicalDisk or partition.
|
@ -37,7 +37,6 @@ import org.hyperic.sigar.Sigar;
|
||||
import org.hyperic.sigar.ptql.ProcessFinder;
|
||||
import org.openide.modules.InstalledFileLocator;
|
||||
import org.openide.modules.Places;
|
||||
import org.sleuthkit.autopsy.casemodule.LocalDisk;
|
||||
import org.sleuthkit.datamodel.SleuthkitJNI;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
|
||||
|
@ -161,8 +161,14 @@ public abstract class AbstractAbstractFileNode<T extends AbstractFile> extends A
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MD5 Hash";
|
||||
}
|
||||
},
|
||||
ObjectID {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Object ID";
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@ -201,6 +207,7 @@ public abstract class AbstractAbstractFileNode<T extends AbstractFile> extends A
|
||||
map.put(AbstractFilePropertyType.KNOWN.toString(), content.getKnown().getName());
|
||||
map.put(AbstractFilePropertyType.HASHSETS.toString(), getHashSetHitsForFile(content));
|
||||
map.put(AbstractFilePropertyType.MD5HASH.toString(), content.getMd5Hash() == null ? "" : content.getMd5Hash());
|
||||
map.put(AbstractFilePropertyType.ObjectID.toString(), content.getId());
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,7 +50,7 @@ public final class ContentUtils {
|
||||
private final static Logger logger = Logger.getLogger(ContentUtils.class.getName());
|
||||
private static final SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
|
||||
private static final SimpleDateFormat dateFormatterISO8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
||||
|
||||
private static boolean displayInLocalTime;
|
||||
// don't instantiate
|
||||
private ContentUtils() {
|
||||
throw new AssertionError();
|
||||
@ -104,12 +104,11 @@ public final class ContentUtils {
|
||||
public static String getStringTimeISO8601(long epochSeconds, Content c) {
|
||||
return getStringTimeISO8601(epochSeconds, getTimeZone(c));
|
||||
}
|
||||
|
||||
|
||||
public static TimeZone getTimeZone(Content c) {
|
||||
Preferences generalPanelPrefs = NbPreferences.root().node("/org/sleuthkit/autopsy/core");
|
||||
boolean useLocalTime = generalPanelPrefs.getBoolean("useLocalTime", true);
|
||||
|
||||
try {
|
||||
if (!useLocalTime) {
|
||||
if (!getDisplayInLocalTime()) {
|
||||
return TimeZone.getTimeZone("GMT");
|
||||
}
|
||||
else {
|
||||
@ -360,4 +359,18 @@ public final class ContentUtils {
|
||||
+ cntnt.getClass().getSimpleName());
|
||||
}
|
||||
}
|
||||
/**sets displayInlocalTime value based on button in GeneralPanel.java
|
||||
*
|
||||
* @param flag
|
||||
*/
|
||||
public static void setDisplayInLocalTime(boolean flag) {
|
||||
displayInLocalTime = flag;
|
||||
}
|
||||
/** get global timezone setting for displaying time values
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static boolean getDisplayInLocalTime(){
|
||||
return displayInLocalTime;
|
||||
}
|
||||
}
|
||||
|
@ -149,6 +149,9 @@ KeywordSearchIngestModule.init.badInitMsg=Keyword search server was not properly
|
||||
KeywordSearchIngestModule.init.tryStopSolrMsg={0}<br />Please try stopping old java Solr process (if it exists) and restart the application.
|
||||
KeywordSearchIngestModule.init.noKwInLstMsg=No keywords in keyword list.
|
||||
KeywordSearchIngestModule.init.onlyIdxKwSkipMsg=Only indexing will be done and and keyword search will be skipped (you can still add keyword lists using the Keyword Lists - Add to Ingest).
|
||||
KeywordSearchIngestModule.doInBackGround.displayName=Keyword Search
|
||||
KeywordSearchIngestModule.doInBackGround.finalizeMsg=Finalizing...
|
||||
KeywordSearchIngestModule.doInBackGround.pendingMsg=Working on Keyword Search...
|
||||
KeywordSearchIngestModule.postIndexSummary.knowFileHeaderLbl=Files with known types
|
||||
KeywordSearchIngestModule.postIndexSummary.fileGenStringsHead=Files with general strings extracted
|
||||
KeywordSearchIngestModule.postIndexSummary.mdOnlyLbl=Metadata only was indexed
|
||||
|
@ -30,7 +30,6 @@ import java.util.logging.Level;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.ingest.IngestModuleDataSource;
|
||||
import org.sleuthkit.autopsy.report.SQLiteDBConnect;
|
||||
import org.sleuthkit.datamodel.*;
|
||||
|
||||
abstract class Extract extends IngestModuleDataSource{
|
||||
|
@ -20,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.sleuthkit.autopsy.report;
|
||||
package org.sleuthkit.autopsy.recentactivity;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
@ -32,7 +32,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
/**
|
||||
* Database connection class & utilities *
|
||||
*/
|
||||
public class SQLiteDBConnect {
|
||||
class SQLiteDBConnect {
|
||||
|
||||
public String sDriver = "";
|
||||
public String sUrl = null;
|
@ -41,7 +41,6 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.casemodule.services.FileManager;
|
||||
import org.sleuthkit.autopsy.report.SQLiteDBConnect;
|
||||
import org.sleuthkit.datamodel.AbstractFile;
|
||||
import org.sleuthkit.datamodel.Content;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
|
@ -56,6 +56,7 @@ import org.netbeans.jemmy.operators.JLabelOperator;
|
||||
import org.netbeans.jemmy.operators.JTabbedPaneOperator;
|
||||
import org.netbeans.jemmy.operators.JTableOperator;
|
||||
import org.netbeans.jemmy.operators.JTextFieldOperator;
|
||||
import org.netbeans.jemmy.operators.JListOperator;
|
||||
import org.netbeans.junit.NbModuleSuite;
|
||||
import org.openide.util.Exceptions;
|
||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
@ -265,14 +266,13 @@ public class RegressionTest extends TestCase {
|
||||
}
|
||||
logger.info("Enqueue took " + (System.currentTimeMillis() - start) + "ms");
|
||||
while (man.isIngestRunning()) {
|
||||
|
||||
new Timeout("pausing", 1000).sleep(); // give it a second (or five) to process
|
||||
}
|
||||
new Timeout("pausing", 15000).sleep(); // give it a second (or fifteen) to process
|
||||
boolean sleep = true;
|
||||
while (man.areModulesRunning()) {
|
||||
new Timeout("pausing", 5000).sleep(); // give it a second (or five) to process
|
||||
new Timeout("pausing", 5000).sleep(); // give it a second (or five) to process
|
||||
}
|
||||
|
||||
logger.info("Ingest (including enqueue) took " + (System.currentTimeMillis() - start) + "ms");
|
||||
// allow keyword search to finish saving artifacts, just in case
|
||||
// but randomize the timing so that we don't always get the same error
|
||||
@ -299,10 +299,13 @@ public class RegressionTest extends TestCase {
|
||||
logger.info("Generate Report Button");
|
||||
JDialog reportDialog = JDialogOperator.waitJDialog("Generate Report", false, false);
|
||||
JDialogOperator reportDialogOperator = new JDialogOperator(reportDialog);
|
||||
JListOperator listOperator = new JListOperator(reportDialogOperator);
|
||||
JButtonOperator jbo0 = new JButtonOperator(reportDialogOperator, "Next");
|
||||
DateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy-HH-mm-ss");
|
||||
Date date = new Date();
|
||||
String datenotime = dateFormat.format(date);
|
||||
listOperator.clickOnItem(1, 1);
|
||||
new Timeout("pausing", 1000).sleep();
|
||||
jbo0.pushNoBlock();
|
||||
new Timeout("pausing", 1000).sleep();
|
||||
JButtonOperator jbo1 = new JButtonOperator(reportDialogOperator, "Finish");
|
||||
|
@ -41,7 +41,9 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Scanner;
|
||||
import java.util.Stack;
|
||||
import java.util.TimeZone;
|
||||
import java.util.logging.Level;
|
||||
import java.util.prefs.Preferences;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
@ -75,11 +77,11 @@ import org.openide.awt.ActionReference;
|
||||
import org.openide.awt.ActionReferences;
|
||||
import org.openide.awt.ActionRegistration;
|
||||
import org.openide.modules.InstalledFileLocator;
|
||||
import org.openide.modules.ModuleInstall;
|
||||
import org.openide.nodes.Children;
|
||||
import org.openide.nodes.Node;
|
||||
import org.openide.util.HelpCtx;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.util.NbPreferences;
|
||||
import org.openide.util.actions.CallableSystemAction;
|
||||
import org.openide.util.actions.Presenter;
|
||||
import org.openide.util.lookup.Lookups;
|
||||
@ -97,6 +99,7 @@ import org.sleuthkit.autopsy.datamodel.DisplayableItemNodeVisitor;
|
||||
import org.sleuthkit.autopsy.datamodel.FileNode;
|
||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
import org.sleuthkit.autopsy.coreutils.ExecUtil;
|
||||
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
||||
import org.sleuthkit.datamodel.AbstractFile;
|
||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
@ -112,7 +115,7 @@ import org.sleuthkit.datamodel.TskCoreException;
|
||||
*
|
||||
*/
|
||||
public class Timeline extends CallableSystemAction implements Presenter.Toolbar, PropertyChangeListener {
|
||||
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Timeline.class.getName());
|
||||
private final java.io.File macRoot = InstalledFileLocator.getDefault().locate("mactime", Timeline.class.getPackage().getName(), false);
|
||||
private TimelineFrame mainFrame; //frame for holding all the elements
|
||||
@ -142,12 +145,11 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
|
||||
private EventHandler<MouseEvent> fxMouseExitedListener;
|
||||
private SleuthkitCase skCase;
|
||||
private boolean fxInited = false;
|
||||
|
||||
public Timeline() {
|
||||
super();
|
||||
|
||||
fxInited = Installer.isJavaFxInited();
|
||||
|
||||
// TimeZone.setDefault(TimeZone.getTimeZone("UTC")); //sets the default timezone to UTC unless otherwise stated
|
||||
}
|
||||
|
||||
//Swing components and JavafX components don't play super well together
|
||||
@ -914,17 +916,35 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
|
||||
|
||||
int prevYear = -1;
|
||||
YearEpoch ye = null;
|
||||
|
||||
while (scan.hasNextLine()) {
|
||||
String[] s = scan.nextLine().split(","); //1999-02-08T11:08:08Z, 78706, m..b, rrwxrwxrwx, 0, 0, 8355, /img...
|
||||
|
||||
// break the date into mon, day and year: Note that the ISO times are in GMT
|
||||
String[] datetime = s[0].split("T"); //{1999-02-08, 11:08:08Z}
|
||||
String[] date = datetime[0].split("-"); // {1999, 02, 08}
|
||||
// break the date into year,month,day,hour,minute, and second: Note that the ISO times are in GMT
|
||||
String delims = "[T:Z\\-]+"; //split by the delimiters
|
||||
String[] date = s[0].split(delims); //{1999,02,08,11,08,08,...}
|
||||
|
||||
int year = Integer.valueOf(date[0]);
|
||||
int month = Integer.valueOf(date[1]) - 1; //Months are zero indexed: 1 = February, 6 = July, 11 = December
|
||||
int day = Integer.valueOf(date[2]); //Days are 1 indexed
|
||||
int hour=Integer.valueOf(date[3]);
|
||||
int minute=Integer.valueOf(date[4]);
|
||||
int second=Integer.valueOf(date[5]);
|
||||
|
||||
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT")); //set calendar to GMT due to ISO format
|
||||
calendar.set(year, month, day, hour, minute, second);
|
||||
day=calendar.get(Calendar.DAY_OF_MONTH); // this is needed or else timezone change wont work. probably incorrect optimization by compiler
|
||||
|
||||
//conversion to GMT
|
||||
|
||||
if (!ContentUtils.getDisplayInLocalTime()) {
|
||||
calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
}
|
||||
else{
|
||||
calendar.setTimeZone(TimeZone.getDefault());// local timezone OF the user. should be what the user SETS at startup
|
||||
}
|
||||
|
||||
// get the object id out of the modified outpu
|
||||
day=calendar.get(Calendar.DAY_OF_MONTH);//get the day which may be affected by timezone change
|
||||
long ObjId = Long.valueOf(s[4]);
|
||||
|
||||
// when the year changes, create and add a new YearEpoch object to the list
|
||||
@ -961,7 +981,6 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
|
||||
// Get report path
|
||||
String bodyFilePath = moduleDir.getAbsolutePath()
|
||||
+ java.io.File.separator + currentCase.getName() + "-" + datenotime + ".txt";
|
||||
|
||||
// Run query to get all files
|
||||
final String filesAndDirs = "name != '.' "
|
||||
+ "AND name != '..'";
|
||||
@ -1107,7 +1126,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
|
||||
public void performAction() {
|
||||
initTimeline();
|
||||
}
|
||||
|
||||
|
||||
private void initTimeline() {
|
||||
if (!Case.existsCurrentCase()) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user