dismissViewControllerAnimatedUIAlertController

UIIAlertController的自动消失

Posted by kunnan on May 15, 2018

消除 sb 的UIAlertController

  • hook sb
    { Filter = { Bundles = ( "com.tencent.xin","com.apple.springboard","com.apple.Preferences"); }; }
    
  • hook all app
    com.apple.UIKit
    Filter = {Bundles = ("com.apple.UIKit");};
    

*code

tweak 代码示范dismissViewControllerAnimatedUIAlertController

基础知识

%ctor 进行分组初始化

  • NSBundle.mainBundle.bundleIdentifier
    %ctor
    {
      if ([NSBundle.mainBundle.bundleIdentifier isEqual:@"com.apple.springboard"])
      {
          [[TIDEBioServer sharedInstance] setUpForMonitoring];
      }
    }
    
  • processName

适配

  • iOS10-Runtime-Headers/PrivateFrameworks/SpringBoardUI.framework/_SBAlertController.h 适配
    *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unexpectedly dismissed alert controller (<_SBAlertController: 0x1068e73b0; title: "未安装 SIM 卡">), please file a radar to PEP SpringBoard about this bad citizen: <SBSIMLockAlertItem: 0x17407a780; alertController: <_SBAlertController: 0x1068e73b0; title: "未安装 SIM 卡">; occluded: NO>'
    
  • code
      if (/* condition */ [self isKindOfClass:%c(_SBAlertController)])
      {
          /* code */
          // 
                  NSLog(@" 暂时不处理ios10 sb 弹框 title :%@ message:%@",AlertHeader,[self message]);
          return;
      }
    

See Also

/Users/devzkn/bin/knpost dismissViewControllerAnimatedUIAlertController UIIAlertController的自动消失 -t iosre
#原来""的参数,需要自己加上""

转载请注明: > dismissViewControllerAnimatedUIAlertController