Skip to content

Commit 6c6a623

Browse files
author
hackcatml
committed
simplify signing the dumped binary with ldid
1 parent 86d95de commit 6c6a623

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

Sources/mldecryptapp/ContentView.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,9 @@ struct ContentView: View {
263263
let replacementFile = "\(documentsPath)\(bundleExecutable).decrypted"
264264
// os_log("[hackcatml] fileToReplace: %{public}s, replacementFile: %{public}s", fileToReplace, replacementFile)
265265

266-
let command = isRootless() ? "/var/jb/usr/bin/ldid" : "/usr/bin/ldid"
267-
// extract the entitlements from the dumped binary. it's same as the original one
268-
let out = task(launchPath: command, arguments: "-e", replacementFile)
269-
let entitlementsPath = workPathURL!.path + "/ent.xml"
270-
let data = out.data(using: .utf8)
271-
fileMgr.createFile(atPath: entitlementsPath, contents: data)
272-
273266
// signing the dumped binary with ldid.
274-
let _ = task(launchPath: command, arguments: "-S\(entitlementsPath)", "\(replacementFile)")
267+
let command = isRootless() ? "/var/jb/usr/bin/ldid" : "/usr/bin/ldid"
268+
let _ = task(launchPath: command, arguments: "-S", "-M", "\(replacementFile)")
275269
// Replace the original binary file with the dumped one
276270
let copyFileSigPath = documentsPath + ".mldecrypt_copy_done"
277271
callMldecryptWithOptions(options: ["copy", replacementFile, fileToReplace, "ext"])

0 commit comments

Comments
 (0)