Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save paulomcnally/dc2dbc5fcb2fc2fb6c1b9157d244d705 to your computer and use it in GitHub Desktop.
Save paulomcnally/dc2dbc5fcb2fc2fb6c1b9157d244d705 to your computer and use it in GitHub Desktop.
Final Cut Pro X trial reset
#!/usr/bin/swift
import Foundation
let path = URL(fileURLWithPath: NSString(string: "~/Library/Application Support/.ffuserdata").expandingTildeInPath)
let data = try! NSData(contentsOf: path) as Data
let dictionary = try! NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) as! NSDictionary
let mutableDictionary = dictionary.mutableCopy() as! NSMutableDictionary
for (key, value) in mutableDictionary {
if value is NSDate {
mutableDictionary[key] = Date()
}
}
try! NSKeyedArchiver.archivedData(withRootObject: mutableDictionary, requiringSecureCoding: false).write(to: path)
print("You'd better buy it")
@paulomcnally
Copy link
Author

swiftc -o fcpxreset ./final-cut-pro-trial-reset.swift

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment