mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
remove upload from options panel
remove upload from options panel
This commit is contained in:
parent
2045b2357c
commit
5899d2dfdf
@ -60,8 +60,6 @@ CTOPtionsPanel_loadMalwareScansInfo_loading=Loading...
|
||||
EULADialog.cancelButton.text=Cancel
|
||||
EULADialog.acceptButton.text=Accept
|
||||
EULADialog.title=Cyber Triage End User License Agreement
|
||||
CTMalwareScannerOptionsPanel.fileUploadCheckbox.text=Upload file if hash lookup produces no results
|
||||
CTMalwareScannerOptionsPanel.fileUploadPanel.border.title=File Upload
|
||||
CTMalwareScannerOptionsPanel.licenseInfoMessageLabel.text=
|
||||
CTMalwareScannerOptionsPanel.disclaimer.text=<html>The Cyber Triage Malware Scanner module uses 40+ malware scanning engines to identify if Windows executables are malicious. It requires a paid subscription to use.</html>
|
||||
CTMalwareScannerOptionsPanel.purchaseFromLabel.text=For licensing information, visit
|
||||
|
@ -91,39 +91,6 @@ public class CTLicensePersistence {
|
||||
});
|
||||
}
|
||||
|
||||
public synchronized boolean saveMalwareSettings(MalwareIngestSettings malwareIngestSettings) {
|
||||
if (malwareIngestSettings != null) {
|
||||
File settingsFile = getMalwareIngestFile();
|
||||
try {
|
||||
settingsFile.getParentFile().mkdirs();
|
||||
objectMapper.writeValue(settingsFile, malwareIngestSettings);
|
||||
return true;
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "There was an error writing malware ingest settings to file: " + settingsFile.getAbsolutePath(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public synchronized MalwareIngestSettings loadMalwareIngestSettings() {
|
||||
MalwareIngestSettings settings = null;
|
||||
File settingsFile = getMalwareIngestFile();
|
||||
if (settingsFile.exists() && settingsFile.isFile()) {
|
||||
try {
|
||||
settings = objectMapper.readValue(settingsFile, MalwareIngestSettings.class);
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "There was an error reading malware ingest settings from file: " + settingsFile.getAbsolutePath(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
if (settings == null) {
|
||||
settings = new MalwareIngestSettings();
|
||||
}
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
private File getCTLicenseFile() {
|
||||
return Paths.get(PlatformUtil.getModuleConfigDirectory(), CT_SETTINGS_DIR, CT_LICENSE_FILENAME).toFile();
|
||||
}
|
||||
|
@ -88,8 +88,6 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel {
|
||||
public CTMalwareScannerOptionsPanel() {
|
||||
initComponents();
|
||||
|
||||
this.fileUploadPanel.setVisible(false);
|
||||
|
||||
this.addComponentListener(new ComponentAdapter() {
|
||||
@Override
|
||||
public void componentHidden(ComponentEvent e) {
|
||||
@ -121,7 +119,6 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel {
|
||||
@Override
|
||||
public synchronized void saveSettings() {
|
||||
ctPersistence.saveLicenseResponse(getLicenseInfo());
|
||||
ctPersistence.saveMalwareSettings(getIngestSettings());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -138,9 +135,6 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel {
|
||||
if (licenseInfo != null) {
|
||||
loadMalwareScansInfo(licenseInfo);
|
||||
}
|
||||
|
||||
MalwareIngestSettings ingestSettings = ctPersistence.loadMalwareIngestSettings();
|
||||
setIngestSettings(ingestSettings);
|
||||
}
|
||||
|
||||
private static String getHtmlLink(String url) {
|
||||
@ -163,18 +157,6 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel {
|
||||
return this.licenseInfo == null ? null : this.licenseInfo.getLicenseResponse();
|
||||
}
|
||||
|
||||
private MalwareIngestSettings getIngestSettings() {
|
||||
return new MalwareIngestSettings()
|
||||
.setUploadFiles(this.fileUploadCheckbox.isSelected());
|
||||
}
|
||||
|
||||
private void setIngestSettings(MalwareIngestSettings ingestSettings) {
|
||||
if (ingestSettings == null) {
|
||||
ingestSettings = new MalwareIngestSettings();
|
||||
}
|
||||
this.fileUploadCheckbox.setSelected(ingestSettings.isUploadFiles());
|
||||
}
|
||||
|
||||
private synchronized void setLicenseDisplay(LicenseInfo licenseInfo, String licenseMessage) {
|
||||
this.licenseInfo = licenseInfo;
|
||||
this.licenseInfoMessage = licenseMessage;
|
||||
@ -695,15 +677,12 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AuthTokenResponse doInBackground() throws Exception, CTCloudException {
|
||||
protected AuthTokenResponse doInBackground() throws Exception {
|
||||
if (this.isCancelled()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
|
||||
return ctApiDAO.getAuthToken(decryptedLicense);
|
||||
} catch (CTCloudException ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2023 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 com.basistech.df.cybertriage.autopsy.ctoptions.ctcloud;
|
||||
|
||||
/**
|
||||
* Settings for the malware ingest module.
|
||||
*/
|
||||
public class MalwareIngestSettings {
|
||||
|
||||
private boolean uploadFiles = true;
|
||||
|
||||
public boolean isUploadFiles() {
|
||||
return uploadFiles;
|
||||
}
|
||||
|
||||
public MalwareIngestSettings setUploadFiles(boolean uploadFiles) {
|
||||
this.uploadFiles = uploadFiles;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
@ -207,7 +207,7 @@ class MalwareScanIngestModule implements FileIngestModule {
|
||||
}
|
||||
|
||||
// determine lookups remaining
|
||||
boolean uploadFiles = ctSettingsPersistence.loadMalwareIngestSettings().isUploadFiles();
|
||||
boolean uploadFiles = true;
|
||||
if (uploadFiles) {
|
||||
long uploadsRemaining = remaining(authTokenResponse.getFileUploadLimit(), authTokenResponse.getFileUploadCount());
|
||||
if (uploadsRemaining <= 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user