mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-21 19:35:49 +08:00
fix build
This commit is contained in:
+10
-10
@@ -2,16 +2,16 @@ name: iDescriptor CI (Linux)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- "**.cpp"
|
||||
- "**.h"
|
||||
- "**.hpp"
|
||||
- "**.cxx"
|
||||
- "**.cc"
|
||||
- "CMakeLists.txt"
|
||||
- "**.cmake"
|
||||
- ".github/workflows/ci.yml"
|
||||
# push:
|
||||
# paths:
|
||||
# - "**.cpp"
|
||||
# - "**.h"
|
||||
# - "**.hpp"
|
||||
# - "**.cxx"
|
||||
# - "**.cc"
|
||||
# - "CMakeLists.txt"
|
||||
# - "**.cmake"
|
||||
# - ".github/workflows/ci.yml"
|
||||
|
||||
env:
|
||||
QT_VERSION: "6.7.2"
|
||||
|
||||
@@ -434,6 +434,7 @@ target_include_directories(iDescriptor PRIVATE
|
||||
${IDEVICE_CPP_INCLUDE_DIR}
|
||||
${IDEVICE_FFI_INCLUDE_DIR}
|
||||
${PLIST_CPP_INCLUDE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/zupdater/src
|
||||
# System includes last
|
||||
${IDEVICE_IMPLEMENTATION_INCLUDES}
|
||||
|
||||
@@ -336,7 +336,6 @@ void AppContext::addDevice(QString udid,
|
||||
.afcClient = initResult->afcClient,
|
||||
.afc2Client = initResult->afc2Client,
|
||||
.lockdown = initResult->lockdown,
|
||||
.mutex = new std::recursive_mutex(),
|
||||
.imageMounter = initResult->imageMounter,
|
||||
.diagRelay = initResult->diagRelay,
|
||||
.locationSimulation = initResult->locationSimulation,
|
||||
@@ -423,7 +422,6 @@ void AppContext::removeDevice(QString _udid)
|
||||
delete device->heartbeatThread;
|
||||
}
|
||||
|
||||
delete device->mutex;
|
||||
delete device;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,19 +76,21 @@ DeviceInfoWidget::DeviceInfoWidget(iDescriptorDevice *device, QWidget *parent)
|
||||
|
||||
ZIconWidget *shutdownBtn = new ZIconWidget(
|
||||
QIcon(":/resources/icons/IcOutlinePowerSettingsNew.png"), "Shutdown",
|
||||
this);
|
||||
1.0, this);
|
||||
shutdownBtn->setIconSize(QSize(20, 20));
|
||||
// connect(shutdownBtn, &ZIconWidget::clicked, this,
|
||||
// [device]() { ToolboxWidget::shutdownDevice(device); });
|
||||
|
||||
ZIconWidget *restartBtn = new ZIconWidget(
|
||||
QIcon(":/resources/icons/IcTwotoneRestartAlt.png"), "Restart", this);
|
||||
ZIconWidget *restartBtn =
|
||||
new ZIconWidget(QIcon(":/resources/icons/IcTwotoneRestartAlt.png"),
|
||||
"Restart", 1.0, this);
|
||||
restartBtn->setIconSize(QSize(20, 20));
|
||||
// connect(restartBtn, &ZIconWidget::clicked, this,
|
||||
// [device]() { ToolboxWidget::restartDevice(device); });
|
||||
|
||||
ZIconWidget *recoveryBtn = new ZIconWidget(
|
||||
QIcon(":/resources/icons/HugeiconsWrench01.png"), "Recovery", this);
|
||||
ZIconWidget *recoveryBtn =
|
||||
new ZIconWidget(QIcon(":/resources/icons/HugeiconsWrench01.png"),
|
||||
"Recovery", 1.0, this);
|
||||
recoveryBtn->setIconSize(QSize(20, 20));
|
||||
// connect(recoveryBtn, &ZIconWidget::clicked, this,
|
||||
// [device]() { ToolboxWidget::_enterRecoveryMode(device); });
|
||||
|
||||
@@ -61,7 +61,7 @@ void DeviceSidebarItem::setupUI()
|
||||
if (m_wireless) {
|
||||
auto wirelessIcon = new ZIconLabel(
|
||||
QIcon(":/resources/icons/QlementineIconsWireless116.png"),
|
||||
"Wireless", this);
|
||||
"Wireless", 1.0, this);
|
||||
nameLayout->setSpacing(5);
|
||||
nameLayout->addWidget(wirelessIcon);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ QUuid ExportManager::startExport(iDescriptorDevice *device,
|
||||
{
|
||||
qDebug() << "startExport() entry - items:" << items.size()
|
||||
<< "dest:" << destinationPath;
|
||||
if (!device || !device->mutex) {
|
||||
if (!device) {
|
||||
qWarning() << "Invalid device provided to ExportManager";
|
||||
return QUuid();
|
||||
}
|
||||
@@ -157,4 +157,4 @@ void ExportManager::cleanupJob(const QUuid &jobId)
|
||||
// m_activeJobs.erase(it);
|
||||
// qDebug() << "Cleaned up export job" << jobId;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -76,6 +76,8 @@
|
||||
|
||||
#define HEARTBEAT_RETRY_LIMIT 2
|
||||
|
||||
#define DONATE_URL "https://opencollective.com/idescriptor"
|
||||
|
||||
#ifdef __linux__
|
||||
#define LOCKDOWN_PATH "/var/lib/lockdown"
|
||||
#elif __APPLE__
|
||||
@@ -219,7 +221,7 @@ struct iDescriptorDevice {
|
||||
// nullptr if the device is not jailbroken or doesn't have AFC2 installed
|
||||
AfcClientHandle *afc2Client;
|
||||
LockdowndClientHandle *lockdown;
|
||||
std::recursive_mutex *mutex;
|
||||
mutable std::recursive_mutex mutex;
|
||||
ImageMounterHandle *imageMounter;
|
||||
std::shared_ptr<DiagnosticsRelay> diagRelay;
|
||||
LocationSimulationHandle *locationSimulation;
|
||||
|
||||
+4
-12
@@ -73,7 +73,7 @@ public:
|
||||
std::function<T()> operation,
|
||||
std::optional<AfcClientHandle *> altAfc = std::nullopt)
|
||||
{
|
||||
if (!device || !device->mutex) {
|
||||
if (!device) {
|
||||
qDebug() << "[executeOperation] Device or mutex is null";
|
||||
return T{}; // Return default-constructed value for the type
|
||||
}
|
||||
@@ -152,12 +152,12 @@ public:
|
||||
AfcFileHandle *handle)
|
||||
{
|
||||
try {
|
||||
if (!device || !device->mutex) {
|
||||
if (!device) {
|
||||
// FIXME: we have to free error
|
||||
return new IdeviceFfiError{1, "DEVICE_OR_MUTEX_IS_NULL"};
|
||||
}
|
||||
|
||||
std::lock_guard<std::recursive_mutex> lock(*device->mutex);
|
||||
std::lock_guard<std::recursive_mutex> lock(device->mutex);
|
||||
|
||||
// Double-check device is still valid after acquiring lock
|
||||
if (!device->afcClient) {
|
||||
@@ -181,21 +181,13 @@ public:
|
||||
std::optional<AfcClientHandle *> altAfc = std::nullopt)
|
||||
{
|
||||
try {
|
||||
if (!device || !device->mutex) {
|
||||
if (!device) {
|
||||
// FIXME: we have to free error
|
||||
qDebug()
|
||||
<< "[executeAfcClientOperation] Device or mutex is null";
|
||||
return new IdeviceFfiError{1, "DEVICE_OR_MUTEX_IS_NULL"};
|
||||
}
|
||||
|
||||
std::lock_guard<std::recursive_mutex> lock(*device->mutex);
|
||||
|
||||
// Double-check device is still valid after acquiring lock
|
||||
if (!device->afcClient) {
|
||||
qDebug() << "[executeAfcClientOperation] AFC client is null";
|
||||
return new IdeviceFfiError{1, "AFC_CLIENT_IS_NULL"};
|
||||
}
|
||||
|
||||
std::lock_guard<std::recursive_mutex> lock(device->mutex);
|
||||
|
||||
// Double-check device is still valid after acquiring lock
|
||||
|
||||
+29
-1
@@ -44,6 +44,13 @@ struct iDescriptorToolWidget {
|
||||
QString iconName;
|
||||
};
|
||||
|
||||
ToolboxWidget *ToolboxWidget::sharedInstance()
|
||||
{
|
||||
static ToolboxWidget *instance = new ToolboxWidget();
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
ToolboxWidget::ToolboxWidget(QWidget *parent) : QWidget{parent}
|
||||
{
|
||||
setupUI();
|
||||
@@ -391,7 +398,7 @@ void ToolboxWidget::onCurrentDeviceChanged(const DeviceSelection &selection)
|
||||
}
|
||||
}
|
||||
|
||||
void ToolboxWidget::onToolboxClicked(iDescriptorTool tool)
|
||||
void ToolboxWidget::onToolboxClicked(iDescriptorTool tool, bool requiresDevice)
|
||||
{
|
||||
// final check to make sure device is connected if required
|
||||
iDescriptorDevice *device = AppContext::sharedInstance()->getDevice(m_uuid);
|
||||
@@ -637,4 +644,25 @@ void ToolboxWidget::_enterRecoveryMode(iDescriptorDevice *device)
|
||||
// unplugged.");
|
||||
// qDebug() << "Entering recovery mode";
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
void ToolboxWidget::restartAirPlayWindow()
|
||||
{
|
||||
if (!m_airplayWindow) {
|
||||
onToolboxClicked(iDescriptorTool::Airplayer, false);
|
||||
return;
|
||||
}
|
||||
|
||||
connect(
|
||||
m_airplayWindow, &QObject::destroyed, this,
|
||||
[this]() {
|
||||
// give some time for cleanup
|
||||
QTimer::singleShot(100, this, [this]() {
|
||||
onToolboxClicked(iDescriptorTool::Airplayer, false);
|
||||
});
|
||||
},
|
||||
Qt::SingleShotConnection);
|
||||
|
||||
m_airplayWindow->close();
|
||||
}
|
||||
Reference in New Issue
Block a user