Quellcode durchsuchen

添加AvoidCarsh调试

leon vor 2 Jahren
Ursprung
Commit
b75718e66a
74 geänderte Dateien mit 4166 neuen und 129 gelöschten Zeilen
  1. BIN
      .DS_Store
  2. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/.DS_Store
  3. 4 1
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/BTDataProcess.mm
  4. 28 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/IOSPlatformSDK.mm
  5. 0 78
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/PrefixHeader.h
  6. BIN
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/.DS_Store
  7. 116 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/AvoidCrash.h
  8. 212 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/AvoidCrash.m
  9. 17 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/AvoidCrashProtocol.h
  10. 37 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/AvoidCrashStubProxy.h
  11. 18 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/AvoidCrashStubProxy.m
  12. 25 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSArray+AvoidCrash.h
  13. 258 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSArray+AvoidCrash.m
  14. 25 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSAttributedString+AvoidCrash.h
  15. 96 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSAttributedString+AvoidCrash.m
  16. 24 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSDictionary+AvoidCrash.h
  17. 56 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSDictionary+AvoidCrash.m
  18. 26 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableArray+AvoidCrash.h
  19. 169 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableArray+AvoidCrash.m
  20. 23 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableAttributedString+AvoidCrash.h
  21. 74 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableAttributedString+AvoidCrash.m
  22. 24 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableDictionary+AvoidCrash.h
  23. 95 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableDictionary+AvoidCrash.m
  24. 29 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableString+AvoidCrash.h
  25. 97 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableString+AvoidCrash.m
  26. 34 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSObject+AvoidCrash.h
  27. 221 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSObject+AvoidCrash.m
  28. 29 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSString+AvoidCrash.h
  29. 204 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSString+AvoidCrash.m
  30. 3 0
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Tool/MYFactoryManager.h
  31. 1 1
      DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/SearchDeviceViewController.m
  32. 76 2
      DanceGame/Unity-iPhone.xcodeproj/project.pbxproj
  33. BIN
      DanceGame/Unity-iPhone.xcodeproj/project.xcworkspace/xcuserdata/duowan123.xcuserdatad/UserInterfaceState.xcuserstate
  34. BIN
      RunGame/.DS_Store
  35. 0 4
      RunGame/Classes/UnityAppController.mm
  36. BIN
      RunGame/SDK/.DS_Store
  37. 1 1
      RunGame/SDK/BLE/BTDataProcess.mm
  38. 4 2
      RunGame/SDK/IOSPlatformSDK.mm
  39. BIN
      RunGame/SDK/ThirdClass/.DS_Store
  40. 116 0
      RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrash.h
  41. 219 0
      RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrash.m
  42. 17 0
      RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrashProtocol.h
  43. 37 0
      RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrashStubProxy.h
  44. 18 0
      RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrashStubProxy.m
  45. 25 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSArray+AvoidCrash.h
  46. 258 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSArray+AvoidCrash.m
  47. 25 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSAttributedString+AvoidCrash.h
  48. 96 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSAttributedString+AvoidCrash.m
  49. 24 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSDictionary+AvoidCrash.h
  50. 56 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSDictionary+AvoidCrash.m
  51. 26 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableArray+AvoidCrash.h
  52. 169 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableArray+AvoidCrash.m
  53. 23 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableAttributedString+AvoidCrash.h
  54. 74 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableAttributedString+AvoidCrash.m
  55. 24 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableDictionary+AvoidCrash.h
  56. 95 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableDictionary+AvoidCrash.m
  57. 29 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableString+AvoidCrash.h
  58. 97 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSMutableString+AvoidCrash.m
  59. 34 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSObject+AvoidCrash.h
  60. 221 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSObject+AvoidCrash.m
  61. 29 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSString+AvoidCrash.h
  62. 204 0
      RunGame/SDK/ThirdClass/AvoidCrash/NSString+AvoidCrash.m
  63. 16 0
      RunGame/SDK/ThirdClass/BuglyManager.h
  64. 40 0
      RunGame/SDK/ThirdClass/BuglyManager.m
  65. 1 0
      RunGame/SDK/Tool/MYFactoryManager.h
  66. 3 5
      RunGame/SDK/Tool/MYFactoryManager.m
  67. BIN
      RunGame/SDK/shoes_sdk/.DS_Store
  68. 1 2
      RunGame/SDK/shoes_sdk/BigFoot.cpp
  69. 3 8
      RunGame/SDK/shoes_sdk/Game.cpp
  70. 3 1
      RunGame/SDK/shoes_sdk/RuinsExplore.cpp
  71. 4 3
      RunGame/SDK/shoes_sdk/RunGame.cpp
  72. 1 1
      RunGame/SDK/shoes_sdk/pub.h
  73. 152 20
      RunGame/Unity-iPhone.xcodeproj/project.pbxproj
  74. BIN
      RunGame/Unity-iPhone.xcodeproj/project.xcworkspace/xcuserdata/duowan123.xcuserdatad/UserInterfaceState.xcuserstate

BIN
.DS_Store


BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/.DS_Store


+ 4 - 1
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/BLE/BTDataProcess.mm

@@ -772,6 +772,9 @@ void disConnectBle (CFNotificationCenterRef center, void *observer, CFStringRef
   
     /********************调试窗数据 *****************/
     NSArray *aArray = [self.tempStepString componentsSeparatedByString:@","];
+    if (aArray == nil || [aArray isKindOfClass:[NSNull class]] || aArray.count<30){
+        return;
+    }
 //    NSLog(@"aArray === %@",aArray);
 //    dispatch_async(dispatch_get_main_queue(), ^{
         if (self.testLabel!=nil){
@@ -781,7 +784,7 @@ void disConnectBle (CFNotificationCenterRef center, void *observer, CFStringRef
     
     /********************颖嘉+的ts丢包数据 *****************/
     NSString * tsString =  aArray[27];
-        NSLog(@"tsString == %@",tsString);
+//        NSLog(@"tsString == %@",tsString);
     int tsInt = [tsString  intValue];
     int total;
     if (self.currentTS != 1000){//颖嘉初始值未知 ios初始值==1000

+ 28 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/IOSPlatformSDK.mm

@@ -103,10 +103,38 @@ static IOSPlatformSDK * instance;
     dispatch_once(&onceToken, ^{
         instance = [super init];
         [self initNotification];
+ 
+        [Bugly startWithAppId:@"403d275730"];
+        //防奔溃
+        [AvoidCrash makeAllEffective];
+        NSArray *noneSelClassStrings = @[
+                                         @"NSString"
+                                         ];
+        [AvoidCrash setupNoneSelClassStringsArr:noneSelClassStrings];
+        NSArray *noneSelClassPrefix = @[
+                                        @"AvoidCrash"
+                                        ];
+        [AvoidCrash setupNoneSelClassStringPrefixsArr:noneSelClassPrefix];
+        //监听通知:AvoidCrashNotification, 获取AvoidCrash捕获的崩溃日志的详细信息
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dealwithCrashMessage:) name:AvoidCrashNotification object:nil];
     });
     return instance;
 }
 
+- (void)dealwithCrashMessage:(NSNotification *)note{
+
+ NSDictionary *info = note.userInfo;
+  NSString *errorReason = [NSString stringWithFormat:@"【ErrorReason】%@========【ErrorPlace】%@========【DefaultToDo】%@========【ErrorName】%@", info[@"errorReason"], info[@"errorPlace"], info[@"defaultToDo"], info[@"errorName"]];
+  NSArray *callStack = info[@"callStackSymbols"];
+  [self reportErrorName:@"Bugly_ErrorName_AvoidCrash" errorReason:errorReason callStack:callStack extraInfo:nil];
+
+}
+
+/** 上报错误信息 */
+- (void)reportErrorName:(NSString *)errorName errorReason:(NSString *)errorReason callStack:(NSArray *)aStackArray extraInfo:(NSDictionary *)info{
+[Bugly reportExceptionWithCategory:3 name:errorName reason:errorReason callStack:aStackArray extraInfo:info terminateApp:NO];
+}
+
 #pragma mark ============================>> public method app跳转直链
 -(void)startWithUrl:(NSURL*)url{//
     

+ 0 - 78
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/PrefixHeader.h

@@ -1,78 +0,0 @@
-////
-////  PrefixHeader.h
-////  Unity-iPhone
-////
-////  Created by duowan123 on 2021/11/2.
-////
-//
-//#ifndef PrefixHeader_h
-//#define PrefixHeader_h
-//
-//
-///*************************** 获取屏幕 宽度、高度 ***************************/
-//#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
-//#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
-///*************************** 状态栏+导航栏 高度 ***************************/
-//#define getRectNavAndStatusHight  self.navigationController.navigationBar.frame.size.height+[[UIApplication sharedApplication] statusBarFrame].size.height
-//#define getTarbarHight (SCREEN_HEIGHT>=812?83:49)
-///*************************** 比例系数布局  ***************************/
-//#define SCALEoefficient(num)   (SCREEN_WIDTH/667.0)*(num)
-//#define SCALE_HIGHT_oefficient(num)   (SCREEN_HEIGHT/375.0)*(num)
-///*************************** 字号大小  ***************************/
-//#define SCALEoefficient_20 20.0*(SCREEN_WIDTH/320.0)///<大标题
-//#define SCALEoefficient_18 18.0*(SCREEN_WIDTH/320.0)///<附标题
-//#define SCALEoefficient_16 16.0*(SCREEN_WIDTH/320.0)///<中标题
-//#define SCALEoefficient_14 14.0*(SCREEN_WIDTH/320.0)///<小标题
-//
-////app跳转 用户信息
-//#define IOSSDK_USERINFO @"iosSdk_userInfo"
-////缓存的步频数据
-//#define IOSSDK_BLESDKDATA @"iosSdk_bleSdk_frequency"
-////custom System UserDefaults
-//#define IOS_NSUSERDEFAULT [NSUserDefaults standardUserDefaults]
-//#define CUS_NOTIFICATIONCENTER [NSNotificationCenter defaultCenter]
-//#define IOSSDK_TOKEN [[IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO] objectForKey:@"token"]
-//#define IOSSDK_GAMEID [[IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO] objectForKey:@"game_id"]
-////#define IOSSDK_GAMEID @"3"
-////#define IOSSDK_TOKEN @"shoes:61652aa99523f9.65681365I94"
-//
-//
-//#ifdef __OBJC__
-//
-//#import <UIKit/UIKit.h>
-//#import <Foundation/Foundation.h>
-//
-////tool
-//#import "MYFactoryManager.h"
-//#import "UIView+ST.h"
-//#import "AlgorithmTool.h"
-//#import "UIColor+Hex.h"
-//
-//////
-////#import "IOSPlatformSDK.h"
-////
-////蓝牙
-//#import <CoreBluetooth/CoreBluetooth.h>
-//#import "LEONBLManager.h"
-//#import "BTDataProcess.h"
-////蓝牙提供的sdk算法
-//#import "GameObjc.h"
-//#define LEFT_FOOT_OC 1
-//#define RIGHT_FOOT_OC 2
-//
-////http
-//#import "HTTPDataProcession.h"
-//#import "UserFriendsModel.h"
-////第三方
-//#import "AFNetworking.h"
-//#import "MBProgressHUD.h"
-////UI
-//#import "SearchDeviceViewController.h"
-//#import "AnimationView.h"
-//#import "PopupView.h"
-//#import "NoDeviceTip.h"
-//
-//#endif
-//
-//
-//#endif /* PrefixHeader_h */

BIN
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/.DS_Store


+ 116 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/AvoidCrash.h

@@ -0,0 +1,116 @@
+//
+//  AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+//===================================================
+//   使用方法和注意事项:
+//   https://www.jianshu.com/p/2b90aa96c0a0
+//===================================================
+
+#import <Foundation/Foundation.h>
+#import <objc/runtime.h>
+
+//category
+#import "NSObject+AvoidCrash.h"
+
+#import "NSArray+AvoidCrash.h"
+#import "NSMutableArray+AvoidCrash.h"
+
+#import "NSDictionary+AvoidCrash.h"
+#import "NSMutableDictionary+AvoidCrash.h"
+
+#import "NSString+AvoidCrash.h"
+#import "NSMutableString+AvoidCrash.h"
+
+#import "NSAttributedString+AvoidCrash.h"
+#import "NSMutableAttributedString+AvoidCrash.h"
+
+//define
+#import "AvoidCrashStubProxy.h"
+
+
+
+
+
+@interface AvoidCrash : NSObject
+
+//===================================================
+//   使用方法和注意事项:
+//   https://www.jianshu.com/p/2b90aa96c0a0
+//===================================================
+
+
+
+/**
+ *  
+ *  开始生效.你可以在AppDelegate的didFinishLaunchingWithOptions方法中调用becomeEffective方法
+ *  【默认不开启  对”unrecognized selector sent to instance”防止崩溃的处理】
+ *
+ *  这是全局生效,若你只需要部分生效,你可以单个进行处理,比如:
+ *  [NSArray avoidCrashExchangeMethod];
+ *  [NSMutableArray avoidCrashExchangeMethod];
+ *  .................
+ *  .................
+ *
+ */
++ (void)becomeEffective;
+
+
+/** 
+ *  相比于becomeEffective,增加
+ *  对”unrecognized selector sent to instance”防止崩溃的处理
+ *
+ *  但是必须配合:
+ *            setupClassStringsArr:和
+ *            setupNoneSelClassStringPrefixsArr
+ *            这两个方法可以同时使用
+ */
++ (void)makeAllEffective;
+
+
+
+/** 
+ *  初始化一个需要防止”unrecognized selector sent to instance”的崩溃的类名数组
+ *  ⚠️不可将@"NSObject"加入classStrings数组中
+ *  ⚠️不可将UI前缀的字符串加入classStrings数组中
+ */
++ (void)setupNoneSelClassStringsArr:(NSArray<NSString *> *)classStrings;
+
+
+/**
+ *  初始化一个需要防止”unrecognized selector sent to instance”的崩溃的类名前缀的数组
+ *  ⚠️不可将UI前缀的字符串(包括@"UI")加入classStringPrefixs数组中
+ *  ⚠️不可将NS前缀的字符串(包括@"NS")加入classStringPrefixs数组中
+ */
++ (void)setupNoneSelClassStringPrefixsArr:(NSArray<NSString *> *)classStringPrefixs;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//您可以忽略以下方法
+
++ (void)exchangeClassMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel;
+
++ (void)exchangeInstanceMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel;
+
++ (void)noteErrorWithException:(NSException *)exception defaultToDo:(NSString *)defaultToDo;
+
+
+@end

+ 212 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/AvoidCrash.m

@@ -0,0 +1,212 @@
+//
+//  AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "AvoidCrash.h"
+
+#define key_errorName        @"errorName"
+#define key_errorReason      @"errorReason"
+#define key_errorPlace       @"errorPlace"
+#define key_defaultToDo      @"defaultToDo"
+#define key_callStackSymbols @"callStackSymbols"
+#define key_exception        @"exception"
+
+@implementation AvoidCrash
+
++ (void)becomeEffective {
+    [self effectiveIfDealWithNoneSel:NO];
+}
+
++ (void)makeAllEffective {
+    [self effectiveIfDealWithNoneSel:YES];
+}
+
++ (void)effectiveIfDealWithNoneSel:(BOOL)dealWithNoneSel {
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        [NSObject avoidCrashExchangeMethodIfDealWithNoneSel:dealWithNoneSel];
+        
+        [NSArray avoidCrashExchangeMethod];
+        [NSMutableArray avoidCrashExchangeMethod];
+        
+        [NSDictionary avoidCrashExchangeMethod];
+        [NSMutableDictionary avoidCrashExchangeMethod];
+        
+        [NSString avoidCrashExchangeMethod];
+        [NSMutableString avoidCrashExchangeMethod];
+        
+        [NSAttributedString avoidCrashExchangeMethod];
+        [NSMutableAttributedString avoidCrashExchangeMethod];
+    });
+}
+
++ (void)setupNoneSelClassStringsArr:(NSArray<NSString *> *)classStrings {
+    [NSObject setupNoneSelClassStringsArr:classStrings];
+}
+
+/**
+ *  初始化一个需要防止”unrecognized selector sent to instance”的崩溃的类名前缀的数组
+ */
++ (void)setupNoneSelClassStringPrefixsArr:(NSArray<NSString *> *)classStringPrefixs {
+    [NSObject setupNoneSelClassStringPrefixsArr:classStringPrefixs];
+}
+
+/**
+ *  类方法的交换
+ *
+ *  @param anClass    哪个类
+ *  @param method1Sel 方法1
+ *  @param method2Sel 方法2
+ */
++ (void)exchangeClassMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel {
+    Method method1 = class_getClassMethod(anClass, method1Sel);
+    Method method2 = class_getClassMethod(anClass, method2Sel);
+    method_exchangeImplementations(method1, method2);
+}
+
+
+/**
+ *  对象方法的交换
+ *
+ *  @param anClass    哪个类
+ *  @param method1Sel 方法1(原本的方法)
+ *  @param method2Sel 方法2(要替换成的方法)
+ */
++ (void)exchangeInstanceMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel {
+    
+    
+    Method originalMethod = class_getInstanceMethod(anClass, method1Sel);
+    Method swizzledMethod = class_getInstanceMethod(anClass, method2Sel);
+    
+    BOOL didAddMethod =
+    class_addMethod(anClass,
+                    method1Sel,
+                    method_getImplementation(swizzledMethod),
+                    method_getTypeEncoding(swizzledMethod));
+    
+    if (didAddMethod) {
+        class_replaceMethod(anClass,
+                            method2Sel,
+                            method_getImplementation(originalMethod),
+                            method_getTypeEncoding(originalMethod));
+    }
+    
+    else {
+        method_exchangeImplementations(originalMethod, swizzledMethod);
+    }
+    
+}
+
+
+
+/**
+ *  获取堆栈主要崩溃精简化的信息<根据正则表达式匹配出来>
+ *
+ *  @param callStackSymbols 堆栈主要崩溃信息
+ *
+ *  @return 堆栈主要崩溃精简化的信息
+ */
+
++ (NSString *)getMainCallStackSymbolMessageWithCallStackSymbols:(NSArray<NSString *> *)callStackSymbols {
+    
+    //mainCallStackSymbolMsg的格式为   +[类名 方法名]  或者 -[类名 方法名]
+    __block NSString *mainCallStackSymbolMsg = nil;
+    
+    //匹配出来的格式为 +[类名 方法名]  或者 -[类名 方法名]
+    NSString *regularExpStr = @"[-\\+]\\[.+\\]";
+    
+    
+    NSRegularExpression *regularExp = [[NSRegularExpression alloc] initWithPattern:regularExpStr options:NSRegularExpressionCaseInsensitive error:nil];
+    
+    
+    for (int index = 2; index < callStackSymbols.count; index++) {
+        NSString *callStackSymbol = callStackSymbols[index];
+        
+        [regularExp enumerateMatchesInString:callStackSymbol options:NSMatchingReportProgress range:NSMakeRange(0, callStackSymbol.length) usingBlock:^(NSTextCheckingResult * _Nullable result, NSMatchingFlags flags, BOOL * _Nonnull stop) {
+            if (result) {
+                NSString* tempCallStackSymbolMsg = [callStackSymbol substringWithRange:result.range];
+                
+                //get className
+                NSString *className = [tempCallStackSymbolMsg componentsSeparatedByString:@" "].firstObject;
+                className = [className componentsSeparatedByString:@"["].lastObject;
+                
+                NSBundle *bundle = [NSBundle bundleForClass:NSClassFromString(className)];
+                
+                //filter category and system class
+                if (![className hasSuffix:@")"] && bundle == [NSBundle mainBundle]) {
+                    mainCallStackSymbolMsg = tempCallStackSymbolMsg;
+                    
+                }
+                *stop = YES;
+            }
+        }];
+        
+        if (mainCallStackSymbolMsg.length) {
+            break;
+        }
+    }
+    
+    return mainCallStackSymbolMsg;
+}
+
+
+/**
+ *  提示崩溃的信息(控制台输出、通知)
+ *
+ *  @param exception   捕获到的异常
+ *  @param defaultToDo 这个框架里默认的做法
+ */
++ (void)noteErrorWithException:(NSException *)exception defaultToDo:(NSString *)defaultToDo {
+
+    //堆栈数据
+    NSArray *callStackSymbolsArr = [NSThread callStackSymbols];
+    
+    //获取在哪个类的哪个方法中实例化的数组  字符串格式 -[类名 方法名]  或者 +[类名 方法名]
+    NSString *mainCallStackSymbolMsg = [AvoidCrash getMainCallStackSymbolMessageWithCallStackSymbols:callStackSymbolsArr];
+    
+    if (mainCallStackSymbolMsg == nil) {
+        
+        mainCallStackSymbolMsg = @"崩溃方法定位失败,请您查看函数调用栈来排查错误原因";
+        
+    }
+    
+    NSString *errorName = exception.name;
+    NSString *errorReason = exception.reason;
+    //errorReason 可能为 -[__NSCFConstantString avoidCrashCharacterAtIndex:]: Range or index out of bounds
+    //将avoidCrash去掉
+    errorReason = [errorReason stringByReplacingOccurrencesOfString:@"avoidCrash" withString:@""];
+    
+    NSString *errorPlace = [NSString stringWithFormat:@"Error Place:%@",mainCallStackSymbolMsg];
+    
+    NSString *logErrorMessage = [NSString stringWithFormat:@"\n\n%@\n\n%@\n%@\n%@\n%@",AvoidCrashSeparatorWithFlag, errorName, errorReason, errorPlace, defaultToDo];
+    
+    logErrorMessage = [NSString stringWithFormat:@"%@\n\n%@\n\n",logErrorMessage,AvoidCrashSeparator];
+    AvoidCrashLog(@"%@",logErrorMessage);
+    
+    
+    //请忽略下面的赋值,目的只是为了能顺利上传到cocoapods
+    logErrorMessage = logErrorMessage;
+    
+    NSDictionary *errorInfoDic = @{
+                                   key_errorName        : errorName,
+                                   key_errorReason      : errorReason,
+                                   key_errorPlace       : errorPlace,
+                                   key_defaultToDo      : defaultToDo,
+                                   key_exception        : exception,
+                                   key_callStackSymbols : callStackSymbolsArr
+                                   };
+    
+    //将错误信息放在字典里,用通知的形式发送出去
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [[NSNotificationCenter defaultCenter] postNotificationName:AvoidCrashNotification object:nil userInfo:errorInfoDic];
+    });
+}
+
+
+
+@end

+ 17 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/AvoidCrashProtocol.h

@@ -0,0 +1,17 @@
+//
+//  AvoidCrashProtocol.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by chenfanfang on 2017/7/22.
+//  Copyright © 2017年 chenfanfang. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@protocol AvoidCrashProtocol <NSObject>
+
+@required
++ (void)avoidCrashExchangeMethod;
+
+@end

+ 37 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/AvoidCrashStubProxy.h

