Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
Restore the ability to add adjustments, use Quick Brushes, and to pri…
Browse files Browse the repository at this point in the history
…nt photos in Aperture.
  • Loading branch information
cormiertyshawn895 committed Nov 7, 2019
1 parent 8a8c760 commit bcc760f
Show file tree
Hide file tree
Showing 25 changed files with 242 additions and 81 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Retroactive is an app that lets you run Aperture, iPhoto, and iTunes on macOS Catalina. [Click to download the Retroactive app](https://github.com/cormiertyshawn895/Retroactive/releases/download/1.0/Retroactive.1.0.zip), or [view the release page](https://github.com/cormiertyshawn895/Retroactive/releases).
## Retroactive is an app that lets you run Aperture, iPhoto, and iTunes on macOS Catalina. [Click to download the Retroactive app](https://github.com/cormiertyshawn895/Retroactive/releases/download/1.1/Retroactive.1.1.zip), or [view the release page](https://github.com/cormiertyshawn895/Retroactive/releases).

---

Expand Down
8 changes: 6 additions & 2 deletions Retroactive.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,14 @@
CODE_SIGN_ENTITLEMENTS = Retroactive/Support/Retroactive.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
INFOPLIST_FILE = Retroactive/Support/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
MARKETING_VERSION = 1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.retroactive.Retroactive;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Retroactive/Libraries/Bridging-Header.h";
Expand All @@ -511,12 +513,14 @@
CODE_SIGN_ENTITLEMENTS = Retroactive/Support/Retroactive.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
INFOPLIST_FILE = Retroactive/Support/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
MARKETING_VERSION = 1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.retroactive.Retroactive;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Retroactive/Libraries/Bridging-Header.h";
Expand Down
11 changes: 7 additions & 4 deletions Retroactive/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
return NSApp.mainWindow?.contentViewController as? RootViewController
}
}

static func openKBArticle(_ identifier: String) {
let url = URL(string:"https://support.apple.com/en-us/HT\(identifier)")!
NSWorkspace.shared.open(url)
}

static func showOptionSheet(title: String, text: String, firstButtonText: String, secondButtonText: String, thirdButtonText: String, callback: @escaping ((_ response: NSApplication.ModalResponse)-> ())) {
let alert = NSAlert()
Expand Down Expand Up @@ -148,9 +153,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
if (AppManager.shared.hasNewerVersion == true) {
self.promptForUpdateAvailable()
} else {
Timer.scheduledTimer(withTimeInterval: 1.0, repeats: false) { (timer) in
self.promptForUpdateAvailable()
}
Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(promptForUpdateAvailable), userInfo: nil, repeats: false)
}
}

Expand Down Expand Up @@ -180,7 +183,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}

