Files
setec_fs_manager/src/ui/tabs/KaliCreatorTab.h
DigiJ e3cf246d8c v1.2.0 — Linux Flasher, Kali Creator, fixed flashing & counterfeit detection
New features:
- Linux Flasher tab: download+decompress+flash pipeline for RPi OS, Ubuntu,
  Debian, Fedora, Kali, DietPi, Alpine, Arch ARM with built-in image catalog
- Kali Creator tab: 4 sub-tabs for USB/SD, VM creation, Docker/Podman
  container pulls, and cloud image downloads
- DownloadManager: async downloads with resume support and speed tracking
- Decompressor: streaming .xz (xz-embedded), .gz (zlib), .zip decompression
- ImageCatalog: built-in catalog + remote fetch from rpi-imager JSON endpoint
- SevenZipExtractor: QProcess wrapper for 7z.exe with progress parsing
- Bundled xz-embedded third-party library for native XZ decompression

Bug fixes:
- Fixed VirtualDisk::flashToDisk() — added FSCTL_ALLOW_EXTENDED_DASD_IO,
  FSCTL_LOCK_VOLUME, FSCTL_DISMOUNT_VOLUME, 32MB aligned buffers,
  WriteFile retry logic (3 attempts), FlushFileBuffers before close
- Fixed VirtualDisk::captureFromDisk() with same improvements
- Fixed ImagingTab::onFlashIso() — now populates targetVolumeLetters from
  disk snapshot so IsoFlasher can properly lock/dismount volumes
- Fixed SD card counterfeit detection false positives:
  - Changed from write-one-read-one to write-all-then-read-all algorithm
    to properly detect NAND address wrapping on fake cards
  - Added volume lock/dismount before probing to prevent filesystem
    interference (journal writes, metadata updates)
  - Added FSCTL_ALLOW_EXTENDED_DASD_IO for probes near end of disk
  - Fixed overly aggressive vendor string check — USB card readers
    legitimately report "USB"/"Mass Storage", no longer flagged
  - Added handle re-open between write and verify phases to defeat
    USB reader hardware cache
- README: documented how to unlock the secret menu, added new feature docs
2026-03-12 12:54:48 -07:00

110 lines
3.0 KiB
C++

#pragma once
#include "core/common/Types.h"
#include "core/disk/DiskEnumerator.h"
#include <QWidget>
class QCheckBox;
class QComboBox;
class QLabel;
class QLineEdit;
class QPlainTextEdit;
class QProcess;
class QProgressBar;
class QPushButton;
class QSpinBox;
class QTabWidget;
namespace spw
{
class DownloadManager;
class KaliCreatorTab : public QWidget
{
Q_OBJECT
public:
explicit KaliCreatorTab(QWidget* parent = nullptr);
~KaliCreatorTab() override;
public slots:
void refreshDisks(const SystemDiskSnapshot& snapshot);
signals:
void statusMessage(const QString& msg);
private slots:
// USB / SD Card
void onFlashToUsb();
void onUsbImageChanged(int index);
// Virtual Machine
void onCreateVmDisk();
void onBrowseVmOutput();
void onDownloadPrebuiltVm();
// Containers
void onPullContainerImage();
void onContainerRuntimeChanged(int index);
void onContainerTagChanged(int index);
// Cloud Image
void onDownloadCloudImage();
void onBrowseCloudOutput();
private:
void setupUi();
void setupUsbTab(QTabWidget* tabs);
void setupVmTab(QTabWidget* tabs);
void setupContainerTab(QTabWidget* tabs);
void setupCloudTab(QTabWidget* tabs);
void populateRemovableDrives();
void updateContainerPullPreview();
static QString formatSize(uint64_t bytes);
// USB / SD Card sub-tab
QComboBox* m_usbImageCombo = nullptr;
QComboBox* m_usbTargetCombo = nullptr;
QCheckBox* m_usbPersistCheck = nullptr;
QSpinBox* m_usbPersistSizeSpin = nullptr;
QLabel* m_usbPersistLabel = nullptr;
QProgressBar* m_usbProgress = nullptr;
QLabel* m_usbStatusLabel = nullptr;
QPushButton* m_usbFlashBtn = nullptr;
// Virtual Machine sub-tab
QComboBox* m_vmFormatCombo = nullptr;
QSpinBox* m_vmSizeSpin = nullptr;
QLineEdit* m_vmOutputEdit = nullptr;
QComboBox* m_vmVersionCombo = nullptr;
QPushButton* m_vmCreateBtn = nullptr;
QPushButton* m_vmDownloadBtn = nullptr;
QProgressBar* m_vmProgress = nullptr;
QLabel* m_vmStatusLabel = nullptr;
// Containers sub-tab
QComboBox* m_containerRuntimeCombo = nullptr;
QComboBox* m_containerTagCombo = nullptr;
QLineEdit* m_containerCmdPreview = nullptr;
QPushButton* m_containerPullBtn = nullptr;
QPlainTextEdit* m_containerLog = nullptr;
QProcess* m_containerProcess = nullptr;
// Cloud Image sub-tab
QComboBox* m_cloudFormatCombo = nullptr;
QLabel* m_cloudInfoLabel = nullptr;
QLineEdit* m_cloudOutputEdit = nullptr;
QPushButton* m_cloudDownloadBtn = nullptr;
QProgressBar* m_cloudProgress = nullptr;
QLabel* m_cloudStatusLabel = nullptr;
// Shared
SystemDiskSnapshot m_snapshot;
DownloadManager* m_downloader = nullptr;
};
} // namespace spw