tr4mpass/include/activation/record.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

67 lines
2.2 KiB
C

/*
* record.h -- Activation record plist builder.
*
* Constructs activation record plists from device information. These
* records contain AccountToken, DeviceCertificate, FairPlayKeyData,
* UniqueDeviceCertificate, and related fields needed by the activation
* protocol.
*/
#ifndef RECORD_H
#define RECORD_H
#include <stdint.h>
#include "compat/plist_compat.h"
#include <libimobiledevice/lockdown.h>
#include "device/device.h"
/*
* record_build -- Build a complete activation record from device info.
* Returns a new plist dict containing all required activation fields.
* Caller must free with record_free() or plist_free().
* Returns NULL on error.
*
* Equivalent to record_build_with_client(dev, NULL): cert fields are
* left as empty-blob placeholders.
*/
plist_t record_build(const device_info_t *dev);
/*
* record_build_a12 -- Build an A12+ specific activation record.
* Uses the FActivation/drmHandshake variant with additional fields
* required for A12 and newer chipsets (SEP-aware activation).
* Returns a new plist dict, or NULL on error. Caller must free.
*
* Equivalent to record_build_a12_with_client(dev, NULL).
*/
plist_t record_build_a12(const device_info_t *dev);
/*
* record_build_with_client -- As record_build, but when `client` is
* non-NULL, pull DeviceCertificate / AccountTokenCertificate /
* UniqueDeviceCertificate from lockdownd and embed them in the record.
* Falls back to empty-blob placeholders if extraction fails.
*/
plist_t record_build_with_client(const device_info_t *dev,
lockdownd_client_t client);
/*
* record_build_a12_with_client -- As record_build_a12, but with live
* cert extraction when `client` is non-NULL (see above).
*/
plist_t record_build_a12_with_client(const device_info_t *dev,
lockdownd_client_t client);
/*
* record_to_xml -- Serialize an activation record to XML string.
* On success, *len is set to the byte length (excluding NUL).
* Returns a plist-allocated string; caller must free with plist_mem_free().
*/
char *record_to_xml(plist_t record, uint32_t *len);
/*
* record_free -- Free an activation record plist.
*/
void record_free(plist_t record);
#endif /* RECORD_H */