From bcb4927cdc090dde61d7517f59e6ff08ce1e77a3 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Mon, 4 May 2020 10:35:37 -0400 Subject: [PATCH 1/7] 6323: Persona UI skeleton --- .../autopsy/persona/Bundle.properties | 3 + .../autopsy/persona/Bundle.properties-MERGED | 5 + .../autopsy/persona/OpenPersonasAction.java | 95 +++++++++++++++++++ .../autopsy/persona/PersonasTopComponent.form | 49 ++++++++++ .../autopsy/persona/PersonasTopComponent.java | 63 ++++++++++++ .../netbeans/core/startup/Bundle.properties | 4 +- .../core/windows/view/ui/Bundle.properties | 6 +- 7 files changed, 220 insertions(+), 5 deletions(-) create mode 100644 Core/src/org/sleuthkit/autopsy/persona/Bundle.properties create mode 100644 Core/src/org/sleuthkit/autopsy/persona/Bundle.properties-MERGED create mode 100644 Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java create mode 100644 Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.form create mode 100644 Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java diff --git a/Core/src/org/sleuthkit/autopsy/persona/Bundle.properties b/Core/src/org/sleuthkit/autopsy/persona/Bundle.properties new file mode 100644 index 0000000000..2ddf32efdc --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/persona/Bundle.properties @@ -0,0 +1,3 @@ +CTL_OpenPersonas=Personas +CTL_PersonasTopComponentAction=PersonasTopComponent +CTL_PersonasTopComponent=Personas \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/persona/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/persona/Bundle.properties-MERGED new file mode 100644 index 0000000000..1e9b1769d2 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/persona/Bundle.properties-MERGED @@ -0,0 +1,5 @@ +CTL_OpenPersonas=Personas +CTL_PersonasTopComponentAction=PersonasTopComponent +CTL_PersonasTopComponent=Personas +OpenPersonasAction.displayName=Personas +PTopComponent_Name=Personas diff --git a/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java b/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java new file mode 100644 index 0000000000..5f37eb92d9 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java @@ -0,0 +1,95 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2014-2018 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.persona; + +import javax.swing.JMenuItem; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionReferences; +import org.openide.awt.ActionRegistration; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CallableSystemAction; +import org.openide.windows.TopComponent; +import org.openide.windows.WindowManager; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.coreutils.ThreadConfined; + +/** + * An Action that opens the Personas window. + */ + +@ActionID(category = "Tools", id = "org.sleuthkit.autopsy.persona.Personas") +@ActionRegistration(displayName = "#CTL_OpenPersonas", lazy = false) +@ActionReferences(value = { + @ActionReference(path = "Menu/Tools", position = 105) +}) +public final class OpenPersonasAction extends CallableSystemAction { + + private static final long serialVersionUID = 1L; + private static final Logger logger = Logger.getLogger(OpenPersonasAction.class.getName()); + + private final JMenuItem menuItem; + + + public OpenPersonasAction() { + menuItem = super.getMenuPresenter(); + this.setEnabled(true); + } + + @Override + @ThreadConfined(type = ThreadConfined.ThreadType.AWT) + public void performAction() { + final TopComponent topComponent = WindowManager.getDefault().findTopComponent("PersonasTopComponent"); + if (topComponent != null) { + if (topComponent.isOpened() == false) { + topComponent.open(); + } + topComponent.toFront(); + topComponent.requestActive(); + } + } + + @Override + @NbBundle.Messages("OpenPersonasAction.displayName=Personas") + public String getName() { + return Bundle.OpenPersonasAction_displayName(); + } + + @Override + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + public boolean asynchronous() { + return false; // run on edt + } + + @Override + public void setEnabled(boolean enable) { + super.setEnabled(enable); + menuItem.setEnabled(enable); + } + + @Override + public JMenuItem getMenuPresenter() { + return menuItem; + } +} diff --git a/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.form b/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.form new file mode 100644 index 0000000000..6fe1c2a940 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.form @@ -0,0 +1,49 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java b/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java new file mode 100644 index 0000000000..fbac97559e --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java @@ -0,0 +1,63 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2014-2018 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.persona; + +import org.openide.util.NbBundle.Messages; +import org.openide.windows.RetainLocation; +import org.openide.windows.TopComponent; + + +@TopComponent.Description(preferredID = "PersonasTopComponent", persistenceType = TopComponent.PERSISTENCE_NEVER) +@TopComponent.Registration(mode = "personas", openAtStartup = false) +@RetainLocation("personas") +@SuppressWarnings("PMD.SingularField") +public final class PersonasTopComponent extends TopComponent { + + @Messages({ + "PTopComponent_Name=Personas" + }) + public PersonasTopComponent() { + initComponents(); + setName(Bundle.PTopComponent_Name()); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 400, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 300, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables + +} diff --git a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties index b20ccf5912..8cc172caa2 100644 --- a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties +++ b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties @@ -1,5 +1,5 @@ #Updated by build script -#Tue, 12 Nov 2019 17:21:46 -0500 +#Thu, 30 Apr 2020 11:26:58 -0400 LBL_splash_window_title=Starting Autopsy SPLASH_HEIGHT=314 SPLASH_WIDTH=538 @@ -8,4 +8,4 @@ SplashRunningTextBounds=0,289,538,18 SplashRunningTextColor=0x0 SplashRunningTextFontSize=19 -currentVersion=Autopsy 4.13.0 +currentVersion=Autopsy 4.15.0 diff --git a/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties b/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties index 998d3f715c..53e196424c 100644 --- a/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties +++ b/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties @@ -1,4 +1,4 @@ #Updated by build script -#Tue, 12 Nov 2019 17:21:46 -0500 -CTL_MainWindow_Title=Autopsy 4.13.0 -CTL_MainWindow_Title_No_Project=Autopsy 4.13.0 +#Thu, 30 Apr 2020 11:26:58 -0400 +CTL_MainWindow_Title=Autopsy 4.15.0 +CTL_MainWindow_Title_No_Project=Autopsy 4.15.0 From 17f44ae56039b714a6666f62d188d22930383d96 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Tue, 5 May 2020 10:10:56 -0400 Subject: [PATCH 2/7] 6323 Updating copyright years --- Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java | 2 +- .../src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java b/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java index 5f37eb92d9..c4ca19bb4f 100644 --- a/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java +++ b/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2014-2018 Basis Technology Corp. + * Copyright 2014-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java b/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java index fbac97559e..44ea5fb534 100644 --- a/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2014-2018 Basis Technology Corp. + * Copyright 2014-2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); From aa9991ef0391b510d20d58e8ccefb7351b85378b Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Tue, 5 May 2020 10:13:45 -0400 Subject: [PATCH 3/7] 6323 Restoring .properties --- .../core.jar/org/netbeans/core/startup/Bundle.properties | 4 ++-- .../org/netbeans/core/windows/view/ui/Bundle.properties | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties index 8cc172caa2..b20ccf5912 100644 --- a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties +++ b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties @@ -1,5 +1,5 @@ #Updated by build script -#Thu, 30 Apr 2020 11:26:58 -0400 +#Tue, 12 Nov 2019 17:21:46 -0500 LBL_splash_window_title=Starting Autopsy SPLASH_HEIGHT=314 SPLASH_WIDTH=538 @@ -8,4 +8,4 @@ SplashRunningTextBounds=0,289,538,18 SplashRunningTextColor=0x0 SplashRunningTextFontSize=19 -currentVersion=Autopsy 4.15.0 +currentVersion=Autopsy 4.13.0 diff --git a/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties b/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties index 53e196424c..998d3f715c 100644 --- a/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties +++ b/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties @@ -1,4 +1,4 @@ #Updated by build script -#Thu, 30 Apr 2020 11:26:58 -0400 -CTL_MainWindow_Title=Autopsy 4.15.0 -CTL_MainWindow_Title_No_Project=Autopsy 4.15.0 +#Tue, 12 Nov 2019 17:21:46 -0500 +CTL_MainWindow_Title=Autopsy 4.13.0 +CTL_MainWindow_Title_No_Project=Autopsy 4.13.0 From f6c06488c51ee32485f8d1afc5d441748ccff0fb Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dsmyda" Date: Tue, 5 May 2020 10:21:55 -0400 Subject: [PATCH 4/7] Fixed date filter NPE when no waypoints or tracks have timestamps --- .../geolocation/AbstractWaypointFetcher.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/geolocation/AbstractWaypointFetcher.java b/Core/src/org/sleuthkit/autopsy/geolocation/AbstractWaypointFetcher.java index e923d6dbd6..0e398b9f22 100755 --- a/Core/src/org/sleuthkit/autopsy/geolocation/AbstractWaypointFetcher.java +++ b/Core/src/org/sleuthkit/autopsy/geolocation/AbstractWaypointFetcher.java @@ -120,13 +120,15 @@ abstract class AbstractWaypointFetcher implements WaypointBuilder.WaypointFilter // Figure out what the most recent time is given the filtered // waypoints and the tracks. timeRangeEnd = getMostRecent(waypoints, tracks); - timeRangeStart = timeRangeEnd - (86400 * filters.getMostRecentNumDays()); + if (timeRangeEnd != null) { + timeRangeStart = timeRangeEnd - (86400 * filters.getMostRecentNumDays()); - completeList.addAll(getWaypointsInRange(timeRangeStart, timeRangeEnd, waypoints)); - - filteredTracks = getTracksInRange(timeRangeStart, timeRangeEnd, tracks); - for (List filteredTrack : filteredTracks) { - completeList.addAll(filteredTrack); + completeList.addAll(getWaypointsInRange(timeRangeStart, timeRangeEnd, waypoints)); + + filteredTracks = getTracksInRange(timeRangeStart, timeRangeEnd, tracks); + for (List filteredTrack : filteredTracks) { + completeList.addAll(filteredTrack); + } } } else { completeList.addAll(waypoints); From be99f86a2bf75f3d57cf3c152721f833546c4ae8 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dsmyda" Date: Tue, 5 May 2020 12:55:48 -0400 Subject: [PATCH 5/7] Made mostRecentEnd negative rather than null when no timestamps can be found --- .../geolocation/AbstractWaypointFetcher.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/geolocation/AbstractWaypointFetcher.java b/Core/src/org/sleuthkit/autopsy/geolocation/AbstractWaypointFetcher.java index 0e398b9f22..2c33d054cb 100755 --- a/Core/src/org/sleuthkit/autopsy/geolocation/AbstractWaypointFetcher.java +++ b/Core/src/org/sleuthkit/autopsy/geolocation/AbstractWaypointFetcher.java @@ -120,15 +120,13 @@ abstract class AbstractWaypointFetcher implements WaypointBuilder.WaypointFilter // Figure out what the most recent time is given the filtered // waypoints and the tracks. timeRangeEnd = getMostRecent(waypoints, tracks); - if (timeRangeEnd != null) { - timeRangeStart = timeRangeEnd - (86400 * filters.getMostRecentNumDays()); + timeRangeStart = timeRangeEnd - (86400 * filters.getMostRecentNumDays()); - completeList.addAll(getWaypointsInRange(timeRangeStart, timeRangeEnd, waypoints)); - - filteredTracks = getTracksInRange(timeRangeStart, timeRangeEnd, tracks); - for (List filteredTrack : filteredTracks) { - completeList.addAll(filteredTrack); - } + completeList.addAll(getWaypointsInRange(timeRangeStart, timeRangeEnd, waypoints)); + + filteredTracks = getTracksInRange(timeRangeStart, timeRangeEnd, tracks); + for (List filteredTrack : filteredTracks) { + completeList.addAll(filteredTrack); } } else { completeList.addAll(waypoints); @@ -259,6 +257,6 @@ abstract class AbstractWaypointFetcher implements WaypointBuilder.WaypointFilter return waypointMostRecent; } - return null; + return -1L; } } From 57a22dee94cc69b9c90ae504f95c75ca49b619fe Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Wed, 6 May 2020 13:25:58 -0400 Subject: [PATCH 6/7] 6323: Changing copyright year range --- Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java | 2 +- .../src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java b/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java index c4ca19bb4f..d9e52349df 100644 --- a/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java +++ b/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2014-2020 Basis Technology Corp. + * Copyright 2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java b/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java index 44ea5fb534..a88d66faa0 100644 --- a/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2014-2020 Basis Technology Corp. + * Copyright 2020 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); From 51639a09680a043978e57206d70968935067b748 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Fri, 8 May 2020 10:46:43 -0400 Subject: [PATCH 7/7] 6323 Address codacy --- .../org/sleuthkit/autopsy/persona/OpenPersonasAction.java | 2 -- .../org/sleuthkit/autopsy/persona/PersonasTopComponent.java | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java b/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java index d9e52349df..157b25d1cc 100644 --- a/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java +++ b/Core/src/org/sleuthkit/autopsy/persona/OpenPersonasAction.java @@ -28,7 +28,6 @@ import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; -import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.ThreadConfined; /** @@ -43,7 +42,6 @@ import org.sleuthkit.autopsy.coreutils.ThreadConfined; public final class OpenPersonasAction extends CallableSystemAction { private static final long serialVersionUID = 1L; - private static final Logger logger = Logger.getLogger(OpenPersonasAction.class.getName()); private final JMenuItem menuItem; diff --git a/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java b/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java index a88d66faa0..8ad405abd3 100644 --- a/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/persona/PersonasTopComponent.java @@ -22,7 +22,10 @@ import org.openide.util.NbBundle.Messages; import org.openide.windows.RetainLocation; import org.openide.windows.TopComponent; - +/** + * Top component for the Personas tool + * + */ @TopComponent.Description(preferredID = "PersonasTopComponent", persistenceType = TopComponent.PERSISTENCE_NEVER) @TopComponent.Registration(mode = "personas", openAtStartup = false) @RetainLocation("personas")