bug fixes & replace idevice_get_device_version with get_device_version

This commit is contained in:
uncor3
2025-10-30 11:32:05 +00:00
parent 56d03f069a
commit 4fc2b49251
15 changed files with 68 additions and 26 deletions
+8 -1
View File
@@ -3,4 +3,11 @@ CMakeLists.txt.user
.DS_Store
AppDir
*.AppImage
build-dir
build-dir
.flatpak-builder
*.o
*.obj
*.so
*.exe
*.dll
devdiskimgs
+6 -5
View File
@@ -100,7 +100,6 @@ done
mkdir -p "$APPDIR/apprun-hooks"
export QML_MODULES_PATHS="./qml"
cat <<'EOF' > "$APPDIR/apprun-hooks/linuxdeploy-plugin-env.sh"
#!/bin/bash
@@ -111,8 +110,8 @@ export GST_PLUGIN_PATH_1_0="${APPDIR}/usr/lib/gstreamer-1.0"
export GST_PLUGIN_SCANNER_1_0="${APPDIR}/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
export GST_PTP_HELPER_1_0="${APPDIR}/usr/lib/gstreamer1.0/gstreamer-1.0/gst-ptp-helper"
export IPROXY_APPIMAGE="${APPDIR}/usr/bin/iproxy"
export IFUSE_APPIMAGE="${APPDIR}/usr/bin/ifuse"
export IPROXY_BIN_APPIMAGE="${APPDIR}/usr/bin/iproxy"
export IFUSE_BIN_APPIMAGE="${APPDIR}/usr/bin/ifuse"
EOF
chmod +x "$APPDIR/apprun-hooks/linuxdeploy-plugin-env.sh"
@@ -121,11 +120,13 @@ chmod +x "$APPDIR/apprun-hooks/linuxdeploy-plugin-env.sh"
cp iDescriptor.desktop "$APPDIR/usr/share/applications/"
export LD_LIBRARY_PATH="$APPDIR/usr/local/lib:$LD_LIBRARY_PATH"
export LINUXDEPLOY_EXCLUDED_LIBRARIES="*sql*"
export QML_SOURCES_PATHS="./qml"
./linuxdeploy-x86_64.AppImage \
--appdir ./AppDir \
--desktop-file AppDir/usr/share/applications/iDescriptor.desktop \
--plugin qt \
--plugin qt \
--exclude-library libGL,libGLX,libEGL,libOpenGL,libdrm,libva,libvdpau,libxcb,libxcb-glx,libxcb-dri2,libxcb-dri3,libX11,libXext,libXrandr,libXrender,libXfixes,libXau,libXdmcp,libqsqlmimer,libmysqlclient,libmysqlclient \
--output appimage \
--deploy-deps-only AppDir/usr/bin/ifuse
+1 -1
View File
@@ -29,7 +29,7 @@ private:
QString m_bundleId;
QLabel *m_statusLabel;
QFutureWatcher<int> *m_installWatcher;
QTemporaryDir *m_tempDir;
QTemporaryDir *m_tempDir = nullptr;
void updateDeviceList();
void performInstallation(const QString &ipaPath, const QString &deviceUdid);
};
+1 -1
View File
@@ -102,7 +102,7 @@ mobile_image_mounter_error_t mount_dev_image(const char *udid,
goto leave;
}
device_version = idevice_get_device_version(device);
device_version = get_device_version(device);
if (LOCKDOWN_E_SUCCESS != (ldret = lockdownd_client_new_with_handshake(
device, &lckd, TOOL_NAME))) {
qDebug() << "ERROR: Could not connect to lockdownd service!";
+1 -1
View File
@@ -71,7 +71,7 @@ bool set_location(idevice_t device, char *lat, char *lon)
lerr = lockdownd_start_service(lockdown, DT_SIMULATELOCATION_SERVICE,
&svc);
if (lerr != LOCKDOWN_E_SUCCESS) {
unsigned int device_version = idevice_get_device_version(device);
unsigned int device_version = get_device_version(device);
lockdownd_client_free(lockdown);
idevice_free(device);
+1 -1
View File
@@ -112,7 +112,7 @@ void DevDiskImageHelper::onMountButtonClicked()
m_isMounting = true;
// Check if we need to download first
unsigned int device_version = idevice_get_device_version(m_device->device);
unsigned int device_version = get_device_version(m_device->device);
unsigned int deviceMajorVersion = (device_version >> 16) & 0xFF;
unsigned int deviceMinorVersion = (device_version >> 8) & 0xFF;
+1 -1
View File
@@ -188,7 +188,7 @@ void DevDiskImagesWidget::displayImages()
// todo wtf is this
if (m_currentDevice && m_currentDevice->device) {
unsigned int device_version =
idevice_get_device_version(m_currentDevice->device);
get_device_version(m_currentDevice->device);
deviceMajorVersion = (device_version >> 16) & 0xFF;
deviceMinorVersion = (device_version >> 8) & 0xFF;
hasConnectedDevice = true;
+2 -2
View File
@@ -294,7 +294,7 @@ bool DevDiskManager::isImageDownloaded(const QString &version,
bool DevDiskManager::downloadCompatibleImageInternal(iDescriptorDevice *device)
{
unsigned int device_version = idevice_get_device_version(device->device);
unsigned int device_version = get_device_version(device->device);
unsigned int deviceMajorVersion = (device_version >> 16) & 0xFF;
unsigned int deviceMinorVersion = (device_version >> 8) & 0xFF;
qDebug() << "Device version:" << deviceMajorVersion << "."
@@ -381,7 +381,7 @@ bool DevDiskManager::downloadCompatibleImage(iDescriptorDevice *device)
bool DevDiskManager::mountCompatibleImageInternal(iDescriptorDevice *device)
{
unsigned int device_version = idevice_get_device_version(device->device);
unsigned int device_version = get_device_version(device->device);
unsigned int deviceMajorVersion = (device_version >> 16) & 0xFF;
unsigned int deviceMinorVersion = (device_version >> 8) & 0xFF;
+1 -1
View File
@@ -136,7 +136,7 @@ QString DeviceImageWidget::getMockupNameFromDisplayName(
int DeviceImageWidget::getIosVersionFromDevice() const
{
unsigned int version = idevice_get_device_version(m_device->device);
unsigned int version = get_device_version(m_device->device);
if (version > 0) {
int majorVersion = (version >> 16) & 0xFF;
+24 -1
View File
@@ -402,4 +402,27 @@ QByteArray read_afc_file_to_byte_array(afc_client_t afcClient,
bool isDarkMode();
instproxy_error_t install_IPA(idevice_t device, afc_client_t afc,
const char *filePath);
const char *filePath);
typedef struct _idevice_private {
char *udid;
uint32_t mux_id;
enum idevice_connection_type conn_type;
void *conn_data;
int version;
int device_class;
};
/*
we need this because idevice_get_device_version
is not always available in libimobiledevice
which could cause issues when installed from package managers
*/
inline unsigned int get_device_version(idevice_t _device)
{
_idevice_private *idevice = reinterpret_cast<_idevice_private *>(_device);
if (!idevice) {
return 0;
}
return static_cast<unsigned int>(idevice->version);
}
+9 -5
View File
@@ -109,6 +109,9 @@ void iFuseWidget::setupUI()
void iFuseWidget::updateDeviceComboBox()
{
QList<iDescriptorDevice *> devices =
AppContext::sharedInstance()->getAllDevices();
m_deviceComboBox->clear();
m_deviceComboBox->setEnabled(true);
m_mountButton->setEnabled(true);
@@ -330,21 +333,22 @@ void iFuseWidget::onProcessFinished(int exitCode,
auto *b = new iFuseDiskUnmountButton(m_currentMountPath);
MainWindow::sharedInstance()->statusBar()->addPermanentWidget(b);
QProcess *processToKill = m_ifuseProcess;
QString currentMountPath = m_currentMountPath;
connect(b, &iFuseDiskUnmountButton::clicked, this,
[b, processToKill]() {
qDebug() << "Unmounting" << m_currentMountPath;
bool ok = iFuseManager::linuxUnmount(m_currentMountPath);
[b, processToKill, currentMountPath]() {
qDebug() << "Unmounting" << currentMountPath;
bool ok = iFuseManager::linuxUnmount(currentMountPath);
if (!ok) {
QMessageBox::warning(nullptr, "Unmount Failed",
"Failed to unmount iFuse at " +
m_currentMountPath +
currentMountPath +
". Please try again.");
return;
}
MainWindow::sharedInstance()->statusBar()->removeWidget(b);
b->deleteLater();
});
QDesktopServices::openUrl(QUrl::fromLocalFile(m_currentMountPath));
QDesktopServices::openUrl(QUrl::fromLocalFile(currentMountPath));
} else {
QString errorOutput = m_ifuseProcess->readAllStandardError();
setStatusMessage("Mount failed: " + errorOutput, true);
+1 -1
View File
@@ -20,7 +20,7 @@ RealtimeScreenWidget::RealtimeScreenWidget(iDescriptorDevice *device,
{
setWindowTitle("Real-time Screen - iDescriptor");
unsigned int device_version = idevice_get_device_version(m_device->device);
unsigned int device_version = get_device_version(m_device->device);
unsigned int deviceMajorVersion = (device_version >> 16) & 0xFF;
if (deviceMajorVersion > 16) {
+9 -1
View File
@@ -45,7 +45,15 @@ QString SettingsManager::devdiskimgpath() const
// Settings implementation
QString SettingsManager::downloadPath() const
{
return m_settings->value("downloadPath", DEFAULT_DEVDISKIMGPATH).toString();
return m_settings
->value("downloadPath", SettingsManager::docsPath() + "/devdiskimages")
.toString();
}
QString SettingsManager::docsPath()
{
return QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) +
"/.idescriptor";
}
void SettingsManager::setDownloadPath(const QString &path)
+1 -1
View File
@@ -26,7 +26,7 @@ public:
Theme,
ConnectionTimeout
};
static QString docsPath();
// Existing methods
QString devdiskimgpath() const;
void clearKeys(const QString &keyPrefix);
+2 -3
View File
@@ -124,14 +124,13 @@ VirtualLocation::VirtualLocation(iDescriptorDevice *device, QWidget *parent)
});
DevDiskManager::sharedInstance()->downloadCompatibleImage(m_device);
unsigned int device_version = idevice_get_device_version(m_device->device);
unsigned int device_version = get_device_version(m_device->device);
unsigned int deviceMajorVersion = (device_version >> 16) & 0xFF;
if (deviceMajorVersion > 16) {
QMessageBox::warning(
this, "Unsupported iOS Version",
"Real-time Screen feature requires iOS 16 or earlier.\n"
"Virtual Location feature requires iOS 16 or earlier.\n"
"Your device is running iOS " +
QString::number(deviceMajorVersion) +
", which is not yet supported.");