├── .gitignore ├── Keychain34018.xcodeproj └── project.pbxproj ├── Keychain34018 ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── JNKeychain.h ├── JNKeychain.m ├── ViewController.h ├── ViewController.m └── main.m ├── Keychain34018Tests ├── Info.plist └── Keychain34018Tests.m ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | # Pods/ 27 | -------------------------------------------------------------------------------- /Keychain34018.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D827CC0419F00749001D230C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D827CC0319F00749001D230C /* main.m */; }; 11 | D827CC0719F00749001D230C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D827CC0619F00749001D230C /* AppDelegate.m */; }; 12 | D827CC0A19F00749001D230C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D827CC0919F00749001D230C /* ViewController.m */; }; 13 | D827CC0D19F00749001D230C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D827CC0B19F00749001D230C /* Main.storyboard */; }; 14 | D827CC0F19F00749001D230C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D827CC0E19F00749001D230C /* Images.xcassets */; }; 15 | D827CC1219F00749001D230C /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = D827CC1019F00749001D230C /* LaunchScreen.xib */; }; 16 | D827CC1E19F00749001D230C /* Keychain34018Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = D827CC1D19F00749001D230C /* Keychain34018Tests.m */; }; 17 | D827CC2819F008A6001D230C /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D827CC2719F008A6001D230C /* Security.framework */; }; 18 | D827CC2B19F008C1001D230C /* JNKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = D827CC2A19F008C1001D230C /* JNKeychain.m */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | D827CC1819F00749001D230C /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = D827CBF619F00749001D230C /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = D827CBFD19F00749001D230C; 27 | remoteInfo = Keychain34018; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | D827CBFE19F00749001D230C /* Keychain34018.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Keychain34018.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | D827CC0219F00749001D230C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | D827CC0319F00749001D230C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 35 | D827CC0519F00749001D230C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 36 | D827CC0619F00749001D230C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 37 | D827CC0819F00749001D230C /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 38 | D827CC0919F00749001D230C /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 39 | D827CC0C19F00749001D230C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 40 | D827CC0E19F00749001D230C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 41 | D827CC1119F00749001D230C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 42 | D827CC1719F00749001D230C /* Keychain34018Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Keychain34018Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | D827CC1C19F00749001D230C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | D827CC1D19F00749001D230C /* Keychain34018Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Keychain34018Tests.m; sourceTree = ""; }; 45 | D827CC2719F008A6001D230C /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 46 | D827CC2919F008C1001D230C /* JNKeychain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JNKeychain.h; sourceTree = ""; }; 47 | D827CC2A19F008C1001D230C /* JNKeychain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JNKeychain.m; sourceTree = ""; }; 48 | /* End PBXFileReference section */ 49 | 50 | /* Begin PBXFrameworksBuildPhase section */ 51 | D827CBFB19F00749001D230C /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | D827CC2819F008A6001D230C /* Security.framework in Frameworks */, 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | D827CC1419F00749001D230C /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | D827CBF519F00749001D230C = { 70 | isa = PBXGroup; 71 | children = ( 72 | D827CC2719F008A6001D230C /* Security.framework */, 73 | D827CC0019F00749001D230C /* Keychain34018 */, 74 | D827CC1A19F00749001D230C /* Keychain34018Tests */, 75 | D827CBFF19F00749001D230C /* Products */, 76 | ); 77 | sourceTree = ""; 78 | }; 79 | D827CBFF19F00749001D230C /* Products */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | D827CBFE19F00749001D230C /* Keychain34018.app */, 83 | D827CC1719F00749001D230C /* Keychain34018Tests.xctest */, 84 | ); 85 | name = Products; 86 | sourceTree = ""; 87 | }; 88 | D827CC0019F00749001D230C /* Keychain34018 */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | D827CC0519F00749001D230C /* AppDelegate.h */, 92 | D827CC0619F00749001D230C /* AppDelegate.m */, 93 | D827CC0819F00749001D230C /* ViewController.h */, 94 | D827CC0919F00749001D230C /* ViewController.m */, 95 | D827CC0B19F00749001D230C /* Main.storyboard */, 96 | D827CC0E19F00749001D230C /* Images.xcassets */, 97 | D827CC1019F00749001D230C /* LaunchScreen.xib */, 98 | D827CC2919F008C1001D230C /* JNKeychain.h */, 99 | D827CC2A19F008C1001D230C /* JNKeychain.m */, 100 | D827CC0119F00749001D230C /* Supporting Files */, 101 | ); 102 | path = Keychain34018; 103 | sourceTree = ""; 104 | }; 105 | D827CC0119F00749001D230C /* Supporting Files */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | D827CC0219F00749001D230C /* Info.plist */, 109 | D827CC0319F00749001D230C /* main.m */, 110 | ); 111 | name = "Supporting Files"; 112 | sourceTree = ""; 113 | }; 114 | D827CC1A19F00749001D230C /* Keychain34018Tests */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | D827CC1D19F00749001D230C /* Keychain34018Tests.m */, 118 | D827CC1B19F00749001D230C /* Supporting Files */, 119 | ); 120 | path = Keychain34018Tests; 121 | sourceTree = ""; 122 | }; 123 | D827CC1B19F00749001D230C /* Supporting Files */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | D827CC1C19F00749001D230C /* Info.plist */, 127 | ); 128 | name = "Supporting Files"; 129 | sourceTree = ""; 130 | }; 131 | /* End PBXGroup section */ 132 | 133 | /* Begin PBXNativeTarget section */ 134 | D827CBFD19F00749001D230C /* Keychain34018 */ = { 135 | isa = PBXNativeTarget; 136 | buildConfigurationList = D827CC2119F00749001D230C /* Build configuration list for PBXNativeTarget "Keychain34018" */; 137 | buildPhases = ( 138 | D827CBFA19F00749001D230C /* Sources */, 139 | D827CBFB19F00749001D230C /* Frameworks */, 140 | D827CBFC19F00749001D230C /* Resources */, 141 | ); 142 | buildRules = ( 143 | ); 144 | dependencies = ( 145 | ); 146 | name = Keychain34018; 147 | productName = Keychain34018; 148 | productReference = D827CBFE19F00749001D230C /* Keychain34018.app */; 149 | productType = "com.apple.product-type.application"; 150 | }; 151 | D827CC1619F00749001D230C /* Keychain34018Tests */ = { 152 | isa = PBXNativeTarget; 153 | buildConfigurationList = D827CC2419F00749001D230C /* Build configuration list for PBXNativeTarget "Keychain34018Tests" */; 154 | buildPhases = ( 155 | D827CC1319F00749001D230C /* Sources */, 156 | D827CC1419F00749001D230C /* Frameworks */, 157 | D827CC1519F00749001D230C /* Resources */, 158 | ); 159 | buildRules = ( 160 | ); 161 | dependencies = ( 162 | D827CC1919F00749001D230C /* PBXTargetDependency */, 163 | ); 164 | name = Keychain34018Tests; 165 | productName = Keychain34018Tests; 166 | productReference = D827CC1719F00749001D230C /* Keychain34018Tests.xctest */; 167 | productType = "com.apple.product-type.bundle.unit-test"; 168 | }; 169 | /* End PBXNativeTarget section */ 170 | 171 | /* Begin PBXProject section */ 172 | D827CBF619F00749001D230C /* Project object */ = { 173 | isa = PBXProject; 174 | attributes = { 175 | LastUpgradeCheck = 0600; 176 | ORGANIZATIONNAME = "ExpeData LLC"; 177 | TargetAttributes = { 178 | D827CBFD19F00749001D230C = { 179 | CreatedOnToolsVersion = 6.0.1; 180 | DevelopmentTeam = 5WULP26L75; 181 | }; 182 | D827CC1619F00749001D230C = { 183 | CreatedOnToolsVersion = 6.0.1; 184 | TestTargetID = D827CBFD19F00749001D230C; 185 | }; 186 | }; 187 | }; 188 | buildConfigurationList = D827CBF919F00749001D230C /* Build configuration list for PBXProject "Keychain34018" */; 189 | compatibilityVersion = "Xcode 3.2"; 190 | developmentRegion = English; 191 | hasScannedForEncodings = 0; 192 | knownRegions = ( 193 | en, 194 | Base, 195 | ); 196 | mainGroup = D827CBF519F00749001D230C; 197 | productRefGroup = D827CBFF19F00749001D230C /* Products */; 198 | projectDirPath = ""; 199 | projectRoot = ""; 200 | targets = ( 201 | D827CBFD19F00749001D230C /* Keychain34018 */, 202 | D827CC1619F00749001D230C /* Keychain34018Tests */, 203 | ); 204 | }; 205 | /* End PBXProject section */ 206 | 207 | /* Begin PBXResourcesBuildPhase section */ 208 | D827CBFC19F00749001D230C /* Resources */ = { 209 | isa = PBXResourcesBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | D827CC0D19F00749001D230C /* Main.storyboard in Resources */, 213 | D827CC1219F00749001D230C /* LaunchScreen.xib in Resources */, 214 | D827CC0F19F00749001D230C /* Images.xcassets in Resources */, 215 | ); 216 | runOnlyForDeploymentPostprocessing = 0; 217 | }; 218 | D827CC1519F00749001D230C /* Resources */ = { 219 | isa = PBXResourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | ); 223 | runOnlyForDeploymentPostprocessing = 0; 224 | }; 225 | /* End PBXResourcesBuildPhase section */ 226 | 227 | /* Begin PBXSourcesBuildPhase section */ 228 | D827CBFA19F00749001D230C /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | D827CC0A19F00749001D230C /* ViewController.m in Sources */, 233 | D827CC0719F00749001D230C /* AppDelegate.m in Sources */, 234 | D827CC0419F00749001D230C /* main.m in Sources */, 235 | D827CC2B19F008C1001D230C /* JNKeychain.m in Sources */, 236 | ); 237 | runOnlyForDeploymentPostprocessing = 0; 238 | }; 239 | D827CC1319F00749001D230C /* Sources */ = { 240 | isa = PBXSourcesBuildPhase; 241 | buildActionMask = 2147483647; 242 | files = ( 243 | D827CC1E19F00749001D230C /* Keychain34018Tests.m in Sources */, 244 | ); 245 | runOnlyForDeploymentPostprocessing = 0; 246 | }; 247 | /* End PBXSourcesBuildPhase section */ 248 | 249 | /* Begin PBXTargetDependency section */ 250 | D827CC1919F00749001D230C /* PBXTargetDependency */ = { 251 | isa = PBXTargetDependency; 252 | target = D827CBFD19F00749001D230C /* Keychain34018 */; 253 | targetProxy = D827CC1819F00749001D230C /* PBXContainerItemProxy */; 254 | }; 255 | /* End PBXTargetDependency section */ 256 | 257 | /* Begin PBXVariantGroup section */ 258 | D827CC0B19F00749001D230C /* Main.storyboard */ = { 259 | isa = PBXVariantGroup; 260 | children = ( 261 | D827CC0C19F00749001D230C /* Base */, 262 | ); 263 | name = Main.storyboard; 264 | sourceTree = ""; 265 | }; 266 | D827CC1019F00749001D230C /* LaunchScreen.xib */ = { 267 | isa = PBXVariantGroup; 268 | children = ( 269 | D827CC1119F00749001D230C /* Base */, 270 | ); 271 | name = LaunchScreen.xib; 272 | sourceTree = ""; 273 | }; 274 | /* End PBXVariantGroup section */ 275 | 276 | /* Begin XCBuildConfiguration section */ 277 | D827CC1F19F00749001D230C /* Debug */ = { 278 | isa = XCBuildConfiguration; 279 | buildSettings = { 280 | ALWAYS_SEARCH_USER_PATHS = NO; 281 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 282 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 283 | CLANG_CXX_LIBRARY = "libc++"; 284 | CLANG_ENABLE_MODULES = YES; 285 | CLANG_ENABLE_OBJC_ARC = YES; 286 | CLANG_WARN_BOOL_CONVERSION = YES; 287 | CLANG_WARN_CONSTANT_CONVERSION = YES; 288 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 289 | CLANG_WARN_EMPTY_BODY = YES; 290 | CLANG_WARN_ENUM_CONVERSION = YES; 291 | CLANG_WARN_INT_CONVERSION = YES; 292 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 293 | CLANG_WARN_UNREACHABLE_CODE = YES; 294 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 295 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 296 | COPY_PHASE_STRIP = NO; 297 | ENABLE_STRICT_OBJC_MSGSEND = YES; 298 | GCC_C_LANGUAGE_STANDARD = gnu99; 299 | GCC_DYNAMIC_NO_PIC = NO; 300 | GCC_OPTIMIZATION_LEVEL = 0; 301 | GCC_PREPROCESSOR_DEFINITIONS = ( 302 | "DEBUG=1", 303 | "$(inherited)", 304 | ); 305 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 306 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 307 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 308 | GCC_WARN_UNDECLARED_SELECTOR = YES; 309 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 310 | GCC_WARN_UNUSED_FUNCTION = YES; 311 | GCC_WARN_UNUSED_VARIABLE = YES; 312 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 313 | MTL_ENABLE_DEBUG_INFO = YES; 314 | ONLY_ACTIVE_ARCH = YES; 315 | SDKROOT = iphoneos; 316 | TARGETED_DEVICE_FAMILY = "1,2"; 317 | }; 318 | name = Debug; 319 | }; 320 | D827CC2019F00749001D230C /* Release */ = { 321 | isa = XCBuildConfiguration; 322 | buildSettings = { 323 | ALWAYS_SEARCH_USER_PATHS = NO; 324 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 325 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 326 | CLANG_CXX_LIBRARY = "libc++"; 327 | CLANG_ENABLE_MODULES = YES; 328 | CLANG_ENABLE_OBJC_ARC = YES; 329 | CLANG_WARN_BOOL_CONVERSION = YES; 330 | CLANG_WARN_CONSTANT_CONVERSION = YES; 331 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 332 | CLANG_WARN_EMPTY_BODY = YES; 333 | CLANG_WARN_ENUM_CONVERSION = YES; 334 | CLANG_WARN_INT_CONVERSION = YES; 335 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 336 | CLANG_WARN_UNREACHABLE_CODE = YES; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 339 | COPY_PHASE_STRIP = YES; 340 | ENABLE_NS_ASSERTIONS = NO; 341 | ENABLE_STRICT_OBJC_MSGSEND = YES; 342 | GCC_C_LANGUAGE_STANDARD = gnu99; 343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 345 | GCC_WARN_UNDECLARED_SELECTOR = YES; 346 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 347 | GCC_WARN_UNUSED_FUNCTION = YES; 348 | GCC_WARN_UNUSED_VARIABLE = YES; 349 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 350 | MTL_ENABLE_DEBUG_INFO = NO; 351 | SDKROOT = iphoneos; 352 | TARGETED_DEVICE_FAMILY = "1,2"; 353 | VALIDATE_PRODUCT = YES; 354 | }; 355 | name = Release; 356 | }; 357 | D827CC2219F00749001D230C /* Debug */ = { 358 | isa = XCBuildConfiguration; 359 | buildSettings = { 360 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 361 | CODE_SIGN_IDENTITY = "iPhone Developer"; 362 | INFOPLIST_FILE = Keychain34018/Info.plist; 363 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 364 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 365 | PRODUCT_NAME = "$(TARGET_NAME)"; 366 | }; 367 | name = Debug; 368 | }; 369 | D827CC2319F00749001D230C /* Release */ = { 370 | isa = XCBuildConfiguration; 371 | buildSettings = { 372 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 373 | CODE_SIGN_IDENTITY = "iPhone Developer"; 374 | INFOPLIST_FILE = Keychain34018/Info.plist; 375 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 376 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 377 | PRODUCT_NAME = "$(TARGET_NAME)"; 378 | }; 379 | name = Release; 380 | }; 381 | D827CC2519F00749001D230C /* Debug */ = { 382 | isa = XCBuildConfiguration; 383 | buildSettings = { 384 | BUNDLE_LOADER = "$(TEST_HOST)"; 385 | FRAMEWORK_SEARCH_PATHS = ( 386 | "$(SDKROOT)/Developer/Library/Frameworks", 387 | "$(inherited)", 388 | ); 389 | GCC_PREPROCESSOR_DEFINITIONS = ( 390 | "DEBUG=1", 391 | "$(inherited)", 392 | ); 393 | INFOPLIST_FILE = Keychain34018Tests/Info.plist; 394 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 395 | PRODUCT_NAME = "$(TARGET_NAME)"; 396 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Keychain34018.app/Keychain34018"; 397 | }; 398 | name = Debug; 399 | }; 400 | D827CC2619F00749001D230C /* Release */ = { 401 | isa = XCBuildConfiguration; 402 | buildSettings = { 403 | BUNDLE_LOADER = "$(TEST_HOST)"; 404 | FRAMEWORK_SEARCH_PATHS = ( 405 | "$(SDKROOT)/Developer/Library/Frameworks", 406 | "$(inherited)", 407 | ); 408 | INFOPLIST_FILE = Keychain34018Tests/Info.plist; 409 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 410 | PRODUCT_NAME = "$(TARGET_NAME)"; 411 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Keychain34018.app/Keychain34018"; 412 | }; 413 | name = Release; 414 | }; 415 | /* End XCBuildConfiguration section */ 416 | 417 | /* Begin XCConfigurationList section */ 418 | D827CBF919F00749001D230C /* Build configuration list for PBXProject "Keychain34018" */ = { 419 | isa = XCConfigurationList; 420 | buildConfigurations = ( 421 | D827CC1F19F00749001D230C /* Debug */, 422 | D827CC2019F00749001D230C /* Release */, 423 | ); 424 | defaultConfigurationIsVisible = 0; 425 | defaultConfigurationName = Release; 426 | }; 427 | D827CC2119F00749001D230C /* Build configuration list for PBXNativeTarget "Keychain34018" */ = { 428 | isa = XCConfigurationList; 429 | buildConfigurations = ( 430 | D827CC2219F00749001D230C /* Debug */, 431 | D827CC2319F00749001D230C /* Release */, 432 | ); 433 | defaultConfigurationIsVisible = 0; 434 | defaultConfigurationName = Release; 435 | }; 436 | D827CC2419F00749001D230C /* Build configuration list for PBXNativeTarget "Keychain34018Tests" */ = { 437 | isa = XCConfigurationList; 438 | buildConfigurations = ( 439 | D827CC2519F00749001D230C /* Debug */, 440 | D827CC2619F00749001D230C /* Release */, 441 | ); 442 | defaultConfigurationIsVisible = 0; 443 | defaultConfigurationName = Release; 444 | }; 445 | /* End XCConfigurationList section */ 446 | }; 447 | rootObject = D827CBF619F00749001D230C /* Project object */; 448 | } 449 | -------------------------------------------------------------------------------- /Keychain34018/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Keychain34018 4 | // 5 | // Created by Matt Palcic on 10/16/14. 6 | // Copyright (c) 2014 ExpeData LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Keychain34018/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Keychain34018 4 | // 5 | // Created by Matt Palcic on 10/16/14. 6 | // Copyright (c) 2014 ExpeData LLC. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Keychain34018/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 | -------------------------------------------------------------------------------- /Keychain34018/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 | 27 | 28 | 29 | 30 | 31 | 32 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /Keychain34018/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 | } -------------------------------------------------------------------------------- /Keychain34018/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | net.expedata.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Keychain34018/JNKeychain.h: -------------------------------------------------------------------------------- 1 | // 2 | // JNKeychain.h 3 | // 4 | // Created by Jeremias Nunez on 5/10/13. 5 | // Copyright (c) 2013 Jeremias Nunez. All rights reserved. 6 | // 7 | // Based on Anomie's great answer - http://stackoverflow.com/a/5251820 8 | // 9 | // jeremias.np@gmail.com 10 | 11 | #import 12 | 13 | @interface JNKeychain : NSObject 14 | 15 | + (id)saveValue:(id)data forKey:(NSString*)key; 16 | + (id)loadValueForKey:(NSString*)key; 17 | + (void)deleteValueForKey:(NSString *)key; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Keychain34018/JNKeychain.m: -------------------------------------------------------------------------------- 1 | // 2 | // JNKeychain.m 3 | // 4 | // Created by Jeremias Nunez on 5/10/13. 5 | // Copyright (c) 2013 Jeremias Nunez. All rights reserved. 6 | // 7 | // jeremias.np@gmail.com 8 | 9 | #import "JNKeychain.h" 10 | 11 | @interface JNKeychain () 12 | 13 | + (NSMutableDictionary *)getKeychainQuery:(NSString *)key; 14 | 15 | @end 16 | 17 | @implementation JNKeychain 18 | 19 | + (NSMutableDictionary *)getKeychainQuery:(NSString *)key 20 | { 21 | // see http://developer.apple.com/library/ios/#DOCUMENTATION/Security/Reference/keychainservices/Reference/reference.html 22 | return [NSMutableDictionary dictionaryWithObjectsAndKeys: 23 | (__bridge id)kSecClassGenericPassword, (__bridge id)kSecClass, 24 | key, (__bridge id)kSecAttrService, 25 | key, (__bridge id)kSecAttrAccount, 26 | (__bridge id)kSecAttrAccessibleAfterFirstUnlock, (__bridge id)kSecAttrAccessible, 27 | nil]; 28 | } 29 | 30 | + (id)saveValue:(id)data forKey:(NSString*)key 31 | { 32 | NSString *value = nil; 33 | 34 | NSMutableDictionary *keychainQuery = [self getKeychainQuery:key]; 35 | // delete any previous value with this key 36 | OSStatus deleteStatus = SecItemDelete((__bridge CFDictionaryRef)keychainQuery); 37 | if (deleteStatus != noErr && deleteStatus != errSecItemNotFound) { 38 | value = [NSString stringWithFormat:@"Error deleting value: %d", (int)deleteStatus]; 39 | return value; 40 | } 41 | 42 | [keychainQuery setObject:[NSKeyedArchiver archivedDataWithRootObject:data] forKey:(__bridge id)kSecValueData]; 43 | 44 | OSStatus addStatus = SecItemAdd((__bridge CFDictionaryRef)keychainQuery, NULL); 45 | if (addStatus != noErr) { 46 | value = [NSString stringWithFormat:@"Error adding value: %d", (int)addStatus]; 47 | return value; 48 | } 49 | 50 | return nil; 51 | } 52 | 53 | + (id)loadValueForKey:(NSString *)key 54 | { 55 | id value = nil; 56 | NSMutableDictionary *keychainQuery = [self getKeychainQuery:key]; 57 | CFDataRef keyData = NULL; 58 | 59 | [keychainQuery setObject:(__bridge id)kCFBooleanTrue forKey:(__bridge id)kSecReturnData]; 60 | [keychainQuery setObject:(__bridge id)kSecMatchLimitOne forKey:(__bridge id)kSecMatchLimit]; 61 | 62 | OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)keychainQuery, (CFTypeRef *)&keyData); 63 | if (status == noErr) { 64 | @try { 65 | value = [NSKeyedUnarchiver unarchiveObjectWithData:(__bridge NSData *)keyData]; 66 | } 67 | @catch (NSException *e) { 68 | NSLog(@"Unarchive of %@ failed: %@", key, e); 69 | } 70 | @finally {} 71 | } 72 | else { 73 | value = [NSString stringWithFormat:@"Error loading value: %d", (int)status]; 74 | } 75 | 76 | if (keyData) { 77 | CFRelease(keyData); 78 | } 79 | 80 | return value; 81 | } 82 | 83 | + (void)deleteValueForKey:(NSString *)key 84 | { 85 | NSMutableDictionary *keychainQuery = [self getKeychainQuery:key]; 86 | SecItemDelete((__bridge CFDictionaryRef)keychainQuery); 87 | } 88 | 89 | @end -------------------------------------------------------------------------------- /Keychain34018/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Keychain34018 4 | // 5 | // Created by Matt Palcic on 10/16/14. 6 | // Copyright (c) 2014 ExpeData LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Keychain34018/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Keychain34018 4 | // 5 | // Created by Matt Palcic on 10/16/14. 6 | // Copyright (c) 2014 ExpeData LLC. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "JNKeychain.h" 11 | 12 | @interface ViewController () 13 | 14 | @property (weak, nonatomic) IBOutlet UITextView *textView; 15 | @property (weak, nonatomic) IBOutlet UIWebView *webView; 16 | @property (weak, nonatomic) IBOutlet UIImageView *imageView; 17 | @property (copy, nonatomic) NSData *bigData; 18 | @property (strong, nonatomic) UIView *snapshot; 19 | @property (strong, nonatomic) UIImage *img; 20 | @property (strong, nonatomic) NSData *imgData; 21 | 22 | @end 23 | 24 | @implementation ViewController 25 | 26 | - (void)viewDidLoad 27 | { 28 | [super viewDidLoad]; 29 | self.textView.text = nil; 30 | 31 | [[NSNotificationCenter defaultCenter] addObserver:self 32 | selector:@selector(didReturnFromBackground:) 33 | name:UIApplicationDidBecomeActiveNotification 34 | object:nil]; 35 | 36 | self.bigData = [self randomDataWithLength:40*1024*1024]; 37 | self.snapshot = [[UIScreen mainScreen] snapshotViewAfterScreenUpdates:YES]; 38 | [self.view addSubview:self.snapshot]; 39 | NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://www.apple.com"]]; 40 | [self.webView loadRequest:request]; 41 | [self grabScreenshot]; 42 | self.imageView.image = self.img; 43 | self.snapshot.hidden = YES; 44 | } 45 | 46 | - (void)grabScreenshot 47 | { 48 | UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, self.view.opaque, 0.0); 49 | [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; 50 | self.img = UIGraphicsGetImageFromCurrentImageContext(); 51 | self.imgData = UIImageJPEGRepresentation(self.img, 1.0); 52 | UIGraphicsEndImageContext(); 53 | } 54 | 55 | - (id)randomDataWithLength:(NSUInteger)length 56 | { 57 | NSMutableData* data=[NSMutableData dataWithLength:length]; 58 | [[NSInputStream inputStreamWithFileAtPath:@"/dev/urandom"] read:(uint8_t*)[data mutableBytes] maxLength:length]; 59 | return data; 60 | } 61 | 62 | - (void)addLogMessage:(NSString *)message 63 | { 64 | if (message) { 65 | self.textView.text = [NSString stringWithFormat:@"%@%@\n", self.textView.text, message]; 66 | } 67 | } 68 | 69 | - (void)saveTimestamp 70 | { 71 | NSString *keychainValue = [[NSDate date] description]; 72 | NSString *status = [JNKeychain saveValue:keychainValue forKey:@"Keychain34018"]; 73 | if (status) { 74 | NSString *message = [NSString stringWithFormat:@"SAVE: %@", status]; 75 | [self addLogMessage:message]; 76 | } 77 | } 78 | 79 | - (void)loadTimestamp 80 | { 81 | NSString *keychainValue = [JNKeychain loadValueForKey:@"Keychain34018"]; 82 | if (keychainValue) { 83 | NSString *message = [NSString stringWithFormat:@"LOAD: %@", keychainValue]; 84 | [self addLogMessage:message]; 85 | } 86 | } 87 | 88 | - (void)didReturnFromBackground:(NSNotification *)event 89 | { 90 | [self loadTimestamp]; 91 | } 92 | 93 | - (IBAction)updateKeychainValue:(id)sender 94 | { 95 | [self saveTimestamp]; 96 | } 97 | 98 | - (void)didReceiveMemoryWarning 99 | { 100 | [super didReceiveMemoryWarning]; 101 | // Dispose of any resources that can be recreated. 102 | } 103 | 104 | @end 105 | -------------------------------------------------------------------------------- /Keychain34018/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Keychain34018 4 | // 5 | // Created by Matt Palcic on 10/16/14. 6 | // Copyright (c) 2014 ExpeData LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Keychain34018Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | net.expedata.$(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 | -------------------------------------------------------------------------------- /Keychain34018Tests/Keychain34018Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Keychain34018Tests.m 3 | // Keychain34018Tests 4 | // 5 | // Created by Matt Palcic on 10/16/14. 6 | // Copyright (c) 2014 ExpeData LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface Keychain34018Tests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation Keychain34018Tests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 DinosaurDad 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Keychain-34018 2 | ============== 3 | 4 | This project is only intended to help track down error -34018 when accessing the keychain on iOS 8 from within a UIApplicationDidBecomeActiveNotification handler. 5 | 6 | __Steps to Reproduce:__ 7 | 8 | 1. Run the attached Keychain34018 app from Xcode (using 6.1 here) on an iPad Air - the simulator was not used. 9 | 2. Tap the Update button in the upper right corner. 10 | 3. Switch away from the app with the home button. 11 | 4. Run some other apps, such as Mail (with a fairly populated inbox), Safari (refresh multiple tabs with heavy content), maybe open a game. 12 | 5. Switch back to the Keychain34018 app. 13 | 6. If you don't get error -34018, stop the app from Xcode and restart at step 1. 14 | 15 | It is not clear what is causing the error, but memory pressure appears to be a factor. This sample intentionally loads up some memory-hungry objects to help cause pressure. 16 | 17 | This project contains a custom copy of [JNKeychain](https://github.com/jeremangnr/JNKeychain) to expose errors. 18 | --------------------------------------------------------------------------------