Skip to content

Commit

Permalink
Merge pull request #45 from jthoward64/version-messages
Browse files Browse the repository at this point in the history
Show a message with info about the current iOS version
  • Loading branch information
KpwnZ authored Jan 23, 2024
2 parents 4314748 + ed72d35 commit 01b0503
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion escape/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (void)viewDidLoad {
UILabel *label = [[UILabel alloc] init];
label.text = @"By xia0o0o0o";
[label sizeToFit];
label.font = [UIFont systemFontOfSize:15];
label.font = [UIFont monospacedSystemFontOfSize:15 weight:1];
[self.view addSubview:label];

// Set up constraints
Expand Down Expand Up @@ -83,6 +83,22 @@ - (void)viewDidLoad {
[[LogHelper sharedInstance] logWithFormat:@"[*] release: %s", u.release];
[[LogHelper sharedInstance] logWithFormat:@"[*] version: %s", u.version];
[[LogHelper sharedInstance] logWithFormat:@"[*] machine: %s", u.machine];

// Get iOS Version
NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
[[LogHelper sharedInstance] logWithFormat:@"[*] iOS Version: %@.%@.%@", @(version.majorVersion), @(version.minorVersion), @(version.patchVersion)];
NSString *unsupportedMessage = @"[*] !!! Only iOS 15.7-16.5 is supported !!!";
if (version.majorVersion < 15 || (version.majorVersion == 15 && version.minorVersion < 7)) {
[[LogHelper sharedInstance] logMessage:unsupportedMessage];
} else if (version.majorVersion > 16) {
[[LogHelper sharedInstance] logMessage:unsupportedMessage];
} else if (version.majorVersion == 16 && version.minorVersion > 5) {
if (version.minorVersion == 6) {
[[LogHelper sharedInstance] logMessage:@"[*] !!! iOS 16.6 support is experimental, you may encounter issues !!!"];
} else {
[[LogHelper sharedInstance] logMessage:unsupportedMessage];
}
}
}

- (void)logButtonTapped {
Expand Down

0 comments on commit 01b0503

Please sign in to comment.