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
40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
#ifndef PLIST_HELPERS_H
|
|
#define PLIST_HELPERS_H
|
|
|
|
#include <stdint.h>
|
|
#include "compat/plist_compat.h"
|
|
|
|
/*
|
|
* Retrieve a string value from a plist dict by key.
|
|
* Returns a malloc'd copy the caller must free, or NULL on error.
|
|
*/
|
|
char *plist_dict_get_string(plist_t dict, const char *key);
|
|
|
|
/*
|
|
* Retrieve a boolean value from a plist dict by key.
|
|
* Stores result in *out (1=true, 0=false).
|
|
* Returns 0 on success, -1 on error.
|
|
*/
|
|
int plist_dict_get_bool_val(plist_t dict, const char *key, int *out);
|
|
|
|
/*
|
|
* Retrieve an unsigned 64-bit integer value from a plist dict by key.
|
|
* Stores result in *out.
|
|
* Returns 0 on success, -1 on error.
|
|
*/
|
|
int plist_dict_get_uint_val(plist_t dict, const char *key, uint64_t *out);
|
|
|
|
/*
|
|
* Serialize a plist to an XML string.
|
|
* *len is set to the byte length (excluding NUL).
|
|
* Returns a plist-allocated string; caller must free with plist_mem_free().
|
|
*/
|
|
char *plist_to_xml_string(plist_t plist, uint32_t *len);
|
|
|
|
/*
|
|
* Parse an XML plist from a buffer.
|
|
* Returns a new plist_t the caller must free with plist_free(), or NULL on error.
|
|
*/
|
|
plist_t plist_from_xml_string(const char *xml, uint32_t len);
|
|
|
|
#endif /* PLIST_HELPERS_H */
|