mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
Hash nodes added.
This commit is contained in:
parent
402c428d3e
commit
d3e07d350d
@ -53,3 +53,4 @@ HashDbSearchPanel.searchButton.text=Search
|
||||
HashDbSearchPanel.removeButton.text=Remove Selected
|
||||
HashDbSearchPanel.titleLabel.text=Search for files with the following MD5 hash(es):
|
||||
HashDbSearchPanel.errorField.text=Error: Not all files have been hashed.
|
||||
HashDbSearchPanel.saveBox.text=Remember Hashes
|
||||
|
@ -1,61 +1,71 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> 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.hashdatabase;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import org.openide.util.HelpCtx;
|
||||
import org.openide.util.actions.CallableSystemAction;
|
||||
import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationCleanDialog;
|
||||
|
||||
/**
|
||||
* The HashDbSearchAction opens the HashDbSearchPanel in a dialog.
|
||||
*/
|
||||
class HashDbSearchAction extends CallableSystemAction {
|
||||
|
||||
static final String ACTION_NAME = "Hash File Search";
|
||||
|
||||
@Override
|
||||
public void performAction() {
|
||||
final HashDbSearchPanel panel = HashDbSearchPanel.getDefault();
|
||||
final AdvancedConfigurationCleanDialog dialog = new AdvancedConfigurationCleanDialog();
|
||||
panel.cancelButtonListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
dialog.close();
|
||||
}
|
||||
});
|
||||
dialog.display(panel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ACTION_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HelpCtx getHelpCtx() {
|
||||
return HelpCtx.DEFAULT_HELP;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean asynchronous() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> 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.hashdatabase;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import org.openide.util.HelpCtx;
|
||||
import org.openide.util.actions.CallableSystemAction;
|
||||
import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationCleanDialog;
|
||||
|
||||
/**
|
||||
* The HashDbSearchAction opens the HashDbSearchPanel in a dialog.
|
||||
*/
|
||||
class HashDbSearchAction extends CallableSystemAction {
|
||||
|
||||
static final String ACTION_NAME = "Hash File Search";
|
||||
|
||||
@Override
|
||||
public void performAction() {
|
||||
final HashDbSearchPanel panel = HashDbSearchPanel.getDefault();
|
||||
final AdvancedConfigurationCleanDialog dialog = new AdvancedConfigurationCleanDialog();
|
||||
panel.cancelButtonListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
panel.clear();
|
||||
dialog.close();
|
||||
}
|
||||
});
|
||||
dialog.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e) {
|
||||
panel.clear();
|
||||
dialog.close();
|
||||
}
|
||||
});
|
||||
dialog.display(panel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ACTION_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HelpCtx getHelpCtx() {
|
||||
return HelpCtx.DEFAULT_HELP;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean asynchronous() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -50,9 +50,9 @@ public class HashDbSearchManager {
|
||||
for(String s : map.keySet()) {
|
||||
for(FsContent file : map.get(s)) {
|
||||
Map<String, Object> keyMap = new LinkedHashMap<String, Object>();
|
||||
keyMap.put("Hash", s);
|
||||
keyMap.put("MD5 Hash", s);
|
||||
AbstractFsContentNode.fillPropertyMap(keyMap, file);
|
||||
KeyValue kv = new KeyValue("MD5 - Name", keyMap, ++id);
|
||||
KeyValue kv = new KeyValue(file.getName(), keyMap, ++id);
|
||||
keyValues.add(kv);
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,8 @@
|
||||
<Component id="addButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="removeButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="saveBox" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
@ -71,6 +73,7 @@
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="addButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="removeButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="saveBox" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="27" max="32767" attributes="0"/>
|
||||
<Component id="jSeparator1" min="-2" pref="10" max="-2" attributes="0"/>
|
||||
@ -179,5 +182,15 @@
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="saveBox">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/hashdatabase/Bundle.properties" key="HashDbSearchPanel.saveBox.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="saveBoxActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
@ -128,6 +128,7 @@ public class HashDbSearchPanel extends javax.swing.JPanel implements ActionListe
|
||||
jSeparator1 = new javax.swing.JSeparator();
|
||||
titleLabel = new javax.swing.JLabel();
|
||||
errorField = new javax.swing.JLabel();
|
||||
saveBox = new javax.swing.JCheckBox();
|
||||
|
||||
hashTable.setModel(new javax.swing.table.DefaultTableModel(
|
||||
new Object [][] {
|
||||
@ -173,6 +174,13 @@ public class HashDbSearchPanel extends javax.swing.JPanel implements ActionListe
|
||||
errorField.setForeground(new java.awt.Color(255, 0, 0));
|
||||
org.openide.awt.Mnemonics.setLocalizedText(errorField, org.openide.util.NbBundle.getMessage(HashDbSearchPanel.class, "HashDbSearchPanel.errorField.text")); // NOI18N
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(saveBox, org.openide.util.NbBundle.getMessage(HashDbSearchPanel.class, "HashDbSearchPanel.saveBox.text")); // NOI18N
|
||||
saveBox.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
saveBoxActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
@ -202,7 +210,9 @@ public class HashDbSearchPanel extends javax.swing.JPanel implements ActionListe
|
||||
.addGap(61, 61, 61)
|
||||
.addComponent(addButton)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(removeButton)))
|
||||
.addComponent(removeButton)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(saveBox)))
|
||||
.addGap(0, 0, Short.MAX_VALUE)))))
|
||||
.addContainerGap())
|
||||
);
|
||||
@ -220,7 +230,8 @@ public class HashDbSearchPanel extends javax.swing.JPanel implements ActionListe
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(addButton)
|
||||
.addComponent(removeButton))
|
||||
.addComponent(removeButton)
|
||||
.addComponent(saveBox))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
|
||||
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
@ -231,6 +242,11 @@ public class HashDbSearchPanel extends javax.swing.JPanel implements ActionListe
|
||||
.addContainerGap())
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void saveBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveBoxActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_saveBoxActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton addButton;
|
||||
private javax.swing.JButton cancelButton;
|
||||
@ -241,6 +257,7 @@ public class HashDbSearchPanel extends javax.swing.JPanel implements ActionListe
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JSeparator jSeparator1;
|
||||
private javax.swing.JButton removeButton;
|
||||
private javax.swing.JCheckBox saveBox;
|
||||
private javax.swing.JButton searchButton;
|
||||
private javax.swing.JLabel titleLabel;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
@ -306,4 +323,17 @@ public class HashDbSearchPanel extends javax.swing.JPanel implements ActionListe
|
||||
model.removeRow(rows[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the table of hashes
|
||||
*/
|
||||
void clear() {
|
||||
if(!saveBox.isSelected()) {
|
||||
DefaultTableModel model = (DefaultTableModel) hashTable.getModel();
|
||||
int numRows = hashTable.getRowCount();
|
||||
for(int i=0; i<numRows; i++) {
|
||||
model.removeRow(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.openide.nodes.ChildFactory;
|
||||
import org.openide.nodes.Children;
|
||||
import org.openide.nodes.Node;
|
||||
import org.sleuthkit.autopsy.datamodel.KeyValue;
|
||||
import org.sleuthkit.autopsy.datamodel.KeyValueNode;
|
||||
@ -34,6 +35,6 @@ public class HashDbSearchResultFactory extends ChildFactory<KeyValue> {
|
||||
|
||||
@Override
|
||||
protected Node createNodeForKey(KeyValue thing) {
|
||||
return new KeyValueNode(thing, null);
|
||||
return new KeyValueNode(thing, Children.LEAF);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user