@@ -0,0 +1,37 @@
+//
+//  AvoidCrashStubProxy.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by chenfanfang on 2017/7/25.
+//  Copyright © 2017年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+#define AvoidCrashNotification @"AvoidCrashNotification"
+#define AvoidCrashIsiOS(version) ([[UIDevice currentDevice].systemVersion floatValue] >= version)
+
+
+//user can ignore below define
+#define AvoidCrashDefaultReturnNil  @"AvoidCrash default is to return nil to avoid crash."
+#define AvoidCrashDefaultIgnore     @"AvoidCrash default is to ignore this operation to avoid crash."
+
+#define AvoidCrashSeparator         @"================================================================"
+#define AvoidCrashSeparatorWithFlag @"========================AvoidCrash Log=========================="
+
+
+#ifdef DEBUG
+
+#define  AvoidCrashLog(...) NSLog(@"%@",[NSString stringWithFormat:__VA_ARGS__])
+
+#else
+
+#define AvoidCrashLog(...)
+#endif
+
+@interface AvoidCrashStubProxy : NSObject
+
+- (void)proxyMethod;
+
+@end

+ 18 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/AvoidCrashStubProxy.m

@@ -0,0 +1,18 @@
+//
+//  AvoidCrashStubProxy.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by chenfanfang on 2017/7/25.
+//  Copyright © 2017年 chenfanfang. All rights reserved.
+//
+
+#import "AvoidCrashStubProxy.h"
+
+
+@implementation AvoidCrashStubProxy
+
+- (void)proxyMethod {
+    
+}
+
+@end

+ 25 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSArray+AvoidCrash.h

@@ -0,0 +1,25 @@
+//
+//  NSArray+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSArray (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+
+/**
+ *  Can avoid crash method
+ *
+ *  1. NSArray的快速创建方式 NSArray *array = @[@"chenfanfang", @"AvoidCrash"];  //这种创建方式其实调用的是2中的方法
+ *  2. +(instancetype)arrayWithObjects:(const id  _Nonnull __unsafe_unretained *)objects count:(NSUInteger)cnt
+ *  3. - (id)objectAtIndex:(NSUInteger)index
+ *  4. - (void)getObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range
+ */    

+ 258 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSArray+AvoidCrash.m

@@ -0,0 +1,258 @@
+//
+//  NSArray+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSArray+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSArray (AvoidCrash)
+
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        //=================
+        //   class method
+        //=================
+        
+        //instance array method exchange
+        [AvoidCrash exchangeClassMethod:[self class] method1Sel:@selector(arrayWithObjects:count:) method2Sel:@selector(AvoidCrashArrayWithObjects:count:)];
+        
+        
+        
+        //====================
+        //   instance method
+        //====================
+        
+        Class __NSArray = NSClassFromString(@"NSArray");
+        Class __NSArrayI = NSClassFromString(@"__NSArrayI");
+        Class __NSSingleObjectArrayI = NSClassFromString(@"__NSSingleObjectArrayI");
+        Class __NSArray0 = NSClassFromString(@"__NSArray0");
+        
+        
+        //objectsAtIndexes:
+        [AvoidCrash exchangeInstanceMethod:__NSArray method1Sel:@selector(objectsAtIndexes:) method2Sel:@selector(avoidCrashObjectsAtIndexes:)];
+        
+        
+        //objectAtIndex:
+        
+        [AvoidCrash exchangeInstanceMethod:__NSArrayI method1Sel:@selector(objectAtIndex:) method2Sel:@selector(__NSArrayIAvoidCrashObjectAtIndex:)];
+        
+        [AvoidCrash exchangeInstanceMethod:__NSSingleObjectArrayI method1Sel:@selector(objectAtIndex:) method2Sel:@selector(__NSSingleObjectArrayIAvoidCrashObjectAtIndex:)];
+        
+        [AvoidCrash exchangeInstanceMethod:__NSArray0 method1Sel:@selector(objectAtIndex:) method2Sel:@selector(__NSArray0AvoidCrashObjectAtIndex:)];
+        
+        //objectAtIndexedSubscript:
+        if (AvoidCrashIsiOS(11.0)) {
+            [AvoidCrash exchangeInstanceMethod:__NSArrayI method1Sel:@selector(objectAtIndexedSubscript:) method2Sel:@selector(__NSArrayIAvoidCrashObjectAtIndexedSubscript:)];
+        }
+        
+        
+        //getObjects:range:
+        [AvoidCrash exchangeInstanceMethod:__NSArray method1Sel:@selector(getObjects:range:) method2Sel:@selector(NSArrayAvoidCrashGetObjects:range:)];
+        
+        [AvoidCrash exchangeInstanceMethod:__NSSingleObjectArrayI method1Sel:@selector(getObjects:range:) method2Sel:@selector(__NSSingleObjectArrayIAvoidCrashGetObjects:range:)];
+        
+        [AvoidCrash exchangeInstanceMethod:__NSArrayI method1Sel:@selector(getObjects:range:) method2Sel:@selector(__NSArrayIAvoidCrashGetObjects:range:)];
+    });
+    
+    
+}
+
+
+//=================================================================
+//                        instance array
+//=================================================================
+#pragma mark - instance array
+
+
++ (instancetype)AvoidCrashArrayWithObjects:(const id  _Nonnull __unsafe_unretained *)objects count:(NSUInteger)cnt {
+    
+    id instance = nil;
+    
+    @try {
+        instance = [self AvoidCrashArrayWithObjects:objects count:cnt];
+    }
+    @catch (NSException *exception) {
+        
+        NSString *defaultToDo = @"AvoidCrash default is to remove nil object and instance a array.";
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+        //以下是对错误数据的处理,把为nil的数据去掉,然后初始化数组
+        NSInteger newObjsIndex = 0;
+        id  _Nonnull __unsafe_unretained newObjects[cnt];
+        
+        for (int i = 0; i < cnt; i++) {
+            if (objects[i] != nil) {
+                newObjects[newObjsIndex] = objects[i];
+                newObjsIndex++;
+            }
+        }
+        instance = [self AvoidCrashArrayWithObjects:newObjects count:newObjsIndex];
+    }
+    @finally {
+        return instance;
+    }
+}
+
+
+
+//=================================================================
+//                     objectAtIndexedSubscript:
+//=================================================================
+#pragma mark - objectAtIndexedSubscript:
+- (id)__NSArrayIAvoidCrashObjectAtIndexedSubscript:(NSUInteger)idx {
+    id object = nil;
+    
+    @try {
+        object = [self __NSArrayIAvoidCrashObjectAtIndexedSubscript:idx];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+
+}
+
+
+//=================================================================
+//                       objectsAtIndexes:
+//=================================================================
+#pragma mark - objectsAtIndexes:
+
+- (NSArray *)avoidCrashObjectsAtIndexes:(NSIndexSet *)indexes {
+    
+    NSArray *returnArray = nil;
+    @try {
+        returnArray = [self avoidCrashObjectsAtIndexes:indexes];
+    } @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+    } @finally {
+        return returnArray;
+    }
+}
+
+
+//=================================================================
+//                         objectAtIndex:
+//=================================================================
+#pragma mark - objectAtIndex:
+
+//__NSArrayI  objectAtIndex:
+- (id)__NSArrayIAvoidCrashObjectAtIndex:(NSUInteger)index {
+    id object = nil;
+    
+    @try {
+        object = [self __NSArrayIAvoidCrashObjectAtIndex:index];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+
+
+//__NSSingleObjectArrayI objectAtIndex:
+- (id)__NSSingleObjectArrayIAvoidCrashObjectAtIndex:(NSUInteger)index {
+    id object = nil;
+    
+    @try {
+        object = [self __NSSingleObjectArrayIAvoidCrashObjectAtIndex:index];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+//__NSArray0 objectAtIndex:
+- (id)__NSArray0AvoidCrashObjectAtIndex:(NSUInteger)index {
+    id object = nil;
+    
+    @try {
+        object = [self __NSArray0AvoidCrashObjectAtIndex:index];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+
+//=================================================================
+//                           getObjects:range:
+//=================================================================
+#pragma mark - getObjects:range:
+
+//NSArray getObjects:range:
+- (void)NSArrayAvoidCrashGetObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range {
+    
+    @try {
+        [self NSArrayAvoidCrashGetObjects:objects range:range];
+    } @catch (NSException *exception) {
+        
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+    } @finally {
+        
+    }
+}
+
+
+//__NSSingleObjectArrayI  getObjects:range:
+- (void)__NSSingleObjectArrayIAvoidCrashGetObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range {
+    
+    @try {
+        [self __NSSingleObjectArrayIAvoidCrashGetObjects:objects range:range];
+    } @catch (NSException *exception) {
+        
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+    } @finally {
+        
+    }
+}
+
+
+//__NSArrayI  getObjects:range:
+- (void)__NSArrayIAvoidCrashGetObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range {
+    
+    @try {
+        [self __NSArrayIAvoidCrashGetObjects:objects range:range];
+    } @catch (NSException *exception) {
+        
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+    } @finally {
+        
+    }
+}
+
+
+
+
+@end

+ 25 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSAttributedString+AvoidCrash.h

@@ -0,0 +1,25 @@
+//
+//  NSAttributedString+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/15.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSAttributedString (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+/**
+ *  Can avoid crash method
+ *
+ *  1.- (instancetype)initWithString:(NSString *)str
+ *  2.- (instancetype)initWithAttributedString:(NSAttributedString *)attrStr
+ *  3.- (instancetype)initWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs
+ *
+ *
+ */

+ 96 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSAttributedString+AvoidCrash.m

@@ -0,0 +1,96 @@
+//
+//  NSAttributedString+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/15.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSAttributedString+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSAttributedString (AvoidCrash)
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        Class NSConcreteAttributedString = NSClassFromString(@"NSConcreteAttributedString");
+        
+        //initWithString:
+        [AvoidCrash exchangeInstanceMethod:NSConcreteAttributedString method1Sel:@selector(initWithString:) method2Sel:@selector(avoidCrashInitWithString:)];
+        
+        //initWithAttributedString
+        [AvoidCrash exchangeInstanceMethod:NSConcreteAttributedString method1Sel:@selector(initWithAttributedString:) method2Sel:@selector(avoidCrashInitWithAttributedString:)];
+        
+        //initWithString:attributes:
+        [AvoidCrash exchangeInstanceMethod:NSConcreteAttributedString method1Sel:@selector(initWithString:attributes:) method2Sel:@selector(avoidCrashInitWithString:attributes:)];
+    });
+
+}
+
+//=================================================================
+//                           initWithString:
+//=================================================================
+#pragma mark - initWithString:
+
+- (instancetype)avoidCrashInitWithString:(NSString *)str {
+    id object = nil;
+    
+    @try {
+        object = [self avoidCrashInitWithString:str];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+
+//=================================================================
+//                          initWithAttributedString
+//=================================================================
+#pragma mark - initWithAttributedString
+
+- (instancetype)avoidCrashInitWithAttributedString:(NSAttributedString *)attrStr {
+    id object = nil;
+    
+    @try {
+        object = [self avoidCrashInitWithAttributedString:attrStr];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+
+//=================================================================
+//                      initWithString:attributes:
+//=================================================================
+#pragma mark - initWithString:attributes:
+
+- (instancetype)avoidCrashInitWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs {
+    id object = nil;
+    
+    @try {
+        object = [self avoidCrashInitWithString:str attributes:attrs];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+@end

+ 24 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSDictionary+AvoidCrash.h

@@ -0,0 +1,24 @@
+//
+//  NSDictionary+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSDictionary (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+
+/**
+ *  Can avoid crash method
+ *
+ *  1. NSDictionary的快速创建方式 NSDictionary *dict = @{@"frameWork" : @"AvoidCrash"}; //这种创建方式其实调用的是2中的方法
+ *  2. +(instancetype)dictionaryWithObjects:(const id  _Nonnull __unsafe_unretained *)objects forKeys:(const id<NSCopying>  _Nonnull __unsafe_unretained *)keys count:(NSUInteger)cnt
+ *
+ */

+ 56 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSDictionary+AvoidCrash.m

@@ -0,0 +1,56 @@
+//
+//  NSDictionary+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSDictionary+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSDictionary (AvoidCrash)
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        [AvoidCrash exchangeClassMethod:self method1Sel:@selector(dictionaryWithObjects:forKeys:count:) method2Sel:@selector(avoidCrashDictionaryWithObjects:forKeys:count:)];
+    });
+}
+
+
++ (instancetype)avoidCrashDictionaryWithObjects:(const id  _Nonnull __unsafe_unretained *)objects forKeys:(const id<NSCopying>  _Nonnull __unsafe_unretained *)keys count:(NSUInteger)cnt {
+    
+    id instance = nil;
+    
+    @try {
+        instance = [self avoidCrashDictionaryWithObjects:objects forKeys:keys count:cnt];
+    }
+    @catch (NSException *exception) {
+        
+        NSString *defaultToDo = @"AvoidCrash default is to remove nil key-values and instance a dictionary.";
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+        //处理错误的数据,然后重新初始化一个字典
+        NSUInteger index = 0;
+        id  _Nonnull __unsafe_unretained newObjects[cnt];
+        id  _Nonnull __unsafe_unretained newkeys[cnt];
+        
+        for (int i = 0; i < cnt; i++) {
+            if (objects[i] && keys[i]) {
+                newObjects[index] = objects[i];
+                newkeys[index] = keys[i];
+                index++;
+            }
+        }
+        instance = [self avoidCrashDictionaryWithObjects:newObjects forKeys:newkeys count:index];
+    }
+    @finally {
+        return instance;
+    }
+}
+
+@end

+ 26 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableArray+AvoidCrash.h

@@ -0,0 +1,26 @@
+//
+//  NSMutableArray+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSMutableArray (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+
+/**
+ *  Can avoid crash method
+ *
+ *  1. - (id)objectAtIndex:(NSUInteger)index
+ *  2. - (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx
+ *  3. - (void)removeObjectAtIndex:(NSUInteger)index
+ *  4. - (void)insertObject:(id)anObject atIndex:(NSUInteger)index
+ *  5. - (void)getObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range
+ */

+ 169 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableArray+AvoidCrash.m

@@ -0,0 +1,169 @@
+//
+//  NSMutableArray+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSMutableArray+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSMutableArray (AvoidCrash)
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        Class arrayMClass = NSClassFromString(@"__NSArrayM");
+        
+        
+        //objectAtIndex:
+        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(objectAtIndex:) method2Sel:@selector(avoidCrashObjectAtIndex:)];
+        
+        //objectAtIndexedSubscript
+        if (AvoidCrashIsiOS(11.0)) {
+            [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(objectAtIndexedSubscript:) method2Sel:@selector(avoidCrashObjectAtIndexedSubscript:)];
+        }
+        
+        
+        //setObject:atIndexedSubscript:
+        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(setObject:atIndexedSubscript:) method2Sel:@selector(avoidCrashSetObject:atIndexedSubscript:)];
+        
+        
+        //removeObjectAtIndex:
+        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(removeObjectAtIndex:) method2Sel:@selector(avoidCrashRemoveObjectAtIndex:)];
+        
+        //insertObject:atIndex:
+        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(insertObject:atIndex:) method2Sel:@selector(avoidCrashInsertObject:atIndex:)];
+        
+        //getObjects:range:
+        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(getObjects:range:) method2Sel:@selector(avoidCrashGetObjects:range:)];
+    });
+    
+    
+    
+}
+
+
+//=================================================================
+//                    array set object at index
+//=================================================================
+#pragma mark - get object from array
+
+
+- (void)avoidCrashSetObject:(id)obj atIndexedSubscript:(NSUInteger)idx {
+    
+    @try {
+        [self avoidCrashSetObject:obj atIndexedSubscript:idx];
+    }
+    @catch (NSException *exception) {
+        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
+    }
+    @finally {
+        
+    }
+}
+
+
+//=================================================================
+//                    removeObjectAtIndex:
+//=================================================================
+#pragma mark - removeObjectAtIndex:
+
+- (void)avoidCrashRemoveObjectAtIndex:(NSUInteger)index {
+    @try {
+        [self avoidCrashRemoveObjectAtIndex:index];
+    }
+    @catch (NSException *exception) {
+        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
+    }
+    @finally {
+        
+    }
+}
+
+
+//=================================================================
+//                    insertObject:atIndex:
+//=================================================================
+#pragma mark - set方法
+- (void)avoidCrashInsertObject:(id)anObject atIndex:(NSUInteger)index {
+    @try {
+        [self avoidCrashInsertObject:anObject atIndex:index];
+    }
+    @catch (NSException *exception) {
+        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
+    }
+    @finally {
+        
+    }
+}
+
+
+//=================================================================
+//                           objectAtIndex:
+//=================================================================
+#pragma mark - objectAtIndex:
+
+- (id)avoidCrashObjectAtIndex:(NSUInteger)index {
+    id object = nil;
+    
+    @try {
+        object = [self avoidCrashObjectAtIndex:index];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+//=================================================================
+//                     objectAtIndexedSubscript:
+//=================================================================
+#pragma mark - objectAtIndexedSubscript:
+- (id)avoidCrashObjectAtIndexedSubscript:(NSUInteger)idx {
+    id object = nil;
+    
+    @try {
+        object = [self avoidCrashObjectAtIndexedSubscript:idx];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+    
+}
+
+
+//=================================================================
+//                         getObjects:range:
+//=================================================================
+#pragma mark - getObjects:range:
+
+- (void)avoidCrashGetObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range {
+    
+    @try {
+        [self avoidCrashGetObjects:objects range:range];
+    } @catch (NSException *exception) {
+        
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+    } @finally {
+        
+    }
+}
+
+
+
+
+@end

+ 23 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableAttributedString+AvoidCrash.h

@@ -0,0 +1,23 @@
+//
+//  NSMutableAttributedString+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/15.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSMutableAttributedString (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+
+/**
+ *  Can avoid crash method
+ *
+ *  1.- (instancetype)initWithString:(NSString *)str
+ *  2.- (instancetype)initWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs
+ */

+ 74 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableAttributedString+AvoidCrash.m

@@ -0,0 +1,74 @@
+//
+//  NSMutableAttributedString+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/15.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSMutableAttributedString+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSMutableAttributedString (AvoidCrash)
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        Class NSConcreteMutableAttributedString = NSClassFromString(@"NSConcreteMutableAttributedString");
+        
+        //initWithString:
+        [AvoidCrash exchangeInstanceMethod:NSConcreteMutableAttributedString method1Sel:@selector(initWithString:) method2Sel:@selector(avoidCrashInitWithString:)];
+        
+        //initWithString:attributes:
+        [AvoidCrash exchangeInstanceMethod:NSConcreteMutableAttributedString method1Sel:@selector(initWithString:attributes:) method2Sel:@selector(avoidCrashInitWithString:attributes:)];
+    });
+}
+
+//=================================================================
+//                          initWithString:
+//=================================================================
+#pragma mark - initWithString:
+
+
+- (instancetype)avoidCrashInitWithString:(NSString *)str {
+    id object = nil;
+    
+    @try {
+        object = [self avoidCrashInitWithString:str];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+
+//=================================================================
+//                     initWithString:attributes:
+//=================================================================
+#pragma mark - initWithString:attributes:
+
+
+- (instancetype)avoidCrashInitWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs {
+    id object = nil;
+    
+    @try {
+        object = [self avoidCrashInitWithString:str attributes:attrs];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+
+@end

+ 24 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableDictionary+AvoidCrash.h

@@ -0,0 +1,24 @@
+//
+//  NSMutableDictionary+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/22.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSMutableDictionary (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+
+/**
+ *  Can avoid crash method
+ *
+ *  1. - (void)setObject:(id)anObject forKey:(id<NSCopying>)aKey
+ *  2. - (void)removeObjectForKey:(id)aKey
+ *
+ */

+ 95 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableDictionary+AvoidCrash.m

@@ -0,0 +1,95 @@
+//
+//  NSMutableDictionary+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/22.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSMutableDictionary+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSMutableDictionary (AvoidCrash)
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        Class dictionaryM = NSClassFromString(@"__NSDictionaryM");
+        
+        //setObject:forKey:
+        [AvoidCrash exchangeInstanceMethod:dictionaryM method1Sel:@selector(setObject:forKey:) method2Sel:@selector(avoidCrashSetObject:forKey:)];
+        
+        //setObject:forKeyedSubscript:
+        if (AvoidCrashIsiOS(11.0)) {
+            [AvoidCrash exchangeInstanceMethod:dictionaryM method1Sel:@selector(setObject:forKeyedSubscript:) method2Sel:@selector(avoidCrashSetObject:forKeyedSubscript:)];
+        }
+        
+        
+        
+        //removeObjectForKey:
+        Method removeObjectForKey = class_getInstanceMethod(dictionaryM, @selector(removeObjectForKey:));
+        Method avoidCrashRemoveObjectForKey = class_getInstanceMethod(dictionaryM, @selector(avoidCrashRemoveObjectForKey:));
+        method_exchangeImplementations(removeObjectForKey, avoidCrashRemoveObjectForKey);
+    });
+}
+
+
+//=================================================================
+//                       setObject:forKey:
+//=================================================================
+#pragma mark - setObject:forKey:
+
+- (void)avoidCrashSetObject:(id)anObject forKey:(id<NSCopying>)aKey {
+    
+    @try {
+        [self avoidCrashSetObject:anObject forKey:aKey];
+    }
+    @catch (NSException *exception) {
+        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
+    }
+    @finally {
+        
+    }
+}
+
+//=================================================================
+//                  setObject:forKeyedSubscript:
+//=================================================================
+#pragma mark - setObject:forKeyedSubscript:
+- (void)avoidCrashSetObject:(id)obj forKeyedSubscript:(id<NSCopying>)key {
+    @try {
+        [self avoidCrashSetObject:obj forKeyedSubscript:key];
+    }
+    @catch (NSException *exception) {
+        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
+    }
+    @finally {
+        
+    }
+}
+
+
+//=================================================================
+//                       removeObjectForKey:
+//=================================================================
+#pragma mark - removeObjectForKey:
+
+- (void)avoidCrashRemoveObjectForKey:(id)aKey {
+    
+    @try {
+        [self avoidCrashRemoveObjectForKey:aKey];
+    }
+    @catch (NSException *exception) {
+        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
+    }
+    @finally {
+        
+    }
+}
+
+
+
+
+@end

+ 29 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableString+AvoidCrash.h

@@ -0,0 +1,29 @@
+//
+//  NSMutableString+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/6.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSMutableString (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+
+/**
+ *  Can avoid crash method
+ *
+ *  1. 由于NSMutableString是继承于NSString,所以这里和NSString有些同样的方法就不重复写了
+ *  2. - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)aString
+ *  3. - (void)insertString:(NSString *)aString atIndex:(NSUInteger)loc
+ *  4. - (void)deleteCharactersInRange:(NSRange)range
+ *
+ */
+
+
+

+ 97 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSMutableString+AvoidCrash.m

@@ -0,0 +1,97 @@
+//
+//  NSMutableString+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/6.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSMutableString+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSMutableString (AvoidCrash)
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        Class stringClass = NSClassFromString(@"__NSCFString");
+        
+        //replaceCharactersInRange
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(replaceCharactersInRange:withString:) method2Sel:@selector(avoidCrashReplaceCharactersInRange:withString:)];
+        
+        //insertString:atIndex:
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(insertString:atIndex:) method2Sel:@selector(avoidCrashInsertString:atIndex:)];
+        
+        //deleteCharactersInRange
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(deleteCharactersInRange:) method2Sel:@selector(avoidCrashDeleteCharactersInRange:)];
+    });
+}
+
+//=================================================================
+//                     replaceCharactersInRange
+//=================================================================
+#pragma mark - replaceCharactersInRange
+
+- (void)avoidCrashReplaceCharactersInRange:(NSRange)range withString:(NSString *)aString {
+    
+    @try {
+        [self avoidCrashReplaceCharactersInRange:range withString:aString];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        
+    }
+}
+
+//=================================================================
+//                     insertString:atIndex:
+//=================================================================
+#pragma mark - insertString:atIndex:
+
+- (void)avoidCrashInsertString:(NSString *)aString atIndex:(NSUInteger)loc {
+    
+    @try {
+        [self avoidCrashInsertString:aString atIndex:loc];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        
+    }
+}
+
+//=================================================================
+//                   deleteCharactersInRange
+//=================================================================
+#pragma mark - deleteCharactersInRange
+
+- (void)avoidCrashDeleteCharactersInRange:(NSRange)range {
+    
+    @try {
+        [self avoidCrashDeleteCharactersInRange:range];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        
+    }
+}
+
+
+
+
+
+
+
+
+@end