func promptForUpdateAvailable() {
@objc func promptForUpdateAvailable() {
if (AppManager.shared.hasNewerVersion == true) {
AppDelegate.showOptionSheet(title: AppManager.shared.newVersionVisibleTitle ?? "Update available.", text: AppManager.shared.newVersionChangelog ?? "A newer version of Retroactive is available.", firstButtonText: "Download", secondButtonText: "Learn More...", thirdButtonText: "Cancel") { (response) in
if (response == .alertFirstButtonReturn) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@
CLANG_ENABLE_OBJC_ARC = NO;
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
Expand All @@ -278,6 +279,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
PRODUCT_BUNDLE_IDENTIFIER = com.gentlemencoders.ApertureFixer;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -291,6 +293,7 @@
CLANG_ENABLE_OBJC_ARC = NO;
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
Expand All @@ -303,6 +306,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.10;
PRODUCT_BUNDLE_IDENTIFIER = com.gentlemencoders.ApertureFixer;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1120"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "24829F65235E478C00D5891C"
BuildableName = "ApertureFixer.framework"
BlueprintName = "ApertureFixer"
ReferencedContainer = "container:ApertureFixer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "24829F65235E478C00D5891C"
BuildableName = "ApertureFixer.framework"
BlueprintName = "ApertureFixer"
ReferencedContainer = "container:ApertureFixer.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,41 @@ + (void)load {

method_exchangeImplementations(class_getInstanceMethod(NSClassFromString(@"NSWorkspace"), NSSelectorFromString(@"URLForApplicationWithBundleIdentifier:")),
class_getInstanceMethod(class, @selector(patched_URLForApplicationWithBundleIdentifier:)));

Class printClass = NSClassFromString(@"RKPrintPanel");
method_exchangeImplementations(class_getInstanceMethod(NSClassFromString(@"RKPrintPanel"), NSSelectorFromString(@"_updatePageSizePopup")),
class_getInstanceMethod(printClass, @selector(patched_updatePageSizePopup)));

method_exchangeImplementations(class_getInstanceMethod(NSClassFromString(@"RKRedRockApp"), NSSelectorFromString(@"_delayedFinishLaunching")),
class_getInstanceMethod(class, @selector(patched_delayedFinishLaunching)));

method_exchangeImplementations(class_getInstanceMethod(NSClassFromString(@"NSConcretePrintOperation"), NSSelectorFromString(@"runOperation")),
class_getInstanceMethod(class, @selector(patched_runOperation)));

method_exchangeImplementations(class_getInstanceMethod(NSClassFromString(@"RKPrinter"), NSSelectorFromString(@"paperWithID:")),
class_getInstanceMethod(class, @selector(patched_paperWithID:)));
}

- (id)patched_paperWithID:(id)arg1 {
NSLog(@"patching paperWithID to prevent crashes");
return nil;
}

- (void)patched_runOperation {
NSLog(@"patching runOperation to run on main queue to prevent Auto Layout crashes");
dispatch_sync(dispatch_get_main_queue(), ^{
NSLog(@"running operation on main queue");
[self patched_runOperation];
});
}

- (void)patched_delayedFinishLaunching {
NSLog(@"kick delayedFinishLaunching to the next run loop, so that the adjustments menu can populate");
[self performSelector:@selector(patched_delayedFinishLaunching) withObject:nil afterDelay:0];
}

- (void)patched_updatePageSizePopup {
NSLog(@"skipping updatePageSizePopup to prevent a crash");
}

- (BOOL)_hasRowHeaderColumn {
Expand Down
14 changes: 9 additions & 5 deletions Retroactive/Libraries/ConfettiView/ConfettiView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ open class ConfettiView: ConfettiView.View {

self.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
leadingAnchor.constraint(equalTo: superview.leadingAnchor),
topAnchor.constraint(equalTo: superview.topAnchor),
trailingAnchor.constraint(equalTo: superview.trailingAnchor),
bottomAnchor.constraint(equalTo: superview.bottomAnchor)
])
NSLayoutConstraint(item: self, attribute: .leading, relatedBy: .equal, toItem: superview, attribute: .leading, multiplier: 1, constant: 0),
NSLayoutConstraint(item: self, attribute: .top, relatedBy: .equal, toItem: superview, attribute: .top, multiplier: 1, constant: 0),
NSLayoutConstraint(item: self, attribute: .trailing, relatedBy: .equal, toItem: superview, attribute: .trailing, multiplier: 1, constant: 0),
NSLayoutConstraint(item: self, attribute: .bottom, relatedBy: .equal, toItem: superview, attribute: .bottom, multiplier: 1, constant: 0),
])
}

#if canImport(AppKit)
Expand Down Expand Up @@ -119,6 +119,10 @@ open class ConfettiView: ConfettiView.View {
#endif
}

deinit {
NotificationCenter.default.removeObserver(self)
}

