mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Merge pull request #5825 from jonas-koeritz/hashset-comments
Added the possibility to include a comment when adding hashes to a hash set
This commit is contained in:
commit
77a295cb67
@ -64,7 +64,7 @@ public class AddHashValuesToDatabaseProgressDialog extends javax.swing.JDialog {
|
|||||||
display(parent);
|
display(parent);
|
||||||
this.hashes = new ArrayList<>();
|
this.hashes = new ArrayList<>();
|
||||||
this.invalidHashes = new ArrayList<>();
|
this.invalidHashes = new ArrayList<>();
|
||||||
this.md5Pattern = Pattern.compile("^[a-fA-F0-9]{32}$"); // NON-NLS
|
this.md5Pattern = Pattern.compile("^([a-fA-F0-9]{32})"); // NON-NLS
|
||||||
this.parentRef = parent;
|
this.parentRef = parent;
|
||||||
this.hashDb = hashDb;
|
this.hashDb = hashDb;
|
||||||
this.text = text;
|
this.text = text;
|
||||||
@ -163,8 +163,14 @@ public class AddHashValuesToDatabaseProgressDialog extends javax.swing.JDialog {
|
|||||||
hashEntry = hashEntry.trim();
|
hashEntry = hashEntry.trim();
|
||||||
Matcher m = md5Pattern.matcher(hashEntry);
|
Matcher m = md5Pattern.matcher(hashEntry);
|
||||||
if (m.find()) {
|
if (m.find()) {
|
||||||
|
// Is there any text left on this line? If so, treat it as a comment.
|
||||||
|
final String comment = hashEntry.substring(m.end()).trim();
|
||||||
|
if (comment.length() > 0) {
|
||||||
|
hashes.add(new HashEntry(null, m.group(0), null, null, comment));
|
||||||
|
} else {
|
||||||
// more information can be added to the HashEntry - sha-1, sha-512, comment
|
// more information can be added to the HashEntry - sha-1, sha-512, comment
|
||||||
hashes.add(new HashEntry(null, m.group(0), null, null, null));
|
hashes.add(new HashEntry(null, m.group(0), null, null, null));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!hashEntry.isEmpty()) {
|
if (!hashEntry.isEmpty()) {
|
||||||
invalidHashes.add(hashEntry);
|
invalidHashes.add(hashEntry);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user