Skip to content

Commit

Permalink
Merge branch 'develop' into mac-os-version
Browse files Browse the repository at this point in the history
  • Loading branch information
Depal1 authored Aug 25, 2024
2 parents 7c55275 + 0cfcffe commit 1e1de6a
Show file tree
Hide file tree
Showing 38 changed files with 980 additions and 1,538 deletions.
54 changes: 7 additions & 47 deletions PlayCover.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion PlayCover/AppInstaller/Downloader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,26 @@ class DownloadApp {
if installVM.inProgress {
Log.shared.error(PlayCoverError.waitInstallation)
} else {
if let app = app, PlayApp.PROHIBITED_APPS.contains(app.bundleID) {
let alert = NSAlert()
alert.messageText = NSLocalizedString("alert.error", comment: "")
alert.informativeText = String(
format: NSLocalizedString("error.appProhibited", comment: ""),
arguments: [app.name]
)
alert.alertStyle = .warning
alert.addButton(withTitle: NSLocalizedString("Ok", comment: ""))
alert.addButton(withTitle: NSLocalizedString("alert.download.downloadAnyway", comment: ""))
if alert.runModal() == .alertFirstButtonReturn {
return
}
}

if let warningMessage = warning, let app = app {
let alert = NSAlert()
alert.messageText = NSLocalizedString(warningMessage, comment: "")
alert.informativeText = String(
format: NSLocalizedString("ipaLibrary.alert.download", comment: ""),
format: NSLocalizedString("alert.install.anyway", comment: ""),
arguments: [app.name]
)
alert.alertStyle = .warning
Expand Down
17 changes: 9 additions & 8 deletions PlayCover/Model/PlayApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ class PlayApp: BaseApp {
sign()
}

if try !isInfoPlistSigned() {
try Shell.signApp(executable)
}

// call unlockKeyCover() and WAIT for it to finish
await unlockKeyCover()

Expand All @@ -63,8 +67,6 @@ class PlayApp: BaseApp {
Log.shared.error("PlayTools are not installed! Please move PlayCover.app into Applications!")
} else if try !Macho.isMachoValidArch(executable) {
Log.shared.error("The app threw an error during conversion.")
} else if try !isCodesigned() {
Log.shared.error("The app is not codesigned! Please open Xcode and accept license agreement.")
} else {
if settings.openWithLLDB {
try Shell.lldb(executable, withTerminalWindow: settings.openLLDBWithTerminal)
Expand Down Expand Up @@ -192,11 +194,9 @@ class PlayApp: BaseApp {
.appendingPathComponent("Applications")
.appendingPathComponent("PlayCover")

static let playChainDirectory = PlayTools.playCoverContainer.appendingPathComponent("PlayChain")

lazy var aliasURL = PlayApp.aliasDirectory.appendingPathComponent(name).appendingPathExtension("app")

lazy var playChainURL = PlayApp.playChainDirectory.appendingPathComponent(info.bundleIdentifier)
lazy var playChainURL = KeyCover.playChainPath.appendingPathComponent(info.bundleIdentifier)

lazy var settings = AppSettings(info)

Expand Down Expand Up @@ -245,8 +245,8 @@ class PlayApp: BaseApp {
return FileManager.default.fileExists(atPath: aliasURL.path)
}

func isCodesigned() throws -> Bool {
try Shell.run("/usr/bin/codesign", "-dv", executable.path).contains("adhoc")
func isInfoPlistSigned() throws -> Bool {
try Shell.run("/usr/bin/codesign", "-dv", executable.path).contains("Info.plist entries")
}

func showInFinder() {
Expand Down Expand Up @@ -307,7 +307,8 @@ class PlayApp: BaseApp {
"com.dts.freefireth",
"com.dts.freefiremax",
"vn.vng.codmvn",
"com.ngame.allstar.eu"
"com.ngame.allstar.eu",
"com.axlebolt.standoff2"
]

static let MALICIOUS_APPS = [
Expand Down
3 changes: 0 additions & 3 deletions PlayCover/PlayCoverError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ enum PlayCoverError: Error {
case appCorrupted
case appProhibited
case appMaliciousProhibited
case noGenshinAccount
case failedToStripBinary
}

Expand All @@ -31,8 +30,6 @@ extension PlayCoverError: LocalizedError {
return NSLocalizedString("error.appProhibited", comment: "")
case .appMaliciousProhibited:
return NSLocalizedString("error.appMaliciousProhibited", comment: "")
case .noGenshinAccount:
return NSLocalizedString("error.noGenshinAccount", comment: "")
case .failedToStripBinary:
return NSLocalizedString("error.failedToStripBinary", comment: "")
}
Expand Down
20 changes: 0 additions & 20 deletions PlayCover/Utils/GenshinUserData/DeleteStoredGenshinUserData.swift

This file was deleted.

41 changes: 0 additions & 41 deletions PlayCover/Utils/GenshinUserData/GenshinUserDataURLs.swift

This file was deleted.

103 changes: 0 additions & 103 deletions PlayCover/Utils/GenshinUserData/RestoreGenshinUserData.swift

This file was deleted.

96 changes: 0 additions & 96 deletions PlayCover/Utils/GenshinUserData/SaveGenshinUserData.swift

This file was deleted.

Loading

0 comments on commit 1e1de6a

Please sign in to comment.