tr4mpass/include/activation/activation.h
Moussa Ouallaf 9bd1a75b2d build(deps): fix pkg-config skew, libusb include, libplist/libirecovery drift
Sync PKGCONFIG_DEPS with Makefile (add libcurl); normalize
<libusb.h> include across 6 files; add compat shims for libplist
2.2/2.3 and libirecovery IRECV_SEND_OPT_DFU_NOTIFY_FINISH; add
pacman/zypper/apk installer branches; drop bogus info->pid read
in path_b_identity.c in favor of irecv_get_mode(). Extend the
mock libirecovery to expose irecv_get_mode() so the mock test
build keeps passing against the new call site. Add Makefile
compile canaries that emit -DTP_PLIST_HAS_MEM_FREE,
-DTP_PLIST_HAS_FMT_ARG, and -DTP_IRECV_HAS_NOTIFY_FINISH plus a
.build-flags diagnostic file consumed by tr4mpass doctor.

Files modified:
- Makefile
- start.sh
- start-helpers.sh
- include/compat/plist_compat.h (new)
- include/compat/libirecovery_compat.h (new)
- include/util/usb_helpers.h
- include/util/plist_helpers.h
- include/exploit/dfu_proto.h
- include/device/device.h
- include/device/usb_dfu.h
- include/activation/activation.h
- include/activation/record.h
- src/bypass/path_b_identity.c
- src/bypass/path_b.c
- src/bypass/path_a_ramdisk.c
- src/activation/session_online.c
- tests/mocks/mock_irecv_sym.c
- .gitignore

Closes: #70, #74, #67, #54, #51, #44, #21, #55, #31, #24, #19
2026-07-17 02:43:53 +02:00

74 lines
2.6 KiB
C

/*
* activation.h -- Activation protocol client.
*
* Wraps the libimobiledevice mobileactivation API for querying activation
* state, retrieving session info blobs, submitting activation records,
* and session-mode activation (iOS 11.2+).
*/
#ifndef ACTIVATION_H
#define ACTIVATION_H
#include <stdint.h>
#include <stddef.h>
#include "compat/plist_compat.h"
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/mobileactivation.h>
#include "device/device.h"
/*
* activation_get_state -- Query the device's current activation state.
* Writes the state string (e.g. "Unactivated", "Activated") into buf.
* Returns 0 on success, -1 on error.
*/
int activation_get_state(device_info_t *dev, char *buf, size_t buf_len);
/*
* activation_get_session_info -- Retrieve the DRM handshake session blob.
* On success, *blob_xml is set to an XML string and *blob_len to its length.
* The string is allocated by libplist; caller must free with plist_mem_free(),
* NOT free() or plist_free().
* Returns 0 on success, -1 on error.
*/
int activation_get_session_info(device_info_t *dev,
char **blob_xml, uint32_t *blob_len);
/*
* activation_get_info -- Retrieve full activation info from the device.
* On success, *info_xml is set to an XML string and *info_len to its length.
* The string is allocated by libplist; caller must free with plist_mem_free(),
* NOT free() or plist_free().
* Returns 0 on success, -1 on error.
*/
int activation_get_info(device_info_t *dev,
char **info_xml, uint32_t *info_len);
/*
* activation_submit_record -- Submit an activation record plist to the device.
* record_xml is an XML plist string. Returns 0 on success, -1 on error.
*/
int activation_submit_record(device_info_t *dev,
const char *record_xml, uint32_t record_len);
/*
* activation_submit_record_with_session -- Submit an activation record with
* session headers from the drmHandshake response (iOS 11.2+ requirement).
* session_headers is the plist dict returned by the activation server.
* Returns 0 on success, -1 on error.
*/
int activation_submit_record_with_session(device_info_t *dev,
const char *record_xml, uint32_t record_len, plist_t session_headers);
/*
* activation_deactivate -- Deactivate the device (reset activation state).
* Returns 0 on success, -1 on error.
*/
int activation_deactivate(device_info_t *dev);
/*
* activation_is_activated -- Check if the device is currently activated.
* Returns 1 if activated, 0 if not activated, -1 on error.
*/
int activation_is_activated(device_info_t *dev);
#endif /* ACTIVATION_H */