Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dump iOS only IPA with argument --ignore-ios-check #29

Merged
merged 8 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# appdecrypt

Decrypt application encrypted binaries on macOS when SIP-enabled (macOS 11.3 or below).
Decrypt application's encrypted binaries on macOS when SIP-enabled (macOS 11.2.3 or below). *Even if it can decrypt all applications, some iOS apps won't be possible to run on the mac, even after decryption.*

This works well and compiles for iOS nicely, if you want use it at iOS devices, you can use build-ios.sh (Thanks @dlevi309).

Expand All @@ -20,7 +19,7 @@ appdecrypt is a tool to make decrypt application encrypted binaries on macOS whe

Examples:
mac:
appdecrypt /Applicaiton/Test.app /Users/admin/Desktop/Test.app
appdecrypt /Application/Test.app /Users/admin/Desktop/Test.app
iPhone:
appdecrypt /var/containers/Bundle/Application/XXXXXX /tmp

Expand All @@ -32,6 +31,7 @@ ARGUMENTS:

OPTIONS:
-h, --help Show help information.
--ignore-ios-check Decrypt the app even if M1 can't run it.
```

#### For Example
Expand Down
3 changes: 2 additions & 1 deletion Sources/appdecrypt/ConsoleIO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ConsoleIO {

Examples:
mac:
appdecrypt /Applicaiton/Test.app /Users/admin/Desktop/Test.app
appdecrypt /Application/Test.app /Users/admin/Desktop/Test.app
iPhone:
appdecrypt /var/containers/Bundle/Application/XXXXXX /tmp

Expand All @@ -46,6 +46,7 @@ class ConsoleIO {

OPTIONS:
-h, --help Show help information.
--ignore-ios-check Decrypt the app even if M1 can't run it.
""")
DispatchQueue.main.async {
NotificationCenter.default.post(name: NSNotification.Name("stop"), object: nil)
Expand Down
14 changes: 11 additions & 3 deletions Sources/appdecrypt/dump.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class Dump {
if targetUrl.hasSuffix("/") {
targetUrl.removeLast()
}

var ignoreIOSOnlyCheck = false
ignoreIOSOnlyCheck = CommandLine.arguments.contains("--ignore-ios-check")

#if os(iOS)
if !targetUrl.hasSuffix("/Payload") {
targetUrl += "/Payload"
Expand Down Expand Up @@ -73,9 +77,13 @@ class Dump {
let data = pipe.fileHandleForReading.readDataToEndOfFile()
if let output = String(data: data, encoding: String.Encoding.utf8) {
if output.contains("LC_VERSION_MIN_IPHONEOS") || output.contains("platform 2") {
consoleIO.writeMessage("This app not support dump on M1 Mac. Because machO PLATFORM is IOS!")
do { try fileManager.removeItem(atPath: targetUrl) } catch {}
exit(-10)
if !ignoreIOSOnlyCheck {
consoleIO.writeMessage("This app can't run on Mac M1 ! However, you can decrypt it anyway by adding argument --ignore-ios-check")
do { try fileManager.removeItem(atPath: targetUrl) } catch {}
exit(-10)
} else {
consoleIO.writeMessage("Warning ! The app is will not run on M1 Mac. Decrypting it anyway.")
}
}
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion Sources/appdecrypt/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
import MachO

let version = "2.2"
let version = "2.3"

var running = true

Expand Down
Loading