mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
Codacy fixes.
This commit is contained in:
parent
fc8587cd0d
commit
aa7ae523ff
@ -75,7 +75,7 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter
|
||||
private static final String MIME_TYPE_MSACCESS = "application/x-msaccess";
|
||||
private static final String MIME_TYPE_PDF = "application/pdf";
|
||||
|
||||
private static final String[] FILE_IGNORE_LIST = { "hiberfile.sys", "pagefile.sys" };
|
||||
private static final String[] FILE_IGNORE_LIST = {"hiberfile.sys", "pagefile.sys"};
|
||||
|
||||
private final IngestServices services = IngestServices.getInstance();
|
||||
private final Logger logger = services.getLogger(EncryptionDetectionModuleFactory.getModuleName());
|
||||
@ -124,21 +124,16 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter
|
||||
|
||||
try {
|
||||
/*
|
||||
* Qualify the file type.
|
||||
* Qualify the file type, qualify it against hash databases, and
|
||||
* verify the file hasn't been deleted.
|
||||
*/
|
||||
if (!file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)
|
||||
&& !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS)
|
||||
&& !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.VIRTUAL_DIR)
|
||||
&& !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.LOCAL_DIR)
|
||||
&& (!file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.SLACK) || slackFilesAllowed)) {
|
||||
/*
|
||||
* Qualify the file against hash databases.
|
||||
*/
|
||||
if (!file.getKnown().equals(TskData.FileKnown.KNOWN)) {
|
||||
/*
|
||||
* Has the file been deleted?
|
||||
*/
|
||||
if (!file.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.UNALLOC)) {
|
||||
&& (!file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.SLACK) || slackFilesAllowed)
|
||||
&& !file.getKnown().equals(TskData.FileKnown.KNOWN)
|
||||
&& !file.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.UNALLOC)) {
|
||||
/*
|
||||
* Is the file in FILE_IGNORE_LIST?
|
||||
*/
|
||||
@ -157,19 +152,13 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter
|
||||
* Qualify the MIME type.
|
||||
*/
|
||||
String mimeType = fileTypeDetector.getMIMEType(file);
|
||||
if (mimeType.equals("application/octet-stream")) {
|
||||
if (isFileEncryptionSuspected(file)) {
|
||||
if (mimeType.equals("application/octet-stream") && isFileEncryptionSuspected(file)) {
|
||||
return flagFile(file, BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_SUSPECTED,
|
||||
String.format(Bundle.EncryptionDetectionFileIngestModule_artifactComment_suspected(), calculatedEntropy));
|
||||
}
|
||||
} else {
|
||||
if (isFilePasswordProtected(file)) {
|
||||
} else if (isFilePasswordProtected(file)) {
|
||||
return flagFile(file, BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED, Bundle.EncryptionDetectionFileIngestModule_artifactComment_password());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (ReadContentInputStreamException | SAXException | TikaException | UnsupportedCodecException ex) {
|
||||
logger.log(Level.WARNING, String.format("Unable to read file '%s'", file.getParentPath() + file.getName()), ex);
|
||||
return IngestModule.ProcessResult.ERROR;
|
||||
|
Loading…
x
Reference in New Issue
Block a user