From 0966919f35079cbdd631103d6ef980b36d00b104 Mon Sep 17 00:00:00 2001 From: Kelly Kelly Date: Thu, 11 Jun 2020 14:57:33 -0400 Subject: [PATCH 1/5] Added contact image to ContactArtifactViewer --- .../contentviewers/ContactArtifactViewer.form | 65 ++++----- .../contentviewers/ContactArtifactViewer.java | 124 +++++++++++++----- .../images/defaultContact.png | Bin 3 files changed, 127 insertions(+), 62 deletions(-) rename Core/src/org/sleuthkit/autopsy/{communications => }/images/defaultContact.png (100%) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/ContactArtifactViewer.form b/Core/src/org/sleuthkit/autopsy/contentviewers/ContactArtifactViewer.form index 3d1b74d1ca..467d3ae72d 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/ContactArtifactViewer.form +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/ContactArtifactViewer.form @@ -19,30 +19,11 @@ - + - - - - - - - - - - - - - - - - - - - - + @@ -55,6 +36,11 @@ + + + + + @@ -71,14 +57,14 @@ - + - + @@ -97,14 +83,14 @@ - + - + @@ -123,14 +109,14 @@ - + - + @@ -149,7 +135,7 @@ - + @@ -175,14 +161,14 @@ - + - + @@ -201,7 +187,7 @@ - + @@ -218,7 +204,22 @@ - + + + + + + + + + + + + + + + + diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/ContactArtifactViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/ContactArtifactViewer.java index e7c6d2ccdc..6dbf0a985f 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/ContactArtifactViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/ContactArtifactViewer.java @@ -23,6 +23,9 @@ import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionListener; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -33,6 +36,8 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.logging.Level; import java.util.stream.Collectors; +import javax.imageio.ImageIO; +import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; @@ -49,8 +54,10 @@ import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsDialogCallb import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsMode; import org.sleuthkit.autopsy.centralrepository.persona.PersonaDetailsPanel; import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; +import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.TskCoreException; /** @@ -75,11 +82,16 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac // account identifier attributes of the Contact artifact. private final Map> contactUniquePersonasMap = new HashMap<>(); + private final static String DEFAULT_IMAGE_PATH = "/org/sleuthkit/autopsy/images/defaultContact.png"; + private final ImageIcon defaultImage; + /** * Creates new form for ContactArtifactViewer */ public ContactArtifactViewer() { initComponents(); + + defaultImage = new ImageIcon(ContactArtifactViewer.class.getResource(DEFAULT_IMAGE_PATH)); } /** @@ -105,41 +117,38 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac personasPanel = new javax.swing.JPanel(); javax.swing.Box.Filler bottomFiller = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767)); javax.swing.Box.Filler rightFiller = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); + contactImage = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); + namePanel.setLayout(new java.awt.GridBagLayout()); + contactNameLabel.setFont(contactNameLabel.getFont().deriveFont((contactNameLabel.getFont().getStyle() | java.awt.Font.ITALIC) | java.awt.Font.BOLD, contactNameLabel.getFont().getSize()+6)); org.openide.awt.Mnemonics.setLocalizedText(contactNameLabel, org.openide.util.NbBundle.getMessage(ContactArtifactViewer.class, "ContactArtifactViewer.contactNameLabel.text")); // NOI18N - - javax.swing.GroupLayout namePanelLayout = new javax.swing.GroupLayout(namePanel); - namePanel.setLayout(namePanelLayout); - namePanelLayout.setHorizontalGroup( - namePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(namePanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(contactNameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - namePanelLayout.setVerticalGroup( - namePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(namePanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(contactNameLabel) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; - gridBagConstraints.gridwidth = 4; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.ipadx = 111; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + namePanel.add(contactNameLabel, gridBagConstraints); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.gridwidth = 5; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.insets = new java.awt.Insets(6, 19, 0, 0); add(namePanel, gridBagConstraints); phonesLabel.setFont(phonesLabel.getFont().deriveFont(phonesLabel.getFont().getStyle() | java.awt.Font.BOLD, phonesLabel.getFont().getSize()+2)); org.openide.awt.Mnemonics.setLocalizedText(phonesLabel, org.openide.util.NbBundle.getMessage(ContactArtifactViewer.class, "ContactArtifactViewer.phonesLabel.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; + gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(6, 19, 0, 0); @@ -148,7 +157,7 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac phoneNumbersPanel.setLayout(new java.awt.GridBagLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 2; + gridBagConstraints.gridy = 3; gridBagConstraints.gridwidth = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; @@ -159,7 +168,7 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac org.openide.awt.Mnemonics.setLocalizedText(emailsLabel, org.openide.util.NbBundle.getMessage(ContactArtifactViewer.class, "ContactArtifactViewer.emailsLabel.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 3; + gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(6, 19, 0, 0); @@ -168,7 +177,7 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac emailsPanel.setLayout(new java.awt.GridBagLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 4; + gridBagConstraints.gridy = 5; gridBagConstraints.gridwidth = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; @@ -179,7 +188,7 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac org.openide.awt.Mnemonics.setLocalizedText(othersLabel, org.openide.util.NbBundle.getMessage(ContactArtifactViewer.class, "ContactArtifactViewer.othersLabel.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 5; + gridBagConstraints.gridy = 6; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(6, 19, 0, 0); add(othersLabel, gridBagConstraints); @@ -187,7 +196,7 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac otherAttrsPanel.setLayout(new java.awt.GridBagLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 6; + gridBagConstraints.gridy = 7; gridBagConstraints.gridwidth = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; @@ -195,7 +204,7 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac add(otherAttrsPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 7; + gridBagConstraints.gridy = 8; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; gridBagConstraints.weighty = 0.1; @@ -208,7 +217,7 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac personasLabel.setPreferredSize(new java.awt.Dimension(90, 19)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 8; + gridBagConstraints.gridy = 9; gridBagConstraints.gridwidth = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(6, 19, 0, 0); @@ -217,7 +226,7 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac personasPanel.setLayout(new java.awt.GridBagLayout()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 9; + gridBagConstraints.gridy = 10; gridBagConstraints.gridwidth = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; @@ -225,19 +234,27 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac add(personasPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 10; + gridBagConstraints.gridy = 11; gridBagConstraints.gridwidth = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weighty = 1.0; add(bottomFiller, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; - gridBagConstraints.gridy = 0; + gridBagConstraints.gridy = 3; gridBagConstraints.gridheight = 8; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.ipadx = 2; gridBagConstraints.weightx = 1.0; add(rightFiller, gridBagConstraints); + + contactImage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/defaultContact.png"))); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(contactImage, org.openide.util.NbBundle.getMessage(ContactArtifactViewer.class, "ContactArtifactViewer.contactImage.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.insets = new java.awt.Insets(6, 19, 0, 0); + add(contactImage, gridBagConstraints); }// //GEN-END:initComponents @Override @@ -291,6 +308,8 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac logger.log(Level.SEVERE, String.format("Error getting Personas for Contact artifact (artifact_id=%d, obj_id=%d)", artifact.getArtifactID(), artifact.getObjectID()), ex); } + contactImage.setIcon(getImageFromArtifact(artifact)); + // repaint this.revalidate(); this.repaint(); @@ -333,6 +352,7 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac contactName = null; contactUniqueAccountsList.clear(); contactUniquePersonasMap.clear(); + contactImage.setIcon(defaultImage); } /** @@ -602,6 +622,49 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac } } + /** + * Gets an image from a TSK_CONTACT artifact. + * + * @param artifact + * + * @return Image from a TSK_CONTACT artifact or default image if none was + * found or the artifact is not a TSK_CONTACT + */ + private ImageIcon getImageFromArtifact(BlackboardArtifact artifact) { + ImageIcon imageIcon = defaultImage; + + if (artifact == null) { + return imageIcon; + } + + BlackboardArtifact.ARTIFACT_TYPE artifactType = BlackboardArtifact.ARTIFACT_TYPE.fromID(artifact.getArtifactTypeID()); + if (artifactType != BlackboardArtifact.ARTIFACT_TYPE.TSK_CONTACT) { + return imageIcon; + } + + try { + for (Content content : artifact.getChildren()) { + if (content instanceof AbstractFile) { + AbstractFile file = (AbstractFile) content; + + try { + BufferedImage image = ImageIO.read(new File(file.getLocalAbsPath())); + imageIcon = new ImageIcon(image); + break; + } catch (IOException ex) { + // ImageIO.read will through an IOException if file is not an image + // therefore we don't need to report this exception just try + // the next file. + } + } + } + } catch (TskCoreException ex) { + logger.log(Level.WARNING, String.format("Unable to load image for contact: %d", artifact.getId()), ex); + } + + return imageIcon; + } + /** * Thread to search for a personas for all account identifier attributes for * a contact. @@ -850,6 +913,7 @@ public class ContactArtifactViewer extends javax.swing.JPanel implements Artifac // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel contactImage; private javax.swing.JLabel contactNameLabel; private javax.swing.JLabel emailsLabel; private javax.swing.JPanel emailsPanel; diff --git a/Core/src/org/sleuthkit/autopsy/communications/images/defaultContact.png b/Core/src/org/sleuthkit/autopsy/images/defaultContact.png similarity index 100% rename from Core/src/org/sleuthkit/autopsy/communications/images/defaultContact.png rename to Core/src/org/sleuthkit/autopsy/images/defaultContact.png From f57ea9b1f3277a41a3aa5835eef430d4cc7d3cc2 Mon Sep 17 00:00:00 2001 From: Kelly Kelly Date: Thu, 11 Jun 2020 16:19:40 -0400 Subject: [PATCH 2/5] Missed the properties file --- .../persona/Bundle.properties-MERGED | 14 ++++++-------- .../autopsy/contentviewers/Bundle.properties | 1 + .../contentviewers/Bundle.properties-MERGED | 17 +++++++++++++---- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle.properties-MERGED index 9edd6ade5c..4b3d9baa64 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle.properties-MERGED @@ -1,13 +1,13 @@ AddAccountDialog.title.text=Add Account -AddAccountDialog_dup_msg=This account is already added to the persona +AddAccountDialog_dup_msg=This account is already added to the persona. AddAccountDialog_dup_Title=Account add failure -AddAccountDialog_empty_msg=The identifier field cannot be empty +AddAccountDialog_empty_msg=The identifier field cannot be empty. AddAccountDialog_empty_Title=Empty identifier -AddAccountDialog_get_types_exception_msg=Failed to access central repository +AddAccountDialog_get_types_exception_msg=Failed to access central repository. AddAccountDialog_get_types_exception_Title=Central Repository failure -AddAccountDialog_search_empty_msg=Account not found for given identifier and type +AddAccountDialog_search_empty_msg=Account not found in the Central Repository for the given identifier and type. AddAccountDialog_search_empty_Title=Account not found -AddAccountDialog_search_failure_msg=Central Repository account search failed +AddAccountDialog_search_failure_msg=Central Repository account search failed. AddAccountDialog_search_failure_Title=Account add failure AddAliasDialog.title.text=Add Alias AddAliasDialog_dup_msg=This alias has already been added to this persona @@ -43,8 +43,6 @@ AddAccountDialog.okBtn.text=OK PersonaManagerTopComponent.editBtn.text=Edit Persona PersonaDetailsDialog.cancelBtn.text=Cancel PersonaDetailsDialog.okBtn.text=OK -PersonaDetailsPanel.deleteCaseBtn.text=Delete -PersonaDetailsPanel.addCaseBtn.text=Add PersonaDetailsPanel.casesLbl.text=Cases found in: PersonaDetailsPanel.deleteAliasBtn.text=Delete PersonaDetailsPanel.addAliasBtn.text=Add @@ -83,7 +81,7 @@ AddAccountDialog.typeLbl.text=Type: AddAccountDialog.identiferLbl.text=Identifier: AddAccountDialog.identifierTextField.text= PersonaManagerTopComponent.deleteBtn.text=Delete Persona -PMTopComponent_delete_confirmation_msg=Are you sure you want to delete a persona? +PMTopComponent_delete_confirmation_msg=Are you sure you want to delete this persona? PMTopComponent_delete_confirmation_Title=Are you sure? PMTopComponent_delete_exception_msg=Failed to delete persona. PMTopComponent_delete_exception_Title=Delete failure diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties index edb4c70bc2..f35853613b 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties @@ -980,3 +980,4 @@ CallLogArtifactViewer.localAccountPersonaLabel.text=Persona: CallLogArtifactViewer.localAccountPersonaNameLabel.text=jLabel1 CallLogArtifactViewer.localAccountPersonaButton.text=jButton1 ContactArtifactViewer.personasLabel.text=Personas +ContactArtifactViewer.contactImage.text= diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED index 4383f2c3d1..bdc9789232 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties-MERGED @@ -37,11 +37,18 @@ ApplicationContentViewer.title=Application ApplicationContentViewer.toolTip=Displays file contents. CallLogArtifactViewer_number_from=From CallLogArtifactViewer_number_to=To -CallLogArtifactViewer_persona_button_new=New +CallLogArtifactViewer_persona_button_new=Create CallLogArtifactViewer_persona_button_view=View -CallLogArtifactViewer_persona_label=\ Persona: -CallLogArtifactViewer_persona_searching=\ Searching... -CallLogArtifactViewer_persona_text_none=No Persona +CallLogArtifactViewer_persona_label=\ Persona +CallLogArtifactViewer_persona_searching=Searching... +CallLogArtifactViewer_persona_text_none=None Found +ContactArtifactViewer_missing_account_label=Missing Account: +ContactArtifactViewer_persona_account_justification=Account found in Contact artifact +ContactArtifactViewer_persona_button_new=Create +ContactArtifactViewer_persona_button_view=View +ContactArtifactViewer_persona_label=Persona +ContactArtifactViewer_persona_searching=\ Searching... +ContactArtifactViewer_persona_text_none=None found DataContentViewerArtifact.failedToGetAttributes.message=Failed to get some or all attributes from case database DataContentViewerArtifact.failedToGetSourcePath.message=Failed to get source file path from case database DefaultArtifactContentViewer.attrsTableHeader.sources=Source(s) @@ -1080,3 +1087,5 @@ MessageArtifactViewer.htmlPane.TabConstraints.tabTitle=HTML CallLogArtifactViewer.localAccountPersonaLabel.text=Persona: CallLogArtifactViewer.localAccountPersonaNameLabel.text=jLabel1 CallLogArtifactViewer.localAccountPersonaButton.text=jButton1 +ContactArtifactViewer.personasLabel.text=Personas +ContactArtifactViewer.contactImage.text= From 1050a189f0d5347e3cc57e0cbedbbb05e157441b Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Tue, 16 Jun 2020 09:09:46 -0400 Subject: [PATCH 3/5] jython module loader scanner --- Core/src/org/sleuthkit/autopsy/python/JythonModuleLoader.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/python/JythonModuleLoader.java b/Core/src/org/sleuthkit/autopsy/python/JythonModuleLoader.java index f58adbfc0d..dab8969c94 100644 --- a/Core/src/org/sleuthkit/autopsy/python/JythonModuleLoader.java +++ b/Core/src/org/sleuthkit/autopsy/python/JythonModuleLoader.java @@ -41,6 +41,8 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.autopsy.ingest.IngestModuleFactory; import org.sleuthkit.autopsy.report.GeneralReportModule; +import java.io.BufferedReader; +import java.io.FileReader; /** * Finds and loads Autopsy modules written using the Jython variant of the @@ -97,7 +99,7 @@ public final class JythonModuleLoader { if (file.isDirectory()) { File[] pythonScripts = file.listFiles(new PythonScriptFileFilter()); for (File script : pythonScripts) { - try (Scanner fileScanner = new Scanner(script)) { + try (Scanner fileScanner = new Scanner(new BufferedReader(new FileReader(script)))) { while (fileScanner.hasNextLine()) { String line = fileScanner.nextLine(); if (line.startsWith("class ") && filter.accept(line)) { //NON-NLS From 7a82060b88bcc73bc5a8186c139fddb81a4cec92 Mon Sep 17 00:00:00 2001 From: Raman Arora Date: Tue, 16 Jun 2020 09:28:03 -0400 Subject: [PATCH 4/5] 6517: Persona dialog invoked in View mode does not dismiss with Ok button. --- .../autopsy/centralrepository/persona/PersonaDetailsPanel.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaDetailsPanel.java b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaDetailsPanel.java index 66b51ba1c7..032505a9a4 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaDetailsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaDetailsPanel.java @@ -976,6 +976,7 @@ public final class PersonaDetailsPanel extends javax.swing.JPanel { } break; case VIEW: + ret = currentPersona; break; default: logger.log(Level.SEVERE, "Unsupported mode: {0}", mode); From 8f1ee8029358b1449e423d87ff92beb33d77bafe Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Tue, 16 Jun 2020 12:54:12 -0400 Subject: [PATCH 5/5] 6460 Restore monospaced font to the hex viewer --- .../sleuthkit/autopsy/corecomponents/DataContentViewerHex.form | 3 +++ .../sleuthkit/autopsy/corecomponents/DataContentViewerHex.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.form b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.form index 25b84e82c7..3cb12fd971 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.form +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.form @@ -75,6 +75,9 @@ + + + diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java index 78af70a300..be8f854b96 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java @@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.corecomponents; import java.awt.Component; import java.awt.Cursor; +import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; @@ -130,6 +131,7 @@ public class DataContentViewerHex extends javax.swing.JPanel implements DataCont jScrollPane3.setPreferredSize(new java.awt.Dimension(300, 33)); outputTextArea.setEditable(false); + outputTextArea.setFont(new Font("Monospaced", Font.PLAIN, 11)); outputTextArea.setTabSize(0); outputTextArea.setInheritsPopupMenu(true); jScrollPane3.setViewportView(outputTextArea);