+ 34 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSObject+AvoidCrash.h

@@ -0,0 +1,34 @@
+//
+//  NSObject+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/11.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface NSObject (AvoidCrash)
+
+/** 
+ *  ifDealWithNoneSel : 是否开启"unrecognized selector sent to instance"异常的捕获
+ */
++ (void)avoidCrashExchangeMethodIfDealWithNoneSel:(BOOL)ifDealWithNoneSel;
+
+
++ (void)setupNoneSelClassStringsArr:(NSArray<NSString *> *)classStrings;
+
++ (void)setupNoneSelClassStringPrefixsArr:(NSArray<NSString *> *)classStringPrefixs;
+
+@end
+
+/**
+ *  Can avoid crash method
+ *
+ *  1.- (void)setValue:(id)value forKey:(NSString *)key
+ *  2.- (void)setValue:(id)value forKeyPath:(NSString *)keyPath
+ *  3.- (void)setValue:(id)value forUndefinedKey:(NSString *)key //这个方法一般用来重写,不会主动调用
+ *  4.- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues
+ *  5. unrecognized selector sent to instance
+ */

+ 221 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSObject+AvoidCrash.m

@@ -0,0 +1,221 @@
+//
+//  NSObject+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/11.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSObject+AvoidCrash.h"
+#import "AvoidCrash.h"
+#import "AvoidCrashStubProxy.h"
+
+@implementation NSObject (AvoidCrash)
+
+
++ (void)avoidCrashExchangeMethodIfDealWithNoneSel:(BOOL)ifDealWithNoneSel {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        //setValue:forKey:
+        [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValue:forKey:) method2Sel:@selector(avoidCrashSetValue:forKey:)];
+        
+        //setValue:forKeyPath:
+        [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValue:forKeyPath:) method2Sel:@selector(avoidCrashSetValue:forKeyPath:)];
+        
+        //setValue:forUndefinedKey:
+        [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValue:forUndefinedKey:) method2Sel:@selector(avoidCrashSetValue:forUndefinedKey:)];
+        
+        //setValuesForKeysWithDictionary:
+        [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValuesForKeysWithDictionary:) method2Sel:@selector(avoidCrashSetValuesForKeysWithDictionary:)];
+        
+        
+        //unrecognized selector sent to instance
+        if (ifDealWithNoneSel) {
+            [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(methodSignatureForSelector:) method2Sel:@selector(avoidCrashMethodSignatureForSelector:)];
+            [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(forwardInvocation:) method2Sel:@selector(avoidCrashForwardInvocation:)];
+        }
+    });
+}
+
+
+//=================================================================
+//              unrecognized selector sent to instance
+//=================================================================
+#pragma mark - unrecognized selector sent to instance
+
+
+static NSMutableArray *noneSelClassStrings;
+static NSMutableArray *noneSelClassStringPrefixs;
+
++ (void)setupNoneSelClassStringsArr:(NSArray<NSString *> *)classStrings {
+    
+    if (noneSelClassStrings) {
+        
+        NSString *warningMsg = [NSString stringWithFormat:@"\n\n%@\n\n[AvoidCrash setupNoneSelClassStringsArr:];\n调用一此即可,多次调用会自动忽略后面的调用\n\n%@\n\n",AvoidCrashSeparatorWithFlag,AvoidCrashSeparator];
+        AvoidCrashLog(@"%@",warningMsg);
+    }
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        noneSelClassStrings = [NSMutableArray array];
+        for (NSString *className in classStrings) {
+            if ([className hasPrefix:@"UI"] == NO &&
+                [className isEqualToString:NSStringFromClass([NSObject class])] == NO) {
+                [noneSelClassStrings addObject:className];
+                
+            } else {
+                NSString *warningMsg = [NSString stringWithFormat:@"\n\n%@\n\n[AvoidCrash setupNoneSelClassStringsArr:];\n会忽略UI开头的类和NSObject类(请使用NSObject的子类)\n\n%@\n\n",AvoidCrashSeparatorWithFlag,AvoidCrashSeparator];
+                AvoidCrashLog(@"%@",warningMsg);
+            }
+        }
+    });
+}
+
+/**
+ *  初始化一个需要防止”unrecognized selector sent to instance”的崩溃的类名前缀的数组
+ */
++ (void)setupNoneSelClassStringPrefixsArr:(NSArray<NSString *> *)classStringPrefixs {
+    if (noneSelClassStringPrefixs) {
+        
+        NSString *warningMsg = [NSString stringWithFormat:@"\n\n%@\n\n[AvoidCrash setupNoneSelClassStringPrefixsArr:];\n调用一此即可,多次调用会自动忽略后面的调用\n\n%@\n\n",AvoidCrashSeparatorWithFlag,AvoidCrashSeparator];
+        AvoidCrashLog(@"%@",warningMsg);
+    }
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        noneSelClassStringPrefixs = [NSMutableArray array];
+        for (NSString *classNamePrefix in classStringPrefixs) {
+            if ([classNamePrefix hasPrefix:@"UI"] == NO &&
+                [classNamePrefix hasPrefix:@"NS"] == NO) {
+                [noneSelClassStringPrefixs addObject:classNamePrefix];
+                
+            } else {
+                NSString *warningMsg = [NSString stringWithFormat:@"\n\n%@\n\n[AvoidCrash setupNoneSelClassStringsArr:];\n会忽略UI开头的类和NS开头的类\n若需要对NS开头的类防止”unrecognized selector sent to instance”(比如NSArray),请使用setupNoneSelClassStringsArr:\n\n%@\n\n",AvoidCrashSeparatorWithFlag,AvoidCrashSeparator];
+                AvoidCrashLog(@"%@",warningMsg);
+            }
+        }
+    });
+}
+
+- (NSMethodSignature *)avoidCrashMethodSignatureForSelector:(SEL)aSelector {
+    
+    NSMethodSignature *ms = [self avoidCrashMethodSignatureForSelector:aSelector];
+    
+    BOOL flag = NO;
+    if (ms == nil) {
+        for (NSString *classStr in noneSelClassStrings) {
+            if ([self isKindOfClass:NSClassFromString(classStr)]) {
+                ms = [AvoidCrashStubProxy instanceMethodSignatureForSelector:@selector(proxyMethod)];
+                flag = YES;
+                break;
+            }
+        }
+    }
+    if (flag == NO) {
+        NSString *selfClass = NSStringFromClass([self class]);
+        for (NSString *classStrPrefix in noneSelClassStringPrefixs) {
+            if ([selfClass hasPrefix:classStrPrefix]) {
+                ms = [AvoidCrashStubProxy instanceMethodSignatureForSelector:@selector(proxyMethod)];
+            }
+        }
+    }
+    return ms;
+}
+
+- (void)avoidCrashForwardInvocation:(NSInvocation *)anInvocation {
+    
+    @try {
+        [self avoidCrashForwardInvocation:anInvocation];
+        
+    } @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+    } @finally {
+        
+    }
+    
+}
+
+
+//=================================================================
+//                         setValue:forKey:
+//=================================================================
+#pragma mark - setValue:forKey:
+
+- (void)avoidCrashSetValue:(id)value forKey:(NSString *)key {
+    @try {
+        [self avoidCrashSetValue:value forKey:key];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        
+    }
+}
+
+
+//=================================================================
+//                     setValue:forKeyPath:
+//=================================================================
+#pragma mark - setValue:forKeyPath:
+
+- (void)avoidCrashSetValue:(id)value forKeyPath:(NSString *)keyPath {
+    @try {
+        [self avoidCrashSetValue:value forKeyPath:keyPath];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        
+    }
+}
+
+
+
+//=================================================================
+//                     setValue:forUndefinedKey:
+//=================================================================
+#pragma mark - setValue:forUndefinedKey:
+
+- (void)avoidCrashSetValue:(id)value forUndefinedKey:(NSString *)key {
+    @try {
+        [self avoidCrashSetValue:value forUndefinedKey:key];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        
+    }
+}
+
+
+//=================================================================
+//                  setValuesForKeysWithDictionary:
+//=================================================================
+#pragma mark - setValuesForKeysWithDictionary:
+
+- (void)avoidCrashSetValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues {
+    @try {
+        [self avoidCrashSetValuesForKeysWithDictionary:keyedValues];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        
+    }
+}
+
+
+
+@end

+ 29 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSString+AvoidCrash.h

@@ -0,0 +1,29 @@
+//
+//  NSString+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/5.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSString (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+
+/**
+ *  Can avoid crash method
+ *
+ *  1. - (unichar)characterAtIndex:(NSUInteger)index
+ *  2. - (NSString *)substringFromIndex:(NSUInteger)from
+ *  3. - (NSString *)substringToIndex:(NSUInteger)to {
+ *  4. - (NSString *)substringWithRange:(NSRange)range {
+ *  5. - (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement
+ *  6. - (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement options:(NSStringCompareOptions)options range:(NSRange)searchRange
+ *  7. - (NSString *)stringByReplacingCharactersInRange:(NSRange)range withString:(NSString *)replacement
+ *
+ */

+ 204 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/ThirdClass/AvoidCrash/NSString+AvoidCrash.m

@@ -0,0 +1,204 @@
+//
+//  NSString+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/5.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSString+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSString (AvoidCrash)
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        Class stringClass = NSClassFromString(@"__NSCFConstantString");
+        
+        //characterAtIndex
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(characterAtIndex:) method2Sel:@selector(avoidCrashCharacterAtIndex:)];
+        
+        //substringFromIndex
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(substringFromIndex:) method2Sel:@selector(avoidCrashSubstringFromIndex:)];
+        
+        //substringToIndex
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(substringToIndex:) method2Sel:@selector(avoidCrashSubstringToIndex:)];
+        
+        //substringWithRange:
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(substringWithRange:) method2Sel:@selector(avoidCrashSubstringWithRange:)];
+        
+        //stringByReplacingOccurrencesOfString:
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(stringByReplacingOccurrencesOfString:withString:) method2Sel:@selector(avoidCrashStringByReplacingOccurrencesOfString:withString:)];
+        
+        //stringByReplacingOccurrencesOfString:withString:options:range:
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(stringByReplacingOccurrencesOfString:withString:options:range:) method2Sel:@selector(avoidCrashStringByReplacingOccurrencesOfString:withString:options:range:)];
+        
+        //stringByReplacingCharactersInRange:withString:
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(stringByReplacingCharactersInRange:withString:) method2Sel:@selector(avoidCrashStringByReplacingCharactersInRange:withString:)];
+    });
+    
+}
+
+
+//=================================================================
+//                           characterAtIndex:
+//=================================================================
+#pragma mark - characterAtIndex:
+
+- (unichar)avoidCrashCharacterAtIndex:(NSUInteger)index {
+    
+    unichar characteristic;
+    @try {
+        characteristic = [self avoidCrashCharacterAtIndex:index];
+    }
+    @catch (NSException *exception) {
+        
+        NSString *defaultToDo = @"AvoidCrash default is to return a without assign unichar.";
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return characteristic;
+    }
+}
+
+//=================================================================
+//                           substringFromIndex:
+//=================================================================
+#pragma mark - substringFromIndex:
+
+- (NSString *)avoidCrashSubstringFromIndex:(NSUInteger)from {
+    
+    NSString *subString = nil;
+    
+    @try {
+        subString = [self avoidCrashSubstringFromIndex:from];
+    }
+    @catch (NSException *exception) {
+        
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        subString = nil;
+    }
+    @finally {
+        return subString;
+    }
+}
+
+//=================================================================
+//                           substringToIndex
+//=================================================================
+#pragma mark - substringToIndex
+
+- (NSString *)avoidCrashSubstringToIndex:(NSUInteger)to {
+    
+    NSString *subString = nil;
+    
+    @try {
+        subString = [self avoidCrashSubstringToIndex:to];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        subString = nil;
+    }
+    @finally {
+        return subString;
+    }
+}
+
+
+//=================================================================
+//                           substringWithRange:
+//=================================================================
+#pragma mark - substringWithRange:
+
+- (NSString *)avoidCrashSubstringWithRange:(NSRange)range {
+    
+    NSString *subString = nil;
+    
+    @try {
+        subString = [self avoidCrashSubstringWithRange:range];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        subString = nil;
+    }
+    @finally {
+        return subString;
+    }
+}
+
+//=================================================================
+//                stringByReplacingOccurrencesOfString:
+//=================================================================
+#pragma mark - stringByReplacingOccurrencesOfString:
+
+- (NSString *)avoidCrashStringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement {
+    
+    NSString *newStr = nil;
+    
+    @try {
+        newStr = [self avoidCrashStringByReplacingOccurrencesOfString:target withString:replacement];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        newStr = nil;
+    }
+    @finally {
+        return newStr;
+    }
+}
+
+//=================================================================
+//  stringByReplacingOccurrencesOfString:withString:options:range:
+//=================================================================
+#pragma mark - stringByReplacingOccurrencesOfString:withString:options:range:
+
+- (NSString *)avoidCrashStringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement options:(NSStringCompareOptions)options range:(NSRange)searchRange {
+    
+    NSString *newStr = nil;
+    
+    @try {
+        newStr = [self avoidCrashStringByReplacingOccurrencesOfString:target withString:replacement options:options range:searchRange];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        newStr = nil;
+    }
+    @finally {
+        return newStr;
+    }
+}
+
+
+//=================================================================
+//       stringByReplacingCharactersInRange:withString:
+//=================================================================
+#pragma mark - stringByReplacingCharactersInRange:withString:
+
+- (NSString *)avoidCrashStringByReplacingCharactersInRange:(NSRange)range withString:(NSString *)replacement {
+
+    
+    NSString *newStr = nil;
+    
+    @try {
+        newStr = [self avoidCrashStringByReplacingCharactersInRange:range withString:replacement];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        newStr = nil;
+    }
+    @finally {
+        return newStr;
+    }
+}
+
+
+@end

+ 3 - 0
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/Tool/MYFactoryManager.h

@@ -34,6 +34,9 @@
 //第三方
 #import "AFNetworking.h"
 #import "MBProgressHUD.h"
+#import "AvoidCrash.h"
+#import <Bugly/Bugly.h>
+
 //UI
 #import "SearchDeviceViewController.h"
 #import "AnimationView.h"

+ 1 - 1
DanceGame/Classes/FitfunTool/FitfunSDK_V2.0/KpSupport/SDK/UI/SearchDeviceViewController.m

@@ -165,7 +165,7 @@
         TXCarouselCellModel *model = [[TXCarouselCellModel alloc]init];
         model.newsId = i;
         model.peripheral = self.deviceArray[i];
-        NSLog(@"model.peripheral === >> %@",model.peripheral.name);
+//        NSLog(@"model.peripheral === >> %@",model.peripheral.name);
         [dataArr addObject:model];
     }
     [self.shoesCarouselView setArrayData:dataArr];

+ 76 - 2
DanceGame/Unity-iPhone.xcodeproj/project.pbxproj

@@ -190,6 +190,17 @@
 		8CBD47E49638FD0CF890B3BC /* Il2CppMetadataUsage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C7A4AEC80BD848836F713B2 /* Il2CppMetadataUsage.cpp */; };
 		91E346D88C9D5D9F7D2FA874 /* Il2CppInteropDataTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E5DC4F7E951D1ECD94986099 /* Il2CppInteropDataTable.cpp */; };
 		92E64B4E99F11D7332C25194 /* Il2CppCompilerCalculateTypeValues_10Table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A1348B696429D055C356554 /* Il2CppCompilerCalculateTypeValues_10Table.cpp */; };
+		93AFCE54278FCE1E00BF6965 /* NSArray+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE3D278FCE1D00BF6965 /* NSArray+AvoidCrash.m */; };
+		93AFCE55278FCE1E00BF6965 /* NSString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE3F278FCE1D00BF6965 /* NSString+AvoidCrash.m */; };
+		93AFCE56278FCE1E00BF6965 /* NSDictionary+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE40278FCE1D00BF6965 /* NSDictionary+AvoidCrash.m */; };
+		93AFCE57278FCE1E00BF6965 /* NSMutableDictionary+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE43278FCE1D00BF6965 /* NSMutableDictionary+AvoidCrash.m */; };
+		93AFCE58278FCE1E00BF6965 /* NSMutableString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE45278FCE1D00BF6965 /* NSMutableString+AvoidCrash.m */; };
+		93AFCE59278FCE1E00BF6965 /* NSObject+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE46278FCE1D00BF6965 /* NSObject+AvoidCrash.m */; };
+		93AFCE5A278FCE1E00BF6965 /* NSMutableArray+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE47278FCE1D00BF6965 /* NSMutableArray+AvoidCrash.m */; };
+		93AFCE5B278FCE1E00BF6965 /* NSMutableAttributedString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE48278FCE1D00BF6965 /* NSMutableAttributedString+AvoidCrash.m */; };
+		93AFCE5C278FCE1E00BF6965 /* NSAttributedString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE49278FCE1D00BF6965 /* NSAttributedString+AvoidCrash.m */; };
+		93AFCE5D278FCE1E00BF6965 /* AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE4C278FCE1D00BF6965 /* AvoidCrash.m */; };
+		93AFCE5E278FCE1E00BF6965 /* AvoidCrashStubProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE4F278FCE1D00BF6965 /* AvoidCrashStubProxy.m */; };
 		93BB27B32785A1820019B85C /* SocketRocketUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 93BB27AF2785A1820019B85C /* SocketRocketUtility.m */; };
 		93BB27B42785A1820019B85C /* SRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 93BB27B02785A1820019B85C /* SRWebSocket.m */; };
 		93E62D3C276C86EA006975D1 /* TXCarouselCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 93E62CA5276C86E9006975D1 /* TXCarouselCollectionViewCell.xib */; };
