mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
3296 use random UUID as device ID when device ID is not in manifest file
This commit is contained in:
parent
91bd67a338
commit
dee6b9284e
@ -24,6 +24,7 @@ import java.nio.file.Path;
|
|||||||
import java.nio.file.attribute.BasicFileAttributes;
|
import java.nio.file.attribute.BasicFileAttributes;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.UUID;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
import javax.xml.parsers.DocumentBuilder;
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
@ -74,6 +75,9 @@ public final class AutopsyManifestFileParser implements ManifestFileParser {
|
|||||||
String caseName = (String) expr.evaluate(doc, XPathConstants.STRING);
|
String caseName = (String) expr.evaluate(doc, XPathConstants.STRING);
|
||||||
expr = xpath.compile(DEVICE_ID_XPATH);
|
expr = xpath.compile(DEVICE_ID_XPATH);
|
||||||
String deviceId = (String) expr.evaluate(doc, XPathConstants.STRING);
|
String deviceId = (String) expr.evaluate(doc, XPathConstants.STRING);
|
||||||
|
if (deviceId.isEmpty()) {
|
||||||
|
deviceId = UUID.randomUUID().toString();
|
||||||
|
}
|
||||||
expr = xpath.compile(DATA_SOURCE_NAME_XPATH);
|
expr = xpath.compile(DATA_SOURCE_NAME_XPATH);
|
||||||
String dataSourceName = (String) expr.evaluate(doc, XPathConstants.STRING);
|
String dataSourceName = (String) expr.evaluate(doc, XPathConstants.STRING);
|
||||||
Path dataSourcePath = filePath.getParent().resolve(dataSourceName);
|
Path dataSourcePath = filePath.getParent().resolve(dataSourceName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user