diff --git a/Entitlements.plist b/Entitlements.plist new file mode 100644 index 00000000..db3305d2 --- /dev/null +++ b/Entitlements.plist @@ -0,0 +1,18 @@ + + + + + com.apple.security.get-task-allow + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.disable-library-validation + + com.apple.security.device.audio-input + + com.apple.security.device.camera + + + diff --git a/Makefile b/Makefile index d4f15799..2bf6f2da 100644 --- a/Makefile +++ b/Makefile @@ -83,9 +83,10 @@ valgrind: $(TARGET) clean: rm -rfv $(TARGET) libRack.a Rack.res build dist -ifdef ARCH_WIN + # For Windows resources %.res: %.rc +ifdef ARCH_WIN windres $^ -O coff -o $@ endif @@ -96,6 +97,7 @@ dist: $(TARGET) mkdir -p dist $(MAKE) -C plugins/Fundamental dist + $(MAKE) -C plugins/Fundamental sign-dist ifdef ARCH_LIN mkdir -p dist/Rack @@ -126,9 +128,9 @@ ifdef ARCH_MAC # Clean up and sign bundle xattr -cr dist/$(TARGET).app # This will only work if you have the private key to my certificate - codesign --verbose --sign "Developer ID Application: Andrew Belt (VRF26934X5)" --deep dist/$(TARGET).app + codesign --verbose --sign "Developer ID Application: Andrew Belt (VRF26934X5)" --options runtime --entitlements Entitlements.plist --deep dist/$(TARGET).app codesign --verify --deep --strict --verbose=2 dist/$(TARGET).app - #spctl --assess --type execute --ignore-cache --no-cache -vv dist/$(TARGET).app +# spctl --assess --type execute --ignore-cache --no-cache -vv dist/$(TARGET).app # Make ZIP cd dist && zip -q -9 -r Rack-$(VERSION)-$(ARCH).zip $(TARGET).app endif @@ -163,6 +165,25 @@ endif cd dist && zip -q -9 -r Rack-SDK-$(VERSION).zip Rack-SDK +notarize: +ifdef ARCH_MAC + # This will only work if you have my Apple ID password in your keychain + xcrun altool --notarize-app -f dist/Rack-$(VERSION)-$(ARCH).zip --primary-bundle-id=com.vcvrack.rack -u "andrewpbelt@gmail.com" -p @keychain:notarize --output-format xml > dist/UploadInfo.plist + # Wait for Apple's servers to approve the app + while true; do \ + xcrun altool --notarization-info `/usr/libexec/PlistBuddy -c "Print :notarization-upload:RequestUUID" dist/UploadInfo.plist` -u "andrewpbelt@gmail.com" -p @keychain:notarize --output-format xml > dist/RequestInfo.plist ; \ + if [ "`/usr/libexec/PlistBuddy -c "Print :notarization-info:Status" dist/RequestInfo.plist`" != "in progress" ]; then \ + break ; \ + fi ; \ + sleep 10 ; \ + done + # Mark app as notarized, check, and re-zip + xcrun stapler staple dist/$(TARGET).app + spctl --assess --type execute --ignore-cache --no-cache -vv dist/$(TARGET).app + cd dist && zip -q -9 -r Rack-$(VERSION)-$(ARCH).zip $(TARGET).app +endif + + UPLOAD_URL := vortico@vcvrack.com:files/ upload: # This will only work if you have a private key to my server diff --git a/include/patch.hpp b/include/patch.hpp index d71918e1..f6ff9712 100644 --- a/include/patch.hpp +++ b/include/patch.hpp @@ -24,6 +24,7 @@ struct PatchManager { void saveTemplateDialog(); bool load(std::string path); void loadDialog(); + void loadPathDialog(std::string path); /** If `lastPath` is defined, ask the user to reload it */ void revertDialog(); /** Disconnects all cables */ diff --git a/src/app/Scene.cpp b/src/app/Scene.cpp index 3518581e..becbf1ba 100644 --- a/src/app/Scene.cpp +++ b/src/app/Scene.cpp @@ -156,17 +156,16 @@ void Scene::onHoverKey(const event::HoverKey &e) { } void Scene::onPathDrop(const event::PathDrop &e) { - OpaqueWidget::onPathDrop(e); - if (e.isConsumed()) - return; - if (e.paths.size() >= 1) { const std::string &path = e.paths[0]; if (string::filenameExtension(string::filename(path)) == "vcv") { - APP->patch->load(path); + APP->patch->loadPathDialog(path); e.consume(this); + return; } } + + OpaqueWidget::onPathDrop(e); } diff --git a/src/patch.cpp b/src/patch.cpp index 4c384396..f8eb463d 100644 --- a/src/patch.cpp +++ b/src/patch.cpp @@ -218,6 +218,15 @@ void PatchManager::loadDialog() { APP->history->setSaved(); } +void PatchManager::loadPathDialog(std::string path) { + if (!promptClear("The current patch is unsaved. Clear it and open the new patch?")) + return; + + load(path); + this->path = path; + APP->history->setSaved(); +} + void PatchManager::revertDialog() { if (path.empty()) return;