QQAlertRemove 是一个专为 iOS 设备开发的 Cydia 插件(越狱插件),这是一个客户定制的插件,主要功能是屏蔽 QQ 应用中的各种弹窗提醒。该插件使用 Theos 框架和 Logos 语法开发,通过 Method Swizzling(方法交换)技术来拦截和阻止 QQ 应用中的弹窗显示。
- 弹窗拦截: 通过 Hook QQ 应用中的
QUIAlertView类,拦截所有弹窗的初始化和显示方法 - 多重拦截: 覆盖多个初始化方法确保弹窗无法创建
- 显示阻止: 即使弹窗创建成功,也会阻止其显示
- 调试日志: 提供详细的日志记录功能(可选开启)
- 安全机制: 包含5分钟自动退出机制(已注释,可选启用)
- 开发框架: Theos
- 编程语言: Objective-C++ (.xm 文件)
- Hook 技术: Logos 语法
- 目标平台: iOS (iphoneos-arm)
- 依赖: MobileSubstrate, iOS 5.0+
插件通过以下方式工作:
-
类声明: 首先声明
QUIAlertView接口,这是 QQ 应用中负责显示弹窗的类 -
方法拦截: 使用
%hook指令拦截QUIAlertView类的关键方法:init- 默认初始化方法initWithFrame:- 带框架参数的初始化方法initWithTitle:message:- 带标题和消息的初始化方法initWithCoder:- 从编码器初始化的方法show- 显示弹窗的方法showWithAnimated:- 带动画显示弹窗的方法
-
返回值控制:
- 对于初始化方法,返回
nil阻止对象创建 - 对于显示方法,直接返回而不调用原始实现
- 对于初始化方法,返回
QQAlertRemove/
├── QQAlertRemove.xm # 主要源代码文件
├── QQAlertRemove.mm # 辅助源代码文件
├── QQAlertRemove-Prefix.pch # 预编译头文件
└── Package/ # 打包相关文件
├── DEBIAN/
│ └── control # Debian 包控制文件
└── Library/
└── MobileSubstrate/ # MobileSubstrate 相关文件
- 已越狱的 iOS 设备
- iOS 5.0 或更高版本
- 已安装 MobileSubstrate
- 已安装 Cydia 包管理器
- 将编译好的 .deb 包通过 Cydia 安装
- 重启设备或重启 SpringBoard
- 打开 QQ 应用,插件将自动生效
- 所有 QQ 弹窗将被自动屏蔽
- 模拟器检测: 代码包含模拟器检测,确保只在真实设备上运行
- 安全退出: 包含可选的5分钟自动退出机制(当前已注释)
- 日志控制: 调试日志可以通过注释/取消注释来控制
- 作者: MacXK
- 包名: com.MacXK.QQAlertRemove
- 版本: 0.1-1
- 项目性质: 客户定制插件
QQAlertRemove is a Cydia tweak (jailbreak plugin) developed for iOS devices, this is a custom plugin developed for a specific client, designed to block various popup alerts in the QQ application. The plugin is developed using the Theos framework and Logos syntax, utilizing Method Swizzling technology to intercept and prevent popup displays in the QQ app.
- Popup Interception: Hooks the
QUIAlertViewclass in QQ app to intercept all popup initialization and display methods - Multiple Interception: Covers multiple initialization methods to ensure popups cannot be created
- Display Prevention: Even if popups are successfully created, prevents them from being displayed
- Debug Logging: Provides detailed logging functionality (optional)
- Safety Mechanism: Includes a 5-minute auto-exit mechanism (commented out, optional)
- Development Framework: Theos
- Programming Language: Objective-C++ (.xm files)
- Hook Technology: Logos syntax
- Target Platform: iOS (iphoneos-arm)
- Dependencies: MobileSubstrate, iOS 5.0+
The plugin works through the following approach:
-
Class Declaration: First declares the
QUIAlertViewinterface, which is the class responsible for displaying popups in QQ app -
Method Interception: Uses
%hookdirective to intercept key methods ofQUIAlertViewclass:init- Default initialization methodinitWithFrame:- Initialization method with frame parameterinitWithTitle:message:- Initialization method with title and messageinitWithCoder:- Initialization method from codershow- Method to display popupshowWithAnimated:- Method to display popup with animation
-
Return Value Control:
- For initialization methods, returns
nilto prevent object creation - For display methods, returns directly without calling original implementation
- For initialization methods, returns
QQAlertRemove/
├── QQAlertRemove.xm # Main source code file
├── QQAlertRemove.mm # Auxiliary source code file
├── QQAlertRemove-Prefix.pch # Precompiled header file
└── Package/ # Packaging related files
├── DEBIAN/
│ └── control # Debian package control file
└── Library/
└── MobileSubstrate/ # MobileSubstrate related files
- Jailbroken iOS device
- iOS 5.0 or higher
- MobileSubstrate installed
- Cydia package manager installed
- Install the compiled .deb package through Cydia
- Restart device or respring SpringBoard
- Open QQ application, the plugin will automatically take effect
- All QQ popups will be automatically blocked
- Simulator Detection: Code includes simulator detection to ensure it only runs on real devices
- Safe Exit: Includes optional 5-minute auto-exit mechanism (currently commented out)
- Log Control: Debug logging can be controlled by commenting/uncommenting
- Author: MacXK
- Package Name: com.MacXK.QQAlertRemove
- Version: 0.1-1
- Project Type: Custom Client Plugin
<augment_code_snippet path="QQAlertRemove/QQAlertRemove.xm" mode="EXCERPT">
%hook QUIAlertView
- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message {
QQAlertLog(@"拦截到QUIAlertView初始化: 标题=%@, 消息=%@", title, message);
return nil; // 返回nil阻止弹窗创建
}
- (void)show {
QQAlertLog(@"拦截到QUIAlertView show方法");
return; // 不调用原始方法,直接返回
}
%end</augment_code_snippet>
<augment_code_snippet path="QQAlertRemove/QQAlertRemove.xm" mode="EXCERPT">
%ctor {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * 60 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
QQAlertLog(@"已运行5分钟,准备闪退");
//exit(0);
});
}</augment_code_snippet>
中文: 此插件仅供学习和研究目的使用。使用此插件可能违反 QQ 应用的服务条款。用户需自行承担使用风险。
English: This plugin is for educational and research purposes only. Using this plugin may violate QQ application's terms of service. Users assume all risks associated with its use.