@@ -637,6 +648,29 @@
 		8DD1467686B0602CA38E0CC9 /* Bulk_UnityEngine.GridModule_0.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Bulk_UnityEngine.GridModule_0.cpp; path = Classes/Native/Bulk_UnityEngine.GridModule_0.cpp; sourceTree = SOURCE_ROOT; };
 		913F48D5B9075C1037EDE48D /* GenericMethods0.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = GenericMethods0.cpp; path = Classes/Native/GenericMethods0.cpp; sourceTree = SOURCE_ROOT; };
 		935642749A1C0E55C636858E /* Bulk_Assembly-CSharp_1.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "Bulk_Assembly-CSharp_1.cpp"; path = "Classes/Native/Bulk_Assembly-CSharp_1.cpp"; sourceTree = SOURCE_ROOT; };
+		93AFCE3D278FCE1D00BF6965 /* NSArray+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCE3E278FCE1D00BF6965 /* AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AvoidCrash.h; sourceTree = "<group>"; };
+		93AFCE3F278FCE1D00BF6965 /* NSString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCE40278FCE1D00BF6965 /* NSDictionary+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCE41278FCE1D00BF6965 /* NSAttributedString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSAttributedString+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCE42278FCE1D00BF6965 /* AvoidCrashStubProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AvoidCrashStubProxy.h; sourceTree = "<group>"; };
+		93AFCE43278FCE1D00BF6965 /* NSMutableDictionary+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableDictionary+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCE44278FCE1D00BF6965 /* AvoidCrashProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AvoidCrashProtocol.h; sourceTree = "<group>"; };
+		93AFCE45278FCE1D00BF6965 /* NSMutableString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableString+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCE46278FCE1D00BF6965 /* NSObject+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCE47278FCE1D00BF6965 /* NSMutableArray+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCE48278FCE1D00BF6965 /* NSMutableAttributedString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableAttributedString+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCE49278FCE1D00BF6965 /* NSAttributedString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSAttributedString+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCE4A278FCE1D00BF6965 /* NSDictionary+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCE4B278FCE1D00BF6965 /* NSString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCE4C278FCE1D00BF6965 /* AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AvoidCrash.m; sourceTree = "<group>"; };
+		93AFCE4D278FCE1D00BF6965 /* NSArray+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCE4E278FCE1D00BF6965 /* NSMutableDictionary+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableDictionary+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCE4F278FCE1D00BF6965 /* AvoidCrashStubProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AvoidCrashStubProxy.m; sourceTree = "<group>"; };
+		93AFCE50278FCE1D00BF6965 /* NSObject+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCE51278FCE1D00BF6965 /* NSMutableString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableString+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCE52278FCE1D00BF6965 /* NSMutableAttributedString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableAttributedString+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCE53278FCE1D00BF6965 /* NSMutableArray+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+AvoidCrash.h"; sourceTree = "<group>"; };
 		93BB27AF2785A1820019B85C /* SocketRocketUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SocketRocketUtility.m; sourceTree = "<group>"; };
 		93BB27B02785A1820019B85C /* SRWebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SRWebSocket.m; sourceTree = "<group>"; };
 		93BB27B12785A1820019B85C /* SocketRocketUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketRocketUtility.h; sourceTree = "<group>"; };
@@ -669,7 +703,6 @@
 		93E62CC2276C86E9006975D1 /* BTDataProcess.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BTDataProcess.mm; sourceTree = "<group>"; };
 		93E62CC3276C86E9006975D1 /* LEONBLManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LEONBLManager.m; sourceTree = "<group>"; };
 		93E62CC4276C86E9006975D1 /* CBPeripheral+ADName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CBPeripheral+ADName.h"; sourceTree = "<group>"; };
-		93E62CC5276C86E9006975D1 /* PrefixHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.h; sourceTree = "<group>"; };
 		93E62CC7276C86E9006975D1 /* UserFriendsModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserFriendsModel.m; sourceTree = "<group>"; };
 		93E62CC8276C86E9006975D1 /* UserFriendsModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserFriendsModel.h; sourceTree = "<group>"; };
 		93E62CCB276C86E9006975D1 /* MBProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBProgressHUD.m; sourceTree = "<group>"; };
@@ -1157,6 +1190,36 @@
 			path = Unity;
 			sourceTree = "<group>";
 		};
+		93AFCE3C278FCE1D00BF6965 /* AvoidCrash */ = {
+			isa = PBXGroup;
+			children = (
+				93AFCE3D278FCE1D00BF6965 /* NSArray+AvoidCrash.m */,
+				93AFCE3E278FCE1D00BF6965 /* AvoidCrash.h */,
+				93AFCE3F278FCE1D00BF6965 /* NSString+AvoidCrash.m */,
+				93AFCE40278FCE1D00BF6965 /* NSDictionary+AvoidCrash.m */,
+				93AFCE41278FCE1D00BF6965 /* NSAttributedString+AvoidCrash.h */,
+				93AFCE42278FCE1D00BF6965 /* AvoidCrashStubProxy.h */,
+				93AFCE43278FCE1D00BF6965 /* NSMutableDictionary+AvoidCrash.m */,
+				93AFCE44278FCE1D00BF6965 /* AvoidCrashProtocol.h */,
+				93AFCE45278FCE1D00BF6965 /* NSMutableString+AvoidCrash.m */,
+				93AFCE46278FCE1D00BF6965 /* NSObject+AvoidCrash.m */,
+				93AFCE47278FCE1D00BF6965 /* NSMutableArray+AvoidCrash.m */,
+				93AFCE48278FCE1D00BF6965 /* NSMutableAttributedString+AvoidCrash.m */,
+				93AFCE49278FCE1D00BF6965 /* NSAttributedString+AvoidCrash.m */,
+				93AFCE4A278FCE1D00BF6965 /* NSDictionary+AvoidCrash.h */,
+				93AFCE4B278FCE1D00BF6965 /* NSString+AvoidCrash.h */,
+				93AFCE4C278FCE1D00BF6965 /* AvoidCrash.m */,
+				93AFCE4D278FCE1D00BF6965 /* NSArray+AvoidCrash.h */,
+				93AFCE4E278FCE1D00BF6965 /* NSMutableDictionary+AvoidCrash.h */,
+				93AFCE4F278FCE1D00BF6965 /* AvoidCrashStubProxy.m */,
+				93AFCE50278FCE1D00BF6965 /* NSObject+AvoidCrash.h */,
+				93AFCE51278FCE1D00BF6965 /* NSMutableString+AvoidCrash.h */,
+				93AFCE52278FCE1D00BF6965 /* NSMutableAttributedString+AvoidCrash.h */,
+				93AFCE53278FCE1D00BF6965 /* NSMutableArray+AvoidCrash.h */,
+			);
+			path = AvoidCrash;
+			sourceTree = "<group>";
+		};
 		93BB27AE2785A1820019B85C /* socket */ = {
 			isa = PBXGroup;
 			children = (
@@ -1176,7 +1239,6 @@
 				93E62CCE276C86E9006975D1 /* HTTP */,
 				93E62CFF276C86E9006975D1 /* IOSPlatformSDK.h */,
 				93E62CCD276C86E9006975D1 /* IOSPlatformSDK.mm */,
-				93E62CC5276C86E9006975D1 /* PrefixHeader.h */,
 				93E62D00276C86E9006975D1 /* resources   */,
 				93E62CE0276C86E9006975D1 /* shoes_sdk */,
 				93E62CC9276C86E9006975D1 /* ThirdClass */,
@@ -1272,6 +1334,7 @@
 		93E62CC9276C86E9006975D1 /* ThirdClass */ = {
 			isa = PBXGroup;
 			children = (
+				93AFCE3C278FCE1D00BF6965 /* AvoidCrash */,
 				93E62CCA276C86E9006975D1 /* MBProgressHUD */,
 			);
 			path = ThirdClass;
@@ -1879,15 +1942,18 @@
 				8A3EDDC81615B7C1001839E9 /* SplashScreen.mm in Sources */,
 				8AC71EC419E7FBA90027502F /* OrientationSupport.mm in Sources */,
 				8A7939FD1ED2F53200B44EF1 /* UnityViewControllerBase.mm in Sources */,
+				93AFCE54278FCE1E00BF6965 /* NSArray+AvoidCrash.m in Sources */,
 				8A9FCB131617295F00C05364 /* ActivityIndicator.mm in Sources */,
 				8A8D90DA1A274A7800456C4E /* UnityAppController+UnityInterface.mm in Sources */,
 				8AA5D80217ABE9AF007B9910 /* UnityAppController+Rendering.mm in Sources */,
 				8A142DC61636943E00DD87CA /* Keyboard.mm in Sources */,
 				8A0FED491649699200E9727D /* EAGLContextHelper.mm in Sources */,
 				AAFE69D219F187C200638316 /* UnityViewControllerListener.mm in Sources */,
+				93AFCE55278FCE1E00BF6965 /* NSString+AvoidCrash.m in Sources */,
 				93E62D43276C86EA006975D1 /* TXCarouselView.m in Sources */,
 				8A1FFFAD16512A9000DD0934 /* GlesHelper.mm in Sources */,
 				93E62D3D276C86EA006975D1 /* TXCarouselCellModel.m in Sources */,
+				93AFCE5D278FCE1E00BF6965 /* AvoidCrash.m in Sources */,
 				848031E11C5160D700FCEAB7 /* UnityReplayKit_Scripting.mm in Sources */,
 				8A5E0B9116849D1800CBB6FE /* DisplayManager.mm in Sources */,
 				8A367F5B16A6D36F0012ED11 /* CVTextureCache.mm in Sources */,
@@ -1996,6 +2062,7 @@
 				13ED4282B2B2FE71284E8906 /* Bulk_System_0.cpp in Sources */,
 				93E62D50276C86EA006975D1 /* AFHTTPSessionManager.m in Sources */,
 				BA1D43F3930E8B6B3CCE9E89 /* Bulk_System_1.cpp in Sources */,
+				93AFCE58278FCE1E00BF6965 /* NSMutableString+AvoidCrash.m in Sources */,
 				93E62D54276C86EA006975D1 /* AFSecurityPolicy.m in Sources */,
 				ABA24DC1A2AAA9C9595AE02A /* Bulk_System_2.cpp in Sources */,
 				692F41D9AE0AA74A87B43325 /* Bulk_System_3.cpp in Sources */,
@@ -2007,6 +2074,7 @@
 				93E62D97276C86EA006975D1 /* UIView+ST.m in Sources */,
 				343E410894CFEBFD3CD348E7 /* Bulk_UnityEngine.CoreModule_1.cpp in Sources */,
 				044644B68C5D373550131AB8 /* Bulk_UnityEngine.DirectorModule_0.cpp in Sources */,
+				93AFCE5A278FCE1E00BF6965 /* NSMutableArray+AvoidCrash.m in Sources */,
 				93E62D4D276C86EA006975D1 /* IOSPlatformSDK.mm in Sources */,
 				D82940C49EC5173E6CF8082B /* Bulk_UnityEngine.GameCenterModule_0.cpp in Sources */,
 				93E62D48276C86EA006975D1 /* CBPeripheral+ADName.m in Sources */,
@@ -2029,6 +2097,7 @@
 				E0984461AEE955AD1EC4A06A /* Bulk_UnityEngine.TilemapModule_0.cpp in Sources */,
 				5CFA4092AB4C29A7F58ADC65 /* Bulk_UnityEngine.UIModule_0.cpp in Sources */,
 				93E62D49276C86EA006975D1 /* BTDataProcess.mm in Sources */,
+				93AFCE57278FCE1E00BF6965 /* NSMutableDictionary+AvoidCrash.m in Sources */,
 				BFC94C89B984F43D24F92844 /* Bulk_UnityEngine.UnityConnectModule_0.cpp in Sources */,
 				83B5448F8D9D7E1244651E88 /* Bulk_UnityEngine.UnityWebRequestModule_0.cpp in Sources */,
 				0C72474F817EA3F2211EA45E /* Bulk_UnityEngine.UnityWebRequestWWWModule_0.cpp in Sources */,
@@ -2048,6 +2117,7 @@
 				6CA14F0783BC9B9A938CD8E7 /* Bulk_mscorlib_2.cpp in Sources */,
 				B99045998C728022F3DC6224 /* Bulk_mscorlib_3.cpp in Sources */,
 				25DE4B40997AB1A380D883C8 /* Bulk_mscorlib_4.cpp in Sources */,
+				93AFCE5B278FCE1E00BF6965 /* NSMutableAttributedString+AvoidCrash.m in Sources */,
 				93E7383E278BD7550017A553 /* InertialTrajProcess.cpp in Sources */,
 				C3B3441AA2C159513394E23C /* Bulk_mscorlib_5.cpp in Sources */,
 				A9584B99BE22FFFCB8EAA952 /* Bulk_mscorlib_6.cpp in Sources */,
@@ -2078,6 +2148,7 @@
 				FA8D41FCBBB52B8D5540BDB7 /* Il2CppCompilerCalculateTypeValues_16Table.cpp in Sources */,
 				1BA2482D908726733F0A3042 /* Il2CppCompilerCalculateTypeValues_17Table.cpp in Sources */,
 				EEB649C2BA2E040004604ABA /* Il2CppCompilerCalculateTypeValues_18Table.cpp in Sources */,
+				93AFCE59278FCE1E00BF6965 /* NSObject+AvoidCrash.m in Sources */,
 				E9F2496795478643FA78487E /* Il2CppCompilerCalculateTypeValues_19Table.cpp in Sources */,
 				F88040AE9876841FC2092B16 /* Il2CppCompilerCalculateTypeValues_1Table.cpp in Sources */,
 				0AC44F1A85A70D754260E1B4 /* Il2CppCompilerCalculateTypeValues_20Table.cpp in Sources */,
@@ -2087,6 +2158,7 @@
 				93E62D4E276C86EA006975D1 /* HTTPDataProcession.m in Sources */,
 				820E4F7DBE6EF69520082D77 /* Il2CppCompilerCalculateTypeValues_24Table.cpp in Sources */,
 				FF7044D9AA05C853574AAB39 /* Il2CppCompilerCalculateTypeValues_25Table.cpp in Sources */,
+				93AFCE56278FCE1E00BF6965 /* NSDictionary+AvoidCrash.m in Sources */,
 				18C0498D880B6CD1C5BFC44D /* Il2CppCompilerCalculateTypeValues_26Table.cpp in Sources */,
 				A0C94CB78A8084FE9C51766E /* Il2CppCompilerCalculateTypeValues_27Table.cpp in Sources */,
 				93E62D51276C86EA006975D1 /* AFURLSessionManager.m in Sources */,
@@ -2128,6 +2200,7 @@
 				3B6A42728BBA820CA7662220 /* Il2CppCompilerCalculateTypeValues_8Table.cpp in Sources */,
 				1181422791D23E5B1A13298A /* Il2CppCompilerCalculateTypeValues_9Table.cpp in Sources */,
 				93E7383A278BD7550017A553 /* jumpH5.cpp in Sources */,
+				93AFCE5E278FCE1E00BF6965 /* AvoidCrashStubProxy.m in Sources */,
 				6A394CCBA3BD2AAE54EE16A5 /* Il2CppGenericClassTable.cpp in Sources */,
 				194B4FD28A0F1AE3078322FE /* Il2CppGenericComDefinitions0.cpp in Sources */,
 				C13C4803975A58AFCAAB4B05 /* Il2CppGenericInstDefinitions.cpp in Sources */,
@@ -2141,6 +2214,7 @@
 				EB244CC8A5A14504533B8B8D /* Il2CppMetadataRegistration.cpp in Sources */,
 				8CBD47E49638FD0CF890B3BC /* Il2CppMetadataUsage.cpp in Sources */,
 				EA3A4B1F90828D7E1D058556 /* Il2CppMethodPointerTable.cpp in Sources */,
+				93AFCE5C278FCE1E00BF6965 /* NSAttributedString+AvoidCrash.m in Sources */,
 				93E73835278BD7550017A553 /* OriginTraj.cpp in Sources */,
 				E18A461783D85B8951E85F9F /* Il2CppReversePInvokeWrapperTable.cpp in Sources */,
 				8B534B3E836CF26E0EE4099D /* Il2CppTypeDefinitions.cpp in Sources */,

BIN
DanceGame/Unity-iPhone.xcodeproj/project.xcworkspace/xcuserdata/duowan123.xcuserdatad/UserInterfaceState.xcuserstate


BIN
RunGame/.DS_Store


+ 0 - 4
RunGame/Classes/UnityAppController.mm

@@ -40,7 +40,6 @@
 #include <unistd.h>
 #include <sys/sysctl.h>
 #import "IOSPlatformSDK.h"
-//#import <Bugly/Bugly.h>
 
 // we assume that app delegate is never changed and we can cache it, instead of re-query UIApplication every time
 UnityAppController* _UnityAppController = nil;
@@ -344,9 +343,6 @@ extern "C" void UnityCleanupTrampoline()
          [IOSPlatformSDK sharedInstance];
      }
 
-//    [Bugly startWithAppId:@"f34d6a4e57"];
-
-    
 
     return YES;
 }

BIN
RunGame/SDK/.DS_Store


+ 1 - 1
RunGame/SDK/BLE/BTDataProcess.mm

@@ -729,7 +729,7 @@ void inviteFriends (CFNotificationCenterRef center, void *observer, CFStringRef
     int right[attLength];
      game->getFootAtt(left, right);
     self.nativeAttX = left[0];
-    NSLog(@"self.nativeAttX = %d",self.nativeAttX);
+//    NSLog(@"self.nativeAttX = %d",self.nativeAttX);
     
     /****************** ios call unity*****************/
         if (self.gameModel==YES){//当前是游戏模式

+ 4 - 2
RunGame/SDK/IOSPlatformSDK.mm

@@ -7,6 +7,7 @@
 
 
 #import "IOSPlatformSDK.h"
+#import "AvoidCrash.h"
 
 #pragma mark ============================>> ios call unity (定义名字参数和C#类一样的方法)
 //大概流程就是先将C#的函数指针存入OC内存,在OC需要回调unity的时候就可以使用不同的指针来回调不同的unity方法
@@ -79,7 +80,6 @@ static InviteFriendHandler inviteFriendHandler;
 static GetRankHandler getRankHandler;
 static RotateHandler rotateHandler;
 
-
 @implementation IOSPlatformSDK
 
 #pragma mark ============================>> SDK 单例
@@ -101,6 +101,8 @@ static IOSPlatformSDK * instance;
     dispatch_once(&onceToken, ^{
         instance = [super init];
         [BTDataProcess sharedInstance];
+        //防奔溃
+        [AvoidCrash makeAllEffective];
     });
     return instance;
 }
@@ -139,7 +141,7 @@ static IOSPlatformSDK * instance;
               rightStatus:(int)rightStatus
                  leftFrag:(int)leftFrag
                 rightFrag:(int)rightFrag{
-    if (stepHandler != nil) {
+    if (stepHandler != nil){
         stepHandler(cusid,leftStatus,rightStatus,leftFrag,rightFrag);
     }
 }

BIN
RunGame/SDK/ThirdClass/.DS_Store


+ 116 - 0
RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrash.h

@@ -0,0 +1,116 @@
+//
+//  AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+//===================================================
+//   使用方法和注意事项:
+//   https://www.jianshu.com/p/2b90aa96c0a0
+//===================================================
+
+#import <Foundation/Foundation.h>
+#import <objc/runtime.h>
+
+//category
+#import "NSObject+AvoidCrash.h"
+
+#import "NSArray+AvoidCrash.h"
+#import "NSMutableArray+AvoidCrash.h"
+
+#import "NSDictionary+AvoidCrash.h"
+#import "NSMutableDictionary+AvoidCrash.h"
+
+#import "NSString+AvoidCrash.h"
+#import "NSMutableString+AvoidCrash.h"
+
+#import "NSAttributedString+AvoidCrash.h"
+#import "NSMutableAttributedString+AvoidCrash.h"
+
+//define
+#import "AvoidCrashStubProxy.h"
+
+
+
+
+
+@interface AvoidCrash : NSObject
+
+//===================================================
+//   使用方法和注意事项:
+//   https://www.jianshu.com/p/2b90aa96c0a0
+//===================================================
+
+
+
+/**
+ *  
+ *  开始生效.你可以在AppDelegate的didFinishLaunchingWithOptions方法中调用becomeEffective方法
+ *  【默认不开启  对”unrecognized selector sent to instance”防止崩溃的处理】
+ *
+ *  这是全局生效,若你只需要部分生效,你可以单个进行处理,比如:
+ *  [NSArray avoidCrashExchangeMethod];
+ *  [NSMutableArray avoidCrashExchangeMethod];
+ *  .................
+ *  .................
+ *
+ */
++ (void)becomeEffective;
+
+
+/** 
+ *  相比于becomeEffective,增加
+ *  对”unrecognized selector sent to instance”防止崩溃的处理
+ *
+ *  但是必须配合:
+ *            setupClassStringsArr:和
+ *            setupNoneSelClassStringPrefixsArr
+ *            这两个方法可以同时使用
+ */
++ (void)makeAllEffective;
+
+
+
+/** 
+ *  初始化一个需要防止”unrecognized selector sent to instance”的崩溃的类名数组
+ *  ⚠️不可将@"NSObject"加入classStrings数组中
+ *  ⚠️不可将UI前缀的字符串加入classStrings数组中
+ */
++ (void)setupNoneSelClassStringsArr:(NSArray<NSString *> *)classStrings;
+
+
+/**
+ *  初始化一个需要防止”unrecognized selector sent to instance”的崩溃的类名前缀的数组
+ *  ⚠️不可将UI前缀的字符串(包括@"UI")加入classStringPrefixs数组中
+ *  ⚠️不可将NS前缀的字符串(包括@"NS")加入classStringPrefixs数组中
+ */
++ (void)setupNoneSelClassStringPrefixsArr:(NSArray<NSString *> *)classStringPrefixs;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//您可以忽略以下方法
+
++ (void)exchangeClassMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel;
+
++ (void)exchangeInstanceMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel;
+
++ (void)noteErrorWithException:(NSException *)exception defaultToDo:(NSString *)defaultToDo;
+
+
+@end

+ 219 - 0
RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrash.m

@@ -0,0 +1,219 @@
+//
+//  AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "AvoidCrash.h"
+
+
+
+
+#define key_errorName        @"errorName"
+#define key_errorReason      @"errorReason"
+#define key_errorPlace       @"errorPlace"
+#define key_defaultToDo      @"defaultToDo"
+#define key_callStackSymbols @"callStackSymbols"
+#define key_exception        @"exception"
+
+
+@implementation AvoidCrash
+
+
++ (void)becomeEffective {
+    [self effectiveIfDealWithNoneSel:NO];
+    
+}
+
++ (void)makeAllEffective {
+    [self effectiveIfDealWithNoneSel:YES];
+}
+
++ (void)effectiveIfDealWithNoneSel:(BOOL)dealWithNoneSel {
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        [NSObject avoidCrashExchangeMethodIfDealWithNoneSel:dealWithNoneSel];
+        
+        [NSArray avoidCrashExchangeMethod];
+        [NSMutableArray avoidCrashExchangeMethod];
+        
+        [NSDictionary avoidCrashExchangeMethod];
+        [NSMutableDictionary avoidCrashExchangeMethod];
+        
+        [NSString avoidCrashExchangeMethod];
+        [NSMutableString avoidCrashExchangeMethod];
+        
+        [NSAttributedString avoidCrashExchangeMethod];
+        [NSMutableAttributedString avoidCrashExchangeMethod];
+    });
+}
+
++ (void)setupNoneSelClassStringsArr:(NSArray<NSString *> *)classStrings {
+    [NSObject setupNoneSelClassStringsArr:classStrings];
+}
+
+/**
+ *  初始化一个需要防止”unrecognized selector sent to instance”的崩溃的类名前缀的数组
+ */
++ (void)setupNoneSelClassStringPrefixsArr:(NSArray<NSString *> *)classStringPrefixs {
+    [NSObject setupNoneSelClassStringPrefixsArr:classStringPrefixs];
+}
+
+
+/**
+ *  类方法的交换
+ *
+ *  @param anClass    哪个类
+ *  @param method1Sel 方法1
+ *  @param method2Sel 方法2
+ */
++ (void)exchangeClassMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel {
+    Method method1 = class_getClassMethod(anClass, method1Sel);
+    Method method2 = class_getClassMethod(anClass, method2Sel);
+    method_exchangeImplementations(method1, method2);
+}
+
+
+/**
+ *  对象方法的交换
+ *
+ *  @param anClass    哪个类
+ *  @param method1Sel 方法1(原本的方法)
+ *  @param method2Sel 方法2(要替换成的方法)
+ */
++ (void)exchangeInstanceMethod:(Class)anClass method1Sel:(SEL)method1Sel method2Sel:(SEL)method2Sel {
+    
+    
+    Method originalMethod = class_getInstanceMethod(anClass, method1Sel);
+    Method swizzledMethod = class_getInstanceMethod(anClass, method2Sel);
+    
+    BOOL didAddMethod =
+    class_addMethod(anClass,
+                    method1Sel,
+                    method_getImplementation(swizzledMethod),
+                    method_getTypeEncoding(swizzledMethod));
+    
+    if (didAddMethod) {
+        class_replaceMethod(anClass,
+                            method2Sel,
+                            method_getImplementation(originalMethod),
+                            method_getTypeEncoding(originalMethod));
+    }
+    
+    else {
+        method_exchangeImplementations(originalMethod, swizzledMethod);
+    }
+    
+}
+
+
+
+/**
+ *  获取堆栈主要崩溃精简化的信息<根据正则表达式匹配出来>
+ *
+ *  @param callStackSymbols 堆栈主要崩溃信息
+ *
+ *  @return 堆栈主要崩溃精简化的信息
+ */
+
++ (NSString *)getMainCallStackSymbolMessageWithCallStackSymbols:(NSArray<NSString *> *)callStackSymbols {
+    
+    //mainCallStackSymbolMsg的格式为   +[类名 方法名]  或者 -[类名 方法名]
+    __block NSString *mainCallStackSymbolMsg = nil;
+    
+    //匹配出来的格式为 +[类名 方法名]  或者 -[类名 方法名]
+    NSString *regularExpStr = @"[-\\+]\\[.+\\]";
+    
+    
+    NSRegularExpression *regularExp = [[NSRegularExpression alloc] initWithPattern:regularExpStr options:NSRegularExpressionCaseInsensitive error:nil];
+    
+    
+    for (int index = 2; index < callStackSymbols.count; index++) {
+        NSString *callStackSymbol = callStackSymbols[index];
+        
+        [regularExp enumerateMatchesInString:callStackSymbol options:NSMatchingReportProgress range:NSMakeRange(0, callStackSymbol.length) usingBlock:^(NSTextCheckingResult * _Nullable result, NSMatchingFlags flags, BOOL * _Nonnull stop) {
+            if (result) {
+                NSString* tempCallStackSymbolMsg = [callStackSymbol substringWithRange:result.range];
+                
+                //get className
+                NSString *className = [tempCallStackSymbolMsg componentsSeparatedByString:@" "].firstObject;
+                className = [className componentsSeparatedByString:@"["].lastObject;
+                
+                NSBundle *bundle = [NSBundle bundleForClass:NSClassFromString(className)];
+                
+                //filter category and system class
+                if (![className hasSuffix:@")"] && bundle == [NSBundle mainBundle]) {
+                    mainCallStackSymbolMsg = tempCallStackSymbolMsg;
+                    
+                }
+                *stop = YES;
+            }
+        }];
+        
+        if (mainCallStackSymbolMsg.length) {
+            break;
+        }
+    }
+    
+    return mainCallStackSymbolMsg;
+}
+
+
+/**
+ *  提示崩溃的信息(控制台输出、通知)
+ *
+ *  @param exception   捕获到的异常
+ *  @param defaultToDo 这个框架里默认的做法
+ */
++ (void)noteErrorWithException:(NSException *)exception defaultToDo:(NSString *)defaultToDo {
+
+    //堆栈数据
+    NSArray *callStackSymbolsArr = [NSThread callStackSymbols];
+    
+    //获取在哪个类的哪个方法中实例化的数组  字符串格式 -[类名 方法名]  或者 +[类名 方法名]
+    NSString *mainCallStackSymbolMsg = [AvoidCrash getMainCallStackSymbolMessageWithCallStackSymbols:callStackSymbolsArr];
+    
+    if (mainCallStackSymbolMsg == nil) {
+        
+        mainCallStackSymbolMsg = @"崩溃方法定位失败,请您查看函数调用栈来排查错误原因";
+        
+    }
+    
+    NSString *errorName = exception.name;
+    NSString *errorReason = exception.reason;
+    //errorReason 可能为 -[__NSCFConstantString avoidCrashCharacterAtIndex:]: Range or index out of bounds
+    //将avoidCrash去掉
+    errorReason = [errorReason stringByReplacingOccurrencesOfString:@"avoidCrash" withString:@""];
+    
+    NSString *errorPlace = [NSString stringWithFormat:@"Error Place:%@",mainCallStackSymbolMsg];
+    
+    NSString *logErrorMessage = [NSString stringWithFormat:@"\n\n%@\n\n%@\n%@\n%@\n%@",AvoidCrashSeparatorWithFlag, errorName, errorReason, errorPlace, defaultToDo];
+    
+    logErrorMessage = [NSString stringWithFormat:@"%@\n\n%@\n\n",logErrorMessage,AvoidCrashSeparator];
+    AvoidCrashLog(@"%@",logErrorMessage);
+    
+    
+    //请忽略下面的赋值,目的只是为了能顺利上传到cocoapods
+    logErrorMessage = logErrorMessage;
+    
+    NSDictionary *errorInfoDic = @{
+                                   key_errorName        : errorName,
+                                   key_errorReason      : errorReason,
+                                   key_errorPlace       : errorPlace,
+                                   key_defaultToDo      : defaultToDo,
+                                   key_exception        : exception,
+                                   key_callStackSymbols : callStackSymbolsArr
+                                   };
+    
+    //将错误信息放在字典里,用通知的形式发送出去
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [[NSNotificationCenter defaultCenter] postNotificationName:AvoidCrashNotification object:nil userInfo:errorInfoDic];
+    });
+}
+
+
+
+@end

