├── DingDingPod.podspec ├── DingDingPod.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── wangrongchao.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── wangrongchao.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── DingDingPod ├── Config │ ├── DDConfig.h │ └── DDConfig.m ├── DingDingPod.h ├── DingDingPod.m ├── Headers │ ├── DDRedPacketHeader.h │ └── DDRevokeMessageHeader.h ├── Info.plist └── Setting │ ├── DDEditorTableViewCell.h │ ├── DDEditorTableViewCell.m │ ├── DDGoNextTableViewCell.h │ ├── DDGoNextTableViewCell.m │ ├── DDSwitchTableViewCell.h │ ├── DDSwitchTableViewCell.m │ ├── DDViewController.h │ ├── DDViewController.m │ ├── DDWindow.h │ └── DDWindow.m ├── README.md └── snaptshop.png /DingDingPod.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |spec| 2 | spec.name = "DingDingPod" #Pod的名字 3 | spec.version = "1.1.0" #版本号 4 | spec.summary = "A example pod for DingDingPod" 5 | spec.description = <<-DESC #Pod的描述 6 | - A example pod for DingDingPod 7 | DESC 8 | 9 | spec.homepage = "https://github.com/AloneMonkey/MonkeyDevPod" #Pod的地址 10 | 11 | spec.license = { :type => "BSD", :file => "LICENSE" } #License 12 | spec.author = { "Justin.Wang" => "wangrongchao@126.com" } #作者 13 | spec.social_media_url = "http://weibo.com/xiaoqing28" #weibo 14 | spec.platform = :ios, "8.0" #平台、版本 15 | spec.source = { :git => "https://github.com/WJustin/DingDingPod.git", :tag => spec.version.to_s } #代码的git地址以及tag 16 | spec.source_files = "DingDingPod/**/*.{h,m}" #本地验证,表示当前目录以及子目录的所有h或m结尾的文件 如果发布到MonkeyPodSpecs需要填写git clone下来的对应的路径 17 | spec.public_header_files = "DingDingPod/DingDingPod.h" #需要对外导出的头文件 此处为本地验证 18 | spec.requires_arc = true #ARC 19 | spec.pod_target_xcconfig = { "ONLY_ACTIVE_ARCH" => "NO", "HEADER_SEARCH_PATHS" => "/opt/MonkeyDev/include" } #这个必须有,不要修改 20 | end -------------------------------------------------------------------------------- /DingDingPod.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BA146BB3202C226A00D7C13B /* DingDingPod.m in Sources */ = {isa = PBXBuildFile; fileRef = BA146BB2202C226A00D7C13B /* DingDingPod.m */; }; 11 | BA146BB7202C226A00D7C13B /* DingDingPod.h in Headers */ = {isa = PBXBuildFile; fileRef = BA146BB1202C226A00D7C13B /* DingDingPod.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | BA146BC1202C241600D7C13B /* DDRevokeMessageHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = BA146BC0202C241600D7C13B /* DDRevokeMessageHeader.h */; }; 13 | BA146BC5202C244E00D7C13B /* DDConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = BA146BC3202C244E00D7C13B /* DDConfig.h */; }; 14 | BA146BC6202C244E00D7C13B /* DDConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = BA146BC4202C244E00D7C13B /* DDConfig.m */; }; 15 | BA146BCA202C249800D7C13B /* DDViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BA146BC8202C249800D7C13B /* DDViewController.h */; }; 16 | BA146BCB202C249800D7C13B /* DDViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BA146BC9202C249800D7C13B /* DDViewController.m */; }; 17 | BA146BCE202C24FA00D7C13B /* DDWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = BA146BCC202C24FA00D7C13B /* DDWindow.h */; }; 18 | BA146BCF202C24FA00D7C13B /* DDWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = BA146BCD202C24FA00D7C13B /* DDWindow.m */; }; 19 | BA146BD1202C27A400D7C13B /* DDRedPacketHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = BA146BD0202C27A400D7C13B /* DDRedPacketHeader.h */; }; 20 | BA146BD4202C2A3B00D7C13B /* DDSwitchTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = BA146BD2202C2A3B00D7C13B /* DDSwitchTableViewCell.h */; }; 21 | BA146BD5202C2A3B00D7C13B /* DDSwitchTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BA146BD3202C2A3B00D7C13B /* DDSwitchTableViewCell.m */; }; 22 | BA146BD8202C2AD500D7C13B /* DDEditorTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = BA146BD6202C2AD500D7C13B /* DDEditorTableViewCell.h */; }; 23 | BA146BD9202C2AD500D7C13B /* DDEditorTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BA146BD7202C2AD500D7C13B /* DDEditorTableViewCell.m */; }; 24 | BA146BE0202C38D700D7C13B /* DDGoNextTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = BA146BDE202C38D700D7C13B /* DDGoNextTableViewCell.h */; }; 25 | BA146BE1202C38D700D7C13B /* DDGoNextTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BA146BDF202C38D700D7C13B /* DDGoNextTableViewCell.m */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | BA146BAE202C226A00D7C13B /* DingDingPod.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DingDingPod.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | BA146BB1202C226A00D7C13B /* DingDingPod.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DingDingPod.h; sourceTree = ""; }; 31 | BA146BB2202C226A00D7C13B /* DingDingPod.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DingDingPod.m; sourceTree = ""; }; 32 | BA146BB6202C226A00D7C13B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | BA146BC0202C241600D7C13B /* DDRevokeMessageHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDRevokeMessageHeader.h; sourceTree = ""; }; 34 | BA146BC3202C244E00D7C13B /* DDConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDConfig.h; sourceTree = ""; }; 35 | BA146BC4202C244E00D7C13B /* DDConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDConfig.m; sourceTree = ""; }; 36 | BA146BC8202C249800D7C13B /* DDViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDViewController.h; sourceTree = ""; }; 37 | BA146BC9202C249800D7C13B /* DDViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDViewController.m; sourceTree = ""; }; 38 | BA146BCC202C24FA00D7C13B /* DDWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDWindow.h; sourceTree = ""; }; 39 | BA146BCD202C24FA00D7C13B /* DDWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDWindow.m; sourceTree = ""; }; 40 | BA146BD0202C27A400D7C13B /* DDRedPacketHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDRedPacketHeader.h; sourceTree = ""; }; 41 | BA146BD2202C2A3B00D7C13B /* DDSwitchTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDSwitchTableViewCell.h; sourceTree = ""; }; 42 | BA146BD3202C2A3B00D7C13B /* DDSwitchTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDSwitchTableViewCell.m; sourceTree = ""; }; 43 | BA146BD6202C2AD500D7C13B /* DDEditorTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDEditorTableViewCell.h; sourceTree = ""; }; 44 | BA146BD7202C2AD500D7C13B /* DDEditorTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDEditorTableViewCell.m; sourceTree = ""; }; 45 | BA146BDE202C38D700D7C13B /* DDGoNextTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DDGoNextTableViewCell.h; sourceTree = ""; }; 46 | BA146BDF202C38D700D7C13B /* DDGoNextTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DDGoNextTableViewCell.m; sourceTree = ""; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | BA146BAA202C226A00D7C13B /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | ); 55 | runOnlyForDeploymentPostprocessing = 0; 56 | }; 57 | /* End PBXFrameworksBuildPhase section */ 58 | 59 | /* Begin PBXGroup section */ 60 | BA146BA4202C226A00D7C13B = { 61 | isa = PBXGroup; 62 | children = ( 63 | BA146BB0202C226A00D7C13B /* DingDingPod */, 64 | BA146BAF202C226A00D7C13B /* Products */, 65 | ); 66 | sourceTree = ""; 67 | }; 68 | BA146BAF202C226A00D7C13B /* Products */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | BA146BAE202C226A00D7C13B /* DingDingPod.framework */, 72 | ); 73 | name = Products; 74 | sourceTree = ""; 75 | }; 76 | BA146BB0202C226A00D7C13B /* DingDingPod */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | BA146BC7202C247600D7C13B /* Setting */, 80 | BA146BC2202C242300D7C13B /* Config */, 81 | BA146BBF202C23FB00D7C13B /* Headers */, 82 | BA146BB1202C226A00D7C13B /* DingDingPod.h */, 83 | BA146BB2202C226A00D7C13B /* DingDingPod.m */, 84 | BA146BB6202C226A00D7C13B /* Info.plist */, 85 | ); 86 | path = DingDingPod; 87 | sourceTree = ""; 88 | }; 89 | BA146BBF202C23FB00D7C13B /* Headers */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | BA146BC0202C241600D7C13B /* DDRevokeMessageHeader.h */, 93 | BA146BD0202C27A400D7C13B /* DDRedPacketHeader.h */, 94 | ); 95 | path = Headers; 96 | sourceTree = ""; 97 | }; 98 | BA146BC2202C242300D7C13B /* Config */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | BA146BC3202C244E00D7C13B /* DDConfig.h */, 102 | BA146BC4202C244E00D7C13B /* DDConfig.m */, 103 | ); 104 | path = Config; 105 | sourceTree = ""; 106 | }; 107 | BA146BC7202C247600D7C13B /* Setting */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | BA146BC8202C249800D7C13B /* DDViewController.h */, 111 | BA146BC9202C249800D7C13B /* DDViewController.m */, 112 | BA146BCC202C24FA00D7C13B /* DDWindow.h */, 113 | BA146BCD202C24FA00D7C13B /* DDWindow.m */, 114 | BA146BD2202C2A3B00D7C13B /* DDSwitchTableViewCell.h */, 115 | BA146BD3202C2A3B00D7C13B /* DDSwitchTableViewCell.m */, 116 | BA146BD6202C2AD500D7C13B /* DDEditorTableViewCell.h */, 117 | BA146BD7202C2AD500D7C13B /* DDEditorTableViewCell.m */, 118 | BA146BDE202C38D700D7C13B /* DDGoNextTableViewCell.h */, 119 | BA146BDF202C38D700D7C13B /* DDGoNextTableViewCell.m */, 120 | ); 121 | path = Setting; 122 | sourceTree = ""; 123 | }; 124 | /* End PBXGroup section */ 125 | 126 | /* Begin PBXHeadersBuildPhase section */ 127 | BA146BAB202C226A00D7C13B /* Headers */ = { 128 | isa = PBXHeadersBuildPhase; 129 | buildActionMask = 2147483647; 130 | files = ( 131 | BA146BD4202C2A3B00D7C13B /* DDSwitchTableViewCell.h in Headers */, 132 | BA146BE0202C38D700D7C13B /* DDGoNextTableViewCell.h in Headers */, 133 | BA146BB7202C226A00D7C13B /* DingDingPod.h in Headers */, 134 | BA146BD1202C27A400D7C13B /* DDRedPacketHeader.h in Headers */, 135 | BA146BC1202C241600D7C13B /* DDRevokeMessageHeader.h in Headers */, 136 | BA146BC5202C244E00D7C13B /* DDConfig.h in Headers */, 137 | BA146BCE202C24FA00D7C13B /* DDWindow.h in Headers */, 138 | BA146BCA202C249800D7C13B /* DDViewController.h in Headers */, 139 | BA146BD8202C2AD500D7C13B /* DDEditorTableViewCell.h in Headers */, 140 | ); 141 | runOnlyForDeploymentPostprocessing = 0; 142 | }; 143 | /* End PBXHeadersBuildPhase section */ 144 | 145 | /* Begin PBXNativeTarget section */ 146 | BA146BAD202C226A00D7C13B /* DingDingPod */ = { 147 | isa = PBXNativeTarget; 148 | buildConfigurationList = BA146BBA202C226A00D7C13B /* Build configuration list for PBXNativeTarget "DingDingPod" */; 149 | buildPhases = ( 150 | BA146BA9202C226A00D7C13B /* Sources */, 151 | BA146BAA202C226A00D7C13B /* Frameworks */, 152 | BA146BAB202C226A00D7C13B /* Headers */, 153 | BA146BAC202C226A00D7C13B /* Resources */, 154 | ); 155 | buildRules = ( 156 | ); 157 | dependencies = ( 158 | ); 159 | name = DingDingPod; 160 | productName = DingDingPod; 161 | productReference = BA146BAE202C226A00D7C13B /* DingDingPod.framework */; 162 | productType = "com.apple.product-type.framework"; 163 | }; 164 | /* End PBXNativeTarget section */ 165 | 166 | /* Begin PBXProject section */ 167 | BA146BA5202C226A00D7C13B /* Project object */ = { 168 | isa = PBXProject; 169 | attributes = { 170 | LastUpgradeCheck = 0920; 171 | ORGANIZATIONNAME = Justin.wang; 172 | TargetAttributes = { 173 | BA146BAD202C226A00D7C13B = { 174 | CreatedOnToolsVersion = 9.2; 175 | ProvisioningStyle = Automatic; 176 | }; 177 | }; 178 | }; 179 | buildConfigurationList = BA146BA8202C226A00D7C13B /* Build configuration list for PBXProject "DingDingPod" */; 180 | compatibilityVersion = "Xcode 8.0"; 181 | developmentRegion = en; 182 | hasScannedForEncodings = 0; 183 | knownRegions = ( 184 | en, 185 | ); 186 | mainGroup = BA146BA4202C226A00D7C13B; 187 | productRefGroup = BA146BAF202C226A00D7C13B /* Products */; 188 | projectDirPath = ""; 189 | projectRoot = ""; 190 | targets = ( 191 | BA146BAD202C226A00D7C13B /* DingDingPod */, 192 | ); 193 | }; 194 | /* End PBXProject section */ 195 | 196 | /* Begin PBXResourcesBuildPhase section */ 197 | BA146BAC202C226A00D7C13B /* Resources */ = { 198 | isa = PBXResourcesBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | }; 204 | /* End PBXResourcesBuildPhase section */ 205 | 206 | /* Begin PBXSourcesBuildPhase section */ 207 | BA146BA9202C226A00D7C13B /* Sources */ = { 208 | isa = PBXSourcesBuildPhase; 209 | buildActionMask = 2147483647; 210 | files = ( 211 | BA146BE1202C38D700D7C13B /* DDGoNextTableViewCell.m in Sources */, 212 | BA146BB3202C226A00D7C13B /* DingDingPod.m in Sources */, 213 | BA146BCF202C24FA00D7C13B /* DDWindow.m in Sources */, 214 | BA146BD9202C2AD500D7C13B /* DDEditorTableViewCell.m in Sources */, 215 | BA146BCB202C249800D7C13B /* DDViewController.m in Sources */, 216 | BA146BD5202C2A3B00D7C13B /* DDSwitchTableViewCell.m in Sources */, 217 | BA146BC6202C244E00D7C13B /* DDConfig.m in Sources */, 218 | ); 219 | runOnlyForDeploymentPostprocessing = 0; 220 | }; 221 | /* End PBXSourcesBuildPhase section */ 222 | 223 | /* Begin XCBuildConfiguration section */ 224 | BA146BB8202C226A00D7C13B /* Debug */ = { 225 | isa = XCBuildConfiguration; 226 | buildSettings = { 227 | ALWAYS_SEARCH_USER_PATHS = NO; 228 | CLANG_ANALYZER_NONNULL = YES; 229 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 230 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 231 | CLANG_CXX_LIBRARY = "libc++"; 232 | CLANG_ENABLE_MODULES = YES; 233 | CLANG_ENABLE_OBJC_ARC = YES; 234 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 235 | CLANG_WARN_BOOL_CONVERSION = YES; 236 | CLANG_WARN_COMMA = YES; 237 | CLANG_WARN_CONSTANT_CONVERSION = YES; 238 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 239 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 240 | CLANG_WARN_EMPTY_BODY = YES; 241 | CLANG_WARN_ENUM_CONVERSION = YES; 242 | CLANG_WARN_INFINITE_RECURSION = YES; 243 | CLANG_WARN_INT_CONVERSION = YES; 244 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 245 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 246 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 247 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 248 | CLANG_WARN_STRICT_PROTOTYPES = YES; 249 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 250 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 251 | CLANG_WARN_UNREACHABLE_CODE = YES; 252 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 253 | CODE_SIGN_IDENTITY = "iPhone Developer"; 254 | COPY_PHASE_STRIP = NO; 255 | CURRENT_PROJECT_VERSION = 1; 256 | DEBUG_INFORMATION_FORMAT = dwarf; 257 | ENABLE_STRICT_OBJC_MSGSEND = YES; 258 | ENABLE_TESTABILITY = YES; 259 | GCC_C_LANGUAGE_STANDARD = gnu11; 260 | GCC_DYNAMIC_NO_PIC = NO; 261 | GCC_NO_COMMON_BLOCKS = YES; 262 | GCC_OPTIMIZATION_LEVEL = 0; 263 | GCC_PREPROCESSOR_DEFINITIONS = ( 264 | "DEBUG=1", 265 | "$(inherited)", 266 | ); 267 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 268 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 269 | GCC_WARN_UNDECLARED_SELECTOR = YES; 270 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 271 | GCC_WARN_UNUSED_FUNCTION = YES; 272 | GCC_WARN_UNUSED_VARIABLE = YES; 273 | HEADER_SEARCH_PATHS = ( 274 | "$(inherited)", 275 | "$(MonkeyDevPath)/include", 276 | ); 277 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 278 | MTL_ENABLE_DEBUG_INFO = YES; 279 | MonkeyDevPath = /opt/MonkeyDev; 280 | ONLY_ACTIVE_ARCH = YES; 281 | SDKROOT = iphoneos; 282 | VERSIONING_SYSTEM = "apple-generic"; 283 | VERSION_INFO_PREFIX = ""; 284 | }; 285 | name = Debug; 286 | }; 287 | BA146BB9202C226A00D7C13B /* Release */ = { 288 | isa = XCBuildConfiguration; 289 | buildSettings = { 290 | ALWAYS_SEARCH_USER_PATHS = NO; 291 | CLANG_ANALYZER_NONNULL = YES; 292 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 293 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 294 | CLANG_CXX_LIBRARY = "libc++"; 295 | CLANG_ENABLE_MODULES = YES; 296 | CLANG_ENABLE_OBJC_ARC = YES; 297 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 298 | CLANG_WARN_BOOL_CONVERSION = YES; 299 | CLANG_WARN_COMMA = YES; 300 | CLANG_WARN_CONSTANT_CONVERSION = YES; 301 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 302 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 303 | CLANG_WARN_EMPTY_BODY = YES; 304 | CLANG_WARN_ENUM_CONVERSION = YES; 305 | CLANG_WARN_INFINITE_RECURSION = YES; 306 | CLANG_WARN_INT_CONVERSION = YES; 307 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 308 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 309 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 310 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 311 | CLANG_WARN_STRICT_PROTOTYPES = YES; 312 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 313 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 314 | CLANG_WARN_UNREACHABLE_CODE = YES; 315 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 316 | CODE_SIGN_IDENTITY = "iPhone Developer"; 317 | COPY_PHASE_STRIP = NO; 318 | CURRENT_PROJECT_VERSION = 1; 319 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 320 | ENABLE_NS_ASSERTIONS = NO; 321 | ENABLE_STRICT_OBJC_MSGSEND = YES; 322 | GCC_C_LANGUAGE_STANDARD = gnu11; 323 | GCC_NO_COMMON_BLOCKS = YES; 324 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 325 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 326 | GCC_WARN_UNDECLARED_SELECTOR = YES; 327 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 328 | GCC_WARN_UNUSED_FUNCTION = YES; 329 | GCC_WARN_UNUSED_VARIABLE = YES; 330 | HEADER_SEARCH_PATHS = ( 331 | "$(inherited)", 332 | "$(MonkeyDevPath)/include", 333 | ); 334 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 335 | MTL_ENABLE_DEBUG_INFO = NO; 336 | MonkeyDevPath = /opt/MonkeyDev; 337 | SDKROOT = iphoneos; 338 | VALIDATE_PRODUCT = YES; 339 | VERSIONING_SYSTEM = "apple-generic"; 340 | VERSION_INFO_PREFIX = ""; 341 | }; 342 | name = Release; 343 | }; 344 | BA146BBB202C226A00D7C13B /* Debug */ = { 345 | isa = XCBuildConfiguration; 346 | buildSettings = { 347 | CODE_SIGN_IDENTITY = ""; 348 | CODE_SIGN_STYLE = Automatic; 349 | DEFINES_MODULE = YES; 350 | DEVELOPMENT_TEAM = N4YFZ84PFP; 351 | DYLIB_COMPATIBILITY_VERSION = 1; 352 | DYLIB_CURRENT_VERSION = 1; 353 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 354 | INFOPLIST_FILE = DingDingPod/Info.plist; 355 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 356 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 357 | PRODUCT_BUNDLE_IDENTIFIER = zhier.DingDingPod; 358 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 359 | SKIP_INSTALL = YES; 360 | TARGETED_DEVICE_FAMILY = "1,2"; 361 | }; 362 | name = Debug; 363 | }; 364 | BA146BBC202C226A00D7C13B /* Release */ = { 365 | isa = XCBuildConfiguration; 366 | buildSettings = { 367 | CODE_SIGN_IDENTITY = ""; 368 | CODE_SIGN_STYLE = Automatic; 369 | DEFINES_MODULE = YES; 370 | DEVELOPMENT_TEAM = N4YFZ84PFP; 371 | DYLIB_COMPATIBILITY_VERSION = 1; 372 | DYLIB_CURRENT_VERSION = 1; 373 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 374 | INFOPLIST_FILE = DingDingPod/Info.plist; 375 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 376 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 377 | PRODUCT_BUNDLE_IDENTIFIER = zhier.DingDingPod; 378 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 379 | SKIP_INSTALL = YES; 380 | TARGETED_DEVICE_FAMILY = "1,2"; 381 | }; 382 | name = Release; 383 | }; 384 | /* End XCBuildConfiguration section */ 385 | 386 | /* Begin XCConfigurationList section */ 387 | BA146BA8202C226A00D7C13B /* Build configuration list for PBXProject "DingDingPod" */ = { 388 | isa = XCConfigurationList; 389 | buildConfigurations = ( 390 | BA146BB8202C226A00D7C13B /* Debug */, 391 | BA146BB9202C226A00D7C13B /* Release */, 392 | ); 393 | defaultConfigurationIsVisible = 0; 394 | defaultConfigurationName = Release; 395 | }; 396 | BA146BBA202C226A00D7C13B /* Build configuration list for PBXNativeTarget "DingDingPod" */ = { 397 | isa = XCConfigurationList; 398 | buildConfigurations = ( 399 | BA146BBB202C226A00D7C13B /* Debug */, 400 | BA146BBC202C226A00D7C13B /* Release */, 401 | ); 402 | defaultConfigurationIsVisible = 0; 403 | defaultConfigurationName = Release; 404 | }; 405 | /* End XCConfigurationList section */ 406 | }; 407 | rootObject = BA146BA5202C226A00D7C13B /* Project object */; 408 | } 409 | -------------------------------------------------------------------------------- /DingDingPod.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DingDingPod.xcodeproj/project.xcworkspace/xcuserdata/wangrongchao.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WJustin/DingDingPod/c72bc42e2926a4567515473eafef48bd340929f6/DingDingPod.xcodeproj/project.xcworkspace/xcuserdata/wangrongchao.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DingDingPod.xcodeproj/xcuserdata/wangrongchao.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DingDingPod.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DingDingPod/Config/DDConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDConfig.h 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DDConfig : NSObject 12 | 13 | @property (nonatomic, assign) BOOL canRevokeMsg; 14 | @property (nonatomic, assign) BOOL canAutoRobRedPacket; 15 | @property (nonatomic, assign) BOOL canRobSelf; 16 | @property (nonatomic, assign) NSInteger robDelay; 17 | @property (nonatomic, assign) NSInteger steps; 18 | 19 | + (instancetype)shareConfig; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DingDingPod/Config/DDConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDConfig.m 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #import "DDConfig.h" 10 | 11 | static NSString * const kCanRevokeMsgKey = @"canRevokeMsg"; 12 | static NSString * const kCanAutoRobRedPacketKey = @"canAutoRobRedPacket"; 13 | static NSString * const kCanRobSelfKey = @"canRobSelf"; 14 | static NSString * const kRobDelayKey = @"robDelay"; 15 | static NSString * const kStepsKey = @"steps"; 16 | 17 | @implementation DDConfig 18 | 19 | + (instancetype)shareConfig { 20 | static DDConfig *shareConfig; 21 | static dispatch_once_t onceToken; 22 | dispatch_once(&onceToken, ^{ 23 | shareConfig = [[DDConfig alloc] init]; 24 | }); 25 | return shareConfig; 26 | } 27 | 28 | #pragma mark - Setter 29 | 30 | - (void)setCanRevokeMsg:(BOOL)canRevokeMsg { 31 | [[NSUserDefaults standardUserDefaults] setBool:canRevokeMsg forKey:kCanRevokeMsgKey]; 32 | [[NSUserDefaults standardUserDefaults] synchronize]; 33 | } 34 | 35 | - (void)setCanAutoRobRedPacket:(BOOL)canAutoRobRedPacket { 36 | [[NSUserDefaults standardUserDefaults] setBool:canAutoRobRedPacket forKey:kCanAutoRobRedPacketKey]; 37 | [[NSUserDefaults standardUserDefaults] synchronize]; 38 | } 39 | 40 | - (void)setCanRobSelf:(BOOL)canRobSelf { 41 | [[NSUserDefaults standardUserDefaults] setBool:canRobSelf forKey:kCanRobSelfKey]; 42 | [[NSUserDefaults standardUserDefaults] synchronize]; 43 | } 44 | 45 | - (void)setRobDelay:(NSInteger)robDelay { 46 | [[NSUserDefaults standardUserDefaults] setObject:@(robDelay) forKey:kRobDelayKey]; 47 | [[NSUserDefaults standardUserDefaults] synchronize]; 48 | } 49 | 50 | - (void)setSteps:(NSInteger)steps { 51 | [[NSUserDefaults standardUserDefaults] setObject:@(steps) forKey:kStepsKey]; 52 | [[NSUserDefaults standardUserDefaults] synchronize]; 53 | } 54 | 55 | 56 | #pragma mark - Getter 57 | 58 | - (BOOL)canRevokeMsg { 59 | return [[NSUserDefaults standardUserDefaults] boolForKey:kCanRevokeMsgKey]; 60 | } 61 | 62 | - (BOOL)canAutoRobRedPacket { 63 | return [[NSUserDefaults standardUserDefaults] boolForKey:kCanAutoRobRedPacketKey]; 64 | } 65 | 66 | - (BOOL)canRobSelf { 67 | return [[NSUserDefaults standardUserDefaults] boolForKey:kCanRobSelfKey]; 68 | } 69 | 70 | - (NSInteger)robDelay { 71 | NSNumber *num = [[NSUserDefaults standardUserDefaults] objectForKey:kRobDelayKey]; 72 | return [num integerValue]; 73 | } 74 | 75 | - (NSInteger)steps { 76 | NSNumber *num = [[NSUserDefaults standardUserDefaults] objectForKey:kStepsKey]; 77 | return [num integerValue]; 78 | } 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /DingDingPod/DingDingPod.h: -------------------------------------------------------------------------------- 1 | // 2 | // DingDingPod.h 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for DingDingPod. 12 | FOUNDATION_EXPORT double DingDingPodVersionNumber; 13 | 14 | //! Project version string for DingDingPod. 15 | FOUNDATION_EXPORT const unsigned char DingDingPodVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /DingDingPod/DingDingPod.m: -------------------------------------------------------------------------------- 1 | // weibo: http://weibo.com/xiaoqing28 2 | // blog: http://www.alonemonkey.com 3 | // 4 | // DingDingPod.m 5 | // DingDingPod 6 | // 7 | // Created by Justin.wang on 2018/2/8. 8 | // Copyright (c) 2018年 Justin.wang. All rights reserved. 9 | // 10 | 11 | #import "DingDingPod.h" 12 | #import 13 | #import 14 | #import 15 | #import 16 | #import "DDWindow.h" 17 | #import "DDConfig.h" 18 | 19 | #import "DDRevokeMessageHeader.h" 20 | #import "DDRedPacketHeader.h" 21 | 22 | #pragma mark - Setting 23 | 24 | CHDeclareClass(UITabBarController); 25 | 26 | CHOptimizedMethod0(self, void, UITabBarController, viewDidLoad) { 27 | CHSuper0(UITabBarController, viewDidLoad); 28 | [[DDWindow shareWindow] setDismissBlock:^{ 29 | [self.viewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 30 | UINavigationController *nav = (UINavigationController *)obj; 31 | [nav popToRootViewControllerAnimated:YES]; 32 | }]; 33 | }]; 34 | } 35 | 36 | CHConstructor{ 37 | CHLoadLateClass(UITabBarController); 38 | CHHook0(UITabBarController, viewDidLoad); 39 | } 40 | 41 | #pragma mark - RevokeMessage 42 | 43 | CHDeclareClass(YYLabel) 44 | CHDeclareClass(DTMessageControllerDataSource) 45 | CHDeclareClass(DTMessageBaseViewController) 46 | 47 | CHOptimizedMethod1(self, void, DTMessageControllerDataSource, setMessages, NSArray *, messages) { 48 | if ([DDConfig shareConfig].canRevokeMsg) { 49 | NSMutableArray *mutableArray = [[NSMutableArray alloc] init]; 50 | __block DTBizMessage *preMessage; 51 | [messages enumerateObjectsUsingBlock:^(DTBizMessage * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 52 | if (obj.recallStatus > 0 && !obj.isMine) { 53 | obj.recallStatus = 0; 54 | DTBizMessage *bizMessage = [[objc_getClass("DTBizMessage") alloc] init]; 55 | bizMessage.senderId = obj.senderId; 56 | bizMessage.mId = obj.mId; 57 | bizMessage.isMine = obj.isMine; 58 | bizMessage.attachmentsType = obj.attachmentsType; 59 | bizMessage.content = obj.content; 60 | bizMessage.recallStatus = 1; 61 | if (preMessage.mId > 0 && preMessage.mId != obj.mId) { 62 | [mutableArray addObject:obj]; 63 | } 64 | [mutableArray addObject:bizMessage]; 65 | } else { 66 | [mutableArray addObject:obj]; 67 | } 68 | preMessage = obj; 69 | }]; 70 | CHSuper1(DTMessageControllerDataSource, setMessages, mutableArray); 71 | } else { 72 | CHSuper1(DTMessageControllerDataSource, setMessages, messages); 73 | } 74 | } 75 | 76 | CHOptimizedMethod1(self, void, YYLabel, setAttributedText, NSAttributedString *, attributedText) { 77 | if ([DDConfig shareConfig].canRevokeMsg) { 78 | if ([attributedText.string containsString:@"撤回了一条消息"] && 79 | ![attributedText.string containsString:@"已阻止"] && 80 | ![attributedText.string containsString:@"你"]) { 81 | NSString *string = [NSString stringWithFormat:@"已阻止%@", attributedText.string]; 82 | string = [string stringByReplacingOccurrencesOfString:@"了一条" withString:@""]; 83 | attributedText = [[NSAttributedString alloc] initWithString:string attributes:nil]; 84 | } 85 | } 86 | CHSuper1(YYLabel, setAttributedText, attributedText); 87 | } 88 | 89 | CHOptimizedMethod1(self, void, DTMessageBaseViewController, receivedMessageNoticeUpdateNotification, id, arg1) { 90 | if ([DDConfig shareConfig].canRevokeMsg) { 91 | NSNotification *notify = arg1; 92 | NSArray *messages = notify.userInfo[@"WKUserInfoMessagesKey"]; 93 | DTBizMessage *message = [messages lastObject]; 94 | if (message && !isFalse) { 95 | [self.dataSource.messages lastObject].recallStatus = 1; 96 | self.dataSource.messages = self.dataSource.messages; 97 | [self refreshAllMessages]; 98 | } 99 | isFalse = !isFalse; 100 | return; 101 | } 102 | CHSuper1(DTMessageBaseViewController, receivedMessageNoticeUpdateNotification, arg1); 103 | } 104 | 105 | CHConstructor{ 106 | CHLoadLateClass(YYLabel); 107 | CHLoadLateClass(DTMessageControllerDataSource); 108 | CHLoadLateClass(DTMessageBaseViewController); 109 | 110 | CHHook1(YYLabel, setAttributedText); 111 | CHHook1(DTMessageControllerDataSource, setMessages); 112 | CHHook1(DTMessageBaseViewController, receivedMessageNoticeUpdateNotification); 113 | } 114 | 115 | #pragma mark - RedPacket 116 | 117 | CHDeclareClass(DTConversationListDataSource) 118 | 119 | CHOptimizedMethod5(self, void, DTConversationListDataSource, controller, id, arg1, didChangeObject, id, arg2, atIndex, unsigned long long, arg3, forChangeType, long long, arg4, newIndex, unsigned long long, arg5) { 120 | CHSuper5(DTConversationListDataSource, controller, arg1, didChangeObject, arg2, atIndex, arg3, forChangeType, arg4, newIndex, arg5); 121 | if (![DDConfig shareConfig].canAutoRobRedPacket) { 122 | return; 123 | } 124 | WKBizConversation *converdation = arg2; 125 | NSMutableArray *retArr = [[NSMutableArray alloc] init]; 126 | NSString *attachmentsJson = converdation.latestMessage.attachmentsJson; 127 | if (attachmentsJson.length > 0) { 128 | NSData* jsonData = [attachmentsJson dataUsingEncoding:NSUTF8StringEncoding]; 129 | NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves error:nil]; 130 | NSNumber *contentType = dict[@"contentType"]; 131 | NSMutableDictionary *retDict = [NSMutableDictionary new]; 132 | retDict[@"contentType"] = contentType; 133 | NSArray *arr = dict[@"attachments"]; 134 | if (arr.count > 0) { 135 | [arr enumerateObjectsUsingBlock:^(NSDictionary *attachmentDict, NSUInteger idx, BOOL * _Nonnull stop) { 136 | NSDictionary *extension = attachmentDict[@"extension"]; 137 | retDict[@"clusterid"] = extension[@"clusterid"]; 138 | retDict[@"sid"] = extension[@"sid"]; 139 | retDict[@"isMine"] = @([converdation.latestMessage isMine]); 140 | retDict[@"congrats"] = extension[@"congrats"]; 141 | retDict[@"sname"] = extension[@"sname"]; 142 | 143 | [retArr addObject:retDict]; 144 | }]; 145 | } 146 | } 147 | 148 | [retArr enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 149 | DTRedEnvelopServiceIMP *imp = [objc_getClass("DTRedEnvelopServiceFactory") defaultServiceIMP]; 150 | long long sid = [obj[@"sid"] longLongValue]; 151 | NSString *cluseId = obj[@"clusterid"]; 152 | if (cluseId.length > 0){ 153 | BOOL isMine = [obj[@"isMine"] boolValue]; 154 | if (isMine && ![DDConfig shareConfig].canRobSelf) { 155 | return; 156 | } 157 | if ([DDConfig shareConfig].robDelay > 0) { 158 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)([DDConfig shareConfig].robDelay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 159 | [imp pickRedEnvelopCluster:sid clusterId:cluseId successBlock:nil failureBlock:nil]; 160 | }); 161 | } else { 162 | [imp pickRedEnvelopCluster:sid clusterId:cluseId successBlock:nil failureBlock:nil]; 163 | } 164 | } 165 | }]; 166 | } 167 | 168 | CHConstructor{ 169 | CHLoadLateClass(DTConversationListDataSource); 170 | CHHook5(DTConversationListDataSource, controller, didChangeObject, atIndex, forChangeType, newIndex); 171 | } 172 | 173 | #pragma mark - step 174 | 175 | CHDeclareClass(CMPedometer) 176 | 177 | CHOptimizedMethod3(self, void, CMPedometer, queryPedometerDataFromDate, NSDate *, start, toDate, NSDate *, end, withHandler, CMPedometerHandler, handler) { 178 | if ([DDConfig shareConfig].steps > 0) { 179 | CMPedometerHandler hand = ^(CMPedometerData *pedometerData, NSError *error) { 180 | [pedometerData setValue:@([DDConfig shareConfig].steps) forKeyPath:@"fNumberOfSteps"]; 181 | if (handler) { 182 | handler(pedometerData, error); 183 | } 184 | }; 185 | CHSuper3(CMPedometer, queryPedometerDataFromDate, start, toDate, end, withHandler, handler ? hand : nil); 186 | } else { 187 | CHSuper3(CMPedometer, queryPedometerDataFromDate, start, toDate, end, withHandler, handler); 188 | } 189 | } 190 | 191 | CHConstructor{ 192 | CHLoadLateClass(CMPedometer); 193 | CHHook3(CMPedometer, queryPedometerDataFromDate, toDate, withHandler); 194 | } 195 | 196 | 197 | 198 | 199 | 200 | -------------------------------------------------------------------------------- /DingDingPod/Headers/DDRedPacketHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDRedPacketHeader.h 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #ifndef DDRedPacketHeader_h 10 | #define DDRedPacketHeader_h 11 | 12 | #import 13 | 14 | @interface WKBizMessage 15 | 16 | @property(nonatomic) NSString *attachmentsJson; 17 | @property(nonatomic) _Bool isMine; 18 | 19 | @end 20 | 21 | @interface WKBizConversation 22 | 23 | @property(nonatomic) NSString *latestMessageJson;//最新一条消息的json字符串 24 | @property(nonatomic) WKBizMessage *latestMessage;//最新一条消息 25 | 26 | @end 27 | 28 | @interface DTRedEnvelopServiceFactory 29 | 30 | + (id)createServiceIMPWithPersistence:(id)arg1 network:(id)arg2; 31 | + (id)defaultServiceIMP; 32 | 33 | @end 34 | 35 | @interface DTRedEnvelopServiceIMP 36 | 37 | - (void)pickRedEnvelopCluster:(long long)sid 38 | clusterId:(NSString *)arg2 39 | successBlock:(id)arg3 40 | failureBlock:(id)arg4; 41 | 42 | @end 43 | 44 | @interface DTConversationListDataSource 45 | 46 | - (void)controller:(id)arg1 47 | didChangeObject:(id)arg2 48 | atIndex:(unsigned long long)arg3 49 | forChangeType:(long long)arg4 50 | newIndex:(unsigned long long)arg5; 51 | 52 | @end 53 | 54 | 55 | #endif /* DDRedPacketHeader_h */ 56 | -------------------------------------------------------------------------------- /DingDingPod/Headers/DDRevokeMessageHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDRevokeMessageHeader.h 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #ifndef DDRevokeMessageHeader_h 10 | #define DDRevokeMessageHeader_h 11 | 12 | static BOOL isFalse; 13 | 14 | @interface YYLabel 15 | 16 | @property (nonatomic) NSAttributedString *attributedText; 17 | 18 | @end 19 | 20 | @interface DTBizMessage 21 | 22 | @property(nonatomic) long long senderId; 23 | @property(copy, nonatomic) NSString *localMid; 24 | @property(nonatomic) long long mId; 25 | @property(nonatomic) long long attachmentsType; //1 26 | @property(nonatomic) long long recallStatus; 27 | @property(copy, nonatomic) NSString *content; 28 | @property(nonatomic) _Bool isMine; 29 | 30 | @end 31 | 32 | @interface DTMessageControllerDataSource 33 | 34 | @property (nonatomic) NSArray *messages; 35 | 36 | @end 37 | 38 | @interface DTMessageBaseViewController 39 | 40 | @property(retain, nonatomic) DTMessageControllerDataSource *dataSource; 41 | - (void)receivedMessageNoticeUpdateNotification:(id)arg1; 42 | - (void)refreshAllMessages; 43 | 44 | @end 45 | 46 | #endif /* DDRevokeMessageHeader_h */ 47 | -------------------------------------------------------------------------------- /DingDingPod/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DingDingPod/Setting/DDEditorTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDEditorTableViewCell.h 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | FOUNDATION_EXTERN NSString * const DDEditorTableViewCellId; 12 | 13 | @interface DDEditorTableViewCell : UITableViewCell 14 | 15 | @property (nonatomic, strong) UITextField *textField; 16 | @property (nonatomic, copy ) void (^didEditValueChangedBlock)(NSString *text); 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /DingDingPod/Setting/DDEditorTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDEditorTableViewCell.m 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #import "DDEditorTableViewCell.h" 10 | 11 | NSString * const DDEditorTableViewCellId = @"DDEditorTableViewCellId"; 12 | 13 | @implementation DDEditorTableViewCell 14 | 15 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 16 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { 17 | [self setSelectionStyle:UITableViewCellSelectionStyleNone]; 18 | } 19 | return self; 20 | } 21 | 22 | - (void)layoutSubviews { 23 | [super layoutSubviews]; 24 | self.textField.frame = CGRectMake(150, 25 | 0, 26 | self.contentView.frame.size.width - 150 - 30, 27 | self.contentView.frame.size.height); 28 | } 29 | 30 | 31 | - (void)didEditValueChanged:(UITextField *)textField { 32 | if (self.didEditValueChangedBlock) { 33 | self.didEditValueChangedBlock(textField.text); 34 | } 35 | } 36 | 37 | - (UITextField *)textField { 38 | if (!_textField) { 39 | _textField = [[UITextField alloc] init]; 40 | _textField.placeholder = @"0"; 41 | _textField.keyboardType = UIKeyboardTypeNumberPad; 42 | _textField.textAlignment = NSTextAlignmentRight; 43 | [_textField addTarget:self 44 | action:@selector(didEditValueChanged:) 45 | forControlEvents:UIControlEventEditingChanged]; 46 | [self.contentView addSubview:_textField]; 47 | } 48 | return _textField; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /DingDingPod/Setting/DDGoNextTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDGoNextTableViewCell.h 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | FOUNDATION_EXTERN NSString * const DDGoNextTableViewCellId; 12 | 13 | @interface DDGoNextTableViewCell : UITableViewCell 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /DingDingPod/Setting/DDGoNextTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDGoNextTableViewCell.m 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #import "DDGoNextTableViewCell.h" 10 | 11 | NSString * const DDGoNextTableViewCellId = @"DDGoNextTableViewCellId"; 12 | 13 | @implementation DDGoNextTableViewCell 14 | 15 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 16 | if (self = [super initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier]) { 17 | [self setSelectionStyle:UITableViewCellSelectionStyleNone]; 18 | } 19 | return self; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /DingDingPod/Setting/DDSwitchTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDSwitchTableViewCell.h 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | FOUNDATION_EXTERN NSString * const DDSwitchTableViewCellId; 12 | 13 | @interface DDSwitchTableViewCell : UITableViewCell 14 | 15 | @property (nonatomic, strong) UISwitch *switchButton; 16 | @property (nonatomic, copy) void (^didSwitchBlock)(void); 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /DingDingPod/Setting/DDSwitchTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDSwitchTableViewCell.m 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #import "DDSwitchTableViewCell.h" 10 | 11 | NSString * const DDSwitchTableViewCellId = @"DDSwitchTableViewCellId"; 12 | 13 | @implementation DDSwitchTableViewCell 14 | 15 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 16 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { 17 | [self setSelectionStyle:UITableViewCellSelectionStyleNone]; 18 | } 19 | return self; 20 | } 21 | 22 | - (void)layoutSubviews { 23 | [super layoutSubviews]; 24 | self.switchButton.center = CGPointMake(self.frame.size.width - 40, self.contentView.center.y); 25 | self.switchButton.bounds = CGRectMake(0, 0, 60, 30); 26 | } 27 | 28 | - (void)didSwitch { 29 | if (self.didSwitchBlock) { 30 | self.didSwitchBlock(); 31 | } 32 | } 33 | 34 | - (UISwitch *)switchButton { 35 | if (!_switchButton) { 36 | _switchButton = [[UISwitch alloc] initWithFrame:CGRectZero]; 37 | [_switchButton addTarget:self 38 | action:@selector(didSwitch) 39 | forControlEvents:UIControlEventValueChanged]; 40 | [self.contentView addSubview:_switchButton]; 41 | } 42 | return _switchButton; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /DingDingPod/Setting/DDViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDViewController.h 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DDViewController : UIViewController 12 | 13 | @property (nonatomic, copy) void (^dismissBlock)(void); 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /DingDingPod/Setting/DDViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDViewController.m 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #import "DDViewController.h" 10 | #import "DDConfig.h" 11 | 12 | #import "DDSwitchTableViewCell.h" 13 | #import "DDEditorTableViewCell.h" 14 | #import "DDGoNextTableViewCell.h" 15 | 16 | @interface DDViewController () 17 | 18 | @property (nonatomic, strong) UITableView *tableView; 19 | 20 | @end 21 | 22 | @implementation DDViewController 23 | 24 | - (void)viewDidLoad { 25 | [super viewDidLoad]; 26 | [self initUI]; 27 | } 28 | 29 | - (void)initUI { 30 | self.navigationItem.title = @"设置"; 31 | UIBarButtonItem *close= [[UIBarButtonItem alloc] initWithTitle:@"关闭" style:UIBarButtonItemStylePlain target:self action:@selector(close)]; 32 | [close setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:16],NSFontAttributeName, nil] 33 | forState:UIControlStateNormal]; 34 | self.navigationItem.leftBarButtonItem = close; 35 | self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds 36 | style:UITableViewStyleGrouped]; 37 | self.tableView.dataSource = self; 38 | self.tableView.delegate = self; 39 | self.tableView.estimatedRowHeight = 0; 40 | [self.view addSubview:self.tableView]; 41 | [self.tableView registerClass:[DDSwitchTableViewCell class] forCellReuseIdentifier:DDSwitchTableViewCellId]; 42 | [self.tableView registerClass:[DDEditorTableViewCell class] forCellReuseIdentifier:DDEditorTableViewCellId]; 43 | [self.tableView registerClass:[DDGoNextTableViewCell class] 44 | forCellReuseIdentifier:DDGoNextTableViewCellId]; 45 | } 46 | 47 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 48 | return 6; 49 | } 50 | 51 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 52 | if (indexPath.row == 0) { 53 | return [self switchCellWithTitle:@"防撤回" 54 | andOn:[DDConfig shareConfig].canRevokeMsg 55 | andBlock:^{ 56 | [DDConfig shareConfig].canRevokeMsg = ![DDConfig shareConfig].canRevokeMsg; 57 | }]; 58 | } else if (indexPath.row == 1) { 59 | return [self switchCellWithTitle:@"自动抢红包" 60 | andOn:[DDConfig shareConfig].canAutoRobRedPacket 61 | andBlock:^{ 62 | [DDConfig shareConfig].canAutoRobRedPacket = ![DDConfig shareConfig].canAutoRobRedPacket; 63 | }]; 64 | } else if (indexPath.row == 2) { 65 | return [self switchCellWithTitle:@"抢自己" 66 | andOn:[DDConfig shareConfig].canRobSelf 67 | andBlock:^{ 68 | [DDConfig shareConfig].canRobSelf = ![DDConfig shareConfig].canRobSelf; 69 | }]; 70 | } else if (indexPath.row == 3) { 71 | DDEditorTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:DDEditorTableViewCellId]; 72 | cell.textLabel.text = @"延迟秒数"; 73 | cell.textField.text = @([DDConfig shareConfig].robDelay).stringValue; 74 | [cell setDidEditValueChangedBlock:^(NSString *text) { 75 | [DDConfig shareConfig].robDelay = [text integerValue]; 76 | }]; 77 | return cell; 78 | } else if (indexPath.row == 4) { 79 | DDEditorTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:DDEditorTableViewCellId]; 80 | cell.textLabel.text = @"钉钉步数"; 81 | cell.textField.text = @([DDConfig shareConfig].steps).stringValue; 82 | [cell setDidEditValueChangedBlock:^(NSString *text) { 83 | [DDConfig shareConfig].steps = [text integerValue]; 84 | }]; 85 | return cell; 86 | } else if (indexPath.row == 5) { 87 | DDGoNextTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:DDGoNextTableViewCellId]; 88 | cell.textLabel.text = @"我的GitHub"; 89 | cell.detailTextLabel.text = @"star"; 90 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 91 | return cell; 92 | } 93 | return nil; 94 | } 95 | 96 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 97 | return 45; 98 | } 99 | 100 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 101 | if (indexPath.row == 5) { 102 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/WJustin/DingDingPod"]]; 103 | } 104 | } 105 | 106 | #pragma mark - Dequeue 107 | 108 | - (DDSwitchTableViewCell *)switchCellWithTitle:(NSString *)title 109 | andOn:(BOOL)on 110 | andBlock:(dispatch_block_t)block { 111 | DDSwitchTableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:DDSwitchTableViewCellId]; 112 | cell.textLabel.text = title; 113 | [cell.switchButton setOn:on]; 114 | [cell setDidSwitchBlock:^{ 115 | if (block) { 116 | block(); 117 | } 118 | }]; 119 | return cell; 120 | } 121 | 122 | #pragma mark - Events 123 | 124 | - (void)close { 125 | [self.navigationController dismissViewControllerAnimated:YES completion:nil]; 126 | if (self.dismissBlock) { 127 | self.dismissBlock(); 128 | } 129 | } 130 | 131 | 132 | @end 133 | -------------------------------------------------------------------------------- /DingDingPod/Setting/DDWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDWindow.h 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DDWindow : UIWindow 12 | 13 | @property (nonatomic, copy) void (^dismissBlock)(void); 14 | 15 | + (instancetype)shareWindow; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DingDingPod/Setting/DDWindow.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDWindow.m 3 | // DingDingPod 4 | // 5 | // Created by Justin.wang on 2018/2/8. 6 | // Copyright © 2018年 Justin.wang. All rights reserved. 7 | // 8 | 9 | #import "DDWindow.h" 10 | #import "DDViewController.h" 11 | 12 | static CGFloat const kDotWindowOutsideDiameter = 50.0f; 13 | static CGFloat const kDotWindowInsideDiameter = kDotWindowOutsideDiameter - 10; 14 | static CGFloat const kDotWindowMargin = 20.0f; 15 | 16 | @implementation DDWindow 17 | 18 | + (instancetype)shareWindow { 19 | static DDWindow *shareWindow; 20 | static dispatch_once_t onceToken; 21 | dispatch_once(&onceToken, ^{ 22 | shareWindow = [[DDWindow alloc] init]; 23 | }); 24 | return shareWindow; 25 | } 26 | 27 | - (instancetype)init { 28 | if (self = [super init]) { 29 | self.hidden = NO; 30 | self.windowLevel = UIWindowLevelAlert; 31 | self.rootViewController = [UIViewController new]; 32 | self.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.2]; 33 | self.frame = CGRectMake(kDotWindowMargin, kDotWindowMargin, kDotWindowOutsideDiameter, kDotWindowOutsideDiameter); 34 | CGFloat radius = kDotWindowOutsideDiameter / 2; 35 | self.layer.cornerRadius = radius; 36 | self.layer.masksToBounds = YES; 37 | UIView *redView = [[UIView alloc] init]; 38 | redView.center = CGPointMake(radius, radius); 39 | redView.bounds = CGRectMake(0, 0, kDotWindowInsideDiameter, kDotWindowInsideDiameter); 40 | redView.backgroundColor = [UIColor redColor]; 41 | redView.layer.cornerRadius = kDotWindowInsideDiameter / 2; 42 | redView.layer.masksToBounds = YES; 43 | [self addSubview:redView]; 44 | UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self 45 | action:@selector(panWithGesture:)]; 46 | [self addGestureRecognizer:pan]; 47 | 48 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap)]; 49 | tap.numberOfTapsRequired = 1; 50 | [self addGestureRecognizer:tap]; 51 | } 52 | return self; 53 | } 54 | 55 | #pragma mark -Events 56 | 57 | - (void)panWithGesture:(UIPanGestureRecognizer *)gesture { 58 | CGPoint point = [gesture translationInView:[[UIApplication sharedApplication] keyWindow]]; 59 | self.center = CGPointMake(point.x +self.center.x, point.y + self.center.y); 60 | [gesture setTranslation:CGPointZero inView:[[UIApplication sharedApplication] keyWindow]]; 61 | } 62 | 63 | - (void)tap { 64 | DDViewController *vc = [[DDViewController alloc] init]; 65 | self.hidden = YES; 66 | [vc setDismissBlock:^{ 67 | self.hidden = NO; 68 | if (self.dismissBlock) { 69 | self.dismissBlock(); 70 | } 71 | }]; 72 | UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc]; 73 | [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:nav 74 | animated:YES 75 | completion:nil]; 76 | 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DingDingPod 2 | 3 | ## Features 4 | 5 | - 防撤回 6 | - 自动抢红包 7 | - 抢自己 8 | - 延迟秒数 9 | - 修改步数 10 | 11 | ## Installation 12 | 13 | DingDingPod is available through [MonkeyDevSpecs](https://github.com/AloneMonkey/MonkeyDevSpecs.git). To install 14 | it, simply add the following line to your Podfile: 15 | 16 | ```ruby 17 | pod 'DingDingPod' 18 | ``` 19 | 20 | ## Author 21 | 22 | Justin.wang, wangrongchao@126.com 23 | 24 | ## License 25 | 26 | DingDingPod is available under the MIT license. See the LICENSE file for more info. 27 | 28 | -------------------------------------------------------------------------------- /snaptshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WJustin/DingDingPod/c72bc42e2926a4567515473eafef48bd340929f6/snaptshop.png --------------------------------------------------------------------------------