Browse Source

Add RNCommonCrypto to try to make CocoaPods happy

Rob Napier 8 years ago
parent
commit
8e11fb04e1

+ 8 - 0
CommonCrypto/CommonCrypto.c

@@ -0,0 +1,8 @@
+/* Something to compile so CocoaPods is happy */
+
+#include "CommonCrypto.h"
+
+int main(int argc, char const *argv[])
+{
+  return 0;
+}

+ 30 - 16
CommonCrypto/CommonCrypto.h

@@ -1,19 +1,33 @@
-//
-//  CommonCrypto.h
-//  CommonCrypto
-//
-//  Created by Rob Napier on 6/12/15.
-//  Copyright © 2015 Rob Napier. All rights reserved.
-//
+/*
+ * Copyright (c) 2006-2012 Apple, Inc. All Rights Reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
 
-#import <UIKit/UIKit.h>
-
-//! Project version number for CommonCrypto.
-FOUNDATION_EXPORT double CommonCryptoVersionNumber;
-
-//! Project version string for CommonCrypto.
-FOUNDATION_EXPORT const unsigned char CommonCryptoVersionString[];
-
-// In this header, you should import all the public headers of your framework using statements like #import <CommonCrypto/PublicHeader.h>
+#ifndef __COMMONCRYPTO_PUBLIC__
+#define __COMMONCRYPTO_PUBLIC__
 
+#include <CommonCrypto/CommonCryptor.h>
+#include <CommonCrypto/CommonDigest.h>
+#include <CommonCrypto/CommonHMAC.h>
+#include <CommonCrypto/CommonKeyDerivation.h>
+#include <CommonCrypto/CommonSymmetricKeywrap.h>
 
+#endif /* __COMMONCRYPTO_PUBLIC__ */

+ 0 - 0
CommonCrypto/iphoneos.modulemap → CommonCrypto/CommonCrypto.modulemap


+ 1 - 3
CommonCrypto/CommonCrypto.xcconfig

@@ -1,3 +1 @@
-MODULEMAP_FILE[sdk=iphoneos*]        = $(SRCROOT)/CommonCrypto/iphoneos.modulemap
-MODULEMAP_FILE[sdk=iphonesimulator*] = $(SRCROOT)/CommonCrypto/iphonesimulator.modulemap
-MODULEMAP_FILE[sdk=macosx*]          = $(SRCROOT)/CommonCrypto/macosx.modulemap
+MODULEMAP_FILE = $(SRCROOT)/CommonCrypto/CommonCrypto.modulemap

+ 0 - 4
CommonCrypto/iphonesimulator.modulemap

@@ -1,4 +0,0 @@
-module CommonCrypto [system] {
-    header "/usr/include/CommonCrypto/CommonCrypto.h"
-    export *
-}

+ 0 - 4
CommonCrypto/macosx.modulemap

@@ -1,4 +0,0 @@
-module CommonCrypto [system] {
-    header "/usr/include/CommonCrypto/CommonCrypto.h"
-    export *
-}

+ 21 - 0
LICENSE

@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Rob Napier
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

+ 1 - 1
README.md

@@ -152,7 +152,7 @@ if (error != nil) {
 
 ### Requirements
 
-RNCryptor 4 is written in Swift 2, so requires Xcode 7, and can target iOS 7 or greater and OS X 10.9 or later. If you want a pure ObjC implementation that supports older versions of iOS and OS X, see [RNCryptor 3](https://github.com/RNCryptor/RNCryptor/releases/tag/RNCryptor-3.0.1).
+RNCryptor 4 is written in Swift 2, so requires Xcode 7, and can target iOS 7 or later (iOS 8 or later if used as a framework), and OS X 10.9 or later. If you want a pure ObjC implementation that supports older versions of iOS and OS X, see [RNCryptor 3](https://github.com/RNCryptor/RNCryptor/releases/tag/RNCryptor-3.0.1).
 
 ### A word about CommonCrypto
 

+ 14 - 0
RNCommonCrypto.podspec

@@ -0,0 +1,14 @@
+Pod::Spec.new do |s|
+  s.name = 'RNCommonCrypto'
+  s.version = '4.0.0-beta.1'
+  s.summary = 'Swift-compatibility module for CommonCrypto'
+  s.authors = {'Rob Napier' => 'robnapier@gmail.com'}
+  s.social_media_url = 'https://twitter.com/cocoaphony'
+  s.license = 'MIT'
+  s.source = { :git => 'https://github.com/rnapier/RNCryptor.git', :tag => "v#{s.version.to_s}" }
+  s.homepage = 'https://github.com/rnapier/RNCryptor'
+  s.source_files = 'CommonCrypto/CommonCrypto.c'
+  s.public_header_files = 'CommonCrypto/CommonCrypto.h'
+  s.ios.deployment_target = '8.0'
+  s.osx.deployment_target = '10.9'
+end

+ 3 - 2
RNCryptor.podspec

@@ -3,12 +3,13 @@ Pod::Spec.new do |s|
   s.version = '4.0.0-beta.1'
   s.summary = 'Cross-language AES Encryptor/Decryptor data format.'
   s.authors = {'Rob Napier' => 'robnapier@gmail.com'}
+  s.social_media_url = 'https://twitter.com/cocoaphony'
   s.license = 'MIT'
   s.source = { :git => 'https://github.com/rnapier/RNCryptor.git', :tag => "v#{s.version.to_s}" }
   s.description = 'Implements a secure encryption format based on AES, PBKDF2, and HMAC.'
   s.homepage = 'https://github.com/rnapier/RNCryptor'
   s.source_files = 'RNCryptor/RNCryptor.swift'
-  s.requires_arc = true
-  s.ios.deployment_target = '7.0'
+  s.ios.deployment_target = '8.0'
   s.osx.deployment_target = '10.9'
+  s.dependency 'RNCommonCrypto'
 end

+ 1 - 0
RNCryptorTests/ObjC.m

@@ -22,6 +22,7 @@
 //  DEALINGS IN THE SOFTWARE.
 //
 
+#import <Foundation/Foundation.h>
 #import <XCTest/XCTest.h>
 @import RNCryptor;
 #import <CommonCrypto/CommonCryptor.h>