0

我正在尝试使用 Theos 来连接并捕获已停止的警报的名称。

我已经这样做了:

// Logos by Dustin Howett
// See http://iphonedevwiki.net/index.php/Logos
//#import <SpringBoard/SpringBoard.h>
#import <MobileTimer/AlarmManager.h>
//#import <SpringBoard/SBApplicationIcon.h>
#import <UIKit/UIKit.h>
//#import <SpringBoard/SBRemoteNotificationEnableSystemwideAlert.h>

%hook AlarmManager

- (void)handleAlarm:(id)arg1 stoppedUsingSong:(id)arg2 {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"ALARM!!!!" message:@"HELLO!!!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];
    %orig(arg1,arg2);
}
%end

问题是我从来没有看到警报框。你有什么想法为什么会这样吗?

4

1 回答 1

0

[alert show];[alert release]; 这个:

%hook AlarmManager 
    - (void)handleAlarm:(id)arg1 stoppedUsingSong:(id)arg2 {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"ALARM!!!!" message:@"HELLO!!!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];
    [alert release];
    %orig(arg1,arg2);
}
%end   
于 2014-03-26T15:16:16.333 回答