From 6f0efaf1f0710f5f1d29c3b050d8a5362023bd81 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 27 Jan 2022 01:05:29 -0800 Subject: Correctly handle nesting frameworks in frameworks. --- ldid.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ldid.cpp b/ldid.cpp index 0d4cb73..78fd73a 100644 --- a/ldid.cpp +++ b/ldid.cpp @@ -2782,7 +2782,7 @@ struct State { } }; -Bundle Sign(const std::string &root, Folder &parent, const std::string &key, State &remote, const std::string &requirements, const Functor &alter, const Progress &progress) { +Bundle Sign(const std::string &root, Folder &parent, const std::string &key, State &local, const std::string &requirements, const Functor &alter, const Progress &progress) { std::string executable; std::string identifier; @@ -2861,8 +2861,6 @@ Bundle Sign(const std::string &root, Folder &parent, const std::string &key, Sta rules2.insert(Rule{20, NoMode, "^version\\.plist$"}); } - State local; - std::string failure(mac ? "Contents/|Versions/[^/]*/Resources/" : ""); Expression nested("^(Frameworks/[^/]*\\.framework|PlugIns/[^/]*\\.appex(()|/[^/]*.app))/(" + failure + ")Info\\.plist$"); std::map bundles; @@ -2870,16 +2868,18 @@ Bundle Sign(const std::string &root, Folder &parent, const std::string &key, Sta folder.Find("", fun([&](const std::string &name) { if (!nested(name)) return; - auto bundle(root + Split(name).dir); + auto bundle(Split(name).dir); if (mac) { _assert(!bundle.empty()); bundle = Split(bundle.substr(0, bundle.size() - 1)).dir; } SubFolder subfolder(folder, bundle); - bundles[nested[1]] = Sign(bundle, subfolder, key, local, "", Starts(name, "PlugIns/") ? alter : + State remote; + bundles[nested[1]] = Sign(root + bundle, subfolder, key, remote, "", Starts(name, "PlugIns/") ? alter : static_cast &>(fun([&](const std::string &, const std::string &) -> std::string { return entitlements; })) , progress); + local.Merge(bundle, remote); }), fun([&](const std::string &name, const Functor &read) { })); @@ -3066,7 +3066,6 @@ Bundle Sign(const std::string &root, Folder &parent, const std::string &key, Sta })); })); - remote.Merge(root, local); return bundle; } -- cgit v1.2.3-56-ge451