浏览代码

米家去广告

SWING 1 年之前
当前提交
8a268c567f
共有 6 个文件被更改,包括 111 次插入0 次删除
  1. 3 0
      .gitignore
  2. 19 0
      Makefile
  3. 1 0
      MiHomeNoAds.plist
  4. 75 0
      Tweak.x
  5. 9 0
      control
  6. 4 0
      debug.sh

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+.theos/
+packages/
+.DS_Store

+ 19 - 0
Makefile

@@ -0,0 +1,19 @@
+export THEOS_DEVICE_IP = 192.168.31.120
+export THEOS_DEVICE_PORT = 2222
+export TARGET = iphone:clang:latest:15.0
+
+THEOS_PACKAGE_SCHEME=rootless
+
+INSTALL_TARGET_PROCESSES = SpringBoard
+
+
+include $(THEOS)/makefiles/common.mk
+
+TWEAK_NAME = MiHomeNoAds
+
+MiHomeNoAds_FILES = Tweak.x
+MiHomeNoAds_CFLAGS = -fobjc-arc
+
+ARCHS =arm64 arm64e
+
+include $(THEOS_MAKE_PATH)/tweak.mk

+ 1 - 0
MiHomeNoAds.plist

@@ -0,0 +1 @@
+{ Filter = { Bundles = ( "com.xiaomi.mihome" ); }; }

+ 75 - 0
Tweak.x

@@ -0,0 +1,75 @@
+#import <UIKit/UIKit.h>
+
+@interface MHFamilyMainViewController: UIViewController
+
+@end
+
+@interface MHSplashViewController: UIViewController
+- (void)jumpAd;
+@end
+
+%hook MHFamilyMainViewController
+
+- (void)viewDidLoad {
+    %log;
+    %orig;
+    //UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"测试米家去广告插件" preferredStyle:UIAlertControllerStyleAlert];
+    //UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+    //}];
+    //[alertController addAction:okAction];
+    //[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

+ 9 - 0
control

@@ -0,0 +1,9 @@
+Package: com.swing.mihome
+Name: MiHomeNoAds
+Version: 0.0.1
+Architecture: iphoneos-arm
+Description: An awesome MobileSubstrate tweak!
+Maintainer: SWING
+Author: SWING
+Section: Tweaks
+Depends: mobilesubstrate (>= 0.9.5000)

+ 4 - 0
debug.sh

@@ -0,0 +1,4 @@
+make
+make package
+make install
+