diff --git a/yinmeng-ios/DingDangApp.xcodeproj/project.pbxproj b/yinmeng-ios/DingDangApp.xcodeproj/project.pbxproj index 84e5614..c99c088 100644 --- a/yinmeng-ios/DingDangApp.xcodeproj/project.pbxproj +++ b/yinmeng-ios/DingDangApp.xcodeproj/project.pbxproj @@ -701,10 +701,15 @@ 8C2C3EDF2B27C3B8002C3C34 /* DDCountDownHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3EDE2B27C3B8002C3C34 /* DDCountDownHelper.m */; }; 8C2C3EE32B27CC6E002C3C34 /* DDBase64.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3EE22B27CC6E002C3C34 /* DDBase64.m */; }; 8C2C3EE62B27CC7D002C3C34 /* DDDESEncrypt.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3EE52B27CC7D002C3C34 /* DDDESEncrypt.m */; }; - 8C2C3EEA2B27D163002C3C34 /* YYReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3EE92B27D163002C3C34 /* YYReachability.m */; }; - 8C2C3EEF2B27D1B5002C3C34 /* SSKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3EEE2B27D1B5002C3C34 /* SSKeychain.m */; }; 8C2C3EF32B27D224002C3C34 /* NSObject+DDExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3EF22B27D224002C3C34 /* NSObject+DDExtension.m */; }; - 8C2C3EF92B27D94A002C3C34 /* YYUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3EF82B27D94A002C3C34 /* YYUtility.m */; }; + 8C2C3F0E2B27E5D8002C3C34 /* DDReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3F0D2B27E5D8002C3C34 /* DDReachability.m */; }; + 8C2C3F132B27ED3C002C3C34 /* DDUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3F122B27ED3C002C3C34 /* DDUtility.m */; }; + 8C2C3F162B27ED7C002C3C34 /* DDUtility+App.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3F152B27ED7C002C3C34 /* DDUtility+App.m */; }; + 8C2C3F192B27F10D002C3C34 /* DDUtility+Device.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3F182B27F10D002C3C34 /* DDUtility+Device.m */; }; + 8C2C3F1C2B27FE43002C3C34 /* DDUtility+Carrier.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3F1B2B27FE43002C3C34 /* DDUtility+Carrier.m */; }; + 8C2C3F202B2801AC002C3C34 /* DDStatisticsService.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3F1F2B2801AC002C3C34 /* DDStatisticsService.m */; }; + 8C2C3F232B2801D8002C3C34 /* DDStatisticsServiceHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3F222B2801D8002C3C34 /* DDStatisticsServiceHelper.m */; }; + 8C2C3F272B2803CA002C3C34 /* DDSpriteSheeImagetManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2C3F262B2803CA002C3C34 /* DDSpriteSheeImagetManager.m */; }; 8CE493992B23F44800CA14D5 /* NSMutableDictionary+DDSafe.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CE493982B23F44800CA14D5 /* NSMutableDictionary+DDSafe.m */; }; 8CE4939C2B23F45C00CA14D5 /* NSArray+DDSafe.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CE4939B2B23F45C00CA14D5 /* NSArray+DDSafe.m */; }; 8CE493A02B23F5FA00CA14D5 /* DDUploadFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CE4939F2B23F5FA00CA14D5 /* DDUploadFile.m */; }; @@ -1998,15 +2003,25 @@ 8C2C3EE22B27CC6E002C3C34 /* DDBase64.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDBase64.m; sourceTree = ""; }; 8C2C3EE42B27CC7D002C3C34 /* DDDESEncrypt.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDDESEncrypt.h; sourceTree = ""; }; 8C2C3EE52B27CC7D002C3C34 /* DDDESEncrypt.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDDESEncrypt.m; sourceTree = ""; }; - 8C2C3EE82B27D163002C3C34 /* YYReachability.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YYReachability.h; sourceTree = ""; }; - 8C2C3EE92B27D163002C3C34 /* YYReachability.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YYReachability.m; sourceTree = ""; }; - 8C2C3EED2B27D1B5002C3C34 /* SSKeychain.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SSKeychain.h; sourceTree = ""; }; - 8C2C3EEE2B27D1B5002C3C34 /* SSKeychain.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SSKeychain.m; sourceTree = ""; }; 8C2C3EF12B27D224002C3C34 /* NSObject+DDExtension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSObject+DDExtension.h"; sourceTree = ""; }; 8C2C3EF22B27D224002C3C34 /* NSObject+DDExtension.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSObject+DDExtension.m"; sourceTree = ""; }; - 8C2C3EF62B27D8CB002C3C34 /* CarrierIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CarrierIdentifier.h; sourceTree = ""; }; - 8C2C3EF72B27D94A002C3C34 /* YYUtility.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YYUtility.h; sourceTree = ""; }; - 8C2C3EF82B27D94A002C3C34 /* YYUtility.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YYUtility.m; sourceTree = ""; }; + 8C2C3F0C2B27E5D8002C3C34 /* DDReachability.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDReachability.h; sourceTree = ""; }; + 8C2C3F0D2B27E5D8002C3C34 /* DDReachability.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDReachability.m; sourceTree = ""; }; + 8C2C3F102B27ECEE002C3C34 /* DDCarrierIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDCarrierIdentifier.h; sourceTree = ""; }; + 8C2C3F112B27ED3C002C3C34 /* DDUtility.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDUtility.h; sourceTree = ""; }; + 8C2C3F122B27ED3C002C3C34 /* DDUtility.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDUtility.m; sourceTree = ""; }; + 8C2C3F142B27ED7C002C3C34 /* DDUtility+App.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DDUtility+App.h"; sourceTree = ""; }; + 8C2C3F152B27ED7C002C3C34 /* DDUtility+App.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "DDUtility+App.m"; sourceTree = ""; }; + 8C2C3F172B27F10D002C3C34 /* DDUtility+Device.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DDUtility+Device.h"; sourceTree = ""; }; + 8C2C3F182B27F10D002C3C34 /* DDUtility+Device.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "DDUtility+Device.m"; sourceTree = ""; }; + 8C2C3F1A2B27FE43002C3C34 /* DDUtility+Carrier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DDUtility+Carrier.h"; sourceTree = ""; }; + 8C2C3F1B2B27FE43002C3C34 /* DDUtility+Carrier.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "DDUtility+Carrier.m"; sourceTree = ""; }; + 8C2C3F1E2B2801AC002C3C34 /* DDStatisticsService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDStatisticsService.h; sourceTree = ""; }; + 8C2C3F1F2B2801AC002C3C34 /* DDStatisticsService.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDStatisticsService.m; sourceTree = ""; }; + 8C2C3F212B2801D8002C3C34 /* DDStatisticsServiceHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDStatisticsServiceHelper.h; sourceTree = ""; }; + 8C2C3F222B2801D8002C3C34 /* DDStatisticsServiceHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDStatisticsServiceHelper.m; sourceTree = ""; }; + 8C2C3F252B2803CA002C3C34 /* DDSpriteSheeImagetManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDSpriteSheeImagetManager.h; sourceTree = ""; }; + 8C2C3F262B2803CA002C3C34 /* DDSpriteSheeImagetManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDSpriteSheeImagetManager.m; sourceTree = ""; }; 8CAB97312B2259EA00ED8639 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 8CE493972B23F44800CA14D5 /* NSMutableDictionary+DDSafe.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSMutableDictionary+DDSafe.h"; sourceTree = ""; }; 8CE493982B23F44800CA14D5 /* NSMutableDictionary+DDSafe.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSMutableDictionary+DDSafe.m"; sourceTree = ""; }; @@ -5076,34 +5091,15 @@ path = DDSecurity; sourceTree = ""; }; - 8C2C3EE72B27D13A002C3C34 /* YYReachability */ = { - isa = PBXGroup; - children = ( - 8C2C3EE82B27D163002C3C34 /* YYReachability.h */, - 8C2C3EE92B27D163002C3C34 /* YYReachability.m */, - ); - path = YYReachability; - sourceTree = ""; - }; 8C2C3EEB2B27D17C002C3C34 /* DDThirdTool */ = { isa = PBXGroup; children = ( - 8C2C3EF42B27D66C002C3C34 /* YYUtility */, - 8C2C3EEC2B27D199002C3C34 /* SSKeyChain */, - 8C2C3EE72B27D13A002C3C34 /* YYReachability */, + 8C2C3F0F2B27ECB8002C3C34 /* DDUtility */, + 8C2C3F0B2B27E5B3002C3C34 /* DDRechability */, ); path = DDThirdTool; sourceTree = ""; }; - 8C2C3EEC2B27D199002C3C34 /* SSKeyChain */ = { - isa = PBXGroup; - children = ( - 8C2C3EED2B27D1B5002C3C34 /* SSKeychain.h */, - 8C2C3EEE2B27D1B5002C3C34 /* SSKeychain.m */, - ); - path = SSKeyChain; - sourceTree = ""; - }; 8C2C3EF02B27D1D7002C3C34 /* NSObject */ = { isa = PBXGroup; children = ( @@ -5113,19 +5109,56 @@ path = NSObject; sourceTree = ""; }; - 8C2C3EF42B27D66C002C3C34 /* YYUtility */ = { + 8C2C3F0B2B27E5B3002C3C34 /* DDRechability */ = { isa = PBXGroup; children = ( - 8C2C3EF62B27D8CB002C3C34 /* CarrierIdentifier.h */, - 8C2C3EF72B27D94A002C3C34 /* YYUtility.h */, - 8C2C3EF82B27D94A002C3C34 /* YYUtility.m */, + 8C2C3F0C2B27E5D8002C3C34 /* DDReachability.h */, + 8C2C3F0D2B27E5D8002C3C34 /* DDReachability.m */, ); - path = YYUtility; + path = DDRechability; + sourceTree = ""; + }; + 8C2C3F0F2B27ECB8002C3C34 /* DDUtility */ = { + isa = PBXGroup; + children = ( + 8C2C3F102B27ECEE002C3C34 /* DDCarrierIdentifier.h */, + 8C2C3F112B27ED3C002C3C34 /* DDUtility.h */, + 8C2C3F122B27ED3C002C3C34 /* DDUtility.m */, + 8C2C3F142B27ED7C002C3C34 /* DDUtility+App.h */, + 8C2C3F152B27ED7C002C3C34 /* DDUtility+App.m */, + 8C2C3F172B27F10D002C3C34 /* DDUtility+Device.h */, + 8C2C3F182B27F10D002C3C34 /* DDUtility+Device.m */, + 8C2C3F1A2B27FE43002C3C34 /* DDUtility+Carrier.h */, + 8C2C3F1B2B27FE43002C3C34 /* DDUtility+Carrier.m */, + ); + path = DDUtility; + sourceTree = ""; + }; + 8C2C3F1D2B280186002C3C34 /* DDStatisticsService */ = { + isa = PBXGroup; + children = ( + 8C2C3F1E2B2801AC002C3C34 /* DDStatisticsService.h */, + 8C2C3F1F2B2801AC002C3C34 /* DDStatisticsService.m */, + 8C2C3F212B2801D8002C3C34 /* DDStatisticsServiceHelper.h */, + 8C2C3F222B2801D8002C3C34 /* DDStatisticsServiceHelper.m */, + ); + path = DDStatisticsService; + sourceTree = ""; + }; + 8C2C3F242B2803BD002C3C34 /* DDSpriteSheetManager */ = { + isa = PBXGroup; + children = ( + 8C2C3F252B2803CA002C3C34 /* DDSpriteSheeImagetManager.h */, + 8C2C3F262B2803CA002C3C34 /* DDSpriteSheeImagetManager.m */, + ); + path = DDSpriteSheetManager; sourceTree = ""; }; 8CE493952B23F2B400CA14D5 /* DDBaseTool */ = { isa = PBXGroup; children = ( + 8C2C3F242B2803BD002C3C34 /* DDSpriteSheetManager */, + 8C2C3F1D2B280186002C3C34 /* DDStatisticsService */, 8C2C3EEB2B27D17C002C3C34 /* DDThirdTool */, 8C2C3EE02B27CC5B002C3C34 /* DDSecurity */, 8C2C3EDC2B27C39C002C3C34 /* DDCountDownHelper */, @@ -5680,6 +5713,7 @@ 188EBFA72A47CF1300060F03 /* DDMCommonModel.m in Sources */, 1812EC812A54FD2700FF2AC0 /* DDRoomGiftMicItemViewCell.m in Sources */, 188EBF982A47CF0C00060F03 /* DDMoreItemViewCell.m in Sources */, + 8C2C3F132B27ED3C002C3C34 /* DDUtility.m in Sources */, 188EBF722A47CEA500060F03 /* DDNoticeMCell.m in Sources */, 1867777B2A4293710096D802 /* CreatRoomNoticeViewCell.m in Sources */, 188AF5C82A27647D004DD4CF /* RoomPublicScreenCell.m in Sources */, @@ -5713,6 +5747,7 @@ 186EBFA02A3FE303005623CC /* DDKuoLieView.m in Sources */, 188583462A42822A00657AEC /* DDMyBlackListTableViewCell.m in Sources */, 18E659CD2A5655790017854A /* DDSearchRoomCell.m in Sources */, + 8C2C3F232B2801D8002C3C34 /* DDStatisticsServiceHelper.m in Sources */, 18660D572A2193C50032D0C9 /* UIView+SDAutoLayout.m in Sources */, 1834018B2A49991700B924BF /* RoomLuckGiftDetailView.m in Sources */, 18D786272A2305E700C9875F /* RoomPopTool.m in Sources */, @@ -5737,6 +5772,7 @@ 188EBF772A47CEA500060F03 /* DDMLiveListVC.m in Sources */, 2358F57D2B230B4A0038453C /* DDVideoEncodeManage.m in Sources */, 18C833602A25A12A0090BF65 /* DDMyInfoGiftWallCollectionViewCell.m in Sources */, + 8C2C3F272B2803CA002C3C34 /* DDSpriteSheeImagetManager.m in Sources */, 18660DCD2A21E54B0032D0C9 /* RoomViewController.m in Sources */, 8C2C3EE62B27CC7D002C3C34 /* DDDESEncrypt.m in Sources */, 188EC0EC2A47CF3200060F03 /* DDMEmoticonCell.m in Sources */, @@ -5797,7 +5833,6 @@ 188EC10E2A47CF3200060F03 /* NSDate+HXExtension.m in Sources */, 188EC12A2A47CF3200060F03 /* HXPhotoBottomSelectView.m in Sources */, 186EBFC42A40363A005623CC /* UIViewController+XPSemiModal.m in Sources */, - 8C2C3EEF2B27D1B5002C3C34 /* SSKeychain.m in Sources */, 183864482A28A17B005BF235 /* ZLCollectionCell.m in Sources */, 18AFFEC02A4BD4E0008F6478 /* DDTopAndBottomView.m in Sources */, 189569AF2A233BCD00DCF149 /* RoomTipView.m in Sources */, @@ -5824,7 +5859,6 @@ 1802B3DB2A541B6B0036DCEF /* DDLoginTextView.m in Sources */, 186A897B2A41B272001DE99E /* DDAuthorStatusTableViewCell.m in Sources */, 186A88E42A415291001DE99E /* DDMyLevelViewController.m in Sources */, - 8C2C3EF92B27D94A002C3C34 /* YYUtility.m in Sources */, 18C905042A2305A600F7CAFD /* ResourcePickerToolsObject.m in Sources */, 186A89052A41603C001DE99E /* DDNobleTableViewCell.m in Sources */, 18E94E802A2740890055E8F0 /* RoomGiftModel.m in Sources */, @@ -5851,6 +5885,7 @@ 186C9D1F2A2A163100209BB5 /* DDLineView.m in Sources */, 1826C5F92A24504500A5AFDB /* DDMyInfoClassView.m in Sources */, 188EBF682A47CEA500060F03 /* DDChatVC+MessageTool.m in Sources */, + 8C2C3F0E2B27E5D8002C3C34 /* DDReachability.m in Sources */, 18B00BED2A21D7DC001232DF /* DDAnimateImageView.m in Sources */, 186EBFB42A401548005623CC /* DDKuoLieHoriCollectionView.m in Sources */, 188EC12C2A47CF3200060F03 /* HXPreviewContentView.m in Sources */, @@ -5862,7 +5897,6 @@ 186A89162A41A1E8001DE99E /* DDRealNameModel.m in Sources */, 186777752A4293460096D802 /* CreatRoomCoverViewCell.m in Sources */, 1882ADC82A52A3F1009081FE /* DDMsgInputView.m in Sources */, - 8C2C3EEA2B27D163002C3C34 /* YYReachability.m in Sources */, 1848C22B2A4D11F00031F734 /* RoomAirPlaneContentView.m in Sources */, 1826B9D12A497F730023408A /* WebViewJavascriptBridgeBase.m in Sources */, 18660CF82A2193750032D0C9 /* JXTAlertView.m in Sources */, @@ -5911,6 +5945,7 @@ 18A7E68B2A4E7C780078E659 /* DDDecorateVC.m in Sources */, 186C9CF12A29DDEB00209BB5 /* DDDynamicPicItemView.m in Sources */, 189391DA2A67E6E000674134 /* BBBackRunningManager.m in Sources */, + 8C2C3F162B27ED7C002C3C34 /* DDUtility+App.m in Sources */, 18D348252A25F3A40011D61C /* DDMyInfoCommonListViewController.m in Sources */, 188EBF6C2A47CEA500060F03 /* DDChatVC.m in Sources */, 188EC14E2A47CF3300060F03 /* HXPhotoEditStickerItemContentView.m in Sources */, @@ -5949,6 +5984,7 @@ 186A88F92A41589D001DE99E /* DDNobleListModel.m in Sources */, 188AF57E2A26FBD7004DD4CF /* DDExchangeCell.m in Sources */, 1848C2282A4D118C0031F734 /* RoomLevelPlaneView.m in Sources */, + 8C2C3F192B27F10D002C3C34 /* DDUtility+Device.m in Sources */, 188EC0E92A47CF3200060F03 /* DDMDeleteCell.m in Sources */, 1894A2D12A58111E0085ADAB /* DDMyRechargeHeaderView.m in Sources */, 188EC1072A47CF3200060F03 /* UIViewController+HXExtension.m in Sources */, @@ -6044,6 +6080,7 @@ 18A7E6882A4E7C250078E659 /* DDDecoratePVC.m in Sources */, 187AE1132A496EAC00B427CB /* RoomConfigModel.m in Sources */, 18660D722A21942F0032D0C9 /* BaseCollectionViewHorizontalLayout.m in Sources */, + 8C2C3F202B2801AC002C3C34 /* DDStatisticsService.m in Sources */, 183864522A28A17B005BF235 /* ZLShowBigImgViewController.m in Sources */, 186EBFC32A40363A005623CC /* XPSemiModalPresentationController.m in Sources */, 1826C6012A24A2FE00A5AFDB /* DDMyInformationViewController.m in Sources */, @@ -6104,6 +6141,7 @@ 18660D442A2193C50032D0C9 /* NSString+Custom.m in Sources */, 18660CC42A2191660032D0C9 /* CYLPlusButtonSubclass.m in Sources */, 1882ADC22A529C17009081FE /* DDEmojiCollCell.m in Sources */, + 8C2C3F1C2B27FE43002C3C34 /* DDUtility+Carrier.m in Sources */, 18C9050B2A233F0600F7CAFD /* DDLunboModel.m in Sources */, 188EBF672A47CEA500060F03 /* DDChatVC+KeyBoardTool.m in Sources */, 187AE10D2A4943C400B427CB /* RoomBlackListCell.m in Sources */, diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDSpriteSheetManager/DDSpriteSheeImagetManager.h b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDSpriteSheetManager/DDSpriteSheeImagetManager.h new file mode 100644 index 0000000..6ef126a --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDSpriteSheetManager/DDSpriteSheeImagetManager.h @@ -0,0 +1,26 @@ +// +// DDSpriteSheetManager.h +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface DDSpriteSheeImagetManager : NSObject + +/// 下载 SpriteSheetImage +/// - Parameters: +/// - url: url +/// - completionBlock: 成功 +/// - failureBlock: 失败 +- (void)dd_loadSpriteSheetImageWithURL:(NSURL *_Nullable)url + completionBlock:(void ( ^ _Nonnull )(YYSpriteSheetImage * _Nullable sprit))completionBlock + failureBlock:(void ( ^ _Nullable)(NSError * _Nullable error))failureBlock; + +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDSpriteSheetManager/DDSpriteSheeImagetManager.m b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDSpriteSheetManager/DDSpriteSheeImagetManager.m new file mode 100644 index 0000000..8f81959 --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDSpriteSheetManager/DDSpriteSheeImagetManager.m @@ -0,0 +1,26 @@ +// +// DDSpriteSheetManager.m +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import "DDSpriteSheeImagetManager.h" + +@interface DDSpriteSheeImagetManager() +@property (nonatomic,strong) YYSpriteSheetImage *sprite; +@property (nonatomic,strong) NSMutableDictionary *parserQueue; +@property (nonatomic,strong) NSMutableDictionary *retryCache; +@property (nonatomic, strong) UIImageView *operationImageView; +@end + +@implementation DDSpriteSheeImagetManager + +/// 下载 SpriteSheetImage +- (void)dd_loadSpriteSheetImageWithURL:(NSURL *)url + completionBlock:(void (^)(YYSpriteSheetImage * _Nullable))completionBlock + failureBlock:(void (^)(NSError * _Nullable))failureBlock { + +} + +@end diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDStatisticsService/DDStatisticsService.h b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDStatisticsService/DDStatisticsService.h new file mode 100644 index 0000000..6b92916 --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDStatisticsService/DDStatisticsService.h @@ -0,0 +1,37 @@ +// +// DDStatisticsService.h +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface DDStatisticsService : NSObject + +/// 埋点数据 不带参数的 +/// @param event key +/// @param describe 描述 ++ (void)DD_TrackEvent:(NSString *)event eventDescribe:(NSString *)describe; + +/// 埋点的 代参数的 +/// @param event key +/// @param describe 描述 +/// @param attributes 参数 ++ (void)DD_TrackEvent:(NSString *)event eventDescribe:(NSString *)describe eventAttributes:(nullable NSDictionary *)attributes; + +/// 统计时长的 开始 +/// @param event key +/// @param describe 描述 ++ (void)DD_TrackEvent:(NSString *)event eventStart:(NSString *)describe; + +/// 统计时长 结束 +/// @param event key +/// @param describe 描述 ++ (void)DD_TrackEvent:(NSString *)event eventEnd:(NSString *)describe; + +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDStatisticsService/DDStatisticsService.m b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDStatisticsService/DDStatisticsService.m new file mode 100644 index 0000000..a190d96 --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDStatisticsService/DDStatisticsService.m @@ -0,0 +1,59 @@ +// +// DDStatisticsService.m +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import "DDStatisticsService.h" +#import + +@implementation DDStatisticsService + +/// 埋点数据 不带参数的 +/// @param event key +/// @param describe 描述 ++ (void)DD_TrackEvent:(NSString *)event eventDescribe:(NSString *)describe { + if (event == nil || event.length == 0) { + return; + } + + [self DD_TrackEvent:event eventDescribe:describe eventAttributes:nil]; +} + +/// 埋点的 代参数的 +/// @param event key +/// @param describe 描述 +/// @param attributes 参数 ++ (void)DD_TrackEvent:(NSString *)event eventDescribe:(NSString *)describe eventAttributes:(nullable NSDictionary *)attributes { + if (event == nil || event.length == 0) { + return; + } + if (attributes.allKeys.count > 0) { + [MobClick event:event attributes:attributes]; + } else { + [MobClick event:event label:describe]; + } +} + +/// 统计时长的 开始 +/// @param event key +/// @param describe 描述 ++ (void)DD_TrackEvent:(NSString *)event eventStart:(NSString *)describe { + if (event == nil || event.length == 0) { + return; + } + [MobClick beginEvent:event label:describe]; +} + +/// 统计时长 结束 +/// @param event key +/// @param describe 描述 ++ (void)DD_TrackEvent:(NSString *)event eventEnd:(NSString *)describe { + if (event == nil || event.length == 0){ + return; + } + [MobClick endEvent:event label:describe]; +} + +@end diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDStatisticsService/DDStatisticsServiceHelper.h b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDStatisticsService/DDStatisticsServiceHelper.h new file mode 100644 index 0000000..1129ff9 --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDStatisticsService/DDStatisticsServiceHelper.h @@ -0,0 +1,134 @@ +// +// DDDD_StatisticsServiceHelper.h +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface DDStatisticsServiceHelper : NSObject + +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventAppLaunch; +#pragma mark - 登录模块的 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventOneClickLoginSuccess; ///一键登录成功 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventLoginPhoneClick;///手机登录 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventLoginQQClick;///QQ登录 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventLoginWXClick;///wx登录 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventLoginRepariSuccess;///注册个人资料保存成功 + +#pragma mark - 贵族 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventVipOpenClick;///开通贵族点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventvipEntranceRoomClick;///贵族房间入口点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventvipEntranceGiftClick;///贵族礼物面板入口点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventvipEntranceFaceClick;///贵族表情面板入口点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventvipEntranceMeClick;///贵族我的页面入口点击 + +#pragma mark - 首页个播tab +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRecent_card_show;///最近在看卡片曝光 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRecent_card_click;///最近在看卡片点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventGebo_tab_click;///个播页二级tab分类点击 + +#pragma mark - 礼物 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoomNugivePopShow; ///房间礼物赠送弹窗曝光 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoomNugivePopClick; ///房间礼物赠送弹窗关闭 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventNugiftPopShow; ///新人专享礼物弹窗曝光(不统计后续个人中心入口的曝光) +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventNugiftPopClick; ///新人专享礼物弹窗充值点击,点击时统计用户所选择的购买档位,(需统计后续个人中心入口的点击) +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventnugift_pop_finish_click; ///新人专享礼物充值成功后弹窗(需统计对应充值tab档位) +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventNugiftPopCloseClick; ///新人专享礼物弹窗关闭点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventUsercenterNugiftPopShow; ///新人专享礼物入口曝光 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventUsercenterNugiftPopClick; ///新人专享礼物入口点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventPersonalshowTopCardShow; ///个播展示卡片曝光 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventPersonalshowTopCardRoomClick; ///个播展示卡片进入房间点击,点击时统计房间id +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventPersonalshowTopCardVoiceClick; ///个播展示卡片播放语音点击 + +#pragma mark - 个人中心 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventusercenter_recharge_card_show; ///个人中心充值卡片曝光 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventusercenter_recharge_card_click; ///个人中心充值卡片点击(跳转充值页) +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventusercenter_noble_card_show; ///个人中心贵族卡片曝光 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventusercenter_noble_card_click;///个人中心贵族卡片片点击(跳转贵族页) +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventusercenter_function_show; ///个人中心功能板块曝光,曝光时统计功能的名称 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventusercenter_function_click; ///个人中心功能板块点击,点击时统计功能的名称 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventusercenter_quick_entry_show; ///个人中心快捷进房曝光,曝光时统计房间的id +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventusercenter_quick_entrysuccess_click; ///个人中心快捷进房点击成功匹配,点击时统计房间的 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventusercenter_quick_entry_click; ///个人中心快捷进房点击未匹配成功,点击时统计房间的id +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventusercenter_banner_show; ///个人中心banner模块曝光,曝光时统计banner的id +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventusercenter_banner_click; ///个人中心banner模块点击,点击时统计banner的id +#pragma mark - 活动任务 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventtask_toast_show; ///任务完成toast曝光 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventtask_toast_click; ///任务完成toast点击(跳转活动页 +#pragma mark - 房间 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventuser_visit_room; ///用户访问房间(进入时统计房间的ID,该房间的停留时长) +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_return_click; ///房间返回按钮点击(右滑返回不统计在内) +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_online_list_click; ///房间在线列表点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_collect_icon_click; ///房间收藏按钮点击(统计收藏房间的ID) +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_more_icon_click; ///房间更多按钮点击(统计用户展开面板后的行为:● 举报房间● 收起房间● 退出房间● 分享房间● 为你推荐(统计用户跳转后的房间ID)) +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_giftlist_click;///房间榜单点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_ranklist_click; ///房间小时榜点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_mike_show; ///房间麦位曝光,只统计该房间在麦上的用户及ID +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_mike_click; ///房间麦位点击,统计用户展开面板后的行为:● 送礼物● 私聊● 关注TA● @TA● 关闭● 资料卡 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_banner_show; ///房间banner曝光,统计曝光banner的ID +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_banner_click; ///房间banner点击,统计点击banner的ID +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_pop_show; ///房间pop曝光,统计曝光pop的名称,如新人充值、糖果树、航海冒险 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_pop_click; ///房间pop点击,统计点击pop的名称,如新人充值、糖果树、航海冒险 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_chatbox_click; ///房间聊天框点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_music_click; ///房间音乐点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_privateletter_click; ///房间私信点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_noble_click; ///房间贵族点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_gift_click; ///房间送礼点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventroom_more_tool_click; ///房间底部更多工具栏点击,统计用户展开面板后的行为 +#pragma mark - 收藏房间列表 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventcollection_editbutton_show; ///管理按钮曝光 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventcollection_editbutton_click; ///管理按钮点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventcollection_editbutton_complete_click; ///完成按钮点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventcollection_entry; ///我的收藏页面访问,统计用户默认落入的tab分类 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventcollection_selectall_click; ///全选按钮点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventcollection_delete_click; ///删除按钮点击 +///许愿礼物 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_wishlist_pop_show; ///礼物心愿气泡曝光 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_wishlist_pop_click; ///礼物心愿气泡点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_wishlist_panel_show; ///礼物心愿面板曝光 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_wishlist_panel_click; ///礼物心愿面板赠送点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_wishlist_panel_close_click; ///礼物心愿面板关闭点击 +#pragma mark - 首页搜索 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_allinsearch_entry_click; ///词条点击-统计点击时对应词条的名称 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_allinsearch_entry_room_click; ///统计点击时对应房间的名称 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_search_input_click; ///统计用户输入搜索框并搜索的内容 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_search_intercept_pop_show; ///统计弹窗奖励内容的名称 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_search_intercept_pop_click; ///搜索劫持结果弹窗关闭 +#pragma mark - 打招呼弹窗 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_sayhi_pop_show; ///打招呼弹窗曝光-统计弹窗主播的id +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_sayhi_pop_find_click; ///打招呼弹窗去找TA点击-统计进房房间的id +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_sayhi_pop_voice_click; ///打招呼弹窗播放声音秀点击 + +#pragma mark - 主播评级 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_grade_profit_pop_click; ///主播评级入口点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_grade_profit_pop_show; ///主播评级入口曝光 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventRoom_grade_profit_close_click; ///主播评级弹窗关闭点击 +#pragma mark - ID复制 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventID_mycenter_copyid_click; +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventID_mydata_copyid_click; ///个人资料页ID复制点击 +UIKIT_EXTERN NSString *const DD_StatisticsServiceEventID_datacard_copyid_click; ///房间资料卡ID复制点击 +/// +/// 埋点事件 +/// @param eventKey key ++ (void)DD_TrackEventWithKey:(NSString *)eventKey; + +/// 埋点事件带参数 +/// @param eventKey key +/// @param eventAttributes 参数 ++ (void)DD_TrackEventWithKey:(NSString *)eventKey eventAttributes:(NSDictionary * _Nullable)eventAttributes; + +/// 统计时长 开始 +/// @param eventKey key ++ (void)DD_TrackEventStartWithKey:(NSString *)eventKey; + +/// 统计时长 结束 +/// @param eventKey key ++ (void)DD_TrackEventEndWithKey:(NSString *)eventKey; + +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDStatisticsService/DDStatisticsServiceHelper.m b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDStatisticsService/DDStatisticsServiceHelper.m new file mode 100644 index 0000000..42679ab --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDStatisticsService/DDStatisticsServiceHelper.m @@ -0,0 +1,158 @@ +// +// DDDD_StatisticsServiceHelper.m +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import "DDStatisticsServiceHelper.h" +#import "DDStatisticsService.h" + +@implementation DDStatisticsServiceHelper +NSString *const DD_StatisticsServiceEventAppLaunch = @"app_launch"; +#pragma mark - 登录模块的 +NSString *const DD_StatisticsServiceEventOneClickLoginSuccess = @"one_click_login_succeed"; +NSString *const DD_StatisticsServiceEventLoginPhoneClick = @"login_phone_click"; +NSString *const DD_StatisticsServiceEventLoginQQClick = @"login_qq_click";///QQ登录 +NSString *const DD_StatisticsServiceEventLoginWXClick = @"login_wx_click";///wx登录 +NSString *const DD_StatisticsServiceEventLoginRepariSuccess = @"login_repari_success";///注册个人资料保存成功 +#pragma mark - 贵族 +NSString *const DD_StatisticsServiceEventVipOpenClick = @"vip_open_click";///开通贵族点击 +NSString *const DD_StatisticsServiceEventvipEntranceRoomClick = @"vip_entrance_room_click";///贵族房间入口点击 +NSString *const DD_StatisticsServiceEventvipEntranceGiftClick = @"vip_entrance_gift_click";///贵族礼物面板入口点击 +NSString *const DD_StatisticsServiceEventvipEntranceFaceClick = @"vip_entrance_face_click";///贵族表情面板入口点击 +NSString *const DD_StatisticsServiceEventvipEntranceMeClick = @"vip_entrance_me_click";///贵族我的页面入口点击 +#pragma mark - 首页直播模块 +NSString *const DD_StatisticsServiceEventRecent_card_show = @"recent_card_show";///最近在看卡片曝光 +NSString *const DD_StatisticsServiceEventRecent_card_click = @"recent_card_click";///最近在看卡片点击 +NSString *const DD_StatisticsServiceEventGebo_tab_click = @"gebo_tab_click";///个播页二级tab分类点击 + +#pragma mark - 礼物 +NSString *const DD_StatisticsServiceEventRoomNugivePopShow = @"room_nugive_pop_show"; ///房间礼物赠送弹窗曝光 +NSString *const DD_StatisticsServiceEventRoomNugivePopClick = @"room_nugive_pop_click"; ///房间礼物赠送弹窗关闭 +NSString *const DD_StatisticsServiceEventNugiftPopShow = @"nugift_pop_show"; ///新人专享礼物弹窗曝光(不统计后续个人中心入口的曝光) +NSString *const DD_StatisticsServiceEventNugiftPopClick = @"nugift_pop_click"; ///新人专享礼物弹窗充值点击,点击时统计用户所选择的购买档位,(需统计后续个人中心入口的点击) +NSString *const DD_StatisticsServiceEventnugift_pop_finish_click = @"nugift_pop_finish_click"; ///新人专享礼物充值成功后弹窗(需统计对应充值tab档位) +NSString *const DD_StatisticsServiceEventNugiftPopCloseClick = @"nugift_pop_close_click"; ///新人专享礼物弹窗关闭点击 +NSString *const DD_StatisticsServiceEventUsercenterNugiftPopShow = @"usercenter_nugift_pop_show"; ///新人专享礼物入口曝光 +NSString *const DD_StatisticsServiceEventUsercenterNugiftPopClick = @"usercenter_nugift_pop_click"; ///新人专享礼物入口点击 +NSString *const DD_StatisticsServiceEventPersonalshowTopCardShow = @"personalshow_top_card_show"; ///个播展示卡片曝光 +NSString *const DD_StatisticsServiceEventPersonalshowTopCardRoomClick = @"personalshow_top_card_room_click"; ///个播展示卡片进入房间点击,点击时统计房间id +NSString *const DD_StatisticsServiceEventPersonalshowTopCardVoiceClick = @"personalshow_top_card_voice_click"; ///个播展示卡片播放语音点击 + +#pragma mark - 个人中心 +NSString *const DD_StatisticsServiceEventusercenter_recharge_card_show = @"usercenter_recharge_card_show"; ///个人中心充值卡片曝光 +NSString *const DD_StatisticsServiceEventusercenter_recharge_card_click = @"usercenter_recharge_card_click"; ///个人中心充值卡片点击(跳转充值页) +NSString *const DD_StatisticsServiceEventusercenter_noble_card_show = @"usercenter_noble_card_show"; ///个人中心贵族卡片曝光 +NSString *const DD_StatisticsServiceEventusercenter_noble_card_click = @"usercenter_noble_card_click";///个人中心贵族卡片片点击(跳转贵族页) +NSString *const DD_StatisticsServiceEventusercenter_function_show = @"usercenter_function_show"; ///个人中心功能板块曝光,曝光时统计功能的名称 +NSString *const DD_StatisticsServiceEventusercenter_function_click = @"usercenter_function_click"; ///个人中心功能板块点击,点击时统计功能的名称 +NSString *const DD_StatisticsServiceEventusercenter_quick_entry_show = @"usercenter_quick_entry_show"; ///个人中心快捷进房曝光,曝光时统计房间的id +NSString *const DD_StatisticsServiceEventusercenter_quick_entrysuccess_click = @"usercenter_quick_entrysuccess_click"; ///个人中心快捷进房点击成功匹配,点击时统计房间的id +NSString *const DD_StatisticsServiceEventusercenter_quick_entry_click = @"usercenter_quick_entry_click"; ///个人中心快捷进房点击未匹配成功,点击时统计房间的id +NSString *const DD_StatisticsServiceEventusercenter_banner_show = @"usercenter_banner_show"; ///个人中心banner模块曝光,曝光时统计banner的id +NSString *const DD_StatisticsServiceEventusercenter_banner_click = @"usercenter_banner_click"; ///个人中心banner模块点击,点击时统计banner的id +#pragma mark - 活动任务 +NSString *const DD_StatisticsServiceEventtask_toast_show = @"task_toast_show"; ///任务完成toast曝光 +NSString *const DD_StatisticsServiceEventtask_toast_click = @"task_toast_click"; ///任务完成toast点击(跳转活动页 +#pragma mark - 房间 +NSString *const DD_StatisticsServiceEventuser_visit_room = @"user_visit_room"; ///用户访问房间(进入时统计房间的ID,该房间的停留时长) +NSString *const DD_StatisticsServiceEventroom_return_click = @"room_return_click"; ///房间返回按钮点击(右滑返回不统计在内) +NSString *const DD_StatisticsServiceEventroom_online_list_click = @"room_online_list_click"; ///房间在线列表点击 +NSString *const DD_StatisticsServiceEventroom_collect_icon_click = @"room_collect_icon_click"; ///房间收藏按钮点击(统计收藏房间的ID) +NSString *const DD_StatisticsServiceEventroom_more_icon_click = @"room_more_icon_click"; ///房间更多按钮点击(统计用户展开面板后的行为:● 举报房间● 收起房间● 退出房间● 分享房间● 为你推荐(统计用户跳转后的房间ID)) +NSString *const DD_StatisticsServiceEventroom_giftlist_click = @"room_giftlist_click"; ///房间榜单点击 +NSString *const DD_StatisticsServiceEventroom_ranklist_click = @"room_ranklist_click"; ///房间小时榜点击 +NSString *const DD_StatisticsServiceEventroom_mike_show = @"room_mike_show"; ///房间麦位曝光,只统计该房间在麦上的用户及ID +NSString *const DD_StatisticsServiceEventroom_mike_click = @"room_mike_click"; ///房间麦位点击,统计用户展开面板后的行为:● 送礼物● 私聊● 关注TA● @TA● 关闭● 资料卡 +NSString *const DD_StatisticsServiceEventroom_banner_show = @"room_banner_show"; ///房间banner曝光,统计曝光banner的ID +NSString *const DD_StatisticsServiceEventroom_banner_click = @"room_banner_click"; ///房间banner点击,统计点击banner的ID +NSString *const DD_StatisticsServiceEventroom_pop_show = @"room_pop_show"; ///房间pop曝光,统计曝光pop的名称,如新人充值、糖果树、航海冒险 +NSString *const DD_StatisticsServiceEventroom_pop_click = @"room_pop_click"; ///房间pop点击,统计点击pop的名称,如新人充值、糖果树、航海冒险 +NSString *const DD_StatisticsServiceEventroom_chatbox_click = @"room_chatbox_click"; ///房间聊天框点击 +NSString *const DD_StatisticsServiceEventroom_music_click = @"room_music_click"; ///房间音乐点击 +NSString *const DD_StatisticsServiceEventroom_privateletter_click = @"room_privateletter_click"; ///房间私信点击 +NSString *const DD_StatisticsServiceEventroom_noble_click = @"room_noble_click"; ///房间贵族点击 +NSString *const DD_StatisticsServiceEventroom_gift_click = @"room_gift_click"; ///房间送礼点击 +NSString *const DD_StatisticsServiceEventroom_more_tool_click = @"room_more_tool_click"; ///房间底部更多工具栏点击,统计用户展开面板后的行为 +#pragma mark - 收藏房间列表 +NSString *const DD_StatisticsServiceEventcollection_editbutton_show = @"collection_editbutton_show"; ///管理按钮曝光 +NSString *const DD_StatisticsServiceEventcollection_editbutton_click = @"collection_editbutton_click"; ///管理按钮点击 +NSString *const DD_StatisticsServiceEventcollection_editbutton_complete_click = @"collection_editbutton_complete_click"; ///完成按钮点击 +NSString *const DD_StatisticsServiceEventcollection_entry = @"collection_entry"; ///我的收藏页面访问,统计用户默认落入的tab分类 +NSString *const DD_StatisticsServiceEventcollection_selectall_click = @"collection_selectall_click"; ///全选按钮点击 +NSString *const DD_StatisticsServiceEventcollection_delete_click = @"collection_delete_click"; ///删除按钮点击 +#pragma mark - 心愿礼物 +NSString *const DD_StatisticsServiceEventRoom_wishlist_pop_show = @"wishlist_pop_show"; ///礼物心愿气泡曝光 +NSString *const DD_StatisticsServiceEventRoom_wishlist_pop_click = @"wishlist_pop_click"; ///礼物心愿气泡点击 +NSString *const DD_StatisticsServiceEventRoom_wishlist_panel_show = @"wishlist_panel_show"; ///礼物心愿面板曝光 +NSString *const DD_StatisticsServiceEventRoom_wishlist_panel_click = @"wishlist_panel_click"; ///礼物心愿面板赠送点击 +NSString *const DD_StatisticsServiceEventRoom_wishlist_panel_close_click = @"wishlist_panel_close_click"; ///礼物心愿面板关闭点击 +#pragma mark - 首页搜索 +NSString *const DD_StatisticsServiceEventRoom_allinsearch_entry_click = @"allinsearch_entry_click"; ///词条点击-统计点击时对应词条的名称 +NSString *const DD_StatisticsServiceEventRoom_allinsearch_entry_room_click = @"allinsearch_entry_room_click"; ///统计点击时对应房间的名称 +NSString *const DD_StatisticsServiceEventRoom_search_input_click = @"search_input_click"; ///统计用户输入搜索框并搜索的内容 +NSString *const DD_StatisticsServiceEventRoom_search_intercept_pop_show = @"search_intercept_pop_show"; ///统计弹窗奖励内容的名称 +NSString *const DD_StatisticsServiceEventRoom_search_intercept_pop_click = @"search_intercept_pop_click"; ///搜索劫持结果弹窗关闭 +#pragma mark - 打招呼弹窗 +NSString *const DD_StatisticsServiceEventRoom_sayhi_pop_show = @"sayhi_pop_show"; ///打招呼弹窗曝光-统计弹窗主播的id +NSString *const DD_StatisticsServiceEventRoom_sayhi_pop_find_click = @"sayhi_pop_find_click"; ///打招呼弹窗去找TA点击-统计进房房间的id +NSString *const DD_StatisticsServiceEventRoom_sayhi_pop_voice_click = @"sayhi_pop_voice_click"; ///打招呼弹窗播放声音秀点击 + +#pragma mark - 主播评级 +NSString *const DD_StatisticsServiceEventRoom_grade_profit_pop_click = @"grade_profit_pop_click"; ///主播评级入口点击 +NSString *const DD_StatisticsServiceEventRoom_grade_profit_pop_show = @"grade_profit_pop_show"; ///主播评级入口曝光 +NSString *const DD_StatisticsServiceEventRoom_grade_profit_close_click = @"grade_profit_close_click"; ///主播评级弹窗关闭点击 + +#pragma mark - ID复制 +NSString *const DD_StatisticsServiceEventID_mycenter_copyid_click = @"mycenter_copyid_click"; ///个人中心ID复制点击 +NSString *const DD_StatisticsServiceEventID_mydata_copyid_click = @"mydata_copyid_click"; ///个人资料页ID复制点击 +NSString *const DD_StatisticsServiceEventID_datacard_copyid_click = @"datacard_copyid_click"; ///房间资料卡ID复制点击 + +/// 埋点事件 +/// @param eventKey key ++ (void)DD_TrackEventWithKey:(NSString *)eventKey { + [self DD_TrackEventWithKey:eventKey eventAttributes:nil]; +} + + +/// 埋点事件带参数 +/// @param eventKey key +/// @param eventAttributes 参数 ++ (void)DD_TrackEventWithKey:(NSString *)eventKey eventAttributes:(NSDictionary * _Nullable)eventAttributes { + [DDStatisticsService DD_TrackEvent:eventKey eventDescribe:[self DD_GetTrackEventDescripWithKey:eventKey] eventAttributes:eventAttributes]; +} + + +/// 统计时长 开始 +/// @param eventKey key ++ (void)DD_TrackEventStartWithKey:(NSString *)eventKey { + [DDStatisticsService DD_TrackEvent:eventKey eventStart:[self DD_GetTrackEventDescripWithKey:eventKey]]; +} + +/// 统计时长 结束 +/// @param eventKey key ++ (void)DD_TrackEventEndWithKey:(NSString *)eventKey { + [DDStatisticsService DD_TrackEvent:eventKey eventEnd:[self DD_GetTrackEventDescripWithKey:eventKey]]; +} + +///埋点 只需要在这个里面 进行相应的配置 即可 key 和descrip ++ (NSString *)DD_GetTrackEventDescripWithKey:(NSString *)key { + NSDictionary * dic = @{ + DD_StatisticsServiceEventAppLaunch:@"应用启动", + DD_StatisticsServiceEventOneClickLoginSuccess:@"一键登录成功", + DD_StatisticsServiceEventLoginPhoneClick:@"手机登录", + DD_StatisticsServiceEventLoginQQClick:@"qq登录", + DD_StatisticsServiceEventLoginWXClick:@"微信登录", + DD_StatisticsServiceEventLoginRepariSuccess:@"注册时候的个人资料保存成功", + DD_StatisticsServiceEventVipOpenClick:@"开通贵族点击", + DD_StatisticsServiceEventvipEntranceRoomClick:@"贵族房间入口点击", + DD_StatisticsServiceEventvipEntranceGiftClick:@"贵族礼物面板入口点击", + DD_StatisticsServiceEventvipEntranceFaceClick:@"贵族表情面板入口点击", + DD_StatisticsServiceEventvipEntranceMeClick:@"贵族我的页面入口点击" + }; + NSString * decription = [dic objectForKey:DD_StatisticsServiceEventAppLaunch]; + return decription; +} + +@end diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDRechability/DDReachability.h b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDRechability/DDReachability.h new file mode 100644 index 0000000..3301ebf --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDRechability/DDReachability.h @@ -0,0 +1,80 @@ +// +// DDReachability.h +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import +#import + +#import +#import +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +#if OS_OBJECT_USE_OBJC +#define NEEDS_DISPATCH_RETAIN_RELEASE 0 +#else +#define NEEDS_DISPATCH_RETAIN_RELEASE 1 +#endif + +#ifndef NS_ENUM +#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type +#endif + +extern NSString *const kDDReachabilityChangedNotification; + +typedef NS_ENUM(NSInteger, DDNetworkStatus) { + // Apple NetworkStatus Compatible Names. + DDNotReachable = 0, + DDReachableViaWiFi = 2, + DDReachableViaWWAN = 1 +}; + +@class DDReachability; + +typedef void (^DDNetworkReachable)(DDReachability * reachability); +typedef void (^DDNetworkUnreachable)(DDReachability * reachability); + +@interface DDReachability : NSObject + +@property (nonatomic, copy) DDNetworkReachable reachableBlock; +@property (nonatomic, copy) DDNetworkUnreachable unreachableBlock; +@property (nonatomic, assign) BOOL reachableOnWWAN; + + ++ (DDReachability*)DD_ReachabilityWithHostname:(NSString*)hostname; ++ (DDReachability*)DD_ReachabilityForInternetConnection; ++ (DDReachability*)DD_ReachabilityWithAddress:(const struct sockaddr_in*)hostAddress; ++ (DDReachability*)DD_ReachabilityForLocalWiFi; + +- (DDReachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref; + +- (BOOL)dd_startNotifier; +- (void)dd_stopNotifier; + +- (BOOL)dd_isReachable; +- (BOOL)dd_isReachableViaWWAN; +- (BOOL)dd_isReachableViaWiFi; + +// WWAN may be available, but not active until a connection has been established. +// WiFi may require a connection for VPN on Demand. +- (BOOL)dd_isConnectionRequired; // Identical DDG variant. +- (BOOL)dd_connectionRequired; // Apple's routine. +// Dynamic, on demand connection? +- (BOOL)dd_isConnectionOnDemand; +// Is user intervention required? +- (BOOL)dd_isInterventionRequired; + +- (NetworkStatus)dd_currentReachabilityStatus; +- (SCNetworkReachabilityFlags)dd_reachabilityFlags; +- (NSString*)dd_currentReachabilityString; +- (NSString*)dd_currentReachabilityFlags; +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYReachability/YYReachability.m b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDRechability/DDReachability.m similarity index 57% rename from yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYReachability/YYReachability.m rename to yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDRechability/DDReachability.m index 0175109..38bc6ab 100644 --- a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYReachability/YYReachability.m +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDRechability/DDReachability.m @@ -1,39 +1,16 @@ -/* - Copyright (c) 2011, Tony Million. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ +// +// DDReachability.m +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// -#import "YYReachability.h" +#import "DDReachability.h" +NSString *const kDDReachabilityChangedNotification = @"kDDReachabilityChangedNotification"; -NSString *const kYYReachabilityChangedNotification = @"kYYReachabilityChangedNotification"; - -@interface YYReachability () - -@property (nonatomic, assign) SCNetworkReachabilityRef reachabilityRef; - +@interface DDReachability() +@property (nonatomic, assign) SCNetworkReachabilityRef reachabilityRef; #if NEEDS_DISPATCH_RETAIN_RELEASE @property (nonatomic, assign) dispatch_queue_t reachabilitySerialQueue; @@ -41,14 +18,14 @@ NSString *const kYYReachabilityChangedNotification = @"kYYReachabilityChangedNot @property (nonatomic, strong) dispatch_queue_t reachabilitySerialQueue; #endif - @property (nonatomic, strong) id reachabilityObject; --(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags; --(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags; +- (void)dd_reachabilityChanged:(SCNetworkReachabilityFlags)flags; +- (BOOL)dd_isReachableWithFlags:(SCNetworkReachabilityFlags)flags; @end + static NSString *reachabilityFlags(SCNetworkReachabilityFlags flags) { return [NSString stringWithFormat:@"%c%c %c%c%c%c%c%c%c", @@ -72,21 +49,20 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea { #pragma unused (target) #if __has_feature(objc_arc) - YYReachability *reachability = ((__bridge YYReachability*)info); + DDReachability *reachability = ((__bridge DDReachability*)info); #else - YYReachability *reachability = ((YYReachability*)info); + DDReachability *reachability = ((DDReachability*)info); #endif // We probably don't need an autoreleasepool here, as GCD docs state each queue has its own autorelease pool, // but what the heck eh? @autoreleasepool { - [reachability reachabilityChanged:flags]; + [reachability dd_reachabilityChanged:flags]; } } - -@implementation YYReachability +@implementation DDReachability @synthesize reachabilityRef; @synthesize reachabilitySerialQueue; @@ -98,33 +74,26 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea @synthesize reachabilityObject; -#pragma mark - Class Constructor Methods -+(YYReachability*)reachabilityWithHostName:(NSString*)hostname -{ - return [YYReachability reachabilityWithHostname:hostname]; -} - -+(YYReachability*)reachabilityWithHostname:(NSString*)hostname -{ +#pragma mark - Public Class Method ++ (DDReachability *)DD_ReachabilityWithHostname:(NSString *)hostname { SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [hostname UTF8String]); if (ref) { id reachability = [[self alloc] initWithReachabilityRef:ref]; - + #if __has_feature(objc_arc) return reachability; #else return [reachability autorelease]; #endif - + } return nil; } -+(YYReachability *)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress -{ ++ (DDReachability *)DD_ReachabilityWithAddress:(const struct sockaddr_in *)hostAddress { SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); if (ref) { @@ -140,85 +109,56 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea return nil; } -+(YYReachability *)reachabilityForInternetConnection -{ ++ (DDReachability *)DD_ReachabilityForInternetConnection { struct sockaddr_in zeroAddress; bzero(&zeroAddress, sizeof(zeroAddress)); zeroAddress.sin_len = sizeof(zeroAddress); zeroAddress.sin_family = AF_INET; - - return [self reachabilityWithAddress:&zeroAddress]; + return [self DD_ReachabilityWithAddress:&zeroAddress]; } -+(YYReachability*)reachabilityForLocalWiFi -{ ++ (DDReachability *)DD_ReachabilityForLocalWiFi { struct sockaddr_in localWifiAddress; bzero(&localWifiAddress, sizeof(localWifiAddress)); localWifiAddress.sin_len = sizeof(localWifiAddress); localWifiAddress.sin_family = AF_INET; // IN_LINKLOCALNETNUM is defined in as 169.254.0.0 localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); - - return [self reachabilityWithAddress:&localWifiAddress]; + return [self DD_ReachabilityWithAddress:&localWifiAddress]; } - -// Initialization methods - --(YYReachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref -{ +#pragma mark - Public Instance Method +- (DDReachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref { self = [super init]; - if (self != nil) - { + if (self != nil) { self.reachableOnWWAN = YES; self.reachabilityRef = ref; } - return self; } --(void)dealloc -{ - [self stopNotifier]; - - if(self.reachabilityRef) - { +- (void)dealloc { + [self dd_stopNotifier]; + if (self.reachabilityRef) { CFRelease(self.reachabilityRef); self.reachabilityRef = nil; } - - self.reachableBlock = nil; - self.unreachableBlock = nil; + self.reachableBlock = nil; + self.unreachableBlock = nil; #if !(__has_feature(objc_arc)) [super dealloc]; #endif - - } + #pragma mark - Notifier Methods - -// Notifier -// NOTE: This uses GCD to trigger the blocks - they *WILL NOT* be called on THE MAIN THREAD -// - In other words DO NOT DO ANY UI UPDATES IN THE BLOCKS. -// INSTEAD USE dispatch_async(dispatch_get_main_queue(), ^{UISTUFF}) (or dispatch_sync if you want) - --(BOOL)startNotifier -{ +- (BOOL)dd_startNotifier { SCNetworkReachabilityContext context = { 0, NULL, NULL, NULL, NULL }; - - // this should do a retain on ourself, so as long as we're in notifier mode we shouldn't disappear out from under ourselves - // woah self.reachabilityObject = self; - - - // First, we need to create a serial queue. - // We allocate this once for the lifetime of the notifier. self.reachabilitySerialQueue = dispatch_queue_create("com.tonymillion.reachability", NULL); - if(!self.reachabilitySerialQueue) - { + if(!self.reachabilitySerialQueue) { return NO; } @@ -228,15 +168,13 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea context.info = (void *)self; #endif - if (!SCNetworkReachabilitySetCallback(self.reachabilityRef, TMReachabilityCallback, &context)) - { + if (!SCNetworkReachabilitySetCallback(self.reachabilityRef, TMReachabilityCallback, &context)) { #ifdef DEBUG NSLog(@"SCNetworkReachabilitySetCallback() failed: %s", SCErrorString(SCError())); #endif // Clear out the dispatch queue - if(self.reachabilitySerialQueue) - { + if(self.reachabilitySerialQueue) { #if NEEDS_DISPATCH_RETAIN_RELEASE dispatch_release(self.reachabilitySerialQueue); #endif @@ -249,8 +187,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea } // Set it as our reachability queue, which will retain the queue - if(!SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, self.reachabilitySerialQueue)) - { + if(!SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, self.reachabilitySerialQueue)) { #ifdef DEBUG NSLog(@"SCNetworkReachabilitySetDispatchQueue() failed: %s", SCErrorString(SCError())); #endif @@ -261,8 +198,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL); // Then clear out the dispatch queue. - if(self.reachabilitySerialQueue) - { + if(self.reachabilitySerialQueue) { #if NEEDS_DISPATCH_RETAIN_RELEASE dispatch_release(self.reachabilitySerialQueue); #endif @@ -277,16 +213,14 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea return YES; } --(void)stopNotifier -{ +- (void)dd_stopNotifier { // First stop, any callbacks! SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL); // Unregister target from the GCD serial dispatch queue. SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, NULL); - if(self.reachabilitySerialQueue) - { + if(self.reachabilitySerialQueue) { #if NEEDS_DISPATCH_RETAIN_RELEASE dispatch_release(self.reachabilitySerialQueue); #endif @@ -298,18 +232,8 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea #pragma mark - reachability tests -// This is for the case where you flick the airplane mode; -// you end up getting something like this: -//Reachability: WR ct----- -//Reachability: -- ------- -//Reachability: WR ct----- -//Reachability: -- ------- -// We treat this as 4 UNREACHABLE triggers - really apple should do better than this - #define testcase (kSCNetworkReachabilityFlagsConnectionRequired | kSCNetworkReachabilityFlagsTransientConnection) - --(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags -{ +- (BOOL)dd_isReachableWithFlags:(SCNetworkReachabilityFlags)flags { BOOL connectionUP = YES; if(!(flags & kSCNetworkReachabilityFlagsReachable)) @@ -319,11 +243,9 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea connectionUP = NO; #if TARGET_OS_IPHONE - if(flags & kSCNetworkReachabilityFlagsIsWWAN) - { + if(flags & kSCNetworkReachabilityFlagsIsWWAN) { // We're on 3G. - if(!self.reachableOnWWAN) - { + if(!self.reachableOnWWAN) { // We don't want to connect when on 3G. connectionUP = NO; } @@ -333,30 +255,25 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea return connectionUP; } --(BOOL)isReachable -{ +- (BOOL)dd_isReachable { SCNetworkReachabilityFlags flags; if(!SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) return NO; - return [self isReachableWithFlags:flags]; + return [self dd_isReachableWithFlags:flags]; } --(BOOL)isReachableViaWWAN -{ +- (BOOL)dd_isReachableViaWWAN { #if TARGET_OS_IPHONE SCNetworkReachabilityFlags flags = 0; - if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { + if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { // Check we're REACHABLE - if(flags & kSCNetworkReachabilityFlagsReachable) - { + if(flags & kSCNetworkReachabilityFlagsReachable) { // Now, check we're on WWAN - if(flags & kSCNetworkReachabilityFlagsIsWWAN) - { + if(flags & kSCNetworkReachabilityFlagsIsWWAN) { return YES; } } @@ -366,19 +283,15 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea return NO; } --(BOOL)isReachableViaWiFi -{ +- (BOOL)dd_isReachableViaWiFi { SCNetworkReachabilityFlags flags = 0; - if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { + if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { // Check we're reachable - if((flags & kSCNetworkReachabilityFlagsReachable)) - { + if((flags & kSCNetworkReachabilityFlagsReachable)) { #if TARGET_OS_IPHONE // Check we're NOT on WWAN - if((flags & kSCNetworkReachabilityFlagsIsWWAN)) - { + if((flags & kSCNetworkReachabilityFlagsIsWWAN)) { return NO; } #endif @@ -389,33 +302,24 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea return NO; } - -// WWAN may be available, but not active until a connection has been established. -// WiFi may require a connection for VPN on Demand. --(BOOL)isConnectionRequired -{ - return [self connectionRequired]; +- (BOOL)dd_isConnectionRequired { + return [self dd_connectionRequired]; } --(BOOL)connectionRequired -{ +- (BOOL)dd_connectionRequired { SCNetworkReachabilityFlags flags; - if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { + if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { return (flags & kSCNetworkReachabilityFlagsConnectionRequired); } return NO; } -// Dynamic, on demand connection? --(BOOL)isConnectionOnDemand -{ +- (BOOL)dd_isConnectionOnDemand { SCNetworkReachabilityFlags flags; - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { + if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) && (flags & (kSCNetworkReachabilityFlagsConnectionOnTraffic | kSCNetworkReachabilityFlagsConnectionOnDemand))); } @@ -423,13 +327,10 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea return NO; } -// Is user intervention required? --(BOOL)isInterventionRequired -{ +- (BOOL)dd_isInterventionRequired { SCNetworkReachabilityFlags flags; - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { + if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) && (flags & kSCNetworkReachabilityFlagsInterventionRequired)); } @@ -437,14 +338,10 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea return NO; } - #pragma mark - reachability status stuff - --(NetworkStatus)currentReachabilityStatus -{ - if([self isReachable]) - { - if([self isReachableViaWiFi]) +- (NetworkStatus)dd_currentReachabilityStatus { + if([self dd_isReachable]) { + if([self dd_isReachableViaWiFi]) return ReachableViaWiFi; #if TARGET_OS_IPHONE @@ -455,73 +352,59 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea return NotReachable; } --(SCNetworkReachabilityFlags)reachabilityFlags -{ +- (SCNetworkReachabilityFlags)dd_reachabilityFlags { SCNetworkReachabilityFlags flags = 0; - if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { + if(SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { return flags; } return 0; } --(NSString*)currentReachabilityString -{ - NetworkStatus temp = [self currentReachabilityStatus]; +- (NSString *)dd_currentReachabilityString { + NetworkStatus temp = [self dd_currentReachabilityStatus]; - if(temp == reachableOnWWAN) - { + if(temp == reachableOnWWAN) { // Updated for the fact that we have CDMA phones now! return NSLocalizedString(@"Cellular", @""); } - if (temp == ReachableViaWiFi) - { + + if (temp == ReachableViaWiFi) { return NSLocalizedString(@"WiFi", @""); } return NSLocalizedString(@"No Connection", @""); } --(NSString*)currentReachabilityFlags -{ - return reachabilityFlags([self reachabilityFlags]); +- (NSString *)dd_currentReachabilityFlags { + return reachabilityFlags([self dd_reachabilityFlags]); } #pragma mark - Callback function calls this method - --(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags -{ - if([self isReachableWithFlags:flags]) - { - if(self.reachableBlock) - { +- (void)dd_reachabilityChanged:(SCNetworkReachabilityFlags)flags { + if([self dd_isReachableWithFlags:flags]) { + if(self.reachableBlock) { self.reachableBlock(self); } - } - else - { - if(self.unreachableBlock) - { + } else { + if(self.unreachableBlock) { self.unreachableBlock(self); } } // this makes sure the change notification happens on the MAIN THREAD dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:kYYReachabilityChangedNotification + [[NSNotificationCenter defaultCenter] postNotificationName:kDDReachabilityChangedNotification object:self]; }); } #pragma mark - Debug Description -- (NSString *) description +- (NSString *)description { - NSString *description = [NSString stringWithFormat:@"<%@: %#x>", - NSStringFromClass([self class]), (unsigned int) self]; - return description; + return [NSString stringWithFormat:@"<%@: %#x>", NSStringFromClass([self class]), (unsigned int)self]; } @end diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDCarrierIdentifier.h b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDCarrierIdentifier.h new file mode 100644 index 0000000..d48643d --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDCarrierIdentifier.h @@ -0,0 +1,17 @@ +// +// DDCarrierIdentifier.h +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import + +typedef NS_ENUM(NSUInteger, DDCarrierIdentifier) { + DD_CarrierIdentifier_Unknown = 0, // 未知, 网络不可用(未插SIM卡/无信号/飞行模式) + DD_CarrierIdentifier_ChinaMobile = 1, // 中国移动 + DD_CarrierIdentifier_ChinaUnicom = 2, // 中国联通 + DD_CarrierIdentifier_ChinaTelecom = 3, // 中国电信 + DD_CarrierIdentifier_Otherwise = 0x0000FFFF, // 其他运营商 +}; + diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+App.h b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+App.h new file mode 100644 index 0000000..e6fe9d5 --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+App.h @@ -0,0 +1,64 @@ +// +// DDUtility+App.h +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import "DDUtility.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface DDUtility (App) +/** + * 从YYMobile-Info.plist中读取字段 + * @param key 键 + * @return 值 + */ ++ (id)DD_ValueInPlistForKey:(NSString *)key; + +/*** 获取App版本号, 从plist从读取CFBundleShortVersion */ ++ (NSString *)DD_AppVersion; + +/*** 获取AppBuild号, 从plist中读取CFBundleVersion */ ++ (NSString *)DD_AppBuild; + +/*** 当前构建出的版本在svn中的版本号 */ ++ (NSString *)DD_SvnVersion; + +/** + 获取appName + @return app的名称 + */ ++ (NSString *)DD_AppName; + +/** + * 获取bundle id + * @return bundle id + */ ++ (NSString *)DD_AppBundleId; + +/*** 获取YYMobileFrameworkRes.bundle的URL */ ++ (NSURL *)DD_URLForMobileFrameworkResourceBundle; + +/*** 获取YYMobileFrameworkRes.bundle的路径 */ ++ (NSString *)DD_PathForMobileFrameworkResourceBundle; + ++ (BOOL)DD_AddSkipBackupAttributeToItemAtURL:(NSURL *)fileURL; + +/** + * 获取当前的构建类型(DEBUG/RELEASE) + * @return 构建类型 + */ ++ (NSString *)DD_BuildType; + +/*** 获取平台渠道 */ ++ (NSString *)DD_GetAppSource; + +/*** 是否来自appstore */ ++ (BOOL)DD_IsFromAppStore; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+App.m b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+App.m new file mode 100644 index 0000000..cfbb545 --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+App.m @@ -0,0 +1,140 @@ +// +// DDUtility+App.m +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import "DDUtility+App.h" + +static NSString * const kMobileFrameworkResourceBundleName = @"YYMobileFrameworkRes"; +static NSString *_from = nil; +@implementation DDUtility (App) + +#pragma mark - Public Method +// 从YYMobile-Info.plist中读取字段 ++ (id)DD_ValueInPlistForKey:(NSString *)key { + NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; + return [infoDictionary objectForKey:key]; +} + +// 获取App版本号 ++ (NSString *)DD_AppVersion { + static NSString *appVersion = nil; + if (!appVersion) { + appVersion = [self DD_ValueInPlistForKey:@"CFBundleShortVersionString"]; + } + return appVersion; +} + +// 获取appName ++ (NSString *)DD_AppName { + return @"yinmeng"; +} + +// 获取AppBuild号 ++ (NSString *)DD_AppBuild { + static NSString *appBuild = nil; + if (!appBuild) { + appBuild = [self DD_ValueInPlistForKey:(NSString *)kCFBundleVersionKey]; + } + return appBuild; +} + +// 获取bundle id ++ (NSString *)DD_AppBundleId { + static NSString *appBundleId = nil; + if (!appBundleId) { + appBundleId = [self DD_ValueInPlistForKey:(NSString *)kCFBundleIdentifierKey]; + } + return appBundleId; +} + + +// 当前构建出的版本在svn中的版本号 ++ (NSString *)DD_SvnVersion { + static NSString *svnVersion = nil; + if (!svnVersion) { + svnVersion = [self DD_ValueInPlistForKey:@"SvnBuildVersion"]; + } + return svnVersion; +} + + +// 获取YYMobileFrameworkRes.bundle的URL ++ (NSURL *)DD_URLForMobileFrameworkResourceBundle { + return [[NSBundle mainBundle] URLForResource:kMobileFrameworkResourceBundleName + withExtension:@"bundle"]; +} + +// 获取YYMobileFrameworkRes.bundle的路 ++ (NSString *)DD_PathForMobileFrameworkResourceBundle { + return [[NSBundle mainBundle] pathForResource:kMobileFrameworkResourceBundleName + ofType:@"bundle"]; +} + +// 获取当前的构建类型(DEBUG/RELEASE) ++ (NSString *)DD_BuildType { +#ifdef DEBUG + return @"DEBUG"; +#else + return @"RELEASE"; +#endif +} + ++ (BOOL)DD_AddSkipBackupAttributeToItemAtURL:(NSURL *)fileURL { + if (![[NSFileManager defaultManager] fileExistsAtPath:[fileURL path]]) { + NSLog(@"File %@ dosen't exist!", fileURL); + return NO; + } + + NSError *error = nil; + BOOL result = [fileURL setResourceValue:[NSNumber numberWithBool:YES] + forKey:NSURLIsExcludedFromBackupKey + error:&error]; + if (!result) { + NSLog(@"Error excluding '%@' from backup, error: %@.", fileURL, error); + } + + return result; +} + +// 获取平台渠道 ++ (NSString *)DD_GetAppSource { + if (_from == nil) { + NSString *path = [[NSBundle mainBundle] pathForResource:@"sourceid.dat" ofType:nil]; + + NSError *error; + NSString *from = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error]; + + // 去除换行及空格 + if (from) { + from = [self dd_removeSpaceAndNewline:from]; + } + // 如果读到有值且不为0 + if (!error + && ![from isEqualToString:@"0"] + && ![from isEqualToString:@""]) { + _from = from; + } else { + _from = @"yinmeng_appstore"; // App Store包 + } + } + + return _from; +} + ++ (BOOL)DD_IsFromAppStore { + return [[[DDUtility DD_GetAppSource] lowercaseString] isEqualToString:@"appstore"]; +} + + +#pragma mark - Private Method ++ (NSString *)dd_removeSpaceAndNewline:(NSString *)str { + NSString *temp = [str stringByReplacingOccurrencesOfString:@" " withString:@""]; + temp = [temp stringByReplacingOccurrencesOfString:@"\r" withString:@""]; + temp = [temp stringByReplacingOccurrencesOfString:@"\n" withString:@""]; + return temp; +} + +@end diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+Carrier.h b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+Carrier.h new file mode 100644 index 0000000..a4dc3c3 --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+Carrier.h @@ -0,0 +1,38 @@ +// +// DDUtility+Carrier.h +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import "DDUtility.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface DDUtility (Carrier) + +/** + 获取设备唯一标识 + @return 唯一标识 + */ ++ (NSString *)DD_DeviceUniqueIdentification; + +/*** 获取运营商 */ ++ (CTCarrier *)DD_Carrier; + +/*** 获取运营商类型 */ ++ (NSInteger)DD_CarrierIdentifier; + +/*** 获取运营商名称 */ ++ (NSString *)DD_CarrierName; + +/** + * 从CTCarrier对象获取网络类型 + * @param carrier - CTCarrier对象 + * @return CarrierType + */ ++ (NSInteger)DD_IdentifierOfCarrier:(CTCarrier *)carrier; + +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+Carrier.m b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+Carrier.m new file mode 100644 index 0000000..e380bbb --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+Carrier.m @@ -0,0 +1,87 @@ +// +// DDUtility+Carrier.m +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import "DDUtility+Carrier.h" +#import +#import +#import "DDCarrierIdentifier.h" +#import + +// MCCs +static NSString * const kMobileCountryCode_China = @"460";// 中国 +// MNCs +static NSSet * kMobileNetworkCodes_ChinaMobile; // 移动 +static NSSet * kMobileNetworkCodes_ChinaUnicom; // 联通 +static NSSet * kMobileNetworkCodes_ChinaTelecom; // 电信 +@implementation DDUtility (Carrier) + +#pragma mark - Super Method ++ (void)load { + if (self == [DDUtility self]) { + kMobileNetworkCodes_ChinaMobile = [NSSet setWithObjects:@"00", @"02", @"07", nil]; // 中国移动 + kMobileNetworkCodes_ChinaUnicom = [NSSet setWithObjects:@"01", @"06", nil]; // 中国联通 + kMobileNetworkCodes_ChinaTelecom = [NSSet setWithObjects:@"03", @"05", nil]; // 中国电信 + } +} + + +#pragma mark - Public Method ++ (CTCarrier *)DD_Carrier { + return [[CTTelephonyNetworkInfo alloc] init].subscriberCellularProvider; +} + ++ (NSString *)DD_CarrierName { + return [self DD_Carrier].carrierName; +} + ++ (NSInteger)DD_CarrierIdentifier { + return [self DD_IdentifierOfCarrier:[self DD_Carrier]]; +} + ++ (NSInteger)DD_IdentifierOfCarrier:(CTCarrier *)carrier { + DDCarrierIdentifier identifier = DD_CarrierIdentifier_Unknown; + do { + if (carrier.mobileCountryCode == nil || carrier.mobileNetworkCode == nil) { + identifier = DD_CarrierIdentifier_Unknown; + break; + } + + if (![carrier.mobileCountryCode isEqualToString:kMobileCountryCode_China]) { + identifier = DD_CarrierIdentifier_Otherwise; + } else { + if ([kMobileNetworkCodes_ChinaMobile containsObject:carrier.mobileNetworkCode]) { + identifier = DD_CarrierIdentifier_ChinaMobile; + break; + } else if ([kMobileNetworkCodes_ChinaUnicom containsObject:carrier.mobileNetworkCode]) { + identifier = DD_CarrierIdentifier_ChinaUnicom; + break; + } else if ([kMobileNetworkCodes_ChinaTelecom containsObject:carrier.mobileNetworkCode]) { + identifier = DD_CarrierIdentifier_ChinaTelecom; + break; + } + } + + } while (0); + + return identifier; +} + + + ++ (NSString *)DD_DeviceUniqueIdentification { + NSString * currentDeviceUUIDStr = [SSKeychain passwordForService:@" " account:@"uuid"]; + if (currentDeviceUUIDStr == nil || [currentDeviceUUIDStr isEqualToString:@""]) { + NSUUID * currentDeviceUUID = [UIDevice currentDevice].identifierForVendor; + currentDeviceUUIDStr = currentDeviceUUID.UUIDString; + currentDeviceUUIDStr = [currentDeviceUUIDStr stringByReplacingOccurrencesOfString:@"-" withString:@""]; + currentDeviceUUIDStr = [currentDeviceUUIDStr lowercaseString]; + [SSKeychain setPassword: currentDeviceUUIDStr forService:@" "account:@"uuid"]; + } + return currentDeviceUUIDStr; +} + +@end diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+Device.h b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+Device.h new file mode 100644 index 0000000..c9847e3 --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+Device.h @@ -0,0 +1,89 @@ +// +// DDUtility+Device.h +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import "DDUtility.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface DDUtility (Device) + +/*** 获取modelName, 如iPhone5,2 */ ++ (NSString *)DD_ModelName; + +/** + 获取设备类型 + @return 设备类型 + */ ++ (NSString*)DD_ModelType; + +/*** 获取系统版本 */ ++ (NSString *)DD_SystemVersion; + +/*** 获取当前设备的 IDFV,IDFV 在某些情况下会变,不建议将其作为设备标识 */ ++ (NSString *)DD_IdentifierForVendor NS_AVAILABLE_IOS(6_0); + +/** + * 获取当前的设备标识,会使用海度 SDK 中的 OpenUDID + * @return 海度 SDK 缓存的 OpenUDID + */ ++ (NSString *)DD_DeviceID; + +/*** 获取当前网络状态 */ ++ (NSInteger)DD_NetworkStatus; + +/*** 获取当前IP地址 */ ++ (NSString *)DD_IPAddress; + +/** + * 获取当前IP地址 + * @param preferIPv4 优先取IPv4的地址 + */ ++ (NSString *)DD_IPAddress:(BOOL)preferIPv4; + +/** + * 检查Camera是否可用, 可用则调用available; 若隐私设置中禁用了本app对相机 + * 的访问, 则调用denied; 否则视为被限制, 调用restriction + * @param available 可用 + * @param denied 不可用 + * @param restriction 受限制 + */ ++ (void)DD_CheckCameraAvailable:(void (^)(void))available denied:(void(^)(void))denied restriction:(void(^)(void))restriction; + +/** + * 检查相册是否可用, 可用则调用available; 若隐私设置中禁用了本app对相册 + * 的访问, 则调用denied; 否则视为被限制, 调用restriction + * @param available 可用 + * @param denied 不可用 + * @param restriction 受限制 + */ ++ (void)DD_CheckAssetsLibrayAvailable:(void (^)(void))available denied:(void(^)(void))denied restriction:(void(^)(void))restriction; + +/** + 检查麦克风权限 + @param resultBlock 结果处理block + */ ++ (void)DD_CheckMicPrivacy:(void(^)(BOOL succeed))resultBlock; + ++ (NSString *)DD_MACAddresss; ++ (NSString *)DD_IDFA; + +/** + * 初始化信令sdk,imsdk所用到的appName + * @return app name + */ ++ (NSString *)DD_AppName; + + +/** + 当前设备是否低于, 等于 iPhone6 + @return 当前设备是否低于, 等于 iPhone6 + */ ++ (BOOL)DD_ISIphone6AndLow; + +@end + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+Device.m b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+Device.m new file mode 100644 index 0000000..839057c --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility+Device.m @@ -0,0 +1,491 @@ +// +// DDUtility+Device.m +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import "DDUtility+Device.h" +#import +#import +#import +#import +#import "DDReachability.h" +#import +#import +#import +#import +#import +#import "DDGCDHelper.h" + +#if !defined(IFT_ETHER) +#define IFT_ETHER 0x6 +#endif + +#define kIOSCellular @"pdp_ip0" +#define kIOSWifi @"en0" +#define kIPAddrV4 @"ipv4" +#define kIPAddrV6 @"ipv6" +#define kAppName @"yym51ip" + +@implementation DDUtility (Device) + +// 获取modelName ++ (NSString *)DD_ModelName { + static NSString *modelName = nil; + if (!modelName) { + struct utsname systemInfo; + uname(&systemInfo); + modelName = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]; + } + return modelName; +} + +// 获取设备类型 ++ (NSString *)DD_SystemVersion { + // 调用非常频繁,主要在cleanSpecialText中 + static NSString* _systemVersion = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _systemVersion = [UIDevice currentDevice].systemVersion;; + }); + + if (_systemVersion) { + return _systemVersion; + } + + return [UIDevice currentDevice].systemVersion; +} + +// 获取当前设备的 IDFV ++ (NSString *)DD_IdentifierForVendor { + static NSString *idfv = nil; + if (!idfv) { + idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; + } + return idfv; +} + +// 获取当前的设备标识,会使用海度 SDK 中的 OpenUDID ++ (NSString *)DD_DeviceID { + NSString *deviceID = @""; + if (!deviceID || deviceID.length == 0) { + deviceID = [DDUtility DD_IdentifierForVendor]; + } + + if (!deviceID) { + deviceID = @""; + } + + return deviceID; +} + +// 获取当前网络状态 ++ (NSInteger)DD_NetworkStatus { + return (self.reachability.dd_currentReachabilityStatus); +} + + +// 检查Camera是否可用, 可用则调用available; +// 若隐私设置中禁用了本app对相机的访问, 则调用denied; 否则视为被限制, 调用restriction ++ (void)DD_CheckCameraAvailable:(void (^)(void))available denied:(void (^)(void))denied restriction:(void (^)(void))restriction { + available = available ? : ^{}; + denied = denied ? : ^{}; + restriction = restriction ? : ^{}; + + if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { + // iOS7下,需要检查iPhone的隐私和访问限制项 + AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; + switch (authStatus) { + case AVAuthorizationStatusAuthorized: { + available(); + break; + } + case AVAuthorizationStatusDenied: { + // [设置->隐私->相机]中禁止了YY访问相机 + denied(); + break; + } + case AVAuthorizationStatusRestricted: { + // NOTE: 这个跟[设置-通用-访问限制]似乎没有关系 + restriction(); + break; + } + case AVAuthorizationStatusNotDetermined: { + [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) { + dd_dispatch_main_sync_safe(^{ + granted ? available() : denied(); + }); + }]; + } + default: + break; + } + } else { + restriction(); + } +} + +// 检查相册是否可用, 可用则调用available; +// 若隐私设置中禁用了本app对相册 的访问, 则调用denied; 否则视为被限制, 调用restriction ++ (void)DD_CheckAssetsLibrayAvailable:(void (^)(void))available denied:(void (^)(void))denied restriction:(void (^)(void))restriction { + available = available ? : ^{}; + denied = denied ? : ^{}; + restriction = restriction ? : ^{}; + + if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary] || + [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum]) { + PHAuthorizationStatus author = [PHPhotoLibrary authorizationStatus]; + if (author == PHAuthorizationStatusNotDetermined) { + + PHFetchResult *collectionArray = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAny options:nil]; + [collectionArray enumerateObjectsUsingBlock:^(PHAssetCollection * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + if (obj == nil) { + denied(); + return; + } + + if (*stop) { + available(); + return; + } + *stop = TRUE; + }]; + + } else if (author == PHAuthorizationStatusDenied) { + denied(); + } else if (author == PHAuthorizationStatusRestricted) { + restriction(); + } else if (author == PHAuthorizationStatusAuthorized) { + available(); + } + } else { + restriction(); + } +} + +// 检查麦克风权限 ++ (void)DD_CheckMicPrivacy:(void (^)(BOOL))resultBlock { + [[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) { + if (resultBlock) { + dispatch_async(dispatch_get_main_queue(), ^{ + resultBlock(granted); + }); + } + }]; +} + +// 获取当前IP地址 ++ (NSString *)DD_IPAddress { + return [self DD_IPAddress:YES]; +} + +// 获取当前IP地址 ++ (NSString *)DD_IPAddress:(BOOL)preferIPv4 { + NSArray *searchArray = preferIPv4 ? + @[ kIOSWifi @"/" kIPAddrV4, kIOSWifi @"/" kIPAddrV6, kIOSCellular @"/" kIPAddrV4, kIOSCellular @"/" kIPAddrV6 ] : + @[ kIOSWifi @"/" kIPAddrV6, kIOSWifi @"/" kIPAddrV4, kIOSCellular @"/" kIPAddrV6, kIOSCellular @"/" kIPAddrV4 ] ; + + NSDictionary *addresses = [self DD_GetIPAddresses]; + + __block NSString *addr; + [searchArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + addr = addresses[obj]; + if (addr) { + *stop = YES; + } + }]; + return addr ? : @"0.0.0.0"; +} + + ++ (NSString *)DD_MACAddresss { + static NSMutableString *macAddress = nil; + + if ([macAddress length] > 0) { + return macAddress; + } + + do { + struct ifaddrs* addrs; + if ( getifaddrs( &addrs ) ) break; + + const struct ifaddrs *cursor = addrs; + while ( cursor ) { + if ( ( cursor->ifa_addr->sa_family == AF_LINK ) + && strcmp( "en0", cursor->ifa_name ) == 0 + && ( ( ( const struct sockaddr_dl * )cursor->ifa_addr)->sdl_type == IFT_ETHER ) ) { + const struct sockaddr_dl *dlAddr = ( const struct sockaddr_dl * )cursor->ifa_addr; + const uint8_t *base = ( const uint8_t * )&dlAddr->sdl_data[dlAddr->sdl_nlen]; + + macAddress = [[NSMutableString alloc] initWithCapacity:64]; + + for ( int i = 0; i < dlAddr->sdl_alen; i++ ) { + if (i > 0) { + [macAddress appendFormat:@":%02X", base[i]]; + } else { + [macAddress appendFormat:@"%02X", base[i]]; + } + } + + break; + } + cursor = cursor->ifa_next; + } + freeifaddrs(addrs); + } while (NO); + + if (macAddress == nil) { + macAddress = [NSMutableString stringWithString:@""]; + } + + return macAddress; +} + ++ (NSString *)DD_IDFA { + static NSString *idfa = nil; + if (!idfa) { + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0) { + idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; + } else { + idfa = @""; + } + } + return idfa; +} + ++ (NSString *)DD_ModelType { + struct utsname systemInfo; + + uname(&systemInfo); + + NSString*platform = [NSString stringWithCString: systemInfo.machine encoding:NSASCIIStringEncoding]; + + if([platform isEqualToString:@"iPhone1,1"])return@"iPhone 2G"; + + if([platform isEqualToString:@"iPhone1,2"])return@"iPhone 3G"; + + if([platform isEqualToString:@"iPhone2,1"])return@"iPhone 3GS"; + + if([platform isEqualToString:@"iPhone3,1"])return@"iPhone 4"; + + if([platform isEqualToString:@"iPhone3,2"])return@"iPhone 4"; + + if([platform isEqualToString:@"iPhone3,3"])return@"iPhone 4"; + + if([platform isEqualToString:@"iPhone4,1"])return@"iPhone 4S"; + + if([platform isEqualToString:@"iPhone5,1"])return@"iPhone 5"; + + if([platform isEqualToString:@"iPhone5,2"])return@"iPhone 5"; + + if([platform isEqualToString:@"iPhone5,3"])return@"iPhone 5c"; + + if([platform isEqualToString:@"iPhone5,4"])return@"iPhone 5c"; + + if([platform isEqualToString:@"iPhone6,1"])return@"iPhone 5s"; + + if([platform isEqualToString:@"iPhone6,2"])return@"iPhone 5s"; + + if([platform isEqualToString:@"iPhone7,1"])return@"iPhone 6 Plus"; + + if([platform isEqualToString:@"iPhone7,2"])return@"iPhone 6"; + + if([platform isEqualToString:@"iPhone8,1"])return@"iPhone 6s"; + + if([platform isEqualToString:@"iPhone8,2"])return@"iPhone 6s Plus"; + + if([platform isEqualToString:@"iPhone8,4"])return@"iPhone SE"; + + if([platform isEqualToString:@"iPhone9,1"])return@"iPhone 7"; + + if([platform isEqualToString:@"iPhone9,2"])return@"iPhone 7 Plus"; + + if([platform isEqualToString:@"iPhone10,1"])return@"iPhone 8"; + + if([platform isEqualToString:@"iPhone10,4"])return@"iPhone 8"; + + if([platform isEqualToString:@"iPhone10,2"])return@"iPhone 8 Plus"; + + if([platform isEqualToString:@"iPhone10,5"])return@"iPhone 8 Plus"; + + if([platform isEqualToString:@"iPhone10,3"])return@"iPhone X"; + + if([platform isEqualToString:@"iPhone10,6"])return@"iPhone X"; + + if([platform isEqualToString:@"iPod1,1"])return@"iPod Touch 1G"; + + if([platform isEqualToString:@"iPod2,1"])return@"iPod Touch 2G"; + + if([platform isEqualToString:@"iPod3,1"])return@"iPod Touch 3G"; + + if([platform isEqualToString:@"iPod4,1"])return@"iPod Touch 4G"; + + if([platform isEqualToString:@"iPod5,1"])return@"iPod Touch 5G"; + + if([platform isEqualToString:@"iPad1,1"])return@"iPad 1G"; + + if([platform isEqualToString:@"iPad2,1"])return@"iPad 2"; + + if([platform isEqualToString:@"iPad2,2"])return@"iPad 2"; + + if([platform isEqualToString:@"iPad2,3"])return@"iPad 2"; + + if([platform isEqualToString:@"iPad2,4"])return@"iPad 2"; + + if([platform isEqualToString:@"iPad2,5"])return@"iPad Mini 1G"; + + if([platform isEqualToString:@"iPad2,6"])return@"iPad Mini 1G"; + + if([platform isEqualToString:@"iPad2,7"])return@"iPad Mini 1G"; + + if([platform isEqualToString:@"iPad3,1"])return@"iPad 3"; + + if([platform isEqualToString:@"iPad3,2"])return@"iPad 3"; + + if([platform isEqualToString:@"iPad3,3"])return@"iPad 3"; + + if([platform isEqualToString:@"iPad3,4"])return@"iPad 4"; + + if([platform isEqualToString:@"iPad3,5"])return@"iPad 4"; + + if([platform isEqualToString:@"iPad3,6"])return@"iPad 4"; + + if([platform isEqualToString:@"iPad4,1"])return@"iPad Air"; + + if([platform isEqualToString:@"iPad4,2"])return@"iPad Air"; + + if([platform isEqualToString:@"iPad4,3"])return@"iPad Air"; + + if([platform isEqualToString:@"iPad4,4"])return@"iPad Mini 2G"; + + if([platform isEqualToString:@"iPad4,5"])return@"iPad Mini 2G"; + + if([platform isEqualToString:@"iPad4,6"])return@"iPad Mini 2G"; + + if([platform isEqualToString:@"iPad4,7"])return@"iPad Mini 3"; + + if([platform isEqualToString:@"iPad4,8"])return@"iPad Mini 3"; + + if([platform isEqualToString:@"iPad4,9"])return@"iPad Mini 3"; + + if([platform isEqualToString:@"iPad5,1"])return@"iPad Mini 4"; + + if([platform isEqualToString:@"iPad5,2"])return@"iPad Mini 4"; + + if([platform isEqualToString:@"iPad5,3"])return@"iPad Air 2"; + + if([platform isEqualToString:@"iPad5,4"])return@"iPad Air 2"; + + if([platform isEqualToString:@"iPad6,3"])return@"iPad Pro 9.7"; + + if([platform isEqualToString:@"iPad6,4"])return@"iPad Pro 9.7"; + + if([platform isEqualToString:@"iPad6,7"])return@"iPad Pro 12.9"; + + if([platform isEqualToString:@"iPad6,8"])return@"iPad Pro 12.9"; + + if([platform isEqualToString:@"i386"])return@"iPhone Simulator"; + + if([platform isEqualToString:@"x86_64"])return@"iPhone Simulator"; + + return platform; +} + ++ (BOOL)DD_ISIphone6AndLow { + struct utsname systemInfo; + + uname(&systemInfo); + + NSString*platform = [NSString stringWithCString: systemInfo.machine encoding:NSASCIIStringEncoding]; + if([platform isEqualToString:@"iPhone1,1"])return YES; + + if([platform isEqualToString:@"iPhone1,2"])return YES; + + if([platform isEqualToString:@"iPhone2,1"])return YES; + + if([platform isEqualToString:@"iPhone3,1"])return YES; + + if([platform isEqualToString:@"iPhone3,2"])return YES; + + if([platform isEqualToString:@"iPhone3,3"])return YES; + + if([platform isEqualToString:@"iPhone4,1"])return YES; + + if([platform isEqualToString:@"iPhone5,1"])return YES; + + if([platform isEqualToString:@"iPhone5,2"])return YES; + + if([platform isEqualToString:@"iPhone5,3"])return YES; + + if([platform isEqualToString:@"iPhone5,4"])return YES; + + if([platform isEqualToString:@"iPhone6,1"])return YES; + + if([platform isEqualToString:@"iPhone6,2"])return YES; + + if([platform isEqualToString:@"iPhone7,1"])return YES; + + if([platform isEqualToString:@"iPhone7,2"])return YES; + + if ([platform isEqualToString:@"iPhone8,1"]) return YES; + + if ([platform isEqualToString:@"iPhone8,3"]) return YES; + + if ([platform isEqualToString:@"iPhone8,4"]) return YES; + + if ([platform isEqualToString:@"iPhone9,1"]) return YES; + + if ([platform isEqualToString:@"iPhone9,3"]) return YES; + + return NO; +} + + +#pragma mark - Private Method ++ (DDReachability *)reachability { + static DDReachability *reachability = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + reachability = [DDReachability DD_ReachabilityForInternetConnection]; + }); + return reachability; +} + ++ (NSDictionary *)DD_GetIPAddresses { + NSMutableDictionary *addresses = [NSMutableDictionary dictionary]; + struct ifaddrs *interfaces; + if (!getifaddrs(&interfaces)) { + // Loop through linked list of interfaces + struct ifaddrs *interface; + for (interface = interfaces; interface; interface = interface->ifa_next) { + if (!(interface -> ifa_flags & IFF_UP)) { + continue; + } + const struct sockaddr_in *addr = (const struct sockaddr_in *)interface->ifa_addr; + char addrBuf[MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) + 2]; + if (addr && (addr->sin_family == AF_INET || addr->sin_family == AF_INET6)) { + NSString *ifaName = [NSString stringWithUTF8String:interface->ifa_name]; + NSString *ifaType; + if (addr->sin_family == AF_INET) { + if (inet_ntop(AF_INET, &addr->sin_addr, addrBuf, INET_ADDRSTRLEN)) { + ifaType = kIPAddrV4; + } + } else { + const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)interface->ifa_addr; + if (inet_ntop(AF_INET6, &addr6->sin6_addr, addrBuf, INET6_ADDRSTRLEN)) { + ifaType = kIPAddrV6; + } + } + if (ifaType) { + NSString *key = [NSString stringWithFormat:@"%@/%@", ifaName, ifaType]; + addresses[key] = [NSString stringWithUTF8String:addrBuf]; + } + } + } + } + // free memory + freeifaddrs(interfaces); + return addresses; +} +@end diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility.h b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility.h new file mode 100644 index 0000000..3619bf5 --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility.h @@ -0,0 +1,21 @@ +// +// DDUtility.h +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import + +@class CTCarrier; + +NS_ASSUME_NONNULL_BEGIN + +@interface DDUtility : NSObject + + +@end + + + +NS_ASSUME_NONNULL_END diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility.m b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility.m new file mode 100644 index 0000000..7069407 --- /dev/null +++ b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/DDUtility/DDUtility.m @@ -0,0 +1,12 @@ +// +// DDUtility.m +// DingDangApp +// +// Created by 触海 on 2023/12/11. +// + +#import "DDUtility.h" + +@implementation DDUtility + +@end diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/SSKeyChain/SSKeychain.h b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/SSKeyChain/SSKeychain.h deleted file mode 100644 index ae58c84..0000000 --- a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/SSKeyChain/SSKeychain.h +++ /dev/null @@ -1,357 +0,0 @@ -// -// SSKeychain.h -// SSToolkit -// -// Created by Sam Soffes on 5/19/10. -// Copyright (c) 2009-2011 Sam Soffes. All rights reserved. -// - -#import -#import - -/** Error codes that can be returned in NSError objects. */ -typedef enum { - /** No error. */ - SSKeychainErrorNone = noErr, - - /** Some of the arguments were invalid. */ - SSKeychainErrorBadArguments = -1001, - - /** There was no password. */ - SSKeychainErrorNoPassword = -1002, - - /** One or more parameters passed internally were not valid. */ - SSKeychainErrorInvalidParameter = errSecParam, - - /** Failed to allocate memory. */ - SSKeychainErrorFailedToAllocated = errSecAllocate, - - /** No trust results are available. */ - SSKeychainErrorNotAvailable = errSecNotAvailable, - - /** Authorization/Authentication failed. */ - SSKeychainErrorAuthorizationFailed = errSecAuthFailed, - - /** The item already exists. */ - SSKeychainErrorDuplicatedItem = errSecDuplicateItem, - - /** The item cannot be found.*/ - SSKeychainErrorNotFound = errSecItemNotFound, - - /** Interaction with the Security Server is not allowed. */ - SSKeychainErrorInteractionNotAllowed = errSecInteractionNotAllowed, - - /** Unable to decode the provided data. */ - SSKeychainErrorFailedToDecode = errSecDecode -} SSKeychainErrorCode; - -extern NSString *const kSSKeychainErrorDomain; - -/** Account name. */ -extern NSString *const kSSKeychainAccountKey; - -/** - Time the item was created. - - The value will be a string. - */ -extern NSString *const kSSKeychainCreatedAtKey; - -/** Item class. */ -extern NSString *const kSSKeychainClassKey; - -/** Item description. */ -extern NSString *const kSSKeychainDescriptionKey; - -/** Item label. */ -extern NSString *const kSSKeychainLabelKey; - -/** Time the item was last modified. - - The value will be a string. - */ -extern NSString *const kSSKeychainLastModifiedKey; - -/** Where the item was created. */ -extern NSString *const kSSKeychainWhereKey; - -/** - Simple wrapper for accessing accounts, getting passwords, setting passwords, and deleting passwords using the system - Keychain on Mac OS X and iOS. - - This was originally inspired by EMKeychain and SDKeychain (both of which are now gone). Thanks to the authors. - SSKeychain has since switched to a simpler implementation that was abstracted from [SSToolkit](http://sstoolk.it). - */ -@interface SSKeychain : NSObject - -///----------------------- -/// @name Getting Accounts -///----------------------- - -/** - Returns an array containing the Keychain's accounts, or `nil` if the Keychain has no accounts. - - See the `NSString` constants declared in SSKeychain.h for a list of keys that can be used when accessing the - dictionaries returned by this method. - - @return An array of dictionaries containing the Keychain's accounts, or `nil` if the Keychain doesn't have any - accounts. The order of the objects in the array isn't defined. - - @see allAccounts: - */ -+ (NSArray *)allAccounts; - -/** - Returns an array containing the Keychain's accounts, or `nil` if the Keychain doesn't have any - accounts. - - See the `NSString` constants declared in SSKeychain.h for a list of keys that can be used when accessing the - dictionaries returned by this method. - - @param error If accessing the accounts fails, upon return contains an error that describes the problem. - - @return An array of dictionaries containing the Keychain's accounts, or `nil` if the Keychain doesn't have any - accounts. The order of the objects in the array isn't defined. - - @see allAccounts - */ -+ (NSArray *)allAccounts:(NSError **)error; - -/** - Returns an array containing the Keychain's accounts for a given service, or `nil` if the Keychain doesn't have any - accounts for the given service. - - See the `NSString` constants declared in SSKeychain.h for a list of keys that can be used when accessing the - dictionaries returned by this method. - - @param serviceName The service for which to return the corresponding accounts. - - @return An array of dictionaries containing the Keychain's accountsfor a given `serviceName`, or `nil` if the Keychain - doesn't have any accounts for the given `serviceName`. The order of the objects in the array isn't defined. - - @see accountsForService:error: - */ -+ (NSArray *)accountsForService:(NSString *)serviceName; - -/** - Returns an array containing the Keychain's accounts for a given service, or `nil` if the Keychain doesn't have any - accounts for the given service. - - @param serviceName The service for which to return the corresponding accounts. - - @param error If accessing the accounts fails, upon return contains an error that describes the problem. - - @return An array of dictionaries containing the Keychain's accountsfor a given `serviceName`, or `nil` if the Keychain - doesn't have any accounts for the given `serviceName`. The order of the objects in the array isn't defined. - - @see accountsForService: - */ -+ (NSArray *)accountsForService:(NSString *)serviceName error:(NSError **)error; - - -///------------------------ -/// @name Getting Passwords -///------------------------ - -/** - Returns a string containing the password for a given account and service, or `nil` if the Keychain doesn't have a - password for the given parameters. - - @param serviceName The service for which to return the corresponding password. - - @param account The account for which to return the corresponding password. - - @return Returns a string containing the password for a given account and service, or `nil` if the Keychain doesn't - have a password for the given parameters. - - @see passwordForService:account:error: - */ -+ (NSString *)passwordForService:(NSString *)serviceName account:(NSString *)account; - -/** - Returns a string containing the password for a given account and service, or `nil` if the Keychain doesn't have a - password for the given parameters. - - @param serviceName The service for which to return the corresponding password. - - @param account The account for which to return the corresponding password. - - @param error If accessing the password fails, upon return contains an error that describes the problem. - - @return Returns a string containing the password for a given account and service, or `nil` if the Keychain doesn't - have a password for the given parameters. - - @see passwordForService:account: - */ -+ (NSString *)passwordForService:(NSString *)serviceName account:(NSString *)account error:(NSError **)error; - -/** - Returns the password data for a given account and service, or `nil` if the Keychain doesn't have data - for the given parameters. - - @param serviceName The service for which to return the corresponding password. - - @param account The account for which to return the corresponding password. - - @param error If accessing the password fails, upon return contains an error that describes the problem. - - @return Returns a the password data for the given account and service, or `nil` if the Keychain doesn't - have data for the given parameters. - - @see passwordDataForService:account:error: - */ -+ (NSData *)passwordDataForService:(NSString *)serviceName account:(NSString *)account; - -/** - Returns the password data for a given account and service, or `nil` if the Keychain doesn't have data - for the given parameters. - - @param serviceName The service for which to return the corresponding password. - - @param account The account for which to return the corresponding password. - - @param error If accessing the password fails, upon return contains an error that describes the problem. - - @return Returns a the password data for the given account and service, or `nil` if the Keychain doesn't - have a password for the given parameters. - - @see passwordDataForService:account: - */ -+ (NSData *)passwordDataForService:(NSString *)serviceName account:(NSString *)account error:(NSError **)error; - - -///------------------------- -/// @name Deleting Passwords -///------------------------- - -/** - Deletes a password from the Keychain. - - @param serviceName The service for which to delete the corresponding password. - - @param account The account for which to delete the corresponding password. - - @return Returns `YES` on success, or `NO` on failure. - - @see deletePasswordForService:account:error: - */ -+ (BOOL)deletePasswordForService:(NSString *)serviceName account:(NSString *)account; - -/** - Deletes a password from the Keychain. - - @param serviceName The service for which to delete the corresponding password. - - @param account The account for which to delete the corresponding password. - - @param error If deleting the password fails, upon return contains an error that describes the problem. - - @return Returns `YES` on success, or `NO` on failure. - - @see deletePasswordForService:account: - */ -+ (BOOL)deletePasswordForService:(NSString *)serviceName account:(NSString *)account error:(NSError **)error; - - -///------------------------ -/// @name Setting Passwords -///------------------------ - -/** - Sets a password in the Keychain. - - @param password The password to store in the Keychain. - - @param serviceName The service for which to set the corresponding password. - - @param account The account for which to set the corresponding password. - - @return Returns `YES` on success, or `NO` on failure. - - @see setPassword:forService:account:error: - */ -+ (BOOL)setPassword:(NSString *)password forService:(NSString *)serviceName account:(NSString *)account; - -/** - Sets a password in the Keychain. - - @param password The password to store in the Keychain. - - @param serviceName The service for which to set the corresponding password. - - @param account The account for which to set the corresponding password. - - @param error If setting the password fails, upon return contains an error that describes the problem. - - @return Returns `YES` on success, or `NO` on failure. - - @see setPassword:forService:account: - */ -+ (BOOL)setPassword:(NSString *)password forService:(NSString *)serviceName account:(NSString *)account error:(NSError **)error; - -/** - Sets arbirary data in the Keychain. - - @param password The data to store in the Keychain. - - @param serviceName The service for which to set the corresponding password. - - @param account The account for which to set the corresponding password. - - @param error If setting the password fails, upon return contains an error that describes the problem. - - @return Returns `YES` on success, or `NO` on failure. - - @see setPasswordData:forService:account:error: - */ -+ (BOOL)setPasswordData:(NSData *)password forService:(NSString *)serviceName account:(NSString *)account; - -/** - Sets arbirary data in the Keychain. - - @param password The data to store in the Keychain. - - @param serviceName The service for which to set the corresponding password. - - @param account The account for which to set the corresponding password. - - @param error If setting the password fails, upon return contains an error that describes the problem. - - @return Returns `YES` on success, or `NO` on failure. - - @see setPasswordData:forService:account: - */ -+ (BOOL)setPasswordData:(NSData *)password forService:(NSString *)serviceName account:(NSString *)account error:(NSError **)error; - - -///-------------------- -/// @name Configuration -///-------------------- - -#if __IPHONE_4_0 && TARGET_OS_IPHONE -/** - Returns the accessibility type for all future passwords saved to the Keychain. - - @return Returns the accessibility type. - - The return value will be `NULL` or one of the "Keychain Item Accessibility Constants" used for determining when a - keychain item should be readable. - - @see accessibilityType - */ -+ (CFTypeRef)accessibilityType; - -/** - Sets the accessibility type for all future passwords saved to the Keychain. - - @param accessibilityType One of the "Keychain Item Accessibility Constants" used for determining when a keychain item - should be readable. - - If the value is `NULL` (the default), the Keychain default will be used. - - @see accessibilityType - */ -+ (void)setAccessibilityType:(CFTypeRef)accessibilityType; -#endif - -@end diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/SSKeyChain/SSKeychain.m b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/SSKeyChain/SSKeychain.m deleted file mode 100644 index 703a4be..0000000 --- a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/SSKeyChain/SSKeychain.m +++ /dev/null @@ -1,262 +0,0 @@ -// -// SSKeychain.m -// SSToolkit -// -// Created by Sam Soffes on 5/19/10. -// Copyright (c) 2009-2011 Sam Soffes. All rights reserved. -// - -#import "SSKeychain.h" - -NSString *const kSSKeychainErrorDomain = @"com.samsoffes.sskeychain"; - -NSString *const kSSKeychainAccountKey = @"acct"; -NSString *const kSSKeychainCreatedAtKey = @"cdat"; -NSString *const kSSKeychainClassKey = @"labl"; -NSString *const kSSKeychainDescriptionKey = @"desc"; -NSString *const kSSKeychainLabelKey = @"labl"; -NSString *const kSSKeychainLastModifiedKey = @"mdat"; -NSString *const kSSKeychainWhereKey = @"svce"; - -#if __IPHONE_4_0 && TARGET_OS_IPHONE -CFTypeRef SSKeychainAccessibilityType = NULL; -#endif - -@interface SSKeychain () -+ (NSMutableDictionary *)_queryForService:(NSString *)service account:(NSString *)account; -@end - -@implementation SSKeychain - -#pragma mark - Getting Accounts - -+ (NSArray *)allAccounts { - return [self accountsForService:nil error:nil]; -} - - -+ (NSArray *)allAccounts:(NSError **)error { - return [self accountsForService:nil error:error]; -} - - -+ (NSArray *)accountsForService:(NSString *)service { - return [self accountsForService:service error:nil]; -} - - -+ (NSArray *)accountsForService:(NSString *)service error:(NSError **)error { - OSStatus status = SSKeychainErrorBadArguments; - NSMutableDictionary *query = [self _queryForService:service account:nil]; -#if __has_feature(objc_arc) - [query setObject:(__bridge id)kCFBooleanTrue forKey:(__bridge id)kSecReturnAttributes]; - [query setObject:(__bridge id)kSecMatchLimitAll forKey:(__bridge id)kSecMatchLimit]; -#else - [query setObject:(id)kCFBooleanTrue forKey:(id)kSecReturnAttributes]; - [query setObject:(id)kSecMatchLimitAll forKey:(id)kSecMatchLimit]; -#endif - - CFTypeRef result = NULL; -#if __has_feature(objc_arc) - status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &result); -#else - status = SecItemCopyMatching((CFDictionaryRef)query, &result); -#endif - if (status != noErr && error != NULL) { - *error = [NSError errorWithDomain:kSSKeychainErrorDomain code:status userInfo:nil]; - return nil; - } - -#if __has_feature(objc_arc) - return (__bridge_transfer NSArray *)result; -#else - return [(NSArray *)result autorelease]; -#endif -} - - -#pragma mark - Getting Passwords - -+ (NSString *)passwordForService:(NSString *)service account:(NSString *)account { - return [self passwordForService:service account:account error:nil]; -} - - -+ (NSString *)passwordForService:(NSString *)service account:(NSString *)account error:(NSError **)error { - NSData *data = [self passwordDataForService:service account:account error:error]; - if (data.length > 0) { - NSString *string = [[NSString alloc] initWithData:(NSData *)data encoding:NSUTF8StringEncoding]; -#if !__has_feature(objc_arc) - [string autorelease]; -#endif - return string; - } - - return nil; -} - - -+ (NSData *)passwordDataForService:(NSString *)service account:(NSString *)account { - return [self passwordDataForService:service account:account error:nil]; -} - - -+ (NSData *)passwordDataForService:(NSString *)service account:(NSString *)account error:(NSError **)error { - OSStatus status = SSKeychainErrorBadArguments; - if (!service || !account) { - if (error) { - *error = [NSError errorWithDomain:kSSKeychainErrorDomain code:status userInfo:nil]; - } - return nil; - } - - CFTypeRef result = NULL; - NSMutableDictionary *query = [self _queryForService:service account:account]; -#if __has_feature(objc_arc) - [query setObject:(__bridge id)kCFBooleanTrue forKey:(__bridge id)kSecReturnData]; - [query setObject:(__bridge id)kSecMatchLimitOne forKey:(__bridge id)kSecMatchLimit]; - status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &result); -#else - [query setObject:(id)kCFBooleanTrue forKey:(id)kSecReturnData]; - [query setObject:(id)kSecMatchLimitOne forKey:(id)kSecMatchLimit]; - status = SecItemCopyMatching((CFDictionaryRef)query, &result); -#endif - - if (status != noErr && error != NULL) { - *error = [NSError errorWithDomain:kSSKeychainErrorDomain code:status userInfo:nil]; - return nil; - } - -#if __has_feature(objc_arc) - return (__bridge_transfer NSData *)result; -#else - return [(NSData *)result autorelease]; -#endif -} - - -#pragma mark - Deleting Passwords - -+ (BOOL)deletePasswordForService:(NSString *)service account:(NSString *)account { - return [self deletePasswordForService:service account:account error:nil]; -} - - -+ (BOOL)deletePasswordForService:(NSString *)service account:(NSString *)account error:(NSError **)error { - OSStatus status = SSKeychainErrorBadArguments; - if (service && account) { - NSMutableDictionary *query = [self _queryForService:service account:account]; -#if __has_feature(objc_arc) - status = SecItemDelete((__bridge CFDictionaryRef)query); -#else - status = SecItemDelete((CFDictionaryRef)query); -#endif - } - if (status != noErr && error != NULL) { - *error = [NSError errorWithDomain:kSSKeychainErrorDomain code:status userInfo:nil]; - } - return (status == noErr); - -} - - -#pragma mark - Setting Passwords - -+ (BOOL)setPassword:(NSString *)password forService:(NSString *)service account:(NSString *)account { - return [self setPassword:password forService:service account:account error:nil]; -} - - -+ (BOOL)setPassword:(NSString *)password forService:(NSString *)service account:(NSString *)account error:(NSError **)error { - NSData *data = [password dataUsingEncoding:NSUTF8StringEncoding]; - return [self setPasswordData:data forService:service account:account error:error]; -} - - -+ (BOOL)setPasswordData:(NSData *)password forService:(NSString *)service account:(NSString *)account { - return [self setPasswordData:password forService:service account:account error:nil]; -} - - -+ (BOOL)setPasswordData:(NSData *)password forService:(NSString *)service account:(NSString *)account error:(NSError **)error { - OSStatus status = SSKeychainErrorBadArguments; - if (password && service && account) { - [self deletePasswordForService:service account:account]; - NSMutableDictionary *query = [self _queryForService:service account:account]; -#if __has_feature(objc_arc) - [query setObject:password forKey:(__bridge id)kSecValueData]; -#else - [query setObject:password forKey:(id)kSecValueData]; -#endif - -#if __IPHONE_4_0 && TARGET_OS_IPHONE - if (SSKeychainAccessibilityType) { -#if __has_feature(objc_arc) - [query setObject:(id)[self accessibilityType] forKey:(__bridge id)kSecAttrAccessible]; -#else - [query setObject:(id)[self accessibilityType] forKey:(id)kSecAttrAccessible]; -#endif - } -#endif - -#if __has_feature(objc_arc) - status = SecItemAdd((__bridge CFDictionaryRef)query, NULL); -#else - status = SecItemAdd((CFDictionaryRef)query, NULL); -#endif - } - if (status != noErr && error != NULL) { - *error = [NSError errorWithDomain:kSSKeychainErrorDomain code:status userInfo:nil]; - } - return (status == noErr); -} - - -#pragma mark - Configuration - -#if __IPHONE_4_0 && TARGET_OS_IPHONE -+ (CFTypeRef)accessibilityType { - return SSKeychainAccessibilityType; -} - - -+ (void)setAccessibilityType:(CFTypeRef)accessibilityType { - CFRetain(accessibilityType); - if (SSKeychainAccessibilityType) { - CFRelease(SSKeychainAccessibilityType); - } - SSKeychainAccessibilityType = accessibilityType; -} -#endif - - -#pragma mark - Private - -+ (NSMutableDictionary *)_queryForService:(NSString *)service account:(NSString *)account { - NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:3]; -#if __has_feature(objc_arc) - [dictionary setObject:(__bridge id)kSecClassGenericPassword forKey:(__bridge id)kSecClass]; -#else - [dictionary setObject:(id)kSecClassGenericPassword forKey:(id)kSecClass]; -#endif - - if (service) { -#if __has_feature(objc_arc) - [dictionary setObject:service forKey:(__bridge id)kSecAttrService]; -#else - [dictionary setObject:service forKey:(id)kSecAttrService]; -#endif - } - - if (account) { -#if __has_feature(objc_arc) - [dictionary setObject:account forKey:(__bridge id)kSecAttrAccount]; -#else - [dictionary setObject:account forKey:(id)kSecAttrAccount]; -#endif - } - - return dictionary; -} - -@end diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYReachability/YYReachability.h b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYReachability/YYReachability.h deleted file mode 100644 index 23aea63..0000000 --- a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYReachability/YYReachability.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - Copyright (c) 2011, Tony Million. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ - -#import -#import - -#import -#import -#import -#import -#import -#import - -/** - * Does ARC support GCD objects? - * It does if the minimum deployment target is iOS 6+ or Mac OS X 8+ - * - * @see http://opensource.apple.com/source/libdispatch/libdispatch-228.18/os/object.h - **/ -#if OS_OBJECT_USE_OBJC -#define NEEDS_DISPATCH_RETAIN_RELEASE 0 -#else -#define NEEDS_DISPATCH_RETAIN_RELEASE 1 -#endif - -/** - * Create NS_ENUM macro if it does not exist on the targeted version of iOS or OS X. - * - * @see http://nshipster.com/ns_enum-ns_options/ - **/ -#ifndef NS_ENUM -#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type -#endif - -extern NSString *const kYYReachabilityChangedNotification; - -typedef NS_ENUM(NSInteger, NetworkStatus) { - // Apple NetworkStatus Compatible Names. - NotReachable = 0, - ReachableViaWiFi = 2, - ReachableViaWWAN = 1 -}; - -@class YYReachability; - -typedef void (^NetworkReachable)(YYReachability * reachability); -typedef void (^NetworkUnreachable)(YYReachability * reachability); - -@interface YYReachability : NSObject - -@property (nonatomic, copy) NetworkReachable reachableBlock; -@property (nonatomic, copy) NetworkUnreachable unreachableBlock; - - -@property (nonatomic, assign) BOOL reachableOnWWAN; - -+(YYReachability*)reachabilityWithHostname:(NSString*)hostname; -+(YYReachability*)reachabilityForInternetConnection; -+(YYReachability*)reachabilityWithAddress:(const struct sockaddr_in*)hostAddress; -+(YYReachability*)reachabilityForLocalWiFi; - --(YYReachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref; - --(BOOL)startNotifier; --(void)stopNotifier; - --(BOOL)isReachable; --(BOOL)isReachableViaWWAN; --(BOOL)isReachableViaWiFi; - -// WWAN may be available, but not active until a connection has been established. -// WiFi may require a connection for VPN on Demand. --(BOOL)isConnectionRequired; // Identical DDG variant. --(BOOL)connectionRequired; // Apple's routine. -// Dynamic, on demand connection? --(BOOL)isConnectionOnDemand; -// Is user intervention required? --(BOOL)isInterventionRequired; - --(NetworkStatus)currentReachabilityStatus; --(SCNetworkReachabilityFlags)reachabilityFlags; --(NSString*)currentReachabilityString; --(NSString*)currentReachabilityFlags; - -@end diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYUtility/CarrierIdentifier.h b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYUtility/CarrierIdentifier.h deleted file mode 100644 index 4a30388..0000000 --- a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYUtility/CarrierIdentifier.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// CarrierIdentifier.h -// YYMobileFramework -// -// Created by wuwei on 14-5-30. -// Copyright (c) 2014年 YY Inc. All rights reserved. -// - -#import - -// 运营商类型 -typedef NS_ENUM(NSUInteger, CarrierIdentifier) -{ - CarrierIdentifier_Unknown = 0, // 未知, 网络不可用(未插SIM卡/无信号/飞行模式) - - CarrierIdentifier_ChinaMobile = 1, // 中国移动 - CarrierIdentifier_ChinaUnicom = 2, // 中国联通 - CarrierIdentifier_ChinaTelecom = 3, // 中国电信 - - CarrierIdentifier_Otherwise = 0x0000FFFF, // 其他运营商 -}; diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYUtility/YYUtility.h b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYUtility/YYUtility.h deleted file mode 100644 index 8024549..0000000 --- a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYUtility/YYUtility.h +++ /dev/null @@ -1,225 +0,0 @@ -// -// YYUtility.h -// YYMobileFramework -// -// Created by wuwei on 14/6/11. -// Copyright (c) 2014年 YY.inc. All rights reserved. -// - -#import - -@class CTCarrier; - -@interface YYUtility : NSObject - -@end - -/*==============================*/ -/* App Utilities */ -/*==============================*/ -@interface YYUtility (App) - -/** - * 从YYMobile-Info.plist中读取字段 - * - * @param key 键 - * - * @return 值 - */ -+ (id)valueInPlistForKey:(NSString *)key; - -/** - * 获取App版本号, 从plist从读取CFBundleShortVersion - */ -+ (NSString *)appVersion; - -/** - * 获取AppBuild号, 从plist中读取CFBundleVersion - */ -+ (NSString *)appBuild; - -/** - * 当前构建出的版本在svn中的版本号 - */ -+ (NSString *)svnVersion; - -/** - 获取appName - - @return app的名称 - */ -+ (NSString *)appName; - -/** - * 获取bundle id - * - * @return bundle id - */ -+ (NSString *)appBundleId; - -/** - * 获取YYMobileFrameworkRes.bundle的URL - */ -+ (NSURL *)URLForMobileFrameworkResourceBundle; - -/** - * 获取YYMobileFrameworkRes.bundle的路径 - */ -+ (NSString *)pathForMobileFrameworkResourceBundle; - -+ (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)fileURL; - -/** - * 获取当前的构建类型(DEBUG/RELEASE) - * - * @return 构建类型 - */ -+ (NSString *)buildType; - -/** - * 获取平台渠道 - */ -+ (NSString *)getAppSource; - -/** - * 是否来自appstore - */ -+ (BOOL)isFromAppStore; - -@end - -/*==============================*/ -/* Carrier Utilities */ -/*==============================*/ -@interface YYUtility (Carrier) - - -/** - 获取设备唯一标识 - - @return 唯一标识 - */ -+ (NSString *)deviceUniqueIdentification; - -/** - * 获取运营商 - */ -+ (CTCarrier *)carrier; - -/** - * 获取运营商类型 - */ -+ (NSInteger)carrierIdentifier; - -/** - * 获取运营商名称 - */ -+ (NSString *)carrierName; - -/** - * 从CTCarrier对象获取网络类型 - * @param carrier - CTCarrier对象 - * @return CarrierType - */ -+ (NSInteger)identifierOfCarrier:(CTCarrier *)carrier; - -@end - -/*==============================*/ -/* Device Utilities */ -/*==============================*/ -@interface YYUtility (Device) - -/** - * 获取modelName, 如iPhone5,2 - */ -+ (NSString *)modelName; - - -/** - 获取设备类型 - - @return 设备类型 - */ -+ (NSString*)modelType; - -/** - * 获取系统版本 - */ -+ (NSString *)systemVersion; - -/** - * 获取当前设备的 IDFV,IDFV 在某些情况下会变,不建议将其作为设备标识 - */ -+ (NSString *)identifierForVendor NS_AVAILABLE_IOS(6_0); - -/** - * 获取当前的设备标识,会使用海度 SDK 中的 OpenUDID - * - * @return 海度 SDK 缓存的 OpenUDID - */ -+ (NSString *)deviceID; - -/** - * 获取当前网络状态 - */ -+ (NSInteger)networkStatus; - -/** - * 获取当前IP地址 - */ -+ (NSString *)ipAddress; - -/** - * 获取当前IP地址 - * - * @param preferIPv4 优先取IPv4的地址 - */ -+ (NSString *)ipAddress:(BOOL)preferIPv4; - -/** - * 检查Camera是否可用, 可用则调用available; 若隐私设置中禁用了本app对相机 - * 的访问, 则调用denied; 否则视为被限制, 调用restriction - * - * @param available 可用 - * @param denied 不可用 - * @param restriction 受限制 - */ -+ (void)checkCameraAvailable:(void (^)(void))available denied:(void(^)(void))denied restriction:(void(^)(void))restriction; - -/** - * 检查相册是否可用, 可用则调用available; 若隐私设置中禁用了本app对相册 - * 的访问, 则调用denied; 否则视为被限制, 调用restriction - * - * @param available 可用 - * @param denied 不可用 - * @param restriction 受限制 - */ -+ (void)checkAssetsLibrayAvailable:(void (^)(void))available denied:(void(^)(void))denied restriction:(void(^)(void))restriction; - -/** - 检查麦克风权限 - - @param resultBlock 结果处理block - */ -+ (void)checkMicPrivacy:(void(^)(BOOL succeed))resultBlock; - -+ (NSString *)macAddresss; -+ (NSString *)idfa; - -/** - * 初始化信令sdk,imsdk所用到的appName - * - * @return app name - */ -+ (NSString *)appName; - - -/** - 当前设备是否低于, 等于 iPhone6 - - @return 当前设备是否低于, 等于 iPhone6 - */ -+ (BOOL)isIphone6AndLow; - -@end diff --git a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYUtility/YYUtility.m b/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYUtility/YYUtility.m deleted file mode 100644 index 2f91c12..0000000 --- a/yinmeng-ios/DingDangApp/YingMeng/DDBaseCompilation/DDBaseTool/DDThirdTool/YYUtility/YYUtility.m +++ /dev/null @@ -1,13 +0,0 @@ -// -// YYUtility.m -// YYMobileFramework -// -// Created by wuwei on 14-5-30. -// Copyright (c) 2014年 YY Inc. All rights reserved. -// - -#import "YYUtility.h" - -@implementation YYUtility - -@end