Skip to content

Commit 1a1fc9b

Browse files
authored
Merge pull request #20 from MainasuK/feature/mac-os-sequoia
Test and build for new macOS
2 parents a6fe67f + ef49d20 commit 1a1fc9b

File tree

29 files changed

+268
-187
lines changed

29 files changed

+268
-187
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,5 @@ iOSInjectionProject/
9494
**/xcshareddata/WorkspaceSettings.xcsettings
9595

9696
# End of https://www.gitignore.io/api/xcode,swift
97+
98+
Dependencies/**

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 – 2016 MainasuK (@mainasuk)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Podfile

Lines changed: 0 additions & 22 deletions
This file was deleted.

Podfile.lock

Lines changed: 0 additions & 16 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@ The popover will jump to new scren scene when it get focused. It will stand in t
2222

2323
### Why Song Rating not show star rating when iTunes/Music playing?
2424
Please check the Security & Privacy settings and check the checkbox of Song Rating.
25-
![Automation](./Press/Automation.png)
25+
![Automation](./Press/Automation.png)
26+
27+
## License
28+
Song Rating is released under the [MIT License](./LICENSE).

SDK/Package.resolved

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SDK/Package.swift

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// swift-tools-version: 5.7
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "SDK",
8+
platforms: [
9+
.macOS(.v11),
10+
],
11+
products: [
12+
// Products define the executables and libraries a package produces, and make them visible to other packages.
13+
.library(
14+
name: "SDK",
15+
targets: ["SDK"]),
16+
],
17+
dependencies: [
18+
.package(url: "https://github.com/shpakovski/MASShortcut.git", branch: "master"),
19+
],
20+
targets: [
21+
.target(
22+
name: "SDK",
23+
dependencies: [
24+
.product(name: "MASShortcut", package: "MASShortcut")
25+
]),
26+
.testTarget(
27+
name: "SDKTests",
28+
dependencies: ["SDK"]),
29+
]
30+
)

SDK/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SDK
2+
3+
A description of this package.

SDK/Sources/SDK/AppContext.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// AppContext.swift
3+
//
4+
//
5+
// Created by MainasuK on 2022/11/18.
6+
//
7+
8+
import os.log
9+
import Foundation
10+
11+
public class AppContext {
12+
13+
let logger = Logger(subsystem: "AppContext", category: "Context")
14+
15+
public var assetURLCache = Set<URL>()
16+
17+
public init() {
18+
// do nothing
19+
}
20+
}
21+

SDK/Sources/SDK/NSImage.swift

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// NSImage.swift
3+
//
4+
//
5+
// Created by MainasuK on 2022/11/18.
6+
//
7+
8+
import Cocoa
9+
10+
extension NSImage {
11+
public func imagePNGRepresentation() -> Data? {
12+
guard let tiffRepresentation = self.tiffRepresentation,
13+
let imageRep = NSBitmapImageRep(data: tiffRepresentation),
14+
let pngData = imageRep.representation(using: .png, properties: [:])
15+
else { return nil }
16+
return pngData
17+
}
18+
19+
public func imageJPEGRepresentation() -> Data? {
20+
guard let tiffRepresentation = self.tiffRepresentation,
21+
let imageRep = NSBitmapImageRep(data: tiffRepresentation),
22+
let pngData = imageRep.representation(using: .jpeg, properties: [:])
23+
else { return nil }
24+
return pngData
25+
}
26+
}

0 commit comments

Comments
 (0)