gpt4 book ai didi

ios - Hook Music Player功能IOS 8

转载 作者:行者123 更新时间:2023-12-01 16:37:07 25 4
gpt4 key购买 nike

我正在尝试在调用快速前进功能时在音乐播放器中将Theos /挂接到endSeek函数中,我在IOS 8.1中
问题是我从未到达调用endSeek的地步,无论何时调用该函数,我都设置了警报,但从未显示。
我已经注释了代码,因此仅显示警报。

这是我的tweak.xm代码:

@interface MPAVController:NSObject {}

- (unsigned int)_displayPlaybackState;
- (void)endSeek;

@end


@interface MPMusicPlayerController:NSObject {}
+ (id)systemMusicPlayer;
- (void)skipToNextItem;
- (void)skipToPreviousItem;
@end



%hook MPAVController

-(void)endSeek {

%orig;

NSString *str1 = @"Now in seek!";
UIAlertView *alert1 = [[UIAlertView alloc] initWithTitle:@"Title"
message:str1
delegate:nil
cancelButtonTitle:@"Cancel"
otherButtonTitles:nil];
[alert1 show];
[alert1 release];

/*switch ( [self _displayPlaybackState] )
{
case 4:
%orig;
[[MPMusicPlayerController systemMusicPlayer] skipToNextItem];
break;
case 5:
%orig;
[[MPMusicPlayerController systemMusicPlayer] skipToPreviousItem];
break;
default:
NSString *str = [NSString stringWithFormat:@"%d",[self _displayPlaybackState]];
%orig;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Titulo"
message:str
delegate:nil
cancelButtonTitle:@"Adiós Edu"
otherButtonTitles:nil];
// [alert show];
[alert release];
break;
}*/

}

/* -(void)beginSeek {

switch ( [self _displayPlaybackState] )
{
case 4:
start = [NSDate date];
%orig;
break;
default:
%orig;
break;

}
}
*/

%end

这是我的Makefile:
export ARCHS = arm64
export TARGET = iphone:clang:8.1
include theos/makefiles/common.mk

TWEAK_NAME = replaceSeek
replaceSeek_FILES = Tweak.xm
replaceSeek_FRAMEWORKS = UIKit MediaPlayer

include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
install.exec "killall -9 SpringBoard"

和.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Filter</key>
<dict>
<key>Bundles</key>
<array>
<string>com.apple.music</string>
</array>
</dict>
</dict>
</plist>

任何帮助,将不胜感激。

问候。

最佳答案

好吧,看来这只是在plist中音乐必须以大写M开头,即com.apple.Music而不是com.apple.music ...:P

关于ios - Hook Music Player功能IOS 8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27213456/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com