From be09e9c002b0ff46aa122ff7aca88b7a5def2527 Mon Sep 17 00:00:00 2001 From: FivePixels Date: Wed, 8 Jul 2020 08:04:36 -0500 Subject: Update alerts in called functions --- Tweak.x | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'Tweak.x') diff --git a/Tweak.x b/Tweak.x index c8b2d0a..30bd6e6 100644 --- a/Tweak.x +++ b/Tweak.x @@ -20,12 +20,14 @@ static void updatePrefs() { %group latestSyntax %hook SBThermalController -(void)_setBlocked:(BOOL)arg1 { - UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Intemperate" message:@"Your device attempted to lockout your device due to it's thermal monitoring. Proceed with caution." preferredStyle:UIAlertControllerStyleAlert]; - UIAlertAction *close = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { - }]; - [alert addAction:close]; - [[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController:alert animated:YES completion:nil]; - arg1 = NO; + if (arg1 == YES) { + UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Intemperate" message:@"Your device attempted to lockout your device due to it's thermal monitoring. Proceed with caution." preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction *close = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + }]; + [alert addAction:close]; + [[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController:alert animated:YES completion:nil]; + arg1 = NO; + } %orig(arg1); } -(BOOL)isThermalBlocked { @@ -43,7 +45,11 @@ static void updatePrefs() { %group previousSyntax %hook SBThermalController -(void)showThermalAlertIfNecessary { - // Do nothing. I don't want a thermal alert. + UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Intemperate" message:@"Your device attempted to lockout your device due to it's thermal monitoring. Proceed with caution." preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction *close = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + }]; + [alert addAction:close]; + [[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController:alert animated:YES completion:nil]; } %end %end -- cgit v1.2.3