open func startConfetti() {
isActive = true

Expand Down
15 changes: 5 additions & 10 deletions Retroactive/RootViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class RootViewController: NSViewController, CCNNavigationControllerDelegate, NSW
self.view.addSubview(self.navigationController.view)

NSLayoutConstraint.activate([
self.view.topAnchor.constraint(equalTo: self.navigationController.view.topAnchor),
self.view.leadingAnchor.constraint(equalTo: self.navigationController.view.leadingAnchor),
self.view.trailingAnchor.constraint(equalTo: self.navigationController.view.trailingAnchor),
self.view.bottomAnchor.constraint(equalTo: self.navigationController.view.bottomAnchor),
NSLayoutConstraint(item: self.view, attribute: .top, relatedBy: .equal, toItem: self.navigationController.view, attribute: .top, multiplier: 1, constant: 0),
NSLayoutConstraint(item: self.view, attribute: .leading, relatedBy: .equal, toItem: self.navigationController.view, attribute: .leading, multiplier: 1, constant: 0),
NSLayoutConstraint(item: self.view, attribute: .trailing, relatedBy: .equal, toItem: self.navigationController.view, attribute: .trailing, multiplier: 1, constant: 0),
NSLayoutConstraint(item: self.view, attribute: .bottom, relatedBy: .equal, toItem: self.navigationController.view, attribute: .bottom, multiplier: 1, constant: 0),
])

titleStackView.wantsLayer = true
Expand All @@ -44,12 +44,7 @@ class RootViewController: NSViewController, CCNNavigationControllerDelegate, NSW
func alertForOSIncompatibility() {
let osVersion = ProcessInfo.processInfo.operatingSystemVersion
if osVersion.minorVersion > 15 {
let patchVersion = osVersion.patchVersion
var patchString = ""
if (patchVersion > 0) {
patchString = ".\(patchVersion)"
}
AppDelegate.showOptionSheet(title: "Update to a newer version of Retroactive", text: "This version of Retroactive is only designed and tested for macOS Catalina, and may be incompatible with macOS \(osVersion.majorVersion).\(osVersion.minorVersion)\(patchString).", firstButtonText: "Check for Updates", secondButtonText: "Run Anyways", thirdButtonText: "Quit") { (response) in
AppDelegate.showOptionSheet(title: "Update to a newer version of Retroactive", text: "This version of Retroactive is only designed and tested for macOS Catalina, and may be incompatible with \(ProcessInfo.versionString).", firstButtonText: "Check for Updates", secondButtonText: "Run Anyways", thirdButtonText: "Quit") { (response) in
if (response == .alertFirstButtonReturn) {
AppDelegate.current.checkForUpdates()
// NSApplication.shared.terminate(self)
Expand Down
10 changes: 6 additions & 4 deletions Retroactive/StepFour/CompletionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CompletionViewController: NSViewController {

static func instantiate() -> CompletionViewController
{
return NSStoryboard.main!.instantiateController(withIdentifier: "CompletionViewController") as! CompletionViewController
return NSStoryboard.standard!.instantiateController(withIdentifier: "CompletionViewController") as! CompletionViewController
}

override func viewDidLoad() {
Expand All @@ -39,9 +39,11 @@ class CompletionViewController: NSViewController {
super.viewDidAppear()
addConfettiView()
confettiView?.startConfetti()
Timer.scheduledTimer(withTimeInterval: 1, repeats: false) { (_) in
self.confettiView?.stopConfetti()
}
Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(stopConfetti), userInfo: nil, repeats: false)
}

@objc func stopConfetti() {
self.confettiView?.stopConfetti()
}

func addConfettiView() {
Expand Down
6 changes: 5 additions & 1 deletion Retroactive/StepOne/AppFinder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ class AppFinder: NSObject {
}

static func openMacAppStore() {
NSWorkspace.shared.openApplication(at: URL(fileURLWithPath: "/System/Applications/App Store.app"), configuration: .init(), completionHandler: nil)
if #available(OSX 10.15, *) {
NSWorkspace.shared.openApplication(at: URL(fileURLWithPath: "/System/Applications/App Store.app"), configuration: .init(), completionHandler: nil)
} else {
NSWorkspace.shared.launchApplication("App Store")
}
}

}
2 changes: 1 addition & 1 deletion Retroactive/StepOne/ChoiceViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ChoiceViewController: NSViewController {

static func instantiate() -> ChoiceViewController
{
NSStoryboard.main!.instantiateController(withIdentifier: "ChoiceViewController") as! ChoiceViewController
NSStoryboard.standard!.instantiateController(withIdentifier: "ChoiceViewController") as! ChoiceViewController
}

override func viewDidLoad() {
Expand Down
3 changes: 1 addition & 2 deletions Retroactive/StepOne/VersionChoiceViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class VersionChoiceViewController: NSViewController {

static func instantiate() -> VersionChoiceViewController
{
return NSStoryboard.main!.instantiateController(withIdentifier: "VersionChoiceViewController") as! VersionChoiceViewController
return NSStoryboard.standard!.instantiateController(withIdentifier: "VersionChoiceViewController") as! VersionChoiceViewController
}

override func viewDidLoad() {
Expand All @@ -23,7 +23,6 @@ class VersionChoiceViewController: NSViewController {
self.screenshotView.image = itunesApp?.previewScreenshot
self.featureDescription.stringValue = itunesApp?.featureDescriptionString ?? ""
self.versionDescription.stringValue = "iTunes \(itunesApp?.versionNumberString ?? "")"
AppManager.shared.choseniTunesVersion = .darkMode
}

}
3 changes: 2 additions & 1 deletion Retroactive/StepOne/VersionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class VersionViewController: NSViewController {

static func instantiate() -> VersionViewController
{
return NSStoryboard.main!.instantiateController(withIdentifier: "VersionViewController") as! VersionViewController
return NSStoryboard.standard!.instantiateController(withIdentifier: "VersionViewController") as! VersionViewController
}

override func viewDidLoad() {
Expand All @@ -36,6 +36,7 @@ class VersionViewController: NSViewController {
}
nextButton.updateTitle()
self.selectedVersion = .darkMode
AppManager.shared.choseniTunesVersion = .darkMode
}

var selectedVersion: iTunesVersion? {
Expand Down
Loading

0 comments on commit bcc760f

Please sign in to comment.