[libimobiledevice/*] Use original upstream (#33246)

This commit is contained in:
Weihang Ding 2023-09-14 07:51:44 +08:00 committed by GitHub
parent 1ca3ee9265
commit 29151e1c19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
75 changed files with 2462 additions and 634 deletions

View File

@ -0,0 +1,47 @@
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c
index c50bacf..e4a8c3d 100644
--- a/src/ideviceinstaller.c
+++ b/src/ideviceinstaller.c
@@ -32,7 +32,9 @@
#include <getopt.h>
#include <errno.h>
#include <time.h>
+#ifndef _MSC_VER
#include <libgen.h>
+#endif
#include <inttypes.h>
#include <limits.h>
#include <sys/stat.h>
@@ -87,6 +89,32 @@ static int asprintf(char **PTR, const char *TEMPLATE, ...)
}
#endif
+#ifdef _MSC_VER
+#ifndef ISSLASH
+#define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#endif
+char *basename(char const *name) {
+ char const *base = name;
+ char const *p;
+ for (p = base; *p; p++) {
+ if (ISSLASH(*p)) {
+ do p++;
+ while (ISSLASH(*p));
+
+ if (!*p) {
+ if (ISSLASH(*base))
+ base = p - 1;
+ break;
+ }
+
+ base = p;
+ }
+ }
+
+ return (char *) base;
+}
+#endif
+
#define ITUNES_METADATA_PLIST_FILENAME "iTunesMetadata.plist"
const char PKG_PATH[] = "PublicStaging";

View File

@ -1,40 +0,0 @@
diff --git a/ideviceinstaller.vcxproj b/ideviceinstaller.vcxproj
index dd8d483..4b15d7e 100644
--- a/ideviceinstaller.vcxproj
+++ b/ideviceinstaller.vcxproj
@@ -112,7 +112,7 @@
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -126,7 +126,7 @@
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -144,7 +144,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -162,7 +162,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup>

View File

@ -0,0 +1,46 @@
cmake_minimum_required(VERSION 3.15)
project(ideviceinstaller C)
include(GNUInstallDirs)
file(GLOB_RECURSE IDEVICEINSTALLER_SOURCE src/*.c src/*.h)
set(DEFINITIONS)
list(APPEND DEFINITIONS -DPACKAGE_NAME="ideviceinstaller")
list(APPEND DEFINITIONS -DPACKAGE_VERSION="1.1.1")
list(APPEND DEFINITIONS -DPACKAGE_URL="https://github.com/libimobiledevice/ideviceinstaller")
list(APPEND DEFINITIONS -DPACKAGE_BUGREPORT="https://github.com/libimobiledevice/ideviceinstaller/issues")
if(UNIX)
list(APPEND DEFINITIONS -DHAVE_VASPRINTF)
list(APPEND DEFINITIONS -DHAVE_ASPRINTF)
list(APPEND DEFINITIONS -DHAVE_UNISTD_H)
endif()
if(WIN32)
list(APPEND DEFINITIONS -D_CRT_SECURE_NO_WARNINGS)
list(APPEND DEFINITIONS -DWIN32)
endif()
find_package(unofficial-libimobiledevice CONFIG REQUIRED)
find_package(libzip CONFIG REQUIRED)
find_path(DIRENT_INCLUDE_DIR dirent.h REQUIRED)
add_executable(ideviceinstaller ${IDEVICEINSTALLER_SOURCE})
target_include_directories(ideviceinstaller PRIVATE
${DIRENT_INCLUDE_DIR}
)
target_compile_definitions(ideviceinstaller PRIVATE ${DEFINITIONS})
target_link_libraries(ideviceinstaller PRIVATE
unofficial::libimobiledevice::libimobiledevice
libzip::zip
)
if(WIN32)
find_package(unofficial-getopt-win32 REQUIRED)
target_link_libraries(ideviceinstaller PRIVATE unofficial::getopt-win32::getopt)
endif()
install(TARGETS ideviceinstaller
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

View File

@ -1,19 +1,24 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libimobiledevice-win32/ideviceinstaller
REF ${VERSION}
SHA512 d0801b3a38eb02206a6f06e05cc19b794c69a87c06895165f64522c61e07030046499c5f0e436981682f9e17f91eae87913cca091e2e039a74ee35a5136100d4
HEAD_REF msvc-master
PATCHES Add-missing-lib.patch
REPO libimobiledevice/ideviceinstaller
REF b9cfe0b264f66eab9ad88e11eb6b0523cb1de911 # commits on 2023-07-21
SHA512 a78418001109593f2d704d91aff8df009e15c504c2139ca606c9719b70868466ef73778d52670468a4b7bf758ec65435c1b981c27809a2e22737f7587ad51c7d
HEAD_REF master
PATCHES
001_fix_windows.patch
)
vcpkg_msbuild_install(
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
PROJECT_SUBPATH ideviceinstaller.vcxproj
DEPENDENT_PKGCONFIG libimobiledevice-1.0 libzip
ADDITIONAL_LIBS getopt.lib
)
vcpkg_cmake_install()
vcpkg_copy_tools(TOOL_NAMES ideviceinstaller AUTO_CLEAN)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)

View File

@ -1,21 +1,18 @@
{
"name": "ideviceinstaller",
"version": "1.1.2.23",
"port-version": 7,
"version-date": "2023-07-21",
"description": "Manage apps of iOS devices",
"homepage": "https://libimobiledevice.org/",
"license": "LGPL-2.1-only",
"supports": "windows & !arm64 & !xbox",
"license": "LGPL-2.0-or-later",
"supports": "!uwp & !android & !ios & !xbox",
"dependencies": [
"dirent",
"getopt",
"libimobiledevice",
"libzip",
{
"name": "vcpkg-msbuild",
"host": true,
"features": [
"pkg-config"
],
"platform": "windows"
"name": "vcpkg-cmake",
"host": true
}
]
}

View File

@ -0,0 +1,59 @@
cmake_minimum_required(VERSION 3.15)
project(idevicerestore C)
include(GNUInstallDirs)
file(GLOB_RECURSE IDEVICERESTORE_SOURCE src/*.c src/*.h)
list(FILTER IDEVICERESTORE_SOURCE EXCLUDE REGEX "sha(1|512)\\.(c|h)$")
set(DEFINITIONS)
list(APPEND DEFINITIONS -DPACKAGE_NAME="idevicerestore")
list(APPEND DEFINITIONS -DPACKAGE_VERSION="1.0.0")
list(APPEND DEFINITIONS -DPACKAGE_URL="https://github.com/libimobiledevice/idevicerestore")
list(APPEND DEFINITIONS -DPACKAGE_BUGREPORT="https://github.com/libimobiledevice/idevicerestore/issues")
list(APPEND DEFINITIONS -DHAVE_REVERSE_PROXY)
list(APPEND DEFINITIONS -DHAVE_OPENSSL)
if(UNIX)
list(APPEND DEFINITIONS -DHAVE_REALPATH)
endif()
if(WIN32)
list(APPEND DEFINITIONS -D_CRT_SECURE_NO_WARNINGS)
list(APPEND DEFINITIONS -DWIN32)
endif()
find_package(CURL CONFIG REQUIRED)
find_package(unofficial-libimobiledevice CONFIG REQUIRED)
find_package(unofficial-libimobiledevice-glue CONFIG REQUIRED)
find_package(unofficial-libirecovery CONFIG REQUIRED)
find_package(libzip CONFIG REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(ZLIB REQUIRED)
find_path(DIRENT_INCLUDE_DIR dirent.h REQUIRED)
add_executable(idevicerestore ${IDEVICERESTORE_SOURCE})
target_include_directories(idevicerestore PRIVATE
${DIRENT_INCLUDE_DIR}
)
target_compile_definitions(idevicerestore PRIVATE ${DEFINITIONS})
target_link_libraries(idevicerestore PRIVATE
CURL::libcurl
unofficial::libimobiledevice::libimobiledevice
unofficial::libimobiledevice-glue::libimobiledevice-glue
unofficial::libirecovery::libirecovery
libzip::zip
OpenSSL::SSL
OpenSSL::Crypto
ZLIB::ZLIB
)
if(WIN32)
find_package(unofficial-getopt-win32 REQUIRED)
target_link_libraries(idevicerestore PRIVATE unofficial::getopt-win32::getopt)
endif()
install(TARGETS idevicerestore
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

View File

@ -1,32 +0,0 @@
diff --git a/src/common.c b/src/common.c
index afe1bc0..9219a8f 100644
--- a/src/common.c
+++ b/src/common.c
@@ -29,7 +29,9 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
+#ifndef _MSC_VER
#include <libgen.h>
+#endif
#include <time.h>
#include "common.h"
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index efa13c3..c17a2ba 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -38,12 +38,12 @@
#include <string.h>
#ifndef _MSC_VER
#include <unistd.h>
+#include <libgen.h>
#endif
#include <ctype.h>
#include <getopt.h>
#include <plist/plist.h>
#include <zlib.h>
-#include <libgen.h>
#include <curl/curl.h>

View File

@ -1,44 +0,0 @@
diff --git a/idevicerestore.vcxproj b/idevicerestore.vcxproj
index fa209fa..6afa088 100644
--- a/idevicerestore.vcxproj
+++ b/idevicerestore.vcxproj
@@ -92,9 +92,10 @@
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_WINSOCK_DEPRECATED_NO_WARNINGS</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
- <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl-d.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -103,9 +104,10 @@
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_WINSOCK_DEPRECATED_NO_WARNINGS</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
- <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl-d.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -116,6 +118,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_WINSOCK_DEPRECATED_NO_WARNINGS</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -131,6 +134,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_WINSOCK_DEPRECATED_NO_WARNINGS</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>

View File

@ -1,21 +1,22 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libimobiledevice-win32/idevicerestore
REF 1.0.12
SHA512 ba623be56c2f37853516d7d4c32e16f1ec72f33d512f18aa812ce6830af4b9e389f7af5321888dd0ddd168e282b652e379b60f90970680e213eabf489f406915
HEAD_REF msvc-master
PATCHES
fix-vcxproj.patch
fix-libgen.h-cannot-be-found.patch
REPO libimobiledevice/idevicerestore
REF 609f7f058487596597e8e742088119fdd46729df # commits on 2023-05-23
SHA512 9427c438d1967f1717424dd1d1b789d3d139b3fcacee15911e531d6377039927c147150dafacd251b92d57134e72c49de6e1a053fcd63f14c780e60dc5b13fc5
HEAD_REF master
)
vcpkg_msbuild_install(
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
PROJECT_SUBPATH idevicerestore.vcxproj
DEPENDENT_PKGCONFIG libimobiledevice-1.0 libzip zlib openssl
ADDITIONAL_LIBS getopt.lib irecovery.lib
)
vcpkg_cmake_install()
vcpkg_copy_tools(TOOL_NAMES idevicerestore AUTO_CLEAN)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)

View File

@ -1,21 +1,23 @@
{
"name": "idevicerestore",
"version": "1.0.12",
"port-version": 8,
"version-date": "2023-05-23",
"description": "Restore/upgrade firmware of iOS devices",
"supports": "windows",
"homepage": "https://libimobiledevice.org/",
"license": "LGPL-3.0-or-later",
"supports": "(!windows & !android & !ios) | mingw",
"dependencies": [
"curl",
"dirent",
"getopt",
"libimobiledevice",
"libimobiledevice-glue",
"libirecovery",
"libzip",
"openssl",
{
"name": "vcpkg-msbuild",
"host": true,
"features": [
"pkg-config"
],
"platform": "windows"
}
"name": "vcpkg-cmake",
"host": true
},
"zlib"
]
}

View File

@ -0,0 +1,21 @@
diff --git a/src/activation.c b/src/activation.c
index 4260c20..29bb2e8 100644
--- a/src/activation.c
+++ b/src/activation.c
@@ -90,6 +90,7 @@ struct idevice_activation_response_private {
int has_errors;
};
+#ifndef LIBIDEVICEACTIVATION_STATIC // disable dll constructor
static void internal_libideviceactivation_init(void)
{
@@ -162,6 +163,8 @@ BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved)
#warning No compiler support for constructor/destructor attributes, some features might not be available.
#endif
+#endif // disable dll constructor
+
static int debug_level = 0;
IDEVICE_ACTIVATION_API void idevice_activation_set_debug_level(int level) {

View File

@ -0,0 +1,21 @@
diff --git a/src/activation.c b/src/activation.c
index 29bb2e8..69ec7b4 100644
--- a/src/activation.c
+++ b/src/activation.c
@@ -32,15 +32,11 @@
#include <libxml/HTMLtree.h>
#include <curl/curl.h>
-#ifdef WIN32
-#define IDEVICE_ACTIVATION_API __declspec( dllexport )
-#else
-#ifdef HAVE_FVISIBILITY
+#if !defined(_WIN32) && !defined(LIBIDEVICEACTIVATION_STATIC)
#define IDEVICE_ACTIVATION_API __attribute__((visibility("default")))
#else
#define IDEVICE_ACTIVATION_API
#endif
-#endif
#ifdef WIN32
#include <windows.h>

View File

@ -1,39 +1,80 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.15)
project(libideviceactivation C)
# find dependencies
find_library(libplist NAMES plist plist-2.0 libplist libplist-2.0 REQUIRED)
find_path(libimobiledevice_INCLUDES endianness.h)
find_library(libimobiledevice NAMES imobiledevice imobiledevice-1.0 libimobiledevice libimobiledevice-1.0 REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(CURL REQUIRED)
include(GNUInstallDirs)
# ready to create library
file(GLOB_RECURSE IDVCACTV_TOOLS_SRC common/*.c)
file(GLOB_RECURSE LIBIDEVICEACTIVATION_HEADER include/*.h)
file(GLOB_RECURSE LIBIDEVICEACTIVATION_SOURCE src/*.c)
file(GLOB_RECURSE IDVCACTV_PUBLIC_HDR include/*.h)
file(GLOB_RECURSE IDVCACTV_SRC src/*.c)
set(DEFINITIONS)
add_library(libideviceactivation ${IDVCACTV_TOOLS_SRC} ${IDVCACTV_SRC} ${IDVCACTV_PUBLIC_HDR})
target_include_directories(libideviceactivation PRIVATE ${libimobiledevice_INCLUDES} ${LIBXML2_INCLUDE_DIR} ${CURL_INCLUDE_DIRS} include)
target_compile_definitions(libideviceactivation PRIVATE -DHAVE_OPENSSL)
target_link_libraries(libideviceactivation PRIVATE ${libplist} ${libimobiledevice} ${CURL_LIBRARIES} ${LIBXML2_LIBRARIES})
if(BUILD_SHARED_LIBS)
if(WIN32)
list(APPEND LIBIDEVICEACTIVATION_SOURCE exports.def)
endif()
else()
list(APPEND DEFINITIONS -DLIBIDEVICEACTIVATION_STATIC)
endif()
# install
install(
TARGETS libideviceactivation
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
if(WIN32)
list(APPEND DEFINITIONS -D_CRT_SECURE_NO_WARNINGS)
list(APPEND DEFINITIONS -DWIN32)
endif()
find_package(unofficial-libplist CONFIG REQUIRED)
find_package(unofficial-libimobiledevice CONFIG REQUIRED)
find_package(CURL CONFIG REQUIRED)
find_package(LibXml2 CONFIG REQUIRED)
add_library(libideviceactivation ${LIBIDEVICEACTIVATION_SOURCE})
target_include_directories(libideviceactivation
PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
PUBLIC
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_compile_definitions(libideviceactivation PRIVATE ${DEFINITIONS})
target_link_libraries(libideviceactivation
PRIVATE
CURL::libcurl
LibXml2::LibXml2
PUBLIC
unofficial::libplist::libplist
unofficial::libimobiledevice::libimobiledevice
)
set_target_properties(libideviceactivation PROPERTIES OUTPUT_NAME ideviceactivation-1.0)
install(TARGETS libideviceactivation EXPORT unofficial-libideviceactivation)
install(
EXPORT unofficial-libideviceactivation
FILE unofficial-libideviceactivation-config.cmake
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/unofficial-libideviceactivation"
NAMESPACE unofficial::libideviceactivation::
)
install(
FILES ${LIBIDEVICEACTIVATION_HEADER}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
set(LIBPLIST_VERSION 2.0)
set(LIBIMOBILEDEVICE_VERSION 1.0)
set(LIBCURL_VERSION 7.0)
set(LIBXML2_VERSION 2.0)
set(PACKAGE_NAME libideviceactivation)
set(PACKAGE_VERSION 1.0)
set(prefix "")
set(exec_prefix "\${prefix}")
set(libdir "\${prefix}/lib")
set(includedir "\${prefix}/include")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/libideviceactivation-1.0.pc.in
${CMAKE_CURRENT_BINARY_DIR}/libideviceactivation-1.0.pc
"${CMAKE_CURRENT_SOURCE_DIR}/src/libideviceactivation-1.0.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/libideviceactivation-1.0.pc"
@ONLY
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/libideviceactivation-1.0.pc
DESTINATION lib/pkgconfig
FILES "${CMAKE_CURRENT_BINARY_DIR}/libideviceactivation-1.0.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
)
install(FILES ${IDVCACTV_PUBLIC_HDR} DESTINATION include)

View File

@ -0,0 +1,31 @@
EXPORTS
idevice_activation_set_debug_level
idevice_activation_request_new
idevice_activation_request_new_from_lockdownd
idevice_activation_drm_handshake_request_new
idevice_activation_request_free
idevice_activation_request_get_fields
idevice_activation_request_set_fields
idevice_activation_request_set_fields_from_response
idevice_activation_request_set_field
idevice_activation_request_get_field
idevice_activation_request_get_url
idevice_activation_request_set_url
idevice_activation_response_new
idevice_activation_response_new_from_html
idevice_activation_response_to_buffer
idevice_activation_response_free
idevice_activation_response_get_field
idevice_activation_response_get_fields
idevice_activation_response_get_label
idevice_activation_response_get_placeholder
idevice_activation_response_get_title
idevice_activation_response_get_description
idevice_activation_response_get_activation_record
idevice_activation_response_get_headers
idevice_activation_response_is_activation_acknowledged
idevice_activation_response_is_authentication_required
idevice_activation_response_field_requires_input
idevice_activation_response_field_secure_input
idevice_activation_response_has_errors
idevice_activation_send_request

View File

@ -1,21 +1,36 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libimobiledevice-win32/libideviceactivation
REF fbe0476cfeddc2fc317ceb900eec12302c1d4c11 # v1.3.17
SHA512 18fdf1b42744da33e0f0f037e83a72b76cc0b63a0b712e78d9736adcde113582327f3712bc2bfa7b6fdb692465700a9106286f383fd7d11f9351ca7939b20e24
HEAD_REF msvc-master
REPO libimobiledevice/libideviceactivation
REF 067c439e0b18d6f1c8a37dde791f9d91191a922e # commits on 2023-05-01
SHA512 0afd74720abc6a1e47e035243879d291444b27667ce0a1908a4e66fea92185ff002e5390a1911ae95dc05d0bb0518a0043c77b531edcc5ac8b59c913aea9d487
HEAD_REF master
PATCHES
001_fix_static_build.patch
002_fix_api.patch
)
configure_file("${CURRENT_PORT_DIR}/CMakeLists.txt" "${SOURCE_PATH}/CMakeLists.txt" COPYONLY)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/exports.def" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT})
vcpkg_fixup_pkgconfig()
file(READ "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake" cmake_config)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake"
"include(CMakeFindDependencyMacro)
find_dependency(unofficial-libplist CONFIG)
find_dependency(unofficial-libimobiledevice CONFIG)
find_dependency(CURL CONFIG)
find_dependency(LibXml2 CONFIG)
${cmake_config}
")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
# Handle copyright
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

View File

@ -0,0 +1,4 @@
libideviceactivation provides CMake targets:
find_package(unofficial-libideviceactivation CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::libideviceactivation::libideviceactivation)

View File

@ -1,7 +1,10 @@
{
"name": "libideviceactivation",
"version": "1.3.17",
"version-date": "2023-05-01",
"description": "A library to handle the activation process of iOS devices",
"homepage": "https://libimobiledevice.org/",
"license": "LGPL-2.1-or-later",
"supports": "!uwp",
"dependencies": [
"curl",
"libimobiledevice",
@ -10,6 +13,10 @@
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -0,0 +1,57 @@
diff --git a/include/libimobiledevice-glue/socket.h b/include/libimobiledevice-glue/socket.h
index 53f58b8..f3cc6c6 100644
--- a/include/libimobiledevice-glue/socket.h
+++ b/include/libimobiledevice-glue/socket.h
@@ -32,7 +32,7 @@ enum fd_mode {
};
typedef enum fd_mode fd_mode;
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#define SHUT_RD SD_READ
#define SHUT_WR SD_WRITE
@@ -41,7 +41,7 @@ typedef enum fd_mode fd_mode;
#include <sys/socket.h>
#endif
-#ifndef WIN32
+#ifndef _WIN32
int socket_create_unix(const char *filename);
int socket_connect_unix(const char *filename);
#endif
diff --git a/include/libimobiledevice-glue/thread.h b/include/libimobiledevice-glue/thread.h
index 2aadc6e..b5c2ac1 100644
--- a/include/libimobiledevice-glue/thread.h
+++ b/include/libimobiledevice-glue/thread.h
@@ -24,7 +24,7 @@
#include <stddef.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
typedef HANDLE THREAD_T;
typedef CRITICAL_SECTION mutex_t;
@@ -61,7 +61,7 @@ int thread_alive(THREAD_T thread);
int thread_cancel(THREAD_T thread);
-#ifdef WIN32
+#ifdef _WIN32
#undef HAVE_THREAD_CLEANUP
#else
#ifdef HAVE_PTHREAD_CANCEL
diff --git a/include/libimobiledevice-glue/utils.h b/include/libimobiledevice-glue/utils.h
index 1a21871..2421270 100644
--- a/include/libimobiledevice-glue/utils.h
+++ b/include/libimobiledevice-glue/utils.h
@@ -29,7 +29,7 @@
#include <config.h>
#endif
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#endif

View File

@ -0,0 +1,47 @@
diff --git a/src/socket.c b/src/socket.c
index 4b8b857..4cf8a92 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -26,10 +26,12 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <errno.h>
-#include <sys/time.h>
#include <sys/stat.h>
+#ifndef _MSC_VER
+#include <unistd.h>
+#include <sys/time.h>
+#endif
#ifdef WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
diff --git a/src/termcolors.c b/src/termcolors.c
index 5c436f2..9a84ff2 100644
--- a/src/termcolors.c
+++ b/src/termcolors.c
@@ -28,7 +28,9 @@
#include <stdio.h>
#include <stdlib.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <string.h>
#include <stdarg.h>
diff --git a/src/utils.c b/src/utils.c
index ad8e9c4..b9803ac 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -30,7 +30,9 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#ifndef _MSC_VER
#include <sys/time.h>
+#endif
#include <inttypes.h>
#include <ctype.h>
#include <errno.h>

View File

@ -0,0 +1,19 @@
diff --git a/src/glue.c b/src/glue.c
index 7970679..bad3269 100644
--- a/src/glue.c
+++ b/src/glue.c
@@ -29,6 +29,8 @@
#include "common.h"
#include "libimobiledevice-glue/thread.h"
+#ifndef LIBIMOBILEDEVICEGLUE_STATIC // disable dll constructor
+
extern void term_colors_init();
static void internal_glue_init(void)
@@ -78,3 +80,5 @@ BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved)
#else
#warning No compiler support for constructor/destructor attributes, some features might not be available.
#endif
+
+#endif // disable dll constructor

View File

@ -0,0 +1,20 @@
diff --git a/src/common.h b/src/common.h
index bd22e3d..144a799 100644
--- a/src/common.h
+++ b/src/common.h
@@ -25,14 +25,10 @@
#include <config.h>
#endif
-#ifdef WIN32
-#define LIBIMOBILEDEVICE_GLUE_API __declspec( dllexport )
-#else
-#ifdef HAVE_FVISIBILITY
+#if !defined(_WIN32) && !defined(LIBIMOBILEDEVICEGLUE_STATIC)
#define LIBIMOBILEDEVICE_GLUE_API __attribute__((visibility("default")))
#else
#define LIBIMOBILEDEVICE_GLUE_API
#endif
-#endif
#endif

View File

@ -0,0 +1,77 @@
cmake_minimum_required(VERSION 3.15)
project(libimobiledevice-glue C CXX)
include(GNUInstallDirs)
file(GLOB_RECURSE LIBIMOBILEDEVICEGLUE_SOURCE src/*.c)
set(DEFINITIONS)
if(BUILD_SHARED_LIBS)
if(WIN32)
list(APPEND LIBIMOBILEDEVICEGLUE_SOURCE exports.def)
endif()
else()
list(APPEND DEFINITIONS -DLIBIMOBILEDEVICEGLUE_STATIC)
endif()
if(UNIX)
list(APPEND DEFINITIONS -DHAVE_GETIFADDRS)
endif()
if(WIN32)
list(APPEND DEFINITIONS -D_CRT_SECURE_NO_WARNINGS)
list(APPEND DEFINITIONS -DWIN32)
endif()
find_package(unofficial-libplist CONFIG REQUIRED)
add_library(libimobiledevice-glue ${LIBIMOBILEDEVICEGLUE_SOURCE})
target_include_directories(libimobiledevice-glue
PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
PUBLIC
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_compile_definitions(libimobiledevice-glue PRIVATE ${DEFINITIONS})
target_link_libraries(libimobiledevice-glue
PUBLIC
unofficial::libplist::libplist
)
set_target_properties(libimobiledevice-glue PROPERTIES OUTPUT_NAME imobiledevice-glue-1.0)
if(WIN32)
target_link_libraries(libimobiledevice-glue PRIVATE Ws2_32 Iphlpapi)
endif()
install(TARGETS libimobiledevice-glue EXPORT unofficial-libimobiledevice-glue)
install(
EXPORT unofficial-libimobiledevice-glue
FILE unofficial-libimobiledevice-glue-config.cmake
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/unofficial-libimobiledevice-glue"
NAMESPACE unofficial::libimobiledevice-glue::
)
install(
DIRECTORY "${CMAKE_SOURCE_DIR}/include/libimobiledevice-glue"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
set(LIBPLIST_VERSION 2.0)
set(PACKAGE_NAME libimobiledevice-glue)
set(PACKAGE_VERSION 1.0)
set(prefix "")
set(exec_prefix "\${prefix}")
set(libdir "\${prefix}/lib")
set(includedir "\${prefix}/include")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/src/libimobiledevice-glue-1.0.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/libimobiledevice-glue-1.0.pc"
@ONLY
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/libimobiledevice-glue-1.0.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
)

View File

@ -0,0 +1,81 @@
EXPORTS
; src/cbuf.c
char_buf_new
char_buf_free
char_buf_append
; src/collention.c
collection_init
collection_free
collection_add
collection_remove
collection_count
collection_copy
; opack.c
opack_encode_from_plist
opack_decode_to_plist
; src/socket.c
socket_set_verbose
socket_addr_to_string
;socket_create_unix
;socket_connect_unix
socket_create
get_primary_mac_address
socket_connect_addr
socket_connect
socket_check_fd
socket_accept
socket_shutdown
socket_close
socket_receive
socket_peek
socket_receive_timeout
socket_send
socket_get_socket_port
; src/termcolors.c
term_colors_init
term_colors_set_enabled
cvfprintf
cfprintf
cprintf
; src/thread.c
thread_new
thread_detach
thread_free
thread_join
thread_alive
thread_cancel
mutex_init
mutex_destroy
mutex_lock
mutex_unlock
thread_once
cond_init
cond_destroy
cond_signal
cond_wait
cond_wait_timeout
; src/tlv.c
tlv_buf_new
tlv_buf_free
tlv_buf_append
tlv_get_data_ptr
tlv_data_get_uint
tlv_data_get_uint8
tlv_data_copy_data
; src/utils.c
string_concat
string_append
string_build_path
string_format_size
string_toupper
generate_uuid
buffer_read_from_filename
buffer_write_to_filename

View File

@ -0,0 +1,35 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libimobiledevice/libimobiledevice-glue
REF 214bafdde6a1434ead87357afe6cb41b32318495 # commits on 2023-05-13
SHA512 a12ace7690ebab0ac6372f61e1a6722d506bc20a89130f39441af4da74e8fe9cdae45d947eb3e864a5f043b621432b59418f8e4660857e25b648a9476c552ac6
HEAD_REF master
PATCHES
001_fix_win32_defs.patch
002_fix_msvc.patch
003_fix_static_build.patch
004_fix_api.patch
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/exports.def" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT})
vcpkg_fixup_pkgconfig()
file(READ "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake" cmake_config)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake"
"include(CMakeFindDependencyMacro)
find_dependency(unofficial-libplist CONFIG)
${cmake_config}
")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

View File

@ -0,0 +1,4 @@
libimobiledevice-glue provides CMake targets:
find_package(unofficial-libimobiledevice-glue CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::libimobiledevice-glue::libimobiledevice-glue)

View File

@ -0,0 +1,18 @@
{
"name": "libimobiledevice-glue",
"version-date": "2023-05-13",
"description": "Library with common code used by the libraries and tools around the libimobiledevice project.",
"homepage": "https://libimobiledevice.org/",
"license": "LGPL-2.1-or-later",
"dependencies": [
"libplist",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -0,0 +1,327 @@
diff --git a/common/userpref.c b/common/userpref.c
index b64c703..7ff325c 100644
--- a/common/userpref.c
+++ b/common/userpref.c
@@ -35,7 +35,9 @@
#ifndef WIN32
#include <pwd.h>
#endif
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <usbmuxd.h>
#if defined(HAVE_OPENSSL)
#include <openssl/bn.h>
@@ -65,7 +67,9 @@
#endif
#include <dirent.h>
+#ifndef _MSC_VER
#include <libgen.h>
+#endif
#include <sys/stat.h>
#include <errno.h>
diff --git a/include/libimobiledevice/libimobiledevice.h b/include/libimobiledevice/libimobiledevice.h
index 6851145..55ef753 100644
--- a/include/libimobiledevice/libimobiledevice.h
+++ b/include/libimobiledevice/libimobiledevice.h
@@ -30,6 +30,11 @@
extern "C" {
#endif
+#if defined(_MSC_VER)
+#include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+#endif
+
#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/src/afc.c b/src/afc.c
index d8c3db0..ab2c4ff 100644
--- a/src/afc.c
+++ b/src/afc.c
@@ -26,7 +26,9 @@
#endif
#include <stdio.h>
#include <stdlib.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <string.h>
#include "afc.h"
diff --git a/src/house_arrest.c b/src/house_arrest.c
index ac92130..e12bde5 100644
--- a/src/house_arrest.c
+++ b/src/house_arrest.c
@@ -24,7 +24,9 @@
#endif
#include <string.h>
#include <stdlib.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <plist/plist.h>
#include "house_arrest.h"
diff --git a/src/installation_proxy.c b/src/installation_proxy.c
index 9602876..2f02514 100644
--- a/src/installation_proxy.c
+++ b/src/installation_proxy.c
@@ -26,7 +26,9 @@
#include <string.h>
#include <stdlib.h>
#include <inttypes.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <plist/plist.h>
#include "installation_proxy.h"
diff --git a/src/lockdown-cu.c b/src/lockdown-cu.c
index d8d7f42..eb11afa 100644
--- a/src/lockdown-cu.c
+++ b/src/lockdown-cu.c
@@ -29,7 +29,9 @@
#define __USE_GNU 1
#include <stdio.h>
#include <ctype.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <plist/plist.h>
#include "idevice.h"
diff --git a/src/lockdown.c b/src/lockdown.c
index 92af186..a9b9b88 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -32,7 +32,9 @@
#define __USE_GNU 1
#include <stdio.h>
#include <ctype.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <plist/plist.h>
#include <libimobiledevice-glue/utils.h>
diff --git a/src/misagent.c b/src/misagent.c
index af925f9..5fe618e 100644
--- a/src/misagent.c
+++ b/src/misagent.c
@@ -24,7 +24,9 @@
#endif
#include <string.h>
#include <stdlib.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <plist/plist.h>
#include <stdio.h>
diff --git a/src/mobile_image_mounter.c b/src/mobile_image_mounter.c
index 9ccfd85..c4f540c 100644
--- a/src/mobile_image_mounter.c
+++ b/src/mobile_image_mounter.c
@@ -24,7 +24,9 @@
#endif
#include <string.h>
#include <stdlib.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <plist/plist.h>
#include "mobile_image_mounter.h"
diff --git a/src/notification_proxy.c b/src/notification_proxy.c
index e17e2fe..679739c 100644
--- a/src/notification_proxy.c
+++ b/src/notification_proxy.c
@@ -24,7 +24,9 @@
#endif
#include <string.h>
#include <stdlib.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <plist/plist.h>
#include "notification_proxy.h"
diff --git a/src/sbservices.c b/src/sbservices.c
index ccb7c4b..f0b832e 100644
--- a/src/sbservices.c
+++ b/src/sbservices.c
@@ -24,7 +24,9 @@
#endif
#include <string.h>
#include <stdlib.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <plist/plist.h>
#include "sbservices.h"
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c
index 5694c12..d360cd3 100644
--- a/tools/idevicebackup.c
+++ b/tools/idevicebackup.c
@@ -50,7 +50,9 @@
#else
#error No supported crypto library enabled
#endif
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <ctype.h>
#include <time.h>
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c
index c73b269..ffb35d1 100644
--- a/tools/idevicebackup2.c
+++ b/tools/idevicebackup2.c
@@ -31,9 +31,13 @@
#include <errno.h>
#include <stdlib.h>
#include <signal.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <dirent.h>
+#ifndef _MSC_VER
#include <libgen.h>
+#endif
#include <ctype.h>
#include <time.h>
#include <getopt.h>
diff --git a/tools/idevicebtlogger.c b/tools/idevicebtlogger.c
index 8de6b22..8fbf40d 100644
--- a/tools/idevicebtlogger.c
+++ b/tools/idevicebtlogger.c
@@ -31,7 +31,9 @@
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <getopt.h>
#include <assert.h>
#include <fcntl.h>
diff --git a/tools/idevicecrashreport.c b/tools/idevicecrashreport.c
index 09bd537..f75ad9d 100644
--- a/tools/idevicecrashreport.c
+++ b/tools/idevicecrashreport.c
@@ -29,7 +29,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <getopt.h>
#ifndef WIN32
#include <signal.h>
diff --git a/tools/idevicedebug.c b/tools/idevicedebug.c
index 36c594e..9c11781 100644
--- a/tools/idevicedebug.c
+++ b/tools/idevicedebug.c
@@ -30,8 +30,12 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
+#ifndef _MSC_VER
#include <libgen.h>
+#endif
#include <getopt.h>
#ifdef WIN32
diff --git a/tools/idevicedevmodectl.c b/tools/idevicedevmodectl.c
index ba9b935..8e28e4b 100644
--- a/tools/idevicedevmodectl.c
+++ b/tools/idevicedevmodectl.c
@@ -30,7 +30,9 @@
#include <string.h>
#include <getopt.h>
#include <sys/stat.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <errno.h>
#ifndef WIN32
#include <signal.h>
diff --git a/tools/ideviceimagemounter.c b/tools/ideviceimagemounter.c
index f551b6c..fe9e1c1 100644
--- a/tools/ideviceimagemounter.c
+++ b/tools/ideviceimagemounter.c
@@ -32,7 +32,9 @@
#include <string.h>
#include <getopt.h>
#include <errno.h>
+#ifndef _MSC_VER
#include <libgen.h>
+#endif
#include <time.h>
#include <sys/time.h>
#include <inttypes.h>
diff --git a/tools/idevicename.c b/tools/idevicename.c
index 69b76f6..cb8c9a6 100644
--- a/tools/idevicename.c
+++ b/tools/idevicename.c
@@ -27,7 +27,9 @@
#include <stdio.h>
#include <string.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <stdlib.h>
#include <getopt.h>
#ifndef WIN32
diff --git a/tools/idevicepair.c b/tools/idevicepair.c
index 94d3f04..129c409 100644
--- a/tools/idevicepair.c
+++ b/tools/idevicepair.c
@@ -31,7 +31,9 @@
#include <stdlib.h>
#include <getopt.h>
#include <ctype.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#ifdef WIN32
#include <windows.h>
#include <conio.h>
diff --git a/tools/idevicescreenshot.c b/tools/idevicescreenshot.c
index 0e694c7..a4ca37d 100644
--- a/tools/idevicescreenshot.c
+++ b/tools/idevicescreenshot.c
@@ -31,7 +31,9 @@
#include <getopt.h>
#include <errno.h>
#include <time.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#ifndef WIN32
#include <signal.h>
#endif
diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c
index 5600be2..69b7b03 100644
--- a/tools/idevicesyslog.c
+++ b/tools/idevicesyslog.c
@@ -31,7 +31,9 @@
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <getopt.h>
#ifdef WIN32

View File

@ -0,0 +1,22 @@
diff --git a/src/idevice.c b/src/idevice.c
index 719cd28..0ae8a1c 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -124,6 +124,8 @@ static void id_function(CRYPTO_THREADID *thread)
#endif
#endif /* HAVE_OPENSSL */
+#ifndef LIBIMOBILEDEVICE_STATIC // disable dll constructor
+
static void internal_idevice_init(void)
{
#if defined(HAVE_OPENSSL)
@@ -219,6 +221,8 @@ BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved)
#warning No compiler support for constructor/destructor attributes, some features might not be available.
#endif
+#endif // disable dll constructor
+
struct idevice_subscription_context {
idevice_event_cb_t callback;
void *user_data;

View File

@ -0,0 +1,21 @@
diff --git a/src/idevice.h b/src/idevice.h
index 2509e48..384f178 100644
--- a/src/idevice.h
+++ b/src/idevice.h
@@ -37,15 +37,11 @@
#include <mbedtls/ctr_drbg.h>
#endif
-#ifdef WIN32
-#define LIBIMOBILEDEVICE_API __declspec( dllexport )
-#else
-#ifdef HAVE_FVISIBILITY
+#if !defined(_WIN32) && !defined(LIBIMOBILEDEVICEGLUE_STATIC)
#define LIBIMOBILEDEVICE_API __attribute__((visibility("default")))
#else
#define LIBIMOBILEDEVICE_API
#endif
-#endif
#include "common/userpref.h"
#include "libimobiledevice/libimobiledevice.h"

View File

@ -1,61 +1,100 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.15)
project(libimobiledevice C)
# find dependencies
find_library(libplist NAMES plist plist-2.0 libplist libplist-2.0 REQUIRED)
find_library(libusbmuxd NAMES usbmuxd libusbmuxd REQUIRED)
find_package(OpenSSL REQUIRED)
find_path(dirent_INCLUDE_DIR dirent.h)
if (WIN32)
find_library(getopt getopt REQUIRED)
include(GNUInstallDirs)
file(GLOB_RECURSE LIBIMOBILEDEVICE_SOURCE src/*.c src/*.h)
file(GLOB_RECURSE LIBIMOBILEDEVICE_COMMON_SOURCE common/*.c common/*.h)
set(DEFINITIONS)
list(APPEND DEFINITIONS -DHAVE_OPENSSL)
if(BUILD_SHARED_LIBS)
if(WIN32)
list(APPEND LIBIMOBILEDEVICE_SOURCE exports.def)
endif()
else()
list(APPEND DEFINITIONS -DLIBIMOBILEDEVICE_STATIC)
endif()
# ready to create library
file(GLOB_RECURSE IMOBDEV_COMMON_HDR common/*.h)
file(GLOB_RECURSE IMOBDEV_COMMON_SRC common/*.c)
if(UNIX)
list(APPEND DEFINITIONS -DHAVE_STPCPY)
list(APPEND DEFINITIONS -DHAVE_VASPRINTF)
list(APPEND DEFINITIONS -DHAVE_ASPRINTF)
list(APPEND DEFINITIONS -DHAVE_GETIFADDRS)
endif()
file(GLOB IMOBDEV_PUBLIC_HDR include/*.h)
file(GLOB IMOBDEV_PUBLIC_SUB_HDR include/libimobiledevice/*.h)
file(GLOB_RECURSE IMOBDEV_PRIVATE_HDR src/*.h)
file(GLOB_RECURSE IMOBDEV_SRC src/*.c)
if(WIN32)
list(APPEND DEFINITIONS -D_CRT_SECURE_NO_WARNINGS)
list(APPEND DEFINITIONS -DWIN32_LEAN_AND_MEAN)
list(APPEND DEFINITIONS -DWIN32)
endif()
add_library(libimobiledevice ${IMOBDEV_SRC} ${IMOBDEV_PUBLIC_HDR} ${IMOBDEV_PUBLIC_SUB_HDR} ${IMOBDEV_PRIVATE_HDR} ${IMOBDEV_COMMON_HDR} ${IMOBDEV_COMMON_SRC})
find_package(unofficial-libplist CONFIG REQUIRED)
find_package(unofficial-libimobiledevice-glue CONFIG REQUIRED)
find_package(unofficial-libusbmuxd CONFIG REQUIRED)
find_package(OpenSSL REQUIRED)
add_library(libimobiledevice ${LIBIMOBILEDEVICE_SOURCE} ${LIBIMOBILEDEVICE_COMMON_SOURCE} ${ED25519_HEADER} ${LIBSRP6A_SHA512_HEADER})
target_include_directories(libimobiledevice
PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>"
PUBLIC
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_compile_definitions(libimobiledevice PRIVATE ${DEFINITIONS})
target_link_libraries(libimobiledevice
PRIVATE
unofficial::libimobiledevice-glue::libimobiledevice-glue
unofficial::libusbmuxd::libusbmuxd
OpenSSL::SSL
OpenSSL::Crypto
PUBLIC
unofficial::libplist::libplist
)
set_target_properties(libimobiledevice PROPERTIES OUTPUT_NAME imobiledevice-1.0)
target_include_directories(libimobiledevice PRIVATE ${dirent_INCLUDE_DIR} include .)
target_compile_definitions(libimobiledevice PRIVATE -DHAVE_OPENSSL)
target_link_libraries(libimobiledevice PRIVATE ${libplist} ${libusbmuxd} ${getopt} OpenSSL::SSL OpenSSL::Crypto)
if (WIN32)
if(WIN32)
target_link_libraries(libimobiledevice PRIVATE Ws2_32)
endif()
if (UNIX)
target_compile_definitions(libimobiledevice PRIVATE -DHAVE_STPCPY -DHAVE_VASPRINTF -DHAVE_ASPRINTF -DHAVE_GETIFADDRS)
endif()
# install
install(TARGETS libimobiledevice EXPORT unofficial-libimobiledevice)
install(
TARGETS libimobiledevice
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
EXPORT unofficial-libimobiledevice
FILE unofficial-libimobiledevice-config.cmake
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/unofficial-libimobiledevice"
NAMESPACE unofficial::libimobiledevice::
)
install(
DIRECTORY "${CMAKE_SOURCE_DIR}/include/libimobiledevice"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
install(
FILES "${CMAKE_SOURCE_DIR}/include/endianness.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
set(LIBPLIST_VERSION 2.0)
set(LIMD_GLUE_VERSION 1.0)
set(LIBUSBMUXD_VERSION 2.0)
set(PACKAGE_NAME libimobiledevice)
set(PACKAGE_VERSION 1.0)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix \${prefix})
set(libdir \${prefix}/lib)
set(includedir \${prefix}/../include)
set(prefix "")
set(exec_prefix "\${prefix}")
set(libdir "\${prefix}/lib")
set(includedir "\${prefix}/include")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/libimobiledevice-1.0.pc.in
${CMAKE_CURRENT_BINARY_DIR}/libimobiledevice-1.0.pc
"${CMAKE_CURRENT_SOURCE_DIR}/src/libimobiledevice-1.0.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/libimobiledevice-1.0.pc"
@ONLY
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/libimobiledevice-1.0.pc
DESTINATION lib/pkgconfig
FILES "${CMAKE_CURRENT_BINARY_DIR}/libimobiledevice-1.0.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
)
install(FILES ${IMOBDEV_PUBLIC_HDR} DESTINATION include)
install(FILES ${IMOBDEV_PUBLIC_SUB_HDR} DESTINATION include/libimobiledevice)

View File

@ -0,0 +1,369 @@
EXPORTS
; src/mobilebackup2.c
mobilebackup2_client_new
mobilebackup2_client_start_service
mobilebackup2_client_free
mobilebackup2_send_message
mobilebackup2_receive_message
mobilebackup2_send_raw
mobilebackup2_receive_raw
mobilebackup2_version_exchange
mobilebackup2_send_request
mobilebackup2_send_status_response
; src/misagent.c
misagent_client_new
misagent_client_start_service
misagent_client_free
misagent_install
misagent_copy
misagent_copy_all
misagent_remove
misagent_get_status_code
; src/mobileactivation.c
mobileactivation_client_new
mobileactivation_client_start_service
mobileactivation_client_free
mobileactivation_get_activation_state
mobileactivation_create_activation_session_info
mobileactivation_create_activation_info
mobileactivation_create_activation_info_with_session
mobileactivation_activate
mobileactivation_activate_with_session
mobileactivation_deactivate
; src/heartbeat.c
heartbeat_client_new
heartbeat_client_start_service
heartbeat_client_free
heartbeat_send
heartbeat_receive
heartbeat_receive_with_timeout
; src/lockdown-cu.c
lockdownd_cu_pairing_create
lockdownd_cu_send_request_and_get_reply
lockdownd_get_value_cu
lockdownd_pair_cu
; src/preboard.c
preboard_client_new
preboard_client_start_service
preboard_client_free
preboard_send
preboard_receive_with_timeout
preboard_receive
preboard_create_stashbag
preboard_commit_stashbag
; src/screenshotr.c
screenshotr_client_new
screenshotr_client_start_service
screenshotr_client_free
screenshotr_take_screenshot
; src/property_list_service.c
property_list_service_client_new
property_list_service_client_free
property_list_service_send_xml_plist
property_list_service_send_binary_plist
property_list_service_receive_plist_with_timeout
property_list_service_receive_plist
property_list_service_enable_ssl
property_list_service_disable_ssl
property_list_service_get_service_client
; src/file_relay.c
file_relay_client_new
file_relay_client_start_service
file_relay_client_free
file_relay_request_sources_timeout
file_relay_request_sources
; src/reverse_proxy.c
reverse_proxy_client_start_proxy
reverse_proxy_client_create_with_service
reverse_proxy_client_create_with_port
reverse_proxy_client_free
reverse_proxy_get_type
reverse_proxy_client_set_status_callback
reverse_proxy_client_set_log_callback
reverse_proxy_client_set_data_callback
; src/service.c
service_client_new
service_client_factory_start_service
service_client_free
service_send
service_receive_with_timeout
service_receive
service_enable_ssl
service_disable_ssl
service_disable_bypass_ssl
service_get_connection
; src/installation_proxy.c
instproxy_client_new
instproxy_client_start_service
instproxy_client_free
instproxy_browse_with_callback
instproxy_browse
instproxy_lookup
instproxy_install
instproxy_upgrade
instproxy_uninstall
instproxy_lookup_archives
instproxy_archive
instproxy_restore
instproxy_remove_archive
instproxy_check_capabilities_match
instproxy_status_get_error
instproxy_status_get_name
instproxy_status_get_percent_complete
instproxy_status_get_current_list
instproxy_command_get_name
instproxy_client_options_new
instproxy_client_options_add
instproxy_client_options_set_return_attributes
instproxy_client_options_free
instproxy_client_get_path_for_bundle_identifier
; src/companion_proxy.c
companion_proxy_client_new
companion_proxy_client_start_service
companion_proxy_client_free
companion_proxy_send
companion_proxy_receive
companion_proxy_get_device_registry
companion_proxy_start_listening_for_devices
companion_proxy_stop_listening_for_devices
companion_proxy_get_value_from_registry
companion_proxy_start_forwarding_service_port
companion_proxy_stop_forwarding_service_port
; src/restore.c
restored_client_free
restored_client_set_label
restored_receive
restored_send
restored_query_type
restored_query_value
restored_get_value
restored_client_new
restored_goodbye
restored_start_restore
restored_reboot
; src/notification_proxy.c
np_client_new
np_client_start_service
np_client_free
np_post_notification
np_observe_notification
np_observe_notifications
np_set_notify_callback
; src/house_arrest.c
house_arrest_client_new
house_arrest_client_start_service
house_arrest_client_free
house_arrest_send_request
house_arrest_send_command
house_arrest_get_result
afc_client_new_from_house_arrest_client
; src/mobilesync.c
mobilesync_client_new
mobilesync_client_start_service
mobilesync_client_free
mobilesync_receive
mobilesync_send
mobilesync_start
mobilesync_finish
mobilesync_get_all_records_from_device
mobilesync_get_changes_from_device
mobilesync_receive_changes
mobilesync_clear_all_records_on_device
mobilesync_acknowledge_changes_from_device
mobilesync_ready_to_send_changes_from_computer
mobilesync_send_changes
mobilesync_remap_identifiers
mobilesync_cancel
mobilesync_anchors_new
mobilesync_anchors_free
mobilesync_actions_new
mobilesync_actions_add
mobilesync_actions_free
; src/idevice.c
idevice_events_subscribe
idevice_events_unsubscribe
idevice_event_subscribe
idevice_event_unsubscribe
idevice_get_device_list_extended
idevice_device_list_extended_free
idevice_get_device_list
idevice_device_list_free
idevice_set_debug_level
idevice_new_with_options
idevice_new
idevice_free
idevice_connect
idevice_disconnect
idevice_connection_send
idevice_connection_receive_timeout
idevice_connection_receive
idevice_connection_get_fd
idevice_get_handle
idevice_get_udid
idevice_connection_enable_ssl
idevice_connection_disable_ssl
idevice_connection_disable_bypass_ssl
; src/mobilebackup.c
mobilebackup_client_new
mobilebackup_client_start_service
mobilebackup_client_free
mobilebackup_receive
mobilebackup_send
mobilebackup_request_backup
mobilebackup_send_backup_file_received
mobilebackup_request_restore
mobilebackup_receive_restore_file_received
mobilebackup_receive_restore_application_received
mobilebackup_send_restore_complete
mobilebackup_send_error
; src/diagnostics_relay.c
diagnostics_relay_client_new
diagnostics_relay_client_start_service
diagnostics_relay_client_free
diagnostics_relay_goodbye
diagnostics_relay_sleep
diagnostics_relay_restart
diagnostics_relay_shutdown
diagnostics_relay_request_diagnostics
diagnostics_relay_query_mobilegestalt
diagnostics_relay_query_ioregistry_entry
diagnostics_relay_query_ioregistry_plane
; src/webinspector.c
webinspector_client_new
webinspector_client_start_service
webinspector_client_free
webinspector_send
webinspector_receive
webinspector_receive_with_timeout
; src/afc.c
afc_client_new_with_service_client
afc_client_new
afc_client_start_service
afc_client_free
afc_read_directory
afc_get_device_info
afc_get_device_info_key
afc_remove_path
afc_rename_path
afc_make_directory
afc_get_file_info
afc_file_open
afc_file_read
afc_file_write
afc_file_close
afc_file_lock
afc_file_seek
afc_file_tell
afc_file_truncate
afc_truncate
afc_make_link
afc_set_file_time
afc_remove_path_and_contents
afc_dictionary_free
; src/debugserver.c
debugserver_client_new
debugserver_client_start_service
debugserver_client_free
debugserver_client_send
debugserver_client_receive_with_timeout
debugserver_client_receive
debugserver_command_new
debugserver_command_free
debugserver_encode_string
debugserver_decode_string
debugserver_client_set_ack_mode
debugserver_client_set_receive_params
debugserver_client_receive_response
debugserver_client_send_command
debugserver_client_set_environment_hex_encoded
debugserver_client_set_argv
; src/sbservices.c
sbservices_client_new
sbservices_client_start_service
sbservices_client_free
sbservices_get_icon_state
sbservices_set_icon_state
sbservices_get_icon_pngdata
sbservices_get_interface_orientation
sbservices_get_home_screen_wallpaper_pngdata
; src/bt_packet_logger.c
bt_packet_logger_client_new
bt_packet_logger_client_start_service
bt_packet_logger_client_free
bt_packet_logger_receive_with_timeout
bt_packet_logger_start_capture
bt_packet_logger_stop_capture
; src/mobile_image_mounter.c
mobile_image_mounter_new
mobile_image_mounter_start_service
mobile_image_mounter_free
mobile_image_mounter_lookup_image
mobile_image_mounter_upload_image
mobile_image_mounter_mount_image
mobile_image_mounter_hangup
; src/lockdown.c
lockdownd_stop_session
lockdownd_client_free
lockdownd_client_set_label
lockdownd_receive
lockdownd_send
lockdownd_query_type
lockdownd_get_value
lockdownd_set_value
lockdownd_remove_value
lockdownd_get_device_udid
lockdownd_get_device_name
lockdownd_client_new
lockdownd_client_new_with_handshake
lockdownd_pair
lockdownd_pair_with_options
lockdownd_validate_pair
lockdownd_unpair
lockdownd_enter_recovery
lockdownd_goodbye
lockdownd_start_session
lockdownd_start_service
lockdownd_start_service_with_escrow_bag
lockdownd_activate
lockdownd_deactivate
lockdownd_get_sync_data_classes
lockdownd_data_classes_free
lockdownd_service_descriptor_free
lockdownd_strerror
; src/syslog_relay.c
syslog_relay_client_new
syslog_relay_client_start_service
syslog_relay_client_free
syslog_relay_receive
syslog_relay_receive_with_timeout
syslog_relay_start_capture
syslog_relay_start_capture_raw
syslog_relay_stop_capture

View File

@ -1,23 +1,37 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libimobiledevice-win32/libimobiledevice
REF 0d4a7e905baeadafa098e629a5241fac6fbf7d24 # v1.3.17
SHA512 db6369b2fa8e7b659948602ac8c4cd568bf37c0f73e58150f61f1af7000de95aa1a6a9ae546d6a37de4cb08a8059127fe5ed067351c4092c01a45350586f755a
HEAD_REF msvc-master
REPO libimobiledevice/libimobiledevice
REF 6fc41f57fc607df9b07446ca45bdf754225c9bd9 # commits on 2023-07-05
SHA512 0ceae43eb5c193c173536a20a6efde44b0ff4b5e6029342f59cb6b0dcad2fd629713db922f17b331b5f359a649b5402c18637e636bcdb5eb5c53bec12ff94903
HEAD_REF master
PATCHES
001_fix_msvc.patch
002_fix_static_build.patch
003_fix_api.patch
)
configure_file("${CURRENT_PORT_DIR}/CMakeLists.txt" "${SOURCE_PATH}/CMakeLists.txt" COPYONLY)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/exports.def" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT})
vcpkg_fixup_pkgconfig()
file(READ "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake" cmake_config)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake"
"include(CMakeFindDependencyMacro)
find_dependency(unofficial-libplist CONFIG)
find_dependency(unofficial-libimobiledevice-glue CONFIG)
find_dependency(unofficial-libusbmuxd CONFIG)
find_dependency(OpenSSL)
${cmake_config}
")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
# Handle copyright
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

View File

@ -1,5 +1,4 @@
libimobiledevice provides usage:
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBIMOBILEDEVICE REQUIRED IMPORTED_TARGET libimobiledevice-1.0)
target_link_libraries(main PRIVATE PkgConfig::LIBIMOBILEDEVICE)
libimobiledevice provides CMake targets:
find_package(unofficial-libimobiledevice CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::libimobiledevice::libimobiledevice)

View File

@ -1,23 +1,22 @@
{
"name": "libimobiledevice",
"version": "1.3.17",
"port-version": 4,
"version-date": "2023-07-05",
"description": "A cross-platform protocol library to communicate with iOS devices",
"homepage": "http://www.libimobiledevice.org",
"license": "LGPL-2.1-only",
"supports": "!xbox",
"license": "LGPL-2.1-or-later",
"supports": "!uwp",
"dependencies": [
"dirent",
"getopt",
"libimobiledevice-glue",
"libplist",
"libusbmuxd",
"openssl",
{
"name": "pkgconf",
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake",
"name": "vcpkg-cmake-config",
"host": true
}
]

View File

@ -0,0 +1,22 @@
diff --git a/src/libirecovery.c b/src/libirecovery.c
index 6e7647b..45ff6f2 100644
--- a/src/libirecovery.c
+++ b/src/libirecovery.c
@@ -470,6 +470,8 @@ static void _irecv_deinit(void)
static thread_once_t init_once = THREAD_ONCE_INIT;
static thread_once_t deinit_once = THREAD_ONCE_INIT;
+#ifndef IRECV_STATIC // disable dll constructor
+
#ifndef HAVE_ATTRIBUTE_CONSTRUCTOR
#if defined(__llvm__) || defined(__GNUC__)
#define HAVE_ATTRIBUTE_CONSTRUCTOR
@@ -505,6 +507,8 @@ BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved)
#warning No compiler support for constructor/destructor attributes, some features might not be available.
#endif
+#endif // disable dll constructor
+
#ifdef HAVE_IOKIT
static int iokit_get_string_descriptor_ascii(irecv_client_t client, uint8_t desc_index, unsigned char * buffer, int size)
{

View File

@ -0,0 +1,24 @@
diff --git a/include/libirecovery.h b/include/libirecovery.h
index 33879a4..41fc8bb 100644
--- a/include/libirecovery.h
+++ b/include/libirecovery.h
@@ -30,17 +30,13 @@ extern "C" {
#ifdef IRECV_STATIC
#define IRECV_API
#elif defined(_WIN32)
- #ifdef DLL_EXPORT
+ #ifdef IRECV_EXPORT
#define IRECV_API __declspec(dllexport)
#else
#define IRECV_API __declspec(dllimport)
#endif
#else
- #if __GNUC__ >= 4
- #define IRECV_API __attribute__((visibility("default")))
- #else
- #define IRECV_API
- #endif
+ #define IRECV_API __attribute__((visibility("default")))
#endif
enum irecv_mode {

View File

@ -0,0 +1,39 @@
diff --git a/src/libirecovery.c b/src/libirecovery.c
index 45ff6f2..d9ff1e6 100644
--- a/src/libirecovery.c
+++ b/src/libirecovery.c
@@ -29,7 +29,9 @@
#include <string.h>
#include <inttypes.h>
#include <ctype.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <sys/stat.h>
#include <libimobiledevice-glue/collection.h>
@@ -59,6 +61,10 @@
#include "libirecovery.h"
+#ifdef _MSC_VER
+#define strcasecmp _stricmp
+#endif
+
struct irecv_client_private {
int debug;
int usb_config;
diff --git a/tools/irecovery.c b/tools/irecovery.c
index 34e80bf..deffe89 100644
--- a/tools/irecovery.c
+++ b/tools/irecovery.c
@@ -27,7 +27,9 @@
#include <stdio.h>
#include <stdlib.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <string.h>
#include <getopt.h>
#include <inttypes.h>

View File

@ -0,0 +1,87 @@
cmake_minimum_required(VERSION 3.15)
project(libirecovery C)
include(GNUInstallDirs)
file(GLOB_RECURSE LIBIRECOVERY_HEADER include/*.h)
file(GLOB_RECURSE LIBIRECOVERY_SOURCE src/*.c)
set(DEFINITIONS)
if(BUILD_SHARED_LIBS)
if(WIN32)
list(APPEND DEFINITIONS -DIRECV_EXPORT)
endif()
else()
list(APPEND DEFINITIONS -DIRECV_STATIC)
endif()
if(APPLE)
list(APPEND DEFINITIONS -DHAVE_IOKIT)
endif()
if(WIN32)
list(APPEND DEFINITIONS -D_CRT_SECURE_NO_WARNINGS)
list(APPEND DEFINITIONS -DWIN32)
endif()
find_package(unofficial-libimobiledevice-glue CONFIG REQUIRED)
add_library(libirecovery ${LIBIRECOVERY_SOURCE})
target_include_directories(libirecovery
PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
PUBLIC
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_compile_definitions(libirecovery PRIVATE ${DEFINITIONS})
target_link_libraries(libirecovery
PRIVATE
unofficial::libimobiledevice-glue::libimobiledevice-glue
)
if(NOT WIN32 AND NOT APPLE)
find_package(libusb CONFIG REQUIRED)
target_include_directories(libirecovery PRIVATE ${LIBUSB_INCLUDE_DIRS})
target_link_libraries(libirecovery PRIVATE ${LIBUSB_LIBRARIES})
endif()
set_target_properties(libirecovery PROPERTIES OUTPUT_NAME irecovery-1.0)
if(WIN32)
target_link_libraries(libirecovery PRIVATE Setupapi)
endif()
if(APPLE)
target_link_libraries(libirecovery PRIVATE "-framework IOKit" "-framework CoreFoundation")
endif()
install(TARGETS libirecovery EXPORT unofficial-libirecovery)
install(
EXPORT unofficial-libirecovery
FILE unofficial-libirecovery-config.cmake
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/unofficial-libirecovery"
NAMESPACE unofficial::libirecovery::
)
install(
FILES ${LIBIRECOVERY_HEADER}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
set(LIMD_GLUE_VERSION 1.0)
set(PACKAGE_NAME libirecovery)
set(PACKAGE_VERSION 1.0)
set(prefix "")
set(exec_prefix "\${prefix}")
set(libdir "\${prefix}/lib")
set(includedir "\${prefix}/include")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/src/libirecovery-1.0.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/libirecovery-1.0.pc"
@ONLY
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/libirecovery-1.0.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
)

View File

@ -1,20 +1,43 @@
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libimobiledevice-win32/libirecovery
REF 1.0.25
SHA512 0dd91d4fe3ded2bc1bbd91aea964e31e7f59bce18be01aa096e974f37dc1be281644d6c44e3f9b49470dd961e3df2e3ff8a09bcc6b803a959073e7d7d9a8d3e7
HEAD_REF msvc-master
REPO libimobiledevice/libirecovery
REF c7b488fbf2a9ab95e451df1319e68662fff7b9b7 # commits on 2023-05-13
SHA512 a8638b71789c0cedf5913a877ca42fef079c968592b6149dfa578d2dc7840f63c1d1fadd934d7cfbd5139cea2b3a4249886a88b69c3edb19dbd3f893c266f665
HEAD_REF master
PATCHES
001_fix_static_build.patch
002_fix_api.patch
003_fix_msvc.patch
)
vcpkg_msbuild_install(
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
PROJECT_SUBPATH libirecovery.sln
ADDITIONAL_LIBS getopt.lib
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT})
vcpkg_fixup_pkgconfig()
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libirecovery.h"
"#ifdef IRECV_STATIC" "#if 1"
)
else()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libirecovery.h"
"#ifdef IRECV_STATIC" "#if 0"
)
endif()
file(READ "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake" cmake_config)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake"
"include(CMakeFindDependencyMacro)
find_dependency(unofficial-libimobiledevice-glue CONFIG)
${cmake_config}
")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
file(COPY "${SOURCE_PATH}/include/" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
file(REMOVE ${CURRENT_PACKAGES_DIR}/include/Makefile.am)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

4
ports/libirecovery/usage Normal file
View File

@ -0,0 +1,4 @@
libirecovery provides CMake targets:
find_package(unofficial-libirecovery CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::libirecovery::libirecovery)

View File

@ -1,18 +1,23 @@
{
"name": "libirecovery",
"version": "1.0.25",
"port-version": 8,
"version-date": "2023-05-13",
"description": "Library and utility to talk to iBoot/iBSS via USB on Mac OS X, Windows, and Linux",
"license": "LGPL-2.1-only",
"supports": "windows & !arm64 & !static & !staticcrt & !xbox",
"homepage": "https://libimobiledevice.org/",
"license": "LGPL-2.1-or-later",
"supports": "!uwp",
"dependencies": [
"getopt",
"libusbmuxd",
"readline",
"libimobiledevice-glue",
{
"name": "vcpkg-msbuild",
"host": true,
"platform": "windows"
"name": "libusb",
"platform": "!windows & !osx"
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -0,0 +1,22 @@
diff --git a/src/plist.c b/src/plist.c
index 19279edb..a62687eb 100644
--- a/src/plist.c
+++ b/src/plist.c
@@ -51,6 +51,8 @@
typedef SSIZE_T ssize_t;
#endif
+#ifndef LIBPLIST_STATIC // disable dll constructor
+
extern void plist_xml_init(void);
extern void plist_xml_deinit(void);
extern void plist_bin_init(void);
@@ -137,6 +139,8 @@ BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved)
#warning No compiler support for constructor/destructor attributes, some features might not be available.
#endif
+#endif // disable dll constructor
+
#ifndef HAVE_MEMMEM
// see https://sourceware.org/legacy-ml/libc-alpha/2007-12/msg00000.html

View File

@ -0,0 +1,24 @@
diff --git a/include/plist/plist.h b/include/plist/plist.h
index 47eda513..9df379ab 100644
--- a/include/plist/plist.h
+++ b/include/plist/plist.h
@@ -78,17 +78,13 @@ extern "C"
#ifdef LIBPLIST_STATIC
#define PLIST_API
#elif defined(_WIN32)
- #ifdef DLL_EXPORT
+ #ifdef PLIST_EXPORT
#define PLIST_API __declspec(dllexport)
#else
#define PLIST_API __declspec(dllimport)
#endif
#else
- #if __GNUC__ >= 4
- #define PLIST_API __attribute__((visibility("default")))
- #else
- #define PLIST_API
- #endif
+ #define PLIST_API __attribute__((visibility("default")))
#endif
#include <sys/types.h>

View File

@ -0,0 +1,106 @@
diff --git a/src/bplist.c b/src/bplist.c
index 953c2c77..d7b4777a 100644
--- a/src/bplist.c
+++ b/src/bplist.c
@@ -87,6 +87,28 @@ union plist_uint_ptr
uint64_t *u64ptr;
};
+#ifdef _MSC_VER
+uint64_t get_unaligned_64(uint64_t *ptr)
+{
+ uint64_t temp;
+ memcpy(&temp, ptr, sizeof(temp));
+ return temp;
+}
+
+uint32_t get_unaligned_32(uint32_t *ptr)
+{
+ uint32_t temp;
+ memcpy(&temp, ptr, sizeof(temp));
+ return temp;
+}
+
+uint16_t get_unaligned_16(uint16_t *ptr)
+{
+ uint16_t temp;
+ memcpy(&temp, ptr, sizeof(temp));
+ return temp;
+}
+#else
#define get_unaligned(ptr) \
({ \
struct __attribute__((packed)) { \
@@ -94,6 +116,7 @@ union plist_uint_ptr
} *__p = (void *) (ptr); \
__p->__v; \
})
+#endif
#ifndef bswap16
@@ -148,10 +171,23 @@ union plist_uint_ptr
#define beNtoh(x,n) be64toh((x) << ((8-(n)) << 3))
#endif
+#ifdef _MSC_VER
+uint64_t UINT_TO_HOST(void* x, uint8_t n)
+{
+ union plist_uint_ptr __up;
+ __up.src = (n > 8) ? (char *)x + (n - 8) : x;
+ return (n >= 8 ? be64toh( get_unaligned_64(__up.u64ptr) ) :
+ (n == 4 ? be32toh( get_unaligned_32(__up.u32ptr) ) :
+ (n == 2 ? be16toh( get_unaligned_16(__up.u16ptr) ) :
+ (n == 1 ? *__up.u8ptr :
+ beNtoh( get_unaligned_64(__up.u64ptr), n)
+ ))));
+}
+#else
#define UINT_TO_HOST(x, n) \
({ \
union plist_uint_ptr __up; \
- __up.src = ((n) > 8) ? (x) + ((n) - 8) : (x); \
+ __up.src = ((n) > 8) ? ((char *)x) + ((n) - 8) : (x); \
((n) >= 8 ? be64toh( get_unaligned(__up.u64ptr) ) : \
((n) == 4 ? be32toh( get_unaligned(__up.u32ptr) ) : \
((n) == 2 ? be16toh( get_unaligned(__up.u16ptr) ) : \
@@ -159,6 +195,7 @@ union plist_uint_ptr
beNtoh( get_unaligned(__up.u64ptr), n) \
)))); \
})
+#endif
#define get_needed_bytes(x) \
( ((uint64_t)(x)) < (1ULL << 8) ? 1 : \
@@ -277,11 +314,19 @@ static plist_t parse_real_node(const char **bnode, uint8_t size)
switch (size)
{
case sizeof(uint32_t):
+#ifdef _MSC_VER
+ *(uint32_t*)buf = float_bswap32(get_unaligned_32((uint32_t*)*bnode));
+#else
*(uint32_t*)buf = float_bswap32(get_unaligned((uint32_t*)*bnode));
+#endif
data->realval = *(float *) buf;
break;
case sizeof(uint64_t):
+#ifdef _MSC_VER
+ *(uint64_t*)buf = float_bswap64(get_unaligned_64((uint64_t*)*bnode));
+#else
*(uint64_t*)buf = float_bswap64(get_unaligned((uint64_t*)*bnode));
+#endif
data->realval = *(double *) buf;
break;
default:
@@ -343,7 +388,11 @@ static char *plist_utf16be_to_utf8(uint16_t *unistr, long len, long *items_read,
}
while (i < len) {
+#if _MSC_VER
+ wc = be16toh(get_unaligned_16(unistr + i));
+#else
wc = be16toh(get_unaligned(unistr + i));
+#endif
i++;
if (wc >= 0xD800 && wc <= 0xDBFF) {
if (!read_lead_surrogate) {

View File

@ -1,79 +1,87 @@
cmake_minimum_required(VERSION 3.8)
project(plist C CXX)
file(GLOB_RECURSE PLIST_HEADER include/plist/*.h)
set(PLIST_SRC
src/base64.c
src/bytearray.c
src/hashtable.c
src/ptrarray.c
src/time64.c
src/xplist.c
src/bplist.c
src/plist.c
)
set(PLISTPP_SRC
src/Node.cpp
src/Structure.cpp
src/Array.cpp
src/Boolean.cpp
src/Data.cpp
src/Date.cpp
src/Dictionary.cpp
src/Integer.cpp
src/Key.cpp
src/Real.cpp
src/String.cpp
src/Uid.cpp
)
file(GLOB_RECURSE LIBCNARY_HEADER libcnary/include/*.h)
file(GLOB_RECURSE LIBCNARY_SRC libcnary/*c)
add_library(plist ${PLIST_SRC} ${PLIST_HEADER} ${LIBCNARY_SRC} ${LIBCNARY_HEADER})
target_include_directories(plist PRIVATE src include libcnary/include)
set_target_properties(plist PROPERTIES OUTPUT_NAME plist-2.0)
add_library(plist++ STATIC ${PLISTPP_SRC} ${PLIST_HEADER} ${LIBCNARY_SRC} ${LIBCNARY_HEADER})
set_target_properties(plist++ PROPERTIES OUTPUT_NAME plist++-2.0)
target_include_directories(plist++ PRIVATE src include libcnary/include)
if(WIN32 AND BUILD_SHARED_LIBS)
target_compile_options(plist PRIVATE -W3 -WX- -sdl-)
target_compile_definitions(plist PRIVATE -DLIBPLIST_EXPORTS)
target_compile_options(plist++ PRIVATE -W3 -WX- -sdl-)
target_compile_definitions(plist++ PRIVATE -DLIBPLIST_EXPORTS)
endif()
if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(plist PRIVATE -DLIBPLIST_STATIC_LIBRARY)
endif()
target_link_libraries(plist++ PRIVATE plist)
install(
TARGETS plist plist++
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
set(PACKAGE_NAME libplist)
set(PACKAGE_VERSION 2.0)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix \${prefix})
set(libdir \${prefix}/lib)
set(includedir \${prefix}/../include)
foreach (PLIST_PKGCONFIG libplist-2.0.pc libplist++-2.0.pc)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/${PLIST_PKGCONFIG}.in
${CMAKE_CURRENT_BINARY_DIR}/${PLIST_PKGCONFIG}
@ONLY
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PLIST_PKGCONFIG}
DESTINATION lib/pkgconfig)
endforeach()
install(FILES ${PLIST_HEADER} DESTINATION include/plist)
cmake_minimum_required(VERSION 3.15)
project(libplist C CXX)
include(GNUInstallDirs)
file(GLOB_RECURSE LIBCNARY_SOURCE libcnary/node.c libcnary/node_list.c)
file(GLOB_RECURSE LIBPLIST_SOURCE src/*.c)
file(GLOB_RECURSE LIBPLISTPP_SOURCE src/*.cpp)
set(DEFINITIONS)
if(BUILD_SHARED_LIBS)
if(WIN32)
list(APPEND DEFINITIONS -DLIBPLIST_EXPORT)
endif()
else()
list(APPEND DEFINITIONS -DLIBPLIST_STATIC)
endif()
if(UNIX)
list(APPEND DEFINITIONS -DHAVE_STRNDUP)
endif()
if(WIN32)
list(APPEND DEFINITIONS -D_CRT_SECURE_NO_WARNINGS)
endif()
add_library(libplist ${LIBPLIST_SOURCE} ${LIBCNARY_SOURCE})
target_include_directories(libplist
PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/libcnary/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src>"
PUBLIC
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_compile_definitions(libplist PRIVATE ${DEFINITIONS})
set_target_properties(libplist PROPERTIES OUTPUT_NAME plist-2.0)
if(UNIX AND NOT APPLE)
target_link_libraries(libplist PRIVATE m)
endif()
add_library(libplist++ STATIC ${LIBPLISTPP_SOURCE} ${LIBCNARY_SOURCE})
target_include_directories(libplist++
PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/libcnary/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src>"
PUBLIC
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_compile_definitions(libplist++ PRIVATE ${DEFINITIONS})
target_link_libraries(libplist++ PUBLIC libplist)
set_target_properties(libplist++ PROPERTIES OUTPUT_NAME plist++-2.0)
install(TARGETS libplist libplist++ EXPORT unofficial-libplist)
install(
EXPORT unofficial-libplist
FILE unofficial-libplist-config.cmake
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/unofficial-libplist"
NAMESPACE unofficial::libplist::
)
install(
DIRECTORY "${CMAKE_SOURCE_DIR}/include/plist"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
set(PACKAGE_NAME libplist)
set(PACKAGE_VERSION 2.0)
set(prefix "")
set(exec_prefix "\${prefix}")
set(libdir "\${prefix}/lib")
set(includedir "\${prefix}/include")
foreach(PLIST_PKGCONFIG libplist-2.0.pc libplist++-2.0.pc)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/src/${PLIST_PKGCONFIG}.in"
"${CMAKE_CURRENT_BINARY_DIR}/${PLIST_PKGCONFIG}"
@ONLY
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/${PLIST_PKGCONFIG}"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
)
endforeach()

View File

@ -1,37 +0,0 @@
diff --git a/include/plist/plist.h b/include/plist/plist.h
index 2863c74..9cdb219 100644
--- a/include/plist/plist.h
+++ b/include/plist/plist.h
@@ -42,7 +42,7 @@ extern "C"
#include <stdint.h>
#endif
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && defined(LIBPLIST_EXPORTS)
#define PLIST_API_MSC __declspec( dllexport )
#else
#define PLIST_API_MSC
diff --git a/src/plist.h b/src/plist.h
index 1e5d0d1..6690343 100644
--- a/src/plist.h
+++ b/src/plist.h
@@ -39,10 +39,7 @@
#include <sys/time.h>
#endif
-#ifdef _MSC_VER
- #define PLIST_API __declspec( dllexport )
-#else
-#ifdef WIN32
+#if (defined(_MSC_VER) || defined(WIN32)) && defined(LIBPLIST_EXPORTS)
#define PLIST_API __declspec( dllexport )
#else
#ifdef HAVE_FVISIBILITY
@@ -51,7 +48,6 @@
#define PLIST_API
#endif
#endif
-#endif
struct plist_data_s
{

View File

@ -1,22 +0,0 @@
diff --git a/src/plist.c b/src/plist.c
index 57f0be4..cbe10ad 100644
--- a/src/plist.c
+++ b/src/plist.c
@@ -62,6 +62,8 @@ static void internal_plist_deinit(void)
plist_xml_deinit();
}
+#ifndef LIBPLIST_STATIC_LIBRARY
+
#ifdef WIN32
typedef volatile struct {
@@ -116,6 +118,8 @@ static void __attribute__((destructor)) libplist_deinitialize(void)
#endif
+#endif
+
#ifndef HAVE_MEMMEM
// see https://sourceware.org/legacy-ml/libc-alpha/2007-12/msg00000.html

View File

@ -1,46 +1,36 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libimobiledevice-win32/libplist
REF bbba7cabb78aad180a7a982ada5e1f21ff0ba873 # v1.3.6
SHA512 4cd59ed87c647259d0da99a20a05e01aa880f01f6b5cecd29e4247029a3d29f0f68b4552571eb3fd3c5549b4cb357801ffe43338b8ff34d44d6be5393d2e6b9d
HEAD_REF msvc-master
REPO libimobiledevice/libplist
REF 2d8d7ef272db06783989f77ba1ed80aa0f4d2dfd # commits on 2023-06-15
SHA512 ec7c723ffb0492fe9901ee3854df16465e1b5b051cc8a716d89ff8fbf8f782134b7dda4d3a9656016fcf15c7cdf0eef7c80551b38a62317a11f056500e5c9ef4
HEAD_REF master
PATCHES
dllexport.patch
fix_static_build.patch
001_fix_static_build.patch
002_fix_api.patch
003_fix_msvc.patch
)
configure_file("${CURRENT_PORT_DIR}/CMakeLists.txt" "${SOURCE_PATH}/CMakeLists.txt" COPYONLY)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT})
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
set(pcfile "libplist-2.0.pc")
set(pcfiletarget "libplist.pc")
set(basepath "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/")
if(EXISTS "${basepath}${pcfile}")
file(CREATE_LINK "${basepath}${pcfile}" "${basepath}${pcfiletarget}" COPY_ON_ERROR)
endif()
set(basepath "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/")
if(EXISTS "${basepath}${pcfile}")
file(CREATE_LINK "${basepath}${pcfile}" "${basepath}${pcfiletarget}" COPY_ON_ERROR)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/plist/plist.h"
"#ifdef LIBPLIST_STATIC" "#if 1"
)
else()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/plist/plist.h"
"#ifdef LIBPLIST_STATIC" "#if 0"
)
endif()
set(pcfile "libplist++-2.0.pc")
set(pcfiletarget "libplist++.pc")
set(basepath "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/")
if(EXISTS "${basepath}${pcfile}")
file(CREATE_LINK "${basepath}${pcfile}" "${basepath}${pcfiletarget}" COPY_ON_ERROR)
endif()
set(basepath "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/")
if(EXISTS "${basepath}${pcfile}")
file(CREATE_LINK "${basepath}${pcfile}" "${basepath}${pcfiletarget}" COPY_ON_ERROR)
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

4
ports/libplist/usage Normal file
View File

@ -0,0 +1,4 @@
libplist provides CMake targets:
find_package(unofficial-libplist CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::libplist::libplist unofficial::libplist::libplist++)

View File

@ -1,14 +1,17 @@
{
"name": "libplist",
"version": "1.3.6",
"port-version": 2,
"version-date": "2023-06-15",
"description": "A library to handle Apple Property List format in binary or XML",
"homepage": "https://libimobiledevice.org/",
"license": "LGPL-2.1-only",
"license": "LGPL-2.1-or-later",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -0,0 +1,13 @@
diff --git a/include/usbmuxd-proto.h b/include/usbmuxd-proto.h
index a2a731e..38473f5 100644
--- a/include/usbmuxd-proto.h
+++ b/include/usbmuxd-proto.h
@@ -26,7 +26,7 @@
#include <stdint.h>
#define USBMUXD_PROTOCOL_VERSION 0
-#if defined(WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32) || defined(__CYGWIN__)
#define USBMUXD_SOCKET_PORT 27015
#else
#define USBMUXD_SOCKET_FILE "/var/run/usbmuxd"

View File

@ -0,0 +1,50 @@
diff --git a/include/usbmuxd-proto.h b/include/usbmuxd-proto.h
index 38473f5..d004232 100644
--- a/include/usbmuxd-proto.h
+++ b/include/usbmuxd-proto.h
@@ -57,28 +57,30 @@ enum usbmuxd_msgtype {
MESSAGE_PLIST = 8,
};
+#pragma pack(push, 1)
+
struct usbmuxd_header {
uint32_t length; // length of message, including header
uint32_t version; // protocol version
uint32_t message; // message type
uint32_t tag; // responses to this query will echo back this tag
-} __attribute__((__packed__));
+};
struct usbmuxd_result_msg {
struct usbmuxd_header header;
uint32_t result;
-} __attribute__((__packed__));
+};
struct usbmuxd_connect_request {
struct usbmuxd_header header;
uint32_t device_id;
uint16_t port; // TCP port number
uint16_t reserved; // set to zero
-} __attribute__((__packed__));
+};
struct usbmuxd_listen_request {
struct usbmuxd_header header;
-} __attribute__((__packed__));
+};
struct usbmuxd_device_record {
uint32_t device_id;
@@ -86,7 +88,9 @@ struct usbmuxd_device_record {
char serial_number[256];
uint16_t padding;
uint32_t location;
-} __attribute__((__packed__));
+};
+
+#pragma pack(pop)
#ifdef __cplusplus
}

View File

@ -0,0 +1,37 @@
diff --git a/src/libusbmuxd.c b/src/libusbmuxd.c
index 95e322f..c5c8f09 100644
--- a/src/libusbmuxd.c
+++ b/src/libusbmuxd.c
@@ -49,7 +49,9 @@
#define ECONNREFUSED 107
#endif
+#ifndef _MSC_VER
#include <unistd.h>
+#endif
#include <signal.h>
#ifdef WIN32
@@ -91,6 +93,10 @@ static char* stpncpy(char *dst, const char *src, size_t len)
}
#endif
+#ifdef _MSC_VER
+#define strcasecmp _stricmp
+#endif
+
#include <plist/plist.h>
#define PLIST_CLIENT_VERSION_STRING PACKAGE_STRING
#define PLIST_LIBUSBMUX_VERSION 3
@@ -1590,7 +1596,11 @@ USBMUXD_API int usbmuxd_send(int sfd, const char *data, uint32_t len, uint32_t *
num_sent = socket_send(sfd, (void*)data, len);
if (num_sent < 0) {
*sent_bytes = 0;
+#ifdef WIN32
+ num_sent = WSAGetLastError();
+#else
num_sent = errno;
+#endif
LIBUSBMUXD_DEBUG(1, "%s: Error %d when sending: %s\n", __func__, num_sent, strerror(num_sent));
return -num_sent;
}

View File

@ -0,0 +1,22 @@
diff --git a/src/libusbmuxd.c b/src/libusbmuxd.c
index c5c8f09..edab706 100644
--- a/src/libusbmuxd.c
+++ b/src/libusbmuxd.c
@@ -29,14 +29,10 @@
#include <stdio.h>
#include <string.h>
-#ifdef WIN32
- #define USBMUXD_API __declspec( dllexport )
+#if !defined(_WIN32) && !defined(LIBUSBMUXD_STATIC)
+#define USBMUXD_API __attribute__((visibility("default")))
#else
- #ifdef HAVE_FVISIBILITY
- #define USBMUXD_API __attribute__((visibility("default")))
- #else
- #define USBMUXD_API
- #endif
+#define USBMUXD_API
#endif
#ifndef EPROTO

View File

@ -1,54 +1,84 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.15)
project(libusbmuxd C)
# find dependencies
find_path(libplist_INCLUDES plist.h PATH_SUFFIXES plist)
set(libplist_INCLUDES ${libplist_INCLUDES}/../)
find_library(libplist NAMES plist libplist plist-2.0 libplist-2.0 REQUIRED)
include(GNUInstallDirs)
# ready to create library
file(GLOB_RECURSE IDVCACTV_TOOLS_HDR common/*.h)
file(GLOB_RECURSE IDVCACTV_TOOLS_SRC common/*.c)
file(GLOB_RECURSE LIBUSBMUXD_HEADER include/*.h)
file(GLOB_RECURSE LIBUSBMUXD_SOURCE src/*.c)
file(GLOB_RECURSE IDVCACTV_PUBLIC_HDR include/*.h)
file(GLOB_RECURSE IDVCACTV_SRC src/*.c)
set(DEFINITIONS)
add_library(libusbmuxd ${IDVCACTV_TOOLS_HDR} ${IDVCACTV_TOOLS_SRC} ${IDVCACTV_SRC} ${IDVCACTV_PUBLIC_HDR})
set_target_properties(libusbmuxd PROPERTIES OUTPUT_NAME usbmuxd)
target_include_directories(libusbmuxd PRIVATE ${libplist_INCLUDES} include common)
target_compile_definitions(libusbmuxd PRIVATE -DPACKAGE_STRING="1.2.77")
if (WIN32)
target_compile_definitions(libusbmuxd PRIVATE -DWIN32)
list(APPEND DEFINITIONS -DPACKAGE_STRING="2.0.2")
if(BUILD_SHARED_LIBS)
if(WIN32)
list(APPEND LIBUSBMUXD_SOURCE exports.def)
endif()
else()
list(APPEND DEFINITIONS -DLIBUSBMUXD_STATIC)
endif()
if(UNIX)
list(APPEND DEFINITIONS -DHAVE_GETIFADDRS)
list(APPEND DEFINITIONS -DHAVE_STPNCPY)
endif()
if(WIN32)
list(APPEND DEFINITIONS -D_CRT_SECURE_NO_WARNINGS)
list(APPEND DEFINITIONS -DWIN32)
endif()
find_package(unofficial-libplist CONFIG REQUIRED)
find_package(unofficial-libimobiledevice-glue CONFIG REQUIRED)
add_library(libusbmuxd ${LIBUSBMUXD_SOURCE})
target_include_directories(libusbmuxd
PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>"
PUBLIC
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_compile_definitions(libusbmuxd PRIVATE ${DEFINITIONS})
target_link_libraries(libusbmuxd
PRIVATE
unofficial::libplist::libplist
unofficial::libimobiledevice-glue::libimobiledevice-glue
)
set_target_properties(libusbmuxd PROPERTIES OUTPUT_NAME usbmuxd-2.0)
if(WIN32)
target_link_libraries(libusbmuxd PRIVATE Ws2_32)
endif()
if (UNIX)
target_compile_definitions(libusbmuxd PRIVATE -DHAVE_STPNCPY)
endif()
target_link_libraries(libusbmuxd PRIVATE ${libplist})
# install
install(TARGETS libusbmuxd EXPORT unofficial-libusbmuxd)
install(
TARGETS libusbmuxd
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
EXPORT unofficial-libusbmuxd
FILE unofficial-libusbmuxd-config.cmake
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/unofficial-libusbmuxd"
NAMESPACE unofficial::libusbmuxd::
)
install(
FILES ${LIBUSBMUXD_HEADER}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
set(LIBPLIST_VERSION 2.0)
set(LIMD_GLUE_VERSION 1.0)
set(PACKAGE_NAME libusbmuxd)
set(PACKAGE_VERSION 2.0)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix \${prefix})
set(libdir \${prefix}/lib)
set(includedir \${prefix}/../include)
set(prefix "")
set(exec_prefix "\${prefix}")
set(libdir "\${prefix}/lib")
set(includedir "\${prefix}/include")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/libusbmuxd-2.0.pc.in
${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd-2.0.pc
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusbmuxd-2.0.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd-2.0.pc"
@ONLY
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd-2.0.pc
DESTINATION lib/pkgconfig
FILES "${CMAKE_CURRENT_BINARY_DIR}/libusbmuxd-2.0.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
)
install(FILES ${IDVCACTV_PUBLIC_HDR} DESTINATION include)

View File

@ -0,0 +1,21 @@
EXPORTS
usbmuxd_events_subscribe
usbmuxd_events_unsubscribe
usbmuxd_subscribe
usbmuxd_unsubscribe
usbmuxd_get_device_list
usbmuxd_device_list_free
usbmuxd_get_device_by_udid
usbmuxd_get_device
usbmuxd_connect
usbmuxd_disconnect
usbmuxd_send
usbmuxd_recv_timeout
usbmuxd_recv
usbmuxd_read_buid
usbmuxd_read_pair_record
usbmuxd_save_pair_record_with_device_id
usbmuxd_save_pair_record
usbmuxd_delete_pair_record
libusbmuxd_set_use_inotify
libusbmuxd_set_debug_level

View File

@ -1,20 +0,0 @@
diff --git a/src/libusbmuxd.c b/src/libusbmuxd.c
index e85cf4a..35ed1b5 100644
--- a/src/libusbmuxd.c
+++ b/src/libusbmuxd.c
@@ -86,6 +86,15 @@ static char* stpncpy(char *dst, const char *src, size_t len)
}
#endif
+#ifdef WIN32
+int strcasecmp(char *s1, char *s2)
+{
+ while (toupper((unsigned char)*s1) == toupper((unsigned char)*s2++))
+ if (*s1++ == '\0') return 0;
+ return(toupper((unsigned char)*s1) - toupper((unsigned char)*--s2));
+}
+#endif
+
#include <plist/plist.h>
#define PLIST_CLIENT_VERSION_STRING PACKAGE_STRING
#define PLIST_LIBUSBMUX_VERSION 3

View File

@ -1,23 +1,36 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libimobiledevice-win32/libusbmuxd
REF ac86b23f57879b8b702f3712ba66729008d059a3 # v1.2.219
SHA512 ced85088bc6ebb416ccb635d6b4e79662fb34f427d869b64b61847e5fde7b4ae094cebb1f7916d9387c314aeb84106a618fbd7497dc4b36151b236dcb55bd0e4
HEAD_REF msvc-master
PATCHES fix-win-build.patch
REPO libimobiledevice/libusbmuxd
REF 8d30a559cf0585625d9d05dc8ce0dd495b1de4f4 # commits on 2023-06-21
SHA512 ace920d13908c12afcc9182776a668f6876b2f037b21a151c1dca897aa24bc24cb41898471cd258487963772963753457be5efba2657571cf2c07c8225b68a5f
HEAD_REF master
PATCHES
001_fix_win32_defs.patch
002_fix_struct_pack.patch
003_fix_msvc.patch
004_fix_api.patch
)
configure_file(${CURRENT_PORT_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/exports.def" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT})
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(READ "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake" cmake_config)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake"
"include(CMakeFindDependencyMacro)
find_dependency(unofficial-libplist CONFIG)
find_dependency(unofficial-libimobiledevice-glue CONFIG)
${cmake_config}
")
# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

4
ports/libusbmuxd/usage Normal file
View File

@ -0,0 +1,4 @@
libusbmuxd provides CMake targets:
find_package(unofficial-libusbmuxd CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::libusbmuxd::libusbmuxd)

View File

@ -1,15 +1,20 @@
{
"name": "libusbmuxd",
"version": "1.2.219",
"port-version": 3,
"version-date": "2023-06-21",
"description": "A client library to multiplex connections from and to iOS devices",
"license": "LGPL-2.1-only",
"homepage": "https://libimobiledevice.org/",
"license": "LGPL-2.1-or-later",
"supports": "!uwp",
"dependencies": [
"libimobiledevice-glue",
"libplist",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -0,0 +1,52 @@
cmake_minimum_required(VERSION 3.15)
project(usbmuxd C)
include(GNUInstallDirs)
file(GLOB_RECURSE USBMUXD_SOURCE src/*.c src/*.h)
set(DEFINITIONS)
list(APPEND DEFINITIONS -DPACKAGE_NAME="usbmuxd")
list(APPEND DEFINITIONS -DPACKAGE_STRING="1.1.1")
list(APPEND DEFINITIONS -DPACKAGE_VERSION="1.1.1")
list(APPEND DEFINITIONS -DPACKAGE_URL="https://github.com/libimobiledevice/usbmuxd")
list(APPEND DEFINITIONS -DPACKAGE_BUGREPORT="https://github.com/libimobiledevice/usbmuxd/issues")
if(UNIX)
list(APPEND DEFINITIONS -DHAVE_CLOCK_GETTIME)
endif()
if(UNIX AND NOT APPLE)
list(APPEND DEFINITIONS -DHAVE_PPOLL)
endif()
if(WIN32)
list(APPEND DEFINITIONS -D_CRT_SECURE_NO_WARNINGS)
list(APPEND DEFINITIONS -DWIN32)
endif()
find_package(unofficial-libimobiledevice CONFIG REQUIRED)
find_package(unofficial-libimobiledevice-glue CONFIG REQUIRED)
find_package(libusb CONFIG REQUIRED)
find_path(DIRENT_INCLUDE_DIR dirent.h REQUIRED)
add_executable(usbmuxd ${USBMUXD_SOURCE})
target_include_directories(usbmuxd PRIVATE
${LIBUSB_INCLUDE_DIRS}
${DIRENT_INCLUDE_DIR}
)
target_compile_definitions(usbmuxd PRIVATE ${DEFINITIONS})
target_link_libraries(usbmuxd PRIVATE
unofficial::libimobiledevice::libimobiledevice
unofficial::libimobiledevice-glue::libimobiledevice-glue
${LIBUSB_LIBRARIES}
)
if(WIN32)
find_package(PThreads4W REQUIRED)
find_package(unofficial-getopt-win32 REQUIRED)
target_link_libraries(usbmuxd PRIVATE PThreads4W::PThreads4W unofficial::getopt-win32::getopt)
endif()
install(TARGETS usbmuxd
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

View File

@ -1,40 +0,0 @@
diff --git a/usbmuxd.vcxproj b/usbmuxd.vcxproj
index 1500a8a..61362c3 100644
--- a/usbmuxd.vcxproj
+++ b/usbmuxd.vcxproj
@@ -129,7 +129,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_USE_32BIT_TIME_T;HAVE_LIBIMOBILEDEVICE</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_USE_32BIT_TIME_T;HAVE_LIBIMOBILEDEVICE;HAVE_ENUM_IDEVICE_CONNECTION_TYPE;PACKAGE_URL="";PACKAGE_BUGREPORT=""</PreprocessorDefinitions>
<TreatSpecificWarningsAsErrors>4013</TreatSpecificWarningsAsErrors>
</ClCompile>
<Link>
@@ -144,7 +144,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;WIN32;HAVE_LIBIMOBILEDEVICE</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;WIN32;HAVE_LIBIMOBILEDEVICE;HAVE_ENUM_IDEVICE_CONNECTION_TYPE;PACKAGE_URL="";PACKAGE_BUGREPORT=""</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -160,7 +160,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_USE_32BIT_TIME_T;HAVE_LIBIMOBILEDEVICE</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_USE_32BIT_TIME_T;HAVE_LIBIMOBILEDEVICE;HAVE_ENUM_IDEVICE_CONNECTION_TYPE;PACKAGE_URL="";PACKAGE_BUGREPORT=""</PreprocessorDefinitions>
<TreatSpecificWarningsAsErrors>4013</TreatSpecificWarningsAsErrors>
</ClCompile>
<Link>
@@ -179,7 +179,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;WIN32;HAVE_LIBIMOBILEDEVICE</PreprocessorDefinitions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;WIN32;HAVE_LIBIMOBILEDEVICE;HAVE_ENUM_IDEVICE_CONNECTION_TYPE;PACKAGE_URL="";PACKAGE_BUGREPORT=""</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>

View File

@ -1,40 +0,0 @@
diff --git a/usbmuxd.vcxproj b/usbmuxd.vcxproj
index d1d8a4d..086e8a4 100644
--- a/usbmuxd.vcxproj
+++ b/usbmuxd.vcxproj
@@ -135,7 +135,7 @@
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>ws2_32.lib;libusb-1.0.lib;libusb0.lib;pthreadsVC2d.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;libusb-1.0.lib;libusb0.lib;pthreadVC3d.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -149,7 +149,7 @@
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>ws2_32.lib;libusb-1.0.lib;libusb0.lib;pthreadsVC2d.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;libusb-1.0.lib;libusb0.lib;pthreadVC3d.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -168,7 +168,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>ws2_32.lib;libusb-1.0.lib;libusb0.lib;pthreadsVC2.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;libusb-1.0.lib;libusb0.lib;pthreadVC3.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -186,7 +186,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>ws2_32.lib;libusb-1.0.lib;libusb0.lib;pthreadsVC2.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;libusb-1.0.lib;libusb0.lib;pthreadVC3.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@ -1,22 +1,22 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libimobiledevice-win32/usbmuxd
REF f1329e742825c93fd080bdb8253d710ef8b6f751 # v1.2.235
SHA512 3259040a3266ce068a6fa1fdecdea824d22f04391ca073fc61d72a1f6d401d93469b9681ddc89a8016ef410bb7443875b2c5df2b571227dd34c66248cbe87fe7
HEAD_REF master-msvc
PATCHES
fix-dependence-pthreads.patch
fix-definitions.patch
REPO libimobiledevice/usbmuxd
REF 61b99ab5c25609c11369733a0df97c03a0581a56 # commits on 2023-07-21
SHA512 1b67a41f43e78bbf0966cbe68c9e35351d5a163d7d82aa6e5caed6c4f8ffc3c28faf74dc96890a35481b4856f6b6d95ebec9e8d2a665a099d8909b91bf408381
HEAD_REF master
)
vcpkg_msbuild_install(
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
PROJECT_SUBPATH usbmuxd.vcxproj
DEPENDENT_PKGCONFIG libimobiledevice-1.0
ADDITIONAL_LIBS getopt.lib
)
# No headers
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
vcpkg_cmake_install()
vcpkg_copy_tools(TOOL_NAMES usbmuxd AUTO_CLEAN)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING.GPLv2")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING.GPLv2" "${SOURCE_PATH}/COPYING.GPLv3")
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)

View File

@ -1,23 +1,20 @@
{
"name": "usbmuxd",
"version": "1.2.235",
"port-version": 5,
"version-date": "2023-07-21",
"description": "A socket daemon to multiplex connections from and to iOS devices",
"homepage": "http://www.libimobiledevice.org",
"license": "LGPL-2.1-only",
"supports": "windows & !arm64 & !static & !xbox",
"license": "LGPL-2.0-or-later",
"supports": "(!windows & !android & !ios) | mingw",
"dependencies": [
"dirent",
"getopt",
"libimobiledevice",
"libimobiledevice-glue",
"libusb",
"libusb-win32",
"pthreads",
{
"name": "vcpkg-msbuild",
"host": true,
"features": [
"pkg-config"
],
"platform": "windows"
"name": "vcpkg-cmake",
"host": true
}
]
}

View File

@ -3269,12 +3269,12 @@
"port-version": 0
},
"ideviceinstaller": {
"baseline": "1.1.2.23",
"port-version": 7
"baseline": "2023-07-21",
"port-version": 0
},
"idevicerestore": {
"baseline": "1.0.12",
"port-version": 8
"baseline": "2023-05-23",
"port-version": 0
},
"idyntree": {
"baseline": "9.0.0",
@ -4241,7 +4241,7 @@
"port-version": 0
},
"libideviceactivation": {
"baseline": "1.3.17",
"baseline": "2023-05-01",
"port-version": 0
},
"libidn2": {
@ -4257,12 +4257,16 @@
"port-version": 0
},
"libimobiledevice": {
"baseline": "1.3.17",
"port-version": 4
"baseline": "2023-07-05",
"port-version": 0
},
"libimobiledevice-glue": {
"baseline": "2023-05-13",
"port-version": 0
},
"libirecovery": {
"baseline": "1.0.25",
"port-version": 8
"baseline": "2023-05-13",
"port-version": 0
},
"libjpeg-turbo": {
"baseline": "3.0.0",
@ -4493,8 +4497,8 @@
"port-version": 0
},
"libplist": {
"baseline": "1.3.6",
"port-version": 2
"baseline": "2023-06-15",
"port-version": 0
},
"libpmemobj-cpp": {
"baseline": "1.13.0",
@ -4785,8 +4789,8 @@
"port-version": 10
},
"libusbmuxd": {
"baseline": "1.2.219",
"port-version": 3
"baseline": "2023-06-21",
"port-version": 0
},
"libuuid": {
"baseline": "1.0.3",
@ -8465,8 +8469,8 @@
"port-version": 0
},
"usbmuxd": {
"baseline": "1.2.235",
"port-version": 5
"baseline": "2023-07-21",
"port-version": 0
},
"usd": {
"baseline": "23.5",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "eff7fcd07b94280ed7c5517ac113b95b3b3bd6a3",
"version-date": "2023-07-21",
"port-version": 0
},
{
"git-tree": "7aba247c233ef7200fd22094b8a44c7c836a62d8",
"version": "1.1.2.23",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b2bbff840af200a3f2b21b5d19f95f223aca4428",
"version-date": "2023-05-23",
"port-version": 0
},
{
"git-tree": "6d1dcd84f69fa4a5006fd26741e2dfd6fbf38a16",
"version": "1.0.12",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5f8ea4177ba77bb2eb82284c8ee31504cb7dfbc7",
"version-date": "2023-05-01",
"port-version": 0
},
{
"git-tree": "5ff1d3dc1c70954efdb1b56ea38660c8e2817a68",
"version": "1.3.17",

View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "8511a9380c2fc23a78609fd9aaf5a7dde1aef135",
"version-date": "2023-05-13",
"port-version": 0
}
]
}

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b7b8456460bdd58cd90cd74a468c6e16a2053f36",
"version-date": "2023-07-05",
"port-version": 0
},
{
"git-tree": "7b950fc1c05e12ac6349b88de19d2df84e9393a7",
"version": "1.3.17",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "0e9b8ce22a277344a7f29c62f38bf44458a129ba",
"version-date": "2023-05-13",
"port-version": 0
},
{
"git-tree": "d3d139450efc9411edc51dea49130dddf09a08d0",
"version": "1.0.25",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8a79aaf94792ae73eea5094eebac773fe6705b54",
"version-date": "2023-06-15",
"port-version": 0
},
{
"git-tree": "e18bc499ccc42a248f2d88c1f5614d4f4314f4eb",
"version": "1.3.6",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "7a9145917e1df41e8820d26c2e167f3839d7a947",
"version-date": "2023-06-21",
"port-version": 0
},
{
"git-tree": "82278a08f20aabe20c5ba0981de631ad6f9df469",
"version": "1.2.219",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "edc61063b642372c7d9de82f7ecc55ed39971c3d",
"version-date": "2023-07-21",
"port-version": 0
},
{
"git-tree": "4116e3cd80421add75aeeb413386b03cbfad5670",
"version": "1.2.235",