From 929b02ca5ac547a97dff3523b1b9bd4c6d5cdadd Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Mon, 18 Oct 2010 21:25:44 +0200 Subject: [PATCH 01/20] Adding files required by the Apache License Version 2.0: LICENSE and NOTICE. --- LICENSE | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ NOTICE | 4 ++ 2 files changed, 206 insertions(+) create mode 100644 LICENSE create mode 100644 NOTICE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..05ae855 --- /dev/null +++ b/NOTICE @@ -0,0 +1,4 @@ +FileMD5Hash +Copyright © 2010 Joel Lopes Da Silva. All rights reserved. + +This software has been developed by Joel Lopes Da Silva (http://www.joel.lopes-da-silva.com/). From 94fdd86e93afd1c47fb74560974ac4c9101082c0 Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Wed, 20 Oct 2010 21:00:07 -0700 Subject: [PATCH 02/20] Fixing a memory leak. --- iOS/AppDelegate.m | 1 + 1 file changed, 1 insertion(+) diff --git a/iOS/AppDelegate.m b/iOS/AppDelegate.m index d40320b..51ee66a 100644 --- a/iOS/AppDelegate.m +++ b/iOS/AppDelegate.m @@ -41,6 +41,7 @@ @implementation AppDelegate - (void)dealloc { [window release]; + [label release]; [super dealloc]; } From 5e83f170798b538212269a0ab9671e37a315d10c Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Thu, 28 Oct 2010 16:42:21 -0700 Subject: [PATCH 03/20] Adding names of Xcode 4 specific files that we don't want in the git repository. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index e9d6a6a..d99f83b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ # Xcode noise /build +project.xcworkspace +xcuserdata *.pbxuser *.mode* *.perspective* From 6864c180c010ab4b0514ba5c025091e12ab01199 Mon Sep 17 00:00:00 2001 From: Thijs Scheepers Date: Mon, 6 Jan 2014 18:17:13 +0100 Subject: [PATCH 04/20] Fixed Macro bug and added podspec --- Common/FileMD5Hash.h | 11 +++++++++++ FileMD5Hash.podspec | 13 +++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 FileMD5Hash.podspec diff --git a/Common/FileMD5Hash.h b/Common/FileMD5Hash.h index 1672fef..3f6726b 100644 --- a/Common/FileMD5Hash.h +++ b/Common/FileMD5Hash.h @@ -21,6 +21,17 @@ #ifndef FILEMD5HASH_H #define FILEMD5HASH_H +//--------------------------------------------------------- +// Macros +//--------------------------------------------------------- + +// Extern +#if defined(__cplusplus) + #define FILEMD5HASH_EXTERN extern "C" +#else + #define FILEMD5HASH_EXTERN extern +#endif + //--------------------------------------------------------- // Includes //--------------------------------------------------------- diff --git a/FileMD5Hash.podspec b/FileMD5Hash.podspec new file mode 100644 index 0000000..15a75ee --- /dev/null +++ b/FileMD5Hash.podspec @@ -0,0 +1,13 @@ +Pod::Spec.new do |s| + s.name = 'FileMD5Hash' + s.version = '0.0.1' + s.license = 'Apache' + s.summary = 'Library for computing MD5 hashes of files with small memory usage.' + s.homepage = 'http://www.joel.lopes-da-silva.com/2010/09/07/compute-md5-or-sha-hash-of-large-file-efficiently-on-ios-and-mac-os-x/' + s.author = { 'Joel Lopes Da Silva' => 'joel@lopes-da-silva.com' } + s.source = { :git => 'https://github.com/JoeKun/FileMD5Hash.git', :commit => 'd00c0c51c6d0955d9daf94c30cfd95a219d4914e' } + + s.prefix_header_file = 'Common/FileMD5Hash_Prefix.pch' + s.source_files = 'Common/*.{h,c}' + +end \ No newline at end of file From 6aab7463f2406ea035ee6683bf47690e9b22695d Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Sun, 19 Jan 2014 14:47:57 -0800 Subject: [PATCH 05/20] Fix version and tag in podspec. --- FileMD5Hash.podspec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FileMD5Hash.podspec b/FileMD5Hash.podspec index 15a75ee..3dbbc01 100644 --- a/FileMD5Hash.podspec +++ b/FileMD5Hash.podspec @@ -1,13 +1,13 @@ Pod::Spec.new do |s| s.name = 'FileMD5Hash' - s.version = '0.0.1' + s.version = '1.0.0' s.license = 'Apache' s.summary = 'Library for computing MD5 hashes of files with small memory usage.' s.homepage = 'http://www.joel.lopes-da-silva.com/2010/09/07/compute-md5-or-sha-hash-of-large-file-efficiently-on-ios-and-mac-os-x/' s.author = { 'Joel Lopes Da Silva' => 'joel@lopes-da-silva.com' } - s.source = { :git => 'https://github.com/JoeKun/FileMD5Hash.git', :commit => 'd00c0c51c6d0955d9daf94c30cfd95a219d4914e' } + s.source = { :git => 'https://github.com/JoeKun/FileMD5Hash.git', :tag => '1.0.0' } s.prefix_header_file = 'Common/FileMD5Hash_Prefix.pch' s.source_files = 'Common/*.{h,c}' -end \ No newline at end of file +end From 72edc1a425e1ffdc4b9481ba8c1e93383377a1c8 Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Sun, 19 Jan 2014 14:50:23 -0800 Subject: [PATCH 06/20] Fix license field in podspec. --- FileMD5Hash.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FileMD5Hash.podspec b/FileMD5Hash.podspec index 3dbbc01..4a4e781 100644 --- a/FileMD5Hash.podspec +++ b/FileMD5Hash.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'FileMD5Hash' s.version = '1.0.0' - s.license = 'Apache' + s.license = 'Apache License, Version 2.0' s.summary = 'Library for computing MD5 hashes of files with small memory usage.' s.homepage = 'http://www.joel.lopes-da-silva.com/2010/09/07/compute-md5-or-sha-hash-of-large-file-efficiently-on-ios-and-mac-os-x/' s.author = { 'Joel Lopes Da Silva' => 'joel@lopes-da-silva.com' } From 0904e3e5af79903dbdc225ee58f52f6dec88442f Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Sun, 19 Jan 2014 14:51:24 -0800 Subject: [PATCH 07/20] Use GitHub URL instead of URL to blog post for the homepage URL of FileMD5Hash. --- FileMD5Hash.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FileMD5Hash.podspec b/FileMD5Hash.podspec index 4a4e781..16a8f6c 100644 --- a/FileMD5Hash.podspec +++ b/FileMD5Hash.podspec @@ -3,7 +3,7 @@ Pod::Spec.new do |s| s.version = '1.0.0' s.license = 'Apache License, Version 2.0' s.summary = 'Library for computing MD5 hashes of files with small memory usage.' - s.homepage = 'http://www.joel.lopes-da-silva.com/2010/09/07/compute-md5-or-sha-hash-of-large-file-efficiently-on-ios-and-mac-os-x/' + s.homepage = 'https://github.com/JoeKun/FileMD5Hash' s.author = { 'Joel Lopes Da Silva' => 'joel@lopes-da-silva.com' } s.source = { :git => 'https://github.com/JoeKun/FileMD5Hash.git', :tag => '1.0.0' } From f1706bea53f18e08fbf7fbed528e3e5df96aba08 Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Sun, 19 Jan 2014 14:53:16 -0800 Subject: [PATCH 08/20] Minor cosmetic changes to podspec file. --- FileMD5Hash.podspec | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/FileMD5Hash.podspec b/FileMD5Hash.podspec index 16a8f6c..30deff8 100644 --- a/FileMD5Hash.podspec +++ b/FileMD5Hash.podspec @@ -1,13 +1,11 @@ -Pod::Spec.new do |s| - s.name = 'FileMD5Hash' - s.version = '1.0.0' - s.license = 'Apache License, Version 2.0' - s.summary = 'Library for computing MD5 hashes of files with small memory usage.' - s.homepage = 'https://github.com/JoeKun/FileMD5Hash' - s.author = { 'Joel Lopes Da Silva' => 'joel@lopes-da-silva.com' } - s.source = { :git => 'https://github.com/JoeKun/FileMD5Hash.git', :tag => '1.0.0' } - - s.prefix_header_file = 'Common/FileMD5Hash_Prefix.pch' - s.source_files = 'Common/*.{h,c}' - +Pod::Spec.new do |spec| + spec.name = 'FileMD5Hash' + spec.version = '1.0.0' + spec.license = 'Apache License, Version 2.0' + spec.summary = 'Library for computing MD5 hashes of files with small memory usage.' + spec.homepage = 'https://github.com/JoeKun/FileMD5Hash' + spec.author = { 'Joel Lopes Da Silva' => 'joel@lopes-da-silva.com' } + spec.source = { :git => 'https://github.com/JoeKun/FileMD5Hash.git', :tag => '1.0.0' } + spec.prefix_header_file = 'Common/FileMD5Hash_Prefix.pch' + spec.source_files = 'Common/*.{h,c}' end From a6c9a4a8b438c30986758686ae6b24e2ec37911e Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Sun, 19 Jan 2014 15:22:58 -0800 Subject: [PATCH 09/20] New API for FileMD5Hash. - Objective-C API to simplify eventual usage of this with ARC; - rename files to FileHash; I expect to add more methods for other types of hashes; - stop using goto or any form of early return. --- Common/FileHash.h | 27 ++++++ Common/FileHash.m | 87 +++++++++++++++++++ Common/FileMD5Hash.c | 120 -------------------------- Common/FileMD5Hash.h | 59 ------------- Common/FileMD5Hash_Prefix.pch | 48 ----------- FileMD5Hash.podspec | 5 +- FileMD5Hash.xcodeproj/project.pbxproj | 28 +++--- Mac/AppDelegate.h | 11 --- Mac/AppDelegate.m | 25 +----- Mac/main.m | 10 --- iOS/AppDelegate.h | 11 --- iOS/AppDelegate.m | 23 +---- iOS/main.m | 10 --- 13 files changed, 132 insertions(+), 332 deletions(-) create mode 100644 Common/FileHash.h create mode 100644 Common/FileHash.m delete mode 100644 Common/FileMD5Hash.c delete mode 100644 Common/FileMD5Hash.h delete mode 100644 Common/FileMD5Hash_Prefix.pch diff --git a/Common/FileHash.h b/Common/FileHash.h new file mode 100644 index 0000000..3c1d913 --- /dev/null +++ b/Common/FileHash.h @@ -0,0 +1,27 @@ +/* + * FileHash.h + * FileMD5Hash + * + * Copyright © 2010 Joel Lopes Da Silva. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +@interface FileHash : NSObject + ++ (NSString *)md5HashOfFileAtPath:(NSString *)filePath; + +@end diff --git a/Common/FileHash.m b/Common/FileHash.m new file mode 100644 index 0000000..dab4813 --- /dev/null +++ b/Common/FileHash.m @@ -0,0 +1,87 @@ +/* + * FileHash.c + * FileMD5Hash + * + * Copyright © 2010 Joel Lopes Da Silva. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Header file +#import "FileHash.h" + +// System framework and libraries +#include +#include +#include +#include + +// Constants +static const size_t FileHashDefaultChunkSizeForReadingData = 4096; + + +@implementation FileHash + ++ (NSString *)md5HashOfFileAtPath:(NSString *)filePath { + NSString *result = nil; + CFURLRef fileURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)filePath, kCFURLPOSIXPathStyle, (Boolean)false); + CFReadStreamRef readStream = fileURL ? CFReadStreamCreateWithFile(kCFAllocatorDefault, fileURL) : NULL; + BOOL didSucceed = readStream ? (BOOL)CFReadStreamOpen(readStream) : NO; + if (didSucceed) { + + // Use default value for the chunk size for reading data. + const size_t chunkSizeForReadingData = FileHashDefaultChunkSizeForReadingData; + + // Initialize the hash object + CC_MD5_CTX hashObject; + CC_MD5_Init(&hashObject); + + // Feed the data to the hash object. + BOOL hasMoreData = YES; + while (hasMoreData) { + uint8_t buffer[chunkSizeForReadingData]; + CFIndex readBytesCount = CFReadStreamRead(readStream, (UInt8 *)buffer, (CFIndex)sizeof(buffer)); + if (readBytesCount == -1) { + break; + } else if (readBytesCount == 0) { + hasMoreData = NO; + } else { + CC_MD5_Update(&hashObject, (const void *)buffer, (CC_LONG)readBytesCount); + } + } + + // Compute the hash digest + unsigned char digest[CC_MD5_DIGEST_LENGTH]; + CC_MD5_Final(digest, &hashObject); + + // Close the read stream. + CFReadStreamClose(readStream); + + // Proceed if the read operation succeeded. + didSucceed = !hasMoreData; + if (didSucceed) { + char hash[2 * sizeof(digest) + 1]; + for (size_t i = 0; i < sizeof(digest); ++i) { + snprintf(hash + (2 * i), 3, "%02x", (int)(digest[i])); + } + result = [NSString stringWithUTF8String:hash]; + } + + } + if (readStream) CFRelease(readStream); + if (fileURL) CFRelease(fileURL); + return result; +} + +@end diff --git a/Common/FileMD5Hash.c b/Common/FileMD5Hash.c deleted file mode 100644 index a889e51..0000000 --- a/Common/FileMD5Hash.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - * FileMD5Hash.c - * FileMD5Hash - * - * Copyright © 2010 Joel Lopes Da Silva. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -//--------------------------------------------------------- -// Includes -//--------------------------------------------------------- - -// Header file -#include "FileMD5Hash.h" - -// Standard library -#include -#include - -// Core Foundation -#include - -// Cryptography -#include - - -//--------------------------------------------------------- -// Function definition -//--------------------------------------------------------- - -CFStringRef FileMD5HashCreateWithPath(CFStringRef filePath, - size_t chunkSizeForReadingData) { - - // Declare needed variables - CFStringRef result = NULL; - CFReadStreamRef readStream = NULL; - - // Get the file URL - CFURLRef fileURL = - CFURLCreateWithFileSystemPath(kCFAllocatorDefault, - (CFStringRef)filePath, - kCFURLPOSIXPathStyle, - (Boolean)false); - if (!fileURL) goto done; - - // Create and open the read stream - readStream = CFReadStreamCreateWithFile(kCFAllocatorDefault, - (CFURLRef)fileURL); - if (!readStream) goto done; - bool didSucceed = (bool)CFReadStreamOpen(readStream); - if (!didSucceed) goto done; - - // Initialize the hash object - CC_MD5_CTX hashObject; - CC_MD5_Init(&hashObject); - - // Make sure chunkSizeForReadingData is valid - if (!chunkSizeForReadingData) { - chunkSizeForReadingData = FileHashDefaultChunkSizeForReadingData; - } - - // Feed the data to the hash object - bool hasMoreData = true; - while (hasMoreData) { - uint8_t buffer[chunkSizeForReadingData]; - CFIndex readBytesCount = CFReadStreamRead(readStream, - (UInt8 *)buffer, - (CFIndex)sizeof(buffer)); - if (readBytesCount == -1) break; - if (readBytesCount == 0) { - hasMoreData = false; - continue; - } - CC_MD5_Update(&hashObject, - (const void *)buffer, - (CC_LONG)readBytesCount); - } - - // Check if the read operation succeeded - didSucceed = !hasMoreData; - - // Compute the hash digest - unsigned char digest[CC_MD5_DIGEST_LENGTH]; - CC_MD5_Final(digest, &hashObject); - - // Abort if the read operation failed - if (!didSucceed) goto done; - - // Compute the string result - char hash[2 * sizeof(digest) + 1]; - for (size_t i = 0; i < sizeof(digest); ++i) { - snprintf(hash + (2 * i), 3, "%02x", (int)(digest[i])); - } - result = CFStringCreateWithCString(kCFAllocatorDefault, - (const char *)hash, - kCFStringEncodingUTF8); - -done: - - if (readStream) { - CFReadStreamClose(readStream); - CFRelease(readStream); - } - if (fileURL) { - CFRelease(fileURL); - } - return result; -} diff --git a/Common/FileMD5Hash.h b/Common/FileMD5Hash.h deleted file mode 100644 index 3f6726b..0000000 --- a/Common/FileMD5Hash.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * FileMD5Hash.h - * FileMD5Hash - * - * Copyright © 2010 Joel Lopes Da Silva. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef FILEMD5HASH_H -#define FILEMD5HASH_H - -//--------------------------------------------------------- -// Macros -//--------------------------------------------------------- - -// Extern -#if defined(__cplusplus) - #define FILEMD5HASH_EXTERN extern "C" -#else - #define FILEMD5HASH_EXTERN extern -#endif - -//--------------------------------------------------------- -// Includes -//--------------------------------------------------------- - -// Core Foundation -#include - - -//--------------------------------------------------------- -// Constant declaration -//--------------------------------------------------------- - -// In bytes -#define FileHashDefaultChunkSizeForReadingData 4096 - - -//--------------------------------------------------------- -// Function declaration -//--------------------------------------------------------- - -FILEMD5HASH_EXTERN CFStringRef FileMD5HashCreateWithPath(CFStringRef filePath, - size_t chunkSizeForReadingData); - - -#endif diff --git a/Common/FileMD5Hash_Prefix.pch b/Common/FileMD5Hash_Prefix.pch deleted file mode 100644 index 60b024c..0000000 --- a/Common/FileMD5Hash_Prefix.pch +++ /dev/null @@ -1,48 +0,0 @@ -/* - * FileMD5Hash_Prefix.pch - * FileMD5Hash - * - * Copyright © 2010 Joel Lopes Da Silva. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -//--------------------------------------------------------- -// Includes and imports -//--------------------------------------------------------- - -// Target conditionals -#include - -// General imports for Objective-C -#ifdef __OBJC__ - #if TARGET_OS_IPHONE - #import - #import - #elif TARGET_OS_MAC - #import - #endif -#endif - - -//--------------------------------------------------------- -// Macros -//--------------------------------------------------------- - -// Extern -#if defined(__cplusplus) - #define FILEMD5HASH_EXTERN extern "C" -#else - #define FILEMD5HASH_EXTERN extern -#endif diff --git a/FileMD5Hash.podspec b/FileMD5Hash.podspec index 30deff8..650f897 100644 --- a/FileMD5Hash.podspec +++ b/FileMD5Hash.podspec @@ -1,11 +1,10 @@ Pod::Spec.new do |spec| spec.name = 'FileMD5Hash' - spec.version = '1.0.0' + spec.version = '2.0.0-pre' spec.license = 'Apache License, Version 2.0' spec.summary = 'Library for computing MD5 hashes of files with small memory usage.' spec.homepage = 'https://github.com/JoeKun/FileMD5Hash' spec.author = { 'Joel Lopes Da Silva' => 'joel@lopes-da-silva.com' } spec.source = { :git => 'https://github.com/JoeKun/FileMD5Hash.git', :tag => '1.0.0' } - spec.prefix_header_file = 'Common/FileMD5Hash_Prefix.pch' - spec.source_files = 'Common/*.{h,c}' + spec.source_files = 'Common/*.{h,m}' end diff --git a/FileMD5Hash.xcodeproj/project.pbxproj b/FileMD5Hash.xcodeproj/project.pbxproj index 886bb4f..9da7812 100644 --- a/FileMD5Hash.xcodeproj/project.pbxproj +++ b/FileMD5Hash.xcodeproj/project.pbxproj @@ -11,12 +11,12 @@ 5DC8CD9C126AF59300CE5F6B /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5DC8CD9B126AF59300CE5F6B /* MainMenu.xib */; }; 5DC8CD9E126AF5F300CE5F6B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC8CD9D126AF5F300CE5F6B /* main.m */; }; 5DC8CDC2126AF93100CE5F6B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC8CDC1126AF93100CE5F6B /* AppDelegate.m */; }; - 5DC8CDF7126AFFB700CE5F6B /* FileMD5Hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 5DE28614126AD4EB0092F897 /* FileMD5Hash.c */; }; + 5DC8CDF7126AFFB700CE5F6B /* FileHash.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE28614126AD4EB0092F897 /* FileHash.m */; }; 5DC8CEB4126B01FC00CE5F6B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC8CEB3126B01FC00CE5F6B /* Cocoa.framework */; }; 5DE285F3126ACE760092F897 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE285DB126ACE110092F897 /* main.m */; }; 5DE285F4126ACE7B0092F897 /* MainWindow_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5DE285D6126ACE110092F897 /* MainWindow_iPad.xib */; }; 5DE285F5126ACE7D0092F897 /* MainWindow_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5DE285DA126ACE110092F897 /* MainWindow_iPhone.xib */; }; - 5DE28616126AD5230092F897 /* FileMD5Hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 5DE28614126AD4EB0092F897 /* FileMD5Hash.c */; }; + 5DE28616126AD5230092F897 /* FileHash.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE28614126AD4EB0092F897 /* FileHash.m */; }; 5DF37931126AE8A200DC3A70 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DF37930126AE85C00DC3A70 /* AppDelegate.m */; }; 5DF37A0B126AEB3300DC3A70 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DF37A0A126AEB3300DC3A70 /* Foundation.framework */; }; /* End PBXBuildFile section */ @@ -35,9 +35,8 @@ 5DE285D6126ACE110092F897 /* MainWindow_iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow_iPad.xib; sourceTree = ""; }; 5DE285DA126ACE110092F897 /* MainWindow_iPhone.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow_iPhone.xib; sourceTree = ""; }; 5DE285DB126ACE110092F897 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 5DE28614126AD4EB0092F897 /* FileMD5Hash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = FileMD5Hash.c; sourceTree = ""; }; - 5DE28615126AD4EB0092F897 /* FileMD5Hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMD5Hash.h; sourceTree = ""; }; - 5DF378DA126AD84000DC3A70 /* FileMD5Hash_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMD5Hash_Prefix.pch; sourceTree = ""; }; + 5DE28614126AD4EB0092F897 /* FileHash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileHash.m; sourceTree = ""; }; + 5DE28615126AD4EB0092F897 /* FileHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileHash.h; sourceTree = ""; }; 5DF3792F126AE85C00DC3A70 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 5DF37930126AE85C00DC3A70 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 5DF37A0A126AEB3300DC3A70 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; @@ -155,9 +154,8 @@ 5DE28613126AD4EB0092F897 /* Common */ = { isa = PBXGroup; children = ( - 5DF378DA126AD84000DC3A70 /* FileMD5Hash_Prefix.pch */, - 5DE28615126AD4EB0092F897 /* FileMD5Hash.h */, - 5DE28614126AD4EB0092F897 /* FileMD5Hash.c */, + 5DE28615126AD4EB0092F897 /* FileHash.h */, + 5DE28614126AD4EB0092F897 /* FileHash.m */, ); path = Common; sourceTree = ""; @@ -204,6 +202,8 @@ /* Begin PBXProject section */ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; + attributes = { + }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "FileMD5Hash" */; compatibilityVersion = "Xcode 3.1"; developmentRegion = English; @@ -250,7 +250,7 @@ buildActionMask = 2147483647; files = ( 5DF37931126AE8A200DC3A70 /* AppDelegate.m in Sources */, - 5DE28616126AD5230092F897 /* FileMD5Hash.c in Sources */, + 5DE28616126AD5230092F897 /* FileHash.m in Sources */, 5DE285F3126ACE760092F897 /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -260,7 +260,7 @@ buildActionMask = 2147483647; files = ( 5DC8CDC2126AF93100CE5F6B /* AppDelegate.m in Sources */, - 5DC8CDF7126AFFB700CE5F6B /* FileMD5Hash.c in Sources */, + 5DC8CDF7126AFFB700CE5F6B /* FileHash.m in Sources */, 5DC8CD9E126AF5F300CE5F6B /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -275,8 +275,6 @@ COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Common/FileMD5Hash_Prefix.pch; INFOPLIST_FILE = "iOS/FileMD5Hash-Info.plist"; PRODUCT_NAME = FileMD5Hash; }; @@ -287,8 +285,6 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Common/FileMD5Hash_Prefix.pch; INFOPLIST_FILE = "iOS/FileMD5Hash-Info.plist"; PRODUCT_NAME = FileMD5Hash; VALIDATE_PRODUCT = YES; @@ -305,8 +301,6 @@ GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Common/FileMD5Hash_Prefix.pch; INFOPLIST_FILE = "Mac/FileMD5Hash-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; OTHER_LDFLAGS = ( @@ -330,8 +324,6 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Common/FileMD5Hash_Prefix.pch; INFOPLIST_FILE = "Mac/FileMD5Hash-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; OTHER_LDFLAGS = ( diff --git a/Mac/AppDelegate.h b/Mac/AppDelegate.h index adcb4e3..3a6d5d4 100644 --- a/Mac/AppDelegate.h +++ b/Mac/AppDelegate.h @@ -18,24 +18,14 @@ * */ -//--------------------------------------------------------- -// Imports -//--------------------------------------------------------- - -// Cocoa #import -//--------------------------------------------------------- -// Interface declaration -//--------------------------------------------------------- - @interface AppDelegate : NSObject { NSWindow *window; NSTextField *label; } - #pragma mark - #pragma mark Properties @@ -48,5 +38,4 @@ - (IBAction)computeMD5HashOfBinary:(id)sender; - @end diff --git a/Mac/AppDelegate.m b/Mac/AppDelegate.m index 99e87c3..9f554da 100644 --- a/Mac/AppDelegate.m +++ b/Mac/AppDelegate.m @@ -18,24 +18,12 @@ * */ -//--------------------------------------------------------- -// Imports -//--------------------------------------------------------- - -// Header file #import "AppDelegate.h" +#import "FileHash.h" -// FileMD5Hash -#include "FileMD5Hash.h" - - -//--------------------------------------------------------- -// Interface declaration -//--------------------------------------------------------- @implementation AppDelegate - #pragma mark - #pragma mark Properties @@ -51,20 +39,13 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { } - #pragma mark - #pragma mark Actions - (IBAction)computeMD5HashOfBinary:(id)sender { NSString *executablePath = [[NSBundle mainBundle] executablePath]; - CFStringRef executableFileMD5Hash = - FileMD5HashCreateWithPath((CFStringRef)executablePath, - FileHashDefaultChunkSizeForReadingData); - if (executableFileMD5Hash) { - [[self label] setStringValue:((NSString *)executableFileMD5Hash)]; - CFRelease(executableFileMD5Hash); - } + NSString *executableFileMD5Hash = [FileHash md5HashOfFileAtPath:executablePath]; + [[self label] setStringValue:executableFileMD5Hash ? executableFileMD5Hash : @""]; } - @end diff --git a/Mac/main.m b/Mac/main.m index 22bf7b3..a5cfcc2 100644 --- a/Mac/main.m +++ b/Mac/main.m @@ -18,18 +18,8 @@ * */ -//--------------------------------------------------------- -// Imports -//--------------------------------------------------------- - -// Cocoa #import - -//--------------------------------------------------------- -// Main entry point -//--------------------------------------------------------- - int main(int argc, const char *argv[]) { return NSApplicationMain(argc, argv); } diff --git a/iOS/AppDelegate.h b/iOS/AppDelegate.h index 5e4d000..3c7d681 100644 --- a/iOS/AppDelegate.h +++ b/iOS/AppDelegate.h @@ -18,24 +18,14 @@ * */ -//--------------------------------------------------------- -// Imports -//--------------------------------------------------------- - -// UIKit #import -//--------------------------------------------------------- -// Interface declaration -//--------------------------------------------------------- - @interface AppDelegate : NSObject { UIWindow *window; UILabel *label; } - #pragma mark - #pragma mark Properties @@ -48,5 +38,4 @@ - (IBAction)computeMD5HashOfBinary:(id)sender; - @end diff --git a/iOS/AppDelegate.m b/iOS/AppDelegate.m index 51ee66a..75aa930 100644 --- a/iOS/AppDelegate.m +++ b/iOS/AppDelegate.m @@ -18,24 +18,12 @@ * */ -//--------------------------------------------------------- -// Imports -//--------------------------------------------------------- - -// Header file #import "AppDelegate.h" - -// FileMD5Hash -#include "FileMD5Hash.h" +#import "FileHash.h" -//--------------------------------------------------------- -// Interface declaration -//--------------------------------------------------------- - @implementation AppDelegate - #pragma mark - #pragma mark Deallocation @@ -106,13 +94,8 @@ - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - (IBAction)computeMD5HashOfBinary:(id)sender { NSString *executablePath = [[NSBundle mainBundle] executablePath]; - CFStringRef executableFileMD5Hash = - FileMD5HashCreateWithPath((CFStringRef)executablePath, - FileHashDefaultChunkSizeForReadingData); - if (executableFileMD5Hash) { - [[self label] setText:((NSString *)executableFileMD5Hash)]; - CFRelease(executableFileMD5Hash); - } + NSString *executableFileMD5Hash = [FileHash md5HashOfFileAtPath:executablePath]; + [[self label] setText:executableFileMD5Hash]; } diff --git a/iOS/main.m b/iOS/main.m index 843470c..dcf7e2a 100644 --- a/iOS/main.m +++ b/iOS/main.m @@ -18,18 +18,8 @@ * */ -//--------------------------------------------------------- -// Imports -//--------------------------------------------------------- - -// UIKit #import - -//--------------------------------------------------------- -// Main entry point -//--------------------------------------------------------- - int main(int argc, char *argv[]) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; int result = UIApplicationMain(argc, argv, nil, nil); From 52ae0651fb01744c7755b40bf7047e2f6cfff767 Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Sun, 19 Jan 2014 16:47:32 -0800 Subject: [PATCH 10/20] Modernize sample applications. --- Common/FileHash.h | 2 +- Common/FileHash.m | 2 +- FileMD5Hash.xcodeproj/project.pbxproj | 181 +- Mac/AppDelegate.m | 51 - Mac/FileMD5Hash-Info.plist | 2 +- Mac/{main.m => FileMD5Hash.m} | 4 +- Mac/FileMD5Hash.xib | 110 + ...ate.h => FileMD5HashApplicationDelegate.h} | 22 +- Mac/FileMD5HashApplicationDelegate.m | 68 + Mac/FileMD5HashViewController.h | 25 + Mac/FileMD5HashViewController.m | 99 + Mac/MainMenu.xib | 3887 ----------------- iOS/AppDelegate.m | 102 - iOS/FileMD5Hash-Info.plist | 10 - iOS/FileMD5Hash.m | 30 + ...ain.m => FileMD5HashApplicationDelegate.h} | 15 +- iOS/FileMD5HashApplicationDelegate.m | 53 + ...Delegate.h => FileMD5HashViewController.h} | 22 +- iOS/FileMD5HashViewController.m | 92 + iOS/iPad/MainWindow_iPad.xib | 521 --- iOS/iPhone/MainWindow_iPhone.xib | 537 --- 21 files changed, 612 insertions(+), 5223 deletions(-) delete mode 100644 Mac/AppDelegate.m rename Mac/{main.m => FileMD5Hash.m} (89%) create mode 100644 Mac/FileMD5Hash.xib rename Mac/{AppDelegate.h => FileMD5HashApplicationDelegate.h} (60%) create mode 100644 Mac/FileMD5HashApplicationDelegate.m create mode 100644 Mac/FileMD5HashViewController.h create mode 100644 Mac/FileMD5HashViewController.m delete mode 100644 Mac/MainMenu.xib delete mode 100644 iOS/AppDelegate.m create mode 100644 iOS/FileMD5Hash.m rename iOS/{main.m => FileMD5HashApplicationDelegate.h} (70%) create mode 100644 iOS/FileMD5HashApplicationDelegate.m rename iOS/{AppDelegate.h => FileMD5HashViewController.h} (59%) create mode 100644 iOS/FileMD5HashViewController.m delete mode 100644 iOS/iPad/MainWindow_iPad.xib delete mode 100644 iOS/iPhone/MainWindow_iPhone.xib diff --git a/Common/FileHash.h b/Common/FileHash.h index 3c1d913..daac092 100644 --- a/Common/FileHash.h +++ b/Common/FileHash.h @@ -2,7 +2,7 @@ * FileHash.h * FileMD5Hash * - * Copyright © 2010 Joel Lopes Da Silva. All rights reserved. + * Copyright © 2010-2014 Joel Lopes Da Silva. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Common/FileHash.m b/Common/FileHash.m index dab4813..c899af5 100644 --- a/Common/FileHash.m +++ b/Common/FileHash.m @@ -2,7 +2,7 @@ * FileHash.c * FileMD5Hash * - * Copyright © 2010 Joel Lopes Da Silva. All rights reserved. + * Copyright © 2010-2014 Joel Lopes Da Silva. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/FileMD5Hash.xcodeproj/project.pbxproj b/FileMD5Hash.xcodeproj/project.pbxproj index 9da7812..2861b80 100644 --- a/FileMD5Hash.xcodeproj/project.pbxproj +++ b/FileMD5Hash.xcodeproj/project.pbxproj @@ -8,37 +8,39 @@ /* Begin PBXBuildFile section */ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; - 5DC8CD9C126AF59300CE5F6B /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5DC8CD9B126AF59300CE5F6B /* MainMenu.xib */; }; - 5DC8CD9E126AF5F300CE5F6B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC8CD9D126AF5F300CE5F6B /* main.m */; }; - 5DC8CDC2126AF93100CE5F6B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC8CDC1126AF93100CE5F6B /* AppDelegate.m */; }; + 5D87FF68188C9B560052ABE3 /* FileMD5HashViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D87FF67188C9B560052ABE3 /* FileMD5HashViewController.m */; }; + 5D87FF6B188CA3D10052ABE3 /* FileMD5HashViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D87FF6A188CA3D10052ABE3 /* FileMD5HashViewController.m */; }; + 5DC8CD9C126AF59300CE5F6B /* FileMD5Hash.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5DC8CD9B126AF59300CE5F6B /* FileMD5Hash.xib */; }; + 5DC8CD9E126AF5F300CE5F6B /* FileMD5Hash.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC8CD9D126AF5F300CE5F6B /* FileMD5Hash.m */; }; + 5DC8CDC2126AF93100CE5F6B /* FileMD5HashApplicationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC8CDC1126AF93100CE5F6B /* FileMD5HashApplicationDelegate.m */; }; 5DC8CDF7126AFFB700CE5F6B /* FileHash.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE28614126AD4EB0092F897 /* FileHash.m */; }; 5DC8CEB4126B01FC00CE5F6B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DC8CEB3126B01FC00CE5F6B /* Cocoa.framework */; }; - 5DE285F3126ACE760092F897 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE285DB126ACE110092F897 /* main.m */; }; - 5DE285F4126ACE7B0092F897 /* MainWindow_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5DE285D6126ACE110092F897 /* MainWindow_iPad.xib */; }; - 5DE285F5126ACE7D0092F897 /* MainWindow_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5DE285DA126ACE110092F897 /* MainWindow_iPhone.xib */; }; + 5DE285F3126ACE760092F897 /* FileMD5Hash.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE285DB126ACE110092F897 /* FileMD5Hash.m */; }; 5DE28616126AD5230092F897 /* FileHash.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE28614126AD4EB0092F897 /* FileHash.m */; }; - 5DF37931126AE8A200DC3A70 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DF37930126AE85C00DC3A70 /* AppDelegate.m */; }; + 5DF37931126AE8A200DC3A70 /* FileMD5HashApplicationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DF37930126AE85C00DC3A70 /* FileMD5HashApplicationDelegate.m */; }; 5DF37A0B126AEB3300DC3A70 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DF37A0A126AEB3300DC3A70 /* Foundation.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 1D6058910D05DD3D006BFB54 /* FileMD5Hash.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FileMD5Hash.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 5D87FF66188C9B560052ABE3 /* FileMD5HashViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMD5HashViewController.h; sourceTree = ""; }; + 5D87FF67188C9B560052ABE3 /* FileMD5HashViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileMD5HashViewController.m; sourceTree = ""; }; + 5D87FF69188CA3D10052ABE3 /* FileMD5HashViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMD5HashViewController.h; sourceTree = ""; }; + 5D87FF6A188CA3D10052ABE3 /* FileMD5HashViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileMD5HashViewController.m; sourceTree = ""; }; 5DC8CD7C126AF42700CE5F6B /* FileMD5Hash.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FileMD5Hash.app; sourceTree = BUILT_PRODUCTS_DIR; }; 5DC8CD84126AF49500CE5F6B /* FileMD5Hash-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "FileMD5Hash-Info.plist"; sourceTree = ""; }; - 5DC8CD9B126AF59300CE5F6B /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = ""; }; - 5DC8CD9D126AF5F300CE5F6B /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 5DC8CDC0126AF93100CE5F6B /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 5DC8CDC1126AF93100CE5F6B /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 5DC8CD9B126AF59300CE5F6B /* FileMD5Hash.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FileMD5Hash.xib; sourceTree = ""; }; + 5DC8CD9D126AF5F300CE5F6B /* FileMD5Hash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileMD5Hash.m; sourceTree = ""; }; + 5DC8CDC0126AF93100CE5F6B /* FileMD5HashApplicationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMD5HashApplicationDelegate.h; sourceTree = ""; }; + 5DC8CDC1126AF93100CE5F6B /* FileMD5HashApplicationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileMD5HashApplicationDelegate.m; sourceTree = ""; }; 5DC8CEB3126B01FC00CE5F6B /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 5DE285D1126ACE110092F897 /* FileMD5Hash-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "FileMD5Hash-Info.plist"; sourceTree = ""; }; - 5DE285D6126ACE110092F897 /* MainWindow_iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow_iPad.xib; sourceTree = ""; }; - 5DE285DA126ACE110092F897 /* MainWindow_iPhone.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow_iPhone.xib; sourceTree = ""; }; - 5DE285DB126ACE110092F897 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 5DE285DB126ACE110092F897 /* FileMD5Hash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileMD5Hash.m; sourceTree = ""; }; 5DE28614126AD4EB0092F897 /* FileHash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileHash.m; sourceTree = ""; }; 5DE28615126AD4EB0092F897 /* FileHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileHash.h; sourceTree = ""; }; - 5DF3792F126AE85C00DC3A70 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 5DF37930126AE85C00DC3A70 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 5DF3792F126AE85C00DC3A70 /* FileMD5HashApplicationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMD5HashApplicationDelegate.h; sourceTree = ""; }; + 5DF37930126AE85C00DC3A70 /* FileMD5HashApplicationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileMD5HashApplicationDelegate.m; sourceTree = ""; }; 5DF37A0A126AEB3300DC3A70 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -96,10 +98,12 @@ 5DC8CD83126AF49500CE5F6B /* Mac */ = { isa = PBXGroup; children = ( - 5DC8CDC0126AF93100CE5F6B /* AppDelegate.h */, - 5DC8CDC1126AF93100CE5F6B /* AppDelegate.m */, - 5DC8CD9B126AF59300CE5F6B /* MainMenu.xib */, - 5DC8CD9D126AF5F300CE5F6B /* main.m */, + 5DC8CDC0126AF93100CE5F6B /* FileMD5HashApplicationDelegate.h */, + 5DC8CDC1126AF93100CE5F6B /* FileMD5HashApplicationDelegate.m */, + 5D87FF69188CA3D10052ABE3 /* FileMD5HashViewController.h */, + 5D87FF6A188CA3D10052ABE3 /* FileMD5HashViewController.m */, + 5DC8CD9B126AF59300CE5F6B /* FileMD5Hash.xib */, + 5DC8CD9D126AF5F300CE5F6B /* FileMD5Hash.m */, 5DC8CD84126AF49500CE5F6B /* FileMD5Hash-Info.plist */, ); path = Mac; @@ -125,32 +129,16 @@ 5DE285D0126ACE110092F897 /* iOS */ = { isa = PBXGroup; children = ( - 5DF3792F126AE85C00DC3A70 /* AppDelegate.h */, - 5DF37930126AE85C00DC3A70 /* AppDelegate.m */, - 5DE285D3126ACE110092F897 /* iPad */, - 5DE285D7126ACE110092F897 /* iPhone */, - 5DE285DB126ACE110092F897 /* main.m */, + 5DF3792F126AE85C00DC3A70 /* FileMD5HashApplicationDelegate.h */, + 5DF37930126AE85C00DC3A70 /* FileMD5HashApplicationDelegate.m */, + 5D87FF66188C9B560052ABE3 /* FileMD5HashViewController.h */, + 5D87FF67188C9B560052ABE3 /* FileMD5HashViewController.m */, + 5DE285DB126ACE110092F897 /* FileMD5Hash.m */, 5DE285D1126ACE110092F897 /* FileMD5Hash-Info.plist */, ); path = iOS; sourceTree = ""; }; - 5DE285D3126ACE110092F897 /* iPad */ = { - isa = PBXGroup; - children = ( - 5DE285D6126ACE110092F897 /* MainWindow_iPad.xib */, - ); - path = iPad; - sourceTree = ""; - }; - 5DE285D7126ACE110092F897 /* iPhone */ = { - isa = PBXGroup; - children = ( - 5DE285DA126ACE110092F897 /* MainWindow_iPhone.xib */, - ); - path = iPhone; - sourceTree = ""; - }; 5DE28613126AD4EB0092F897 /* Common */ = { isa = PBXGroup; children = ( @@ -229,8 +217,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 5DE285F5126ACE7D0092F897 /* MainWindow_iPhone.xib in Resources */, - 5DE285F4126ACE7B0092F897 /* MainWindow_iPad.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -238,7 +224,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 5DC8CD9C126AF59300CE5F6B /* MainMenu.xib in Resources */, + 5DC8CD9C126AF59300CE5F6B /* FileMD5Hash.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -249,9 +235,10 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 5DF37931126AE8A200DC3A70 /* AppDelegate.m in Sources */, + 5DF37931126AE8A200DC3A70 /* FileMD5HashApplicationDelegate.m in Sources */, 5DE28616126AD5230092F897 /* FileHash.m in Sources */, - 5DE285F3126ACE760092F897 /* main.m in Sources */, + 5DE285F3126ACE760092F897 /* FileMD5Hash.m in Sources */, + 5D87FF68188C9B560052ABE3 /* FileMD5HashViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -259,9 +246,10 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 5DC8CDC2126AF93100CE5F6B /* AppDelegate.m in Sources */, + 5DC8CDC2126AF93100CE5F6B /* FileMD5HashApplicationDelegate.m in Sources */, 5DC8CDF7126AFFB700CE5F6B /* FileHash.m in Sources */, - 5DC8CD9E126AF5F300CE5F6B /* main.m in Sources */, + 5DC8CD9E126AF5F300CE5F6B /* FileMD5Hash.m in Sources */, + 5D87FF6B188CA3D10052ABE3 /* FileMD5HashViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -272,7 +260,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; INFOPLIST_FILE = "iOS/FileMD5Hash-Info.plist"; @@ -284,7 +271,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; INFOPLIST_FILE = "iOS/FileMD5Hash-Info.plist"; PRODUCT_NAME = FileMD5Hash; VALIDATE_PRODUCT = YES; @@ -295,7 +281,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; @@ -303,6 +289,7 @@ GCC_OPTIMIZATION_LEVEL = 0; INFOPLIST_FILE = "Mac/FileMD5Hash-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + MACOSX_DEPLOYMENT_TARGET = 10.8; OTHER_LDFLAGS = ( "-framework", Foundation, @@ -311,7 +298,7 @@ ); PREBINDING = NO; PRODUCT_NAME = FileMD5Hash; - SDKROOT = macosx10.6; + SDKROOT = macosx; }; name = Debug; }; @@ -319,13 +306,13 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_MODEL_TUNING = G5; INFOPLIST_FILE = "Mac/FileMD5Hash-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + MACOSX_DEPLOYMENT_TARGET = 10.8; OTHER_LDFLAGS = ( "-framework", Foundation, @@ -334,7 +321,7 @@ ); PREBINDING = NO; PRODUCT_NAME = FileMD5Hash; - SDKROOT = macosx10.6; + SDKROOT = macosx; ZERO_LINK = NO; }; name = Release; @@ -342,14 +329,46 @@ C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_CXX0X_EXTENSIONS = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = c99; + GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; + GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_PEDANTIC = YES; + GCC_WARN_SHADOW = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_STRICT_SELECTOR_MATCH = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNKNOWN_PRAGMAS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 3.2; - PREBINDING = NO; - SDKROOT = iphoneos4.1; + SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -357,15 +376,47 @@ C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_CXX0X_EXTENSIONS = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = c99; + GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; + GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_PEDANTIC = YES; + GCC_WARN_SHADOW = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_STRICT_SELECTOR_MATCH = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNKNOWN_PRAGMAS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 3.2; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - PREBINDING = NO; - SDKROOT = iphoneos4.1; + SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/Mac/AppDelegate.m b/Mac/AppDelegate.m deleted file mode 100644 index 9f554da..0000000 --- a/Mac/AppDelegate.m +++ /dev/null @@ -1,51 +0,0 @@ -/* - * AppDelegate.m - * FileMD5Hash - * - * Copyright © 2010 Joel Lopes Da Silva. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#import "AppDelegate.h" -#import "FileHash.h" - - -@implementation AppDelegate - -#pragma mark - -#pragma mark Properties - -@synthesize window; -@synthesize label; - - -#pragma mark - -#pragma mark Application lifecycle - -- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - // Insert code here to initialize your application -} - - -#pragma mark - -#pragma mark Actions - -- (IBAction)computeMD5HashOfBinary:(id)sender { - NSString *executablePath = [[NSBundle mainBundle] executablePath]; - NSString *executableFileMD5Hash = [FileHash md5HashOfFileAtPath:executablePath]; - [[self label] setStringValue:executableFileMD5Hash ? executableFileMD5Hash : @""]; -} - -@end diff --git a/Mac/FileMD5Hash-Info.plist b/Mac/FileMD5Hash-Info.plist index da6e361..809b6d3 100644 --- a/Mac/FileMD5Hash-Info.plist +++ b/Mac/FileMD5Hash-Info.plist @@ -21,7 +21,7 @@ LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSMainNibFile - MainMenu + FileMD5Hash NSPrincipalClass NSApplication diff --git a/Mac/main.m b/Mac/FileMD5Hash.m similarity index 89% rename from Mac/main.m rename to Mac/FileMD5Hash.m index a5cfcc2..1407597 100644 --- a/Mac/main.m +++ b/Mac/FileMD5Hash.m @@ -1,8 +1,8 @@ /* - * main.m + * FileMD5Hash.m * FileMD5Hash * - * Copyright © 2010 Joel Lopes Da Silva. All rights reserved. + * Copyright © 2010-2014 Joel Lopes Da Silva. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Mac/FileMD5Hash.xib b/Mac/FileMD5Hash.xib new file mode 100644 index 0000000..f32688e --- /dev/null +++ b/Mac/FileMD5Hash.xib @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Mac/AppDelegate.h b/Mac/FileMD5HashApplicationDelegate.h similarity index 60% rename from Mac/AppDelegate.h rename to Mac/FileMD5HashApplicationDelegate.h index 3a6d5d4..c5b719d 100644 --- a/Mac/AppDelegate.h +++ b/Mac/FileMD5HashApplicationDelegate.h @@ -1,8 +1,8 @@ /* - * AppDelegate.h + * FileMD5HashApplicationDelegate.h * FileMD5Hash * - * Copyright © 2010 Joel Lopes Da Silva. All rights reserved. + * Copyright © 2010-2014 Joel Lopes Da Silva. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,22 +20,8 @@ #import +@interface FileMD5HashApplicationDelegate : NSObject -@interface AppDelegate : NSObject { - NSWindow *window; - NSTextField *label; -} - -#pragma mark - -#pragma mark Properties - -@property (assign) IBOutlet NSWindow *window; -@property (assign) IBOutlet NSTextField *label; - - -#pragma mark - -#pragma mark Actions - -- (IBAction)computeMD5HashOfBinary:(id)sender; +@property (nonatomic, strong) IBOutlet NSWindow *window; @end diff --git a/Mac/FileMD5HashApplicationDelegate.m b/Mac/FileMD5HashApplicationDelegate.m new file mode 100644 index 0000000..02feeb3 --- /dev/null +++ b/Mac/FileMD5HashApplicationDelegate.m @@ -0,0 +1,68 @@ +/* + * FileMD5HashApplicationDelegate.m + * FileMD5Hash + * + * Copyright © 2010-2014 Joel Lopes Da Silva. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Header file +#import "FileMD5HashApplicationDelegate.h" + +// View controller +#import "FileMD5HashViewController.h" + + +#pragma mark - +#pragma mark Private extension + +@interface FileMD5HashApplicationDelegate () + +@property (nonatomic, strong) FileMD5HashViewController *viewController; + +@end + + +#pragma mark - + +@implementation FileMD5HashApplicationDelegate + +#pragma mark - +#pragma mark Deallocation + +- (void)dealloc { + self.viewController = nil; + self.window = nil; + [super dealloc]; +} + + +#pragma mark - +#pragma mark Application lifecycle + +- (void)applicationDidFinishLaunching:(NSNotification *)notification { + NSWindow *window = self.window; + FileMD5HashViewController *viewController = [FileMD5HashViewController new]; + NSView *view = viewController.view; + NSRect frame = window.frame; + frame.origin = NSZeroPoint; + view.frame = frame; + view.autoresizingMask = (NSViewMinXMargin | NSViewWidthSizable | NSViewMaxXMargin | NSViewMinYMargin | NSViewHeightSizable | NSViewMaxYMargin); + window.contentView = view; + self.viewController = viewController; + [viewController release]; +} + +@end diff --git a/Mac/FileMD5HashViewController.h b/Mac/FileMD5HashViewController.h new file mode 100644 index 0000000..3343c3c --- /dev/null +++ b/Mac/FileMD5HashViewController.h @@ -0,0 +1,25 @@ +/* + * FileMD5HashViewController.h + * FileMD5Hash + * + * Copyright © 2010-2014 Joel Lopes Da Silva. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +@interface FileMD5HashViewController : NSViewController + +@end diff --git a/Mac/FileMD5HashViewController.m b/Mac/FileMD5HashViewController.m new file mode 100644 index 0000000..956c922 --- /dev/null +++ b/Mac/FileMD5HashViewController.m @@ -0,0 +1,99 @@ +/* + * FileMD5HashViewController.m + * FileMD5Hash + * + * Copyright © 2010-2014 Joel Lopes Da Silva. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Header file +#import "FileMD5HashViewController.h" + +// File hash +#import "FileHash.h" + + +#pragma mark - +#pragma mark Private extension + +@interface FileMD5HashViewController () + +@property (nonatomic, strong) NSButton *button; +@property (nonatomic, strong) NSTextField *label; + +@end + + +#pragma mark - + +@implementation FileMD5HashViewController + +#pragma mark - +#pragma mark Deallocation + +- (void)dealloc { + self.button.target = nil; + self.button.action = NULL; + self.button = nil; + self.label = nil; + [super dealloc]; +} + + +#pragma mark - +#pragma mark View lifecycle + +- (void)loadView { + NSView *view = [NSView new]; + + NSButton *button = [NSButton new]; + button.bezelStyle = NSRoundedBezelStyle; + button.title = @"Compute MD5 hash of executable file"; + button.target = self; + button.action = @selector(computeMD5HashOfExecutableFile:); + button.translatesAutoresizingMaskIntoConstraints = NO; + [view addSubview:button]; + [view addConstraint:[NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:0.0]]; + [view addConstraint:[NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:-30.0]]; + + NSTextField *label = [NSTextField new]; + label.bordered = NO; + label.selectable = NO; + label.alignment = NSCenterTextAlignment; + label.backgroundColor = [NSColor clearColor]; + label.translatesAutoresizingMaskIntoConstraints = NO; + [view addSubview:label]; + [view addConstraint:[NSLayoutConstraint constraintWithItem:label attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:0.0]]; + [view addConstraint:[NSLayoutConstraint constraintWithItem:label attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:30.0]]; + [view addConstraint:[NSLayoutConstraint constraintWithItem:label attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeWidth multiplier:1.0 constant:-30.0]]; + + self.view = view; + self.button = button; + self.label = label; + [label release]; + [view release]; +} + + +#pragma mark - +#pragma mark Button handler + +- (void)computeMD5HashOfExecutableFile:(id)sender { + NSString *executablePath = [[NSBundle mainBundle] executablePath]; + NSString *executableFileMD5Hash = [FileHash md5HashOfFileAtPath:executablePath]; + self.label.stringValue = executableFileMD5Hash ? executableFileMD5Hash : @"Error"; +} + +@end diff --git a/Mac/MainMenu.xib b/Mac/MainMenu.xib deleted file mode 100644 index 9305fbb..0000000 --- a/Mac/MainMenu.xib +++ /dev/null @@ -1,3887 +0,0 @@ - - - - 1060 - 10F569 - 804 - 1038.29 - 461.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 804 - - - YES - - - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - NSFontManager - - - Main Menu - - YES - - - FileMD5Hash - - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - FileMD5Hash - - YES - - - About FileMD5Hash - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Services - - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 2147483647 - - - - - - Hide FileMD5Hash - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Quit FileMD5Hash - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - File - - 2147483647 - - - submenuAction: - - File - - YES - - - New - n - 1048576 - 2147483647 - - - - - - Open… - o - 1048576 - 2147483647 - - - - - - Open Recent - - 2147483647 - - - submenuAction: - - Open Recent - - YES - - - Clear Menu - - 2147483647 - - - - - _NSRecentDocumentsMenu - - - - - YES - YES - - - 2147483647 - - - - - - Close - w - 1048576 - 2147483647 - - - - - - Save - s - 1048576 - 2147483647 - - - - - - Save As… - S - 1179648 - 2147483647 - - - - - - Revert to Saved - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - Print… - p - 1048576 - 2147483647 - - - - - - - - - Edit - - 2147483647 - - - submenuAction: - - Edit - - YES - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Paste and Match Style - V - 1572864 - 2147483647 - - - - - - Delete - - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Find - - 2147483647 - - - submenuAction: - - Find - - YES - - - Find… - f - 1048576 - 2147483647 - - - 1 - - - - Find Next - g - 1048576 - 2147483647 - - - 2 - - - - Find Previous - G - 1048576 - 2147483647 - - - 3 - - - - Use Selection for Find - e - 1048576 - 2147483647 - - - 7 - - - - Jump to Selection - j - 1048576 - 2147483647 - - - - - - - - - Spelling and Grammar - - 2147483647 - - - submenuAction: - - Spelling - - YES - - - Show Spelling and Grammar - : - 1048576 - 2147483647 - - - - - - Check Document Now - ; - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Check Spelling While Typing - - 2147483647 - - - - - - Check Grammar With Spelling - - 2147483647 - - - - - - Correct Spelling Automatically - - 2147483647 - - - - - - - - - Substitutions - - 2147483647 - - - submenuAction: - - Substitutions - - YES - - - Show Substitutions - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Smart Copy/Paste - - 2147483647 - - - - - - Smart Quotes - - 2147483647 - - - - - - Smart Dashes - - 2147483647 - - - - - - Smart Links - - 2147483647 - - - - - - Data Detectors - - 2147483647 - - - - - - Text Replacement - - 2147483647 - - - - - - - - - Transformations - - 2147483647 - - - submenuAction: - - Transformations - - YES - - - Make Upper Case - - 2147483647 - - - - - - Make Lower Case - - 2147483647 - - - - - - Capitalize - - 2147483647 - - - - - - - - - Speech - - 2147483647 - - - submenuAction: - - Speech - - YES - - - Start Speaking - - 2147483647 - - - - - - Stop Speaking - - 2147483647 - - - - - - - - - - - - Format - - 2147483647 - - - submenuAction: - - Format - - YES - - - Font - - 2147483647 - - - submenuAction: - - Font - - YES - - - Show Fonts - t - 1048576 - 2147483647 - - - - - - Bold - b - 1048576 - 2147483647 - - - 2 - - - - Italic - i - 1048576 - 2147483647 - - - 1 - - - - Underline - u - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bigger - + - 1048576 - 2147483647 - - - 3 - - - - Smaller - - - 1048576 - 2147483647 - - - 4 - - - - YES - YES - - - 2147483647 - - - - - - Kern - - 2147483647 - - - submenuAction: - - Kern - - YES - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Tighten - - 2147483647 - - - - - - Loosen - - 2147483647 - - - - - - - - - Ligature - - 2147483647 - - - submenuAction: - - Ligature - - YES - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Use All - - 2147483647 - - - - - - - - - Baseline - - 2147483647 - - - submenuAction: - - Baseline - - YES - - - Use Default - - 2147483647 - - - - - - Superscript - - 2147483647 - - - - - - Subscript - - 2147483647 - - - - - - Raise - - 2147483647 - - - - - - Lower - - 2147483647 - - - - - - - - - YES - YES - - - 2147483647 - - - - - - Show Colors - C - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Copy Style - c - 1572864 - 2147483647 - - - - - - Paste Style - v - 1572864 - 2147483647 - - - - - _NSFontMenu - - - - - Text - - 2147483647 - - - submenuAction: - - Text - - YES - - - Align Left - { - 1048576 - 2147483647 - - - - - - Center - | - 1048576 - 2147483647 - - - - - - Justify - - 2147483647 - - - - - - Align Right - } - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Writing Direction - - 2147483647 - - - submenuAction: - - Writing Direction - - YES - - - YES - Paragraph - - 2147483647 - - - - - - CURlZmF1bHQ - - 2147483647 - - - - - - CUxlZnQgdG8gUmlnaHQ - - 2147483647 - - - - - - CVJpZ2h0IHRvIExlZnQ - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - YES - Selection - - 2147483647 - - - - - - CURlZmF1bHQ - - 2147483647 - - - - - - CUxlZnQgdG8gUmlnaHQ - - 2147483647 - - - - - - CVJpZ2h0IHRvIExlZnQ - - 2147483647 - - - - - - - - - YES - YES - - - 2147483647 - - - - - - Show Ruler - - 2147483647 - - - - - - Copy Ruler - c - 1310720 - 2147483647 - - - - - - Paste Ruler - v - 1310720 - 2147483647 - - - - - - - - - - - - View - - 2147483647 - - - submenuAction: - - View - - YES - - - Show Toolbar - t - 1572864 - 2147483647 - - - - - - Customize Toolbar… - - 2147483647 - - - - - - - - - Window - - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bring All to Front - - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - YES - - - FileMD5Hash Help - ? - 1048576 - 2147483647 - - - - - _NSHelpMenu - - - - _NSMainMenu - - - 15 - 2 - {{235, 700}, {480, 270}} - 611844096 - FileMD5Hash - NSWindow - - {1.79769e+308, 1.79769e+308} - - - 301 - - YES - - - 301 - {{126, 190}, {227, 32}} - - YES - - 67239424 - 134217728 - Compute MD5 Hash of binary - - LucidaGrande - 13 - 1044 - - - -2038284033 - 129 - - - 200 - 25 - - - - - 301 - {{17, 130}, {446, 17}} - - YES - - 68288064 - 138413056 - - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - - - {480, 270} - - - {{0, 0}, {1920, 1178}} - {1.79769e+308, 1.79769e+308} - - - AppDelegate - - - - - YES - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - print: - - - - 86 - - - - runPageLayout: - - - - 87 - - - - clearRecentDocuments: - - - - 127 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - performClose: - - - - 193 - - - - performZoom: - - - - 240 - - - - showHelp: - - - - 360 - - - - saveDocument: - - - - 362 - - - - saveDocumentAs: - - - - 363 - - - - revertDocumentToSaved: - - - - 364 - - - - runToolbarCustomizationPalette: - - - - 365 - - - - toggleToolbarShown: - - - - 366 - - - - hide: - - - - 369 - - - - hideOtherApplications: - - - - 370 - - - - unhideAllApplications: - - - - 372 - - - - addFontTrait: - - - - 420 - - - - addFontTrait: - - - - 421 - - - - modifyFont: - - - - 422 - - - - orderFrontFontPanel: - - - - 423 - - - - modifyFont: - - - - 424 - - - - raiseBaseline: - - - - 425 - - - - lowerBaseline: - - - - 426 - - - - copyFont: - - - - 427 - - - - subscript: - - - - 428 - - - - superscript: - - - - 429 - - - - tightenKerning: - - - - 430 - - - - underline: - - - - 431 - - - - orderFrontColorPanel: - - - - 432 - - - - useAllLigatures: - - - - 433 - - - - loosenKerning: - - - - 434 - - - - pasteFont: - - - - 435 - - - - unscript: - - - - 436 - - - - useStandardKerning: - - - - 437 - - - - useStandardLigatures: - - - - 438 - - - - turnOffLigatures: - - - - 439 - - - - turnOffKerning: - - - - 440 - - - - terminate: - - - - 448 - - - - capitalizeWord: - - - - 740 - - - - cut: - - - - 741 - - - - paste: - - - - 742 - - - - toggleSmartInsertDelete: - - - - 743 - - - - toggleAutomaticQuoteSubstitution: - - - - 744 - - - - redo: - - - - 745 - - - - toggleAutomaticDashSubstitution: - - - - 746 - - - - toggleContinuousSpellChecking: - - - - 747 - - - - toggleAutomaticDataDetection: - - - - 748 - - - - undo: - - - - 749 - - - - toggleGrammarChecking: - - - - 750 - - - - startSpeaking: - - - - 751 - - - - showGuessPanel: - - - - 752 - - - - checkSpelling: - - - - 753 - - - - pasteAsPlainText: - - - - 754 - - - - copy: - - - - 755 - - - - delete: - - - - 756 - - - - lowercaseWord: - - - - 757 - - - - selectAll: - - - - 758 - - - - stopSpeaking: - - - - 759 - - - - orderFrontSubstitutionsPanel: - - - - 760 - - - - toggleAutomaticTextReplacement: - - - - 761 - - - - toggleAutomaticLinkDetection: - - - - 762 - - - - toggleAutomaticSpellingCorrection: - - - - 763 - - - - uppercaseWord: - - - - 764 - - - - performFindPanelAction: - - - - 771 - - - - performFindPanelAction: - - - - 772 - - - - performFindPanelAction: - - - - 773 - - - - centerSelectionInVisibleArea: - - - - 774 - - - - performFindPanelAction: - - - - 775 - - - - toggleRuler: - - - - 798 - - - - pasteRuler: - - - - 799 - - - - alignCenter: - - - - 800 - - - - copyRuler: - - - - 801 - - - - alignJustified: - - - - 802 - - - - alignRight: - - - - 803 - - - - alignLeft: - - - - 804 - - - - makeBaseWritingDirectionNatural: - - - - 805 - - - - makeBaseWritingDirectionLeftToRight: - - - - 806 - - - - makeBaseWritingDirectionRightToLeft: - - - - 807 - - - - makeTextWritingDirectionNatural: - - - - 808 - - - - makeTextWritingDirectionLeftToRight: - - - - 809 - - - - makeTextWritingDirectionRightToLeft: - - - - 810 - - - - window - - - - 812 - - - - delegate - - - - 813 - - - - label - - - - 820 - - - - computeMD5HashOfBinary: - - - - 821 - - - - - YES - - 0 - - YES - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 103 - - - YES - - - - - - 83 - - - YES - - - - - - 81 - - - YES - - - - - - - - - - - - - - - - 75 - - - - - 80 - - - - - 78 - - - - - 72 - - - - - 82 - - - - - 124 - - - YES - - - - - - 77 - - - - - 73 - - - - - 112 - - - - - 74 - - - - - 125 - - - YES - - - - - - 126 - - - - - 106 - - - YES - - - - - - 111 - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - - 297 - - - - - 298 - - - - - 367 - - - YES - - - - - - 368 - - - YES - - - - - - - 373 - - - - - 375 - - - YES - - - - - - 376 - - - YES - - - - - - - 377 - - - YES - - - - - - 388 - - - YES - - - - - - - - - - - - - - - - - - - - - 389 - - - - - 390 - - - - - 391 - - - - - 392 - - - - - 393 - - - - - 394 - - - - - 395 - - - - - 396 - - - - - 397 - - - YES - - - - - - 398 - - - YES - - - - - - 399 - - - YES - - - - - - 400 - - - - - 401 - - - - - 402 - - - - - 403 - - - - - 404 - - - - - 405 - - - YES - - - - - - - - - - 406 - - - - - 407 - - - - - 408 - - - - - 409 - - - - - 410 - - - - - 411 - - - YES - - - - - - - - 412 - - - - - 413 - - - - - 414 - - - - - 415 - - - YES - - - - - - - - - 416 - - - - - 417 - - - - - 418 - - - - - 419 - - - - - 79 - - - - - 684 - - - YES - - - - - - 685 - - - YES - - - - - - - - - - - - - - - - - - - - 686 - - - - - 687 - - - - - 688 - - - - - 689 - - - - - 690 - - - - - 691 - - - - - 692 - - - - - 693 - - - - - 694 - - - - - 695 - - - - - 696 - - - YES - - - - - - 697 - - - YES - - - - - - 698 - - - YES - - - - - - 699 - - - YES - - - - - - 700 - - - YES - - - - - - 711 - - - YES - - - - - - - 712 - - - - - 713 - - - - - 714 - - - YES - - - - - - - - 715 - - - - - 716 - - - - - 717 - - - - - 718 - - - YES - - - - - - - - - - - - - 719 - - - - - 720 - - - - - 721 - - - - - 722 - - - - - 723 - - - - - 724 - - - - - 725 - - - - - 726 - - - - - 727 - - - YES - - - - - - - - - - - 728 - - - - - 729 - - - - - 730 - - - - - 731 - - - - - 732 - - - - - 733 - - - - - 734 - - - YES - - - - - - - - - - 735 - - - - - 736 - - - - - 737 - - - - - 738 - - - - - 739 - - - - - 776 - - - YES - - - - - - 777 - - - YES - - - - - - - - - - - - - - - 778 - - - - - 779 - - - - - 780 - - - - - 781 - - - - - 782 - - - - - 783 - - - YES - - - - - - 784 - - - - - 785 - - - - - 786 - - - - - 787 - - - - - 788 - - - YES - - - - - - - - - - - - - - 789 - - - - - 790 - - - - - 791 - - - - - 792 - - - - - 793 - - - - - 794 - - - - - 795 - - - - - 796 - - - - - 797 - - - - - 811 - - - - - 816 - - - YES - - - - - - 817 - - - - - 818 - - - YES - - - - - - 819 - - - - - - - YES - - YES - -3.IBPluginDependency - 103.IBPluginDependency - 103.ImportedFromIB2 - 106.IBEditorWindowLastContentRect - 106.IBPluginDependency - 106.ImportedFromIB2 - 106.editorWindowContentRectSynchronizationRect - 111.IBPluginDependency - 111.ImportedFromIB2 - 112.IBPluginDependency - 112.ImportedFromIB2 - 124.IBPluginDependency - 124.ImportedFromIB2 - 125.IBEditorWindowLastContentRect - 125.IBPluginDependency - 125.ImportedFromIB2 - 125.editorWindowContentRectSynchronizationRect - 126.IBPluginDependency - 126.ImportedFromIB2 - 129.IBPluginDependency - 129.ImportedFromIB2 - 130.IBEditorWindowLastContentRect - 130.IBPluginDependency - 130.ImportedFromIB2 - 130.editorWindowContentRectSynchronizationRect - 131.IBPluginDependency - 131.ImportedFromIB2 - 134.IBPluginDependency - 134.ImportedFromIB2 - 136.IBPluginDependency - 136.ImportedFromIB2 - 143.IBPluginDependency - 143.ImportedFromIB2 - 144.IBPluginDependency - 144.ImportedFromIB2 - 145.IBPluginDependency - 145.ImportedFromIB2 - 149.IBPluginDependency - 149.ImportedFromIB2 - 150.IBPluginDependency - 150.ImportedFromIB2 - 19.IBPluginDependency - 19.ImportedFromIB2 - 23.IBPluginDependency - 23.ImportedFromIB2 - 236.IBPluginDependency - 236.ImportedFromIB2 - 239.IBPluginDependency - 239.ImportedFromIB2 - 24.IBEditorWindowLastContentRect - 24.IBPluginDependency - 24.ImportedFromIB2 - 24.editorWindowContentRectSynchronizationRect - 29.IBEditorWindowLastContentRect - 29.IBPluginDependency - 29.ImportedFromIB2 - 29.WindowOrigin - 29.editorWindowContentRectSynchronizationRect - 295.IBPluginDependency - 296.IBEditorWindowLastContentRect - 296.IBPluginDependency - 296.editorWindowContentRectSynchronizationRect - 297.IBPluginDependency - 298.IBPluginDependency - 367.IBEditorWindowLastContentRect - 367.IBPluginDependency - 367.IBWindowTemplateEditedContentRect - 367.NSWindowTemplate.visibleAtLaunch - 367.editorWindowContentRectSynchronizationRect - 367.windowTemplate.maxSize - 368.IBPluginDependency - 375.IBPluginDependency - 376.IBEditorWindowLastContentRect - 376.IBPluginDependency - 377.IBPluginDependency - 388.IBEditorWindowLastContentRect - 388.IBPluginDependency - 389.IBPluginDependency - 390.IBPluginDependency - 391.IBPluginDependency - 392.IBPluginDependency - 393.IBPluginDependency - 394.IBPluginDependency - 395.IBPluginDependency - 396.IBPluginDependency - 397.IBPluginDependency - 398.IBPluginDependency - 399.IBPluginDependency - 400.IBPluginDependency - 401.IBPluginDependency - 402.IBPluginDependency - 403.IBPluginDependency - 404.IBPluginDependency - 405.IBPluginDependency - 406.IBPluginDependency - 407.IBPluginDependency - 408.IBPluginDependency - 409.IBPluginDependency - 410.IBPluginDependency - 411.IBPluginDependency - 412.IBPluginDependency - 413.IBPluginDependency - 414.IBPluginDependency - 415.IBPluginDependency - 416.IBPluginDependency - 417.IBPluginDependency - 418.IBPluginDependency - 419.IBPluginDependency - 5.IBPluginDependency - 5.ImportedFromIB2 - 56.IBPluginDependency - 56.ImportedFromIB2 - 57.IBEditorWindowLastContentRect - 57.IBPluginDependency - 57.ImportedFromIB2 - 57.editorWindowContentRectSynchronizationRect - 58.IBPluginDependency - 58.ImportedFromIB2 - 684.IBPluginDependency - 685.IBEditorWindowLastContentRect - 685.IBPluginDependency - 686.IBPluginDependency - 687.IBPluginDependency - 688.IBPluginDependency - 689.IBPluginDependency - 690.IBPluginDependency - 691.IBPluginDependency - 692.IBPluginDependency - 693.IBPluginDependency - 694.IBPluginDependency - 695.IBPluginDependency - 696.IBPluginDependency - 697.IBPluginDependency - 698.IBPluginDependency - 699.IBPluginDependency - 700.IBPluginDependency - 711.IBPluginDependency - 712.IBPluginDependency - 713.IBPluginDependency - 714.IBPluginDependency - 715.IBPluginDependency - 716.IBPluginDependency - 717.IBPluginDependency - 718.IBPluginDependency - 719.IBPluginDependency - 72.IBPluginDependency - 72.ImportedFromIB2 - 720.IBPluginDependency - 721.IBPluginDependency - 722.IBPluginDependency - 723.IBPluginDependency - 724.IBPluginDependency - 725.IBPluginDependency - 726.IBPluginDependency - 727.IBPluginDependency - 728.IBPluginDependency - 729.IBPluginDependency - 73.IBPluginDependency - 73.ImportedFromIB2 - 730.IBPluginDependency - 731.IBPluginDependency - 732.IBPluginDependency - 733.IBPluginDependency - 734.IBPluginDependency - 735.IBPluginDependency - 736.IBPluginDependency - 737.IBPluginDependency - 738.IBPluginDependency - 739.IBPluginDependency - 74.IBPluginDependency - 74.ImportedFromIB2 - 75.IBPluginDependency - 75.ImportedFromIB2 - 77.IBPluginDependency - 77.ImportedFromIB2 - 776.IBPluginDependency - 777.IBEditorWindowLastContentRect - 777.IBPluginDependency - 778.IBPluginDependency - 779.IBPluginDependency - 78.IBPluginDependency - 78.ImportedFromIB2 - 780.IBPluginDependency - 781.IBPluginDependency - 782.IBPluginDependency - 783.IBPluginDependency - 784.IBPluginDependency - 785.IBPluginDependency - 786.IBPluginDependency - 787.IBPluginDependency - 788.IBEditorWindowLastContentRect - 788.IBPluginDependency - 789.IBPluginDependency - 79.IBPluginDependency - 79.ImportedFromIB2 - 790.IBPluginDependency - 791.IBPluginDependency - 792.IBPluginDependency - 793.IBPluginDependency - 794.IBPluginDependency - 795.IBPluginDependency - 796.IBPluginDependency - 797.IBPluginDependency - 80.IBPluginDependency - 80.ImportedFromIB2 - 81.IBEditorWindowLastContentRect - 81.IBPluginDependency - 81.ImportedFromIB2 - 81.editorWindowContentRectSynchronizationRect - 811.IBPluginDependency - 816.IBPluginDependency - 816.IBViewBoundsToFrameTransform - 817.IBPluginDependency - 818.IBPluginDependency - 819.IBPluginDependency - 82.IBPluginDependency - 82.ImportedFromIB2 - 83.IBPluginDependency - 83.ImportedFromIB2 - 92.IBPluginDependency - 92.ImportedFromIB2 - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{747, 1061}, {195, 23}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{596, 852}, {216, 23}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{449, 589}, {132, 23}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{522, 812}, {146, 23}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{509, 573}, {64, 6}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{436, 809}, {64, 6}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{676, 1011}, {194, 73}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{525, 802}, {197, 73}} - {{349, 1084}, {459, 20}} - com.apple.InterfaceBuilder.CocoaPlugin - - {74, 862} - {{11, 977}, {478, 20}} - com.apple.InterfaceBuilder.CocoaPlugin - {{626, 1041}, {231, 43}} - com.apple.InterfaceBuilder.CocoaPlugin - {{475, 832}, {234, 43}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{351, 776}, {480, 270}} - com.apple.InterfaceBuilder.CocoaPlugin - {{351, 776}, {480, 270}} - - {{11, 666}, {480, 270}} - {3.40282e+38, 3.40282e+38} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{560, 1041}, {83, 43}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{422, 369}, {178, 283}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{361, 901}, {224, 183}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{23, 794}, {245, 183}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - {{516, 801}, {254, 283}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - {{666, 881}, {204, 183}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{870, 801}, {164, 173}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{474, 881}, {196, 203}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{323, 672}, {199, 203}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABCmgAAw18AAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - - - - YES - - - YES - - - - - YES - - - YES - - - - 821 - - - - YES - - AppDelegate - NSObject - - computeMD5HashOfBinary: - id - - - computeMD5HashOfBinary: - - computeMD5HashOfBinary: - id - - - - YES - - YES - label - window - - - YES - NSTextField - NSWindow - - - - YES - - YES - label - window - - - YES - - label - NSTextField - - - window - NSWindow - - - - - IBProjectSource - Mac/AppDelegate.h - - - - AppDelegate - NSObject - - computeMD5HashOfBinary: - id - - - computeMD5HashOfBinary: - - computeMD5HashOfBinary: - id - - - - YES - - YES - label - window - - - YES - UILabel - UIWindow - - - - YES - - YES - label - window - - - YES - - label - UILabel - - - window - UIWindow - - - - - IBProjectSource - iOS/AppDelegate.h - - - - - YES - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - - UIResponder - NSObject - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIWindow - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIWindow.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - - - YES - {9, 8} - {7, 2} - - - - diff --git a/iOS/AppDelegate.m b/iOS/AppDelegate.m deleted file mode 100644 index 75aa930..0000000 --- a/iOS/AppDelegate.m +++ /dev/null @@ -1,102 +0,0 @@ -/* - * AppDelegate.m - * FileMD5Hash - * - * Copyright © 2010 Joel Lopes Da Silva. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#import "AppDelegate.h" -#import "FileHash.h" - - -@implementation AppDelegate - -#pragma mark - -#pragma mark Deallocation - -- (void)dealloc { - [window release]; - [label release]; - [super dealloc]; -} - - - -#pragma mark - -#pragma mark Properties - -@synthesize window; -@synthesize label; - - - -#pragma mark - -#pragma mark Application lifecycle - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - // Override point for customization after application launch. - [window makeKeyAndVisible]; - return YES; -} - - -- (void)applicationWillResignActive:(UIApplication *)application { - // Sent when the application is about to move from active to - // inactive state. This can occur for certain types of temporary - // interruptions (such as an incoming phone call or SMS message) - // or when the user quits the application and it begins the - // transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and - // throttle down OpenGL ES frame rates. Games should use this - // method to pause the game. -} - - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // Restart any tasks that were paused (or not yet started) while - // the application was inactive. -} - - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. -} - - - -#pragma mark - -#pragma mark Memory management - -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - // Free up as much memory as possible by purging cached data objects - // that can be recreated (or reloaded from disk) later. -} - - - -#pragma mark - -#pragma mark Actions - -- (IBAction)computeMD5HashOfBinary:(id)sender { - NSString *executablePath = [[NSBundle mainBundle] executablePath]; - NSString *executableFileMD5Hash = [FileHash md5HashOfFileAtPath:executablePath]; - [[self label] setText:executableFileMD5Hash]; -} - - -@end diff --git a/iOS/FileMD5Hash-Info.plist b/iOS/FileMD5Hash-Info.plist index 84966d4..56707db 100644 --- a/iOS/FileMD5Hash-Info.plist +++ b/iOS/FileMD5Hash-Info.plist @@ -22,17 +22,7 @@ ???? CFBundleVersion 1.0 - LSRequiresIPhoneOS - - NSMainNibFile - MainWindow_iPhone - NSMainNibFile~ipad - MainWindow_iPad UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown diff --git a/iOS/FileMD5Hash.m b/iOS/FileMD5Hash.m new file mode 100644 index 0000000..f9c8978 --- /dev/null +++ b/iOS/FileMD5Hash.m @@ -0,0 +1,30 @@ +/* + * FileMD5Hash.m + * FileMD5Hash + * + * Copyright © 2010-2014 Joel Lopes Da Silva. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import +#import "FileMD5HashApplicationDelegate.h" + +int main(int argc, char *argv[]) { + int result = 0; + @autoreleasepool { + result = UIApplicationMain(argc, argv, nil, NSStringFromClass([FileMD5HashApplicationDelegate class])); + } + return result; +} diff --git a/iOS/main.m b/iOS/FileMD5HashApplicationDelegate.h similarity index 70% rename from iOS/main.m rename to iOS/FileMD5HashApplicationDelegate.h index dcf7e2a..fc22ecb 100644 --- a/iOS/main.m +++ b/iOS/FileMD5HashApplicationDelegate.h @@ -1,8 +1,8 @@ /* - * main.m + * FileMD5HashApplicationDelegate.h * FileMD5Hash * - * Copyright © 2010 Joel Lopes Da Silva. All rights reserved. + * Copyright © 2010-2014 Joel Lopes Da Silva. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +20,8 @@ #import -int main(int argc, char *argv[]) { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - int result = UIApplicationMain(argc, argv, nil, nil); - [pool drain]; - return result; -} +@interface FileMD5HashApplicationDelegate : NSObject + +@property (nonatomic, strong) UIWindow *window; + +@end diff --git a/iOS/FileMD5HashApplicationDelegate.m b/iOS/FileMD5HashApplicationDelegate.m new file mode 100644 index 0000000..1ca97df --- /dev/null +++ b/iOS/FileMD5HashApplicationDelegate.m @@ -0,0 +1,53 @@ +/* + * FileMD5HashApplicationDelegate.m + * FileMD5Hash + * + * Copyright © 2010-2014 Joel Lopes Da Silva. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Header file +#import "FileMD5HashApplicationDelegate.h" + +// View controller +#import "FileMD5HashViewController.h" + + +@implementation FileMD5HashApplicationDelegate + +#pragma mark - +#pragma mark Deallocation + +- (void)dealloc { + self.window = nil; + [super dealloc]; +} + + +#pragma mark - +#pragma mark Application lifecycle + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + FileMD5HashViewController *viewController = [FileMD5HashViewController new]; + window.rootViewController = viewController; + [viewController release]; + [window makeKeyAndVisible]; + self.window = window; + [window release]; + return YES; +} + +@end diff --git a/iOS/AppDelegate.h b/iOS/FileMD5HashViewController.h similarity index 59% rename from iOS/AppDelegate.h rename to iOS/FileMD5HashViewController.h index 3c7d681..c144937 100644 --- a/iOS/AppDelegate.h +++ b/iOS/FileMD5HashViewController.h @@ -1,8 +1,8 @@ /* - * AppDelegate.h + * FileMD5HashViewController.h * FileMD5Hash * - * Copyright © 2010 Joel Lopes Da Silva. All rights reserved. + * Copyright © 2010-2014 Joel Lopes Da Silva. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,22 +20,6 @@ #import - -@interface AppDelegate : NSObject { - UIWindow *window; - UILabel *label; -} - -#pragma mark - -#pragma mark Properties - -@property (nonatomic, retain) IBOutlet UIWindow *window; -@property (nonatomic, retain) IBOutlet UILabel *label; - - -#pragma mark - -#pragma mark Actions - -- (IBAction)computeMD5HashOfBinary:(id)sender; +@interface FileMD5HashViewController : UIViewController @end diff --git a/iOS/FileMD5HashViewController.m b/iOS/FileMD5HashViewController.m new file mode 100644 index 0000000..5053388 --- /dev/null +++ b/iOS/FileMD5HashViewController.m @@ -0,0 +1,92 @@ +/* + * FileMD5HashViewController.m + * FileMD5Hash + * + * Copyright © 2010-2014 Joel Lopes Da Silva. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Header file +#import "FileMD5HashViewController.h" + +// File hash +#import "FileHash.h" + + +#pragma mark - +#pragma mark Private extension + +@interface FileMD5HashViewController () + +@property (nonatomic, strong) UIButton *button; +@property (nonatomic, strong) UILabel *label; + +@end + + +#pragma mark - + +@implementation FileMD5HashViewController + +#pragma mark - +#pragma mark Deallocation + +- (void)dealloc { + [self.button removeTarget:self action:NULL forControlEvents:UIControlEventAllEvents]; + self.button = nil; + self.label = nil; + [super dealloc]; +} + + +#pragma mark - +#pragma mark View lifecycle + +- (void)loadView { + UIView *view = [UIView new]; + view.backgroundColor = [UIColor whiteColor]; + + UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem]; + [button setTitle:@"Compute MD5 hash of executable file" forState:UIControlStateNormal]; + [button addTarget:self action:@selector(computeMD5HashOfExecutableFile:) forControlEvents:UIControlEventTouchUpInside]; + button.translatesAutoresizingMaskIntoConstraints = NO; + [view addSubview:button]; + [view addConstraint:[NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:0.0]]; + [view addConstraint:[NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:-30.0]]; + + UILabel *label = [UILabel new]; + label.translatesAutoresizingMaskIntoConstraints = NO; + [view addSubview:label]; + [view addConstraint:[NSLayoutConstraint constraintWithItem:label attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:0.0]]; + [view addConstraint:[NSLayoutConstraint constraintWithItem:label attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:30.0]]; + + self.view = view; + self.button = button; + self.label = label; + [label release]; + [view release]; +} + + +#pragma mark - +#pragma mark Button handler + +- (void)computeMD5HashOfExecutableFile:(id)sender { + NSString *executablePath = [[NSBundle mainBundle] executablePath]; + NSString *executableFileMD5Hash = [FileHash md5HashOfFileAtPath:executablePath]; + self.label.text = executableFileMD5Hash ? executableFileMD5Hash : @"Error"; +} + +@end diff --git a/iOS/iPad/MainWindow_iPad.xib b/iOS/iPad/MainWindow_iPad.xib deleted file mode 100644 index 43b1c86..0000000 --- a/iOS/iPad/MainWindow_iPad.xib +++ /dev/null @@ -1,521 +0,0 @@ - - - - 1024 - 10F569 - 804 - 1038.29 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 123 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - IBIPadFramework - - - IBFirstResponder - IBIPadFramework - - - - 301 - - YES - - - 301 - {{266, 80}, {235, 37}} - - NO - IBIPadFramework - 0 - 0 - - Helvetica-Bold - 15 - 16 - - 1 - Compute MD5 Hash of binary - - 3 - MQA - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - 3 - MC41AA - - - - - 301 - {{20, 176}, {728, 21}} - - NO - YES - 7 - NO - IBIPadFramework - - - 1 - MSAxIDEAA - - - 1 - 10 - 1 - - - {768, 1024} - - - 1 - MC41IDAgMC41AA - - NO - NO - - 2 - - IBIPadFramework - YES - - - IBIPadFramework - - - - - YES - - - window - - - - 7 - - - - delegate - - - - 8 - - - - label - - - - 12 - - - - computeMD5HashOfBinary: - - - 1 - - 13 - - - - - YES - - 0 - - - - - - -1 - - - File's Owner - - - -2 - - - - - 2 - - - YES - - - - - - - 6 - - - - - 10 - - - - - 11 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 10.IBPluginDependency - 10.IBViewBoundsToFrameTransform - 11.IBPluginDependency - 2.IBEditorWindowLastContentRect - 2.IBPluginDependency - 6.CustomClassName - 6.IBPluginDependency - - - YES - UIApplication - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABDhQAAwuQAAA - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{840, 55}, {768, 1024}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - AppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 13 - - - - YES - - AppDelegate - NSObject - - computeMD5HashOfBinary: - id - - - computeMD5HashOfBinary: - - computeMD5HashOfBinary: - id - - - - YES - - YES - label - window - - - YES - UILabel - UIWindow - - - - YES - - YES - label - window - - - YES - - label - UILabel - - - window - UIWindow - - - - - IBProjectSource - iOS/AppDelegate.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIApplication - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIApplication.h - - - - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - UIWindow - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIWindow.h - - - - - 0 - IBIPadFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - ../../FileMD5Hash.xcodeproj - 3 - 123 - - diff --git a/iOS/iPhone/MainWindow_iPhone.xib b/iOS/iPhone/MainWindow_iPhone.xib deleted file mode 100644 index 21e1017..0000000 --- a/iOS/iPhone/MainWindow_iPhone.xib +++ /dev/null @@ -1,537 +0,0 @@ - - - - 1024 - 10F569 - 804 - 1038.29 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 123 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - IBCocoaTouchFramework - - - - 1325 - - YES - - - 1325 - {{20, 180}, {280, 21}} - - NO - YES - 7 - NO - IBCocoaTouchFramework - - - 1 - MSAxIDEAA - - - 3 - MQA - - 1 - 10 - 1 - - - - 1325 - {{42, 94}, {235, 37}} - - NO - IBCocoaTouchFramework - 0 - 0 - - Helvetica-Bold - 15 - 16 - - 1 - Compute MD5 Hash of binary - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - 3 - MC41AA - - - - - {320, 480} - - - 1 - MC41IDAgMC41AA - - NO - NO - - 2 - - IBCocoaTouchFramework - YES - - - - - YES - - - delegate - - - - 5 - - - - window - - - - 6 - - - - computeMD5HashOfBinary: - - - 1 - - 11 - - - - label - - - - 12 - - - - - YES - - 0 - - - - - - 2 - - - YES - - - - - - - -1 - - - File's Owner - - - 4 - - - App Delegate - - - -2 - - - - - 9 - - - - - 10 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 10.IBPluginDependency - 10.IBViewBoundsToFrameTransform - 2.IBAttributePlaceholdersKey - 2.IBEditorWindowLastContentRect - 2.IBPluginDependency - 2.UIWindow.visibleAtLaunch - 4.CustomClassName - 4.IBPluginDependency - 9.IBPluginDependency - 9.IBViewBoundsToFrameTransform - - - YES - UIApplication - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABCLAAAwwUAAA - - - YES - - - YES - - - {{516, 526}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - AppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABBoAAAw3kAAA - - - - - YES - - - YES - - - - - YES - - - YES - - - - 12 - - - - YES - - AppDelegate - NSObject - - computeMD5HashOfBinary: - id - - - computeMD5HashOfBinary: - - computeMD5HashOfBinary: - id - - - - YES - - YES - label - window - - - YES - UILabel - UIWindow - - - - YES - - YES - label - window - - - YES - - label - UILabel - - - window - UIWindow - - - - - IBProjectSource - iOS/AppDelegate.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIApplication - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIApplication.h - - - - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - UIWindow - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIWindow.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - ../../FileMD5Hash.xcodeproj - 3 - 123 - - From c07d253a497235621e6e8a5447159ea73d970386 Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Sun, 19 Jan 2014 16:49:43 -0800 Subject: [PATCH 11/20] Rename Mac folder and target as "OS X". --- FileMD5Hash.xcodeproj/project.pbxproj | 27 ++++++++++--------- {Mac => OSX}/FileMD5Hash-Info.plist | 0 {Mac => OSX}/FileMD5Hash.m | 0 {Mac => OSX}/FileMD5Hash.xib | 0 {Mac => OSX}/FileMD5HashApplicationDelegate.h | 0 {Mac => OSX}/FileMD5HashApplicationDelegate.m | 0 {Mac => OSX}/FileMD5HashViewController.h | 0 {Mac => OSX}/FileMD5HashViewController.m | 0 8 files changed, 14 insertions(+), 13 deletions(-) rename {Mac => OSX}/FileMD5Hash-Info.plist (100%) rename {Mac => OSX}/FileMD5Hash.m (100%) rename {Mac => OSX}/FileMD5Hash.xib (100%) rename {Mac => OSX}/FileMD5HashApplicationDelegate.h (100%) rename {Mac => OSX}/FileMD5HashApplicationDelegate.m (100%) rename {Mac => OSX}/FileMD5HashViewController.h (100%) rename {Mac => OSX}/FileMD5HashViewController.m (100%) diff --git a/FileMD5Hash.xcodeproj/project.pbxproj b/FileMD5Hash.xcodeproj/project.pbxproj index 2861b80..ce0a065 100644 --- a/FileMD5Hash.xcodeproj/project.pbxproj +++ b/FileMD5Hash.xcodeproj/project.pbxproj @@ -78,7 +78,7 @@ isa = PBXGroup; children = ( 5DE285D0126ACE110092F897 /* iOS */, - 5DC8CD83126AF49500CE5F6B /* Mac */, + 5DC8CD83126AF49500CE5F6B /* OS X */, 5DE28613126AD4EB0092F897 /* Common */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, @@ -90,12 +90,12 @@ isa = PBXGroup; children = ( 5DC8CE0C126B01B600CE5F6B /* iOS */, - 5DC8CEB2126B01C200CE5F6B /* Mac */, + 5DC8CEB2126B01C200CE5F6B /* OS X */, ); name = Frameworks; sourceTree = ""; }; - 5DC8CD83126AF49500CE5F6B /* Mac */ = { + 5DC8CD83126AF49500CE5F6B /* OS X */ = { isa = PBXGroup; children = ( 5DC8CDC0126AF93100CE5F6B /* FileMD5HashApplicationDelegate.h */, @@ -106,7 +106,8 @@ 5DC8CD9D126AF5F300CE5F6B /* FileMD5Hash.m */, 5DC8CD84126AF49500CE5F6B /* FileMD5Hash-Info.plist */, ); - path = Mac; + name = "OS X"; + path = OSX; sourceTree = ""; }; 5DC8CE0C126B01B600CE5F6B /* iOS */ = { @@ -118,12 +119,12 @@ name = iOS; sourceTree = ""; }; - 5DC8CEB2126B01C200CE5F6B /* Mac */ = { + 5DC8CEB2126B01C200CE5F6B /* OS X */ = { isa = PBXGroup; children = ( 5DC8CEB3126B01FC00CE5F6B /* Cocoa.framework */, ); - name = Mac; + name = "OS X"; sourceTree = ""; }; 5DE285D0126ACE110092F897 /* iOS */ = { @@ -168,9 +169,9 @@ productReference = 1D6058910D05DD3D006BFB54 /* FileMD5Hash.app */; productType = "com.apple.product-type.application"; }; - 5DC8CD7B126AF42700CE5F6B /* Mac */ = { + 5DC8CD7B126AF42700CE5F6B /* OS X */ = { isa = PBXNativeTarget; - buildConfigurationList = 5DC8CD81126AF42800CE5F6B /* Build configuration list for PBXNativeTarget "Mac" */; + buildConfigurationList = 5DC8CD81126AF42800CE5F6B /* Build configuration list for PBXNativeTarget "OS X" */; buildPhases = ( 5DC8CD78126AF42700CE5F6B /* Resources */, 5DC8CD79126AF42700CE5F6B /* Sources */, @@ -180,7 +181,7 @@ ); dependencies = ( ); - name = Mac; + name = "OS X"; productName = FileMD5Hash; productReference = 5DC8CD7C126AF42700CE5F6B /* FileMD5Hash.app */; productType = "com.apple.product-type.application"; @@ -207,7 +208,7 @@ projectRoot = ""; targets = ( 1D6058900D05DD3D006BFB54 /* iOS */, - 5DC8CD7B126AF42700CE5F6B /* Mac */, + 5DC8CD7B126AF42700CE5F6B /* OS X */, ); }; /* End PBXProject section */ @@ -287,7 +288,7 @@ GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; - INFOPLIST_FILE = "Mac/FileMD5Hash-Info.plist"; + INFOPLIST_FILE = "OSX/FileMD5Hash-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; MACOSX_DEPLOYMENT_TARGET = 10.8; OTHER_LDFLAGS = ( @@ -310,7 +311,7 @@ COPY_PHASE_STRIP = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_MODEL_TUNING = G5; - INFOPLIST_FILE = "Mac/FileMD5Hash-Info.plist"; + INFOPLIST_FILE = "OSX/FileMD5Hash-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; MACOSX_DEPLOYMENT_TARGET = 10.8; OTHER_LDFLAGS = ( @@ -433,7 +434,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 5DC8CD81126AF42800CE5F6B /* Build configuration list for PBXNativeTarget "Mac" */ = { + 5DC8CD81126AF42800CE5F6B /* Build configuration list for PBXNativeTarget "OS X" */ = { isa = XCConfigurationList; buildConfigurations = ( 5DC8CD7F126AF42800CE5F6B /* Debug */, diff --git a/Mac/FileMD5Hash-Info.plist b/OSX/FileMD5Hash-Info.plist similarity index 100% rename from Mac/FileMD5Hash-Info.plist rename to OSX/FileMD5Hash-Info.plist diff --git a/Mac/FileMD5Hash.m b/OSX/FileMD5Hash.m similarity index 100% rename from Mac/FileMD5Hash.m rename to OSX/FileMD5Hash.m diff --git a/Mac/FileMD5Hash.xib b/OSX/FileMD5Hash.xib similarity index 100% rename from Mac/FileMD5Hash.xib rename to OSX/FileMD5Hash.xib diff --git a/Mac/FileMD5HashApplicationDelegate.h b/OSX/FileMD5HashApplicationDelegate.h similarity index 100% rename from Mac/FileMD5HashApplicationDelegate.h rename to OSX/FileMD5HashApplicationDelegate.h diff --git a/Mac/FileMD5HashApplicationDelegate.m b/OSX/FileMD5HashApplicationDelegate.m similarity index 100% rename from Mac/FileMD5HashApplicationDelegate.m rename to OSX/FileMD5HashApplicationDelegate.m diff --git a/Mac/FileMD5HashViewController.h b/OSX/FileMD5HashViewController.h similarity index 100% rename from Mac/FileMD5HashViewController.h rename to OSX/FileMD5HashViewController.h diff --git a/Mac/FileMD5HashViewController.m b/OSX/FileMD5HashViewController.m similarity index 100% rename from Mac/FileMD5HashViewController.m rename to OSX/FileMD5HashViewController.m From 9468991b8e811c05624d12df153599ac4005021f Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Sun, 19 Jan 2014 16:50:29 -0800 Subject: [PATCH 12/20] Update copyright. --- NOTICE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NOTICE b/NOTICE index 05ae855..b739178 100644 --- a/NOTICE +++ b/NOTICE @@ -1,4 +1,4 @@ FileMD5Hash -Copyright © 2010 Joel Lopes Da Silva. All rights reserved. +Copyright © 2010-2014 Joel Lopes Da Silva. All rights reserved. This software has been developed by Joel Lopes Da Silva (http://www.joel.lopes-da-silva.com/). From dd774cce3d0bc6b9394c643a38d8211c516730db Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Sun, 19 Jan 2014 16:52:29 -0800 Subject: [PATCH 13/20] Rename folder "Common" as "Library". --- FileMD5Hash.podspec | 2 +- FileMD5Hash.xcodeproj/project.pbxproj | 6 +++--- {Common => Library}/FileHash.h | 0 {Common => Library}/FileHash.m | 0 4 files changed, 4 insertions(+), 4 deletions(-) rename {Common => Library}/FileHash.h (100%) rename {Common => Library}/FileHash.m (100%) diff --git a/FileMD5Hash.podspec b/FileMD5Hash.podspec index 650f897..32c9453 100644 --- a/FileMD5Hash.podspec +++ b/FileMD5Hash.podspec @@ -6,5 +6,5 @@ Pod::Spec.new do |spec| spec.homepage = 'https://github.com/JoeKun/FileMD5Hash' spec.author = { 'Joel Lopes Da Silva' => 'joel@lopes-da-silva.com' } spec.source = { :git => 'https://github.com/JoeKun/FileMD5Hash.git', :tag => '1.0.0' } - spec.source_files = 'Common/*.{h,m}' + spec.source_files = 'Library/*.{h,m}' end diff --git a/FileMD5Hash.xcodeproj/project.pbxproj b/FileMD5Hash.xcodeproj/project.pbxproj index ce0a065..d4dc45b 100644 --- a/FileMD5Hash.xcodeproj/project.pbxproj +++ b/FileMD5Hash.xcodeproj/project.pbxproj @@ -77,9 +77,9 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( + 5DE28613126AD4EB0092F897 /* Library */, 5DE285D0126ACE110092F897 /* iOS */, 5DC8CD83126AF49500CE5F6B /* OS X */, - 5DE28613126AD4EB0092F897 /* Common */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, ); @@ -140,13 +140,13 @@ path = iOS; sourceTree = ""; }; - 5DE28613126AD4EB0092F897 /* Common */ = { + 5DE28613126AD4EB0092F897 /* Library */ = { isa = PBXGroup; children = ( 5DE28615126AD4EB0092F897 /* FileHash.h */, 5DE28614126AD4EB0092F897 /* FileHash.m */, ); - path = Common; + path = Library; sourceTree = ""; }; /* End PBXGroup section */ diff --git a/Common/FileHash.h b/Library/FileHash.h similarity index 100% rename from Common/FileHash.h rename to Library/FileHash.h diff --git a/Common/FileHash.m b/Library/FileHash.m similarity index 100% rename from Common/FileHash.m rename to Library/FileHash.m From 7b39d891fced492d74635c68fd31b2e5202baeed Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Sun, 19 Jan 2014 17:18:11 -0800 Subject: [PATCH 14/20] Making logic for creating cryptographic hashes more generic, and add SHA1 and SHA512 APIs. --- Library/FileHash.h | 2 ++ Library/FileHash.m | 52 ++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/Library/FileHash.h b/Library/FileHash.h index daac092..0165436 100644 --- a/Library/FileHash.h +++ b/Library/FileHash.h @@ -23,5 +23,7 @@ @interface FileHash : NSObject + (NSString *)md5HashOfFileAtPath:(NSString *)filePath; ++ (NSString *)sha1HashOfFileAtPath:(NSString *)filePath; ++ (NSString *)sha512HashOfFileAtPath:(NSString *)filePath; @end diff --git a/Library/FileHash.m b/Library/FileHash.m index c899af5..d0fee4c 100644 --- a/Library/FileHash.m +++ b/Library/FileHash.m @@ -30,10 +30,33 @@ // Constants static const size_t FileHashDefaultChunkSizeForReadingData = 4096; +// Function pointer types for functions used in the computation +// of a cryptographic hash. +typedef int (*FileHashInitFunction) (uint8_t *hashObjectPointer[]); +typedef int (*FileHashUpdateFunction) (uint8_t *hashObjectPointer[], const void *data, CC_LONG len); +typedef int (*FileHashFinalFunction) (unsigned char *md, uint8_t *hashObjectPointer[]); + +// Structure used to describe a hash computation context. +typedef struct _FileHashComputationContext { + FileHashInitFunction initFunction; + FileHashUpdateFunction updateFunction; + FileHashFinalFunction finalFunction; + size_t digestLength; + uint8_t **hashObjectPointer; +} FileHashComputationContext; + +#define FileHashComputationContextInitialize(context, hashAlgorithmName) \ + CC_##hashAlgorithmName##_CTX hashObjectFor##hashAlgorithmName; \ + context.initFunction = (FileHashInitFunction)&CC_##hashAlgorithmName##_Init; \ + context.updateFunction = (FileHashUpdateFunction)&CC_##hashAlgorithmName##_Update; \ + context.finalFunction = (FileHashFinalFunction)&CC_##hashAlgorithmName##_Final; \ + context.digestLength = CC_##hashAlgorithmName##_DIGEST_LENGTH; \ + context.hashObjectPointer = (uint8_t **)&hashObjectFor##hashAlgorithmName + @implementation FileHash -+ (NSString *)md5HashOfFileAtPath:(NSString *)filePath { ++ (NSString *)hashOfFileAtPath:(NSString *)filePath withComputationContext:(FileHashComputationContext *)context { NSString *result = nil; CFURLRef fileURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)filePath, kCFURLPOSIXPathStyle, (Boolean)false); CFReadStreamRef readStream = fileURL ? CFReadStreamCreateWithFile(kCFAllocatorDefault, fileURL) : NULL; @@ -44,8 +67,7 @@ + (NSString *)md5HashOfFileAtPath:(NSString *)filePath { const size_t chunkSizeForReadingData = FileHashDefaultChunkSizeForReadingData; // Initialize the hash object - CC_MD5_CTX hashObject; - CC_MD5_Init(&hashObject); + (*context->initFunction)(context->hashObjectPointer); // Feed the data to the hash object. BOOL hasMoreData = YES; @@ -57,13 +79,13 @@ + (NSString *)md5HashOfFileAtPath:(NSString *)filePath { } else if (readBytesCount == 0) { hasMoreData = NO; } else { - CC_MD5_Update(&hashObject, (const void *)buffer, (CC_LONG)readBytesCount); + (*context->updateFunction)(context->hashObjectPointer, (const void *)buffer, (CC_LONG)readBytesCount); } } // Compute the hash digest - unsigned char digest[CC_MD5_DIGEST_LENGTH]; - CC_MD5_Final(digest, &hashObject); + unsigned char digest[context->digestLength]; + (*context->finalFunction)(digest, context->hashObjectPointer); // Close the read stream. CFReadStreamClose(readStream); @@ -84,4 +106,22 @@ + (NSString *)md5HashOfFileAtPath:(NSString *)filePath { return result; } ++ (NSString *)md5HashOfFileAtPath:(NSString *)filePath { + FileHashComputationContext context; + FileHashComputationContextInitialize(context, MD5); + return [self hashOfFileAtPath:filePath withComputationContext:&context]; +} + ++ (NSString *)sha1HashOfFileAtPath:(NSString *)filePath { + FileHashComputationContext context; + FileHashComputationContextInitialize(context, SHA1); + return [self hashOfFileAtPath:filePath withComputationContext:&context]; +} + ++ (NSString *)sha512HashOfFileAtPath:(NSString *)filePath { + FileHashComputationContext context; + FileHashComputationContextInitialize(context, SHA512); + return [self hashOfFileAtPath:filePath withComputationContext:&context]; +} + @end From e02a4dadd08e043d884f611af6fd6356df5553fe Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Sun, 19 Jan 2014 17:22:05 -0800 Subject: [PATCH 15/20] Upgrade to new Xcode recommended settings. --- FileMD5Hash.xcodeproj/project.pbxproj | 16 ++++++++++------ iOS/Default-568h@2x.png | Bin 0 -> 18594 bytes 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 iOS/Default-568h@2x.png diff --git a/FileMD5Hash.xcodeproj/project.pbxproj b/FileMD5Hash.xcodeproj/project.pbxproj index d4dc45b..a0c8213 100644 --- a/FileMD5Hash.xcodeproj/project.pbxproj +++ b/FileMD5Hash.xcodeproj/project.pbxproj @@ -3,11 +3,12 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 5D62043B188CB10400A1074D /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5D62043A188CB10400A1074D /* Default-568h@2x.png */; }; 5D87FF68188C9B560052ABE3 /* FileMD5HashViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D87FF67188C9B560052ABE3 /* FileMD5HashViewController.m */; }; 5D87FF6B188CA3D10052ABE3 /* FileMD5HashViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D87FF6A188CA3D10052ABE3 /* FileMD5HashViewController.m */; }; 5DC8CD9C126AF59300CE5F6B /* FileMD5Hash.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5DC8CD9B126AF59300CE5F6B /* FileMD5Hash.xib */; }; @@ -24,6 +25,7 @@ /* Begin PBXFileReference section */ 1D6058910D05DD3D006BFB54 /* FileMD5Hash.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FileMD5Hash.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 5D62043A188CB10400A1074D /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 5D87FF66188C9B560052ABE3 /* FileMD5HashViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMD5HashViewController.h; sourceTree = ""; }; 5D87FF67188C9B560052ABE3 /* FileMD5HashViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileMD5HashViewController.m; sourceTree = ""; }; 5D87FF69188CA3D10052ABE3 /* FileMD5HashViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMD5HashViewController.h; sourceTree = ""; }; @@ -136,6 +138,7 @@ 5D87FF67188C9B560052ABE3 /* FileMD5HashViewController.m */, 5DE285DB126ACE110092F897 /* FileMD5Hash.m */, 5DE285D1126ACE110092F897 /* FileMD5Hash-Info.plist */, + 5D62043A188CB10400A1074D /* Default-568h@2x.png */, ); path = iOS; sourceTree = ""; @@ -192,9 +195,10 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { + LastUpgradeCheck = 0500; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "FileMD5Hash" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -218,6 +222,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 5D62043B188CB10400A1074D /* Default-568h@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -282,7 +287,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD)"; + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; @@ -307,7 +312,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD)"; + COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_MODEL_TUNING = G5; @@ -330,7 +335,6 @@ C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_CXX0X_EXTENSIONS = YES; @@ -369,6 +373,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -377,7 +382,6 @@ C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_CXX0X_EXTENSIONS = YES; diff --git a/iOS/Default-568h@2x.png b/iOS/Default-568h@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0891b7aabfcf3422423b109c8beed2bab838c607 GIT binary patch literal 18594 zcmeI4X;f257Jx&9fS`ixvS;&$x8J@slQFSel)6zJN=?13FB7H(lQjRkSy8x_-S~tvu2gzn1oS+dLcF#eqtq$ z%tf9TTvX?`)R@}3uBI;jzS-=ZR-Td&MHaS&;!0?Ni*#$#`n*~CcQK)Q9vAQ~TUpnI!j)a2biYK^R)M~A5wUDZhx?ULMX z3x1P&qt=trOY6P2U67L=m=U?F|5#Uj(eCueNTZaHs_ceWiHeET+j+tp3Jt9g(ekqP z2WOvfR{qV+9r+o4J5?qK>7;;^+I7tGv-i)es$X_D=EoKF+S?zsyj^oRFElP}c}JT< zd8SUs-?O?}2YD#ngKbnHgzHBcboxK_2r9l(?eNCl-pEzkJm}fY?WC*jnS?VBE4EpY zO$fEejz6fU;W2Kl>JeQBZBl-%Irg`obSlg*@4QB;Dd1H7^Oi5wvt4d{RZ!8Og?^aE z)k0$1g+V3fd(gdQ3d&q2q-FL*uy#}|bc^=VhFsl0jBgUGJ+-s3U8MK9A!YJJMxpci z5hJ%|{DwV48fZn0{n5l$N_KcSb#NKE4plB`9I6Zt=Z!~-zw0{9tg$L&Ju1F0X)Cy8 zKF;(&lJ>x)Jw(=;p~sF(Sd9VWGwFE2rnyS9!f^DZ8+aCLq zQ};>lcJ1GDLqjm6Hd>|Eabno@P`~Bn(~6^aD_#yoEH(a?Nm1S<;S+hSxI5d16^<1lEM3NPFi zkqPrpL)+ zgnseFikg`gJVBha1&7C4;O6>h=dt~`ND+;Zd?W(4v2JIb7Pt>Td42%M-Ju-XAH#Pns762L}K3 zDhvsRqN0Ni(1UrishD2YvV?4*h2iFj$+&N||Fn$4n|^NSU+o?~jq`0jVQt8T9l{7b zXiwwODFh2V!Q6sqP9S>WH$oOf$N~=d0-bqTlD61!=`&0eAP-F>XN?*|gtOXX{ zQVTWyYo4ZK0GAw!GHf|pz9`D;-bbb*5LBX*{bnz|+)$@&P9|ORM2o?95{;ejvo&r- zq8cBhTN6nn)7~W>54U)%-F_-b?YKdfk5I8MHcuzBD5)!;yv#Z&R&^y=@=>VTIMy#r zX&U<=BsPkdqcMe<_}2+>H%XKyrr5ZR8_KVe>ZqYN z^=^~TFD};;rHJ$U;{~w^hYojl4hRI@SH$^K{YEo=sg)WY87r!*7blQK&qnpDo0`Vn zkl)9u9g=mCh&ZCJS(L4yN3k0kQ zuvg$h2KEEk51T+O0JQ+r0`R>g{jvqM0Mr6d3qUOZwE!?PI7HY@CE|dr sfw?Q;rAv?G4&^^8-z_>&sWXMxvD*gPOU4CBe-*@OtE+wfmVJNyHv)PfH~;_u literal 0 HcmV?d00001 From 7f35b1cc8e29153322d6bc84495f04efc5888e9b Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Sun, 19 Jan 2014 17:29:19 -0800 Subject: [PATCH 16/20] Move iOS and OS X folders in a new folder named "Sample Client". --- FileMD5Hash.xcodeproj/project.pbxproj | 80 +++++++----------- .../OSX}/FileMD5Hash-Info.plist | 0 {OSX => SampleClient/OSX}/FileMD5Hash.m | 0 {OSX => SampleClient/OSX}/FileMD5Hash.xib | 0 .../OSX}/FileMD5HashApplicationDelegate.h | 0 .../OSX}/FileMD5HashApplicationDelegate.m | 0 .../OSX}/FileMD5HashViewController.h | 0 .../OSX}/FileMD5HashViewController.m | 0 {iOS => SampleClient/iOS}/Default-568h@2x.png | Bin .../iOS}/FileMD5Hash-Info.plist | 0 {iOS => SampleClient/iOS}/FileMD5Hash.m | 0 .../iOS}/FileMD5HashApplicationDelegate.h | 0 .../iOS}/FileMD5HashApplicationDelegate.m | 0 .../iOS}/FileMD5HashViewController.h | 0 .../iOS}/FileMD5HashViewController.m | 0 15 files changed, 30 insertions(+), 50 deletions(-) rename {OSX => SampleClient/OSX}/FileMD5Hash-Info.plist (100%) rename {OSX => SampleClient/OSX}/FileMD5Hash.m (100%) rename {OSX => SampleClient/OSX}/FileMD5Hash.xib (100%) rename {OSX => SampleClient/OSX}/FileMD5HashApplicationDelegate.h (100%) rename {OSX => SampleClient/OSX}/FileMD5HashApplicationDelegate.m (100%) rename {OSX => SampleClient/OSX}/FileMD5HashViewController.h (100%) rename {OSX => SampleClient/OSX}/FileMD5HashViewController.m (100%) rename {iOS => SampleClient/iOS}/Default-568h@2x.png (100%) rename {iOS => SampleClient/iOS}/FileMD5Hash-Info.plist (100%) rename {iOS => SampleClient/iOS}/FileMD5Hash.m (100%) rename {iOS => SampleClient/iOS}/FileMD5HashApplicationDelegate.h (100%) rename {iOS => SampleClient/iOS}/FileMD5HashApplicationDelegate.m (100%) rename {iOS => SampleClient/iOS}/FileMD5HashViewController.h (100%) rename {iOS => SampleClient/iOS}/FileMD5HashViewController.m (100%) diff --git a/FileMD5Hash.xcodeproj/project.pbxproj b/FileMD5Hash.xcodeproj/project.pbxproj index a0c8213..826578b 100644 --- a/FileMD5Hash.xcodeproj/project.pbxproj +++ b/FileMD5Hash.xcodeproj/project.pbxproj @@ -80,8 +80,7 @@ isa = PBXGroup; children = ( 5DE28613126AD4EB0092F897 /* Library */, - 5DE285D0126ACE110092F897 /* iOS */, - 5DC8CD83126AF49500CE5F6B /* OS X */, + 5D3336A5188CB1FF007C61B0 /* Sample Client */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, ); @@ -97,6 +96,16 @@ name = Frameworks; sourceTree = ""; }; + 5D3336A5188CB1FF007C61B0 /* Sample Client */ = { + isa = PBXGroup; + children = ( + 5DE285D0126ACE110092F897 /* iOS */, + 5DC8CD83126AF49500CE5F6B /* OS X */, + ); + name = "Sample Client"; + path = SampleClient; + sourceTree = ""; + }; 5DC8CD83126AF49500CE5F6B /* OS X */ = { isa = PBXGroup; children = ( @@ -155,9 +164,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* iOS */ = { + 1D6058900D05DD3D006BFB54 /* Sample Client - iOS */ = { isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "iOS" */; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Sample Client - iOS" */; buildPhases = ( 1D60588D0D05DD3D006BFB54 /* Resources */, 1D60588E0D05DD3D006BFB54 /* Sources */, @@ -167,14 +176,14 @@ ); dependencies = ( ); - name = iOS; + name = "Sample Client - iOS"; productName = FileMD5Hash; productReference = 1D6058910D05DD3D006BFB54 /* FileMD5Hash.app */; productType = "com.apple.product-type.application"; }; - 5DC8CD7B126AF42700CE5F6B /* OS X */ = { + 5DC8CD7B126AF42700CE5F6B /* Sample Client - OS X */ = { isa = PBXNativeTarget; - buildConfigurationList = 5DC8CD81126AF42800CE5F6B /* Build configuration list for PBXNativeTarget "OS X" */; + buildConfigurationList = 5DC8CD81126AF42800CE5F6B /* Build configuration list for PBXNativeTarget "Sample Client - OS X" */; buildPhases = ( 5DC8CD78126AF42700CE5F6B /* Resources */, 5DC8CD79126AF42700CE5F6B /* Sources */, @@ -184,7 +193,7 @@ ); dependencies = ( ); - name = "OS X"; + name = "Sample Client - OS X"; productName = FileMD5Hash; productReference = 5DC8CD7C126AF42700CE5F6B /* FileMD5Hash.app */; productType = "com.apple.product-type.application"; @@ -195,7 +204,9 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { + CLASSPREFIX = FileHash; LastUpgradeCheck = 0500; + ORGANIZATIONNAME = "Joel Lopes Da Silva"; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "FileMD5Hash" */; compatibilityVersion = "Xcode 3.2"; @@ -211,8 +222,8 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 1D6058900D05DD3D006BFB54 /* iOS */, - 5DC8CD7B126AF42700CE5F6B /* OS X */, + 1D6058900D05DD3D006BFB54 /* Sample Client - iOS */, + 5DC8CD7B126AF42700CE5F6B /* Sample Client - OS X */, ); }; /* End PBXProject section */ @@ -265,45 +276,24 @@ 1D6058940D05DD3E006BFB54 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - INFOPLIST_FILE = "iOS/FileMD5Hash-Info.plist"; - PRODUCT_NAME = FileMD5Hash; + INFOPLIST_FILE = "SampleClient/iOS/FileMD5Hash-Info.plist"; }; name = Debug; }; 1D6058950D05DD3E006BFB54 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - INFOPLIST_FILE = "iOS/FileMD5Hash-Info.plist"; - PRODUCT_NAME = FileMD5Hash; - VALIDATE_PRODUCT = YES; + INFOPLIST_FILE = "SampleClient/iOS/FileMD5Hash-Info.plist"; }; name = Release; }; 5DC8CD7F126AF42800CE5F6B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; COMBINE_HIDPI_IMAGES = YES; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INFOPLIST_FILE = "OSX/FileMD5Hash-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; + INFOPLIST_FILE = "SampleClient/OSX/FileMD5Hash-Info.plist"; MACOSX_DEPLOYMENT_TARGET = 10.8; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; - PRODUCT_NAME = FileMD5Hash; SDKROOT = macosx; }; name = Debug; @@ -311,24 +301,11 @@ 5DC8CD80126AF42800CE5F6B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; COMBINE_HIDPI_IMAGES = YES; - COPY_PHASE_STRIP = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_MODEL_TUNING = G5; - INFOPLIST_FILE = "OSX/FileMD5Hash-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; + INFOPLIST_FILE = "SampleClient/OSX/FileMD5Hash-Info.plist"; MACOSX_DEPLOYMENT_TARGET = 10.8; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PREBINDING = NO; - PRODUCT_NAME = FileMD5Hash; SDKROOT = macosx; - ZERO_LINK = NO; }; name = Release; }; @@ -350,6 +327,7 @@ CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; @@ -374,6 +352,7 @@ GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(PROJECT_NAME)"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -421,6 +400,7 @@ GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + PRODUCT_NAME = "$(PROJECT_NAME)"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -429,7 +409,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "iOS" */ = { + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Sample Client - iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( 1D6058940D05DD3E006BFB54 /* Debug */, @@ -438,7 +418,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 5DC8CD81126AF42800CE5F6B /* Build configuration list for PBXNativeTarget "OS X" */ = { + 5DC8CD81126AF42800CE5F6B /* Build configuration list for PBXNativeTarget "Sample Client - OS X" */ = { isa = XCConfigurationList; buildConfigurations = ( 5DC8CD7F126AF42800CE5F6B /* Debug */, diff --git a/OSX/FileMD5Hash-Info.plist b/SampleClient/OSX/FileMD5Hash-Info.plist similarity index 100% rename from OSX/FileMD5Hash-Info.plist rename to SampleClient/OSX/FileMD5Hash-Info.plist diff --git a/OSX/FileMD5Hash.m b/SampleClient/OSX/FileMD5Hash.m similarity index 100% rename from OSX/FileMD5Hash.m rename to SampleClient/OSX/FileMD5Hash.m diff --git a/OSX/FileMD5Hash.xib b/SampleClient/OSX/FileMD5Hash.xib similarity index 100% rename from OSX/FileMD5Hash.xib rename to SampleClient/OSX/FileMD5Hash.xib diff --git a/OSX/FileMD5HashApplicationDelegate.h b/SampleClient/OSX/FileMD5HashApplicationDelegate.h similarity index 100% rename from OSX/FileMD5HashApplicationDelegate.h rename to SampleClient/OSX/FileMD5HashApplicationDelegate.h diff --git a/OSX/FileMD5HashApplicationDelegate.m b/SampleClient/OSX/FileMD5HashApplicationDelegate.m similarity index 100% rename from OSX/FileMD5HashApplicationDelegate.m rename to SampleClient/OSX/FileMD5HashApplicationDelegate.m diff --git a/OSX/FileMD5HashViewController.h b/SampleClient/OSX/FileMD5HashViewController.h similarity index 100% rename from OSX/FileMD5HashViewController.h rename to SampleClient/OSX/FileMD5HashViewController.h diff --git a/OSX/FileMD5HashViewController.m b/SampleClient/OSX/FileMD5HashViewController.m similarity index 100% rename from OSX/FileMD5HashViewController.m rename to SampleClient/OSX/FileMD5HashViewController.m diff --git a/iOS/Default-568h@2x.png b/SampleClient/iOS/Default-568h@2x.png similarity index 100% rename from iOS/Default-568h@2x.png rename to SampleClient/iOS/Default-568h@2x.png diff --git a/iOS/FileMD5Hash-Info.plist b/SampleClient/iOS/FileMD5Hash-Info.plist similarity index 100% rename from iOS/FileMD5Hash-Info.plist rename to SampleClient/iOS/FileMD5Hash-Info.plist diff --git a/iOS/FileMD5Hash.m b/SampleClient/iOS/FileMD5Hash.m similarity index 100% rename from iOS/FileMD5Hash.m rename to SampleClient/iOS/FileMD5Hash.m diff --git a/iOS/FileMD5HashApplicationDelegate.h b/SampleClient/iOS/FileMD5HashApplicationDelegate.h similarity index 100% rename from iOS/FileMD5HashApplicationDelegate.h rename to SampleClient/iOS/FileMD5HashApplicationDelegate.h diff --git a/iOS/FileMD5HashApplicationDelegate.m b/SampleClient/iOS/FileMD5HashApplicationDelegate.m similarity index 100% rename from iOS/FileMD5HashApplicationDelegate.m rename to SampleClient/iOS/FileMD5HashApplicationDelegate.m diff --git a/iOS/FileMD5HashViewController.h b/SampleClient/iOS/FileMD5HashViewController.h similarity index 100% rename from iOS/FileMD5HashViewController.h rename to SampleClient/iOS/FileMD5HashViewController.h diff --git a/iOS/FileMD5HashViewController.m b/SampleClient/iOS/FileMD5HashViewController.m similarity index 100% rename from iOS/FileMD5HashViewController.m rename to SampleClient/iOS/FileMD5HashViewController.m From e30749f2d07e7844ab06c10ae5c7de3009557950 Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Sun, 19 Jan 2014 18:05:34 -0800 Subject: [PATCH 17/20] Bump up to version 2.0.0. --- CHANGELOG | 12 ++++++++++++ FileMD5Hash.podspec | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 CHANGELOG diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..9c2eb40 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,12 @@ +2.0.0 + - New Objective-C API; the old API was just removed, hence the bump in major version number. + - ARC support. + - Additional SHA1 and SHA512 hashing routines. + * The logic for computing the hash wasn't replicated, it was simply made more modular internally. + * The implementation of a new method like that is just 3 lines of code, most of which to create the "hash computation context" containing all the special parts for the requested algorithm. + - Parameter chunkSizeForReadingData was removed; too much of a hassle to pass it. + - Removed goto usage. + - Miscellaneous cleanup. + +1.0.0 + - Initial release. diff --git a/FileMD5Hash.podspec b/FileMD5Hash.podspec index 32c9453..2e11a35 100644 --- a/FileMD5Hash.podspec +++ b/FileMD5Hash.podspec @@ -1,10 +1,10 @@ Pod::Spec.new do |spec| spec.name = 'FileMD5Hash' - spec.version = '2.0.0-pre' + spec.version = '2.0.0' spec.license = 'Apache License, Version 2.0' spec.summary = 'Library for computing MD5 hashes of files with small memory usage.' spec.homepage = 'https://github.com/JoeKun/FileMD5Hash' spec.author = { 'Joel Lopes Da Silva' => 'joel@lopes-da-silva.com' } - spec.source = { :git => 'https://github.com/JoeKun/FileMD5Hash.git', :tag => '1.0.0' } + spec.source = { :git => 'https://github.com/JoeKun/FileMD5Hash.git', :tag => '2.0.0' } spec.source_files = 'Library/*.{h,m}' end From cc8e232fbc201fc2efd8af40afc7ef2a378356f7 Mon Sep 17 00:00:00 2001 From: Joel Lopes Da Silva Date: Thu, 20 Mar 2014 22:26:11 -0700 Subject: [PATCH 18/20] Fix comment. --- Library/FileHash.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/FileHash.m b/Library/FileHash.m index d0fee4c..6449b95 100644 --- a/Library/FileHash.m +++ b/Library/FileHash.m @@ -1,5 +1,5 @@ /* - * FileHash.c + * FileHash.m * FileMD5Hash * * Copyright © 2010-2014 Joel Lopes Da Silva. All rights reserved. From a844c7bb8efe06f1dfa444e91b081a5fa52333a8 Mon Sep 17 00:00:00 2001 From: Fabio Gallonetto Date: Mon, 18 May 2015 12:06:26 +0100 Subject: [PATCH 19/20] Add support for SHA256 --- Library/FileHash.h | 1 + Library/FileHash.m | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Library/FileHash.h b/Library/FileHash.h index 0165436..d20959a 100644 --- a/Library/FileHash.h +++ b/Library/FileHash.h @@ -24,6 +24,7 @@ + (NSString *)md5HashOfFileAtPath:(NSString *)filePath; + (NSString *)sha1HashOfFileAtPath:(NSString *)filePath; ++ (NSString *)sha256HashOfFileAtPath:(NSString *)filePath; + (NSString *)sha512HashOfFileAtPath:(NSString *)filePath; @end diff --git a/Library/FileHash.m b/Library/FileHash.m index 6449b95..d191396 100644 --- a/Library/FileHash.m +++ b/Library/FileHash.m @@ -118,6 +118,13 @@ + (NSString *)sha1HashOfFileAtPath:(NSString *)filePath { return [self hashOfFileAtPath:filePath withComputationContext:&context]; } ++ (NSString *)sha256HashOfFileAtPath:(NSString *)filePath { + FileHashComputationContext context; + FileHashComputationContextInitialize(context, SHA256); + return [self hashOfFileAtPath:filePath withComputationContext:&context]; +} + + + (NSString *)sha512HashOfFileAtPath:(NSString *)filePath { FileHashComputationContext context; FileHashComputationContextInitialize(context, SHA512); From e309bf9aac5c3e1e9134a4d0d5a84f1078cca91d Mon Sep 17 00:00:00 2001 From: Fabio Gallonetto Date: Mon, 18 May 2015 12:08:13 +0100 Subject: [PATCH 20/20] Fix identation --- Library/FileHash.m | 1 - 1 file changed, 1 deletion(-) diff --git a/Library/FileHash.m b/Library/FileHash.m index d191396..5f27e43 100644 --- a/Library/FileHash.m +++ b/Library/FileHash.m @@ -124,7 +124,6 @@ + (NSString *)sha256HashOfFileAtPath:(NSString *)filePath { return [self hashOfFileAtPath:filePath withComputationContext:&context]; } - + (NSString *)sha512HashOfFileAtPath:(NSString *)filePath { FileHashComputationContext context; FileHashComputationContextInitialize(context, SHA512);