diff --git a/.travis.yml b/.travis.yml index e573a53..afc7680 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -osx_image: xcode7.3 +osx_image: xcode8 language: objective-c before_install: - ./build-libssl.sh verbose-on-error @@ -7,4 +7,6 @@ before_install: - xcrun -sdk iphoneos lipo -info openssl.framework/openssl script: - - xctool -project OpenSSL-for-iOS.xcodeproj -scheme OpenSSL-for-iOS -sdk iphonesimulator clean build + - xcodebuild -project OpenSSL-for-iOS.xcodeproj -scheme OpenSSL-for-iOS -sdk iphonesimulator clean build + # xctool 0.2.9 doesn't support Xcode 8 yet (see https://github.com/facebook/xctool/issues/704) + #- xctool -project OpenSSL-for-iOS.xcodeproj -scheme OpenSSL-for-iOS -sdk iphonesimulator clean build diff --git a/OpenSSL-for-iOS.xcodeproj/project.pbxproj b/OpenSSL-for-iOS.xcodeproj/project.pbxproj index 2282fd5..d6bd5f6 100644 --- a/OpenSSL-for-iOS.xcodeproj/project.pbxproj +++ b/OpenSSL-for-iOS.xcodeproj/project.pbxproj @@ -271,13 +271,18 @@ 533ED2F21528C4840005C6FA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0800; ORGANIZATIONNAME = Immobilienscout24; TargetAttributes = { 2A8A9A6E1BFA59F7002944B4 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0800; + }; + 533ED2FA1528C4840005C6FA = { + LastSwiftMigration = 0800; }; 53572A4A183AAFFE00B21832 = { + LastSwiftMigration = 0800; TestTargetID = 533ED2FA1528C4840005C6FA; }; }; @@ -424,6 +429,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_OBJC_BRIDGING_HEADER = "OpenSSL-for-iOS/OpenSSL-for-iOS-Bridging-Header.h"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -455,6 +461,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_OBJC_BRIDGING_HEADER = "OpenSSL-for-iOS/OpenSSL-for-iOS-Bridging-Header.h"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -469,7 +476,9 @@ CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; @@ -510,7 +519,9 @@ CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; @@ -529,6 +540,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; TVOS_DEPLOYMENT_TARGET = 9.0; VALIDATE_PRODUCT = YES; @@ -553,6 +565,7 @@ PRODUCT_NAME = OpenSSL; SWIFT_OBJC_BRIDGING_HEADER = "OpenSSL-for-iOS/OpenSSL-for-iOS-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; WRAPPER_EXTENSION = app; }; name = Debug; @@ -574,6 +587,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "de.felixschulze.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = OpenSSL; SWIFT_OBJC_BRIDGING_HEADER = "OpenSSL-for-iOS/OpenSSL-for-iOS-Bridging-Header.h"; + SWIFT_VERSION = 3.0; WRAPPER_EXTENSION = app; }; name = Release; @@ -607,6 +621,7 @@ ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "de.felixschulze.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUNDLE_LOADER)"; WRAPPER_EXTENSION = xctest; }; @@ -637,6 +652,7 @@ INFOPLIST_FILE = "OpenSSL-for-iOS_Tests/OpenSSL-for-iOS_Tests-Info.plist"; PRODUCT_BUNDLE_IDENTIFIER = "de.felixschulze.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUNDLE_LOADER)"; WRAPPER_EXTENSION = xctest; }; diff --git a/OpenSSL-for-iOS.xcodeproj/xcshareddata/xcschemes/OpenSSL-for-iOS.xcscheme b/OpenSSL-for-iOS.xcodeproj/xcshareddata/xcschemes/OpenSSL-for-iOS.xcscheme index 3df6a15..0f8dea8 100644 --- a/OpenSSL-for-iOS.xcodeproj/xcshareddata/xcschemes/OpenSSL-for-iOS.xcscheme +++ b/OpenSSL-for-iOS.xcodeproj/xcshareddata/xcschemes/OpenSSL-for-iOS.xcscheme @@ -1,6 +1,6 @@ Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - self.window = UIWindow(frame: UIScreen.mainScreen().bounds) + self.window = UIWindow(frame: UIScreen.main.bounds) #if os(tvOS) self.window?.rootViewController = ViewController(nibName: "ViewController~tv", bundle: nil) #else let navigationController = UINavigationController(rootViewController: ViewController()) - navigationController.navigationBar.translucent = false + navigationController.navigationBar.isTranslucent = false self.window?.rootViewController = navigationController #endif diff --git a/OpenSSL-for-iOS/Icons.xcassets/AppIcon.appiconset/Contents.json b/OpenSSL-for-iOS/Icons.xcassets/AppIcon.appiconset/Contents.json index 86648a0..1e8eae0 100644 --- a/OpenSSL-for-iOS/Icons.xcassets/AppIcon.appiconset/Contents.json +++ b/OpenSSL-for-iOS/Icons.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "size" : "29x29", "idiom" : "iphone", @@ -36,6 +46,16 @@ "filename" : "Icon-60@3x.png", "scale" : "3x" }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, { "size" : "29x29", "idiom" : "ipad", @@ -71,6 +91,12 @@ "idiom" : "ipad", "filename" : "Icon-76@2x.png", "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-83.5@2x-1.png", + "scale" : "2x" } ], "info" : { diff --git a/OpenSSL-for-iOS/Icons.xcassets/AppIcon.appiconset/Icon-83.5@2x-1.png b/OpenSSL-for-iOS/Icons.xcassets/AppIcon.appiconset/Icon-83.5@2x-1.png new file mode 100644 index 0000000..4dbb35c Binary files /dev/null and b/OpenSSL-for-iOS/Icons.xcassets/AppIcon.appiconset/Icon-83.5@2x-1.png differ diff --git a/OpenSSL-for-iOS/ViewController.swift b/OpenSSL-for-iOS/ViewController.swift index 5ebb342..7dc894b 100644 --- a/OpenSSL-for-iOS/ViewController.swift +++ b/OpenSSL-for-iOS/ViewController.swift @@ -18,21 +18,21 @@ class ViewController: UIViewController { @IBAction func showInfo() { - let message = "OpenSSL-Version: \(OPENSSL_VERSION_TEXT)\nLicense: See include/LICENSE\n\nCopyright 2010-2015 by Felix Schulze\n http://www.felixschulze.de" - let alertController = UIAlertController(title: "OpenSSL-for-iOS", message: message, preferredStyle: .Alert) - alertController.addAction(UIAlertAction(title: "Ok", style: .Cancel, handler: nil)) - self.presentViewController(alertController, animated: true, completion: nil) + let message = "OpenSSL-Version: \(OPENSSL_VERSION_TEXT)\nLicense: See include/LICENSE\n\nCopyright 2010-2016 by Felix Schulze\n http://www.felixschulze.de" + let alertController = UIAlertController(title: "OpenSSL-for-iOS", message: message, preferredStyle: .alert) + alertController.addAction(UIAlertAction(title: "Ok", style: .cancel, handler: nil)) + self.present(alertController, animated: true, completion: nil) } override func viewDidLoad() { super.viewDidLoad() self.title = "OpenSSL-for-iOS" - let infoButton = UIButton(type: .InfoLight) - infoButton.addTarget(self, action: #selector(ViewController.showInfo), forControlEvents: .TouchDown) + let infoButton = UIButton(type: .infoLight) + infoButton.addTarget(self, action: #selector(ViewController.showInfo), for: .touchDown) self.navigationItem.rightBarButtonItem = UIBarButtonItem(customView: infoButton) - self.textField.addTarget(self, action: #selector(ViewController.textFieldDidChange), forControlEvents: .EditingChanged) + self.textField.addTarget(self, action: #selector(ViewController.textFieldDidChange), for: .editingChanged) self.calculateHash() } @@ -42,8 +42,8 @@ class ViewController: UIViewController { func calculateHash() { if textField.text!.characters.count > 0 { - md5Label.text = FSOpenSSL.md5FromString(textField.text) - sh256Label.text = FSOpenSSL.sha256FromString(textField.text) + md5Label.text = FSOpenSSL.md5(from: textField.text) + sh256Label.text = FSOpenSSL.sha256(from: textField.text) } else { md5Label.text = nil diff --git a/README.md b/README.md index 74f3f86..54ca1a6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# OpenSSL-for-iOS [![Build Status](https://travis-ci.org/x2on/OpenSSL-for-iPhone.svg)](https://travis-ci.org/x2on/OpenSSL-for-iPhone) [![license](https://img.shields.io/github/license/x2on/OpenSSL-for-iPhone.svg)](https://github.com/x2on/OpenSSL-for-iPhone/blob/master/LICENSE) [![OpenSSL version](https://img.shields.io/badge/OpenSSL-1.0.2h-lightgrey.svg)]() [![iOS support](https://img.shields.io/badge/iOS-7.0%20--%209.3-lightgrey.svg)]() [![tvOS support](https://img.shields.io/badge/tvOS-9.2-lightgrey.svg)]() +# OpenSSL-for-iOS [![Build Status](https://travis-ci.org/x2on/OpenSSL-for-iPhone.svg)](https://travis-ci.org/x2on/OpenSSL-for-iPhone) [![license](https://img.shields.io/github/license/x2on/OpenSSL-for-iPhone.svg)](https://github.com/x2on/OpenSSL-for-iPhone/blob/master/LICENSE) [![OpenSSL version](https://img.shields.io/badge/OpenSSL-1.0.2h-lightgrey.svg)]() [![iOS support](https://img.shields.io/badge/iOS-7.0%20--%2010.0-lightgrey.svg)]() [![tvOS support](https://img.shields.io/badge/tvOS-9.2--%2010.0-lightgrey.svg)]() This is a script for using self-compiled builds of the OpenSSL-library on the iPhone. You can build apps with Xcode and the official SDK from Apple with this. I also made a small example-app for using the libraries with Xcode and the iPhone/iPhone-Simulator. @@ -9,10 +9,10 @@ You must build the OpenSSL-Libraries before running the sample with: ./build-libssl.sh ``` -This repository contains an iOS 9.1 Xcode Project which uses the OpenSSL Libraries. The examples uses the MD5 or SHA256-algorithm to calculate an md5 or sha256 hash from an UITextfield. +This repository contains an iOS 10.0 Xcode Project which uses the OpenSSL Libraries. The examples uses the MD5 or SHA256-algorithm to calculate an md5 or sha256 hash from an UITextfield. ## System support -**iOS 7.0 - iOS 9.3 (i386, x86_64, armv7, armv7s, armv64, bitcode) and tvOS are currently supported.** +**iOS 7.0 - iOS 10.0 (i386, x86_64, armv7, armv7s, armv64, bitcode) and tvOS are currently supported.** For iOS < 7.0 you must use Xcode < 7 and an older version of the build script. @@ -23,6 +23,7 @@ If you have problems building for arm64 please uninstall MacPorts (see [#28](htt * ## Changelog +* 2016-09-18: Xcode 8 support, iOS 10.0 * 2016-08-09: Xcode 7.3 support, iOS 9.3 * 2016-05-04: OpenSSL 1.0.2h * 2015-12-11: Xcode 7.2 support, iOS 9.2