+ 17 - 0
RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrashProtocol.h

@@ -0,0 +1,17 @@
+//
+//  AvoidCrashProtocol.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by chenfanfang on 2017/7/22.
+//  Copyright © 2017年 chenfanfang. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@protocol AvoidCrashProtocol <NSObject>
+
+@required
++ (void)avoidCrashExchangeMethod;
+
+@end

+ 37 - 0
RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrashStubProxy.h

@@ -0,0 +1,37 @@
+//
+//  AvoidCrashStubProxy.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by chenfanfang on 2017/7/25.
+//  Copyright © 2017年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+#define AvoidCrashNotification @"AvoidCrashNotification"
+#define AvoidCrashIsiOS(version) ([[UIDevice currentDevice].systemVersion floatValue] >= version)
+
+
+//user can ignore below define
+#define AvoidCrashDefaultReturnNil  @"AvoidCrash default is to return nil to avoid crash."
+#define AvoidCrashDefaultIgnore     @"AvoidCrash default is to ignore this operation to avoid crash."
+
+#define AvoidCrashSeparator         @"================================================================"
+#define AvoidCrashSeparatorWithFlag @"========================AvoidCrash Log=========================="
+
+
+#ifdef DEBUG
+
+#define  AvoidCrashLog(...) NSLog(@"%@",[NSString stringWithFormat:__VA_ARGS__])
+
+#else
+
+#define AvoidCrashLog(...)
+#endif
+
+@interface AvoidCrashStubProxy : NSObject
+
+- (void)proxyMethod;
+
+@end

+ 18 - 0
RunGame/SDK/ThirdClass/AvoidCrash/AvoidCrashStubProxy.m

@@ -0,0 +1,18 @@
+//
+//  AvoidCrashStubProxy.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by chenfanfang on 2017/7/25.
+//  Copyright © 2017年 chenfanfang. All rights reserved.
+//
+
+#import "AvoidCrashStubProxy.h"
+
+
+@implementation AvoidCrashStubProxy
+
+- (void)proxyMethod {
+    
+}
+
+@end

+ 25 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSArray+AvoidCrash.h

@@ -0,0 +1,25 @@
+//
+//  NSArray+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSArray (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+
+/**
+ *  Can avoid crash method
+ *
+ *  1. NSArray的快速创建方式 NSArray *array = @[@"chenfanfang", @"AvoidCrash"];  //这种创建方式其实调用的是2中的方法
+ *  2. +(instancetype)arrayWithObjects:(const id  _Nonnull __unsafe_unretained *)objects count:(NSUInteger)cnt
+ *  3. - (id)objectAtIndex:(NSUInteger)index
+ *  4. - (void)getObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range
+ */    

+ 258 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSArray+AvoidCrash.m

@@ -0,0 +1,258 @@
+//
+//  NSArray+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSArray+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSArray (AvoidCrash)
+
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        //=================
+        //   class method
+        //=================
+        
+        //instance array method exchange
+        [AvoidCrash exchangeClassMethod:[self class] method1Sel:@selector(arrayWithObjects:count:) method2Sel:@selector(AvoidCrashArrayWithObjects:count:)];
+        
+        
+        
+        //====================
+        //   instance method
+        //====================
+        
+        Class __NSArray = NSClassFromString(@"NSArray");
+        Class __NSArrayI = NSClassFromString(@"__NSArrayI");
+        Class __NSSingleObjectArrayI = NSClassFromString(@"__NSSingleObjectArrayI");
+        Class __NSArray0 = NSClassFromString(@"__NSArray0");
+        
+        
+        //objectsAtIndexes:
+        [AvoidCrash exchangeInstanceMethod:__NSArray method1Sel:@selector(objectsAtIndexes:) method2Sel:@selector(avoidCrashObjectsAtIndexes:)];
+        
+        
+        //objectAtIndex:
+        
+        [AvoidCrash exchangeInstanceMethod:__NSArrayI method1Sel:@selector(objectAtIndex:) method2Sel:@selector(__NSArrayIAvoidCrashObjectAtIndex:)];
+        
+        [AvoidCrash exchangeInstanceMethod:__NSSingleObjectArrayI method1Sel:@selector(objectAtIndex:) method2Sel:@selector(__NSSingleObjectArrayIAvoidCrashObjectAtIndex:)];
+        
+        [AvoidCrash exchangeInstanceMethod:__NSArray0 method1Sel:@selector(objectAtIndex:) method2Sel:@selector(__NSArray0AvoidCrashObjectAtIndex:)];
+        
+        //objectAtIndexedSubscript:
+        if (AvoidCrashIsiOS(11.0)) {
+            [AvoidCrash exchangeInstanceMethod:__NSArrayI method1Sel:@selector(objectAtIndexedSubscript:) method2Sel:@selector(__NSArrayIAvoidCrashObjectAtIndexedSubscript:)];
+        }
+        
+        
+        //getObjects:range:
+        [AvoidCrash exchangeInstanceMethod:__NSArray method1Sel:@selector(getObjects:range:) method2Sel:@selector(NSArrayAvoidCrashGetObjects:range:)];
+        
+        [AvoidCrash exchangeInstanceMethod:__NSSingleObjectArrayI method1Sel:@selector(getObjects:range:) method2Sel:@selector(__NSSingleObjectArrayIAvoidCrashGetObjects:range:)];
+        
+        [AvoidCrash exchangeInstanceMethod:__NSArrayI method1Sel:@selector(getObjects:range:) method2Sel:@selector(__NSArrayIAvoidCrashGetObjects:range:)];
+    });
+    
+    
+}
+
+
+//=================================================================
+//                        instance array
+//=================================================================
+#pragma mark - instance array
+
+
++ (instancetype)AvoidCrashArrayWithObjects:(const id  _Nonnull __unsafe_unretained *)objects count:(NSUInteger)cnt {
+    
+    id instance = nil;
+    
+    @try {
+        instance = [self AvoidCrashArrayWithObjects:objects count:cnt];
+    }
+    @catch (NSException *exception) {
+        
+        NSString *defaultToDo = @"AvoidCrash default is to remove nil object and instance a array.";
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+        //以下是对错误数据的处理,把为nil的数据去掉,然后初始化数组
+        NSInteger newObjsIndex = 0;
+        id  _Nonnull __unsafe_unretained newObjects[cnt];
+        
+        for (int i = 0; i < cnt; i++) {
+            if (objects[i] != nil) {
+                newObjects[newObjsIndex] = objects[i];
+                newObjsIndex++;
+            }
+        }
+        instance = [self AvoidCrashArrayWithObjects:newObjects count:newObjsIndex];
+    }
+    @finally {
+        return instance;
+    }
+}
+
+
+
+//=================================================================
+//                     objectAtIndexedSubscript:
+//=================================================================
+#pragma mark - objectAtIndexedSubscript:
+- (id)__NSArrayIAvoidCrashObjectAtIndexedSubscript:(NSUInteger)idx {
+    id object = nil;
+    
+    @try {
+        object = [self __NSArrayIAvoidCrashObjectAtIndexedSubscript:idx];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+
+}
+
+
+//=================================================================
+//                       objectsAtIndexes:
+//=================================================================
+#pragma mark - objectsAtIndexes:
+
+- (NSArray *)avoidCrashObjectsAtIndexes:(NSIndexSet *)indexes {
+    
+    NSArray *returnArray = nil;
+    @try {
+        returnArray = [self avoidCrashObjectsAtIndexes:indexes];
+    } @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+    } @finally {
+        return returnArray;
+    }
+}
+
+
+//=================================================================
+//                         objectAtIndex:
+//=================================================================
+#pragma mark - objectAtIndex:
+
+//__NSArrayI  objectAtIndex:
+- (id)__NSArrayIAvoidCrashObjectAtIndex:(NSUInteger)index {
+    id object = nil;
+    
+    @try {
+        object = [self __NSArrayIAvoidCrashObjectAtIndex:index];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+
+
+//__NSSingleObjectArrayI objectAtIndex:
+- (id)__NSSingleObjectArrayIAvoidCrashObjectAtIndex:(NSUInteger)index {
+    id object = nil;
+    
+    @try {
+        object = [self __NSSingleObjectArrayIAvoidCrashObjectAtIndex:index];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+//__NSArray0 objectAtIndex:
+- (id)__NSArray0AvoidCrashObjectAtIndex:(NSUInteger)index {
+    id object = nil;
+    
+    @try {
+        object = [self __NSArray0AvoidCrashObjectAtIndex:index];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+
+//=================================================================
+//                           getObjects:range:
+//=================================================================
+#pragma mark - getObjects:range:
+
+//NSArray getObjects:range:
+- (void)NSArrayAvoidCrashGetObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range {
+    
+    @try {
+        [self NSArrayAvoidCrashGetObjects:objects range:range];
+    } @catch (NSException *exception) {
+        
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+    } @finally {
+        
+    }
+}
+
+
+//__NSSingleObjectArrayI  getObjects:range:
+- (void)__NSSingleObjectArrayIAvoidCrashGetObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range {
+    
+    @try {
+        [self __NSSingleObjectArrayIAvoidCrashGetObjects:objects range:range];
+    } @catch (NSException *exception) {
+        
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+    } @finally {
+        
+    }
+}
+
+
+//__NSArrayI  getObjects:range:
+- (void)__NSArrayIAvoidCrashGetObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range {
+    
+    @try {
+        [self __NSArrayIAvoidCrashGetObjects:objects range:range];
+    } @catch (NSException *exception) {
+        
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+    } @finally {
+        
+    }
+}
+
+
+
+
+@end

+ 25 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSAttributedString+AvoidCrash.h

@@ -0,0 +1,25 @@
+//
+//  NSAttributedString+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/15.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSAttributedString (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+/**
+ *  Can avoid crash method
+ *
+ *  1.- (instancetype)initWithString:(NSString *)str
+ *  2.- (instancetype)initWithAttributedString:(NSAttributedString *)attrStr
+ *  3.- (instancetype)initWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs
+ *
+ *
+ */

+ 96 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSAttributedString+AvoidCrash.m

@@ -0,0 +1,96 @@
+//
+//  NSAttributedString+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/15.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSAttributedString+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSAttributedString (AvoidCrash)
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        Class NSConcreteAttributedString = NSClassFromString(@"NSConcreteAttributedString");
+        
+        //initWithString:
+        [AvoidCrash exchangeInstanceMethod:NSConcreteAttributedString method1Sel:@selector(initWithString:) method2Sel:@selector(avoidCrashInitWithString:)];
+        
+        //initWithAttributedString
+        [AvoidCrash exchangeInstanceMethod:NSConcreteAttributedString method1Sel:@selector(initWithAttributedString:) method2Sel:@selector(avoidCrashInitWithAttributedString:)];
+        
+        //initWithString:attributes:
+        [AvoidCrash exchangeInstanceMethod:NSConcreteAttributedString method1Sel:@selector(initWithString:attributes:) method2Sel:@selector(avoidCrashInitWithString:attributes:)];
+    });
+
+}
+
+//=================================================================
+//                           initWithString:
+//=================================================================
+#pragma mark - initWithString:
+
+- (instancetype)avoidCrashInitWithString:(NSString *)str {
+    id object = nil;
+    
+    @try {
+        object = [self avoidCrashInitWithString:str];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+
+//=================================================================
+//                          initWithAttributedString
+//=================================================================
+#pragma mark - initWithAttributedString
+
+- (instancetype)avoidCrashInitWithAttributedString:(NSAttributedString *)attrStr {
+    id object = nil;
+    
+    @try {
+        object = [self avoidCrashInitWithAttributedString:attrStr];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+
+//=================================================================
+//                      initWithString:attributes:
+//=================================================================
+#pragma mark - initWithString:attributes:
+
+- (instancetype)avoidCrashInitWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs {
+    id object = nil;
+    
+    @try {
+        object = [self avoidCrashInitWithString:str attributes:attrs];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+@end

+ 24 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSDictionary+AvoidCrash.h

@@ -0,0 +1,24 @@
+//
+//  NSDictionary+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSDictionary (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+
+/**
+ *  Can avoid crash method
+ *
+ *  1. NSDictionary的快速创建方式 NSDictionary *dict = @{@"frameWork" : @"AvoidCrash"}; //这种创建方式其实调用的是2中的方法
+ *  2. +(instancetype)dictionaryWithObjects:(const id  _Nonnull __unsafe_unretained *)objects forKeys:(const id<NSCopying>  _Nonnull __unsafe_unretained *)keys count:(NSUInteger)cnt
+ *
+ */

+ 56 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSDictionary+AvoidCrash.m

@@ -0,0 +1,56 @@
+//
+//  NSDictionary+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSDictionary+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSDictionary (AvoidCrash)
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        [AvoidCrash exchangeClassMethod:self method1Sel:@selector(dictionaryWithObjects:forKeys:count:) method2Sel:@selector(avoidCrashDictionaryWithObjects:forKeys:count:)];
+    });
+}
+
+
++ (instancetype)avoidCrashDictionaryWithObjects:(const id  _Nonnull __unsafe_unretained *)objects forKeys:(const id<NSCopying>  _Nonnull __unsafe_unretained *)keys count:(NSUInteger)cnt {
+    
+    id instance = nil;
+    
+    @try {
+        instance = [self avoidCrashDictionaryWithObjects:objects forKeys:keys count:cnt];
+    }
+    @catch (NSException *exception) {
+        
+        NSString *defaultToDo = @"AvoidCrash default is to remove nil key-values and instance a dictionary.";
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+        //处理错误的数据,然后重新初始化一个字典
+        NSUInteger index = 0;
+        id  _Nonnull __unsafe_unretained newObjects[cnt];
+        id  _Nonnull __unsafe_unretained newkeys[cnt];
+        
+        for (int i = 0; i < cnt; i++) {
+            if (objects[i] && keys[i]) {
+                newObjects[index] = objects[i];
+                newkeys[index] = keys[i];
+                index++;
+            }
+        }
+        instance = [self avoidCrashDictionaryWithObjects:newObjects forKeys:newkeys count:index];
+    }
+    @finally {
+        return instance;
+    }
+}
+
+@end

+ 26 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableArray+AvoidCrash.h

@@ -0,0 +1,26 @@
+//
+//  NSMutableArray+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSMutableArray (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+
+/**
+ *  Can avoid crash method
+ *
+ *  1. - (id)objectAtIndex:(NSUInteger)index
+ *  2. - (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx
+ *  3. - (void)removeObjectAtIndex:(NSUInteger)index
+ *  4. - (void)insertObject:(id)anObject atIndex:(NSUInteger)index
+ *  5. - (void)getObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range
+ */

+ 169 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableArray+AvoidCrash.m

@@ -0,0 +1,169 @@
+//
+//  NSMutableArray+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/21.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSMutableArray+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSMutableArray (AvoidCrash)
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        Class arrayMClass = NSClassFromString(@"__NSArrayM");
+        
+        
+        //objectAtIndex:
+        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(objectAtIndex:) method2Sel:@selector(avoidCrashObjectAtIndex:)];
+        
+        //objectAtIndexedSubscript
+        if (AvoidCrashIsiOS(11.0)) {
+            [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(objectAtIndexedSubscript:) method2Sel:@selector(avoidCrashObjectAtIndexedSubscript:)];
+        }
+        
+        
+        //setObject:atIndexedSubscript:
+        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(setObject:atIndexedSubscript:) method2Sel:@selector(avoidCrashSetObject:atIndexedSubscript:)];
+        
+        
+        //removeObjectAtIndex:
+        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(removeObjectAtIndex:) method2Sel:@selector(avoidCrashRemoveObjectAtIndex:)];
+        
+        //insertObject:atIndex:
+        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(insertObject:atIndex:) method2Sel:@selector(avoidCrashInsertObject:atIndex:)];
+        
+        //getObjects:range:
+        [AvoidCrash exchangeInstanceMethod:arrayMClass method1Sel:@selector(getObjects:range:) method2Sel:@selector(avoidCrashGetObjects:range:)];
+    });
+    
+    
+    
+}
+
+
+//=================================================================
+//                    array set object at index
+//=================================================================
+#pragma mark - get object from array
+
+
+- (void)avoidCrashSetObject:(id)obj atIndexedSubscript:(NSUInteger)idx {
+    
+    @try {
+        [self avoidCrashSetObject:obj atIndexedSubscript:idx];
+    }
+    @catch (NSException *exception) {
+        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
+    }
+    @finally {
+        
+    }
+}
+
+
+//=================================================================
+//                    removeObjectAtIndex:
+//=================================================================
+#pragma mark - removeObjectAtIndex:
+
+- (void)avoidCrashRemoveObjectAtIndex:(NSUInteger)index {
+    @try {
+        [self avoidCrashRemoveObjectAtIndex:index];
+    }
+    @catch (NSException *exception) {
+        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
+    }
+    @finally {
+        
+    }
+}
+
+
+//=================================================================
+//                    insertObject:atIndex:
+//=================================================================
+#pragma mark - set方法
+- (void)avoidCrashInsertObject:(id)anObject atIndex:(NSUInteger)index {
+    @try {
+        [self avoidCrashInsertObject:anObject atIndex:index];
+    }
+    @catch (NSException *exception) {
+        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
+    }
+    @finally {
+        
+    }
+}
+
+
+//=================================================================
+//                           objectAtIndex:
+//=================================================================
+#pragma mark - objectAtIndex:
+
+- (id)avoidCrashObjectAtIndex:(NSUInteger)index {
+    id object = nil;
+    
+    @try {
+        object = [self avoidCrashObjectAtIndex:index];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+//=================================================================
+//                     objectAtIndexedSubscript:
+//=================================================================
+#pragma mark - objectAtIndexedSubscript:
+- (id)avoidCrashObjectAtIndexedSubscript:(NSUInteger)idx {
+    id object = nil;
+    
+    @try {
+        object = [self avoidCrashObjectAtIndexedSubscript:idx];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+    
+}
+
+
+//=================================================================
+//                         getObjects:range:
+//=================================================================
+#pragma mark - getObjects:range:
+
+- (void)avoidCrashGetObjects:(__unsafe_unretained id  _Nonnull *)objects range:(NSRange)range {
+    
+    @try {
+        [self avoidCrashGetObjects:objects range:range];
+    } @catch (NSException *exception) {
+        
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+    } @finally {
+        
+    }
+}
+
+
+
+
+@end

+ 23 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableAttributedString+AvoidCrash.h

@@ -0,0 +1,23 @@
+//
+//  NSMutableAttributedString+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/15.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSMutableAttributedString (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+
+/**
+ *  Can avoid crash method
+ *
+ *  1.- (instancetype)initWithString:(NSString *)str
+ *  2.- (instancetype)initWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs
+ */

+ 74 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableAttributedString+AvoidCrash.m

@@ -0,0 +1,74 @@
+//
+//  NSMutableAttributedString+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/15.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSMutableAttributedString+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSMutableAttributedString (AvoidCrash)
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        Class NSConcreteMutableAttributedString = NSClassFromString(@"NSConcreteMutableAttributedString");
+        
+        //initWithString:
+        [AvoidCrash exchangeInstanceMethod:NSConcreteMutableAttributedString method1Sel:@selector(initWithString:) method2Sel:@selector(avoidCrashInitWithString:)];
+        
+        //initWithString:attributes:
+        [AvoidCrash exchangeInstanceMethod:NSConcreteMutableAttributedString method1Sel:@selector(initWithString:attributes:) method2Sel:@selector(avoidCrashInitWithString:attributes:)];
+    });
+}
+
+//=================================================================
+//                          initWithString:
+//=================================================================
+#pragma mark - initWithString:
+
+
+- (instancetype)avoidCrashInitWithString:(NSString *)str {
+    id object = nil;
+    
+    @try {
+        object = [self avoidCrashInitWithString:str];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+
+//=================================================================
+//                     initWithString:attributes:
+//=================================================================
+#pragma mark - initWithString:attributes:
+
+
+- (instancetype)avoidCrashInitWithString:(NSString *)str attributes:(NSDictionary<NSString *,id> *)attrs {
+    id object = nil;
+    
+    @try {
+        object = [self avoidCrashInitWithString:str attributes:attrs];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return object;
+    }
+}
+
+
+@end

+ 24 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableDictionary+AvoidCrash.h

@@ -0,0 +1,24 @@
+//
+//  NSMutableDictionary+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/22.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSMutableDictionary (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+
+/**
+ *  Can avoid crash method
+ *
+ *  1. - (void)setObject:(id)anObject forKey:(id<NSCopying>)aKey
+ *  2. - (void)removeObjectForKey:(id)aKey
+ *
+ */

+ 95 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableDictionary+AvoidCrash.m

@@ -0,0 +1,95 @@
+//
+//  NSMutableDictionary+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/9/22.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSMutableDictionary+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSMutableDictionary (AvoidCrash)
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        Class dictionaryM = NSClassFromString(@"__NSDictionaryM");
+        
+        //setObject:forKey:
+        [AvoidCrash exchangeInstanceMethod:dictionaryM method1Sel:@selector(setObject:forKey:) method2Sel:@selector(avoidCrashSetObject:forKey:)];
+        
+        //setObject:forKeyedSubscript:
+        if (AvoidCrashIsiOS(11.0)) {
+            [AvoidCrash exchangeInstanceMethod:dictionaryM method1Sel:@selector(setObject:forKeyedSubscript:) method2Sel:@selector(avoidCrashSetObject:forKeyedSubscript:)];
+        }
+        
+        
+        
+        //removeObjectForKey:
+        Method removeObjectForKey = class_getInstanceMethod(dictionaryM, @selector(removeObjectForKey:));
+        Method avoidCrashRemoveObjectForKey = class_getInstanceMethod(dictionaryM, @selector(avoidCrashRemoveObjectForKey:));
+        method_exchangeImplementations(removeObjectForKey, avoidCrashRemoveObjectForKey);
+    });
+}
+
+
+//=================================================================
+//                       setObject:forKey:
+//=================================================================
+#pragma mark - setObject:forKey:
+
+- (void)avoidCrashSetObject:(id)anObject forKey:(id<NSCopying>)aKey {
+    
+    @try {
+        [self avoidCrashSetObject:anObject forKey:aKey];
+    }
+    @catch (NSException *exception) {
+        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
+    }
+    @finally {
+        
+    }
+}
+
+//=================================================================
+//                  setObject:forKeyedSubscript:
+//=================================================================
+#pragma mark - setObject:forKeyedSubscript:
+- (void)avoidCrashSetObject:(id)obj forKeyedSubscript:(id<NSCopying>)key {
+    @try {
+        [self avoidCrashSetObject:obj forKeyedSubscript:key];
+    }
+    @catch (NSException *exception) {
+        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
+    }
+    @finally {
+        
+    }
+}
+
+
+//=================================================================
+//                       removeObjectForKey:
+//=================================================================
+#pragma mark - removeObjectForKey:
+
+- (void)avoidCrashRemoveObjectForKey:(id)aKey {
+    
+    @try {
+        [self avoidCrashRemoveObjectForKey:aKey];
+    }
+    @catch (NSException *exception) {
+        [AvoidCrash noteErrorWithException:exception defaultToDo:AvoidCrashDefaultIgnore];
+    }
+    @finally {
+        
+    }
+}
+
+
+
+
+@end

