gpt4 book ai didi

ios - 挂机静音开关(越狱)

转载 作者:行者123 更新时间:2023-11-29 12:36:24 28 4
gpt4 key购买 nike

我想覆盖静音开关以在开关切换时创建一个新 Action 。那么当开关改变时触发的方法是什么?

谢谢

最佳答案

在 SpringBoard 中 Hook 这个方法

SBMediaController - (void)setRingerMuted:(char)

如果你只是想观察开关事件,那么你可以观察系统范围的通知 com.apple.springboard.ringerstate 与 Darwin 通知中心这样

static void RingerStateChanged(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo)
{
}

CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),
NULL,
RingerStateChanged,
CFSTR("com.apple.springboard.ringerstate"),
NULL,
CFNotificationSuspensionBehaviorDeliverImmediately);

关于ios - 挂机静音开关(越狱),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26205577/

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