├── .gitignore ├── .idea ├── encodings.xml ├── ipatool.iml ├── misc.xml ├── modules.xml ├── scopes │ └── scope_settings.xml ├── vcs.xml └── xcode.xml ├── IpaTool.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── IpaTool ├── IPTCommandBuild.swift ├── IPTCommandResign.swift ├── IPTCommandVersion.swift ├── IPTSystemCommand.swift ├── ITCMSDecoder.swift ├── ITCommand.swift ├── ITCommandFactory.swift ├── ITCommandInfo.swift ├── ITCommandUsage.swift ├── ITIpa.swift ├── ITMain.swift ├── ITProvisioningProfile.swift ├── ITSecCertificate.swift └── main.swift ├── IpaToolTests ├── IPTCommandBuildTests.swift ├── IPTCommandResignTests.swift ├── IPTCommandVersionTests.swift ├── IPTSystemCommandTests.swift ├── ITCommandFactoryTests.swift ├── ITCommandInfoTests.swift ├── ITIpaTests.swift ├── ITMainTests.swift ├── ITTestConfig.swift ├── Info.plist ├── SampleApp_Ad_Hoc.mobileprovision └── testConfig.json ├── LICENSE ├── Podfile ├── Podfile.lock ├── Pods ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj ├── SSZipArchive │ ├── LICENSE.txt │ ├── README.md │ └── SSZipArchive │ │ ├── SSZipArchive.h │ │ ├── SSZipArchive.m │ │ ├── SSZipCommon.h │ │ ├── ZipArchive.h │ │ └── minizip │ │ ├── aes │ │ ├── aes.h │ │ ├── aes_ni.c │ │ ├── aes_ni.h │ │ ├── aescrypt.c │ │ ├── aeskey.c │ │ ├── aesopt.h │ │ ├── aestab.c │ │ ├── aestab.h │ │ ├── brg_endian.h │ │ ├── brg_types.h │ │ ├── fileenc.c │ │ ├── fileenc.h │ │ ├── hmac.c │ │ ├── hmac.h │ │ ├── prng.c │ │ ├── prng.h │ │ ├── pwd2key.c │ │ ├── pwd2key.h │ │ ├── sha1.c │ │ └── sha1.h │ │ ├── crypt.c │ │ ├── crypt.h │ │ ├── ioapi.c │ │ ├── ioapi.h │ │ ├── ioapi_buf.c │ │ ├── ioapi_buf.h │ │ ├── ioapi_mem.c │ │ ├── ioapi_mem.h │ │ ├── minishared.c │ │ ├── minishared.h │ │ ├── unzip.c │ │ ├── unzip.h │ │ ├── zip.c │ │ └── zip.h └── Target Support Files │ ├── Pods-ipatool-ipatoolTests │ ├── Info.plist │ ├── Pods-ipatool-ipatoolTests-acknowledgements.markdown │ ├── Pods-ipatool-ipatoolTests-acknowledgements.plist │ ├── Pods-ipatool-ipatoolTests-dummy.m │ ├── Pods-ipatool-ipatoolTests-frameworks.sh │ ├── Pods-ipatool-ipatoolTests-resources.sh │ ├── Pods-ipatool-ipatoolTests-umbrella.h │ ├── Pods-ipatool-ipatoolTests.debug.xcconfig │ ├── Pods-ipatool-ipatoolTests.modulemap │ └── Pods-ipatool-ipatoolTests.release.xcconfig │ ├── Pods-ipatool │ ├── Info.plist │ ├── Pods-ipatool-acknowledgements.markdown │ ├── Pods-ipatool-acknowledgements.plist │ ├── Pods-ipatool-dummy.m │ ├── Pods-ipatool-frameworks.sh │ ├── Pods-ipatool-resources.sh │ ├── Pods-ipatool-umbrella.h │ ├── Pods-ipatool.debug.xcconfig │ ├── Pods-ipatool.modulemap │ └── Pods-ipatool.release.xcconfig │ └── SSZipArchive │ ├── Info.plist │ ├── SSZipArchive-dummy.m │ ├── SSZipArchive-prefix.pch │ ├── SSZipArchive-umbrella.h │ ├── SSZipArchive.modulemap │ └── SSZipArchive.xcconfig ├── README.md ├── SampleApp ├── AppDelegate.swift ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist └── ViewController.swift ├── buildAndInstall.sh ├── ipatool-Bridging-Header.h ├── ipatool.xcodeproj └── xcshareddata │ └── xcschemes │ ├── SampleApp.xcscheme │ ├── ipatool.xcscheme │ └── ipatoolTests.xcscheme └── ipatool.xcworkspace └── contents.xcworkspacedata /.gitignore: -------------------------------------------------------------------------------- 1 | ipatool.sh 2 | *.xcuserstate 3 | .ruby-gemset 4 | .ruby-version 5 | *.idea/workspace.xml 6 | xcuserdata 7 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/ipatool.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/xcode.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /IpaTool.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /IpaTool/IPTCommandBuild.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IPTCommandBuild.swift 3 | // ipatool 4 | // 5 | // Created by Stefan on 28/11/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class IPTCommandBuild : ITCommand 12 | { 13 | override func execute(_ args: [String]) -> String { 14 | let ipa = ITIpa() 15 | let (success,error) = ipa.load(args[0]) 16 | 17 | if (success) { 18 | return ipa.bundleVersion; 19 | } 20 | else { 21 | return "Error: " + (error ?? "(nil)") 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /IpaTool/IPTCommandResign.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IPTCommandResign.swift 3 | // ipatool 4 | // 5 | // Created by Stefan on 28/11/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import SSZipArchive 11 | 12 | class IPTCommandResign : ITCommand 13 | { 14 | var ipaPath:String = "" 15 | var resignedPath:String { get { return IPTCommandResign.resignedPathForPath(ipaPath) } } 16 | var codesignAllocate:String? { 17 | get { 18 | let cmd = IPTSystemCommand() 19 | let ok = cmd.execute("/usr/bin/xcrun", ["--find", "codesign_allocate"]) 20 | if (ok) { 21 | return cmd.standardOutput!.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines) 22 | } 23 | else { 24 | return nil 25 | } 26 | } 27 | } 28 | 29 | class func resignedPathForPath(_ path:String) -> String { 30 | return (path as NSString).deletingPathExtension + "_resigned.ipa" 31 | } 32 | 33 | func validateArgs(_ args: [String]) -> (ok:Bool, error:String?) { 34 | if (args.count < 2 || args.count > 3) { 35 | return (false, "Need parameters for ipa path and new provisioning profile") 36 | } 37 | 38 | if (!FileManager.default.isReadableFile(atPath: args[0])) { 39 | return (false, "First parameter must be path of ipa file") 40 | } 41 | 42 | if (!FileManager.default.isReadableFile(atPath: args[1])) { 43 | return (false, "Second parameter must be path of provisioning profile") 44 | } 45 | 46 | return (true, nil) 47 | } 48 | 49 | override func execute(_ arguments: [String]) -> String { 50 | let args = convertArgsForCompatibility(arguments) 51 | 52 | let (ok, message) = validateArgs(args) 53 | if (!ok) { 54 | return "Error: " + message! 55 | } 56 | 57 | let ipa = ITIpa() 58 | ipaPath = args[0] 59 | let (success,error) = ipa.load(ipaPath) 60 | if !success { 61 | return "Error: " + (error ?? "(nil)") 62 | } 63 | var bundleIdentifier:String? = nil 64 | if (args.count == 3) { 65 | bundleIdentifier = args[2] 66 | } 67 | 68 | return resign(ipa, args[1], bundleIdentifier) 69 | } 70 | 71 | func convertArgsForCompatibility(_ args:[String]) -> [String] 72 | { 73 | while (args.count >= 2 && 74 | (args[1] == "provisioning-profile" || args[1] == "bundle-identifier" || args[1] == "resign")) { 75 | var converted:[String] = [] 76 | converted.append(args[0]) 77 | if (args[1] == "bundle-identifier") { 78 | converted.append(args[4]) 79 | converted.append(args[2]) 80 | } 81 | else { 82 | converted.append(args[2]) 83 | if (args.count > 3) { 84 | if (args[3] == "bundle-identifier") { 85 | converted.append(args[4]) 86 | } 87 | else { 88 | converted.append(args[3]) 89 | } 90 | } 91 | } 92 | return converted 93 | } 94 | return args 95 | } 96 | 97 | func resign(_ ipa:ITIpa, _ provPath:String, _ bundleIdentifier:String? = nil) -> String { 98 | if let alloc = codesignAllocate { 99 | let prof = ITProvisioningProfile.loadFromPath(provPath) 100 | if prof == nil { 101 | return "Error: could not load provisioning profile from path \(provPath)" 102 | } 103 | 104 | if (bundleIdentifier != nil) { 105 | let ok = replaceBundleIdentifier((ipa.appPath as NSString).appendingPathComponent("Info.plist"), bundleIdentifier!) 106 | if (!ok) { 107 | return "Error: failed to replace bundle identifier in Info.plist" 108 | } 109 | } 110 | 111 | copyProvisioningProfileToExtractedIpa(ipa, provPath) 112 | let signer = prof!.codeSigningAuthority()! 113 | let cmd = IPTSystemCommand() 114 | let appName = ipa.appName 115 | let args:[String] = ["-f", "-vv", "-s", signer, appName] 116 | let env:[String:String] = ["CODESIGN_ALLOCATE":alloc, "EMBEDDED_PROFILE_NAME":"embedded.mobileprovision"] 117 | let payloadDir = (ipa.appPath as NSString).deletingLastPathComponent 118 | cmd.workingDirectory = payloadDir 119 | var ok = cmd.execute("/usr/bin/codesign", args, env) 120 | 121 | if !ok { 122 | return "Execution of codesign failed" 123 | } 124 | 125 | ok = SSZipArchive.createZipFile(atPath: resignedPath, withContentsOfDirectory: (payloadDir as NSString).deletingLastPathComponent) 126 | if ok { 127 | return "\(ipa.appName): replacing existing signature\n" + "\n" + "Resigned ipa: \(resignedPath)\n" 128 | } 129 | else { 130 | return "Failed to create resigned IPA archive" 131 | } 132 | } 133 | else { 134 | return "Could not find codesign_allocate" 135 | } 136 | } 137 | 138 | func copyProvisioningProfileToExtractedIpa(_ ipa:ITIpa, _ provPath:String) 139 | { 140 | let dest = (ipa.appPath as NSString).appendingPathComponent("embedded.mobileprovision") 141 | do { 142 | try FileManager.default.removeItem(atPath: dest) 143 | try FileManager.default.copyItem(atPath: provPath, toPath: dest) 144 | } catch let e { 145 | assert(false, "\(e)") 146 | } 147 | } 148 | 149 | func replaceBundleIdentifier(_ infoPlistPath:String, _ bundleIdentifier:String) -> Bool 150 | { 151 | let d:NSDictionary? = NSDictionary(contentsOfFile: infoPlistPath) as NSDictionary? 152 | if (d == nil) { 153 | return false 154 | } 155 | 156 | let plist:NSMutableDictionary = d!.mutableCopy() as! NSMutableDictionary 157 | plist["CFBundleIdentifier"] = bundleIdentifier 158 | 159 | var data:Data? = nil 160 | do { 161 | data = try PropertyListSerialization.data(fromPropertyList: plist, format: PropertyListSerialization.PropertyListFormat.binary, options: 0) 162 | } catch { 163 | return false 164 | } 165 | 166 | return ((try? data!.write(to: URL(fileURLWithPath: infoPlistPath), options: [.atomic])) != nil) 167 | } 168 | 169 | } 170 | -------------------------------------------------------------------------------- /IpaTool/IPTCommandVersion.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IPTCommandVersion.swift 3 | // ipatool 4 | // 5 | // Created by Stefan on 28/11/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class IPTCommandVersion : ITCommand 12 | { 13 | override func execute(_ args: [String]) -> String { 14 | let ipa = ITIpa() 15 | let (success,error) = ipa.load(args[0]) 16 | 17 | if (success) { 18 | return ipa.bundleShortVersionString; 19 | } 20 | else { 21 | return "Error: " + (error ?? "(nil)") 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /IpaTool/IPTSystemCommand.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IPTSystemCommand.swift 3 | // ipatool 4 | // 5 | // Created by Stefan on 01/12/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class IPTSystemCommand 12 | { 13 | var exitCode:Int32 = 0 14 | var standardOutput:String? = nil 15 | var workingDirectory:String? = nil 16 | 17 | func execute(_ cmd:String, _ args:[String] = [], _ env:[String:String] = [:]) -> Bool { 18 | let stdOutPipe = Pipe() 19 | let stdOut = stdOutPipe.fileHandleForReading 20 | 21 | let task = Process() 22 | task.launchPath = cmd 23 | if args.count > 0 { 24 | task.arguments = args 25 | } 26 | if env.count > 0 { 27 | task.environment = env 28 | } 29 | if workingDirectory != nil { 30 | task.currentDirectoryPath = workingDirectory! 31 | } 32 | task.standardOutput = stdOutPipe 33 | task.launch() 34 | 35 | let stdOutData = NSMutableData() 36 | while (task.isRunning) { 37 | stdOutData.append(stdOut.readDataToEndOfFile()) 38 | } 39 | stdOutData.append(stdOut.readDataToEndOfFile()) 40 | stdOut.closeFile() 41 | standardOutput = NSString(data:stdOutData as Data, encoding:String.Encoding.utf8.rawValue) as String? 42 | 43 | exitCode = task.terminationStatus 44 | return exitCode == 0 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /IpaTool/ITCMSDecoder.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ITCMSDecoder.swift 3 | // ipatool 4 | // 5 | // Created by Stefan on 20/11/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ITCMSDecoder 12 | { 13 | var cmsDecoder:CMSDecoder! 14 | fileprivate var _decodedString:String? 15 | fileprivate var _decodedData:Data? 16 | 17 | init() 18 | { 19 | var d:CMSDecoder? = nil 20 | let status = CMSDecoderCreate(&d) 21 | assert(status == noErr) 22 | cmsDecoder = d 23 | } 24 | 25 | func decodeData(_ data:Data) 26 | { 27 | let l = data.count 28 | var bytes = [UInt8](repeating: 0, count: l) 29 | (data as NSData).getBytes(&bytes, length:l) 30 | var status = CMSDecoderUpdateMessage(cmsDecoder, bytes, Int(l)) 31 | assert(status == noErr) 32 | 33 | status = CMSDecoderFinalizeMessage(cmsDecoder) 34 | assert(status == noErr) 35 | 36 | decodeString() 37 | } 38 | 39 | func decodeString() 40 | { 41 | var data:CFData? = nil 42 | let status = CMSDecoderCopyContent(cmsDecoder, &data) 43 | assert(status == noErr) 44 | if let d = data { 45 | _decodedData = d as Data 46 | _decodedString = NSString(data:_decodedData!, encoding: String.Encoding.utf8.rawValue) as String? 47 | } 48 | } 49 | 50 | func decodedString() -> String? 51 | { 52 | if (_decodedString != nil) { return _decodedString } 53 | if (cmsDecoder == nil) { return nil } 54 | decodeString() 55 | return _decodedString 56 | } 57 | 58 | func provisioningProfile() -> ITProvisioningProfile? 59 | { 60 | if let d = _decodedData { 61 | return ITProvisioningProfile(d) 62 | } 63 | else { 64 | return nil 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /IpaTool/ITCommand.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ITCommand.swift 3 | // IpaTool 4 | // 5 | // Created by Stefan on 01/10/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ITCommand 12 | { 13 | func execute(_ args:[String]) -> String 14 | { 15 | fatalError("abstract method") 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /IpaTool/ITCommandFactory.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ITCommandFactory.swift 3 | // IpaTool 4 | // 5 | // Created by Stefan on 07/10/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ITCommandFactory 12 | { 13 | struct Statics { 14 | static var commandFactoryCommands:Dictionary = [ 15 | "info" : ITCommandInfo(), 16 | "usage": ITCommandUsage(), 17 | "version": IPTCommandVersion(), 18 | "build": IPTCommandBuild(), 19 | "resign": IPTCommandResign()] 20 | } 21 | 22 | var commands : Dictionary 23 | { 24 | get 25 | { 26 | return ITCommandFactory.Statics.commandFactoryCommands 27 | } 28 | } 29 | 30 | func commandWithName(_ name:String) -> ITCommand? 31 | { 32 | return ITCommandFactory.Statics.commandFactoryCommands[name] 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /IpaTool/ITCommandInfo.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ITCommandInfo.swift 3 | // IpaTool 4 | // 5 | // Created by Stefan on 07/10/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ITCommandInfo : ITCommand 12 | { 13 | override func execute(_ args: [String]) -> String { 14 | let ipa = ITIpa() 15 | let (success,error) = ipa.load(args[0]) 16 | 17 | if (success) { 18 | var dispName:String 19 | if let dn = ipa.displayName { 20 | dispName = dn 21 | } 22 | else { 23 | dispName = "[not set]" 24 | } 25 | return " App name: " + ipa.appName + "\n" + 26 | " Display name: " + dispName + "\n" + 27 | " Version: " + ipa.bundleShortVersionString + "\n" + 28 | " Build: " + ipa.bundleVersion + "\n" + 29 | " Bundle identifier: " + ipa.bundleIdentifier + "\n" + 30 | " Code sign authority: " + ipa.provisioningProfile!.codeSigningAuthority()! + "\n" + 31 | " Minimum OS version: " + ipa.minimumOSVersion + "\n" + 32 | " Device family: " + ipa.deviceFamily + "\n" + 33 | "\n" + 34 | "Provisioning:\n" + 35 | " Name: " + ipa.provisioningProfile!.provisioningName()! + "\n" + 36 | " Expiration: " + formatDate(ipa.provisioningProfile!.expirationDate()! as Date) + "\n" + 37 | " App ID name: " + ipa.provisioningProfile!.appIdName()! + "\n" + 38 | " Team: " + ipa.provisioningProfile!.teamName()! + "\n"; 39 | } 40 | else { 41 | return "Error: " + (error ?? "(nil)") 42 | } 43 | } 44 | 45 | func formatDate(_ date:Date) -> String { 46 | let df = DateFormatter() 47 | df.dateFormat = "EEE MMM d HH:mm:ss v yyyy" 48 | return df.string(from: date) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /IpaTool/ITCommandUsage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ITCommandUsage.swift 3 | // IpaTool 4 | // 5 | // Created by Stefan on 04/10/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ITCommandUsage : ITCommand 12 | { 13 | 14 | override func execute(_ args:[String]) -> String 15 | { 16 | return "ipatool version \(ITMain.version()). Copyright (c) 2014 Stefan van den Oord\n" + 17 | "\n" + 18 | "Usage: ipatool IPA [OPTIONS]\n" + 19 | "IPA is a file with extension '.ipa'\n" + 20 | "\n" + 21 | "Available options:\n" + 22 | " info [default] Shows high level info about the IPA\n" + 23 | " version Shows the version number (CFBundleShortVersionString)\n" + 24 | " build Shows the build number (CFBundleVersion)\n" + 25 | " extract-certs Extracts certificates used for code signing and writes them\n" + 26 | " to files in the current working directory.\n" + 27 | " expiration Shows expiration date of the embedded provisioning profile\n" + 28 | " resign Resign the IPA and write the resigned IPA to the current\n" + 29 | " working directory according to the given options:\n" + 30 | " NEW-PROVISIONING-PROFILE [required]\n" + 31 | " NEW-BUNDLE-IDENTIFIER [optional]\n" + 32 | "\n" + 33 | "Example:\n" + 34 | "\n" + 35 | "ipatool myApp.ipa resign /path/to/profile.mobileprovision com.example.new.bundleIdentifier\n" + 36 | "\n" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /IpaTool/ITIpa.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ITIpa.swift 3 | // IpaTool 4 | // 5 | // Created by Stefan on 07/10/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import SSZipArchive 11 | 12 | class ITIpa 13 | { 14 | var appName = "" 15 | var appPath = "" 16 | var extractedIpaPath = "" 17 | 18 | var displayName:String? { get { 19 | return infoPlistContents!["CFBundleDisplayName"] as? String 20 | } } 21 | var bundleShortVersionString:String { get { return infoPlistContents!["CFBundleShortVersionString"] as! String } } 22 | var bundleVersion:String { get { return infoPlistContents!["CFBundleVersion"] as! String } } 23 | var bundleIdentifier:String { get { return infoPlistContents!["CFBundleIdentifier"] as! String } } 24 | var minimumOSVersion:String { get { return infoPlistContents!["MinimumOSVersion"] as! String } } 25 | var deviceFamily:String { 26 | get { 27 | var result = "" 28 | let families:Array = infoPlistContents!["UIDeviceFamily"] as! Array 29 | for f in families { 30 | switch f as Int { 31 | case 1: result += "iphone " 32 | case 2: result += "ipad " 33 | case 3: result += "appletv " 34 | default: continue 35 | } 36 | } 37 | return result.trimmingCharacters(in: CharacterSet.whitespaces) 38 | } 39 | } 40 | var provisioningProfile:ITProvisioningProfile? = nil 41 | fileprivate var infoPlistContents:NSDictionary? = nil 42 | 43 | deinit 44 | { 45 | do { 46 | try FileManager.default.removeItem(atPath: extractedIpaPath) 47 | } catch _ { 48 | } 49 | } 50 | 51 | func load(_ path:String) -> (result:Bool, error:String?) 52 | { 53 | let tempDirUrl = ITIpa.createTempDir() 54 | extractedIpaPath = tempDirUrl!.path 55 | 56 | if !FileManager.default.isReadableFile(atPath: path) { 57 | return (false, "File not found: \(path)") 58 | } 59 | 60 | let ok = SSZipArchive.unzipFile(atPath: path, toDestination: extractedIpaPath) 61 | if !ok { 62 | return (false, "Failed to extract \(path)") 63 | } 64 | 65 | extractAppName(extractedIpaPath) 66 | extractInfoPlist(extractedIpaPath) 67 | extractProvisioningProfile(extractedIpaPath) 68 | 69 | return (true, nil) 70 | } 71 | 72 | class func createTempDir() -> URL! 73 | { 74 | let systemTempDir = NSTemporaryDirectory() 75 | let uniqueId = ProcessInfo.processInfo.globallyUniqueString 76 | let tempDirPath = (systemTempDir as NSString).appendingPathComponent(uniqueId) 77 | let tempDirUrl = URL(fileURLWithPath: tempDirPath, isDirectory: true) 78 | 79 | do { 80 | try FileManager.default.createDirectory(at: tempDirUrl, withIntermediateDirectories: true, attributes: nil) 81 | } catch let e { 82 | assert(false, "Failed to create temp dir: \(e)") 83 | return nil 84 | } 85 | 86 | return tempDirUrl 87 | } 88 | 89 | func extractAppName(_ extractedIpaPath:String) 90 | { 91 | let payloadDir:String = (extractedIpaPath as NSString).appendingPathComponent("Payload") 92 | let contents = (try! FileManager.default.contentsOfDirectory(atPath: payloadDir)) 93 | appName = contents[0] 94 | appPath = (payloadDir as NSString).appendingPathComponent(appName) 95 | } 96 | 97 | func extractInfoPlist(_ extractedIpaPath:String) 98 | { 99 | let infoPlistPath = (appPath as NSString).appendingPathComponent("Info.plist") 100 | infoPlistContents = NSDictionary(contentsOfFile: infoPlistPath) 101 | assert(infoPlistContents != nil) 102 | } 103 | 104 | func extractProvisioningProfile(_ extractedIpaPath:String) 105 | { 106 | let inputFileName = (appPath as NSString).appendingPathComponent("embedded.mobileprovision") 107 | provisioningProfile = ITProvisioningProfile.loadFromPath(inputFileName) 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /IpaTool/ITMain.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ITMain.swift 3 | // IpaTool 4 | // 5 | // Created by Stefan on 01/10/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ITMain 12 | { 13 | class func version() -> String { 14 | return "1.0" 15 | } 16 | 17 | let commandFactory : ITCommandFactory = ITCommandFactory() 18 | 19 | func run(_ args:[String]) -> String 20 | { 21 | let command = commandForArguments(args) 22 | var output:String 23 | if let c = command { 24 | output = c.execute(args) 25 | } 26 | else { 27 | output = "Invocation error. Please refer to documentation." 28 | } 29 | return output 30 | } 31 | 32 | func commandForArguments(_ args:[String]) -> ITCommand? 33 | { 34 | var commandName = "" 35 | switch (args.count) { 36 | case 0: commandName = "usage" 37 | case 1: commandName = "info" 38 | default: commandName = args[1] 39 | } 40 | var command = commandFactory.commandWithName(commandName) 41 | if command == nil { 42 | command = commandFactory.commandWithName("usage") 43 | } 44 | return command 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /IpaTool/ITProvisioningProfile.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ITProvisioningProfile.swift 3 | // ipatool 4 | // 5 | // Created by Stefan on 21/11/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ITProvisioningProfile 12 | { 13 | var provisioningProfile:NSDictionary? 14 | 15 | init(_ data:Data) 16 | { 17 | provisioningProfile = (try? PropertyListSerialization.propertyList(from: data, options: PropertyListSerialization.MutabilityOptions(), format: nil)) as? NSDictionary 18 | } 19 | 20 | class func loadFromPath(_ path:String) -> ITProvisioningProfile? 21 | { 22 | let provisioningData = try? Data(contentsOf: URL(fileURLWithPath: path)) 23 | if provisioningData == nil { 24 | return nil 25 | } 26 | 27 | let decoder = ITCMSDecoder() 28 | decoder.decodeData(provisioningData!) 29 | return decoder.provisioningProfile() 30 | } 31 | 32 | func subjectCNForCertificateAtIndex(_ i:Int) -> String? 33 | { 34 | if let prof = provisioningProfile 35 | { 36 | var certs:[Data] = prof["DeveloperCertificates"] as! [Data] 37 | let cert = certs[i] 38 | let secCert:ITSecCertificate = ITSecCertificate(cert) 39 | return secCert.subject 40 | } 41 | else { 42 | return nil; 43 | } 44 | } 45 | 46 | func codeSigningAuthority() -> String? 47 | { 48 | return subjectCNForCertificateAtIndex(0) 49 | } 50 | 51 | func expirationDate() -> Date? 52 | { 53 | return provisioningProfile!["ExpirationDate"] as? Date 54 | } 55 | 56 | func provisioningName() -> String? 57 | { 58 | return provisioningProfile!["Name"] as? String 59 | } 60 | 61 | func appIdName() -> String? 62 | { 63 | return provisioningProfile!["AppIDName"] as? String 64 | } 65 | 66 | func teamName() -> String? 67 | { 68 | return provisioningProfile!["TeamName"] as? String 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /IpaTool/ITSecCertificate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ITSecCertificate.swift 3 | // ipatool 4 | // 5 | // Created by Stefan on 21/11/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ITSecCertificate 12 | { 13 | var _secCertificate:SecCertificate 14 | 15 | init(_ secCertificate:SecCertificate) { 16 | _secCertificate = secCertificate 17 | } 18 | 19 | init(_ data:Data) { 20 | _secCertificate = SecCertificateCreateWithData(nil, data as CFData)! 21 | } 22 | 23 | var commonName : String? { 24 | get { 25 | var cn:CFString? = nil 26 | SecCertificateCopyCommonName(_secCertificate, &cn) 27 | return cn as String? 28 | } 29 | } 30 | 31 | var subject : String? { 32 | get { 33 | return SecCertificateCopySubjectSummary(_secCertificate) as String? 34 | } 35 | } 36 | 37 | var values : NSDictionary? { 38 | get { 39 | return SecCertificateCopyValues(_secCertificate, nil, nil) 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /IpaTool/main.swift: -------------------------------------------------------------------------------- 1 | // 2 | // main.swift 3 | // ipatool 4 | // 5 | // Created by Stefan on 08/11/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension Array { 12 | var match : (head: Element, tail: [Element])? { 13 | return (count > 0) ? (self[0],Array(self[1.. = factory.commands 17 | XCTAssertEqual(commands.count, 5) 18 | XCTAssertNotNil(commands["info"]) 19 | XCTAssertNotNil(commands["usage"]) 20 | XCTAssertNotNil(commands["version"]) 21 | XCTAssertNotNil(commands["build"]) 22 | XCTAssertNotNil(commands["resign"]) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /IpaToolTests/ITCommandInfoTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ITCommandInfoTests.swift 3 | // ipatool 4 | // 5 | // Created by Stefan on 15/11/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import XCTest 11 | 12 | class ITCommandInfoTests: XCTestCase { 13 | 14 | var config = ITTestConfig() 15 | var infoCommand = ITCommandInfo() 16 | 17 | override func setUp() { 18 | config = ITTestConfig() 19 | config.load() 20 | infoCommand = ITCommandInfo() 21 | } 22 | 23 | func testReturnsErrorWithInvalidIpa() { 24 | let result = infoCommand.execute(["bla"]) 25 | let range = result.range(of: "error", options:NSString.CompareOptions.caseInsensitive) 26 | XCTAssertFalse(range == nil) 27 | } 28 | 29 | func testReturnsNoErrorWithValidIpa() { 30 | let result = infoCommand.execute([config.ipaFullPath!]) 31 | let range = result.range(of: "error", options:NSString.CompareOptions.caseInsensitive) 32 | XCTAssertTrue(range == nil) 33 | } 34 | 35 | func testReturnsInfoWithValidIpa() { 36 | let line1 = " App name: \(config.appName)\n" 37 | let line2 = " Display name: \(config.displayName)\n" 38 | let line3 = " Version: \(config.bundleShortVersionString)\n" 39 | let line4 = " Build: \(config.bundleVersion)\n" 40 | let line5 = " Bundle identifier: \(config.bundleIdentifier)\n" 41 | let line6 = " Code sign authority: \(config.codeSigningAuthority)\n" 42 | let line7 = " Minimum OS version: \(config.minimumOSVersion)\n" 43 | let line8 = " Device family: \(config.deviceFamily)\n" 44 | let line9 = "\n" 45 | let line10 = "Provisioning:\n" 46 | let line11 = " Name: \(config.provisioningName)\n" 47 | let line12 = " Expiration: \(infoCommand.formatDate(config.provisioningExpiration! as Date))\n" 48 | let line13 = " App ID name: \(config.provisioningAppIdName)\n" 49 | let line14 = " Team: \(config.provisioningTeam)\n" 50 | let expectedOutput = line1+line2+line3+line4+line5+line6+line7+line8+line9+line10+line11+line12+line13+line14 51 | let result = infoCommand.execute([config.ipaFullPath!]) 52 | XCTAssertEqual(expectedOutput, result) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /IpaToolTests/ITIpaTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ITIpaTests.swift 3 | // IpaTool 4 | // 5 | // Created by Stefan on 07/10/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import SSZipArchive 11 | 12 | class ITIpaTests_testConfig: XCTestCase { 13 | 14 | var config = ITTestConfig() 15 | var tempDirUrl:URL! 16 | 17 | override func setUp() { 18 | config.load() 19 | tempDirUrl = ITIpa.createTempDir() 20 | } 21 | 22 | override func tearDown() { 23 | do { 24 | try FileManager.default.removeItem(at: tempDirUrl) 25 | } catch {} 26 | } 27 | 28 | func testLoad() 29 | { 30 | let ipa = ITIpa() 31 | let (ok, _) = ipa.load("nonexisting.ipa") 32 | XCTAssertFalse(ok) 33 | } 34 | 35 | func testLoadTestConfig() 36 | { 37 | XCTAssertNotNil(config.ipaPath) 38 | } 39 | 40 | func testExtractIpa() 41 | { 42 | let ok = SSZipArchive.unzipFile(atPath: config.ipaFullPath!, toDestination: (tempDirUrl?.path)!) 43 | XCTAssertTrue(ok) 44 | } 45 | 46 | } 47 | 48 | class ITIpaTests: XCTestCase 49 | { 50 | var config = ITTestConfig() 51 | var tempDirUrl:URL! 52 | var ipa:ITIpa! 53 | 54 | override func setUp() { 55 | config.load() 56 | tempDirUrl = ITIpa.createTempDir() 57 | 58 | ipa = ITIpa() 59 | let ipaPath = config.ipaFullPath 60 | let (ok, _) = ipa.load(ipaPath!) 61 | XCTAssertTrue(ok) 62 | } 63 | 64 | override func tearDown() { 65 | do { 66 | try FileManager.default.removeItem(at: tempDirUrl) 67 | } catch {} 68 | } 69 | 70 | func testAppName() 71 | { 72 | XCTAssertEqual(config.appName, ipa.appName) 73 | } 74 | 75 | func testDisplayName() 76 | { 77 | XCTAssertEqual(config.displayName, ipa.displayName!) 78 | } 79 | 80 | func testBundleShortVersionString() 81 | { 82 | XCTAssertEqual(config.bundleShortVersionString, ipa.bundleShortVersionString) 83 | } 84 | 85 | func testBundleVersion() 86 | { 87 | XCTAssertEqual(config.bundleVersion, ipa.bundleVersion) 88 | } 89 | 90 | func testBundleIdentifier() 91 | { 92 | XCTAssertEqual(config.bundleIdentifier, ipa.bundleIdentifier) 93 | } 94 | 95 | func testMinimumOSVersion() 96 | { 97 | XCTAssertEqual(config.minimumOSVersion, ipa.minimumOSVersion) 98 | } 99 | 100 | func testReadProvisioningInformation() 101 | { 102 | let provisioningProfile = ipa.provisioningProfile! 103 | XCTAssertEqual(config.provisioningExpiration! as Date, provisioningProfile.expirationDate()!) 104 | XCTAssertEqual(config.provisioningName, provisioningProfile.provisioningName()!) 105 | XCTAssertEqual(config.provisioningAppIdName, provisioningProfile.appIdName()!) 106 | XCTAssertEqual(config.provisioningTeam, provisioningProfile.teamName()!) 107 | } 108 | 109 | func testCodeSigningAuthority() 110 | { 111 | XCTAssertEqual(config.codeSigningAuthority, ipa.provisioningProfile!.codeSigningAuthority()!) 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /IpaToolTests/ITMainTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IpaToolTests.swift 3 | // IpaToolTests 4 | // 5 | // Created by Stefan on 01/10/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class ITMainTests: XCTestCase { 12 | 13 | var ipaTool : ITMain = ITMain() 14 | 15 | override func setUp() { 16 | ipaTool = ITMain() 17 | } 18 | 19 | func testHasCommandFactory() 20 | { 21 | XCTAssertNotNil(ipaTool.commandFactory) 22 | } 23 | 24 | func testShowsUsageWithoutParameters() 25 | { 26 | let output = ipaTool.run([]) 27 | let range = output.lowercased().range(of: "usage") 28 | XCTAssertTrue(range != nil) 29 | } 30 | 31 | func testShowsUsageWithInvalidParameters() 32 | { 33 | let output = ipaTool.run(["some_ipa", "invalid_parameter"]) 34 | let range = output.lowercased().range(of: "usage") 35 | XCTAssertTrue(range != nil) 36 | } 37 | 38 | func testInfoCommand() 39 | { 40 | let command:ITCommand? = ipaTool.commandForArguments(["some.ipa", "info"]) 41 | XCTAssertNotNil(command) 42 | XCTAssertTrue(command is ITCommandInfo) 43 | } 44 | 45 | func testVersionCommand() 46 | { 47 | let command:ITCommand? = ipaTool.commandForArguments(["some.ipa", "version"]) 48 | XCTAssertNotNil(command) 49 | XCTAssertTrue(command is IPTCommandVersion) 50 | } 51 | 52 | func testBuildCommand() 53 | { 54 | let command:ITCommand? = ipaTool.commandForArguments(["some.ipa", "build"]) 55 | XCTAssertNotNil(command) 56 | XCTAssertTrue(command is IPTCommandBuild) 57 | } 58 | 59 | func testResignCommand() 60 | { 61 | let command:ITCommand? = ipaTool.commandForArguments(["some.ipa", "resign"]) 62 | XCTAssertNotNil(command) 63 | XCTAssertTrue(command is IPTCommandResign) 64 | } 65 | 66 | func testDefaultCommandIsInfo() 67 | { 68 | let command:ITCommand? = ipaTool.commandForArguments(["some.ipa"]) 69 | XCTAssertNotNil(command) 70 | XCTAssertTrue(command is ITCommandInfo) 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /IpaToolTests/ITTestConfig.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ITTestConfig.swift 3 | // ipatool 4 | // 5 | // Created by Stefan on 15/11/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension FileManager { 12 | func findPathOfFile(_ name:String, startPath:NSString, maxLevelsUp: Int, maxLevelsDown: Int) -> String? { 13 | let filePath = startPath.appendingPathComponent(name) 14 | if fileExists(atPath: filePath) { 15 | return filePath 16 | } 17 | if (maxLevelsUp > 0) { 18 | let parent = startPath.deletingLastPathComponent 19 | return findPathOfFile(name, startPath: parent as NSString, maxLevelsUp: maxLevelsUp - 1, maxLevelsDown: maxLevelsDown) 20 | } 21 | if (maxLevelsDown > 0) { 22 | if let subFolders = subpaths(atPath: startPath as String) { 23 | for sub in subFolders { 24 | if let s = findPathOfFile(name, startPath: sub as NSString, maxLevelsUp: 0, maxLevelsDown: maxLevelsDown - 1) { 25 | return s 26 | } 27 | } 28 | } 29 | } 30 | return nil 31 | } 32 | } 33 | 34 | class ITTestConfig 35 | { 36 | fileprivate var config:NSDictionary? = nil 37 | 38 | var ipaPath:String { get { return "SampleApp.ipa" } } 39 | var ipaFullPath:String? { get { 40 | let bundlePath = Bundle(for:type(of: self)).bundlePath 41 | let fullPath = FileManager.default.findPathOfFile(self.ipaPath, startPath: bundlePath as NSString, maxLevelsUp: 3, maxLevelsDown: 5) 42 | assert(fullPath != nil, "Could not find SampleApp.ipa") 43 | return fullPath 44 | } } 45 | var appName:String { get { return "SampleApp.app" } } 46 | var displayName:String { get { return "Sample!" } } 47 | var bundleShortVersionString:String { get { return "1.0" } } 48 | var bundleVersion:String { get { return "1" } } 49 | var bundleIdentifier:String { get { return config!["bundleIdentifier"] as! String } } 50 | var minimumOSVersion:String { get { return "8.0" } } 51 | var deviceFamily:String { get { return "iphone ipad" } } 52 | var codeSigningAuthority:String { get { return config!["codeSigningAuthority"] as! String } } 53 | var provisioningName:String { get { return config!["provisioningName"] as! String } } 54 | var provisioningExpiration:Date? { get { 55 | let df = DateFormatter() 56 | df.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" 57 | return df.date(from: config!["provisioningExpiration"] as! String) 58 | } } 59 | var provisioningAppIdName:String { get { return config!["provisioningAppIdName"] as! String } } 60 | var provisioningTeam:String { get { return config!["provisioningTeam"] as! String } } 61 | var resignedProvisioningName:String { get { return config!["resignedProvisioningName"] as! String } } 62 | var resignedCodeSigningAuthority:String { get { return config!["resignedCodeSigningAuthority"] as! String } } 63 | var resignProvisioningProfilePath:String { get { 64 | let fileName = config!["resignProvisioningProfilePath"] as! String 65 | return Bundle(for: type(of: self)).path(forResource: fileName, ofType: nil)! 66 | } } 67 | var resignedBundleIdentifier:String { get { return config!["resignedBundleIdentifier"] as! String } } 68 | 69 | func load() { 70 | let bundle = Bundle(for: type(of: self)) 71 | let configFilePath:String? = bundle.path(forResource: "testConfig", ofType: "json") 72 | assert(configFilePath != nil) 73 | 74 | var jsonData: Data? = nil 75 | do { 76 | jsonData = try Data(contentsOf: URL(fileURLWithPath: configFilePath!), options:NSData.ReadingOptions(rawValue: 0)) 77 | } catch {} 78 | assert(jsonData != nil) 79 | 80 | var config: NSDictionary? = nil 81 | do { 82 | config = try JSONSerialization.jsonObject(with: jsonData!, options:[]) as? NSDictionary 83 | } catch {} 84 | assert(config != nil) 85 | 86 | self.config = config 87 | } 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /IpaToolTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.vandenoord.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /IpaToolTests/SampleApp_Ad_Hoc.mobileprovision: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/svdo/ipatool/41f4b3cb915ab7a0f5cc712e52b9ef5452046272/IpaToolTests/SampleApp_Ad_Hoc.mobileprovision -------------------------------------------------------------------------------- /IpaToolTests/testConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "bundleIdentifier":"com.vandenoord.SampleApp", 3 | "codeSigningAuthority":"iPhone Distribution: Stefan van den Oord (7EQ9KX3BR9)", 4 | "provisioningName":"XC iOS Ad Hoc: *", 5 | "provisioningExpiration":"2018-09-06T09:57:41Z", 6 | "provisioningAppIdName":"Shopping List", 7 | "provisioningTeam":"Stefan van den Oord", 8 | "resignedProvisioningName": "SampleApp Ad Hoc", 9 | "resignedCodeSigningAuthority": "iPhone Distribution: Stefan van den Oord (7EQ9KX3BR9)", 10 | "resignProvisioningProfilePath": "SampleApp_Ad_Hoc.mobileprovision", 11 | "resignedBundleIdentifier": "com.vandenoord.dist.SampleApp" 12 | } 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Stefan van den Oord 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :osx 2 | 3 | use_frameworks! 4 | 5 | target 'ipatool' do 6 | pod 'SSZipArchive', '~> 2.0' 7 | 8 | target 'ipatoolTests' 9 | end 10 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SSZipArchive (2.0.4) 3 | 4 | DEPENDENCIES: 5 | - SSZipArchive (~> 2.0) 6 | 7 | SPEC CHECKSUMS: 8 | SSZipArchive: c77fc6ec8194f4e6d57876da1348e46cd63b90ba 9 | 10 | PODFILE CHECKSUM: 2f7c1a2b4b60d56cf660394e322e3d19cea45351 11 | 12 | COCOAPODS: 1.3.1 13 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SSZipArchive (2.0.4) 3 | 4 | DEPENDENCIES: 5 | - SSZipArchive (~> 2.0) 6 | 7 | SPEC CHECKSUMS: 8 | SSZipArchive: c77fc6ec8194f4e6d57876da1348e46cd63b90ba 9 | 10 | PODFILE CHECKSUM: 2f7c1a2b4b60d56cf660394e322e3d19cea45351 11 | 12 | COCOAPODS: 1.3.1 13 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2015, Sam Soffes, http://soff.es 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/README.md: -------------------------------------------------------------------------------- 1 | 2 | [![Build Status](https://travis-ci.org/ZipArchive/ZipArchive.svg?branch=master)](https://travis-ci.org/ZipArchive/ZipArchive) 3 | 4 | # SSZipArchive 5 | 6 | ZipArchive is a simple utility class for zipping and unzipping files on iOS and Mac. 7 | 8 | - Unzip zip files; 9 | - Unzip password protected zip files; 10 | - Create new zip files; 11 | - Append to existing zip files; 12 | - Zip files; 13 | - Zip-up NSData instances. (with a filename) 14 | 15 | ## Installation and Setup 16 | 17 | *The main release branch is configured to support Objective C and Swift 3+. There is a 'swift23' branch which is a tied to a older 1.x release and will not be upgraded. Xcode 8.3+ removes support for Swift 2.3* 18 | 19 | ### CocoaPods 20 | In your Podfile: 21 | `pod 'SSZipArchive'` 22 | 23 | ### Carthage 24 | In your Cartfile: 25 | `github "ZipArchive/ZipArchive"` 26 | 27 | ### Manual 28 | 29 | 1. Add the `SSZipArchive` and `minizip` folders to your project. 30 | 2. Add the `libz` library to your target 31 | 32 | SSZipArchive requires ARC. 33 | 34 | ## Usage 35 | 36 | ### Objective-C 37 | 38 | ```objective-c 39 | // Create 40 | [SSZipArchive createZipFileAtPath: zipPath withContentsOfDirectory: sampleDataPath]; 41 | 42 | // Unzip 43 | [SSZipArchive unzipFileAtPath:zipPath toDestination: unzipPath]; 44 | ``` 45 | 46 | ### Swift 47 | 48 | ```swift 49 | // Create 50 | SSZipArchive.createZipFileAtPath(zipPath, withContentsOfDirectory: sampleDataPath) 51 | 52 | // Unzip 53 | SSZipArchive.unzipFileAtPath(zipPath, toDestination: unzipPath) 54 | ``` 55 | 56 | ## License 57 | 58 | SSZipArchive is protected under the [MIT license](https://github.com/samsoffes/ssziparchive/raw/master/LICENSE) and our slightly modified version of [Minizip](https://github.com/nmoinvaz/minizip) 1.1 is licensed under the [Zlib license](http://www.zlib.net/zlib_license.html). 59 | 60 | ## Acknowledgments 61 | 62 | * Big thanks to [aish](http://code.google.com/p/ziparchive) for creating [ZipArchive](http://code.google.com/p/ziparchive). The project that inspired SSZipArchive. 63 | * Thank you [@soffes](https://github.com/soffes) for the actual name of SSZipArchive. 64 | * Thank you [@randomsequence](https://github.com/randomsequence) for implementing the creation support tech. 65 | * Thank you [@johnezang](https://github.com/johnezang) for all his amazing help along the way. 66 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/SSZipArchive.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSZipArchive.h 3 | // SSZipArchive 4 | // 5 | // Created by Sam Soffes on 7/21/10. 6 | // Copyright (c) Sam Soffes 2010-2015. All rights reserved. 7 | // 8 | 9 | #ifndef _SSZIPARCHIVE_H 10 | #define _SSZIPARCHIVE_H 11 | 12 | #import 13 | #include "SSZipCommon.h" 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | extern NSString *const SSZipArchiveErrorDomain; 18 | typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) { 19 | SSZipArchiveErrorCodeFailedOpenZipFile = -1, 20 | SSZipArchiveErrorCodeFailedOpenFileInZip = -2, 21 | SSZipArchiveErrorCodeFileInfoNotLoadable = -3, 22 | SSZipArchiveErrorCodeFileContentNotReadable = -4, 23 | SSZipArchiveErrorCodeFailedToWriteFile = -5, 24 | SSZipArchiveErrorCodeInvalidArguments = -6, 25 | }; 26 | 27 | @protocol SSZipArchiveDelegate; 28 | 29 | @interface SSZipArchive : NSObject 30 | 31 | // Password check 32 | + (BOOL)isFilePasswordProtectedAtPath:(NSString *)path; 33 | + (BOOL)isPasswordValidForArchiveAtPath:(NSString *)path password:(NSString *)pw error:(NSError * __nullable * __nullable)error NS_SWIFT_NOTHROW; 34 | 35 | // Unzip 36 | + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination; 37 | + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(nullable id)delegate; 38 | 39 | + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError * *)error; 40 | + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination overwrite:(BOOL)overwrite password:(nullable NSString *)password error:(NSError * *)error delegate:(nullable id)delegate NS_REFINED_FOR_SWIFT; 41 | 42 | + (BOOL)unzipFileAtPath:(NSString *)path 43 | toDestination:(NSString *)destination 44 | preserveAttributes:(BOOL)preserveAttributes 45 | overwrite:(BOOL)overwrite 46 | password:(nullable NSString *)password 47 | error:(NSError * *)error 48 | delegate:(nullable id)delegate; 49 | 50 | + (BOOL)unzipFileAtPath:(NSString *)path 51 | toDestination:(NSString *)destination 52 | progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler 53 | completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError * __nullable error))completionHandler; 54 | 55 | + (BOOL)unzipFileAtPath:(NSString *)path 56 | toDestination:(NSString *)destination 57 | overwrite:(BOOL)overwrite 58 | password:(nullable NSString *)password 59 | progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler 60 | completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError * __nullable error))completionHandler; 61 | 62 | // Zip 63 | 64 | // without password 65 | + (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths; 66 | + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath; 67 | 68 | + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory; 69 | 70 | // with password, password could be nil 71 | + (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(nullable NSString *)password; 72 | + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password; 73 | + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password; 74 | + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password andProgressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler; 75 | 76 | - (instancetype)initWithPath:(NSString *)path; 77 | @property (NS_NONATOMIC_IOSONLY, readonly) BOOL open; 78 | - (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password; 79 | - (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password; 80 | - (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password; 81 | - (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password; 82 | @property (NS_NONATOMIC_IOSONLY, readonly) BOOL close; 83 | 84 | @end 85 | 86 | @protocol SSZipArchiveDelegate 87 | 88 | @optional 89 | 90 | - (void)zipArchiveWillUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo; 91 | - (void)zipArchiveDidUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo unzippedPath:(NSString *)unzippedPath; 92 | 93 | - (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; 94 | - (void)zipArchiveWillUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; 95 | - (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; 96 | - (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath unzippedFilePath:(NSString *)unzippedFilePath; 97 | 98 | - (void)zipArchiveProgressEvent:(unsigned long long)loaded total:(unsigned long long)total; 99 | - (void)zipArchiveDidUnzipArchiveFile:(NSString *)zipFile entryPath:(NSString *)entryPath destPath:(NSString *)destPath; 100 | 101 | @end 102 | 103 | NS_ASSUME_NONNULL_END 104 | 105 | #endif /* _SSZIPARCHIVE_H */ 106 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/SSZipCommon.h: -------------------------------------------------------------------------------- 1 | #ifndef SSZipCommon 2 | #define SSZipCommon 3 | 4 | /* unz_global_info structure contain global data about the ZIPfile 5 | These data comes from the end of central dir */ 6 | typedef struct unz_global_info64_s 7 | { 8 | uint64_t number_entry; /* total number of entries in the central dir on this disk */ 9 | uint32_t number_disk_with_CD; /* number the the disk with central dir, used for spanning ZIP*/ 10 | uint16_t size_comment; /* size of the global comment of the zipfile */ 11 | } unz_global_info64; 12 | 13 | typedef struct unz_global_info_s 14 | { 15 | uint32_t number_entry; /* total number of entries in the central dir on this disk */ 16 | uint32_t number_disk_with_CD; /* number the the disk with central dir, used for spanning ZIP*/ 17 | uint16_t size_comment; /* size of the global comment of the zipfile */ 18 | } unz_global_info; 19 | 20 | /* unz_file_info contain information about a file in the zipfile */ 21 | typedef struct unz_file_info64_s 22 | { 23 | uint16_t version; /* version made by 2 bytes */ 24 | uint16_t version_needed; /* version needed to extract 2 bytes */ 25 | uint16_t flag; /* general purpose bit flag 2 bytes */ 26 | uint16_t compression_method; /* compression method 2 bytes */ 27 | uint32_t dos_date; /* last mod file date in Dos fmt 4 bytes */ 28 | uint32_t crc; /* crc-32 4 bytes */ 29 | uint64_t compressed_size; /* compressed size 8 bytes */ 30 | uint64_t uncompressed_size; /* uncompressed size 8 bytes */ 31 | uint16_t size_filename; /* filename length 2 bytes */ 32 | uint16_t size_file_extra; /* extra field length 2 bytes */ 33 | uint16_t size_file_comment; /* file comment length 2 bytes */ 34 | 35 | uint32_t disk_num_start; /* disk number start 4 bytes */ 36 | uint16_t internal_fa; /* internal file attributes 2 bytes */ 37 | uint32_t external_fa; /* external file attributes 4 bytes */ 38 | 39 | uint64_t disk_offset; 40 | 41 | uint16_t size_file_extra_internal; 42 | } unz_file_info64; 43 | 44 | typedef struct unz_file_info_s 45 | { 46 | uint16_t version; /* version made by 2 bytes */ 47 | uint16_t version_needed; /* version needed to extract 2 bytes */ 48 | uint16_t flag; /* general purpose bit flag 2 bytes */ 49 | uint16_t compression_method; /* compression method 2 bytes */ 50 | uint32_t dos_date; /* last mod file date in Dos fmt 4 bytes */ 51 | uint32_t crc; /* crc-32 4 bytes */ 52 | uint32_t compressed_size; /* compressed size 4 bytes */ 53 | uint32_t uncompressed_size; /* uncompressed size 4 bytes */ 54 | uint16_t size_filename; /* filename length 2 bytes */ 55 | uint16_t size_file_extra; /* extra field length 2 bytes */ 56 | uint16_t size_file_comment; /* file comment length 2 bytes */ 57 | 58 | uint16_t disk_num_start; /* disk number start 2 bytes */ 59 | uint16_t internal_fa; /* internal file attributes 2 bytes */ 60 | uint32_t external_fa; /* external file attributes 4 bytes */ 61 | 62 | uint64_t disk_offset; 63 | } unz_file_info; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/ZipArchive.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZipArchive.h 3 | // ZipArchive 4 | // 5 | // Created by Serhii Mumriak on 12/1/15. 6 | // Copyright © 2015 smumryak. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for ZipArchive. 12 | FOUNDATION_EXPORT double ZipArchiveVersionNumber; 13 | 14 | //! Project version string for ZipArchive. 15 | FOUNDATION_EXPORT const unsigned char ZipArchiveVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | #import "SSZipArchive.h" 20 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/aes/aes_ni.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved. 3 | 4 | The redistribution and use of this software (with or without changes) 5 | is allowed without the payment of fees or royalties provided that: 6 | 7 | source code distributions include the above copyright notice, this 8 | list of conditions and the following disclaimer; 9 | 10 | binary distributions include the above copyright notice, this list 11 | of conditions and the following disclaimer in their documentation. 12 | 13 | This software is provided 'as is' with no explicit or implied warranties 14 | in respect of its operation, including, but not limited to, correctness 15 | and fitness for purpose. 16 | --------------------------------------------------------------------------- 17 | Issue Date: 13/11/2013 18 | */ 19 | 20 | #ifndef AES_NI_H 21 | #define AES_NI_H 22 | 23 | #define USE_AES_CONTEXT 24 | 25 | #include "aesopt.h" 26 | 27 | #if defined( USE_INTEL_AES_IF_PRESENT ) 28 | 29 | /* map names in C code to make them internal ('name' -> 'aes_name_i') */ 30 | #define aes_xi(x) aes_ ## x ## _i 31 | 32 | /* map names here to provide the external API ('name' -> 'aes_name') */ 33 | #define aes_ni(x) aes_ ## x 34 | 35 | AES_RETURN aes_ni(encrypt_key128)(const unsigned char *key, aes_encrypt_ctx cx[1]); 36 | AES_RETURN aes_ni(encrypt_key192)(const unsigned char *key, aes_encrypt_ctx cx[1]); 37 | AES_RETURN aes_ni(encrypt_key256)(const unsigned char *key, aes_encrypt_ctx cx[1]); 38 | 39 | AES_RETURN aes_ni(decrypt_key128)(const unsigned char *key, aes_decrypt_ctx cx[1]); 40 | AES_RETURN aes_ni(decrypt_key192)(const unsigned char *key, aes_decrypt_ctx cx[1]); 41 | AES_RETURN aes_ni(decrypt_key256)(const unsigned char *key, aes_decrypt_ctx cx[1]); 42 | 43 | AES_RETURN aes_ni(encrypt)(const unsigned char *in, unsigned char *out, const aes_encrypt_ctx cx[1]); 44 | AES_RETURN aes_ni(decrypt)(const unsigned char *in, unsigned char *out, const aes_decrypt_ctx cx[1]); 45 | 46 | AES_RETURN aes_xi(encrypt_key128)(const unsigned char *key, aes_encrypt_ctx cx[1]); 47 | AES_RETURN aes_xi(encrypt_key192)(const unsigned char *key, aes_encrypt_ctx cx[1]); 48 | AES_RETURN aes_xi(encrypt_key256)(const unsigned char *key, aes_encrypt_ctx cx[1]); 49 | 50 | AES_RETURN aes_xi(decrypt_key128)(const unsigned char *key, aes_decrypt_ctx cx[1]); 51 | AES_RETURN aes_xi(decrypt_key192)(const unsigned char *key, aes_decrypt_ctx cx[1]); 52 | AES_RETURN aes_xi(decrypt_key256)(const unsigned char *key, aes_decrypt_ctx cx[1]); 53 | 54 | AES_RETURN aes_xi(encrypt)(const unsigned char *in, unsigned char *out, const aes_encrypt_ctx cx[1]); 55 | AES_RETURN aes_xi(decrypt)(const unsigned char *in, unsigned char *out, const aes_decrypt_ctx cx[1]); 56 | 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/aes/aestab.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved. 4 | 5 | The redistribution and use of this software (with or without changes) 6 | is allowed without the payment of fees or royalties provided that: 7 | 8 | source code distributions include the above copyright notice, this 9 | list of conditions and the following disclaimer; 10 | 11 | binary distributions include the above copyright notice, this list 12 | of conditions and the following disclaimer in their documentation. 13 | 14 | This software is provided 'as is' with no explicit or implied warranties 15 | in respect of its operation, including, but not limited to, correctness 16 | and fitness for purpose. 17 | --------------------------------------------------------------------------- 18 | Issue Date: 20/12/2007 19 | 20 | This file contains the code for declaring the tables needed to implement 21 | AES. The file aesopt.h is assumed to be included before this header file. 22 | If there are no global variables, the definitions here can be used to put 23 | the AES tables in a structure so that a pointer can then be added to the 24 | AES context to pass them to the AES routines that need them. If this 25 | facility is used, the calling program has to ensure that this pointer is 26 | managed appropriately. In particular, the value of the t_dec(in,it) item 27 | in the table structure must be set to zero in order to ensure that the 28 | tables are initialised. In practice the three code sequences in aeskey.c 29 | that control the calls to aes_init() and the aes_init() routine itself will 30 | have to be changed for a specific implementation. If global variables are 31 | available it will generally be preferable to use them with the precomputed 32 | STATIC_TABLES option that uses static global tables. 33 | 34 | The following defines can be used to control the way the tables 35 | are defined, initialised and used in embedded environments that 36 | require special features for these purposes 37 | 38 | the 't_dec' construction is used to declare fixed table arrays 39 | the 't_set' construction is used to set fixed table values 40 | the 't_use' construction is used to access fixed table values 41 | 42 | 256 byte tables: 43 | 44 | t_xxx(s,box) => forward S box 45 | t_xxx(i,box) => inverse S box 46 | 47 | 256 32-bit word OR 4 x 256 32-bit word tables: 48 | 49 | t_xxx(f,n) => forward normal round 50 | t_xxx(f,l) => forward last round 51 | t_xxx(i,n) => inverse normal round 52 | t_xxx(i,l) => inverse last round 53 | t_xxx(l,s) => key schedule table 54 | t_xxx(i,m) => key schedule table 55 | 56 | Other variables and tables: 57 | 58 | t_xxx(r,c) => the rcon table 59 | */ 60 | 61 | #if !defined( _AESTAB_H ) 62 | #define _AESTAB_H 63 | 64 | #if defined(__cplusplus) 65 | extern "C" { 66 | #endif 67 | 68 | #define t_dec(m,n) t_##m##n 69 | #define t_set(m,n) t_##m##n 70 | #define t_use(m,n) t_##m##n 71 | 72 | #if defined(STATIC_TABLES) 73 | # if !defined( __GNUC__ ) && (defined( __MSDOS__ ) || defined( __WIN16__ )) 74 | /* make tables far data to avoid using too much DGROUP space (PG) */ 75 | # define CONST const far 76 | # else 77 | # define CONST const 78 | # endif 79 | #else 80 | # define CONST 81 | #endif 82 | 83 | #if defined(DO_TABLES) 84 | # define EXTERN 85 | #else 86 | # define EXTERN extern 87 | #endif 88 | 89 | #if defined(_MSC_VER) && defined(TABLE_ALIGN) 90 | #define ALIGN __declspec(align(TABLE_ALIGN)) 91 | #else 92 | #define ALIGN 93 | #endif 94 | 95 | #if defined( __WATCOMC__ ) && ( __WATCOMC__ >= 1100 ) 96 | # define XP_DIR __cdecl 97 | #else 98 | # define XP_DIR 99 | #endif 100 | 101 | #if defined(DO_TABLES) && defined(STATIC_TABLES) 102 | #define d_1(t,n,b,e) EXTERN ALIGN CONST XP_DIR t n[256] = b(e) 103 | #define d_4(t,n,b,e,f,g,h) EXTERN ALIGN CONST XP_DIR t n[4][256] = { b(e), b(f), b(g), b(h) } 104 | EXTERN ALIGN CONST uint32_t t_dec(r,c)[RC_LENGTH] = rc_data(w0); 105 | #else 106 | #define d_1(t,n,b,e) EXTERN ALIGN CONST XP_DIR t n[256] 107 | #define d_4(t,n,b,e,f,g,h) EXTERN ALIGN CONST XP_DIR t n[4][256] 108 | EXTERN ALIGN CONST uint32_t t_dec(r,c)[RC_LENGTH]; 109 | #endif 110 | 111 | #if defined( SBX_SET ) 112 | d_1(uint8_t, t_dec(s,box), sb_data, h0); 113 | #endif 114 | #if defined( ISB_SET ) 115 | d_1(uint8_t, t_dec(i,box), isb_data, h0); 116 | #endif 117 | 118 | #if defined( FT1_SET ) 119 | d_1(uint32_t, t_dec(f,n), sb_data, u0); 120 | #endif 121 | #if defined( FT4_SET ) 122 | d_4(uint32_t, t_dec(f,n), sb_data, u0, u1, u2, u3); 123 | #endif 124 | 125 | #if defined( FL1_SET ) 126 | d_1(uint32_t, t_dec(f,l), sb_data, w0); 127 | #endif 128 | #if defined( FL4_SET ) 129 | d_4(uint32_t, t_dec(f,l), sb_data, w0, w1, w2, w3); 130 | #endif 131 | 132 | #if defined( IT1_SET ) 133 | d_1(uint32_t, t_dec(i,n), isb_data, v0); 134 | #endif 135 | #if defined( IT4_SET ) 136 | d_4(uint32_t, t_dec(i,n), isb_data, v0, v1, v2, v3); 137 | #endif 138 | 139 | #if defined( IL1_SET ) 140 | d_1(uint32_t, t_dec(i,l), isb_data, w0); 141 | #endif 142 | #if defined( IL4_SET ) 143 | d_4(uint32_t, t_dec(i,l), isb_data, w0, w1, w2, w3); 144 | #endif 145 | 146 | #if defined( LS1_SET ) 147 | #if defined( FL1_SET ) 148 | #undef LS1_SET 149 | #else 150 | d_1(uint32_t, t_dec(l,s), sb_data, w0); 151 | #endif 152 | #endif 153 | 154 | #if defined( LS4_SET ) 155 | #if defined( FL4_SET ) 156 | #undef LS4_SET 157 | #else 158 | d_4(uint32_t, t_dec(l,s), sb_data, w0, w1, w2, w3); 159 | #endif 160 | #endif 161 | 162 | #if defined( IM1_SET ) 163 | d_1(uint32_t, t_dec(i,m), mm_data, v0); 164 | #endif 165 | #if defined( IM4_SET ) 166 | d_4(uint32_t, t_dec(i,m), mm_data, v0, v1, v2, v3); 167 | #endif 168 | 169 | #if defined(__cplusplus) 170 | } 171 | #endif 172 | 173 | #endif 174 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/aes/brg_endian.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved. 4 | 5 | The redistribution and use of this software (with or without changes) 6 | is allowed without the payment of fees or royalties provided that: 7 | 8 | source code distributions include the above copyright notice, this 9 | list of conditions and the following disclaimer; 10 | 11 | binary distributions include the above copyright notice, this list 12 | of conditions and the following disclaimer in their documentation. 13 | 14 | This software is provided 'as is' with no explicit or implied warranties 15 | in respect of its operation, including, but not limited to, correctness 16 | and fitness for purpose. 17 | --------------------------------------------------------------------------- 18 | Issue Date: 20/12/2007 19 | */ 20 | 21 | #ifndef _BRG_ENDIAN_H 22 | #define _BRG_ENDIAN_H 23 | 24 | #define IS_BIG_ENDIAN 4321 /* byte 0 is most significant (mc68k) */ 25 | #define IS_LITTLE_ENDIAN 1234 /* byte 0 is least significant (i386) */ 26 | 27 | /* Include files where endian defines and byteswap functions may reside */ 28 | #if defined( __sun ) 29 | # include 30 | #elif defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __NetBSD__ ) 31 | # include 32 | #elif defined( BSD ) && ( BSD >= 199103 ) || defined( __APPLE__ ) || \ 33 | defined( __CYGWIN32__ ) || defined( __DJGPP__ ) || defined( __osf__ ) 34 | # include 35 | #elif defined( __linux__ ) || defined( __GNUC__ ) || defined( __GNU_LIBRARY__ ) 36 | # if !defined( __MINGW32__ ) && !defined( _AIX ) 37 | # include 38 | # if !defined( __BEOS__ ) 39 | # include 40 | # endif 41 | # endif 42 | #endif 43 | 44 | /* Now attempt to set the define for platform byte order using any */ 45 | /* of the four forms SYMBOL, _SYMBOL, __SYMBOL & __SYMBOL__, which */ 46 | /* seem to encompass most endian symbol definitions */ 47 | 48 | #if defined( BIG_ENDIAN ) && defined( LITTLE_ENDIAN ) 49 | # if defined( BYTE_ORDER ) && BYTE_ORDER == BIG_ENDIAN 50 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN 51 | # elif defined( BYTE_ORDER ) && BYTE_ORDER == LITTLE_ENDIAN 52 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN 53 | # endif 54 | #elif defined( BIG_ENDIAN ) 55 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN 56 | #elif defined( LITTLE_ENDIAN ) 57 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN 58 | #endif 59 | 60 | #if defined( _BIG_ENDIAN ) && defined( _LITTLE_ENDIAN ) 61 | # if defined( _BYTE_ORDER ) && _BYTE_ORDER == _BIG_ENDIAN 62 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN 63 | # elif defined( _BYTE_ORDER ) && _BYTE_ORDER == _LITTLE_ENDIAN 64 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN 65 | # endif 66 | #elif defined( _BIG_ENDIAN ) 67 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN 68 | #elif defined( _LITTLE_ENDIAN ) 69 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN 70 | #endif 71 | 72 | #if defined( __BIG_ENDIAN ) && defined( __LITTLE_ENDIAN ) 73 | # if defined( __BYTE_ORDER ) && __BYTE_ORDER == __BIG_ENDIAN 74 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN 75 | # elif defined( __BYTE_ORDER ) && __BYTE_ORDER == __LITTLE_ENDIAN 76 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN 77 | # endif 78 | #elif defined( __BIG_ENDIAN ) 79 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN 80 | #elif defined( __LITTLE_ENDIAN ) 81 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN 82 | #endif 83 | 84 | #if defined( __BIG_ENDIAN__ ) && defined( __LITTLE_ENDIAN__ ) 85 | # if defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __BIG_ENDIAN__ 86 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN 87 | # elif defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __LITTLE_ENDIAN__ 88 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN 89 | # endif 90 | #elif defined( __BIG_ENDIAN__ ) 91 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN 92 | #elif defined( __LITTLE_ENDIAN__ ) 93 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN 94 | #endif 95 | 96 | /* if the platform byte order could not be determined, then try to */ 97 | /* set this define using common machine defines */ 98 | #if !defined(PLATFORM_BYTE_ORDER) 99 | 100 | #if defined( __alpha__ ) || defined( __alpha ) || defined( i386 ) || \ 101 | defined( __i386__ ) || defined( _M_I86 ) || defined( _M_IX86 ) || \ 102 | defined( __OS2__ ) || defined( sun386 ) || defined( __TURBOC__ ) || \ 103 | defined( vax ) || defined( vms ) || defined( VMS ) || \ 104 | defined( __VMS ) || defined( _M_X64 ) 105 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN 106 | 107 | #elif defined( AMIGA ) || defined( applec ) || defined( __AS400__ ) || \ 108 | defined( _CRAY ) || defined( __hppa ) || defined( __hp9000 ) || \ 109 | defined( ibm370 ) || defined( mc68000 ) || defined( m68k ) || \ 110 | defined( __MRC__ ) || defined( __MVS__ ) || defined( __MWERKS__ ) || \ 111 | defined( sparc ) || defined( __sparc) || defined( SYMANTEC_C ) || \ 112 | defined( __VOS__ ) || defined( __TIGCC__ ) || defined( __TANDEM ) || \ 113 | defined( THINK_C ) || defined( __VMCMS__ ) || defined( _AIX ) 114 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN 115 | 116 | #elif 0 /* **** EDIT HERE IF NECESSARY **** */ 117 | # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN 118 | #elif 0 /* **** EDIT HERE IF NECESSARY **** */ 119 | # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN 120 | #else 121 | # error Please edit lines 126 or 128 in brg_endian.h to set the platform byte order 122 | #endif 123 | 124 | #endif 125 | 126 | #endif 127 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/aes/brg_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved. 4 | 5 | The redistribution and use of this software (with or without changes) 6 | is allowed without the payment of fees or royalties provided that: 7 | 8 | source code distributions include the above copyright notice, this 9 | list of conditions and the following disclaimer; 10 | 11 | binary distributions include the above copyright notice, this list 12 | of conditions and the following disclaimer in their documentation. 13 | 14 | This software is provided 'as is' with no explicit or implied warranties 15 | in respect of its operation, including, but not limited to, correctness 16 | and fitness for purpose. 17 | --------------------------------------------------------------------------- 18 | Issue Date: 20/12/2007 19 | 20 | The unsigned integer types defined here are of the form uint_t where 21 | is the length of the type; for example, the unsigned 32-bit type is 22 | 'uint32_t'. These are NOT the same as the 'C99 integer types' that are 23 | defined in the inttypes.h and stdint.h headers since attempts to use these 24 | types have shown that support for them is still highly variable. However, 25 | since the latter are of the form uint_t, a regular expression search 26 | and replace (in VC++ search on 'uint_{:z}t' and replace with 'uint\1_t') 27 | can be used to convert the types used here to the C99 standard types. 28 | */ 29 | 30 | #ifndef _BRG_TYPES_H 31 | #define _BRG_TYPES_H 32 | 33 | #if defined(__cplusplus) 34 | extern "C" { 35 | #endif 36 | 37 | #include 38 | #include 39 | 40 | #if defined( _MSC_VER ) && ( _MSC_VER >= 1300 ) 41 | # include 42 | # define ptrint_t intptr_t 43 | #elif defined( __ECOS__ ) 44 | # define intptr_t unsigned int 45 | # define ptrint_t intptr_t 46 | #elif defined( __GNUC__ ) && ( __GNUC__ >= 3 ) 47 | # define ptrint_t intptr_t 48 | #else 49 | # define ptrint_t int 50 | #endif 51 | 52 | #ifndef BRG_UI32 53 | # define BRG_UI32 54 | # if UINT_MAX == 4294967295u 55 | # define li_32(h) 0x##h##u 56 | # elif ULONG_MAX == 4294967295u 57 | # define li_32(h) 0x##h##ul 58 | # elif defined( _CRAY ) 59 | # error This code needs 32-bit data types, which Cray machines do not provide 60 | # else 61 | # error Please define uint32_t as a 32-bit unsigned integer type in brg_types.h 62 | # endif 63 | #endif 64 | 65 | #ifndef BRG_UI64 66 | # if defined( __BORLANDC__ ) && !defined( __MSDOS__ ) 67 | # define BRG_UI64 68 | # define li_64(h) 0x##h##ui64 69 | # elif defined( _MSC_VER ) && ( _MSC_VER < 1300 ) /* 1300 == VC++ 7.0 */ 70 | # define BRG_UI64 71 | # define li_64(h) 0x##h##ui64 72 | # elif defined( __sun ) && defined( ULONG_MAX ) && ULONG_MAX == 0xfffffffful 73 | # define BRG_UI64 74 | # define li_64(h) 0x##h##ull 75 | # elif defined( __MVS__ ) 76 | # define BRG_UI64 77 | # define li_64(h) 0x##h##ull 78 | # elif defined( UINT_MAX ) && UINT_MAX > 4294967295u 79 | # if UINT_MAX == 18446744073709551615u 80 | # define BRG_UI64 81 | # define li_64(h) 0x##h##u 82 | # endif 83 | # elif defined( ULONG_MAX ) && ULONG_MAX > 4294967295u 84 | # if ULONG_MAX == 18446744073709551615ul 85 | # define BRG_UI64 86 | # define li_64(h) 0x##h##ul 87 | # endif 88 | # elif defined( ULLONG_MAX ) && ULLONG_MAX > 4294967295u 89 | # if ULLONG_MAX == 18446744073709551615ull 90 | # define BRG_UI64 91 | # define li_64(h) 0x##h##ull 92 | # endif 93 | # elif defined( ULONG_LONG_MAX ) && ULONG_LONG_MAX > 4294967295u 94 | # if ULONG_LONG_MAX == 18446744073709551615ull 95 | # define BRG_UI64 96 | # define li_64(h) 0x##h##ull 97 | # endif 98 | # endif 99 | #endif 100 | 101 | #if !defined( BRG_UI64 ) 102 | # if defined( NEED_UINT_64T ) 103 | # error Please define uint64_t as an unsigned 64 bit type in brg_types.h 104 | # endif 105 | #endif 106 | 107 | #ifndef RETURN_VALUES 108 | # define RETURN_VALUES 109 | # if defined( DLL_EXPORT ) 110 | # if defined( _MSC_VER ) || defined ( __INTEL_COMPILER ) 111 | # define VOID_RETURN __declspec( dllexport ) void __stdcall 112 | # define INT_RETURN __declspec( dllexport ) int __stdcall 113 | # elif defined( __GNUC__ ) 114 | # define VOID_RETURN __declspec( __dllexport__ ) void 115 | # define INT_RETURN __declspec( __dllexport__ ) int 116 | # else 117 | # error Use of the DLL is only available on the Microsoft, Intel and GCC compilers 118 | # endif 119 | # elif defined( DLL_IMPORT ) 120 | # if defined( _MSC_VER ) || defined ( __INTEL_COMPILER ) 121 | # define VOID_RETURN __declspec( dllimport ) void __stdcall 122 | # define INT_RETURN __declspec( dllimport ) int __stdcall 123 | # elif defined( __GNUC__ ) 124 | # define VOID_RETURN __declspec( __dllimport__ ) void 125 | # define INT_RETURN __declspec( __dllimport__ ) int 126 | # else 127 | # error Use of the DLL is only available on the Microsoft, Intel and GCC compilers 128 | # endif 129 | # elif defined( __WATCOMC__ ) 130 | # define VOID_RETURN void __cdecl 131 | # define INT_RETURN int __cdecl 132 | # else 133 | # define VOID_RETURN void 134 | # define INT_RETURN int 135 | # endif 136 | #endif 137 | 138 | /* These defines are used to detect and set the memory alignment of pointers. 139 | Note that offsets are in bytes. 140 | 141 | ALIGN_OFFSET(x,n) return the positive or zero offset of 142 | the memory addressed by the pointer 'x' 143 | from an address that is aligned on an 144 | 'n' byte boundary ('n' is a power of 2) 145 | 146 | ALIGN_FLOOR(x,n) return a pointer that points to memory 147 | that is aligned on an 'n' byte boundary 148 | and is not higher than the memory address 149 | pointed to by 'x' ('n' is a power of 2) 150 | 151 | ALIGN_CEIL(x,n) return a pointer that points to memory 152 | that is aligned on an 'n' byte boundary 153 | and is not lower than the memory address 154 | pointed to by 'x' ('n' is a power of 2) 155 | */ 156 | 157 | #define ALIGN_OFFSET(x,n) (((ptrint_t)(x)) & ((n) - 1)) 158 | #define ALIGN_FLOOR(x,n) ((uint8_t*)(x) - ( ((ptrint_t)(x)) & ((n) - 1))) 159 | #define ALIGN_CEIL(x,n) ((uint8_t*)(x) + (-((ptrint_t)(x)) & ((n) - 1))) 160 | 161 | /* These defines are used to declare buffers in a way that allows 162 | faster operations on longer variables to be used. In all these 163 | defines 'size' must be a power of 2 and >= 8. NOTE that the 164 | buffer size is in bytes but the type length is in bits 165 | 166 | UNIT_TYPEDEF(x,size) declares a variable 'x' of length 167 | 'size' bits 168 | 169 | BUFR_TYPEDEF(x,size,bsize) declares a buffer 'x' of length 'bsize' 170 | bytes defined as an array of variables 171 | each of 'size' bits (bsize must be a 172 | multiple of size / 8) 173 | 174 | UNIT_CAST(x,size) casts a variable to a type of 175 | length 'size' bits 176 | 177 | UPTR_CAST(x,size) casts a pointer to a pointer to a 178 | varaiable of length 'size' bits 179 | */ 180 | 181 | #define UI_TYPE(size) uint##size##_t 182 | #define UNIT_TYPEDEF(x,size) typedef UI_TYPE(size) x 183 | #define BUFR_TYPEDEF(x,size,bsize) typedef UI_TYPE(size) x[bsize / (size >> 3)] 184 | #define UNIT_CAST(x,size) ((UI_TYPE(size) )(x)) 185 | #define UPTR_CAST(x,size) ((UI_TYPE(size)*)(x)) 186 | 187 | #if defined(__cplusplus) 188 | } 189 | #endif 190 | 191 | #endif 192 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/aes/fileenc.c: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Copyright (c) 2002, Dr Brian Gladman < >, Worcester, UK. 4 | All rights reserved. 5 | 6 | LICENSE TERMS 7 | 8 | The free distribution and use of this software in both source and binary 9 | form is allowed (with or without changes) provided that: 10 | 11 | 1. distributions of this source code include the above copyright 12 | notice, this list of conditions and the following disclaimer; 13 | 14 | 2. distributions in binary form include the above copyright 15 | notice, this list of conditions and the following disclaimer 16 | in the documentation and/or other associated materials; 17 | 18 | 3. the copyright holder's name is not used to endorse products 19 | built using this software without specific written permission. 20 | 21 | ALTERNATIVELY, provided that this notice is retained in full, this product 22 | may be distributed under the terms of the GNU General Public License (GPL), 23 | in which case the provisions of the GPL apply INSTEAD OF those given above. 24 | 25 | DISCLAIMER 26 | 27 | This software is provided 'as is' with no explicit or implied warranties 28 | in respect of its properties, including, but not limited to, correctness 29 | and/or fitness for purpose. 30 | ------------------------------------------------------------------------- 31 | Issue Date: 24/01/2003 32 | 33 | This file implements password based file encryption and authentication 34 | using AES in CTR mode, HMAC-SHA1 authentication and RFC2898 password 35 | based key derivation. 36 | 37 | */ 38 | 39 | #include 40 | 41 | #include "fileenc.h" 42 | 43 | #if defined(__cplusplus) 44 | extern "C" 45 | { 46 | #endif 47 | 48 | /* subroutine for data encryption/decryption */ 49 | /* this could be speeded up a lot by aligning */ 50 | /* buffers and using 32 bit operations */ 51 | 52 | static void encr_data(unsigned char data[], unsigned long d_len, fcrypt_ctx cx[1]) 53 | { 54 | unsigned int i = 0, pos = cx->encr_pos; 55 | 56 | while (i < d_len) 57 | { 58 | if (pos == AES_BLOCK_SIZE) 59 | { 60 | unsigned int j = 0; 61 | /* increment encryption nonce */ 62 | while (j < 8 && !++cx->nonce[j]) 63 | ++j; 64 | /* encrypt the nonce to form next xor buffer */ 65 | aes_encrypt(cx->nonce, cx->encr_bfr, cx->encr_ctx); 66 | pos = 0; 67 | } 68 | 69 | data[i++] ^= cx->encr_bfr[pos++]; 70 | } 71 | 72 | cx->encr_pos = pos; 73 | } 74 | 75 | int fcrypt_init( 76 | int mode, /* the mode to be used (input) */ 77 | const unsigned char pwd[], /* the user specified password (input) */ 78 | unsigned int pwd_len, /* the length of the password (input) */ 79 | const unsigned char salt[], /* the salt (input) */ 80 | #ifdef PASSWORD_VERIFIER 81 | unsigned char pwd_ver[PWD_VER_LENGTH], /* 2 byte password verifier (output) */ 82 | #endif 83 | fcrypt_ctx cx[1]) /* the file encryption context (output) */ 84 | { unsigned char kbuf[2 * MAX_KEY_LENGTH + PWD_VER_LENGTH]; 85 | 86 | if (pwd_len > MAX_PWD_LENGTH) 87 | return PASSWORD_TOO_LONG; 88 | 89 | if (mode < 1 || mode > 3) 90 | return BAD_MODE; 91 | 92 | cx->mode = mode; 93 | cx->pwd_len = pwd_len; 94 | 95 | /* derive the encryption and authentication keys and the password verifier */ 96 | derive_key(pwd, pwd_len, salt, SALT_LENGTH(mode), KEYING_ITERATIONS, 97 | kbuf, 2 * KEY_LENGTH(mode) + PWD_VER_LENGTH); 98 | 99 | /* initialise the encryption nonce and buffer pos */ 100 | cx->encr_pos = AES_BLOCK_SIZE; 101 | /* if we need a random component in the encryption */ 102 | /* nonce, this is where it would have to be set */ 103 | memset(cx->nonce, 0, AES_BLOCK_SIZE * sizeof(unsigned char)); 104 | 105 | /* initialise for encryption using key 1 */ 106 | aes_encrypt_key(kbuf, KEY_LENGTH(mode), cx->encr_ctx); 107 | 108 | /* initialise for authentication using key 2 */ 109 | hmac_sha_begin(HMAC_SHA1, cx->auth_ctx); 110 | hmac_sha_key(kbuf + KEY_LENGTH(mode), KEY_LENGTH(mode), cx->auth_ctx); 111 | 112 | #ifdef PASSWORD_VERIFIER 113 | memcpy(pwd_ver, kbuf + 2 * KEY_LENGTH(mode), PWD_VER_LENGTH); 114 | #endif 115 | 116 | return GOOD_RETURN; 117 | } 118 | 119 | /* perform 'in place' encryption and authentication */ 120 | 121 | void fcrypt_encrypt(unsigned char data[], unsigned int data_len, fcrypt_ctx cx[1]) 122 | { 123 | encr_data(data, data_len, cx); 124 | hmac_sha_data(data, data_len, cx->auth_ctx); 125 | } 126 | 127 | /* perform 'in place' authentication and decryption */ 128 | 129 | void fcrypt_decrypt(unsigned char data[], unsigned int data_len, fcrypt_ctx cx[1]) 130 | { 131 | hmac_sha_data(data, data_len, cx->auth_ctx); 132 | encr_data(data, data_len, cx); 133 | } 134 | 135 | /* close encryption/decryption and return the MAC value */ 136 | 137 | int fcrypt_end(unsigned char mac[], fcrypt_ctx cx[1]) 138 | { 139 | hmac_sha_end(mac, MAC_LENGTH(cx->mode), cx->auth_ctx); 140 | return MAC_LENGTH(cx->mode); /* return MAC length in bytes */ 141 | } 142 | 143 | #if defined(__cplusplus) 144 | } 145 | #endif 146 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/aes/fileenc.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Copyright (c) 2002, Dr Brian Gladman < >, Worcester, UK. 4 | All rights reserved. 5 | 6 | LICENSE TERMS 7 | 8 | The free distribution and use of this software in both source and binary 9 | form is allowed (with or without changes) provided that: 10 | 11 | 1. distributions of this source code include the above copyright 12 | notice, this list of conditions and the following disclaimer; 13 | 14 | 2. distributions in binary form include the above copyright 15 | notice, this list of conditions and the following disclaimer 16 | in the documentation and/or other associated materials; 17 | 18 | 3. the copyright holder's name is not used to endorse products 19 | built using this software without specific written permission. 20 | 21 | ALTERNATIVELY, provided that this notice is retained in full, this product 22 | may be distributed under the terms of the GNU General Public License (GPL), 23 | in which case the provisions of the GPL apply INSTEAD OF those given above. 24 | 25 | DISCLAIMER 26 | 27 | This software is provided 'as is' with no explicit or implied warranties 28 | in respect of its properties, including, but not limited to, correctness 29 | and/or fitness for purpose. 30 | --------------------------------------------------------------------------- 31 | Issue Date: 24/01/2003 32 | 33 | This file contains the header file for fileenc.c, which implements password 34 | based file encryption and authentication using AES in CTR mode, HMAC-SHA1 35 | authentication and RFC2898 password based key derivation. 36 | */ 37 | 38 | #ifndef _FENC_H 39 | #define _FENC_H 40 | 41 | #include "aes.h" 42 | #include "hmac.h" 43 | #include "pwd2key.h" 44 | 45 | #define PASSWORD_VERIFIER 46 | 47 | #define MAX_KEY_LENGTH 32 48 | #define MAX_PWD_LENGTH 128 49 | #define MAX_SALT_LENGTH 16 50 | #define KEYING_ITERATIONS 1000 51 | 52 | #ifdef PASSWORD_VERIFIER 53 | #define PWD_VER_LENGTH 2 54 | #else 55 | #define PWD_VER_LENGTH 0 56 | #endif 57 | 58 | #define GOOD_RETURN 0 59 | #define PASSWORD_TOO_LONG -100 60 | #define BAD_MODE -101 61 | 62 | /* 63 | Field lengths (in bytes) versus File Encryption Mode (0 < mode < 4) 64 | 65 | Mode Key Salt MAC Overhead 66 | 1 16 8 10 18 67 | 2 24 12 10 22 68 | 3 32 16 10 26 69 | 70 | The following macros assume that the mode value is correct. 71 | */ 72 | 73 | #define KEY_LENGTH(mode) (8 * (mode & 3) + 8) 74 | #define SALT_LENGTH(mode) (4 * (mode & 3) + 4) 75 | #define MAC_LENGTH(mode) (10) 76 | 77 | /* the context for file encryption */ 78 | 79 | #if defined(__cplusplus) 80 | extern "C" 81 | { 82 | #endif 83 | 84 | typedef struct 85 | { unsigned char nonce[AES_BLOCK_SIZE]; /* the CTR nonce */ 86 | unsigned char encr_bfr[AES_BLOCK_SIZE]; /* encrypt buffer */ 87 | aes_encrypt_ctx encr_ctx[1]; /* encryption context */ 88 | hmac_ctx auth_ctx[1]; /* authentication context */ 89 | unsigned int encr_pos; /* block position (enc) */ 90 | unsigned int pwd_len; /* password length */ 91 | unsigned int mode; /* File encryption mode */ 92 | } fcrypt_ctx; 93 | 94 | /* initialise file encryption or decryption */ 95 | 96 | int fcrypt_init( 97 | int mode, /* the mode to be used (input) */ 98 | const unsigned char pwd[], /* the user specified password (input) */ 99 | unsigned int pwd_len, /* the length of the password (input) */ 100 | const unsigned char salt[], /* the salt (input) */ 101 | #ifdef PASSWORD_VERIFIER 102 | unsigned char pwd_ver[PWD_VER_LENGTH], /* 2 byte password verifier (output) */ 103 | #endif 104 | fcrypt_ctx cx[1]); /* the file encryption context (output) */ 105 | 106 | /* perform 'in place' encryption or decryption and authentication */ 107 | 108 | void fcrypt_encrypt(unsigned char data[], unsigned int data_len, fcrypt_ctx cx[1]); 109 | void fcrypt_decrypt(unsigned char data[], unsigned int data_len, fcrypt_ctx cx[1]); 110 | 111 | /* close encryption/decryption and return the MAC value */ 112 | /* the return value is the length of the MAC */ 113 | 114 | int fcrypt_end(unsigned char mac[], /* the MAC value (output) */ 115 | fcrypt_ctx cx[1]); /* the context (input) */ 116 | 117 | #if defined(__cplusplus) 118 | } 119 | #endif 120 | 121 | #endif 122 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/aes/hmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Copyright (c) 1998-2010, Brian Gladman, Worcester, UK. All rights reserved. 4 | 5 | The redistribution and use of this software (with or without changes) 6 | is allowed without the payment of fees or royalties provided that: 7 | 8 | source code distributions include the above copyright notice, this 9 | list of conditions and the following disclaimer; 10 | 11 | binary distributions include the above copyright notice, this list 12 | of conditions and the following disclaimer in their documentation. 13 | 14 | This software is provided 'as is' with no explicit or implied warranties 15 | in respect of its operation, including, but not limited to, correctness 16 | and fitness for purpose. 17 | --------------------------------------------------------------------------- 18 | Issue Date: 20/12/2007 19 | 20 | This is an implementation of HMAC, the FIPS standard keyed hash function 21 | */ 22 | 23 | #ifndef _HMAC2_H 24 | #define _HMAC2_H 25 | 26 | #include 27 | #include 28 | 29 | #if defined(__cplusplus) 30 | extern "C" 31 | { 32 | #endif 33 | 34 | #include "sha1.h" 35 | 36 | #if defined(SHA_224) || defined(SHA_256) || defined(SHA_384) || defined(SHA_512) 37 | #define HMAC_MAX_OUTPUT_SIZE SHA2_MAX_DIGEST_SIZE 38 | #define HMAC_MAX_BLOCK_SIZE SHA2_MAX_BLOCK_SIZE 39 | #else 40 | #define HMAC_MAX_OUTPUT_SIZE SHA1_DIGEST_SIZE 41 | #define HMAC_MAX_BLOCK_SIZE SHA1_BLOCK_SIZE 42 | #endif 43 | 44 | #define HMAC_IN_DATA 0xffffffff 45 | 46 | enum hmac_hash 47 | { 48 | #ifdef SHA_1 49 | HMAC_SHA1, 50 | #endif 51 | #ifdef SHA_224 52 | HMAC_SHA224, 53 | #endif 54 | #ifdef SHA_256 55 | HMAC_SHA256, 56 | #endif 57 | #ifdef SHA_384 58 | HMAC_SHA384, 59 | #endif 60 | #ifdef SHA_512 61 | HMAC_SHA512, 62 | HMAC_SHA512_256, 63 | HMAC_SHA512_224, 64 | HMAC_SHA512_192, 65 | HMAC_SHA512_128 66 | #endif 67 | }; 68 | 69 | typedef VOID_RETURN hf_begin(void*); 70 | typedef VOID_RETURN hf_hash(const void*, unsigned long len, void*); 71 | typedef VOID_RETURN hf_end(void*, void*); 72 | 73 | typedef struct 74 | { hf_begin *f_begin; 75 | hf_hash *f_hash; 76 | hf_end *f_end; 77 | unsigned char key[HMAC_MAX_BLOCK_SIZE]; 78 | union 79 | { 80 | #ifdef SHA_1 81 | sha1_ctx u_sha1; 82 | #endif 83 | #ifdef SHA_224 84 | sha224_ctx u_sha224; 85 | #endif 86 | #ifdef SHA_256 87 | sha256_ctx u_sha256; 88 | #endif 89 | #ifdef SHA_384 90 | sha384_ctx u_sha384; 91 | #endif 92 | #ifdef SHA_512 93 | sha512_ctx u_sha512; 94 | #endif 95 | } sha_ctx[1]; 96 | unsigned long input_len; 97 | unsigned long output_len; 98 | unsigned long klen; 99 | } hmac_ctx; 100 | 101 | /* returns the length of hash digest for the hash used */ 102 | /* mac_len must not be greater than this */ 103 | int hmac_sha_begin(enum hmac_hash hash, hmac_ctx cx[1]); 104 | 105 | int hmac_sha_key(const unsigned char key[], unsigned long key_len, hmac_ctx cx[1]); 106 | 107 | void hmac_sha_data(const unsigned char data[], unsigned long data_len, hmac_ctx cx[1]); 108 | 109 | void hmac_sha_end(unsigned char mac[], unsigned long mac_len, hmac_ctx cx[1]); 110 | 111 | void hmac_sha(enum hmac_hash hash, const unsigned char key[], unsigned long key_len, 112 | const unsigned char data[], unsigned long data_len, 113 | unsigned char mac[], unsigned long mac_len); 114 | 115 | #if defined(__cplusplus) 116 | } 117 | #endif 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/aes/prng.c: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Copyright (c) 2002, Dr Brian Gladman < >, Worcester, UK. 4 | All rights reserved. 5 | 6 | LICENSE TERMS 7 | 8 | The free distribution and use of this software in both source and binary 9 | form is allowed (with or without changes) provided that: 10 | 11 | 1. distributions of this source code include the above copyright 12 | notice, this list of conditions and the following disclaimer; 13 | 14 | 2. distributions in binary form include the above copyright 15 | notice, this list of conditions and the following disclaimer 16 | in the documentation and/or other associated materials; 17 | 18 | 3. the copyright holder's name is not used to endorse products 19 | built using this software without specific written permission. 20 | 21 | ALTERNATIVELY, provided that this notice is retained in full, this product 22 | may be distributed under the terms of the GNU General Public License (GPL), 23 | in which case the provisions of the GPL apply INSTEAD OF those given above. 24 | 25 | DISCLAIMER 26 | 27 | This software is provided 'as is' with no explicit or implied warranties 28 | in respect of its properties, including, but not limited to, correctness 29 | and/or fitness for purpose. 30 | --------------------------------------------------------------------------- 31 | Issue Date: 24/01/2003 32 | 33 | This file implements a random data pool based on the use of an external 34 | entropy function. It is based on the ideas advocated by Peter Gutmann in 35 | his work on pseudo random sequence generators. It is not a 'paranoid' 36 | random sequence generator and no attempt is made to protect the pool 37 | from prying eyes either by memory locking or by techniques to obscure 38 | its location in memory. 39 | */ 40 | 41 | #include 42 | #include "prng.h" 43 | 44 | #if defined(__cplusplus) 45 | extern "C" 46 | { 47 | #endif 48 | 49 | /* mix a random data pool using the SHA1 compression function (as */ 50 | /* suggested by Peter Gutmann in his paper on random pools) */ 51 | 52 | static void prng_mix(unsigned char buf[]) 53 | { unsigned int i, len; 54 | sha1_ctx ctx[1]; 55 | 56 | /*lint -e{663} unusual array to pointer conversion */ 57 | for(i = 0; i < PRNG_POOL_SIZE; i += SHA1_DIGEST_SIZE) 58 | { 59 | /* copy digest size pool block into SHA1 hash block */ 60 | memcpy(ctx->hash, buf + (i ? i : PRNG_POOL_SIZE) 61 | - SHA1_DIGEST_SIZE, SHA1_DIGEST_SIZE); 62 | 63 | /* copy data from pool into the SHA1 data buffer */ 64 | len = PRNG_POOL_SIZE - i; 65 | memcpy(ctx->wbuf, buf + i, (len > SHA1_BLOCK_SIZE ? SHA1_BLOCK_SIZE : len)); 66 | 67 | if(len < SHA1_BLOCK_SIZE) 68 | memcpy(((char*)ctx->wbuf) + len, buf, SHA1_BLOCK_SIZE - len); 69 | 70 | /* compress using the SHA1 compression function */ 71 | sha1_compile(ctx); 72 | 73 | /* put digest size block back into the random pool */ 74 | memcpy(buf + i, ctx->hash, SHA1_DIGEST_SIZE); 75 | } 76 | } 77 | 78 | /* refresh the output buffer and update the random pool by adding */ 79 | /* entropy and remixing */ 80 | 81 | static void update_pool(prng_ctx ctx[1]) 82 | { unsigned int i = 0; 83 | 84 | /* transfer random pool data to the output buffer */ 85 | memcpy(ctx->obuf, ctx->rbuf, PRNG_POOL_SIZE); 86 | 87 | /* enter entropy data into the pool */ 88 | while(i < PRNG_POOL_SIZE) 89 | i += ctx->entropy(ctx->rbuf + i, PRNG_POOL_SIZE - i); 90 | 91 | /* invert and xor the original pool data into the pool */ 92 | for(i = 0; i < PRNG_POOL_SIZE; ++i) 93 | ctx->rbuf[i] ^= ~ctx->obuf[i]; 94 | 95 | /* mix the pool and the output buffer */ 96 | prng_mix(ctx->rbuf); 97 | prng_mix(ctx->obuf); 98 | } 99 | 100 | void prng_init(prng_entropy_fn fun, prng_ctx ctx[1]) 101 | { int i; 102 | 103 | /* clear the buffers and the counter in the context */ 104 | memset(ctx, 0, sizeof(prng_ctx)); 105 | 106 | /* set the pointer to the entropy collection function */ 107 | ctx->entropy = fun; 108 | 109 | /* initialise the random data pool */ 110 | update_pool(ctx); 111 | 112 | /* mix the pool a minimum number of times */ 113 | for(i = 0; i < PRNG_MIN_MIX; ++i) 114 | prng_mix(ctx->rbuf); 115 | 116 | /* update the pool to prime the pool output buffer */ 117 | update_pool(ctx); 118 | } 119 | 120 | /* provide random bytes from the random data pool */ 121 | 122 | void prng_rand(unsigned char data[], unsigned int data_len, prng_ctx ctx[1]) 123 | { unsigned char *rp = data; 124 | unsigned int len, pos = ctx->pos; 125 | 126 | while(data_len) 127 | { 128 | /* transfer 'data_len' bytes (or the number of bytes remaining */ 129 | /* the pool output buffer if less) into the output */ 130 | len = (data_len < PRNG_POOL_SIZE - pos ? data_len : PRNG_POOL_SIZE - pos); 131 | memcpy(rp, ctx->obuf + pos, len); 132 | rp += len; /* update ouput buffer position pointer */ 133 | pos += len; /* update pool output buffer pointer */ 134 | data_len -= len; /* update the remaining data count */ 135 | 136 | /* refresh the random pool if necessary */ 137 | if(pos == PRNG_POOL_SIZE) 138 | { 139 | update_pool(ctx); pos = 0; 140 | } 141 | } 142 | 143 | ctx->pos = pos; 144 | } 145 | 146 | void prng_end(prng_ctx ctx[1]) 147 | { 148 | /* ensure the data in the context is destroyed */ 149 | memset(ctx, 0, sizeof(prng_ctx)); 150 | } 151 | 152 | #if defined(__cplusplus) 153 | } 154 | #endif 155 | 156 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/aes/prng.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Copyright (c) 2002, Dr Brian Gladman < >, Worcester, UK. 4 | All rights reserved. 5 | 6 | LICENSE TERMS 7 | 8 | The free distribution and use of this software in both source and binary 9 | form is allowed (with or without changes) provided that: 10 | 11 | 1. distributions of this source code include the above copyright 12 | notice, this list of conditions and the following disclaimer; 13 | 14 | 2. distributions in binary form include the above copyright 15 | notice, this list of conditions and the following disclaimer 16 | in the documentation and/or other associated materials; 17 | 18 | 3. the copyright holder's name is not used to endorse products 19 | built using this software without specific written permission. 20 | 21 | ALTERNATIVELY, provided that this notice is retained in full, this product 22 | may be distributed under the terms of the GNU General Public License (GPL), 23 | in which case the provisions of the GPL apply INSTEAD OF those given above. 24 | 25 | DISCLAIMER 26 | 27 | This software is provided 'as is' with no explicit or implied warranties 28 | in respect of its properties, including, but not limited to, correctness 29 | and/or fitness for purpose. 30 | --------------------------------------------------------------------------- 31 | Issue Date: 24/01/2003 32 | 33 | This is the header file for an implementation of a random data pool based on 34 | the use of an external entropy function (inspired by Peter Gutmann's work). 35 | */ 36 | 37 | #ifndef _PRNG_H 38 | #define _PRNG_H 39 | 40 | #include "sha1.h" 41 | 42 | #define PRNG_POOL_LEN 256 /* minimum random pool size */ 43 | #define PRNG_MIN_MIX 20 /* min initial pool mixing iterations */ 44 | 45 | /* ensure that pool length is a multiple of the SHA1 digest size */ 46 | 47 | #define PRNG_POOL_SIZE (SHA1_DIGEST_SIZE * (1 + (PRNG_POOL_LEN - 1) / SHA1_DIGEST_SIZE)) 48 | 49 | #if defined(__cplusplus) 50 | extern "C" 51 | { 52 | #endif 53 | 54 | /* A function for providing entropy is a parameter in the prng_init() */ 55 | /* call. This function has the following form and returns a maximum */ 56 | /* of 'len' bytes of pseudo random data in the buffer 'buf'. It can */ 57 | /* return less than 'len' bytes but will be repeatedly called for more */ 58 | /* data in this case. */ 59 | 60 | typedef int (*prng_entropy_fn)(unsigned char buf[], unsigned int len); 61 | 62 | typedef struct 63 | { unsigned char rbuf[PRNG_POOL_SIZE]; /* the random pool */ 64 | unsigned char obuf[PRNG_POOL_SIZE]; /* pool output buffer */ 65 | unsigned int pos; /* output buffer position */ 66 | prng_entropy_fn entropy; /* entropy function pointer */ 67 | } prng_ctx; 68 | 69 | /* initialise the random stream generator */ 70 | void prng_init(prng_entropy_fn fun, prng_ctx ctx[1]); 71 | 72 | /* obtain random bytes from the generator */ 73 | void prng_rand(unsigned char data[], unsigned int data_len, prng_ctx ctx[1]); 74 | 75 | /* close the random stream generator */ 76 | void prng_end(prng_ctx ctx[1]); 77 | 78 | #if defined(__cplusplus) 79 | } 80 | #endif 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/aes/pwd2key.c: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Copyright (c) 1998-2010, Brian Gladman, Worcester, UK. All rights reserved. 4 | 5 | The redistribution and use of this software (with or without changes) 6 | is allowed without the payment of fees or royalties provided that: 7 | 8 | source code distributions include the above copyright notice, this 9 | list of conditions and the following disclaimer; 10 | 11 | binary distributions include the above copyright notice, this list 12 | of conditions and the following disclaimer in their documentation. 13 | 14 | This software is provided 'as is' with no explicit or implied warranties 15 | in respect of its operation, including, but not limited to, correctness 16 | and fitness for purpose. 17 | --------------------------------------------------------------------------- 18 | Issue Date: 20/12/2007 19 | 20 | This is an implementation of RFC2898, which specifies key derivation from 21 | a password and a salt value. 22 | */ 23 | 24 | #include 25 | #include "hmac.h" 26 | 27 | #if defined(__cplusplus) 28 | extern "C" 29 | { 30 | #endif 31 | 32 | void derive_key(const unsigned char pwd[], /* the PASSWORD */ 33 | unsigned int pwd_len, /* and its length */ 34 | const unsigned char salt[], /* the SALT and its */ 35 | unsigned int salt_len, /* length */ 36 | unsigned int iter, /* the number of iterations */ 37 | unsigned char key[], /* space for the output key */ 38 | unsigned int key_len)/* and its required length */ 39 | { 40 | unsigned int i, j, k, n_blk, h_size; 41 | unsigned char uu[HMAC_MAX_OUTPUT_SIZE], ux[HMAC_MAX_OUTPUT_SIZE]; 42 | hmac_ctx c1[1], c2[1], c3[1]; 43 | 44 | /* set HMAC context (c1) for password */ 45 | h_size = hmac_sha_begin(HMAC_SHA1, c1); 46 | hmac_sha_key(pwd, pwd_len, c1); 47 | 48 | /* set HMAC context (c2) for password and salt */ 49 | memcpy(c2, c1, sizeof(hmac_ctx)); 50 | hmac_sha_data(salt, salt_len, c2); 51 | 52 | /* find the number of SHA blocks in the key */ 53 | n_blk = 1 + (key_len - 1) / h_size; 54 | 55 | for(i = 0; i < n_blk; ++i) /* for each block in key */ 56 | { 57 | /* ux[] holds the running xor value */ 58 | memset(ux, 0, h_size); 59 | 60 | /* set HMAC context (c3) for password and salt */ 61 | memcpy(c3, c2, sizeof(hmac_ctx)); 62 | 63 | /* enter additional data for 1st block into uu */ 64 | uu[0] = (unsigned char)((i + 1) >> 24); 65 | uu[1] = (unsigned char)((i + 1) >> 16); 66 | uu[2] = (unsigned char)((i + 1) >> 8); 67 | uu[3] = (unsigned char)(i + 1); 68 | 69 | /* this is the key mixing iteration */ 70 | for(j = 0, k = 4; j < iter; ++j) 71 | { 72 | /* add previous round data to HMAC */ 73 | hmac_sha_data(uu, k, c3); 74 | 75 | /* obtain HMAC for uu[] */ 76 | hmac_sha_end(uu, h_size, c3); 77 | 78 | /* xor into the running xor block */ 79 | for(k = 0; k < h_size; ++k) 80 | ux[k] ^= uu[k]; 81 | 82 | /* set HMAC context (c3) for password */ 83 | memcpy(c3, c1, sizeof(hmac_ctx)); 84 | } 85 | 86 | /* compile key blocks into the key output */ 87 | j = 0; k = i * h_size; 88 | while(j < h_size && k < key_len) 89 | key[k++] = ux[j++]; 90 | } 91 | } 92 | 93 | #ifdef TEST 94 | 95 | #include 96 | 97 | struct 98 | { unsigned int pwd_len; 99 | unsigned int salt_len; 100 | unsigned int it_count; 101 | unsigned char *pwd; 102 | unsigned char salt[32]; 103 | unsigned char key[32]; 104 | } tests[] = 105 | { 106 | { 8, 4, 5, (unsigned char*)"password", 107 | { 108 | 0x12, 0x34, 0x56, 0x78 109 | }, 110 | { 111 | 0x5c, 0x75, 0xce, 0xf0, 0x1a, 0x96, 0x0d, 0xf7, 112 | 0x4c, 0xb6, 0xb4, 0x9b, 0x9e, 0x38, 0xe6, 0xb5 113 | } 114 | }, 115 | { 8, 8, 5, (unsigned char*)"password", 116 | { 117 | 0x12, 0x34, 0x56, 0x78, 0x78, 0x56, 0x34, 0x12 118 | }, 119 | { 120 | 0xd1, 0xda, 0xa7, 0x86, 0x15, 0xf2, 0x87, 0xe6, 121 | 0xa1, 0xc8, 0xb1, 0x20, 0xd7, 0x06, 0x2a, 0x49 122 | } 123 | }, 124 | { 8, 21, 1, (unsigned char*)"password", 125 | { 126 | "ATHENA.MIT.EDUraeburn" 127 | }, 128 | { 129 | 0xcd, 0xed, 0xb5, 0x28, 0x1b, 0xb2, 0xf8, 0x01, 130 | 0x56, 0x5a, 0x11, 0x22, 0xb2, 0x56, 0x35, 0x15 131 | } 132 | }, 133 | { 8, 21, 2, (unsigned char*)"password", 134 | { 135 | "ATHENA.MIT.EDUraeburn" 136 | }, 137 | { 138 | 0x01, 0xdb, 0xee, 0x7f, 0x4a, 0x9e, 0x24, 0x3e, 139 | 0x98, 0x8b, 0x62, 0xc7, 0x3c, 0xda, 0x93, 0x5d 140 | } 141 | }, 142 | { 8, 21, 1200, (unsigned char*)"password", 143 | { 144 | "ATHENA.MIT.EDUraeburn" 145 | }, 146 | { 147 | 0x5c, 0x08, 0xeb, 0x61, 0xfd, 0xf7, 0x1e, 0x4e, 148 | 0x4e, 0xc3, 0xcf, 0x6b, 0xa1, 0xf5, 0x51, 0x2b 149 | } 150 | } 151 | }; 152 | 153 | int main() 154 | { unsigned int i, j, key_len = 256; 155 | unsigned char key[256]; 156 | 157 | printf("\nTest of RFC2898 Password Based Key Derivation"); 158 | for(i = 0; i < 5; ++i) 159 | { 160 | derive_key(tests[i].pwd, tests[i].pwd_len, tests[i].salt, 161 | tests[i].salt_len, tests[i].it_count, key, key_len); 162 | 163 | printf("\ntest %i: ", i + 1); 164 | printf("key %s", memcmp(tests[i].key, key, 16) ? "is bad" : "is good"); 165 | for(j = 0; j < key_len && j < 64; j += 4) 166 | { 167 | if(j % 16 == 0) 168 | printf("\n"); 169 | printf("0x%02x%02x%02x%02x ", key[j], key[j + 1], key[j + 2], key[j + 3]); 170 | } 171 | printf(j < key_len ? " ... \n" : "\n"); 172 | } 173 | printf("\n"); 174 | return 0; 175 | } 176 | 177 | #if defined(__cplusplus) 178 | } 179 | #endif 180 | 181 | #endif 182 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/aes/pwd2key.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Copyright (c) 1998-2010, Brian Gladman, Worcester, UK. All rights reserved. 4 | 5 | The redistribution and use of this software (with or without changes) 6 | is allowed without the payment of fees or royalties provided that: 7 | 8 | source code distributions include the above copyright notice, this 9 | list of conditions and the following disclaimer; 10 | 11 | binary distributions include the above copyright notice, this list 12 | of conditions and the following disclaimer in their documentation. 13 | 14 | This software is provided 'as is' with no explicit or implied warranties 15 | in respect of its operation, including, but not limited to, correctness 16 | and fitness for purpose. 17 | --------------------------------------------------------------------------- 18 | Issue Date: 20/12/2007 19 | 20 | This is an implementation of RFC2898, which specifies key derivation from 21 | a password and a salt value. 22 | */ 23 | 24 | #ifndef PWD2KEY_H 25 | #define PWD2KEY_H 26 | 27 | #if defined(__cplusplus) 28 | extern "C" 29 | { 30 | #endif 31 | 32 | void derive_key( 33 | const unsigned char pwd[], /* the PASSWORD, and */ 34 | unsigned int pwd_len, /* its length */ 35 | const unsigned char salt[], /* the SALT and its */ 36 | unsigned int salt_len, /* length */ 37 | unsigned int iter, /* the number of iterations */ 38 | unsigned char key[], /* space for the output key */ 39 | unsigned int key_len); /* and its required length */ 40 | 41 | #if defined(__cplusplus) 42 | } 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/aes/sha1.h: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Copyright (c) 1998-2010, Brian Gladman, Worcester, UK. All rights reserved. 4 | 5 | The redistribution and use of this software (with or without changes) 6 | is allowed without the payment of fees or royalties provided that: 7 | 8 | source code distributions include the above copyright notice, this 9 | list of conditions and the following disclaimer; 10 | 11 | binary distributions include the above copyright notice, this list 12 | of conditions and the following disclaimer in their documentation. 13 | 14 | This software is provided 'as is' with no explicit or implied warranties 15 | in respect of its operation, including, but not limited to, correctness 16 | and fitness for purpose. 17 | --------------------------------------------------------------------------- 18 | Issue Date: 20/12/2007 19 | */ 20 | 21 | #ifndef _SHA1_H 22 | #define _SHA1_H 23 | 24 | #define SHA_1 25 | 26 | /* define for bit or byte oriented SHA */ 27 | #if 1 28 | # define SHA1_BITS 0 /* byte oriented */ 29 | #else 30 | # define SHA1_BITS 1 /* bit oriented */ 31 | #endif 32 | 33 | #include 34 | #include "brg_types.h" 35 | 36 | #define SHA1_BLOCK_SIZE 64 37 | #define SHA1_DIGEST_SIZE 20 38 | 39 | #if defined(__cplusplus) 40 | extern "C" 41 | { 42 | #endif 43 | 44 | /* type to hold the SHA256 context */ 45 | 46 | typedef struct 47 | { uint32_t count[2]; 48 | uint32_t hash[SHA1_DIGEST_SIZE >> 2]; 49 | uint32_t wbuf[SHA1_BLOCK_SIZE >> 2]; 50 | } sha1_ctx; 51 | 52 | /* Note that these prototypes are the same for both bit and */ 53 | /* byte oriented implementations. However the length fields */ 54 | /* are in bytes or bits as appropriate for the version used */ 55 | /* and bit sequences are input as arrays of bytes in which */ 56 | /* bit sequences run from the most to the least significant */ 57 | /* end of each byte. The value 'len' in sha1_hash for the */ 58 | /* byte oriented version of SHA1 is limited to 2^29 bytes, */ 59 | /* but multiple calls will handle longer data blocks. */ 60 | 61 | VOID_RETURN sha1_compile(sha1_ctx ctx[1]); 62 | 63 | VOID_RETURN sha1_begin(sha1_ctx ctx[1]); 64 | VOID_RETURN sha1_hash(const unsigned char data[], unsigned long len, sha1_ctx ctx[1]); 65 | VOID_RETURN sha1_end(unsigned char hval[], sha1_ctx ctx[1]); 66 | VOID_RETURN sha1(unsigned char hval[], const unsigned char data[], unsigned long len); 67 | 68 | #if defined(__cplusplus) 69 | } 70 | #endif 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/crypt.c: -------------------------------------------------------------------------------- 1 | /* crypt.c -- base code for traditional PKWARE encryption 2 | Version 1.01e, February 12th, 2005 3 | 4 | Copyright (C) 1998-2005 Gilles Vollant 5 | Modifications for Info-ZIP crypting 6 | Copyright (C) 2003 Terry Thorsen 7 | 8 | This code is a modified version of crypting code in Info-ZIP distribution 9 | 10 | Copyright (C) 1990-2000 Info-ZIP. All rights reserved. 11 | 12 | This program is distributed under the terms of the same license as zlib. 13 | See the accompanying LICENSE file for the full text of the license. 14 | 15 | This encryption code is a direct transcription of the algorithm from 16 | Roger Schlafly, described by Phil Katz in the file appnote.txt. This 17 | file (appnote.txt) is distributed with the PKZIP program (even in the 18 | version without encryption capabilities). 19 | 20 | If you don't need crypting in your application, just define symbols 21 | NOCRYPT and NOUNCRYPT. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #ifdef _WIN32 30 | # include 31 | # include 32 | #else 33 | # include 34 | # include 35 | # include 36 | #endif 37 | 38 | #include "zlib.h" 39 | 40 | #include "crypt.h" 41 | 42 | /***************************************************************************/ 43 | 44 | #define CRC32(c, b) ((*(pcrc_32_tab+(((uint32_t)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) 45 | 46 | #ifndef ZCR_SEED2 47 | # define ZCR_SEED2 3141592654UL /* use PI as default pattern */ 48 | #endif 49 | 50 | /***************************************************************************/ 51 | 52 | uint8_t decrypt_byte(uint32_t *pkeys) 53 | { 54 | unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an 55 | * unpredictable manner on 16-bit systems; not a problem 56 | * with any known compiler so far, though */ 57 | 58 | temp = ((uint32_t)(*(pkeys+2)) & 0xffff) | 2; 59 | return (uint8_t)(((temp * (temp ^ 1)) >> 8) & 0xff); 60 | } 61 | 62 | uint8_t update_keys(uint32_t *pkeys, const z_crc_t *pcrc_32_tab, int32_t c) 63 | { 64 | (*(pkeys+0)) = (uint32_t)CRC32((*(pkeys+0)), c); 65 | (*(pkeys+1)) += (*(pkeys+0)) & 0xff; 66 | (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; 67 | { 68 | register int32_t keyshift = (int32_t)((*(pkeys + 1)) >> 24); 69 | (*(pkeys+2)) = (uint32_t)CRC32((*(pkeys+2)), keyshift); 70 | } 71 | return c; 72 | } 73 | 74 | void init_keys(const char *passwd, uint32_t *pkeys, const z_crc_t *pcrc_32_tab) 75 | { 76 | *(pkeys+0) = 305419896L; 77 | *(pkeys+1) = 591751049L; 78 | *(pkeys+2) = 878082192L; 79 | while (*passwd != 0) 80 | { 81 | update_keys(pkeys, pcrc_32_tab, *passwd); 82 | passwd += 1; 83 | } 84 | } 85 | 86 | /***************************************************************************/ 87 | 88 | int cryptrand(unsigned char *buf, unsigned int len) 89 | { 90 | static unsigned calls = 0; 91 | int rlen = 0; 92 | #ifdef _WIN32 93 | HCRYPTPROV provider; 94 | unsigned __int64 pentium_tsc[1]; 95 | int result = 0; 96 | 97 | 98 | if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) 99 | { 100 | result = CryptGenRandom(provider, len, buf); 101 | CryptReleaseContext(provider, 0); 102 | if (result) 103 | return len; 104 | } 105 | 106 | for (rlen = 0; rlen < (int)len; ++rlen) 107 | { 108 | if (rlen % 8 == 0) 109 | QueryPerformanceCounter((LARGE_INTEGER *)pentium_tsc); 110 | buf[rlen] = ((unsigned char*)pentium_tsc)[rlen % 8]; 111 | } 112 | #else 113 | int frand = open("/dev/urandom", O_RDONLY); 114 | if (frand != -1) 115 | { 116 | rlen = (int)read(frand, buf, len); 117 | close(frand); 118 | } 119 | #endif 120 | if (rlen < (int)len) 121 | { 122 | /* Ensure different random header each time */ 123 | if (++calls == 1) 124 | srand((unsigned)(time(NULL) ^ ZCR_SEED2)); 125 | 126 | while (rlen < (int)len) 127 | buf[rlen++] = (rand() >> 7) & 0xff; 128 | } 129 | return rlen; 130 | } 131 | 132 | int crypthead(const char *passwd, uint8_t *buf, int buf_size, uint32_t *pkeys, 133 | const z_crc_t *pcrc_32_tab, uint8_t verify1, uint8_t verify2) 134 | { 135 | uint8_t n = 0; /* index in random header */ 136 | uint8_t header[RAND_HEAD_LEN-2]; /* random header */ 137 | uint16_t t = 0; /* temporary */ 138 | 139 | if (buf_size < RAND_HEAD_LEN) 140 | return 0; 141 | 142 | init_keys(passwd, pkeys, pcrc_32_tab); 143 | 144 | /* First generate RAND_HEAD_LEN-2 random bytes. */ 145 | cryptrand(header, RAND_HEAD_LEN-2); 146 | 147 | /* Encrypt random header (last two bytes is high word of crc) */ 148 | init_keys(passwd, pkeys, pcrc_32_tab); 149 | 150 | for (n = 0; n < RAND_HEAD_LEN-2; n++) 151 | buf[n] = (uint8_t)zencode(pkeys, pcrc_32_tab, header[n], t); 152 | 153 | buf[n++] = (uint8_t)zencode(pkeys, pcrc_32_tab, verify1, t); 154 | buf[n++] = (uint8_t)zencode(pkeys, pcrc_32_tab, verify2, t); 155 | return n; 156 | } 157 | 158 | /***************************************************************************/ 159 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/crypt.h: -------------------------------------------------------------------------------- 1 | /* crypt.h -- base code for traditional PKWARE encryption 2 | Version 1.01e, February 12th, 2005 3 | 4 | Copyright (C) 1998-2005 Gilles Vollant 5 | Modifications for Info-ZIP crypting 6 | Copyright (C) 2003 Terry Thorsen 7 | 8 | This code is a modified version of crypting code in Info-ZIP distribution 9 | 10 | Copyright (C) 1990-2000 Info-ZIP. All rights reserved. 11 | 12 | This program is distributed under the terms of the same license as zlib. 13 | See the accompanying LICENSE file for the full text of the license. 14 | */ 15 | 16 | #ifndef _MINICRYPT_H 17 | #define _MINICRYPT_H 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #define RAND_HEAD_LEN 12 24 | 25 | /***************************************************************************/ 26 | 27 | #define zdecode(pkeys,pcrc_32_tab,c) \ 28 | (update_keys(pkeys,pcrc_32_tab, c ^= decrypt_byte(pkeys))) 29 | 30 | #define zencode(pkeys,pcrc_32_tab,c,t) \ 31 | (t = decrypt_byte(pkeys), update_keys(pkeys,pcrc_32_tab,c), t^(c)) 32 | 33 | /***************************************************************************/ 34 | 35 | /* Return the next byte in the pseudo-random sequence */ 36 | uint8_t decrypt_byte(uint32_t *pkeys); 37 | 38 | /* Update the encryption keys with the next byte of plain text */ 39 | uint8_t update_keys(uint32_t *pkeys, const z_crc_t *pcrc_32_tab, int32_t c); 40 | 41 | /* Initialize the encryption keys and the random header according to the given password. */ 42 | void init_keys(const char *passwd, uint32_t *pkeys, const z_crc_t *pcrc_32_tab); 43 | 44 | /* Generate cryptographically secure random numbers */ 45 | int cryptrand(unsigned char *buf, unsigned int len); 46 | 47 | /* Create encryption header */ 48 | int crypthead(const char *passwd, uint8_t *buf, int buf_size, uint32_t *pkeys, 49 | const z_crc_t *pcrc_32_tab, uint8_t verify1, uint8_t verify2); 50 | 51 | /***************************************************************************/ 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/ioapi.h: -------------------------------------------------------------------------------- 1 | /* ioapi.h -- IO base function header for compress/uncompress .zip 2 | part of the MiniZip project 3 | 4 | Copyright (C) 1998-2010 Gilles Vollant 5 | http://www.winimage.com/zLibDll/minizip.html 6 | Modifications for Zip64 support 7 | Copyright (C) 2009-2010 Mathias Svensson 8 | http://result42.com 9 | 10 | This program is distributed under the terms of the same license as zlib. 11 | See the accompanying LICENSE file for the full text of the license. 12 | */ 13 | 14 | #ifndef _ZLIBIOAPI64_H 15 | #define _ZLIBIOAPI64_H 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #include "zlib.h" 22 | 23 | #if defined(USE_FILE32API) 24 | # define fopen64 fopen 25 | # define ftello64 ftell 26 | # define fseeko64 fseek 27 | #else 28 | # if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) || defined(__APPLE__) 29 | # define fopen64 fopen 30 | # define ftello64 ftello 31 | # define fseeko64 fseeko 32 | # endif 33 | # ifdef _MSC_VER 34 | # define fopen64 fopen 35 | # if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) 36 | # define ftello64 _ftelli64 37 | # define fseeko64 _fseeki64 38 | # else /* old MSC */ 39 | # define ftello64 ftell 40 | # define fseeko64 fseek 41 | # endif 42 | # endif 43 | #endif 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | #define ZLIB_FILEFUNC_SEEK_CUR (1) 50 | #define ZLIB_FILEFUNC_SEEK_END (2) 51 | #define ZLIB_FILEFUNC_SEEK_SET (0) 52 | 53 | #define ZLIB_FILEFUNC_MODE_READ (1) 54 | #define ZLIB_FILEFUNC_MODE_WRITE (2) 55 | #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) 56 | #define ZLIB_FILEFUNC_MODE_EXISTING (4) 57 | #define ZLIB_FILEFUNC_MODE_CREATE (8) 58 | 59 | #ifndef ZCALLBACK 60 | # if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || \ 61 | defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) 62 | # define ZCALLBACK CALLBACK 63 | # else 64 | # define ZCALLBACK 65 | # endif 66 | #endif 67 | 68 | typedef voidpf (ZCALLBACK *open_file_func) (voidpf opaque, const char *filename, int mode); 69 | typedef voidpf (ZCALLBACK *opendisk_file_func) (voidpf opaque, voidpf stream, uint32_t number_disk, int mode); 70 | typedef uint32_t (ZCALLBACK *read_file_func) (voidpf opaque, voidpf stream, void* buf, uint32_t size); 71 | typedef uint32_t (ZCALLBACK *write_file_func) (voidpf opaque, voidpf stream, const void *buf, uint32_t size); 72 | typedef int (ZCALLBACK *close_file_func) (voidpf opaque, voidpf stream); 73 | typedef int (ZCALLBACK *error_file_func) (voidpf opaque, voidpf stream); 74 | 75 | typedef long (ZCALLBACK *tell_file_func) (voidpf opaque, voidpf stream); 76 | typedef long (ZCALLBACK *seek_file_func) (voidpf opaque, voidpf stream, uint32_t offset, int origin); 77 | 78 | /* here is the "old" 32 bits structure structure */ 79 | typedef struct zlib_filefunc_def_s 80 | { 81 | open_file_func zopen_file; 82 | opendisk_file_func zopendisk_file; 83 | read_file_func zread_file; 84 | write_file_func zwrite_file; 85 | tell_file_func ztell_file; 86 | seek_file_func zseek_file; 87 | close_file_func zclose_file; 88 | error_file_func zerror_file; 89 | voidpf opaque; 90 | } zlib_filefunc_def; 91 | 92 | typedef uint64_t (ZCALLBACK *tell64_file_func) (voidpf opaque, voidpf stream); 93 | typedef long (ZCALLBACK *seek64_file_func) (voidpf opaque, voidpf stream, uint64_t offset, int origin); 94 | typedef voidpf (ZCALLBACK *open64_file_func) (voidpf opaque, const void *filename, int mode); 95 | typedef voidpf (ZCALLBACK *opendisk64_file_func)(voidpf opaque, voidpf stream, uint32_t number_disk, int mode); 96 | 97 | typedef struct zlib_filefunc64_def_s 98 | { 99 | open64_file_func zopen64_file; 100 | opendisk64_file_func zopendisk64_file; 101 | read_file_func zread_file; 102 | write_file_func zwrite_file; 103 | tell64_file_func ztell64_file; 104 | seek64_file_func zseek64_file; 105 | close_file_func zclose_file; 106 | error_file_func zerror_file; 107 | voidpf opaque; 108 | } zlib_filefunc64_def; 109 | 110 | void fill_fopen_filefunc(zlib_filefunc_def *pzlib_filefunc_def); 111 | void fill_fopen64_filefunc(zlib_filefunc64_def *pzlib_filefunc_def); 112 | 113 | /* now internal definition, only for zip.c and unzip.h */ 114 | typedef struct zlib_filefunc64_32_def_s 115 | { 116 | zlib_filefunc64_def zfile_func64; 117 | open_file_func zopen32_file; 118 | opendisk_file_func zopendisk32_file; 119 | tell_file_func ztell32_file; 120 | seek_file_func zseek32_file; 121 | } zlib_filefunc64_32_def; 122 | 123 | #define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) 124 | #define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) 125 | /*#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream))*/ 126 | /*#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode))*/ 127 | #define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) 128 | #define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) 129 | 130 | voidpf call_zopen64(const zlib_filefunc64_32_def *pfilefunc,const void*filename, int mode); 131 | voidpf call_zopendisk64(const zlib_filefunc64_32_def *pfilefunc, voidpf filestream, uint32_t number_disk, int mode); 132 | long call_zseek64(const zlib_filefunc64_32_def *pfilefunc, voidpf filestream, uint64_t offset, int origin); 133 | uint64_t call_ztell64(const zlib_filefunc64_32_def *pfilefunc, voidpf filestream); 134 | 135 | void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def *p_filefunc64_32, const zlib_filefunc_def *p_filefunc32); 136 | 137 | #define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) 138 | #define ZOPENDISK64(filefunc,filestream,diskn,mode) (call_zopendisk64((&(filefunc)),(filestream),(diskn),(mode))) 139 | #define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) 140 | #define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) 141 | 142 | #ifdef __cplusplus 143 | } 144 | #endif 145 | 146 | #endif 147 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/ioapi_buf.h: -------------------------------------------------------------------------------- 1 | /* ioapi_buf.h -- IO base function header for compress/uncompress .zip 2 | files using zlib + zip or unzip API 3 | 4 | This version of ioapi is designed to buffer IO. 5 | 6 | Copyright (C) 1998-2003 Gilles Vollant 7 | (C) 2012-2014 Nathan Moinvaziri 8 | 9 | This program is distributed under the terms of the same license as zlib. 10 | See the accompanying LICENSE file for the full text of the license. 11 | */ 12 | 13 | #ifndef _IOAPI_BUF_H 14 | #define _IOAPI_BUF_H 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #include "zlib.h" 21 | #include "ioapi.h" 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | voidpf ZCALLBACK fopen_buf_func(voidpf opaque, const char* filename, int mode); 28 | voidpf ZCALLBACK fopen64_buf_func(voidpf opaque, const void* filename, int mode); 29 | voidpf ZCALLBACK fopendisk_buf_func(voidpf opaque, voidpf stream_cd, uint32_t number_disk, int mode); 30 | voidpf ZCALLBACK fopendisk64_buf_func(voidpf opaque, voidpf stream_cd, uint32_t number_disk, int mode); 31 | uint32_t ZCALLBACK fread_buf_func(voidpf opaque, voidpf stream, void* buf, uint32_t size); 32 | uint32_t ZCALLBACK fwrite_buf_func(voidpf opaque, voidpf stream, const void* buf, uint32_t size); 33 | long ZCALLBACK ftell_buf_func(voidpf opaque, voidpf stream); 34 | uint64_t ZCALLBACK ftell64_buf_func(voidpf opaque, voidpf stream); 35 | long ZCALLBACK fseek_buf_func(voidpf opaque, voidpf stream, uint32_t offset, int origin); 36 | long ZCALLBACK fseek64_buf_func(voidpf opaque, voidpf stream, uint64_t offset, int origin); 37 | int ZCALLBACK fclose_buf_func(voidpf opaque,voidpf stream); 38 | int ZCALLBACK ferror_buf_func(voidpf opaque,voidpf stream); 39 | 40 | typedef struct ourbuffer_s { 41 | zlib_filefunc_def filefunc; 42 | zlib_filefunc64_def filefunc64; 43 | } ourbuffer_t; 44 | 45 | void fill_buffer_filefunc(zlib_filefunc_def* pzlib_filefunc_def, ourbuffer_t *ourbuf); 46 | void fill_buffer_filefunc64(zlib_filefunc64_def* pzlib_filefunc_def, ourbuffer_t *ourbuf); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/ioapi_mem.c: -------------------------------------------------------------------------------- 1 | /* ioapi_mem.c -- IO base function header for compress/uncompress .zip 2 | files using zlib + zip or unzip API 3 | 4 | This version of ioapi is designed to access memory rather than files. 5 | We do use a region of memory to put data in to and take it out of. We do 6 | not have auto-extending buffers and do not inform anyone else that the 7 | data has been written. It is really intended for accessing a zip archive 8 | embedded in an application such that I can write an installer with no 9 | external files. Creation of archives has not been attempted, although 10 | parts of the framework are present. 11 | 12 | Based on Unzip ioapi.c version 0.22, May 19th, 2003 13 | 14 | Copyright (C) 1998-2003 Gilles Vollant 15 | (C) 2003 Justin Fletcher 16 | 17 | This file is under the same license as the Unzip tool it is distributed 18 | with. 19 | */ 20 | 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include "zlib.h" 27 | #include "ioapi.h" 28 | 29 | #include "ioapi_mem.h" 30 | 31 | #ifndef IOMEM_BUFFERSIZE 32 | # define IOMEM_BUFFERSIZE (UINT16_MAX) 33 | #endif 34 | 35 | voidpf ZCALLBACK fopen_mem_func(voidpf opaque, const char *filename, int mode) 36 | { 37 | ourmemory_t *mem = (ourmemory_t *)opaque; 38 | if (mem == NULL) 39 | return NULL; /* Mem structure passed in was null */ 40 | 41 | if (mode & ZLIB_FILEFUNC_MODE_CREATE) 42 | { 43 | if (mem->grow) 44 | { 45 | mem->size = IOMEM_BUFFERSIZE; 46 | mem->base = (char *)malloc(mem->size); 47 | } 48 | 49 | mem->limit = 0; /* When writing we start with 0 bytes written */ 50 | } 51 | else 52 | mem->limit = mem->size; 53 | 54 | mem->cur_offset = 0; 55 | 56 | return mem; 57 | } 58 | 59 | voidpf ZCALLBACK fopendisk_mem_func(voidpf opaque, voidpf stream, uint32_t number_disk, int mode) 60 | { 61 | /* Not used */ 62 | return NULL; 63 | } 64 | 65 | uint32_t ZCALLBACK fread_mem_func(voidpf opaque, voidpf stream, void *buf, uint32_t size) 66 | { 67 | ourmemory_t *mem = (ourmemory_t *)stream; 68 | 69 | if (size > mem->size - mem->cur_offset) 70 | size = mem->size - mem->cur_offset; 71 | 72 | memcpy(buf, mem->base + mem->cur_offset, size); 73 | mem->cur_offset += size; 74 | 75 | return size; 76 | } 77 | 78 | uint32_t ZCALLBACK fwrite_mem_func(voidpf opaque, voidpf stream, const void *buf, uint32_t size) 79 | { 80 | ourmemory_t *mem = (ourmemory_t *)stream; 81 | uint32_t newmemsize = 0; 82 | char *newbase = NULL; 83 | 84 | if (size > mem->size - mem->cur_offset) 85 | { 86 | if (mem->grow) 87 | { 88 | newmemsize = mem->size; 89 | if (size < IOMEM_BUFFERSIZE) 90 | newmemsize += IOMEM_BUFFERSIZE; 91 | else 92 | newmemsize += size; 93 | newbase = (char *)malloc(newmemsize); 94 | memcpy(newbase, mem->base, mem->size); 95 | free(mem->base); 96 | mem->base = newbase; 97 | mem->size = newmemsize; 98 | } 99 | else 100 | size = mem->size - mem->cur_offset; 101 | } 102 | memcpy(mem->base + mem->cur_offset, buf, size); 103 | mem->cur_offset += size; 104 | if (mem->cur_offset > mem->limit) 105 | mem->limit = mem->cur_offset; 106 | 107 | return size; 108 | } 109 | 110 | long ZCALLBACK ftell_mem_func(voidpf opaque, voidpf stream) 111 | { 112 | ourmemory_t *mem = (ourmemory_t *)stream; 113 | return mem->cur_offset; 114 | } 115 | 116 | long ZCALLBACK fseek_mem_func(voidpf opaque, voidpf stream, uint32_t offset, int origin) 117 | { 118 | ourmemory_t *mem = (ourmemory_t *)stream; 119 | uint32_t new_pos = 0; 120 | switch (origin) 121 | { 122 | case ZLIB_FILEFUNC_SEEK_CUR: 123 | new_pos = mem->cur_offset + offset; 124 | break; 125 | case ZLIB_FILEFUNC_SEEK_END: 126 | new_pos = mem->limit + offset; 127 | break; 128 | case ZLIB_FILEFUNC_SEEK_SET: 129 | new_pos = offset; 130 | break; 131 | default: 132 | return -1; 133 | } 134 | 135 | if (new_pos > mem->size) 136 | return 1; /* Failed to seek that far */ 137 | mem->cur_offset = new_pos; 138 | return 0; 139 | } 140 | 141 | int ZCALLBACK fclose_mem_func(voidpf opaque, voidpf stream) 142 | { 143 | /* Even with grow = 1, caller must always free() memory */ 144 | return 0; 145 | } 146 | 147 | int ZCALLBACK ferror_mem_func(voidpf opaque, voidpf stream) 148 | { 149 | /* We never return errors */ 150 | return 0; 151 | } 152 | 153 | void fill_memory_filefunc(zlib_filefunc_def *pzlib_filefunc_def, ourmemory_t *ourmem) 154 | { 155 | pzlib_filefunc_def->zopen_file = fopen_mem_func; 156 | pzlib_filefunc_def->zopendisk_file = fopendisk_mem_func; 157 | pzlib_filefunc_def->zread_file = fread_mem_func; 158 | pzlib_filefunc_def->zwrite_file = fwrite_mem_func; 159 | pzlib_filefunc_def->ztell_file = ftell_mem_func; 160 | pzlib_filefunc_def->zseek_file = fseek_mem_func; 161 | pzlib_filefunc_def->zclose_file = fclose_mem_func; 162 | pzlib_filefunc_def->zerror_file = ferror_mem_func; 163 | pzlib_filefunc_def->opaque = ourmem; 164 | } 165 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/ioapi_mem.h: -------------------------------------------------------------------------------- 1 | /* ioapi_mem.h -- IO base function header for compress/uncompress .zip 2 | files using zlib + zip or unzip API 3 | 4 | This version of ioapi is designed to access memory rather than files. 5 | We do use a region of memory to put data in to and take it out of. 6 | 7 | Copyright (C) 1998-2003 Gilles Vollant 8 | (C) 2003 Justin Fletcher 9 | 10 | This program is distributed under the terms of the same license as zlib. 11 | See the accompanying LICENSE file for the full text of the license. 12 | */ 13 | 14 | #ifndef _IOAPI_MEM_H 15 | #define _IOAPI_MEM_H 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #include "zlib.h" 22 | #include "ioapi.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | voidpf ZCALLBACK fopen_mem_func(voidpf opaque, const char* filename, int mode); 29 | voidpf ZCALLBACK fopendisk_mem_func(voidpf opaque, voidpf stream, uint32_t number_disk, int mode); 30 | uint32_t ZCALLBACK fread_mem_func(voidpf opaque, voidpf stream, void* buf, uint32_t size); 31 | uint32_t ZCALLBACK fwrite_mem_func(voidpf opaque, voidpf stream, const void* buf, uint32_t size); 32 | long ZCALLBACK ftell_mem_func(voidpf opaque, voidpf stream); 33 | long ZCALLBACK fseek_mem_func(voidpf opaque, voidpf stream, uint32_t offset, int origin); 34 | int ZCALLBACK fclose_mem_func(voidpf opaque, voidpf stream); 35 | int ZCALLBACK ferror_mem_func(voidpf opaque, voidpf stream); 36 | 37 | typedef struct ourmemory_s { 38 | char *base; /* Base of the region of memory we're using */ 39 | uint32_t size; /* Size of the region of memory we're using */ 40 | uint32_t limit; /* Furthest we've written */ 41 | uint32_t cur_offset; /* Current offset in the area */ 42 | int grow; /* Growable memory buffer */ 43 | } ourmemory_t; 44 | 45 | void fill_memory_filefunc(zlib_filefunc_def* pzlib_filefunc_def, ourmemory_t *ourmem); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/minishared.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "zlib.h" 10 | #include "ioapi.h" 11 | 12 | #ifdef _WIN32 13 | # include 14 | # include 15 | #else 16 | # include 17 | # include 18 | # include 19 | # include 20 | #endif 21 | 22 | #include "minishared.h" 23 | 24 | #ifdef _WIN32 25 | # define USEWIN32IOAPI 26 | # include "iowin32.h" 27 | #endif 28 | 29 | uint32_t get_file_date(const char *path, uint32_t *dos_date) 30 | { 31 | int ret = 0; 32 | #ifdef _WIN32 33 | FILETIME ftm_local; 34 | HANDLE find = NULL; 35 | WIN32_FIND_DATAA ff32; 36 | 37 | find = FindFirstFileA(path, &ff32); 38 | if (find != INVALID_HANDLE_VALUE) 39 | { 40 | FileTimeToLocalFileTime(&(ff32.ftLastWriteTime), &ftm_local); 41 | FileTimeToDosDateTime(&ftm_local, ((LPWORD)dos_date) + 1, ((LPWORD)dos_date) + 0); 42 | FindClose(find); 43 | ret = 1; 44 | } 45 | #else 46 | struct stat s = { 0 }; 47 | struct tm *filedate = NULL; 48 | time_t tm_t = 0; 49 | 50 | if (strcmp(path, "-") != 0) 51 | { 52 | size_t len = strlen(path); 53 | char *name = (char *)malloc(len + 1); 54 | strncpy(name, path, len + 1); 55 | name[len] = 0; 56 | if (name[len - 1] == '/') 57 | name[len - 1] = 0; 58 | 59 | /* not all systems allow stat'ing a file with / appended */ 60 | if (stat(name, &s) == 0) 61 | { 62 | tm_t = s.st_mtime; 63 | ret = 1; 64 | } 65 | free(name); 66 | } 67 | 68 | filedate = localtime(&tm_t); 69 | *dos_date = tm_to_dosdate(filedate); 70 | #endif 71 | return ret; 72 | } 73 | 74 | void change_file_date(const char *path, uint32_t dos_date) 75 | { 76 | #ifdef _WIN32 77 | HANDLE handle = NULL; 78 | FILETIME ftm, ftm_local, ftm_create, ftm_access, ftm_modified; 79 | 80 | handle = CreateFileA(path, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); 81 | if (handle != INVALID_HANDLE_VALUE) 82 | { 83 | GetFileTime(handle, &ftm_create, &ftm_access, &ftm_modified); 84 | DosDateTimeToFileTime((WORD)(dos_date >> 16), (WORD)dos_date, &ftm_local); 85 | LocalFileTimeToFileTime(&ftm_local, &ftm); 86 | SetFileTime(handle, &ftm, &ftm_access, &ftm); 87 | CloseHandle(handle); 88 | } 89 | #else 90 | struct utimbuf ut; 91 | struct tm newdate; 92 | 93 | dosdate_to_tm(dos_date, &newdate); 94 | 95 | ut.actime = ut.modtime = mktime(&newdate); 96 | utime(path, &ut); 97 | #endif 98 | } 99 | 100 | int dosdate_to_tm(uint64_t dos_date, struct tm *ptm) 101 | { 102 | uint64_t date = (uint64_t)(dos_date >> 16); 103 | 104 | ptm->tm_mday = (uint16_t)(date & 0x1f); 105 | ptm->tm_mon = (uint16_t)(((date & 0x1E0) / 0x20) - 1); 106 | ptm->tm_year = (uint16_t)(((date & 0x0FE00) / 0x0200) + 1980); 107 | ptm->tm_hour = (uint16_t)((dos_date & 0xF800) / 0x800); 108 | ptm->tm_min = (uint16_t)((dos_date & 0x7E0) / 0x20); 109 | ptm->tm_sec = (uint16_t)(2 * (dos_date & 0x1f)); 110 | ptm->tm_isdst = -1; 111 | 112 | #define datevalue_in_range(min, max, value) ((min) <= (value) && (value) <= (max)) 113 | if (!datevalue_in_range(0, 11, ptm->tm_mon) || 114 | !datevalue_in_range(1, 31, ptm->tm_mday) || 115 | !datevalue_in_range(0, 23, ptm->tm_hour) || 116 | !datevalue_in_range(0, 59, ptm->tm_min) || 117 | !datevalue_in_range(0, 59, ptm->tm_sec)) 118 | { 119 | /* Invalid date stored, so don't return it. */ 120 | memset(ptm, 0, sizeof(struct tm)); 121 | return -1; 122 | } 123 | #undef datevalue_in_range 124 | return 0; 125 | } 126 | 127 | uint32_t tm_to_dosdate(const struct tm *ptm) 128 | { 129 | uint32_t year = 0; 130 | 131 | #define datevalue_in_range(min, max, value) ((min) <= (value) && (value) <= (max)) 132 | /* Years supported: 133 | * [00, 79] (assumed to be between 2000 and 2079) 134 | * [80, 207] (assumed to be between 1980 and 2107, typical output of old 135 | software that does 'year-1900' to get a double digit year) 136 | * [1980, 2107] 137 | Due to the date format limitations, only years between 1980 and 2107 can be stored. 138 | */ 139 | if (!(datevalue_in_range(1980, 2107, ptm->tm_year) || datevalue_in_range(0, 207, ptm->tm_year)) || 140 | !datevalue_in_range(0, 11, ptm->tm_mon) || 141 | !datevalue_in_range(1, 31, ptm->tm_mday) || 142 | !datevalue_in_range(0, 23, ptm->tm_hour) || 143 | !datevalue_in_range(0, 59, ptm->tm_min) || 144 | !datevalue_in_range(0, 59, ptm->tm_sec)) 145 | { 146 | return 0; 147 | } 148 | #undef datevalue_in_range 149 | 150 | year = (uint32_t)ptm->tm_year; 151 | if (year >= 1980) /* range [1980, 2107] */ 152 | year -= 1980; 153 | else if (year >= 80) /* range [80, 99] */ 154 | year -= 80; 155 | else /* range [00, 79] */ 156 | year += 20; 157 | 158 | return (uint32_t)(((ptm->tm_mday) + (32 * (ptm->tm_mon + 1)) + (512 * year)) << 16) | 159 | ((ptm->tm_sec / 2) + (32 * ptm->tm_min) + (2048 * (uint32_t)ptm->tm_hour)); 160 | } 161 | 162 | int makedir(const char *newdir) 163 | { 164 | char *buffer = NULL; 165 | char *p = NULL; 166 | int len = (int)strlen(newdir); 167 | 168 | if (len <= 0) 169 | return 0; 170 | 171 | buffer = (char*)malloc(len + 1); 172 | if (buffer == NULL) 173 | { 174 | printf("Error allocating memory\n"); 175 | return -1; 176 | } 177 | 178 | strcpy(buffer, newdir); 179 | 180 | if (buffer[len - 1] == '/') 181 | buffer[len - 1] = 0; 182 | 183 | if (MKDIR(buffer) == 0) 184 | { 185 | free(buffer); 186 | return 1; 187 | } 188 | 189 | p = buffer + 1; 190 | while (1) 191 | { 192 | char hold; 193 | while (*p && *p != '\\' && *p != '/') 194 | p++; 195 | hold = *p; 196 | *p = 0; 197 | 198 | if ((MKDIR(buffer) == -1) && (errno == ENOENT)) 199 | { 200 | printf("couldn't create directory %s (%d)\n", buffer, errno); 201 | free(buffer); 202 | return 0; 203 | } 204 | 205 | if (hold == 0) 206 | break; 207 | 208 | *p++ = hold; 209 | } 210 | 211 | free(buffer); 212 | return 1; 213 | } 214 | 215 | int check_file_exists(const char *path) 216 | { 217 | FILE* handle = fopen64(path, "rb"); 218 | if (handle == NULL) 219 | return 0; 220 | fclose(handle); 221 | return 1; 222 | } 223 | 224 | int is_large_file(const char *path) 225 | { 226 | uint64_t pos = 0; 227 | FILE* handle = fopen64(path, "rb"); 228 | 229 | if (handle == NULL) 230 | return 0; 231 | 232 | fseeko64(handle, 0, SEEK_END); 233 | pos = ftello64(handle); 234 | fclose(handle); 235 | 236 | printf("file : %s is %lld bytes\n", path, pos); 237 | 238 | return (pos >= UINT32_MAX); 239 | } 240 | 241 | void display_zpos64(uint64_t n, int size_char) 242 | { 243 | /* To avoid compatibility problem we do here the conversion */ 244 | char number[21] = { 0 }; 245 | int offset = 19; 246 | int pos_string = 19; 247 | int size_display_string = 19; 248 | 249 | while (1) 250 | { 251 | number[offset] = (char)((n % 10) + '0'); 252 | if (number[offset] != '0') 253 | pos_string = offset; 254 | n /= 10; 255 | if (offset == 0) 256 | break; 257 | offset--; 258 | } 259 | 260 | size_display_string -= pos_string; 261 | while (size_char-- > size_display_string) 262 | printf(" "); 263 | printf("%s", &number[pos_string]); 264 | } 265 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/minishared.h: -------------------------------------------------------------------------------- 1 | #ifndef _MINISHARED_H 2 | #define _MINISHARED_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #ifdef _WIN32 9 | # define MKDIR(d) _mkdir(d) 10 | # define CHDIR(d) _chdir(d) 11 | #else 12 | # define MKDIR(d) mkdir(d, 0775) 13 | # define CHDIR(d) chdir(d) 14 | #endif 15 | 16 | /***************************************************************************/ 17 | 18 | /* Get a file's date and time in dos format */ 19 | uint32_t get_file_date(const char *path, uint32_t *dos_date); 20 | 21 | /* Sets a file's date and time in dos format */ 22 | void change_file_date(const char *path, uint32_t dos_date); 23 | 24 | /* Convert dos date/time format to struct tm */ 25 | int dosdate_to_tm(uint64_t dos_date, struct tm *ptm); 26 | 27 | /* Convert struct tm to dos date/time format */ 28 | uint32_t tm_to_dosdate(const struct tm *ptm); 29 | 30 | /* Create a directory and all subdirectories */ 31 | int makedir(const char *newdir); 32 | 33 | /* Check to see if a file exists */ 34 | int check_file_exists(const char *path); 35 | 36 | /* Check to see if a file is over 4GB and needs ZIP64 extension */ 37 | int is_large_file(const char *path); 38 | 39 | /* Print a 64-bit number for compatibility */ 40 | void display_zpos64(uint64_t n, int size_char); 41 | 42 | /***************************************************************************/ 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif /* _MINISHARED_H */ -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool-ipatoolTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool-ipatoolTests/Pods-ipatool-ipatoolTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SSZipArchive 5 | 6 | Copyright (c) 2010-2015, Sam Soffes, http://soff.es 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | "Software"), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | 27 | Generated by CocoaPods - https://cocoapods.org 28 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool-ipatoolTests/Pods-ipatool-ipatoolTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2010-2015, Sam Soffes, http://soff.es 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining 20 | a copy of this software and associated documentation files (the 21 | "Software"), to deal in the Software without restriction, including 22 | without limitation the rights to use, copy, modify, merge, publish, 23 | distribute, sublicense, and/or sell copies of the Software, and to 24 | permit persons to whom the Software is furnished to do so, subject to 25 | the following conditions: 26 | 27 | The above copyright notice and this permission notice shall be 28 | included in all copies or substantial portions of the Software. 29 | 30 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 31 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 32 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 33 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 34 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 35 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 36 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 37 | 38 | License 39 | MIT 40 | Title 41 | SSZipArchive 42 | Type 43 | PSGroupSpecifier 44 | 45 | 46 | FooterText 47 | Generated by CocoaPods - https://cocoapods.org 48 | Title 49 | 50 | Type 51 | PSGroupSpecifier 52 | 53 | 54 | StringsTable 55 | Acknowledgements 56 | Title 57 | Acknowledgements 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool-ipatoolTests/Pods-ipatool-ipatoolTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ipatool_ipatoolTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ipatool_ipatoolTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool-ipatoolTests/Pods-ipatool-ipatoolTests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 10 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 11 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 12 | 13 | install_framework() 14 | { 15 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 16 | local source="${BUILT_PRODUCTS_DIR}/$1" 17 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 18 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 19 | elif [ -r "$1" ]; then 20 | local source="$1" 21 | fi 22 | 23 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | 25 | if [ -L "${source}" ]; then 26 | echo "Symlinked..." 27 | source="$(readlink "${source}")" 28 | fi 29 | 30 | # Use filter instead of exclude so missing patterns don't throw errors. 31 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 32 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 33 | 34 | local basename 35 | basename="$(basename -s .framework "$1")" 36 | binary="${destination}/${basename}.framework/${basename}" 37 | if ! [ -r "$binary" ]; then 38 | binary="${destination}/${basename}" 39 | fi 40 | 41 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 42 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 43 | strip_invalid_archs "$binary" 44 | fi 45 | 46 | # Resign the code if required by the build settings to avoid unstable apps 47 | code_sign_if_enabled "${destination}/$(basename "$1")" 48 | 49 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 50 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 51 | local swift_runtime_libs 52 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 53 | for lib in $swift_runtime_libs; do 54 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 55 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 56 | code_sign_if_enabled "${destination}/${lib}" 57 | done 58 | fi 59 | } 60 | 61 | # Copies the dSYM of a vendored framework 62 | install_dsym() { 63 | local source="$1" 64 | if [ -r "$source" ]; then 65 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" 66 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" 67 | fi 68 | } 69 | 70 | # Signs a framework with the provided identity 71 | code_sign_if_enabled() { 72 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 73 | # Use the current code_sign_identitiy 74 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 75 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 76 | 77 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 78 | code_sign_cmd="$code_sign_cmd &" 79 | fi 80 | echo "$code_sign_cmd" 81 | eval "$code_sign_cmd" 82 | fi 83 | } 84 | 85 | # Strip invalid architectures 86 | strip_invalid_archs() { 87 | binary="$1" 88 | # Get architectures for current file 89 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 90 | stripped="" 91 | for arch in $archs; do 92 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 93 | # Strip non-valid architectures in-place 94 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 95 | stripped="$stripped $arch" 96 | fi 97 | done 98 | if [[ "$stripped" ]]; then 99 | echo "Stripped $binary of architectures:$stripped" 100 | fi 101 | } 102 | 103 | 104 | if [[ "$CONFIGURATION" == "Debug" ]]; then 105 | install_framework "${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework" 106 | fi 107 | if [[ "$CONFIGURATION" == "Release" ]]; then 108 | install_framework "${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework" 109 | fi 110 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 111 | wait 112 | fi 113 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool-ipatoolTests/Pods-ipatool-ipatoolTests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 12 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 13 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 14 | 15 | case "${TARGETED_DEVICE_FAMILY}" in 16 | 1,2) 17 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 18 | ;; 19 | 1) 20 | TARGET_DEVICE_ARGS="--target-device iphone" 21 | ;; 22 | 2) 23 | TARGET_DEVICE_ARGS="--target-device ipad" 24 | ;; 25 | 3) 26 | TARGET_DEVICE_ARGS="--target-device tv" 27 | ;; 28 | 4) 29 | TARGET_DEVICE_ARGS="--target-device watch" 30 | ;; 31 | *) 32 | TARGET_DEVICE_ARGS="--target-device mac" 33 | ;; 34 | esac 35 | 36 | install_resource() 37 | { 38 | if [[ "$1" = /* ]] ; then 39 | RESOURCE_PATH="$1" 40 | else 41 | RESOURCE_PATH="${PODS_ROOT}/$1" 42 | fi 43 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 44 | cat << EOM 45 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 46 | EOM 47 | exit 1 48 | fi 49 | case $RESOURCE_PATH in 50 | *.storyboard) 51 | echo "ibtool --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 52 | ibtool --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.xib) 55 | echo "ibtool --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 56 | ibtool --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 57 | ;; 58 | *.framework) 59 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 60 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 61 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 62 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 63 | ;; 64 | *.xcdatamodel) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 67 | ;; 68 | *.xcdatamodeld) 69 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 70 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 71 | ;; 72 | *.xcmappingmodel) 73 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 74 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 75 | ;; 76 | *.xcassets) 77 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 78 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 79 | ;; 80 | *) 81 | echo "$RESOURCE_PATH" || true 82 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 83 | ;; 84 | esac 85 | } 86 | 87 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 89 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 90 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 91 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 92 | fi 93 | rm -f "$RESOURCES_TO_COPY" 94 | 95 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 96 | then 97 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 98 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 99 | while read line; do 100 | if [[ $line != "${PODS_ROOT}*" ]]; then 101 | XCASSET_FILES+=("$line") 102 | fi 103 | done <<<"$OTHER_XCASSETS" 104 | 105 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 106 | fi 107 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool-ipatoolTests/Pods-ipatool-ipatoolTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_ipatool_ipatoolTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ipatool_ipatoolTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool-ipatoolTests/Pods-ipatool-ipatoolTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SSZipArchive" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/../Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SSZipArchive/SSZipArchive.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "SSZipArchive" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool-ipatoolTests/Pods-ipatool-ipatoolTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_ipatool_ipatoolTests { 2 | umbrella header "Pods-ipatool-ipatoolTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool-ipatoolTests/Pods-ipatool-ipatoolTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SSZipArchive" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/../Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SSZipArchive/SSZipArchive.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "SSZipArchive" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool/Pods-ipatool-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SSZipArchive 5 | 6 | Copyright (c) 2010-2015, Sam Soffes, http://soff.es 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | "Software"), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | 27 | Generated by CocoaPods - https://cocoapods.org 28 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool/Pods-ipatool-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2010-2015, Sam Soffes, http://soff.es 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining 20 | a copy of this software and associated documentation files (the 21 | "Software"), to deal in the Software without restriction, including 22 | without limitation the rights to use, copy, modify, merge, publish, 23 | distribute, sublicense, and/or sell copies of the Software, and to 24 | permit persons to whom the Software is furnished to do so, subject to 25 | the following conditions: 26 | 27 | The above copyright notice and this permission notice shall be 28 | included in all copies or substantial portions of the Software. 29 | 30 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 31 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 32 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 33 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 34 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 35 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 36 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 37 | 38 | License 39 | MIT 40 | Title 41 | SSZipArchive 42 | Type 43 | PSGroupSpecifier 44 | 45 | 46 | FooterText 47 | Generated by CocoaPods - https://cocoapods.org 48 | Title 49 | 50 | Type 51 | PSGroupSpecifier 52 | 53 | 54 | StringsTable 55 | Acknowledgements 56 | Title 57 | Acknowledgements 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool/Pods-ipatool-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ipatool : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ipatool 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool/Pods-ipatool-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 10 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 11 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 12 | 13 | install_framework() 14 | { 15 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 16 | local source="${BUILT_PRODUCTS_DIR}/$1" 17 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 18 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 19 | elif [ -r "$1" ]; then 20 | local source="$1" 21 | fi 22 | 23 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | 25 | if [ -L "${source}" ]; then 26 | echo "Symlinked..." 27 | source="$(readlink "${source}")" 28 | fi 29 | 30 | # Use filter instead of exclude so missing patterns don't throw errors. 31 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 32 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 33 | 34 | local basename 35 | basename="$(basename -s .framework "$1")" 36 | binary="${destination}/${basename}.framework/${basename}" 37 | if ! [ -r "$binary" ]; then 38 | binary="${destination}/${basename}" 39 | fi 40 | 41 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 42 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 43 | strip_invalid_archs "$binary" 44 | fi 45 | 46 | # Resign the code if required by the build settings to avoid unstable apps 47 | code_sign_if_enabled "${destination}/$(basename "$1")" 48 | 49 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 50 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 51 | local swift_runtime_libs 52 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 53 | for lib in $swift_runtime_libs; do 54 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 55 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 56 | code_sign_if_enabled "${destination}/${lib}" 57 | done 58 | fi 59 | } 60 | 61 | # Copies the dSYM of a vendored framework 62 | install_dsym() { 63 | local source="$1" 64 | if [ -r "$source" ]; then 65 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" 66 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" 67 | fi 68 | } 69 | 70 | # Signs a framework with the provided identity 71 | code_sign_if_enabled() { 72 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 73 | # Use the current code_sign_identitiy 74 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 75 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 76 | 77 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 78 | code_sign_cmd="$code_sign_cmd &" 79 | fi 80 | echo "$code_sign_cmd" 81 | eval "$code_sign_cmd" 82 | fi 83 | } 84 | 85 | # Strip invalid architectures 86 | strip_invalid_archs() { 87 | binary="$1" 88 | # Get architectures for current file 89 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 90 | stripped="" 91 | for arch in $archs; do 92 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 93 | # Strip non-valid architectures in-place 94 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 95 | stripped="$stripped $arch" 96 | fi 97 | done 98 | if [[ "$stripped" ]]; then 99 | echo "Stripped $binary of architectures:$stripped" 100 | fi 101 | } 102 | 103 | 104 | if [[ "$CONFIGURATION" == "Debug" ]]; then 105 | install_framework "${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework" 106 | fi 107 | if [[ "$CONFIGURATION" == "Release" ]]; then 108 | install_framework "${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework" 109 | fi 110 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 111 | wait 112 | fi 113 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool/Pods-ipatool-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 12 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 13 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 14 | 15 | case "${TARGETED_DEVICE_FAMILY}" in 16 | 1,2) 17 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 18 | ;; 19 | 1) 20 | TARGET_DEVICE_ARGS="--target-device iphone" 21 | ;; 22 | 2) 23 | TARGET_DEVICE_ARGS="--target-device ipad" 24 | ;; 25 | 3) 26 | TARGET_DEVICE_ARGS="--target-device tv" 27 | ;; 28 | 4) 29 | TARGET_DEVICE_ARGS="--target-device watch" 30 | ;; 31 | *) 32 | TARGET_DEVICE_ARGS="--target-device mac" 33 | ;; 34 | esac 35 | 36 | install_resource() 37 | { 38 | if [[ "$1" = /* ]] ; then 39 | RESOURCE_PATH="$1" 40 | else 41 | RESOURCE_PATH="${PODS_ROOT}/$1" 42 | fi 43 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 44 | cat << EOM 45 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 46 | EOM 47 | exit 1 48 | fi 49 | case $RESOURCE_PATH in 50 | *.storyboard) 51 | echo "ibtool --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 52 | ibtool --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.xib) 55 | echo "ibtool --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 56 | ibtool --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 57 | ;; 58 | *.framework) 59 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 60 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 61 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 62 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 63 | ;; 64 | *.xcdatamodel) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 67 | ;; 68 | *.xcdatamodeld) 69 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 70 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 71 | ;; 72 | *.xcmappingmodel) 73 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 74 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 75 | ;; 76 | *.xcassets) 77 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 78 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 79 | ;; 80 | *) 81 | echo "$RESOURCE_PATH" || true 82 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 83 | ;; 84 | esac 85 | } 86 | 87 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 89 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 90 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 91 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 92 | fi 93 | rm -f "$RESOURCES_TO_COPY" 94 | 95 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 96 | then 97 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 98 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 99 | while read line; do 100 | if [[ $line != "${PODS_ROOT}*" ]]; then 101 | XCASSET_FILES+=("$line") 102 | fi 103 | done <<<"$OTHER_XCASSETS" 104 | 105 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 106 | fi 107 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool/Pods-ipatool-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_ipatoolVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ipatoolVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool/Pods-ipatool.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SSZipArchive" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SSZipArchive/SSZipArchive.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "SSZipArchive" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool/Pods-ipatool.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_ipatool { 2 | umbrella header "Pods-ipatool-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ipatool/Pods-ipatool.release.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SSZipArchive" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SSZipArchive/SSZipArchive.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "SSZipArchive" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SSZipArchive/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.0.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SSZipArchive/SSZipArchive-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SSZipArchive : NSObject 3 | @end 4 | @implementation PodsDummy_SSZipArchive 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SSZipArchive/SSZipArchive-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SSZipArchive/SSZipArchive-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "SSZipArchive.h" 14 | #import "SSZipCommon.h" 15 | #import "ZipArchive.h" 16 | 17 | FOUNDATION_EXPORT double SSZipArchiveVersionNumber; 18 | FOUNDATION_EXPORT const unsigned char SSZipArchiveVersionString[]; 19 | 20 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SSZipArchive/SSZipArchive.modulemap: -------------------------------------------------------------------------------- 1 | framework module SSZipArchive { 2 | umbrella header "SSZipArchive-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SSZipArchive/SSZipArchive.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SSZipArchive 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 5 | OTHER_LDFLAGS = -l"z" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SSZipArchive 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > I'm archiving this repo. After all these years this is probably not the best way to do 2 | > things anymore. If you disagree I'd be happy to put a link to your fork here. 3 | 4 | ipatool 5 | ======= 6 | 7 | Quick Start 8 | ----------- 9 | 10 | 1. Download and extract latest release sources (or clone master) 11 | 2. Inside the source folder, run the shell script `./buildAndInstall.sh` 12 | 13 | This will install ipatool in `/usr/local/bin`. You can easily customize the installation 14 | location by editing the script. 15 | 16 | You can now run it by executing `/usr/local/bin/ipatool`. See below for details on 17 | command line options. 18 | 19 | Introduction 20 | ------------ 21 | Command line utility to query iOS IPA files and to resign an IPA with a new provisioning 22 | profile (and optionally a new bundle identifier). Sample use cases: 23 | 24 | * Check expiration of enterprise-signed IPAs so that you know when you have to ship 25 | new releases to your customers. 26 | * Resign enterprise-signed IPA that has expired with a new provisioning profile. 27 | * Resign appstore-signed IPA with enterprise provisioning profile, so that you can 28 | test the actual binary that you will upload to Apple. 29 | 30 | Since this is a command line utility, you can of course use it in continuous integration 31 | setups such as Jenkins etc. 32 | 33 | Query IPA files 34 | --------------- 35 | Invocation: `ipatool myapp.ipa` 36 | 37 | Sample output: 38 |
39 |   App name:            My App.app
40 |   Display name:        My App
41 |   Version:             1.0
42 |   Build:               21
43 |   Bundle identifier:   com.example.myapp
44 |   Code sign authority: iPhone Distribution: Example Inc.
45 |   Minimum OS version:  6.0
46 |   Device family:       iphone ipad 
47 | 
48 | Provisioning:
49 |   Name:                My App - AppStore
50 |   Expiration:          Fri Dec 11 10:22:40 CET 2013
51 |   App ID name:         My App
52 |   Team:                Example Team
53 | 
54 | 55 | Resign IPA files 56 | ---------------- 57 | Invocation: `ipatool myapp.ipa resign enterpriseprof.mobileprovision com.example.enterprise.myapp` 58 | 59 | This invocation will resign the IPA using the provisioning profile found in 60 | `enterpriseprof.mobileprovision`. In the process, it will change the bundle identifier 61 | to `com.example.enterprise.myapp`. 62 | 63 | Note for Developers 64 | =================== 65 | The unit tests work on an actual ipa that is also part of this project. It is built using 66 | a shell script build phase in the `ipatoolTests` target. This means that it will be 67 | code-signed using your own certificate and provisioning profile. 68 | 69 | The tests check whether the code signing that this `SampleApp.ipa` has matches what is 70 | expected. Since this will be different for everybody, the expected values are put in 71 | `testConfig.json`. In order for the tests to pass, you will have to modify 72 | `testConfig.json` so that it contains the values that are valid for you. 73 | 74 | Wiki 75 | ==== 76 | Please refer to the wiki for more information on [Managing Archives and Code Signing with 77 | xcodebuild](https://github.com/svdo/ipatool/wiki/Managing-Archives-and-Code-Signing-with-xodebuild). 78 | 79 | TODO 80 | ==== 81 | * Use `IPT` class prefix everywhere instead of `IT`. 82 | -------------------------------------------------------------------------------- /SampleApp/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SampleApp 4 | // 5 | // Created by Stefan on 28/11/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /SampleApp/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /SampleApp/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /SampleApp/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /SampleApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Sample! 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | com.vandenoord.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /SampleApp/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SampleApp 4 | // 5 | // Created by Stefan on 28/11/14. 6 | // Copyright (c) 2014 Stefan van den Oord. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /buildAndInstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export DSTROOT= 4 | xcodebuild -workspace ipatool.xcworkspace -scheme ipatool -configuration Release install 5 | if [ -d "$DSTROOT/tmp/ipatool.dst" ]; then 6 | echo "Copy $DSTROOT/tmp/ipatool.dst/usr/local/bin/ipatool to $DSTROOT/usr/local/bin/ipatool" 7 | ditto "$DSTROOT/tmp/ipatool.dst/usr/local/bin/ipatool" "$DSTROOT/usr/local/bin/ipatool" 8 | fi 9 | 10 | echo 11 | echo "Installed ipatool in $DSTROOT/usr/local/bin" 12 | -------------------------------------------------------------------------------- /ipatool-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import 2 | -------------------------------------------------------------------------------- /ipatool.xcodeproj/xcshareddata/xcschemes/SampleApp.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /ipatool.xcodeproj/xcshareddata/xcschemes/ipatool.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 68 | 69 | 72 | 73 | 76 | 77 | 80 | 81 | 84 | 85 | 88 | 89 | 92 | 93 | 94 | 95 | 96 | 97 | 103 | 105 | 111 | 112 | 113 | 114 | 116 | 117 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /ipatool.xcodeproj/xcshareddata/xcschemes/ipatoolTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /ipatool.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | --------------------------------------------------------------------------------