+ 29 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableString+AvoidCrash.h

@@ -0,0 +1,29 @@
+//
+//  NSMutableString+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/6.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSMutableString (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+
+/**
+ *  Can avoid crash method
+ *
+ *  1. 由于NSMutableString是继承于NSString,所以这里和NSString有些同样的方法就不重复写了
+ *  2. - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)aString
+ *  3. - (void)insertString:(NSString *)aString atIndex:(NSUInteger)loc
+ *  4. - (void)deleteCharactersInRange:(NSRange)range
+ *
+ */
+
+
+

+ 97 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSMutableString+AvoidCrash.m

@@ -0,0 +1,97 @@
+//
+//  NSMutableString+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/6.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSMutableString+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSMutableString (AvoidCrash)
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        Class stringClass = NSClassFromString(@"__NSCFString");
+        
+        //replaceCharactersInRange
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(replaceCharactersInRange:withString:) method2Sel:@selector(avoidCrashReplaceCharactersInRange:withString:)];
+        
+        //insertString:atIndex:
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(insertString:atIndex:) method2Sel:@selector(avoidCrashInsertString:atIndex:)];
+        
+        //deleteCharactersInRange
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(deleteCharactersInRange:) method2Sel:@selector(avoidCrashDeleteCharactersInRange:)];
+    });
+}
+
+//=================================================================
+//                     replaceCharactersInRange
+//=================================================================
+#pragma mark - replaceCharactersInRange
+
+- (void)avoidCrashReplaceCharactersInRange:(NSRange)range withString:(NSString *)aString {
+    
+    @try {
+        [self avoidCrashReplaceCharactersInRange:range withString:aString];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        
+    }
+}
+
+//=================================================================
+//                     insertString:atIndex:
+//=================================================================
+#pragma mark - insertString:atIndex:
+
+- (void)avoidCrashInsertString:(NSString *)aString atIndex:(NSUInteger)loc {
+    
+    @try {
+        [self avoidCrashInsertString:aString atIndex:loc];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        
+    }
+}
+
+//=================================================================
+//                   deleteCharactersInRange
+//=================================================================
+#pragma mark - deleteCharactersInRange
+
+- (void)avoidCrashDeleteCharactersInRange:(NSRange)range {
+    
+    @try {
+        [self avoidCrashDeleteCharactersInRange:range];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        
+    }
+}
+
+
+
+
+
+
+
+
+@end

+ 34 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSObject+AvoidCrash.h

@@ -0,0 +1,34 @@
+//
+//  NSObject+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/11.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface NSObject (AvoidCrash)
+
+/** 
+ *  ifDealWithNoneSel : 是否开启"unrecognized selector sent to instance"异常的捕获
+ */
++ (void)avoidCrashExchangeMethodIfDealWithNoneSel:(BOOL)ifDealWithNoneSel;
+
+
++ (void)setupNoneSelClassStringsArr:(NSArray<NSString *> *)classStrings;
+
++ (void)setupNoneSelClassStringPrefixsArr:(NSArray<NSString *> *)classStringPrefixs;
+
+@end
+
+/**
+ *  Can avoid crash method
+ *
+ *  1.- (void)setValue:(id)value forKey:(NSString *)key
+ *  2.- (void)setValue:(id)value forKeyPath:(NSString *)keyPath
+ *  3.- (void)setValue:(id)value forUndefinedKey:(NSString *)key //这个方法一般用来重写,不会主动调用
+ *  4.- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues
+ *  5. unrecognized selector sent to instance
+ */

+ 221 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSObject+AvoidCrash.m

@@ -0,0 +1,221 @@
+//
+//  NSObject+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/11.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSObject+AvoidCrash.h"
+#import "AvoidCrash.h"
+#import "AvoidCrashStubProxy.h"
+
+@implementation NSObject (AvoidCrash)
+
+
++ (void)avoidCrashExchangeMethodIfDealWithNoneSel:(BOOL)ifDealWithNoneSel {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        //setValue:forKey:
+        [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValue:forKey:) method2Sel:@selector(avoidCrashSetValue:forKey:)];
+        
+        //setValue:forKeyPath:
+        [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValue:forKeyPath:) method2Sel:@selector(avoidCrashSetValue:forKeyPath:)];
+        
+        //setValue:forUndefinedKey:
+        [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValue:forUndefinedKey:) method2Sel:@selector(avoidCrashSetValue:forUndefinedKey:)];
+        
+        //setValuesForKeysWithDictionary:
+        [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(setValuesForKeysWithDictionary:) method2Sel:@selector(avoidCrashSetValuesForKeysWithDictionary:)];
+        
+        
+        //unrecognized selector sent to instance
+        if (ifDealWithNoneSel) {
+            [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(methodSignatureForSelector:) method2Sel:@selector(avoidCrashMethodSignatureForSelector:)];
+            [AvoidCrash exchangeInstanceMethod:[self class] method1Sel:@selector(forwardInvocation:) method2Sel:@selector(avoidCrashForwardInvocation:)];
+        }
+    });
+}
+
+
+//=================================================================
+//              unrecognized selector sent to instance
+//=================================================================
+#pragma mark - unrecognized selector sent to instance
+
+
+static NSMutableArray *noneSelClassStrings;
+static NSMutableArray *noneSelClassStringPrefixs;
+
++ (void)setupNoneSelClassStringsArr:(NSArray<NSString *> *)classStrings {
+    
+    if (noneSelClassStrings) {
+        
+        NSString *warningMsg = [NSString stringWithFormat:@"\n\n%@\n\n[AvoidCrash setupNoneSelClassStringsArr:];\n调用一此即可,多次调用会自动忽略后面的调用\n\n%@\n\n",AvoidCrashSeparatorWithFlag,AvoidCrashSeparator];
+        AvoidCrashLog(@"%@",warningMsg);
+    }
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        noneSelClassStrings = [NSMutableArray array];
+        for (NSString *className in classStrings) {
+            if ([className hasPrefix:@"UI"] == NO &&
+                [className isEqualToString:NSStringFromClass([NSObject class])] == NO) {
+                [noneSelClassStrings addObject:className];
+                
+            } else {
+                NSString *warningMsg = [NSString stringWithFormat:@"\n\n%@\n\n[AvoidCrash setupNoneSelClassStringsArr:];\n会忽略UI开头的类和NSObject类(请使用NSObject的子类)\n\n%@\n\n",AvoidCrashSeparatorWithFlag,AvoidCrashSeparator];
+                AvoidCrashLog(@"%@",warningMsg);
+            }
+        }
+    });
+}
+
+/**
+ *  初始化一个需要防止”unrecognized selector sent to instance”的崩溃的类名前缀的数组
+ */
++ (void)setupNoneSelClassStringPrefixsArr:(NSArray<NSString *> *)classStringPrefixs {
+    if (noneSelClassStringPrefixs) {
+        
+        NSString *warningMsg = [NSString stringWithFormat:@"\n\n%@\n\n[AvoidCrash setupNoneSelClassStringPrefixsArr:];\n调用一此即可,多次调用会自动忽略后面的调用\n\n%@\n\n",AvoidCrashSeparatorWithFlag,AvoidCrashSeparator];
+        AvoidCrashLog(@"%@",warningMsg);
+    }
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        
+        noneSelClassStringPrefixs = [NSMutableArray array];
+        for (NSString *classNamePrefix in classStringPrefixs) {
+            if ([classNamePrefix hasPrefix:@"UI"] == NO &&
+                [classNamePrefix hasPrefix:@"NS"] == NO) {
+                [noneSelClassStringPrefixs addObject:classNamePrefix];
+                
+            } else {
+                NSString *warningMsg = [NSString stringWithFormat:@"\n\n%@\n\n[AvoidCrash setupNoneSelClassStringsArr:];\n会忽略UI开头的类和NS开头的类\n若需要对NS开头的类防止”unrecognized selector sent to instance”(比如NSArray),请使用setupNoneSelClassStringsArr:\n\n%@\n\n",AvoidCrashSeparatorWithFlag,AvoidCrashSeparator];
+                AvoidCrashLog(@"%@",warningMsg);
+            }
+        }
+    });
+}
+
+- (NSMethodSignature *)avoidCrashMethodSignatureForSelector:(SEL)aSelector {
+    
+    NSMethodSignature *ms = [self avoidCrashMethodSignatureForSelector:aSelector];
+    
+    BOOL flag = NO;
+    if (ms == nil) {
+        for (NSString *classStr in noneSelClassStrings) {
+            if ([self isKindOfClass:NSClassFromString(classStr)]) {
+                ms = [AvoidCrashStubProxy instanceMethodSignatureForSelector:@selector(proxyMethod)];
+                flag = YES;
+                break;
+            }
+        }
+    }
+    if (flag == NO) {
+        NSString *selfClass = NSStringFromClass([self class]);
+        for (NSString *classStrPrefix in noneSelClassStringPrefixs) {
+            if ([selfClass hasPrefix:classStrPrefix]) {
+                ms = [AvoidCrashStubProxy instanceMethodSignatureForSelector:@selector(proxyMethod)];
+            }
+        }
+    }
+    return ms;
+}
+
+- (void)avoidCrashForwardInvocation:(NSInvocation *)anInvocation {
+    
+    @try {
+        [self avoidCrashForwardInvocation:anInvocation];
+        
+    } @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        
+    } @finally {
+        
+    }
+    
+}
+
+
+//=================================================================
+//                         setValue:forKey:
+//=================================================================
+#pragma mark - setValue:forKey:
+
+- (void)avoidCrashSetValue:(id)value forKey:(NSString *)key {
+    @try {
+        [self avoidCrashSetValue:value forKey:key];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        
+    }
+}
+
+
+//=================================================================
+//                     setValue:forKeyPath:
+//=================================================================
+#pragma mark - setValue:forKeyPath:
+
+- (void)avoidCrashSetValue:(id)value forKeyPath:(NSString *)keyPath {
+    @try {
+        [self avoidCrashSetValue:value forKeyPath:keyPath];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        
+    }
+}
+
+
+
+//=================================================================
+//                     setValue:forUndefinedKey:
+//=================================================================
+#pragma mark - setValue:forUndefinedKey:
+
+- (void)avoidCrashSetValue:(id)value forUndefinedKey:(NSString *)key {
+    @try {
+        [self avoidCrashSetValue:value forUndefinedKey:key];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        
+    }
+}
+
+
+//=================================================================
+//                  setValuesForKeysWithDictionary:
+//=================================================================
+#pragma mark - setValuesForKeysWithDictionary:
+
+- (void)avoidCrashSetValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues {
+    @try {
+        [self avoidCrashSetValuesForKeysWithDictionary:keyedValues];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultIgnore;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        
+    }
+}
+
+
+
+@end

+ 29 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSString+AvoidCrash.h

@@ -0,0 +1,29 @@
+//
+//  NSString+AvoidCrash.h
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/5.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "AvoidCrashProtocol.h"
+
+@interface NSString (AvoidCrash)<AvoidCrashProtocol>
+
+
+@end
+
+
+/**
+ *  Can avoid crash method
+ *
+ *  1. - (unichar)characterAtIndex:(NSUInteger)index
+ *  2. - (NSString *)substringFromIndex:(NSUInteger)from
+ *  3. - (NSString *)substringToIndex:(NSUInteger)to {
+ *  4. - (NSString *)substringWithRange:(NSRange)range {
+ *  5. - (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement
+ *  6. - (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement options:(NSStringCompareOptions)options range:(NSRange)searchRange
+ *  7. - (NSString *)stringByReplacingCharactersInRange:(NSRange)range withString:(NSString *)replacement
+ *
+ */

+ 204 - 0
RunGame/SDK/ThirdClass/AvoidCrash/NSString+AvoidCrash.m

@@ -0,0 +1,204 @@
+//
+//  NSString+AvoidCrash.m
+//  https://github.com/chenfanfang/AvoidCrash
+//
+//  Created by mac on 16/10/5.
+//  Copyright © 2016年 chenfanfang. All rights reserved.
+//
+
+#import "NSString+AvoidCrash.h"
+
+#import "AvoidCrash.h"
+
+@implementation NSString (AvoidCrash)
+
++ (void)avoidCrashExchangeMethod {
+    
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        Class stringClass = NSClassFromString(@"__NSCFConstantString");
+        
+        //characterAtIndex
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(characterAtIndex:) method2Sel:@selector(avoidCrashCharacterAtIndex:)];
+        
+        //substringFromIndex
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(substringFromIndex:) method2Sel:@selector(avoidCrashSubstringFromIndex:)];
+        
+        //substringToIndex
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(substringToIndex:) method2Sel:@selector(avoidCrashSubstringToIndex:)];
+        
+        //substringWithRange:
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(substringWithRange:) method2Sel:@selector(avoidCrashSubstringWithRange:)];
+        
+        //stringByReplacingOccurrencesOfString:
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(stringByReplacingOccurrencesOfString:withString:) method2Sel:@selector(avoidCrashStringByReplacingOccurrencesOfString:withString:)];
+        
+        //stringByReplacingOccurrencesOfString:withString:options:range:
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(stringByReplacingOccurrencesOfString:withString:options:range:) method2Sel:@selector(avoidCrashStringByReplacingOccurrencesOfString:withString:options:range:)];
+        
+        //stringByReplacingCharactersInRange:withString:
+        [AvoidCrash exchangeInstanceMethod:stringClass method1Sel:@selector(stringByReplacingCharactersInRange:withString:) method2Sel:@selector(avoidCrashStringByReplacingCharactersInRange:withString:)];
+    });
+    
+}
+
+
+//=================================================================
+//                           characterAtIndex:
+//=================================================================
+#pragma mark - characterAtIndex:
+
+- (unichar)avoidCrashCharacterAtIndex:(NSUInteger)index {
+    
+    unichar characteristic;
+    @try {
+        characteristic = [self avoidCrashCharacterAtIndex:index];
+    }
+    @catch (NSException *exception) {
+        
+        NSString *defaultToDo = @"AvoidCrash default is to return a without assign unichar.";
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+    }
+    @finally {
+        return characteristic;
+    }
+}
+
+//=================================================================
+//                           substringFromIndex:
+//=================================================================
+#pragma mark - substringFromIndex:
+
+- (NSString *)avoidCrashSubstringFromIndex:(NSUInteger)from {
+    
+    NSString *subString = nil;
+    
+    @try {
+        subString = [self avoidCrashSubstringFromIndex:from];
+    }
+    @catch (NSException *exception) {
+        
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        subString = nil;
+    }
+    @finally {
+        return subString;
+    }
+}
+
+//=================================================================
+//                           substringToIndex
+//=================================================================
+#pragma mark - substringToIndex
+
+- (NSString *)avoidCrashSubstringToIndex:(NSUInteger)to {
+    
+    NSString *subString = nil;
+    
+    @try {
+        subString = [self avoidCrashSubstringToIndex:to];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        subString = nil;
+    }
+    @finally {
+        return subString;
+    }
+}
+
+
+//=================================================================
+//                           substringWithRange:
+//=================================================================
+#pragma mark - substringWithRange:
+
+- (NSString *)avoidCrashSubstringWithRange:(NSRange)range {
+    
+    NSString *subString = nil;
+    
+    @try {
+        subString = [self avoidCrashSubstringWithRange:range];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        subString = nil;
+    }
+    @finally {
+        return subString;
+    }
+}
+
+//=================================================================
+//                stringByReplacingOccurrencesOfString:
+//=================================================================
+#pragma mark - stringByReplacingOccurrencesOfString:
+
+- (NSString *)avoidCrashStringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement {
+    
+    NSString *newStr = nil;
+    
+    @try {
+        newStr = [self avoidCrashStringByReplacingOccurrencesOfString:target withString:replacement];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        newStr = nil;
+    }
+    @finally {
+        return newStr;
+    }
+}
+
+//=================================================================
+//  stringByReplacingOccurrencesOfString:withString:options:range:
+//=================================================================
+#pragma mark - stringByReplacingOccurrencesOfString:withString:options:range:
+
+- (NSString *)avoidCrashStringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement options:(NSStringCompareOptions)options range:(NSRange)searchRange {
+    
+    NSString *newStr = nil;
+    
+    @try {
+        newStr = [self avoidCrashStringByReplacingOccurrencesOfString:target withString:replacement options:options range:searchRange];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        newStr = nil;
+    }
+    @finally {
+        return newStr;
+    }
+}
+
+
+//=================================================================
+//       stringByReplacingCharactersInRange:withString:
+//=================================================================
+#pragma mark - stringByReplacingCharactersInRange:withString:
+
+- (NSString *)avoidCrashStringByReplacingCharactersInRange:(NSRange)range withString:(NSString *)replacement {
+
+    
+    NSString *newStr = nil;
+    
+    @try {
+        newStr = [self avoidCrashStringByReplacingCharactersInRange:range withString:replacement];
+    }
+    @catch (NSException *exception) {
+        NSString *defaultToDo = AvoidCrashDefaultReturnNil;
+        [AvoidCrash noteErrorWithException:exception defaultToDo:defaultToDo];
+        newStr = nil;
+    }
+    @finally {
+        return newStr;
+    }
+}
+
+
+@end

+ 16 - 0
RunGame/SDK/ThirdClass/BuglyManager.h

@@ -0,0 +1,16 @@
+////
+////  BuglyManager.h
+////  Unity-iPhone
+////
+////  Created by duowan123 on 2022/1/13.
+////
+//
+//#import <UnityFramework/UnityFramework.h>
+//
+//NS_ASSUME_NONNULL_BEGIN
+//
+//@interface BuglyManager : UnityAppController
+//- (void)startBuglyManager;
+//@end
+//
+//NS_ASSUME_NONNULL_END

+ 40 - 0
RunGame/SDK/ThirdClass/BuglyManager.m

@@ -0,0 +1,40 @@
+////
+////  BuglyManager.m
+////  Unity-iPhone
+////
+////  Created by duowan123 on 2022/1/13.
+////
+//
+//#import "BuglyManager.h"
+//#import "AvoidCrash.h"
+//#import "AvoidCrashStubProxy.h"
+////#import <Bugly/Bugly.h>
+//
+//@implementation BuglyManager
+//
+//- (void)startBuglyManager{
+//
+////        [Bugly startWithAppId:@"36a0c05291"];
+//        //防奔溃
+//        [AvoidCrash makeAllEffective];
+//    
+//        //监听通知:AvoidCrashNotification, 获取AvoidCrash捕获的崩溃日志的详细信息
+//        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dealwithCrashMessage:) name:AvoidCrashNotification object:nil];
+//}
+//
+//- (void)dealwithCrashMessage:(NSNotification *)note{
+//
+//     NSDictionary *info = note.userInfo;
+//      NSString *errorReason = [NSString stringWithFormat:@"【ErrorReason】%@========【ErrorPlace】%@========【DefaultToDo】%@========【ErrorName】%@", info[@"errorReason"], info[@"errorPlace"], info[@"defaultToDo"], info[@"errorName"]];
+//      NSArray *callStack = info[@"callStackSymbols"];
+//      [self reportErrorName:@"Bugly_ErrorName_AvoidCrash" errorReason:errorReason callStack:callStack extraInfo:nil];
+//
+//}
+//
+///** 上报错误信息 */
+//- (void)reportErrorName:(NSString *)errorName errorReason:(NSString *)errorReason callStack:(NSArray *)aStackArray extraInfo:(NSDictionary *)info{
+////    [Bugly reportExceptionWithCategory:3 name:errorName reason:errorReason callStack:aStackArray extraInfo:info terminateApp:NO];
+//
+//}
+//
+//@end

