Skip to content

Commit c887977

Browse files
committed
Add new dir on check jailbreak
1 parent 7ffdd29 commit c887977

File tree

1 file changed

+58
-14
lines changed

1 file changed

+58
-14
lines changed

Utils/Utils/BrightSide/BrightSide.swift

Lines changed: 58 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
import Foundation
10-
import UIKit
10+
import class UIKit.UIApplication
1111

1212
public final class BrightSide {
1313

@@ -44,30 +44,74 @@ public final class BrightSide {
4444

4545
private extension BrightSide {
4646

47-
/// Method will return true, if any of the files typical for the jailbreak exists
48-
private static func isJailbreakDirectoriesExist() -> Bool {
49-
let jailbreakDirectories = [
50-
"/Applications/Cydia.app",
51-
"/Library/MobileSubstrate/MobileSubstrate.dylib",
52-
"/bin/bash",
53-
"/usr/sbin/sshd",
54-
"/etc/apt",
55-
"/private/var/lib/apt/"
56-
]
57-
return jailbreakDirectories.map { FileManager.default.fileExists(atPath: $0) }.reduce(false, { $0 || $1 })
47+
/// Method will return true, if any of the files or dir, typical for the jailbreak, exists
48+
static func isJailbreakDirectoriesExist() -> Bool {
49+
let jailbreakRelativelyFilesAndPaths = suspiciousSystemFiles
50+
+ suspiciousAppsDir
51+
+ suspiciousSystemDir
52+
return jailbreakRelativelyFilesAndPaths
53+
.allSatisfy(FileManager.default.fileExists(atPath:))
5854
}
5955

6056
/// Method will return true if we can open cydia package
61-
private static func canOpenCydia() -> Bool {
57+
static func canOpenCydia() -> Bool {
6258
guard let cydiaURL = URL(string: "cydia://package/com.example.package") else {
6359
return false
6460
}
6561
return UIApplication.shared.canOpenURL(cydiaURL)
6662
}
6763

6864
/// Method will return true if current device is simulator
69-
private static func isSimulator() -> Bool {
65+
static func isSimulator() -> Bool {
7066
return ProcessInfo.processInfo.environment["SIMULATOR_DEVICE_NAME"] != nil
7167
}
7268

7369
}
70+
71+
// MARK: - Suspicious dir
72+
73+
extension BrightSide {
74+
75+
static var suspiciousAppsDir: [String] {
76+
return [
77+
"/Applications/Cydia.app",
78+
"/Applications/blackra1n.app",
79+
"/Applications/checkra1n.app",
80+
"/Applications/Zeon.app",
81+
"/Applications/FakeCarrier.app",
82+
"/Applications/Icy.app",
83+
"/Applications/IntelliScreen.app",
84+
"/Applications/MxTube.app",
85+
"/Applications/RockApp.app",
86+
"/Applications/SBSettings.app",
87+
"/Applications/WinterBoard.app"
88+
]
89+
}
90+
91+
static var suspiciousSystemDir: [String] {
92+
return [
93+
"/private/var/lib/apt",
94+
"/private/var/lib/apt/",
95+
"/private/var/lib/cydia",
96+
"/private/var/mobile/Library/SBSettings/Themes",
97+
"/private/var/stash",
98+
"/usr/bin/sshd",
99+
"/usr/libexec/sftp-server",
100+
"/usr/sbin/sshd",
101+
"/etc/apt",
102+
"/bin/bash"
103+
]
104+
}
105+
106+
static var suspiciousSystemFiles: [String] {
107+
return [
108+
"/Library/MobileSubstrate/DynamicLibraries/LiveClock.plist",
109+
"/Library/MobileSubstrate/DynamicLibraries/Veency.plist",
110+
"/private/var/tmp/cydia.log",
111+
"/System/Library/LaunchDaemons/com.ikey.bbot.plist",
112+
"/System/Library/LaunchDaemons/com.saurik.Cydia.Startup.plist",
113+
"/Library/MobileSubstrate/MobileSubstrate.dylib"
114+
]
115+
}
116+
117+
}

0 commit comments

Comments
 (0)