From 0178c63f6ae3273ce227f147308eb2039de5fd14 Mon Sep 17 00:00:00 2001 From: naturecodevoid <44983869+naturecodevoid@users.noreply.github.com> Date: Wed, 12 Apr 2023 19:53:27 -0700 Subject: [PATCH] fix: hopefully reduce ApplicationVerificationFailed errors by removing _CodeSignature folders since those may cause a problem --- AltStore/Operations/ResignAppOperation.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AltStore/Operations/ResignAppOperation.swift b/AltStore/Operations/ResignAppOperation.swift index a6098e00..12760205 100644 --- a/AltStore/Operations/ResignAppOperation.swift +++ b/AltStore/Operations/ResignAppOperation.swift @@ -148,6 +148,14 @@ private extension ResignAppOperation infoDictionary[Bundle.Info.exportedUTIs] = exportedUTIs try (infoDictionary as NSDictionary).write(to: bundle.infoPlistURL) + + // Remove _CodeSignature folder (if it exists) because it will be added when resigning and it may have files that aren't overwritten when resigning + // These files might be the cause of some ApplicationVerificationFailed errors + let codeSignaturePath = bundle.bundleURL.appendingPathComponent("_CodeSignature").absoluteString + if FileManager.default.fileExists(atPath: codeSignaturePath) { + try FileManager.default.removeItem(atPath: codeSignaturePath) + print("Removed _CodeSignature folder at \(codeSignaturePath)") + } } DispatchQueue.global().async {