+ 1 - 0
RunGame/SDK/Tool/MYFactoryManager.h

@@ -35,6 +35,7 @@
 //第三方
 #import "AFNetworking.h"
 #import "MBProgressHUD.h"
+
 //UI
 #import "SearchDeviceViewController.h"
 #import "AnimationView.h"

+ 3 - 5
RunGame/SDK/Tool/MYFactoryManager.m

@@ -74,9 +74,7 @@ static MYFactoryManager * instance;
         return rect.size.width;
 
     }else{
-        
         return 50;
-        
     }
 }
 
@@ -197,7 +195,7 @@ static MYFactoryManager * instance;
     NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
     NSString * mac =  [urlDict objectForKey:@"mac"];
     if ([mac isKindOfClass:[NSNull class]] || mac == nil || [mac isEqual:[NSNull null]]){
-         [PopupView showCusHUDA:@"获取mac失败,请从趣动启动"];
+//         [PopupView showCusHUDA:@"获取mac失败,请从趣动启动"];
         return @"";
     }else{
         return mac;
@@ -209,7 +207,7 @@ static MYFactoryManager * instance;
     NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
     NSDictionary * invite = urlDict[@"invite"];
     if ([invite isKindOfClass:[NSNull class]] || invite == nil || [invite isEqual:[NSNull null]]){
-         [PopupView showCusHUDA:@"获取user失败,请从趣动启动"];
+//         [PopupView showCusHUDA:@"获取getInviteUser失败,请从趣动启动"];
         return @"";
     }else{
         //user字典 -> 字符串 -> Char
@@ -226,7 +224,7 @@ static MYFactoryManager * instance;
     NSDictionary * urlDict = [IOS_NSUSERDEFAULT objectForKey:IOSSDK_USERINFO];
     NSDictionary * invite = urlDict[@"invite"];
     if ([invite isKindOfClass:[NSNull class]] || invite == nil || [invite isEqual:[NSNull null]]){
-         [PopupView showCusHUDA:@"获取mac失败,请从趣动启动"];
+//         [PopupView showCusHUDA:@"获取邀请信息失败,请从趣动启动"];
         return @"";
     }else{
         NSString * info = [invite objectForKey:@"info"];

BIN
RunGame/SDK/shoes_sdk/.DS_Store


+ 1 - 2
RunGame/SDK/shoes_sdk/BigFoot.cpp

@@ -30,7 +30,6 @@ int BigFoot::station_acc(int* max_acc, int* min_acc)
 		}
 	}
 
-
 	return 1;
 }
 
@@ -120,4 +119,4 @@ void BigFoot::Process(int* right_pos, int* right_att, int* right_acc, int right_
 	}
 
 
-}
+}

+ 3 - 8
RunGame/SDK/shoes_sdk/Game.cpp

@@ -404,7 +404,6 @@ string Game::getGameDataStr()
 
 }
 
-
 void Game::setGameDataStr()
 {
 	if (data_str.size() != 0)
@@ -423,9 +422,9 @@ void Game::setGameDataStr()
 
 	data_str += (to_string(left_front_mag) + "," + to_string(left_back_mag) + "," + to_string(h_zupt) + ",");
 
-	data_str += (to_string(down) + "," + to_string(jump) + "," + to_string(rssi) + "," + to_string(posTimeStamp) + ",");
+	data_str += (to_string(shoes_down) + "," + to_string(jump) + "," + to_string(rssi) + "," + to_string(posTimeStamp) + ",");
 
-	data_str += (to_string(right_step) + "," + to_string(left_step) + "," + to_string(shoes_down) );
+	data_str += (to_string(right_step) + "," + to_string(left_step) + "," + to_string(down));
 
 }
 
@@ -438,7 +437,7 @@ void Game::getFootAtt(int* left_att, int* right_att)
 
 
 //½âÎöЬ×ÓµÄÊý¾Ý
-void Game::GameProcessBuf(uint8_t* buf, int len) {
+void Game::GameProcessBuf(uint8_t* buf, int len){
 
 	static int last_game_time;
 
@@ -488,13 +487,10 @@ void Game::GameProcessBuf(uint8_t* buf, int len) {
 
 	}
 
-
 	if (posTimeStamp - lastTimeStamp > - 100 && posTimeStamp - lastTimeStamp <=0)
 	{
 		std::cout << "receive old shoes package ( lastTimeStamp : " << lastTimeStamp << " posTimeStamp : " << posTimeStamp << " )" <<endl;
-
 		lastTimeStamp = posTimeStamp;
-
 		return;
 	}
 
@@ -503,7 +499,6 @@ void Game::GameProcessBuf(uint8_t* buf, int len) {
 
 	lastTimeStamp = posTimeStamp;
 
-
 	right_front_mag = uint16_t(buf[51] << 8 | buf[52] << 0);
 	right_back_mag = uint16_t(buf[53] << 8 | buf[54] << 0);
 

+ 3 - 1
RunGame/SDK/shoes_sdk/RuinsExplore.cpp

@@ -24,10 +24,12 @@ void RuinsExplore::Process(int* right_pos, int* right_att, int* right_acc, int r
 		暂时在同一个函数里分开处理左右脚的数据,往后再优化
 	*/
 
+
 	int left_pos_tmp[3];
 	int right_pos_tmp[3];
 
 
+
 	left_acc_status = getAccStatus(left_zupt, left_acc, left_acc_max, left_acc_min);
 
 	right_acc_status = getAccStatus(right_zupt, right_acc, right_acc_max, right_acc_min);
@@ -106,4 +108,4 @@ int RuinsExplore::getAccStatus(int zupt, int* acc, int* max_acc, int* min_acc)
 	}
 
 	return 0;
-}
+}

+ 4 - 3
RunGame/SDK/shoes_sdk/RunGame.cpp

@@ -147,7 +147,8 @@ int calResult_LEFT(vector<POS_X_CELL>& data_vector)
 		}
 	}
 	//ÔÙ×öÅжÏ
-	if (max_val - pos_x_vector[pos_x_vector.size() - 1] > 15 && data_vector[pos_x_vector.size() - 1].pitch * 0.0001f < 0.3f)
+	//if (max_val - pos_x_vector[pos_x_vector.size() - 1] > 15 && data_vector[pos_x_vector.size() - 1].pitch * 0.0001f < 0.3f)
+	if (max_val - pos_x_vector[pos_x_vector.size() - 1] > 23 && (data_vector[pos_x_vector.size() - 1].pitch * 0.0001f < 0.3f || data_vector[pos_x_vector.size() - 1].zupt))
 	{
 		for (int i = 0; i < pos_x_vector.size(); i++)
 		{
@@ -229,7 +230,8 @@ int calResult_RIGHT(vector<POS_X_CELL>& data_vector)
 		}
 	}
 	//ÔÙ×öÅжÏ
-	if (pos_x_vector[pos_x_vector.size() - 1] - min_val > 15 && data_vector[pos_x_vector.size() - 1].pitch * 0.0001f < 0.3f)
+	//if (pos_x_vector[pos_x_vector.size() - 1] - min_val > 15 && data_vector[pos_x_vector.size() - 1].pitch * 0.0001f < 0.3f)
+	if (pos_x_vector[pos_x_vector.size() - 1] - min_val > 23 && (data_vector[pos_x_vector.size() - 1].pitch * 0.0001f < 0.3f || data_vector[pos_x_vector.size() - 1].zupt))
 	{
 		std::cout << "right_foot pos_offset : ";
 
@@ -283,7 +285,6 @@ void RunGame::Process(int* right_pos, int* right_att, int* right_acc, int right_
 	int jump, int down, int rssi)
 {
 
-
 	POS_X_CELL left_pos_x_cell = { left_pos[0], left_pos[1], left_pos[2], left_att[0], left_att[1], left_zupt };
 
 	POS_X_CELL right_pos_x_cell = { right_pos[0], right_pos[1], right_pos[2], right_att[0], right_att[1],right_zupt };

+ 1 - 1
RunGame/SDK/shoes_sdk/pub.h

@@ -36,7 +36,7 @@ using namespace std;
 
 #define PRESS_MIN 41000
 
-#define GAME_VERSION "0.3.52"
+#define GAME_VERSION "0.3.53"
 
 enum CMD_MOTION
 {

+ 152 - 20
RunGame/Unity-iPhone.xcodeproj/project.pbxproj

@@ -130,6 +130,43 @@
 		917C4C54AB71F090E6A5CEA8 /* Generics17.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B6C439C9D0853090FCADEB0 /* Generics17.cpp */; };
 		91984D84B3FE92002A071435 /* UnityEngine.SharedInternalsModule_CodeGen.c in Sources */ = {isa = PBXBuildFile; fileRef = 405E41C3995D0BF5696952C7 /* UnityEngine.SharedInternalsModule_CodeGen.c */; };
 		92C044C895A2F97CE833ACC2 /* QFramework.ResKit3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 508F4A078251FE52B15E1A30 /* QFramework.ResKit3.cpp */; };
+		93AFCDF4278FBAB700BF6965 /* NSArray+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDDD278FBAB600BF6965 /* NSArray+AvoidCrash.m */; };
+		93AFCDF5278FBAB700BF6965 /* NSArray+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDDD278FBAB600BF6965 /* NSArray+AvoidCrash.m */; };
+		93AFCDF6278FBAB700BF6965 /* AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AFCDDE278FBAB600BF6965 /* AvoidCrash.h */; };
+		93AFCDF7278FBAB700BF6965 /* NSString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDDF278FBAB600BF6965 /* NSString+AvoidCrash.m */; };
+		93AFCDF8278FBAB700BF6965 /* NSString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDDF278FBAB600BF6965 /* NSString+AvoidCrash.m */; };
+		93AFCDF9278FBAB700BF6965 /* NSDictionary+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDE0278FBAB600BF6965 /* NSDictionary+AvoidCrash.m */; };
+		93AFCDFA278FBAB700BF6965 /* NSDictionary+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDE0278FBAB600BF6965 /* NSDictionary+AvoidCrash.m */; };
+		93AFCDFB278FBAB700BF6965 /* NSAttributedString+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AFCDE1278FBAB700BF6965 /* NSAttributedString+AvoidCrash.h */; };
+		93AFCDFC278FBAB700BF6965 /* AvoidCrashStubProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AFCDE2278FBAB700BF6965 /* AvoidCrashStubProxy.h */; };
+		93AFCDFD278FBAB700BF6965 /* NSMutableDictionary+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDE3278FBAB700BF6965 /* NSMutableDictionary+AvoidCrash.m */; };
+		93AFCDFE278FBAB700BF6965 /* NSMutableDictionary+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDE3278FBAB700BF6965 /* NSMutableDictionary+AvoidCrash.m */; };
+		93AFCDFF278FBAB700BF6965 /* AvoidCrashProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AFCDE4278FBAB700BF6965 /* AvoidCrashProtocol.h */; };
+		93AFCE00278FBAB700BF6965 /* NSMutableString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDE5278FBAB700BF6965 /* NSMutableString+AvoidCrash.m */; };
+		93AFCE01278FBAB700BF6965 /* NSMutableString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDE5278FBAB700BF6965 /* NSMutableString+AvoidCrash.m */; };
+		93AFCE02278FBAB700BF6965 /* NSObject+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDE6278FBAB700BF6965 /* NSObject+AvoidCrash.m */; };
+		93AFCE03278FBAB700BF6965 /* NSObject+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDE6278FBAB700BF6965 /* NSObject+AvoidCrash.m */; };
+		93AFCE04278FBAB700BF6965 /* NSMutableArray+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDE7278FBAB700BF6965 /* NSMutableArray+AvoidCrash.m */; };
+		93AFCE05278FBAB700BF6965 /* NSMutableArray+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDE7278FBAB700BF6965 /* NSMutableArray+AvoidCrash.m */; };
+		93AFCE06278FBAB700BF6965 /* NSMutableAttributedString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDE8278FBAB700BF6965 /* NSMutableAttributedString+AvoidCrash.m */; };
+		93AFCE07278FBAB700BF6965 /* NSMutableAttributedString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDE8278FBAB700BF6965 /* NSMutableAttributedString+AvoidCrash.m */; };
+		93AFCE08278FBAB700BF6965 /* NSAttributedString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDE9278FBAB700BF6965 /* NSAttributedString+AvoidCrash.m */; };
+		93AFCE09278FBAB700BF6965 /* NSAttributedString+AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDE9278FBAB700BF6965 /* NSAttributedString+AvoidCrash.m */; };
+		93AFCE0A278FBAB700BF6965 /* NSDictionary+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AFCDEA278FBAB700BF6965 /* NSDictionary+AvoidCrash.h */; };
+		93AFCE0B278FBAB700BF6965 /* NSString+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AFCDEB278FBAB700BF6965 /* NSString+AvoidCrash.h */; };
+		93AFCE0C278FBAB700BF6965 /* AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDEC278FBAB700BF6965 /* AvoidCrash.m */; };
+		93AFCE0D278FBAB700BF6965 /* AvoidCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDEC278FBAB700BF6965 /* AvoidCrash.m */; };
+		93AFCE0E278FBAB700BF6965 /* NSArray+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AFCDED278FBAB700BF6965 /* NSArray+AvoidCrash.h */; };
+		93AFCE0F278FBAB700BF6965 /* NSMutableDictionary+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AFCDEE278FBAB700BF6965 /* NSMutableDictionary+AvoidCrash.h */; };
+		93AFCE10278FBAB700BF6965 /* AvoidCrashStubProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDEF278FBAB700BF6965 /* AvoidCrashStubProxy.m */; };
+		93AFCE11278FBAB700BF6965 /* AvoidCrashStubProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCDEF278FBAB700BF6965 /* AvoidCrashStubProxy.m */; };
+		93AFCE12278FBAB700BF6965 /* NSObject+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AFCDF0278FBAB700BF6965 /* NSObject+AvoidCrash.h */; };
+		93AFCE13278FBAB700BF6965 /* NSMutableString+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AFCDF1278FBAB700BF6965 /* NSMutableString+AvoidCrash.h */; };
+		93AFCE14278FBAB700BF6965 /* NSMutableAttributedString+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AFCDF2278FBAB700BF6965 /* NSMutableAttributedString+AvoidCrash.h */; };
+		93AFCE15278FBAB700BF6965 /* NSMutableArray+AvoidCrash.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AFCDF3278FBAB700BF6965 /* NSMutableArray+AvoidCrash.h */; };
+		93AFCE61278FCF9D00BF6965 /* BuglyManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AFCE5F278FCF9D00BF6965 /* BuglyManager.h */; };
+		93AFCE62278FCF9D00BF6965 /* BuglyManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE60278FCF9D00BF6965 /* BuglyManager.m */; };
+		93AFCE63278FCF9D00BF6965 /* BuglyManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AFCE60278FCF9D00BF6965 /* BuglyManager.m */; };
 		93BB27A6278597830019B85C /* SRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 93BB27A4278597830019B85C /* SRWebSocket.m */; };
 		93BB27A7278597830019B85C /* SRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 93BB27A4278597830019B85C /* SRWebSocket.m */; };
 		93BB27A8278597830019B85C /* SRWebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 93BB27A5278597830019B85C /* SRWebSocket.h */; };
