aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2022-07-20 23:26:16 -0400
committerCameron Katri <me@cameronkatri.com>2022-07-20 23:26:16 -0400
commite605d49a6079a2852e60115d5003d243ec0cd51d (patch)
tree1a18849e9bbe15913042042bd42b6533bbe299a1
parent761e019876021e4161c8b890039b375d3aeec546 (diff)
downloadldid-e605d49a6079a2852e60115d5003d243ec0cd51d.tar.gz
ldid-e605d49a6079a2852e60115d5003d243ec0cd51d.tar.zst
ldid-e605d49a6079a2852e60115d5003d243ec0cd51d.zip
Document new -P functionality
-rw-r--r--_ldid2
-rw-r--r--docs/ldid.18
-rw-r--r--ldid.cpp4
3 files changed, 9 insertions, 5 deletions
diff --git a/_ldid b/_ldid
index db8a90a..ed7bf90 100644
--- a/_ldid
+++ b/_ldid
@@ -12,6 +12,6 @@ _arguments \
'-H-[Hash type]:hash:(sha1 sha256)' \
'-I-[Set identifier]:identifier' \
'-K-[Signing private key]:key:_files' \
- '-P[Set as platform]' \
+ '-P-[Set as platform]:number' \
'-U-[Password for -K]' \
'*: :_files'
diff --git a/docs/ldid.1 b/docs/ldid.1
index 4034137..2f13068 100644
--- a/docs/ldid.1
+++ b/docs/ldid.1
@@ -22,7 +22,7 @@
.Op Fl I Ns Ar name
.Op Fl K Ns Ar key.p12 Op Fl U Ns Ar password
.Op Fl M
-.Op Fl P
+.Op Fl P Ns Op Ar num
.Op Fl Q Ns Ar requirements
.Op Fl q
.Op Fl r | Fl S Ns Ar file.xml | Fl s
@@ -106,8 +106,12 @@ When used with
merge the new and existing entitlements instead of replacing the existing
entitlements, this is useful for adding a few specific entitlements to a
handful of binaries.
-.It Fl P
+.It Fl P Ns Op Ar num
Mark the Mach-O as a platform binary.
+If
+.Ar num
+is specified, the platform field in the CodeDirectory will be set to that number.
+The default is 13, as per Apple binaries.
.It Fl Q Ns Ar requirements.xml
Embed the requirements found in
.Ar requirements .
diff --git a/ldid.cpp b/ldid.cpp
index 2e54207..4d19c93 100644
--- a/ldid.cpp
+++ b/ldid.cpp
@@ -3144,9 +3144,9 @@ static void usage(const char *argv0) {
fprintf(stderr, "Usage: %s [-Acputype:subtype] [-a] [-C[adhoc | enforcement | expires | hard |\n", argv0);
fprintf(stderr, " host | kill | library-validation | restrict | runtime]] [-D] [-d]\n");
fprintf(stderr, " [-Enum:file] [-e] [-H[sha1 | sha256]] [-h] [-Iname]\n");
- fprintf(stderr, " [-Kkey.p12 [-Upassword]] [-M] [-P] [-Qrequirements.xml] [-q]\n");
+ fprintf(stderr, " [-Kkey.p12 [-Upassword]] [-M] [-P[num]] [-Qrequirements.xml] [-q]\n");
fprintf(stderr, " [-r | -Sfile.xml | -s] [-u] [-arch arch_type] file ...\n");
- fprintf(stderr, "Options:\n");
+ fprintf(stderr, "Common Options:\n");
fprintf(stderr, " -S[file.xml] Pseudo-sign using the entitlements in file.xml\n");
fprintf(stderr, " -Kkey.p12 Sign using private key in key.p12\n");
fprintf(stderr, " -Upassword Use password to unlock key.p12\n");