From f037db0b594b4ab6cab53d106c60fb73b983c626 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 15 Jan 2014 04:52:46 -0800 Subject: Fix the stupid alert popup on ALL the iOS versions. --- Tweak.xm | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Tweak.xm b/Tweak.xm index 5b6f143..a7eb8f7 100644 --- a/Tweak.xm +++ b/Tweak.xm @@ -205,24 +205,33 @@ static void AlertIfNeeded() { MSAlert(); } -// on iOS 7 (maybe also iOS 6) we should really just hook the unlock mechanism -// XXX: deterine where this works and maybe unify this code - +// iOS 7 %hook SBLockScreenManager - (void) _finishUIUnlockFromSource:(int)source withOptions:(id)options { %orig; AlertIfNeeded(); } %end +// iOS 6 +%hook SBAwayController +- (void) _finishUnlockWithSound:(BOOL)sound unlockSource:(int)source isAutoUnlock:(BOOL)is { + %orig; + AlertIfNeeded(); +} %end -// on iOS 4.3 and above we can use this advertisement, which seems to check every time the user unlocks -// XXX: verify that this still works on iOS 5.0 - -%hook AAAccountManager -+ (void) showMobileMeOfferIfNecessary { +// iOS 5 +%hook SBAwayController +- (void) _unlockWithSound:(BOOL)sound isAutoUnlock:(BOOL)is unlockSource:(int)source { + %orig; AlertIfNeeded(); } %end +// iOS 4.3 XXX: check lower versions +%hook SBAwayController +- (void) _unlockWithSound:(BOOL)sound isAutoUnlock:(BOOL)is unlockType:(int)type { + %orig; + AlertIfNeeded(); +} %end // -[SBIconController showInfoAlertIfNeeded] explains how to drag icons around the iPhone home screen // it used to be shown to users when they unlocked their screen for the first time, and happened every unlock -- cgit v1.2.3