@@ -845,6 +882,31 @@
 		914642A9ACEDBBFC7BE9E1A3 /* Il2CppMetadataRegistration.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = Il2CppMetadataRegistration.c; path = Classes/Native/Il2CppMetadataRegistration.c; sourceTree = SOURCE_ROOT; };
 		92584C48A14965A935847383 /* Assembly-CSharp8.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "Assembly-CSharp8.cpp"; path = "Classes/Native/Assembly-CSharp8.cpp"; sourceTree = SOURCE_ROOT; };
 		93A94264A833AF9295273FDD /* QFramework.CSharpExtension.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = QFramework.CSharpExtension.cpp; path = Classes/Native/QFramework.CSharpExtension.cpp; sourceTree = SOURCE_ROOT; };
+		93AFCDDD278FBAB600BF6965 /* NSArray+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCDDE278FBAB600BF6965 /* AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AvoidCrash.h; sourceTree = "<group>"; };
+		93AFCDDF278FBAB600BF6965 /* NSString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCDE0278FBAB600BF6965 /* NSDictionary+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCDE1278FBAB700BF6965 /* NSAttributedString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSAttributedString+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCDE2278FBAB700BF6965 /* AvoidCrashStubProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AvoidCrashStubProxy.h; sourceTree = "<group>"; };
+		93AFCDE3278FBAB700BF6965 /* NSMutableDictionary+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableDictionary+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCDE4278FBAB700BF6965 /* AvoidCrashProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AvoidCrashProtocol.h; sourceTree = "<group>"; };
+		93AFCDE5278FBAB700BF6965 /* NSMutableString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableString+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCDE6278FBAB700BF6965 /* NSObject+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCDE7278FBAB700BF6965 /* NSMutableArray+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCDE8278FBAB700BF6965 /* NSMutableAttributedString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableAttributedString+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCDE9278FBAB700BF6965 /* NSAttributedString+AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSAttributedString+AvoidCrash.m"; sourceTree = "<group>"; };
+		93AFCDEA278FBAB700BF6965 /* NSDictionary+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCDEB278FBAB700BF6965 /* NSString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCDEC278FBAB700BF6965 /* AvoidCrash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AvoidCrash.m; sourceTree = "<group>"; };
+		93AFCDED278FBAB700BF6965 /* NSArray+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCDEE278FBAB700BF6965 /* NSMutableDictionary+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableDictionary+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCDEF278FBAB700BF6965 /* AvoidCrashStubProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AvoidCrashStubProxy.m; sourceTree = "<group>"; };
+		93AFCDF0278FBAB700BF6965 /* NSObject+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCDF1278FBAB700BF6965 /* NSMutableString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableString+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCDF2278FBAB700BF6965 /* NSMutableAttributedString+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableAttributedString+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCDF3278FBAB700BF6965 /* NSMutableArray+AvoidCrash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+AvoidCrash.h"; sourceTree = "<group>"; };
+		93AFCE5F278FCF9D00BF6965 /* BuglyManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BuglyManager.h; sourceTree = "<group>"; };
+		93AFCE60278FCF9D00BF6965 /* BuglyManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BuglyManager.m; sourceTree = "<group>"; };
 		93BB27A4278597830019B85C /* SRWebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SRWebSocket.m; sourceTree = "<group>"; };
 		93BB27A5278597830019B85C /* SRWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SRWebSocket.h; sourceTree = "<group>"; };
 		93BB27A92785978A0019B85C /* SocketRocketUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SocketRocketUtility.m; sourceTree = "<group>"; };
@@ -1570,6 +1632,36 @@
 			path = Unity;
 			sourceTree = "<group>";
 		};
+		93AFCDDC278FBAB600BF6965 /* AvoidCrash */ = {
+			isa = PBXGroup;
+			children = (
+				93AFCDDE278FBAB600BF6965 /* AvoidCrash.h */,
+				93AFCDEC278FBAB700BF6965 /* AvoidCrash.m */,
+				93AFCDE4278FBAB700BF6965 /* AvoidCrashProtocol.h */,
+				93AFCDE2278FBAB700BF6965 /* AvoidCrashStubProxy.h */,
+				93AFCDEF278FBAB700BF6965 /* AvoidCrashStubProxy.m */,
+				93AFCDED278FBAB700BF6965 /* NSArray+AvoidCrash.h */,
+				93AFCDDD278FBAB600BF6965 /* NSArray+AvoidCrash.m */,
+				93AFCDE1278FBAB700BF6965 /* NSAttributedString+AvoidCrash.h */,
+				93AFCDE9278FBAB700BF6965 /* NSAttributedString+AvoidCrash.m */,
+				93AFCDEA278FBAB700BF6965 /* NSDictionary+AvoidCrash.h */,
+				93AFCDE0278FBAB600BF6965 /* NSDictionary+AvoidCrash.m */,
+				93AFCDF3278FBAB700BF6965 /* NSMutableArray+AvoidCrash.h */,
+				93AFCDE7278FBAB700BF6965 /* NSMutableArray+AvoidCrash.m */,
+				93AFCDF2278FBAB700BF6965 /* NSMutableAttributedString+AvoidCrash.h */,
+				93AFCDE8278FBAB700BF6965 /* NSMutableAttributedString+AvoidCrash.m */,
+				93AFCDEE278FBAB700BF6965 /* NSMutableDictionary+AvoidCrash.h */,
+				93AFCDE3278FBAB700BF6965 /* NSMutableDictionary+AvoidCrash.m */,
+				93AFCDF1278FBAB700BF6965 /* NSMutableString+AvoidCrash.h */,
+				93AFCDE5278FBAB700BF6965 /* NSMutableString+AvoidCrash.m */,
+				93AFCDF0278FBAB700BF6965 /* NSObject+AvoidCrash.h */,
+				93AFCDE6278FBAB700BF6965 /* NSObject+AvoidCrash.m */,
+				93AFCDEB278FBAB700BF6965 /* NSString+AvoidCrash.h */,
+				93AFCDDF278FBAB600BF6965 /* NSString+AvoidCrash.m */,
+			);
+			path = AvoidCrash;
+			sourceTree = "<group>";
+		};
 		93BB2794278585480019B85C /* socket */ = {
 			isa = PBXGroup;
 			children = (
@@ -1601,12 +1693,12 @@
 		93D3D07C27797662006D26A0 /* UI */ = {
 			isa = PBXGroup;
 			children = (
+				93D3D09327797662006D26A0 /* AnimationVIew */,
 				93D3D07D27797662006D26A0 /* CarouselView */,
-				93D3D08C27797662006D26A0 /* PopupView */,
-				93D3D08F27797662006D26A0 /* SearchDeviceViewController.m */,
 				93D3D09027797662006D26A0 /* NoDeviceTip */,
-				93D3D09327797662006D26A0 /* AnimationVIew */,
+				93D3D08C27797662006D26A0 /* PopupView */,
 				93D3D09627797662006D26A0 /* SearchDeviceViewController.h */,
+				93D3D08F27797662006D26A0 /* SearchDeviceViewController.m */,
 			);
 			path = UI;
 			sourceTree = "<group>";
@@ -1614,20 +1706,20 @@
 		93D3D07D27797662006D26A0 /* CarouselView */ = {
 			isa = PBXGroup;
 			children = (
-				93D3D07E27797662006D26A0 /* TXCarouselCollectionViewCell.xib */,
-				93D3D07F27797662006D26A0 /* TXCarouselViewLayout.h */,
 				93D3D08027797662006D26A0 /* ShoesCarouselView.h */,
-				93D3D08127797662006D26A0 /* TXCarouselCellModel.m */,
-				93D3D08227797662006D26A0 /* TXCarouselCollectionViewCell.h */,
-				93D3D08327797662006D26A0 /* ShoesCollectionCell.m */,
-				93D3D08427797662006D26A0 /* ShoesCollectionCell.xib */,
-				93D3D08527797662006D26A0 /* TXCarouselView.h */,
 				93D3D08627797662006D26A0 /* ShoesCarouselView.m */,
-				93D3D08727797662006D26A0 /* TXCarouselViewLayout.m */,
 				93D3D08827797662006D26A0 /* ShoesCollectionCell.h */,
-				93D3D08927797662006D26A0 /* TXCarouselCollectionViewCell.m */,
+				93D3D08327797662006D26A0 /* ShoesCollectionCell.m */,
+				93D3D08427797662006D26A0 /* ShoesCollectionCell.xib */,
 				93D3D08A27797662006D26A0 /* TXCarouselCellModel.h */,
+				93D3D08127797662006D26A0 /* TXCarouselCellModel.m */,
+				93D3D08227797662006D26A0 /* TXCarouselCollectionViewCell.h */,
+				93D3D08927797662006D26A0 /* TXCarouselCollectionViewCell.m */,
+				93D3D07E27797662006D26A0 /* TXCarouselCollectionViewCell.xib */,
+				93D3D08527797662006D26A0 /* TXCarouselView.h */,
 				93D3D08B27797662006D26A0 /* TXCarouselView.m */,
+				93D3D07F27797662006D26A0 /* TXCarouselViewLayout.h */,
+				93D3D08727797662006D26A0 /* TXCarouselViewLayout.m */,
 			);
 			path = CarouselView;
 			sourceTree = "<group>";
@@ -1692,7 +1784,10 @@
 		93D3D0AA27797662006D26A0 /* ThirdClass */ = {
 			isa = PBXGroup;
 			children = (
+				93AFCDDC278FBAB600BF6965 /* AvoidCrash */,
 				93D3D0AB27797662006D26A0 /* MBProgressHUD */,
+				93AFCE5F278FCF9D00BF6965 /* BuglyManager.h */,
+				93AFCE60278FCF9D00BF6965 /* BuglyManager.m */,
 			);
 			path = ThirdClass;
 			sourceTree = "<group>";
@@ -1939,6 +2034,7 @@
 				93E737E9278BD6970017A553 /* FootStep.h in Headers */,
 				93D3D12127797662006D26A0 /* TXCarouselViewLayout.h in Headers */,
 				93D3D16327797662006D26A0 /* HTTPDataProcession.h in Headers */,
+				93AFCE0E278FBAB700BF6965 /* NSArray+AvoidCrash.h in Headers */,
 				93E737E3278BD6970017A553 /* testGame.h in Headers */,
 				93E7380A278BD6970017A553 /* RunGame.h in Headers */,
 				93D3D13A27797662006D26A0 /* NoDeviceTip.h in Headers */,
@@ -1951,8 +2047,11 @@
 				93D3D16727797662006D26A0 /* AFURLRequestSerialization.h in Headers */,
 				9DC67E8821CBBED5005F9FA1 /* RenderPluginDelegate.h in Headers */,
 				93D3D12527797662006D26A0 /* TXCarouselCollectionViewCell.h in Headers */,
+				93AFCE61278FCF9D00BF6965 /* BuglyManager.h in Headers */,
+				93AFCDFF278FBAB700BF6965 /* AvoidCrashProtocol.h in Headers */,
 				93D3D15527797662006D26A0 /* DebugView.h in Headers */,
 				93E737F7278BD6970017A553 /* RuinsExplore.h in Headers */,
+				93AFCE13278FBAB700BF6965 /* NSMutableString+AvoidCrash.h in Headers */,
 				93D3D20C27797663006D26A0 /* AlgorithmTool.h in Headers */,
 				93D3D15427797662006D26A0 /* MainShoesAnalysis.h in Headers */,
 				93D3D14F27797662006D26A0 /* BTDataSend.h in Headers */,
@@ -1969,22 +2068,31 @@
 				9D25ABA1213FB47800354C27 /* UnityFramework.h in Headers */,
 				93D3D14027797662006D26A0 /* SearchDeviceViewController.h in Headers */,
 				93D3D13227797662006D26A0 /* TXCarouselCellModel.h in Headers */,
+				93AFCE0B278FBAB700BF6965 /* NSString+AvoidCrash.h in Headers */,
+				93AFCE12278FBAB700BF6965 /* NSObject+AvoidCrash.h in Headers */,
+				93AFCE0F278FBAB700BF6965 /* NSMutableDictionary+AvoidCrash.h in Headers */,
 				93D3D12227797662006D26A0 /* ShoesCarouselView.h in Headers */,
+				93AFCDFB278FBAB700BF6965 /* NSAttributedString+AvoidCrash.h in Headers */,
 				93D3D13D27797662006D26A0 /* AnimationView.h in Headers */,
 				93E737E5278BD6970017A553 /* InertialTrajProcess.h in Headers */,
 				93D3D20A27797663006D26A0 /* MYFactoryManager.h in Headers */,
 				93D3D15927797662006D26A0 /* UserFriendsModel.h in Headers */,
 				93E737F1278BD6970017A553 /* Tricycle.h in Headers */,
 				93D3D15C27797662006D26A0 /* MBProgressHUD.h in Headers */,
+				93AFCDF6278FBAB700BF6965 /* AvoidCrash.h in Headers */,
 				93E73809278BD6970017A553 /* DanceFoot.h in Headers */,
 				9DC67E8621CBBEC7005F9FA1 /* UndefinePlatforms.h in Headers */,
 				93D3D13727797662006D26A0 /* PopupView.h in Headers */,
 				93D3D14327797662006D26A0 /* LEONBLManager.h in Headers */,
+				93AFCE15278FBAB700BF6965 /* NSMutableArray+AvoidCrash.h in Headers */,
 				93D3D20427797663006D26A0 /* GameObjc.h in Headers */,
 				93E73811278BD6970017A553 /* MonsterH5.h in Headers */,
 				93E737E6278BD6970017A553 /* DanceGame.h in Headers */,
+				93AFCDFC278FBAB700BF6965 /* AvoidCrashStubProxy.h in Headers */,
+				93AFCE0A278FBAB700BF6965 /* NSDictionary+AvoidCrash.h in Headers */,
 				93D3D16527797662006D26A0 /* AFNetworkReachabilityManager.h in Headers */,
 				93E737EE278BD6970017A553 /* BigFoot.h in Headers */,
+				93AFCE14278FBAB700BF6965 /* NSMutableAttributedString+AvoidCrash.h in Headers */,
 				93D3D16C27797662006D26A0 /* AFURLResponseSerialization.h in Headers */,
 				93D3D12F27797662006D26A0 /* ShoesCollectionCell.h in Headers */,
 				93D3D15327797662006D26A0 /* ViceShoesAnalysis.h in Headers */,
@@ -2258,6 +2366,7 @@
 				93D3D17427797663006D26A0 /* AFSecurityPolicy.m in Sources */,
 				93D3D16D27797663006D26A0 /* AFURLSessionManager.m in Sources */,
 				93E737F3278BD6970017A553 /* MonsterH5.cpp in Sources */,
+				93AFCE10278FBAB700BF6965 /* AvoidCrashStubProxy.m in Sources */,
 				93D3D13027797662006D26A0 /* TXCarouselCollectionViewCell.m in Sources */,
 				93E73803278BD6970017A553 /* testGame.cpp in Sources */,
 				93D3D15F27797662006D26A0 /* IOSPlatformSDK.mm in Sources */,
@@ -2269,32 +2378,42 @@
 				93D3D14127797662006D26A0 /* CBPeripheral+ADName.m in Sources */,
 				93D3D15A27797662006D26A0 /* MBProgressHUD.m in Sources */,
 				93D3D20F27797663006D26A0 /* MYFactoryManager.m in Sources */,
+				93AFCE62278FCF9D00BF6965 /* BuglyManager.m in Sources */,
 				93D3D14D27797662006D26A0 /* MainShoesAnalysis.mm in Sources */,
 				93E7380C278BD6970017A553 /* Interaction.cpp in Sources */,
 				93BB27A6278597830019B85C /* SRWebSocket.m in Sources */,
 				93E737F5278BD6970017A553 /* FootStep.cpp in Sources */,
 				93E737EA278BD6970017A553 /* InertialTrajProcess.cpp in Sources */,
 				93D3D14B27797662006D26A0 /* BTDataProcess.mm in Sources */,
+				93AFCE08278FBAB700BF6965 /* NSAttributedString+AvoidCrash.m in Sources */,
 				93E737E7278BD6970017A553 /* jumpH5.cpp in Sources */,
 				93D3D15027797662006D26A0 /* LEONBLManager.m in Sources */,
 				93E737FB278BD6970017A553 /* DanceFoot.cpp in Sources */,
 				93D3D14427797662006D26A0 /* BTDataSend.m in Sources */,
+				93AFCDF7278FBAB700BF6965 /* NSString+AvoidCrash.m in Sources */,
 				93D3D13E27797662006D26A0 /* AnimationView.m in Sources */,
 				93E737FF278BD6970017A553 /* RuinsExplore.cpp in Sources */,
 				93E737FD278BD6970017A553 /* Tricycle.cpp in Sources */,
+				93AFCE02278FBAB700BF6965 /* NSObject+AvoidCrash.m in Sources */,
+				93AFCE06278FBAB700BF6965 /* NSMutableAttributedString+AvoidCrash.m in Sources */,
 				93E737EF278BD6970017A553 /* SingleFootAction.cpp in Sources */,
+				93AFCDF9278FBAB700BF6965 /* NSDictionary+AvoidCrash.m in Sources */,
 				93D3D13527797662006D26A0 /* PopupView.m in Sources */,
 				93D3D16A27797662006D26A0 /* AFHTTPSessionManager.m in Sources */,
 				93D3D12D27797662006D26A0 /* TXCarouselViewLayout.m in Sources */,
 				93E73801278BD6970017A553 /* OriginTraj.cpp in Sources */,
 				93E73807278BD6970017A553 /* publicMotion.cpp in Sources */,
 				93E737F9278BD6970017A553 /* Game.cpp in Sources */,
+				93AFCE0C278FBAB700BF6965 /* AvoidCrash.m in Sources */,
 				93D3D14727797662006D26A0 /* ViceShoesAnalysis.m in Sources */,
 				93D3D20527797663006D26A0 /* AlgorithmTool.m in Sources */,
 				93E73805278BD6970017A553 /* DanceGame.cpp in Sources */,
+				93AFCE00278FBAB700BF6965 /* NSMutableString+AvoidCrash.m in Sources */,
 				93E7380E278BD6970017A553 /* BigFoot.cpp in Sources */,
+				93AFCE04278FBAB700BF6965 /* NSMutableArray+AvoidCrash.m in Sources */,
 				93D3D21127797663006D26A0 /* UIView+ST.m in Sources */,
 				93D3D17227797663006D26A0 /* AFNetworkReachabilityManager.m in Sources */,
+				93AFCDFD278FBAB700BF6965 /* NSMutableDictionary+AvoidCrash.m in Sources */,
 				93D3D16F27797663006D26A0 /* AFURLRequestSerialization.m in Sources */,
 				93D3D12327797662006D26A0 /* TXCarouselCellModel.m in Sources */,
 				93D3D16127797662006D26A0 /* HTTPDataProcession.m in Sources */,
@@ -2304,6 +2423,7 @@
 				93D3D20727797663006D26A0 /* UIColor+Hex.m in Sources */,
 				93E737EC278BD6970017A553 /* RunGame.cpp in Sources */,
 				93D3D15727797662006D26A0 /* UserFriendsModel.m in Sources */,
+				93AFCDF4278FBAB700BF6965 /* NSArray+AvoidCrash.m in Sources */,
 				93D3D16827797662006D26A0 /* AFURLResponseSerialization.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -2339,6 +2459,7 @@
 				93E737ED278BD6970017A553 /* RunGame.cpp in Sources */,
 				9D25ABBB213FB6E300354C27 /* UnityViewControllerBase.mm in Sources */,
 				93D3D15827797662006D26A0 /* UserFriendsModel.m in Sources */,
+				93AFCE11278FBAB700BF6965 /* AvoidCrashStubProxy.m in Sources */,
 				9D25ABCC213FB6F800354C27 /* UnityReplayKit_Scripting.mm in Sources */,
 				9D25ABB7213FB6E300354C27 /* UnityAppController+ViewHandling.mm in Sources */,
 				9D25ABC2213FB6F800354C27 /* CVTextureCache.mm in Sources */,
@@ -2367,6 +2488,7 @@
 				9D25ABE6213FB7C100354C27 /* RegisterFeatures.cpp in Sources */,
 				9D25ABBC213FB6E300354C27 /* UnityViewControllerBase+iOS.mm in Sources */,
 				9D25ABE5213FB76500354C27 /* UnityAppController+UnityInterface.mm in Sources */,
+				93AFCE05278FBAB700BF6965 /* NSMutableArray+AvoidCrash.m in Sources */,
 				9D25ABC0213FB6F800354C27 /* CameraCapture.mm in Sources */,
 				9D25ABB0213FB6C400354C27 /* UnityViewControllerListener.mm in Sources */,
 				9D25ABAE213FB6BA00354C27 /* LifeCycleListener.mm in Sources */,
@@ -2421,6 +2543,7 @@
 				A76E45388CC6D17A7C03CB9B /* Generics23.cpp in Sources */,
 				D4F14A22B97C0B65B8E3BC93 /* Generics3.cpp in Sources */,
 				A5CD49E186155517CE1DB837 /* Generics4.cpp in Sources */,
+				93AFCDF8278FBAB700BF6965 /* NSString+AvoidCrash.m in Sources */,
 				B1FF44FF81D6080ECD6E7FF7 /* Generics5.cpp in Sources */,
 				B745404FAD35E6350D0B38E4 /* Generics6.cpp in Sources */,
 				93D3D12E27797662006D26A0 /* TXCarouselViewLayout.m in Sources */,
@@ -2450,8 +2573,10 @@
 				6CF044849425DE9289325675 /* Il2CppInvokerTable.cpp in Sources */,
 				8D7144E89114AFAFAC4CBC36 /* Il2CppMetadataRegistration.c in Sources */,
 				860444828D15E23593962960 /* Il2CppMetadataUsage.c in Sources */,
+				93AFCDFA278FBAB700BF6965 /* NSDictionary+AvoidCrash.m in Sources */,
 				83634BE5907B45C836ED3B78 /* Il2CppReversePInvokeWrapperTable.cpp in Sources */,
 				93D3D12C27797662006D26A0 /* ShoesCarouselView.m in Sources */,
+				93AFCDF5278FBAB700BF6965 /* NSArray+AvoidCrash.m in Sources */,
 				0D0F42C8BFF4F711800B7E44 /* Il2CppTypeDefinitions.c in Sources */,
 				8392446EB5981EA1ECCB4D3E /* Mono.Security.cpp in Sources */,
 				93D3D12727797662006D26A0 /* ShoesCollectionCell.m in Sources */,
@@ -2492,6 +2617,7 @@
 				F52A45339D1675BB5E3B1C6F /* QFramework.Architecture.cpp in Sources */,
 				C27C44298E86F1F769EEDB78 /* QFramework.Architecture_CodeGen.c in Sources */,
 				C157453FAF877B87E87C92FC /* QFramework.AudioKit.cpp in Sources */,
+				93AFCE03278FBAB700BF6965 /* NSObject+AvoidCrash.m in Sources */,
 				C3C54C5D87FF8A35300BE8BE /* QFramework.AudioKit_CodeGen.c in Sources */,
 				BEF749359691F240DE52E977 /* QFramework.BindableProperty.cpp in Sources */,
 				D344495DA0DC02967F2C7E7A /* QFramework.BindableProperty_CodeGen.c in Sources */,
@@ -2505,14 +2631,18 @@
 				93D3D15B27797662006D26A0 /* MBProgressHUD.m in Sources */,
 				F87C4E2FBB24D4762A8FF79F /* QFramework.DataStructure_CodeGen.c in Sources */,
 				10AD4E88A05101429370219F /* QFramework.Device.cpp in Sources */,
+				93AFCE07278FBAB700BF6965 /* NSMutableAttributedString+AvoidCrash.m in Sources */,
 				2C82422F8E0A9E365CE767AB /* QFramework.Device_CodeGen.c in Sources */,
 				48B54F38986BF07A4F926E1B /* QFramework.EventSystem.cpp in Sources */,
+				93AFCDFE278FBAB700BF6965 /* NSMutableDictionary+AvoidCrash.m in Sources */,
 				C68C4C88A124B4561D842A9C /* QFramework.EventSystem_CodeGen.c in Sources */,
 				93D3D14C27797662006D26A0 /* BTDataProcess.mm in Sources */,
 				01B14F2794C20F4AF83EDD10 /* QFramework.FSM.cpp in Sources */,
+				93AFCE09278FBAB700BF6965 /* NSAttributedString+AvoidCrash.m in Sources */,
 				93E73800278BD6970017A553 /* RuinsExplore.cpp in Sources */,
 				A5AE4C63B2C54DC109EFF8D4 /* QFramework.FSM_CodeGen.c in Sources */,
 				E13B45A18DE413B60F7BC033 /* QFramework.IOC.cpp in Sources */,
+				93AFCE01278FBAB700BF6965 /* NSMutableString+AvoidCrash.m in Sources */,
 				8B594A449DF4BE01F42980F5 /* QFramework.IOC_CodeGen.c in Sources */,
 				93E7380D278BD6970017A553 /* Interaction.cpp in Sources */,
 				50884B09B04B0685E80855E1 /* QFramework.Log.cpp in Sources */,
@@ -2570,6 +2700,7 @@
 				7A684420B0AD1DF71CBAF9FC /* System_CodeGen.c in Sources */,
 				F01A4A1C918C4BA979981B6F /* Unity.TextMeshPro.cpp in Sources */,
 				EE65489085875D5EC88D8778 /* Unity.TextMeshPro1.cpp in Sources */,
+				93AFCE0D278FBAB700BF6965 /* AvoidCrash.m in Sources */,
 				19514B99BFE3DF9EA5860189 /* Unity.TextMeshPro2.cpp in Sources */,
 				861A45A2B3089A2AAC4BA14F /* Unity.TextMeshPro3.cpp in Sources */,
 				219E436581689DA6F66250D1 /* Unity.TextMeshPro_CodeGen.c in Sources */,
@@ -2604,6 +2735,7 @@
 				93E737F0278BD6970017A553 /* SingleFootAction.cpp in Sources */,
 				8D17458581415BB6971D1A41 /* UnityEngine.Physics2DModule_CodeGen.c in Sources */,
 				3BBE4878B5B3F0CA86E4040B /* UnityEngine.PhysicsModule.cpp in Sources */,
+				93AFCE63278FCF9D00BF6965 /* BuglyManager.m in Sources */,
 				B8F645089CB66BAF79CBAFE5 /* UnityEngine.PhysicsModule_CodeGen.c in Sources */,
 				27324BF8B79354F4473EB83F /* UnityEngine.SharedInternalsModule.cpp in Sources */,
 				91984D84B3FE92002A071435 /* UnityEngine.SharedInternalsModule_CodeGen.c in Sources */,
@@ -2681,8 +2813,8 @@
 				DEVELOPMENT_TEAM = 79QQ6HAK8M;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
-					"$(PROJECT_DIR)/SDK/ThirdClass/Bugly-2.5.9",
 					"$(PROJECT_DIR)",
+					"$(PROJECT_DIR)/SDK/ThirdClass",
 				);
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_ENABLE_CPP_EXCEPTIONS = NO;
@@ -2738,8 +2870,8 @@
 				DEVELOPMENT_TEAM = 79QQ6HAK8M;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
-					"$(PROJECT_DIR)/SDK/ThirdClass/Bugly-2.5.9",
 					"$(PROJECT_DIR)",
+					"$(PROJECT_DIR)/SDK/ThirdClass",
 				);
 				GCC_ENABLE_CPP_EXCEPTIONS = NO;
 				INFOPLIST_FILE = Info.plist;
@@ -2917,8 +3049,8 @@
 				DEVELOPMENT_TEAM = 79QQ6HAK8M;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
-					"$(PROJECT_DIR)/SDK/ThirdClass/Bugly-2.5.9",
 					"$(PROJECT_DIR)",
+					"$(PROJECT_DIR)/SDK/ThirdClass",
 				);
 				GCC_ENABLE_CPP_EXCEPTIONS = NO;
 				INFOPLIST_FILE = Info.plist;
@@ -3040,8 +3172,8 @@
 				DEVELOPMENT_TEAM = 79QQ6HAK8M;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
-					"$(PROJECT_DIR)/SDK/ThirdClass/Bugly-2.5.9",
 					"$(PROJECT_DIR)",
+					"$(PROJECT_DIR)/SDK/ThirdClass",
 				);
 				GCC_ENABLE_CPP_EXCEPTIONS = NO;
 				INFOPLIST_FILE = Info.plist;
@@ -3142,7 +3274,7 @@
 				ENABLE_ON_DEMAND_RESOURCES = NO;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
-					"$(PROJECT_DIR)/SDK/ThirdClass/Bugly-2.5.9",
+					"$(PROJECT_DIR)/SDK/ThirdClass",
 				);
 				GCC_ENABLE_CPP_EXCEPTIONS = YES;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -3215,7 +3347,7 @@
 				ENABLE_ON_DEMAND_RESOURCES = NO;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
-					"$(PROJECT_DIR)/SDK/ThirdClass/Bugly-2.5.9",
+					"$(PROJECT_DIR)/SDK/ThirdClass",
 				);
 				GCC_ENABLE_CPP_EXCEPTIONS = YES;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -3290,7 +3422,7 @@
 				ENABLE_ON_DEMAND_RESOURCES = NO;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
-					"$(PROJECT_DIR)/SDK/ThirdClass/Bugly-2.5.9",
+					"$(PROJECT_DIR)/SDK/ThirdClass",
 				);
 				GCC_ENABLE_CPP_EXCEPTIONS = YES;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -3364,7 +3496,7 @@
 				ENABLE_ON_DEMAND_RESOURCES = NO;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
-					"$(PROJECT_DIR)/SDK/ThirdClass/Bugly-2.5.9",
+					"$(PROJECT_DIR)/SDK/ThirdClass",
 				);
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_ENABLE_CPP_EXCEPTIONS = YES;

BIN
RunGame/Unity-iPhone.xcodeproj/project.xcworkspace/xcuserdata/duowan123.xcuserdatad/UserInterfaceState.xcuserstate