Licensing API
There are two ways to check a licence, and they give the same answer.
Anything ending in _inline is compiled into your own tweak from
the header; everything else is a normal function call into
TI_Support.dylib.
The inline one needs nothing from TI_Support, so your tweak carries no licence function, and no giveaway text either: the receipt path and the field names it looks for are encoded in the header and rebuilt as it runs, so searching the binary for them finds nothing. The dylib one keeps your binary smaller and is easier to read in a stack trace. The macros below use both at once.
Getting the header
TILicense.h is in headers.zip on the releases
page, with the rest of the
TI_Support headers. Include it and
link TI_Support.dylib.
#import "TILicense.h"
What is available
| Name | Kind | Purpose |
|---|---|---|
TILicenseCheck_inline |
Function | Plain yes or no, compiled into your tweak. |
TILicenseCheck |
Function | The same answer, from TI_Support.dylib. |
TIL_DISPATCH |
Macro | Calls a function only when licensed, with no branch. |
TIL_DISPATCH_OR |
Macro | As above, with your own fallback instead of a stub. |
TIL_DISPATCH_CALL |
Macro | Same, for a function that takes arguments and returns a value. |
TIL_DISPATCH_FN |
Macro | Resolves to a function pointer rather than calling it. |
TIL_GUARD_PTR |
Macro | Passes a pointer through, or poisons it when unlicensed. |
TIL_HOOK |
Macro | Installs an MSHookFunction hook only when licensed. |
Why there are two checks
The macros check twice: once in code compiled into your tweak, and once by asking TI_Support.dylib. Both have to agree, so removing the dylib does not turn the check into a pass, and patching the copy inside your tweak is not enough on its own. Someone bypassing it has to deal with both.