| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- #import <UIKit/UIKit.h>
- #import "TweakHelper.h"
- #define TWEAK_SOURCE @"thebigboss.org"
- // #define TWEAK_SOURCE @"abox.plus"
- #define TWEAK_VERSION @"1.0.0"
- #define TWEAK_NAME @"MiHomeNoAds"
- #define ALERT_KEY @"block-ad-alert"
- @interface MHFamilyMainViewController: UIViewController
- - (void)showAlertControllerWhitKey:(NSString *)key;
- @end
- @interface MHSplashViewController: UIViewController
- - (void)jumpAd;
- @end
- %hook MHFamilyMainViewController
- - (void)viewDidLoad {
- %log;
- %orig;
- if (![[NSUserDefaults standardUserDefaults] boolForKey:ALERT_KEY]) {
- [self showAlertControllerWhitKey:ALERT_KEY];
- }
- }
- %new
- - (void)showAlertControllerWhitKey:(NSString *)key {
- NSString * appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
- NSString *alertTitle = [NSString stringWithFormat:@"%@去广告插件",appName];
- NSString *alertMessage = @"由SWING开发";
- UIAlertController *alertController = [UIAlertController alertControllerWithTitle:alertTitle message:alertMessage preferredStyle:UIAlertControllerStyleAlert];
- if ([TweakHelper canOpenSileo]) {
- [alertController addAction:[UIAlertAction actionWithTitle:@"在Sileo中添加源" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- NSString *urlString = @"sileo://source/https://repo.abox.plus/";
- NSURL *url = [NSURL URLWithString:urlString];
- [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
- }]];
- }
- if ([TweakHelper canOpenCydia]) {
- [alertController addAction:[UIAlertAction actionWithTitle:@"在Cydia中添加源" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- NSString *urlString = @"cydia://url/https://cydia.saurik.com/api/share#?source=https://repo.abox.plus/";
- NSURL *url = [NSURL URLWithString:urlString];
- [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
- }]];
- }
- UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"不再提醒" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
- [[NSUserDefaults standardUserDefaults] setBool:true forKey:key];
- }];
- [alertController addAction:okAction];
- UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];
- [alertController addAction:cancelAction];
- [self presentViewController:alertController animated:YES completion:nil];
- }
- - (void)refreshFocusAdData{
- %log;
- }
- %end
- %hook MHTabBarViewController
- - (void)p_setupBrandZoneTab:(id)arg1 {
- %log;
- }
- %end
- %hook MHSplashViewController
- - (void)viewDidLoad {
- [self jumpAd];
- }
- %end
- %hook MHSplashADProcessor
- + (id)shared {
- return nil;
- }
- - (void)displaySplashAd {
- }
- - (id)init {
- return nil;
- }
- - (id)loadSplashAdCacheDataAdList {
- return nil;
- }
- - (id)loadSplashAdCacheData {
- return nil;
- }
- %end
- %hook AppDelegate
- - (void)showUserGuideOrSplashAD {
- %log;
- }
- %end
|