diff --git a/.gitmodules b/.gitmodules index 68f8e67a..c7965d7e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,9 +4,6 @@ [submodule "External/InAppSettingsKit"] path = External/InAppSettingsKit url = git://github.com/lhunath/InAppSettingsKit.git -[submodule "External/FontReplacer"] - path = External/FontReplacer - url = git://github.com/0xced/FontReplacer.git [submodule "External/UbiquityStoreManager"] path = External/UbiquityStoreManager url = git://github.com/lhunath/UbiquityStoreManager.git @@ -16,6 +13,3 @@ [submodule "External/LoveLyndir"] path = External/LoveLyndir url = git://github.com/Lyndir/love-lyndir.client.git -[submodule "External/DCIntrospect"] - path = External/DCIntrospect - url = https://github.com/lhunath/DCIntrospect.git diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 87f2daf9..a84efcb2 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -9,6 +9,7 @@ + diff --git a/External/Crashlytics.framework/run b/External/Crashlytics.framework/run deleted file mode 100755 index d2c28068..00000000 Binary files a/External/Crashlytics.framework/run and /dev/null differ diff --git a/External/DCIntrospect b/External/DCIntrospect deleted file mode 160000 index 3aa31226..00000000 --- a/External/DCIntrospect +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3aa3122645afa96c2354124b96bb714de9ad2d69 diff --git a/External/FontReplacer b/External/FontReplacer deleted file mode 160000 index 4e3dea08..00000000 --- a/External/FontReplacer +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4e3dea08702906fc5d51c8b75dda5da29c545a74 diff --git a/External/GoogleOpenSource.framework b/External/GoogleOpenSource.framework deleted file mode 120000 index c8c85aaa..00000000 --- a/External/GoogleOpenSource.framework +++ /dev/null @@ -1 +0,0 @@ -google-plus-ios-sdk/GoogleOpenSource.framework \ No newline at end of file diff --git a/External/GooglePlus.framework b/External/GooglePlus.framework deleted file mode 120000 index 42537e6f..00000000 --- a/External/GooglePlus.framework +++ /dev/null @@ -1 +0,0 @@ -google-plus-ios-sdk/GooglePlus.framework \ No newline at end of file diff --git a/External/LoveLyndir b/External/LoveLyndir index adab69df..ceed9e20 160000 --- a/External/LoveLyndir +++ b/External/LoveLyndir @@ -1 +1 @@ -Subproject commit adab69df05840d94a3f2f883251869d6cb352b0e +Subproject commit ceed9e20009f2cf3679445e2c60b0f206aaef383 diff --git a/External/Crashlytics.framework/Crashlytics b/External/Mac/Crashlytics.framework/Crashlytics similarity index 100% rename from External/Crashlytics.framework/Crashlytics rename to External/Mac/Crashlytics.framework/Crashlytics diff --git a/External/Crashlytics.framework/Headers b/External/Mac/Crashlytics.framework/Headers similarity index 100% rename from External/Crashlytics.framework/Headers rename to External/Mac/Crashlytics.framework/Headers diff --git a/External/Crashlytics.framework/Resources b/External/Mac/Crashlytics.framework/Resources similarity index 100% rename from External/Crashlytics.framework/Resources rename to External/Mac/Crashlytics.framework/Resources diff --git a/External/Mac/Crashlytics.framework/Versions/A/Crashlytics b/External/Mac/Crashlytics.framework/Versions/A/Crashlytics new file mode 100644 index 00000000..41884f03 Binary files /dev/null and b/External/Mac/Crashlytics.framework/Versions/A/Crashlytics differ diff --git a/External/Crashlytics.framework/Versions/A/Headers/Crashlytics.h b/External/Mac/Crashlytics.framework/Versions/A/Headers/Crashlytics.h similarity index 100% rename from External/Crashlytics.framework/Versions/A/Headers/Crashlytics.h rename to External/Mac/Crashlytics.framework/Versions/A/Headers/Crashlytics.h diff --git a/External/Mac/Crashlytics.framework/Versions/A/Resources/Info.plist b/External/Mac/Crashlytics.framework/Versions/A/Resources/Info.plist new file mode 100644 index 00000000..bf21197c --- /dev/null +++ b/External/Mac/Crashlytics.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + Crashlytics + CFBundleIdentifier + com.crashlytics.sdk.mac + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Crashlytics + CFBundlePackageType + FMWK + CFBundleShortVersionString + 2.1.2 + CFBundleSupportedPlatforms + + macosx + + CFBundleVersion + 9 + DTPlatformName + macosx + MinimumOSVersion + 10.6 + + diff --git a/External/Crashlytics.framework/Versions/Current b/External/Mac/Crashlytics.framework/Versions/Current similarity index 100% rename from External/Crashlytics.framework/Versions/Current rename to External/Mac/Crashlytics.framework/Versions/Current diff --git a/External/Mac/Crashlytics.framework/run b/External/Mac/Crashlytics.framework/run new file mode 100755 index 00000000..a43a84fe Binary files /dev/null and b/External/Mac/Crashlytics.framework/run differ diff --git a/External/Pearl b/External/Pearl index 081c2dec..c2266f37 160000 --- a/External/Pearl +++ b/External/Pearl @@ -1 +1 @@ -Subproject commit 081c2dec20b3638694a5ad20cd2fddccdb298447 +Subproject commit c2266f37add0c1d54fc4dd771d44d50f7c249953 diff --git a/External/Reveal.framework/Versions/A/Headers/IBARevealLogger.h b/External/Reveal.framework/Versions/A/Headers/IBARevealLogger.h index 92193c71..a2dd329c 100644 --- a/External/Reveal.framework/Versions/A/Headers/IBARevealLogger.h +++ b/External/Reveal.framework/Versions/A/Headers/IBARevealLogger.h @@ -7,7 +7,7 @@ CF_EXTERN_C_BEGIN /*! \brief The Reveal Log level bit flags. - \discussion These flags are addative. Ie, you should bitwise OR them together. + \discussion These flags are additive. i.e. you should bitwise OR them together. \seealso IBARevealLoggerSetLevelMask \seealso IBARevealLoggerGetLevelMask diff --git a/External/Reveal.framework/Versions/A/Reveal b/External/Reveal.framework/Versions/A/Reveal index 0ae41f5e..4ffdd56e 100644 Binary files a/External/Reveal.framework/Versions/A/Reveal and b/External/Reveal.framework/Versions/A/Reveal differ diff --git a/External/TestFlight/README.md b/External/TestFlight/README.md index f3e5a28d..9f36d59e 100644 --- a/External/TestFlight/README.md +++ b/External/TestFlight/README.md @@ -66,20 +66,6 @@ The TestFlight SDK requires iOS 4.3 or above, the Apple LLVM compiler, and the l 3. To report crashes to you we install our own uncaught exception handler. If you are not currently using an exception handler of your own then all you need to do is go to the next step. If you currently use an Exception Handler, or you use another framework that does please go to the section on advanced exception handling. -## Setting the UDID - -For **BETA** apps only: In order for "In App Updates" to work and for user data not to be anonymized, you may provide the device's unique identifier. To send the device identifier call the following method **before** your call to `+[TestFlight takeOff:]` like so: - - [TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]]; - [TestFlight takeOff:@"Insert your Application Token here"]; - -Note: `[[UIDevice currentDevice] uniqueIdentifier]` is deprecated, which means it may be removed from iOS in the future and that it should not be used in production apps. We recommend using it **only** in beta apps. If using it makes you feel uncomfortable, you are not required to include it. - -**Note on iOS 7 and Xcode 5**: In iOS 7, `uniqueIdentifier` no longer returns the device's UDID, so iOS 7 users will show up anonymously on TestFlight. Also, when building with ARC, Xcode 5 will not allow you to call `uniqueIdentifier` because it has been removed in iOS 7 from `UIDevice`'s header. We are working on a workaround for this issue. - -**DO NOT USE THIS IN PRODUCTION APPS**. When it is time to submit to the App Store comment this line out. Apple will probably reject your app if you leave this line in. - - ## Uploading your build After you have integrated the SDK into your application you need to upload your build to TestFlight. You can upload your build on our [website](https://testflightapp.com/dashboard/builds/add/), using our [desktop app](https://testflightapp.com/desktop/), or by using our [upload API](https://testflightapp.com/api/doc/). @@ -89,23 +75,23 @@ After you have integrated the SDK into your application you need to upload your ### Session Information -View anonymous information about how often users use your app, how long they use it for, and when they use it. You can see what type of device the user is using, which OS, which language, etc. +View information about how often users use your app, how long they use it for, and when they use it. You can see what type of device the user is using, which OS, which language, etc. Sessions automatically start at when the app becomes active and end when the app resigns active. Sessions that start shortly after an end continue the session instead of starting a new one. NB: Sessions do not start when `takeOff:` is called, `takeOff:` registers callbacks to start sessions when the app is active. -For **beta** users, you can see who the users are if you are **setting the UDID**, they have a TestFlight account, and their device is registered to TestFlight. (See Setting the UDID for more information). +For **beta** users, you can see who the users are if they have a TestFlight account and their device is registered with TestFlight. ### Crash Reports -The TestFlight SDK automatically reports all crashes (beta and prod) to TestFlight's website where you can view them. Crash reports are sent **at** crash time. TestFlight will also automatically symbolicate all crashes (if you have uploaded your dSYM). For **beta** apps, on the site, you can see which checkpoints the user passed before the crash and see remote logs that were sent before the crash. For **prod** apps, you can see remote logs that were sent before the crash. +The TestFlight SDK automatically reports all crashes (beta and prod) to TestFlight's website where you can view them. Crash reports are sent **at** crash time. TestFlight will also automatically symbolicate all crashes (if you have uploaded your dSYM). For **beta** apps, on the site, you can see which checkpoints the user passed before the crash and see remote logs that were sent before the crash. ### Beta In App Updates -If a user is using a **beta** version of your app, you are **setting the UDID**, a new beta version is available, and that user has permission to install it; an in app popup will ask them if they would like to install the update. If they tap "Install", the new version is installed from inside the app. +If a user is using a **beta** version of your app and that user has permission to install it; an in app popup will ask them if they would like to install the update. If they tap "Install", the new version is installed from inside the app. NB: For this to work, you must increment your build version before uploading. Otherwise the new and old builds will have the same version number and we won't know if the user needs to update or is already using the new version. @@ -118,7 +104,7 @@ To turn this off set this option before calling `takeOff:` ### Checkpoints -When a tester does something you care about in your app, you can pass a checkpoint. For example completing a level, adding a todo item, etc. The checkpoint progress is used to provide insight into how your testers are testing your apps. The passed checkpoints are also attached to crashes, which can help when creating steps to replicate. Checkpoints are visible for all beta and prod builds. +When a tester does something you care about in your app, you can pass a checkpoint. For example completing a level, adding a todo item, etc. The checkpoint progress is used to provide insight into how your testers are testing your apps. The passed checkpoints are also attached to crashes, which can help when creating steps to replicate. Checkpoints are visible for all beta builds. [TestFlight passCheckpoint:@"CHECKPOINT_NAME"]; @@ -126,7 +112,7 @@ Use `passCheckpoint:` to track when a user performs certain tasks in your applic Checkpoints are meant to tell you if a user visited a place in your app or completed a task. They should not be used for debugging purposes. Instead, use Remote Logging for debugging information (more information below). -NB: Checkpoints are only recorded during sessions. +NB: Checkpoints are only recorded during BETA sessions. ### Custom Environment Information @@ -149,7 +135,7 @@ Once users have submitted feedback from inside of the application you can view i ### Remote Logging -Remote Logging allows you to see the logs your app prints out remotely, on TestFlight's website. You can see logs for **beta sessions** and **prod sessions with crashes**. NB: you cannot see the logs for all prod sessions. +Remote Logging allows you to see the logs your app prints out remotely, on TestFlight's website. You can see logs for **beta sessions**. To use it, simply replace all of your `NSLog` calls with `TFLog` calls. An easy way to do this without rewriting all your `NSLog` calls is to add the following macro to your `.pch` file. @@ -175,6 +161,7 @@ If you have your own custom logging, call `TFLog` from your custom logging funct [TestFlight setOptions:@{ TFOptionLogToConsole : @NO }]; [TestFlight setOptions:@{ TFOptionLogToSTDERR : @NO }]; + ## Advanced Notes ### Checkpoint API @@ -186,12 +173,14 @@ When passing a checkpoint, TestFlight logs the checkpoint synchronously (See Rem All logging is done synchronously. Every time the SDK logs, it must write data to a file. This is to ensure log integrity at crash time. Without this, we could not trust logs at crash time. If you have a high performance app, please email support@testflightapp.com for more options. + ### Advanced Session Control Continuing sessions: You can adjust the amount of time a user can leave the app for and still continue the same session when they come back by changing the `TFOptionSessionKeepAliveTimeout` option. Change it to 0 to turn the feature off. Manual Session Control: If your app is a music player that continues to play music in the background, a navigation app that continues to function in the background, or any app where a user is considered to be "using" the app even while the app is not active you should use Manual Session Control. Please only use manual session control if you know exactly what you are doing. There are many pitfalls which can result in bad session duration and counts. See `TestFlight+ManualSessions.h` for more information and instructions. + ### Advanced Exception/Signal Handling An uncaught exception means that your application is in an unknown state and there is not much that you can do but try and exit gracefully. Our SDK does its best to get the data we collect in this situation to you while it is crashing, but it is designed in such a way that the important act of saving the data occurs in as safe way a way as possible before trying to send anything. If you do use uncaught exception or signal handlers, install your handlers before calling `takeOff:`. Our SDK will then call your handler while ours is running. For example: diff --git a/External/TestFlight/TestFlight.h b/External/TestFlight/TestFlight.h index f84128ff..bc8147d5 100644 --- a/External/TestFlight/TestFlight.h +++ b/External/TestFlight/TestFlight.h @@ -6,7 +6,7 @@ // Copyright 2011 TestFlight. All rights reserved. #import -#define TESTFLIGHT_SDK_VERSION @"2.1.4" +#define TESTFLIGHT_SDK_VERSION @"3.0.0" #undef TFLog #if __cplusplus @@ -14,6 +14,7 @@ extern "C" { #endif /* * Remote Logging + * BETA only * Note: All Logging is synchronous, see the README for more information. */ void TFLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2))); @@ -31,6 +32,7 @@ extern "C" { /** * Add custom environment information + * BETA only * If you want to track custom information such as a user name from your application you can add it here. * NB: This information must be added before the session starts, it is recorded only on session start. * @@ -64,6 +66,7 @@ extern "C" { /** * Track when a user has passed a checkpoint after the flight has taken off. Eg. passed level 1, posted high score. + * BETA only * Checkpoints are sent in the background. * Note: The checkpoint is logged synchronously (See TFLog and TFOptionLogOnCheckpoint for more information). * @@ -74,33 +77,12 @@ extern "C" { /** * Submits custom feedback to the site. Sends the data in feedback to the site. This is to be used as the method to submit * feedback from custom feedback forms. + * BETA only * * @param feedback Your users feedback, method does nothing if feedback is nil */ + (void)submitFeedback:(NSString*)feedback; -/** - * Sets the Device Identifier. - * - * !! DO NOT CALL IN SUBMITTED APP STORE APP. - * - * !! MUST BE CALLED BEFORE +takeOff: - * - * This method should only be used during testing so that you can identify a testers test data with them. - * If you do not provide the identifier you will still see all session data, with checkpoints - * and logs, but the data will be anonymized. - * - * It is recommended that you only use this method during testing. - * Apple may reject your app if left in a submitted app. - * - * Use: - * Only use this with the Apple device UDID. DO NOT use Open ID or your own identifier. - * [TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]]; - * - * @param deviceIdentifer The current devices device identifier - */ -+ (void)setDeviceIdentifier:(NSString*)deviceIdentifer; - @end diff --git a/External/TestFlight/libTestFlight.a b/External/TestFlight/libTestFlight.a index bb507b61..bc51098e 100644 Binary files a/External/TestFlight/libTestFlight.a and b/External/TestFlight/libTestFlight.a differ diff --git a/External/TestFlight/release_notes.md b/External/TestFlight/release_notes.md index fb9a5f61..5788505f 100644 --- a/External/TestFlight/release_notes.md +++ b/External/TestFlight/release_notes.md @@ -1,30 +1,45 @@ -## 2.1.4 +## 3.0.0 - February 18, 2014 + +- Remove checkpoints, feedback, and logs from production apps. + +## 2.2.2 - February 5, 2014 + +- Remove `+ (void)setDeviceIdentifier:(NSString *)deviceIdentifer`, it is no longer used +- On start up, if unsent events are found only attempt to send some of them (this is in case a device doesn't have internet for a while and unsent events build up) +- Fix crash if you try to run `TFLog(nil)` (thanks Florian!) + +## 2.2.1 - January 16, 2014 - Consolidate both SDK versions into one which removes all access to `ASIdentifierManager` -## 2.1.3 +## 2.2 - December 17, 2013 + +- Restore In App Updates +- Automatic identification of beta testers + +## 2.1.3 - November 25, 2013 - Fix bug in 2.1.2-noadid which caused adid to be collected -## 2.1.2 +## 2.1.2 - November 19, 2013 - Fix for bug that caused events to not get sent properly when using the `TFOptionSessionKeepAliveTimeout` option - Fix for bug that caused logs that were sent immediately after start session to sometimes not be sent to server -## 2.1.1 +## 2.1.1 - October 2, 2013 - Create sdk version that removes all access to `ASIdentifierManager` - Add UIDevice's `identifierForVendor` -## 2.1 +## 2.1 - September 30, 2013 - Full support for the iPhone 5s’ ARM64 processor while still supporting down to iOS 4.3 -## 2.0.2 +## 2.0.2 - August 30, 2013 - Fixed a bug where the sdk would cause an app's CPU usage to rise significantly if the device had no internet connection when the app started -## 2.0.1 +## 2.0.1 - August 22, 2013 - Fixed rare `8badf00d` crash in TFNetworkManager that happened when the app was in the background diff --git a/External/UbiquityStoreManager b/External/UbiquityStoreManager index ef9aa1c2..5e38f25f 160000 --- a/External/UbiquityStoreManager +++ b/External/UbiquityStoreManager @@ -1 +1 @@ -Subproject commit ef9aa1c29ed6e1729be4d6a3dd65e2c8a289bf4c +Subproject commit 5e38f25f6e058cc52b8e41bcdc183b7966bb3ac7 diff --git a/External/google-plus-ios-sdk/Changelog b/External/google-plus-ios-sdk/Changelog deleted file mode 100644 index 2e3c650e..00000000 --- a/External/google-plus-ios-sdk/Changelog +++ /dev/null @@ -1,20 +0,0 @@ -2013-05-07 -- v1.3.0 -- Packaged as framework -- Bug fixes - -2013-02-26 -- v1.2.1 -- Interactive posts on Google+ share -- Improved sign-in and share APIs to use shared instances -- Automatic retrieval of user identity upon sign-in -- Expanded Google+ moments API support -- Updated sample app - -2012-10-12 -- v1.1.0 -- Content deep linking on Google+ share -- iOS6 support -- Shortened class names -- Bug fixes - -2012-06-25 -- v1.0.0 -- Google+ sign-in button, share plugin, and Google+ history integration library - with sample app. diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/GoogleOpenSource b/External/google-plus-ios-sdk/GoogleOpenSource.framework/GoogleOpenSource deleted file mode 120000 index aaccac7a..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/GoogleOpenSource +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/GoogleOpenSource \ No newline at end of file diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/GoogleOpenSource b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/GoogleOpenSource deleted file mode 100644 index 794b8a77..00000000 Binary files a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/GoogleOpenSource and /dev/null differ diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLBase64.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLBase64.h deleted file mode 100644 index fd0a0518..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLBase64.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -NSData *GTLDecodeBase64(NSString *base64Str); -NSString *GTLEncodeBase64(NSData *data); - -// "Web-safe" encoding substitutes - and _ for + and / in the encoding table, -// per http://www.ietf.org/rfc/rfc4648.txt section 5. - -NSData *GTLDecodeWebSafeBase64(NSString *base64Str); -NSString *GTLEncodeWebSafeBase64(NSData *data); diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLBatchQuery.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLBatchQuery.h deleted file mode 100644 index d4fb1d38..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLBatchQuery.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLBatchQuery.h -// - -// Batch query documentation: -// https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Batch_Operations - -#import "GTLQuery.h" - -@interface GTLBatchQuery : NSObject { - @private - NSMutableArray *queries_; - NSMutableDictionary *requestIDMap_; - BOOL skipAuthorization_; - NSDictionary *additionalHTTPHeaders_; - NSDictionary *urlQueryParameters_; -} - -// Queries included in this batch. Each query should have a unique requestID. -@property (retain) NSArray *queries; - -// Clients may set this to YES to disallow authorization. Defaults to NO. -@property (assign) BOOL shouldSkipAuthorization; - -// Any additional HTTP headers for this batch. -// -// These headers override the same keys from the service object's -// additionalHTTPHeaders. -@property (copy) NSDictionary *additionalHTTPHeaders; - -// Any URL query parameters to add to the query (useful for debugging with some -// services). -@property (copy) NSDictionary *urlQueryParameters; - -+ (id)batchQuery; -+ (id)batchQueryWithQueries:(NSArray *)array; - -- (void)addQuery:(GTLQuery *)query GTL_NONNULL((1)); - -- (GTLQuery *)queryForRequestID:(NSString *)requestID GTL_NONNULL((1)); - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLBatchResult.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLBatchResult.h deleted file mode 100644 index 9675aaf7..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLBatchResult.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (c) 2011 Google Inc. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// GTLBatchResult.h -// - -#import "GTLObject.h" - -@interface GTLBatchResult : GTLObject { - @private - NSMutableDictionary *successes_; - NSMutableDictionary *failures_; -} - -// Dictionaries of results for all queries in the batch -// -// Dictionary keys are requestID strings; objects are results or -// GTLErrorObjects. -// -// For successes with no returned object (such as from delete operations), -// the object for the dictionary entry is NSNull. -// -// -// The original query for each result is available from the service ticket, -// for example -// -// NSDictionary *successes = batchResults.successes; -// for (NSString *requestID in successes) { -// GTLObject *obj = [successes objectForKey:requestID]; -// GTLQuery *query = [ticket queryForRequestID:requestID]; -// NSLog(@"Query %@ returned object %@", query, obj); -// } -// -// NSDictionary *failures = batchResults.failures; -// for (NSString *requestID in failures) { -// GTLErrorObject *errorObj = [failures objectForKey:requestID]; -// GTLQuery *query = [ticket queryForRequestID:requestID]; -// NSLog(@"Query %@ failed with error %@", query, errorObj); -// } -// - -@property (retain) NSMutableDictionary *successes; -@property (retain) NSMutableDictionary *failures; - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLDateTime.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLDateTime.h deleted file mode 100644 index f6b1ffb3..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLDateTime.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) 2011 Google Inc. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// GTLDateTime.h -// -// This is an immutable class representing a date and optionally a -// time with time zone. -// - -#import -#import "GTLDefines.h" - -@interface GTLDateTime : NSObject { - NSDateComponents *dateComponents_; - NSInteger milliseconds_; // This is only for the fraction of a second 0-999 - NSInteger offsetSeconds_; // may be NSUndefinedDateComponent - BOOL isUniversalTime_; // preserves "Z" - NSTimeZone *timeZone_; // specific time zone by name, if known -} - -+ (GTLDateTime *)dateTimeWithRFC3339String:(NSString *)str; - -// timeZone may be nil if the time zone is not known. -+ (GTLDateTime *)dateTimeWithDate:(NSDate *)date timeZone:(NSTimeZone *)tz; - -// Use this method to make a dateTime for an all-day event (date only, so -// hasTime is NO.) -+ (GTLDateTime *)dateTimeForAllDayWithDate:(NSDate *)date; - -+ (GTLDateTime *)dateTimeWithDateComponents:(NSDateComponents *)date; - -@property (nonatomic, readonly) NSDate *date; -@property (nonatomic, readonly) NSCalendar *calendar; - -@property (nonatomic, readonly) NSString *RFC3339String; -@property (nonatomic, readonly) NSString *stringValue; // same as RFC3339String - -@property (nonatomic, readonly, retain) NSTimeZone *timeZone; -@property (nonatomic, readonly, copy) NSDateComponents *dateComponents; -@property (nonatomic, readonly) NSInteger milliseconds; // This is only for the fraction of a second 0-999 - -@property (nonatomic, readonly) BOOL hasTime; -@property (nonatomic, readonly) NSInteger offsetSeconds; -@property (nonatomic, readonly, getter=isUniversalTime) BOOL universalTime; - - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLDefines.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLDefines.h deleted file mode 100644 index b12eb9eb..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLDefines.h +++ /dev/null @@ -1,144 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLDefines.h -// - -// Ensure Apple's conditionals we depend on are defined. -#import -#import - -// -// The developer may choose to define these in the project: -// -// #define GTL_TARGET_NAMESPACE Xxx // preface all GTL class names with Xxx (recommended for building plug-ins) -// #define GTL_FOUNDATION_ONLY 1 // builds without AppKit or Carbon (default for iPhone builds) -// #define STRIP_GTM_FETCH_LOGGING 1 // omit http logging code (default for iPhone release builds) -// -// Mac developers may find GTL_SIMPLE_DESCRIPTIONS and STRIP_GTM_FETCH_LOGGING useful for -// reducing code size. -// - -// Define later OS versions when building on earlier versions -#ifdef MAC_OS_X_VERSION_10_0 - #ifndef MAC_OS_X_VERSION_10_6 - #define MAC_OS_X_VERSION_10_6 1060 - #endif -#endif - - -#ifdef GTL_TARGET_NAMESPACE -// prefix all GTL class names with GTL_TARGET_NAMESPACE for this target - #import "GTLTargetNamespace.h" -#endif - -// Provide a common definition for externing constants/functions -#if defined(__cplusplus) - #define GTL_EXTERN extern "C" -#else - #define GTL_EXTERN extern -#endif - -#if TARGET_OS_IPHONE // iPhone SDK - - #define GTL_IPHONE 1 - -#endif - -#if GTL_IPHONE - - #define GTL_FOUNDATION_ONLY 1 - -#endif - -// -// GTL_ASSERT is like NSAssert, but takes a variable number of arguments: -// -// GTL_ASSERT(condition, @"Problem in argument %@", argStr); -// -// GTL_DEBUG_ASSERT is similar, but compiles in only for debug builds -// - -#ifndef GTL_ASSERT - // we directly invoke the NSAssert handler so we can pass on the varargs - #if !defined(NS_BLOCK_ASSERTIONS) - #define GTL_ASSERT(condition, ...) \ - do { \ - if (!(condition)) { \ - [[NSAssertionHandler currentHandler] \ - handleFailureInFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] \ - file:[NSString stringWithUTF8String:__FILE__] \ - lineNumber:__LINE__ \ - description:__VA_ARGS__]; \ - } \ - } while(0) - #else - #define GTL_ASSERT(condition, ...) do { } while (0) - #endif // !defined(NS_BLOCK_ASSERTIONS) -#endif // GTL_ASSERT - -#ifndef GTL_DEBUG_ASSERT - #if DEBUG - #define GTL_DEBUG_ASSERT(condition, ...) GTL_ASSERT(condition, __VA_ARGS__) - #else - #define GTL_DEBUG_ASSERT(condition, ...) do { } while (0) - #endif -#endif - -#ifndef GTL_DEBUG_LOG - #if DEBUG - #define GTL_DEBUG_LOG(...) NSLog(__VA_ARGS__) - #else - #define GTL_DEBUG_LOG(...) do { } while (0) - #endif -#endif - -#ifndef STRIP_GTM_FETCH_LOGGING - #if GTL_IPHONE && !DEBUG - #define STRIP_GTM_FETCH_LOGGING 1 - #else - #define STRIP_GTM_FETCH_LOGGING 0 - #endif -#endif - -// Some support for advanced clang static analysis functionality -// See http://clang-analyzer.llvm.org/annotations.html -#ifndef __has_feature // Optional. - #define __has_feature(x) 0 // Compatibility with non-clang compilers. -#endif -#ifndef NS_RETURNS_NOT_RETAINED - #if __has_feature(attribute_ns_returns_not_retained) - #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) - #else - #define NS_RETURNS_NOT_RETAINED - #endif -#endif - -#ifndef __has_attribute - #define __has_attribute(x) 0 -#endif - -#if 1 - // We will start using nonnull declarations once the static analyzer seems - // to support it without false positives. - #define GTL_NONNULL(x) -#else - #if __has_attribute(nonnull) - #define GTL_NONNULL(x) __attribute__((nonnull x)) - #else - #define GTL_NONNULL(x) - #endif -#endif diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLErrorObject.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLErrorObject.h deleted file mode 100644 index c2ec67db..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLErrorObject.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLErrorObject.h -// - -#import "GTLObject.h" - -@class GTLErrorObjectData; - -@interface GTLErrorObject : GTLObject -@property (retain) NSNumber *code; -@property (retain) NSString *message; -@property (retain) NSArray *data; // of GTLErrorObjectData - -// Convenience accessor for creating an NSError from a GTLErrorObject. -@property (readonly) NSError *foundationError; - -// Convenience accessor for extracting the GTLErrorObject that was used to -// create an NSError. -// -// Returns nil if the error was not originally from a GTLErrorObject. -+ (GTLErrorObject *)underlyingObjectForError:(NSError *)foundationError; - -@end - -@interface GTLErrorObjectData : GTLObject -@property (retain) NSString *domain; -@property (retain) NSString *reason; -@property (retain) NSString *message; -@property (retain) NSString *location; -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLFramework.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLFramework.h deleted file mode 100644 index 106f420e..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLFramework.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef _GTLFRAMEWORK_H_ -#define _GTLFRAMEWORK_H_ - -#import - -#import "GTLDefines.h" - - -// Returns the version of the framework. Major and minor should -// match the bundle version in the Info.plist file. -// -// Pass NULL to ignore any of the parameters. - -void GTLFrameworkVersion(NSUInteger* major, NSUInteger* minor, NSUInteger* release); - -// Returns the version in @"a.b" or @"a.b.c" format -NSString *GTLFrameworkVersionString(void); - -#endif diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLJSONParser.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLJSONParser.h deleted file mode 100644 index d9715295..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLJSONParser.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLJSONParser.h -// - -// This class is a thin wrapper around the JSON parser. It uses -// NSJSONSerialization when available, and SBJSON otherwise. - -#import - -#import "GTLDefines.h" - -@interface GTLJSONParser : NSObject -+ (NSString*)stringWithObject:(id)value - humanReadable:(BOOL)humanReadable - error:(NSError**)error; - -+ (NSData *)dataWithObject:(id)obj - humanReadable:(BOOL)humanReadable - error:(NSError**)error; - -+ (id)objectWithString:(NSString *)jsonStr - error:(NSError **)error; - -+ (id)objectWithData:(NSData *)jsonData - error:(NSError **)error; -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLObject.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLObject.h deleted file mode 100644 index 43935adf..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLObject.h +++ /dev/null @@ -1,208 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLObject.h -// - -// GTLObject documentation: -// https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Objects_and_Queries - -#import - -#import "GTLDefines.h" -#import "GTLUtilities.h" -#import "GTLDateTime.h" - -#undef _EXTERN -#undef _INITIALIZE_AS -#ifdef GTLOBJECT_DEFINE_GLOBALS -#define _EXTERN -#define _INITIALIZE_AS(x) =x -#else -#define _EXTERN extern -#define _INITIALIZE_AS(x) -#endif - -@protocol GTLCollectionProtocol -@optional -@property (retain) NSArray *items; -@end - -@protocol GTLBatchItemCreationProtocol -- (void)createItemsWithClassMap:(NSDictionary *)batchClassMap; -@end - -@interface GTLObject : NSObject { - - @private - - NSMutableDictionary *json_; - - // Used when creating the subobjects from this one. - NSDictionary *surrogates_; - - // Any complex object hung off this object goes into the cache so the - // next fetch will get the same object back instead of having to recreate - // it. - NSMutableDictionary *childCache_; - - // Anything defined by the client; retained but not used internally; not - // copied by copyWithZone: - NSMutableDictionary *userProperties_; -} - -@property (nonatomic, retain) NSMutableDictionary *JSON; -@property (nonatomic, retain) NSDictionary *surrogates; -@property (nonatomic, retain) NSMutableDictionary *userProperties; - -/////////////////////////////////////////////////////////////////////////////// -// -// Public methods -// -// These methods are intended for users of the library -// - -+ (id)object; -+ (id)objectWithJSON:(NSMutableDictionary *)dict; - -- (id)copyWithZone:(NSZone *)zone; - -- (NSString *)JSONString; - -// generic access to json; also creates it if necessary -- (void)setJSONValue:(id)obj forKey:(NSString *)key GTL_NONNULL((2)); -- (id)JSONValueForKey:(NSString *)key; - -// Returns the list of keys in this object's JSON that aren't listed as -// properties on the object. -- (NSArray *)additionalJSONKeys; - -// Any keys in the JSON that aren't listed as @properties on the object -// are counted as "additional properties". These allow you to get/set them. -- (id)additionalPropertyForName:(NSString *)name; -- (void)setAdditionalProperty:(id)obj forName:(NSString *)name GTL_NONNULL((2)); -- (NSDictionary *)additionalProperties; - -// User properties are supported for client convenience, but are not copied by -// copyWithZone. User Properties keys beginning with _ are reserved by the library. -// -// Set nil for obj to remove the property. -- (void)setProperty:(id)obj forKey:(NSString *)key GTL_NONNULL((2)); -- (id)propertyForKey:(NSString *)key GTL_NONNULL((1)); - -// userData is stored as a property with key "_userData" -- (void)setUserData:(id)obj; -- (id)userData; - -// Makes a partial query-compatible string describing the fields present -// in this object. (Note: only the first element of any array is examined.) -// -// http://code.google.com/apis/tasks/v1/performance.html#partial -// -- (NSString *)fieldsDescription; - -// Makes an object containing only the changes needed to do a partial update -// (patch), where the patch would be to change an object from the original -// to the receiver, such as -// -// GTLSomeObject *patchObject = [newVersion patchObjectFromOriginal:oldVersion]; -// -// http://code.google.com/apis/tasks/v1/performance.html#patch -// -// NOTE: this method returns nil if there are no changes between the original -// and the receiver. -- (id)patchObjectFromOriginal:(GTLObject *)original; - -// Method creating a null value to set object properties for patch queries that -// delete fields. Do not use this except when setting an object property for -// a patch query. -+ (id)nullValue; - -/////////////////////////////////////////////////////////////////////////////// -// -// Protected methods -// -// These methods are intended for subclasses of GTLObject -// - -// class registration ("kind" strings) for subclasses -+ (Class)registeredObjectClassForKind:(NSString *)kind; -+ (void)registerObjectClassForKind:(NSString *)kind; - -// creation of objects from a JSON dictionary -+ (GTLObject *)objectForJSON:(NSMutableDictionary *)json - defaultClass:(Class)defaultClass - surrogates:(NSDictionary *)surrogates - batchClassMap:(NSDictionary *)batchClassMap; - -// property-to-key mapping (for JSON keys which are not used as method names) -+ (NSDictionary *)propertyToJSONKeyMap; - -// property-to-Class mapping for array properties (to say what is in the array) -+ (NSDictionary *)arrayPropertyToClassMap; - -// The default class for additional JSON keys -+ (Class)classForAdditionalProperties; - -@end - -// Collection objects with an "items" property should derive from GTLCollection -// object. This provides support for fast object enumeration, the -// itemAtIndex: convenience method, and indexed subscripts. -// -// Subclasses must implement the items method dynamically. -@interface GTLCollectionObject : GTLObject { - @private - NSDictionary *identifierMap_; -} - -// itemAtIndex: and objectAtIndexedSubscript: return nil when the index exceeds -// the bounds of the items array. -- (id)itemAtIndex:(NSUInteger)idx; - -- (id)objectAtIndexedSubscript:(NSInteger)idx; - -// itemForIdentifier: looks up items from the collection object by identifier, -// and returns the first one. -// -// Typically, items will have a unique identifier (with key "id" in the -// object's JSON). This method returns the first item found in the collection -// with the specified identifier. -// -// The first time this method is used, the collection will cache a map of -// identifiers to items. If the items list for the instance somehow changes, -// use the reset method below to force a new cache to be created for this -// collection. -- (id)itemForIdentifier:(NSString *)key GTL_NONNULL((1)); - -// Identifiers for all items are cached when the first one is obtained. -// This method resets the cache. It is needed only if the item list has -// changed. -- (void)resetIdentifierMap; - -@end - -@interface GTLCollectionObject (DynamicMethods) -- (NSArray *)items; -@end - -// Base object use for when an service method directly returns an array instead -// of an object. Normally methods should return an object with an 'items' -// property, but this exists for the methods not up to spec. -@interface GTLResultArray : GTLCollectionObject -// This method should only be called by subclasses. -- (NSArray *)itemsWithItemClass:(Class)itemClass; -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlus.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlus.h deleted file mode 100644 index 220410bb..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlus.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlus.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ - -#import "GTLPlusConstants.h" - -#import "GTLPlusAcl.h" -#import "GTLPlusAclentryResource.h" -#import "GTLPlusActivity.h" -#import "GTLPlusActivityFeed.h" -#import "GTLPlusComment.h" -#import "GTLPlusCommentFeed.h" -#import "GTLPlusItemScope.h" -#import "GTLPlusMoment.h" -#import "GTLPlusMomentsFeed.h" -#import "GTLPlusPeopleFeed.h" -#import "GTLPlusPerson.h" - -#import "GTLQueryPlus.h" -#import "GTLServicePlus.h" diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusAcl.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusAcl.h deleted file mode 100644 index aad4f65e..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusAcl.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusAcl.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusAcl (0 custom class methods, 3 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusAclentryResource; - -// ---------------------------------------------------------------------------- -// -// GTLPlusAcl -// - -// This class supports NSFastEnumeration over its "items" property. It also -// supports -itemAtIndex: to retrieve individual objects from "items". - -@interface GTLPlusAcl : GTLCollectionObject - -// Description of the access granted, suitable for display. -// Remapped to 'descriptionProperty' to avoid NSObject's 'description'. -@property (copy) NSString *descriptionProperty; - -// The list of access entries. -@property (retain) NSArray *items; // of GTLPlusAclentryResource - -// Identifies this resource as a collection of access controls. Value: -// "plus#acl". -@property (copy) NSString *kind; - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusAclentryResource.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusAclentryResource.h deleted file mode 100644 index 30634e8d..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusAclentryResource.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusAclentryResource.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusAclentryResource (0 custom class methods, 3 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -// ---------------------------------------------------------------------------- -// -// GTLPlusAclentryResource -// - -@interface GTLPlusAclentryResource : GTLObject - -// A descriptive name for this entry. Suitable for display. -@property (copy) NSString *displayName; - -// The ID of the entry. For entries of type "person" or "circle", this is the ID -// of the resource. For other types, this property is not set. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The type of entry describing to whom access is granted. Possible values are: -// - "person" - Access to an individual. -// - "circle" - Access to members of a circle. -// - "myCircles" - Access to members of all the person's circles. -// - "extendedCircles" - Access to members of everyone in a person's circles, -// plus all of the people in their circles. -// - "public" - Access to anyone on the web. -@property (copy) NSString *type; - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusActivity.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusActivity.h deleted file mode 100644 index ce4b9417..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusActivity.h +++ /dev/null @@ -1,493 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusActivity.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusActivity (0 custom class methods, 19 custom properties) -// GTLPlusActivityActor (0 custom class methods, 5 custom properties) -// GTLPlusActivityObject (0 custom class methods, 10 custom properties) -// GTLPlusActivityProvider (0 custom class methods, 1 custom properties) -// GTLPlusActivityActorImage (0 custom class methods, 1 custom properties) -// GTLPlusActivityActorName (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectActor (0 custom class methods, 4 custom properties) -// GTLPlusActivityObjectAttachmentsItem (0 custom class methods, 9 custom properties) -// GTLPlusActivityObjectPlusoners (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectReplies (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectResharers (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectActorImage (0 custom class methods, 1 custom properties) -// GTLPlusActivityObjectAttachmentsItemEmbed (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectAttachmentsItemFullImage (0 custom class methods, 4 custom properties) -// GTLPlusActivityObjectAttachmentsItemImage (0 custom class methods, 4 custom properties) -// GTLPlusActivityObjectAttachmentsItemThumbnailsItem (0 custom class methods, 3 custom properties) -// GTLPlusActivityObjectAttachmentsItemThumbnailsItemImage (0 custom class methods, 4 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusAcl; -@class GTLPlusActivityActor; -@class GTLPlusActivityActorImage; -@class GTLPlusActivityActorName; -@class GTLPlusActivityObject; -@class GTLPlusActivityObjectActor; -@class GTLPlusActivityObjectActorImage; -@class GTLPlusActivityObjectAttachmentsItem; -@class GTLPlusActivityObjectAttachmentsItemEmbed; -@class GTLPlusActivityObjectAttachmentsItemFullImage; -@class GTLPlusActivityObjectAttachmentsItemImage; -@class GTLPlusActivityObjectAttachmentsItemThumbnailsItem; -@class GTLPlusActivityObjectAttachmentsItemThumbnailsItemImage; -@class GTLPlusActivityObjectPlusoners; -@class GTLPlusActivityObjectReplies; -@class GTLPlusActivityObjectResharers; -@class GTLPlusActivityProvider; - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivity -// - -@interface GTLPlusActivity : GTLObject - -// Identifies who has access to see this activity. -@property (retain) GTLPlusAcl *access; - -// The person who performed this activity. -@property (retain) GTLPlusActivityActor *actor; - -// Street address where this activity occurred. -@property (copy) NSString *address; - -// Additional content added by the person who shared this activity, applicable -// only when resharing an activity. -@property (copy) NSString *annotation; - -// If this activity is a crosspost from another system, this property specifies -// the ID of the original activity. -@property (copy) NSString *crosspostSource; - -// ETag of this response for caching purposes. -@property (copy) NSString *ETag; - -// Latitude and longitude where this activity occurred. Format is latitude -// followed by longitude, space separated. -@property (copy) NSString *geocode; - -// The ID of this activity. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// Identifies this resource as an activity. Value: "plus#activity". -@property (copy) NSString *kind; - -// The object of this activity. -@property (retain) GTLPlusActivityObject *object; - -// ID of the place where this activity occurred. -@property (copy) NSString *placeId; - -// Name of the place where this activity occurred. -@property (copy) NSString *placeName; - -// The service provider that initially published this activity. -@property (retain) GTLPlusActivityProvider *provider; - -// The time at which this activity was initially published. Formatted as an RFC -// 3339 timestamp. -@property (retain) GTLDateTime *published; - -// Radius, in meters, of the region where this activity occurred, centered at -// the latitude and longitude identified in geocode. -@property (copy) NSString *radius; - -// Title of this activity. -@property (copy) NSString *title; - -// The time at which this activity was last updated. Formatted as an RFC 3339 -// timestamp. -@property (retain) GTLDateTime *updated; - -// The link to this activity. -@property (copy) NSString *url; - -// This activity's verb, indicating what action was performed. Possible values -// are: -// - "post" - Publish content to the stream. -// - "share" - Reshare an activity. -@property (copy) NSString *verb; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityActor -// - -@interface GTLPlusActivityActor : GTLObject - -// The name of the actor, suitable for display. -@property (copy) NSString *displayName; - -// The ID of the actor's person resource. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The image representation of the actor. -@property (retain) GTLPlusActivityActorImage *image; - -// An object representation of the individual components of name. -@property (retain) GTLPlusActivityActorName *name; - -// The link to the actor's Google profile. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObject -// - -@interface GTLPlusActivityObject : GTLObject - -// If this activity's object is itself another activity (for example, when a -// person reshares an activity), this property specifies the original activity's -// actor. -@property (retain) GTLPlusActivityObjectActor *actor; - -// The media objects attached to this activity. -@property (retain) NSArray *attachments; // of GTLPlusActivityObjectAttachmentsItem - -// The HTML-formatted content, suitable for display. -@property (copy) NSString *content; - -// The ID of the object. When resharing an activity, this is the ID of the -// activity being reshared. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The type of the object. Possible values are: -// - "note" - Textual content. -// - "activity" - A Google+ activity. -@property (copy) NSString *objectType; - -// The content (text) as provided by the author, stored without any HTML -// formatting. When creating or updating an activity, this value must be -// supplied as plain text in the request. -@property (copy) NSString *originalContent; - -// People who +1'd this activity. -@property (retain) GTLPlusActivityObjectPlusoners *plusoners; - -// Comments in reply to this activity. -@property (retain) GTLPlusActivityObjectReplies *replies; - -// People who reshared this activity. -@property (retain) GTLPlusActivityObjectResharers *resharers; - -// The URL that points to the linked resource. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityProvider -// - -@interface GTLPlusActivityProvider : GTLObject - -// Name of the service provider. -@property (copy) NSString *title; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityActorImage -// - -@interface GTLPlusActivityActorImage : GTLObject - -// The URL of the actor's profile photo. To re-size the image and crop it to a -// square, append the query string ?sz=x, where x is the dimension in pixels of -// each side. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityActorName -// - -@interface GTLPlusActivityActorName : GTLObject - -// The family name (last name) of the actor. -@property (copy) NSString *familyName; - -// The given name (first name) of the actor. -@property (copy) NSString *givenName; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectActor -// - -@interface GTLPlusActivityObjectActor : GTLObject - -// The original actor's name, suitable for display. -@property (copy) NSString *displayName; - -// ID of the original actor. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The image representation of the original actor. -@property (retain) GTLPlusActivityObjectActorImage *image; - -// A link to the original actor's Google profile. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItem -// - -@interface GTLPlusActivityObjectAttachmentsItem : GTLObject - -// If the attachment is an article, this property contains a snippet of text -// from the article. It can also include descriptions for other types. -@property (copy) NSString *content; - -// The title of the attachment (such as a photo caption or an article title). -@property (copy) NSString *displayName; - -// If the attachment is a video, the embeddable link. -@property (retain) GTLPlusActivityObjectAttachmentsItemEmbed *embed; - -// The full image URL for photo attachments. -@property (retain) GTLPlusActivityObjectAttachmentsItemFullImage *fullImage; - -// The ID of the attachment. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The preview image for photos or videos. -@property (retain) GTLPlusActivityObjectAttachmentsItemImage *image; - -// The type of media object. Possible values are: -// - "photo" - A photo. -// - "album" - A photo album. -// - "video" - A video. -// - "article" - An article, specified by a link. -@property (copy) NSString *objectType; - -// If the attachment is an album, potential additional thumbnails from the -// album. -@property (retain) NSArray *thumbnails; // of GTLPlusActivityObjectAttachmentsItemThumbnailsItem - -// The link to the attachment, should be of type text/html. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectPlusoners -// - -@interface GTLPlusActivityObjectPlusoners : GTLObject - -// The URL for the collection of people who +1'd this activity. -@property (copy) NSString *selfLink; - -// Total number of people who +1'd this activity. -@property (retain) NSNumber *totalItems; // unsignedIntValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectReplies -// - -@interface GTLPlusActivityObjectReplies : GTLObject - -// The URL for the collection of comments in reply to this activity. -@property (copy) NSString *selfLink; - -// Total number of comments on this activity. -@property (retain) NSNumber *totalItems; // unsignedIntValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectResharers -// - -@interface GTLPlusActivityObjectResharers : GTLObject - -// The URL for the collection of resharers. -@property (copy) NSString *selfLink; - -// Total number of people who reshared this activity. -@property (retain) NSNumber *totalItems; // unsignedIntValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectActorImage -// - -@interface GTLPlusActivityObjectActorImage : GTLObject - -// A URL that points to a thumbnail photo of the original actor. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemEmbed -// - -@interface GTLPlusActivityObjectAttachmentsItemEmbed : GTLObject - -// Media type of the link. -@property (copy) NSString *type; - -// URL of the link. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemFullImage -// - -@interface GTLPlusActivityObjectAttachmentsItemFullImage : GTLObject - -// The height, in pixels, of the linked resource. -@property (retain) NSNumber *height; // unsignedIntValue - -// Media type of the link. -@property (copy) NSString *type; - -// URL to the image. -@property (copy) NSString *url; - -// The width, in pixels, of the linked resource. -@property (retain) NSNumber *width; // unsignedIntValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemImage -// - -@interface GTLPlusActivityObjectAttachmentsItemImage : GTLObject - -// The height, in pixels, of the linked resource. -@property (retain) NSNumber *height; // unsignedIntValue - -// Media type of the link. -@property (copy) NSString *type; - -// Image url. -@property (copy) NSString *url; - -// The width, in pixels, of the linked resource. -@property (retain) NSNumber *width; // unsignedIntValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemThumbnailsItem -// - -@interface GTLPlusActivityObjectAttachmentsItemThumbnailsItem : GTLObject - -// Potential name of the thumbnail. -// Remapped to 'descriptionProperty' to avoid NSObject's 'description'. -@property (copy) NSString *descriptionProperty; - -// Image resource. -@property (retain) GTLPlusActivityObjectAttachmentsItemThumbnailsItemImage *image; - -// URL to the webpage containing the image. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemThumbnailsItemImage -// - -@interface GTLPlusActivityObjectAttachmentsItemThumbnailsItemImage : GTLObject - -// The height, in pixels, of the linked resource. -@property (retain) NSNumber *height; // unsignedIntValue - -// Media type of the link. -@property (copy) NSString *type; - -// Image url. -@property (copy) NSString *url; - -// The width, in pixels, of the linked resource. -@property (retain) NSNumber *width; // unsignedIntValue - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusActivityFeed.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusActivityFeed.h deleted file mode 100644 index f99ca32f..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusActivityFeed.h +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusActivityFeed.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusActivityFeed (0 custom class methods, 9 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusActivity; - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityFeed -// - -// This class supports NSFastEnumeration over its "items" property. It also -// supports -itemAtIndex: to retrieve individual objects from "items". - -@interface GTLPlusActivityFeed : GTLCollectionObject - -// ETag of this response for caching purposes. -@property (copy) NSString *ETag; - -// The ID of this collection of activities. Deprecated. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The activities in this page of results. -@property (retain) NSArray *items; // of GTLPlusActivity - -// Identifies this resource as a collection of activities. Value: -// "plus#activityFeed". -@property (copy) NSString *kind; - -// Link to the next page of activities. -@property (copy) NSString *nextLink; - -// The continuation token, which is used to page through large result sets. -// Provide this value in a subsequent request to return the next page of -// results. -@property (copy) NSString *nextPageToken; - -// Link to this activity resource. -@property (copy) NSString *selfLink; - -// The title of this collection of activities. -@property (copy) NSString *title; - -// The time at which this collection of activities was last updated. Formatted -// as an RFC 3339 timestamp. -@property (retain) GTLDateTime *updated; - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusComment.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusComment.h deleted file mode 100644 index 4698576a..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusComment.h +++ /dev/null @@ -1,183 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusComment.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusComment (0 custom class methods, 11 custom properties) -// GTLPlusCommentActor (0 custom class methods, 4 custom properties) -// GTLPlusCommentInReplyToItem (0 custom class methods, 2 custom properties) -// GTLPlusCommentObject (0 custom class methods, 3 custom properties) -// GTLPlusCommentPlusoners (0 custom class methods, 1 custom properties) -// GTLPlusCommentActorImage (0 custom class methods, 1 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusCommentActor; -@class GTLPlusCommentActorImage; -@class GTLPlusCommentInReplyToItem; -@class GTLPlusCommentObject; -@class GTLPlusCommentPlusoners; - -// ---------------------------------------------------------------------------- -// -// GTLPlusComment -// - -@interface GTLPlusComment : GTLObject - -// The person who posted this comment. -@property (retain) GTLPlusCommentActor *actor; - -// ETag of this response for caching purposes. -@property (copy) NSString *ETag; - -// The ID of this comment. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The activity this comment replied to. -@property (retain) NSArray *inReplyTo; // of GTLPlusCommentInReplyToItem - -// Identifies this resource as a comment. Value: "plus#comment". -@property (copy) NSString *kind; - -// The object of this comment. -@property (retain) GTLPlusCommentObject *object; - -// People who +1'd this comment. -@property (retain) GTLPlusCommentPlusoners *plusoners; - -// The time at which this comment was initially published. Formatted as an RFC -// 3339 timestamp. -@property (retain) GTLDateTime *published; - -// Link to this comment resource. -@property (copy) NSString *selfLink; - -// The time at which this comment was last updated. Formatted as an RFC 3339 -// timestamp. -@property (retain) GTLDateTime *updated; - -// This comment's verb, indicating what action was performed. Possible values -// are: -// - "post" - Publish content to the stream. -@property (copy) NSString *verb; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentActor -// - -@interface GTLPlusCommentActor : GTLObject - -// The name of this actor, suitable for display. -@property (copy) NSString *displayName; - -// The ID of the actor. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The image representation of this actor. -@property (retain) GTLPlusCommentActorImage *image; - -// A link to the person resource for this actor. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentInReplyToItem -// - -@interface GTLPlusCommentInReplyToItem : GTLObject - -// The ID of the activity. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The URL of the activity. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentObject -// - -@interface GTLPlusCommentObject : GTLObject - -// The HTML-formatted content, suitable for display. -@property (copy) NSString *content; - -// The object type of this comment. Possible values are: -// - "comment" - A comment in reply to an activity. -@property (copy) NSString *objectType; - -// The content (text) as provided by the author, stored without any HTML -// formatting. When creating or updating a comment, this value must be supplied -// as plain text in the request. -@property (copy) NSString *originalContent; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentPlusoners -// - -@interface GTLPlusCommentPlusoners : GTLObject - -// Total number of people who +1'd this comment. -@property (retain) NSNumber *totalItems; // unsignedIntValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentActorImage -// - -@interface GTLPlusCommentActorImage : GTLObject - -// The URL of the actor's profile photo. To re-size the image and crop it to a -// square, append the query string ?sz=x, where x is the dimension in pixels of -// each side. -@property (copy) NSString *url; - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusCommentFeed.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusCommentFeed.h deleted file mode 100644 index 74f9be5a..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusCommentFeed.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusCommentFeed.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusCommentFeed (0 custom class methods, 8 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusComment; - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentFeed -// - -// This class supports NSFastEnumeration over its "items" property. It also -// supports -itemAtIndex: to retrieve individual objects from "items". - -@interface GTLPlusCommentFeed : GTLCollectionObject - -// ETag of this response for caching purposes. -@property (copy) NSString *ETag; - -// The ID of this collection of comments. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The comments in this page of results. -@property (retain) NSArray *items; // of GTLPlusComment - -// Identifies this resource as a collection of comments. Value: -// "plus#commentFeed". -@property (copy) NSString *kind; - -// Link to the next page of activities. -@property (copy) NSString *nextLink; - -// The continuation token, which is used to page through large result sets. -// Provide this value in a subsequent request to return the next page of -// results. -@property (copy) NSString *nextPageToken; - -// The title of this collection of comments. -@property (copy) NSString *title; - -// The time at which this collection of comments was last updated. Formatted as -// an RFC 3339 timestamp. -@property (retain) GTLDateTime *updated; - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusConstants.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusConstants.h deleted file mode 100644 index b5e87ad7..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusConstants.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusConstants.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ - -#import - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLDefines.h" -#else - #import "GTLDefines.h" -#endif - -// Authorization scope -// Know your name, basic info, and list of people you're connected to on Google+ -GTL_EXTERN NSString * const kGTLAuthScopePlusLogin; // "https://www.googleapis.com/auth/plus.login" -// Know who you are on Google -GTL_EXTERN NSString * const kGTLAuthScopePlusMe; // "https://www.googleapis.com/auth/plus.me" - -// Collection -GTL_EXTERN NSString * const kGTLPlusCollectionPlusoners; // "plusoners" -GTL_EXTERN NSString * const kGTLPlusCollectionPublic; // "public" -GTL_EXTERN NSString * const kGTLPlusCollectionResharers; // "resharers" -GTL_EXTERN NSString * const kGTLPlusCollectionVault; // "vault" -GTL_EXTERN NSString * const kGTLPlusCollectionVisible; // "visible" - -// OrderBy -GTL_EXTERN NSString * const kGTLPlusOrderByAlphabetical; // "alphabetical" -GTL_EXTERN NSString * const kGTLPlusOrderByBest; // "best" -GTL_EXTERN NSString * const kGTLPlusOrderByRecent; // "recent" - -// SortOrder -GTL_EXTERN NSString * const kGTLPlusSortOrderAscending; // "ascending" -GTL_EXTERN NSString * const kGTLPlusSortOrderDescending; // "descending" diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusItemScope.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusItemScope.h deleted file mode 100644 index 17e2b371..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusItemScope.h +++ /dev/null @@ -1,225 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusItemScope.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusItemScope (0 custom class methods, 55 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusItemScope; - -// ---------------------------------------------------------------------------- -// -// GTLPlusItemScope -// - -@interface GTLPlusItemScope : GTLObject - -// The subject matter of the content. -@property (retain) GTLPlusItemScope *about; - -// An additional name for a Person, can be used for a middle name. -@property (retain) NSArray *additionalName; // of NSString - -// Postal address. -@property (retain) GTLPlusItemScope *address; - -// Address country. -@property (copy) NSString *addressCountry; - -// Address locality. -@property (copy) NSString *addressLocality; - -// Address region. -@property (copy) NSString *addressRegion; - -// The encoding. -@property (retain) NSArray *associatedMedia; // of GTLPlusItemScope - -// Number of attendees. -@property (retain) NSNumber *attendeeCount; // intValue - -// A person attending the event. -@property (retain) NSArray *attendees; // of GTLPlusItemScope - -// From http://schema.org/MusicRecording, the audio file. -@property (retain) GTLPlusItemScope *audio; - -// The person who created this scope. -@property (retain) NSArray *author; // of GTLPlusItemScope - -// Best possible rating value. -@property (copy) NSString *bestRating; - -// Date of birth. -@property (copy) NSString *birthDate; - -// From http://schema.org/MusicRecording, the artist that performed this -// recording. -@property (retain) GTLPlusItemScope *byArtist; - -// The caption for this object. -@property (copy) NSString *caption; - -// File size in (mega/kilo) bytes. -@property (copy) NSString *contentSize; - -// Actual bytes of the media object, for example the image file or video file. -@property (copy) NSString *contentUrl; - -// The list of contributors for this scope. -@property (retain) NSArray *contributor; // of GTLPlusItemScope - -// The date this scope was created. -@property (copy) NSString *dateCreated; - -// The date this scope was last modified. -@property (copy) NSString *dateModified; - -// The initial date this scope was published. -@property (copy) NSString *datePublished; - -// The string describing the content of this scope. -// Remapped to 'descriptionProperty' to avoid NSObject's 'description'. -@property (copy) NSString *descriptionProperty; - -// The duration of the item (movie, audio recording, event, etc.) in ISO 8601 -// date format. -@property (copy) NSString *duration; - -// A URL pointing to a player for a specific video. In general, this is the -// information in the src element of an embed tag and should not be the same as -// the content of the loc tag. -@property (copy) NSString *embedUrl; - -// The end date and time of the event (in ISO 8601 date format). -@property (copy) NSString *endDate; - -// Family name. In the U.S., the last name of an Person. This can be used along -// with givenName instead of the Name property. -@property (copy) NSString *familyName; - -// Gender of the person. -@property (copy) NSString *gender; - -// Geo coordinates. -@property (retain) GTLPlusItemScope *geo; - -// Given name. In the U.S., the first name of a Person. This can be used along -// with familyName instead of the Name property. -@property (copy) NSString *givenName; - -// The height of the media object. -@property (copy) NSString *height; - -// The id for this item scope. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// A url to the image for this scope. -@property (copy) NSString *image; - -// From http://schema.org/MusicRecording, which album a song is in. -@property (retain) GTLPlusItemScope *inAlbum; - -// Identifies this resource as an itemScope. -@property (copy) NSString *kind; - -// Latitude. -@property (retain) NSNumber *latitude; // doubleValue - -// The location of the event or organization. -@property (retain) GTLPlusItemScope *location; - -// Longitude. -@property (retain) NSNumber *longitude; // doubleValue - -// The name of this scope. -@property (copy) NSString *name; - -// Property of http://schema.org/TVEpisode indicating which series the episode -// belongs to. -@property (retain) GTLPlusItemScope *partOfTVSeries; - -// The main performer or performers of the event-for example, a presenter, -// musician, or actor. -@property (retain) NSArray *performers; // of GTLPlusItemScope - -// Player type required-for example, Flash or Silverlight. -@property (copy) NSString *playerType; - -// Postal code. -@property (copy) NSString *postalCode; - -// Post office box number. -@property (copy) NSString *postOfficeBoxNumber; - -// Rating value. -@property (copy) NSString *ratingValue; - -// Review rating. -@property (retain) GTLPlusItemScope *reviewRating; - -// The start date and time of the event (in ISO 8601 date format). -@property (copy) NSString *startDate; - -// Street address. -@property (copy) NSString *streetAddress; - -// Comment text, review text, etc. -@property (copy) NSString *text; - -// Thumbnail image for an image or video. -@property (retain) GTLPlusItemScope *thumbnail; - -// A url to a thumbnail image for this scope. -@property (copy) NSString *thumbnailUrl; - -// The exchange traded instrument associated with a Corporation object. The -// tickerSymbol is expressed as an exchange and an instrument name separated by -// a space character. For the exchange component of the tickerSymbol attribute, -// we reccommend using the controlled vocaulary of Market Identifier Codes (MIC) -// specified in ISO15022. -@property (copy) NSString *tickerSymbol; - -// The item type. -@property (copy) NSString *type; - -// A URL for the item upon which the action was performed. -@property (copy) NSString *url; - -// The width of the media object. -@property (copy) NSString *width; - -// Worst possible rating value. -@property (copy) NSString *worstRating; - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusMoment.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusMoment.h deleted file mode 100644 index 0b028c88..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusMoment.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusMoment.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusMoment (0 custom class methods, 6 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusItemScope; - -// ---------------------------------------------------------------------------- -// -// GTLPlusMoment -// - -@interface GTLPlusMoment : GTLObject - -// The moment ID. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// Identifies this resource as a moment. -@property (copy) NSString *kind; - -// The object generated by performing the action on the item -@property (retain) GTLPlusItemScope *result; - -// Time stamp of when the action occurred in RFC3339 format. -@property (retain) GTLDateTime *startDate; - -// The object on which the action was performed. -@property (retain) GTLPlusItemScope *target; - -// The schema.org activity type. -@property (copy) NSString *type; - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusMomentsFeed.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusMomentsFeed.h deleted file mode 100644 index 6cc8106b..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusMomentsFeed.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusMomentsFeed.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusMomentsFeed (0 custom class methods, 8 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusMoment; - -// ---------------------------------------------------------------------------- -// -// GTLPlusMomentsFeed -// - -// This class supports NSFastEnumeration over its "items" property. It also -// supports -itemAtIndex: to retrieve individual objects from "items". - -@interface GTLPlusMomentsFeed : GTLCollectionObject - -// ETag of this response for caching purposes. -@property (copy) NSString *ETag; - -// The moments in this page of results. -@property (retain) NSArray *items; // of GTLPlusMoment - -// Identifies this resource as a collection of moments. Value: -// "plus#momentsFeed". -@property (copy) NSString *kind; - -// Link to the next page of moments. -@property (copy) NSString *nextLink; - -// The continuation token, which is used to page through large result sets. -// Provide this value in a subsequent request to return the next page of -// results. -@property (copy) NSString *nextPageToken; - -// Link to this page of moments. -@property (copy) NSString *selfLink; - -// The title of this collection of moments. -@property (copy) NSString *title; - -// The RFC 339 timestamp for when this collection of moments was last updated. -@property (retain) GTLDateTime *updated; - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusPeopleFeed.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusPeopleFeed.h deleted file mode 100644 index 523afadd..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusPeopleFeed.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusPeopleFeed.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusPeopleFeed (0 custom class methods, 7 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusPerson; - -// ---------------------------------------------------------------------------- -// -// GTLPlusPeopleFeed -// - -// This class supports NSFastEnumeration over its "items" property. It also -// supports -itemAtIndex: to retrieve individual objects from "items". - -@interface GTLPlusPeopleFeed : GTLCollectionObject - -// ETag of this response for caching purposes. -@property (copy) NSString *ETag; - -// The people in this page of results. Each item includes the id, displayName, -// image, and url for the person. To retrieve additional profile data, see the -// people.get method. -@property (retain) NSArray *items; // of GTLPlusPerson - -// Identifies this resource as a collection of people. Value: "plus#peopleFeed". -@property (copy) NSString *kind; - -// The continuation token, which is used to page through large result sets. -// Provide this value in a subsequent request to return the next page of -// results. -@property (copy) NSString *nextPageToken; - -// Link to this resource. -@property (copy) NSString *selfLink; - -// The title of this collection of people. -@property (copy) NSString *title; - -// The total number of people available in this list. The number of people in a -// response might be smaller due to paging. This might not be set for all -// collections. -@property (retain) NSNumber *totalItems; // intValue - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusPerson.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusPerson.h deleted file mode 100644 index 57ae94ed..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLPlusPerson.h +++ /dev/null @@ -1,388 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusPerson.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusPerson (0 custom class methods, 28 custom properties) -// GTLPlusPersonAgeRange (0 custom class methods, 2 custom properties) -// GTLPlusPersonCover (0 custom class methods, 3 custom properties) -// GTLPlusPersonEmailsItem (0 custom class methods, 3 custom properties) -// GTLPlusPersonImage (0 custom class methods, 1 custom properties) -// GTLPlusPersonName (0 custom class methods, 6 custom properties) -// GTLPlusPersonOrganizationsItem (0 custom class methods, 9 custom properties) -// GTLPlusPersonPlacesLivedItem (0 custom class methods, 2 custom properties) -// GTLPlusPersonUrlsItem (0 custom class methods, 3 custom properties) -// GTLPlusPersonCoverCoverInfo (0 custom class methods, 2 custom properties) -// GTLPlusPersonCoverCoverPhoto (0 custom class methods, 3 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusPersonAgeRange; -@class GTLPlusPersonCover; -@class GTLPlusPersonCoverCoverInfo; -@class GTLPlusPersonCoverCoverPhoto; -@class GTLPlusPersonEmailsItem; -@class GTLPlusPersonImage; -@class GTLPlusPersonName; -@class GTLPlusPersonOrganizationsItem; -@class GTLPlusPersonPlacesLivedItem; -@class GTLPlusPersonUrlsItem; - -// ---------------------------------------------------------------------------- -// -// GTLPlusPerson -// - -@interface GTLPlusPerson : GTLObject - -// A short biography for this person. -@property (copy) NSString *aboutMe; - -// The age range of the person. -@property (retain) GTLPlusPersonAgeRange *ageRange; - -// The person's date of birth, represented as YYYY-MM-DD. -@property (copy) NSString *birthday; - -// The "bragging rights" line of this person. -@property (copy) NSString *braggingRights; - -// If a Google+ Page and for followers who are visible, the number of people who -// have added this page to a circle. -@property (retain) NSNumber *circledByCount; // intValue - -// The cover photo content. -@property (retain) GTLPlusPersonCover *cover; - -// The current location for this person. -@property (copy) NSString *currentLocation; - -// The name of this person, suitable for display. -@property (copy) NSString *displayName; - -// A list of email addresses for this person. -@property (retain) NSArray *emails; // of GTLPlusPersonEmailsItem - -// ETag of this response for caching purposes. -@property (copy) NSString *ETag; - -// The person's gender. Possible values are: -// - "male" - Male gender. -// - "female" - Female gender. -// - "other" - Other. -@property (copy) NSString *gender; - -// If "true", indicates that the person has installed the app that is making the -// request and has chosen to expose this install state to the caller. A value of -// "false" indicates that the install state cannot be determined (it is either -// not installed or the person has chosen to keep this information private). -@property (retain) NSNumber *hasApp; // boolValue - -// The ID of this person. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The representation of the person's profile photo. -@property (retain) GTLPlusPersonImage *image; - -// Whether this user has signed up for Google+. -@property (retain) NSNumber *isPlusUser; // boolValue - -// Identifies this resource as a person. Value: "plus#person". -@property (copy) NSString *kind; - -// The user's preferred language for rendering. -@property (copy) NSString *language; - -// An object representation of the individual components of a person's name. -@property (retain) GTLPlusPersonName *name; - -// The nickname of this person. -@property (copy) NSString *nickname; - -// Type of person within Google+. Possible values are: -// - "person" - represents an actual person. -// - "page" - represents a page. -@property (copy) NSString *objectType; - -// A list of current or past organizations with which this person is associated. -@property (retain) NSArray *organizations; // of GTLPlusPersonOrganizationsItem - -// A list of places where this person has lived. -@property (retain) NSArray *placesLived; // of GTLPlusPersonPlacesLivedItem - -// If a Google+ Page, the number of people who have +1'ed this page. -@property (retain) NSNumber *plusOneCount; // intValue - -// The person's relationship status. Possible values are: -// - "single" - Person is single. -// - "in_a_relationship" - Person is in a relationship. -// - "engaged" - Person is engaged. -// - "married" - Person is married. -// - "its_complicated" - The relationship is complicated. -// - "open_relationship" - Person is in an open relationship. -// - "widowed" - Person is widowed. -// - "in_domestic_partnership" - Person is in a domestic partnership. -// - "in_civil_union" - Person is in a civil union. -@property (copy) NSString *relationshipStatus; - -// The brief description (tagline) of this person. -@property (copy) NSString *tagline; - -// The URL of this person's profile. -@property (copy) NSString *url; - -// A list of URLs for this person. -@property (retain) NSArray *urls; // of GTLPlusPersonUrlsItem - -// Whether the person or Google+ Page has been verified. -@property (retain) NSNumber *verified; // boolValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonAgeRange -// - -@interface GTLPlusPersonAgeRange : GTLObject - -// The age range's upper bound, if any. -@property (retain) NSNumber *max; // intValue - -// The age range's lower bound, if any. -@property (retain) NSNumber *min; // intValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonCover -// - -@interface GTLPlusPersonCover : GTLObject - -// Extra information about the cover photo. -@property (retain) GTLPlusPersonCoverCoverInfo *coverInfo; - -// The person's primary cover image. -@property (retain) GTLPlusPersonCoverCoverPhoto *coverPhoto; - -// The layout of the cover art. Possible values are: -// - "banner" - One large image banner. -@property (copy) NSString *layout; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonEmailsItem -// - -@interface GTLPlusPersonEmailsItem : GTLObject - -// If "true", indicates this email address is the person's primary one. -@property (retain) NSNumber *primary; // boolValue - -// The type of address. Possible values are: -// - "home" - Home email address. -// - "work" - Work email address. -// - "other" - Other. -@property (copy) NSString *type; - -// The email address. -@property (copy) NSString *value; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonImage -// - -@interface GTLPlusPersonImage : GTLObject - -// The URL of the person's profile photo. To re-size the image and crop it to a -// square, append the query string ?sz=x, where x is the dimension in pixels of -// each side. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonName -// - -@interface GTLPlusPersonName : GTLObject - -// The family name (last name) of this person. -@property (copy) NSString *familyName; - -// The full name of this person, including middle names, suffixes, etc. -@property (copy) NSString *formatted; - -// The given name (first name) of this person. -@property (copy) NSString *givenName; - -// The honorific prefixes (such as "Dr." or "Mrs.") for this person. -@property (copy) NSString *honorificPrefix; - -// The honorific suffixes (such as "Jr.") for this person. -@property (copy) NSString *honorificSuffix; - -// The middle name of this person. -@property (copy) NSString *middleName; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonOrganizationsItem -// - -@interface GTLPlusPersonOrganizationsItem : GTLObject - -// The department within the organization. Deprecated. -@property (copy) NSString *department; - -// A short description of the person's role in this organization. Deprecated. -// Remapped to 'descriptionProperty' to avoid NSObject's 'description'. -@property (copy) NSString *descriptionProperty; - -// The date the person left this organization. -@property (copy) NSString *endDate; - -// The location of this organization. Deprecated. -@property (copy) NSString *location; - -// The name of the organization. -@property (copy) NSString *name; - -// If "true", indicates this organization is the person's primary one (typically -// interpreted as current one). -@property (retain) NSNumber *primary; // boolValue - -// The date the person joined this organization. -@property (copy) NSString *startDate; - -// The person's job title or role within the organization. -@property (copy) NSString *title; - -// The type of organization. Possible values are: -// - "work" - Work. -// - "school" - School. -@property (copy) NSString *type; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonPlacesLivedItem -// - -@interface GTLPlusPersonPlacesLivedItem : GTLObject - -// If "true", this place of residence is this person's primary residence. -@property (retain) NSNumber *primary; // boolValue - -// A place where this person has lived. For example: "Seattle, WA", "Near -// Toronto". -@property (copy) NSString *value; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonUrlsItem -// - -@interface GTLPlusPersonUrlsItem : GTLObject - -// If "true", this URL is the person's primary URL. -@property (retain) NSNumber *primary; // boolValue - -// The type of URL. Possible values are: -// - "home" - URL for home. -// - "work" - URL for work. -// - "blog" - URL for blog. -// - "profile" - URL for profile. -// - "other" - Other. -@property (copy) NSString *type; - -// The URL value. -@property (copy) NSString *value; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonCoverCoverInfo -// - -@interface GTLPlusPersonCoverCoverInfo : GTLObject - -// The difference between the left position of the image cover and the actual -// displayed cover image. Only valid for BANNER layout. -@property (retain) NSNumber *leftImageOffset; // intValue - -// The difference between the top position of the image cover and the actual -// displayed cover image. Only valid for BANNER layout. -@property (retain) NSNumber *topImageOffset; // intValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonCoverCoverPhoto -// - -@interface GTLPlusPersonCoverCoverPhoto : GTLObject - -// The height to the image. -@property (retain) NSNumber *height; // intValue - -// The url to the image. -@property (copy) NSString *url; - -// The width to the image. -@property (retain) NSNumber *width; // intValue - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLQuery.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLQuery.h deleted file mode 100644 index 9d40887e..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLQuery.h +++ /dev/null @@ -1,136 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLQuery.h -// - -// Query documentation: -// https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Query_Operations - -#import "GTLObject.h" -#import "GTLUploadParameters.h" - -@protocol GTLQueryProtocol -- (BOOL)isBatchQuery; -- (BOOL)shouldSkipAuthorization; -- (void)executionDidStop; -- (NSDictionary *)additionalHTTPHeaders; -- (NSDictionary *)urlQueryParameters; -- (GTLUploadParameters *)uploadParameters; -@end - -@protocol GTLQueryCollectionProtocol -@optional -@property (retain) NSString *pageToken; -@property (retain) NSNumber *startIndex; -@end - -@class GTLServiceTicket; - -@interface GTLQuery : NSObject { - @private - NSString *methodName_; - NSMutableDictionary *json_; - GTLObject *bodyObject_; - NSMutableDictionary *childCache_; - NSString *requestID_; - GTLUploadParameters *uploadParameters_; - NSDictionary *urlQueryParameters_; - NSDictionary *additionalHTTPHeaders_; - Class expectedObjectClass_; - BOOL skipAuthorization_; -#if NS_BLOCKS_AVAILABLE - void (^completionBlock_)(GTLServiceTicket *ticket, id object, NSError *error); -#elif !__LP64__ - // Placeholders: for 32-bit builds, keep the size of the object's ivar section - // the same with and without blocks - id completionPlaceholder_; -#endif -} - -// The rpc method name. -@property (readonly) NSString *methodName; - -// The JSON dictionary of all the parameters set on this query. -@property (retain) NSMutableDictionary *JSON; - -// The object set to be uploaded with the query. -@property (retain) GTLObject *bodyObject; - -// Each query must have a request ID string. The user may replace the -// default assigned request ID with a custom string, provided that if -// used in a batch query, all request IDs in the batch must be unique. -@property (copy) NSString *requestID; - -// For queries which support file upload, the MIME type and file handle -// or data must be provided. -@property (copy) GTLUploadParameters *uploadParameters; - -// Any URL query parameters to add to the query (useful for debugging with some -// services). -@property (copy) NSDictionary *urlQueryParameters; - -// Any additional HTTP headers for this query. Not valid when this query -// is added to a batch. -// -// These headers override the same keys from the service object's -// additionalHTTPHeaders. -@property (copy) NSDictionary *additionalHTTPHeaders; - -// The GTLObject subclass expected for results (used if the result doesn't -// include a kind attribute). -@property (assign) Class expectedObjectClass; - -// Clients may set this to YES to disallow authorization. Defaults to NO. -@property (assign) BOOL shouldSkipAuthorization; - -#if NS_BLOCKS_AVAILABLE -// Clients may provide an optional callback block to be called immediately -// before the executeQuery: callback. -// -// The completionBlock property is particularly useful for queries executed -// in a batch. -// -// Errors passed to the completionBlock will have an "underlying" GTLErrorObject -// when the server returned an error for this specific query: -// -// GTLErrorObject *errorObj = [GTLErrorObject underlyingObjectForError:error]; -// if (errorObj) { -// // the server returned this error for this specific query -// } else { -// // the batch execution failed -// } -@property (copy) void (^completionBlock)(GTLServiceTicket *ticket, id object, NSError *error); -#endif - -// methodName is the RPC method name to use. -+ (id)queryWithMethodName:(NSString *)methodName GTL_NONNULL((1)); - -// methodName is the RPC method name to use. -- (id)initWithMethodName:(NSString *)method GTL_NONNULL((1)); - -// If you need to set a parameter that is not listed as a property for a -// query class, you can do so via this api. If you need to clear it after -// setting, pass nil for obj. -- (void)setCustomParameter:(id)obj forKey:(NSString *)key GTL_NONNULL((2)); - -// Auto-generated request IDs -+ (NSString *)nextRequestID; - -// Methods for subclasses to override. -+ (NSDictionary *)parameterNameMap; -+ (NSDictionary *)arrayPropertyToClassMap; -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLQueryPlus.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLQueryPlus.h deleted file mode 100644 index 44b43109..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLQueryPlus.h +++ /dev/null @@ -1,297 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLQueryPlus.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLQueryPlus (12 custom class methods, 15 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLQuery.h" -#else - #import "GTLQuery.h" -#endif - -@class GTLPlusMoment; - -@interface GTLQueryPlus : GTLQuery - -// -// Parameters valid on all methods. -// - -// Selector specifying which fields to include in a partial response. -@property (copy) NSString *fields; - -// -// Method-specific parameters; see the comments below for more information. -// -@property (copy) NSString *activityId; -@property (copy) NSString *collection; -@property (copy) NSString *commentId; -@property (assign) BOOL debug; -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; -@property (copy) NSString *language; -@property (assign) NSUInteger maxResults; -@property (copy) NSString *orderBy; -@property (copy) NSString *pageToken; -@property (copy) NSString *query; -@property (copy) NSString *sortOrder; -@property (copy) NSString *targetUrl; -@property (copy) NSString *type; -@property (copy) NSString *userId; - -#pragma mark - -#pragma mark "activities" methods -// These create a GTLQueryPlus object. - -// Method: plus.activities.get -// Get an activity. -// Required: -// activityId: The ID of the activity to get. -// Authorization scope(s): -// kGTLAuthScopePlusLogin -// kGTLAuthScopePlusMe -// Fetches a GTLPlusActivity. -+ (id)queryForActivitiesGetWithActivityId:(NSString *)activityId; - -// Method: plus.activities.list -// List all of the activities in the specified collection for a particular user. -// Required: -// userId: The ID of the user to get activities for. The special value "me" -// can be used to indicate the authenticated user. -// collection: The collection of activities to list. -// kGTLPlusCollectionPublic: All public activities created by the specified -// user. -// Optional: -// maxResults: The maximum number of activities to include in the response, -// which is used for paging. For any response, the actual number returned -// might be less than the specified maxResults. (1..100, default 20) -// pageToken: The continuation token, which is used to page through large -// result sets. To get the next page of results, set this parameter to the -// value of "nextPageToken" from the previous response. -// Authorization scope(s): -// kGTLAuthScopePlusLogin -// kGTLAuthScopePlusMe -// Fetches a GTLPlusActivityFeed. -+ (id)queryForActivitiesListWithUserId:(NSString *)userId - collection:(NSString *)collection; - -// Method: plus.activities.search -// Search public activities. -// Required: -// query: Full-text search query string. -// Optional: -// language: Specify the preferred language to search with. See search -// language codes for available values. (Default en-US) -// maxResults: The maximum number of activities to include in the response, -// which is used for paging. For any response, the actual number returned -// might be less than the specified maxResults. (1..20, default 10) -// orderBy: Specifies how to order search results. (Default -// kGTLPlusOrderByRecent) -// kGTLPlusOrderByBest: Sort activities by relevance to the user, most -// relevant first. -// kGTLPlusOrderByRecent: Sort activities by published date, most recent -// first. -// pageToken: The continuation token, which is used to page through large -// result sets. To get the next page of results, set this parameter to the -// value of "nextPageToken" from the previous response. This token can be of -// any length. -// Authorization scope(s): -// kGTLAuthScopePlusMe -// Fetches a GTLPlusActivityFeed. -+ (id)queryForActivitiesSearchWithQuery:(NSString *)query; - -#pragma mark - -#pragma mark "comments" methods -// These create a GTLQueryPlus object. - -// Method: plus.comments.get -// Get a comment. -// Required: -// commentId: The ID of the comment to get. -// Authorization scope(s): -// kGTLAuthScopePlusMe -// Fetches a GTLPlusComment. -+ (id)queryForCommentsGetWithCommentId:(NSString *)commentId; - -// Method: plus.comments.list -// List all of the comments for an activity. -// Required: -// activityId: The ID of the activity to get comments for. -// Optional: -// maxResults: The maximum number of comments to include in the response, -// which is used for paging. For any response, the actual number returned -// might be less than the specified maxResults. (0..500, default 20) -// pageToken: The continuation token, which is used to page through large -// result sets. To get the next page of results, set this parameter to the -// value of "nextPageToken" from the previous response. -// sortOrder: The order in which to sort the list of comments. (Default -// kGTLPlusSortOrderAscending) -// kGTLPlusSortOrderAscending: Sort oldest comments first. -// kGTLPlusSortOrderDescending: Sort newest comments first. -// Authorization scope(s): -// kGTLAuthScopePlusMe -// Fetches a GTLPlusCommentFeed. -+ (id)queryForCommentsListWithActivityId:(NSString *)activityId; - -#pragma mark - -#pragma mark "moments" methods -// These create a GTLQueryPlus object. - -// Method: plus.moments.insert -// Record a moment representing a user's activity such as making a purchase or -// commenting on a blog. -// Required: -// userId: The ID of the user to record activities for. The only valid values -// are "me" and the ID of the authenticated user. -// collection: The collection to which to write moments. -// kGTLPlusCollectionVault: The default collection for writing new moments. -// Optional: -// debug: Return the moment as written. Should be used only for debugging. -// Authorization scope(s): -// kGTLAuthScopePlusLogin -// Fetches a GTLPlusMoment. -+ (id)queryForMomentsInsertWithObject:(GTLPlusMoment *)object - userId:(NSString *)userId - collection:(NSString *)collection; - -// Method: plus.moments.list -// List all of the moments for a particular user. -// Required: -// userId: The ID of the user to get moments for. The special value "me" can -// be used to indicate the authenticated user. -// collection: The collection of moments to list. -// kGTLPlusCollectionVault: All moments created by the requesting -// application for the authenticated user. -// Optional: -// maxResults: The maximum number of moments to include in the response, which -// is used for paging. For any response, the actual number returned might be -// less than the specified maxResults. (1..100, default 20) -// pageToken: The continuation token, which is used to page through large -// result sets. To get the next page of results, set this parameter to the -// value of "nextPageToken" from the previous response. -// targetUrl: Only moments containing this targetUrl will be returned. -// type: Only moments of this type will be returned. -// Authorization scope(s): -// kGTLAuthScopePlusLogin -// Fetches a GTLPlusMomentsFeed. -+ (id)queryForMomentsListWithUserId:(NSString *)userId - collection:(NSString *)collection; - -// Method: plus.moments.remove -// Delete a moment. -// Required: -// identifier: The ID of the moment to delete. -// Authorization scope(s): -// kGTLAuthScopePlusLogin -+ (id)queryForMomentsRemoveWithIdentifier:(NSString *)identifier; - -#pragma mark - -#pragma mark "people" methods -// These create a GTLQueryPlus object. - -// Method: plus.people.get -// Get a person's profile. If your app uses scope -// https://www.googleapis.com/auth/plus.login, this method is guaranteed to -// return ageRange and language. -// Required: -// userId: The ID of the person to get the profile for. The special value "me" -// can be used to indicate the authenticated user. -// Authorization scope(s): -// kGTLAuthScopePlusLogin -// kGTLAuthScopePlusMe -// Fetches a GTLPlusPerson. -+ (id)queryForPeopleGetWithUserId:(NSString *)userId; - -// Method: plus.people.list -// List all of the people in the specified collection. -// Required: -// userId: Get the collection of people for the person identified by the ID or -// use "me" to indiciated the authenticated user. -// collection: The collection of people to list. -// kGTLPlusCollectionVisible: The list of people who this user has added to -// one or more circles, limited to the circles visible to the requesting -// application. -// Optional: -// maxResults: The maximum number of people to include in the response, which -// is used for paging. For any response, the actual number returned might be -// less than the specified maxResults. (1..100, default 100) -// orderBy: The order to return people in. -// kGTLPlusOrderByAlphabetical: Order the people by their display name. -// kGTLPlusOrderByBest: Order people based on the relevence to the viewer. -// pageToken: The continuation token, which is used to page through large -// result sets. To get the next page of results, set this parameter to the -// value of "nextPageToken" from the previous response. -// Authorization scope(s): -// kGTLAuthScopePlusLogin -// Fetches a GTLPlusPeopleFeed. -+ (id)queryForPeopleListWithUserId:(NSString *)userId - collection:(NSString *)collection; - -// Method: plus.people.listByActivity -// List all of the people in the specified collection for a particular activity. -// Required: -// activityId: The ID of the activity to get the list of people for. -// collection: The collection of people to list. -// kGTLPlusCollectionPlusoners: List all people who have +1'd this -// activity. -// kGTLPlusCollectionResharers: List all people who have reshared this -// activity. -// Optional: -// maxResults: The maximum number of people to include in the response, which -// is used for paging. For any response, the actual number returned might be -// less than the specified maxResults. (1..100, default 20) -// pageToken: The continuation token, which is used to page through large -// result sets. To get the next page of results, set this parameter to the -// value of "nextPageToken" from the previous response. -// Authorization scope(s): -// kGTLAuthScopePlusMe -// Fetches a GTLPlusPeopleFeed. -+ (id)queryForPeopleListByActivityWithActivityId:(NSString *)activityId - collection:(NSString *)collection; - -// Method: plus.people.search -// Search all public profiles. -// Required: -// query: Specify a query string for full text search of public text in all -// profiles. -// Optional: -// language: Specify the preferred language to search with. See search -// language codes for available values. (Default en-US) -// maxResults: The maximum number of people to include in the response, which -// is used for paging. For any response, the actual number returned might be -// less than the specified maxResults. (1..20, default 10) -// pageToken: The continuation token, which is used to page through large -// result sets. To get the next page of results, set this parameter to the -// value of "nextPageToken" from the previous response. This token can be of -// any length. -// Authorization scope(s): -// kGTLAuthScopePlusMe -// Fetches a GTLPlusPeopleFeed. -+ (id)queryForPeopleSearchWithQuery:(NSString *)query; - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLRuntimeCommon.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLRuntimeCommon.h deleted file mode 100644 index 28822b5e..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLRuntimeCommon.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLRuntimeCommon.h -// - - -#import - -#import "GTLDefines.h" - -// This protocol and support class are an internal implementation detail so -// GTLObject and GTLQuery can share some code. - -@protocol GTLRuntimeCommon -@required -// Get/Set properties -- (void)setJSONValue:(id)obj forKey:(NSString *)key; -- (id)JSONValueForKey:(NSString *)key; -// Child cache -- (void)setCacheChild:(id)obj forKey:(NSString *)key; -- (id)cacheChildForKey:(NSString *)key; -// Surrogate class mappings. -- (NSDictionary *)surrogates; -// Key map -+ (NSDictionary *)propertyToJSONKeyMapForClass:(Class)aClass; -// Array item types -+ (NSDictionary *)arrayPropertyToClassMapForClass:(Class)aClass; -// The parent class for dynamic support -+ (Class)ancestorClass; -@end - -@interface GTLRuntimeCommon : NSObject -// Wire things up. -+ (BOOL)resolveInstanceMethod:(SEL)sel onClass:(Class)onClass; -// Helpers -+ (id)objectFromJSON:(id)json - defaultClass:(Class)defaultClass - surrogates:(NSDictionary *)surrogates - isCacheable:(BOOL*)isCacheable; -+ (id)jsonFromAPIObject:(id)obj - expectedClass:(Class)expectedClass - isCacheable:(BOOL*)isCacheable; -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLService.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLService.h deleted file mode 100644 index eac1dac8..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLService.h +++ /dev/null @@ -1,607 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLService.h -// - -// Service object documentation: -// https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Services_and_Tickets - -#import - -#import "GTLDefines.h" -#import "GTMHTTPFetcherService.h" -#import "GTLBatchQuery.h" -#import "GTLBatchResult.h" -#import "GTLDateTime.h" -#import "GTLErrorObject.h" -#import "GTLFramework.h" -#import "GTLJSONParser.h" -#import "GTLObject.h" -#import "GTLQuery.h" -#import "GTLUtilities.h" - -#undef _EXTERN -#undef _INITIALIZE_AS -#ifdef GTLSERVICE_DEFINE_GLOBALS -#define _EXTERN -#define _INITIALIZE_AS(x) =x -#else -#define _EXTERN extern -#define _INITIALIZE_AS(x) -#endif - -// Error domains -_EXTERN NSString* const kGTLServiceErrorDomain _INITIALIZE_AS(@"com.google.GTLServiceDomain"); -enum { - kGTLErrorQueryResultMissing = -3000, - kGTLErrorWaitTimedOut = -3001 -}; - -_EXTERN NSString* const kGTLJSONRPCErrorDomain _INITIALIZE_AS(@"com.google.GTLJSONRPCErrorDomain"); - -// We'll consistently store the server error string in the userInfo under -// this key -_EXTERN NSString* const kGTLServerErrorStringKey _INITIALIZE_AS(@"error"); - -_EXTERN Class const kGTLUseRegisteredClass _INITIALIZE_AS(nil); - -_EXTERN NSUInteger const kGTLStandardUploadChunkSize _INITIALIZE_AS(NSUIntegerMax); - -// When servers return us structured JSON errors, the NSError will -// contain a GTLErrorObject in the userInfo dictionary under the key -// kGTLStructuredErrorsKey -_EXTERN NSString* const kGTLStructuredErrorKey _INITIALIZE_AS(@"GTLStructuredError"); - -// When specifying an ETag for updating or deleting a single entry, use -// kGTLETagWildcard to tell the server to replace the current value -// unconditionally. Do not use this in entries in a batch feed. -_EXTERN NSString* const kGTLETagWildcard _INITIALIZE_AS(@"*"); - -// Notifications when parsing of a fetcher feed or entry begins or ends -_EXTERN NSString* const kGTLServiceTicketParsingStartedNotification _INITIALIZE_AS(@"kGTLServiceTicketParsingStartedNotification"); -_EXTERN NSString* const kGTLServiceTicketParsingStoppedNotification _INITIALIZE_AS(@"kGTLServiceTicketParsingStoppedNotification"); - -@class GTLServiceTicket; - -// Block types used for fetch callbacks -// -// These typedefs are not used in the header file method declarations -// since it's more useful when code sense expansions show the argument -// types rather than the typedefs - -#if NS_BLOCKS_AVAILABLE -typedef void (^GTLServiceCompletionHandler)(GTLServiceTicket *ticket, id object, NSError *error); - -typedef void (^GTLServiceUploadProgressBlock)(GTLServiceTicket *ticket, unsigned long long numberOfBytesRead, unsigned long long dataLength); -#else -typedef void *GTLServiceCompletionHandler; - -typedef void *GTLServiceUploadProgressBlock; -#endif // NS_BLOCKS_AVAILABLE - -#pragma mark - - -// -// Service base class -// - -@interface GTLService : NSObject { - @private - NSOperationQueue *parseQueue_; - NSString *userAgent_; - GTMHTTPFetcherService *fetcherService_; - NSString *userAgentAddition_; - - NSMutableDictionary *serviceProperties_; // initial values for properties in future tickets - - NSDictionary *surrogates_; // initial value for surrogates in future tickets - - SEL uploadProgressSelector_; // optional - -#if NS_BLOCKS_AVAILABLE - BOOL (^retryBlock_)(GTLServiceTicket *, BOOL, NSError *); - void (^uploadProgressBlock_)(GTLServiceTicket *ticket, - unsigned long long numberOfBytesRead, - unsigned long long dataLength); -#elif !__LP64__ - // Placeholders: for 32-bit builds, keep the size of the object's ivar section - // the same with and without blocks - id retryPlaceholder_; - id uploadProgressPlaceholder_; -#endif - - NSUInteger uploadChunkSize_; // zero when uploading via multi-part MIME http body - - BOOL isRetryEnabled_; // user allows auto-retries - SEL retrySelector_; // optional; set with setServiceRetrySelector - NSTimeInterval maxRetryInterval_; // default to 600. seconds - - BOOL shouldFetchNextPages_; - - NSString *apiKey_; - BOOL isRESTDataWrapperRequired_; - NSString *apiVersion_; - NSURL *rpcURL_; - NSURL *rpcUploadURL_; - NSDictionary *urlQueryParameters_; - NSDictionary *additionalHTTPHeaders_; -} - -#pragma mark Query Execution - -// The finishedSelector has a signature matching: -// -// - (void)serviceTicket:(GTLServiceTicket *)ticket -// finishedWithObject:(GTLObject *)object -// error:(NSError *)error -// -// If an error occurs, the error parameter will be non-nil. Otherwise, -// the object parameter will point to a GTLObject, if any was returned by -// the fetch. (Delete fetches return no object, so the second parameter will -// be nil.) -// -// If the query object is a GTLBatchQuery, the object passed to the callback -// will be a GTLBatchResult; see the batch query documentation: -// https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Batch_Operations - -- (GTLServiceTicket *)executeQuery:(id)query - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -#if NS_BLOCKS_AVAILABLE -- (GTLServiceTicket *)executeQuery:(id)query - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); -#endif - -// Automatic page fetches -// -// Tickets can optionally do a sequence of fetches for queries where -// repeated requests with nextPageToken or nextStartIndex values is required to -// retrieve items of all pages of the response collection. The client's -// callback is invoked only when all items have been retrieved, or an error has -// occurred. During the fetch, the items accumulated so far are available from -// the ticket. -// -// Note that the final object may be a combination of multiple page responses -// so it may not be the same as if all results had been returned in a single -// page. Some fields of the response such as total item counts may reflect only -// the final page's values. -// -// Automatic page fetches will return an error if more than 25 page fetches are -// required. For debug builds, this will log a warning to the console when more -// than 2 page fetches occur, as a reminder that the query's maxResults -// parameter should probably be increased to specify more items returned per -// page. -// -// Default value is NO. -@property (nonatomic, assign) BOOL shouldFetchNextPages; - -// Retrying; see comments on retry support at the top of GTMHTTPFetcher. -// -// Default value is NO. -@property (nonatomic, assign, getter=isRetryEnabled) BOOL retryEnabled; - -// Some services require a developer key for quotas and limits. Setting this -// will include it on all request sent to this service via a GTLQuery class. -@property (nonatomic, copy) NSString *APIKey; - -// An authorizer adds user authentication headers to the request as needed. -@property (nonatomic, retain) id authorizer; - -// Retry selector is optional for retries. -// -// If present, it should have the signature: -// -(BOOL)ticket:(GTLServiceTicket *)ticket willRetry:(BOOL)suggestedWillRetry forError:(NSError *)error -// and return YES to cause a retry. Note that unlike the GTMHTTPFetcher retry -// selector, this selector's first argument is a ticket, not a fetcher. - -@property (nonatomic, assign) SEL retrySelector; -#if NS_BLOCKS_AVAILABLE -@property (copy) BOOL (^retryBlock)(GTLServiceTicket *ticket, BOOL suggestedWillRetry, NSError *error); -#endif - -@property (nonatomic, assign) NSTimeInterval maxRetryInterval; - -// -// Fetches may be done using RPC or REST APIs, without creating -// a GTLQuery object -// - -#pragma mark RPC Fetch Methods - -// -// These methods may be used for RPC fetches without creating a GTLQuery object -// - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - parameters:(NSDictionary *)parameters - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - insertingObject:(GTLObject *)bodyObject - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - parameters:(NSDictionary *)parameters - insertingObject:(GTLObject *)bodyObject - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -#if NS_BLOCKS_AVAILABLE -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - parameters:(NSDictionary *)parameters - objectClass:(Class)objectClass - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - insertingObject:(GTLObject *)bodyObject - objectClass:(Class)objectClass - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - parameters:(NSDictionary *)parameters - insertingObject:(GTLObject *)bodyObject - objectClass:(Class)objectClass - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); -#endif - -#pragma mark REST Fetch Methods - -- (GTLServiceTicket *)fetchObjectWithURL:(NSURL *)objectURL - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectWithURL:(NSURL *)objectURL - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchPublicObjectWithURL:(NSURL *)objectURL - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectByInsertingObject:(GTLObject *)bodyToPut - forURL:(NSURL *)destinationURL - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1,2)); - -- (GTLServiceTicket *)fetchObjectByUpdatingObject:(GTLObject *)bodyToPut - forURL:(NSURL *)destinationURL - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1,2)); - -- (GTLServiceTicket *)deleteResourceURL:(NSURL *)destinationURL - ETag:(NSString *)etagOrNil - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -#if NS_BLOCKS_AVAILABLE -- (GTLServiceTicket *)fetchObjectWithURL:(NSURL *)objectURL - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectByInsertingObject:(GTLObject *)bodyToPut - forURL:(NSURL *)destinationURL - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectByUpdatingObject:(GTLObject *)bodyToPut - forURL:(NSURL *)destinationURL - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); - -- (GTLServiceTicket *)deleteResourceURL:(NSURL *)destinationURL - ETag:(NSString *)etagOrNil - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); -#endif - -#pragma mark User Properties - -// Properties and userData are supported for client convenience. -// -// Property keys beginning with _ are reserved by the library. -// -// The service properties dictionary is copied to become the initial property -// dictionary for each ticket. -- (void)setServiceProperty:(id)obj forKey:(NSString *)key GTL_NONNULL((2)); // pass nil obj to remove property -- (id)servicePropertyForKey:(NSString *)key GTL_NONNULL((1)); - -@property (nonatomic, copy) NSDictionary *serviceProperties; - -// The service userData becomes the initial value for each future ticket's -// userData. -@property (nonatomic, retain) id serviceUserData; - -#pragma mark Request Settings - -// Set the surrogates to be used for future tickets. Surrogates are subclasses -// to be used instead of standard classes when creating objects from the JSON. -// For example, this code will make the framework generate objects -// using MyCalendarItemSubclass instead of GTLItemCalendar and -// MyCalendarEventSubclass instead of GTLItemCalendarEvent. -// -// NSDictionary *surrogates = [NSDictionary dictionaryWithObjectsAndKeys: -// [MyCalendarEntrySubclass class], [GTLItemCalendar class], -// [MyCalendarEventSubclass class], [GTLItemCalendarEvent class], -// nil]; -// [calendarService setServiceSurrogates:surrogates]; -// -@property (nonatomic, retain) NSDictionary *surrogates; - -// On iOS 4 and later, the fetch may optionally continue in the background -// until finished or stopped by OS expiration. -// -// The default value is NO. -// -// For Mac OS X, background fetches are always supported, and this property -// is ignored. -@property (nonatomic, assign) BOOL shouldFetchInBackground; - -// Callbacks can be invoked on an operation queue rather than via the run loop -// starting on 10.7 and iOS 6. Do not specify both run loop modes and an -// operation queue. Specifying a delegate queue typically looks like this: -// -// service.delegateQueue = [[[NSOperationQueue alloc] init] autorelease]; -// -// Since the callbacks will be on a thread of the operation queue, the client -// may re-dispatch from the callbacks to a known dispatch queue or to the -// main queue. -@property (nonatomic, retain) NSOperationQueue *delegateQueue; - -// Run loop modes are used for scheduling NSURLConnections. -// -// The default value, nil, schedules connections using the current run -// loop mode. To use the service during a modal dialog, be sure to specify -// NSModalPanelRunLoopMode as one of the modes. -@property (nonatomic, retain) NSArray *runLoopModes; - -// Applications needing an additional identifier in the server logs may specify -// one. -@property (nonatomic, copy) NSString *userAgentAddition; - -// Applications have a default user-agent based on the application signature -// in the Info.plist settings. Most applications should not explicitly set -// this property. -@property (nonatomic, copy) NSString *userAgent; - -// The request user agent includes the library and OS version appended to the -// base userAgent, along with the optional addition string. -@property (nonatomic, readonly) NSString *requestUserAgent; - -// Applications may call requestForURL:httpMethod to get a request with the -// proper user-agent and ETag headers -// -// For http method, pass nil (for default GET method), POST, PUT, or DELETE -- (NSMutableURLRequest *)requestForURL:(NSURL *)url - ETag:(NSString *)etagOrNil - httpMethod:(NSString *)httpMethodOrNil GTL_NONNULL((1)); - -// objectRequestForURL returns an NSMutableURLRequest for a JSON GTL object -// -// The object is the object being sent to the server, or nil; -// the http method may be nil for GET, or POST, PUT, DELETE -- (NSMutableURLRequest *)objectRequestForURL:(NSURL *)url - object:(GTLObject *)object - ETag:(NSString *)etag - httpMethod:(NSString *)httpMethod - isREST:(BOOL)isREST - additionalHeaders:(NSDictionary *)additionalHeaders - ticket:(GTLServiceTicket *)ticket GTL_NONNULL((1)); - -// The queue used for parsing JSON responses (previously this property -// was called operationQueue) -@property (nonatomic, retain) NSOperationQueue *parseQueue; - -// The fetcher service object issues the GTMHTTPFetcher instances -// for this API service -@property (nonatomic, retain) GTMHTTPFetcherService *fetcherService; - -// Default storage for cookies is in the service object's fetchHistory. -// -// Apps that want to share cookies between all standalone fetchers and the -// service object may specify static application-wide cookie storage, -// kGTMHTTPFetcherCookieStorageMethodStatic. -@property (nonatomic, assign) NSInteger cookieStorageMethod; - -// When sending REST style queries, should the payload be wrapped in a "data" -// element, and will the reply be wrapped in an "data" element. -@property (nonatomic, assign) BOOL isRESTDataWrapperRequired; - -// Any url query parameters to add to urls (useful for debugging with some -// services). -@property (copy) NSDictionary *urlQueryParameters; - -// Any extra http headers to set on requests for GTLObjects. -@property (copy) NSDictionary *additionalHTTPHeaders; - -// The service API version. -@property (nonatomic, copy) NSString *apiVersion; - -// The URL for sending RPC requests for this service. -@property (nonatomic, retain) NSURL *rpcURL; - -// The URL for sending RPC requests which initiate file upload. -@property (nonatomic, retain) NSURL *rpcUploadURL; - -// Set a non-zero value to enable uploading via chunked fetches -// (resumable uploads); typically this defaults to kGTLStandardUploadChunkSize -// for service subclasses that support chunked uploads -@property (nonatomic, assign) NSUInteger serviceUploadChunkSize; - -// Service subclasses may specify their own default chunk size -+ (NSUInteger)defaultServiceUploadChunkSize; - -// The service uploadProgressSelector becomes the initial value for each future -// ticket's uploadProgressSelector. -// -// The optional uploadProgressSelector will be called in the delegate as bytes -// are uploaded to the server. It should have a signature matching -// -// - (void)ticket:(GTLServiceTicket *)ticket -// hasDeliveredByteCount:(unsigned long long)numberOfBytesRead -// ofTotalByteCount:(unsigned long long)dataLength; -@property (nonatomic, assign) SEL uploadProgressSelector; - -#if NS_BLOCKS_AVAILABLE -@property (copy) void (^uploadProgressBlock)(GTLServiceTicket *ticket, unsigned long long numberOfBytesRead, unsigned long long dataLength); -#endif - -// Wait synchronously for fetch to complete (strongly discouraged) -// -// This just runs the current event loop until the fetch completes -// or the timout limit is reached. This may discard unexpected events -// that occur while spinning, so it's really not appropriate for use -// in serious applications. -// -// Returns true if an object was successfully fetched. If the wait -// timed out, returns false and the returned error is nil. -// -// The returned object or error, if any, will be already autoreleased -// -// This routine will likely be removed in some future releases of the library. -- (BOOL)waitForTicket:(GTLServiceTicket *)ticket - timeout:(NSTimeInterval)timeoutInSeconds - fetchedObject:(GTLObject **)outObjectOrNil - error:(NSError **)outErrorOrNil GTL_NONNULL((1)); -@end - -#pragma mark - - -// -// Ticket base class -// -@interface GTLServiceTicket : NSObject { - GTLService *service_; - - NSMutableDictionary *ticketProperties_; - NSDictionary *surrogates_; - - GTMHTTPFetcher *objectFetcher_; - SEL uploadProgressSelector_; - BOOL shouldFetchNextPages_; - BOOL isRetryEnabled_; - SEL retrySelector_; - NSTimeInterval maxRetryInterval_; - -#if NS_BLOCKS_AVAILABLE - BOOL (^retryBlock_)(GTLServiceTicket *, BOOL, NSError *); - void (^uploadProgressBlock_)(GTLServiceTicket *ticket, - unsigned long long numberOfBytesRead, - unsigned long long dataLength); -#elif !__LP64__ - // Placeholders: for 32-bit builds, keep the size of the object's ivar section - // the same with and without blocks - id retryPlaceholder_; - id uploadProgressPlaceholder_; -#endif - - GTLObject *postedObject_; - GTLObject *fetchedObject_; - id executingQuery_; - id originalQuery_; - NSError *fetchError_; - BOOL hasCalledCallback_; - NSUInteger pagesFetchedCounter_; - - NSString *apiKey_; - BOOL isREST_; - - NSOperation *parseOperation_; -} - -+ (id)ticketForService:(GTLService *)service; - -- (id)initWithService:(GTLService *)service; - -- (id)service; - -#pragma mark Execution Control -// if cancelTicket is called, the fetch is stopped if it is in progress, -// the callbacks will not be called, and the ticket will no longer be useful -// (though the client must still release the ticket if it retained the ticket) -- (void)cancelTicket; - -// chunked upload tickets may be paused -- (void)pauseUpload; -- (void)resumeUpload; -- (BOOL)isUploadPaused; - -@property (nonatomic, retain) GTMHTTPFetcher *objectFetcher; -@property (nonatomic, assign) SEL uploadProgressSelector; - -// Services which do not require an user authorization may require a developer -// API key for quota management -@property (nonatomic, copy) NSString *APIKey; - -#pragma mark User Properties - -// Properties and userData are supported for client convenience. -// -// Property keys beginning with _ are reserved by the library. -- (void)setProperty:(id)obj forKey:(NSString *)key GTL_NONNULL((1)); // pass nil obj to remove property -- (id)propertyForKey:(NSString *)key; - -@property (nonatomic, copy) NSDictionary *properties; -@property (nonatomic, retain) id userData; - -#pragma mark Payload - -@property (nonatomic, retain) GTLObject *postedObject; -@property (nonatomic, retain) GTLObject *fetchedObject; -@property (nonatomic, retain) id executingQuery; // Query currently being fetched by this ticket -@property (nonatomic, retain) id originalQuery; // Query used to create this ticket -- (GTLQuery *)queryForRequestID:(NSString *)requestID GTL_NONNULL((1)); // Returns the query from within the batch with the given id. - -@property (nonatomic, retain) NSDictionary *surrogates; - -#pragma mark Retry - -@property (nonatomic, assign, getter=isRetryEnabled) BOOL retryEnabled; -@property (nonatomic, assign) SEL retrySelector; -#if NS_BLOCKS_AVAILABLE -@property (copy) BOOL (^retryBlock)(GTLServiceTicket *ticket, BOOL suggestedWillRetry, NSError *error); -#endif -@property (nonatomic, assign) NSTimeInterval maxRetryInterval; - -#pragma mark Status - -@property (nonatomic, readonly) NSInteger statusCode; // server status from object fetch -@property (nonatomic, retain) NSError *fetchError; -@property (nonatomic, assign) BOOL hasCalledCallback; - -#pragma mark Pagination - -@property (nonatomic, assign) BOOL shouldFetchNextPages; -@property (nonatomic, assign) NSUInteger pagesFetchedCounter; - -#pragma mark Upload - -#if NS_BLOCKS_AVAILABLE -@property (copy) void (^uploadProgressBlock)(GTLServiceTicket *ticket, unsigned long long numberOfBytesRead, unsigned long long dataLength); -#endif - -@end - - -// Category to provide opaque access to tickets stored in fetcher properties -@interface GTMHTTPFetcher (GTLServiceTicketAdditions) -- (id)ticket; -@end - diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLServicePlus.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLServicePlus.h deleted file mode 100644 index b05c4f47..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLServicePlus.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLServicePlus.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLServicePlus (0 custom class methods, 0 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLService.h" -#else - #import "GTLService.h" -#endif - -@interface GTLServicePlus : GTLService - -// No new methods - -// Clients should create a standard query with any of the class methods in -// GTLQueryPlus.h. The query can the be sent with GTLService's execute methods, -// -// - (GTLServiceTicket *)executeQuery:(GTLQuery *)query -// completionHandler:(void (^)(GTLServiceTicket *ticket, -// id object, NSError *error))handler; -// or -// - (GTLServiceTicket *)executeQuery:(GTLQuery *)query -// delegate:(id)delegate -// didFinishSelector:(SEL)finishedSelector; -// -// where finishedSelector has a signature of: -// -// - (void)serviceTicket:(GTLServiceTicket *)ticket -// finishedWithObject:(id)object -// error:(NSError *)error; -// -// The object passed to the completion handler or delegate method -// is a subclass of GTLObject, determined by the query method executed. - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLTargetNamespace.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLTargetNamespace.h deleted file mode 100644 index 9e08a9e4..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLTargetNamespace.h +++ /dev/null @@ -1,58 +0,0 @@ -// -// Makes the value of GTL_TARGET_NAMESPACE a prefix for all GTL -// library class names -// - -// -// To avoid global namespace issues, define GTL_TARGET_NAMESPACE to a short -// string in your target if you are using the GTL library in a shared-code -// environment like a plug-in. -// -// For example: -DGTL_TARGET_NAMESPACE=MyPlugin -// - -// -// com.google.GTLFramework v. 2.0 (29 classes) 2011-10-25 19:25:36 -0700 -// - -#if defined(__OBJC__) && defined(GTL_TARGET_NAMESPACE) - - #define _GTL_NS_SYMBOL_INNER(ns, symbol) ns ## _ ## symbol - #define _GTL_NS_SYMBOL_MIDDLE(ns, symbol) _GTL_NS_SYMBOL_INNER(ns, symbol) - #define _GTL_NS_SYMBOL(symbol) _GTL_NS_SYMBOL_MIDDLE(GTL_TARGET_NAMESPACE, symbol) - - #define _GTL_NS_STRING_INNER(ns) #ns - #define _GTL_NS_STRING_MIDDLE(ns) _GTL_NS_STRING_INNER(ns) - #define GTL_TARGET_NAMESPACE_STRING _GTL_NS_STRING_MIDDLE(GTL_TARGET_NAMESPACE) - - #define GTLBatchQuery _GTL_NS_SYMBOL(GTLBatchQuery) - #define GTLBatchResult _GTL_NS_SYMBOL(GTLBatchResult) - #define GTLCollectionObject _GTL_NS_SYMBOL(GTLCollectionObject) - #define GTLDateTime _GTL_NS_SYMBOL(GTLDateTime) - #define GTLErrorObject _GTL_NS_SYMBOL(GTLErrorObject) - #define GTLErrorObjectData _GTL_NS_SYMBOL(GTLErrorObjectData) - #define GTLJSONParser _GTL_NS_SYMBOL(GTLJSONParser) - #define GTLObject _GTL_NS_SYMBOL(GTLObject) - #define GTLQuery _GTL_NS_SYMBOL(GTLQuery) - #define GTLRuntimeCommon _GTL_NS_SYMBOL(GTLRuntimeCommon) - #define GTLService _GTL_NS_SYMBOL(GTLService) - #define GTLServiceTicket _GTL_NS_SYMBOL(GTLServiceTicket) - #define GTLUploadParameters _GTL_NS_SYMBOL(GTLUploadParameters) - #define GTLUtilities _GTL_NS_SYMBOL(GTLUtilities) - #define GTMCachedURLResponse _GTL_NS_SYMBOL(GTMCachedURLResponse) - #define GTMCookieStorage _GTL_NS_SYMBOL(GTMCookieStorage) - #define GTMGatherInputStream _GTL_NS_SYMBOL(GTMGatherInputStream) - #define GTMHTTPFetcher _GTL_NS_SYMBOL(GTMHTTPFetcher) - #define GTMHTTPFetcherService _GTL_NS_SYMBOL(GTMHTTPFetcherService) - #define GTMHTTPFetchHistory _GTL_NS_SYMBOL(GTMHTTPFetchHistory) - #define GTMHTTPUploadFetcher _GTL_NS_SYMBOL(GTMHTTPUploadFetcher) - #define GTMMIMEDocument _GTL_NS_SYMBOL(GTMMIMEDocument) - #define GTMMIMEPart _GTL_NS_SYMBOL(GTMMIMEPart) - #define GTMOAuth2Authentication _GTL_NS_SYMBOL(GTMOAuth2Authentication) - #define GTMOAuth2AuthorizationArgs _GTL_NS_SYMBOL(GTMOAuth2AuthorizationArgs) - #define GTMOAuth2SignIn _GTL_NS_SYMBOL(GTMOAuth2SignIn) - #define GTMOAuth2WindowController _GTL_NS_SYMBOL(GTMOAuth2WindowController) - #define GTMReadMonitorInputStream _GTL_NS_SYMBOL(GTMReadMonitorInputStream) - #define GTMURLCache _GTL_NS_SYMBOL(GTMURLCache) - -#endif diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLUploadParameters.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLUploadParameters.h deleted file mode 100644 index a3c1d9dc..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLUploadParameters.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLUploadParameters.h -// - -// Uploading documentation: -// https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Uploading_Files - -#import - -#import "GTLDefines.h" - -@interface GTLUploadParameters : NSObject { - @private - NSString *MIMEType_; - NSData *data_; - NSFileHandle *fileHandle_; - NSURL *uploadLocationURL_; - NSString *slug_; - BOOL shouldSendUploadOnly_; -} - -// Uploading requires MIME type and one of -// - data to be uploaded -// - file handle for uploading -@property (copy) NSString *MIMEType; -@property (retain) NSData *data; -@property (retain) NSFileHandle *fileHandle; - -// Resuming an in-progress upload is done with the upload location URL, -// and requires a file handle for uploading -@property (retain) NSURL *uploadLocationURL; - -// Some services need a slug (filename) header -@property (copy) NSString *slug; - -// Uploads may be done without a JSON body in the initial request -@property (assign) BOOL shouldSendUploadOnly; - -+ (GTLUploadParameters *)uploadParametersWithData:(NSData *)data - MIMEType:(NSString *)mimeType GTL_NONNULL((1,2)); - -+ (GTLUploadParameters *)uploadParametersWithFileHandle:(NSFileHandle *)fileHandle - MIMEType:(NSString *)mimeType GTL_NONNULL((1,2)); - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLUtilities.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLUtilities.h deleted file mode 100644 index 97f4bf07..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTLUtilities.h +++ /dev/null @@ -1,93 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#ifndef SKIP_GTL_DEFINES - #import "GTLDefines.h" -#endif - -// helper functions for implementing isEqual: -BOOL GTL_AreEqualOrBothNil(id obj1, id obj2); -BOOL GTL_AreBoolsEqual(BOOL b1, BOOL b2); - -// Helper to ensure a number is a number. -// -// The GoogleAPI servers will send numbers >53 bits as strings to avoid -// bugs in some JavaScript implementations. Work around this by catching -// the string and turning it back into a number. -NSNumber *GTL_EnsureNSNumber(NSNumber *num); - -@interface GTLUtilities : NSObject - -// -// String encoding -// - -// URL encoding, different for parts of URLs and parts of URL parameters -// -// +stringByURLEncodingString just makes a string legal for a URL -// -// +stringByURLEncodingForURI also encodes some characters that are legal in -// URLs but should not be used in URIs, -// per http://bitworking.org/projects/atom/rfc5023.html#rfc.section.9.7 -// -// +stringByURLEncodingStringParameter is like +stringByURLEncodingForURI but -// replaces space characters with + characters rather than percent-escaping them -// -+ (NSString *)stringByURLEncodingString:(NSString *)str; -+ (NSString *)stringByURLEncodingForURI:(NSString *)str; -+ (NSString *)stringByURLEncodingStringParameter:(NSString *)str; - -// Percent-encoded UTF-8 -+ (NSString *)stringByPercentEncodingUTF8ForString:(NSString *)str; - -// Key-value coding searches in an array -// -// Utilities to get from an array objects having a known value (or nil) -// at a keyPath - -+ (NSArray *)objectsFromArray:(NSArray *)sourceArray - withValue:(id)desiredValue - forKeyPath:(NSString *)keyPath; - -+ (id)firstObjectFromArray:(NSArray *)sourceArray - withValue:(id)desiredValue - forKeyPath:(NSString *)keyPath; - -// -// Version helpers -// - -+ (NSComparisonResult)compareVersion:(NSString *)ver1 toVersion:(NSString *)ver2; - -// -// URL builder -// - -// If there are already query parameters on urlString, the new ones are simple -// appended after them. -+ (NSURL *)URLWithString:(NSString *)urlString - queryParameters:(NSDictionary *)queryParameters; - -// Allocate a global dictionary -+ (NSMutableDictionary *)newStaticDictionary; - -// Walk up the class tree merging dictionaries and return the result. -+ (NSDictionary *)mergedClassDictionaryForSelector:(SEL)selector - startClass:(Class)startClass - ancestorClass:(Class)ancestorClass - cache:(NSMutableDictionary *)cache; -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMDefines.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMDefines.h deleted file mode 100644 index c2958487..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMDefines.h +++ /dev/null @@ -1,441 +0,0 @@ -// -// GTMDefines.h -// -// Copyright 2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -// ============================================================================ - -#include -#include - -#ifdef __OBJC__ -#include -#endif // __OBJC__ - -#if TARGET_OS_IPHONE -#include -#endif // TARGET_OS_IPHONE - -// Not all MAC_OS_X_VERSION_10_X macros defined in past SDKs -#ifndef MAC_OS_X_VERSION_10_5 - #define MAC_OS_X_VERSION_10_5 1050 -#endif -#ifndef MAC_OS_X_VERSION_10_6 - #define MAC_OS_X_VERSION_10_6 1060 -#endif -#ifndef MAC_OS_X_VERSION_10_7 - #define MAC_OS_X_VERSION_10_7 1070 -#endif - -// Not all __IPHONE_X macros defined in past SDKs -#ifndef __IPHONE_3_0 - #define __IPHONE_3_0 30000 -#endif -#ifndef __IPHONE_3_1 - #define __IPHONE_3_1 30100 -#endif -#ifndef __IPHONE_3_2 - #define __IPHONE_3_2 30200 -#endif -#ifndef __IPHONE_4_0 - #define __IPHONE_4_0 40000 -#endif -#ifndef __IPHONE_4_3 - #define __IPHONE_4_3 40300 -#endif -#ifndef __IPHONE_5_0 - #define __IPHONE_5_0 50000 -#endif - -// ---------------------------------------------------------------------------- -// CPP symbols that can be overridden in a prefix to control how the toolbox -// is compiled. -// ---------------------------------------------------------------------------- - - -// By setting the GTM_CONTAINERS_VALIDATION_FAILED_LOG and -// GTM_CONTAINERS_VALIDATION_FAILED_ASSERT macros you can control what happens -// when a validation fails. If you implement your own validators, you may want -// to control their internals using the same macros for consistency. -#ifndef GTM_CONTAINERS_VALIDATION_FAILED_ASSERT - #define GTM_CONTAINERS_VALIDATION_FAILED_ASSERT 0 -#endif - -// Give ourselves a consistent way to do inlines. Apple's macros even use -// a few different actual definitions, so we're based off of the foundation -// one. -#if !defined(GTM_INLINE) - #if (defined (__GNUC__) && (__GNUC__ == 4)) || defined (__clang__) - #define GTM_INLINE static __inline__ __attribute__((always_inline)) - #else - #define GTM_INLINE static __inline__ - #endif -#endif - -// Give ourselves a consistent way of doing externs that links up nicely -// when mixing objc and objc++ -#if !defined (GTM_EXTERN) - #if defined __cplusplus - #define GTM_EXTERN extern "C" - #define GTM_EXTERN_C_BEGIN extern "C" { - #define GTM_EXTERN_C_END } - #else - #define GTM_EXTERN extern - #define GTM_EXTERN_C_BEGIN - #define GTM_EXTERN_C_END - #endif -#endif - -// Give ourselves a consistent way of exporting things if we have visibility -// set to hidden. -#if !defined (GTM_EXPORT) - #define GTM_EXPORT __attribute__((visibility("default"))) -#endif - -// Give ourselves a consistent way of declaring something as unused. This -// doesn't use __unused because that is only supported in gcc 4.2 and greater. -#if !defined (GTM_UNUSED) -#define GTM_UNUSED(x) ((void)(x)) -#endif - -// _GTMDevLog & _GTMDevAssert -// -// _GTMDevLog & _GTMDevAssert are meant to be a very lightweight shell for -// developer level errors. This implementation simply macros to NSLog/NSAssert. -// It is not intended to be a general logging/reporting system. -// -// Please see http://code.google.com/p/google-toolbox-for-mac/wiki/DevLogNAssert -// for a little more background on the usage of these macros. -// -// _GTMDevLog log some error/problem in debug builds -// _GTMDevAssert assert if conditon isn't met w/in a method/function -// in all builds. -// -// To replace this system, just provide different macro definitions in your -// prefix header. Remember, any implementation you provide *must* be thread -// safe since this could be called by anything in what ever situtation it has -// been placed in. -// - -// We only define the simple macros if nothing else has defined this. -#ifndef _GTMDevLog - -#ifdef DEBUG - #define _GTMDevLog(...) NSLog(__VA_ARGS__) -#else - #define _GTMDevLog(...) do { } while (0) -#endif - -#endif // _GTMDevLog - -#ifndef _GTMDevAssert -// we directly invoke the NSAssert handler so we can pass on the varargs -// (NSAssert doesn't have a macro we can use that takes varargs) -#if !defined(NS_BLOCK_ASSERTIONS) - #define _GTMDevAssert(condition, ...) \ - do { \ - if (!(condition)) { \ - [[NSAssertionHandler currentHandler] \ - handleFailureInFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] \ - file:[NSString stringWithUTF8String:__FILE__] \ - lineNumber:__LINE__ \ - description:__VA_ARGS__]; \ - } \ - } while(0) -#else // !defined(NS_BLOCK_ASSERTIONS) - #define _GTMDevAssert(condition, ...) do { } while (0) -#endif // !defined(NS_BLOCK_ASSERTIONS) - -#endif // _GTMDevAssert - -// _GTMCompileAssert -// _GTMCompileAssert is an assert that is meant to fire at compile time if you -// want to check things at compile instead of runtime. For example if you -// want to check that a wchar is 4 bytes instead of 2 you would use -// _GTMCompileAssert(sizeof(wchar_t) == 4, wchar_t_is_4_bytes_on_OS_X) -// Note that the second "arg" is not in quotes, and must be a valid processor -// symbol in it's own right (no spaces, punctuation etc). - -// Wrapping this in an #ifndef allows external groups to define their own -// compile time assert scheme. -#ifndef _GTMCompileAssert - // We got this technique from here: - // http://unixjunkie.blogspot.com/2007/10/better-compile-time-asserts_29.html - - #define _GTMCompileAssertSymbolInner(line, msg) _GTMCOMPILEASSERT ## line ## __ ## msg - #define _GTMCompileAssertSymbol(line, msg) _GTMCompileAssertSymbolInner(line, msg) - #define _GTMCompileAssert(test, msg) \ - typedef char _GTMCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ] -#endif // _GTMCompileAssert - -// ---------------------------------------------------------------------------- -// CPP symbols defined based on the project settings so the GTM code has -// simple things to test against w/o scattering the knowledge of project -// setting through all the code. -// ---------------------------------------------------------------------------- - -// Provide a single constant CPP symbol that all of GTM uses for ifdefing -// iPhone code. -#if TARGET_OS_IPHONE // iPhone SDK - // For iPhone specific stuff - #define GTM_IPHONE_SDK 1 - #if TARGET_IPHONE_SIMULATOR - #define GTM_IPHONE_SIMULATOR 1 - #else - #define GTM_IPHONE_DEVICE 1 - #endif // TARGET_IPHONE_SIMULATOR - // By default, GTM has provided it's own unittesting support, define this - // to use the support provided by Xcode, especially for the Xcode4 support - // for unittesting. - #ifndef GTM_IPHONE_USE_SENTEST - #define GTM_IPHONE_USE_SENTEST 0 - #endif -#else - // For MacOS specific stuff - #define GTM_MACOS_SDK 1 -#endif - -// Some of our own availability macros -#if GTM_MACOS_SDK -#define GTM_AVAILABLE_ONLY_ON_IPHONE UNAVAILABLE_ATTRIBUTE -#define GTM_AVAILABLE_ONLY_ON_MACOS -#else -#define GTM_AVAILABLE_ONLY_ON_IPHONE -#define GTM_AVAILABLE_ONLY_ON_MACOS UNAVAILABLE_ATTRIBUTE -#endif - -// GC was dropped by Apple, define the old constant incase anyone still keys -// off of it. -#ifndef GTM_SUPPORT_GC - #define GTM_SUPPORT_GC 0 -#endif - -// To simplify support for 64bit (and Leopard in general), we provide the type -// defines for non Leopard SDKs -#if !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) - // NSInteger/NSUInteger and Max/Mins - #ifndef NSINTEGER_DEFINED - #if __LP64__ || NS_BUILD_32_LIKE_64 - typedef long NSInteger; - typedef unsigned long NSUInteger; - #else - typedef int NSInteger; - typedef unsigned int NSUInteger; - #endif - #define NSIntegerMax LONG_MAX - #define NSIntegerMin LONG_MIN - #define NSUIntegerMax ULONG_MAX - #define NSINTEGER_DEFINED 1 - #endif // NSINTEGER_DEFINED - // CGFloat - #ifndef CGFLOAT_DEFINED - #if defined(__LP64__) && __LP64__ - // This really is an untested path (64bit on Tiger?) - typedef double CGFloat; - #define CGFLOAT_MIN DBL_MIN - #define CGFLOAT_MAX DBL_MAX - #define CGFLOAT_IS_DOUBLE 1 - #else /* !defined(__LP64__) || !__LP64__ */ - typedef float CGFloat; - #define CGFLOAT_MIN FLT_MIN - #define CGFLOAT_MAX FLT_MAX - #define CGFLOAT_IS_DOUBLE 0 - #endif /* !defined(__LP64__) || !__LP64__ */ - #define CGFLOAT_DEFINED 1 - #endif // CGFLOAT_DEFINED -#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 - -// Some support for advanced clang static analysis functionality -// See http://clang-analyzer.llvm.org/annotations.html -#ifndef __has_feature // Optional. - #define __has_feature(x) 0 // Compatibility with non-clang compilers. -#endif - -#ifndef NS_RETURNS_RETAINED - #if __has_feature(attribute_ns_returns_retained) - #define NS_RETURNS_RETAINED __attribute__((ns_returns_retained)) - #else - #define NS_RETURNS_RETAINED - #endif -#endif - -#ifndef NS_RETURNS_NOT_RETAINED - #if __has_feature(attribute_ns_returns_not_retained) - #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) - #else - #define NS_RETURNS_NOT_RETAINED - #endif -#endif - -#ifndef CF_RETURNS_RETAINED - #if __has_feature(attribute_cf_returns_retained) - #define CF_RETURNS_RETAINED __attribute__((cf_returns_retained)) - #else - #define CF_RETURNS_RETAINED - #endif -#endif - -#ifndef CF_RETURNS_NOT_RETAINED - #if __has_feature(attribute_cf_returns_not_retained) - #define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained)) - #else - #define CF_RETURNS_NOT_RETAINED - #endif -#endif - -#ifndef NS_CONSUMED - #if __has_feature(attribute_ns_consumed) - #define NS_CONSUMED __attribute__((ns_consumed)) - #else - #define NS_CONSUMED - #endif -#endif - -#ifndef CF_CONSUMED - #if __has_feature(attribute_cf_consumed) - #define CF_CONSUMED __attribute__((cf_consumed)) - #else - #define CF_CONSUMED - #endif -#endif - -#ifndef NS_CONSUMES_SELF - #if __has_feature(attribute_ns_consumes_self) - #define NS_CONSUMES_SELF __attribute__((ns_consumes_self)) - #else - #define NS_CONSUMES_SELF - #endif -#endif - -// Defined on 10.6 and above. -#ifndef NS_FORMAT_ARGUMENT - #define NS_FORMAT_ARGUMENT(A) -#endif - -// Defined on 10.6 and above. -#ifndef NS_FORMAT_FUNCTION - #define NS_FORMAT_FUNCTION(F,A) -#endif - -// Defined on 10.6 and above. -#ifndef CF_FORMAT_ARGUMENT - #define CF_FORMAT_ARGUMENT(A) -#endif - -// Defined on 10.6 and above. -#ifndef CF_FORMAT_FUNCTION - #define CF_FORMAT_FUNCTION(F,A) -#endif - -#ifndef GTM_NONNULL - #if defined(__has_attribute) - #if __has_attribute(nonnull) - #define GTM_NONNULL(x) __attribute__((nonnull x)) - #else - #define GTM_NONNULL(x) - #endif - #else - #define GTM_NONNULL(x) - #endif -#endif - -// Invalidates the initializer from which it's called. -#ifndef GTMInvalidateInitializer - #if __has_feature(objc_arc) - #define GTMInvalidateInitializer() \ - do { \ - [self class]; /* Avoid warning of dead store to |self|. */ \ - _GTMDevAssert(NO, @"Invalid initializer."); \ - return nil; \ - } while (0) - #else - #define GTMInvalidateInitializer() \ - do { \ - [self release]; \ - _GTMDevAssert(NO, @"Invalid initializer."); \ - return nil; \ - } while (0) - #endif -#endif - -#ifdef __OBJC__ - -// Declared here so that it can easily be used for logging tracking if -// necessary. See GTMUnitTestDevLog.h for details. -@class NSString; -GTM_EXTERN void _GTMUnitTestDevLog(NSString *format, ...) NS_FORMAT_FUNCTION(1, 2); - -// Macro to allow you to create NSStrings out of other macros. -// #define FOO foo -// NSString *fooString = GTM_NSSTRINGIFY(FOO); -#if !defined (GTM_NSSTRINGIFY) - #define GTM_NSSTRINGIFY_INNER(x) @#x - #define GTM_NSSTRINGIFY(x) GTM_NSSTRINGIFY_INNER(x) -#endif - -// Macro to allow fast enumeration when building for 10.5 or later, and -// reliance on NSEnumerator for 10.4. Remember, NSDictionary w/ FastEnumeration -// does keys, so pick the right thing, nothing is done on the FastEnumeration -// side to be sure you're getting what you wanted. -#ifndef GTM_FOREACH_OBJECT - #if TARGET_OS_IPHONE || !(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) - #define GTM_FOREACH_ENUMEREE(element, enumeration) \ - for (element in enumeration) - #define GTM_FOREACH_OBJECT(element, collection) \ - for (element in collection) - #define GTM_FOREACH_KEY(element, collection) \ - for (element in collection) - #else - #define GTM_FOREACH_ENUMEREE(element, enumeration) \ - for (NSEnumerator *_ ## element ## _enum = enumeration; \ - (element = [_ ## element ## _enum nextObject]) != nil; ) - #define GTM_FOREACH_OBJECT(element, collection) \ - GTM_FOREACH_ENUMEREE(element, [collection objectEnumerator]) - #define GTM_FOREACH_KEY(element, collection) \ - GTM_FOREACH_ENUMEREE(element, [collection keyEnumerator]) - #endif -#endif - -// ============================================================================ - -// To simplify support for both Leopard and Snow Leopard we declare -// the Snow Leopard protocols that we need here. -#if !defined(GTM_10_6_PROTOCOLS_DEFINED) && !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) -#define GTM_10_6_PROTOCOLS_DEFINED 1 -@protocol NSConnectionDelegate -@end -@protocol NSAnimationDelegate -@end -@protocol NSImageDelegate -@end -@protocol NSTabViewDelegate -@end -#endif // !defined(GTM_10_6_PROTOCOLS_DEFINED) && !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) - -// GTM_SEL_STRING is for specifying selector (usually property) names to KVC -// or KVO methods. -// In debug it will generate warnings for undeclared selectors if -// -Wunknown-selector is turned on. -// In release it will have no runtime overhead. -#ifndef GTM_SEL_STRING - #ifdef DEBUG - #define GTM_SEL_STRING(selName) NSStringFromSelector(@selector(selName)) - #else - #define GTM_SEL_STRING(selName) @#selName - #endif // DEBUG -#endif // GTM_SEL_STRING - -#endif // __OBJC__ diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMGarbageCollection.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMGarbageCollection.h deleted file mode 100644 index 93d4efab..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMGarbageCollection.h +++ /dev/null @@ -1,72 +0,0 @@ -// -// GTMGarbageCollection.h -// -// Copyright 2007-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -#import - -#import "GTMDefines.h" - -// This allows us to easily move our code from GC to non GC. -// They are no-ops unless we are require Leopard or above. -// See -// http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/index.html -// and -// http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcCoreFoundation.html#//apple_ref/doc/uid/TP40006687-SW1 -// for details. - -#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5) && !GTM_IPHONE_SDK -// General use would be to call this through GTMCFAutorelease -// but there may be a reason the you want to make something collectable -// but not autoreleased, especially in pure GC code where you don't -// want to bother with the nop autorelease. Done as a define instead of an -// inline so that tools like Clang's scan-build don't report code as leaking. -#define GTMNSMakeCollectable(cf) ((id)NSMakeCollectable(cf)) - -// GTMNSMakeUncollectable is for global maps, etc. that we don't -// want released ever. You should still retain these in non-gc code. -GTM_INLINE void GTMNSMakeUncollectable(id object) { - [[NSGarbageCollector defaultCollector] disableCollectorForPointer:object]; -} - -// Hopefully no code really needs this, but GTMIsGarbageCollectionEnabled is -// a common way to check at runtime if GC is on. -// There are some places where GC doesn't work w/ things w/in Apple's -// frameworks, so this is here so GTM unittests and detect it, and not run -// individual tests to work around bugs in Apple's frameworks. -GTM_INLINE BOOL GTMIsGarbageCollectionEnabled(void) { - return ([NSGarbageCollector defaultCollector] != nil); -} - -#else - -#define GTMNSMakeCollectable(cf) ((id)(cf)) - -GTM_INLINE void GTMNSMakeUncollectable(id object) { -} - -GTM_INLINE BOOL GTMIsGarbageCollectionEnabled(void) { - return NO; -} - -#endif - -// GTMCFAutorelease makes a CF object collectable in GC mode, or adds it -// to the autorelease pool in non-GC mode. Either way it is taken care -// of. Done as a define instead of an inline so that tools like Clang's -// scan-build don't report code as leaking. -#define GTMCFAutorelease(cf) ([GTMNSMakeCollectable(cf) autorelease]) - diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPFetchHistory.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPFetchHistory.h deleted file mode 100644 index 96018f5d..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPFetchHistory.h +++ /dev/null @@ -1,187 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTMHTTPFetchHistory.h -// - -// -// Users of the GTMHTTPFetcher class may optionally create and set a fetch -// history object. The fetch history provides "memory" between subsequent -// fetches, including: -// -// - For fetch responses with Etag headers, the fetch history -// remembers the response headers. Future fetcher requests to the same URL -// will be given an "If-None-Match" header, telling the server to return -// a 304 Not Modified status if the response is unchanged, reducing the -// server load and network traffic. -// -// - Optionally, the fetch history can cache the ETagged data that was returned -// in the responses that contained Etag headers. If a later fetch -// results in a 304 status, the fetcher will return the cached ETagged data -// to the client along with a 200 status, hiding the 304. -// -// - The fetch history can track cookies. -// - -#pragma once - -#import - -#import "GTMHTTPFetcher.h" - -#undef _EXTERN -#undef _INITIALIZE_AS -#ifdef GTMHTTPFETCHHISTORY_DEFINE_GLOBALS - #define _EXTERN - #define _INITIALIZE_AS(x) =x -#else - #if defined(__cplusplus) - #define _EXTERN extern "C" - #else - #define _EXTERN extern - #endif - #define _INITIALIZE_AS(x) -#endif - - -// default data cache size for when we're caching responses to handle "not -// modified" errors for the client -#if GTM_IPHONE -// iPhone: up to 1MB memory -_EXTERN const NSUInteger kGTMDefaultETaggedDataCacheMemoryCapacity _INITIALIZE_AS(1*1024*1024); -#else -// Mac OS X: up to 15MB memory -_EXTERN const NSUInteger kGTMDefaultETaggedDataCacheMemoryCapacity _INITIALIZE_AS(15*1024*1024); -#endif - -// forward declarations -@class GTMURLCache; -@class GTMCookieStorage; - -@interface GTMHTTPFetchHistory : NSObject { - @private - GTMURLCache *etaggedDataCache_; - BOOL shouldRememberETags_; - BOOL shouldCacheETaggedData_; // if NO, then only headers are cached - GTMCookieStorage *cookieStorage_; -} - -// With caching enabled, previously-cached data will be returned instead of -// 304 Not Modified responses when repeating a fetch of an URL that previously -// included an ETag header in its response -@property (assign) BOOL shouldRememberETags; // default: NO -@property (assign) BOOL shouldCacheETaggedData; // default: NO - -// the default ETag data cache capacity is kGTMDefaultETaggedDataCacheMemoryCapacity -@property (assign) NSUInteger memoryCapacity; - -@property (retain) GTMCookieStorage *cookieStorage; - -- (id)initWithMemoryCapacity:(NSUInteger)totalBytes - shouldCacheETaggedData:(BOOL)shouldCacheETaggedData; - -- (void)updateRequest:(NSMutableURLRequest *)request isHTTPGet:(BOOL)isHTTPGet; - -- (void)clearETaggedDataCache; -- (void)clearHistory; - -- (void)removeAllCookies; - -@end - - -// GTMURLCache and GTMCachedURLResponse have interfaces similar to their -// NSURLCache counterparts, in hopes that someday the NSURLCache versions -// can be used. But in 10.5.8, those are not reliable enough except when -// used with +setSharedURLCache. Our goal here is just to cache -// responses for handling If-None-Match requests that return -// "Not Modified" responses, not for replacing the general URL -// caches. - -@interface GTMCachedURLResponse : NSObject { - @private - NSURLResponse *response_; - NSData *data_; - NSDate *useDate_; // date this response was last saved or used - NSDate *reservationDate_; // date this response's ETag was used -} - -@property (readonly) NSURLResponse* response; -@property (readonly) NSData* data; - -// date the response was saved or last accessed -@property (retain) NSDate *useDate; - -// date the response's ETag header was last used for a fetch request -@property (retain) NSDate *reservationDate; - -- (id)initWithResponse:(NSURLResponse *)response data:(NSData *)data; -@end - -@interface GTMURLCache : NSObject { - NSMutableDictionary *responses_; // maps request URL to GTMCachedURLResponse - NSUInteger memoryCapacity_; // capacity of NSDatas in the responses - NSUInteger totalDataSize_; // sum of sizes of NSDatas of all responses - NSTimeInterval reservationInterval_; // reservation expiration interval -} - -@property (assign) NSUInteger memoryCapacity; - -- (id)initWithMemoryCapacity:(NSUInteger)totalBytes; - -- (GTMCachedURLResponse *)cachedResponseForRequest:(NSURLRequest *)request; -- (void)storeCachedResponse:(GTMCachedURLResponse *)cachedResponse forRequest:(NSURLRequest *)request; -- (void)removeCachedResponseForRequest:(NSURLRequest *)request; -- (void)removeAllCachedResponses; - -// for unit testing -- (void)setReservationInterval:(NSTimeInterval)secs; -- (NSDictionary *)responses; -- (NSUInteger)totalDataSize; -@end - -@interface GTMCookieStorage : NSObject { - @private - // The cookie storage object manages an array holding cookies, but the array - // is allocated externally (it may be in a fetcher object or the static - // fetcher cookie array.) See the fetcher's setCookieStorageMethod: - // for allocation of this object and assignment of its cookies array. - NSMutableArray *cookies_; -} - -// add all NSHTTPCookies in the supplied array to the storage array, -// replacing cookies in the storage array as appropriate -// Side effect: removes expired cookies from the storage array -- (void)setCookies:(NSArray *)newCookies; - -// retrieve all cookies appropriate for the given URL, considering -// domain, path, cookie name, expiration, security setting. -// Side effect: removes expired cookies from the storage array -- (NSArray *)cookiesForURL:(NSURL *)theURL; - -// return a cookie with the same name, domain, and path as the -// given cookie, or else return nil if none found -// -// Both the cookie being tested and all stored cookies should -// be valid (non-nil name, domains, paths) -- (NSHTTPCookie *)cookieMatchingCookie:(NSHTTPCookie *)cookie; - -// remove any expired cookies, excluding cookies with nil expirations -- (void)removeExpiredCookies; - -- (void)removeAllCookies; - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPFetcher.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPFetcher.h deleted file mode 100644 index a681390b..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPFetcher.h +++ /dev/null @@ -1,765 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTMHTTPFetcher.h -// - -// This is essentially a wrapper around NSURLConnection for POSTs and GETs. -// If setPostData: is called, then POST is assumed. -// -// When would you use this instead of NSURLConnection? -// -// - When you just want the result from a GET, POST, or PUT -// - When you want the "standard" behavior for connections (redirection handling -// an so on) -// - When you want automatic retry on failures -// - When you want to avoid cookie collisions with Safari and other applications -// - When you are fetching resources with ETags and want to avoid the overhead -// of repeated fetches of unchanged data -// - When you need to set a credential for the http operation -// -// This is assumed to be a one-shot fetch request; don't reuse the object -// for a second fetch. -// -// The fetcher may be created auto-released, in which case it will release -// itself after the fetch completion callback. The fetcher is implicitly -// retained as long as a connection is pending. -// -// But if you may need to cancel the fetcher, retain it and have the delegate -// release the fetcher in the callbacks. -// -// Sample usage: -// -// NSURLRequest *request = [NSURLRequest requestWithURL:myURL]; -// GTMHTTPFetcher* myFetcher = [GTMHTTPFetcher fetcherWithRequest:request]; -// -// // optional upload body data -// [myFetcher setPostData:[postString dataUsingEncoding:NSUTF8StringEncoding]]; -// -// [myFetcher beginFetchWithDelegate:self -// didFinishSelector:@selector(myFetcher:finishedWithData:error:)]; -// -// Upon fetch completion, the callback selector is invoked; it should have -// this signature (you can use any callback method name you want so long as -// the signature matches this): -// -// - (void)myFetcher:(GTMHTTPFetcher *)fetcher finishedWithData:(NSData *)retrievedData error:(NSError *)error; -// -// The block callback version looks like: -// -// [myFetcher beginFetchWithCompletionHandler:^(NSData *retrievedData, NSError *error) { -// if (error != nil) { -// // status code or network error -// } else { -// // succeeded -// } -// }]; - -// -// NOTE: Fetches may retrieve data from the server even though the server -// returned an error. The failure selector is called when the server -// status is >= 300, with an NSError having domain -// kGTMHTTPFetcherStatusDomain and code set to the server status. -// -// Status codes are at -// -// -// Threading and queue support: -// -// Callbacks require either that the thread used to start the fetcher have a run -// loop spinning (typically the main thread), or that an NSOperationQueue be -// provided upon which the delegate callbacks will be called. Starting with -// iOS 6 and Mac OS X 10.7, clients may simply create an operation queue for -// callbacks on a background thread: -// -// NSOperationQueue *queue = [[[NSOperationQueue alloc] init] autorelease]; -// [queue setMaxConcurrentOperationCount:1]; -// fetcher.delegateQueue = queue; -// -// or specify the main queue for callbacks on the main thread: -// -// fetcher.delegateQueue = [NSOperationQueue mainQueue]; -// -// The client may also re-dispatch from the callbacks and notifications to -// a known dispatch queue: -// -// [myFetcher beginFetchWithCompletionHandler:^(NSData *retrievedData, NSError *error) { -// if (error == nil) { -// dispatch_async(myDispatchQueue, ^{ -// ... -// }); -// } -// }]; -// -// -// -// Downloading to disk: -// -// To have downloaded data saved directly to disk, specify either a path for the -// downloadPath property, or a file handle for the downloadFileHandle property. -// When downloading to disk, callbacks will be passed a nil for the NSData* -// arguments. -// -// -// HTTP methods and headers: -// -// Alternative HTTP methods, like PUT, and custom headers can be specified by -// creating the fetcher with an appropriate NSMutableURLRequest -// -// -// Proxies: -// -// Proxy handling is invisible so long as the system has a valid credential in -// the keychain, which is normally true (else most NSURL-based apps would have -// difficulty.) But when there is a proxy authetication error, the the fetcher -// will call the failedWithError: method with the NSURLChallenge in the error's -// userInfo. The error method can get the challenge info like this: -// -// NSURLAuthenticationChallenge *challenge -// = [[error userInfo] objectForKey:kGTMHTTPFetcherErrorChallengeKey]; -// BOOL isProxyChallenge = [[challenge protectionSpace] isProxy]; -// -// If a proxy error occurs, you can ask the user for the proxy username/password -// and call fetcher's setProxyCredential: to provide those for the -// next attempt to fetch. -// -// -// Cookies: -// -// There are three supported mechanisms for remembering cookies between fetches. -// -// By default, GTMHTTPFetcher uses a mutable array held statically to track -// cookies for all instantiated fetchers. This avoids server cookies being set -// by servers for the application from interfering with Safari cookie settings, -// and vice versa. The fetcher cookies are lost when the application quits. -// -// To rely instead on WebKit's global NSHTTPCookieStorage, call -// setCookieStorageMethod: with kGTMHTTPFetcherCookieStorageMethodSystemDefault. -// -// If the fetcher is created from a GTMHTTPFetcherService object -// then the cookie storage mechanism is set to use the cookie storage in the -// service object rather than the static storage. -// -// -// Fetching for periodic checks: -// -// The fetcher object tracks ETag headers from responses and -// provide an "If-None-Match" header. This allows the server to save -// bandwidth by providing a status message instead of repeated response -// data. -// -// To get this behavior, create the fetcher from an GTMHTTPFetcherService object -// and look for a fetch callback error with code 304 -// (kGTMHTTPFetcherStatusNotModified) like this: -// -// - (void)myFetcher:(GTMHTTPFetcher *)fetcher finishedWithData:(NSData *)data error:(NSError *)error { -// if ([error code] == kGTMHTTPFetcherStatusNotModified) { -// // |data| is empty; use the data from the previous finishedWithData: for this URL -// } else { -// // handle other server status code -// } -// } -// -// -// Monitoring received data -// -// The optional received data selector can be set with setReceivedDataSelector: -// and should have the signature -// -// - (void)myFetcher:(GTMHTTPFetcher *)fetcher receivedData:(NSData *)dataReceivedSoFar; -// -// The number bytes received so far is available as [fetcher downloadedLength]. -// This number may go down if a redirect causes the download to begin again from -// a new server. -// -// If supplied by the server, the anticipated total download size is available -// as [[myFetcher response] expectedContentLength] (and may be -1 for unknown -// download sizes.) -// -// -// Automatic retrying of fetches -// -// The fetcher can optionally create a timer and reattempt certain kinds of -// fetch failures (status codes 408, request timeout; 503, service unavailable; -// 504, gateway timeout; networking errors NSURLErrorTimedOut and -// NSURLErrorNetworkConnectionLost.) The user may set a retry selector to -// customize the type of errors which will be retried. -// -// Retries are done in an exponential-backoff fashion (that is, after 1 second, -// 2, 4, 8, and so on.) -// -// Enabling automatic retries looks like this: -// [myFetcher setRetryEnabled:YES]; -// -// With retries enabled, the success or failure callbacks are called only -// when no more retries will be attempted. Calling the fetcher's stopFetching -// method will terminate the retry timer, without the finished or failure -// selectors being invoked. -// -// Optionally, the client may set the maximum retry interval: -// [myFetcher setMaxRetryInterval:60.0]; // in seconds; default is 60 seconds -// // for downloads, 600 for uploads -// -// Also optionally, the client may provide a callback selector to determine -// if a status code or other error should be retried. -// [myFetcher setRetrySelector:@selector(myFetcher:willRetry:forError:)]; -// -// If set, the retry selector should have the signature: -// -(BOOL)fetcher:(GTMHTTPFetcher *)fetcher willRetry:(BOOL)suggestedWillRetry forError:(NSError *)error -// and return YES to set the retry timer or NO to fail without additional -// fetch attempts. -// -// The retry method may return the |suggestedWillRetry| argument to get the -// default retry behavior. Server status codes are present in the -// error argument, and have the domain kGTMHTTPFetcherStatusDomain. The -// user's method may look something like this: -// -// -(BOOL)myFetcher:(GTMHTTPFetcher *)fetcher willRetry:(BOOL)suggestedWillRetry forError:(NSError *)error { -// -// // perhaps examine [error domain] and [error code], or [fetcher retryCount] -// // -// // return YES to start the retry timer, NO to proceed to the failure -// // callback, or |suggestedWillRetry| to get default behavior for the -// // current error domain and code values. -// return suggestedWillRetry; -// } - - - -#pragma once - -#import - -#if defined(GTL_TARGET_NAMESPACE) - // we're using target namespace macros - #import "GTLDefines.h" -#elif defined(GDATA_TARGET_NAMESPACE) - #import "GDataDefines.h" -#else - #if TARGET_OS_IPHONE - #ifndef GTM_FOUNDATION_ONLY - #define GTM_FOUNDATION_ONLY 1 - #endif - #ifndef GTM_IPHONE - #define GTM_IPHONE 1 - #endif - #endif -#endif - -#if TARGET_OS_IPHONE && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 40000) - #define GTM_BACKGROUND_FETCHING 1 -#endif - -#undef _EXTERN -#undef _INITIALIZE_AS -#ifdef GTMHTTPFETCHER_DEFINE_GLOBALS - #define _EXTERN - #define _INITIALIZE_AS(x) =x -#else - #if defined(__cplusplus) - #define _EXTERN extern "C" - #else - #define _EXTERN extern - #endif - #define _INITIALIZE_AS(x) -#endif - -// notifications -// -// fetch started and stopped, and fetch retry delay started and stopped -_EXTERN NSString* const kGTMHTTPFetcherStartedNotification _INITIALIZE_AS(@"kGTMHTTPFetcherStartedNotification"); -_EXTERN NSString* const kGTMHTTPFetcherStoppedNotification _INITIALIZE_AS(@"kGTMHTTPFetcherStoppedNotification"); -_EXTERN NSString* const kGTMHTTPFetcherRetryDelayStartedNotification _INITIALIZE_AS(@"kGTMHTTPFetcherRetryDelayStartedNotification"); -_EXTERN NSString* const kGTMHTTPFetcherRetryDelayStoppedNotification _INITIALIZE_AS(@"kGTMHTTPFetcherRetryDelayStoppedNotification"); - -// callback constants -_EXTERN NSString* const kGTMHTTPFetcherErrorDomain _INITIALIZE_AS(@"com.google.GTMHTTPFetcher"); -_EXTERN NSString* const kGTMHTTPFetcherStatusDomain _INITIALIZE_AS(@"com.google.HTTPStatus"); -_EXTERN NSString* const kGTMHTTPFetcherErrorChallengeKey _INITIALIZE_AS(@"challenge"); -_EXTERN NSString* const kGTMHTTPFetcherStatusDataKey _INITIALIZE_AS(@"data"); // data returned with a kGTMHTTPFetcherStatusDomain error - -enum { - kGTMHTTPFetcherErrorDownloadFailed = -1, - kGTMHTTPFetcherErrorAuthenticationChallengeFailed = -2, - kGTMHTTPFetcherErrorChunkUploadFailed = -3, - kGTMHTTPFetcherErrorFileHandleException = -4, - kGTMHTTPFetcherErrorBackgroundExpiration = -6, - - // The code kGTMHTTPFetcherErrorAuthorizationFailed (-5) has been removed; - // look for status 401 instead. - - kGTMHTTPFetcherStatusNotModified = 304, - kGTMHTTPFetcherStatusBadRequest = 400, - kGTMHTTPFetcherStatusUnauthorized = 401, - kGTMHTTPFetcherStatusForbidden = 403, - kGTMHTTPFetcherStatusPreconditionFailed = 412 -}; - -// cookie storage methods -enum { - kGTMHTTPFetcherCookieStorageMethodStatic = 0, - kGTMHTTPFetcherCookieStorageMethodFetchHistory = 1, - kGTMHTTPFetcherCookieStorageMethodSystemDefault = 2, - kGTMHTTPFetcherCookieStorageMethodNone = 3 -}; - -#ifdef __cplusplus -extern "C" { -#endif - -void GTMAssertSelectorNilOrImplementedWithArgs(id obj, SEL sel, ...); - -// Utility functions for applications self-identifying to servers via a -// user-agent header - -// Make a proper app name without whitespace from the given string, removing -// whitespace and other characters that may be special parsed marks of -// the full user-agent string. -NSString *GTMCleanedUserAgentString(NSString *str); - -// Make an identifier like "MacOSX/10.7.1" or "iPod_Touch/4.1" -NSString *GTMSystemVersionString(void); - -// Make a generic name and version for the current application, like -// com.example.MyApp/1.2.3 relying on the bundle identifier and the -// CFBundleShortVersionString or CFBundleVersion. If no bundle ID -// is available, the process name preceded by "proc_" is used. -NSString *GTMApplicationIdentifier(NSBundle *bundle); - -#ifdef __cplusplus -} // extern "C" -#endif - -@class GTMHTTPFetcher; - -@protocol GTMCookieStorageProtocol -// This protocol allows us to call into the service without requiring -// GTMCookieStorage sources in this project -// -// The public interface for cookie handling is the GTMCookieStorage class, -// accessible from a fetcher service object's fetchHistory or from the fetcher's -// +staticCookieStorage method. -- (NSArray *)cookiesForURL:(NSURL *)theURL; -- (void)setCookies:(NSArray *)newCookies; -@end - -@protocol GTMHTTPFetchHistoryProtocol -// This protocol allows us to call the fetch history object without requiring -// GTMHTTPFetchHistory sources in this project -- (void)updateRequest:(NSMutableURLRequest *)request isHTTPGet:(BOOL)isHTTPGet; -- (BOOL)shouldCacheETaggedData; -- (NSData *)cachedDataForRequest:(NSURLRequest *)request; -- (id )cookieStorage; -- (void)updateFetchHistoryWithRequest:(NSURLRequest *)request - response:(NSURLResponse *)response - downloadedData:(NSData *)downloadedData; -- (void)removeCachedDataForRequest:(NSURLRequest *)request; -@end - -@protocol GTMHTTPFetcherServiceProtocol -// This protocol allows us to call into the service without requiring -// GTMHTTPFetcherService sources in this project - -@property (retain) NSOperationQueue *delegateQueue; - -- (BOOL)fetcherShouldBeginFetching:(GTMHTTPFetcher *)fetcher; -- (void)fetcherDidStop:(GTMHTTPFetcher *)fetcher; - -- (GTMHTTPFetcher *)fetcherWithRequest:(NSURLRequest *)request; -- (BOOL)isDelayingFetcher:(GTMHTTPFetcher *)fetcher; -@end - -@protocol GTMFetcherAuthorizationProtocol -@required -// This protocol allows us to call the authorizer without requiring its sources -// in this project. -- (void)authorizeRequest:(NSMutableURLRequest *)request - delegate:(id)delegate - didFinishSelector:(SEL)sel; - -- (void)stopAuthorization; - -- (void)stopAuthorizationForRequest:(NSURLRequest *)request; - -- (BOOL)isAuthorizingRequest:(NSURLRequest *)request; - -- (BOOL)isAuthorizedRequest:(NSURLRequest *)request; - -@property (retain, readonly) NSString *userEmail; - -@optional - -// Indicate if authorization may be attempted. Even if this succeeds, -// authorization may fail if the user's permissions have been revoked. -@property (readonly) BOOL canAuthorize; - -// For development only, allow authorization of non-SSL requests, allowing -// transmission of the bearer token unencrypted. -@property (assign) BOOL shouldAuthorizeAllRequests; - -#if NS_BLOCKS_AVAILABLE -- (void)authorizeRequest:(NSMutableURLRequest *)request - completionHandler:(void (^)(NSError *error))handler; -#endif - -@property (assign) id fetcherService; // WEAK - -- (BOOL)primeForRefresh; - -@end - -// GTMHTTPFetcher objects are used for async retrieval of an http get or post -// -// See additional comments at the beginning of this file -@interface GTMHTTPFetcher : NSObject { - @protected - NSMutableURLRequest *request_; - NSURLConnection *connection_; - NSMutableData *downloadedData_; - NSString *downloadPath_; - NSString *temporaryDownloadPath_; - NSFileHandle *downloadFileHandle_; - unsigned long long downloadedLength_; - NSURLCredential *credential_; // username & password - NSURLCredential *proxyCredential_; // credential supplied to proxy servers - NSData *postData_; - NSInputStream *postStream_; - NSMutableData *loggedStreamData_; - NSURLResponse *response_; // set in connection:didReceiveResponse: - id delegate_; - SEL finishedSel_; // should by implemented by delegate - SEL sentDataSel_; // optional, set with setSentDataSelector - SEL receivedDataSel_; // optional, set with setReceivedDataSelector -#if NS_BLOCKS_AVAILABLE - void (^completionBlock_)(NSData *, NSError *); - void (^receivedDataBlock_)(NSData *); - void (^sentDataBlock_)(NSInteger, NSInteger, NSInteger); - BOOL (^retryBlock_)(BOOL, NSError *); -#elif !__LP64__ - // placeholders: for 32-bit builds, keep the size of the object's ivar section - // the same with and without blocks - id completionPlaceholder_; - id receivedDataPlaceholder_; - id sentDataPlaceholder_; - id retryPlaceholder_; -#endif - BOOL hasConnectionEnded_; // set if the connection need not be cancelled - BOOL isCancellingChallenge_; // set only when cancelling an auth challenge - BOOL isStopNotificationNeeded_; // set when start notification has been sent - BOOL shouldFetchInBackground_; -#if GTM_BACKGROUND_FETCHING - NSUInteger backgroundTaskIdentifer_; // UIBackgroundTaskIdentifier -#endif - id userData_; // retained, if set by caller - NSMutableDictionary *properties_; // more data retained for caller - NSArray *runLoopModes_; // optional - NSOperationQueue *delegateQueue_; // optional; available iOS 6/10.7 and later - id fetchHistory_; // if supplied by the caller, used for Last-Modified-Since checks and cookies - NSInteger cookieStorageMethod_; // constant from above - id cookieStorage_; - - id authorizer_; - - // the service object that created and monitors this fetcher, if any - id service_; - NSString *serviceHost_; - NSInteger servicePriority_; - NSThread *thread_; - - BOOL isRetryEnabled_; // user wants auto-retry - SEL retrySel_; // optional; set with setRetrySelector - NSTimer *retryTimer_; - NSUInteger retryCount_; - NSTimeInterval maxRetryInterval_; // default 600 seconds - NSTimeInterval minRetryInterval_; // random between 1 and 2 seconds - NSTimeInterval retryFactor_; // default interval multiplier is 2 - NSTimeInterval lastRetryInterval_; - BOOL hasAttemptedAuthRefresh_; - - NSString *comment_; // comment for log - NSString *log_; -#if !STRIP_GTM_FETCH_LOGGING - NSString *logRequestBody_; - NSString *logResponseBody_; - BOOL shouldDeferResponseBodyLogging_; -#endif -} - -// Create a fetcher -// -// fetcherWithRequest will return an autoreleased fetcher, but if -// the connection is successfully created, the connection should retain the -// fetcher for the life of the connection as well. So the caller doesn't have -// to retain the fetcher explicitly unless they want to be able to cancel it. -+ (GTMHTTPFetcher *)fetcherWithRequest:(NSURLRequest *)request; - -// Convenience methods that make a request, like +fetcherWithRequest -+ (GTMHTTPFetcher *)fetcherWithURL:(NSURL *)requestURL; -+ (GTMHTTPFetcher *)fetcherWithURLString:(NSString *)requestURLString; - -// Designated initializer -- (id)initWithRequest:(NSURLRequest *)request; - -// Fetcher request -// -// The underlying request is mutable and may be modified by the caller -@property (retain) NSMutableURLRequest *mutableRequest; - -// Setting the credential is optional; it is used if the connection receives -// an authentication challenge -@property (retain) NSURLCredential *credential; - -// Setting the proxy credential is optional; it is used if the connection -// receives an authentication challenge from a proxy -@property (retain) NSURLCredential *proxyCredential; - -// If post data or stream is not set, then a GET retrieval method is assumed -@property (retain) NSData *postData; -@property (retain) NSInputStream *postStream; - -// The default cookie storage method is kGTMHTTPFetcherCookieStorageMethodStatic -// without a fetch history set, and kGTMHTTPFetcherCookieStorageMethodFetchHistory -// with a fetch history set -// -// Applications needing control of cookies across a sequence of fetches should -// create fetchers from a GTMHTTPFetcherService object (which encapsulates -// fetch history) for a well-defined cookie store -@property (assign) NSInteger cookieStorageMethod; - -+ (id )staticCookieStorage; - -// Object to add authorization to the request, if needed -@property (retain) id authorizer; - -// The service object that created and monitors this fetcher, if any -@property (retain) id service; - -// The host, if any, used to classify this fetcher in the fetcher service -@property (copy) NSString *serviceHost; - -// The priority, if any, used for starting fetchers in the fetcher service -// -// Lower values are higher priority; the default is 0, and values may -// be negative or positive. This priority affects only the start order of -// fetchers that are being delayed by a fetcher service. -@property (assign) NSInteger servicePriority; - -// The thread used to run this fetcher in the fetcher service when no operation -// queue is provided. -@property (retain) NSThread *thread; - -// The delegate is retained during the connection -@property (retain) id delegate; - -// On iOS 4 and later, the fetch may optionally continue while the app is in the -// background until finished or stopped by OS expiration -// -// The default value is NO -// -// For Mac OS X, background fetches are always supported, and this property -// is ignored -@property (assign) BOOL shouldFetchInBackground; - -// The delegate's optional sentData selector may be used to monitor upload -// progress. It should have a signature like: -// - (void)myFetcher:(GTMHTTPFetcher *)fetcher -// didSendBytes:(NSInteger)bytesSent -// totalBytesSent:(NSInteger)totalBytesSent -// totalBytesExpectedToSend:(NSInteger)totalBytesExpectedToSend; -// -// +doesSupportSentDataCallback indicates if this delegate method is supported -+ (BOOL)doesSupportSentDataCallback; - -@property (assign) SEL sentDataSelector; - -// The delegate's optional receivedData selector may be used to monitor download -// progress. It should have a signature like: -// - (void)myFetcher:(GTMHTTPFetcher *)fetcher -// receivedData:(NSData *)dataReceivedSoFar; -// -// The dataReceived argument will be nil when downloading to a path or to a -// file handle. -// -// Applications should not use this method to accumulate the received data; -// the callback method or block supplied to the beginFetch call will have -// the complete NSData received. -@property (assign) SEL receivedDataSelector; - -#if NS_BLOCKS_AVAILABLE -// The full interface to the block is provided rather than just a typedef for -// its parameter list in order to get more useful code completion in the Xcode -// editor -@property (copy) void (^sentDataBlock)(NSInteger bytesSent, NSInteger totalBytesSent, NSInteger bytesExpectedToSend); - -// The dataReceived argument will be nil when downloading to a path or to -// a file handle -@property (copy) void (^receivedDataBlock)(NSData *dataReceivedSoFar); -#endif - -// retrying; see comments at the top of the file. Calling -// setRetryEnabled(YES) resets the min and max retry intervals. -@property (assign, getter=isRetryEnabled) BOOL retryEnabled; - -// Retry selector or block is optional for retries. -// -// If present, it should have the signature: -// -(BOOL)fetcher:(GTMHTTPFetcher *)fetcher willRetry:(BOOL)suggestedWillRetry forError:(NSError *)error -// and return YES to cause a retry. See comments at the top of this file. -@property (assign) SEL retrySelector; - -#if NS_BLOCKS_AVAILABLE -@property (copy) BOOL (^retryBlock)(BOOL suggestedWillRetry, NSError *error); -#endif - -// Retry intervals must be strictly less than maxRetryInterval, else -// they will be limited to maxRetryInterval and no further retries will -// be attempted. Setting maxRetryInterval to 0.0 will reset it to the -// default value, 600 seconds. - -@property (assign) NSTimeInterval maxRetryInterval; - -// Starting retry interval. Setting minRetryInterval to 0.0 will reset it -// to a random value between 1.0 and 2.0 seconds. Clients should normally not -// call this except for unit testing. -@property (assign) NSTimeInterval minRetryInterval; - -// Multiplier used to increase the interval between retries, typically 2.0. -// Clients should not need to call this. -@property (assign) double retryFactor; - -// Number of retries attempted -@property (readonly) NSUInteger retryCount; - -// interval delay to precede next retry -@property (readonly) NSTimeInterval nextRetryInterval; - -// Begin fetching the request -// -// The delegate can optionally implement the finished selectors or pass NULL -// for it. -// -// Returns YES if the fetch is initiated. The delegate is retained between -// the beginFetch call until after the finish callback. -// -// An error is passed to the callback for server statuses 300 or -// higher, with the status stored as the error object's code. -// -// finishedSEL has a signature like: -// - (void)fetcher:(GTMHTTPFetcher *)fetcher finishedWithData:(NSData *)data error:(NSError *)error; -// -// If the application has specified a downloadPath or downloadFileHandle -// for the fetcher, the data parameter passed to the callback will be nil. - -- (BOOL)beginFetchWithDelegate:(id)delegate - didFinishSelector:(SEL)finishedSEL; - -#if NS_BLOCKS_AVAILABLE -- (BOOL)beginFetchWithCompletionHandler:(void (^)(NSData *data, NSError *error))handler; -#endif - - -// Returns YES if this is in the process of fetching a URL -- (BOOL)isFetching; - -// Cancel the fetch of the request that's currently in progress -- (void)stopFetching; - -// Return the status code from the server response -@property (readonly) NSInteger statusCode; - -// Return the http headers from the response -@property (retain, readonly) NSDictionary *responseHeaders; - -// The response, once it's been received -@property (retain) NSURLResponse *response; - -// Bytes downloaded so far -@property (readonly) unsigned long long downloadedLength; - -// Buffer of currently-downloaded data -@property (readonly, retain) NSData *downloadedData; - -// Path in which to non-atomically create a file for storing the downloaded data -// -// The path must be set before fetching begins. The download file handle -// will be created for the path, and can be used to monitor progress. If a file -// already exists at the path, it will be overwritten. -@property (copy) NSString *downloadPath; - -// If downloadFileHandle is set, data received is immediately appended to -// the file handle rather than being accumulated in the downloadedData property -// -// The file handle supplied must allow writing and support seekToFileOffset:, -// and must be set before fetching begins. Setting a download path will -// override the file handle property. -@property (retain) NSFileHandle *downloadFileHandle; - -// The optional fetchHistory object is used for a sequence of fetchers to -// remember ETags, cache ETagged data, and store cookies. Typically, this -// is set by a GTMFetcherService object when it creates a fetcher. -// -// Side effect: setting fetch history implicitly calls setCookieStorageMethod: -@property (retain) id fetchHistory; - -// userData is retained for the convenience of the caller -@property (retain) id userData; - -// Stored property values are retained for the convenience of the caller -@property (copy) NSMutableDictionary *properties; - -- (void)setProperty:(id)obj forKey:(NSString *)key; // pass nil obj to remove property -- (id)propertyForKey:(NSString *)key; - -- (void)addPropertiesFromDictionary:(NSDictionary *)dict; - -// Comments are useful for logging -@property (copy) NSString *comment; - -- (void)setCommentWithFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2); - -// Log of request and response, if logging is enabled -@property (copy) NSString *log; - -// Callbacks can be invoked on an operation queue rather than via the run loop, -// starting on 10.7 and iOS 6. If a delegate queue is supplied. the run loop -// modes are ignored. -@property (retain) NSOperationQueue *delegateQueue; - -// Using the fetcher while a modal dialog is displayed requires setting the -// run-loop modes to include NSModalPanelRunLoopMode -@property (retain) NSArray *runLoopModes; - -// Users who wish to replace GTMHTTPFetcher's use of NSURLConnection -// can do so globally here. The replacement should be a subclass of -// NSURLConnection. -+ (Class)connectionClass; -+ (void)setConnectionClass:(Class)theClass; - -// Spin the run loop, discarding events, until the fetch has completed -// -// This is only for use in testing or in tools without a user interface. -// -// Synchronous fetches should never be done by shipping apps; they are -// sufficient reason for rejection from the app store. -- (void)waitForCompletionWithTimeout:(NSTimeInterval)timeoutInSeconds; - -#if STRIP_GTM_FETCH_LOGGING -// if logging is stripped, provide a stub for the main method -// for controlling logging -+ (void)setLoggingEnabled:(BOOL)flag; -#endif // STRIP_GTM_FETCH_LOGGING - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPFetcherService.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPFetcherService.h deleted file mode 100644 index 9c6cd754..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPFetcherService.h +++ /dev/null @@ -1,125 +0,0 @@ -/* Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTMHTTPFetcherService.h -// - -// The fetcher service class maintains a history to be used by a sequence -// of fetchers objects generated by the service. -// -// Fetchers that do not need to share a history may be generated independently, -// like -// -// GTMHTTPFetcher* myFetcher = [GTMHTTPFetcher fetcherWithRequest:request]; -// -// Fetchers that should share cookies or an ETagged data cache should be -// generated by a common GTMHTTPFetcherService instance, like -// -// GTMHTTPFetcherService *myFetcherService = [[GTMHTTPFetcherService alloc] init]; -// GTMHTTPFetcher* myFirstFetcher = [myFetcherService fetcherWithRequest:request1]; -// GTMHTTPFetcher* mySecondFetcher = [myFetcherService fetcherWithRequest:request2]; - -#import "GTMHTTPFetcher.h" -#import "GTMHTTPFetchHistory.h" - -@interface GTMHTTPFetcherService : NSObject { - @private - NSMutableDictionary *delayedHosts_; - NSMutableDictionary *runningHosts_; - NSUInteger maxRunningFetchersPerHost_; - - GTMHTTPFetchHistory *fetchHistory_; - NSOperationQueue *delegateQueue_; - NSArray *runLoopModes_; - NSString *userAgent_; - NSTimeInterval timeout_; - NSURLCredential *credential_; // username & password - NSURLCredential *proxyCredential_; // credential supplied to proxy servers - NSInteger cookieStorageMethod_; - - BOOL shouldFetchInBackground_; - - id authorizer_; -} - -// Create a fetcher -// -// These methods will return an autoreleased fetcher, but if -// the fetcher is successfully created, the connection will retain the -// fetcher for the life of the connection as well. So the caller doesn't have -// to retain the fetcher explicitly unless they want to be able to monitor -// or cancel it. -- (GTMHTTPFetcher *)fetcherWithRequest:(NSURLRequest *)request; -- (GTMHTTPFetcher *)fetcherWithURL:(NSURL *)requestURL; -- (GTMHTTPFetcher *)fetcherWithURLString:(NSString *)requestURLString; -- (id)fetcherWithRequest:(NSURLRequest *)request - fetcherClass:(Class)fetcherClass; - -// Queues of delayed and running fetchers. Each dictionary contains arrays -// of fetchers, keyed by host -// -// A max value of 0 means no fetchers should be delayed. -// -// The default limit is 10 simultaneous fetchers targeting each host. -@property (assign) NSUInteger maxRunningFetchersPerHost; -@property (retain, readonly) NSDictionary *delayedHosts; -@property (retain, readonly) NSDictionary *runningHosts; - -- (BOOL)isDelayingFetcher:(GTMHTTPFetcher *)fetcher; - -- (NSUInteger)numberOfFetchers; // running + delayed fetchers -- (NSUInteger)numberOfRunningFetchers; -- (NSUInteger)numberOfDelayedFetchers; - -// Search for running or delayed fetchers with the specified URL. -// -// Returns an array of fetcher objects found, or nil if none found. -- (NSArray *)issuedFetchersWithRequestURL:(NSURL *)requestURL; - -- (void)stopAllFetchers; - -// Properties to be applied to each fetcher; -// see GTMHTTPFetcher.h for descriptions -@property (copy) NSString *userAgent; -@property (assign) NSTimeInterval timeout; -@property (retain) NSOperationQueue *delegateQueue; -@property (retain) NSArray *runLoopModes; -@property (retain) NSURLCredential *credential; -@property (retain) NSURLCredential *proxyCredential; -@property (assign) BOOL shouldFetchInBackground; - -// Fetch history -@property (retain) GTMHTTPFetchHistory *fetchHistory; - -@property (assign) NSInteger cookieStorageMethod; -@property (assign) BOOL shouldRememberETags; // default: NO -@property (assign) BOOL shouldCacheETaggedData; // default: NO - -- (void)clearETaggedDataCache; -- (void)clearHistory; - -@property (nonatomic, retain) id authorizer; - -// Spin the run loop, discarding events, until all running and delayed fetchers -// have completed -// -// This is only for use in testing or in tools without a user interface. -// -// Synchronous fetches should never be done by shipping apps; they are -// sufficient reason for rejection from the app store. -- (void)waitForCompletionOfAllFetchersWithTimeout:(NSTimeInterval)timeoutInSeconds; - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMLogger.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMLogger.h deleted file mode 100644 index c4fd1402..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMLogger.h +++ /dev/null @@ -1,504 +0,0 @@ -// -// GTMLogger.h -// -// Copyright 2007-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -// Key Abstractions -// ---------------- -// -// This file declares multiple classes and protocols that are used by the -// GTMLogger logging system. The 4 main abstractions used in this file are the -// following: -// -// * logger (GTMLogger) - The main logging class that users interact with. It -// has methods for logging at different levels and uses a log writer, a log -// formatter, and a log filter to get the job done. -// -// * log writer (GTMLogWriter) - Writes a given string to some log file, where -// a "log file" can be a physical file on disk, a POST over HTTP to some URL, -// or even some in-memory structure (e.g., a ring buffer). -// -// * log formatter (GTMLogFormatter) - Given a format string and arguments as -// a va_list, returns a single formatted NSString. A "formatted string" could -// be a string with the date prepended, a string with values in a CSV format, -// or even a string of XML. -// -// * log filter (GTMLogFilter) - Given a formatted log message as an NSString -// and the level at which the message is to be logged, this class will decide -// whether the given message should be logged or not. This is a flexible way -// to filter out messages logged at a certain level, messages that contain -// certain text, or filter nothing out at all. This gives the caller the -// flexibility to dynamically enable debug logging in Release builds. -// -// This file also declares some classes to handle the common log writer, log -// formatter, and log filter cases. Callers can also create their own writers, -// formatters, and filters and they can even build them on top of the ones -// declared here. Keep in mind that your custom writer/formatter/filter may be -// called from multiple threads, so it must be thread-safe. - -#import -#import "GTMDefines.h" - -// Predeclaration of used protocols that are declared later in this file. -@protocol GTMLogWriter, GTMLogFormatter, GTMLogFilter; - -// GTMLogger -// -// GTMLogger is the primary user-facing class for an object-oriented logging -// system. It is built on the concept of log formatters (GTMLogFormatter), log -// writers (GTMLogWriter), and log filters (GTMLogFilter). When a message is -// sent to a GTMLogger to log a message, the message is formatted using the log -// formatter, then the log filter is consulted to see if the message should be -// logged, and if so, the message is sent to the log writer to be written out. -// -// GTMLogger is intended to be a flexible and thread-safe logging solution. Its -// flexibility comes from the fact that GTMLogger instances can be customized -// with user defined formatters, filters, and writers. And these writers, -// filters, and formatters can be combined, stacked, and customized in arbitrary -// ways to suit the needs at hand. For example, multiple writers can be used at -// the same time, and a GTMLogger instance can even be used as another -// GTMLogger's writer. This allows for arbitrarily deep logging trees. -// -// A standard GTMLogger uses a writer that sends messages to standard out, a -// formatter that smacks a timestamp and a few other bits of interesting -// information on the message, and a filter that filters out debug messages from -// release builds. Using the standard log settings, a log message will look like -// the following: -// -// 2007-12-30 10:29:24.177 myapp[4588/0xa07d0f60] [lvl=1] foo= -// -// The output contains the date and time of the log message, the name of the -// process followed by its process ID/thread ID, the log level at which the -// message was logged (in the previous example the level was 1: -// kGTMLoggerLevelDebug), and finally, the user-specified log message itself (in -// this case, the log message was @"foo=%@", foo). -// -// Multiple instances of GTMLogger can be created, each configured their own -// way. Though GTMLogger is not a singleton (in the GoF sense), it does provide -// access to a shared (i.e., globally accessible) GTMLogger instance. This makes -// it convenient for all code in a process to use the same GTMLogger instance. -// The shared GTMLogger instance can also be configured in an arbitrary, and -// these configuration changes will affect all code that logs through the shared -// instance. - -// -// Log Levels -// ---------- -// GTMLogger has 3 different log levels: Debug, Info, and Error. GTMLogger -// doesn't take any special action based on the log level; it simply forwards -// this information on to formatters, filters, and writers, each of which may -// optionally take action based on the level. Since log level filtering is -// performed at runtime, log messages are typically not filtered out at compile -// time. The exception to this rule is that calls to the GTMLoggerDebug() macro -// *ARE* filtered out of non-DEBUG builds. This is to be backwards compatible -// with behavior that many developers are currently used to. Note that this -// means that GTMLoggerDebug(@"hi") will be compiled out of Release builds, but -// [[GTMLogger sharedLogger] logDebug:@"hi"] will NOT be compiled out. -// -// Standard loggers are created with the GTMLogLevelFilter log filter, which -// filters out certain log messages based on log level, and some other settings. -// -// In addition to the -logDebug:, -logInfo:, and -logError: methods defined on -// GTMLogger itself, there are also C macros that make usage of the shared -// GTMLogger instance very convenient. These macros are: -// -// GTMLoggerDebug(...) -// GTMLoggerInfo(...) -// GTMLoggerError(...) -// -// Again, a notable feature of these macros is that GTMLogDebug() calls *will be -// compiled out of non-DEBUG builds*. -// -// Standard Loggers -// ---------------- -// GTMLogger has the concept of "standard loggers". A standard logger is simply -// a logger that is pre-configured with some standard/common writer, formatter, -// and filter combination. Standard loggers are created using the creation -// methods beginning with "standard". The alternative to a standard logger is a -// regular logger, which will send messages to stdout, with no special -// formatting, and no filtering. -// -// How do I use GTMLogger? -// ---------------------- -// The typical way you will want to use GTMLogger is to simply use the -// GTMLogger*() macros for logging from code. That way we can easily make -// changes to the GTMLogger class and simply update the macros accordingly. Only -// your application startup code (perhaps, somewhere in main()) should use the -// GTMLogger class directly in order to configure the shared logger, which all -// of the code using the macros will be using. Again, this is just the typical -// situation. -// -// To be complete, there are cases where you may want to use GTMLogger directly, -// or even create separate GTMLogger instances for some reason. That's fine, -// too. -// -// Examples -// -------- -// The following show some common GTMLogger use cases. -// -// 1. You want to log something as simply as possible. Also, this call will only -// appear in debug builds. In non-DEBUG builds it will be completely removed. -// -// GTMLoggerDebug(@"foo = %@", foo); -// -// 2. The previous example is similar to the following. The major difference is -// that the previous call (example 1) will be compiled out of Release builds -// but this statement will not be compiled out. -// -// [[GTMLogger sharedLogger] logDebug:@"foo = %@", foo]; -// -// 3. Send all logging output from the shared logger to a file. We do this by -// creating an NSFileHandle for writing associated with a file, and setting -// that file handle as the logger's writer. -// -// NSFileHandle *f = [NSFileHandle fileHandleForWritingAtPath:@"/tmp/f.log" -// create:YES]; -// [[GTMLogger sharedLogger] setWriter:f]; -// GTMLoggerError(@"hi"); // This will be sent to /tmp/f.log -// -// 4. Create a new GTMLogger that will log to a file. This example differs from -// the previous one because here we create a new GTMLogger that is different -// from the shared logger. -// -// GTMLogger *logger = [GTMLogger standardLoggerWithPath:@"/tmp/temp.log"]; -// [logger logInfo:@"hi temp log file"]; -// -// 5. Create a logger that writes to stdout and does NOT do any formatting to -// the log message. This might be useful, for example, when writing a help -// screen for a command-line tool to standard output. -// -// GTMLogger *logger = [GTMLogger logger]; -// [logger logInfo:@"%@ version 0.1 usage", progName]; -// -// 6. Send log output to stdout AND to a log file. The trick here is that -// NSArrays function as composite log writers, which means when an array is -// set as the log writer, it forwards all logging messages to all of its -// contained GTMLogWriters. -// -// // Create array of GTMLogWriters -// NSArray *writers = [NSArray arrayWithObjects: -// [NSFileHandle fileHandleForWritingAtPath:@"/tmp/f.log" create:YES], -// [NSFileHandle fileHandleWithStandardOutput], nil]; -// -// GTMLogger *logger = [GTMLogger standardLogger]; -// [logger setWriter:writers]; -// [logger logInfo:@"hi"]; // Output goes to stdout and /tmp/f.log -// -// For futher details on log writers, formatters, and filters, see the -// documentation below. -// -// NOTE: GTMLogger is application level logging. By default it does nothing -// with _GTMDevLog/_GTMDevAssert (see GTMDefines.h). An application can choose -// to bridge _GTMDevLog/_GTMDevAssert to GTMLogger by providing macro -// definitions in its prefix header (see GTMDefines.h for how one would do -// that). -// -@interface GTMLogger : NSObject { - @private - id writer_; - id formatter_; - id filter_; -} - -// -// Accessors for the shared logger instance -// - -// Returns a shared/global standard GTMLogger instance. Callers should typically -// use this method to get a GTMLogger instance, unless they explicitly want -// their own instance to configure for their own needs. This is the only method -// that returns a shared instance; all the rest return new GTMLogger instances. -+ (id)sharedLogger; - -// Sets the shared logger instance to |logger|. Future calls to +sharedLogger -// will return |logger| instead. -+ (void)setSharedLogger:(GTMLogger *)logger; - -// -// Creation methods -// - -// Returns a new autoreleased GTMLogger instance that will log to stdout, using -// the GTMLogStandardFormatter, and the GTMLogLevelFilter filter. -+ (id)standardLogger; - -// Same as +standardLogger, but logs to stderr. -+ (id)standardLoggerWithStderr; - -// Same as +standardLogger but levels >= kGTMLoggerLevelError are routed to -// stderr, everything else goes to stdout. -+ (id)standardLoggerWithStdoutAndStderr; - -// Returns a new standard GTMLogger instance with a log writer that will -// write to the file at |path|, and will use the GTMLogStandardFormatter and -// GTMLogLevelFilter classes. If |path| does not exist, it will be created. -+ (id)standardLoggerWithPath:(NSString *)path; - -// Returns an autoreleased GTMLogger instance that will use the specified -// |writer|, |formatter|, and |filter|. -+ (id)loggerWithWriter:(id)writer - formatter:(id)formatter - filter:(id)filter; - -// Returns an autoreleased GTMLogger instance that logs to stdout, with the -// basic formatter, and no filter. The returned logger differs from the logger -// returned by +standardLogger because this one does not do any filtering and -// does not do any special log formatting; this is the difference between a -// "regular" logger and a "standard" logger. -+ (id)logger; - -// Designated initializer. This method returns a GTMLogger initialized with the -// specified |writer|, |formatter|, and |filter|. See the setter methods below -// for what values will be used if nil is passed for a parameter. -- (id)initWithWriter:(id)writer - formatter:(id)formatter - filter:(id)filter; - -// -// Logging methods -// - -// Logs a message at the debug level (kGTMLoggerLevelDebug). -- (void)logDebug:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2); -// Logs a message at the info level (kGTMLoggerLevelInfo). -- (void)logInfo:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2); -// Logs a message at the error level (kGTMLoggerLevelError). -- (void)logError:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2); -// Logs a message at the assert level (kGTMLoggerLevelAssert). -- (void)logAssert:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2); - - -// -// Accessors -// - -// Accessor methods for the log writer. If the log writer is set to nil, -// [NSFileHandle fileHandleWithStandardOutput] is used. -- (id)writer; -- (void)setWriter:(id)writer; - -// Accessor methods for the log formatter. If the log formatter is set to nil, -// GTMLogBasicFormatter is used. This formatter will format log messages in a -// plain printf style. -- (id)formatter; -- (void)setFormatter:(id)formatter; - -// Accessor methods for the log filter. If the log filter is set to nil, -// GTMLogNoFilter is used, which allows all log messages through. -- (id)filter; -- (void)setFilter:(id)filter; - -@end // GTMLogger - - -// Helper functions that are used by the convenience GTMLogger*() macros that -// enable the logging of function names. -@interface GTMLogger (GTMLoggerMacroHelpers) -- (void)logFuncDebug:(const char *)func msg:(NSString *)fmt, ... - NS_FORMAT_FUNCTION(2, 3); -- (void)logFuncInfo:(const char *)func msg:(NSString *)fmt, ... - NS_FORMAT_FUNCTION(2, 3); -- (void)logFuncError:(const char *)func msg:(NSString *)fmt, ... - NS_FORMAT_FUNCTION(2, 3); -- (void)logFuncAssert:(const char *)func msg:(NSString *)fmt, ... - NS_FORMAT_FUNCTION(2, 3); -@end // GTMLoggerMacroHelpers - - -// The convenience macros are only defined if they haven't already been defined. -#ifndef GTMLoggerInfo - -// Convenience macros that log to the shared GTMLogger instance. These macros -// are how users should typically log to GTMLogger. Notice that GTMLoggerDebug() -// calls will be compiled out of non-Debug builds. -#define GTMLoggerDebug(...) \ - [[GTMLogger sharedLogger] logFuncDebug:__func__ msg:__VA_ARGS__] -#define GTMLoggerInfo(...) \ - [[GTMLogger sharedLogger] logFuncInfo:__func__ msg:__VA_ARGS__] -#define GTMLoggerError(...) \ - [[GTMLogger sharedLogger] logFuncError:__func__ msg:__VA_ARGS__] -#define GTMLoggerAssert(...) \ - [[GTMLogger sharedLogger] logFuncAssert:__func__ msg:__VA_ARGS__] - -// If we're not in a debug build, remove the GTMLoggerDebug statements. This -// makes calls to GTMLoggerDebug "compile out" of Release builds -#ifndef DEBUG -#undef GTMLoggerDebug -#define GTMLoggerDebug(...) do {} while(0) -#endif - -#endif // !defined(GTMLoggerInfo) - -// Log levels. -typedef enum { - kGTMLoggerLevelUnknown, - kGTMLoggerLevelDebug, - kGTMLoggerLevelInfo, - kGTMLoggerLevelError, - kGTMLoggerLevelAssert, -} GTMLoggerLevel; - - -// -// Log Writers -// - -// Protocol to be implemented by a GTMLogWriter instance. -@protocol GTMLogWriter -// Writes the given log message to where the log writer is configured to write. -- (void)logMessage:(NSString *)msg level:(GTMLoggerLevel)level; -@end // GTMLogWriter - - -// Simple category on NSFileHandle that makes NSFileHandles valid log writers. -// This is convenient because something like, say, +fileHandleWithStandardError -// now becomes a valid log writer. Log messages are written to the file handle -// with a newline appended. -@interface NSFileHandle (GTMFileHandleLogWriter) -// Opens the file at |path| in append mode, and creates the file with |mode| -// if it didn't previously exist. -+ (id)fileHandleForLoggingAtPath:(NSString *)path mode:(mode_t)mode; -@end // NSFileHandle - - -// This category makes NSArray a GTMLogWriter that can be composed of other -// GTMLogWriters. This is the classic Composite GoF design pattern. When the -// GTMLogWriter -logMessage:level: message is sent to the array, the array -// forwards the message to all of its elements that implement the GTMLogWriter -// protocol. -// -// This is useful in situations where you would like to send log output to -// multiple log writers at the same time. Simply create an NSArray of the log -// writers you wish to use, then set the array as the "writer" for your -// GTMLogger instance. -@interface NSArray (GTMArrayCompositeLogWriter) -@end // GTMArrayCompositeLogWriter - - -// This category adapts the GTMLogger interface so that it can be used as a log -// writer; it's an "adapter" in the GoF Adapter pattern sense. -// -// This is useful when you want to configure a logger to log to a specific -// writer with a specific formatter and/or filter. But you want to also compose -// that with a different log writer that may have its own formatter and/or -// filter. -@interface GTMLogger (GTMLoggerLogWriter) -@end // GTMLoggerLogWriter - - -// -// Log Formatters -// - -// Protocol to be implemented by a GTMLogFormatter instance. -@protocol GTMLogFormatter -// Returns a formatted string using the format specified in |fmt| and the va -// args specified in |args|. -- (NSString *)stringForFunc:(NSString *)func - withFormat:(NSString *)fmt - valist:(va_list)args - level:(GTMLoggerLevel)level NS_FORMAT_FUNCTION(2, 0); -@end // GTMLogFormatter - - -// A basic log formatter that formats a string the same way that NSLog (or -// printf) would. It does not do anything fancy, nor does it add any data of its -// own. -@interface GTMLogBasicFormatter : NSObject - -// Helper method for prettying C99 __func__ and GCC __PRETTY_FUNCTION__ -- (NSString *)prettyNameForFunc:(NSString *)func; - -@end // GTMLogBasicFormatter - - -// A log formatter that formats the log string like the basic formatter, but -// also prepends a timestamp and some basic process info to the message, as -// shown in the following sample output. -// 2007-12-30 10:29:24.177 myapp[4588/0xa07d0f60] [lvl=1] log mesage here -@interface GTMLogStandardFormatter : GTMLogBasicFormatter { - @private - NSDateFormatter *dateFormatter_; // yyyy-MM-dd HH:mm:ss.SSS - NSString *pname_; - pid_t pid_; -} -@end // GTMLogStandardFormatter - - -// -// Log Filters -// - -// Protocol to be imlemented by a GTMLogFilter instance. -@protocol GTMLogFilter -// Returns YES if |msg| at |level| should be filtered out; NO otherwise. -- (BOOL)filterAllowsMessage:(NSString *)msg level:(GTMLoggerLevel)level; -@end // GTMLogFilter - - -// A log filter that filters messages at the kGTMLoggerLevelDebug level out of -// non-debug builds. Messages at the kGTMLoggerLevelInfo level are also filtered -// out of non-debug builds unless GTMVerboseLogging is set in the environment or -// the processes's defaults. Messages at the kGTMLoggerLevelError level are -// never filtered. -@interface GTMLogLevelFilter : NSObject -@end // GTMLogLevelFilter - -// A simple log filter that does NOT filter anything out; -// -filterAllowsMessage:level will always return YES. This can be a convenient -// way to enable debug-level logging in release builds (if you so desire). -@interface GTMLogNoFilter : NSObject -@end // GTMLogNoFilter - - -// Base class for custom level filters. Not for direct use, use the minimum -// or maximum level subclasses below. -@interface GTMLogAllowedLevelFilter : NSObject { - @private - NSIndexSet *allowedLevels_; -} -@end - -// A log filter that allows you to set a minimum log level. Messages below this -// level will be filtered. -@interface GTMLogMininumLevelFilter : GTMLogAllowedLevelFilter - -// Designated initializer, logs at levels < |level| will be filtered. -- (id)initWithMinimumLevel:(GTMLoggerLevel)level; - -@end - -// A log filter that allows you to set a maximum log level. Messages whose level -// exceeds this level will be filtered. This is really only useful if you have -// a composite GTMLogger that is sending the other messages elsewhere. -@interface GTMLogMaximumLevelFilter : GTMLogAllowedLevelFilter - -// Designated initializer, logs at levels > |level| will be filtered. -- (id)initWithMaximumLevel:(GTMLoggerLevel)level; - -@end - - -// For subclasses only -@interface GTMLogger (PrivateMethods) - -- (void)logInternalFunc:(const char *)func - format:(NSString *)fmt - valist:(va_list)args - level:(GTMLoggerLevel)level NS_FORMAT_FUNCTION(2, 0); - -@end - diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMMethodCheck.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMMethodCheck.h deleted file mode 100644 index 7b0919b0..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMMethodCheck.h +++ /dev/null @@ -1,88 +0,0 @@ -// -// GTMMethodCheck.h -// -// Copyright 2006-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -#import -#import -#import - -/// A macro for enforcing debug time checks to make sure all required methods are linked in -// -// When using categories, it can be very easy to forget to include the -// implementation of a category. -// Let's say you had a class foo that depended on method bar of class baz, and -// method bar was implemented as a member of a category. -// You could add the following code: -// @implementation foo -// GTM_METHOD_CHECK(baz, bar) -// @end -// and the code would check to make sure baz was implemented just before main -// was called. This works for both dynamic libraries, and executables. -// -// Classes (or one of their superclasses) being checked must conform to the -// NSObject protocol. We will check this, and spit out a warning if a class does -// not conform to NSObject. -// -// This is not compiled into release builds. - -#ifdef DEBUG - -#ifdef __cplusplus -extern "C" { -#endif - -// If you get an error for GTMMethodCheckMethodChecker not being defined, -// you need to link in GTMMethodCheck.m. We keep it hidden so that we can have -// it living in several separate images without conflict. -// Functions with the ((constructor)) attribute are called after all +loads -// have been called. See "Initializing Objective-C Classes" in -// http://developer.apple.com/documentation/DeveloperTools/Conceptual/DynamicLibraries/Articles/DynamicLibraryDesignGuidelines.html#//apple_ref/doc/uid/TP40002013-DontLinkElementID_20 - -__attribute__ ((constructor, visibility("hidden"))) void GTMMethodCheckMethodChecker(void); - -#ifdef __cplusplus -}; -#endif - -// This is the "magic". -// A) we need a multi layer define here so that the stupid preprocessor -// expands __LINE__ out the way we want it. We need LINE so that each of -// out GTM_METHOD_CHECKs generates a unique class method for the class. -#define GTM_METHOD_CHECK(class, method) GTM_METHOD_CHECK_INNER(class, method, __LINE__) -#define GTM_METHOD_CHECK_INNER(class, method, line) GTM_METHOD_CHECK_INNER_INNER(class, method, line) - -// B) Create up a class method called xxGMethodCheckMethod+class+line that the -// GTMMethodCheckMethodChecker function can look for and call. We -// look for GTMMethodCheckMethodChecker to enforce linkage of -// GTMMethodCheck.m. -#define GTM_METHOD_CHECK_INNER_INNER(class, method, line) \ -+ (void)xxGTMMethodCheckMethod ## class ## line { \ - void (*addr)() = GTMMethodCheckMethodChecker; \ - if (addr && ![class instancesRespondToSelector:@selector(method)] \ - && ![class respondsToSelector:@selector(method)]) { \ - fprintf(stderr, "%s:%d: error: We need method '%s' to be linked in for class '%s'\n", \ - __FILE__, line, #method, #class); \ - exit(EX_SOFTWARE); \ - } \ -} - -#else // !DEBUG - -// Do nothing in release. -#define GTM_METHOD_CHECK(class, method) - -#endif // DEBUG diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMNSDictionary+URLArguments.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMNSDictionary+URLArguments.h deleted file mode 100644 index b0944111..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMNSDictionary+URLArguments.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// GTMNSDictionary+URLArguments.h -// -// Copyright 2006-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -#import - -/// Utility for building a URL or POST argument string. -@interface NSDictionary (GTMNSDictionaryURLArgumentsAdditions) - -/// Returns a dictionary of the decoded key-value pairs in a http arguments -/// string of the form key1=value1&key2=value2&...&keyN=valueN. -/// Keys and values will be unescaped automatically. -/// Only the first value for a repeated key is returned. -+ (NSDictionary *)gtm_dictionaryWithHttpArgumentsString:(NSString *)argString; - -/// Gets a string representation of the dictionary in the form -/// key1=value1&key2=value2&...&keyN=valueN, suitable for use as either -/// URL arguments (after a '?') or POST body. Keys and values will be escaped -/// automatically, so should be unescaped in the dictionary. -- (NSString *)gtm_httpArgumentsString; - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMNSString+URLArguments.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMNSString+URLArguments.h deleted file mode 100644 index d4c7e09a..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMNSString+URLArguments.h +++ /dev/null @@ -1,41 +0,0 @@ -// -// GTMNSString+URLArguments.h -// -// Copyright 2006-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -#import - -/// Utilities for encoding and decoding URL arguments. -@interface NSString (GTMNSStringURLArgumentsAdditions) - -/// Returns a string that is escaped properly to be a URL argument. -// -/// This differs from stringByAddingPercentEscapesUsingEncoding: in that it -/// will escape all the reserved characters (per RFC 3986 -/// ) which -/// stringByAddingPercentEscapesUsingEncoding would leave. -/// -/// This will also escape '%', so this should not be used on a string that has -/// already been escaped unless double-escaping is the desired result. -- (NSString*)gtm_stringByEscapingForURLArgument; - -/// Returns the unescaped version of a URL argument -// -/// This has the same behavior as stringByReplacingPercentEscapesUsingEncoding:, -/// except that it will also convert '+' to space. -- (NSString*)gtm_stringByUnescapingFromURLArgument; - -@end diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMOAuth2Authentication.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMOAuth2Authentication.h deleted file mode 100644 index 8703164b..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMOAuth2Authentication.h +++ /dev/null @@ -1,356 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES - -// This class implements the OAuth 2 protocol for authorizing requests. -// http://tools.ietf.org/html/draft-ietf-oauth-v2 - -#import - -// GTMHTTPFetcher.h brings in GTLDefines/GDataDefines -#import "GTMHTTPFetcher.h" - -#undef _EXTERN -#undef _INITIALIZE_AS -#ifdef GTMOAUTH2AUTHENTICATION_DEFINE_GLOBALS - #define _EXTERN - #define _INITIALIZE_AS(x) =x -#else - #if defined(__cplusplus) - #define _EXTERN extern "C" - #else - #define _EXTERN extern - #endif - #define _INITIALIZE_AS(x) -#endif - -// Until all OAuth 2 providers are up to the same spec, we'll provide a crude -// way here to override the "Bearer" string in the Authorization header -#ifndef GTM_OAUTH2_BEARER -#define GTM_OAUTH2_BEARER "Bearer" -#endif - -// Service provider name allows stored authorization to be associated with -// the authorizing service -_EXTERN NSString* const kGTMOAuth2ServiceProviderGoogle _INITIALIZE_AS(@"Google"); - -// -// GTMOAuth2SignIn constants, included here for use by clients -// -_EXTERN NSString* const kGTMOAuth2ErrorDomain _INITIALIZE_AS(@"com.google.GTMOAuth2"); - -// Error userInfo keys -_EXTERN NSString* const kGTMOAuth2ErrorMessageKey _INITIALIZE_AS(@"error"); -_EXTERN NSString* const kGTMOAuth2ErrorRequestKey _INITIALIZE_AS(@"request"); -_EXTERN NSString* const kGTMOAuth2ErrorJSONKey _INITIALIZE_AS(@"json"); - -enum { - // Error code indicating that the window was prematurely closed - kGTMOAuth2ErrorWindowClosed = -1000, - kGTMOAuth2ErrorAuthorizationFailed = -1001, - kGTMOAuth2ErrorTokenExpired = -1002, - kGTMOAuth2ErrorTokenUnavailable = -1003, - kGTMOAuth2ErrorUnauthorizableRequest = -1004 -}; - - -// Notifications for token fetches -_EXTERN NSString* const kGTMOAuth2FetchStarted _INITIALIZE_AS(@"kGTMOAuth2FetchStarted"); -_EXTERN NSString* const kGTMOAuth2FetchStopped _INITIALIZE_AS(@"kGTMOAuth2FetchStopped"); - -_EXTERN NSString* const kGTMOAuth2FetcherKey _INITIALIZE_AS(@"fetcher"); -_EXTERN NSString* const kGTMOAuth2FetchTypeKey _INITIALIZE_AS(@"FetchType"); -_EXTERN NSString* const kGTMOAuth2FetchTypeToken _INITIALIZE_AS(@"token"); -_EXTERN NSString* const kGTMOAuth2FetchTypeRefresh _INITIALIZE_AS(@"refresh"); -_EXTERN NSString* const kGTMOAuth2FetchTypeAssertion _INITIALIZE_AS(@"assertion"); -_EXTERN NSString* const kGTMOAuth2FetchTypeUserInfo _INITIALIZE_AS(@"userInfo"); - -// Token-issuance errors -_EXTERN NSString* const kGTMOAuth2ErrorKey _INITIALIZE_AS(@"error"); -_EXTERN NSString* const kGTMOAuth2ErrorObjectKey _INITIALIZE_AS(@"kGTMOAuth2ErrorObjectKey"); - -_EXTERN NSString* const kGTMOAuth2ErrorInvalidRequest _INITIALIZE_AS(@"invalid_request"); -_EXTERN NSString* const kGTMOAuth2ErrorInvalidClient _INITIALIZE_AS(@"invalid_client"); -_EXTERN NSString* const kGTMOAuth2ErrorInvalidGrant _INITIALIZE_AS(@"invalid_grant"); -_EXTERN NSString* const kGTMOAuth2ErrorUnauthorizedClient _INITIALIZE_AS(@"unauthorized_client"); -_EXTERN NSString* const kGTMOAuth2ErrorUnsupportedGrantType _INITIALIZE_AS(@"unsupported_grant_type"); -_EXTERN NSString* const kGTMOAuth2ErrorInvalidScope _INITIALIZE_AS(@"invalid_scope"); - -// Notification that sign-in has completed, and token fetches will begin (useful -// for displaying interstitial messages after the window has closed) -_EXTERN NSString* const kGTMOAuth2UserSignedIn _INITIALIZE_AS(@"kGTMOAuth2UserSignedIn"); - -// Notification for token changes -_EXTERN NSString* const kGTMOAuth2AccessTokenRefreshed _INITIALIZE_AS(@"kGTMOAuth2AccessTokenRefreshed"); -_EXTERN NSString* const kGTMOAuth2RefreshTokenChanged _INITIALIZE_AS(@"kGTMOAuth2RefreshTokenChanged"); -_EXTERN NSString* const kGTMOAuth2AccessTokenRefreshFailed _INITIALIZE_AS(@"kGTMOAuth2AccessTokenRefreshFailed"); - -// Notification for WebView loading -_EXTERN NSString* const kGTMOAuth2WebViewStartedLoading _INITIALIZE_AS(@"kGTMOAuth2WebViewStartedLoading"); -_EXTERN NSString* const kGTMOAuth2WebViewStoppedLoading _INITIALIZE_AS(@"kGTMOAuth2WebViewStoppedLoading"); -_EXTERN NSString* const kGTMOAuth2WebViewKey _INITIALIZE_AS(@"kGTMOAuth2WebViewKey"); -_EXTERN NSString* const kGTMOAuth2WebViewStopKindKey _INITIALIZE_AS(@"kGTMOAuth2WebViewStopKindKey"); -_EXTERN NSString* const kGTMOAuth2WebViewFinished _INITIALIZE_AS(@"finished"); -_EXTERN NSString* const kGTMOAuth2WebViewFailed _INITIALIZE_AS(@"failed"); -_EXTERN NSString* const kGTMOAuth2WebViewCancelled _INITIALIZE_AS(@"cancelled"); - -// Notification for network loss during html sign-in display -_EXTERN NSString* const kGTMOAuth2NetworkLost _INITIALIZE_AS(@"kGTMOAuthNetworkLost"); -_EXTERN NSString* const kGTMOAuth2NetworkFound _INITIALIZE_AS(@"kGTMOAuthNetworkFound"); - -@interface GTMOAuth2Authentication : NSObject { - @private - NSString *clientID_; - NSString *clientSecret_; - NSString *redirectURI_; - NSMutableDictionary *parameters_; - - // authorization parameters - NSURL *tokenURL_; - NSDate *expirationDate_; - - NSString *authorizationTokenKey_; - - NSDictionary *additionalTokenRequestParameters_; - NSDictionary *additionalGrantTypeRequestParameters_; - - // queue of requests for authorization waiting for a valid access token - GTMHTTPFetcher *refreshFetcher_; - NSMutableArray *authorizationQueue_; - - id fetcherService_; // WEAK - - Class parserClass_; - - BOOL shouldAuthorizeAllRequests_; - - // arbitrary data retained for the user - id userData_; - NSMutableDictionary *properties_; -} - -// OAuth2 standard protocol parameters -// -// These should be the plain strings; any needed escaping will be provided by -// the library. - -// Request properties -@property (copy) NSString *clientID; -@property (copy) NSString *clientSecret; -@property (copy) NSString *redirectURI; -@property (retain) NSString *scope; -@property (retain) NSString *tokenType; -@property (retain) NSString *assertion; -@property (retain) NSString *refreshScope; - -// Apps may optionally add parameters here to be provided to the token -// endpoint on token requests and refreshes. -@property (retain) NSDictionary *additionalTokenRequestParameters; - -// Apps may optionally add parameters here to be provided to the token -// endpoint on specific token requests and refreshes, keyed by the grant_type. -// For example, if a different "type" parameter is required for obtaining -// the auth code and on refresh, this might be: -// -// viewController.authentication.additionalGrantTypeRequestParameters = @{ -// @"authorization_code" : @{ @"type" : @"code" }, -// @"refresh_token" : @{ @"type" : @"refresh" } -// }; -@property (retain) NSDictionary *additionalGrantTypeRequestParameters; - -// Response properties -@property (retain) NSMutableDictionary *parameters; - -@property (retain) NSString *accessToken; -@property (retain) NSString *refreshToken; -@property (retain) NSNumber *expiresIn; -@property (retain) NSString *code; -@property (retain) NSString *errorString; - -// URL for obtaining access tokens -@property (copy) NSURL *tokenURL; - -// Calculated expiration date (expiresIn seconds added to the -// time the access token was received.) -@property (copy) NSDate *expirationDate; - -// Service identifier, like "Google"; not used for authentication -// -// The provider name is just for allowing stored authorization to be associated -// with the authorizing service. -@property (copy) NSString *serviceProvider; - -// User ID; not used for authentication -@property (retain) NSString *userID; - -// User email and verified status; not used for authentication -// -// The verified string can be checked with -boolValue. If the result is false, -// then the email address is listed with the account on the server, but the -// address has not been confirmed as belonging to the owner of the account. -@property (retain) NSString *userEmail; -@property (retain) NSString *userEmailIsVerified; - -// Property indicating if this auth has a refresh or access token so is suitable -// for authorizing a request. This does not guarantee that the token is valid. -@property (readonly) BOOL canAuthorize; - -// Property indicating if this object will authorize plain http request -// (as well as any non-https requests.) Default is NO, only requests with the -// scheme https are authorized, since security may be compromised if tokens -// are sent over the wire using an unencrypted protocol like http. -@property (assign) BOOL shouldAuthorizeAllRequests; - -// userData is retained for the convenience of the caller -@property (retain) id userData; - -// Stored property values are retained for the convenience of the caller -@property (retain) NSDictionary *properties; - -// Property for the optional fetcher service instance to be used to create -// fetchers -// -// Fetcher service objects retain authorizations, so this is weak to avoid -// circular retains. -@property (assign) id fetcherService; // WEAK - -// Alternative JSON parsing class; this should implement the -// GTMOAuth2ParserClass informal protocol. If this property is -// not set, the class SBJSON must be available in the runtime. -@property (assign) Class parserClass; - -// Key for the response parameter used for the authorization header; by default, -// "access_token" is used, but some servers may expect alternatives, like -// "id_token". -@property (copy) NSString *authorizationTokenKey; - -// Convenience method for creating an authentication object -+ (id)authenticationWithServiceProvider:(NSString *)serviceProvider - tokenURL:(NSURL *)tokenURL - redirectURI:(NSString *)redirectURI - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret; - -// Clear out any authentication values, prepare for a new request fetch -- (void)reset; - -// Main authorization entry points -// -// These will refresh the access token, if necessary, add the access token to -// the request, then invoke the callback. -// -// The request argument may be nil to just force a refresh of the access token, -// if needed. -// -// NOTE: To avoid accidental leaks of bearer tokens, the request must -// be for a URL with the scheme https unless the shouldAuthorizeAllRequests -// property is set. - -// The finish selector should have a signature matching -// - (void)authentication:(GTMOAuth2Authentication *)auth -// request:(NSMutableURLRequest *)request -// finishedWithError:(NSError *)error; - -- (void)authorizeRequest:(NSMutableURLRequest *)request - delegate:(id)delegate - didFinishSelector:(SEL)sel; - -#if NS_BLOCKS_AVAILABLE -- (void)authorizeRequest:(NSMutableURLRequest *)request - completionHandler:(void (^)(NSError *error))handler; -#endif - -// Synchronous entry point; authorizing this way cannot refresh an expired -// access token -- (BOOL)authorizeRequest:(NSMutableURLRequest *)request; - -// If the authentication is waiting for a refresh to complete, spin the run -// loop, discarding events, until the fetch has completed -// -// This is only for use in testing or in tools without a user interface. -- (void)waitForCompletionWithTimeout:(NSTimeInterval)timeoutInSeconds; - - -////////////////////////////////////////////////////////////////////////////// -// -// Internal properties and methods for use by GTMOAuth2SignIn -// - -// Pending fetcher to get a new access token, if any -@property (retain) GTMHTTPFetcher *refreshFetcher; - -// Check if a request is queued up to be authorized -- (BOOL)isAuthorizingRequest:(NSURLRequest *)request; - -// Check if a request appears to be authorized -- (BOOL)isAuthorizedRequest:(NSURLRequest *)request; - -// Stop any pending refresh fetch. This will also cancel the authorization -// for all fetch requests pending authorization. -- (void)stopAuthorization; - -// Prevents authorization callback for a given request. -- (void)stopAuthorizationForRequest:(NSURLRequest *)request; - -// OAuth fetch user-agent header value -- (NSString *)userAgent; - -// Parse and set token and token secret from response data -- (void)setKeysForResponseString:(NSString *)str; -- (void)setKeysForResponseDictionary:(NSDictionary *)dict; - -// Persistent token string for keychain storage -// -// We'll use the format "refresh_token=foo&serviceProvider=bar" so we can -// easily alter what portions of the auth data are stored -// -// Use these methods for serialization -- (NSString *)persistenceResponseString; -- (void)setKeysForPersistenceResponseString:(NSString *)str; - -// method to begin fetching an access token, used by the sign-in object -- (GTMHTTPFetcher *)beginTokenFetchWithDelegate:(id)delegate - didFinishSelector:(SEL)finishedSel; - -// Entry point to post a notification about a fetcher currently used for -// obtaining or refreshing a token; the sign-in object will also use this -// to indicate when the user's email address is being fetched. -// -// Fetch type constants are above under "notifications for token fetches" -- (void)notifyFetchIsRunning:(BOOL)isStarting - fetcher:(GTMHTTPFetcher *)fetcher - type:(NSString *)fetchType; - -// Arbitrary key-value properties retained for the user -- (void)setProperty:(id)obj forKey:(NSString *)key; -- (id)propertyForKey:(NSString *)key; - -// -// Utilities -// - -+ (NSString *)encodedOAuthValueForString:(NSString *)str; - -+ (NSString *)encodedQueryParametersForDictionary:(NSDictionary *)dict; - -+ (NSDictionary *)dictionaryWithResponseString:(NSString *)responseStr; - -+ (NSDictionary *)dictionaryWithJSONData:(NSData *)data; - -+ (NSString *)scopeWithStrings:(NSString *)firsStr, ... NS_REQUIRES_NIL_TERMINATION; -@end - -#endif // GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMOAuth2SignIn.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMOAuth2SignIn.h deleted file mode 100644 index ded279bd..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMOAuth2SignIn.h +++ /dev/null @@ -1,187 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// This sign-in object opens and closes the web view window as needed for -// users to sign in. For signing in to Google, it also obtains -// the authenticated user's email address. -// -// Typically, this will be managed for the application by -// GTMOAuth2ViewControllerTouch or GTMOAuth2WindowController, so this -// class's interface is interesting only if -// you are creating your own window controller for sign-in. -// -// -// Delegate methods implemented by the window controller -// -// The window controller implements two methods for use by the sign-in object, -// the webRequestSelector and the finishedSelector: -// -// webRequestSelector has a signature matching -// - (void)signIn:(GTMOAuth2SignIn *)signIn displayRequest:(NSURLRequest *)request -// -// The web request selector will be invoked with a request to be displayed, or -// nil to close the window when the final callback request has been encountered. -// -// -// finishedSelector has a signature matching -// - (void)signin:(GTMOAuth2SignIn *)signin finishedWithAuth:(GTMOAuth2Authentication *)auth error:(NSError *)error -// -// The finished selector will be invoked when sign-in has completed, except -// when explicitly canceled by calling cancelSigningIn -// - -#if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES - -#import -#import - -// GTMHTTPFetcher brings in GTLDefines/GDataDefines -#import "GTMHTTPFetcher.h" - -#import "GTMOAuth2Authentication.h" - -@interface GTMOAuth2SignIn : NSObject { - @private - GTMOAuth2Authentication *auth_; - - // the endpoint for displaying the sign-in page - NSURL *authorizationURL_; - NSDictionary *additionalAuthorizationParameters_; - - id delegate_; - SEL webRequestSelector_; - SEL finishedSelector_; - - BOOL hasHandledCallback_; - - GTMHTTPFetcher *pendingFetcher_; - -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT - BOOL shouldFetchGoogleUserEmail_; - BOOL shouldFetchGoogleUserProfile_; - NSDictionary *userProfile_; -#endif - - SCNetworkReachabilityRef reachabilityRef_; - NSTimer *networkLossTimer_; - NSTimeInterval networkLossTimeoutInterval_; - BOOL hasNotifiedNetworkLoss_; - - id userData_; -} - -@property (nonatomic, retain) GTMOAuth2Authentication *authentication; - -@property (nonatomic, retain) NSURL *authorizationURL; -@property (nonatomic, retain) NSDictionary *additionalAuthorizationParameters; - -// The delegate is released when signing in finishes or is cancelled -@property (nonatomic, retain) id delegate; -@property (nonatomic, assign) SEL webRequestSelector; -@property (nonatomic, assign) SEL finishedSelector; - -@property (nonatomic, retain) id userData; - -// By default, signing in to Google will fetch the user's email, but will not -// fetch the user's profile. -// -// The email is saved in the auth object. -// The profile is available immediately after sign-in. -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -@property (nonatomic, assign) BOOL shouldFetchGoogleUserEmail; -@property (nonatomic, assign) BOOL shouldFetchGoogleUserProfile; -@property (nonatomic, retain, readonly) NSDictionary *userProfile; -#endif - -// The default timeout for an unreachable network during display of the -// sign-in page is 30 seconds; set this to 0 to have no timeout -@property (nonatomic, assign) NSTimeInterval networkLossTimeoutInterval; - -// The delegate is retained until sign-in has completed or been canceled -// -// designated initializer -- (id)initWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - delegate:(id)delegate - webRequestSelector:(SEL)webRequestSelector - finishedSelector:(SEL)finishedSelector; - -// A default authentication object for signing in to Google services -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (GTMOAuth2Authentication *)standardGoogleAuthenticationForScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret; -#endif - -#pragma mark Methods used by the Window Controller - -// Start the sequence of fetches and sign-in window display for sign-in -- (BOOL)startSigningIn; - -// Stop any pending fetches, and close the window (but don't call the -// delegate's finishedSelector) -- (void)cancelSigningIn; - -// Window controllers must tell the sign-in object about any redirect -// requested by the web view, and any changes in the webview window title -// -// If these return YES then the event was handled by the -// sign-in object (typically by closing the window) and should be ignored by -// the window controller's web view - -- (BOOL)requestRedirectedToRequest:(NSURLRequest *)redirectedRequest; -- (BOOL)titleChanged:(NSString *)title; -- (BOOL)cookiesChanged:(NSHTTPCookieStorage *)cookieStorage; -- (BOOL)loadFailedWithError:(NSError *)error; - -// Window controllers must tell the sign-in object if the window was closed -// prematurely by the user (but not by the sign-in object); this calls the -// delegate's finishedSelector -- (void)windowWasClosed; - -// Start the sequences for signing in with an authorization code. The -// authentication must contain an authorization code, otherwise the process -// will fail. -- (void)authCodeObtained; - -#pragma mark - - -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -// Revocation of an authorized token from Google -+ (void)revokeTokenForGoogleAuthentication:(GTMOAuth2Authentication *)auth; - -// Create a fetcher for obtaining the user's Google email address or profile, -// according to the current auth scopes. -// -// The auth object must have been created with appropriate scopes. -// -// The fetcher's response data can be parsed with NSJSONSerialization. -+ (GTMHTTPFetcher *)userInfoFetcherWithAuth:(GTMOAuth2Authentication *)auth; -#endif - -#pragma mark - - -// Standard authentication values -+ (NSString *)nativeClientRedirectURI; -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (NSURL *)googleAuthorizationURL; -+ (NSURL *)googleTokenURL; -+ (NSURL *)googleUserInfoURL; -#endif - -@end - -#endif // #if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMOAuth2ViewControllerTouch.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMOAuth2ViewControllerTouch.h deleted file mode 100644 index 23bb07a9..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMOAuth2ViewControllerTouch.h +++ /dev/null @@ -1,366 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTMOAuth2ViewControllerTouch.h -// -// This view controller for iPhone handles sign-in via OAuth to Google or -// other services. -// -// This controller is not reusable; create a new instance of this controller -// every time the user will sign in. -// - -#if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES - -#import - -#if TARGET_OS_IPHONE - -#import - -#import "GTMOAuth2Authentication.h" - -#undef _EXTERN -#undef _INITIALIZE_AS -#ifdef GTMOAUTH2VIEWCONTROLLERTOUCH_DEFINE_GLOBALS -#define _EXTERN -#define _INITIALIZE_AS(x) =x -#else -#define _EXTERN extern -#define _INITIALIZE_AS(x) -#endif - -_EXTERN NSString* const kGTMOAuth2KeychainErrorDomain _INITIALIZE_AS(@"com.google.GTMOAuthKeychain"); - -@class GTMOAuth2SignIn; -@class GTMOAuth2ViewControllerTouch; - -typedef void (^GTMOAuth2ViewControllerCompletionHandler)(GTMOAuth2ViewControllerTouch *viewController, GTMOAuth2Authentication *auth, NSError *error); - -@interface GTMOAuth2ViewControllerTouch : UIViewController { - @private - UIButton *backButton_; - UIButton *forwardButton_; - UIActivityIndicatorView *initialActivityIndicator_; - UIView *navButtonsView_; - UIBarButtonItem *rightBarButtonItem_; - UIWebView *webView_; - - // The object responsible for the sign-in networking sequence; it holds - // onto the authentication object as well. - GTMOAuth2SignIn *signIn_; - - // the page request to load when awakeFromNib occurs - NSURLRequest *request_; - - // The user we're calling back - // - // The delegate is retained only until the callback is invoked - // or the sign-in is canceled - id delegate_; - SEL finishedSelector_; - -#if NS_BLOCKS_AVAILABLE - GTMOAuth2ViewControllerCompletionHandler completionBlock_; - - void (^popViewBlock_)(void); -#endif - - NSString *keychainItemName_; - CFTypeRef keychainItemAccessibility_; - - // if non-nil, the html string to be displayed immediately upon opening - // of the web view - NSString *initialHTMLString_; - - // set to 1 or -1 if the user sets the showsInitialActivityIndicator - // property - int mustShowActivityIndicator_; - - // if non-nil, the URL for which cookies will be deleted when the - // browser view is dismissed - NSURL *browserCookiesURL_; - - id userData_; - NSMutableDictionary *properties_; - -#if __IPHONE_OS_VERSION_MIN_REQUIRED < 60000 - // We delegate the decision to our owning NavigationController (if any). - // But, the NavigationController will call us back, and ask us. - // BOOL keeps us from infinite looping. - BOOL isInsideShouldAutorotateToInterfaceOrientation_; -#endif - - // YES, when view first shown in this signIn session. - BOOL isViewShown_; - - // YES, after the view has fully transitioned in. - BOOL didViewAppear_; - - // YES between sends of start and stop notifications - BOOL hasNotifiedWebViewStartedLoading_; - - // To prevent us from calling our delegate's selector more than once. - BOOL hasCalledFinished_; - - // Set in a webView callback. - BOOL hasDoneFinalRedirect_; - - // Set during the pop initiated by the sign-in object; otherwise, - // viewWillDisappear indicates that some external change of the view - // has stopped the sign-in. - BOOL didDismissSelf_; -} - -// the application and service name to use for saving the auth tokens -// to the keychain -@property (nonatomic, copy) NSString *keychainItemName; - -// the keychain item accessibility is a system constant for use -// with kSecAttrAccessible. -// -// Since it's a system constant, we do not need to retain it. -@property (nonatomic, assign) CFTypeRef keychainItemAccessibility; - -// optional html string displayed immediately upon opening the web view -// -// This string is visible just until the sign-in web page loads, and -// may be used for a "Loading..." type of message or to set the -// initial view color -@property (nonatomic, copy) NSString *initialHTMLString; - -// an activity indicator shows during initial webview load when no initial HTML -// string is specified, but the activity indicator can be forced to be shown -// with this property -@property (nonatomic, assign) BOOL showsInitialActivityIndicator; - -// the underlying object to hold authentication tokens and authorize http -// requests -@property (nonatomic, retain, readonly) GTMOAuth2Authentication *authentication; - -// the underlying object which performs the sign-in networking sequence -@property (nonatomic, retain, readonly) GTMOAuth2SignIn *signIn; - -// user interface elements -@property (nonatomic, retain) IBOutlet UIButton *backButton; -@property (nonatomic, retain) IBOutlet UIButton *forwardButton; -@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *initialActivityIndicator; -@property (nonatomic, retain) IBOutlet UIView *navButtonsView; -@property (nonatomic, retain) IBOutlet UIBarButtonItem *rightBarButtonItem; -@property (nonatomic, retain) IBOutlet UIWebView *webView; - -#if NS_BLOCKS_AVAILABLE -// An optional block to be called when the view should be popped. If not set, -// the view controller will use its navigation controller to pop the view. -@property (nonatomic, copy) void (^popViewBlock)(void); -#endif - -// the default timeout for an unreachable network during display of the -// sign-in page is 30 seconds; set this to 0 to have no timeout -@property (nonatomic, assign) NSTimeInterval networkLossTimeoutInterval; - -// if set, cookies are deleted for this URL when the view is hidden -// -// For Google sign-ins, this is set by default to https://google.com/accounts -// but it may be explicitly set to nil to disable clearing of browser cookies -@property (nonatomic, retain) NSURL *browserCookiesURL; - -// userData is retained for the convenience of the caller -@property (nonatomic, retain) id userData; - -// Stored property values are retained for the convenience of the caller -- (void)setProperty:(id)obj forKey:(NSString *)key; -- (id)propertyForKey:(NSString *)key; - -@property (nonatomic, retain) NSDictionary *properties; - -// Method for creating a controller to authenticate to Google services -// -// scope is the requested scope of authorization -// (like "http://www.google.com/m8/feeds") -// -// keychain item name is used for storing the token on the keychain, -// keychainItemName should be like "My Application: Google Latitude" -// (or set to nil if no persistent keychain storage is desired) -// -// the delegate is retained only until the finished selector is invoked -// or the sign-in is canceled -// -// If you don't like the default nibName and bundle, you can change them -// using the UIViewController properties once you've made one of these. -// -// finishedSelector is called after authentication completes. It should follow -// this signature. -// -// - (void)viewController:(GTMOAuth2ViewControllerTouch *)viewController -// finishedWithAuth:(GTMOAuth2Authentication *)auth -// error:(NSError *)error; -// -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (id)controllerWithScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret - keychainItemName:(NSString *)keychainItemName - delegate:(id)delegate - finishedSelector:(SEL)finishedSelector; - -- (id)initWithScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret - keychainItemName:(NSString *)keychainItemName - delegate:(id)delegate - finishedSelector:(SEL)finishedSelector; - -#if NS_BLOCKS_AVAILABLE -+ (id)controllerWithScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret - keychainItemName:(NSString *)keychainItemName - completionHandler:(GTMOAuth2ViewControllerCompletionHandler)handler; - -- (id)initWithScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret - keychainItemName:(NSString *)keychainItemName - completionHandler:(GTMOAuth2ViewControllerCompletionHandler)handler; -#endif -#endif - -// Create a controller for authenticating to non-Google services, taking -// explicit endpoint URLs and an authentication object -+ (id)controllerWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - keychainItemName:(NSString *)keychainItemName // may be nil - delegate:(id)delegate - finishedSelector:(SEL)finishedSelector; - -// This is the designated initializer -- (id)initWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - keychainItemName:(NSString *)keychainItemName - delegate:(id)delegate - finishedSelector:(SEL)finishedSelector; - -#if NS_BLOCKS_AVAILABLE -+ (id)controllerWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - keychainItemName:(NSString *)keychainItemName // may be nil - completionHandler:(GTMOAuth2ViewControllerCompletionHandler)handler; - -- (id)initWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - keychainItemName:(NSString *)keychainItemName - completionHandler:(GTMOAuth2ViewControllerCompletionHandler)handler; -#endif - -// subclasses may override authNibName to specify a custom name -+ (NSString *)authNibName; - -// subclasses may override authNibBundle to specify a custom bundle -+ (NSBundle *)authNibBundle; - -// subclasses may override setUpNavigation to provide their own navigation -// controls -- (void)setUpNavigation; - -// apps may replace the sign-in class with their own subclass of it -+ (Class)signInClass; -+ (void)setSignInClass:(Class)theClass; - -- (void)cancelSigningIn; - -// revocation of an authorized token from Google -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (void)revokeTokenForGoogleAuthentication:(GTMOAuth2Authentication *)auth; -#endif - -// -// Keychain -// - -// create an authentication object for Google services from the access -// token and secret stored in the keychain; if no token is available, return -// an unauthorized auth object -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (GTMOAuth2Authentication *)authForGoogleFromKeychainForName:(NSString *)keychainItemName - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret; -#endif - -// add tokens from the keychain, if available, to the authentication object -// -// returns YES if the authentication object was authorized from the keychain -+ (BOOL)authorizeFromKeychainForName:(NSString *)keychainItemName - authentication:(GTMOAuth2Authentication *)auth; - -// method for deleting the stored access token and secret, useful for "signing -// out" -+ (BOOL)removeAuthFromKeychainForName:(NSString *)keychainItemName; - -// method for saving the stored access token and secret -+ (BOOL)saveParamsToKeychainForName:(NSString *)keychainItemName - accessibility:(CFTypeRef)accessibility - authentication:(GTMOAuth2Authentication *)auth; - -// older version, defaults to kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly -+ (BOOL)saveParamsToKeychainForName:(NSString *)keychainItemName - authentication:(GTMOAuth2Authentication *)auth; - -@end - -// To function, GTMOAuth2ViewControllerTouch needs a certain amount of access -// to the iPhone's keychain. To keep things simple, its keychain access is -// broken out into a helper class. We declare it here in case you'd like to use -// it too, to store passwords. - -enum { - kGTMOAuth2KeychainErrorBadArguments = -1301, - kGTMOAuth2KeychainErrorNoPassword = -1302 -}; - - -@interface GTMOAuth2Keychain : NSObject - -+ (GTMOAuth2Keychain *)defaultKeychain; - -// OK to pass nil for the error parameter. -- (NSString *)passwordForService:(NSString *)service - account:(NSString *)account - error:(NSError **)error; - -// OK to pass nil for the error parameter. -- (BOOL)removePasswordForService:(NSString *)service - account:(NSString *)account - error:(NSError **)error; - -// OK to pass nil for the error parameter. -// -// accessibility should be one of the constants for kSecAttrAccessible -// such as kSecAttrAccessibleWhenUnlocked -- (BOOL)setPassword:(NSString *)password - forService:(NSString *)service - accessibility:(CFTypeRef)accessibility - account:(NSString *)account - error:(NSError **)error; - -// For unit tests: allow setting a mock object -+ (void)setDefaultKeychain:(GTMOAuth2Keychain *)keychain; - -@end - -#endif // TARGET_OS_IPHONE - -#endif // #if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMObjC2Runtime.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMObjC2Runtime.h deleted file mode 100644 index e4e2ac72..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GTMObjC2Runtime.h +++ /dev/null @@ -1,113 +0,0 @@ -// -// GTMObjC2Runtime.h -// -// Copyright 2007-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -#import -#import -#import "GTMDefines.h" - -// These functions exist for code that we want to compile on both the < 10.5 -// sdks and on the >= 10.5 sdks without warnings. It basically reimplements -// certain parts of the objc2 runtime in terms of the objc1 runtime. It is not -// a complete implementation as I've only implemented the routines I know we -// use. Feel free to add more as necessary. -// These functions are not documented because they conform to the documentation -// for the ObjC2 Runtime. - -#if OBJC_API_VERSION >= 2 // Only have optional and req'd keywords in ObjC2. -#define AT_OPTIONAL @optional -#define AT_REQUIRED @required -#else -#define AT_OPTIONAL -#define AT_REQUIRED -#endif - -// The file objc-runtime.h was moved to runtime.h and in Leopard, objc-runtime.h -// was just a wrapper around runtime.h. For the iPhone SDK, this objc-runtime.h -// is removed in the iPhoneOS2.0 SDK. -// -// The |Object| class was removed in the iPhone2.0 SDK too. -#if GTM_IPHONE_SDK -#import -#import -#else -#import -#import -#endif - -#import - -#if GTM_MACOS_SDK && (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) -#import "objc/Protocol.h" - -OBJC_EXPORT Class object_getClass(id obj); -OBJC_EXPORT const char *class_getName(Class cls); -OBJC_EXPORT BOOL class_conformsToProtocol(Class cls, Protocol *protocol); -OBJC_EXPORT BOOL class_respondsToSelector(Class cls, SEL sel); -OBJC_EXPORT Class class_getSuperclass(Class cls); -OBJC_EXPORT Method *class_copyMethodList(Class cls, unsigned int *outCount); -OBJC_EXPORT SEL method_getName(Method m); -OBJC_EXPORT void method_exchangeImplementations(Method m1, Method m2); -OBJC_EXPORT IMP method_getImplementation(Method method); -OBJC_EXPORT IMP method_setImplementation(Method method, IMP imp); -OBJC_EXPORT struct objc_method_description protocol_getMethodDescription(Protocol *p, - SEL aSel, - BOOL isRequiredMethod, - BOOL isInstanceMethod); -OBJC_EXPORT BOOL sel_isEqual(SEL lhs, SEL rhs); - -// If building for 10.4 but using the 10.5 SDK, don't include these. -#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 -// atomics -// On Leopard these are GC aware -// Intentionally did not include the non-barrier versions, because I couldn't -// come up with a case personally where you wouldn't want to use the -// barrier versions. -GTM_INLINE bool OSAtomicCompareAndSwapPtrBarrier(void *predicate, - void *replacement, - void * volatile *theValue) { -#if defined(__LP64__) && __LP64__ - return OSAtomicCompareAndSwap64Barrier((int64_t)predicate, - (int64_t)replacement, - (int64_t *)theValue); -#else // defined(__LP64__) && __LP64__ - return OSAtomicCompareAndSwap32Barrier((int32_t)predicate, - (int32_t)replacement, - (int32_t *)theValue); -#endif // defined(__LP64__) && __LP64__ -} - -#endif // MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 -#endif // GTM_MACOS_SDK && (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) - -#if GTM_MACOS_SDK && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5) - -GTM_INLINE BOOL objc_atomicCompareAndSwapGlobalBarrier(id predicate, - id replacement, - volatile id *objectLocation) { - return OSAtomicCompareAndSwapPtrBarrier(predicate, - replacement, - (void * volatile *)objectLocation); -} -GTM_INLINE BOOL objc_atomicCompareAndSwapInstanceVariableBarrier(id predicate, - id replacement, - volatile id *objectLocation) { - return OSAtomicCompareAndSwapPtrBarrier(predicate, - replacement, - (void * volatile *)objectLocation); -} -#endif // GTM_MACOS_SDK && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5) diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GoogleOpenSource.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GoogleOpenSource.h deleted file mode 100644 index 8703285c..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/GoogleOpenSource.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// GoogleOpenSource.h -// Google+ iOS SDK -// -// Copyright 2013 Google Inc. -// -// Use of this SDK is subject to the Google+ Platform Terms of Service: -// https://developers.google.com/+/terms -// - - -// GTM. -#import "GTMDefines.h" -#import "GTMHTTPFetcher.h" -#import "GTMHTTPFetcherService.h" -#import "GTMHTTPFetchHistory.h" -#import "GTMLogger.h" -#import "GTMMethodCheck.h" -#import "GTMNSDictionary+URLArguments.h" -#import "GTMNSString+URLArguments.h" -#import "GTMOAuth2Authentication.h" -#import "GTMOAuth2SignIn.h" -#import "GTMOAuth2ViewControllerTouch.h" -#import "GTMObjC2Runtime.h" - -// Chrome. -#import "OpenInChromeController.h" - -// GTL. -#import "GTLDefines.h" -#import "GTLBatchQuery.h" -#import "GTLBatchResult.h" -#import "GTLDateTime.h" -#import "GTLErrorObject.h" -#import "GTLObject.h" -#import "GTLQuery.h" -#import "GTLRuntimeCommon.h" -#import "GTLService.h" -#import "GTLFramework.h" -#import "GTLJSONParser.h" -#import "GTLUtilities.h" - -// GTLPlus. -#import "GTLPlus.h" diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/OpenInChromeController.h b/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/OpenInChromeController.h deleted file mode 100644 index 35363a71..00000000 --- a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/A/Headers/OpenInChromeController.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2012, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#import - -// This class is used to check if Google Chrome is installed in the system and -// to open a URL in Google Chrome either with or without a callback URL. -@interface OpenInChromeController : NSObject - -// Returns a shared instance of the OpenInChromeController. -+ (OpenInChromeController *)sharedInstance; - -// Returns YES if Google Chrome is installed in the user's system. -- (BOOL)isChromeInstalled; - -// Opens a URL in Google Chrome. -- (BOOL)openInChrome:(NSURL *)url; - -// Open a URL in Google Chrome providing a |callbackURL| to return to the app. -// URLs from the same app will be opened in the same tab unless |createNewTab| -// is set to YES. -// |callbackURL| can be nil. -// The return value of this method is YES if the URL is successfully opened. -- (BOOL)openInChrome:(NSURL *)url - withCallbackURL:(NSURL *)callbackURL - createNewTab:(BOOL)createNewTab; - -@end diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/GooglePlus b/External/google-plus-ios-sdk/GooglePlus.bundle/GooglePlus deleted file mode 100644 index 776285bb..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/GooglePlus and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/Info.plist b/External/google-plus-ios-sdk/GooglePlus.bundle/Info.plist deleted file mode 100644 index 61747833..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/Info.plist and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/af.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/af.lproj/GooglePlusPlatform.strings deleted file mode 100644 index ca57e46c..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/af.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/am.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/am.lproj/GooglePlusPlatform.strings deleted file mode 100644 index b8514153..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/am.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/ar.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/ar.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 2209904f..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/ar.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/be.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/be.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 34913f1f..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/be.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/bg.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/bg.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 924d78fe..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/bg.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/ca.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/ca.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 3f1cc806..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/ca.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/cs.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/cs.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 96bcf622..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/cs.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/da.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/da.lproj/GooglePlusPlatform.strings deleted file mode 100644 index ee2b6cc0..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/da.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/de.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/de.lproj/GooglePlusPlatform.strings deleted file mode 100644 index cf334d8f..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/de.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/de_AT.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/de_AT.lproj/GooglePlusPlatform.strings deleted file mode 100644 index cf334d8f..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/de_AT.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/de_CH.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/de_CH.lproj/GooglePlusPlatform.strings deleted file mode 100644 index cf334d8f..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/de_CH.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/el.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/el.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 37a9ae0d..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/el.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/en.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/en.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 8cde83d6..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/en.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/en_GB.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/en_GB.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 8cde83d6..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/en_GB.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/en_IE.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/en_IE.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 8cde83d6..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/en_IE.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/en_IN.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/en_IN.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 8cde83d6..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/en_IN.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/en_SG.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/en_SG.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 8cde83d6..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/en_SG.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/en_ZA.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/en_ZA.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 8cde83d6..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/en_ZA.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es.lproj/GooglePlusPlatform.strings deleted file mode 100644 index ce133e7c..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_419.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_419.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_419.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_AR.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_AR.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_AR.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_BO.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_BO.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_BO.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_CL.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_CL.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_CL.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_CO.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_CO.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_CO.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_CR.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_CR.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_CR.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_DO.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_DO.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_DO.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_EC.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_EC.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_EC.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_GT.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_GT.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_GT.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_HN.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_HN.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_HN.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_MX.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_MX.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_MX.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_NI.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_NI.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_NI.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_PA.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_PA.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_PA.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_PE.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_PE.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_PE.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_PR.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_PR.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_PR.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_PY.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_PY.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_PY.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_SV.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_SV.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_SV.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_US.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_US.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_US.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_UY.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_UY.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_UY.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/es_VE.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/es_VE.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c67ec5e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/es_VE.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/et.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/et.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 40cf9ac1..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/et.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/fa.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/fa.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 94e2395c..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/fa.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/fi.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/fi.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 84ffb1ca..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/fi.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/fil.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/fil.lproj/GooglePlusPlatform.strings deleted file mode 100644 index a73f999d..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/fil.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/fr.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/fr.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 66cc6838..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/fr.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/fr_CH.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/fr_CH.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 66cc6838..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/fr_CH.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_disabled.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_disabled.png deleted file mode 100644 index bd168a3a..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_disabled.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_disabled@2x.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_disabled@2x.png deleted file mode 100644 index 21ae728e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_disabled@2x.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_normal.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_normal.png deleted file mode 100644 index a4a3c12e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_normal.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_normal@2x.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_normal@2x.png deleted file mode 100644 index 80fc9439..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_normal@2x.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_pressed.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_pressed.png deleted file mode 100644 index 3d84015d..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_pressed.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_pressed@2x.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_pressed@2x.png deleted file mode 100644 index e377195a..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_button_pressed@2x.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_disabled.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_disabled.png deleted file mode 100644 index 99986b55..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_disabled.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_disabled@2x.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_disabled@2x.png deleted file mode 100644 index 6134e917..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_disabled@2x.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_normal.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_normal.png deleted file mode 100644 index 71d85845..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_normal.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_normal@2x.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_normal@2x.png deleted file mode 100644 index bd1cc2e2..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_normal@2x.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_pressed.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_pressed.png deleted file mode 100644 index c4fa2147..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_pressed.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_pressed@2x.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_pressed@2x.png deleted file mode 100644 index 67f61b8a..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_dark_icon_pressed@2x.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_disabled.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_disabled.png deleted file mode 100644 index e5d00526..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_disabled.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_disabled@2x.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_disabled@2x.png deleted file mode 100644 index caa82993..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_disabled@2x.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_normal.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_normal.png deleted file mode 100644 index f95240a7..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_normal.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_normal@2x.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_normal@2x.png deleted file mode 100644 index 18aed084..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_normal@2x.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_pressed.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_pressed.png deleted file mode 100644 index 601f6346..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_pressed.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_pressed@2x.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_pressed@2x.png deleted file mode 100644 index 4a7ac50a..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_button_pressed@2x.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_disabled.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_disabled.png deleted file mode 100644 index 7bbc129a..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_disabled.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_disabled@2x.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_disabled@2x.png deleted file mode 100644 index fc6e0451..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_disabled@2x.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_normal.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_normal.png deleted file mode 100644 index a69703c8..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_normal.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_normal@2x.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_normal@2x.png deleted file mode 100644 index 61e1dbb3..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_normal@2x.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_pressed.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_pressed.png deleted file mode 100644 index 962bd989..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_pressed.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_pressed@2x.png b/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_pressed@2x.png deleted file mode 100644 index c780c912..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gpp_sign_in_light_icon_pressed@2x.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/gsw.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/gsw.lproj/GooglePlusPlatform.strings deleted file mode 100644 index cf334d8f..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/gsw.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/he.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/he.lproj/GooglePlusPlatform.strings deleted file mode 100644 index f603fa7d..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/he.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/hi.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/hi.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 023031f2..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/hi.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/hr.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/hr.lproj/GooglePlusPlatform.strings deleted file mode 100644 index eab7e25b..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/hr.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/hu.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/hu.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 5a03ce74..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/hu.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/id.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/id.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 18c0e9a1..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/id.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/in.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/in.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 18c0e9a1..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/in.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/it.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/it.lproj/GooglePlusPlatform.strings deleted file mode 100644 index bd15d9e6..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/it.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/iw.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/iw.lproj/GooglePlusPlatform.strings deleted file mode 100644 index f603fa7d..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/iw.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/ja.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/ja.lproj/GooglePlusPlatform.strings deleted file mode 100644 index c5deef23..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/ja.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/ko.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/ko.lproj/GooglePlusPlatform.strings deleted file mode 100644 index a946ea2e..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/ko.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/ln.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/ln.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 66cc6838..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/ln.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/lt.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/lt.lproj/GooglePlusPlatform.strings deleted file mode 100644 index c0b37507..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/lt.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/lv.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/lv.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 91f1515c..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/lv.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/mo.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/mo.lproj/GooglePlusPlatform.strings deleted file mode 100644 index a76a9b4b..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/mo.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/ms.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/ms.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 2f806396..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/ms.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/nb.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/nb.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 4318afbb..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/nb.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/nl.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/nl.lproj/GooglePlusPlatform.strings deleted file mode 100644 index de8aeeab..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/nl.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/no.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/no.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 4318afbb..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/no.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/pl.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/pl.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 63867b39..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/pl.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/pt.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/pt.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 21485026..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/pt.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/pt_BR.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/pt_BR.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 21485026..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/pt_BR.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/pt_PT.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/pt_PT.lproj/GooglePlusPlatform.strings deleted file mode 100644 index f0f5ee92..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/pt_PT.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/ro.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/ro.lproj/GooglePlusPlatform.strings deleted file mode 100644 index a76a9b4b..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/ro.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/ru.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/ru.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 59665952..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/ru.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/sk.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/sk.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 0cfe6156..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/sk.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/sl.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/sl.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 86b01769..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/sl.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/sr.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/sr.lproj/GooglePlusPlatform.strings deleted file mode 100644 index e0777f18..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/sr.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/sv.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/sv.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 35a393c7..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/sv.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/sw.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/sw.lproj/GooglePlusPlatform.strings deleted file mode 100644 index c5de69fd..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/sw.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/th.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/th.lproj/GooglePlusPlatform.strings deleted file mode 100644 index a0cd034a..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/th.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/tl.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/tl.lproj/GooglePlusPlatform.strings deleted file mode 100644 index a73f999d..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/tl.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/tr.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/tr.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 7c86ee3b..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/tr.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/uk.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/uk.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 58d32113..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/uk.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/vi.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/vi.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 6d0e7f56..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/vi.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/zh.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/zh.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 389ae378..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/zh.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/zh_CN.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/zh_CN.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 389ae378..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/zh_CN.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/zh_HK.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/zh_HK.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 3e974a37..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/zh_HK.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/zh_TW.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/zh_TW.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 2fe0d276..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/zh_TW.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.bundle/zu.lproj/GooglePlusPlatform.strings b/External/google-plus-ios-sdk/GooglePlus.bundle/zu.lproj/GooglePlusPlatform.strings deleted file mode 100644 index 9f7d9d32..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.bundle/zu.lproj/GooglePlusPlatform.strings and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.framework/GooglePlus b/External/google-plus-ios-sdk/GooglePlus.framework/GooglePlus deleted file mode 120000 index aa81e702..00000000 --- a/External/google-plus-ios-sdk/GooglePlus.framework/GooglePlus +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/GooglePlus \ No newline at end of file diff --git a/External/google-plus-ios-sdk/GooglePlus.framework/Headers b/External/google-plus-ios-sdk/GooglePlus.framework/Headers deleted file mode 120000 index a177d2a6..00000000 --- a/External/google-plus-ios-sdk/GooglePlus.framework/Headers +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Headers \ No newline at end of file diff --git a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/GooglePlus b/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/GooglePlus deleted file mode 100644 index d46ff489..00000000 Binary files a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/GooglePlus and /dev/null differ diff --git a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPDeepLink.h b/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPDeepLink.h deleted file mode 100644 index 991a9506..00000000 --- a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPDeepLink.h +++ /dev/null @@ -1,59 +0,0 @@ -// -// GPPDeepLink.h -// Google+ iOS SDK -// -// Copyright 2012 Google Inc. -// -// Use of this SDK is subject to the Google+ Platform Terms of Service: -// https://developers.google.com/+/terms -// - -#import - -@class GPPDeepLink; - -// A protocol optionally implemented by the client of |GPPDeepLink|. -@protocol GPPDeepLinkDelegate - -// Notifies the client that a deep link has been received either from -// |readDeepLinkAfterInstall| or |handleURL:sourceApplication:annotation:|. -- (void)didReceiveDeepLink:(GPPDeepLink *)deepLink; - -@end - -// This class handles a deep link within a share posted on Google+. -// For more information on deep links, see -// http://developers.google.com/+/mobile/ios/share . -@interface GPPDeepLink : NSObject - -// Sets the delegate to handle the deep link. -+ (void)setDelegate:(id)delegate; - -// Returns a |GPPDeepLink| for your app to handle, or |nil| if not found. The -// deep-link ID can be obtained from |GPPDeepLink|. It is stored when a user -// clicks a link to your app from a Google+ post, but hasn't yet installed your -// app. The user will be redirected to the App Store to install your app. This -// method should be called on or near your app launch to take the user to -// deep-link ID within your app. The delegate will be called if set and if a -// deep link is found. -+ (GPPDeepLink *)readDeepLinkAfterInstall; - -// This method should be called from your |UIApplicationDelegate|'s -// |application:openURL:sourceApplication:annotation|. Returns -// |GooglePlusDeepLink| if |GooglePlusDeepLink| handled this URL, |nil| -// otherwise. The delegate will be called if set and if a deep link is found. -// Also see |handleURL:sourceApplication:annotation:| in |GPPURLHandler|. -+ (GPPDeepLink *)handleURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication - annotation:(id)annotation; - -// The deep-link ID in |GPPDeepLink| that was passed to the app. -- (NSString *)deepLinkID; - -// This instance method indicates where the user came from before arriving in -// your app. This method is provided for you to collect engagement metrics. -// For the possible values, see -// http://developers.google.com/+/mobile/ios/source-values . -- (NSString *)source; - -@end diff --git a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPShare.h b/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPShare.h deleted file mode 100644 index 1857dc79..00000000 --- a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPShare.h +++ /dev/null @@ -1,152 +0,0 @@ -// -// GPPShare.h -// Google+ iOS SDK -// -// Copyright 2012 Google Inc. -// -// Use of this SDK is subject to the Google+ Platform Terms of Service: -// https://developers.google.com/+/terms -// - -// To allow a user to share with Google+, please follow these steps: -// -// 0. Create a project on Google API console, -// https://code.google.com/apis/console . Under "API Access", create a -// client ID as "Installed application" with the type "iOS", and -// register the bundle ID of your app. -// -// 1. Initialize the |GPPSignIn| instance with your registered client ID, -// and get the |GPPShare| instance. -// -// [[GPPSignIn shareInstance] setClientID:myClientID]; -// GPPShare *gppShare = [GPPShare sharedInstance]; -// -// 2. In the code where the share dialog will be opened, -// -// [[gppShare shareDialog] open]; -// -// you can optionally call any of the |GPPShareBuilder| methods before -// calling |open|, for example, if there is a particular URL resource to be -// shared, or if you want to set text to prefill user comment in the share -// dialog, such as: -// -// NSURL *urlToShare = [NSURL URLWithString:@"http://www.google.com/"]; -// NSString *prefillText = @"You probably already know this site..."; -// [[[[gppShare shareDialog] setURLToShare:urlToShare] -// setPrefillText:prefillText] open]; -// -// 3. In the '-info.plist' settings for your app, add a URL type to be -// handled by your app. Make the URL scheme the same as your app bundle ID. -// -// 4. In your application delegate, implement: -// - (BOOL)application:(NSString*)application -// openURL:(NSURL *)url -// sourceApplication:(NSString*)sourceApplication -// annotation:(id)annotation { -// if ([gppShare handleURL:url -// sourceApplication:sourceApplication -// annotation:annotation]) { -// return YES; -// } -// // Other handling code here... -// } -// -// 5. Optionally, if you want to be notified of the result of the share action, -// have a delegate class implement |GPPShareDelegate|, for example: -// -// @interface MyDelegateClass : NSObject; -// -// - (void)finishedSharing:(BOOL)shared { -// // The share action was successful if |shared| is YES. -// } -// -// MyDelegateClass *myDelegate = [[MyDelegateClass alloc] init]; -// gppShare.delegate = myDelegate; - -#import - -@class GPPSignIn; - -// The protocol to receive the result of the share action. -@protocol GPPShareDelegate - -// Reports the status of the share action, |shared| is |YES| if user has -// successfully shared her post, |NO| otherwise, such as if the user canceled -// the post. -- (void)finishedSharing:(BOOL)shared; - -@end - -// The builder protocol to open the share dialog. -// For more information on sharing, see -// http://developers.google.com/+/mobile/ios/share . -@protocol GPPShareBuilder - -// Sets the URL resource to be shared. -- (id)setURLToShare:(NSURL *)urlToShare; - -// Sets the text to prefill user's comment in the share dialog. -- (id)setPrefillText:(NSString *)prefillText; - -// Sets the title, description, and thumbnail URL of the shared content preview -// in the share dialog. Only set these fields if you are sharing with a content -// deep link and don't have a URL resource. |title| is required. -- (id)setTitle:(NSString *)title - description:(NSString *)description - thumbnailURL:(NSURL *)thumbnailURL; - -// Sets the content deep-link ID that takes the user straight to your shared -// content. Only set this field if you want the content deep-linking feature. -// The content deep-link ID can either be a fully qualified URI, or URI path, -// which can be up to 512 characters in length. -- (id)setContentDeepLinkID:(NSString *)contentDeepLinkID; - -// Sets the call-to-action button of the shared content preview. -// The call-to-action button consists of a label, URL, and deep-link ID. -// The |label| is a string key defined under "data-calltoactionlabel" on -// http://developers.google.com/+/web/share/interactive#button_attr_calltoactionlabel -// that maps to the actual button text. -// The |url| is where the user is taken to after tapping on the button. -// The optional |deepLinkID| is the call-to-action deep-link ID that takes the -// user straight to a specific action in your app. It can either be a fully -// qualified URI, or URI path, which can be up to 512 characters in length. -// Note: In order to set the call-to-action button: -// 1. User must have been authenticated with scopes including -// "https://www.googleapis.com/auth/plus.login". -// 2. |setURLToShare:| must also be called. -- (id)setCallToActionButtonWithLabel:(NSString *)label - URL:(NSURL *)url - deepLinkID:(NSString *)deepLinkID; - -// Opens the share dialog. Returns |NO| if there was an error, |YES| otherwise. -- (BOOL)open; - -@end - -// The primary class for the share action on Google+. -// For more information on sharing, see -// http://developers.google.com/+/mobile/ios/share . -@interface GPPShare : NSObject - -// The object to be notified when the share action has finished. -@property (nonatomic, assign) id delegate; - -// Returns a shared |GPPShare| instance. -// |[GPPSignIn sharedInstance].clientID| must be initialized with a client ID -// registered in the Google API console, https://code.google.com/apis/console/ -// with the app's bundle ID. -+ (GPPShare *)sharedInstance; - -// Returns a share dialog builder instance. Call its |open| method to -// create the dialog after setting the parameters as needed. -- (id)shareDialog; - -// This method should be called from your |UIApplicationDelegate|'s -// |application:openURL:sourceApplication:annotation|. Returns |YES| if -// |GPPShare| handled this URL. -// Also see |handleURL:sourceApplication:annotation:| in |GPPURLHandler|. -- (BOOL)handleURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication - annotation:(id)annotation; - -@end diff --git a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPSignIn.h b/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPSignIn.h deleted file mode 100644 index 85446a6e..00000000 --- a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPSignIn.h +++ /dev/null @@ -1,158 +0,0 @@ -// -// GPPSignIn.h -// Google+ iOS SDK -// -// Copyright 2012 Google Inc. -// -// Use of this SDK is subject to the Google+ Platform Terms of Service: -// https://developers.google.com/+/terms -// - -#import - -@class GTLServicePlus; -@class GTMOAuth2Authentication; -@class GTMOAuth2ViewControllerTouch; - -// A protocol implemented by the client of |GPPSignIn| to receive a refresh -// token or an error. -@protocol GPPSignInDelegate - -// The authorization has finished and is successful if |error| is |nil|. -- (void)finishedWithAuth:(GTMOAuth2Authentication *)auth - error:(NSError *)error; - -// Finished disconnecting user from the app. -// The operation was successful if |error| is |nil|. -@optional -- (void)didDisconnectWithError:(NSError *)error; - -@end - -// This class signs the user in with Google. It provides single sign-on -// via the Google+ app (if installed), Chrome for iOS (if installed), or Mobile -// Safari. -// -// For reference, please see "Google+ Sign-In for iOS" at -// https://developers.google.com/+/mobile/ios/sign-in . -// Here is sample code to use |GPPSignIn|: -// 1) Get a reference to the |GPPSignIn| shared instance: -// GPPSignIn *signIn = [GPPSignIn sharedInstance]; -// 2) Set the OAuth 2.0 scopes you want to request: -// [signIn setScopes:[NSArray arrayWithObject: -// @"https://www.googleapis.com/auth/plus.login"]]; -// 2) Call [signIn setDelegate:self]; -// 3) Set up delegate method |finishedWithAuth:error:|. -// 4) Call |handleURL| on the shared instance from |application:openUrl:...| -// in your app delegate. -// 5) Call [signIn authenticate]; -@interface GPPSignIn : NSObject - -// The authentication object for the current user, or |nil| if there is -// currently no logged in user. -@property (nonatomic, readonly) GTMOAuth2Authentication *authentication; - -// The Google user ID. It is only available if |shouldFetchGoogleUserID| is set -// and either |trySilentAuthentication| or |authenticate| has been completed -// successfully. -@property (nonatomic, readonly) NSString *userID; - -// The Google user's email. It is only available if |shouldFetchGoogleUserEmail| -// is set and either |trySilentAuthentication| or |authenticate| has been -// completed successfully. -@property (nonatomic, readonly) NSString *userEmail; - -// The object to be notified when authentication is finished. -@property (nonatomic, assign) id delegate; - -// All properties below are optional parameters. If they need to be set, set -// before calling |authenticate|. - -// The client ID of the app from the Google APIs console. -// Must set for sign-in to work. -@property (nonatomic, copy) NSString *clientID; - -// The API scopes requested by the app in an array of |NSString|s. -// The default value is |@[@"https://www.googleapis.com/auth/plus.login"]|. -@property (nonatomic, copy) NSArray *scopes; - -// Whether or not to attempt Single-Sign-On when signing in. -// If |attemptSSO| is true, the sign-in button tries to authenticate with the -// Google+ application if it is installed. If false, it always uses Google+ via -// Chrome for iOS, if installed, or Mobile Safari for authentication. -// The default value is |YES|. -@property (nonatomic, assign) BOOL attemptSSO; - -// The language for sign-in, in the form of ISO 639-1 language code -// optionally followed by a dash and ISO 3166-1 alpha-2 region code, -// such as |@"it"| or |@"pt-PT"|. -// Only set if different from system default. -@property (nonatomic, copy) NSString *language; - -// Name of the keychain to save the sign-in state. -// Only set if a custom name needs to be used. -@property (nonatomic, copy) NSString *keychainName; - -// An |NSString| array of moment types used by your app. Use values from the -// full list at -// https://developers.google.com/+/api/moment-types . -// such as "http://schemas.google.com/AddActivity". -// This property is required only for writing moments, with -// "https://www.googleapis.com/auth/plus.login" as a scope. -@property (nonatomic, copy) NSArray *actions; - -// Whether or not to fetch user email after signing in. The email is saved in -// the |GTMOAuth2Authentication| object. Note that using this flag automatically -// adds "https://www.googleapis.com/auth/userinfo.email" scope to the request. -@property (nonatomic, assign) BOOL shouldFetchGoogleUserEmail; - -// Whether or not to fetch user ID after signing in. The ID can be retrieved -// by |googleUserID| after user has been authenticated. -// Note, a scope, such as "https://www.googleapis.com/auth/plus.login" or -// "https://www.googleapis.com/auth/plus.me", that provides user ID must be -// included in |scopes| for this flag to work. -@property (nonatomic, assign) BOOL shouldFetchGoogleUserID; - -// Returns a shared |GPPSignIn| instance. -+ (GPPSignIn *)sharedInstance; - -// Checks whether the user has either currently signed in or has previous -// authentication saved in keychain. -- (BOOL)hasAuthInKeychain; - -// Attempts to authenticate silently without user interaction. -// Returns |YES| and calls the delegate if the user has either currently signed -// in or has previous authentication saved in keychain. -// Note that if the previous authentication was revoked by the user, this method -// still returns |YES| but |finishedWithAuth:error:| callback will indicate -// that authentication has failed. -- (BOOL)trySilentAuthentication; - -// Starts the authentication process. Set |attemptSSO| to try single sign-on. -// If |attemptSSO| is true, try to authenticate with the Google+ app, if -// installed. If false, always use Google+ via Chrome or Mobile Safari for -// authentication. The delegate will be called at the end of this process. -- (void)authenticate; - -// This method should be called from your |UIApplicationDelegate|'s -// |application:openURL:sourceApplication:annotation|. Returns |YES| if -// |GPPSignIn| handled this URL. -// Also see |handleURL:sourceApplication:annotation:| in |GPPURLHandler|. -- (BOOL)handleURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication - annotation:(id)annotation; - -// Removes the OAuth 2.0 token from the keychain. -- (void)signOut; - -// Disconnects the user from the app and revokes previous authentication. -// If the operation succeeds, the OAuth 2.0 token is also removed from keychain. -// The token is needed to disconnect so do not call |signOut| if |disconnect| is -// to be called. -- (void)disconnect; - -// Gets a service object which can execute "queries", for example, -// to get list of people that is visible to this app. -- (GTLServicePlus *)plusService; - -@end diff --git a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPSignInButton.h b/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPSignInButton.h deleted file mode 100644 index ea263f8d..00000000 --- a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPSignInButton.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// GPPSignInButton.h -// Google+ iOS SDK -// -// Copyright 2012 Google Inc. -// -// Use of this SDK is subject to the Google+ Platform Terms of Service: -// https://developers.google.com/+/terms -// - -#import - -// The various layout styles supported by the GPPSignInButton. -// The minmum size of the button depends on the language used for text. -// The following dimensions (in points) fit for all languages: -// kGPPSignInButtonStyleStandard: 226 x 48 -// kGPPSignInButtonStyleWide: 308 x 48 -// kGPPSignInButtonStyleIconOnly: 46 x 48 (no text, fixed size) -typedef enum { - kGPPSignInButtonStyleStandard = 0, - kGPPSignInButtonStyleWide = 1, - kGPPSignInButtonStyleIconOnly = 2 -} GPPSignInButtonStyle; - -// The various color schemes supported by the GPPSignInButton. -typedef enum { - kGPPSignInButtonColorSchemeDark = 0, - kGPPSignInButtonColorSchemeLight = 1 -} GPPSignInButtonColorScheme; - -// This class provides the Google+ sign-in button. You can instantiate this -// class programmatically or from a NIB file. You should set up the -// |GPPSignIn| shared instance with your client ID and any additional scopes, -// implement the delegate methods for |GPPSignIn|, and add this button to your -// view hierarchy. -@interface GPPSignInButton : UIButton - -// Sets the sign-in button layout style. The default style is standard. -- (void)setStyle:(GPPSignInButtonStyle)style; - -// Sets the sign-in button color scheme. The default scheme is dark. -- (void)setColorScheme:(GPPSignInButtonColorScheme)colorScheme; - -@end diff --git a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPURLHandler.h b/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPURLHandler.h deleted file mode 100644 index 0e45390f..00000000 --- a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GPPURLHandler.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// GPPURLHandler.h -// Google+ iOS SDK -// -// Copyright 2013 Google Inc. -// -// Use of this SDK is subject to the Google+ Platform Terms of Service: -// https://developers.google.com/+/terms -// - -#import - -@interface GPPURLHandler : NSObject - -// Calls |handleURL:sourceApplication:annotation:| for -// |[GPPSignIn sharedInstance]|, |[GPPShare sharedInstance]|, and -// |GPPDeepLink|, and returns |YES| if any of them handles the URL. -// This method can be called from your |UIApplicationDelegate|'s -// |application:openURL:sourceApplication:annotation| instead of calling -// those methods individually. -+ (BOOL)handleURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication - annotation:(id)annotation; - -@end diff --git a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GooglePlus.h b/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GooglePlus.h deleted file mode 100644 index 8134aa82..00000000 --- a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/A/Headers/GooglePlus.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// GooglePlus.h -// Google+ iOS SDK -// -// Copyright 2013 Google Inc. -// -// Use of this SDK is subject to the Google+ Platform Terms of Service: -// https://developers.google.com/+/terms -// - -// G+ SDK. -#import "GPPDeepLink.h" -#import "GPPShare.h" -#import "GPPSignIn.h" -#import "GPPSignInButton.h" -#import "GPPURLHandler.h" diff --git a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/Current b/External/google-plus-ios-sdk/GooglePlus.framework/Versions/Current deleted file mode 120000 index 8c7e5a66..00000000 --- a/External/google-plus-ios-sdk/GooglePlus.framework/Versions/Current +++ /dev/null @@ -1 +0,0 @@ -A \ No newline at end of file diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLBase64.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLBase64.h deleted file mode 100644 index fd0a0518..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLBase64.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -NSData *GTLDecodeBase64(NSString *base64Str); -NSString *GTLEncodeBase64(NSData *data); - -// "Web-safe" encoding substitutes - and _ for + and / in the encoding table, -// per http://www.ietf.org/rfc/rfc4648.txt section 5. - -NSData *GTLDecodeWebSafeBase64(NSString *base64Str); -NSString *GTLEncodeWebSafeBase64(NSData *data); diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLBase64.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLBase64.m deleted file mode 100644 index e6c03627..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLBase64.m +++ /dev/null @@ -1,139 +0,0 @@ -/* Copyright (c) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "GTLBase64.h" - -// Based on Cyrus Najmabadi's elegent little encoder and decoder from -// http://www.cocoadev.com/index.pl?BaseSixtyFour - -static char gStandardEncodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -static char gWebSafeEncodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; - -#pragma mark Encode - -static NSString *EncodeBase64StringCommon(NSData *data, const char *table) { - if (data == nil) return nil; - - const uint8_t* input = [data bytes]; - NSUInteger length = [data length]; - - NSUInteger bufferSize = ((length + 2) / 3) * 4; - NSMutableData* buffer = [NSMutableData dataWithLength:bufferSize]; - - int8_t *output = [buffer mutableBytes]; - - for (NSUInteger i = 0; i < length; i += 3) { - NSUInteger value = 0; - for (NSUInteger j = i; j < (i + 3); j++) { - value <<= 8; - - if (j < length) { - value |= (0xFF & input[j]); - } - } - - NSInteger idx = (i / 3) * 4; - output[idx + 0] = table[(value >> 18) & 0x3F]; - output[idx + 1] = table[(value >> 12) & 0x3F]; - output[idx + 2] = (i + 1) < length ? table[(value >> 6) & 0x3F] : '='; - output[idx + 3] = (i + 2) < length ? table[(value >> 0) & 0x3F] : '='; - } - - NSString *result = [[[NSString alloc] initWithData:buffer - encoding:NSASCIIStringEncoding] autorelease]; - return result; -} - -NSString *GTLEncodeBase64(NSData *data) { - return EncodeBase64StringCommon(data, gStandardEncodingTable); -} - -NSString *GTLEncodeWebSafeBase64(NSData *data) { - return EncodeBase64StringCommon(data, gWebSafeEncodingTable); -} - -#pragma mark Decode - -static void CreateDecodingTable(const char *encodingTable, - size_t encodingTableSize, char *decodingTable) { - memset(decodingTable, 0, 128); - for (unsigned int i = 0; i < encodingTableSize; i++) { - decodingTable[(unsigned int) encodingTable[i]] = (char)i; - } -} - -static NSData *DecodeBase64StringCommon(NSString *base64Str, - char *decodingTable) { - // The input string should be plain ASCII - const char *cString = [base64Str cStringUsingEncoding:NSASCIIStringEncoding]; - if (cString == nil) return nil; - - NSInteger inputLength = (NSInteger)strlen(cString); - if (inputLength % 4 != 0) return nil; - if (inputLength == 0) return [NSData data]; - - while (inputLength > 0 && cString[inputLength - 1] == '=') { - inputLength--; - } - - NSInteger outputLength = inputLength * 3 / 4; - NSMutableData* data = [NSMutableData dataWithLength:(NSUInteger)outputLength]; - uint8_t *output = [data mutableBytes]; - - NSInteger inputPoint = 0; - NSInteger outputPoint = 0; - char *table = decodingTable; - - while (inputPoint < inputLength) { - int i0 = cString[inputPoint++]; - int i1 = cString[inputPoint++]; - int i2 = inputPoint < inputLength ? cString[inputPoint++] : 'A'; // 'A' will decode to \0 - int i3 = inputPoint < inputLength ? cString[inputPoint++] : 'A'; - - output[outputPoint++] = (uint8_t)((table[i0] << 2) | (table[i1] >> 4)); - if (outputPoint < outputLength) { - output[outputPoint++] = (uint8_t)(((table[i1] & 0xF) << 4) | (table[i2] >> 2)); - } - if (outputPoint < outputLength) { - output[outputPoint++] = (uint8_t)(((table[i2] & 0x3) << 6) | table[i3]); - } - } - - return data; -} - -NSData *GTLDecodeBase64(NSString *base64Str) { - static char decodingTable[128]; - static BOOL hasInited = NO; - - if (!hasInited) { - CreateDecodingTable(gStandardEncodingTable, sizeof(gStandardEncodingTable), - decodingTable); - hasInited = YES; - } - return DecodeBase64StringCommon(base64Str, decodingTable); -} - -NSData *GTLDecodeWebSafeBase64(NSString *base64Str) { - static char decodingTable[128]; - static BOOL hasInited = NO; - - if (!hasInited) { - CreateDecodingTable(gWebSafeEncodingTable, sizeof(gWebSafeEncodingTable), - decodingTable); - hasInited = YES; - } - return DecodeBase64StringCommon(base64Str, decodingTable); -} diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLBatchQuery.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLBatchQuery.h deleted file mode 100644 index d4fb1d38..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLBatchQuery.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLBatchQuery.h -// - -// Batch query documentation: -// https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Batch_Operations - -#import "GTLQuery.h" - -@interface GTLBatchQuery : NSObject { - @private - NSMutableArray *queries_; - NSMutableDictionary *requestIDMap_; - BOOL skipAuthorization_; - NSDictionary *additionalHTTPHeaders_; - NSDictionary *urlQueryParameters_; -} - -// Queries included in this batch. Each query should have a unique requestID. -@property (retain) NSArray *queries; - -// Clients may set this to YES to disallow authorization. Defaults to NO. -@property (assign) BOOL shouldSkipAuthorization; - -// Any additional HTTP headers for this batch. -// -// These headers override the same keys from the service object's -// additionalHTTPHeaders. -@property (copy) NSDictionary *additionalHTTPHeaders; - -// Any URL query parameters to add to the query (useful for debugging with some -// services). -@property (copy) NSDictionary *urlQueryParameters; - -+ (id)batchQuery; -+ (id)batchQueryWithQueries:(NSArray *)array; - -- (void)addQuery:(GTLQuery *)query GTL_NONNULL((1)); - -- (GTLQuery *)queryForRequestID:(NSString *)requestID GTL_NONNULL((1)); - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLBatchQuery.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLBatchQuery.m deleted file mode 100644 index c584368c..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLBatchQuery.m +++ /dev/null @@ -1,135 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLBatchQuery.m -// - -#import "GTLBatchQuery.h" - -@implementation GTLBatchQuery - -@synthesize shouldSkipAuthorization = skipAuthorization_, - additionalHTTPHeaders = additionalHTTPHeaders_, - urlQueryParameters = urlQueryParameters_; - -+ (id)batchQuery { - GTLBatchQuery *obj = [[[self alloc] init] autorelease]; - return obj; -} - -+ (id)batchQueryWithQueries:(NSArray *)queries { - GTLBatchQuery *obj = [self batchQuery]; - obj.queries = queries; - return obj; -} - -- (id)copyWithZone:(NSZone *)zone { - // Deep copy the list of queries - NSArray *copiesOfQueries = [[[NSArray alloc] initWithArray:self.queries - copyItems:YES] autorelease]; - GTLBatchQuery *newBatch = [[[self class] allocWithZone:zone] init]; - newBatch.queries = copiesOfQueries; - newBatch.shouldSkipAuthorization = self.shouldSkipAuthorization; - newBatch.additionalHTTPHeaders = self.additionalHTTPHeaders; - return newBatch; -} - -- (void)dealloc { - [queries_ release]; - [additionalHTTPHeaders_ release]; - [urlQueryParameters_ release]; - [requestIDMap_ release]; - - [super dealloc]; -} - -- (NSString *)description { - NSArray *queries = self.queries; - NSArray *methodNames = [queries valueForKey:@"methodName"]; - NSArray *dedupedNames = [[NSSet setWithArray:methodNames] allObjects]; - NSString *namesStr = [dedupedNames componentsJoinedByString:@","]; - - return [NSString stringWithFormat:@"%@ %p (queries:%lu methods:%@)", - [self class], self, (unsigned long) [queries count], namesStr]; -} - -#pragma mark - - -- (BOOL)isBatchQuery { - return YES; -} - -- (GTLUploadParameters *)uploadParameters { - // File upload is not supported for batches - return nil; -} - -- (void)executionDidStop { - NSArray *queries = self.queries; - [queries makeObjectsPerformSelector:@selector(executionDidStop)]; -} - -- (GTLQuery *)queryForRequestID:(NSString *)requestID { - GTLQuery *result = [requestIDMap_ objectForKey:requestID]; - if (result) return result; - - // We've not before tried to look up a query, or the map is stale - [requestIDMap_ release]; - requestIDMap_ = [[NSMutableDictionary alloc] init]; - - for (GTLQuery *query in queries_) { - [requestIDMap_ setObject:query forKey:query.requestID]; - } - - result = [requestIDMap_ objectForKey:requestID]; - return result; -} - -#pragma mark - - -- (void)setQueries:(NSArray *)array { -#if DEBUG - for (id obj in array) { - GTLQuery *query = obj; - GTL_DEBUG_ASSERT([query isKindOfClass:[GTLQuery class]], - @"unexpected query class: %@", [obj class]); - GTL_DEBUG_ASSERT(query.uploadParameters == nil, - @"batch may not contain upload: %@", query); - } -#endif - - [queries_ autorelease]; - queries_ = [array mutableCopy]; -} - -- (NSArray *)queries { - return queries_; -} - -- (void)addQuery:(GTLQuery *)query { - GTL_DEBUG_ASSERT([query isKindOfClass:[GTLQuery class]], - @"unexpected query class: %@", [query class]); - GTL_DEBUG_ASSERT(query.uploadParameters == nil, - @"batch may not contain upload: %@", query); - - if (queries_ == nil) { - queries_ = [[NSMutableArray alloc] init]; - } - - [queries_ addObject:query]; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLBatchResult.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLBatchResult.h deleted file mode 100644 index 9675aaf7..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLBatchResult.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (c) 2011 Google Inc. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// GTLBatchResult.h -// - -#import "GTLObject.h" - -@interface GTLBatchResult : GTLObject { - @private - NSMutableDictionary *successes_; - NSMutableDictionary *failures_; -} - -// Dictionaries of results for all queries in the batch -// -// Dictionary keys are requestID strings; objects are results or -// GTLErrorObjects. -// -// For successes with no returned object (such as from delete operations), -// the object for the dictionary entry is NSNull. -// -// -// The original query for each result is available from the service ticket, -// for example -// -// NSDictionary *successes = batchResults.successes; -// for (NSString *requestID in successes) { -// GTLObject *obj = [successes objectForKey:requestID]; -// GTLQuery *query = [ticket queryForRequestID:requestID]; -// NSLog(@"Query %@ returned object %@", query, obj); -// } -// -// NSDictionary *failures = batchResults.failures; -// for (NSString *requestID in failures) { -// GTLErrorObject *errorObj = [failures objectForKey:requestID]; -// GTLQuery *query = [ticket queryForRequestID:requestID]; -// NSLog(@"Query %@ failed with error %@", query, errorObj); -// } -// - -@property (retain) NSMutableDictionary *successes; -@property (retain) NSMutableDictionary *failures; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLBatchResult.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLBatchResult.m deleted file mode 100644 index f17748d5..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLBatchResult.m +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (c) 2011 Google Inc. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// GTLBatchResult.m -// - -#import "GTLBatchResult.h" - -#import "GTLErrorObject.h" - -@implementation GTLBatchResult - -@synthesize successes = successes_, - failures = failures_; - -- (id)copyWithZone:(NSZone *)zone { - GTLBatchResult* newObject = [super copyWithZone:zone]; - newObject.successes = [[self.successes mutableCopyWithZone:zone] autorelease]; - newObject.failures = [[self.failures mutableCopyWithZone:zone] autorelease]; - return newObject; -} - -- (void)dealloc { - [successes_ release]; - [failures_ release]; - - [super dealloc]; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"%@ %p (successes:%lu failures:%lu)", - [self class], self, - (unsigned long) [self.successes count], - (unsigned long) [self.failures count]]; -} - -#pragma mark - - -- (void)createItemsWithClassMap:(NSDictionary *)batchClassMap { - // This is called by GTLObject objectForJSON:defaultClass: - // JSON is defined to be a dictionary, but for batch results, it really - // is any array. - id json = self.JSON; - GTL_DEBUG_ASSERT([json isKindOfClass:[NSArray class]], - @"didn't get an array for the batch results"); - NSArray *jsonArray = json; - - NSMutableDictionary *successes = [NSMutableDictionary dictionary]; - NSMutableDictionary *failures = [NSMutableDictionary dictionary]; - - for (NSMutableDictionary *rpcResponse in jsonArray) { - NSString *responseID = [rpcResponse objectForKey:@"id"]; - - NSMutableDictionary *errorJSON = [rpcResponse objectForKey:@"error"]; - if (errorJSON) { - GTLErrorObject *errorObject = [GTLErrorObject objectWithJSON:errorJSON]; - [failures setValue:errorObject forKey:responseID]; - } else { - NSMutableDictionary *resultJSON = [rpcResponse objectForKey:@"result"]; - - NSDictionary *surrogates = self.surrogates; - Class defaultClass = [batchClassMap objectForKey:responseID]; - - id resultObject = [[self class] objectForJSON:resultJSON - defaultClass:defaultClass - surrogates:surrogates - batchClassMap:nil]; - if (resultObject == nil) { - // methods like delete return no object - resultObject = [NSNull null]; - } - [successes setValue:resultObject forKey:responseID]; - } - } - self.successes = successes; - self.failures = failures; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLDateTime.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLDateTime.h deleted file mode 100644 index f6b1ffb3..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLDateTime.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) 2011 Google Inc. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// -// GTLDateTime.h -// -// This is an immutable class representing a date and optionally a -// time with time zone. -// - -#import -#import "GTLDefines.h" - -@interface GTLDateTime : NSObject { - NSDateComponents *dateComponents_; - NSInteger milliseconds_; // This is only for the fraction of a second 0-999 - NSInteger offsetSeconds_; // may be NSUndefinedDateComponent - BOOL isUniversalTime_; // preserves "Z" - NSTimeZone *timeZone_; // specific time zone by name, if known -} - -+ (GTLDateTime *)dateTimeWithRFC3339String:(NSString *)str; - -// timeZone may be nil if the time zone is not known. -+ (GTLDateTime *)dateTimeWithDate:(NSDate *)date timeZone:(NSTimeZone *)tz; - -// Use this method to make a dateTime for an all-day event (date only, so -// hasTime is NO.) -+ (GTLDateTime *)dateTimeForAllDayWithDate:(NSDate *)date; - -+ (GTLDateTime *)dateTimeWithDateComponents:(NSDateComponents *)date; - -@property (nonatomic, readonly) NSDate *date; -@property (nonatomic, readonly) NSCalendar *calendar; - -@property (nonatomic, readonly) NSString *RFC3339String; -@property (nonatomic, readonly) NSString *stringValue; // same as RFC3339String - -@property (nonatomic, readonly, retain) NSTimeZone *timeZone; -@property (nonatomic, readonly, copy) NSDateComponents *dateComponents; -@property (nonatomic, readonly) NSInteger milliseconds; // This is only for the fraction of a second 0-999 - -@property (nonatomic, readonly) BOOL hasTime; -@property (nonatomic, readonly) NSInteger offsetSeconds; -@property (nonatomic, readonly, getter=isUniversalTime) BOOL universalTime; - - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLDateTime.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLDateTime.m deleted file mode 100644 index a55b049a..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLDateTime.m +++ /dev/null @@ -1,471 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLDateTime.m -// - -#import "GTLDateTime.h" - -@interface GTLDateTime () - -- (void)setFromDate:(NSDate *)date timeZone:(NSTimeZone *)tz; -- (void)setFromRFC3339String:(NSString *)str; - -@property (nonatomic, retain, readwrite) NSTimeZone *timeZone; -@property (nonatomic, copy, readwrite) NSDateComponents *dateComponents; -@property (nonatomic, assign, readwrite) NSInteger milliseconds; - -@property (nonatomic, assign, readwrite) BOOL hasTime; -@property (nonatomic, assign, readwrite) NSInteger offsetSeconds; -@property (nonatomic, assign, getter=isUniversalTime, readwrite) BOOL universalTime; - -@end - -static NSCharacterSet *gDashSet = nil; -static NSCharacterSet *gTSet = nil; -static NSCharacterSet *gColonSet = nil; -static NSCharacterSet *gPlusMinusZSet = nil; -static NSMutableDictionary *gCalendarsForTimeZones = nil; - -@implementation GTLDateTime - -// A note about milliseconds_: -// RFC 3339 has support for fractions of a second. NSDateComponents is all -// NSInteger based, so it can't handle a fraction of a second. NSDate is -// built on NSTimeInterval so it has sub-millisecond precision. GTL takes -// the compromise of supporting the RFC's optional fractional second support -// by maintaining a number of milliseconds past what fits in the -// NSDateComponents. The parsing and string conversions will include -// 3 decimal digits (hence milliseconds). When going to a string, the decimal -// digits are only included if the milliseconds are non zero. - -@dynamic date; -@dynamic calendar; -@dynamic RFC3339String; -@dynamic stringValue; -@dynamic timeZone; -@dynamic hasTime; - -@synthesize dateComponents = dateComponents_, - milliseconds = milliseconds_, - offsetSeconds = offsetSeconds_, - universalTime = isUniversalTime_; - -+ (void)initialize { - // Note that initialize is guaranteed by the runtime to be called in a - // thread-safe manner. - if (gDashSet == nil) { - gDashSet = [[NSCharacterSet characterSetWithCharactersInString:@"-"] retain]; - gTSet = [[NSCharacterSet characterSetWithCharactersInString:@"Tt "] retain]; - gColonSet = [[NSCharacterSet characterSetWithCharactersInString:@":"] retain]; - gPlusMinusZSet = [[NSCharacterSet characterSetWithCharactersInString:@"+-zZ"] retain]; - - gCalendarsForTimeZones = [[NSMutableDictionary alloc] init]; - } -} - -+ (GTLDateTime *)dateTimeWithRFC3339String:(NSString *)str { - if (str == nil) return nil; - - GTLDateTime *result = [[[self alloc] init] autorelease]; - [result setFromRFC3339String:str]; - return result; -} - -+ (GTLDateTime *)dateTimeWithDate:(NSDate *)date timeZone:(NSTimeZone *)tz { - if (date == nil) return nil; - - GTLDateTime *result = [[[self alloc] init] autorelease]; - [result setFromDate:date timeZone:tz]; - return result; -} - -+ (GTLDateTime *)dateTimeForAllDayWithDate:(NSDate *)date { - if (date == nil) return nil; - - GTLDateTime *result = [[[self alloc] init] autorelease]; - [result setFromDate:date timeZone:nil]; - result.hasTime = NO; - return result; -} - -+ (GTLDateTime *)dateTimeWithDateComponents:(NSDateComponents *)components { - NSCalendar *cal = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease]; - NSDate *date = [cal dateFromComponents:components]; -#if GTL_IPHONE - NSTimeZone *tz = [components timeZone]; -#else - // NSDateComponents added timeZone: in Mac OS X 10.7. - NSTimeZone *tz = nil; - if ([components respondsToSelector:@selector(timeZone)]) { - tz = [components timeZone]; - } -#endif - return [self dateTimeWithDate:date timeZone:tz]; -} - -- (void)dealloc { - [dateComponents_ release]; - [timeZone_ release]; - [super dealloc]; -} - -- (id)copyWithZone:(NSZone *)zone { - // Object is immutable - return [self retain]; -} - -// until NSDateComponent implements isEqual, we'll use this -- (BOOL)doesDateComponents:(NSDateComponents *)dc1 - equalDateComponents:(NSDateComponents *)dc2 { - - return [dc1 era] == [dc2 era] - && [dc1 year] == [dc2 year] - && [dc1 month] == [dc2 month] - && [dc1 day] == [dc2 day] - && [dc1 hour] == [dc2 hour] - && [dc1 minute] == [dc2 minute] - && [dc1 second] == [dc2 second] - && [dc1 week] == [dc2 week] - && [dc1 weekday] == [dc2 weekday] - && [dc1 weekdayOrdinal] == [dc2 weekdayOrdinal]; -} - -- (BOOL)isEqual:(GTLDateTime *)other { - - if (self == other) return YES; - if (![other isKindOfClass:[GTLDateTime class]]) return NO; - - BOOL areDateComponentsEqual = [self doesDateComponents:self.dateComponents - equalDateComponents:other.dateComponents]; - NSTimeZone *tz1 = self.timeZone; - NSTimeZone *tz2 = other.timeZone; - BOOL areTimeZonesEqual = (tz1 == tz2 || (tz2 && [tz1 isEqual:tz2])); - - return self.offsetSeconds == other.offsetSeconds - && self.isUniversalTime == other.isUniversalTime - && self.milliseconds == other.milliseconds - && areDateComponentsEqual - && areTimeZonesEqual; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"%@ %p: {%@}", - [self class], self, self.RFC3339String]; -} - -- (NSTimeZone *)timeZone { - if (timeZone_) { - return timeZone_; - } - - if (self.isUniversalTime) { - NSTimeZone *ztz = [NSTimeZone timeZoneWithName:@"Universal"]; - return ztz; - } - - NSInteger offsetSeconds = self.offsetSeconds; - - if (offsetSeconds != NSUndefinedDateComponent) { - NSTimeZone *tz = [NSTimeZone timeZoneForSecondsFromGMT:offsetSeconds]; - return tz; - } - return nil; -} - -- (void)setTimeZone:(NSTimeZone *)timeZone { - [timeZone_ release]; - timeZone_ = [timeZone retain]; - - if (timeZone) { - NSInteger offsetSeconds = [timeZone secondsFromGMTForDate:self.date]; - self.offsetSeconds = offsetSeconds; - } else { - self.offsetSeconds = NSUndefinedDateComponent; - } -} - -- (NSCalendar *)calendarForTimeZone:(NSTimeZone *)tz { - NSCalendar *cal = nil; - @synchronized(gCalendarsForTimeZones) { - id tzKey = (tz ? tz : [NSNull null]); - cal = [gCalendarsForTimeZones objectForKey:tzKey]; - if (cal == nil) { - cal = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease]; - if (tz) { - [cal setTimeZone:tz]; - } - [gCalendarsForTimeZones setObject:cal forKey:tzKey]; - } - } - return cal; -} - -- (NSCalendar *)calendar { - NSTimeZone *tz = self.timeZone; - return [self calendarForTimeZone:tz]; -} - -- (NSDate *)date { - NSDateComponents *dateComponents = self.dateComponents; - NSTimeInterval extraMillisecondsAsSeconds = 0.0; - NSCalendar *cal; - - if (!self.hasTime) { - // We're not keeping track of a time, but NSDate always is based on - // an absolute time. We want to avoid returning an NSDate where the - // calendar date appears different from what was used to create our - // date-time object. - // - // We'll make a copy of the date components, setting the time on our - // copy to noon GMT, since that ensures the date renders correctly for - // any time zone. - NSDateComponents *noonDateComponents = [[dateComponents copy] autorelease]; - [noonDateComponents setHour:12]; - [noonDateComponents setMinute:0]; - [noonDateComponents setSecond:0]; - dateComponents = noonDateComponents; - - NSTimeZone *gmt = [NSTimeZone timeZoneWithName:@"Universal"]; - cal = [self calendarForTimeZone:gmt]; - } else { - cal = self.calendar; - - // Add in the fractional seconds that don't fit into NSDateComponents. - extraMillisecondsAsSeconds = ((NSTimeInterval)self.milliseconds) / 1000.0; - } - - NSDate *date = [cal dateFromComponents:dateComponents]; - - // Add in any milliseconds that didn't fit into the dateComponents. - if (extraMillisecondsAsSeconds > 0.0) { -#if GTL_IPHONE || (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5) - date = [date dateByAddingTimeInterval:extraMillisecondsAsSeconds]; -#else - date = [date addTimeInterval:extraMillisecondsAsSeconds]; -#endif - } - - return date; -} - -- (NSString *)stringValue { - return self.RFC3339String; -} - -- (NSString *)RFC3339String { - NSDateComponents *dateComponents = self.dateComponents; - NSInteger offset = self.offsetSeconds; - - NSString *timeString = @""; // timeString like "T15:10:46-08:00" - - if (self.hasTime) { - - NSString *timeOffsetString; // timeOffsetString like "-08:00" - - if (self.isUniversalTime) { - timeOffsetString = @"Z"; - } else if (offset == NSUndefinedDateComponent) { - // unknown offset is rendered as -00:00 per - // http://www.ietf.org/rfc/rfc3339.txt section 4.3 - timeOffsetString = @"-00:00"; - } else { - NSString *sign = @"+"; - if (offset < 0) { - sign = @"-"; - offset = -offset; - } - timeOffsetString = [NSString stringWithFormat:@"%@%02ld:%02ld", - sign, (long)(offset/(60*60)) % 24, (long)(offset / 60) % 60]; - } - - NSString *fractionalSecondsString = @""; - if (self.milliseconds > 0.0) { - fractionalSecondsString = [NSString stringWithFormat:@".%03ld", (long)self.milliseconds]; - } - - timeString = [NSString stringWithFormat:@"T%02ld:%02ld:%02ld%@%@", - (long)[dateComponents hour], (long)[dateComponents minute], - (long)[dateComponents second], fractionalSecondsString, timeOffsetString]; - } - - // full dateString like "2006-11-17T15:10:46-08:00" - NSString *dateString = [NSString stringWithFormat:@"%04ld-%02ld-%02ld%@", - (long)[dateComponents year], (long)[dateComponents month], - (long)[dateComponents day], timeString]; - - return dateString; -} - -- (void)setFromDate:(NSDate *)date timeZone:(NSTimeZone *)tz { - NSCalendar *cal = [self calendarForTimeZone:tz]; - - NSUInteger const kComponentBits = (NSYearCalendarUnit | NSMonthCalendarUnit - | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit - | NSSecondCalendarUnit); - - NSDateComponents *components = [cal components:kComponentBits fromDate:date]; - self.dateComponents = components; - - // Extract the fractional seconds. - NSTimeInterval asTimeInterval = [date timeIntervalSince1970]; - NSTimeInterval worker = asTimeInterval - trunc(asTimeInterval); - self.milliseconds = (NSInteger)round(worker * 1000.0); - - self.universalTime = NO; - - NSInteger offset = NSUndefinedDateComponent; - - if (tz) { - offset = [tz secondsFromGMTForDate:date]; - - if (offset == 0 && [tz isEqualToTimeZone:[NSTimeZone timeZoneWithName:@"Universal"]]) { - self.universalTime = YES; - } - } - self.offsetSeconds = offset; - - // though offset seconds are authoritative, we'll retain the time zone - // since we can't regenerate it reliably from just the offset - timeZone_ = [tz retain]; -} - -- (void)setFromRFC3339String:(NSString *)str { - - NSInteger year = NSUndefinedDateComponent; - NSInteger month = NSUndefinedDateComponent; - NSInteger day = NSUndefinedDateComponent; - NSInteger hour = NSUndefinedDateComponent; - NSInteger minute = NSUndefinedDateComponent; - NSInteger sec = NSUndefinedDateComponent; - NSInteger milliseconds = 0; - double secDouble = -1.0; - NSString* sign = nil; - NSInteger offsetHour = 0; - NSInteger offsetMinute = 0; - - if ([str length] > 0) { - NSScanner* scanner = [NSScanner scannerWithString:str]; - // There should be no whitespace, so no skip characters. - [scanner setCharactersToBeSkipped:nil]; - - // for example, scan 2006-11-17T15:10:46-08:00 - // or 2006-11-17T15:10:46Z - if (// yyyy-mm-dd - [scanner scanInteger:&year] && - [scanner scanCharactersFromSet:gDashSet intoString:NULL] && - [scanner scanInteger:&month] && - [scanner scanCharactersFromSet:gDashSet intoString:NULL] && - [scanner scanInteger:&day] && - // Thh:mm:ss - [scanner scanCharactersFromSet:gTSet intoString:NULL] && - [scanner scanInteger:&hour] && - [scanner scanCharactersFromSet:gColonSet intoString:NULL] && - [scanner scanInteger:&minute] && - [scanner scanCharactersFromSet:gColonSet intoString:NULL] && - [scanner scanDouble:&secDouble]) { - - // At this point we got secDouble, pull it apart. - sec = (NSInteger)secDouble; - double worker = secDouble - ((double)sec); - milliseconds = (NSInteger)round(worker * 1000.0); - - // Finish parsing, now the offset info. - if (// Z or +hh:mm - [scanner scanCharactersFromSet:gPlusMinusZSet intoString:&sign] && - [scanner scanInteger:&offsetHour] && - [scanner scanCharactersFromSet:gColonSet intoString:NULL] && - [scanner scanInteger:&offsetMinute]) { - } - } - } - - NSDateComponents *dateComponents = [[[NSDateComponents alloc] init] autorelease]; - [dateComponents setYear:year]; - [dateComponents setMonth:month]; - [dateComponents setDay:day]; - [dateComponents setHour:hour]; - [dateComponents setMinute:minute]; - [dateComponents setSecond:sec]; - - self.dateComponents = dateComponents; - self.milliseconds = milliseconds; - - // determine the offset, like from Z, or -08:00:00.0 - - self.timeZone = nil; - - NSInteger totalOffset = NSUndefinedDateComponent; - self.universalTime = NO; - - if ([sign caseInsensitiveCompare:@"Z"] == NSOrderedSame) { - - self.universalTime = YES; - totalOffset = 0; - - } else if (sign != nil) { - - totalOffset = (60 * offsetMinute) + (60 * 60 * offsetHour); - - if ([sign isEqual:@"-"]) { - - if (totalOffset == 0) { - // special case: offset of -0.00 means undefined offset - totalOffset = NSUndefinedDateComponent; - } else { - totalOffset *= -1; - } - } - } - - self.offsetSeconds = totalOffset; -} - -- (BOOL)hasTime { - NSDateComponents *dateComponents = self.dateComponents; - - BOOL hasTime = ([dateComponents hour] != NSUndefinedDateComponent - && [dateComponents minute] != NSUndefinedDateComponent); - - return hasTime; -} - -- (void)setHasTime:(BOOL)shouldHaveTime { - - // we'll set time values to zero or NSUndefinedDateComponent as appropriate - BOOL hadTime = self.hasTime; - - if (shouldHaveTime && !hadTime) { - [dateComponents_ setHour:0]; - [dateComponents_ setMinute:0]; - [dateComponents_ setSecond:0]; - milliseconds_ = 0; - offsetSeconds_ = NSUndefinedDateComponent; - isUniversalTime_ = NO; - - } else if (hadTime && !shouldHaveTime) { - [dateComponents_ setHour:NSUndefinedDateComponent]; - [dateComponents_ setMinute:NSUndefinedDateComponent]; - [dateComponents_ setSecond:NSUndefinedDateComponent]; - milliseconds_ = 0; - offsetSeconds_ = NSUndefinedDateComponent; - isUniversalTime_ = NO; - self.timeZone = nil; - } -} - - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLDefines.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLDefines.h deleted file mode 100644 index b12eb9eb..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLDefines.h +++ /dev/null @@ -1,144 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLDefines.h -// - -// Ensure Apple's conditionals we depend on are defined. -#import -#import - -// -// The developer may choose to define these in the project: -// -// #define GTL_TARGET_NAMESPACE Xxx // preface all GTL class names with Xxx (recommended for building plug-ins) -// #define GTL_FOUNDATION_ONLY 1 // builds without AppKit or Carbon (default for iPhone builds) -// #define STRIP_GTM_FETCH_LOGGING 1 // omit http logging code (default for iPhone release builds) -// -// Mac developers may find GTL_SIMPLE_DESCRIPTIONS and STRIP_GTM_FETCH_LOGGING useful for -// reducing code size. -// - -// Define later OS versions when building on earlier versions -#ifdef MAC_OS_X_VERSION_10_0 - #ifndef MAC_OS_X_VERSION_10_6 - #define MAC_OS_X_VERSION_10_6 1060 - #endif -#endif - - -#ifdef GTL_TARGET_NAMESPACE -// prefix all GTL class names with GTL_TARGET_NAMESPACE for this target - #import "GTLTargetNamespace.h" -#endif - -// Provide a common definition for externing constants/functions -#if defined(__cplusplus) - #define GTL_EXTERN extern "C" -#else - #define GTL_EXTERN extern -#endif - -#if TARGET_OS_IPHONE // iPhone SDK - - #define GTL_IPHONE 1 - -#endif - -#if GTL_IPHONE - - #define GTL_FOUNDATION_ONLY 1 - -#endif - -// -// GTL_ASSERT is like NSAssert, but takes a variable number of arguments: -// -// GTL_ASSERT(condition, @"Problem in argument %@", argStr); -// -// GTL_DEBUG_ASSERT is similar, but compiles in only for debug builds -// - -#ifndef GTL_ASSERT - // we directly invoke the NSAssert handler so we can pass on the varargs - #if !defined(NS_BLOCK_ASSERTIONS) - #define GTL_ASSERT(condition, ...) \ - do { \ - if (!(condition)) { \ - [[NSAssertionHandler currentHandler] \ - handleFailureInFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] \ - file:[NSString stringWithUTF8String:__FILE__] \ - lineNumber:__LINE__ \ - description:__VA_ARGS__]; \ - } \ - } while(0) - #else - #define GTL_ASSERT(condition, ...) do { } while (0) - #endif // !defined(NS_BLOCK_ASSERTIONS) -#endif // GTL_ASSERT - -#ifndef GTL_DEBUG_ASSERT - #if DEBUG - #define GTL_DEBUG_ASSERT(condition, ...) GTL_ASSERT(condition, __VA_ARGS__) - #else - #define GTL_DEBUG_ASSERT(condition, ...) do { } while (0) - #endif -#endif - -#ifndef GTL_DEBUG_LOG - #if DEBUG - #define GTL_DEBUG_LOG(...) NSLog(__VA_ARGS__) - #else - #define GTL_DEBUG_LOG(...) do { } while (0) - #endif -#endif - -#ifndef STRIP_GTM_FETCH_LOGGING - #if GTL_IPHONE && !DEBUG - #define STRIP_GTM_FETCH_LOGGING 1 - #else - #define STRIP_GTM_FETCH_LOGGING 0 - #endif -#endif - -// Some support for advanced clang static analysis functionality -// See http://clang-analyzer.llvm.org/annotations.html -#ifndef __has_feature // Optional. - #define __has_feature(x) 0 // Compatibility with non-clang compilers. -#endif -#ifndef NS_RETURNS_NOT_RETAINED - #if __has_feature(attribute_ns_returns_not_retained) - #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) - #else - #define NS_RETURNS_NOT_RETAINED - #endif -#endif - -#ifndef __has_attribute - #define __has_attribute(x) 0 -#endif - -#if 1 - // We will start using nonnull declarations once the static analyzer seems - // to support it without false positives. - #define GTL_NONNULL(x) -#else - #if __has_attribute(nonnull) - #define GTL_NONNULL(x) __attribute__((nonnull x)) - #else - #define GTL_NONNULL(x) - #endif -#endif diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLErrorObject.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLErrorObject.h deleted file mode 100644 index c2ec67db..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLErrorObject.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLErrorObject.h -// - -#import "GTLObject.h" - -@class GTLErrorObjectData; - -@interface GTLErrorObject : GTLObject -@property (retain) NSNumber *code; -@property (retain) NSString *message; -@property (retain) NSArray *data; // of GTLErrorObjectData - -// Convenience accessor for creating an NSError from a GTLErrorObject. -@property (readonly) NSError *foundationError; - -// Convenience accessor for extracting the GTLErrorObject that was used to -// create an NSError. -// -// Returns nil if the error was not originally from a GTLErrorObject. -+ (GTLErrorObject *)underlyingObjectForError:(NSError *)foundationError; - -@end - -@interface GTLErrorObjectData : GTLObject -@property (retain) NSString *domain; -@property (retain) NSString *reason; -@property (retain) NSString *message; -@property (retain) NSString *location; -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLErrorObject.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLErrorObject.m deleted file mode 100644 index 1fa1023a..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLErrorObject.m +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLErrorObject.m -// - -#import "GTLErrorObject.h" -#import "GTLService.h" - -@implementation GTLErrorObject - -@dynamic code; -@dynamic message; -@dynamic data; - -+ (NSDictionary *)arrayPropertyToClassMap { - NSDictionary *map = [NSDictionary dictionaryWithObject:[GTLErrorObjectData class] - forKey:@"data"]; - return map; -} - -- (NSError *)foundationError { - NSMutableDictionary *userInfo; - - // This structured GTLErrorObject will be available in the error's userInfo - // dictionary - userInfo = [NSMutableDictionary dictionaryWithObject:self - forKey:kGTLStructuredErrorKey]; - - NSString *reasonStr = self.message; - if (reasonStr) { - // We always store an error in the userInfo key "error" - [userInfo setObject:reasonStr - forKey:kGTLServerErrorStringKey]; - - // Store a user-readable "reason" to show up when an error is logged, - // in parentheses like NSError does it - NSString *parenthesized = [NSString stringWithFormat:@"(%@)", reasonStr]; - [userInfo setObject:parenthesized - forKey:NSLocalizedFailureReasonErrorKey]; - } - - NSInteger code = [self.code integerValue]; - NSError *error = [NSError errorWithDomain:kGTLJSONRPCErrorDomain - code:code - userInfo:userInfo]; - return error; -} - -+ (GTLErrorObject *)underlyingObjectForError:(NSError *)foundationError { - NSDictionary *userInfo = [foundationError userInfo]; - GTLErrorObject *errorObj = [userInfo objectForKey:kGTLStructuredErrorKey]; - return errorObj; -} - -@end - -@implementation GTLErrorObjectData -@dynamic domain; -@dynamic reason; -@dynamic message; -@dynamic location; -@end - - diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLFramework.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLFramework.h deleted file mode 100644 index 106f420e..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLFramework.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef _GTLFRAMEWORK_H_ -#define _GTLFRAMEWORK_H_ - -#import - -#import "GTLDefines.h" - - -// Returns the version of the framework. Major and minor should -// match the bundle version in the Info.plist file. -// -// Pass NULL to ignore any of the parameters. - -void GTLFrameworkVersion(NSUInteger* major, NSUInteger* minor, NSUInteger* release); - -// Returns the version in @"a.b" or @"a.b.c" format -NSString *GTLFrameworkVersionString(void); - -#endif diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLFramework.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLFramework.m deleted file mode 100644 index 6bfc7f22..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLFramework.m +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "GTLFramework.h" - -void GTLFrameworkVersion(NSUInteger* major, NSUInteger* minor, NSUInteger* release) { - // version 2.0.0 - if (major) *major = 2; - if (minor) *minor = 0; - if (release) *release = 0; -} - -NSString *GTLFrameworkVersionString(void) { - NSUInteger major, minor, release; - NSString *libVersionString; - - GTLFrameworkVersion(&major, &minor, &release); - - // most library releases will have a release value of zero - if (release != 0) { - libVersionString = [NSString stringWithFormat:@"%d.%d.%d", - (int)major, (int)minor, (int)release]; - } else { - libVersionString = [NSString stringWithFormat:@"%d.%d", - (int)major, (int)minor]; - } - return libVersionString; -} diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLJSONParser.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLJSONParser.h deleted file mode 100644 index d9715295..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLJSONParser.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLJSONParser.h -// - -// This class is a thin wrapper around the JSON parser. It uses -// NSJSONSerialization when available, and SBJSON otherwise. - -#import - -#import "GTLDefines.h" - -@interface GTLJSONParser : NSObject -+ (NSString*)stringWithObject:(id)value - humanReadable:(BOOL)humanReadable - error:(NSError**)error; - -+ (NSData *)dataWithObject:(id)obj - humanReadable:(BOOL)humanReadable - error:(NSError**)error; - -+ (id)objectWithString:(NSString *)jsonStr - error:(NSError **)error; - -+ (id)objectWithData:(NSData *)jsonData - error:(NSError **)error; -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLJSONParser.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLJSONParser.m deleted file mode 100644 index a089a93d..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLJSONParser.m +++ /dev/null @@ -1,150 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLJSONParser.m -// - -#import "GTLJSONParser.h" - -// We can assume NSJSONSerialization is present on Mac OS X 10.7 and iOS 5 -#if !defined(GTL_REQUIRES_NSJSONSERIALIZATION) -#if (!TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) || \ - (TARGET_OS_IPHONE && (__IPHONE_OS_VERSION_MIN_REQUIRED >= 50000)) -#define GTL_REQUIRES_NSJSONSERIALIZATION 1 -#endif -#endif - -// If GTMNSJSONSerialization is available, it is used for parsing and -// formatting JSON -#if !GTL_REQUIRES_NSJSONSERIALIZATION -@interface GTMNSJSONSerialization : NSObject -+ (NSData *)dataWithJSONObject:(id)obj options:(NSUInteger)opt error:(NSError **)error; -+ (id)JSONObjectWithData:(NSData *)data options:(NSUInteger)opt error:(NSError **)error; -@end - -// As a fallback, SBJSON is used for parsing and formatting JSON -@interface GTLSBJSON -- (void)setHumanReadable:(BOOL)flag; -- (NSString*)stringWithObject:(id)value error:(NSError**)error; -- (id)objectWithString:(NSString*)jsonrep error:(NSError**)error; -@end -#endif // !GTL_REQUIRES_NSJSONSERIALIZATION - -@implementation GTLJSONParser - -#if DEBUG && !GTL_REQUIRES_NSJSONSERIALIZATION -// When compiling for iOS 4 compatibility, SBJSON must be available -+ (void)load { - Class writer = NSClassFromString(@"SBJsonWriter"); - Class parser = NSClassFromString(@"SBJsonParser"); - Class oldParser = NSClassFromString(@"SBJSON"); - GTL_ASSERT((oldParser != Nil) - || (writer != Nil && parser != Nil), - @"No parsing class found"); -} -#endif // DEBUG && !GTL_REQUIRES_NSJSONSERIALIZATION - -+ (NSString*)stringWithObject:(id)obj - humanReadable:(BOOL)humanReadable - error:(NSError**)error { - NSData *data = [self dataWithObject:obj - humanReadable:humanReadable - error:error]; - if (data) { - NSString *jsonStr = [[[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding] autorelease]; - return jsonStr; - } - return nil; -} - -+ (NSData *)dataWithObject:(id)obj - humanReadable:(BOOL)humanReadable - error:(NSError**)error { - const NSUInteger kOpts = humanReadable ? (1UL << 0) : 0; // NSJSONWritingPrettyPrinted - -#if GTL_REQUIRES_NSJSONSERIALIZATION - NSData *data = [NSJSONSerialization dataWithJSONObject:obj - options:kOpts - error:error]; - return data; -#else - Class serializer = NSClassFromString(@"NSJSONSerialization"); - if (serializer) { - NSData *data = [serializer dataWithJSONObject:obj - options:kOpts - error:error]; - return data; - } else { - Class jsonWriteClass = NSClassFromString(@"SBJsonWriter"); - if (!jsonWriteClass) { - jsonWriteClass = NSClassFromString(@"SBJSON"); - } - - if (error) *error = nil; - - GTLSBJSON *writer = [[[jsonWriteClass alloc] init] autorelease]; - [writer setHumanReadable:humanReadable]; - NSString *jsonStr = [writer stringWithObject:obj - error:error]; - NSData *data = [jsonStr dataUsingEncoding:NSUTF8StringEncoding]; - return data; - } -#endif -} - -+ (id)objectWithString:(NSString *)jsonStr - error:(NSError **)error { - NSData *data = [jsonStr dataUsingEncoding:NSUTF8StringEncoding]; - return [self objectWithData:data - error:error]; -} - -+ (id)objectWithData:(NSData *)jsonData - error:(NSError **)error { -#if GTL_REQUIRES_NSJSONSERIALIZATION - NSMutableDictionary *obj = [NSJSONSerialization JSONObjectWithData:jsonData - options:NSJSONReadingMutableContainers - error:error]; - return obj; -#else - Class serializer = NSClassFromString(@"NSJSONSerialization"); - if (serializer) { - const NSUInteger kOpts = (1UL << 0); // NSJSONReadingMutableContainers - NSMutableDictionary *obj = [serializer JSONObjectWithData:jsonData - options:kOpts - error:error]; - return obj; - } else { - Class jsonParseClass = NSClassFromString(@"SBJsonParser"); - if (!jsonParseClass) { - jsonParseClass = NSClassFromString(@"SBJSON"); - } - - if (error) *error = nil; - - GTLSBJSON *parser = [[[jsonParseClass alloc] init] autorelease]; - - NSString *jsonrep = [[[NSString alloc] initWithData:jsonData - encoding:NSUTF8StringEncoding] autorelease]; - id obj = [parser objectWithString:jsonrep - error:error]; - return obj; - } -#endif -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLObject.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLObject.h deleted file mode 100644 index 43935adf..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLObject.h +++ /dev/null @@ -1,208 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLObject.h -// - -// GTLObject documentation: -// https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Objects_and_Queries - -#import - -#import "GTLDefines.h" -#import "GTLUtilities.h" -#import "GTLDateTime.h" - -#undef _EXTERN -#undef _INITIALIZE_AS -#ifdef GTLOBJECT_DEFINE_GLOBALS -#define _EXTERN -#define _INITIALIZE_AS(x) =x -#else -#define _EXTERN extern -#define _INITIALIZE_AS(x) -#endif - -@protocol GTLCollectionProtocol -@optional -@property (retain) NSArray *items; -@end - -@protocol GTLBatchItemCreationProtocol -- (void)createItemsWithClassMap:(NSDictionary *)batchClassMap; -@end - -@interface GTLObject : NSObject { - - @private - - NSMutableDictionary *json_; - - // Used when creating the subobjects from this one. - NSDictionary *surrogates_; - - // Any complex object hung off this object goes into the cache so the - // next fetch will get the same object back instead of having to recreate - // it. - NSMutableDictionary *childCache_; - - // Anything defined by the client; retained but not used internally; not - // copied by copyWithZone: - NSMutableDictionary *userProperties_; -} - -@property (nonatomic, retain) NSMutableDictionary *JSON; -@property (nonatomic, retain) NSDictionary *surrogates; -@property (nonatomic, retain) NSMutableDictionary *userProperties; - -/////////////////////////////////////////////////////////////////////////////// -// -// Public methods -// -// These methods are intended for users of the library -// - -+ (id)object; -+ (id)objectWithJSON:(NSMutableDictionary *)dict; - -- (id)copyWithZone:(NSZone *)zone; - -- (NSString *)JSONString; - -// generic access to json; also creates it if necessary -- (void)setJSONValue:(id)obj forKey:(NSString *)key GTL_NONNULL((2)); -- (id)JSONValueForKey:(NSString *)key; - -// Returns the list of keys in this object's JSON that aren't listed as -// properties on the object. -- (NSArray *)additionalJSONKeys; - -// Any keys in the JSON that aren't listed as @properties on the object -// are counted as "additional properties". These allow you to get/set them. -- (id)additionalPropertyForName:(NSString *)name; -- (void)setAdditionalProperty:(id)obj forName:(NSString *)name GTL_NONNULL((2)); -- (NSDictionary *)additionalProperties; - -// User properties are supported for client convenience, but are not copied by -// copyWithZone. User Properties keys beginning with _ are reserved by the library. -// -// Set nil for obj to remove the property. -- (void)setProperty:(id)obj forKey:(NSString *)key GTL_NONNULL((2)); -- (id)propertyForKey:(NSString *)key GTL_NONNULL((1)); - -// userData is stored as a property with key "_userData" -- (void)setUserData:(id)obj; -- (id)userData; - -// Makes a partial query-compatible string describing the fields present -// in this object. (Note: only the first element of any array is examined.) -// -// http://code.google.com/apis/tasks/v1/performance.html#partial -// -- (NSString *)fieldsDescription; - -// Makes an object containing only the changes needed to do a partial update -// (patch), where the patch would be to change an object from the original -// to the receiver, such as -// -// GTLSomeObject *patchObject = [newVersion patchObjectFromOriginal:oldVersion]; -// -// http://code.google.com/apis/tasks/v1/performance.html#patch -// -// NOTE: this method returns nil if there are no changes between the original -// and the receiver. -- (id)patchObjectFromOriginal:(GTLObject *)original; - -// Method creating a null value to set object properties for patch queries that -// delete fields. Do not use this except when setting an object property for -// a patch query. -+ (id)nullValue; - -/////////////////////////////////////////////////////////////////////////////// -// -// Protected methods -// -// These methods are intended for subclasses of GTLObject -// - -// class registration ("kind" strings) for subclasses -+ (Class)registeredObjectClassForKind:(NSString *)kind; -+ (void)registerObjectClassForKind:(NSString *)kind; - -// creation of objects from a JSON dictionary -+ (GTLObject *)objectForJSON:(NSMutableDictionary *)json - defaultClass:(Class)defaultClass - surrogates:(NSDictionary *)surrogates - batchClassMap:(NSDictionary *)batchClassMap; - -// property-to-key mapping (for JSON keys which are not used as method names) -+ (NSDictionary *)propertyToJSONKeyMap; - -// property-to-Class mapping for array properties (to say what is in the array) -+ (NSDictionary *)arrayPropertyToClassMap; - -// The default class for additional JSON keys -+ (Class)classForAdditionalProperties; - -@end - -// Collection objects with an "items" property should derive from GTLCollection -// object. This provides support for fast object enumeration, the -// itemAtIndex: convenience method, and indexed subscripts. -// -// Subclasses must implement the items method dynamically. -@interface GTLCollectionObject : GTLObject { - @private - NSDictionary *identifierMap_; -} - -// itemAtIndex: and objectAtIndexedSubscript: return nil when the index exceeds -// the bounds of the items array. -- (id)itemAtIndex:(NSUInteger)idx; - -- (id)objectAtIndexedSubscript:(NSInteger)idx; - -// itemForIdentifier: looks up items from the collection object by identifier, -// and returns the first one. -// -// Typically, items will have a unique identifier (with key "id" in the -// object's JSON). This method returns the first item found in the collection -// with the specified identifier. -// -// The first time this method is used, the collection will cache a map of -// identifiers to items. If the items list for the instance somehow changes, -// use the reset method below to force a new cache to be created for this -// collection. -- (id)itemForIdentifier:(NSString *)key GTL_NONNULL((1)); - -// Identifiers for all items are cached when the first one is obtained. -// This method resets the cache. It is needed only if the item list has -// changed. -- (void)resetIdentifierMap; - -@end - -@interface GTLCollectionObject (DynamicMethods) -- (NSArray *)items; -@end - -// Base object use for when an service method directly returns an array instead -// of an object. Normally methods should return an object with an 'items' -// property, but this exists for the methods not up to spec. -@interface GTLResultArray : GTLCollectionObject -// This method should only be called by subclasses. -- (NSArray *)itemsWithItemClass:(Class)itemClass; -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLObject.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLObject.m deleted file mode 100644 index 83c2d19f..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLObject.m +++ /dev/null @@ -1,722 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLObject.m -// - -#define GTLOBJECT_DEFINE_GLOBALS 1 - -#include - -#import "GTLObject.h" -#import "GTLRuntimeCommon.h" -#import "GTLJSONParser.h" - -static NSString *const kUserDataPropertyKey = @"_userData"; - -@interface GTLObject () -+ (NSMutableArray *)allDeclaredProperties; -+ (NSArray *)allKnownKeys; - -+ (NSArray *)fieldsElementsForJSON:(NSDictionary *)targetJSON; -+ (NSString *)fieldsDescriptionForJSON:(NSDictionary *)targetJSON; - -+ (NSMutableDictionary *)patchDictionaryForJSON:(NSDictionary *)newJSON - fromOriginalJSON:(NSDictionary *)originalJSON; -@end - -@implementation GTLObject - -@synthesize JSON = json_, - surrogates = surrogates_, - userProperties = userProperties_; - -+ (id)object { - return [[[self alloc] init] autorelease]; -} - -+ (id)objectWithJSON:(NSMutableDictionary *)dict { - GTLObject *obj = [self object]; - obj.JSON = dict; - return obj; -} - -+ (NSDictionary *)propertyToJSONKeyMap { - return nil; -} - -+ (NSDictionary *)arrayPropertyToClassMap { - return nil; -} - -+ (Class)classForAdditionalProperties { - return Nil; -} - -- (BOOL)isEqual:(GTLObject *)other { - if (self == other) return YES; - if (other == nil) return NO; - - // The objects should be the same class, or one should be a subclass of the - // other's class - if (![other isKindOfClass:[self class]] - && ![self isKindOfClass:[other class]]) return NO; - - // What we're not comparing here: - // properties - return GTL_AreEqualOrBothNil(json_, [other JSON]); -} - -// By definition, for two objects to potentially be considered equal, -// they must have the same hash value. The hash is mostly ignored, -// but removeObjectsInArray: in Leopard does seem to check the hash, -// and NSObject's default hash method just returns the instance pointer. -// We'll define hash here for all of our GTLObjects. -- (NSUInteger)hash { - return (NSUInteger) (void *) [GTLObject class]; -} - -- (id)copyWithZone:(NSZone *)zone { - GTLObject* newObject = [[[self class] allocWithZone:zone] init]; - CFPropertyListRef ref = CFPropertyListCreateDeepCopy(kCFAllocatorDefault, - json_, kCFPropertyListMutableContainers); - GTL_DEBUG_ASSERT(ref != NULL, @"GTLObject: copy failed (probably a non-plist type in the JSON)"); - newObject.JSON = [NSMakeCollectable(ref) autorelease]; - newObject.surrogates = self.surrogates; - - // What we're not copying: - // userProperties - return newObject; -} - -- (NSString *)descriptionWithLocale:(id)locale { - return [self description]; -} - -- (void)dealloc { - [json_ release]; - [surrogates_ release]; - [childCache_ release]; - [userProperties_ release]; - - [super dealloc]; -} - -#pragma mark JSON values - -- (void)setJSONValue:(id)obj forKey:(NSString *)key { - NSMutableDictionary *dict = self.JSON; - if (dict == nil && obj != nil) { - dict = [NSMutableDictionary dictionaryWithCapacity:1]; - self.JSON = dict; - } - [dict setValue:obj forKey:key]; -} - -- (id)JSONValueForKey:(NSString *)key { - id obj = [self.JSON objectForKey:key]; - return obj; -} - -- (NSString *)JSONString { - NSError *error = nil; - NSString *str = [GTLJSONParser stringWithObject:[self JSON] - humanReadable:YES - error:&error]; - if (error) { - return [error description]; - } - return str; -} - -- (NSArray *)additionalJSONKeys { - NSArray *knownKeys = [[self class] allKnownKeys]; - NSMutableArray *result = [NSMutableArray arrayWithArray:[json_ allKeys]]; - [result removeObjectsInArray:knownKeys]; - // Return nil instead of an empty array. - if ([result count] == 0) { - result = nil; - } - return result; -} - -#pragma mark Partial - Fields - -- (NSString *)fieldsDescription { - NSString *str = [GTLObject fieldsDescriptionForJSON:self.JSON]; - return str; -} - -+ (NSString *)fieldsDescriptionForJSON:(NSDictionary *)targetJSON { - // Internal routine: recursively generate a string field description - // by joining elements - NSArray *array = [self fieldsElementsForJSON:targetJSON]; - NSString *str = [array componentsJoinedByString:@","]; - return str; -} - -+ (NSArray *)fieldsElementsForJSON:(NSDictionary *)targetJSON { - // Internal routine: recursively generate an array of field description - // element strings - NSMutableArray *resultFields = [NSMutableArray array]; - - // Sorting the dictionary keys gives us deterministic results when iterating - NSArray *sortedKeys = [[targetJSON allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; - for (NSString *key in sortedKeys) { - // We'll build a comma-separated list of fields - id value = [targetJSON objectForKey:key]; - if ([value isKindOfClass:[NSString class]] - || [value isKindOfClass:[NSNumber class]]) { - // Basic type (string, number), so the key is what we want - [resultFields addObject:key]; - } else if ([value isKindOfClass:[NSDictionary class]]) { - // Object (dictionary): "parent/child1,parent/child2,parent/child3" - NSArray *subElements = [self fieldsElementsForJSON:value]; - for (NSString *subElem in subElements) { - NSString *prepended = [NSString stringWithFormat:@"%@/%@", - key, subElem]; - [resultFields addObject:prepended]; - } - } else if ([value isKindOfClass:[NSArray class]]) { - // Array; we'll generate from the first array entry: - // "parent(child1,child2,child3)" - // - // Open question: should this instead create the union of elements for - // all items in the array, rather than just get fields from the first - // array object? - if ([(NSArray *)value count] > 0) { - id firstObj = [value objectAtIndex:0]; - if ([firstObj isKindOfClass:[NSDictionary class]]) { - // An array of objects - NSString *contentsStr = [self fieldsDescriptionForJSON:firstObj]; - NSString *encapsulated = [NSString stringWithFormat:@"%@(%@)", - key, contentsStr]; - [resultFields addObject:encapsulated]; - } else { - // An array of some basic type, or of arrays - [resultFields addObject:key]; - } - } - } else { - GTL_ASSERT(0, @"GTLObject unknown field element for %@ (%@)", - key, NSStringFromClass([value class])); - } - } - return resultFields; -} - -#pragma mark Partial - Patch - -- (id)patchObjectFromOriginal:(GTLObject *)original { - id resultObj; - NSMutableDictionary *resultJSON = [GTLObject patchDictionaryForJSON:self.JSON - fromOriginalJSON:original.JSON]; - if ([resultJSON count] > 0) { - resultObj = [[self class] objectWithJSON:resultJSON]; - } else { - // Client apps should not attempt to patch with an object containing - // empty JSON - resultObj = nil; - } - return resultObj; -} - -+ (NSMutableDictionary *)patchDictionaryForJSON:(NSDictionary *)newJSON - fromOriginalJSON:(NSDictionary *)originalJSON { - // Internal recursive routine to create an object suitable for - // our patch semantics - NSMutableDictionary *resultJSON = [NSMutableDictionary dictionary]; - - // Iterate through keys present in the old object - NSArray *originalKeys = [originalJSON allKeys]; - for (NSString *key in originalKeys) { - id originalValue = [originalJSON objectForKey:key]; - id newValue = [newJSON valueForKey:key]; - if (newValue == nil) { - // There is no new value for this key, so set the value to NSNull - [resultJSON setValue:[NSNull null] forKey:key]; - } else if (!GTL_AreEqualOrBothNil(originalValue, newValue)) { - // The values for this key differ - if ([originalValue isKindOfClass:[NSDictionary class]] - && [newValue isKindOfClass:[NSDictionary class]]) { - // Both are objects; recurse - NSMutableDictionary *subDict = [self patchDictionaryForJSON:newValue - fromOriginalJSON:originalValue]; - [resultJSON setValue:subDict forKey:key]; - } else { - // They are non-object values; the new replaces the old. Per the - // documentation for patch, this replaces entire arrays. - [resultJSON setValue:newValue forKey:key]; - } - } else { - // The values are the same; omit this key-value pair - } - } - - // Iterate through keys present only in the new object, and add them to the - // result - NSMutableArray *newKeys = [NSMutableArray arrayWithArray:[newJSON allKeys]]; - [newKeys removeObjectsInArray:originalKeys]; - - for (NSString *key in newKeys) { - id value = [newJSON objectForKey:key]; - [resultJSON setValue:value forKey:key]; - } - return resultJSON; -} - -+ (id)nullValue { - return [NSNull null]; -} - -#pragma mark Additional Properties - -- (id)additionalPropertyForName:(NSString *)name { - // Return the cached object, if any, before creating one. - id result = [self cacheChildForKey:name]; - if (result != nil) { - return result; - } - - Class defaultClass = [[self class] classForAdditionalProperties]; - id jsonObj = [self JSONValueForKey:name]; - BOOL shouldCache = NO; - if (jsonObj != nil) { - NSDictionary *surrogates = self.surrogates; - result = [GTLRuntimeCommon objectFromJSON:jsonObj - defaultClass:defaultClass - surrogates:surrogates - isCacheable:&shouldCache]; - } - - [self setCacheChild:(shouldCache ? result : nil) - forKey:name]; - return result; -} - -- (void)setAdditionalProperty:(id)obj forName:(NSString *)name { - BOOL shouldCache = NO; - Class defaultClass = [[self class] classForAdditionalProperties]; - id json = [GTLRuntimeCommon jsonFromAPIObject:obj - expectedClass:defaultClass - isCacheable:&shouldCache]; - [self setJSONValue:json forKey:name]; - [self setCacheChild:(shouldCache ? obj : nil) - forKey:name]; -} - -- (NSDictionary *)additionalProperties { - NSMutableDictionary *result = [NSMutableDictionary dictionary]; - - NSArray *propertyNames = [self additionalJSONKeys]; - for (NSString *name in propertyNames) { - id obj = [self additionalPropertyForName:name]; - [result setObject:obj forKey:name]; - } - - return result; -} - -#pragma mark Child Cache methods - -// There is no property for childCache_ as there shouldn't be KVC/KVO -// support for it, it's an implementation detail. - -- (void)setCacheChild:(id)obj forKey:(NSString *)key { - if (childCache_ == nil && obj != nil) { - childCache_ = [[NSMutableDictionary alloc] initWithObjectsAndKeys: - obj, key, nil]; - } else { - [childCache_ setValue:obj forKey:key]; - } -} - -- (id)cacheChildForKey:(NSString *)key { - id obj = [childCache_ objectForKey:key]; - return obj; -} - -#pragma mark userData and user properties - -- (void)setUserData:(id)userData { - [self setProperty:userData forKey:kUserDataPropertyKey]; -} - -- (id)userData { - // be sure the returned pointer has the life of the autorelease pool, - // in case self is released immediately - return [[[self propertyForKey:kUserDataPropertyKey] retain] autorelease]; -} - -- (void)setProperty:(id)obj forKey:(NSString *)key { - if (obj == nil) { - // user passed in nil, so delete the property - [userProperties_ removeObjectForKey:key]; - } else { - // be sure the property dictionary exists - if (userProperties_ == nil) { - self.userProperties = [NSMutableDictionary dictionary]; - } - [userProperties_ setObject:obj forKey:key]; - } -} - -- (id)propertyForKey:(NSString *)key { - id obj = [userProperties_ objectForKey:key]; - - // be sure the returned pointer has the life of the autorelease pool, - // in case self is released immediately - return [[obj retain] autorelease]; -} - -#pragma mark Support methods - -+ (NSMutableArray *)allDeclaredProperties { - NSMutableArray *array = [NSMutableArray array]; - - // walk from this class up the hierarchy to GTLObject - Class topClass = class_getSuperclass([GTLObject class]); - for (Class currClass = self; - currClass != topClass; - currClass = class_getSuperclass(currClass)) { - // step through this class's properties, and add the property names to the - // array - objc_property_t *properties = class_copyPropertyList(currClass, NULL); - if (properties) { - for (objc_property_t *prop = properties; - *prop != NULL; - ++prop) { - const char *propName = property_getName(*prop); - // We only want dynamic properties; their attributes contain ",D". - const char *attr = property_getAttributes(*prop); - const char *dynamicMarker = strstr(attr, ",D"); - if (dynamicMarker && - (dynamicMarker[2] == 0 || dynamicMarker[2] == ',' )) { - [array addObject:[NSString stringWithUTF8String:propName]]; - } - } - free(properties); - } - } - return array; -} - -+ (NSArray *)allKnownKeys { - NSArray *allProps = [self allDeclaredProperties]; - NSMutableArray *knownKeys = [NSMutableArray arrayWithArray:allProps]; - - NSDictionary *propMap = [GTLObject propertyToJSONKeyMapForClass:[self class]]; - - NSUInteger idx = 0; - for (NSString *propName in allProps) { - NSString *jsonKey = [propMap objectForKey:propName]; - if (jsonKey) { - [knownKeys replaceObjectAtIndex:idx - withObject:jsonKey]; - } - ++idx; - } - return knownKeys; -} - -- (NSString *)description { - // find the list of declared and otherwise known JSON keys for this class - NSArray *knownKeys = [[self class] allKnownKeys]; - - NSMutableString *descStr = [NSMutableString string]; - - NSString *spacer = @""; - for (NSString *key in json_) { - NSString *value = nil; - // show question mark for JSON keys not supported by a declared property: - // foo?:"Hi mom." - NSString *qmark = [knownKeys containsObject:key] ? @"" : @"?"; - - // determine property value to dislay - id rawValue = [json_ valueForKey:key]; - if ([rawValue isKindOfClass:[NSDictionary class]]) { - // for dictionaries, show the list of keys: - // {key1,key2,key3} - NSString *subkeyList = [[rawValue allKeys] componentsJoinedByString:@","]; - value = [NSString stringWithFormat:@"{%@}", subkeyList]; - } else if ([rawValue isKindOfClass:[NSArray class]]) { - // for arrays, show the number of items in the array: - // [3] - value = [NSString stringWithFormat:@"[%lu]", (unsigned long)[(NSArray *)rawValue count]]; - } else if ([rawValue isKindOfClass:[NSString class]]) { - // for strings, show the string in quotes: - // "Hi mom." - value = [NSString stringWithFormat:@"\"%@\"", rawValue]; - } else { - // for numbers, show just the number - value = [rawValue description]; - } - [descStr appendFormat:@"%@%@%@:%@", spacer, key, qmark, value]; - spacer = @" "; - } - - NSString *str = [NSString stringWithFormat:@"%@ %p: {%@}", - [self class], self, descStr]; - return str; -} - -#pragma mark Class Registration - -static NSMutableDictionary *gKindMap = nil; - -+ (Class)registeredObjectClassForKind:(NSString *)kind { - Class resultClass = [gKindMap objectForKey:kind]; - return resultClass; -} - -+ (void)registerObjectClassForKind:(NSString *)kind { - // there's no autorelease pool in place at +load time, so we'll create our own - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - if (gKindMap == nil) { - gKindMap = [GTLUtilities newStaticDictionary]; - } - - Class selfClass = [self class]; - -#if DEBUG - // ensure this is a unique registration - if ([gKindMap objectForKey:kind] != nil ) { - GTL_DEBUG_LOG(@"%@ (%@) registration conflicts with %@", - selfClass, kind, [gKindMap objectForKey:kind]); - } - if ([[gKindMap allKeysForObject:selfClass] count] != 0) { - GTL_DEBUG_LOG(@"%@ (%@) registration conflicts with %@", - selfClass, kind, [gKindMap allKeysForObject:selfClass]); - } -#endif - - [gKindMap setValue:selfClass forKey:kind]; - - // we drain here to keep the clang static analyzer quiet - [pool drain]; -} - -#pragma mark Object Instantiation - -+ (GTLObject *)objectForJSON:(NSMutableDictionary *)json - defaultClass:(Class)defaultClass - surrogates:(NSDictionary *)surrogates - batchClassMap:(NSDictionary *)batchClassMap { - if ([json count] == 0 || [json isEqual:[NSNull null]]) { - // no actual result, such as the response from a delete - return nil; - } - - // Determine the class to instantiate, based on the original fetch - // request or by looking up "kind" string from the registration at - // +load time of GTLObject subclasses - // - // We're letting the dynamic kind override the default class so - // feeds of heterogenous entries can use the defaultClass as a - // fallback - Class classToCreate = defaultClass; - NSString *kind = nil; - if ([json isKindOfClass:[NSDictionary class]]) { - kind = [json valueForKey:@"kind"]; - if ([kind isKindOfClass:[NSString class]] && [kind length] > 0) { - Class dynamicClass = [GTLObject registeredObjectClassForKind:kind]; - if (dynamicClass) { - classToCreate = dynamicClass; - } - } - } - - // Warn the developer that no specific class of GTLObject - // was requested with the fetch call, and no class is found - // compiled in to match the "kind" attribute of the JSON - // returned by the server - GTL_ASSERT(classToCreate != nil, - @"Could not find registered GTLObject subclass to " - "match JSON with kind \"%@\"", kind); - - if (classToCreate == nil) { - classToCreate = [self class]; - } - - // See if the top-level class for the JSON is listed in the surrogates; - // if so, instantiate the surrogate class instead - Class baseSurrogate = [surrogates objectForKey:classToCreate]; - if (baseSurrogate) { - classToCreate = baseSurrogate; - } - - // now instantiate the GTLObject - GTLObject *parsedObject = [classToCreate object]; - - parsedObject.surrogates = surrogates; - parsedObject.JSON = json; - - // it's time to instantiate inner items - if ([parsedObject conformsToProtocol:@protocol(GTLBatchItemCreationProtocol)]) { - id batch = - (id ) parsedObject; - [batch createItemsWithClassMap:batchClassMap]; - } - - return parsedObject; -} - -#pragma mark Runtime Utilities - -static NSMutableDictionary *gJSONKeyMapCache = nil; -static NSMutableDictionary *gArrayPropertyToClassMapCache = nil; - -+ (void)initialize { - // Note that initialize is guaranteed by the runtime to be called in a - // thread-safe manner - if (gJSONKeyMapCache == nil) { - gJSONKeyMapCache = [GTLUtilities newStaticDictionary]; - } - if (gArrayPropertyToClassMapCache == nil) { - gArrayPropertyToClassMapCache = [GTLUtilities newStaticDictionary]; - } -} - -+ (NSDictionary *)propertyToJSONKeyMapForClass:(Class)aClass { - NSDictionary *resultMap = - [GTLUtilities mergedClassDictionaryForSelector:@selector(propertyToJSONKeyMap) - startClass:aClass - ancestorClass:[GTLObject class] - cache:gJSONKeyMapCache]; - return resultMap; -} - -+ (NSDictionary *)arrayPropertyToClassMapForClass:(Class)aClass { - NSDictionary *resultMap = - [GTLUtilities mergedClassDictionaryForSelector:@selector(arrayPropertyToClassMap) - startClass:aClass - ancestorClass:[GTLObject class] - cache:gArrayPropertyToClassMapCache]; - return resultMap; -} - -#pragma mark Runtime Support - -+ (Class)ancestorClass { - return [GTLObject class]; -} - -+ (BOOL)resolveInstanceMethod:(SEL)sel { - BOOL resolved = [GTLRuntimeCommon resolveInstanceMethod:sel onClass:self]; - if (resolved) - return YES; - - return [super resolveInstanceMethod:sel]; -} - -@end - -@implementation GTLCollectionObject -// Subclasses must implement the items method dynamically. - -- (void)dealloc { - [identifierMap_ release]; - [super dealloc]; -} - -- (id)itemAtIndex:(NSUInteger)idx { - NSArray *items = [self performSelector:@selector(items)]; - if (idx < [items count]) { - return [items objectAtIndex:idx]; - } - return nil; -} - -- (id)objectAtIndexedSubscript:(NSInteger)idx { - if (idx >= 0) { - return [self itemAtIndex:(NSUInteger)idx]; - } - return nil; -} - -- (id)itemForIdentifier:(NSString *)key { - if (identifierMap_ == nil) { - NSArray *items = [self performSelector:@selector(items)]; - NSMutableDictionary *dict = - [NSMutableDictionary dictionaryWithCapacity:[items count]]; - for (id item in items) { - id identifier = [item valueForKey:@"identifier"]; - if (identifier != nil && identifier != [NSNull null]) { - if ([dict objectForKey:identifier] == nil) { - [dict setObject:item forKey:identifier]; - } - } - } - identifierMap_ = [dict copy]; - } - return [identifierMap_ objectForKey:key]; -} - -- (void)resetIdentifierMap { - [identifierMap_ release]; - identifierMap_ = nil; -} - -// NSFastEnumeration protocol -- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state - objects:(id *)stackbuf - count:(NSUInteger)len { - NSArray *items = [self performSelector:@selector(items)]; - NSUInteger result = [items countByEnumeratingWithState:state - objects:stackbuf - count:len]; - return result; -} - -@end - -@implementation GTLResultArray - -- (NSArray *)itemsWithItemClass:(Class)itemClass { - // Return the cached array before creating on demand. - NSString *cacheKey = @"result_array_items"; - NSMutableArray *cachedArray = [self cacheChildForKey:cacheKey]; - if (cachedArray != nil) { - return cachedArray; - } - NSArray *result = nil; - NSArray *array = (NSArray *)[self JSON]; - if (array != nil) { - if ([array isKindOfClass:[NSArray class]]) { - NSDictionary *surrogates = self.surrogates; - result = [GTLRuntimeCommon objectFromJSON:array - defaultClass:itemClass - surrogates:surrogates - isCacheable:NULL]; - } else { -#if DEBUG - if (![array isKindOfClass:[NSNull class]]) { - GTL_DEBUG_LOG(@"GTLObject: unexpected JSON: %@ should be an array, actually is a %@:\n%@", - NSStringFromClass([self class]), - NSStringFromClass([array class]), - array); - } -#endif - result = array; - } - } - - [self setCacheChild:result forKey:cacheKey]; - return result; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlus.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlus.h deleted file mode 100644 index 220410bb..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlus.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlus.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ - -#import "GTLPlusConstants.h" - -#import "GTLPlusAcl.h" -#import "GTLPlusAclentryResource.h" -#import "GTLPlusActivity.h" -#import "GTLPlusActivityFeed.h" -#import "GTLPlusComment.h" -#import "GTLPlusCommentFeed.h" -#import "GTLPlusItemScope.h" -#import "GTLPlusMoment.h" -#import "GTLPlusMomentsFeed.h" -#import "GTLPlusPeopleFeed.h" -#import "GTLPlusPerson.h" - -#import "GTLQueryPlus.h" -#import "GTLServicePlus.h" diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusAcl.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusAcl.h deleted file mode 100644 index aad4f65e..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusAcl.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusAcl.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusAcl (0 custom class methods, 3 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusAclentryResource; - -// ---------------------------------------------------------------------------- -// -// GTLPlusAcl -// - -// This class supports NSFastEnumeration over its "items" property. It also -// supports -itemAtIndex: to retrieve individual objects from "items". - -@interface GTLPlusAcl : GTLCollectionObject - -// Description of the access granted, suitable for display. -// Remapped to 'descriptionProperty' to avoid NSObject's 'description'. -@property (copy) NSString *descriptionProperty; - -// The list of access entries. -@property (retain) NSArray *items; // of GTLPlusAclentryResource - -// Identifies this resource as a collection of access controls. Value: -// "plus#acl". -@property (copy) NSString *kind; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusAcl.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusAcl.m deleted file mode 100644 index 0e82d087..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusAcl.m +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusAcl.m -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusAcl (0 custom class methods, 3 custom properties) - -#import "GTLPlusAcl.h" - -#import "GTLPlusAclentryResource.h" - -// ---------------------------------------------------------------------------- -// -// GTLPlusAcl -// - -@implementation GTLPlusAcl -@dynamic descriptionProperty, items, kind; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:@"description" - forKey:@"descriptionProperty"]; - return map; -} - -+ (NSDictionary *)arrayPropertyToClassMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:[GTLPlusAclentryResource class] - forKey:@"items"]; - return map; -} - -+ (void)load { - [self registerObjectClassForKind:@"plus#acl"]; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusAclentryResource.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusAclentryResource.h deleted file mode 100644 index 30634e8d..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusAclentryResource.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusAclentryResource.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusAclentryResource (0 custom class methods, 3 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -// ---------------------------------------------------------------------------- -// -// GTLPlusAclentryResource -// - -@interface GTLPlusAclentryResource : GTLObject - -// A descriptive name for this entry. Suitable for display. -@property (copy) NSString *displayName; - -// The ID of the entry. For entries of type "person" or "circle", this is the ID -// of the resource. For other types, this property is not set. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The type of entry describing to whom access is granted. Possible values are: -// - "person" - Access to an individual. -// - "circle" - Access to members of a circle. -// - "myCircles" - Access to members of all the person's circles. -// - "extendedCircles" - Access to members of everyone in a person's circles, -// plus all of the people in their circles. -// - "public" - Access to anyone on the web. -@property (copy) NSString *type; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusAclentryResource.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusAclentryResource.m deleted file mode 100644 index ff640290..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusAclentryResource.m +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusAclentryResource.m -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusAclentryResource (0 custom class methods, 3 custom properties) - -#import "GTLPlusAclentryResource.h" - -// ---------------------------------------------------------------------------- -// -// GTLPlusAclentryResource -// - -@implementation GTLPlusAclentryResource -@dynamic displayName, identifier, type; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:@"id" - forKey:@"identifier"]; - return map; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusActivity.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusActivity.h deleted file mode 100644 index ce4b9417..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusActivity.h +++ /dev/null @@ -1,493 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusActivity.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusActivity (0 custom class methods, 19 custom properties) -// GTLPlusActivityActor (0 custom class methods, 5 custom properties) -// GTLPlusActivityObject (0 custom class methods, 10 custom properties) -// GTLPlusActivityProvider (0 custom class methods, 1 custom properties) -// GTLPlusActivityActorImage (0 custom class methods, 1 custom properties) -// GTLPlusActivityActorName (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectActor (0 custom class methods, 4 custom properties) -// GTLPlusActivityObjectAttachmentsItem (0 custom class methods, 9 custom properties) -// GTLPlusActivityObjectPlusoners (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectReplies (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectResharers (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectActorImage (0 custom class methods, 1 custom properties) -// GTLPlusActivityObjectAttachmentsItemEmbed (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectAttachmentsItemFullImage (0 custom class methods, 4 custom properties) -// GTLPlusActivityObjectAttachmentsItemImage (0 custom class methods, 4 custom properties) -// GTLPlusActivityObjectAttachmentsItemThumbnailsItem (0 custom class methods, 3 custom properties) -// GTLPlusActivityObjectAttachmentsItemThumbnailsItemImage (0 custom class methods, 4 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusAcl; -@class GTLPlusActivityActor; -@class GTLPlusActivityActorImage; -@class GTLPlusActivityActorName; -@class GTLPlusActivityObject; -@class GTLPlusActivityObjectActor; -@class GTLPlusActivityObjectActorImage; -@class GTLPlusActivityObjectAttachmentsItem; -@class GTLPlusActivityObjectAttachmentsItemEmbed; -@class GTLPlusActivityObjectAttachmentsItemFullImage; -@class GTLPlusActivityObjectAttachmentsItemImage; -@class GTLPlusActivityObjectAttachmentsItemThumbnailsItem; -@class GTLPlusActivityObjectAttachmentsItemThumbnailsItemImage; -@class GTLPlusActivityObjectPlusoners; -@class GTLPlusActivityObjectReplies; -@class GTLPlusActivityObjectResharers; -@class GTLPlusActivityProvider; - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivity -// - -@interface GTLPlusActivity : GTLObject - -// Identifies who has access to see this activity. -@property (retain) GTLPlusAcl *access; - -// The person who performed this activity. -@property (retain) GTLPlusActivityActor *actor; - -// Street address where this activity occurred. -@property (copy) NSString *address; - -// Additional content added by the person who shared this activity, applicable -// only when resharing an activity. -@property (copy) NSString *annotation; - -// If this activity is a crosspost from another system, this property specifies -// the ID of the original activity. -@property (copy) NSString *crosspostSource; - -// ETag of this response for caching purposes. -@property (copy) NSString *ETag; - -// Latitude and longitude where this activity occurred. Format is latitude -// followed by longitude, space separated. -@property (copy) NSString *geocode; - -// The ID of this activity. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// Identifies this resource as an activity. Value: "plus#activity". -@property (copy) NSString *kind; - -// The object of this activity. -@property (retain) GTLPlusActivityObject *object; - -// ID of the place where this activity occurred. -@property (copy) NSString *placeId; - -// Name of the place where this activity occurred. -@property (copy) NSString *placeName; - -// The service provider that initially published this activity. -@property (retain) GTLPlusActivityProvider *provider; - -// The time at which this activity was initially published. Formatted as an RFC -// 3339 timestamp. -@property (retain) GTLDateTime *published; - -// Radius, in meters, of the region where this activity occurred, centered at -// the latitude and longitude identified in geocode. -@property (copy) NSString *radius; - -// Title of this activity. -@property (copy) NSString *title; - -// The time at which this activity was last updated. Formatted as an RFC 3339 -// timestamp. -@property (retain) GTLDateTime *updated; - -// The link to this activity. -@property (copy) NSString *url; - -// This activity's verb, indicating what action was performed. Possible values -// are: -// - "post" - Publish content to the stream. -// - "share" - Reshare an activity. -@property (copy) NSString *verb; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityActor -// - -@interface GTLPlusActivityActor : GTLObject - -// The name of the actor, suitable for display. -@property (copy) NSString *displayName; - -// The ID of the actor's person resource. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The image representation of the actor. -@property (retain) GTLPlusActivityActorImage *image; - -// An object representation of the individual components of name. -@property (retain) GTLPlusActivityActorName *name; - -// The link to the actor's Google profile. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObject -// - -@interface GTLPlusActivityObject : GTLObject - -// If this activity's object is itself another activity (for example, when a -// person reshares an activity), this property specifies the original activity's -// actor. -@property (retain) GTLPlusActivityObjectActor *actor; - -// The media objects attached to this activity. -@property (retain) NSArray *attachments; // of GTLPlusActivityObjectAttachmentsItem - -// The HTML-formatted content, suitable for display. -@property (copy) NSString *content; - -// The ID of the object. When resharing an activity, this is the ID of the -// activity being reshared. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The type of the object. Possible values are: -// - "note" - Textual content. -// - "activity" - A Google+ activity. -@property (copy) NSString *objectType; - -// The content (text) as provided by the author, stored without any HTML -// formatting. When creating or updating an activity, this value must be -// supplied as plain text in the request. -@property (copy) NSString *originalContent; - -// People who +1'd this activity. -@property (retain) GTLPlusActivityObjectPlusoners *plusoners; - -// Comments in reply to this activity. -@property (retain) GTLPlusActivityObjectReplies *replies; - -// People who reshared this activity. -@property (retain) GTLPlusActivityObjectResharers *resharers; - -// The URL that points to the linked resource. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityProvider -// - -@interface GTLPlusActivityProvider : GTLObject - -// Name of the service provider. -@property (copy) NSString *title; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityActorImage -// - -@interface GTLPlusActivityActorImage : GTLObject - -// The URL of the actor's profile photo. To re-size the image and crop it to a -// square, append the query string ?sz=x, where x is the dimension in pixels of -// each side. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityActorName -// - -@interface GTLPlusActivityActorName : GTLObject - -// The family name (last name) of the actor. -@property (copy) NSString *familyName; - -// The given name (first name) of the actor. -@property (copy) NSString *givenName; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectActor -// - -@interface GTLPlusActivityObjectActor : GTLObject - -// The original actor's name, suitable for display. -@property (copy) NSString *displayName; - -// ID of the original actor. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The image representation of the original actor. -@property (retain) GTLPlusActivityObjectActorImage *image; - -// A link to the original actor's Google profile. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItem -// - -@interface GTLPlusActivityObjectAttachmentsItem : GTLObject - -// If the attachment is an article, this property contains a snippet of text -// from the article. It can also include descriptions for other types. -@property (copy) NSString *content; - -// The title of the attachment (such as a photo caption or an article title). -@property (copy) NSString *displayName; - -// If the attachment is a video, the embeddable link. -@property (retain) GTLPlusActivityObjectAttachmentsItemEmbed *embed; - -// The full image URL for photo attachments. -@property (retain) GTLPlusActivityObjectAttachmentsItemFullImage *fullImage; - -// The ID of the attachment. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The preview image for photos or videos. -@property (retain) GTLPlusActivityObjectAttachmentsItemImage *image; - -// The type of media object. Possible values are: -// - "photo" - A photo. -// - "album" - A photo album. -// - "video" - A video. -// - "article" - An article, specified by a link. -@property (copy) NSString *objectType; - -// If the attachment is an album, potential additional thumbnails from the -// album. -@property (retain) NSArray *thumbnails; // of GTLPlusActivityObjectAttachmentsItemThumbnailsItem - -// The link to the attachment, should be of type text/html. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectPlusoners -// - -@interface GTLPlusActivityObjectPlusoners : GTLObject - -// The URL for the collection of people who +1'd this activity. -@property (copy) NSString *selfLink; - -// Total number of people who +1'd this activity. -@property (retain) NSNumber *totalItems; // unsignedIntValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectReplies -// - -@interface GTLPlusActivityObjectReplies : GTLObject - -// The URL for the collection of comments in reply to this activity. -@property (copy) NSString *selfLink; - -// Total number of comments on this activity. -@property (retain) NSNumber *totalItems; // unsignedIntValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectResharers -// - -@interface GTLPlusActivityObjectResharers : GTLObject - -// The URL for the collection of resharers. -@property (copy) NSString *selfLink; - -// Total number of people who reshared this activity. -@property (retain) NSNumber *totalItems; // unsignedIntValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectActorImage -// - -@interface GTLPlusActivityObjectActorImage : GTLObject - -// A URL that points to a thumbnail photo of the original actor. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemEmbed -// - -@interface GTLPlusActivityObjectAttachmentsItemEmbed : GTLObject - -// Media type of the link. -@property (copy) NSString *type; - -// URL of the link. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemFullImage -// - -@interface GTLPlusActivityObjectAttachmentsItemFullImage : GTLObject - -// The height, in pixels, of the linked resource. -@property (retain) NSNumber *height; // unsignedIntValue - -// Media type of the link. -@property (copy) NSString *type; - -// URL to the image. -@property (copy) NSString *url; - -// The width, in pixels, of the linked resource. -@property (retain) NSNumber *width; // unsignedIntValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemImage -// - -@interface GTLPlusActivityObjectAttachmentsItemImage : GTLObject - -// The height, in pixels, of the linked resource. -@property (retain) NSNumber *height; // unsignedIntValue - -// Media type of the link. -@property (copy) NSString *type; - -// Image url. -@property (copy) NSString *url; - -// The width, in pixels, of the linked resource. -@property (retain) NSNumber *width; // unsignedIntValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemThumbnailsItem -// - -@interface GTLPlusActivityObjectAttachmentsItemThumbnailsItem : GTLObject - -// Potential name of the thumbnail. -// Remapped to 'descriptionProperty' to avoid NSObject's 'description'. -@property (copy) NSString *descriptionProperty; - -// Image resource. -@property (retain) GTLPlusActivityObjectAttachmentsItemThumbnailsItemImage *image; - -// URL to the webpage containing the image. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemThumbnailsItemImage -// - -@interface GTLPlusActivityObjectAttachmentsItemThumbnailsItemImage : GTLObject - -// The height, in pixels, of the linked resource. -@property (retain) NSNumber *height; // unsignedIntValue - -// Media type of the link. -@property (copy) NSString *type; - -// Image url. -@property (copy) NSString *url; - -// The width, in pixels, of the linked resource. -@property (retain) NSNumber *width; // unsignedIntValue - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusActivity.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusActivity.m deleted file mode 100644 index 4d70f017..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusActivity.m +++ /dev/null @@ -1,290 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusActivity.m -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusActivity (0 custom class methods, 19 custom properties) -// GTLPlusActivityActor (0 custom class methods, 5 custom properties) -// GTLPlusActivityObject (0 custom class methods, 10 custom properties) -// GTLPlusActivityProvider (0 custom class methods, 1 custom properties) -// GTLPlusActivityActorImage (0 custom class methods, 1 custom properties) -// GTLPlusActivityActorName (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectActor (0 custom class methods, 4 custom properties) -// GTLPlusActivityObjectAttachmentsItem (0 custom class methods, 9 custom properties) -// GTLPlusActivityObjectPlusoners (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectReplies (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectResharers (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectActorImage (0 custom class methods, 1 custom properties) -// GTLPlusActivityObjectAttachmentsItemEmbed (0 custom class methods, 2 custom properties) -// GTLPlusActivityObjectAttachmentsItemFullImage (0 custom class methods, 4 custom properties) -// GTLPlusActivityObjectAttachmentsItemImage (0 custom class methods, 4 custom properties) -// GTLPlusActivityObjectAttachmentsItemThumbnailsItem (0 custom class methods, 3 custom properties) -// GTLPlusActivityObjectAttachmentsItemThumbnailsItemImage (0 custom class methods, 4 custom properties) - -#import "GTLPlusActivity.h" - -#import "GTLPlusAcl.h" - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivity -// - -@implementation GTLPlusActivity -@dynamic access, actor, address, annotation, crosspostSource, ETag, geocode, - identifier, kind, object, placeId, placeName, provider, published, - radius, title, updated, url, verb; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObjectsAndKeys: - @"etag", @"ETag", - @"id", @"identifier", - nil]; - return map; -} - -+ (void)load { - [self registerObjectClassForKind:@"plus#activity"]; -} - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityActor -// - -@implementation GTLPlusActivityActor -@dynamic displayName, identifier, image, name, url; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:@"id" - forKey:@"identifier"]; - return map; -} - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObject -// - -@implementation GTLPlusActivityObject -@dynamic actor, attachments, content, identifier, objectType, originalContent, - plusoners, replies, resharers, url; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:@"id" - forKey:@"identifier"]; - return map; -} - -+ (NSDictionary *)arrayPropertyToClassMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:[GTLPlusActivityObjectAttachmentsItem class] - forKey:@"attachments"]; - return map; -} - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityProvider -// - -@implementation GTLPlusActivityProvider -@dynamic title; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityActorImage -// - -@implementation GTLPlusActivityActorImage -@dynamic url; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityActorName -// - -@implementation GTLPlusActivityActorName -@dynamic familyName, givenName; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectActor -// - -@implementation GTLPlusActivityObjectActor -@dynamic displayName, identifier, image, url; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:@"id" - forKey:@"identifier"]; - return map; -} - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItem -// - -@implementation GTLPlusActivityObjectAttachmentsItem -@dynamic content, displayName, embed, fullImage, identifier, image, objectType, - thumbnails, url; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:@"id" - forKey:@"identifier"]; - return map; -} - -+ (NSDictionary *)arrayPropertyToClassMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:[GTLPlusActivityObjectAttachmentsItemThumbnailsItem class] - forKey:@"thumbnails"]; - return map; -} - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectPlusoners -// - -@implementation GTLPlusActivityObjectPlusoners -@dynamic selfLink, totalItems; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectReplies -// - -@implementation GTLPlusActivityObjectReplies -@dynamic selfLink, totalItems; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectResharers -// - -@implementation GTLPlusActivityObjectResharers -@dynamic selfLink, totalItems; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectActorImage -// - -@implementation GTLPlusActivityObjectActorImage -@dynamic url; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemEmbed -// - -@implementation GTLPlusActivityObjectAttachmentsItemEmbed -@dynamic type, url; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemFullImage -// - -@implementation GTLPlusActivityObjectAttachmentsItemFullImage -@dynamic height, type, url, width; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemImage -// - -@implementation GTLPlusActivityObjectAttachmentsItemImage -@dynamic height, type, url, width; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemThumbnailsItem -// - -@implementation GTLPlusActivityObjectAttachmentsItemThumbnailsItem -@dynamic descriptionProperty, image, url; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:@"description" - forKey:@"descriptionProperty"]; - return map; -} - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityObjectAttachmentsItemThumbnailsItemImage -// - -@implementation GTLPlusActivityObjectAttachmentsItemThumbnailsItemImage -@dynamic height, type, url, width; -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusActivityFeed.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusActivityFeed.h deleted file mode 100644 index f99ca32f..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusActivityFeed.h +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusActivityFeed.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusActivityFeed (0 custom class methods, 9 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusActivity; - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityFeed -// - -// This class supports NSFastEnumeration over its "items" property. It also -// supports -itemAtIndex: to retrieve individual objects from "items". - -@interface GTLPlusActivityFeed : GTLCollectionObject - -// ETag of this response for caching purposes. -@property (copy) NSString *ETag; - -// The ID of this collection of activities. Deprecated. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The activities in this page of results. -@property (retain) NSArray *items; // of GTLPlusActivity - -// Identifies this resource as a collection of activities. Value: -// "plus#activityFeed". -@property (copy) NSString *kind; - -// Link to the next page of activities. -@property (copy) NSString *nextLink; - -// The continuation token, which is used to page through large result sets. -// Provide this value in a subsequent request to return the next page of -// results. -@property (copy) NSString *nextPageToken; - -// Link to this activity resource. -@property (copy) NSString *selfLink; - -// The title of this collection of activities. -@property (copy) NSString *title; - -// The time at which this collection of activities was last updated. Formatted -// as an RFC 3339 timestamp. -@property (retain) GTLDateTime *updated; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusActivityFeed.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusActivityFeed.m deleted file mode 100644 index a3a34e48..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusActivityFeed.m +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusActivityFeed.m -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusActivityFeed (0 custom class methods, 9 custom properties) - -#import "GTLPlusActivityFeed.h" - -#import "GTLPlusActivity.h" - -// ---------------------------------------------------------------------------- -// -// GTLPlusActivityFeed -// - -@implementation GTLPlusActivityFeed -@dynamic ETag, identifier, items, kind, nextLink, nextPageToken, selfLink, - title, updated; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObjectsAndKeys: - @"etag", @"ETag", - @"id", @"identifier", - nil]; - return map; -} - -+ (NSDictionary *)arrayPropertyToClassMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:[GTLPlusActivity class] - forKey:@"items"]; - return map; -} - -+ (void)load { - [self registerObjectClassForKind:@"plus#activityFeed"]; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusComment.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusComment.h deleted file mode 100644 index 4698576a..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusComment.h +++ /dev/null @@ -1,183 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusComment.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusComment (0 custom class methods, 11 custom properties) -// GTLPlusCommentActor (0 custom class methods, 4 custom properties) -// GTLPlusCommentInReplyToItem (0 custom class methods, 2 custom properties) -// GTLPlusCommentObject (0 custom class methods, 3 custom properties) -// GTLPlusCommentPlusoners (0 custom class methods, 1 custom properties) -// GTLPlusCommentActorImage (0 custom class methods, 1 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusCommentActor; -@class GTLPlusCommentActorImage; -@class GTLPlusCommentInReplyToItem; -@class GTLPlusCommentObject; -@class GTLPlusCommentPlusoners; - -// ---------------------------------------------------------------------------- -// -// GTLPlusComment -// - -@interface GTLPlusComment : GTLObject - -// The person who posted this comment. -@property (retain) GTLPlusCommentActor *actor; - -// ETag of this response for caching purposes. -@property (copy) NSString *ETag; - -// The ID of this comment. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The activity this comment replied to. -@property (retain) NSArray *inReplyTo; // of GTLPlusCommentInReplyToItem - -// Identifies this resource as a comment. Value: "plus#comment". -@property (copy) NSString *kind; - -// The object of this comment. -@property (retain) GTLPlusCommentObject *object; - -// People who +1'd this comment. -@property (retain) GTLPlusCommentPlusoners *plusoners; - -// The time at which this comment was initially published. Formatted as an RFC -// 3339 timestamp. -@property (retain) GTLDateTime *published; - -// Link to this comment resource. -@property (copy) NSString *selfLink; - -// The time at which this comment was last updated. Formatted as an RFC 3339 -// timestamp. -@property (retain) GTLDateTime *updated; - -// This comment's verb, indicating what action was performed. Possible values -// are: -// - "post" - Publish content to the stream. -@property (copy) NSString *verb; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentActor -// - -@interface GTLPlusCommentActor : GTLObject - -// The name of this actor, suitable for display. -@property (copy) NSString *displayName; - -// The ID of the actor. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The image representation of this actor. -@property (retain) GTLPlusCommentActorImage *image; - -// A link to the person resource for this actor. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentInReplyToItem -// - -@interface GTLPlusCommentInReplyToItem : GTLObject - -// The ID of the activity. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The URL of the activity. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentObject -// - -@interface GTLPlusCommentObject : GTLObject - -// The HTML-formatted content, suitable for display. -@property (copy) NSString *content; - -// The object type of this comment. Possible values are: -// - "comment" - A comment in reply to an activity. -@property (copy) NSString *objectType; - -// The content (text) as provided by the author, stored without any HTML -// formatting. When creating or updating a comment, this value must be supplied -// as plain text in the request. -@property (copy) NSString *originalContent; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentPlusoners -// - -@interface GTLPlusCommentPlusoners : GTLObject - -// Total number of people who +1'd this comment. -@property (retain) NSNumber *totalItems; // unsignedIntValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentActorImage -// - -@interface GTLPlusCommentActorImage : GTLObject - -// The URL of the actor's profile photo. To re-size the image and crop it to a -// square, append the query string ?sz=x, where x is the dimension in pixels of -// each side. -@property (copy) NSString *url; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusComment.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusComment.m deleted file mode 100644 index 3abaa26d..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusComment.m +++ /dev/null @@ -1,133 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusComment.m -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusComment (0 custom class methods, 11 custom properties) -// GTLPlusCommentActor (0 custom class methods, 4 custom properties) -// GTLPlusCommentInReplyToItem (0 custom class methods, 2 custom properties) -// GTLPlusCommentObject (0 custom class methods, 3 custom properties) -// GTLPlusCommentPlusoners (0 custom class methods, 1 custom properties) -// GTLPlusCommentActorImage (0 custom class methods, 1 custom properties) - -#import "GTLPlusComment.h" - -// ---------------------------------------------------------------------------- -// -// GTLPlusComment -// - -@implementation GTLPlusComment -@dynamic actor, ETag, identifier, inReplyTo, kind, object, plusoners, published, - selfLink, updated, verb; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObjectsAndKeys: - @"etag", @"ETag", - @"id", @"identifier", - nil]; - return map; -} - -+ (NSDictionary *)arrayPropertyToClassMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:[GTLPlusCommentInReplyToItem class] - forKey:@"inReplyTo"]; - return map; -} - -+ (void)load { - [self registerObjectClassForKind:@"plus#comment"]; -} - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentActor -// - -@implementation GTLPlusCommentActor -@dynamic displayName, identifier, image, url; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:@"id" - forKey:@"identifier"]; - return map; -} - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentInReplyToItem -// - -@implementation GTLPlusCommentInReplyToItem -@dynamic identifier, url; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:@"id" - forKey:@"identifier"]; - return map; -} - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentObject -// - -@implementation GTLPlusCommentObject -@dynamic content, objectType, originalContent; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentPlusoners -// - -@implementation GTLPlusCommentPlusoners -@dynamic totalItems; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentActorImage -// - -@implementation GTLPlusCommentActorImage -@dynamic url; -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusCommentFeed.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusCommentFeed.h deleted file mode 100644 index 74f9be5a..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusCommentFeed.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusCommentFeed.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusCommentFeed (0 custom class methods, 8 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusComment; - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentFeed -// - -// This class supports NSFastEnumeration over its "items" property. It also -// supports -itemAtIndex: to retrieve individual objects from "items". - -@interface GTLPlusCommentFeed : GTLCollectionObject - -// ETag of this response for caching purposes. -@property (copy) NSString *ETag; - -// The ID of this collection of comments. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The comments in this page of results. -@property (retain) NSArray *items; // of GTLPlusComment - -// Identifies this resource as a collection of comments. Value: -// "plus#commentFeed". -@property (copy) NSString *kind; - -// Link to the next page of activities. -@property (copy) NSString *nextLink; - -// The continuation token, which is used to page through large result sets. -// Provide this value in a subsequent request to return the next page of -// results. -@property (copy) NSString *nextPageToken; - -// The title of this collection of comments. -@property (copy) NSString *title; - -// The time at which this collection of comments was last updated. Formatted as -// an RFC 3339 timestamp. -@property (retain) GTLDateTime *updated; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusCommentFeed.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusCommentFeed.m deleted file mode 100644 index a8d81e6e..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusCommentFeed.m +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusCommentFeed.m -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusCommentFeed (0 custom class methods, 8 custom properties) - -#import "GTLPlusCommentFeed.h" - -#import "GTLPlusComment.h" - -// ---------------------------------------------------------------------------- -// -// GTLPlusCommentFeed -// - -@implementation GTLPlusCommentFeed -@dynamic ETag, identifier, items, kind, nextLink, nextPageToken, title, updated; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObjectsAndKeys: - @"etag", @"ETag", - @"id", @"identifier", - nil]; - return map; -} - -+ (NSDictionary *)arrayPropertyToClassMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:[GTLPlusComment class] - forKey:@"items"]; - return map; -} - -+ (void)load { - [self registerObjectClassForKind:@"plus#commentFeed"]; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusConstants.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusConstants.h deleted file mode 100644 index b5e87ad7..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusConstants.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusConstants.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ - -#import - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLDefines.h" -#else - #import "GTLDefines.h" -#endif - -// Authorization scope -// Know your name, basic info, and list of people you're connected to on Google+ -GTL_EXTERN NSString * const kGTLAuthScopePlusLogin; // "https://www.googleapis.com/auth/plus.login" -// Know who you are on Google -GTL_EXTERN NSString * const kGTLAuthScopePlusMe; // "https://www.googleapis.com/auth/plus.me" - -// Collection -GTL_EXTERN NSString * const kGTLPlusCollectionPlusoners; // "plusoners" -GTL_EXTERN NSString * const kGTLPlusCollectionPublic; // "public" -GTL_EXTERN NSString * const kGTLPlusCollectionResharers; // "resharers" -GTL_EXTERN NSString * const kGTLPlusCollectionVault; // "vault" -GTL_EXTERN NSString * const kGTLPlusCollectionVisible; // "visible" - -// OrderBy -GTL_EXTERN NSString * const kGTLPlusOrderByAlphabetical; // "alphabetical" -GTL_EXTERN NSString * const kGTLPlusOrderByBest; // "best" -GTL_EXTERN NSString * const kGTLPlusOrderByRecent; // "recent" - -// SortOrder -GTL_EXTERN NSString * const kGTLPlusSortOrderAscending; // "ascending" -GTL_EXTERN NSString * const kGTLPlusSortOrderDescending; // "descending" diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusConstants.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusConstants.m deleted file mode 100644 index bb5610ff..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusConstants.m +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusConstants.m -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ - -#import "GTLPlusConstants.h" - -// Authorization scope -NSString * const kGTLAuthScopePlusLogin = @"https://www.googleapis.com/auth/plus.login"; -NSString * const kGTLAuthScopePlusMe = @"https://www.googleapis.com/auth/plus.me"; - -// Collection -NSString * const kGTLPlusCollectionPlusoners = @"plusoners"; -NSString * const kGTLPlusCollectionPublic = @"public"; -NSString * const kGTLPlusCollectionResharers = @"resharers"; -NSString * const kGTLPlusCollectionVault = @"vault"; -NSString * const kGTLPlusCollectionVisible = @"visible"; - -// OrderBy -NSString * const kGTLPlusOrderByAlphabetical = @"alphabetical"; -NSString * const kGTLPlusOrderByBest = @"best"; -NSString * const kGTLPlusOrderByRecent = @"recent"; - -// SortOrder -NSString * const kGTLPlusSortOrderAscending = @"ascending"; -NSString * const kGTLPlusSortOrderDescending = @"descending"; diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusItemScope.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusItemScope.h deleted file mode 100644 index 17e2b371..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusItemScope.h +++ /dev/null @@ -1,225 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusItemScope.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusItemScope (0 custom class methods, 55 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusItemScope; - -// ---------------------------------------------------------------------------- -// -// GTLPlusItemScope -// - -@interface GTLPlusItemScope : GTLObject - -// The subject matter of the content. -@property (retain) GTLPlusItemScope *about; - -// An additional name for a Person, can be used for a middle name. -@property (retain) NSArray *additionalName; // of NSString - -// Postal address. -@property (retain) GTLPlusItemScope *address; - -// Address country. -@property (copy) NSString *addressCountry; - -// Address locality. -@property (copy) NSString *addressLocality; - -// Address region. -@property (copy) NSString *addressRegion; - -// The encoding. -@property (retain) NSArray *associatedMedia; // of GTLPlusItemScope - -// Number of attendees. -@property (retain) NSNumber *attendeeCount; // intValue - -// A person attending the event. -@property (retain) NSArray *attendees; // of GTLPlusItemScope - -// From http://schema.org/MusicRecording, the audio file. -@property (retain) GTLPlusItemScope *audio; - -// The person who created this scope. -@property (retain) NSArray *author; // of GTLPlusItemScope - -// Best possible rating value. -@property (copy) NSString *bestRating; - -// Date of birth. -@property (copy) NSString *birthDate; - -// From http://schema.org/MusicRecording, the artist that performed this -// recording. -@property (retain) GTLPlusItemScope *byArtist; - -// The caption for this object. -@property (copy) NSString *caption; - -// File size in (mega/kilo) bytes. -@property (copy) NSString *contentSize; - -// Actual bytes of the media object, for example the image file or video file. -@property (copy) NSString *contentUrl; - -// The list of contributors for this scope. -@property (retain) NSArray *contributor; // of GTLPlusItemScope - -// The date this scope was created. -@property (copy) NSString *dateCreated; - -// The date this scope was last modified. -@property (copy) NSString *dateModified; - -// The initial date this scope was published. -@property (copy) NSString *datePublished; - -// The string describing the content of this scope. -// Remapped to 'descriptionProperty' to avoid NSObject's 'description'. -@property (copy) NSString *descriptionProperty; - -// The duration of the item (movie, audio recording, event, etc.) in ISO 8601 -// date format. -@property (copy) NSString *duration; - -// A URL pointing to a player for a specific video. In general, this is the -// information in the src element of an embed tag and should not be the same as -// the content of the loc tag. -@property (copy) NSString *embedUrl; - -// The end date and time of the event (in ISO 8601 date format). -@property (copy) NSString *endDate; - -// Family name. In the U.S., the last name of an Person. This can be used along -// with givenName instead of the Name property. -@property (copy) NSString *familyName; - -// Gender of the person. -@property (copy) NSString *gender; - -// Geo coordinates. -@property (retain) GTLPlusItemScope *geo; - -// Given name. In the U.S., the first name of a Person. This can be used along -// with familyName instead of the Name property. -@property (copy) NSString *givenName; - -// The height of the media object. -@property (copy) NSString *height; - -// The id for this item scope. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// A url to the image for this scope. -@property (copy) NSString *image; - -// From http://schema.org/MusicRecording, which album a song is in. -@property (retain) GTLPlusItemScope *inAlbum; - -// Identifies this resource as an itemScope. -@property (copy) NSString *kind; - -// Latitude. -@property (retain) NSNumber *latitude; // doubleValue - -// The location of the event or organization. -@property (retain) GTLPlusItemScope *location; - -// Longitude. -@property (retain) NSNumber *longitude; // doubleValue - -// The name of this scope. -@property (copy) NSString *name; - -// Property of http://schema.org/TVEpisode indicating which series the episode -// belongs to. -@property (retain) GTLPlusItemScope *partOfTVSeries; - -// The main performer or performers of the event-for example, a presenter, -// musician, or actor. -@property (retain) NSArray *performers; // of GTLPlusItemScope - -// Player type required-for example, Flash or Silverlight. -@property (copy) NSString *playerType; - -// Postal code. -@property (copy) NSString *postalCode; - -// Post office box number. -@property (copy) NSString *postOfficeBoxNumber; - -// Rating value. -@property (copy) NSString *ratingValue; - -// Review rating. -@property (retain) GTLPlusItemScope *reviewRating; - -// The start date and time of the event (in ISO 8601 date format). -@property (copy) NSString *startDate; - -// Street address. -@property (copy) NSString *streetAddress; - -// Comment text, review text, etc. -@property (copy) NSString *text; - -// Thumbnail image for an image or video. -@property (retain) GTLPlusItemScope *thumbnail; - -// A url to a thumbnail image for this scope. -@property (copy) NSString *thumbnailUrl; - -// The exchange traded instrument associated with a Corporation object. The -// tickerSymbol is expressed as an exchange and an instrument name separated by -// a space character. For the exchange component of the tickerSymbol attribute, -// we reccommend using the controlled vocaulary of Market Identifier Codes (MIC) -// specified in ISO15022. -@property (copy) NSString *tickerSymbol; - -// The item type. -@property (copy) NSString *type; - -// A URL for the item upon which the action was performed. -@property (copy) NSString *url; - -// The width of the media object. -@property (copy) NSString *width; - -// Worst possible rating value. -@property (copy) NSString *worstRating; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusItemScope.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusItemScope.m deleted file mode 100644 index ee761503..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusItemScope.m +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusItemScope.m -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusItemScope (0 custom class methods, 55 custom properties) - -#import "GTLPlusItemScope.h" - -// ---------------------------------------------------------------------------- -// -// GTLPlusItemScope -// - -@implementation GTLPlusItemScope -@dynamic about, additionalName, address, addressCountry, addressLocality, - addressRegion, associatedMedia, attendeeCount, attendees, audio, - author, bestRating, birthDate, byArtist, caption, contentSize, - contentUrl, contributor, dateCreated, dateModified, datePublished, - descriptionProperty, duration, embedUrl, endDate, familyName, gender, - geo, givenName, height, identifier, image, inAlbum, kind, latitude, - location, longitude, name, partOfTVSeries, performers, playerType, - postalCode, postOfficeBoxNumber, ratingValue, reviewRating, startDate, - streetAddress, text, thumbnail, thumbnailUrl, tickerSymbol, type, url, - width, worstRating; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObjectsAndKeys: - @"associated_media", @"associatedMedia", - @"description", @"descriptionProperty", - @"id", @"identifier", - nil]; - return map; -} - -+ (NSDictionary *)arrayPropertyToClassMap { - NSDictionary *map = - [NSDictionary dictionaryWithObjectsAndKeys: - [NSString class], @"additionalName", - [GTLPlusItemScope class], @"associated_media", - [GTLPlusItemScope class], @"attendees", - [GTLPlusItemScope class], @"author", - [GTLPlusItemScope class], @"contributor", - [GTLPlusItemScope class], @"performers", - nil]; - return map; -} - -+ (void)load { - [self registerObjectClassForKind:@"plus#itemScope"]; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusMoment.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusMoment.h deleted file mode 100644 index 0b028c88..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusMoment.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusMoment.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusMoment (0 custom class methods, 6 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusItemScope; - -// ---------------------------------------------------------------------------- -// -// GTLPlusMoment -// - -@interface GTLPlusMoment : GTLObject - -// The moment ID. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// Identifies this resource as a moment. -@property (copy) NSString *kind; - -// The object generated by performing the action on the item -@property (retain) GTLPlusItemScope *result; - -// Time stamp of when the action occurred in RFC3339 format. -@property (retain) GTLDateTime *startDate; - -// The object on which the action was performed. -@property (retain) GTLPlusItemScope *target; - -// The schema.org activity type. -@property (copy) NSString *type; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusMoment.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusMoment.m deleted file mode 100644 index 7785726a..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusMoment.m +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusMoment.m -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusMoment (0 custom class methods, 6 custom properties) - -#import "GTLPlusMoment.h" - -#import "GTLPlusItemScope.h" - -// ---------------------------------------------------------------------------- -// -// GTLPlusMoment -// - -@implementation GTLPlusMoment -@dynamic identifier, kind, result, startDate, target, type; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:@"id" - forKey:@"identifier"]; - return map; -} - -+ (void)load { - [self registerObjectClassForKind:@"plus#moment"]; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusMomentsFeed.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusMomentsFeed.h deleted file mode 100644 index 6cc8106b..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusMomentsFeed.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusMomentsFeed.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusMomentsFeed (0 custom class methods, 8 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusMoment; - -// ---------------------------------------------------------------------------- -// -// GTLPlusMomentsFeed -// - -// This class supports NSFastEnumeration over its "items" property. It also -// supports -itemAtIndex: to retrieve individual objects from "items". - -@interface GTLPlusMomentsFeed : GTLCollectionObject - -// ETag of this response for caching purposes. -@property (copy) NSString *ETag; - -// The moments in this page of results. -@property (retain) NSArray *items; // of GTLPlusMoment - -// Identifies this resource as a collection of moments. Value: -// "plus#momentsFeed". -@property (copy) NSString *kind; - -// Link to the next page of moments. -@property (copy) NSString *nextLink; - -// The continuation token, which is used to page through large result sets. -// Provide this value in a subsequent request to return the next page of -// results. -@property (copy) NSString *nextPageToken; - -// Link to this page of moments. -@property (copy) NSString *selfLink; - -// The title of this collection of moments. -@property (copy) NSString *title; - -// The RFC 339 timestamp for when this collection of moments was last updated. -@property (retain) GTLDateTime *updated; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusMomentsFeed.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusMomentsFeed.m deleted file mode 100644 index 21ff97c5..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusMomentsFeed.m +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusMomentsFeed.m -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusMomentsFeed (0 custom class methods, 8 custom properties) - -#import "GTLPlusMomentsFeed.h" - -#import "GTLPlusMoment.h" - -// ---------------------------------------------------------------------------- -// -// GTLPlusMomentsFeed -// - -@implementation GTLPlusMomentsFeed -@dynamic ETag, items, kind, nextLink, nextPageToken, selfLink, title, updated; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:@"etag" - forKey:@"ETag"]; - return map; -} - -+ (NSDictionary *)arrayPropertyToClassMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:[GTLPlusMoment class] - forKey:@"items"]; - return map; -} - -+ (void)load { - [self registerObjectClassForKind:@"plus#momentsFeed"]; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusPeopleFeed.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusPeopleFeed.h deleted file mode 100644 index 523afadd..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusPeopleFeed.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusPeopleFeed.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusPeopleFeed (0 custom class methods, 7 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusPerson; - -// ---------------------------------------------------------------------------- -// -// GTLPlusPeopleFeed -// - -// This class supports NSFastEnumeration over its "items" property. It also -// supports -itemAtIndex: to retrieve individual objects from "items". - -@interface GTLPlusPeopleFeed : GTLCollectionObject - -// ETag of this response for caching purposes. -@property (copy) NSString *ETag; - -// The people in this page of results. Each item includes the id, displayName, -// image, and url for the person. To retrieve additional profile data, see the -// people.get method. -@property (retain) NSArray *items; // of GTLPlusPerson - -// Identifies this resource as a collection of people. Value: "plus#peopleFeed". -@property (copy) NSString *kind; - -// The continuation token, which is used to page through large result sets. -// Provide this value in a subsequent request to return the next page of -// results. -@property (copy) NSString *nextPageToken; - -// Link to this resource. -@property (copy) NSString *selfLink; - -// The title of this collection of people. -@property (copy) NSString *title; - -// The total number of people available in this list. The number of people in a -// response might be smaller due to paging. This might not be set for all -// collections. -@property (retain) NSNumber *totalItems; // intValue - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusPeopleFeed.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusPeopleFeed.m deleted file mode 100644 index 4861f65f..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusPeopleFeed.m +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusPeopleFeed.m -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusPeopleFeed (0 custom class methods, 7 custom properties) - -#import "GTLPlusPeopleFeed.h" - -#import "GTLPlusPerson.h" - -// ---------------------------------------------------------------------------- -// -// GTLPlusPeopleFeed -// - -@implementation GTLPlusPeopleFeed -@dynamic ETag, items, kind, nextPageToken, selfLink, title, totalItems; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:@"etag" - forKey:@"ETag"]; - return map; -} - -+ (NSDictionary *)arrayPropertyToClassMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:[GTLPlusPerson class] - forKey:@"items"]; - return map; -} - -+ (void)load { - [self registerObjectClassForKind:@"plus#peopleFeed"]; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusPerson.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusPerson.h deleted file mode 100644 index 57ae94ed..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusPerson.h +++ /dev/null @@ -1,388 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusPerson.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusPerson (0 custom class methods, 28 custom properties) -// GTLPlusPersonAgeRange (0 custom class methods, 2 custom properties) -// GTLPlusPersonCover (0 custom class methods, 3 custom properties) -// GTLPlusPersonEmailsItem (0 custom class methods, 3 custom properties) -// GTLPlusPersonImage (0 custom class methods, 1 custom properties) -// GTLPlusPersonName (0 custom class methods, 6 custom properties) -// GTLPlusPersonOrganizationsItem (0 custom class methods, 9 custom properties) -// GTLPlusPersonPlacesLivedItem (0 custom class methods, 2 custom properties) -// GTLPlusPersonUrlsItem (0 custom class methods, 3 custom properties) -// GTLPlusPersonCoverCoverInfo (0 custom class methods, 2 custom properties) -// GTLPlusPersonCoverCoverPhoto (0 custom class methods, 3 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLObject.h" -#else - #import "GTLObject.h" -#endif - -@class GTLPlusPersonAgeRange; -@class GTLPlusPersonCover; -@class GTLPlusPersonCoverCoverInfo; -@class GTLPlusPersonCoverCoverPhoto; -@class GTLPlusPersonEmailsItem; -@class GTLPlusPersonImage; -@class GTLPlusPersonName; -@class GTLPlusPersonOrganizationsItem; -@class GTLPlusPersonPlacesLivedItem; -@class GTLPlusPersonUrlsItem; - -// ---------------------------------------------------------------------------- -// -// GTLPlusPerson -// - -@interface GTLPlusPerson : GTLObject - -// A short biography for this person. -@property (copy) NSString *aboutMe; - -// The age range of the person. -@property (retain) GTLPlusPersonAgeRange *ageRange; - -// The person's date of birth, represented as YYYY-MM-DD. -@property (copy) NSString *birthday; - -// The "bragging rights" line of this person. -@property (copy) NSString *braggingRights; - -// If a Google+ Page and for followers who are visible, the number of people who -// have added this page to a circle. -@property (retain) NSNumber *circledByCount; // intValue - -// The cover photo content. -@property (retain) GTLPlusPersonCover *cover; - -// The current location for this person. -@property (copy) NSString *currentLocation; - -// The name of this person, suitable for display. -@property (copy) NSString *displayName; - -// A list of email addresses for this person. -@property (retain) NSArray *emails; // of GTLPlusPersonEmailsItem - -// ETag of this response for caching purposes. -@property (copy) NSString *ETag; - -// The person's gender. Possible values are: -// - "male" - Male gender. -// - "female" - Female gender. -// - "other" - Other. -@property (copy) NSString *gender; - -// If "true", indicates that the person has installed the app that is making the -// request and has chosen to expose this install state to the caller. A value of -// "false" indicates that the install state cannot be determined (it is either -// not installed or the person has chosen to keep this information private). -@property (retain) NSNumber *hasApp; // boolValue - -// The ID of this person. -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; - -// The representation of the person's profile photo. -@property (retain) GTLPlusPersonImage *image; - -// Whether this user has signed up for Google+. -@property (retain) NSNumber *isPlusUser; // boolValue - -// Identifies this resource as a person. Value: "plus#person". -@property (copy) NSString *kind; - -// The user's preferred language for rendering. -@property (copy) NSString *language; - -// An object representation of the individual components of a person's name. -@property (retain) GTLPlusPersonName *name; - -// The nickname of this person. -@property (copy) NSString *nickname; - -// Type of person within Google+. Possible values are: -// - "person" - represents an actual person. -// - "page" - represents a page. -@property (copy) NSString *objectType; - -// A list of current or past organizations with which this person is associated. -@property (retain) NSArray *organizations; // of GTLPlusPersonOrganizationsItem - -// A list of places where this person has lived. -@property (retain) NSArray *placesLived; // of GTLPlusPersonPlacesLivedItem - -// If a Google+ Page, the number of people who have +1'ed this page. -@property (retain) NSNumber *plusOneCount; // intValue - -// The person's relationship status. Possible values are: -// - "single" - Person is single. -// - "in_a_relationship" - Person is in a relationship. -// - "engaged" - Person is engaged. -// - "married" - Person is married. -// - "its_complicated" - The relationship is complicated. -// - "open_relationship" - Person is in an open relationship. -// - "widowed" - Person is widowed. -// - "in_domestic_partnership" - Person is in a domestic partnership. -// - "in_civil_union" - Person is in a civil union. -@property (copy) NSString *relationshipStatus; - -// The brief description (tagline) of this person. -@property (copy) NSString *tagline; - -// The URL of this person's profile. -@property (copy) NSString *url; - -// A list of URLs for this person. -@property (retain) NSArray *urls; // of GTLPlusPersonUrlsItem - -// Whether the person or Google+ Page has been verified. -@property (retain) NSNumber *verified; // boolValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonAgeRange -// - -@interface GTLPlusPersonAgeRange : GTLObject - -// The age range's upper bound, if any. -@property (retain) NSNumber *max; // intValue - -// The age range's lower bound, if any. -@property (retain) NSNumber *min; // intValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonCover -// - -@interface GTLPlusPersonCover : GTLObject - -// Extra information about the cover photo. -@property (retain) GTLPlusPersonCoverCoverInfo *coverInfo; - -// The person's primary cover image. -@property (retain) GTLPlusPersonCoverCoverPhoto *coverPhoto; - -// The layout of the cover art. Possible values are: -// - "banner" - One large image banner. -@property (copy) NSString *layout; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonEmailsItem -// - -@interface GTLPlusPersonEmailsItem : GTLObject - -// If "true", indicates this email address is the person's primary one. -@property (retain) NSNumber *primary; // boolValue - -// The type of address. Possible values are: -// - "home" - Home email address. -// - "work" - Work email address. -// - "other" - Other. -@property (copy) NSString *type; - -// The email address. -@property (copy) NSString *value; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonImage -// - -@interface GTLPlusPersonImage : GTLObject - -// The URL of the person's profile photo. To re-size the image and crop it to a -// square, append the query string ?sz=x, where x is the dimension in pixels of -// each side. -@property (copy) NSString *url; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonName -// - -@interface GTLPlusPersonName : GTLObject - -// The family name (last name) of this person. -@property (copy) NSString *familyName; - -// The full name of this person, including middle names, suffixes, etc. -@property (copy) NSString *formatted; - -// The given name (first name) of this person. -@property (copy) NSString *givenName; - -// The honorific prefixes (such as "Dr." or "Mrs.") for this person. -@property (copy) NSString *honorificPrefix; - -// The honorific suffixes (such as "Jr.") for this person. -@property (copy) NSString *honorificSuffix; - -// The middle name of this person. -@property (copy) NSString *middleName; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonOrganizationsItem -// - -@interface GTLPlusPersonOrganizationsItem : GTLObject - -// The department within the organization. Deprecated. -@property (copy) NSString *department; - -// A short description of the person's role in this organization. Deprecated. -// Remapped to 'descriptionProperty' to avoid NSObject's 'description'. -@property (copy) NSString *descriptionProperty; - -// The date the person left this organization. -@property (copy) NSString *endDate; - -// The location of this organization. Deprecated. -@property (copy) NSString *location; - -// The name of the organization. -@property (copy) NSString *name; - -// If "true", indicates this organization is the person's primary one (typically -// interpreted as current one). -@property (retain) NSNumber *primary; // boolValue - -// The date the person joined this organization. -@property (copy) NSString *startDate; - -// The person's job title or role within the organization. -@property (copy) NSString *title; - -// The type of organization. Possible values are: -// - "work" - Work. -// - "school" - School. -@property (copy) NSString *type; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonPlacesLivedItem -// - -@interface GTLPlusPersonPlacesLivedItem : GTLObject - -// If "true", this place of residence is this person's primary residence. -@property (retain) NSNumber *primary; // boolValue - -// A place where this person has lived. For example: "Seattle, WA", "Near -// Toronto". -@property (copy) NSString *value; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonUrlsItem -// - -@interface GTLPlusPersonUrlsItem : GTLObject - -// If "true", this URL is the person's primary URL. -@property (retain) NSNumber *primary; // boolValue - -// The type of URL. Possible values are: -// - "home" - URL for home. -// - "work" - URL for work. -// - "blog" - URL for blog. -// - "profile" - URL for profile. -// - "other" - Other. -@property (copy) NSString *type; - -// The URL value. -@property (copy) NSString *value; - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonCoverCoverInfo -// - -@interface GTLPlusPersonCoverCoverInfo : GTLObject - -// The difference between the left position of the image cover and the actual -// displayed cover image. Only valid for BANNER layout. -@property (retain) NSNumber *leftImageOffset; // intValue - -// The difference between the top position of the image cover and the actual -// displayed cover image. Only valid for BANNER layout. -@property (retain) NSNumber *topImageOffset; // intValue - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonCoverCoverPhoto -// - -@interface GTLPlusPersonCoverCoverPhoto : GTLObject - -// The height to the image. -@property (retain) NSNumber *height; // intValue - -// The url to the image. -@property (copy) NSString *url; - -// The width to the image. -@property (retain) NSNumber *width; // intValue - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusPerson.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusPerson.m deleted file mode 100644 index 200434fb..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLPlusPerson.m +++ /dev/null @@ -1,189 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLPlusPerson.m -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLPlusPerson (0 custom class methods, 28 custom properties) -// GTLPlusPersonAgeRange (0 custom class methods, 2 custom properties) -// GTLPlusPersonCover (0 custom class methods, 3 custom properties) -// GTLPlusPersonEmailsItem (0 custom class methods, 3 custom properties) -// GTLPlusPersonImage (0 custom class methods, 1 custom properties) -// GTLPlusPersonName (0 custom class methods, 6 custom properties) -// GTLPlusPersonOrganizationsItem (0 custom class methods, 9 custom properties) -// GTLPlusPersonPlacesLivedItem (0 custom class methods, 2 custom properties) -// GTLPlusPersonUrlsItem (0 custom class methods, 3 custom properties) -// GTLPlusPersonCoverCoverInfo (0 custom class methods, 2 custom properties) -// GTLPlusPersonCoverCoverPhoto (0 custom class methods, 3 custom properties) - -#import "GTLPlusPerson.h" - -// ---------------------------------------------------------------------------- -// -// GTLPlusPerson -// - -@implementation GTLPlusPerson -@dynamic aboutMe, ageRange, birthday, braggingRights, circledByCount, cover, - currentLocation, displayName, emails, ETag, gender, hasApp, identifier, - image, isPlusUser, kind, language, name, nickname, objectType, - organizations, placesLived, plusOneCount, relationshipStatus, tagline, - url, urls, verified; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObjectsAndKeys: - @"etag", @"ETag", - @"id", @"identifier", - nil]; - return map; -} - -+ (NSDictionary *)arrayPropertyToClassMap { - NSDictionary *map = - [NSDictionary dictionaryWithObjectsAndKeys: - [GTLPlusPersonEmailsItem class], @"emails", - [GTLPlusPersonOrganizationsItem class], @"organizations", - [GTLPlusPersonPlacesLivedItem class], @"placesLived", - [GTLPlusPersonUrlsItem class], @"urls", - nil]; - return map; -} - -+ (void)load { - [self registerObjectClassForKind:@"plus#person"]; -} - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonAgeRange -// - -@implementation GTLPlusPersonAgeRange -@dynamic max, min; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonCover -// - -@implementation GTLPlusPersonCover -@dynamic coverInfo, coverPhoto, layout; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonEmailsItem -// - -@implementation GTLPlusPersonEmailsItem -@dynamic primary, type, value; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonImage -// - -@implementation GTLPlusPersonImage -@dynamic url; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonName -// - -@implementation GTLPlusPersonName -@dynamic familyName, formatted, givenName, honorificPrefix, honorificSuffix, - middleName; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonOrganizationsItem -// - -@implementation GTLPlusPersonOrganizationsItem -@dynamic department, descriptionProperty, endDate, location, name, primary, - startDate, title, type; - -+ (NSDictionary *)propertyToJSONKeyMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:@"description" - forKey:@"descriptionProperty"]; - return map; -} - -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonPlacesLivedItem -// - -@implementation GTLPlusPersonPlacesLivedItem -@dynamic primary, value; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonUrlsItem -// - -@implementation GTLPlusPersonUrlsItem -@dynamic primary, type, value; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonCoverCoverInfo -// - -@implementation GTLPlusPersonCoverCoverInfo -@dynamic leftImageOffset, topImageOffset; -@end - - -// ---------------------------------------------------------------------------- -// -// GTLPlusPersonCoverCoverPhoto -// - -@implementation GTLPlusPersonCoverCoverPhoto -@dynamic height, url, width; -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLQueryPlus.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLQueryPlus.h deleted file mode 100644 index 44b43109..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLQueryPlus.h +++ /dev/null @@ -1,297 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLQueryPlus.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLQueryPlus (12 custom class methods, 15 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLQuery.h" -#else - #import "GTLQuery.h" -#endif - -@class GTLPlusMoment; - -@interface GTLQueryPlus : GTLQuery - -// -// Parameters valid on all methods. -// - -// Selector specifying which fields to include in a partial response. -@property (copy) NSString *fields; - -// -// Method-specific parameters; see the comments below for more information. -// -@property (copy) NSString *activityId; -@property (copy) NSString *collection; -@property (copy) NSString *commentId; -@property (assign) BOOL debug; -// identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). -@property (copy) NSString *identifier; -@property (copy) NSString *language; -@property (assign) NSUInteger maxResults; -@property (copy) NSString *orderBy; -@property (copy) NSString *pageToken; -@property (copy) NSString *query; -@property (copy) NSString *sortOrder; -@property (copy) NSString *targetUrl; -@property (copy) NSString *type; -@property (copy) NSString *userId; - -#pragma mark - -#pragma mark "activities" methods -// These create a GTLQueryPlus object. - -// Method: plus.activities.get -// Get an activity. -// Required: -// activityId: The ID of the activity to get. -// Authorization scope(s): -// kGTLAuthScopePlusLogin -// kGTLAuthScopePlusMe -// Fetches a GTLPlusActivity. -+ (id)queryForActivitiesGetWithActivityId:(NSString *)activityId; - -// Method: plus.activities.list -// List all of the activities in the specified collection for a particular user. -// Required: -// userId: The ID of the user to get activities for. The special value "me" -// can be used to indicate the authenticated user. -// collection: The collection of activities to list. -// kGTLPlusCollectionPublic: All public activities created by the specified -// user. -// Optional: -// maxResults: The maximum number of activities to include in the response, -// which is used for paging. For any response, the actual number returned -// might be less than the specified maxResults. (1..100, default 20) -// pageToken: The continuation token, which is used to page through large -// result sets. To get the next page of results, set this parameter to the -// value of "nextPageToken" from the previous response. -// Authorization scope(s): -// kGTLAuthScopePlusLogin -// kGTLAuthScopePlusMe -// Fetches a GTLPlusActivityFeed. -+ (id)queryForActivitiesListWithUserId:(NSString *)userId - collection:(NSString *)collection; - -// Method: plus.activities.search -// Search public activities. -// Required: -// query: Full-text search query string. -// Optional: -// language: Specify the preferred language to search with. See search -// language codes for available values. (Default en-US) -// maxResults: The maximum number of activities to include in the response, -// which is used for paging. For any response, the actual number returned -// might be less than the specified maxResults. (1..20, default 10) -// orderBy: Specifies how to order search results. (Default -// kGTLPlusOrderByRecent) -// kGTLPlusOrderByBest: Sort activities by relevance to the user, most -// relevant first. -// kGTLPlusOrderByRecent: Sort activities by published date, most recent -// first. -// pageToken: The continuation token, which is used to page through large -// result sets. To get the next page of results, set this parameter to the -// value of "nextPageToken" from the previous response. This token can be of -// any length. -// Authorization scope(s): -// kGTLAuthScopePlusMe -// Fetches a GTLPlusActivityFeed. -+ (id)queryForActivitiesSearchWithQuery:(NSString *)query; - -#pragma mark - -#pragma mark "comments" methods -// These create a GTLQueryPlus object. - -// Method: plus.comments.get -// Get a comment. -// Required: -// commentId: The ID of the comment to get. -// Authorization scope(s): -// kGTLAuthScopePlusMe -// Fetches a GTLPlusComment. -+ (id)queryForCommentsGetWithCommentId:(NSString *)commentId; - -// Method: plus.comments.list -// List all of the comments for an activity. -// Required: -// activityId: The ID of the activity to get comments for. -// Optional: -// maxResults: The maximum number of comments to include in the response, -// which is used for paging. For any response, the actual number returned -// might be less than the specified maxResults. (0..500, default 20) -// pageToken: The continuation token, which is used to page through large -// result sets. To get the next page of results, set this parameter to the -// value of "nextPageToken" from the previous response. -// sortOrder: The order in which to sort the list of comments. (Default -// kGTLPlusSortOrderAscending) -// kGTLPlusSortOrderAscending: Sort oldest comments first. -// kGTLPlusSortOrderDescending: Sort newest comments first. -// Authorization scope(s): -// kGTLAuthScopePlusMe -// Fetches a GTLPlusCommentFeed. -+ (id)queryForCommentsListWithActivityId:(NSString *)activityId; - -#pragma mark - -#pragma mark "moments" methods -// These create a GTLQueryPlus object. - -// Method: plus.moments.insert -// Record a moment representing a user's activity such as making a purchase or -// commenting on a blog. -// Required: -// userId: The ID of the user to record activities for. The only valid values -// are "me" and the ID of the authenticated user. -// collection: The collection to which to write moments. -// kGTLPlusCollectionVault: The default collection for writing new moments. -// Optional: -// debug: Return the moment as written. Should be used only for debugging. -// Authorization scope(s): -// kGTLAuthScopePlusLogin -// Fetches a GTLPlusMoment. -+ (id)queryForMomentsInsertWithObject:(GTLPlusMoment *)object - userId:(NSString *)userId - collection:(NSString *)collection; - -// Method: plus.moments.list -// List all of the moments for a particular user. -// Required: -// userId: The ID of the user to get moments for. The special value "me" can -// be used to indicate the authenticated user. -// collection: The collection of moments to list. -// kGTLPlusCollectionVault: All moments created by the requesting -// application for the authenticated user. -// Optional: -// maxResults: The maximum number of moments to include in the response, which -// is used for paging. For any response, the actual number returned might be -// less than the specified maxResults. (1..100, default 20) -// pageToken: The continuation token, which is used to page through large -// result sets. To get the next page of results, set this parameter to the -// value of "nextPageToken" from the previous response. -// targetUrl: Only moments containing this targetUrl will be returned. -// type: Only moments of this type will be returned. -// Authorization scope(s): -// kGTLAuthScopePlusLogin -// Fetches a GTLPlusMomentsFeed. -+ (id)queryForMomentsListWithUserId:(NSString *)userId - collection:(NSString *)collection; - -// Method: plus.moments.remove -// Delete a moment. -// Required: -// identifier: The ID of the moment to delete. -// Authorization scope(s): -// kGTLAuthScopePlusLogin -+ (id)queryForMomentsRemoveWithIdentifier:(NSString *)identifier; - -#pragma mark - -#pragma mark "people" methods -// These create a GTLQueryPlus object. - -// Method: plus.people.get -// Get a person's profile. If your app uses scope -// https://www.googleapis.com/auth/plus.login, this method is guaranteed to -// return ageRange and language. -// Required: -// userId: The ID of the person to get the profile for. The special value "me" -// can be used to indicate the authenticated user. -// Authorization scope(s): -// kGTLAuthScopePlusLogin -// kGTLAuthScopePlusMe -// Fetches a GTLPlusPerson. -+ (id)queryForPeopleGetWithUserId:(NSString *)userId; - -// Method: plus.people.list -// List all of the people in the specified collection. -// Required: -// userId: Get the collection of people for the person identified by the ID or -// use "me" to indiciated the authenticated user. -// collection: The collection of people to list. -// kGTLPlusCollectionVisible: The list of people who this user has added to -// one or more circles, limited to the circles visible to the requesting -// application. -// Optional: -// maxResults: The maximum number of people to include in the response, which -// is used for paging. For any response, the actual number returned might be -// less than the specified maxResults. (1..100, default 100) -// orderBy: The order to return people in. -// kGTLPlusOrderByAlphabetical: Order the people by their display name. -// kGTLPlusOrderByBest: Order people based on the relevence to the viewer. -// pageToken: The continuation token, which is used to page through large -// result sets. To get the next page of results, set this parameter to the -// value of "nextPageToken" from the previous response. -// Authorization scope(s): -// kGTLAuthScopePlusLogin -// Fetches a GTLPlusPeopleFeed. -+ (id)queryForPeopleListWithUserId:(NSString *)userId - collection:(NSString *)collection; - -// Method: plus.people.listByActivity -// List all of the people in the specified collection for a particular activity. -// Required: -// activityId: The ID of the activity to get the list of people for. -// collection: The collection of people to list. -// kGTLPlusCollectionPlusoners: List all people who have +1'd this -// activity. -// kGTLPlusCollectionResharers: List all people who have reshared this -// activity. -// Optional: -// maxResults: The maximum number of people to include in the response, which -// is used for paging. For any response, the actual number returned might be -// less than the specified maxResults. (1..100, default 20) -// pageToken: The continuation token, which is used to page through large -// result sets. To get the next page of results, set this parameter to the -// value of "nextPageToken" from the previous response. -// Authorization scope(s): -// kGTLAuthScopePlusMe -// Fetches a GTLPlusPeopleFeed. -+ (id)queryForPeopleListByActivityWithActivityId:(NSString *)activityId - collection:(NSString *)collection; - -// Method: plus.people.search -// Search all public profiles. -// Required: -// query: Specify a query string for full text search of public text in all -// profiles. -// Optional: -// language: Specify the preferred language to search with. See search -// language codes for available values. (Default en-US) -// maxResults: The maximum number of people to include in the response, which -// is used for paging. For any response, the actual number returned might be -// less than the specified maxResults. (1..20, default 10) -// pageToken: The continuation token, which is used to page through large -// result sets. To get the next page of results, set this parameter to the -// value of "nextPageToken" from the previous response. This token can be of -// any length. -// Authorization scope(s): -// kGTLAuthScopePlusMe -// Fetches a GTLPlusPeopleFeed. -+ (id)queryForPeopleSearchWithQuery:(NSString *)query; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLQueryPlus.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLQueryPlus.m deleted file mode 100644 index 8d2c9a98..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLQueryPlus.m +++ /dev/null @@ -1,182 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLQueryPlus.m -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLQueryPlus (12 custom class methods, 15 custom properties) - -#import "GTLQueryPlus.h" - -#import "GTLPlusActivity.h" -#import "GTLPlusActivityFeed.h" -#import "GTLPlusComment.h" -#import "GTLPlusCommentFeed.h" -#import "GTLPlusMoment.h" -#import "GTLPlusMomentsFeed.h" -#import "GTLPlusPeopleFeed.h" -#import "GTLPlusPerson.h" - -@implementation GTLQueryPlus - -@dynamic activityId, collection, commentId, debug, fields, identifier, language, - maxResults, orderBy, pageToken, query, sortOrder, targetUrl, type, - userId; - -+ (NSDictionary *)parameterNameMap { - NSDictionary *map = - [NSDictionary dictionaryWithObject:@"id" - forKey:@"identifier"]; - return map; -} - -#pragma mark - -#pragma mark "activities" methods -// These create a GTLQueryPlus object. - -+ (id)queryForActivitiesGetWithActivityId:(NSString *)activityId { - NSString *methodName = @"plus.activities.get"; - GTLQueryPlus *query = [self queryWithMethodName:methodName]; - query.activityId = activityId; - query.expectedObjectClass = [GTLPlusActivity class]; - return query; -} - -+ (id)queryForActivitiesListWithUserId:(NSString *)userId - collection:(NSString *)collection { - NSString *methodName = @"plus.activities.list"; - GTLQueryPlus *query = [self queryWithMethodName:methodName]; - query.userId = userId; - query.collection = collection; - query.expectedObjectClass = [GTLPlusActivityFeed class]; - return query; -} - -+ (id)queryForActivitiesSearchWithQuery:(NSString *)query_param { - NSString *methodName = @"plus.activities.search"; - GTLQueryPlus *query = [self queryWithMethodName:methodName]; - query.query = query_param; - query.expectedObjectClass = [GTLPlusActivityFeed class]; - return query; -} - -#pragma mark - -#pragma mark "comments" methods -// These create a GTLQueryPlus object. - -+ (id)queryForCommentsGetWithCommentId:(NSString *)commentId { - NSString *methodName = @"plus.comments.get"; - GTLQueryPlus *query = [self queryWithMethodName:methodName]; - query.commentId = commentId; - query.expectedObjectClass = [GTLPlusComment class]; - return query; -} - -+ (id)queryForCommentsListWithActivityId:(NSString *)activityId { - NSString *methodName = @"plus.comments.list"; - GTLQueryPlus *query = [self queryWithMethodName:methodName]; - query.activityId = activityId; - query.expectedObjectClass = [GTLPlusCommentFeed class]; - return query; -} - -#pragma mark - -#pragma mark "moments" methods -// These create a GTLQueryPlus object. - -+ (id)queryForMomentsInsertWithObject:(GTLPlusMoment *)object - userId:(NSString *)userId - collection:(NSString *)collection { - if (object == nil) { - GTL_DEBUG_ASSERT(object != nil, @"%@ got a nil object", NSStringFromSelector(_cmd)); - return nil; - } - NSString *methodName = @"plus.moments.insert"; - GTLQueryPlus *query = [self queryWithMethodName:methodName]; - query.bodyObject = object; - query.userId = userId; - query.collection = collection; - query.expectedObjectClass = [GTLPlusMoment class]; - return query; -} - -+ (id)queryForMomentsListWithUserId:(NSString *)userId - collection:(NSString *)collection { - NSString *methodName = @"plus.moments.list"; - GTLQueryPlus *query = [self queryWithMethodName:methodName]; - query.userId = userId; - query.collection = collection; - query.expectedObjectClass = [GTLPlusMomentsFeed class]; - return query; -} - -+ (id)queryForMomentsRemoveWithIdentifier:(NSString *)identifier { - NSString *methodName = @"plus.moments.remove"; - GTLQueryPlus *query = [self queryWithMethodName:methodName]; - query.identifier = identifier; - return query; -} - -#pragma mark - -#pragma mark "people" methods -// These create a GTLQueryPlus object. - -+ (id)queryForPeopleGetWithUserId:(NSString *)userId { - NSString *methodName = @"plus.people.get"; - GTLQueryPlus *query = [self queryWithMethodName:methodName]; - query.userId = userId; - query.expectedObjectClass = [GTLPlusPerson class]; - return query; -} - -+ (id)queryForPeopleListWithUserId:(NSString *)userId - collection:(NSString *)collection { - NSString *methodName = @"plus.people.list"; - GTLQueryPlus *query = [self queryWithMethodName:methodName]; - query.userId = userId; - query.collection = collection; - query.expectedObjectClass = [GTLPlusPeopleFeed class]; - return query; -} - -+ (id)queryForPeopleListByActivityWithActivityId:(NSString *)activityId - collection:(NSString *)collection { - NSString *methodName = @"plus.people.listByActivity"; - GTLQueryPlus *query = [self queryWithMethodName:methodName]; - query.activityId = activityId; - query.collection = collection; - query.expectedObjectClass = [GTLPlusPeopleFeed class]; - return query; -} - -+ (id)queryForPeopleSearchWithQuery:(NSString *)query_param { - NSString *methodName = @"plus.people.search"; - GTLQueryPlus *query = [self queryWithMethodName:methodName]; - query.query = query_param; - query.expectedObjectClass = [GTLPlusPeopleFeed class]; - return query; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLServicePlus.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLServicePlus.h deleted file mode 100644 index b05c4f47..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLServicePlus.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLServicePlus.h -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLServicePlus (0 custom class methods, 0 custom properties) - -#if GTL_BUILT_AS_FRAMEWORK - #import "GTL/GTLService.h" -#else - #import "GTLService.h" -#endif - -@interface GTLServicePlus : GTLService - -// No new methods - -// Clients should create a standard query with any of the class methods in -// GTLQueryPlus.h. The query can the be sent with GTLService's execute methods, -// -// - (GTLServiceTicket *)executeQuery:(GTLQuery *)query -// completionHandler:(void (^)(GTLServiceTicket *ticket, -// id object, NSError *error))handler; -// or -// - (GTLServiceTicket *)executeQuery:(GTLQuery *)query -// delegate:(id)delegate -// didFinishSelector:(SEL)finishedSelector; -// -// where finishedSelector has a signature of: -// -// - (void)serviceTicket:(GTLServiceTicket *)ticket -// finishedWithObject:(id)object -// error:(NSError *)error; -// -// The object passed to the completion handler or delegate method -// is a subclass of GTLObject, determined by the query method executed. - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLServicePlus.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLServicePlus.m deleted file mode 100644 index 6a53d566..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLPlus/GTLServicePlus.m +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (c) 2013 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLServicePlus.m -// - -// ---------------------------------------------------------------------------- -// NOTE: This file is generated from Google APIs Discovery Service. -// Service: -// Google+ API (plus/v1) -// Description: -// The Google+ API enables developers to build on top of the Google+ platform. -// Documentation: -// https://developers.google.com/+/api/ -// Classes: -// GTLServicePlus (0 custom class methods, 0 custom properties) - -#import "GTLPlus.h" - -@implementation GTLServicePlus - -#if DEBUG -// Method compiled in debug builds just to check that all the needed support -// classes are present at link time. -+ (NSArray *)checkClasses { - NSArray *classes = [NSArray arrayWithObjects: - [GTLQueryPlus class], - [GTLPlusAcl class], - [GTLPlusAclentryResource class], - [GTLPlusActivity class], - [GTLPlusActivityFeed class], - [GTLPlusComment class], - [GTLPlusCommentFeed class], - [GTLPlusItemScope class], - [GTLPlusMoment class], - [GTLPlusMomentsFeed class], - [GTLPlusPeopleFeed class], - [GTLPlusPerson class], - nil]; - return classes; -} -#endif // DEBUG - -- (id)init { - self = [super init]; - if (self) { - // Version from discovery. - self.apiVersion = @"v1"; - - // From discovery. Where to send JSON-RPC. - // Turn off prettyPrint for this service to save bandwidth (especially on - // mobile). The fetcher logging will pretty print. - self.rpcURL = [NSURL URLWithString:@"https://www.googleapis.com/rpc?prettyPrint=false"]; - } - return self; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLQuery.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLQuery.h deleted file mode 100644 index 9d40887e..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLQuery.h +++ /dev/null @@ -1,136 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLQuery.h -// - -// Query documentation: -// https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Query_Operations - -#import "GTLObject.h" -#import "GTLUploadParameters.h" - -@protocol GTLQueryProtocol -- (BOOL)isBatchQuery; -- (BOOL)shouldSkipAuthorization; -- (void)executionDidStop; -- (NSDictionary *)additionalHTTPHeaders; -- (NSDictionary *)urlQueryParameters; -- (GTLUploadParameters *)uploadParameters; -@end - -@protocol GTLQueryCollectionProtocol -@optional -@property (retain) NSString *pageToken; -@property (retain) NSNumber *startIndex; -@end - -@class GTLServiceTicket; - -@interface GTLQuery : NSObject { - @private - NSString *methodName_; - NSMutableDictionary *json_; - GTLObject *bodyObject_; - NSMutableDictionary *childCache_; - NSString *requestID_; - GTLUploadParameters *uploadParameters_; - NSDictionary *urlQueryParameters_; - NSDictionary *additionalHTTPHeaders_; - Class expectedObjectClass_; - BOOL skipAuthorization_; -#if NS_BLOCKS_AVAILABLE - void (^completionBlock_)(GTLServiceTicket *ticket, id object, NSError *error); -#elif !__LP64__ - // Placeholders: for 32-bit builds, keep the size of the object's ivar section - // the same with and without blocks - id completionPlaceholder_; -#endif -} - -// The rpc method name. -@property (readonly) NSString *methodName; - -// The JSON dictionary of all the parameters set on this query. -@property (retain) NSMutableDictionary *JSON; - -// The object set to be uploaded with the query. -@property (retain) GTLObject *bodyObject; - -// Each query must have a request ID string. The user may replace the -// default assigned request ID with a custom string, provided that if -// used in a batch query, all request IDs in the batch must be unique. -@property (copy) NSString *requestID; - -// For queries which support file upload, the MIME type and file handle -// or data must be provided. -@property (copy) GTLUploadParameters *uploadParameters; - -// Any URL query parameters to add to the query (useful for debugging with some -// services). -@property (copy) NSDictionary *urlQueryParameters; - -// Any additional HTTP headers for this query. Not valid when this query -// is added to a batch. -// -// These headers override the same keys from the service object's -// additionalHTTPHeaders. -@property (copy) NSDictionary *additionalHTTPHeaders; - -// The GTLObject subclass expected for results (used if the result doesn't -// include a kind attribute). -@property (assign) Class expectedObjectClass; - -// Clients may set this to YES to disallow authorization. Defaults to NO. -@property (assign) BOOL shouldSkipAuthorization; - -#if NS_BLOCKS_AVAILABLE -// Clients may provide an optional callback block to be called immediately -// before the executeQuery: callback. -// -// The completionBlock property is particularly useful for queries executed -// in a batch. -// -// Errors passed to the completionBlock will have an "underlying" GTLErrorObject -// when the server returned an error for this specific query: -// -// GTLErrorObject *errorObj = [GTLErrorObject underlyingObjectForError:error]; -// if (errorObj) { -// // the server returned this error for this specific query -// } else { -// // the batch execution failed -// } -@property (copy) void (^completionBlock)(GTLServiceTicket *ticket, id object, NSError *error); -#endif - -// methodName is the RPC method name to use. -+ (id)queryWithMethodName:(NSString *)methodName GTL_NONNULL((1)); - -// methodName is the RPC method name to use. -- (id)initWithMethodName:(NSString *)method GTL_NONNULL((1)); - -// If you need to set a parameter that is not listed as a property for a -// query class, you can do so via this api. If you need to clear it after -// setting, pass nil for obj. -- (void)setCustomParameter:(id)obj forKey:(NSString *)key GTL_NONNULL((2)); - -// Auto-generated request IDs -+ (NSString *)nextRequestID; - -// Methods for subclasses to override. -+ (NSDictionary *)parameterNameMap; -+ (NSDictionary *)arrayPropertyToClassMap; -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLQuery.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLQuery.m deleted file mode 100644 index 55f98223..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLQuery.m +++ /dev/null @@ -1,267 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLQuery.m -// - -#include - -#import "GTLQuery.h" -#import "GTLRuntimeCommon.h" -#import "GTLUtilities.h" - -@interface GTLQuery () -@end - -@implementation GTLQuery - -// Implementation Note: bodyObject could be done as a dynamic property and map -// it to the key "resource". But we expose the object on the ServiceTicket -// for developers, and so sending it through the plumbing already in the -// parameters and outside of that gets into a grey area. For requests sent -// via this class, we don't need to touch the JSON, but for developers that -// have to use the lower level apis for something we'd need to know to add -// it to the JSON. - -@synthesize methodName = methodName_, - JSON = json_, - bodyObject = bodyObject_, - requestID = requestID_, - uploadParameters = uploadParameters_, - urlQueryParameters = urlQueryParameters_, - additionalHTTPHeaders = additionalHTTPHeaders_, - expectedObjectClass = expectedObjectClass_, - shouldSkipAuthorization = skipAuthorization_; - -#if NS_BLOCKS_AVAILABLE -@synthesize completionBlock = completionBlock_; -#endif - -+ (id)queryWithMethodName:(NSString *)methodName { - return [[[self alloc] initWithMethodName:methodName] autorelease]; -} - -- (id)initWithMethodName:(NSString *)methodName { - self = [super init]; - if (self) { - requestID_ = [[[self class] nextRequestID] retain]; - - methodName_ = [methodName copy]; - if ([methodName_ length] == 0) { - [self release]; - self = nil; - } - } - return self; -} - -- (void)dealloc { - [methodName_ release]; - [json_ release]; - [bodyObject_ release]; - [childCache_ release]; - [requestID_ release]; - [uploadParameters_ release]; - [urlQueryParameters_ release]; - [additionalHTTPHeaders_ release]; -#if NS_BLOCKS_AVAILABLE - [completionBlock_ release]; -#endif - - [super dealloc]; -} - - -- (id)copyWithZone:(NSZone *)zone { - GTLQuery *query = - [[[self class] allocWithZone:zone] initWithMethodName:self.methodName]; - - if ([json_ count] > 0) { - // Deep copy the parameters - CFPropertyListRef ref = CFPropertyListCreateDeepCopy(kCFAllocatorDefault, - json_, kCFPropertyListMutableContainers); - query.JSON = [NSMakeCollectable(ref) autorelease]; - } - query.bodyObject = self.bodyObject; - query.requestID = self.requestID; - query.uploadParameters = self.uploadParameters; - query.urlQueryParameters = self.urlQueryParameters; - query.additionalHTTPHeaders = self.additionalHTTPHeaders; - query.expectedObjectClass = self.expectedObjectClass; - query.shouldSkipAuthorization = self.shouldSkipAuthorization; -#if NS_BLOCKS_AVAILABLE - query.completionBlock = self.completionBlock; -#endif - return query; -} - -- (NSString *)description { - NSArray *keys = [self.JSON allKeys]; - NSArray *params = [keys sortedArrayUsingSelector:@selector(compare:)]; - NSString *paramsSummary = @""; - if ([params count] > 0) { - paramsSummary = [NSString stringWithFormat:@" params:(%@)", - [params componentsJoinedByString:@","]]; - } - - keys = [self.urlQueryParameters allKeys]; - NSArray *urlQParams = [keys sortedArrayUsingSelector:@selector(compare:)]; - NSString *urlQParamsSummary = @""; - if ([urlQParams count] > 0) { - urlQParamsSummary = [NSString stringWithFormat:@" urlQParams:(%@)", - [urlQParams componentsJoinedByString:@","]]; - } - - GTLObject *bodyObj = self.bodyObject; - NSString *bodyObjSummary = @""; - if (bodyObj != nil) { - bodyObjSummary = [NSString stringWithFormat:@" bodyObject:%@", [bodyObj class]]; - } - - NSString *uploadStr = @""; - GTLUploadParameters *uploadParams = self.uploadParameters; - if (uploadParams) { - uploadStr = [NSString stringWithFormat:@" %@", uploadParams]; - } - - return [NSString stringWithFormat:@"%@ %p: {method:%@%@%@%@%@}", - [self class], self, self.methodName, - paramsSummary, urlQParamsSummary, bodyObjSummary, uploadStr]; -} - -- (void)setCustomParameter:(id)obj forKey:(NSString *)key { - [self setJSONValue:obj forKey:key]; -} - -- (BOOL)isBatchQuery { - return NO; -} - -- (void)executionDidStop { -#if NS_BLOCKS_AVAILABLE - self.completionBlock = nil; -#endif -} - -+ (NSString *)nextRequestID { - static unsigned long lastRequestID = 0; - NSString *result; - - @synchronized([GTLQuery class]) { - ++lastRequestID; - result = [NSString stringWithFormat:@"gtl_%lu", - (unsigned long) lastRequestID]; - } - return result; -} - -#pragma mark GTLRuntimeCommon Support - -- (void)setJSONValue:(id)obj forKey:(NSString *)key { - NSMutableDictionary *dict = self.JSON; - if (dict == nil && obj != nil) { - dict = [NSMutableDictionary dictionaryWithCapacity:1]; - self.JSON = dict; - } - [dict setValue:obj forKey:key]; -} - -- (id)JSONValueForKey:(NSString *)key { - id obj = [self.JSON objectForKey:key]; - return obj; -} - -// There is no property for childCache_ as there shouldn't be KVC/KVO -// support for it, it's an implementation detail. - -- (void)setCacheChild:(id)obj forKey:(NSString *)key { - if (childCache_ == nil && obj != nil) { - childCache_ = - [[NSMutableDictionary alloc] initWithObjectsAndKeys:obj, key, nil]; - } else { - [childCache_ setValue:obj forKey:key]; - } -} - -- (id)cacheChildForKey:(NSString *)key { - id obj = [childCache_ objectForKey:key]; - return obj; -} - -#pragma mark Methods for Subclasses to Override - -+ (NSDictionary *)parameterNameMap { - return nil; -} - -+ (NSDictionary *)arrayPropertyToClassMap { - return nil; -} - -#pragma mark Runtime Utilities - -static NSMutableDictionary *gParameterNameMapCache = nil; -static NSMutableDictionary *gArrayPropertyToClassMapCache = nil; - -+ (void)initialize { - // note that initialize is guaranteed by the runtime to be called in a - // thread-safe manner - if (gParameterNameMapCache == nil) { - gParameterNameMapCache = [GTLUtilities newStaticDictionary]; - } - if (gArrayPropertyToClassMapCache == nil) { - gArrayPropertyToClassMapCache = [GTLUtilities newStaticDictionary]; - } -} - -+ (NSDictionary *)propertyToJSONKeyMapForClass:(Class)aClass { - NSDictionary *resultMap = - [GTLUtilities mergedClassDictionaryForSelector:@selector(parameterNameMap) - startClass:aClass - ancestorClass:[GTLQuery class] - cache:gParameterNameMapCache]; - return resultMap; -} - -+ (NSDictionary *)arrayPropertyToClassMapForClass:(Class)aClass { - NSDictionary *resultMap = - [GTLUtilities mergedClassDictionaryForSelector:@selector(arrayPropertyToClassMap) - startClass:aClass - ancestorClass:[GTLQuery class] - cache:gArrayPropertyToClassMapCache]; - return resultMap; -} - -#pragma mark Runtime Support - -- (NSDictionary *)surrogates { - // Stub method just needed for RumtimeCommon, query doesn't use surrogates. - return nil; -} - -+ (Class)ancestorClass { - return [GTLQuery class]; -} - -+ (BOOL)resolveInstanceMethod:(SEL)sel { - BOOL resolved = [GTLRuntimeCommon resolveInstanceMethod:sel onClass:self]; - if (resolved) - return YES; - - return [super resolveInstanceMethod:sel]; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLRuntimeCommon.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLRuntimeCommon.h deleted file mode 100644 index 28822b5e..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLRuntimeCommon.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLRuntimeCommon.h -// - - -#import - -#import "GTLDefines.h" - -// This protocol and support class are an internal implementation detail so -// GTLObject and GTLQuery can share some code. - -@protocol GTLRuntimeCommon -@required -// Get/Set properties -- (void)setJSONValue:(id)obj forKey:(NSString *)key; -- (id)JSONValueForKey:(NSString *)key; -// Child cache -- (void)setCacheChild:(id)obj forKey:(NSString *)key; -- (id)cacheChildForKey:(NSString *)key; -// Surrogate class mappings. -- (NSDictionary *)surrogates; -// Key map -+ (NSDictionary *)propertyToJSONKeyMapForClass:(Class)aClass; -// Array item types -+ (NSDictionary *)arrayPropertyToClassMapForClass:(Class)aClass; -// The parent class for dynamic support -+ (Class)ancestorClass; -@end - -@interface GTLRuntimeCommon : NSObject -// Wire things up. -+ (BOOL)resolveInstanceMethod:(SEL)sel onClass:(Class)onClass; -// Helpers -+ (id)objectFromJSON:(id)json - defaultClass:(Class)defaultClass - surrogates:(NSDictionary *)surrogates - isCacheable:(BOOL*)isCacheable; -+ (id)jsonFromAPIObject:(id)obj - expectedClass:(Class)expectedClass - isCacheable:(BOOL*)isCacheable; -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLRuntimeCommon.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLRuntimeCommon.m deleted file mode 100644 index 5f6613d0..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLRuntimeCommon.m +++ /dev/null @@ -1,1141 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLRuntimeCommon.m -// - -#include - -#import "GTLRuntimeCommon.h" - -#import "GTLDateTime.h" -#import "GTLObject.h" -#import "GTLUtilities.h" - -static NSString *const kReturnClassKey = @"returnClass"; -static NSString *const kContainedClassKey = @"containedClass"; -static NSString *const kJSONKey = @"jsonKey"; - -// Note: NSObject's class is used as a marker for the expected/default class -// when Discovery says it can be any type of object. - -@implementation GTLRuntimeCommon - -// Helper to generically convert JSON to an api object type. -+ (id)objectFromJSON:(id)json - defaultClass:(Class)defaultClass - surrogates:(NSDictionary *)surrogates - isCacheable:(BOOL*)isCacheable { - id result = nil; - BOOL canBeCached = YES; - - // TODO(TVL): use defaultClass to validate things like expectedClass is - // done in jsonFromAPIObject:expectedClass:isCacheable:? - - if ([json isKindOfClass:[NSDictionary class]]) { - // If no default, or the default was any object, then default to base - // object here (and hope there is a kind to get the right thing). - if ((defaultClass == Nil) || [defaultClass isEqual:[NSObject class]]) { - defaultClass = [GTLObject class]; - } - result = [GTLObject objectForJSON:json - defaultClass:defaultClass - surrogates:surrogates - batchClassMap:nil]; - } else if ([json isKindOfClass:[NSArray class]]) { - NSArray *jsonArray = json; - // make an object for each JSON dictionary in the array - NSMutableArray *resultArray = [NSMutableArray arrayWithCapacity:[jsonArray count]]; - for (id jsonItem in jsonArray) { - id item = [self objectFromJSON:jsonItem - defaultClass:defaultClass - surrogates:surrogates - isCacheable:NULL]; - [resultArray addObject:item]; - } - result = resultArray; - } else if ([json isKindOfClass:[NSString class]]) { - // DateTimes live in JSON as strings, so convert - if ([defaultClass isEqual:[GTLDateTime class]]) { - result = [GTLDateTime dateTimeWithRFC3339String:json]; - } else { - result = json; - canBeCached = NO; - } - } else if ([json isKindOfClass:[NSNumber class]] || - [json isKindOfClass:[NSNull class]]) { - result = json; - canBeCached = NO; - } else { - GTL_DEBUG_LOG(@"GTLRuntimeCommon: unsupported class '%s' in objectFromJSON", - class_getName([json class])); - } - - if (isCacheable) { - *isCacheable = canBeCached; - } - return result; -} - -// Helper to generically convert an api object type to JSON. -// |expectedClass| is the type that was expected for |obj|. -+ (id)jsonFromAPIObject:(id)obj - expectedClass:(Class)expectedClass - isCacheable:(BOOL*)isCacheable { - id result = nil; - BOOL canBeCached = YES; - BOOL checkExpected = (expectedClass != Nil); - - if ([obj isKindOfClass:[NSString class]]) { - result = [[obj copy] autorelease]; - canBeCached = NO; - } else if ([obj isKindOfClass:[NSNumber class]] || - [obj isKindOfClass:[NSNull class]]) { - result = obj; - canBeCached = NO; - } else if ([obj isKindOfClass:[GTLObject class]]) { - result = [obj JSON]; - if (result == nil) { - // adding an empty object; it should have a JSON dictionary so it can - // hold future assignments - [obj setJSON:[NSMutableDictionary dictionary]]; - result = [obj JSON]; - } - } else if ([obj isKindOfClass:[NSArray class]]) { - checkExpected = NO; - NSArray *array = obj; - // get the JSON for each thing in the array - NSMutableArray *resultArray = [NSMutableArray arrayWithCapacity:[array count]]; - for (id item in array) { - id itemJSON = [self jsonFromAPIObject:item - expectedClass:expectedClass - isCacheable:NULL]; - [resultArray addObject:itemJSON]; - } - result = resultArray; - } else if ([obj isKindOfClass:[GTLDateTime class]]) { - // DateTimes live in JSON as strings, so convert. - GTLDateTime *dateTime = obj; - result = [dateTime stringValue]; - } else { - checkExpected = NO; - GTL_DEBUG_LOG(@"GTLRuntimeCommon: unsupported class '%s' in jsonFromAPIObject", - class_getName([obj class])); - } - - if (checkExpected) { - // If the default was any object, then clear it to skip validation checks. - if ([expectedClass isEqual:[NSObject class]] || - [obj isKindOfClass:[NSNull class]]) { - expectedClass = nil; - } - if (expectedClass && ![obj isKindOfClass:expectedClass]) { - GTL_DEBUG_LOG(@"GTLRuntimeCommon: jsonFromAPIObject expected class '%s' instead got '%s'", - class_getName(expectedClass), class_getName([obj class])); - } - } - - if (isCacheable) { - *isCacheable = canBeCached; - } - return result; -} - -#pragma mark JSON/Object Utilities - -static NSMutableDictionary *gDispatchCache = nil; - -static CFStringRef SelectorKeyCopyDescriptionCallBack(const void *key) { - // Make a CFString from the key - NSString *name = NSStringFromSelector((SEL) key); - CFStringRef str = CFStringCreateCopy(kCFAllocatorDefault, (CFStringRef) name); - return str; -} - -// Save the dispatch details for the specified class and selector -+ (void)setStoredDispatchForClass:(Class)dispatchClass - selector:(SEL)sel - returnClass:(Class)returnClass - containedClass:(Class)containedClass - jsonKey:(NSString *)jsonKey { - // cache structure: - // class -> - // selector -> - // returnClass - // containedClass - // jsonKey - @synchronized([GTLRuntimeCommon class]) { - if (gDispatchCache == nil) { - gDispatchCache = [GTLUtilities newStaticDictionary]; - } - - CFMutableDictionaryRef classDict = - (CFMutableDictionaryRef) [gDispatchCache objectForKey:dispatchClass]; - if (classDict == nil) { - // We create a CFDictionary since the keys are raw selectors rather than - // NSStrings - const CFDictionaryKeyCallBacks keyCallBacks = { - .version = 0, - .retain = NULL, - .release = NULL, - .copyDescription = SelectorKeyCopyDescriptionCallBack, - .equal = NULL, // defaults to pointer comparison - .hash = NULL // defaults to the pointer value - }; - const CFIndex capacity = 0; // no limit - classDict = CFDictionaryCreateMutable(kCFAllocatorDefault, capacity, - &keyCallBacks, - &kCFTypeDictionaryValueCallBacks); - [gDispatchCache setObject:(id)classDict - forKey:(id)dispatchClass]; - CFRelease(classDict); - } - - NSDictionary *selDict = (NSDictionary *)CFDictionaryGetValue(classDict, sel); - if (selDict == nil) { - selDict = [NSDictionary dictionaryWithObjectsAndKeys: - jsonKey, kJSONKey, - returnClass, kReturnClassKey, // can be nil (primitive types) - containedClass, kContainedClassKey, // may be nil - nil]; - CFDictionarySetValue(classDict, sel, selDict); - } else { - // we already have a dictionary for this selector on this class, which is - // surprising - GTL_DEBUG_LOG(@"Storing duplicate dispatch for %@ selector %@", - dispatchClass, NSStringFromSelector(sel)); - } - } -} - -+ (BOOL)getStoredDispatchForClass:(Class)dispatchClass - selector:(SEL)sel - returnClass:(Class *)outReturnClass - containedClass:(Class *)outContainedClass - jsonKey:(NSString **)outJsonKey { - @synchronized([GTLRuntimeCommon class]) { - // walk from this class up the hierarchy to the ancestor class - Class topClass = class_getSuperclass([dispatchClass ancestorClass]); - for (Class currClass = dispatchClass; - currClass != topClass; - currClass = class_getSuperclass(currClass)) { - - CFMutableDictionaryRef classDict = - (CFMutableDictionaryRef) [gDispatchCache objectForKey:currClass]; - if (classDict) { - NSMutableDictionary *selDict = - (NSMutableDictionary *) CFDictionaryGetValue(classDict, sel); - if (selDict) { - if (outReturnClass) { - *outReturnClass = [selDict objectForKey:kReturnClassKey]; - } - if (outContainedClass) { - *outContainedClass = [selDict objectForKey:kContainedClassKey]; - } - if (outJsonKey) { - *outJsonKey = [selDict objectForKey:kJSONKey]; - } - return YES; - } - } - } - } - GTL_DEBUG_LOG(@"Failed to find stored dispatch info for %@ %s", - dispatchClass, sel_getName(sel)); - return NO; -} - -#pragma mark IMPs - getters and setters for specific object types - -#if !__LP64__ - -// NSInteger on 32bit -static NSInteger DynamicInteger32Getter(id self, SEL sel) { - // get an NSInteger (NSNumber) from the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSNumber *num = [self JSONValueForKey:jsonKey]; - num = GTL_EnsureNSNumber(num); - NSInteger result = [num integerValue]; - return result; - } - return 0; -} - -static void DynamicInteger32Setter(id self, SEL sel, NSInteger val) { - // save an NSInteger (NSNumber) into the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSNumber *num = [NSNumber numberWithInteger:val]; - [self setJSONValue:num forKey:jsonKey]; - } -} - -// NSUInteger on 32bit -static NSUInteger DynamicUInteger32Getter(id self, SEL sel) { - // get an NSUInteger (NSNumber) from the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSNumber *num = [self JSONValueForKey:jsonKey]; - num = GTL_EnsureNSNumber(num); - NSUInteger result = [num unsignedIntegerValue]; - return result; - } - return 0; -} - -static void DynamicUInteger32Setter(id self, SEL sel, NSUInteger val) { - // save an NSUInteger (NSNumber) into the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSNumber *num = [NSNumber numberWithUnsignedInteger:val]; - [self setJSONValue:num forKey:jsonKey]; - } -} - -#endif // !__LP64__ - -// NSInteger on 64bit, long long on 32bit and 64bit -static long long DynamicLongLongGetter(id self, SEL sel) { - // get a long long (NSNumber) from the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSNumber *num = [self JSONValueForKey:jsonKey]; - num = GTL_EnsureNSNumber(num); - long long result = [num longLongValue]; - return result; - } - return 0; -} - -static void DynamicLongLongSetter(id self, SEL sel, long long val) { - // save a long long (NSNumber) into the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSNumber *num = [NSNumber numberWithLongLong:val]; - [self setJSONValue:num forKey:jsonKey]; - } -} - -// NSUInteger on 64bit, unsiged long long on 32bit and 64bit -static unsigned long long DynamicULongLongGetter(id self, SEL sel) { - // get an unsigned long long (NSNumber) from the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSNumber *num = [self JSONValueForKey:jsonKey]; - num = GTL_EnsureNSNumber(num); - unsigned long long result = [num unsignedLongLongValue]; - return result; - } - return 0; -} - -static void DynamicULongLongSetter(id self, SEL sel, unsigned long long val) { - // save an unsigned long long (NSNumber) into the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSNumber *num = [NSNumber numberWithUnsignedLongLong:val]; - [self setJSONValue:num forKey:jsonKey]; - } -} - -// float -static float DynamicFloatGetter(id self, SEL sel) { - // get a float (NSNumber) from the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSNumber *num = [self JSONValueForKey:jsonKey]; - num = GTL_EnsureNSNumber(num); - float result = [num floatValue]; - return result; - } - return 0.0f; -} - -static void DynamicFloatSetter(id self, SEL sel, float val) { - // save a float (NSNumber) into the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSNumber *num = [NSNumber numberWithFloat:val]; - [self setJSONValue:num forKey:jsonKey]; - } -} - -// double -static double DynamicDoubleGetter(id self, SEL sel) { - // get a double (NSNumber) from the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSNumber *num = [self JSONValueForKey:jsonKey]; - num = GTL_EnsureNSNumber(num); - double result = [num doubleValue]; - return result; - } - return 0.0; -} - -static void DynamicDoubleSetter(id self, SEL sel, double val) { - // save a double (NSNumber) into the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSNumber *num = [NSNumber numberWithDouble:val]; - [self setJSONValue:num forKey:jsonKey]; - } -} - -// BOOL -static BOOL DynamicBooleanGetter(id self, SEL sel) { - // get a BOOL (NSNumber) from the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSNumber *num = [self JSONValueForKey:jsonKey]; - BOOL flag = [num boolValue]; - return flag; - } - return NO; -} - -static void DynamicBooleanSetter(id self, SEL sel, BOOL val) { - // save a BOOL (NSNumber) into the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSNumber *num = [NSNumber numberWithBool:val]; - [self setJSONValue:num forKey:jsonKey]; - } -} - -// NSString -static NSString *DynamicStringGetter(id self, SEL sel) { - // get an NSString from the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - - NSString *str = [self JSONValueForKey:jsonKey]; - return str; - } - return nil; -} - -static void DynamicStringSetter(id self, SEL sel, - NSString *str) { - // save an NSString into the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - NSString *copiedStr = [str copy]; - [self setJSONValue:copiedStr forKey:jsonKey]; - [copiedStr release]; - } -} - -// GTLDateTime -static GTLDateTime *DynamicDateTimeGetter(id self, SEL sel) { - // get a GTLDateTime from the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - - // Return the cached object before creating on demand. - GTLDateTime *cachedDateTime = [self cacheChildForKey:jsonKey]; - if (cachedDateTime != nil) { - return cachedDateTime; - } - NSString *str = [self JSONValueForKey:jsonKey]; - id cacheValue, resultValue; - if (![str isKindOfClass:[NSNull class]]) { - GTLDateTime *dateTime = [GTLDateTime dateTimeWithRFC3339String:str]; - - cacheValue = dateTime; - resultValue = dateTime; - } else { - cacheValue = nil; - resultValue = [NSNull null]; - } - [self setCacheChild:cacheValue forKey:jsonKey]; - return resultValue; - } - return nil; -} - -static void DynamicDateTimeSetter(id self, SEL sel, - GTLDateTime *dateTime) { - // save an GTLDateTime into the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - id cacheValue, jsonValue; - if (![dateTime isKindOfClass:[NSNull class]]) { - jsonValue = [dateTime stringValue]; - cacheValue = dateTime; - } else { - jsonValue = [NSNull null]; - cacheValue = nil; - } - - [self setJSONValue:jsonValue forKey:jsonKey]; - [self setCacheChild:cacheValue forKey:jsonKey]; - } -} - -// NSNumber -static NSNumber *DynamicNumberGetter(id self, SEL sel) { - // get an NSNumber from the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - - NSNumber *num = [self JSONValueForKey:jsonKey]; - num = GTL_EnsureNSNumber(num); - return num; - } - return nil; -} - -static void DynamicNumberSetter(id self, SEL sel, - NSNumber *num) { - // save an NSNumber into the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - [self setJSONValue:num forKey:jsonKey]; - } -} - -// GTLObject -static GTLObject *DynamicObjectGetter(id self, SEL sel) { - // get a GTLObject from the JSON dictionary - NSString *jsonKey = nil; - Class returnClass = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:&returnClass - containedClass:NULL - jsonKey:&jsonKey]) { - - // Return the cached object before creating on demand. - GTLObject *cachedObj = [self cacheChildForKey:jsonKey]; - if (cachedObj != nil) { - return cachedObj; - } - NSMutableDictionary *dict = [self JSONValueForKey:jsonKey]; - if ([dict isKindOfClass:[NSMutableDictionary class]]) { - // get the class of the object being returned, and instantiate it - if (returnClass == Nil) { - returnClass = [GTLObject class]; - } - - NSDictionary *surrogates = self.surrogates; - GTLObject *obj = [GTLObject objectForJSON:dict - defaultClass:returnClass - surrogates:surrogates - batchClassMap:nil]; - [self setCacheChild:obj forKey:jsonKey]; - return obj; - } else if ([dict isKindOfClass:[NSNull class]]) { - [self setCacheChild:nil forKey:jsonKey]; - return (id) [NSNull null]; - } else if (dict != nil) { - // unexpected; probably got a string -- let the caller figure it out - GTL_DEBUG_LOG(@"GTLObject: unexpected JSON: %@.%@ should be a dictionary, actually is a %@:\n%@", - NSStringFromClass(selfClass), NSStringFromSelector(sel), - NSStringFromClass([dict class]), dict); - return (GTLObject *)dict; - } - } - return nil; -} - -static void DynamicObjectSetter(id self, SEL sel, - GTLObject *obj) { - // save a GTLObject into the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - id cacheValue, jsonValue; - if (![obj isKindOfClass:[NSNull class]]) { - NSMutableDictionary *dict = [obj JSON]; - if (dict == nil && obj != nil) { - // adding an empty object; it should have a JSON dictionary so it can - // hold future assignments - obj.JSON = [NSMutableDictionary dictionary]; - jsonValue = obj.JSON; - } else { - jsonValue = dict; - } - cacheValue = obj; - } else { - jsonValue = [NSNull null]; - cacheValue = nil; - } - [self setJSONValue:jsonValue forKey:jsonKey]; - [self setCacheChild:cacheValue forKey:jsonKey]; - } -} - -// get an NSArray of GTLObjects, NSStrings, or NSNumbers from the -// JSON dictionary for this object -static NSMutableArray *DynamicArrayGetter(id self, SEL sel) { - NSString *jsonKey = nil; - Class containedClass = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:&containedClass - jsonKey:&jsonKey]) { - - // Return the cached array before creating on demand. - NSMutableArray *cachedArray = [self cacheChildForKey:jsonKey]; - if (cachedArray != nil) { - return cachedArray; - } - NSMutableArray *result = nil; - NSArray *array = [self JSONValueForKey:jsonKey]; - if (array != nil) { - if ([array isKindOfClass:[NSArray class]]) { - NSDictionary *surrogates = self.surrogates; - result = [GTLRuntimeCommon objectFromJSON:array - defaultClass:containedClass - surrogates:surrogates - isCacheable:NULL]; - } else { -#if DEBUG - if (![array isKindOfClass:[NSNull class]]) { - GTL_DEBUG_LOG(@"GTLObject: unexpected JSON: %@.%@ should be an array, actually is a %@:\n%@", - NSStringFromClass(selfClass), NSStringFromSelector(sel), - NSStringFromClass([array class]), array); - } -#endif - result = (NSMutableArray *)array; - } - } - - [self setCacheChild:result forKey:jsonKey]; - return result; - } - return nil; -} - -static void DynamicArraySetter(id self, SEL sel, - NSMutableArray *array) { - // save an array of GTLObjects objects into the JSON dictionary - NSString *jsonKey = nil; - Class selfClass = [self class]; - Class containedClass = nil; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:&containedClass - jsonKey:&jsonKey]) { - id json = [GTLRuntimeCommon jsonFromAPIObject:array - expectedClass:containedClass - isCacheable:NULL]; - [self setJSONValue:json forKey:jsonKey]; - [self setCacheChild:array forKey:jsonKey]; - } -} - -// type 'id' -static id DynamicNSObjectGetter(id self, SEL sel) { - NSString *jsonKey = nil; - Class returnClass = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:&returnClass - containedClass:NULL - jsonKey:&jsonKey]) { - - // Return the cached object before creating on demand. - id cachedObj = [self cacheChildForKey:jsonKey]; - if (cachedObj != nil) { - return cachedObj; - } - - id jsonObj = [self JSONValueForKey:jsonKey]; - if (jsonObj != nil) { - BOOL shouldCache = NO; - NSDictionary *surrogates = self.surrogates; - id result = [GTLRuntimeCommon objectFromJSON:jsonObj - defaultClass:nil - surrogates:surrogates - isCacheable:&shouldCache]; - - [self setCacheChild:(shouldCache ? result : nil) - forKey:jsonKey]; - return result; - } - } - return nil; -} - -static void DynamicNSObjectSetter(id self, SEL sel, id obj) { - NSString *jsonKey = nil; - Class selfClass = [self class]; - if ([GTLRuntimeCommon getStoredDispatchForClass:selfClass - selector:sel - returnClass:NULL - containedClass:NULL - jsonKey:&jsonKey]) { - BOOL shouldCache = NO; - id json = [GTLRuntimeCommon jsonFromAPIObject:obj - expectedClass:Nil - isCacheable:&shouldCache]; - [self setJSONValue:json forKey:jsonKey]; - [self setCacheChild:(shouldCache ? obj : nil) - forKey:jsonKey]; - } -} - -#pragma mark Runtime lookup support - -static objc_property_t PropertyForSel(Class startClass, - SEL sel, BOOL isSetter, - Class *outFoundClass) { - const char *baseName = sel_getName(sel); - size_t baseNameLen = strlen(baseName); - if (isSetter) { - baseName += 3; // skip "set" - baseNameLen -= 4; // subtract "set" and the final colon - } - - // walk from this class up the hierarchy to the ancestor class - Class topClass = class_getSuperclass([startClass ancestorClass]); - for (Class currClass = startClass; - currClass != topClass; - currClass = class_getSuperclass(currClass)) { - // step through this class's properties - objc_property_t foundProp = NULL; - objc_property_t *properties = class_copyPropertyList(currClass, NULL); - if (properties) { - for (objc_property_t *prop = properties; *prop != NULL; ++prop) { - const char *propName = property_getName(*prop); - size_t propNameLen = strlen(propName); - - // search for an exact-name match (a getter), but case-insensitive on the - // first character (in case baseName comes from a setter) - if (baseNameLen == propNameLen - && strncasecmp(baseName, propName, 1) == 0 - && (baseNameLen <= 1 - || strncmp(baseName + 1, propName + 1, baseNameLen - 1) == 0)) { - // return the actual property name - foundProp = *prop; - - // if requested, return the class containing the property - if (outFoundClass) *outFoundClass = currClass; - break; - } - } - free(properties); - } - if (foundProp) return foundProp; - } - - // not found; this occasionally happens when the system looks for a method - // like "getFoo" or "descriptionWithLocale:indent:" - return NULL; -} - -typedef struct { - const char *attributePrefix; - - const char *setterEncoding; - IMP setterFunction; - const char *getterEncoding; - IMP getterFunction; - - // These are the "fixed" return classes, but some properties will require - // looking up the return class instead (because it is a subclass of - // GTLObject). - const char *returnClassName; - Class returnClass; - BOOL extractReturnClass; - -} GTLDynamicImpInfo; - -static const GTLDynamicImpInfo *DynamicImpInfoForProperty(objc_property_t prop, - Class *outReturnClass) { - - if (outReturnClass) *outReturnClass = nil; - - // dynamic method resolution: - // http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtDynamicResolution.html - // - // property runtimes: - // http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtPropertyIntrospection.html - - // Get and parse the property attributes, which look something like - // T@"NSString",&,D,P - // Ti,D -- NSInteger on 32bit - // Tq,D -- NSInteger on 64bit, long long on 32bit & 64bit - // Tc,D -- BOOL comes as char - // T@"NSString",D - // T@"GTLLink",D - // T@"NSArray",D - - - static GTLDynamicImpInfo kImplInfo[] = { -#if !__LP64__ - { // NSInteger on 32bit - "Ti", - "v@:i", (IMP)DynamicInteger32Setter, - "i@:", (IMP)DynamicInteger32Getter, - nil, nil, - NO - }, - { // NSUInteger on 32bit - "TI", - "v@:I", (IMP)DynamicUInteger32Setter, - "I@:", (IMP)DynamicUInteger32Getter, - nil, nil, - NO - }, -#endif - { // NSInteger on 64bit, long long on 32bit and 64bit. - "Tq", - "v@:q", (IMP)DynamicLongLongSetter, - "q@:", (IMP)DynamicLongLongGetter, - nil, nil, - NO - }, - { // NSUInteger on 64bit, long long on 32bit and 64bit. - "TQ", - "v@:Q", (IMP)DynamicULongLongSetter, - "Q@:", (IMP)DynamicULongLongGetter, - nil, nil, - NO - }, - { // float - "Tf", - "v@:f", (IMP)DynamicFloatSetter, - "f@:", (IMP)DynamicFloatGetter, - nil, nil, - NO - }, - { // double - "Td", - "v@:d", (IMP)DynamicDoubleSetter, - "d@:", (IMP)DynamicDoubleGetter, - nil, nil, - NO - }, - { // BOOL - "Tc", - "v@:c", (IMP)DynamicBooleanSetter, - "c@:", (IMP)DynamicBooleanGetter, - nil, nil, - NO - }, - { // NSString - "T@\"NSString\"", - "v@:@", (IMP)DynamicStringSetter, - "@@:", (IMP)DynamicStringGetter, - "NSString", nil, - NO - }, - { // NSNumber - "T@\"NSNumber\"", - "v@:@", (IMP)DynamicNumberSetter, - "@@:", (IMP)DynamicNumberGetter, - "NSNumber", nil, - NO - }, - { // GTLDateTime -#if !defined(GTL_TARGET_NAMESPACE) - "T@\"GTLDateTime\"", - "v@:@", (IMP)DynamicDateTimeSetter, - "@@:", (IMP)DynamicDateTimeGetter, - "GTLDateTime", nil, - NO -#else - "T@\"" GTL_TARGET_NAMESPACE_STRING "_" "GTLDateTime\"", - "v@:@", (IMP)DynamicDateTimeSetter, - "@@:", (IMP)DynamicDateTimeGetter, - GTL_TARGET_NAMESPACE_STRING "_" "GTLDateTime", nil, - NO -#endif - }, - { // NSArray with type - "T@\"NSArray\"", - "v@:@", (IMP)DynamicArraySetter, - "@@:", (IMP)DynamicArrayGetter, - "NSArray", nil, - NO - }, - { // id (any of the objects above) - "T@,", - "v@:@", (IMP)DynamicNSObjectSetter, - "@@:", (IMP)DynamicNSObjectGetter, - "NSObject", nil, - NO - }, - { // GTLObject - Last, cause it's a special case and prefix is general - "T@\"", - "v@:@", (IMP)DynamicObjectSetter, - "@@:", (IMP)DynamicObjectGetter, - nil, nil, - YES - }, - }; - - static BOOL hasLookedUpClasses = NO; - if (!hasLookedUpClasses) { - // Unfortunately, you can't put [NSString class] into the static structure, - // so this lookup has to be done at runtime. - hasLookedUpClasses = YES; - for (uint32_t idx = 0; idx < sizeof(kImplInfo)/sizeof(kImplInfo[0]); ++idx) { - if (kImplInfo[idx].returnClassName) { - kImplInfo[idx].returnClass = objc_getClass(kImplInfo[idx].returnClassName); - NSCAssert1(kImplInfo[idx].returnClass != nil, - @"GTLRuntimeCommon: class lookup failed: %s", kImplInfo[idx].returnClassName); - } - } - } - - const char *attr = property_getAttributes(prop); - - const char *dynamicMarker = strstr(attr, ",D"); - if (!dynamicMarker || - (dynamicMarker[2] != 0 && dynamicMarker[2] != ',' )) { - GTL_DEBUG_LOG(@"GTLRuntimeCommon: property %s isn't dynamic, attributes %s", - property_getName(prop), attr ? attr : "(nil)"); - return NULL; - } - - const GTLDynamicImpInfo *result = NULL; - - // Cycle over the list - - for (uint32_t idx = 0; idx < sizeof(kImplInfo)/sizeof(kImplInfo[0]); ++idx) { - const char *attributePrefix = kImplInfo[idx].attributePrefix; - if (strncmp(attr, attributePrefix, strlen(attributePrefix)) == 0) { - result = &kImplInfo[idx]; - if (outReturnClass) *outReturnClass = result->returnClass; - break; - } - } - - if (result == NULL) { - GTL_DEBUG_LOG(@"GTLRuntimeCommon: unexpected attributes %s for property %s", - attr ? attr : "(nil)", property_getName(prop)); - return NULL; - } - - if (result->extractReturnClass && outReturnClass) { - - // add a null at the next quotation mark - char *attrCopy = strdup(attr); - char *classNameStart = attrCopy + 3; - char *classNameEnd = strstr(classNameStart, "\""); - if (classNameEnd) { - *classNameEnd = '\0'; - - // Lookup the return class - *outReturnClass = objc_getClass(classNameStart); - if (*outReturnClass == nil) { - GTL_DEBUG_LOG(@"GTLRuntimeCommon: did not find class with name \"%s\" " - "for property \"%s\" with attributes \"%s\"", - classNameStart, property_getName(prop), attr); - } - } else { - GTL_DEBUG_LOG(@"GTLRuntimeCommon: Failed to find end of class name for " - "property \"%s\" with attributes \"%s\"", - property_getName(prop), attr); - } - free(attrCopy); - } - - return result; -} - -#pragma mark Runtime - wiring point - -+ (BOOL)resolveInstanceMethod:(SEL)sel onClass:(Class)onClass { - // dynamic method resolution: - // http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtDynamicResolution.html - // - // property runtimes: - // http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtPropertyIntrospection.html - - const char *selName = sel_getName(sel); - size_t selNameLen = strlen(selName); - char lastChar = selName[selNameLen - 1]; - BOOL isSetter = (lastChar == ':'); - - // look for a declared property matching this selector name exactly - Class foundClass = nil; - - objc_property_t prop = PropertyForSel(onClass, sel, isSetter, &foundClass); - if (prop != NULL && foundClass != nil) { - - Class returnClass = nil; - const GTLDynamicImpInfo *implInfo = DynamicImpInfoForProperty(prop, - &returnClass); - if (implInfo == NULL) { - GTL_DEBUG_LOG(@"GTLRuntimeCommon: unexpected return type class %s for " - "property \"%s\" of class \"%s\"", - returnClass ? class_getName(returnClass) : "", - property_getName(prop), - class_getName(onClass)); - } - - if (implInfo != NULL) { - IMP imp = ( isSetter ? implInfo->setterFunction : implInfo->getterFunction ); - const char *encoding = ( isSetter ? implInfo->setterEncoding : implInfo->getterEncoding ); - - class_addMethod(foundClass, sel, imp, encoding); - - const char *propName = property_getName(prop); - NSString *propStr = [NSString stringWithUTF8String:propName]; - - // replace the property name with the proper JSON key if it's - // special-cased with a map in the found class; otherwise, the property - // name is the JSON key - NSDictionary *keyMap = - [[foundClass ancestorClass] propertyToJSONKeyMapForClass:foundClass]; - NSString *jsonKey = [keyMap objectForKey:propStr]; - if (jsonKey == nil) { - jsonKey = propStr; - } - - Class containedClass = nil; - - // For arrays we need to look up what the contained class is. - if (imp == (IMP)DynamicArraySetter || imp == (IMP)DynamicArrayGetter) { - NSDictionary *classMap = - [[foundClass ancestorClass] arrayPropertyToClassMapForClass:foundClass]; - containedClass = [classMap objectForKey:jsonKey]; - if (containedClass == Nil) { - GTL_DEBUG_LOG(@"GTLRuntimeCommon: expected array item class for " - "property \"%s\" of class \"%s\"", - property_getName(prop), class_getName(foundClass)); - } - } - - // save the dispatch info to the cache - [GTLRuntimeCommon setStoredDispatchForClass:foundClass - selector:sel - returnClass:returnClass - containedClass:containedClass - jsonKey:jsonKey]; - return YES; - } - } - - return NO; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLService.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLService.h deleted file mode 100644 index eac1dac8..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLService.h +++ /dev/null @@ -1,607 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLService.h -// - -// Service object documentation: -// https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Services_and_Tickets - -#import - -#import "GTLDefines.h" -#import "GTMHTTPFetcherService.h" -#import "GTLBatchQuery.h" -#import "GTLBatchResult.h" -#import "GTLDateTime.h" -#import "GTLErrorObject.h" -#import "GTLFramework.h" -#import "GTLJSONParser.h" -#import "GTLObject.h" -#import "GTLQuery.h" -#import "GTLUtilities.h" - -#undef _EXTERN -#undef _INITIALIZE_AS -#ifdef GTLSERVICE_DEFINE_GLOBALS -#define _EXTERN -#define _INITIALIZE_AS(x) =x -#else -#define _EXTERN extern -#define _INITIALIZE_AS(x) -#endif - -// Error domains -_EXTERN NSString* const kGTLServiceErrorDomain _INITIALIZE_AS(@"com.google.GTLServiceDomain"); -enum { - kGTLErrorQueryResultMissing = -3000, - kGTLErrorWaitTimedOut = -3001 -}; - -_EXTERN NSString* const kGTLJSONRPCErrorDomain _INITIALIZE_AS(@"com.google.GTLJSONRPCErrorDomain"); - -// We'll consistently store the server error string in the userInfo under -// this key -_EXTERN NSString* const kGTLServerErrorStringKey _INITIALIZE_AS(@"error"); - -_EXTERN Class const kGTLUseRegisteredClass _INITIALIZE_AS(nil); - -_EXTERN NSUInteger const kGTLStandardUploadChunkSize _INITIALIZE_AS(NSUIntegerMax); - -// When servers return us structured JSON errors, the NSError will -// contain a GTLErrorObject in the userInfo dictionary under the key -// kGTLStructuredErrorsKey -_EXTERN NSString* const kGTLStructuredErrorKey _INITIALIZE_AS(@"GTLStructuredError"); - -// When specifying an ETag for updating or deleting a single entry, use -// kGTLETagWildcard to tell the server to replace the current value -// unconditionally. Do not use this in entries in a batch feed. -_EXTERN NSString* const kGTLETagWildcard _INITIALIZE_AS(@"*"); - -// Notifications when parsing of a fetcher feed or entry begins or ends -_EXTERN NSString* const kGTLServiceTicketParsingStartedNotification _INITIALIZE_AS(@"kGTLServiceTicketParsingStartedNotification"); -_EXTERN NSString* const kGTLServiceTicketParsingStoppedNotification _INITIALIZE_AS(@"kGTLServiceTicketParsingStoppedNotification"); - -@class GTLServiceTicket; - -// Block types used for fetch callbacks -// -// These typedefs are not used in the header file method declarations -// since it's more useful when code sense expansions show the argument -// types rather than the typedefs - -#if NS_BLOCKS_AVAILABLE -typedef void (^GTLServiceCompletionHandler)(GTLServiceTicket *ticket, id object, NSError *error); - -typedef void (^GTLServiceUploadProgressBlock)(GTLServiceTicket *ticket, unsigned long long numberOfBytesRead, unsigned long long dataLength); -#else -typedef void *GTLServiceCompletionHandler; - -typedef void *GTLServiceUploadProgressBlock; -#endif // NS_BLOCKS_AVAILABLE - -#pragma mark - - -// -// Service base class -// - -@interface GTLService : NSObject { - @private - NSOperationQueue *parseQueue_; - NSString *userAgent_; - GTMHTTPFetcherService *fetcherService_; - NSString *userAgentAddition_; - - NSMutableDictionary *serviceProperties_; // initial values for properties in future tickets - - NSDictionary *surrogates_; // initial value for surrogates in future tickets - - SEL uploadProgressSelector_; // optional - -#if NS_BLOCKS_AVAILABLE - BOOL (^retryBlock_)(GTLServiceTicket *, BOOL, NSError *); - void (^uploadProgressBlock_)(GTLServiceTicket *ticket, - unsigned long long numberOfBytesRead, - unsigned long long dataLength); -#elif !__LP64__ - // Placeholders: for 32-bit builds, keep the size of the object's ivar section - // the same with and without blocks - id retryPlaceholder_; - id uploadProgressPlaceholder_; -#endif - - NSUInteger uploadChunkSize_; // zero when uploading via multi-part MIME http body - - BOOL isRetryEnabled_; // user allows auto-retries - SEL retrySelector_; // optional; set with setServiceRetrySelector - NSTimeInterval maxRetryInterval_; // default to 600. seconds - - BOOL shouldFetchNextPages_; - - NSString *apiKey_; - BOOL isRESTDataWrapperRequired_; - NSString *apiVersion_; - NSURL *rpcURL_; - NSURL *rpcUploadURL_; - NSDictionary *urlQueryParameters_; - NSDictionary *additionalHTTPHeaders_; -} - -#pragma mark Query Execution - -// The finishedSelector has a signature matching: -// -// - (void)serviceTicket:(GTLServiceTicket *)ticket -// finishedWithObject:(GTLObject *)object -// error:(NSError *)error -// -// If an error occurs, the error parameter will be non-nil. Otherwise, -// the object parameter will point to a GTLObject, if any was returned by -// the fetch. (Delete fetches return no object, so the second parameter will -// be nil.) -// -// If the query object is a GTLBatchQuery, the object passed to the callback -// will be a GTLBatchResult; see the batch query documentation: -// https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Batch_Operations - -- (GTLServiceTicket *)executeQuery:(id)query - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -#if NS_BLOCKS_AVAILABLE -- (GTLServiceTicket *)executeQuery:(id)query - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); -#endif - -// Automatic page fetches -// -// Tickets can optionally do a sequence of fetches for queries where -// repeated requests with nextPageToken or nextStartIndex values is required to -// retrieve items of all pages of the response collection. The client's -// callback is invoked only when all items have been retrieved, or an error has -// occurred. During the fetch, the items accumulated so far are available from -// the ticket. -// -// Note that the final object may be a combination of multiple page responses -// so it may not be the same as if all results had been returned in a single -// page. Some fields of the response such as total item counts may reflect only -// the final page's values. -// -// Automatic page fetches will return an error if more than 25 page fetches are -// required. For debug builds, this will log a warning to the console when more -// than 2 page fetches occur, as a reminder that the query's maxResults -// parameter should probably be increased to specify more items returned per -// page. -// -// Default value is NO. -@property (nonatomic, assign) BOOL shouldFetchNextPages; - -// Retrying; see comments on retry support at the top of GTMHTTPFetcher. -// -// Default value is NO. -@property (nonatomic, assign, getter=isRetryEnabled) BOOL retryEnabled; - -// Some services require a developer key for quotas and limits. Setting this -// will include it on all request sent to this service via a GTLQuery class. -@property (nonatomic, copy) NSString *APIKey; - -// An authorizer adds user authentication headers to the request as needed. -@property (nonatomic, retain) id authorizer; - -// Retry selector is optional for retries. -// -// If present, it should have the signature: -// -(BOOL)ticket:(GTLServiceTicket *)ticket willRetry:(BOOL)suggestedWillRetry forError:(NSError *)error -// and return YES to cause a retry. Note that unlike the GTMHTTPFetcher retry -// selector, this selector's first argument is a ticket, not a fetcher. - -@property (nonatomic, assign) SEL retrySelector; -#if NS_BLOCKS_AVAILABLE -@property (copy) BOOL (^retryBlock)(GTLServiceTicket *ticket, BOOL suggestedWillRetry, NSError *error); -#endif - -@property (nonatomic, assign) NSTimeInterval maxRetryInterval; - -// -// Fetches may be done using RPC or REST APIs, without creating -// a GTLQuery object -// - -#pragma mark RPC Fetch Methods - -// -// These methods may be used for RPC fetches without creating a GTLQuery object -// - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - parameters:(NSDictionary *)parameters - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - insertingObject:(GTLObject *)bodyObject - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - parameters:(NSDictionary *)parameters - insertingObject:(GTLObject *)bodyObject - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -#if NS_BLOCKS_AVAILABLE -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - parameters:(NSDictionary *)parameters - objectClass:(Class)objectClass - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - insertingObject:(GTLObject *)bodyObject - objectClass:(Class)objectClass - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - parameters:(NSDictionary *)parameters - insertingObject:(GTLObject *)bodyObject - objectClass:(Class)objectClass - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); -#endif - -#pragma mark REST Fetch Methods - -- (GTLServiceTicket *)fetchObjectWithURL:(NSURL *)objectURL - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectWithURL:(NSURL *)objectURL - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchPublicObjectWithURL:(NSURL *)objectURL - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectByInsertingObject:(GTLObject *)bodyToPut - forURL:(NSURL *)destinationURL - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1,2)); - -- (GTLServiceTicket *)fetchObjectByUpdatingObject:(GTLObject *)bodyToPut - forURL:(NSURL *)destinationURL - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1,2)); - -- (GTLServiceTicket *)deleteResourceURL:(NSURL *)destinationURL - ETag:(NSString *)etagOrNil - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector GTL_NONNULL((1)); - -#if NS_BLOCKS_AVAILABLE -- (GTLServiceTicket *)fetchObjectWithURL:(NSURL *)objectURL - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectByInsertingObject:(GTLObject *)bodyToPut - forURL:(NSURL *)destinationURL - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); - -- (GTLServiceTicket *)fetchObjectByUpdatingObject:(GTLObject *)bodyToPut - forURL:(NSURL *)destinationURL - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); - -- (GTLServiceTicket *)deleteResourceURL:(NSURL *)destinationURL - ETag:(NSString *)etagOrNil - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler GTL_NONNULL((1)); -#endif - -#pragma mark User Properties - -// Properties and userData are supported for client convenience. -// -// Property keys beginning with _ are reserved by the library. -// -// The service properties dictionary is copied to become the initial property -// dictionary for each ticket. -- (void)setServiceProperty:(id)obj forKey:(NSString *)key GTL_NONNULL((2)); // pass nil obj to remove property -- (id)servicePropertyForKey:(NSString *)key GTL_NONNULL((1)); - -@property (nonatomic, copy) NSDictionary *serviceProperties; - -// The service userData becomes the initial value for each future ticket's -// userData. -@property (nonatomic, retain) id serviceUserData; - -#pragma mark Request Settings - -// Set the surrogates to be used for future tickets. Surrogates are subclasses -// to be used instead of standard classes when creating objects from the JSON. -// For example, this code will make the framework generate objects -// using MyCalendarItemSubclass instead of GTLItemCalendar and -// MyCalendarEventSubclass instead of GTLItemCalendarEvent. -// -// NSDictionary *surrogates = [NSDictionary dictionaryWithObjectsAndKeys: -// [MyCalendarEntrySubclass class], [GTLItemCalendar class], -// [MyCalendarEventSubclass class], [GTLItemCalendarEvent class], -// nil]; -// [calendarService setServiceSurrogates:surrogates]; -// -@property (nonatomic, retain) NSDictionary *surrogates; - -// On iOS 4 and later, the fetch may optionally continue in the background -// until finished or stopped by OS expiration. -// -// The default value is NO. -// -// For Mac OS X, background fetches are always supported, and this property -// is ignored. -@property (nonatomic, assign) BOOL shouldFetchInBackground; - -// Callbacks can be invoked on an operation queue rather than via the run loop -// starting on 10.7 and iOS 6. Do not specify both run loop modes and an -// operation queue. Specifying a delegate queue typically looks like this: -// -// service.delegateQueue = [[[NSOperationQueue alloc] init] autorelease]; -// -// Since the callbacks will be on a thread of the operation queue, the client -// may re-dispatch from the callbacks to a known dispatch queue or to the -// main queue. -@property (nonatomic, retain) NSOperationQueue *delegateQueue; - -// Run loop modes are used for scheduling NSURLConnections. -// -// The default value, nil, schedules connections using the current run -// loop mode. To use the service during a modal dialog, be sure to specify -// NSModalPanelRunLoopMode as one of the modes. -@property (nonatomic, retain) NSArray *runLoopModes; - -// Applications needing an additional identifier in the server logs may specify -// one. -@property (nonatomic, copy) NSString *userAgentAddition; - -// Applications have a default user-agent based on the application signature -// in the Info.plist settings. Most applications should not explicitly set -// this property. -@property (nonatomic, copy) NSString *userAgent; - -// The request user agent includes the library and OS version appended to the -// base userAgent, along with the optional addition string. -@property (nonatomic, readonly) NSString *requestUserAgent; - -// Applications may call requestForURL:httpMethod to get a request with the -// proper user-agent and ETag headers -// -// For http method, pass nil (for default GET method), POST, PUT, or DELETE -- (NSMutableURLRequest *)requestForURL:(NSURL *)url - ETag:(NSString *)etagOrNil - httpMethod:(NSString *)httpMethodOrNil GTL_NONNULL((1)); - -// objectRequestForURL returns an NSMutableURLRequest for a JSON GTL object -// -// The object is the object being sent to the server, or nil; -// the http method may be nil for GET, or POST, PUT, DELETE -- (NSMutableURLRequest *)objectRequestForURL:(NSURL *)url - object:(GTLObject *)object - ETag:(NSString *)etag - httpMethod:(NSString *)httpMethod - isREST:(BOOL)isREST - additionalHeaders:(NSDictionary *)additionalHeaders - ticket:(GTLServiceTicket *)ticket GTL_NONNULL((1)); - -// The queue used for parsing JSON responses (previously this property -// was called operationQueue) -@property (nonatomic, retain) NSOperationQueue *parseQueue; - -// The fetcher service object issues the GTMHTTPFetcher instances -// for this API service -@property (nonatomic, retain) GTMHTTPFetcherService *fetcherService; - -// Default storage for cookies is in the service object's fetchHistory. -// -// Apps that want to share cookies between all standalone fetchers and the -// service object may specify static application-wide cookie storage, -// kGTMHTTPFetcherCookieStorageMethodStatic. -@property (nonatomic, assign) NSInteger cookieStorageMethod; - -// When sending REST style queries, should the payload be wrapped in a "data" -// element, and will the reply be wrapped in an "data" element. -@property (nonatomic, assign) BOOL isRESTDataWrapperRequired; - -// Any url query parameters to add to urls (useful for debugging with some -// services). -@property (copy) NSDictionary *urlQueryParameters; - -// Any extra http headers to set on requests for GTLObjects. -@property (copy) NSDictionary *additionalHTTPHeaders; - -// The service API version. -@property (nonatomic, copy) NSString *apiVersion; - -// The URL for sending RPC requests for this service. -@property (nonatomic, retain) NSURL *rpcURL; - -// The URL for sending RPC requests which initiate file upload. -@property (nonatomic, retain) NSURL *rpcUploadURL; - -// Set a non-zero value to enable uploading via chunked fetches -// (resumable uploads); typically this defaults to kGTLStandardUploadChunkSize -// for service subclasses that support chunked uploads -@property (nonatomic, assign) NSUInteger serviceUploadChunkSize; - -// Service subclasses may specify their own default chunk size -+ (NSUInteger)defaultServiceUploadChunkSize; - -// The service uploadProgressSelector becomes the initial value for each future -// ticket's uploadProgressSelector. -// -// The optional uploadProgressSelector will be called in the delegate as bytes -// are uploaded to the server. It should have a signature matching -// -// - (void)ticket:(GTLServiceTicket *)ticket -// hasDeliveredByteCount:(unsigned long long)numberOfBytesRead -// ofTotalByteCount:(unsigned long long)dataLength; -@property (nonatomic, assign) SEL uploadProgressSelector; - -#if NS_BLOCKS_AVAILABLE -@property (copy) void (^uploadProgressBlock)(GTLServiceTicket *ticket, unsigned long long numberOfBytesRead, unsigned long long dataLength); -#endif - -// Wait synchronously for fetch to complete (strongly discouraged) -// -// This just runs the current event loop until the fetch completes -// or the timout limit is reached. This may discard unexpected events -// that occur while spinning, so it's really not appropriate for use -// in serious applications. -// -// Returns true if an object was successfully fetched. If the wait -// timed out, returns false and the returned error is nil. -// -// The returned object or error, if any, will be already autoreleased -// -// This routine will likely be removed in some future releases of the library. -- (BOOL)waitForTicket:(GTLServiceTicket *)ticket - timeout:(NSTimeInterval)timeoutInSeconds - fetchedObject:(GTLObject **)outObjectOrNil - error:(NSError **)outErrorOrNil GTL_NONNULL((1)); -@end - -#pragma mark - - -// -// Ticket base class -// -@interface GTLServiceTicket : NSObject { - GTLService *service_; - - NSMutableDictionary *ticketProperties_; - NSDictionary *surrogates_; - - GTMHTTPFetcher *objectFetcher_; - SEL uploadProgressSelector_; - BOOL shouldFetchNextPages_; - BOOL isRetryEnabled_; - SEL retrySelector_; - NSTimeInterval maxRetryInterval_; - -#if NS_BLOCKS_AVAILABLE - BOOL (^retryBlock_)(GTLServiceTicket *, BOOL, NSError *); - void (^uploadProgressBlock_)(GTLServiceTicket *ticket, - unsigned long long numberOfBytesRead, - unsigned long long dataLength); -#elif !__LP64__ - // Placeholders: for 32-bit builds, keep the size of the object's ivar section - // the same with and without blocks - id retryPlaceholder_; - id uploadProgressPlaceholder_; -#endif - - GTLObject *postedObject_; - GTLObject *fetchedObject_; - id executingQuery_; - id originalQuery_; - NSError *fetchError_; - BOOL hasCalledCallback_; - NSUInteger pagesFetchedCounter_; - - NSString *apiKey_; - BOOL isREST_; - - NSOperation *parseOperation_; -} - -+ (id)ticketForService:(GTLService *)service; - -- (id)initWithService:(GTLService *)service; - -- (id)service; - -#pragma mark Execution Control -// if cancelTicket is called, the fetch is stopped if it is in progress, -// the callbacks will not be called, and the ticket will no longer be useful -// (though the client must still release the ticket if it retained the ticket) -- (void)cancelTicket; - -// chunked upload tickets may be paused -- (void)pauseUpload; -- (void)resumeUpload; -- (BOOL)isUploadPaused; - -@property (nonatomic, retain) GTMHTTPFetcher *objectFetcher; -@property (nonatomic, assign) SEL uploadProgressSelector; - -// Services which do not require an user authorization may require a developer -// API key for quota management -@property (nonatomic, copy) NSString *APIKey; - -#pragma mark User Properties - -// Properties and userData are supported for client convenience. -// -// Property keys beginning with _ are reserved by the library. -- (void)setProperty:(id)obj forKey:(NSString *)key GTL_NONNULL((1)); // pass nil obj to remove property -- (id)propertyForKey:(NSString *)key; - -@property (nonatomic, copy) NSDictionary *properties; -@property (nonatomic, retain) id userData; - -#pragma mark Payload - -@property (nonatomic, retain) GTLObject *postedObject; -@property (nonatomic, retain) GTLObject *fetchedObject; -@property (nonatomic, retain) id executingQuery; // Query currently being fetched by this ticket -@property (nonatomic, retain) id originalQuery; // Query used to create this ticket -- (GTLQuery *)queryForRequestID:(NSString *)requestID GTL_NONNULL((1)); // Returns the query from within the batch with the given id. - -@property (nonatomic, retain) NSDictionary *surrogates; - -#pragma mark Retry - -@property (nonatomic, assign, getter=isRetryEnabled) BOOL retryEnabled; -@property (nonatomic, assign) SEL retrySelector; -#if NS_BLOCKS_AVAILABLE -@property (copy) BOOL (^retryBlock)(GTLServiceTicket *ticket, BOOL suggestedWillRetry, NSError *error); -#endif -@property (nonatomic, assign) NSTimeInterval maxRetryInterval; - -#pragma mark Status - -@property (nonatomic, readonly) NSInteger statusCode; // server status from object fetch -@property (nonatomic, retain) NSError *fetchError; -@property (nonatomic, assign) BOOL hasCalledCallback; - -#pragma mark Pagination - -@property (nonatomic, assign) BOOL shouldFetchNextPages; -@property (nonatomic, assign) NSUInteger pagesFetchedCounter; - -#pragma mark Upload - -#if NS_BLOCKS_AVAILABLE -@property (copy) void (^uploadProgressBlock)(GTLServiceTicket *ticket, unsigned long long numberOfBytesRead, unsigned long long dataLength); -#endif - -@end - - -// Category to provide opaque access to tickets stored in fetcher properties -@interface GTMHTTPFetcher (GTLServiceTicketAdditions) -- (id)ticket; -@end - diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLService.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLService.m deleted file mode 100644 index dee1bb90..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLService.m +++ /dev/null @@ -1,2417 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLService.m -// - -#import -#if TARGET_OS_MAC -#include -#endif - -#if TARGET_OS_IPHONE -#import -#endif - -#define GTLSERVICE_DEFINE_GLOBALS 1 -#import "GTLService.h" - -static NSString *const kUserDataPropertyKey = @"_userData"; - -static NSString* const kFetcherDelegateKey = @"_delegate"; -static NSString* const kFetcherObjectClassKey = @"_objectClass"; -static NSString* const kFetcherFinishedSelectorKey = @"_finishedSelector"; -static NSString* const kFetcherCompletionHandlerKey = @"_completionHandler"; -static NSString* const kFetcherTicketKey = @"_ticket"; -static NSString* const kFetcherFetchErrorKey = @"_fetchError"; -static NSString* const kFetcherParsingNotificationKey = @"_parseNotification"; -static NSString* const kFetcherParsedObjectKey = @"_parsedObject"; -static NSString* const kFetcherBatchClassMapKey = @"_batchClassMap"; -static NSString* const kFetcherCallbackThreadKey = @"_callbackThread"; -static NSString* const kFetcherCallbackRunLoopModesKey = @"_runLoopModes"; - -static const NSUInteger kMaxNumberOfNextPagesFetched = 25; - -// we'll enforce 50K chunks minimum just to avoid the server getting hit -// with too many small upload chunks -static const NSUInteger kMinimumUploadChunkSize = 50000; -static const NSUInteger kStandardUploadChunkSize = NSUIntegerMax; - -// Helper to get the ETag if it is defined on an object. -static NSString *ETagIfPresent(GTLObject *obj) { - NSString *result = [obj.JSON objectForKey:@"etag"]; - return result; -} - -@interface GTLServiceTicket () -@property (retain) NSOperation *parseOperation; -@property (assign) BOOL isREST; -@end - -// category to provide opaque access to tickets stored in fetcher properties -@implementation GTMHTTPFetcher (GTLServiceTicketAdditions) -- (id)ticket { - return [self propertyForKey:kFetcherTicketKey]; -} -@end - -// If GTMHTTPUploadFetcher is available, it can be used for chunked uploads -// -// We locally declare some methods of GTMHTTPUploadFetcher so we -// do not need to import the header, as some projects may not have it available -@interface GTMHTTPUploadFetcher : GTMHTTPFetcher -+ (GTMHTTPUploadFetcher *)uploadFetcherWithRequest:(NSURLRequest *)request - uploadData:(NSData *)data - uploadMIMEType:(NSString *)uploadMIMEType - chunkSize:(NSUInteger)chunkSize - fetcherService:(GTMHTTPFetcherService *)fetcherService; -+ (GTMHTTPUploadFetcher *)uploadFetcherWithRequest:(NSURLRequest *)request - uploadFileHandle:(NSFileHandle *)uploadFileHandle - uploadMIMEType:(NSString *)uploadMIMEType - chunkSize:(NSUInteger)chunkSize - fetcherService:(GTMHTTPFetcherService *)fetcherService; -+ (GTMHTTPUploadFetcher *)uploadFetcherWithLocation:(NSURL *)location - uploadFileHandle:(NSFileHandle *)fileHandle - uploadMIMEType:(NSString *)uploadMIMEType - chunkSize:(NSUInteger)chunkSize - fetcherService:(GTMHTTPFetcherService *)fetcherService; -- (void)pauseFetching; -- (void)resumeFetching; -- (BOOL)isPaused; -@end - - -@interface GTLService () -- (void)prepareToParseObjectForFetcher:(GTMHTTPFetcher *)fetcher; -- (void)handleParsedObjectForFetcher:(GTMHTTPFetcher *)fetcher; -- (BOOL)fetchNextPageWithQuery:(GTLQuery *)query - delegate:(id)delegate - didFinishedSelector:(SEL)finishedSelector - completionHandler:(GTLServiceCompletionHandler)completionHandler - ticket:(GTLServiceTicket *)ticket; -- (id )nextPageQueryForQuery:(GTLQuery *)query - result:(GTLObject *)object - ticket:(GTLServiceTicket *)ticket; -- (GTLObject *)mergedNewResultObject:(GTLObject *)newResult - oldResultObject:(GTLObject *)oldResult - forQuery:(GTLQuery *)query; -- (GTMHTTPUploadFetcher *)uploadFetcherWithRequest:(NSURLRequest *)request - fetcherService:(GTMHTTPFetcherService *)fetcherService - params:(GTLUploadParameters *)uploadParams; -+ (void)invokeCallback:(SEL)callbackSel - target:(id)target - ticket:(id)ticket - object:(id)object - error:(id)error; -- (BOOL)invokeRetrySelector:(SEL)retrySelector - delegate:(id)delegate - ticket:(GTLServiceTicket *)ticket - willRetry:(BOOL)willRetry - error:(NSError *)error; -- (BOOL)objectFetcher:(GTMHTTPFetcher *)fetcher - willRetry:(BOOL)willRetry - forError:(NSError *)error; -- (void)objectFetcher:(GTMHTTPFetcher *)fetcher - finishedWithData:(NSData *)data - error:(NSError *)error; -- (void)parseObjectFromDataOfFetcher:(GTMHTTPFetcher *)fetcher; -@end - -@interface GTLObject (StandardProperties) -@property (retain) NSString *ETag; -@property (retain) NSString *nextPageToken; -@property (retain) NSNumber *nextStartIndex; -@end - -@implementation GTLService - -@synthesize userAgentAddition = userAgentAddition_, - fetcherService = fetcherService_, - parseQueue = parseQueue_, - shouldFetchNextPages = shouldFetchNextPages_, - surrogates = surrogates_, - uploadProgressSelector = uploadProgressSelector_, - retryEnabled = isRetryEnabled_, - retrySelector = retrySelector_, - maxRetryInterval = maxRetryInterval_, - APIKey = apiKey_, - isRESTDataWrapperRequired = isRESTDataWrapperRequired_, - urlQueryParameters = urlQueryParameters_, - additionalHTTPHeaders = additionalHTTPHeaders_, - apiVersion = apiVersion_, - rpcURL = rpcURL_, - rpcUploadURL = rpcUploadURL_; - -#if NS_BLOCKS_AVAILABLE -@synthesize retryBlock = retryBlock_, - uploadProgressBlock = uploadProgressBlock_; -#endif - -+ (Class)ticketClass { - return [GTLServiceTicket class]; -} - -- (id)init { - self = [super init]; - if (self) { - -#if GTL_IPHONE || (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5) - // For 10.6 and up, always use an operation queue - parseQueue_ = [[NSOperationQueue alloc] init]; -#elif !GTL_SKIP_PARSE_THREADING - // Avoid NSOperationQueue prior to 10.5.6, per - // http://www.mikeash.com/?page=pyblog/use-nsoperationqueue.html - SInt32 bcdSystemVersion = 0; - (void) Gestalt(gestaltSystemVersion, &bcdSystemVersion); - - if (bcdSystemVersion >= 0x1057) { - parseQueue_ = [[NSOperationQueue alloc] init]; - } -#else - // parseQueue_ defaults to nil, so parsing will be done immediately - // on the current thread -#endif - - fetcherService_ = [[GTMHTTPFetcherService alloc] init]; - - NSUInteger chunkSize = [[self class] defaultServiceUploadChunkSize]; - self.serviceUploadChunkSize = chunkSize; - } - return self; -} - -- (void)dealloc { - [parseQueue_ release]; - [userAgent_ release]; - [fetcherService_ release]; - [userAgentAddition_ release]; - [serviceProperties_ release]; - [surrogates_ release]; -#if NS_BLOCKS_AVAILABLE - [uploadProgressBlock_ release]; - [retryBlock_ release]; -#endif - [apiKey_ release]; - [apiVersion_ release]; - [rpcURL_ release]; - [rpcUploadURL_ release]; - [urlQueryParameters_ release]; - [additionalHTTPHeaders_ release]; - - [super dealloc]; -} - -- (NSString *)requestUserAgent { - NSString *userAgent = self.userAgent; - if ([userAgent length] == 0) { - // the service instance is missing an explicit user-agent; use the bundle ID - // or process name - NSBundle *owningBundle = [NSBundle bundleForClass:[self class]]; - if (owningBundle == nil - || [[owningBundle bundleIdentifier] isEqual:@"com.google.GTLFramework"]) { - - owningBundle = [NSBundle mainBundle]; - } - - userAgent = GTMApplicationIdentifier(owningBundle); - } - - NSString *requestUserAgent = userAgent; - - // if the user agent already specifies the library version, we'll - // use it verbatim in the request - NSString *libraryString = @"google-api-objc-client"; - NSRange libRange = [userAgent rangeOfString:libraryString - options:NSCaseInsensitiveSearch]; - if (libRange.location == NSNotFound) { - // the user agent doesn't specify the client library, so append that - // information, and the system version - NSString *libVersionString = GTLFrameworkVersionString(); - - NSString *systemString = GTMSystemVersionString(); - - // We don't clean this with GTMCleanedUserAgentString so spaces are - // preserved - NSString *userAgentAddition = self.userAgentAddition; - NSString *customString = userAgentAddition ? - [@" " stringByAppendingString:userAgentAddition] : @""; - - // Google servers look for gzip in the user agent before sending gzip- - // encoded responses. See Service.java - requestUserAgent = [NSString stringWithFormat:@"%@ %@/%@ %@%@ (gzip)", - userAgent, libraryString, libVersionString, systemString, customString]; - } - return requestUserAgent; -} - -- (NSMutableURLRequest *)requestForURL:(NSURL *)url - ETag:(NSString *)etag - httpMethod:(NSString *)httpMethod - ticket:(GTLServiceTicket *)ticket { - - // subclasses may add headers to this - NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] initWithURL:url - cachePolicy:NSURLRequestReloadIgnoringCacheData - timeoutInterval:60] autorelease]; - NSString *requestUserAgent = self.requestUserAgent; - [request setValue:requestUserAgent forHTTPHeaderField:@"User-Agent"]; - - if ([httpMethod length] > 0) { - [request setHTTPMethod:httpMethod]; - } - - if ([etag length] > 0) { - - // it's rather unexpected for an etagged object to be provided for a GET, - // but we'll check for an etag anyway, similar to HttpGDataRequest.java, - // and if present use it to request only an unchanged resource - - BOOL isDoingHTTPGet = (httpMethod == nil - || [httpMethod caseInsensitiveCompare:@"GET"] == NSOrderedSame); - - if (isDoingHTTPGet) { - - // set the etag header, even if weak, indicating we don't want - // another copy of the resource if it's the same as the object - [request setValue:etag forHTTPHeaderField:@"If-None-Match"]; - - } else { - - // if we're doing PUT or DELETE, set the etag header indicating - // we only want to update the resource if our copy matches the current - // one (unless the etag is weak and so shouldn't be a constraint at all) - BOOL isWeakETag = [etag hasPrefix:@"W/"]; - - BOOL isModifying = - [httpMethod caseInsensitiveCompare:@"PUT"] == NSOrderedSame - || [httpMethod caseInsensitiveCompare:@"DELETE"] == NSOrderedSame - || [httpMethod caseInsensitiveCompare:@"PATCH"] == NSOrderedSame; - - if (isModifying && !isWeakETag) { - [request setValue:etag forHTTPHeaderField:@"If-Match"]; - } - } - } - - return request; -} - -- (NSMutableURLRequest *)requestForURL:(NSURL *)url - ETag:(NSString *)etag - httpMethod:(NSString *)httpMethod { - // this public entry point authenticates from the service object but - // not from the auth token in the ticket - return [self requestForURL:url ETag:etag httpMethod:httpMethod ticket:nil]; -} - -// objectRequestForURL returns an NSMutableURLRequest for a GTLObject -// -// the object is the object being sent to the server, or nil; -// the http method may be nil for get, or POST, PUT, DELETE - -- (NSMutableURLRequest *)objectRequestForURL:(NSURL *)url - object:(GTLObject *)object - ETag:(NSString *)etag - httpMethod:(NSString *)httpMethod - isREST:(BOOL)isREST - additionalHeaders:(NSDictionary *)additionalHeaders - ticket:(GTLServiceTicket *)ticket { - if (object) { - // if the object being sent has an etag, add it to the request header to - // avoid retrieving a duplicate or to avoid writing over an updated - // version of the resource on the server - // - // Typically, delete requests will provide an explicit ETag parameter, and - // other requests will have the ETag carried inside the object being updated - if (etag == nil) { - SEL selEtag = @selector(ETag); - if ([object respondsToSelector:selEtag]) { - etag = [object performSelector:selEtag]; - } - } - } - - NSMutableURLRequest *request = [self requestForURL:url - ETag:etag - httpMethod:httpMethod - ticket:ticket]; - NSString *acceptValue; - NSString *contentTypeValue; - if (isREST) { - acceptValue = @"application/json"; - contentTypeValue = @"application/json; charset=utf-8"; - } else { - acceptValue = @"application/json-rpc"; - contentTypeValue = @"application/json-rpc; charset=utf-8"; - } - [request setValue:acceptValue forHTTPHeaderField:@"Accept"]; - [request setValue:contentTypeValue forHTTPHeaderField:@"Content-Type"]; - - [request setValue:@"no-cache" forHTTPHeaderField:@"Cache-Control"]; - - // Add the additional http headers from the service, and then from the query - NSDictionary *headers = self.additionalHTTPHeaders; - for (NSString *key in headers) { - NSString *value = [headers valueForKey:key]; - [request setValue:value forHTTPHeaderField:key]; - } - - headers = additionalHeaders; - for (NSString *key in headers) { - NSString *value = [headers valueForKey:key]; - [request setValue:value forHTTPHeaderField:key]; - } - - return request; -} - -#pragma mark - - -// common fetch starting method - -- (GTLServiceTicket *)fetchObjectWithURL:(NSURL *)targetURL - objectClass:(Class)objectClass - bodyObject:(GTLObject *)bodyObject - dataToPost:(NSData *)dataToPost - ETag:(NSString *)etag - httpMethod:(NSString *)httpMethod - mayAuthorize:(BOOL)mayAuthorize - isREST:(BOOL)isREST - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector - completionHandler:(id)completionHandler // GTLServiceCompletionHandler - executingQuery:(id)query - ticket:(GTLServiceTicket *)ticket { - - GTMAssertSelectorNilOrImplementedWithArgs(delegate, finishedSelector, @encode(GTLServiceTicket *), @encode(GTLObject *), @encode(NSError *), 0); - - // The completionHandler argument is declared as an id, not as a block - // pointer, so this can be built with the 10.6 SDK and still run on 10.5. - // If the argument were declared as a block pointer, the invocation for - // fetchObjectWithURL: created in GTLService would cause an exception - // since 10.5's NSInvocation cannot deal with encoding of block pointers. - - GTL_DEBUG_ASSERT(targetURL != nil, @"no url?"); - if (targetURL == nil) return nil; - - // we need to create a ticket unless one was created earlier (like during - // authentication) - if (!ticket) { - ticket = [[[self class] ticketClass] ticketForService:self]; - } - - ticket.isREST = isREST; - - // Add any service specific query parameters. - NSDictionary *urlQueryParameters = self.urlQueryParameters; - if ([urlQueryParameters count] > 0) { - targetURL = [GTLUtilities URLWithString:[targetURL absoluteString] - queryParameters:urlQueryParameters]; - } - - // If this is REST and there is a developer key, add it onto the url. RPC - // adds the key into the payload, not on the url. - NSString *apiKey = self.APIKey; - if (isREST && [apiKey length] > 0) { - NSString *const kDeveloperAPIQueryParamKey = @"key"; - NSDictionary *queryParameters; - queryParameters = [NSDictionary dictionaryWithObject:apiKey - forKey:kDeveloperAPIQueryParamKey]; - targetURL = [GTLUtilities URLWithString:[targetURL absoluteString] - queryParameters:queryParameters]; - } - - NSDictionary *additionalHeaders = query.additionalHTTPHeaders; - - NSMutableURLRequest *request = [self objectRequestForURL:targetURL - object:bodyObject - ETag:etag - httpMethod:httpMethod - isREST:isREST - additionalHeaders:additionalHeaders - ticket:ticket]; - - GTMAssertSelectorNilOrImplementedWithArgs(delegate, ticket.uploadProgressSelector, - @encode(GTLServiceTicket *), @encode(unsigned long long), - @encode(unsigned long long), 0); - GTMAssertSelectorNilOrImplementedWithArgs(delegate, ticket.retrySelector, - @encode(GTLServiceTicket *), @encode(BOOL), @encode(NSError *), 0); - - SEL finishedSel = @selector(objectFetcher:finishedWithData:error:); - - ticket.postedObject = bodyObject; - - ticket.executingQuery = query; - if (ticket.originalQuery == nil) { - ticket.originalQuery = query; - } - - GTMHTTPFetcherService *fetcherService = self.fetcherService; - GTMHTTPFetcher *fetcher; - - GTLUploadParameters *uploadParams = query.uploadParameters; - if (uploadParams == nil) { - // Not uploading a file with this request - fetcher = [fetcherService fetcherWithRequest:request]; - } else { - fetcher = [self uploadFetcherWithRequest:request - fetcherService:fetcherService - params:uploadParams]; - } - - if (finishedSelector) { - // if we don't have a method name, default to the finished selector as - // a useful fetcher log comment - fetcher.comment = NSStringFromSelector(finishedSelector); - } - - // allow the user to specify static app-wide cookies for fetching - NSInteger cookieStorageMethod = [self cookieStorageMethod]; - if (cookieStorageMethod >= 0) { - fetcher.cookieStorageMethod = cookieStorageMethod; - } - - if (!mayAuthorize) { - fetcher.authorizer = nil; - } - - // copy the ticket's retry settings into the fetcher - fetcher.retryEnabled = ticket.retryEnabled; - fetcher.maxRetryInterval = ticket.maxRetryInterval; - - BOOL shouldExamineRetries; -#if NS_BLOCKS_AVAILABLE - shouldExamineRetries = (ticket.retrySelector != nil - || ticket.retryBlock != nil); -#else - shouldExamineRetries = (ticket.retrySelector != nil); -#endif - if (shouldExamineRetries) { - [fetcher setRetrySelector:@selector(objectFetcher:willRetry:forError:)]; - } - - // remember the object fetcher in the ticket - ticket.objectFetcher = fetcher; - - // add parameters used by the callbacks - - [fetcher setProperty:objectClass forKey:kFetcherObjectClassKey]; - - [fetcher setProperty:delegate forKey:kFetcherDelegateKey]; - - [fetcher setProperty:NSStringFromSelector(finishedSelector) - forKey:kFetcherFinishedSelectorKey]; - - [fetcher setProperty:ticket - forKey:kFetcherTicketKey]; - -#if NS_BLOCKS_AVAILABLE - // copy the completion handler block to the heap; this does nothing if the - // block is already on the heap - completionHandler = [[completionHandler copy] autorelease]; - [fetcher setProperty:completionHandler - forKey:kFetcherCompletionHandlerKey]; -#endif - - // set the upload data - fetcher.postData = dataToPost; - - // failed fetches call the failure selector, which will delete the ticket - BOOL didFetch = [fetcher beginFetchWithDelegate:self - didFinishSelector:finishedSel]; - - // If something weird happens and the networking callbacks have been called - // already synchronously, we don't want to return the ticket since the caller - // will never know when to stop retaining it, so we'll make sure the - // success/failure callbacks have not yet been called by checking the - // ticket - if (!didFetch || ticket.hasCalledCallback) { - fetcher.properties = nil; - return nil; - } - - return ticket; -} - -- (GTMHTTPUploadFetcher *)uploadFetcherWithRequest:(NSURLRequest *)request - fetcherService:(GTMHTTPFetcherService *)fetcherService - params:(GTLUploadParameters *)uploadParams { - // Hang on to the user's requested chunk size, and ensure it's not tiny - NSUInteger uploadChunkSize = [self serviceUploadChunkSize]; - if (uploadChunkSize < kMinimumUploadChunkSize) { - uploadChunkSize = kMinimumUploadChunkSize; - } - -#ifdef GTL_TARGET_NAMESPACE - // Prepend the class name prefix - Class uploadClass = NSClassFromString(@GTL_TARGET_NAMESPACE_STRING - "_GTMHTTPUploadFetcher"); -#else - Class uploadClass = NSClassFromString(@"GTMHTTPUploadFetcher"); -#endif - GTL_ASSERT(uploadClass != nil, @"GTMHTTPUploadFetcher needed"); - - NSString *uploadMIMEType = uploadParams.MIMEType; - NSData *uploadData = uploadParams.data; - NSFileHandle *uploadFileHandle = uploadParams.fileHandle; - NSURL *uploadLocationURL = uploadParams.uploadLocationURL; - - GTMHTTPUploadFetcher *fetcher; - if (uploadData) { - fetcher = [uploadClass uploadFetcherWithRequest:request - uploadData:uploadData - uploadMIMEType:uploadMIMEType - chunkSize:uploadChunkSize - fetcherService:fetcherService]; - } else if (uploadLocationURL) { - GTL_DEBUG_ASSERT(uploadFileHandle != nil, - @"Resume requires a file handle"); - fetcher = [uploadClass uploadFetcherWithLocation:uploadLocationURL - uploadFileHandle:uploadFileHandle - uploadMIMEType:uploadMIMEType - chunkSize:uploadChunkSize - fetcherService:fetcherService]; - } else { - fetcher = [uploadClass uploadFetcherWithRequest:request - uploadFileHandle:uploadFileHandle - uploadMIMEType:uploadMIMEType - chunkSize:uploadChunkSize - fetcherService:fetcherService]; - } - - NSString *slug = [uploadParams slug]; - if ([slug length] > 0) { - [[fetcher mutableRequest] setValue:slug forHTTPHeaderField:@"Slug"]; - } - return fetcher; -} - -#pragma mark - - -// RPC fetch methods - -- (NSDictionary *)rpcPayloadForMethodNamed:(NSString *)methodName - parameters:(NSDictionary *)parameters - bodyObject:(GTLObject *)bodyObject - requestID:(NSString *)requestID { - GTL_DEBUG_ASSERT([requestID length] > 0, @"Got an empty request id"); - - // First, merge the developer key and bodyObject into the parameters. - - NSString *apiKey = self.APIKey; - NSUInteger apiKeyLen = [apiKey length]; - - NSString *const kDeveloperAPIParamKey = @"key"; - NSString *const kBodyObjectParamKey = @"resource"; - - NSDictionary *finalParams; - if ((apiKeyLen == 0) && (bodyObject == nil)) { - // Nothing needs to be added, just send the dict along. - finalParams = parameters; - } else { - NSMutableDictionary *worker = [NSMutableDictionary dictionary]; - if ([parameters count] > 0) { - [worker addEntriesFromDictionary:parameters]; - } - if ((apiKeyLen > 0) - && ([worker objectForKey:kDeveloperAPIParamKey] == nil)) { - [worker setObject:apiKey forKey:kDeveloperAPIParamKey]; - } - if (bodyObject != nil) { - GTL_DEBUG_ASSERT([parameters objectForKey:kBodyObjectParamKey] == nil, - @"There was already something under the 'data' key?!"); - NSMutableDictionary *json = [bodyObject JSON]; - if (json != nil) { - [worker setObject:json forKey:kBodyObjectParamKey]; - } - } - finalParams = worker; - } - - // Now, build up the full dictionary for the JSON-RPC (this is the body of - // the HTTP PUT). - - // Spec calls for the jsonrpc entry. Google doesn't require it, but include - // it so the code can work with other servers. - NSMutableDictionary *rpcPayload = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"2.0", @"jsonrpc", - methodName, @"method", - requestID, @"id", - nil]; - - // Google extension, provide the version of the api. - NSString *apiVersion = self.apiVersion; - if ([apiVersion length] > 0) { - [rpcPayload setObject:apiVersion forKey:@"apiVersion"]; - } - - if ([finalParams count] > 0) { - [rpcPayload setObject:finalParams forKey:@"params"]; - } - - return rpcPayload; -} - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - objectClass:(Class)objectClass - parameters:(NSDictionary *)parameters - bodyObject:(GTLObject *)bodyObject - requestID:(NSString *)requestID - urlQueryParameters:(NSDictionary *)urlQueryParameters - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector - completionHandler:(id)completionHandler // GTLServiceCompletionHandler - executingQuery:(id)executingQuery - ticket:(GTLServiceTicket *)ticket { - GTL_DEBUG_ASSERT([methodName length] > 0, @"Got an empty method name"); - if ([methodName length] == 0) return nil; - - // If we didn't get a requestID, assign one (call came from one of the public - // calls that doesn't take a GTLQuery object). - if (requestID == nil) { - requestID = [GTLQuery nextRequestID]; - } - - NSData *dataToPost = nil; - GTLUploadParameters *uploadParameters = executingQuery.uploadParameters; - BOOL shouldSendBody = !uploadParameters.shouldSendUploadOnly; - if (shouldSendBody) { - NSDictionary *rpcPayload = [self rpcPayloadForMethodNamed:methodName - parameters:parameters - bodyObject:bodyObject - requestID:requestID]; - - NSError *error = nil; - dataToPost = [GTLJSONParser dataWithObject:rpcPayload - humanReadable:NO - error:&error]; - if (dataToPost == nil) { - // There is the chance something went into parameters that wasn't valid. - GTL_DEBUG_LOG(@"JSON generation error: %@", error); - return nil; - } - } - - BOOL isUploading = (uploadParameters != nil); - NSURL *rpcURL = (isUploading ? self.rpcUploadURL : self.rpcURL); - - if ([urlQueryParameters count] > 0) { - rpcURL = [GTLUtilities URLWithString:[rpcURL absoluteString] - queryParameters:urlQueryParameters]; - } - - BOOL mayAuthorize = (executingQuery ? - !executingQuery.shouldSkipAuthorization : YES); - - GTLServiceTicket *resultTicket = [self fetchObjectWithURL:rpcURL - objectClass:objectClass - bodyObject:bodyObject - dataToPost:dataToPost - ETag:nil - httpMethod:@"POST" - mayAuthorize:mayAuthorize - isREST:NO - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:completionHandler - executingQuery:executingQuery - ticket:ticket]; - - // Set the fetcher log comment to default to the method name - NSUInteger pageNumber = resultTicket.pagesFetchedCounter; - if (pageNumber == 0) { - resultTicket.objectFetcher.comment = methodName; - } else { - // Also put the page number in the log comment - [resultTicket.objectFetcher setCommentWithFormat:@"%@ (page %lu)", - methodName, (unsigned long) (pageNumber + 1)]; - } - - return resultTicket; -} - -- (GTLServiceTicket *)executeBatchQuery:(GTLBatchQuery *)batch - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector - completionHandler:(id)completionHandler // GTLServiceCompletionHandler - ticket:(GTLServiceTicket *)ticket { - GTLBatchQuery *batchCopy = [[batch copy] autorelease]; - NSArray *queries = batchCopy.queries; - NSUInteger numberOfQueries = [queries count]; - if (numberOfQueries == 0) return nil; - - // Build up the array of RPC calls. - NSMutableArray *rpcPayloads = [NSMutableArray arrayWithCapacity:numberOfQueries]; - NSMutableArray *requestIDs = [NSMutableSet setWithCapacity:numberOfQueries]; - for (GTLQuery *query in queries) { - NSString *methodName = query.methodName; - NSDictionary *parameters = query.JSON; - GTLObject *bodyObject = query.bodyObject; - NSString *requestID = query.requestID; - - if ([methodName length] == 0 || [requestID length] == 0) { - GTL_DEBUG_ASSERT(0, @"Invalid query - id:%@ method:%@", - requestID, methodName); - return nil; - } - - GTL_DEBUG_ASSERT(query.additionalHTTPHeaders == nil, - @"additionalHTTPHeaders disallowed on queries added to a batch - query %@ (%@)", - requestID, methodName); - - GTL_DEBUG_ASSERT(query.urlQueryParameters == nil, - @"urlQueryParameters disallowed on queries added to a batch - query %@ (%@)", - requestID, methodName); - - GTL_DEBUG_ASSERT(query.uploadParameters == nil, - @"uploadParameters disallowed on queries added to a batch - query %@ (%@)", - requestID, methodName); - - NSDictionary *rpcPayload = [self rpcPayloadForMethodNamed:methodName - parameters:parameters - bodyObject:bodyObject - requestID:requestID]; - [rpcPayloads addObject:rpcPayload]; - - if ([requestIDs containsObject:requestID]) { - GTL_DEBUG_LOG(@"Duplicate request id in batch: %@", requestID); - return nil; - } - [requestIDs addObject:requestID]; - } - - NSError *error = nil; - NSData *dataToPost = nil; - dataToPost = [GTLJSONParser dataWithObject:rpcPayloads - humanReadable:NO - error:&error]; - if (dataToPost == nil) { - // There is the chance something went into parameters that wasn't valid. - GTL_DEBUG_LOG(@"JSON generation error: %@", error); - return nil; - } - - BOOL mayAuthorize = (batchCopy ? !batchCopy.shouldSkipAuthorization : YES); - - NSURL *rpcURL = self.rpcURL; - - // We'll use the batch query's URL parameters, and ignore the URL parameters - // specified on the individual queries. - NSDictionary *urlQueryParameters = batch.urlQueryParameters; - if ([urlQueryParameters count] > 0) { - rpcURL = [GTLUtilities URLWithString:[rpcURL absoluteString] - queryParameters:urlQueryParameters]; - } - - GTLServiceTicket *resultTicket = [self fetchObjectWithURL:rpcURL - objectClass:[GTLBatchResult class] - bodyObject:nil - dataToPost:dataToPost - ETag:nil - httpMethod:@"POST" - mayAuthorize:mayAuthorize - isREST:NO - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:completionHandler - executingQuery:batch - ticket:ticket]; - -#if !STRIP_GTM_FETCH_LOGGING - // Set the fetcher log comment - // - // Because this has expensive set operations, it's conditionally - // compiled in - NSArray *methodNames = [queries valueForKey:@"methodName"]; - methodNames = [[NSSet setWithArray:methodNames] allObjects]; // de-dupe - NSString *methodsStr = [methodNames componentsJoinedByString:@", "]; - - NSUInteger pageNumber = ticket.pagesFetchedCounter; - NSString *pageStr = @""; - if (pageNumber > 0) { - pageStr = [NSString stringWithFormat:@"page %lu, ", - (unsigned long) pageNumber + 1]; - } - [resultTicket.objectFetcher setCommentWithFormat:@"batch: %@ (%@%lu queries)", - methodsStr, pageStr, (unsigned long) numberOfQueries]; -#endif - - return resultTicket; -} - - -#pragma mark - - -// REST fetch methods - -- (GTLServiceTicket *)fetchObjectWithURL:(NSURL *)targetURL - objectClass:(Class)objectClass - bodyObject:(GTLObject *)bodyObject - ETag:(NSString *)etag - httpMethod:(NSString *)httpMethod - mayAuthorize:(BOOL)mayAuthorize - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector - completionHandler:(id)completionHandler // GTLServiceCompletionHandler - ticket:(GTLServiceTicket *)ticket { - // if no URL was supplied, treat this as if the fetch failed (below) - // and immediately return a nil ticket, skipping the callbacks - // - // this might be considered normal (say, updating a read-only entry - // that lacks an edit link) though higher-level calls may assert or - // return errors depending on the specific usage - if (targetURL == nil) return nil; - - NSData *dataToPost = nil; - if (bodyObject != nil) { - NSError *error = nil; - - NSDictionary *whatToSend; - NSDictionary *json = bodyObject.JSON; - if (isRESTDataWrapperRequired_) { - // create the top-level "data" object - NSDictionary *dataDict = [NSDictionary dictionaryWithObject:json - forKey:@"data"]; - whatToSend = dataDict; - } else { - whatToSend = json; - } - dataToPost = [GTLJSONParser dataWithObject:whatToSend - humanReadable:NO - error:&error]; - if (dataToPost == nil) { - GTL_DEBUG_LOG(@"JSON generation error: %@", error); - } - } - - return [self fetchObjectWithURL:targetURL - objectClass:objectClass - bodyObject:bodyObject - dataToPost:dataToPost - ETag:etag - httpMethod:httpMethod - mayAuthorize:mayAuthorize - isREST:YES - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:completionHandler - executingQuery:nil - ticket:ticket]; -} - -- (void)invokeProgressCallbackForTicket:(GTLServiceTicket *)ticket - deliveredBytes:(unsigned long long)numReadSoFar - totalBytes:(unsigned long long)total { - - SEL progressSelector = [ticket uploadProgressSelector]; - if (progressSelector) { - - GTMHTTPFetcher *fetcher = ticket.objectFetcher; - id delegate = [fetcher propertyForKey:kFetcherDelegateKey]; - - NSMethodSignature *signature = [delegate methodSignatureForSelector:progressSelector]; - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; - - [invocation setSelector:progressSelector]; - [invocation setTarget:delegate]; - [invocation setArgument:&ticket atIndex:2]; - [invocation setArgument:&numReadSoFar atIndex:3]; - [invocation setArgument:&total atIndex:4]; - [invocation invoke]; - } - -#if NS_BLOCKS_AVAILABLE - GTLServiceUploadProgressBlock block = ticket.uploadProgressBlock; - if (block) { - block(ticket, numReadSoFar, total); - } -#endif -} - -// sentData callback from fetcher -- (void)objectFetcher:(GTMHTTPFetcher *)fetcher - didSendBytes:(NSInteger)bytesSent - totalBytesSent:(NSInteger)totalBytesSent -totalBytesExpectedToSend:(NSInteger)totalBytesExpected { - - GTLServiceTicket *ticket = [fetcher propertyForKey:kFetcherTicketKey]; - - [self invokeProgressCallbackForTicket:ticket - deliveredBytes:(unsigned long long)totalBytesSent - totalBytes:(unsigned long long)totalBytesExpected]; -} - -- (void)objectFetcher:(GTMHTTPFetcher *)fetcher finishedWithData:(NSData *)data error:(NSError *)error { - // we now have the JSON data for an object, or an error - if (error == nil) { - if ([data length] > 0) { - [self prepareToParseObjectForFetcher:fetcher]; - } else { - // no data (such as when deleting) - [self handleParsedObjectForFetcher:fetcher]; - } - } else { - // There was an error from the fetch - NSInteger status = [error code]; - if (status >= 300) { - // Return the HTTP error status code along with a more descriptive error - // from within the HTTP response payload. - NSData *responseData = fetcher.downloadedData; - if ([responseData length] > 0) { - NSDictionary *responseHeaders = fetcher.responseHeaders; - NSString *contentType = [responseHeaders objectForKey:@"Content-Type"]; - - if ([data length] > 0) { - if ([contentType hasPrefix:@"application/json"]) { - NSError *parseError = nil; - NSMutableDictionary *jsonWrapper = [GTLJSONParser objectWithData:data - error:&parseError]; - if (parseError) { - // We could not parse the JSON payload - error = parseError; - } else { - // Convert the JSON error payload into a structured error - NSMutableDictionary *errorJSON = [jsonWrapper valueForKey:@"error"]; - GTLErrorObject *errorObject = [GTLErrorObject objectWithJSON:errorJSON]; - error = [errorObject foundationError]; - } - } else { - // No structured JSON error was available; make a plaintext server - // error response visible in the error object. - NSString *reasonStr = [[[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding] autorelease]; - NSDictionary *userInfo = [NSDictionary dictionaryWithObject:reasonStr - forKey:NSLocalizedFailureReasonErrorKey]; - error = [NSError errorWithDomain:kGTMHTTPFetcherStatusDomain - code:status - userInfo:userInfo]; - } - } else { - // Response data length is zero; we'll settle for returning the - // fetcher's error. - } - } - } - - // store the error, call the callbacks, and bail - [fetcher setProperty:error - forKey:kFetcherFetchErrorKey]; - - [self handleParsedObjectForFetcher:fetcher]; - } -} - -// Three methods handle parsing of the fetched JSON data: -// - prepareToParse posts a start notification and then spawns off parsing -// on the operation queue (if there's an operation queue) -// - parseObject does the parsing of the JSON string -// - handleParsedObject posts the stop notification and calls the callback -// with the parsed object or an error -// -// The middle method may run on a separate thread. - -- (void)prepareToParseObjectForFetcher:(GTMHTTPFetcher *)fetcher { - // save the current thread into the fetcher, since we'll handle additional - // fetches and callbacks on this thread - [fetcher setProperty:[NSThread currentThread] - forKey:kFetcherCallbackThreadKey]; - - // copy the run loop modes, if any, so we don't need to access them - // from the parsing thread - [fetcher setProperty:[[[self runLoopModes] copy] autorelease] - forKey:kFetcherCallbackRunLoopModesKey]; - - // we post parsing notifications now to ensure they're on caller's - // original thread - GTLServiceTicket *ticket = [fetcher propertyForKey:kFetcherTicketKey]; - NSNotificationCenter *defaultNC = [NSNotificationCenter defaultCenter]; - [defaultNC postNotificationName:kGTLServiceTicketParsingStartedNotification - object:ticket]; - [fetcher setProperty:@"1" - forKey:kFetcherParsingNotificationKey]; - - id executingQuery = ticket.executingQuery; - if ([executingQuery isBatchQuery]) { - // build a dictionary of expected classes for the batch responses - GTLBatchQuery *batchQuery = executingQuery; - NSArray *queries = batchQuery.queries; - NSDictionary *batchClassMap = [NSMutableDictionary dictionaryWithCapacity:[queries count]]; - for (GTLQuery *query in queries) { - [batchClassMap setValue:query.expectedObjectClass - forKey:query.requestID]; - } - [fetcher setProperty:batchClassMap - forKey:kFetcherBatchClassMapKey]; - } - - // if there's an operation queue, then use that to schedule parsing on another - // thread - SEL parseSel = @selector(parseObjectFromDataOfFetcher:); - NSOperationQueue *queue = self.parseQueue; - if (queue) { - NSInvocationOperation *op; - op = [[[NSInvocationOperation alloc] initWithTarget:self - selector:parseSel - object:fetcher] autorelease]; - ticket.parseOperation = op; - [queue addOperation:op]; - // the fetcher now belongs to the parsing thread - } else { - // parse on the current thread, on Mac OS X 10.4 through 10.5.7 - // or when the project defines GTL_SKIP_PARSE_THREADING - [self performSelector:parseSel - withObject:fetcher]; - } -} - -- (void)parseObjectFromDataOfFetcher:(GTMHTTPFetcher *)fetcher { - // This method runs in a separate thread - - // Generally protect the fetcher properties, since canceling a ticket would - // release the fetcher properties dictionary - NSMutableDictionary *properties = [[fetcher.properties retain] autorelease]; - - // The callback thread is retaining the fetcher, so the fetcher shouldn't keep - // retaining the callback thread - NSThread *callbackThread = [properties valueForKey:kFetcherCallbackThreadKey]; - [[callbackThread retain] autorelease]; - [properties removeObjectForKey:kFetcherCallbackThreadKey]; - - GTLServiceTicket *ticket = [properties valueForKey:kFetcherTicketKey]; - [[ticket retain] autorelease]; - - NSDictionary *responseHeaders = fetcher.responseHeaders; - NSString *contentType = [responseHeaders objectForKey:@"Content-Type"]; - NSData *data = fetcher.downloadedData; - - NSOperation *parseOperation = ticket.parseOperation; - - GTL_DEBUG_ASSERT([contentType hasPrefix:@"application/json"], - @"Got unexpected content type '%@'", contentType); - if ([contentType hasPrefix:@"application/json"] && [data length] > 0) { -#if GTL_LOG_PERFORMANCE - NSTimeInterval secs1, secs2; - secs1 = [NSDate timeIntervalSinceReferenceDate]; -#endif - - NSError *parseError = nil; - NSMutableDictionary *jsonWrapper = [GTLJSONParser objectWithData:data - error:&parseError]; - if ([parseOperation isCancelled]) return; - - if (parseError != nil) { - [properties setValue:parseError forKey:kFetcherFetchErrorKey]; - } else { - NSMutableDictionary *json; - NSDictionary *batchClassMap = nil; - - // In theory, just checking for "application/json-rpc" vs - // "application/json" would work. But the JSON-RPC spec allows for - // "application/json" also so we have to carry a flag all the way in - // saying which type of result to expect and process as. - BOOL isREST = ticket.isREST; - if (isREST) { - if (isRESTDataWrapperRequired_) { - json = [jsonWrapper valueForKey:@"data"]; - } else { - json = jsonWrapper; - } - } else { - batchClassMap = [properties valueForKey:kFetcherBatchClassMapKey]; - if (batchClassMap) { - // A batch gets the whole array as it's json. - json = jsonWrapper; - } else { - json = [jsonWrapper valueForKey:@"result"]; - } - } - - if (json != nil) { - Class defaultClass = [properties valueForKey:kFetcherObjectClassKey]; - NSDictionary *surrogates = ticket.surrogates; - - GTLObject *parsedObject = [GTLObject objectForJSON:json - defaultClass:defaultClass - surrogates:surrogates - batchClassMap:batchClassMap]; - - [properties setValue:parsedObject forKey:kFetcherParsedObjectKey]; - } else if (!isREST) { - NSMutableDictionary *errorJSON = [jsonWrapper valueForKey:@"error"]; - GTL_DEBUG_ASSERT(errorJSON != nil, @"no result or error in response:\n%@", - jsonWrapper); - GTLErrorObject *errorObject = [GTLErrorObject objectWithJSON:errorJSON]; - NSError *error = [errorObject foundationError]; - - // Store the error and let it go to the callback - [properties setValue:error - forKey:kFetcherFetchErrorKey]; - } - } - -#if GTL_LOG_PERFORMANCE - secs2 = [NSDate timeIntervalSinceReferenceDate]; - NSLog(@"allocation of %@ took %f seconds", objectClass, secs2 - secs1); -#endif - } - - if ([parseOperation isCancelled]) return; - - SEL parseDoneSel = @selector(handleParsedObjectForFetcher:); - NSArray *runLoopModes = [properties valueForKey:kFetcherCallbackRunLoopModesKey]; - // If this callback was enqueued, then the fetcher has already released - // its delegateQueue. We'll use our own delegateQueue to determine how to - // invoke the callbacks. - NSOperationQueue *delegateQueue = self.delegateQueue; - if (delegateQueue) { - NSInvocationOperation *op; - op = [[[NSInvocationOperation alloc] initWithTarget:self - selector:parseDoneSel - object:fetcher] autorelease]; - [delegateQueue addOperation:op]; - } else if (runLoopModes) { - [self performSelector:parseDoneSel - onThread:callbackThread - withObject:fetcher - waitUntilDone:NO - modes:runLoopModes]; - } else { - // Defaults to common modes - [self performSelector:parseDoneSel - onThread:callbackThread - withObject:fetcher - waitUntilDone:NO]; - } - // the fetcher now belongs to the callback thread -} - -- (void)handleParsedObjectForFetcher:(GTMHTTPFetcher *)fetcher { - // After parsing is complete, this is invoked on the thread that the - // fetch was performed on - // - // There may not be an object due to a fetch or parsing error - - GTLServiceTicket *ticket = [fetcher propertyForKey:kFetcherTicketKey]; - ticket.parseOperation = nil; - - // unpack the callback parameters - id delegate = [fetcher propertyForKey:kFetcherDelegateKey]; - NSString *selString = [fetcher propertyForKey:kFetcherFinishedSelectorKey]; - SEL finishedSelector = NSSelectorFromString(selString); - -#if NS_BLOCKS_AVAILABLE - GTLServiceCompletionHandler completionHandler; - completionHandler = [fetcher propertyForKey:kFetcherCompletionHandlerKey]; -#else - id completionHandler = nil; -#endif - - GTLObject *object = [fetcher propertyForKey:kFetcherParsedObjectKey]; - NSError *error = [fetcher propertyForKey:kFetcherFetchErrorKey]; - - GTLQuery *executingQuery = (GTLQuery *)ticket.executingQuery; - - BOOL shouldFetchNextPages = ticket.shouldFetchNextPages; - GTLObject *previousObject = ticket.fetchedObject; - - if (shouldFetchNextPages - && (previousObject != nil) - && (object != nil)) { - // Accumulate new results - object = [self mergedNewResultObject:object - oldResultObject:previousObject - forQuery:executingQuery]; - } - - ticket.fetchedObject = object; - ticket.fetchError = error; - - if ([fetcher propertyForKey:kFetcherParsingNotificationKey] != nil) { - // we want to always balance the start and stop notifications - NSNotificationCenter *defaultNC = [NSNotificationCenter defaultCenter]; - [defaultNC postNotificationName:kGTLServiceTicketParsingStoppedNotification - object:ticket]; - } - - BOOL shouldCallCallbacks = YES; - - // Use the nextPageToken to fetch any later pages for non-batch queries - // - // This assumes a pagination model where objects have entries in an "items" - // field and a "nextPageToken" field, and queries support a "pageToken" - // parameter. - if (ticket.shouldFetchNextPages) { - // Determine if we should fetch more pages of results - - GTLQuery *nextPageQuery = [self nextPageQueryForQuery:executingQuery - result:object - ticket:ticket]; - if (nextPageQuery) { - BOOL isFetchingMore = [self fetchNextPageWithQuery:nextPageQuery - delegate:delegate - didFinishedSelector:finishedSelector - completionHandler:completionHandler - ticket:ticket]; - if (isFetchingMore) { - shouldCallCallbacks = NO; - } - } else { - // No more page tokens are present -#if DEBUG && !GTL_SKIP_PAGES_WARNING - // Each next page followed to accumulate all pages of a feed takes up to - // a few seconds. When multiple pages are being fetched, that - // usually indicates that a larger page size (that is, more items per - // feed fetched) should be requested. - // - // To avoid fetching many pages, set query.maxResults so the feed - // requested is large enough to rarely need to follow next links. - NSUInteger pageCount = ticket.pagesFetchedCounter; - if (pageCount > 2) { - NSString *queryLabel = [executingQuery isBatchQuery] ? - @"batch query" : executingQuery.methodName; - NSLog(@"Executing %@ required fetching %u pages; use a query with a" - @" larger maxResults for faster results", - queryLabel, (unsigned int) pageCount); - } -#endif - } - } - - // We no longer care about the queries for page 2 or later, so for the client - // inspecting the ticket in the callback, the executing query should be - // the original one - ticket.executingQuery = ticket.originalQuery; - - if (shouldCallCallbacks) { - // First, call query-specific callback blocks. We do this before the - // fetch callback to let applications do any final clean-up (or update - // their UI) in the fetch callback. - GTLQuery *originalQuery = (GTLQuery *)ticket.originalQuery; -#if NS_BLOCKS_AVAILABLE - if (![originalQuery isBatchQuery]) { - // Single query - GTLServiceCompletionHandler completionBlock = originalQuery.completionBlock; - if (completionBlock) { - completionBlock(ticket, object, error); - } - } else { - // Batch query - // - // We'll step through the queries of the original batch, not of the - // batch result - GTLBatchQuery *batchQuery = (GTLBatchQuery *)originalQuery; - GTLBatchResult *batchResult = (GTLBatchResult *)object; - NSDictionary *successes = batchResult.successes; - NSDictionary *failures = batchResult.failures; - - for (GTLQuery *oneQuery in batchQuery.queries) { - GTLServiceCompletionHandler completionBlock = oneQuery.completionBlock; - if (completionBlock) { - // If there was no networking error, look for a query-specific - // error or result - GTLObject *oneResult = nil; - NSError *oneError = error; - if (oneError == nil) { - NSString *requestID = [oneQuery requestID]; - GTLErrorObject *gtlError = [failures objectForKey:requestID]; - if (gtlError) { - oneError = [gtlError foundationError]; - } else { - oneResult = [successes objectForKey:requestID]; - if (oneResult == nil) { - // We found neither a success nor a failure for this - // query, unexpectedly - GTL_DEBUG_LOG(@"GTLService: Batch result missing for request %@", - requestID); - oneError = [NSError errorWithDomain:kGTLServiceErrorDomain - code:kGTLErrorQueryResultMissing - userInfo:nil]; - } - } - } - completionBlock(ticket, oneResult, oneError); - } - } - } -#endif - // Release query callback blocks - [originalQuery executionDidStop]; - - if (finishedSelector) { - [[self class] invokeCallback:finishedSelector - target:delegate - ticket:ticket - object:object - error:error]; - } - -#if NS_BLOCKS_AVAILABLE - if (completionHandler) { - completionHandler(ticket, object, error); - } -#endif - ticket.hasCalledCallback = YES; - } - fetcher.properties = nil; - -#if NS_BLOCKS_AVAILABLE - // Tickets don't know when the fetch has completed, so the service will - // release their blocks here to avoid unintended retain loops - ticket.retryBlock = nil; - ticket.uploadProgressBlock = nil; -#endif -} - -#pragma mark - - -+ (void)invokeCallback:(SEL)callbackSel - target:(id)target - ticket:(id)ticket - object:(id)object - error:(id)error { - - // GTL fetch callbacks have no return value - NSMethodSignature *signature = [target methodSignatureForSelector:callbackSel]; - NSInvocation *retryInvocation = [NSInvocation invocationWithMethodSignature:signature]; - [retryInvocation setSelector:callbackSel]; - [retryInvocation setTarget:target]; - [retryInvocation setArgument:&ticket atIndex:2]; - [retryInvocation setArgument:&object atIndex:3]; - [retryInvocation setArgument:&error atIndex:4]; - [retryInvocation invoke]; -} - -// The object fetcher may call into this retry method; this one invokes the -// selector provided by the user. -- (BOOL)objectFetcher:(GTMHTTPFetcher *)fetcher willRetry:(BOOL)willRetry forError:(NSError *)error { - - GTLServiceTicket *ticket = [fetcher propertyForKey:kFetcherTicketKey]; - SEL retrySelector = ticket.retrySelector; - if (retrySelector) { - id delegate = [fetcher propertyForKey:kFetcherDelegateKey]; - - willRetry = [self invokeRetrySelector:retrySelector - delegate:delegate - ticket:ticket - willRetry:willRetry - error:error]; - } - -#if NS_BLOCKS_AVAILABLE - BOOL (^retryBlock)(GTLServiceTicket *, BOOL, NSError *) = ticket.retryBlock; - if (retryBlock) { - willRetry = retryBlock(ticket, willRetry, error); - } -#endif - - return willRetry; -} - -- (BOOL)invokeRetrySelector:(SEL)retrySelector - delegate:(id)delegate - ticket:(GTLServiceTicket *)ticket - willRetry:(BOOL)willRetry - error:(NSError *)error { - - if ([delegate respondsToSelector:retrySelector]) { - // Unlike the retry selector invocation in GTMHTTPFetcher, this invocation - // passes the ticket rather than the fetcher as argument 2 - NSMethodSignature *signature = [delegate methodSignatureForSelector:retrySelector]; - NSInvocation *retryInvocation = [NSInvocation invocationWithMethodSignature:signature]; - [retryInvocation setSelector:retrySelector]; - [retryInvocation setTarget:delegate]; - [retryInvocation setArgument:&ticket atIndex:2]; // ticket passed - [retryInvocation setArgument:&willRetry atIndex:3]; - [retryInvocation setArgument:&error atIndex:4]; - [retryInvocation invoke]; - - [retryInvocation getReturnValue:&willRetry]; - } - return willRetry; -} - -- (BOOL)waitForTicket:(GTLServiceTicket *)ticket - timeout:(NSTimeInterval)timeoutInSeconds - fetchedObject:(GTLObject **)outObjectOrNil - error:(NSError **)outErrorOrNil { - - NSDate* giveUpDate = [NSDate dateWithTimeIntervalSinceNow:timeoutInSeconds]; - - // loop until the fetch completes with an object or an error, - // or until the timeout has expired - while (![ticket hasCalledCallback] - && [giveUpDate timeIntervalSinceNow] > 0) { - - // run the current run loop 1/1000 of a second to give the networking - // code a chance to work - NSDate *stopDate = [NSDate dateWithTimeIntervalSinceNow:0.001]; - [[NSRunLoop currentRunLoop] runUntilDate:stopDate]; - } - - NSError *fetchError = ticket.fetchError; - - if (![ticket hasCalledCallback] && fetchError == nil) { - fetchError = [NSError errorWithDomain:kGTLServiceErrorDomain - code:kGTLErrorWaitTimedOut - userInfo:nil]; - } - - if (outObjectOrNil) *outObjectOrNil = ticket.fetchedObject; - if (outErrorOrNil) *outErrorOrNil = fetchError; - - return (fetchError == nil); -} - -#pragma mark - - -// Given a single or batch query and its result, make a new query -// for the next pages, if any. Returns nil if there's no additional -// query to make. -// -// This method calls itself recursively to make the individual next page -// queries for a batch query. -- (id )nextPageQueryForQuery:(GTLQuery *)query - result:(GTLObject *)object - ticket:(GTLServiceTicket *)ticket { - if (!query.isBatchQuery) { - // This is a single query - - // Determine if we should fetch more pages of results - GTLQuery *nextPageQuery = nil; - NSString *nextPageToken = nil; - NSNumber *nextStartIndex = nil; - - if ([object respondsToSelector:@selector(nextPageToken)] - && [query respondsToSelector:@selector(pageToken)]) { - nextPageToken = [object performSelector:@selector(nextPageToken)]; - } - - if ([object respondsToSelector:@selector(nextStartIndex)] - && [query respondsToSelector:@selector(startIndex)]) { - nextStartIndex = [object performSelector:@selector(nextStartIndex)]; - } - - if (nextPageToken || nextStartIndex) { - // Make a query for the next page, preserving the request ID - nextPageQuery = [[query copy] autorelease]; - nextPageQuery.requestID = query.requestID; - - if (nextPageToken) { - [nextPageQuery performSelector:@selector(setPageToken:) - withObject:nextPageToken]; - } else { - // Use KVC to unwrap the scalar type instead of converting the - // NSNumber to an integer and using NSInvocation - [nextPageQuery setValue:nextStartIndex - forKey:@"startIndex"]; - } - } - return nextPageQuery; - } else { - // This is a batch query - // - // Check if there's a next page to fetch for any of the success - // results by invoking this method recursively on each of those results - GTLBatchResult *batchResult = (GTLBatchResult *)object; - GTLBatchQuery *nextPageBatchQuery = nil; - NSDictionary *successes = batchResult.successes; - - for (NSString *requestID in successes) { - GTLObject *singleObject = [successes objectForKey:requestID]; - GTLQuery *singleQuery = [ticket queryForRequestID:requestID]; - - GTLQuery *newQuery = [self nextPageQueryForQuery:singleQuery - result:singleObject - ticket:ticket]; - if (newQuery) { - // There is another query to fetch - if (nextPageBatchQuery == nil) { - nextPageBatchQuery = [GTLBatchQuery batchQuery]; - } - [nextPageBatchQuery addQuery:newQuery]; - } - } - return nextPageBatchQuery; - } -} - -// When a ticket is set to fetch more pages for feeds, this routine -// initiates the fetch for each additional feed page -- (BOOL)fetchNextPageWithQuery:(GTLQuery *)query - delegate:(id)delegate - didFinishedSelector:(SEL)finishedSelector - completionHandler:(GTLServiceCompletionHandler)completionHandler - ticket:(GTLServiceTicket *)ticket { - // Sanity check the number of pages fetched already - NSUInteger oldPagesFetchedCounter = ticket.pagesFetchedCounter; - - if (oldPagesFetchedCounter > kMaxNumberOfNextPagesFetched) { - // Sanity check failed: way too many pages were fetched - // - // The client should be querying with a higher max results per page - // to avoid this - GTL_DEBUG_ASSERT(0, @"Fetched too many next pages for %@", - query.methodName); - return NO; - } - - ticket.pagesFetchedCounter = 1 + oldPagesFetchedCounter; - - GTLServiceTicket *newTicket; - if (query.isBatchQuery) { - newTicket = [self executeBatchQuery:(GTLBatchQuery *)query - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:completionHandler - ticket:ticket]; - } else { - newTicket = [self fetchObjectWithMethodNamed:query.methodName - objectClass:query.expectedObjectClass - parameters:query.JSON - bodyObject:query.bodyObject - requestID:query.requestID - urlQueryParameters:query.urlQueryParameters - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:completionHandler - executingQuery:query - ticket:ticket]; - } - - // In the bizarre case that the fetch didn't begin, newTicket will be - // nil. So long as the new ticket is the same as the ticket we're - // continuing, then we're happy. - return (newTicket == ticket); -} - -// Given a new single or batch result (meaning additional pages for a previous -// query result), merge it into the old result. -- (GTLObject *)mergedNewResultObject:(GTLObject *)newResult - oldResultObject:(GTLObject *)oldResult - forQuery:(GTLQuery *)query { - if (query.isBatchQuery) { - // Batch query result - // - // The new batch results are a subset of the old result's queries, since - // not all queries in the batch necessarily have additional pages. - // - // New success objects replace old success objects, with the old items - // prepended; new failure objects replace old success objects. - // We will update the old batch results with accumulated items, using the - // new objects, and return the old batch. - // - // We reuse the old batch results object because it may include some earlier - // results which did not have additional pages. - GTLBatchResult *newBatchResult = (GTLBatchResult *)newResult; - GTLBatchResult *oldBatchResult = (GTLBatchResult *)oldResult; - - NSMutableDictionary *newSuccesses = newBatchResult.successes; - NSMutableDictionary *newFailures = newBatchResult.failures; - NSMutableDictionary *oldSuccesses = oldBatchResult.successes; - NSMutableDictionary *oldFailures = oldBatchResult.failures; - - for (NSString *requestID in newSuccesses) { - // Prepend the old items to the new response's items - // - // We can assume the objects are collections since they're present in - // additional pages. - GTLCollectionObject *newObj = [newSuccesses objectForKey:requestID]; - GTLCollectionObject *oldObj = [oldSuccesses objectForKey:requestID]; - - NSMutableArray *items = [NSMutableArray arrayWithArray:oldObj.items]; - [items addObjectsFromArray:newObj.items]; - [newObj performSelector:@selector(setItems:) withObject:items]; - - // Replace the old object with the new one - [oldSuccesses setObject:newObj forKey:requestID]; - } - - for (NSString *requestID in newFailures) { - // Replace old successes or failures with the new failure - GTLErrorObject *newError = [newFailures objectForKey:requestID]; - [oldFailures setObject:newError forKey:requestID]; - [oldSuccesses removeObjectForKey:requestID]; - } - return oldBatchResult; - } else { - // Single query result - // - // Merge the items into the new object, and return that. - // - // We can assume the objects are collections since they're present in - // additional pages. - GTLCollectionObject *newObj = (GTLCollectionObject *)newResult; - GTLCollectionObject *oldObj = (GTLCollectionObject *)oldResult; - - NSMutableArray *items = [NSMutableArray arrayWithArray:oldObj.items]; - [items addObjectsFromArray:newObj.items]; - [newObj performSelector:@selector(setItems:) withObject:items]; - - return newObj; - } -} - -#pragma mark - - -// GTLQuery methods. - -- (GTLServiceTicket *)executeQuery:(id)queryObj - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector { - if ([queryObj isBatchQuery]) { - return [self executeBatchQuery:queryObj - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:NULL - ticket:nil]; - } - - GTLQuery *query = [[(GTLQuery *)queryObj copy] autorelease]; - NSString *methodName = query.methodName; - NSDictionary *params = query.JSON; - GTLObject *bodyObject = query.bodyObject; - - return [self fetchObjectWithMethodNamed:methodName - objectClass:query.expectedObjectClass - parameters:params - bodyObject:bodyObject - requestID:query.requestID - urlQueryParameters:query.urlQueryParameters - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:nil - executingQuery:query - ticket:nil]; -} - -#if NS_BLOCKS_AVAILABLE -- (GTLServiceTicket *)executeQuery:(id)queryObj - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler { - if ([queryObj isBatchQuery]) { - return [self executeBatchQuery:queryObj - delegate:nil - didFinishSelector:NULL - completionHandler:handler - ticket:nil]; - } - - GTLQuery *query = [[(GTLQuery *)queryObj copy] autorelease]; - NSString *methodName = query.methodName; - NSDictionary *params = query.JSON; - GTLObject *bodyObject = query.bodyObject; - - return [self fetchObjectWithMethodNamed:methodName - objectClass:query.expectedObjectClass - parameters:params - bodyObject:bodyObject - requestID:query.requestID - urlQueryParameters:query.urlQueryParameters - delegate:nil - didFinishSelector:NULL - completionHandler:handler - executingQuery:query - ticket:nil]; -} -#endif - -#pragma mark - - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - parameters:(NSDictionary *)parameters - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector { - return [self fetchObjectWithMethodNamed:methodName - objectClass:objectClass - parameters:parameters - bodyObject:nil - requestID:nil - urlQueryParameters:nil - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:nil - executingQuery:nil - ticket:nil]; -} - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - insertingObject:(GTLObject *)bodyObject - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector { - return [self fetchObjectWithMethodNamed:methodName - objectClass:objectClass - parameters:nil - bodyObject:bodyObject - requestID:nil - urlQueryParameters:nil - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:nil - executingQuery:nil - ticket:nil]; -} - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - parameters:(NSDictionary *)parameters - insertingObject:(GTLObject *)bodyObject - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector { - return [self fetchObjectWithMethodNamed:methodName - objectClass:objectClass - parameters:parameters - bodyObject:bodyObject - requestID:nil - urlQueryParameters:nil - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:nil - executingQuery:nil - ticket:nil]; -} - -#if NS_BLOCKS_AVAILABLE -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - parameters:(NSDictionary *)parameters - objectClass:(Class)objectClass - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler { - return [self fetchObjectWithMethodNamed:methodName - objectClass:objectClass - parameters:parameters - bodyObject:nil - requestID:nil - urlQueryParameters:nil - delegate:nil - didFinishSelector:NULL - completionHandler:handler - executingQuery:nil - ticket:nil]; -} - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - insertingObject:(GTLObject *)bodyObject - objectClass:(Class)objectClass - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler { - return [self fetchObjectWithMethodNamed:methodName - objectClass:objectClass - parameters:nil - bodyObject:bodyObject - requestID:nil - urlQueryParameters:nil - delegate:nil - didFinishSelector:NULL - completionHandler:handler - executingQuery:nil - ticket:nil]; -} - -- (GTLServiceTicket *)fetchObjectWithMethodNamed:(NSString *)methodName - parameters:(NSDictionary *)parameters - insertingObject:(GTLObject *)bodyObject - objectClass:(Class)objectClass - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler { - return [self fetchObjectWithMethodNamed:methodName - objectClass:objectClass - parameters:parameters - bodyObject:bodyObject - requestID:nil - urlQueryParameters:nil - delegate:nil - didFinishSelector:NULL - completionHandler:handler - executingQuery:nil - ticket:nil]; -} -#endif - -#pragma mark - - -// These external entry points doing a REST style fetch. - -- (GTLServiceTicket *)fetchObjectWithURL:(NSURL *)feedURL - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector { - // no object class specified; use registered class - return [self fetchObjectWithURL:feedURL - objectClass:nil - bodyObject:nil - ETag:nil - httpMethod:nil - mayAuthorize:YES - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:nil - ticket:nil]; -} - -- (GTLServiceTicket *)fetchPublicObjectWithURL:(NSURL *)feedURL - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector { - return [self fetchObjectWithURL:feedURL - objectClass:objectClass - bodyObject:nil - ETag:nil - httpMethod:nil - mayAuthorize:NO - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:nil - ticket:nil]; -} - -- (GTLServiceTicket *)fetchObjectWithURL:(NSURL *)feedURL - objectClass:(Class)objectClass - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector { - return [self fetchObjectWithURL:feedURL - objectClass:objectClass - bodyObject:nil - ETag:nil - httpMethod:nil - mayAuthorize:YES - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:nil - ticket:nil]; -} - - -- (GTLServiceTicket *)fetchObjectByInsertingObject:(GTLObject *)bodyToPost - forURL:(NSURL *)destinationURL - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector { - Class objClass = [bodyToPost class]; - NSString *etag = ETagIfPresent(bodyToPost); - - return [self fetchObjectWithURL:destinationURL - objectClass:objClass - bodyObject:bodyToPost - ETag:etag - httpMethod:@"POST" - mayAuthorize:YES - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:nil - ticket:nil]; -} - -- (GTLServiceTicket *)fetchObjectByUpdatingObject:(GTLObject *)bodyToPut - forURL:(NSURL *)destinationURL - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector { - Class objClass = [bodyToPut class]; - NSString *etag = ETagIfPresent(bodyToPut); - - return [self fetchObjectWithURL:destinationURL - objectClass:objClass - bodyObject:bodyToPut - ETag:etag - httpMethod:@"PUT" - mayAuthorize:YES - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:nil - ticket:nil]; -} - - -- (GTLServiceTicket *)deleteResourceURL:(NSURL *)destinationURL - ETag:(NSString *)etagOrNil - delegate:(id)delegate - didFinishSelector:(SEL)finishedSelector { - return [self fetchObjectWithURL:destinationURL - objectClass:nil - bodyObject:nil - ETag:etagOrNil - httpMethod:@"DELETE" - mayAuthorize:YES - delegate:delegate - didFinishSelector:finishedSelector - completionHandler:nil - ticket:nil]; -} - - -#if NS_BLOCKS_AVAILABLE -- (GTLServiceTicket *)fetchObjectWithURL:(NSURL *)objectURL - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler { - return [self fetchObjectWithURL:objectURL - objectClass:nil - bodyObject:nil - ETag:nil - httpMethod:nil - mayAuthorize:YES - delegate:nil - didFinishSelector:NULL - completionHandler:handler - ticket:nil]; -} - -- (GTLServiceTicket *)fetchObjectByInsertingObject:(GTLObject *)bodyToPost - forURL:(NSURL *)destinationURL - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler { - Class objClass = [bodyToPost class]; - NSString *etag = ETagIfPresent(bodyToPost); - - return [self fetchObjectWithURL:destinationURL - objectClass:objClass - bodyObject:bodyToPost - ETag:etag - httpMethod:@"POST" - mayAuthorize:YES - delegate:nil - didFinishSelector:NULL - completionHandler:handler - ticket:nil]; -} - -- (GTLServiceTicket *)fetchObjectByUpdatingObject:(GTLObject *)bodyToPut - forURL:(NSURL *)destinationURL - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler { - Class objClass = [bodyToPut class]; - NSString *etag = ETagIfPresent(bodyToPut); - - return [self fetchObjectWithURL:destinationURL - objectClass:objClass - bodyObject:bodyToPut - ETag:etag - httpMethod:@"PUT" - mayAuthorize:YES - delegate:nil - didFinishSelector:NULL - completionHandler:handler - ticket:nil]; -} - -- (GTLServiceTicket *)deleteResourceURL:(NSURL *)destinationURL - ETag:(NSString *)etagOrNil - completionHandler:(void (^)(GTLServiceTicket *ticket, id object, NSError *error))handler { - return [self fetchObjectWithURL:destinationURL - objectClass:nil - bodyObject:nil - ETag:etagOrNil - httpMethod:@"DELETE" - mayAuthorize:YES - delegate:nil - didFinishSelector:NULL - completionHandler:handler - ticket:nil]; -} - -#endif // NS_BLOCKS_AVAILABLE - -#pragma mark - - -- (NSString *)userAgent { - return userAgent_; -} - -- (void)setExactUserAgent:(NSString *)userAgent { - // internal use only - [userAgent_ release]; - userAgent_ = [userAgent copy]; -} - -- (void)setUserAgent:(NSString *)userAgent { - // remove whitespace and unfriendly characters - NSString *str = GTMCleanedUserAgentString(userAgent); - [self setExactUserAgent:str]; -} - -// -// The following methods pass through to the fetcher service object -// - -- (void)setCookieStorageMethod:(NSInteger)method { - self.fetcherService.cookieStorageMethod = method; -} - -- (NSInteger)cookieStorageMethod { - return self.fetcherService.cookieStorageMethod; -} - -- (void)setShouldFetchInBackground:(BOOL)flag { - self.fetcherService.shouldFetchInBackground = flag; -} - -- (BOOL)shouldFetchInBackground { - return self.fetcherService.shouldFetchInBackground; -} - -- (void)setDelegateQueue:(NSOperationQueue *)delegateQueue { - self.fetcherService.delegateQueue = delegateQueue; -} - -- (NSOperationQueue *)delegateQueue { - return self.fetcherService.delegateQueue; -} - -- (void)setRunLoopModes:(NSArray *)array { - self.fetcherService.runLoopModes = array; -} - -- (NSArray *)runLoopModes { - return self.fetcherService.runLoopModes; -} - -#pragma mark - - -// The service properties becomes the initial value for each future ticket's -// properties -- (void)setServiceProperties:(NSDictionary *)dict { - [serviceProperties_ autorelease]; - serviceProperties_ = [dict mutableCopy]; -} - -- (NSDictionary *)serviceProperties { - // be sure the returned pointer has the life of the autorelease pool, - // in case self is released immediately - return [[serviceProperties_ retain] autorelease]; -} - -- (void)setServiceProperty:(id)obj forKey:(NSString *)key { - - if (obj == nil) { - // user passed in nil, so delete the property - [serviceProperties_ removeObjectForKey:key]; - } else { - // be sure the property dictionary exists - if (serviceProperties_ == nil) { - [self setServiceProperties:[NSDictionary dictionary]]; - } - [serviceProperties_ setObject:obj forKey:key]; - } -} - -- (id)servicePropertyForKey:(NSString *)key { - id obj = [serviceProperties_ objectForKey:key]; - - // be sure the returned pointer has the life of the autorelease pool, - // in case self is released immediately - return [[obj retain] autorelease]; -} - -- (void)setServiceUserData:(id)userData { - [self setServiceProperty:userData forKey:kUserDataPropertyKey]; -} - -- (id)serviceUserData { - return [[[self servicePropertyForKey:kUserDataPropertyKey] retain] autorelease]; -} - -- (void)setAuthorizer:(id )authorizer { - self.fetcherService.authorizer = authorizer; -} - -- (id )authorizer { - return self.fetcherService.authorizer; -} - -+ (NSUInteger)defaultServiceUploadChunkSize { - // subclasses may override - return kStandardUploadChunkSize; -} - -- (NSUInteger)serviceUploadChunkSize { - return uploadChunkSize_; -} - -- (void)setServiceUploadChunkSize:(NSUInteger)val { - - if (val == kGTLStandardUploadChunkSize) { - // determine an appropriate upload chunk size for the system - - if (![GTMHTTPFetcher doesSupportSentDataCallback]) { - // for 10.4 and iPhone 2, we need a small upload chunk size so there - // are frequent intrachunk callbacks for progress monitoring - val = 75000; - } else { -#if GTL_IPHONE - val = 1000000; -#else - if (NSFoundationVersionNumber >= 751.00) { - // Mac OS X 10.6 - // - // we'll pick a huge upload chunk size, which minimizes http overhead - // and server effort, and we'll hope that NSURLConnection can finally - // handle big uploads reliably - val = 25000000; - } else { - // Mac OS X 10.5 - // - // NSURLConnection is more reliable on POSTs in 10.5 than it was in - // 10.4, but it still fails mysteriously on big uploads on some - // systems, so we'll limit the chunks to a megabyte - val = 1000000; - } -#endif - } - } - uploadChunkSize_ = val; -} - -@end - -@implementation GTLServiceTicket - -@synthesize shouldFetchNextPages = shouldFetchNextPages_, - surrogates = surrogates_, - uploadProgressSelector = uploadProgressSelector_, - retryEnabled = isRetryEnabled_, - hasCalledCallback = hasCalledCallback_, - retrySelector = retrySelector_, - maxRetryInterval = maxRetryInterval_, - objectFetcher = objectFetcher_, - postedObject = postedObject_, - fetchedObject = fetchedObject_, - executingQuery = executingQuery_, - originalQuery = originalQuery_, - fetchError = fetchError_, - pagesFetchedCounter = pagesFetchedCounter_, - APIKey = apiKey_, - parseOperation = parseOperation_, - isREST = isREST_; - -#if NS_BLOCKS_AVAILABLE -@synthesize retryBlock = retryBlock_; -#endif - -+ (id)ticketForService:(GTLService *)service { - return [[[self alloc] initWithService:service] autorelease]; -} - -- (id)initWithService:(GTLService *)service { - self = [super init]; - if (self) { - service_ = [service retain]; - - ticketProperties_ = [service.serviceProperties mutableCopy]; - surrogates_ = [service.surrogates retain]; - uploadProgressSelector_ = service.uploadProgressSelector; - isRetryEnabled_ = service.retryEnabled; - retrySelector_ = service.retrySelector; - maxRetryInterval_ = service.maxRetryInterval; - shouldFetchNextPages_ = service.shouldFetchNextPages; - apiKey_ = [service.APIKey copy]; - -#if NS_BLOCKS_AVAILABLE - uploadProgressBlock_ = [service.uploadProgressBlock copy]; - retryBlock_ = [service.retryBlock copy]; -#endif - } - return self; -} - -- (void)dealloc { - [service_ release]; - [ticketProperties_ release]; - [surrogates_ release]; - [objectFetcher_ release]; -#if NS_BLOCKS_AVAILABLE - [uploadProgressBlock_ release]; - [retryBlock_ release]; -#endif - [postedObject_ release]; - [fetchedObject_ release]; - [executingQuery_ release]; - [originalQuery_ release]; - [fetchError_ release]; - [apiKey_ release]; - [parseOperation_ release]; - - [super dealloc]; -} - -- (NSString *)description { - NSString *devKeyInfo = @""; - if (apiKey_ != nil) { - devKeyInfo = [NSString stringWithFormat:@" devKey:%@", apiKey_]; - } - - NSString *authorizerInfo = @""; - id authorizer = self.objectFetcher.authorizer; - if (authorizer != nil) { - authorizerInfo = [NSString stringWithFormat:@" authorizer:%@", authorizer]; - } - - return [NSString stringWithFormat:@"%@ %p: {service:%@%@%@ fetcher:%@ }", - [self class], self, service_, devKeyInfo, authorizerInfo, objectFetcher_]; -} - -- (void)pauseUpload { - BOOL canPause = [objectFetcher_ respondsToSelector:@selector(pauseFetching)]; - GTL_DEBUG_ASSERT(canPause, @"unpauseable ticket"); - - if (canPause) { - [(GTMHTTPUploadFetcher *)objectFetcher_ pauseFetching]; - } -} - -- (void)resumeUpload { - BOOL canResume = [objectFetcher_ respondsToSelector:@selector(resumeFetching)]; - GTL_DEBUG_ASSERT(canResume, @"unresumable ticket"); - - if (canResume) { - [(GTMHTTPUploadFetcher *)objectFetcher_ resumeFetching]; - } -} - -- (BOOL)isUploadPaused { - BOOL isPausable = [objectFetcher_ respondsToSelector:@selector(isPaused)]; - GTL_DEBUG_ASSERT(isPausable, @"unpauseable ticket"); - - if (isPausable) { - return [(GTMHTTPUploadFetcher *)objectFetcher_ isPaused]; - } - return NO; -} - -- (void)cancelTicket { - NSOperation *parseOperation = self.parseOperation; - [parseOperation cancel]; - self.parseOperation = nil; - - [objectFetcher_ stopFetching]; - objectFetcher_.properties = nil; - - self.objectFetcher = nil; - self.properties = nil; - self.uploadProgressSelector = nil; - -#if NS_BLOCKS_AVAILABLE - self.uploadProgressBlock = nil; - self.retryBlock = nil; -#endif - [self.executingQuery executionDidStop]; - self.executingQuery = self.originalQuery; - - [service_ autorelease]; - service_ = nil; -} - -- (id)service { - return service_; -} - -- (void)setUserData:(id)userData { - [self setProperty:userData forKey:kUserDataPropertyKey]; -} - -- (id)userData { - // be sure the returned pointer has the life of the autorelease pool, - // in case self is released immediately - return [[[self propertyForKey:kUserDataPropertyKey] retain] autorelease]; -} - -- (void)setProperties:(NSDictionary *)dict { - [ticketProperties_ autorelease]; - ticketProperties_ = [dict mutableCopy]; -} - -- (NSDictionary *)properties { - // be sure the returned pointer has the life of the autorelease pool, - // in case self is released immediately - return [[ticketProperties_ retain] autorelease]; -} - -- (void)setProperty:(id)obj forKey:(NSString *)key { - if (obj == nil) { - // user passed in nil, so delete the property - [ticketProperties_ removeObjectForKey:key]; - } else { - // be sure the property dictionary exists - if (ticketProperties_ == nil) { - // call setProperties so observers are notified - [self setProperties:[NSDictionary dictionary]]; - } - [ticketProperties_ setObject:obj forKey:key]; - } -} - -- (id)propertyForKey:(NSString *)key { - id obj = [ticketProperties_ objectForKey:key]; - - // be sure the returned pointer has the life of the autorelease pool, - // in case self is released immediately - return [[obj retain] autorelease]; -} - -- (NSDictionary *)surrogates { - return surrogates_; -} - -- (void)setSurrogates:(NSDictionary *)dict { - [surrogates_ autorelease]; - surrogates_ = [dict retain]; -} - -- (SEL)uploadProgressSelector { - return uploadProgressSelector_; -} - -- (void)setUploadProgressSelector:(SEL)progressSelector { - uploadProgressSelector_ = progressSelector; - - // if the user is turning on the progress selector in the ticket after the - // ticket's fetcher has been created, we need to give the fetcher our sentData - // callback. - // - // The progress monitor must be set in the service prior to creation of the - // ticket on 10.4 and iPhone 2.0, since on those systems the upload data must - // be wrapped with a ProgressMonitorInputStream prior to the creation of the - // fetcher. - if (progressSelector != NULL) { - SEL sentDataSel = @selector(objectFetcher:didSendBytes:totalBytesSent:totalBytesExpectedToSend:); - [[self objectFetcher] setSentDataSelector:sentDataSel]; - } -} - -#if NS_BLOCKS_AVAILABLE -- (void)setUploadProgressBlock:(GTLServiceUploadProgressBlock)block { - [uploadProgressBlock_ autorelease]; - uploadProgressBlock_ = [block copy]; - - if (uploadProgressBlock_) { - // As above, we need the fetcher to call us back when bytes are sent. - SEL sentDataSel = @selector(objectFetcher:didSendBytes:totalBytesSent:totalBytesExpectedToSend:); - [[self objectFetcher] setSentDataSelector:sentDataSel]; - } -} - -- (GTLServiceUploadProgressBlock)uploadProgressBlock { - return uploadProgressBlock_; -} -#endif - -- (NSInteger)statusCode { - return [objectFetcher_ statusCode]; -} - -- (GTLQuery *)queryForRequestID:(NSString *)requestID { - id queryObj = self.executingQuery; - if ([queryObj isBatchQuery]) { - GTLBatchQuery *batch = (GTLBatchQuery *)queryObj; - GTLQuery *result = [batch queryForRequestID:requestID]; - return result; - } else { - GTL_DEBUG_ASSERT(0, @"just use ticket.executingQuery"); - return nil; - } -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLTargetNamespace.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLTargetNamespace.h deleted file mode 100644 index 9e08a9e4..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLTargetNamespace.h +++ /dev/null @@ -1,58 +0,0 @@ -// -// Makes the value of GTL_TARGET_NAMESPACE a prefix for all GTL -// library class names -// - -// -// To avoid global namespace issues, define GTL_TARGET_NAMESPACE to a short -// string in your target if you are using the GTL library in a shared-code -// environment like a plug-in. -// -// For example: -DGTL_TARGET_NAMESPACE=MyPlugin -// - -// -// com.google.GTLFramework v. 2.0 (29 classes) 2011-10-25 19:25:36 -0700 -// - -#if defined(__OBJC__) && defined(GTL_TARGET_NAMESPACE) - - #define _GTL_NS_SYMBOL_INNER(ns, symbol) ns ## _ ## symbol - #define _GTL_NS_SYMBOL_MIDDLE(ns, symbol) _GTL_NS_SYMBOL_INNER(ns, symbol) - #define _GTL_NS_SYMBOL(symbol) _GTL_NS_SYMBOL_MIDDLE(GTL_TARGET_NAMESPACE, symbol) - - #define _GTL_NS_STRING_INNER(ns) #ns - #define _GTL_NS_STRING_MIDDLE(ns) _GTL_NS_STRING_INNER(ns) - #define GTL_TARGET_NAMESPACE_STRING _GTL_NS_STRING_MIDDLE(GTL_TARGET_NAMESPACE) - - #define GTLBatchQuery _GTL_NS_SYMBOL(GTLBatchQuery) - #define GTLBatchResult _GTL_NS_SYMBOL(GTLBatchResult) - #define GTLCollectionObject _GTL_NS_SYMBOL(GTLCollectionObject) - #define GTLDateTime _GTL_NS_SYMBOL(GTLDateTime) - #define GTLErrorObject _GTL_NS_SYMBOL(GTLErrorObject) - #define GTLErrorObjectData _GTL_NS_SYMBOL(GTLErrorObjectData) - #define GTLJSONParser _GTL_NS_SYMBOL(GTLJSONParser) - #define GTLObject _GTL_NS_SYMBOL(GTLObject) - #define GTLQuery _GTL_NS_SYMBOL(GTLQuery) - #define GTLRuntimeCommon _GTL_NS_SYMBOL(GTLRuntimeCommon) - #define GTLService _GTL_NS_SYMBOL(GTLService) - #define GTLServiceTicket _GTL_NS_SYMBOL(GTLServiceTicket) - #define GTLUploadParameters _GTL_NS_SYMBOL(GTLUploadParameters) - #define GTLUtilities _GTL_NS_SYMBOL(GTLUtilities) - #define GTMCachedURLResponse _GTL_NS_SYMBOL(GTMCachedURLResponse) - #define GTMCookieStorage _GTL_NS_SYMBOL(GTMCookieStorage) - #define GTMGatherInputStream _GTL_NS_SYMBOL(GTMGatherInputStream) - #define GTMHTTPFetcher _GTL_NS_SYMBOL(GTMHTTPFetcher) - #define GTMHTTPFetcherService _GTL_NS_SYMBOL(GTMHTTPFetcherService) - #define GTMHTTPFetchHistory _GTL_NS_SYMBOL(GTMHTTPFetchHistory) - #define GTMHTTPUploadFetcher _GTL_NS_SYMBOL(GTMHTTPUploadFetcher) - #define GTMMIMEDocument _GTL_NS_SYMBOL(GTMMIMEDocument) - #define GTMMIMEPart _GTL_NS_SYMBOL(GTMMIMEPart) - #define GTMOAuth2Authentication _GTL_NS_SYMBOL(GTMOAuth2Authentication) - #define GTMOAuth2AuthorizationArgs _GTL_NS_SYMBOL(GTMOAuth2AuthorizationArgs) - #define GTMOAuth2SignIn _GTL_NS_SYMBOL(GTMOAuth2SignIn) - #define GTMOAuth2WindowController _GTL_NS_SYMBOL(GTMOAuth2WindowController) - #define GTMReadMonitorInputStream _GTL_NS_SYMBOL(GTMReadMonitorInputStream) - #define GTMURLCache _GTL_NS_SYMBOL(GTMURLCache) - -#endif diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLUploadParameters.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLUploadParameters.h deleted file mode 100644 index a3c1d9dc..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLUploadParameters.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLUploadParameters.h -// - -// Uploading documentation: -// https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Uploading_Files - -#import - -#import "GTLDefines.h" - -@interface GTLUploadParameters : NSObject { - @private - NSString *MIMEType_; - NSData *data_; - NSFileHandle *fileHandle_; - NSURL *uploadLocationURL_; - NSString *slug_; - BOOL shouldSendUploadOnly_; -} - -// Uploading requires MIME type and one of -// - data to be uploaded -// - file handle for uploading -@property (copy) NSString *MIMEType; -@property (retain) NSData *data; -@property (retain) NSFileHandle *fileHandle; - -// Resuming an in-progress upload is done with the upload location URL, -// and requires a file handle for uploading -@property (retain) NSURL *uploadLocationURL; - -// Some services need a slug (filename) header -@property (copy) NSString *slug; - -// Uploads may be done without a JSON body in the initial request -@property (assign) BOOL shouldSendUploadOnly; - -+ (GTLUploadParameters *)uploadParametersWithData:(NSData *)data - MIMEType:(NSString *)mimeType GTL_NONNULL((1,2)); - -+ (GTLUploadParameters *)uploadParametersWithFileHandle:(NSFileHandle *)fileHandle - MIMEType:(NSString *)mimeType GTL_NONNULL((1,2)); - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLUploadParameters.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLUploadParameters.m deleted file mode 100644 index 1a668a9d..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLUploadParameters.m +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTLObject.m -// - -#include - -#import "GTLUploadParameters.h" - -@implementation GTLUploadParameters - -@synthesize MIMEType = MIMEType_, - data = data_, - fileHandle = fileHandle_, - uploadLocationURL = uploadLocationURL_, - slug = slug_, - shouldSendUploadOnly = shouldSendUploadOnly_; - -+ (GTLUploadParameters *)uploadParametersWithData:(NSData *)data - MIMEType:(NSString *)mimeType { - GTLUploadParameters *params = [[[GTLUploadParameters alloc] init] autorelease]; - params.data = data; - params.MIMEType = mimeType; - return params; -} - -+ (GTLUploadParameters *)uploadParametersWithFileHandle:(NSFileHandle *)fileHandle - MIMEType:(NSString *)mimeType { - GTLUploadParameters *params = [[[GTLUploadParameters alloc] init] autorelease]; - params.fileHandle = fileHandle; - params.MIMEType = mimeType; - return params; -} - -- (id)copyWithZone:(NSZone *)zone { - GTLUploadParameters *newParams = [[[self class] allocWithZone:zone] init]; - newParams.MIMEType = self.MIMEType; - newParams.data = self.data; - newParams.fileHandle = self.fileHandle; - newParams.uploadLocationURL = self.uploadLocationURL; - newParams.slug = self.slug; - newParams.shouldSendUploadOnly = self.shouldSendUploadOnly; - return newParams; -} - -- (void)dealloc { - [MIMEType_ release]; - [data_ release]; - [fileHandle_ release]; - [uploadLocationURL_ release]; - [slug_ release]; - - [super dealloc]; -} - -- (NSString *)description { - NSMutableArray *array = [NSMutableArray array]; - NSString *str = [NSString stringWithFormat:@"MIMEType:%@", MIMEType_]; - [array addObject:str]; - - if (data_) { - str = [NSString stringWithFormat:@"data:%llu bytes", - (unsigned long long)[data_ length]]; - [array addObject:str]; - } - - if (fileHandle_) { - str = [NSString stringWithFormat:@"fileHandle:%@", fileHandle_]; - [array addObject:str]; - } - - if (uploadLocationURL_) { - str = [NSString stringWithFormat:@"uploadLocation:%@", - [uploadLocationURL_ absoluteString]]; - [array addObject:str]; - } - - if (slug_) { - str = [NSString stringWithFormat:@"slug:%@", slug_]; - [array addObject:str]; - } - - if (shouldSendUploadOnly_) { - [array addObject:@"shouldSendUploadOnly"]; - } - - NSString *descStr = [array componentsJoinedByString:@", "]; - str = [NSString stringWithFormat:@"%@ %p: {%@}", - [self class], self, descStr]; - return str; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLUtilities.h b/External/google-plus-ios-sdk/OpenSource/GTL/GTLUtilities.h deleted file mode 100644 index 97f4bf07..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLUtilities.h +++ /dev/null @@ -1,93 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#ifndef SKIP_GTL_DEFINES - #import "GTLDefines.h" -#endif - -// helper functions for implementing isEqual: -BOOL GTL_AreEqualOrBothNil(id obj1, id obj2); -BOOL GTL_AreBoolsEqual(BOOL b1, BOOL b2); - -// Helper to ensure a number is a number. -// -// The GoogleAPI servers will send numbers >53 bits as strings to avoid -// bugs in some JavaScript implementations. Work around this by catching -// the string and turning it back into a number. -NSNumber *GTL_EnsureNSNumber(NSNumber *num); - -@interface GTLUtilities : NSObject - -// -// String encoding -// - -// URL encoding, different for parts of URLs and parts of URL parameters -// -// +stringByURLEncodingString just makes a string legal for a URL -// -// +stringByURLEncodingForURI also encodes some characters that are legal in -// URLs but should not be used in URIs, -// per http://bitworking.org/projects/atom/rfc5023.html#rfc.section.9.7 -// -// +stringByURLEncodingStringParameter is like +stringByURLEncodingForURI but -// replaces space characters with + characters rather than percent-escaping them -// -+ (NSString *)stringByURLEncodingString:(NSString *)str; -+ (NSString *)stringByURLEncodingForURI:(NSString *)str; -+ (NSString *)stringByURLEncodingStringParameter:(NSString *)str; - -// Percent-encoded UTF-8 -+ (NSString *)stringByPercentEncodingUTF8ForString:(NSString *)str; - -// Key-value coding searches in an array -// -// Utilities to get from an array objects having a known value (or nil) -// at a keyPath - -+ (NSArray *)objectsFromArray:(NSArray *)sourceArray - withValue:(id)desiredValue - forKeyPath:(NSString *)keyPath; - -+ (id)firstObjectFromArray:(NSArray *)sourceArray - withValue:(id)desiredValue - forKeyPath:(NSString *)keyPath; - -// -// Version helpers -// - -+ (NSComparisonResult)compareVersion:(NSString *)ver1 toVersion:(NSString *)ver2; - -// -// URL builder -// - -// If there are already query parameters on urlString, the new ones are simple -// appended after them. -+ (NSURL *)URLWithString:(NSString *)urlString - queryParameters:(NSDictionary *)queryParameters; - -// Allocate a global dictionary -+ (NSMutableDictionary *)newStaticDictionary; - -// Walk up the class tree merging dictionaries and return the result. -+ (NSDictionary *)mergedClassDictionaryForSelector:(SEL)selector - startClass:(Class)startClass - ancestorClass:(Class)ancestorClass - cache:(NSMutableDictionary *)cache; -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTL/GTLUtilities.m b/External/google-plus-ios-sdk/OpenSource/GTL/GTLUtilities.m deleted file mode 100644 index 90d8e745..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTL/GTLUtilities.m +++ /dev/null @@ -1,358 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "GTLUtilities.h" - -#include - -@implementation GTLUtilities - -#pragma mark String encoding - -// URL Encoding - -+ (NSString *)stringByURLEncodingString:(NSString *)str { - NSString *result = [str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - return result; -} - -// NSURL's stringByAddingPercentEscapesUsingEncoding: does not escape -// some characters that should be escaped in URL parameters, like / and ?; -// we'll use CFURL to force the encoding of those -// -// Reference: http://www.ietf.org/rfc/rfc3986.txt - -const CFStringRef kCharsToForceEscape = CFSTR("!*'();:@&=+$,/?%#[]"); - -+ (NSString *)stringByURLEncodingForURI:(NSString *)str { - - NSString *resultStr = str; - - CFStringRef originalString = (CFStringRef) str; - CFStringRef leaveUnescaped = NULL; - - CFStringRef escapedStr; - escapedStr = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, - originalString, - leaveUnescaped, - kCharsToForceEscape, - kCFStringEncodingUTF8); - if (escapedStr) { - resultStr = [(id)CFMakeCollectable(escapedStr) autorelease]; - } - return resultStr; -} - -+ (NSString *)stringByURLEncodingStringParameter:(NSString *)str { - // For parameters, we'll explicitly leave spaces unescaped now, and replace - // them with +'s - NSString *resultStr = str; - - CFStringRef originalString = (CFStringRef) str; - CFStringRef leaveUnescaped = CFSTR(" "); - - CFStringRef escapedStr; - escapedStr = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, - originalString, - leaveUnescaped, - kCharsToForceEscape, - kCFStringEncodingUTF8); - - if (escapedStr) { - NSMutableString *mutableStr = [NSMutableString stringWithString:(NSString *)escapedStr]; - CFRelease(escapedStr); - - // replace spaces with plusses - [mutableStr replaceOccurrencesOfString:@" " - withString:@"+" - options:0 - range:NSMakeRange(0, [mutableStr length])]; - resultStr = mutableStr; - } - return resultStr; -} - -+ (NSString *)stringByPercentEncodingUTF8ForString:(NSString *)inputStr { - - // Encode per http://bitworking.org/projects/atom/rfc5023.html#rfc.section.9.7 - // - // This is used for encoding upload slug headers - // - // Step through the string as UTF-8, and replace characters outside 20..7E - // (and the percent symbol itself, 25) with percent-encodings - // - // We avoid creating an encoding string unless we encounter some characters - // that require it - const char* utf8 = [inputStr UTF8String]; - if (utf8 == NULL) { - return nil; - } - - NSMutableString *encoded = nil; - - for (unsigned int idx = 0; utf8[idx] != '\0'; idx++) { - - unsigned char currChar = (unsigned char)utf8[idx]; - if (currChar < 0x20 || currChar == 0x25 || currChar > 0x7E) { - - if (encoded == nil) { - // Start encoding and catch up on the character skipped so far - encoded = [[[NSMutableString alloc] initWithBytes:utf8 - length:idx - encoding:NSUTF8StringEncoding] autorelease]; - } - - // append this byte as a % and then uppercase hex - [encoded appendFormat:@"%%%02X", currChar]; - - } else { - // This character does not need encoding - // - // Encoded is nil here unless we've encountered a previous character - // that needed encoding - [encoded appendFormat:@"%c", currChar]; - } - } - - if (encoded) { - return encoded; - } - - return inputStr; -} - -#pragma mark Key-Value Coding Searches in an Array - -+ (NSArray *)objectsFromArray:(NSArray *)sourceArray - withValue:(id)desiredValue - forKeyPath:(NSString *)keyPath { - // Step through all entries, get the value from - // the key path, and see if it's equal to the - // desired value - NSMutableArray *results = [NSMutableArray array]; - - for(id obj in sourceArray) { - id val = [obj valueForKeyPath:keyPath]; - if (GTL_AreEqualOrBothNil(val, desiredValue)) { - - // found a match; add it to the results array - [results addObject:obj]; - } - } - return results; -} - -+ (id)firstObjectFromArray:(NSArray *)sourceArray - withValue:(id)desiredValue - forKeyPath:(NSString *)keyPath { - for (id obj in sourceArray) { - id val = [obj valueForKeyPath:keyPath]; - if (GTL_AreEqualOrBothNil(val, desiredValue)) { - // found a match; return it - return obj; - } - } - return nil; -} - -#pragma mark Version helpers - -// compareVersion compares two strings in 1.2.3.4 format -// missing fields are interpreted as zeros, so 1.2 = 1.2.0.0 -+ (NSComparisonResult)compareVersion:(NSString *)ver1 toVersion:(NSString *)ver2 { - - static NSCharacterSet* dotSet = nil; - if (dotSet == nil) { - dotSet = [[NSCharacterSet characterSetWithCharactersInString:@"."] retain]; - } - - if (ver1 == nil) ver1 = @""; - if (ver2 == nil) ver2 = @""; - - NSScanner* scanner1 = [NSScanner scannerWithString:ver1]; - NSScanner* scanner2 = [NSScanner scannerWithString:ver2]; - - [scanner1 setCharactersToBeSkipped:dotSet]; - [scanner2 setCharactersToBeSkipped:dotSet]; - - int partA1 = 0, partA2 = 0, partB1 = 0, partB2 = 0; - int partC1 = 0, partC2 = 0, partD1 = 0, partD2 = 0; - - if ([scanner1 scanInt:&partA1] && [scanner1 scanInt:&partB1] - && [scanner1 scanInt:&partC1] && [scanner1 scanInt:&partD1]) { - } - if ([scanner2 scanInt:&partA2] && [scanner2 scanInt:&partB2] - && [scanner2 scanInt:&partC2] && [scanner2 scanInt:&partD2]) { - } - - if (partA1 != partA2) return ((partA1 < partA2) ? NSOrderedAscending : NSOrderedDescending); - if (partB1 != partB2) return ((partB1 < partB2) ? NSOrderedAscending : NSOrderedDescending); - if (partC1 != partC2) return ((partC1 < partC2) ? NSOrderedAscending : NSOrderedDescending); - if (partD1 != partD2) return ((partD1 < partD2) ? NSOrderedAscending : NSOrderedDescending); - return NSOrderedSame; -} - -#pragma mark URL builder - -+ (NSURL *)URLWithString:(NSString *)urlString - queryParameters:(NSDictionary *)queryParameters { - if ([urlString length] == 0) return nil; - - NSString *fullURLString; - if ([queryParameters count] > 0) { - NSMutableArray *queryItems = [NSMutableArray arrayWithCapacity:[queryParameters count]]; - - // sort the custom parameter keys so that we have deterministic parameter - // order for unit tests - NSArray *queryKeys = [queryParameters allKeys]; - NSArray *sortedQueryKeys = [queryKeys sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; - - for (NSString *paramKey in sortedQueryKeys) { - NSString *paramValue = [queryParameters valueForKey:paramKey]; - - NSString *paramItem = [NSString stringWithFormat:@"%@=%@", - [self stringByURLEncodingStringParameter:paramKey], - [self stringByURLEncodingStringParameter:paramValue]]; - - [queryItems addObject:paramItem]; - } - - NSString *paramStr = [queryItems componentsJoinedByString:@"&"]; - - BOOL hasQMark = ([urlString rangeOfString:@"?"].location == NSNotFound); - char joiner = hasQMark ? '?' : '&'; - fullURLString = [NSString stringWithFormat:@"%@%c%@", - urlString, joiner, paramStr]; - } else { - fullURLString = urlString; - } - NSURL *result = [NSURL URLWithString:fullURLString]; - return result; -} - -#pragma mark Collections - -+ (NSMutableDictionary *)newStaticDictionary { - NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; - - // make the dictionary ineligible for garbage collection -#if !GTL_IPHONE - [[NSGarbageCollector defaultCollector] disableCollectorForPointer:dict]; -#endif - return dict; -} - -+ (NSDictionary *)mergedClassDictionaryForSelector:(SEL)selector - startClass:(Class)startClass - ancestorClass:(Class)ancestorClass - cache:(NSMutableDictionary *)cache { - NSDictionary *result; - @synchronized(cache) { - result = [cache objectForKey:startClass]; - if (result == nil) { - // Collect the class's dictionary. - NSDictionary *classDict = [startClass performSelector:selector]; - - // Collect the parent class's merged dictionary. - NSDictionary *parentClassMergedDict; - if ([startClass isEqual:ancestorClass]) { - parentClassMergedDict = nil; - } else { - Class parentClass = class_getSuperclass(startClass); - parentClassMergedDict = - [GTLUtilities mergedClassDictionaryForSelector:selector - startClass:parentClass - ancestorClass:ancestorClass - cache:cache]; - } - - // Merge this class's into the parent's so things properly override. - NSMutableDictionary *mergeDict; - if (parentClassMergedDict != nil) { - mergeDict = - [NSMutableDictionary dictionaryWithDictionary:parentClassMergedDict]; - } else { - mergeDict = [NSMutableDictionary dictionary]; - } - if (classDict != nil) { - [mergeDict addEntriesFromDictionary:classDict]; - } - - // Make an immutable version. - result = [NSDictionary dictionaryWithDictionary:mergeDict]; - - // Save it. - [cache setObject:result forKey:(id)startClass]; - } - } - return result; -} - -@end - -// isEqual: has the fatal flaw that it doesn't deal well with the receiver -// being nil. We'll use this utility instead. -BOOL GTL_AreEqualOrBothNil(id obj1, id obj2) { - if (obj1 == obj2) { - return YES; - } - if (obj1 && obj2) { - BOOL areEqual = [obj1 isEqual:obj2]; - return areEqual; - } - return NO; -} - -BOOL GTL_AreBoolsEqual(BOOL b1, BOOL b2) { - // avoid comparison problems with boolean types by negating - // both booleans - return (!b1 == !b2); -} - -NSNumber *GTL_EnsureNSNumber(NSNumber *num) { - // If the server returned a string object where we expect a number, try - // to make a number object. - if ([num isKindOfClass:[NSString class]]) { - NSNumber *newNum; - NSString *str = (NSString *)num; - if ([str rangeOfString:@"."].location != NSNotFound) { - // This is a floating-point number. - // Force the parser to use '.' as the decimal separator. - static NSLocale *usLocale = nil; - @synchronized([GTLUtilities class]) { - if (usLocale == nil) { - usLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; - } - newNum = [NSDecimalNumber decimalNumberWithString:(NSString*)num - locale:(id)usLocale]; - } - } else { - // NSDecimalNumber +decimalNumberWithString:locale: - // does not correctly create an NSNumber for large values like - // 71100000000007780. - if ([str hasPrefix:@"-"]) { - newNum = [NSNumber numberWithLongLong:[str longLongValue]]; - } else { - const char *utf8 = [str UTF8String]; - unsigned long long ull = strtoull(utf8, NULL, 10); - newNum = [NSNumber numberWithUnsignedLongLong:ull]; - } - } - if (newNum) { - num = newNum; - } - } - return num; -} diff --git a/External/google-plus-ios-sdk/OpenSource/GTMDefines.h b/External/google-plus-ios-sdk/OpenSource/GTMDefines.h deleted file mode 100644 index c2958487..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMDefines.h +++ /dev/null @@ -1,441 +0,0 @@ -// -// GTMDefines.h -// -// Copyright 2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -// ============================================================================ - -#include -#include - -#ifdef __OBJC__ -#include -#endif // __OBJC__ - -#if TARGET_OS_IPHONE -#include -#endif // TARGET_OS_IPHONE - -// Not all MAC_OS_X_VERSION_10_X macros defined in past SDKs -#ifndef MAC_OS_X_VERSION_10_5 - #define MAC_OS_X_VERSION_10_5 1050 -#endif -#ifndef MAC_OS_X_VERSION_10_6 - #define MAC_OS_X_VERSION_10_6 1060 -#endif -#ifndef MAC_OS_X_VERSION_10_7 - #define MAC_OS_X_VERSION_10_7 1070 -#endif - -// Not all __IPHONE_X macros defined in past SDKs -#ifndef __IPHONE_3_0 - #define __IPHONE_3_0 30000 -#endif -#ifndef __IPHONE_3_1 - #define __IPHONE_3_1 30100 -#endif -#ifndef __IPHONE_3_2 - #define __IPHONE_3_2 30200 -#endif -#ifndef __IPHONE_4_0 - #define __IPHONE_4_0 40000 -#endif -#ifndef __IPHONE_4_3 - #define __IPHONE_4_3 40300 -#endif -#ifndef __IPHONE_5_0 - #define __IPHONE_5_0 50000 -#endif - -// ---------------------------------------------------------------------------- -// CPP symbols that can be overridden in a prefix to control how the toolbox -// is compiled. -// ---------------------------------------------------------------------------- - - -// By setting the GTM_CONTAINERS_VALIDATION_FAILED_LOG and -// GTM_CONTAINERS_VALIDATION_FAILED_ASSERT macros you can control what happens -// when a validation fails. If you implement your own validators, you may want -// to control their internals using the same macros for consistency. -#ifndef GTM_CONTAINERS_VALIDATION_FAILED_ASSERT - #define GTM_CONTAINERS_VALIDATION_FAILED_ASSERT 0 -#endif - -// Give ourselves a consistent way to do inlines. Apple's macros even use -// a few different actual definitions, so we're based off of the foundation -// one. -#if !defined(GTM_INLINE) - #if (defined (__GNUC__) && (__GNUC__ == 4)) || defined (__clang__) - #define GTM_INLINE static __inline__ __attribute__((always_inline)) - #else - #define GTM_INLINE static __inline__ - #endif -#endif - -// Give ourselves a consistent way of doing externs that links up nicely -// when mixing objc and objc++ -#if !defined (GTM_EXTERN) - #if defined __cplusplus - #define GTM_EXTERN extern "C" - #define GTM_EXTERN_C_BEGIN extern "C" { - #define GTM_EXTERN_C_END } - #else - #define GTM_EXTERN extern - #define GTM_EXTERN_C_BEGIN - #define GTM_EXTERN_C_END - #endif -#endif - -// Give ourselves a consistent way of exporting things if we have visibility -// set to hidden. -#if !defined (GTM_EXPORT) - #define GTM_EXPORT __attribute__((visibility("default"))) -#endif - -// Give ourselves a consistent way of declaring something as unused. This -// doesn't use __unused because that is only supported in gcc 4.2 and greater. -#if !defined (GTM_UNUSED) -#define GTM_UNUSED(x) ((void)(x)) -#endif - -// _GTMDevLog & _GTMDevAssert -// -// _GTMDevLog & _GTMDevAssert are meant to be a very lightweight shell for -// developer level errors. This implementation simply macros to NSLog/NSAssert. -// It is not intended to be a general logging/reporting system. -// -// Please see http://code.google.com/p/google-toolbox-for-mac/wiki/DevLogNAssert -// for a little more background on the usage of these macros. -// -// _GTMDevLog log some error/problem in debug builds -// _GTMDevAssert assert if conditon isn't met w/in a method/function -// in all builds. -// -// To replace this system, just provide different macro definitions in your -// prefix header. Remember, any implementation you provide *must* be thread -// safe since this could be called by anything in what ever situtation it has -// been placed in. -// - -// We only define the simple macros if nothing else has defined this. -#ifndef _GTMDevLog - -#ifdef DEBUG - #define _GTMDevLog(...) NSLog(__VA_ARGS__) -#else - #define _GTMDevLog(...) do { } while (0) -#endif - -#endif // _GTMDevLog - -#ifndef _GTMDevAssert -// we directly invoke the NSAssert handler so we can pass on the varargs -// (NSAssert doesn't have a macro we can use that takes varargs) -#if !defined(NS_BLOCK_ASSERTIONS) - #define _GTMDevAssert(condition, ...) \ - do { \ - if (!(condition)) { \ - [[NSAssertionHandler currentHandler] \ - handleFailureInFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] \ - file:[NSString stringWithUTF8String:__FILE__] \ - lineNumber:__LINE__ \ - description:__VA_ARGS__]; \ - } \ - } while(0) -#else // !defined(NS_BLOCK_ASSERTIONS) - #define _GTMDevAssert(condition, ...) do { } while (0) -#endif // !defined(NS_BLOCK_ASSERTIONS) - -#endif // _GTMDevAssert - -// _GTMCompileAssert -// _GTMCompileAssert is an assert that is meant to fire at compile time if you -// want to check things at compile instead of runtime. For example if you -// want to check that a wchar is 4 bytes instead of 2 you would use -// _GTMCompileAssert(sizeof(wchar_t) == 4, wchar_t_is_4_bytes_on_OS_X) -// Note that the second "arg" is not in quotes, and must be a valid processor -// symbol in it's own right (no spaces, punctuation etc). - -// Wrapping this in an #ifndef allows external groups to define their own -// compile time assert scheme. -#ifndef _GTMCompileAssert - // We got this technique from here: - // http://unixjunkie.blogspot.com/2007/10/better-compile-time-asserts_29.html - - #define _GTMCompileAssertSymbolInner(line, msg) _GTMCOMPILEASSERT ## line ## __ ## msg - #define _GTMCompileAssertSymbol(line, msg) _GTMCompileAssertSymbolInner(line, msg) - #define _GTMCompileAssert(test, msg) \ - typedef char _GTMCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ] -#endif // _GTMCompileAssert - -// ---------------------------------------------------------------------------- -// CPP symbols defined based on the project settings so the GTM code has -// simple things to test against w/o scattering the knowledge of project -// setting through all the code. -// ---------------------------------------------------------------------------- - -// Provide a single constant CPP symbol that all of GTM uses for ifdefing -// iPhone code. -#if TARGET_OS_IPHONE // iPhone SDK - // For iPhone specific stuff - #define GTM_IPHONE_SDK 1 - #if TARGET_IPHONE_SIMULATOR - #define GTM_IPHONE_SIMULATOR 1 - #else - #define GTM_IPHONE_DEVICE 1 - #endif // TARGET_IPHONE_SIMULATOR - // By default, GTM has provided it's own unittesting support, define this - // to use the support provided by Xcode, especially for the Xcode4 support - // for unittesting. - #ifndef GTM_IPHONE_USE_SENTEST - #define GTM_IPHONE_USE_SENTEST 0 - #endif -#else - // For MacOS specific stuff - #define GTM_MACOS_SDK 1 -#endif - -// Some of our own availability macros -#if GTM_MACOS_SDK -#define GTM_AVAILABLE_ONLY_ON_IPHONE UNAVAILABLE_ATTRIBUTE -#define GTM_AVAILABLE_ONLY_ON_MACOS -#else -#define GTM_AVAILABLE_ONLY_ON_IPHONE -#define GTM_AVAILABLE_ONLY_ON_MACOS UNAVAILABLE_ATTRIBUTE -#endif - -// GC was dropped by Apple, define the old constant incase anyone still keys -// off of it. -#ifndef GTM_SUPPORT_GC - #define GTM_SUPPORT_GC 0 -#endif - -// To simplify support for 64bit (and Leopard in general), we provide the type -// defines for non Leopard SDKs -#if !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) - // NSInteger/NSUInteger and Max/Mins - #ifndef NSINTEGER_DEFINED - #if __LP64__ || NS_BUILD_32_LIKE_64 - typedef long NSInteger; - typedef unsigned long NSUInteger; - #else - typedef int NSInteger; - typedef unsigned int NSUInteger; - #endif - #define NSIntegerMax LONG_MAX - #define NSIntegerMin LONG_MIN - #define NSUIntegerMax ULONG_MAX - #define NSINTEGER_DEFINED 1 - #endif // NSINTEGER_DEFINED - // CGFloat - #ifndef CGFLOAT_DEFINED - #if defined(__LP64__) && __LP64__ - // This really is an untested path (64bit on Tiger?) - typedef double CGFloat; - #define CGFLOAT_MIN DBL_MIN - #define CGFLOAT_MAX DBL_MAX - #define CGFLOAT_IS_DOUBLE 1 - #else /* !defined(__LP64__) || !__LP64__ */ - typedef float CGFloat; - #define CGFLOAT_MIN FLT_MIN - #define CGFLOAT_MAX FLT_MAX - #define CGFLOAT_IS_DOUBLE 0 - #endif /* !defined(__LP64__) || !__LP64__ */ - #define CGFLOAT_DEFINED 1 - #endif // CGFLOAT_DEFINED -#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 - -// Some support for advanced clang static analysis functionality -// See http://clang-analyzer.llvm.org/annotations.html -#ifndef __has_feature // Optional. - #define __has_feature(x) 0 // Compatibility with non-clang compilers. -#endif - -#ifndef NS_RETURNS_RETAINED - #if __has_feature(attribute_ns_returns_retained) - #define NS_RETURNS_RETAINED __attribute__((ns_returns_retained)) - #else - #define NS_RETURNS_RETAINED - #endif -#endif - -#ifndef NS_RETURNS_NOT_RETAINED - #if __has_feature(attribute_ns_returns_not_retained) - #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) - #else - #define NS_RETURNS_NOT_RETAINED - #endif -#endif - -#ifndef CF_RETURNS_RETAINED - #if __has_feature(attribute_cf_returns_retained) - #define CF_RETURNS_RETAINED __attribute__((cf_returns_retained)) - #else - #define CF_RETURNS_RETAINED - #endif -#endif - -#ifndef CF_RETURNS_NOT_RETAINED - #if __has_feature(attribute_cf_returns_not_retained) - #define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained)) - #else - #define CF_RETURNS_NOT_RETAINED - #endif -#endif - -#ifndef NS_CONSUMED - #if __has_feature(attribute_ns_consumed) - #define NS_CONSUMED __attribute__((ns_consumed)) - #else - #define NS_CONSUMED - #endif -#endif - -#ifndef CF_CONSUMED - #if __has_feature(attribute_cf_consumed) - #define CF_CONSUMED __attribute__((cf_consumed)) - #else - #define CF_CONSUMED - #endif -#endif - -#ifndef NS_CONSUMES_SELF - #if __has_feature(attribute_ns_consumes_self) - #define NS_CONSUMES_SELF __attribute__((ns_consumes_self)) - #else - #define NS_CONSUMES_SELF - #endif -#endif - -// Defined on 10.6 and above. -#ifndef NS_FORMAT_ARGUMENT - #define NS_FORMAT_ARGUMENT(A) -#endif - -// Defined on 10.6 and above. -#ifndef NS_FORMAT_FUNCTION - #define NS_FORMAT_FUNCTION(F,A) -#endif - -// Defined on 10.6 and above. -#ifndef CF_FORMAT_ARGUMENT - #define CF_FORMAT_ARGUMENT(A) -#endif - -// Defined on 10.6 and above. -#ifndef CF_FORMAT_FUNCTION - #define CF_FORMAT_FUNCTION(F,A) -#endif - -#ifndef GTM_NONNULL - #if defined(__has_attribute) - #if __has_attribute(nonnull) - #define GTM_NONNULL(x) __attribute__((nonnull x)) - #else - #define GTM_NONNULL(x) - #endif - #else - #define GTM_NONNULL(x) - #endif -#endif - -// Invalidates the initializer from which it's called. -#ifndef GTMInvalidateInitializer - #if __has_feature(objc_arc) - #define GTMInvalidateInitializer() \ - do { \ - [self class]; /* Avoid warning of dead store to |self|. */ \ - _GTMDevAssert(NO, @"Invalid initializer."); \ - return nil; \ - } while (0) - #else - #define GTMInvalidateInitializer() \ - do { \ - [self release]; \ - _GTMDevAssert(NO, @"Invalid initializer."); \ - return nil; \ - } while (0) - #endif -#endif - -#ifdef __OBJC__ - -// Declared here so that it can easily be used for logging tracking if -// necessary. See GTMUnitTestDevLog.h for details. -@class NSString; -GTM_EXTERN void _GTMUnitTestDevLog(NSString *format, ...) NS_FORMAT_FUNCTION(1, 2); - -// Macro to allow you to create NSStrings out of other macros. -// #define FOO foo -// NSString *fooString = GTM_NSSTRINGIFY(FOO); -#if !defined (GTM_NSSTRINGIFY) - #define GTM_NSSTRINGIFY_INNER(x) @#x - #define GTM_NSSTRINGIFY(x) GTM_NSSTRINGIFY_INNER(x) -#endif - -// Macro to allow fast enumeration when building for 10.5 or later, and -// reliance on NSEnumerator for 10.4. Remember, NSDictionary w/ FastEnumeration -// does keys, so pick the right thing, nothing is done on the FastEnumeration -// side to be sure you're getting what you wanted. -#ifndef GTM_FOREACH_OBJECT - #if TARGET_OS_IPHONE || !(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) - #define GTM_FOREACH_ENUMEREE(element, enumeration) \ - for (element in enumeration) - #define GTM_FOREACH_OBJECT(element, collection) \ - for (element in collection) - #define GTM_FOREACH_KEY(element, collection) \ - for (element in collection) - #else - #define GTM_FOREACH_ENUMEREE(element, enumeration) \ - for (NSEnumerator *_ ## element ## _enum = enumeration; \ - (element = [_ ## element ## _enum nextObject]) != nil; ) - #define GTM_FOREACH_OBJECT(element, collection) \ - GTM_FOREACH_ENUMEREE(element, [collection objectEnumerator]) - #define GTM_FOREACH_KEY(element, collection) \ - GTM_FOREACH_ENUMEREE(element, [collection keyEnumerator]) - #endif -#endif - -// ============================================================================ - -// To simplify support for both Leopard and Snow Leopard we declare -// the Snow Leopard protocols that we need here. -#if !defined(GTM_10_6_PROTOCOLS_DEFINED) && !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) -#define GTM_10_6_PROTOCOLS_DEFINED 1 -@protocol NSConnectionDelegate -@end -@protocol NSAnimationDelegate -@end -@protocol NSImageDelegate -@end -@protocol NSTabViewDelegate -@end -#endif // !defined(GTM_10_6_PROTOCOLS_DEFINED) && !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) - -// GTM_SEL_STRING is for specifying selector (usually property) names to KVC -// or KVO methods. -// In debug it will generate warnings for undeclared selectors if -// -Wunknown-selector is turned on. -// In release it will have no runtime overhead. -#ifndef GTM_SEL_STRING - #ifdef DEBUG - #define GTM_SEL_STRING(selName) NSStringFromSelector(@selector(selName)) - #else - #define GTM_SEL_STRING(selName) @#selName - #endif // DEBUG -#endif // GTM_SEL_STRING - -#endif // __OBJC__ diff --git a/External/google-plus-ios-sdk/OpenSource/GTMGarbageCollection.h b/External/google-plus-ios-sdk/OpenSource/GTMGarbageCollection.h deleted file mode 100644 index 93d4efab..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMGarbageCollection.h +++ /dev/null @@ -1,72 +0,0 @@ -// -// GTMGarbageCollection.h -// -// Copyright 2007-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -#import - -#import "GTMDefines.h" - -// This allows us to easily move our code from GC to non GC. -// They are no-ops unless we are require Leopard or above. -// See -// http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/index.html -// and -// http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcCoreFoundation.html#//apple_ref/doc/uid/TP40006687-SW1 -// for details. - -#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5) && !GTM_IPHONE_SDK -// General use would be to call this through GTMCFAutorelease -// but there may be a reason the you want to make something collectable -// but not autoreleased, especially in pure GC code where you don't -// want to bother with the nop autorelease. Done as a define instead of an -// inline so that tools like Clang's scan-build don't report code as leaking. -#define GTMNSMakeCollectable(cf) ((id)NSMakeCollectable(cf)) - -// GTMNSMakeUncollectable is for global maps, etc. that we don't -// want released ever. You should still retain these in non-gc code. -GTM_INLINE void GTMNSMakeUncollectable(id object) { - [[NSGarbageCollector defaultCollector] disableCollectorForPointer:object]; -} - -// Hopefully no code really needs this, but GTMIsGarbageCollectionEnabled is -// a common way to check at runtime if GC is on. -// There are some places where GC doesn't work w/ things w/in Apple's -// frameworks, so this is here so GTM unittests and detect it, and not run -// individual tests to work around bugs in Apple's frameworks. -GTM_INLINE BOOL GTMIsGarbageCollectionEnabled(void) { - return ([NSGarbageCollector defaultCollector] != nil); -} - -#else - -#define GTMNSMakeCollectable(cf) ((id)(cf)) - -GTM_INLINE void GTMNSMakeUncollectable(id object) { -} - -GTM_INLINE BOOL GTMIsGarbageCollectionEnabled(void) { - return NO; -} - -#endif - -// GTMCFAutorelease makes a CF object collectable in GC mode, or adds it -// to the autorelease pool in non-GC mode. Either way it is taken care -// of. Done as a define instead of an inline so that tools like Clang's -// scan-build don't report code as leaking. -#define GTMCFAutorelease(cf) ([GTMNSMakeCollectable(cf) autorelease]) - diff --git a/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetchHistory.h b/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetchHistory.h deleted file mode 100644 index 96018f5d..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetchHistory.h +++ /dev/null @@ -1,187 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTMHTTPFetchHistory.h -// - -// -// Users of the GTMHTTPFetcher class may optionally create and set a fetch -// history object. The fetch history provides "memory" between subsequent -// fetches, including: -// -// - For fetch responses with Etag headers, the fetch history -// remembers the response headers. Future fetcher requests to the same URL -// will be given an "If-None-Match" header, telling the server to return -// a 304 Not Modified status if the response is unchanged, reducing the -// server load and network traffic. -// -// - Optionally, the fetch history can cache the ETagged data that was returned -// in the responses that contained Etag headers. If a later fetch -// results in a 304 status, the fetcher will return the cached ETagged data -// to the client along with a 200 status, hiding the 304. -// -// - The fetch history can track cookies. -// - -#pragma once - -#import - -#import "GTMHTTPFetcher.h" - -#undef _EXTERN -#undef _INITIALIZE_AS -#ifdef GTMHTTPFETCHHISTORY_DEFINE_GLOBALS - #define _EXTERN - #define _INITIALIZE_AS(x) =x -#else - #if defined(__cplusplus) - #define _EXTERN extern "C" - #else - #define _EXTERN extern - #endif - #define _INITIALIZE_AS(x) -#endif - - -// default data cache size for when we're caching responses to handle "not -// modified" errors for the client -#if GTM_IPHONE -// iPhone: up to 1MB memory -_EXTERN const NSUInteger kGTMDefaultETaggedDataCacheMemoryCapacity _INITIALIZE_AS(1*1024*1024); -#else -// Mac OS X: up to 15MB memory -_EXTERN const NSUInteger kGTMDefaultETaggedDataCacheMemoryCapacity _INITIALIZE_AS(15*1024*1024); -#endif - -// forward declarations -@class GTMURLCache; -@class GTMCookieStorage; - -@interface GTMHTTPFetchHistory : NSObject { - @private - GTMURLCache *etaggedDataCache_; - BOOL shouldRememberETags_; - BOOL shouldCacheETaggedData_; // if NO, then only headers are cached - GTMCookieStorage *cookieStorage_; -} - -// With caching enabled, previously-cached data will be returned instead of -// 304 Not Modified responses when repeating a fetch of an URL that previously -// included an ETag header in its response -@property (assign) BOOL shouldRememberETags; // default: NO -@property (assign) BOOL shouldCacheETaggedData; // default: NO - -// the default ETag data cache capacity is kGTMDefaultETaggedDataCacheMemoryCapacity -@property (assign) NSUInteger memoryCapacity; - -@property (retain) GTMCookieStorage *cookieStorage; - -- (id)initWithMemoryCapacity:(NSUInteger)totalBytes - shouldCacheETaggedData:(BOOL)shouldCacheETaggedData; - -- (void)updateRequest:(NSMutableURLRequest *)request isHTTPGet:(BOOL)isHTTPGet; - -- (void)clearETaggedDataCache; -- (void)clearHistory; - -- (void)removeAllCookies; - -@end - - -// GTMURLCache and GTMCachedURLResponse have interfaces similar to their -// NSURLCache counterparts, in hopes that someday the NSURLCache versions -// can be used. But in 10.5.8, those are not reliable enough except when -// used with +setSharedURLCache. Our goal here is just to cache -// responses for handling If-None-Match requests that return -// "Not Modified" responses, not for replacing the general URL -// caches. - -@interface GTMCachedURLResponse : NSObject { - @private - NSURLResponse *response_; - NSData *data_; - NSDate *useDate_; // date this response was last saved or used - NSDate *reservationDate_; // date this response's ETag was used -} - -@property (readonly) NSURLResponse* response; -@property (readonly) NSData* data; - -// date the response was saved or last accessed -@property (retain) NSDate *useDate; - -// date the response's ETag header was last used for a fetch request -@property (retain) NSDate *reservationDate; - -- (id)initWithResponse:(NSURLResponse *)response data:(NSData *)data; -@end - -@interface GTMURLCache : NSObject { - NSMutableDictionary *responses_; // maps request URL to GTMCachedURLResponse - NSUInteger memoryCapacity_; // capacity of NSDatas in the responses - NSUInteger totalDataSize_; // sum of sizes of NSDatas of all responses - NSTimeInterval reservationInterval_; // reservation expiration interval -} - -@property (assign) NSUInteger memoryCapacity; - -- (id)initWithMemoryCapacity:(NSUInteger)totalBytes; - -- (GTMCachedURLResponse *)cachedResponseForRequest:(NSURLRequest *)request; -- (void)storeCachedResponse:(GTMCachedURLResponse *)cachedResponse forRequest:(NSURLRequest *)request; -- (void)removeCachedResponseForRequest:(NSURLRequest *)request; -- (void)removeAllCachedResponses; - -// for unit testing -- (void)setReservationInterval:(NSTimeInterval)secs; -- (NSDictionary *)responses; -- (NSUInteger)totalDataSize; -@end - -@interface GTMCookieStorage : NSObject { - @private - // The cookie storage object manages an array holding cookies, but the array - // is allocated externally (it may be in a fetcher object or the static - // fetcher cookie array.) See the fetcher's setCookieStorageMethod: - // for allocation of this object and assignment of its cookies array. - NSMutableArray *cookies_; -} - -// add all NSHTTPCookies in the supplied array to the storage array, -// replacing cookies in the storage array as appropriate -// Side effect: removes expired cookies from the storage array -- (void)setCookies:(NSArray *)newCookies; - -// retrieve all cookies appropriate for the given URL, considering -// domain, path, cookie name, expiration, security setting. -// Side effect: removes expired cookies from the storage array -- (NSArray *)cookiesForURL:(NSURL *)theURL; - -// return a cookie with the same name, domain, and path as the -// given cookie, or else return nil if none found -// -// Both the cookie being tested and all stored cookies should -// be valid (non-nil name, domains, paths) -- (NSHTTPCookie *)cookieMatchingCookie:(NSHTTPCookie *)cookie; - -// remove any expired cookies, excluding cookies with nil expirations -- (void)removeExpiredCookies; - -- (void)removeAllCookies; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetchHistory.m b/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetchHistory.m deleted file mode 100644 index 2c859230..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetchHistory.m +++ /dev/null @@ -1,605 +0,0 @@ -/* Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTMHTTPFetchHistory.m -// - -#define GTMHTTPFETCHHISTORY_DEFINE_GLOBALS 1 - -#import "GTMHTTPFetchHistory.h" - -const NSTimeInterval kCachedURLReservationInterval = 60.0; // 1 minute -static NSString* const kGTMIfNoneMatchHeader = @"If-None-Match"; -static NSString* const kGTMETagHeader = @"Etag"; - -@implementation GTMCookieStorage - -- (id)init { - self = [super init]; - if (self != nil) { - cookies_ = [[NSMutableArray alloc] init]; - } - return self; -} - -- (void)dealloc { - [cookies_ release]; - [super dealloc]; -} - -// Add all cookies in the new cookie array to the storage, -// replacing stored cookies as appropriate. -// -// Side effect: removes expired cookies from the storage array. -- (void)setCookies:(NSArray *)newCookies { - - @synchronized(cookies_) { - [self removeExpiredCookies]; - - for (NSHTTPCookie *newCookie in newCookies) { - if ([[newCookie name] length] > 0 - && [[newCookie domain] length] > 0 - && [[newCookie path] length] > 0) { - - // remove the cookie if it's currently in the array - NSHTTPCookie *oldCookie = [self cookieMatchingCookie:newCookie]; - if (oldCookie) { - [cookies_ removeObjectIdenticalTo:oldCookie]; - } - - // make sure the cookie hasn't already expired - NSDate *expiresDate = [newCookie expiresDate]; - if ((!expiresDate) || [expiresDate timeIntervalSinceNow] > 0) { - [cookies_ addObject:newCookie]; - } - - } else { - NSAssert1(NO, @"Cookie incomplete: %@", newCookie); - } - } - } -} - -- (void)deleteCookie:(NSHTTPCookie *)cookie { - @synchronized(cookies_) { - NSHTTPCookie *foundCookie = [self cookieMatchingCookie:cookie]; - if (foundCookie) { - [cookies_ removeObjectIdenticalTo:foundCookie]; - } - } -} - -// Retrieve all cookies appropriate for the given URL, considering -// domain, path, cookie name, expiration, security setting. -// Side effect: removed expired cookies from the storage array. -- (NSArray *)cookiesForURL:(NSURL *)theURL { - - NSMutableArray *foundCookies = nil; - - @synchronized(cookies_) { - [self removeExpiredCookies]; - - // We'll prepend "." to the desired domain, since we want the - // actual domain "nytimes.com" to still match the cookie domain - // ".nytimes.com" when we check it below with hasSuffix. - NSString *host = [[theURL host] lowercaseString]; - NSString *path = [theURL path]; - NSString *scheme = [theURL scheme]; - - NSString *domain = nil; - BOOL isLocalhostRetrieval = NO; - - if ([host isEqual:@"localhost"]) { - isLocalhostRetrieval = YES; - } else { - if (host) { - domain = [@"." stringByAppendingString:host]; - } - } - - NSUInteger numberOfCookies = [cookies_ count]; - for (NSUInteger idx = 0; idx < numberOfCookies; idx++) { - - NSHTTPCookie *storedCookie = [cookies_ objectAtIndex:idx]; - - NSString *cookieDomain = [[storedCookie domain] lowercaseString]; - NSString *cookiePath = [storedCookie path]; - BOOL cookieIsSecure = [storedCookie isSecure]; - - BOOL isDomainOK; - - if (isLocalhostRetrieval) { - // prior to 10.5.6, the domain stored into NSHTTPCookies for localhost - // is "localhost.local" - isDomainOK = [cookieDomain isEqual:@"localhost"] - || [cookieDomain isEqual:@"localhost.local"]; - } else { - isDomainOK = [domain hasSuffix:cookieDomain]; - } - - BOOL isPathOK = [cookiePath isEqual:@"/"] || [path hasPrefix:cookiePath]; - BOOL isSecureOK = (!cookieIsSecure) || [scheme isEqual:@"https"]; - - if (isDomainOK && isPathOK && isSecureOK) { - if (foundCookies == nil) { - foundCookies = [NSMutableArray arrayWithCapacity:1]; - } - [foundCookies addObject:storedCookie]; - } - } - } - return foundCookies; -} - -// Return a cookie from the array with the same name, domain, and path as the -// given cookie, or else return nil if none found. -// -// Both the cookie being tested and all cookies in the storage array should -// be valid (non-nil name, domains, paths). -// -// Note: this should only be called from inside a @synchronized(cookies_) block -- (NSHTTPCookie *)cookieMatchingCookie:(NSHTTPCookie *)cookie { - - NSUInteger numberOfCookies = [cookies_ count]; - NSString *name = [cookie name]; - NSString *domain = [cookie domain]; - NSString *path = [cookie path]; - - NSAssert3(name && domain && path, @"Invalid cookie (name:%@ domain:%@ path:%@)", - name, domain, path); - - for (NSUInteger idx = 0; idx < numberOfCookies; idx++) { - - NSHTTPCookie *storedCookie = [cookies_ objectAtIndex:idx]; - - if ([[storedCookie name] isEqual:name] - && [[storedCookie domain] isEqual:domain] - && [[storedCookie path] isEqual:path]) { - - return storedCookie; - } - } - return nil; -} - - -// Internal routine to remove any expired cookies from the array, excluding -// cookies with nil expirations. -// -// Note: this should only be called from inside a @synchronized(cookies_) block -- (void)removeExpiredCookies { - - // count backwards since we're deleting items from the array - for (NSInteger idx = (NSInteger)[cookies_ count] - 1; idx >= 0; idx--) { - - NSHTTPCookie *storedCookie = [cookies_ objectAtIndex:(NSUInteger)idx]; - - NSDate *expiresDate = [storedCookie expiresDate]; - if (expiresDate && [expiresDate timeIntervalSinceNow] < 0) { - [cookies_ removeObjectAtIndex:(NSUInteger)idx]; - } - } -} - -- (void)removeAllCookies { - @synchronized(cookies_) { - [cookies_ removeAllObjects]; - } -} -@end - -// -// GTMCachedURLResponse -// - -@implementation GTMCachedURLResponse - -@synthesize response = response_; -@synthesize data = data_; -@synthesize reservationDate = reservationDate_; -@synthesize useDate = useDate_; - -- (id)initWithResponse:(NSURLResponse *)response data:(NSData *)data { - self = [super init]; - if (self != nil) { - response_ = [response retain]; - data_ = [data retain]; - useDate_ = [[NSDate alloc] init]; - } - return self; -} - -- (void)dealloc { - [response_ release]; - [data_ release]; - [useDate_ release]; - [reservationDate_ release]; - [super dealloc]; -} - -- (NSString *)description { - NSString *reservationStr = reservationDate_ ? - [NSString stringWithFormat:@" resDate:%@", reservationDate_] : @""; - - return [NSString stringWithFormat:@"%@ %p: {bytes:%@ useDate:%@%@}", - [self class], self, - data_ ? [NSNumber numberWithInt:(int)[data_ length]] : nil, - useDate_, - reservationStr]; -} - -- (NSComparisonResult)compareUseDate:(GTMCachedURLResponse *)other { - return [useDate_ compare:[other useDate]]; -} - -@end - -// -// GTMURLCache -// - -@implementation GTMURLCache - -@dynamic memoryCapacity; - -- (id)init { - return [self initWithMemoryCapacity:kGTMDefaultETaggedDataCacheMemoryCapacity]; -} - -- (id)initWithMemoryCapacity:(NSUInteger)totalBytes { - self = [super init]; - if (self != nil) { - memoryCapacity_ = totalBytes; - - responses_ = [[NSMutableDictionary alloc] initWithCapacity:5]; - - reservationInterval_ = kCachedURLReservationInterval; - } - return self; -} - -- (void)dealloc { - [responses_ release]; - [super dealloc]; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"%@ %p: {responses:%@}", - [self class], self, [responses_ allValues]]; -} - -// Setters/getters - -- (void)pruneCacheResponses { - // Internal routine to remove the least-recently-used responses when the - // cache has grown too large - if (memoryCapacity_ >= totalDataSize_) return; - - // Sort keys by date - SEL sel = @selector(compareUseDate:); - NSArray *sortedKeys = [responses_ keysSortedByValueUsingSelector:sel]; - - // The least-recently-used keys are at the beginning of the sorted array; - // remove those (except ones still reserved) until the total data size is - // reduced sufficiently - for (NSURL *key in sortedKeys) { - GTMCachedURLResponse *response = [responses_ objectForKey:key]; - - NSDate *resDate = [response reservationDate]; - BOOL isResponseReserved = (resDate != nil) - && ([resDate timeIntervalSinceNow] > -reservationInterval_); - - if (!isResponseReserved) { - // We can remove this response from the cache - NSUInteger storedSize = [[response data] length]; - totalDataSize_ -= storedSize; - [responses_ removeObjectForKey:key]; - } - - // If we've removed enough response data, then we're done - if (memoryCapacity_ >= totalDataSize_) break; - } -} - -- (void)storeCachedResponse:(GTMCachedURLResponse *)cachedResponse - forRequest:(NSURLRequest *)request { - @synchronized(self) { - // Remove any previous entry for this request - [self removeCachedResponseForRequest:request]; - - // cache this one only if it's not bigger than our cache - NSUInteger storedSize = [[cachedResponse data] length]; - if (storedSize < memoryCapacity_) { - - NSURL *key = [request URL]; - [responses_ setObject:cachedResponse forKey:key]; - totalDataSize_ += storedSize; - - [self pruneCacheResponses]; - } - } -} - -- (GTMCachedURLResponse *)cachedResponseForRequest:(NSURLRequest *)request { - GTMCachedURLResponse *response; - - @synchronized(self) { - NSURL *key = [request URL]; - response = [[[responses_ objectForKey:key] retain] autorelease]; - - // Touch the date to indicate this was recently retrieved - [response setUseDate:[NSDate date]]; - } - return response; -} - -- (void)removeCachedResponseForRequest:(NSURLRequest *)request { - @synchronized(self) { - NSURL *key = [request URL]; - totalDataSize_ -= [[[responses_ objectForKey:key] data] length]; - [responses_ removeObjectForKey:key]; - } -} - -- (void)removeAllCachedResponses { - @synchronized(self) { - [responses_ removeAllObjects]; - totalDataSize_ = 0; - } -} - -- (NSUInteger)memoryCapacity { - return memoryCapacity_; -} - -- (void)setMemoryCapacity:(NSUInteger)totalBytes { - @synchronized(self) { - BOOL didShrink = (totalBytes < memoryCapacity_); - memoryCapacity_ = totalBytes; - - if (didShrink) { - [self pruneCacheResponses]; - } - } -} - -// Methods for unit testing. -- (void)setReservationInterval:(NSTimeInterval)secs { - reservationInterval_ = secs; -} - -- (NSDictionary *)responses { - return responses_; -} - -- (NSUInteger)totalDataSize { - return totalDataSize_; -} - -@end - -// -// GTMHTTPFetchHistory -// - -@interface GTMHTTPFetchHistory () -- (NSString *)cachedETagForRequest:(NSURLRequest *)request; -- (void)removeCachedDataForRequest:(NSURLRequest *)request; -@end - -@implementation GTMHTTPFetchHistory - -@synthesize cookieStorage = cookieStorage_; - -@dynamic shouldRememberETags; -@dynamic shouldCacheETaggedData; -@dynamic memoryCapacity; - -- (id)init { - return [self initWithMemoryCapacity:kGTMDefaultETaggedDataCacheMemoryCapacity - shouldCacheETaggedData:NO]; -} - -- (id)initWithMemoryCapacity:(NSUInteger)totalBytes - shouldCacheETaggedData:(BOOL)shouldCacheETaggedData { - self = [super init]; - if (self != nil) { - etaggedDataCache_ = [[GTMURLCache alloc] initWithMemoryCapacity:totalBytes]; - shouldRememberETags_ = shouldCacheETaggedData; - shouldCacheETaggedData_ = shouldCacheETaggedData; - cookieStorage_ = [[GTMCookieStorage alloc] init]; - } - return self; -} - -- (void)dealloc { - [etaggedDataCache_ release]; - [cookieStorage_ release]; - [super dealloc]; -} - -- (void)updateRequest:(NSMutableURLRequest *)request isHTTPGet:(BOOL)isHTTPGet { - @synchronized(self) { - if ([self shouldRememberETags]) { - // If this URL is in the history, and no ETag has been set, then - // set the ETag header field - - // If we have a history, we're tracking across fetches, so we don't - // want to pull results from any other cache - [request setCachePolicy:NSURLRequestReloadIgnoringCacheData]; - - if (isHTTPGet) { - // We'll only add an ETag if there's no ETag specified in the user's - // request - NSString *specifiedETag = [request valueForHTTPHeaderField:kGTMIfNoneMatchHeader]; - if (specifiedETag == nil) { - // No ETag: extract the previous ETag for this request from the - // fetch history, and add it to the request - NSString *cachedETag = [self cachedETagForRequest:request]; - - if (cachedETag != nil) { - [request addValue:cachedETag forHTTPHeaderField:kGTMIfNoneMatchHeader]; - } - } else { - // Has an ETag: remove any stored response in the fetch history - // for this request, as the If-None-Match header could lead to - // a 304 Not Modified, and we want that error delivered to the - // user since they explicitly specified the ETag - [self removeCachedDataForRequest:request]; - } - } - } - } -} - -- (void)updateFetchHistoryWithRequest:(NSURLRequest *)request - response:(NSURLResponse *)response - downloadedData:(NSData *)downloadedData { - @synchronized(self) { - if (![self shouldRememberETags]) return; - - if (![response respondsToSelector:@selector(allHeaderFields)]) return; - - NSInteger statusCode = [(NSHTTPURLResponse *)response statusCode]; - - if (statusCode != kGTMHTTPFetcherStatusNotModified) { - // Save this ETag string for successful results (<300) - // If there's no last modified string, clear the dictionary - // entry for this URL. Also cache or delete the data, if appropriate - // (when etaggedDataCache is non-nil.) - NSDictionary *headers = [(NSHTTPURLResponse *)response allHeaderFields]; - NSString* etag = [headers objectForKey:kGTMETagHeader]; - - if (etag != nil && statusCode < 300) { - - // we want to cache responses for the headers, even if the client - // doesn't want the response body data caches - NSData *dataToStore = shouldCacheETaggedData_ ? downloadedData : nil; - - GTMCachedURLResponse *cachedResponse; - cachedResponse = [[[GTMCachedURLResponse alloc] initWithResponse:response - data:dataToStore] autorelease]; - [etaggedDataCache_ storeCachedResponse:cachedResponse - forRequest:request]; - } else { - [etaggedDataCache_ removeCachedResponseForRequest:request]; - } - } - } -} - -- (NSString *)cachedETagForRequest:(NSURLRequest *)request { - // Internal routine. - GTMCachedURLResponse *cachedResponse; - cachedResponse = [etaggedDataCache_ cachedResponseForRequest:request]; - - NSURLResponse *response = [cachedResponse response]; - NSDictionary *headers = [(NSHTTPURLResponse *)response allHeaderFields]; - NSString *cachedETag = [headers objectForKey:kGTMETagHeader]; - if (cachedETag) { - // Since the request having an ETag implies this request is about - // to be fetched again, reserve the cached response to ensure that - // that it will be around at least until the fetch completes. - // - // When the fetch completes, either the cached response will be replaced - // with a new response, or the cachedDataForRequest: method below will - // clear the reservation. - [cachedResponse setReservationDate:[NSDate date]]; - } - return cachedETag; -} - -- (NSData *)cachedDataForRequest:(NSURLRequest *)request { - @synchronized(self) { - GTMCachedURLResponse *cachedResponse; - cachedResponse = [etaggedDataCache_ cachedResponseForRequest:request]; - - NSData *cachedData = [cachedResponse data]; - - // Since the data for this cached request is being obtained from the cache, - // we can clear the reservation as the fetch has completed. - [cachedResponse setReservationDate:nil]; - - return cachedData; - } -} - -- (void)removeCachedDataForRequest:(NSURLRequest *)request { - @synchronized(self) { - [etaggedDataCache_ removeCachedResponseForRequest:request]; - } -} - -- (void)clearETaggedDataCache { - @synchronized(self) { - [etaggedDataCache_ removeAllCachedResponses]; - } -} - -- (void)clearHistory { - @synchronized(self) { - [self clearETaggedDataCache]; - [cookieStorage_ removeAllCookies]; - } -} - -- (void)removeAllCookies { - @synchronized(self) { - [cookieStorage_ removeAllCookies]; - } -} - -- (BOOL)shouldRememberETags { - return shouldRememberETags_; -} - -- (void)setShouldRememberETags:(BOOL)flag { - BOOL wasRemembering = shouldRememberETags_; - shouldRememberETags_ = flag; - - if (wasRemembering && !flag) { - // Free up the cache memory - [self clearETaggedDataCache]; - } -} - -- (BOOL)shouldCacheETaggedData { - return shouldCacheETaggedData_; -} - -- (void)setShouldCacheETaggedData:(BOOL)flag { - BOOL wasCaching = shouldCacheETaggedData_; - shouldCacheETaggedData_ = flag; - - if (flag) { - self.shouldRememberETags = YES; - } - - if (wasCaching && !flag) { - // users expect turning off caching to free up the cache memory - [self clearETaggedDataCache]; - } -} - -- (NSUInteger)memoryCapacity { - return [etaggedDataCache_ memoryCapacity]; -} - -- (void)setMemoryCapacity:(NSUInteger)totalBytes { - [etaggedDataCache_ setMemoryCapacity:totalBytes]; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetcher.h b/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetcher.h deleted file mode 100644 index a681390b..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetcher.h +++ /dev/null @@ -1,765 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTMHTTPFetcher.h -// - -// This is essentially a wrapper around NSURLConnection for POSTs and GETs. -// If setPostData: is called, then POST is assumed. -// -// When would you use this instead of NSURLConnection? -// -// - When you just want the result from a GET, POST, or PUT -// - When you want the "standard" behavior for connections (redirection handling -// an so on) -// - When you want automatic retry on failures -// - When you want to avoid cookie collisions with Safari and other applications -// - When you are fetching resources with ETags and want to avoid the overhead -// of repeated fetches of unchanged data -// - When you need to set a credential for the http operation -// -// This is assumed to be a one-shot fetch request; don't reuse the object -// for a second fetch. -// -// The fetcher may be created auto-released, in which case it will release -// itself after the fetch completion callback. The fetcher is implicitly -// retained as long as a connection is pending. -// -// But if you may need to cancel the fetcher, retain it and have the delegate -// release the fetcher in the callbacks. -// -// Sample usage: -// -// NSURLRequest *request = [NSURLRequest requestWithURL:myURL]; -// GTMHTTPFetcher* myFetcher = [GTMHTTPFetcher fetcherWithRequest:request]; -// -// // optional upload body data -// [myFetcher setPostData:[postString dataUsingEncoding:NSUTF8StringEncoding]]; -// -// [myFetcher beginFetchWithDelegate:self -// didFinishSelector:@selector(myFetcher:finishedWithData:error:)]; -// -// Upon fetch completion, the callback selector is invoked; it should have -// this signature (you can use any callback method name you want so long as -// the signature matches this): -// -// - (void)myFetcher:(GTMHTTPFetcher *)fetcher finishedWithData:(NSData *)retrievedData error:(NSError *)error; -// -// The block callback version looks like: -// -// [myFetcher beginFetchWithCompletionHandler:^(NSData *retrievedData, NSError *error) { -// if (error != nil) { -// // status code or network error -// } else { -// // succeeded -// } -// }]; - -// -// NOTE: Fetches may retrieve data from the server even though the server -// returned an error. The failure selector is called when the server -// status is >= 300, with an NSError having domain -// kGTMHTTPFetcherStatusDomain and code set to the server status. -// -// Status codes are at -// -// -// Threading and queue support: -// -// Callbacks require either that the thread used to start the fetcher have a run -// loop spinning (typically the main thread), or that an NSOperationQueue be -// provided upon which the delegate callbacks will be called. Starting with -// iOS 6 and Mac OS X 10.7, clients may simply create an operation queue for -// callbacks on a background thread: -// -// NSOperationQueue *queue = [[[NSOperationQueue alloc] init] autorelease]; -// [queue setMaxConcurrentOperationCount:1]; -// fetcher.delegateQueue = queue; -// -// or specify the main queue for callbacks on the main thread: -// -// fetcher.delegateQueue = [NSOperationQueue mainQueue]; -// -// The client may also re-dispatch from the callbacks and notifications to -// a known dispatch queue: -// -// [myFetcher beginFetchWithCompletionHandler:^(NSData *retrievedData, NSError *error) { -// if (error == nil) { -// dispatch_async(myDispatchQueue, ^{ -// ... -// }); -// } -// }]; -// -// -// -// Downloading to disk: -// -// To have downloaded data saved directly to disk, specify either a path for the -// downloadPath property, or a file handle for the downloadFileHandle property. -// When downloading to disk, callbacks will be passed a nil for the NSData* -// arguments. -// -// -// HTTP methods and headers: -// -// Alternative HTTP methods, like PUT, and custom headers can be specified by -// creating the fetcher with an appropriate NSMutableURLRequest -// -// -// Proxies: -// -// Proxy handling is invisible so long as the system has a valid credential in -// the keychain, which is normally true (else most NSURL-based apps would have -// difficulty.) But when there is a proxy authetication error, the the fetcher -// will call the failedWithError: method with the NSURLChallenge in the error's -// userInfo. The error method can get the challenge info like this: -// -// NSURLAuthenticationChallenge *challenge -// = [[error userInfo] objectForKey:kGTMHTTPFetcherErrorChallengeKey]; -// BOOL isProxyChallenge = [[challenge protectionSpace] isProxy]; -// -// If a proxy error occurs, you can ask the user for the proxy username/password -// and call fetcher's setProxyCredential: to provide those for the -// next attempt to fetch. -// -// -// Cookies: -// -// There are three supported mechanisms for remembering cookies between fetches. -// -// By default, GTMHTTPFetcher uses a mutable array held statically to track -// cookies for all instantiated fetchers. This avoids server cookies being set -// by servers for the application from interfering with Safari cookie settings, -// and vice versa. The fetcher cookies are lost when the application quits. -// -// To rely instead on WebKit's global NSHTTPCookieStorage, call -// setCookieStorageMethod: with kGTMHTTPFetcherCookieStorageMethodSystemDefault. -// -// If the fetcher is created from a GTMHTTPFetcherService object -// then the cookie storage mechanism is set to use the cookie storage in the -// service object rather than the static storage. -// -// -// Fetching for periodic checks: -// -// The fetcher object tracks ETag headers from responses and -// provide an "If-None-Match" header. This allows the server to save -// bandwidth by providing a status message instead of repeated response -// data. -// -// To get this behavior, create the fetcher from an GTMHTTPFetcherService object -// and look for a fetch callback error with code 304 -// (kGTMHTTPFetcherStatusNotModified) like this: -// -// - (void)myFetcher:(GTMHTTPFetcher *)fetcher finishedWithData:(NSData *)data error:(NSError *)error { -// if ([error code] == kGTMHTTPFetcherStatusNotModified) { -// // |data| is empty; use the data from the previous finishedWithData: for this URL -// } else { -// // handle other server status code -// } -// } -// -// -// Monitoring received data -// -// The optional received data selector can be set with setReceivedDataSelector: -// and should have the signature -// -// - (void)myFetcher:(GTMHTTPFetcher *)fetcher receivedData:(NSData *)dataReceivedSoFar; -// -// The number bytes received so far is available as [fetcher downloadedLength]. -// This number may go down if a redirect causes the download to begin again from -// a new server. -// -// If supplied by the server, the anticipated total download size is available -// as [[myFetcher response] expectedContentLength] (and may be -1 for unknown -// download sizes.) -// -// -// Automatic retrying of fetches -// -// The fetcher can optionally create a timer and reattempt certain kinds of -// fetch failures (status codes 408, request timeout; 503, service unavailable; -// 504, gateway timeout; networking errors NSURLErrorTimedOut and -// NSURLErrorNetworkConnectionLost.) The user may set a retry selector to -// customize the type of errors which will be retried. -// -// Retries are done in an exponential-backoff fashion (that is, after 1 second, -// 2, 4, 8, and so on.) -// -// Enabling automatic retries looks like this: -// [myFetcher setRetryEnabled:YES]; -// -// With retries enabled, the success or failure callbacks are called only -// when no more retries will be attempted. Calling the fetcher's stopFetching -// method will terminate the retry timer, without the finished or failure -// selectors being invoked. -// -// Optionally, the client may set the maximum retry interval: -// [myFetcher setMaxRetryInterval:60.0]; // in seconds; default is 60 seconds -// // for downloads, 600 for uploads -// -// Also optionally, the client may provide a callback selector to determine -// if a status code or other error should be retried. -// [myFetcher setRetrySelector:@selector(myFetcher:willRetry:forError:)]; -// -// If set, the retry selector should have the signature: -// -(BOOL)fetcher:(GTMHTTPFetcher *)fetcher willRetry:(BOOL)suggestedWillRetry forError:(NSError *)error -// and return YES to set the retry timer or NO to fail without additional -// fetch attempts. -// -// The retry method may return the |suggestedWillRetry| argument to get the -// default retry behavior. Server status codes are present in the -// error argument, and have the domain kGTMHTTPFetcherStatusDomain. The -// user's method may look something like this: -// -// -(BOOL)myFetcher:(GTMHTTPFetcher *)fetcher willRetry:(BOOL)suggestedWillRetry forError:(NSError *)error { -// -// // perhaps examine [error domain] and [error code], or [fetcher retryCount] -// // -// // return YES to start the retry timer, NO to proceed to the failure -// // callback, or |suggestedWillRetry| to get default behavior for the -// // current error domain and code values. -// return suggestedWillRetry; -// } - - - -#pragma once - -#import - -#if defined(GTL_TARGET_NAMESPACE) - // we're using target namespace macros - #import "GTLDefines.h" -#elif defined(GDATA_TARGET_NAMESPACE) - #import "GDataDefines.h" -#else - #if TARGET_OS_IPHONE - #ifndef GTM_FOUNDATION_ONLY - #define GTM_FOUNDATION_ONLY 1 - #endif - #ifndef GTM_IPHONE - #define GTM_IPHONE 1 - #endif - #endif -#endif - -#if TARGET_OS_IPHONE && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 40000) - #define GTM_BACKGROUND_FETCHING 1 -#endif - -#undef _EXTERN -#undef _INITIALIZE_AS -#ifdef GTMHTTPFETCHER_DEFINE_GLOBALS - #define _EXTERN - #define _INITIALIZE_AS(x) =x -#else - #if defined(__cplusplus) - #define _EXTERN extern "C" - #else - #define _EXTERN extern - #endif - #define _INITIALIZE_AS(x) -#endif - -// notifications -// -// fetch started and stopped, and fetch retry delay started and stopped -_EXTERN NSString* const kGTMHTTPFetcherStartedNotification _INITIALIZE_AS(@"kGTMHTTPFetcherStartedNotification"); -_EXTERN NSString* const kGTMHTTPFetcherStoppedNotification _INITIALIZE_AS(@"kGTMHTTPFetcherStoppedNotification"); -_EXTERN NSString* const kGTMHTTPFetcherRetryDelayStartedNotification _INITIALIZE_AS(@"kGTMHTTPFetcherRetryDelayStartedNotification"); -_EXTERN NSString* const kGTMHTTPFetcherRetryDelayStoppedNotification _INITIALIZE_AS(@"kGTMHTTPFetcherRetryDelayStoppedNotification"); - -// callback constants -_EXTERN NSString* const kGTMHTTPFetcherErrorDomain _INITIALIZE_AS(@"com.google.GTMHTTPFetcher"); -_EXTERN NSString* const kGTMHTTPFetcherStatusDomain _INITIALIZE_AS(@"com.google.HTTPStatus"); -_EXTERN NSString* const kGTMHTTPFetcherErrorChallengeKey _INITIALIZE_AS(@"challenge"); -_EXTERN NSString* const kGTMHTTPFetcherStatusDataKey _INITIALIZE_AS(@"data"); // data returned with a kGTMHTTPFetcherStatusDomain error - -enum { - kGTMHTTPFetcherErrorDownloadFailed = -1, - kGTMHTTPFetcherErrorAuthenticationChallengeFailed = -2, - kGTMHTTPFetcherErrorChunkUploadFailed = -3, - kGTMHTTPFetcherErrorFileHandleException = -4, - kGTMHTTPFetcherErrorBackgroundExpiration = -6, - - // The code kGTMHTTPFetcherErrorAuthorizationFailed (-5) has been removed; - // look for status 401 instead. - - kGTMHTTPFetcherStatusNotModified = 304, - kGTMHTTPFetcherStatusBadRequest = 400, - kGTMHTTPFetcherStatusUnauthorized = 401, - kGTMHTTPFetcherStatusForbidden = 403, - kGTMHTTPFetcherStatusPreconditionFailed = 412 -}; - -// cookie storage methods -enum { - kGTMHTTPFetcherCookieStorageMethodStatic = 0, - kGTMHTTPFetcherCookieStorageMethodFetchHistory = 1, - kGTMHTTPFetcherCookieStorageMethodSystemDefault = 2, - kGTMHTTPFetcherCookieStorageMethodNone = 3 -}; - -#ifdef __cplusplus -extern "C" { -#endif - -void GTMAssertSelectorNilOrImplementedWithArgs(id obj, SEL sel, ...); - -// Utility functions for applications self-identifying to servers via a -// user-agent header - -// Make a proper app name without whitespace from the given string, removing -// whitespace and other characters that may be special parsed marks of -// the full user-agent string. -NSString *GTMCleanedUserAgentString(NSString *str); - -// Make an identifier like "MacOSX/10.7.1" or "iPod_Touch/4.1" -NSString *GTMSystemVersionString(void); - -// Make a generic name and version for the current application, like -// com.example.MyApp/1.2.3 relying on the bundle identifier and the -// CFBundleShortVersionString or CFBundleVersion. If no bundle ID -// is available, the process name preceded by "proc_" is used. -NSString *GTMApplicationIdentifier(NSBundle *bundle); - -#ifdef __cplusplus -} // extern "C" -#endif - -@class GTMHTTPFetcher; - -@protocol GTMCookieStorageProtocol -// This protocol allows us to call into the service without requiring -// GTMCookieStorage sources in this project -// -// The public interface for cookie handling is the GTMCookieStorage class, -// accessible from a fetcher service object's fetchHistory or from the fetcher's -// +staticCookieStorage method. -- (NSArray *)cookiesForURL:(NSURL *)theURL; -- (void)setCookies:(NSArray *)newCookies; -@end - -@protocol GTMHTTPFetchHistoryProtocol -// This protocol allows us to call the fetch history object without requiring -// GTMHTTPFetchHistory sources in this project -- (void)updateRequest:(NSMutableURLRequest *)request isHTTPGet:(BOOL)isHTTPGet; -- (BOOL)shouldCacheETaggedData; -- (NSData *)cachedDataForRequest:(NSURLRequest *)request; -- (id )cookieStorage; -- (void)updateFetchHistoryWithRequest:(NSURLRequest *)request - response:(NSURLResponse *)response - downloadedData:(NSData *)downloadedData; -- (void)removeCachedDataForRequest:(NSURLRequest *)request; -@end - -@protocol GTMHTTPFetcherServiceProtocol -// This protocol allows us to call into the service without requiring -// GTMHTTPFetcherService sources in this project - -@property (retain) NSOperationQueue *delegateQueue; - -- (BOOL)fetcherShouldBeginFetching:(GTMHTTPFetcher *)fetcher; -- (void)fetcherDidStop:(GTMHTTPFetcher *)fetcher; - -- (GTMHTTPFetcher *)fetcherWithRequest:(NSURLRequest *)request; -- (BOOL)isDelayingFetcher:(GTMHTTPFetcher *)fetcher; -@end - -@protocol GTMFetcherAuthorizationProtocol -@required -// This protocol allows us to call the authorizer without requiring its sources -// in this project. -- (void)authorizeRequest:(NSMutableURLRequest *)request - delegate:(id)delegate - didFinishSelector:(SEL)sel; - -- (void)stopAuthorization; - -- (void)stopAuthorizationForRequest:(NSURLRequest *)request; - -- (BOOL)isAuthorizingRequest:(NSURLRequest *)request; - -- (BOOL)isAuthorizedRequest:(NSURLRequest *)request; - -@property (retain, readonly) NSString *userEmail; - -@optional - -// Indicate if authorization may be attempted. Even if this succeeds, -// authorization may fail if the user's permissions have been revoked. -@property (readonly) BOOL canAuthorize; - -// For development only, allow authorization of non-SSL requests, allowing -// transmission of the bearer token unencrypted. -@property (assign) BOOL shouldAuthorizeAllRequests; - -#if NS_BLOCKS_AVAILABLE -- (void)authorizeRequest:(NSMutableURLRequest *)request - completionHandler:(void (^)(NSError *error))handler; -#endif - -@property (assign) id fetcherService; // WEAK - -- (BOOL)primeForRefresh; - -@end - -// GTMHTTPFetcher objects are used for async retrieval of an http get or post -// -// See additional comments at the beginning of this file -@interface GTMHTTPFetcher : NSObject { - @protected - NSMutableURLRequest *request_; - NSURLConnection *connection_; - NSMutableData *downloadedData_; - NSString *downloadPath_; - NSString *temporaryDownloadPath_; - NSFileHandle *downloadFileHandle_; - unsigned long long downloadedLength_; - NSURLCredential *credential_; // username & password - NSURLCredential *proxyCredential_; // credential supplied to proxy servers - NSData *postData_; - NSInputStream *postStream_; - NSMutableData *loggedStreamData_; - NSURLResponse *response_; // set in connection:didReceiveResponse: - id delegate_; - SEL finishedSel_; // should by implemented by delegate - SEL sentDataSel_; // optional, set with setSentDataSelector - SEL receivedDataSel_; // optional, set with setReceivedDataSelector -#if NS_BLOCKS_AVAILABLE - void (^completionBlock_)(NSData *, NSError *); - void (^receivedDataBlock_)(NSData *); - void (^sentDataBlock_)(NSInteger, NSInteger, NSInteger); - BOOL (^retryBlock_)(BOOL, NSError *); -#elif !__LP64__ - // placeholders: for 32-bit builds, keep the size of the object's ivar section - // the same with and without blocks - id completionPlaceholder_; - id receivedDataPlaceholder_; - id sentDataPlaceholder_; - id retryPlaceholder_; -#endif - BOOL hasConnectionEnded_; // set if the connection need not be cancelled - BOOL isCancellingChallenge_; // set only when cancelling an auth challenge - BOOL isStopNotificationNeeded_; // set when start notification has been sent - BOOL shouldFetchInBackground_; -#if GTM_BACKGROUND_FETCHING - NSUInteger backgroundTaskIdentifer_; // UIBackgroundTaskIdentifier -#endif - id userData_; // retained, if set by caller - NSMutableDictionary *properties_; // more data retained for caller - NSArray *runLoopModes_; // optional - NSOperationQueue *delegateQueue_; // optional; available iOS 6/10.7 and later - id fetchHistory_; // if supplied by the caller, used for Last-Modified-Since checks and cookies - NSInteger cookieStorageMethod_; // constant from above - id cookieStorage_; - - id authorizer_; - - // the service object that created and monitors this fetcher, if any - id service_; - NSString *serviceHost_; - NSInteger servicePriority_; - NSThread *thread_; - - BOOL isRetryEnabled_; // user wants auto-retry - SEL retrySel_; // optional; set with setRetrySelector - NSTimer *retryTimer_; - NSUInteger retryCount_; - NSTimeInterval maxRetryInterval_; // default 600 seconds - NSTimeInterval minRetryInterval_; // random between 1 and 2 seconds - NSTimeInterval retryFactor_; // default interval multiplier is 2 - NSTimeInterval lastRetryInterval_; - BOOL hasAttemptedAuthRefresh_; - - NSString *comment_; // comment for log - NSString *log_; -#if !STRIP_GTM_FETCH_LOGGING - NSString *logRequestBody_; - NSString *logResponseBody_; - BOOL shouldDeferResponseBodyLogging_; -#endif -} - -// Create a fetcher -// -// fetcherWithRequest will return an autoreleased fetcher, but if -// the connection is successfully created, the connection should retain the -// fetcher for the life of the connection as well. So the caller doesn't have -// to retain the fetcher explicitly unless they want to be able to cancel it. -+ (GTMHTTPFetcher *)fetcherWithRequest:(NSURLRequest *)request; - -// Convenience methods that make a request, like +fetcherWithRequest -+ (GTMHTTPFetcher *)fetcherWithURL:(NSURL *)requestURL; -+ (GTMHTTPFetcher *)fetcherWithURLString:(NSString *)requestURLString; - -// Designated initializer -- (id)initWithRequest:(NSURLRequest *)request; - -// Fetcher request -// -// The underlying request is mutable and may be modified by the caller -@property (retain) NSMutableURLRequest *mutableRequest; - -// Setting the credential is optional; it is used if the connection receives -// an authentication challenge -@property (retain) NSURLCredential *credential; - -// Setting the proxy credential is optional; it is used if the connection -// receives an authentication challenge from a proxy -@property (retain) NSURLCredential *proxyCredential; - -// If post data or stream is not set, then a GET retrieval method is assumed -@property (retain) NSData *postData; -@property (retain) NSInputStream *postStream; - -// The default cookie storage method is kGTMHTTPFetcherCookieStorageMethodStatic -// without a fetch history set, and kGTMHTTPFetcherCookieStorageMethodFetchHistory -// with a fetch history set -// -// Applications needing control of cookies across a sequence of fetches should -// create fetchers from a GTMHTTPFetcherService object (which encapsulates -// fetch history) for a well-defined cookie store -@property (assign) NSInteger cookieStorageMethod; - -+ (id )staticCookieStorage; - -// Object to add authorization to the request, if needed -@property (retain) id authorizer; - -// The service object that created and monitors this fetcher, if any -@property (retain) id service; - -// The host, if any, used to classify this fetcher in the fetcher service -@property (copy) NSString *serviceHost; - -// The priority, if any, used for starting fetchers in the fetcher service -// -// Lower values are higher priority; the default is 0, and values may -// be negative or positive. This priority affects only the start order of -// fetchers that are being delayed by a fetcher service. -@property (assign) NSInteger servicePriority; - -// The thread used to run this fetcher in the fetcher service when no operation -// queue is provided. -@property (retain) NSThread *thread; - -// The delegate is retained during the connection -@property (retain) id delegate; - -// On iOS 4 and later, the fetch may optionally continue while the app is in the -// background until finished or stopped by OS expiration -// -// The default value is NO -// -// For Mac OS X, background fetches are always supported, and this property -// is ignored -@property (assign) BOOL shouldFetchInBackground; - -// The delegate's optional sentData selector may be used to monitor upload -// progress. It should have a signature like: -// - (void)myFetcher:(GTMHTTPFetcher *)fetcher -// didSendBytes:(NSInteger)bytesSent -// totalBytesSent:(NSInteger)totalBytesSent -// totalBytesExpectedToSend:(NSInteger)totalBytesExpectedToSend; -// -// +doesSupportSentDataCallback indicates if this delegate method is supported -+ (BOOL)doesSupportSentDataCallback; - -@property (assign) SEL sentDataSelector; - -// The delegate's optional receivedData selector may be used to monitor download -// progress. It should have a signature like: -// - (void)myFetcher:(GTMHTTPFetcher *)fetcher -// receivedData:(NSData *)dataReceivedSoFar; -// -// The dataReceived argument will be nil when downloading to a path or to a -// file handle. -// -// Applications should not use this method to accumulate the received data; -// the callback method or block supplied to the beginFetch call will have -// the complete NSData received. -@property (assign) SEL receivedDataSelector; - -#if NS_BLOCKS_AVAILABLE -// The full interface to the block is provided rather than just a typedef for -// its parameter list in order to get more useful code completion in the Xcode -// editor -@property (copy) void (^sentDataBlock)(NSInteger bytesSent, NSInteger totalBytesSent, NSInteger bytesExpectedToSend); - -// The dataReceived argument will be nil when downloading to a path or to -// a file handle -@property (copy) void (^receivedDataBlock)(NSData *dataReceivedSoFar); -#endif - -// retrying; see comments at the top of the file. Calling -// setRetryEnabled(YES) resets the min and max retry intervals. -@property (assign, getter=isRetryEnabled) BOOL retryEnabled; - -// Retry selector or block is optional for retries. -// -// If present, it should have the signature: -// -(BOOL)fetcher:(GTMHTTPFetcher *)fetcher willRetry:(BOOL)suggestedWillRetry forError:(NSError *)error -// and return YES to cause a retry. See comments at the top of this file. -@property (assign) SEL retrySelector; - -#if NS_BLOCKS_AVAILABLE -@property (copy) BOOL (^retryBlock)(BOOL suggestedWillRetry, NSError *error); -#endif - -// Retry intervals must be strictly less than maxRetryInterval, else -// they will be limited to maxRetryInterval and no further retries will -// be attempted. Setting maxRetryInterval to 0.0 will reset it to the -// default value, 600 seconds. - -@property (assign) NSTimeInterval maxRetryInterval; - -// Starting retry interval. Setting minRetryInterval to 0.0 will reset it -// to a random value between 1.0 and 2.0 seconds. Clients should normally not -// call this except for unit testing. -@property (assign) NSTimeInterval minRetryInterval; - -// Multiplier used to increase the interval between retries, typically 2.0. -// Clients should not need to call this. -@property (assign) double retryFactor; - -// Number of retries attempted -@property (readonly) NSUInteger retryCount; - -// interval delay to precede next retry -@property (readonly) NSTimeInterval nextRetryInterval; - -// Begin fetching the request -// -// The delegate can optionally implement the finished selectors or pass NULL -// for it. -// -// Returns YES if the fetch is initiated. The delegate is retained between -// the beginFetch call until after the finish callback. -// -// An error is passed to the callback for server statuses 300 or -// higher, with the status stored as the error object's code. -// -// finishedSEL has a signature like: -// - (void)fetcher:(GTMHTTPFetcher *)fetcher finishedWithData:(NSData *)data error:(NSError *)error; -// -// If the application has specified a downloadPath or downloadFileHandle -// for the fetcher, the data parameter passed to the callback will be nil. - -- (BOOL)beginFetchWithDelegate:(id)delegate - didFinishSelector:(SEL)finishedSEL; - -#if NS_BLOCKS_AVAILABLE -- (BOOL)beginFetchWithCompletionHandler:(void (^)(NSData *data, NSError *error))handler; -#endif - - -// Returns YES if this is in the process of fetching a URL -- (BOOL)isFetching; - -// Cancel the fetch of the request that's currently in progress -- (void)stopFetching; - -// Return the status code from the server response -@property (readonly) NSInteger statusCode; - -// Return the http headers from the response -@property (retain, readonly) NSDictionary *responseHeaders; - -// The response, once it's been received -@property (retain) NSURLResponse *response; - -// Bytes downloaded so far -@property (readonly) unsigned long long downloadedLength; - -// Buffer of currently-downloaded data -@property (readonly, retain) NSData *downloadedData; - -// Path in which to non-atomically create a file for storing the downloaded data -// -// The path must be set before fetching begins. The download file handle -// will be created for the path, and can be used to monitor progress. If a file -// already exists at the path, it will be overwritten. -@property (copy) NSString *downloadPath; - -// If downloadFileHandle is set, data received is immediately appended to -// the file handle rather than being accumulated in the downloadedData property -// -// The file handle supplied must allow writing and support seekToFileOffset:, -// and must be set before fetching begins. Setting a download path will -// override the file handle property. -@property (retain) NSFileHandle *downloadFileHandle; - -// The optional fetchHistory object is used for a sequence of fetchers to -// remember ETags, cache ETagged data, and store cookies. Typically, this -// is set by a GTMFetcherService object when it creates a fetcher. -// -// Side effect: setting fetch history implicitly calls setCookieStorageMethod: -@property (retain) id fetchHistory; - -// userData is retained for the convenience of the caller -@property (retain) id userData; - -// Stored property values are retained for the convenience of the caller -@property (copy) NSMutableDictionary *properties; - -- (void)setProperty:(id)obj forKey:(NSString *)key; // pass nil obj to remove property -- (id)propertyForKey:(NSString *)key; - -- (void)addPropertiesFromDictionary:(NSDictionary *)dict; - -// Comments are useful for logging -@property (copy) NSString *comment; - -- (void)setCommentWithFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2); - -// Log of request and response, if logging is enabled -@property (copy) NSString *log; - -// Callbacks can be invoked on an operation queue rather than via the run loop, -// starting on 10.7 and iOS 6. If a delegate queue is supplied. the run loop -// modes are ignored. -@property (retain) NSOperationQueue *delegateQueue; - -// Using the fetcher while a modal dialog is displayed requires setting the -// run-loop modes to include NSModalPanelRunLoopMode -@property (retain) NSArray *runLoopModes; - -// Users who wish to replace GTMHTTPFetcher's use of NSURLConnection -// can do so globally here. The replacement should be a subclass of -// NSURLConnection. -+ (Class)connectionClass; -+ (void)setConnectionClass:(Class)theClass; - -// Spin the run loop, discarding events, until the fetch has completed -// -// This is only for use in testing or in tools without a user interface. -// -// Synchronous fetches should never be done by shipping apps; they are -// sufficient reason for rejection from the app store. -- (void)waitForCompletionWithTimeout:(NSTimeInterval)timeoutInSeconds; - -#if STRIP_GTM_FETCH_LOGGING -// if logging is stripped, provide a stub for the main method -// for controlling logging -+ (void)setLoggingEnabled:(BOOL)flag; -#endif // STRIP_GTM_FETCH_LOGGING - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetcher.m b/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetcher.m deleted file mode 100644 index 431fe66c..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetcher.m +++ /dev/null @@ -1,1955 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTMHTTPFetcher.m -// - -#define GTMHTTPFETCHER_DEFINE_GLOBALS 1 - -#import "GTMHTTPFetcher.h" - -#if GTM_BACKGROUND_FETCHING -#import -#endif - -static id gGTMFetcherStaticCookieStorage = nil; -static Class gGTMFetcherConnectionClass = nil; - -// The default max retry interview is 10 minutes for uploads (POST/PUT/PATCH), -// 1 minute for downloads. -static const NSTimeInterval kUnsetMaxRetryInterval = -1; -static const NSTimeInterval kDefaultMaxDownloadRetryInterval = 60.0; -static const NSTimeInterval kDefaultMaxUploadRetryInterval = 60.0 * 10.; - -// delegateQueue callback parameters -static NSString *const kCallbackData = @"data"; -static NSString *const kCallbackError = @"error"; - -// -// GTMHTTPFetcher -// - -@interface GTMHTTPFetcher () - -@property (copy) NSString *temporaryDownloadPath; -@property (retain) id cookieStorage; -@property (readwrite, retain) NSData *downloadedData; -#if NS_BLOCKS_AVAILABLE -@property (copy) void (^completionBlock)(NSData *, NSError *); -#endif - -- (BOOL)beginFetchMayDelay:(BOOL)mayDelay - mayAuthorize:(BOOL)mayAuthorize; -- (void)failToBeginFetchWithError:(NSError *)error; -- (void)failToBeginFetchDeferWithError:(NSError *)error; - -#if GTM_BACKGROUND_FETCHING -- (void)endBackgroundTask; -- (void)backgroundFetchExpired; -#endif - -- (BOOL)authorizeRequest; -- (void)authorizer:(id )auth - request:(NSMutableURLRequest *)request - finishedWithError:(NSError *)error; - -- (NSString *)createTempDownloadFilePathForPath:(NSString *)targetPath; -- (void)stopFetchReleasingCallbacks:(BOOL)shouldReleaseCallbacks; -- (BOOL)shouldReleaseCallbacksUponCompletion; - -- (void)addCookiesToRequest:(NSMutableURLRequest *)request; -- (void)handleCookiesForResponse:(NSURLResponse *)response; - -- (void)invokeFetchCallbacksWithData:(NSData *)data - error:(NSError *)error; -- (void)invokeFetchCallback:(SEL)sel - target:(id)target - data:(NSData *)data - error:(NSError *)error; -- (void)invokeFetchCallbacksOnDelegateQueueWithData:(NSData *)data - error:(NSError *)error; -- (void)releaseCallbacks; - -- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error; - -- (BOOL)shouldRetryNowForStatus:(NSInteger)status error:(NSError *)error; -- (void)destroyRetryTimer; -- (void)beginRetryTimer; -- (void)primeRetryTimerWithNewTimeInterval:(NSTimeInterval)secs; -- (void)sendStopNotificationIfNeeded; -- (void)retryFetch; -- (void)retryTimerFired:(NSTimer *)timer; -@end - -@interface GTMHTTPFetcher (GTMHTTPFetcherLoggingInternal) -- (void)setupStreamLogging; -- (void)logFetchWithError:(NSError *)error; -@end - -@implementation GTMHTTPFetcher - -+ (GTMHTTPFetcher *)fetcherWithRequest:(NSURLRequest *)request { - return [[[[self class] alloc] initWithRequest:request] autorelease]; -} - -+ (GTMHTTPFetcher *)fetcherWithURL:(NSURL *)requestURL { - return [self fetcherWithRequest:[NSURLRequest requestWithURL:requestURL]]; -} - -+ (GTMHTTPFetcher *)fetcherWithURLString:(NSString *)requestURLString { - return [self fetcherWithURL:[NSURL URLWithString:requestURLString]]; -} - -+ (void)initialize { - // initialize is guaranteed by the runtime to be called in a - // thread-safe manner - if (!gGTMFetcherStaticCookieStorage) { - Class cookieStorageClass = NSClassFromString(@"GTMCookieStorage"); - if (cookieStorageClass) { - gGTMFetcherStaticCookieStorage = [[cookieStorageClass alloc] init]; - } - } -} - -- (id)init { - return [self initWithRequest:nil]; -} - -- (id)initWithRequest:(NSURLRequest *)request { - self = [super init]; - if (self) { - request_ = [request mutableCopy]; - - if (gGTMFetcherStaticCookieStorage != nil) { - // The user has compiled with the cookie storage class available; - // default to static cookie storage, so our cookies are independent - // of the cookies of other apps. - [self setCookieStorageMethod:kGTMHTTPFetcherCookieStorageMethodStatic]; - } else { - // Default to system default cookie storage - [self setCookieStorageMethod:kGTMHTTPFetcherCookieStorageMethodSystemDefault]; - } -#if !STRIP_GTM_FETCH_LOGGING - // Encourage developers to set the comment property or use - // setCommentWithFormat: by providing a default string. - comment_ = @"(No fetcher comment set)"; -#endif - } - return self; -} - -- (id)copyWithZone:(NSZone *)zone { - // disallow use of fetchers in a copy property - [self doesNotRecognizeSelector:_cmd]; - return nil; -} - -- (NSString *)description { - return [NSString stringWithFormat:@"%@ %p (%@)", - [self class], self, [self.mutableRequest URL]]; -} - -#if !GTM_IPHONE -- (void)finalize { - [self stopFetchReleasingCallbacks:YES]; // releases connection_, destroys timers - [super finalize]; -} -#endif - -- (void)dealloc { -#if DEBUG - NSAssert(!isStopNotificationNeeded_, - @"unbalanced fetcher notification for %@", [request_ URL]); -#endif - - // Note: if a connection or a retry timer was pending, then this instance - // would be retained by those so it wouldn't be getting dealloc'd, - // hence we don't need to stopFetch here - [request_ release]; - [connection_ release]; - [downloadedData_ release]; - [downloadPath_ release]; - [temporaryDownloadPath_ release]; - [downloadFileHandle_ release]; - [credential_ release]; - [proxyCredential_ release]; - [postData_ release]; - [postStream_ release]; - [loggedStreamData_ release]; - [response_ release]; -#if NS_BLOCKS_AVAILABLE - [completionBlock_ release]; - [receivedDataBlock_ release]; - [sentDataBlock_ release]; - [retryBlock_ release]; -#endif - [userData_ release]; - [properties_ release]; - [delegateQueue_ release]; - [runLoopModes_ release]; - [fetchHistory_ release]; - [cookieStorage_ release]; - [authorizer_ release]; - [service_ release]; - [serviceHost_ release]; - [thread_ release]; - [retryTimer_ release]; - [comment_ release]; - [log_ release]; -#if !STRIP_GTM_FETCH_LOGGING - [logRequestBody_ release]; - [logResponseBody_ release]; -#endif - - [super dealloc]; -} - -#pragma mark - - -// Begin fetching the URL (or begin a retry fetch). The delegate is retained -// for the duration of the fetch connection. - -- (BOOL)beginFetchWithDelegate:(id)delegate - didFinishSelector:(SEL)finishedSelector { - GTMAssertSelectorNilOrImplementedWithArgs(delegate, finishedSelector, @encode(GTMHTTPFetcher *), @encode(NSData *), @encode(NSError *), 0); - GTMAssertSelectorNilOrImplementedWithArgs(delegate, receivedDataSel_, @encode(GTMHTTPFetcher *), @encode(NSData *), 0); - GTMAssertSelectorNilOrImplementedWithArgs(delegate, retrySel_, @encode(GTMHTTPFetcher *), @encode(BOOL), @encode(NSError *), 0); - - // We'll retain the delegate only during the outstanding connection (similar - // to what Cocoa does with performSelectorOnMainThread:) and during - // authorization or delays, since the app would crash - // if the delegate was released before the fetch calls back - [self setDelegate:delegate]; - finishedSel_ = finishedSelector; - - return [self beginFetchMayDelay:YES - mayAuthorize:YES]; -} - -- (BOOL)beginFetchMayDelay:(BOOL)mayDelay - mayAuthorize:(BOOL)mayAuthorize { - // This is the internal entry point for re-starting fetches - NSError *error = nil; - - if (connection_ != nil) { - NSAssert1(connection_ != nil, @"fetch object %@ being reused; this should never happen", self); - goto CannotBeginFetch; - } - - if (request_ == nil || [request_ URL] == nil) { - NSAssert(request_ != nil, @"beginFetchWithDelegate requires a request with a URL"); - goto CannotBeginFetch; - } - - self.downloadedData = nil; - downloadedLength_ = 0; - - if (mayDelay && service_) { - BOOL shouldFetchNow = [service_ fetcherShouldBeginFetching:self]; - if (!shouldFetchNow) { - // the fetch is deferred, but will happen later - return YES; - } - } - - NSString *effectiveHTTPMethod = [request_ valueForHTTPHeaderField:@"X-HTTP-Method-Override"]; - if (effectiveHTTPMethod == nil) { - effectiveHTTPMethod = [request_ HTTPMethod]; - } - BOOL isEffectiveHTTPGet = (effectiveHTTPMethod == nil - || [effectiveHTTPMethod isEqual:@"GET"]); - - if (postData_ || postStream_) { - if (isEffectiveHTTPGet) { - [request_ setHTTPMethod:@"POST"]; - isEffectiveHTTPGet = NO; - } - - if (postData_) { - [request_ setHTTPBody:postData_]; - } else { - if ([self respondsToSelector:@selector(setupStreamLogging)]) { - [self performSelector:@selector(setupStreamLogging)]; - } - - [request_ setHTTPBodyStream:postStream_]; - } - } - - // We authorize after setting up the http method and body in the request - // because OAuth 1 may need to sign the request body - if (mayAuthorize && authorizer_) { - BOOL isAuthorized = [authorizer_ isAuthorizedRequest:request_]; - if (!isAuthorized) { - // authorization needed - return [self authorizeRequest]; - } - } - - [fetchHistory_ updateRequest:request_ isHTTPGet:isEffectiveHTTPGet]; - - // set the default upload or download retry interval, if necessary - if (isRetryEnabled_ - && maxRetryInterval_ <= kUnsetMaxRetryInterval) { - if (isEffectiveHTTPGet || [effectiveHTTPMethod isEqual:@"HEAD"]) { - [self setMaxRetryInterval:kDefaultMaxDownloadRetryInterval]; - } else { - [self setMaxRetryInterval:kDefaultMaxUploadRetryInterval]; - } - } - - [self addCookiesToRequest:request_]; - - if (downloadPath_ != nil) { - // downloading to a path, so create a temporary file and a file handle for - // downloading - NSString *tempPath = [self createTempDownloadFilePathForPath:downloadPath_]; - - BOOL didCreate = [[NSData data] writeToFile:tempPath - options:0 - error:&error]; - if (!didCreate) goto CannotBeginFetch; - - [self setTemporaryDownloadPath:tempPath]; - - NSFileHandle *fh = [NSFileHandle fileHandleForWritingAtPath:tempPath]; - if (fh == nil) goto CannotBeginFetch; - - [self setDownloadFileHandle:fh]; - } - - // finally, start the connection - - Class connectionClass = [[self class] connectionClass]; - - NSOperationQueue *delegateQueue = delegateQueue_; - if (delegateQueue && - ![connectionClass instancesRespondToSelector:@selector(setDelegateQueue:)]) { - // NSURLConnection has no setDelegateQueue: on iOS 4 and Mac OS X 10.5. - delegateQueue = nil; - self.delegateQueue = nil; - } - -#if DEBUG && TARGET_OS_IPHONE - BOOL isPreIOS6 = (NSFoundationVersionNumber <= 890.1); - if (isPreIOS6 && delegateQueue) { - NSLog(@"GTMHTTPFetcher delegateQueue not safe in iOS 5"); - } -#endif - - if (downloadFileHandle_ != nil) { - // Downloading to a file, so downloadedData_ remains nil. - } else { - self.downloadedData = [NSMutableData data]; - } - - hasConnectionEnded_ = NO; - if ([runLoopModes_ count] == 0 && delegateQueue == nil) { - // No custom callback modes or queue were specified, so start the connection - // on the current run loop in the current mode - connection_ = [[connectionClass connectionWithRequest:request_ - delegate:self] retain]; - } else { - // Specify callbacks be on an operation queue or on the current run loop - // in the specified modes - connection_ = [[connectionClass alloc] initWithRequest:request_ - delegate:self - startImmediately:NO]; - if (delegateQueue) { - [connection_ performSelector:@selector(setDelegateQueue:) - withObject:delegateQueue]; - } else if (runLoopModes_) { - NSRunLoop *rl = [NSRunLoop currentRunLoop]; - for (NSString *mode in runLoopModes_) { - [connection_ scheduleInRunLoop:rl forMode:mode]; - } - } - [connection_ start]; - } - - if (!connection_) { - NSAssert(connection_ != nil, @"beginFetchWithDelegate could not create a connection"); - self.downloadedData = nil; - goto CannotBeginFetch; - } - -#if GTM_BACKGROUND_FETCHING - backgroundTaskIdentifer_ = 0; // UIBackgroundTaskInvalid is 0 on iOS 4 - if (shouldFetchInBackground_) { - // For iOS 3 compatibility, ensure that UIApp supports backgrounding - UIApplication *app = [UIApplication sharedApplication]; - if ([app respondsToSelector:@selector(beginBackgroundTaskWithExpirationHandler:)]) { - // Tell UIApplication that we want to continue even when the app is in the - // background. - NSThread *thread = delegateQueue_ ? nil : [NSThread currentThread]; - backgroundTaskIdentifer_ = [app beginBackgroundTaskWithExpirationHandler:^{ - // Background task expiration callback - this block is always invoked by - // UIApplication on the main thread. - if (thread) { - // Run the user's callbacks on the thread used to start the - // fetch. - [self performSelector:@selector(backgroundFetchExpired) - onThread:thread - withObject:nil - waitUntilDone:YES]; - } else { - // backgroundFetchExpired invokes callbacks on the provided delegate - // queue. - [self backgroundFetchExpired]; - } - }]; - } - } -#endif - - // Once connection_ is non-nil we can send the start notification - isStopNotificationNeeded_ = YES; - NSNotificationCenter *defaultNC = [NSNotificationCenter defaultCenter]; - [defaultNC postNotificationName:kGTMHTTPFetcherStartedNotification - object:self]; - return YES; - -CannotBeginFetch: - [self failToBeginFetchDeferWithError:error]; - return NO; -} - -- (void)failToBeginFetchDeferWithError:(NSError *)error { - if (delegateQueue_) { - // Deferring will happen by the callback being invoked on the specified - // queue. - [self failToBeginFetchWithError:error]; - } else { - // No delegate queue has been specified, so put the callback - // on an appropriate run loop. - NSArray *modes = (runLoopModes_ ? runLoopModes_ : - [NSArray arrayWithObject:NSRunLoopCommonModes]); - [self performSelector:@selector(failToBeginFetchWithError:) - onThread:[NSThread currentThread] - withObject:error - waitUntilDone:NO - modes:modes]; - } -} - -- (void)failToBeginFetchWithError:(NSError *)error { - if (error == nil) { - error = [NSError errorWithDomain:kGTMHTTPFetcherErrorDomain - code:kGTMHTTPFetcherErrorDownloadFailed - userInfo:nil]; - } - - [[self retain] autorelease]; // In case the callback releases us - - [self invokeFetchCallbacksOnDelegateQueueWithData:nil - error:error]; - - [self releaseCallbacks]; - - [service_ fetcherDidStop:self]; - - self.authorizer = nil; - - if (temporaryDownloadPath_) { - [[NSFileManager defaultManager] removeItemAtPath:temporaryDownloadPath_ - error:NULL]; - self.temporaryDownloadPath = nil; - } -} - -#if GTM_BACKGROUND_FETCHING -- (void)backgroundFetchExpired { - // On background expiration, we stop the fetch and invoke the callbacks - NSError *error = [NSError errorWithDomain:kGTMHTTPFetcherErrorDomain - code:kGTMHTTPFetcherErrorBackgroundExpiration - userInfo:nil]; - [self invokeFetchCallbacksOnDelegateQueueWithData:nil - error:error]; - @synchronized(self) { - // Stopping the fetch here will indirectly call endBackgroundTask - [self stopFetchReleasingCallbacks:NO]; - - [self releaseCallbacks]; - self.authorizer = nil; - } -} - -- (void)endBackgroundTask { - @synchronized(self) { - // Whenever the connection stops or background execution expires, - // we need to tell UIApplication we're done - if (backgroundTaskIdentifer_) { - // If backgroundTaskIdentifer_ is non-zero, we know we're on iOS 4 - UIApplication *app = [UIApplication sharedApplication]; - [app endBackgroundTask:backgroundTaskIdentifer_]; - - backgroundTaskIdentifer_ = 0; - } - } -} -#endif // GTM_BACKGROUND_FETCHING - -- (BOOL)authorizeRequest { - id authorizer = self.authorizer; - SEL asyncAuthSel = @selector(authorizeRequest:delegate:didFinishSelector:); - if ([authorizer respondsToSelector:asyncAuthSel]) { - SEL callbackSel = @selector(authorizer:request:finishedWithError:); - [authorizer authorizeRequest:request_ - delegate:self - didFinishSelector:callbackSel]; - return YES; - } else { - NSAssert(authorizer == nil, @"invalid authorizer for fetch"); - - // No authorizing possible, and authorizing happens only after any delay; - // just begin fetching - return [self beginFetchMayDelay:NO - mayAuthorize:NO]; - } -} - -- (void)authorizer:(id )auth - request:(NSMutableURLRequest *)request - finishedWithError:(NSError *)error { - if (error != nil) { - // We can't fetch without authorization - [self failToBeginFetchDeferWithError:error]; - } else { - [self beginFetchMayDelay:NO - mayAuthorize:NO]; - } -} - -#if NS_BLOCKS_AVAILABLE -- (BOOL)beginFetchWithCompletionHandler:(void (^)(NSData *data, NSError *error))handler { - self.completionBlock = handler; - - // The user may have called setDelegate: earlier if they want to use other - // delegate-style callbacks during the fetch; otherwise, the delegate is nil, - // which is fine. - return [self beginFetchWithDelegate:[self delegate] - didFinishSelector:nil]; -} -#endif - -- (NSString *)createTempDownloadFilePathForPath:(NSString *)targetPath { - NSString *tempDir = nil; - -#if (!TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)) - // Find an appropriate directory for the download, ideally on the same disk - // as the final target location so the temporary file won't have to be moved - // to a different disk. - // - // Available in SDKs for 10.6 and iOS 4 - // - // Oct 2011: We previously also used URLForDirectory for - // (TARGET_OS_IPHONE && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 40000)) - // but that is returning a non-temporary directory for iOS, unfortunately - - SEL sel = @selector(URLForDirectory:inDomain:appropriateForURL:create:error:); - if ([NSFileManager instancesRespondToSelector:sel]) { - NSError *error = nil; - NSURL *targetURL = [NSURL fileURLWithPath:targetPath]; - NSFileManager *fileMgr = [NSFileManager defaultManager]; - - NSURL *tempDirURL = [fileMgr URLForDirectory:NSItemReplacementDirectory - inDomain:NSUserDomainMask - appropriateForURL:targetURL - create:YES - error:&error]; - tempDir = [tempDirURL path]; - } -#endif - - if (tempDir == nil) { - tempDir = NSTemporaryDirectory(); - } - - static unsigned int counter = 0; - NSString *name = [NSString stringWithFormat:@"gtmhttpfetcher_%u_%u", - ++counter, (unsigned int) arc4random()]; - NSString *result = [tempDir stringByAppendingPathComponent:name]; - return result; -} - -- (void)addCookiesToRequest:(NSMutableURLRequest *)request { - // Get cookies for this URL from our storage array, if - // we have a storage array - if (cookieStorageMethod_ != kGTMHTTPFetcherCookieStorageMethodSystemDefault - && cookieStorageMethod_ != kGTMHTTPFetcherCookieStorageMethodNone) { - - NSArray *cookies = [cookieStorage_ cookiesForURL:[request URL]]; - if ([cookies count] > 0) { - - NSDictionary *headerFields = [NSHTTPCookie requestHeaderFieldsWithCookies:cookies]; - NSString *cookieHeader = [headerFields objectForKey:@"Cookie"]; // key used in header dictionary - if (cookieHeader) { - [request addValue:cookieHeader forHTTPHeaderField:@"Cookie"]; // header name - } - } - } -} - -// Returns YES if this is in the process of fetching a URL, or waiting to -// retry, or waiting for authorization, or waiting to be issued by the -// service object -- (BOOL)isFetching { - if (connection_ != nil || retryTimer_ != nil) return YES; - - BOOL isAuthorizing = [authorizer_ isAuthorizingRequest:request_]; - if (isAuthorizing) return YES; - - BOOL isDelayed = [service_ isDelayingFetcher:self]; - return isDelayed; -} - -// Returns the status code set in connection:didReceiveResponse: -- (NSInteger)statusCode { - - NSInteger statusCode; - - if (response_ != nil - && [response_ respondsToSelector:@selector(statusCode)]) { - - statusCode = [(NSHTTPURLResponse *)response_ statusCode]; - } else { - // Default to zero, in hopes of hinting "Unknown" (we can't be - // sure that things are OK enough to use 200). - statusCode = 0; - } - return statusCode; -} - -- (NSDictionary *)responseHeaders { - if (response_ != nil - && [response_ respondsToSelector:@selector(allHeaderFields)]) { - - NSDictionary *headers = [(NSHTTPURLResponse *)response_ allHeaderFields]; - return headers; - } - return nil; -} - -- (void)releaseCallbacks { - [delegate_ autorelease]; - delegate_ = nil; - - [delegateQueue_ autorelease]; - delegateQueue_ = nil; - -#if NS_BLOCKS_AVAILABLE - self.completionBlock = nil; - self.sentDataBlock = nil; - self.receivedDataBlock = nil; - self.retryBlock = nil; -#endif -} - -// Cancel the fetch of the URL that's currently in progress. -- (void)stopFetchReleasingCallbacks:(BOOL)shouldReleaseCallbacks { - id service; - - // if the connection or the retry timer is all that's retaining the fetcher, - // we want to be sure this instance survives stopping at least long enough for - // the stack to unwind - [[self retain] autorelease]; - - [self destroyRetryTimer]; - - @synchronized(self) { - service = [[service_ retain] autorelease]; - - if (connection_) { - // in case cancelling the connection calls this recursively, we want - // to ensure that we'll only release the connection and delegate once, - // so first set connection_ to nil - NSURLConnection* oldConnection = connection_; - connection_ = nil; - - if (!hasConnectionEnded_) { - [oldConnection cancel]; - } - - // this may be called in a callback from the connection, so use autorelease - [oldConnection autorelease]; - } - } // @synchronized(self) - - // send the stopped notification - [self sendStopNotificationIfNeeded]; - - @synchronized(self) { - [authorizer_ stopAuthorizationForRequest:request_]; - - if (shouldReleaseCallbacks) { - [self releaseCallbacks]; - - self.authorizer = nil; - } - - if (temporaryDownloadPath_) { - [[NSFileManager defaultManager] removeItemAtPath:temporaryDownloadPath_ - error:NULL]; - self.temporaryDownloadPath = nil; - } - } // @synchronized(self) - - [service fetcherDidStop:self]; - -#if GTM_BACKGROUND_FETCHING - [self endBackgroundTask]; -#endif -} - -// External stop method -- (void)stopFetching { - [self stopFetchReleasingCallbacks:YES]; -} - -- (void)sendStopNotificationIfNeeded { - BOOL sendNow = NO; - @synchronized(self) { - if (isStopNotificationNeeded_) { - isStopNotificationNeeded_ = NO; - sendNow = YES; - } - } - - if (sendNow) { - NSNotificationCenter *defaultNC = [NSNotificationCenter defaultCenter]; - [defaultNC postNotificationName:kGTMHTTPFetcherStoppedNotification - object:self]; - } -} - -- (void)retryFetch { - [self stopFetchReleasingCallbacks:NO]; - - [self beginFetchWithDelegate:delegate_ - didFinishSelector:finishedSel_]; -} - -- (void)waitForCompletionWithTimeout:(NSTimeInterval)timeoutInSeconds { - NSDate* giveUpDate = [NSDate dateWithTimeIntervalSinceNow:timeoutInSeconds]; - - // Loop until the callbacks have been called and released, and until - // the connection is no longer pending, or until the timeout has expired - BOOL isMainThread = [NSThread isMainThread]; - - while ((!hasConnectionEnded_ -#if NS_BLOCKS_AVAILABLE - || completionBlock_ != nil -#endif - || delegate_ != nil) - && [giveUpDate timeIntervalSinceNow] > 0) { - - // Run the current run loop 1/1000 of a second to give the networking - // code a chance to work - if (isMainThread || delegateQueue_ == nil) { - NSDate *stopDate = [NSDate dateWithTimeIntervalSinceNow:0.001]; - [[NSRunLoop currentRunLoop] runUntilDate:stopDate]; - } else { - [NSThread sleepForTimeInterval:0.001]; - } - } -} - -#pragma mark NSURLConnection Delegate Methods - -// -// NSURLConnection Delegate Methods -// - -// This method just says "follow all redirects", which _should_ be the default behavior, -// According to file:///Developer/ADC%20Reference%20Library/documentation/Cocoa/Conceptual/URLLoadingSystem -// but the redirects were not being followed until I added this method. May be -// a bug in the NSURLConnection code, or the documentation. -// -// In OS X 10.4.8 and earlier, the redirect request doesn't -// get the original's headers and body. This causes POSTs to fail. -// So we construct a new request, a copy of the original, with overrides from the -// redirect. -// -// Docs say that if redirectResponse is nil, just return the redirectRequest. - -- (NSURLRequest *)connection:(NSURLConnection *)connection - willSendRequest:(NSURLRequest *)redirectRequest - redirectResponse:(NSURLResponse *)redirectResponse { - @synchronized(self) { - if (redirectRequest && redirectResponse) { - // save cookies from the response - [self handleCookiesForResponse:redirectResponse]; - - NSMutableURLRequest *newRequest = [[request_ mutableCopy] autorelease]; - // copy the URL - NSURL *redirectURL = [redirectRequest URL]; - NSURL *url = [newRequest URL]; - - // disallow scheme changes (say, from https to http) - NSString *redirectScheme = [url scheme]; - NSString *newScheme = [redirectURL scheme]; - NSString *newResourceSpecifier = [redirectURL resourceSpecifier]; - - if ([redirectScheme caseInsensitiveCompare:@"http"] == NSOrderedSame - && newScheme != nil - && [newScheme caseInsensitiveCompare:@"https"] == NSOrderedSame) { - - // allow the change from http to https - redirectScheme = newScheme; - } - - NSString *newUrlString = [NSString stringWithFormat:@"%@:%@", - redirectScheme, newResourceSpecifier]; - - NSURL *newURL = [NSURL URLWithString:newUrlString]; - [newRequest setURL:newURL]; - - // any headers in the redirect override headers in the original. - NSDictionary *redirectHeaders = [redirectRequest allHTTPHeaderFields]; - for (NSString *key in redirectHeaders) { - NSString *value = [redirectHeaders objectForKey:key]; - [newRequest setValue:value forHTTPHeaderField:key]; - } - - [self addCookiesToRequest:newRequest]; - - redirectRequest = newRequest; - - // log the response we just received - [self setResponse:redirectResponse]; - [self logNowWithError:nil]; - - // update the request for future logging - NSMutableURLRequest *mutable = [[redirectRequest mutableCopy] autorelease]; - [self setMutableRequest:mutable]; - } - return redirectRequest; - } // @synchronized(self) -} - -- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { - @synchronized(self) { - // This method is called when the server has determined that it - // has enough information to create the NSURLResponse - // it can be called multiple times, for example in the case of a - // redirect, so each time we reset the data. - [downloadedData_ setLength:0]; - [downloadFileHandle_ truncateFileAtOffset:0]; - downloadedLength_ = 0; - - [self setResponse:response]; - - // Save cookies from the response - [self handleCookiesForResponse:response]; - } -} - - -// handleCookiesForResponse: handles storage of cookies for responses passed to -// connection:willSendRequest:redirectResponse: and connection:didReceiveResponse: -- (void)handleCookiesForResponse:(NSURLResponse *)response { - - if (cookieStorageMethod_ == kGTMHTTPFetcherCookieStorageMethodSystemDefault - || cookieStorageMethod_ == kGTMHTTPFetcherCookieStorageMethodNone) { - - // do nothing special for NSURLConnection's default storage mechanism - // or when we're ignoring cookies - - } else if ([response respondsToSelector:@selector(allHeaderFields)]) { - - // grab the cookies from the header as NSHTTPCookies and store them either - // into our static array or into the fetchHistory - - NSDictionary *responseHeaderFields = [(NSHTTPURLResponse *)response allHeaderFields]; - if (responseHeaderFields) { - - NSArray *cookies = [NSHTTPCookie cookiesWithResponseHeaderFields:responseHeaderFields - forURL:[response URL]]; - if ([cookies count] > 0) { - [cookieStorage_ setCookies:cookies]; - } - } - } -} - --(void)connection:(NSURLConnection *)connection -didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { - @synchronized(self) { - if ([challenge previousFailureCount] <= 2) { - - NSURLCredential *credential = credential_; - - if ([[challenge protectionSpace] isProxy] && proxyCredential_ != nil) { - credential = proxyCredential_; - } - - // Here, if credential is still nil, then we *could* try to get it from - // NSURLCredentialStorage's defaultCredentialForProtectionSpace:. - // We don't, because we're assuming: - // - // - for server credentials, we only want ones supplied by the program - // calling http fetcher - // - for proxy credentials, if one were necessary and available in the - // keychain, it would've been found automatically by NSURLConnection - // and this challenge delegate method never would've been called - // anyway - - if (credential) { - // try the credential - [[challenge sender] useCredential:credential - forAuthenticationChallenge:challenge]; - return; - } - } // @synchronized(self) - - // If we don't have credentials, or we've already failed auth 3x, - // report the error, putting the challenge as a value in the userInfo - // dictionary. -#if DEBUG - NSAssert(!isCancellingChallenge_, @"isCancellingChallenge_ unexpected"); -#endif - NSDictionary *userInfo = [NSDictionary dictionaryWithObject:challenge - forKey:kGTMHTTPFetcherErrorChallengeKey]; - NSError *error = [NSError errorWithDomain:kGTMHTTPFetcherErrorDomain - code:kGTMHTTPFetcherErrorAuthenticationChallengeFailed - userInfo:userInfo]; - - // cancelAuthenticationChallenge seems to indirectly call - // connection:didFailWithError: now, though that isn't documented - // - // We'll use an ivar to make the indirect invocation of the - // delegate method do nothing. - isCancellingChallenge_ = YES; - [[challenge sender] cancelAuthenticationChallenge:challenge]; - isCancellingChallenge_ = NO; - - [self connection:connection didFailWithError:error]; - } -} - -- (void)invokeFetchCallbacksWithData:(NSData *)data - error:(NSError *)error { - // To avoid deadlocks, this should not be called inside of @synchronized(self) - id target; - SEL sel; -#if NS_BLOCKS_AVAILABLE - void (^block)(NSData *, NSError *); -#endif - @synchronized(self) { - target = delegate_; - sel = finishedSel_; - block = completionBlock_; - } - - [[self retain] autorelease]; // In case the callback releases us - - [self invokeFetchCallback:sel - target:target - data:data - error:error]; - -#if NS_BLOCKS_AVAILABLE - if (block) { - block(data, error); - } -#endif -} - -- (void)invokeFetchCallback:(SEL)sel - target:(id)target - data:(NSData *)data - error:(NSError *)error { - // This method is available to subclasses which may provide a customized - // target pointer. - if (target && sel) { - NSMethodSignature *sig = [target methodSignatureForSelector:sel]; - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig]; - [invocation setSelector:sel]; - [invocation setTarget:target]; - [invocation setArgument:&self atIndex:2]; - [invocation setArgument:&data atIndex:3]; - [invocation setArgument:&error atIndex:4]; - [invocation invoke]; - } -} - -- (void)invokeFetchCallbacksOnDelegateQueueWithData:(NSData *)data - error:(NSError *)error { - // This is called by methods that are not already on the delegateQueue - // (as NSURLConnection callbacks should already be, but other failures - // are not.) - if (!delegateQueue_) { - [self invokeFetchCallbacksWithData:data error:error]; - } - - // Values may be nil. - NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:2]; - [dict setValue:data forKey:kCallbackData]; - [dict setValue:error forKey:kCallbackError]; - NSInvocationOperation *op = - [[[NSInvocationOperation alloc] initWithTarget:self - selector:@selector(invokeOnQueueWithDictionary:) - object:dict] autorelease]; - [delegateQueue_ addOperation:op]; -} - -- (void)invokeOnQueueWithDictionary:(NSDictionary *)dict { - NSData *data = [dict objectForKey:kCallbackData]; - NSError *error = [dict objectForKey:kCallbackError]; - - [self invokeFetchCallbacksWithData:data error:error]; -} - - -- (void)invokeSentDataCallback:(SEL)sel - target:(id)target - didSendBodyData:(NSInteger)bytesWritten - totalBytesWritten:(NSInteger)totalBytesWritten - totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite { - if (target && sel) { - NSMethodSignature *sig = [target methodSignatureForSelector:sel]; - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig]; - [invocation setSelector:sel]; - [invocation setTarget:target]; - [invocation setArgument:&self atIndex:2]; - [invocation setArgument:&bytesWritten atIndex:3]; - [invocation setArgument:&totalBytesWritten atIndex:4]; - [invocation setArgument:&totalBytesExpectedToWrite atIndex:5]; - [invocation invoke]; - } -} - -- (BOOL)invokeRetryCallback:(SEL)sel - target:(id)target - willRetry:(BOOL)willRetry - error:(NSError *)error { - if (target && sel) { - NSMethodSignature *sig = [target methodSignatureForSelector:sel]; - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig]; - [invocation setSelector:sel]; - [invocation setTarget:target]; - [invocation setArgument:&self atIndex:2]; - [invocation setArgument:&willRetry atIndex:3]; - [invocation setArgument:&error atIndex:4]; - [invocation invoke]; - - [invocation getReturnValue:&willRetry]; - } - return willRetry; -} - -- (void)connection:(NSURLConnection *)connection - didSendBodyData:(NSInteger)bytesWritten - totalBytesWritten:(NSInteger)totalBytesWritten -totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite { - @synchronized(self) { - SEL sel = [self sentDataSelector]; - [self invokeSentDataCallback:sel - target:delegate_ - didSendBodyData:bytesWritten - totalBytesWritten:totalBytesWritten - totalBytesExpectedToWrite:totalBytesExpectedToWrite]; - -#if NS_BLOCKS_AVAILABLE - if (sentDataBlock_) { - sentDataBlock_(bytesWritten, totalBytesWritten, totalBytesExpectedToWrite); - } -#endif - } -} - -- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { - @synchronized(self) { -#if DEBUG - NSAssert(!hasConnectionEnded_, @"Connection received data after ending"); - - // The download file handle should be set or the data object allocated - // before the fetch is started. - NSAssert((downloadFileHandle_ == nil) != (downloadedData_ == nil), - @"received data accumulates as either NSData (%d) or" - @" NSFileHandle (%d)", - (downloadedData_ != nil), (downloadFileHandle_ != nil)); -#endif - // Hopefully, we'll never see this execute out-of-order, receiving data - // after we've received the finished or failed callback. - if (hasConnectionEnded_) return; - - if (downloadFileHandle_ != nil) { - // Append to file - @try { - [downloadFileHandle_ writeData:data]; - - downloadedLength_ = [downloadFileHandle_ offsetInFile]; - } - @catch (NSException *exc) { - // Couldn't write to file, probably due to a full disk - NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[exc reason] - forKey:NSLocalizedDescriptionKey]; - NSError *error = [NSError errorWithDomain:kGTMHTTPFetcherStatusDomain - code:kGTMHTTPFetcherErrorFileHandleException - userInfo:userInfo]; - [self connection:connection didFailWithError:error]; - return; - } - } else { - // append to mutable data - [downloadedData_ appendData:data]; - - downloadedLength_ = [downloadedData_ length]; - } - - if (receivedDataSel_) { - [delegate_ performSelector:receivedDataSel_ - withObject:self - withObject:downloadedData_]; - } - -#if NS_BLOCKS_AVAILABLE - if (receivedDataBlock_) { - receivedDataBlock_(downloadedData_); - } -#endif - } // @synchronized(self) -} - -// For error 304's ("Not Modified") where we've cached the data, return -// status 200 ("OK") to the caller (but leave the fetcher status as 304) -// and copy the cached data. -// -// For other errors or if there's no cached data, just return the actual status. -- (NSData *)cachedDataForStatus { - if ([self statusCode] == kGTMHTTPFetcherStatusNotModified - && [fetchHistory_ shouldCacheETaggedData]) { - NSData *cachedData = [fetchHistory_ cachedDataForRequest:request_]; - return cachedData; - } - return nil; -} - -- (NSInteger)statusAfterHandlingNotModifiedError { - NSInteger status = [self statusCode]; - NSData *cachedData = [self cachedDataForStatus]; - if (cachedData) { - // Forge the status to pass on to the delegate - status = 200; - - // Copy our stored data - if (downloadFileHandle_ != nil) { - @try { - // Downloading to a file handle won't save to the cache (the data is - // likely inappropriately large for caching), but will still read from - // the cache, on the unlikely chance that the response was Not Modified - // and the URL response was indeed present in the cache. - [downloadFileHandle_ truncateFileAtOffset:0]; - [downloadFileHandle_ writeData:cachedData]; - downloadedLength_ = [downloadFileHandle_ offsetInFile]; - } - @catch (NSException *) { - // Failed to write data, likely due to lack of disk space - status = kGTMHTTPFetcherErrorFileHandleException; - } - } else { - [downloadedData_ setData:cachedData]; - downloadedLength_ = [cachedData length]; - } - } - return status; -} - -- (void)connectionDidFinishLoading:(NSURLConnection *)connection { - BOOL shouldStopFetching = YES; - BOOL shouldSendStopNotification = NO; - NSError *error = nil; - NSData *downloadedData; -#if !STRIP_GTM_FETCH_LOGGING - BOOL shouldDeferLogging = NO; -#endif - BOOL shouldBeginRetryTimer = NO; - BOOL hasLogged = NO; - - @synchronized(self) { - // We no longer need to cancel the connection - hasConnectionEnded_ = YES; - - // Skip caching ETagged results when the data is being saved to a file - if (downloadFileHandle_ == nil) { - [fetchHistory_ updateFetchHistoryWithRequest:request_ - response:response_ - downloadedData:downloadedData_]; - } else { - [fetchHistory_ removeCachedDataForRequest:request_]; - } - - [[self retain] autorelease]; // in case the callback releases us - - NSInteger status = [self statusCode]; - if ([self cachedDataForStatus] != nil) { - // Log the pre-cache response. - [self logNowWithError:nil]; - hasLogged = YES; - status = [self statusAfterHandlingNotModifiedError]; - } - - shouldSendStopNotification = YES; - - if (status >= 0 && status < 300) { - // success - if (downloadPath_) { - // Avoid deleting the downloaded file when the fetch stops - [downloadFileHandle_ closeFile]; - self.downloadFileHandle = nil; - - NSFileManager *fileMgr = [NSFileManager defaultManager]; - [fileMgr removeItemAtPath:downloadPath_ - error:NULL]; - - if ([fileMgr moveItemAtPath:temporaryDownloadPath_ - toPath:downloadPath_ - error:&error]) { - self.temporaryDownloadPath = nil; - } - } - } else { - // unsuccessful - if (!hasLogged) { - [self logNowWithError:nil]; - hasLogged = YES; - } - // Status over 300; retry or notify the delegate of failure - if ([self shouldRetryNowForStatus:status error:nil]) { - // retrying - shouldBeginRetryTimer = YES; - shouldStopFetching = NO; - } else { - NSDictionary *userInfo = nil; - if ([downloadedData_ length] > 0) { - userInfo = [NSDictionary dictionaryWithObject:downloadedData_ - forKey:kGTMHTTPFetcherStatusDataKey]; - } - error = [NSError errorWithDomain:kGTMHTTPFetcherStatusDomain - code:status - userInfo:userInfo]; - } - } - downloadedData = downloadedData_; -#if !STRIP_GTM_FETCH_LOGGING - shouldDeferLogging = shouldDeferResponseBodyLogging_; -#endif - } // @synchronized(self) - - if (shouldBeginRetryTimer) { - [self beginRetryTimer]; - } - - if (shouldSendStopNotification) { - // We want to send the stop notification before calling the delegate's - // callback selector, since the callback selector may release all of - // the fetcher properties that the client is using to track the fetches. - // - // We'll also stop now so that, to any observers watching the notifications, - // it doesn't look like our wait for a retry (which may be long, - // 30 seconds or more) is part of the network activity. - [self sendStopNotificationIfNeeded]; - } - - if (shouldStopFetching) { - // Call the callbacks (outside of the @synchronized to avoid deadlocks.) - [self invokeFetchCallbacksWithData:downloadedData - error:error]; - BOOL shouldRelease = [self shouldReleaseCallbacksUponCompletion]; - [self stopFetchReleasingCallbacks:shouldRelease]; - } - - @synchronized(self) { - BOOL shouldLogNow = !hasLogged; -#if !STRIP_GTM_FETCH_LOGGING - if (shouldDeferLogging) shouldLogNow = NO; -#endif - if (shouldLogNow) { - [self logNowWithError:nil]; - } - } -} - -- (BOOL)shouldReleaseCallbacksUponCompletion { - // A subclass can override this to keep callbacks around after the - // connection has finished successfully - return YES; -} - -- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { - @synchronized(self) { - // Prevent the failure callback from being called twice, since the stopFetch - // call below (either the explicit one at the end of this method, or the - // implicit one when the retry occurs) will release the delegate. - if (connection_ == nil) return; - - // If this method was invoked indirectly by cancellation of an authentication - // challenge, defer this until it is called again with the proper error object - if (isCancellingChallenge_) return; - - // We no longer need to cancel the connection - hasConnectionEnded_ = YES; - - [self logNowWithError:error]; - } - - // See comment about sendStopNotificationIfNeeded - // in connectionDidFinishLoading: - [self sendStopNotificationIfNeeded]; - - if ([self shouldRetryNowForStatus:0 error:error]) { - [self beginRetryTimer]; - } else { - [[self retain] autorelease]; // in case the callback releases us - - [self invokeFetchCallbacksWithData:nil - error:error]; - - [self stopFetchReleasingCallbacks:YES]; - } -} - -- (void)logNowWithError:(NSError *)error { - // If the logging category is available, then log the current request, - // response, data, and error - if ([self respondsToSelector:@selector(logFetchWithError:)]) { - [self performSelector:@selector(logFetchWithError:) withObject:error]; - } -} - -#pragma mark Retries - -- (BOOL)isRetryError:(NSError *)error { - - struct retryRecord { - NSString *const domain; - int code; - }; - - struct retryRecord retries[] = { - { kGTMHTTPFetcherStatusDomain, 408 }, // request timeout - { kGTMHTTPFetcherStatusDomain, 503 }, // service unavailable - { kGTMHTTPFetcherStatusDomain, 504 }, // request timeout - { NSURLErrorDomain, NSURLErrorTimedOut }, - { NSURLErrorDomain, NSURLErrorNetworkConnectionLost }, - { nil, 0 } - }; - - // NSError's isEqual always returns false for equal but distinct instances - // of NSError, so we have to compare the domain and code values explicitly - - for (int idx = 0; retries[idx].domain != nil; idx++) { - - if ([[error domain] isEqual:retries[idx].domain] - && [error code] == retries[idx].code) { - - return YES; - } - } - return NO; -} - - -// shouldRetryNowForStatus:error: returns YES if the user has enabled retries -// and the status or error is one that is suitable for retrying. "Suitable" -// means either the isRetryError:'s list contains the status or error, or the -// user's retrySelector: is present and returns YES when called, or the -// authorizer may be able to fix. -- (BOOL)shouldRetryNowForStatus:(NSInteger)status - error:(NSError *)error { - // Determine if a refreshed authorizer may avoid an authorization error - BOOL shouldRetryForAuthRefresh = NO; - BOOL isFirstAuthError = (authorizer_ != nil) - && !hasAttemptedAuthRefresh_ - && (status == kGTMHTTPFetcherStatusUnauthorized); // 401 - - if (isFirstAuthError) { - if ([authorizer_ respondsToSelector:@selector(primeForRefresh)]) { - BOOL hasPrimed = [authorizer_ primeForRefresh]; - if (hasPrimed) { - shouldRetryForAuthRefresh = YES; - hasAttemptedAuthRefresh_ = YES; - [request_ setValue:nil forHTTPHeaderField:@"Authorization"]; - } - } - } - - // Determine if we're doing exponential backoff retries - BOOL shouldDoIntervalRetry = [self isRetryEnabled] - && ([self nextRetryInterval] < [self maxRetryInterval]); - - BOOL willRetry = NO; - BOOL canRetry = shouldRetryForAuthRefresh || shouldDoIntervalRetry; - if (canRetry) { - // Check if this is a retryable error - if (error == nil) { - // Make an error for the status - NSDictionary *userInfo = nil; - if ([downloadedData_ length] > 0) { - userInfo = [NSDictionary dictionaryWithObject:downloadedData_ - forKey:kGTMHTTPFetcherStatusDataKey]; - } - error = [NSError errorWithDomain:kGTMHTTPFetcherStatusDomain - code:status - userInfo:userInfo]; - } - - willRetry = shouldRetryForAuthRefresh || [self isRetryError:error]; - - // If the user has installed a retry callback, consult that - willRetry = [self invokeRetryCallback:retrySel_ - target:delegate_ - willRetry:willRetry - error:error]; -#if NS_BLOCKS_AVAILABLE - if (retryBlock_) { - willRetry = retryBlock_(willRetry, error); - } -#endif - } - return willRetry; -} - -- (void)beginRetryTimer { - @synchronized(self) { - if (delegateQueue_ != nil && ![NSThread isMainThread]) { - // A delegate queue is set, so the thread we're running on may not - // have a run loop. We'll defer creating and starting the timer - // until we're on the main thread to ensure it has a run loop. - // (If we weren't supporting 10.5, we could use dispatch_after instead - // of an NSTimer.) - [self performSelectorOnMainThread:_cmd - withObject:nil - waitUntilDone:NO]; - return; - } - } - - NSTimeInterval nextInterval = [self nextRetryInterval]; - NSTimeInterval maxInterval = [self maxRetryInterval]; - NSTimeInterval newInterval = MIN(nextInterval, maxInterval); - - [self primeRetryTimerWithNewTimeInterval:newInterval]; - - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc postNotificationName:kGTMHTTPFetcherRetryDelayStartedNotification - object:self]; -} - -- (void)primeRetryTimerWithNewTimeInterval:(NSTimeInterval)secs { - - [self destroyRetryTimer]; - - @synchronized(self) { - lastRetryInterval_ = secs; - - retryTimer_ = [NSTimer timerWithTimeInterval:secs - target:self - selector:@selector(retryTimerFired:) - userInfo:nil - repeats:NO]; - [retryTimer_ retain]; - - NSRunLoop *timerRL = (self.delegateQueue ? - [NSRunLoop mainRunLoop] : [NSRunLoop currentRunLoop]); - [timerRL addTimer:retryTimer_ - forMode:NSDefaultRunLoopMode]; - } -} - -- (void)retryTimerFired:(NSTimer *)timer { - [self destroyRetryTimer]; - - @synchronized(self) { - retryCount_++; - - [self retryFetch]; - } -} - -- (void)destroyRetryTimer { - BOOL shouldNotify = NO; - @synchronized(self) { - if (retryTimer_) { - [retryTimer_ invalidate]; - [retryTimer_ autorelease]; - retryTimer_ = nil; - shouldNotify = YES; - } - } // @synchronized(self) - - if (shouldNotify) { - NSNotificationCenter *defaultNC = [NSNotificationCenter defaultCenter]; - [defaultNC postNotificationName:kGTMHTTPFetcherRetryDelayStoppedNotification - object:self]; - } -} - -- (NSUInteger)retryCount { - return retryCount_; -} - -- (NSTimeInterval)nextRetryInterval { - // The next wait interval is the factor (2.0) times the last interval, - // but never less than the minimum interval. - NSTimeInterval secs = lastRetryInterval_ * retryFactor_; - secs = MIN(secs, maxRetryInterval_); - secs = MAX(secs, minRetryInterval_); - - return secs; -} - -- (BOOL)isRetryEnabled { - return isRetryEnabled_; -} - -- (void)setRetryEnabled:(BOOL)flag { - - if (flag && !isRetryEnabled_) { - // We defer initializing these until the user calls setRetryEnabled - // to avoid using the random number generator if it's not needed. - // However, this means min and max intervals for this fetcher are reset - // as a side effect of calling setRetryEnabled. - // - // Make an initial retry interval random between 1.0 and 2.0 seconds - [self setMinRetryInterval:0.0]; - [self setMaxRetryInterval:kUnsetMaxRetryInterval]; - [self setRetryFactor:2.0]; - lastRetryInterval_ = 0.0; - } - isRetryEnabled_ = flag; -}; - -- (NSTimeInterval)maxRetryInterval { - return maxRetryInterval_; -} - -- (void)setMaxRetryInterval:(NSTimeInterval)secs { - if (secs > 0) { - maxRetryInterval_ = secs; - } else { - maxRetryInterval_ = kUnsetMaxRetryInterval; - } -} - -- (double)minRetryInterval { - return minRetryInterval_; -} - -- (void)setMinRetryInterval:(NSTimeInterval)secs { - if (secs > 0) { - minRetryInterval_ = secs; - } else { - // Set min interval to a random value between 1.0 and 2.0 seconds - // so that if multiple clients start retrying at the same time, they'll - // repeat at different times and avoid overloading the server - minRetryInterval_ = 1.0 + ((double)(arc4random() & 0x0FFFF) / (double) 0x0FFFF); - } -} - -#pragma mark Getters and Setters - -@dynamic cookieStorageMethod, - retryEnabled, - maxRetryInterval, - minRetryInterval, - retryCount, - nextRetryInterval, - statusCode, - responseHeaders, - fetchHistory, - userData, - properties; - -@synthesize mutableRequest = request_, - credential = credential_, - proxyCredential = proxyCredential_, - postData = postData_, - postStream = postStream_, - delegate = delegate_, - authorizer = authorizer_, - service = service_, - serviceHost = serviceHost_, - servicePriority = servicePriority_, - thread = thread_, - sentDataSelector = sentDataSel_, - receivedDataSelector = receivedDataSel_, - retrySelector = retrySel_, - retryFactor = retryFactor_, - response = response_, - downloadedLength = downloadedLength_, - downloadedData = downloadedData_, - downloadPath = downloadPath_, - temporaryDownloadPath = temporaryDownloadPath_, - downloadFileHandle = downloadFileHandle_, - delegateQueue = delegateQueue_, - runLoopModes = runLoopModes_, - comment = comment_, - log = log_, - cookieStorage = cookieStorage_; - -#if NS_BLOCKS_AVAILABLE -@synthesize completionBlock = completionBlock_, - sentDataBlock = sentDataBlock_, - receivedDataBlock = receivedDataBlock_, - retryBlock = retryBlock_; -#endif - -@synthesize shouldFetchInBackground = shouldFetchInBackground_; - -- (NSInteger)cookieStorageMethod { - return cookieStorageMethod_; -} - -- (void)setCookieStorageMethod:(NSInteger)method { - - cookieStorageMethod_ = method; - - if (method == kGTMHTTPFetcherCookieStorageMethodSystemDefault) { - // System default - [request_ setHTTPShouldHandleCookies:YES]; - - // No need for a cookie storage object - self.cookieStorage = nil; - - } else { - // Not system default - [request_ setHTTPShouldHandleCookies:NO]; - - if (method == kGTMHTTPFetcherCookieStorageMethodStatic) { - // Store cookies in the static array - NSAssert(gGTMFetcherStaticCookieStorage != nil, - @"cookie storage requires GTMHTTPFetchHistory"); - - self.cookieStorage = gGTMFetcherStaticCookieStorage; - } else if (method == kGTMHTTPFetcherCookieStorageMethodFetchHistory) { - // store cookies in the fetch history - self.cookieStorage = [fetchHistory_ cookieStorage]; - } else { - // kGTMHTTPFetcherCookieStorageMethodNone - ignore cookies - self.cookieStorage = nil; - } - } -} - -+ (id )staticCookieStorage { - return gGTMFetcherStaticCookieStorage; -} - -+ (BOOL)doesSupportSentDataCallback { -#if GTM_IPHONE - // NSURLConnection's didSendBodyData: delegate support appears to be - // available starting in iPhone OS 3.0 - return (NSFoundationVersionNumber >= 678.47); -#else - // Per WebKit's MaxFoundationVersionWithoutdidSendBodyDataDelegate - // - // Indicates if NSURLConnection will invoke the didSendBodyData: delegate - // method - return (NSFoundationVersionNumber > 677.21); -#endif -} - -- (id )fetchHistory { - return fetchHistory_; -} - -- (void)setFetchHistory:(id )fetchHistory { - [fetchHistory_ autorelease]; - fetchHistory_ = [fetchHistory retain]; - - if (fetchHistory_ != nil) { - // set the fetch history's cookie array to be the cookie store - [self setCookieStorageMethod:kGTMHTTPFetcherCookieStorageMethodFetchHistory]; - - } else { - // The fetch history was removed - if (cookieStorageMethod_ == kGTMHTTPFetcherCookieStorageMethodFetchHistory) { - // Fall back to static storage - [self setCookieStorageMethod:kGTMHTTPFetcherCookieStorageMethodStatic]; - } - } -} - -- (id)userData { - @synchronized(self) { - return userData_; - } -} - -- (void)setUserData:(id)theObj { - @synchronized(self) { - [userData_ autorelease]; - userData_ = [theObj retain]; - } -} - -- (void)setProperties:(NSMutableDictionary *)dict { - @synchronized(self) { - [properties_ autorelease]; - - // This copies rather than retains the parameter for compatiblity with - // an earlier version that took an immutable parameter and copied it. - properties_ = [dict mutableCopy]; - } -} - -- (NSMutableDictionary *)properties { - @synchronized(self) { - return properties_; - } -} - -- (void)setProperty:(id)obj forKey:(NSString *)key { - @synchronized(self) { - if (properties_ == nil && obj != nil) { - [self setProperties:[NSMutableDictionary dictionary]]; - } - [properties_ setValue:obj forKey:key]; - } -} - -- (id)propertyForKey:(NSString *)key { - @synchronized(self) { - return [properties_ objectForKey:key]; - } -} - -- (void)addPropertiesFromDictionary:(NSDictionary *)dict { - @synchronized(self) { - if (properties_ == nil && dict != nil) { - [self setProperties:[[dict mutableCopy] autorelease]]; - } else { - [properties_ addEntriesFromDictionary:dict]; - } - } -} - -- (void)setCommentWithFormat:(id)format, ... { -#if !STRIP_GTM_FETCH_LOGGING - NSString *result = format; - if (format) { - va_list argList; - va_start(argList, format); - - result = [[[NSString alloc] initWithFormat:format - arguments:argList] autorelease]; - va_end(argList); - } - [self setComment:result]; -#endif -} - -+ (Class)connectionClass { - if (gGTMFetcherConnectionClass == nil) { - gGTMFetcherConnectionClass = [NSURLConnection class]; - } - return gGTMFetcherConnectionClass; -} - -+ (void)setConnectionClass:(Class)theClass { - gGTMFetcherConnectionClass = theClass; -} - -#if STRIP_GTM_FETCH_LOGGING -+ (void)setLoggingEnabled:(BOOL)flag { -} -#endif // STRIP_GTM_FETCH_LOGGING - -@end - -void GTMAssertSelectorNilOrImplementedWithArgs(id obj, SEL sel, ...) { - - // Verify that the object's selector is implemented with the proper - // number and type of arguments -#if DEBUG - va_list argList; - va_start(argList, sel); - - if (obj && sel) { - // Check that the selector is implemented - if (![obj respondsToSelector:sel]) { - NSLog(@"\"%@\" selector \"%@\" is unimplemented or misnamed", - NSStringFromClass([obj class]), - NSStringFromSelector(sel)); - NSCAssert(0, @"callback selector unimplemented or misnamed"); - } else { - const char *expectedArgType; - unsigned int argCount = 2; // skip self and _cmd - NSMethodSignature *sig = [obj methodSignatureForSelector:sel]; - - // Check that each expected argument is present and of the correct type - while ((expectedArgType = va_arg(argList, const char*)) != 0) { - - if ([sig numberOfArguments] > argCount) { - const char *foundArgType = [sig getArgumentTypeAtIndex:argCount]; - - if(0 != strncmp(foundArgType, expectedArgType, strlen(expectedArgType))) { - NSLog(@"\"%@\" selector \"%@\" argument %d should be type %s", - NSStringFromClass([obj class]), - NSStringFromSelector(sel), (argCount - 2), expectedArgType); - NSCAssert(0, @"callback selector argument type mistake"); - } - } - argCount++; - } - - // Check that the proper number of arguments are present in the selector - if (argCount != [sig numberOfArguments]) { - NSLog( @"\"%@\" selector \"%@\" should have %d arguments", - NSStringFromClass([obj class]), - NSStringFromSelector(sel), (argCount - 2)); - NSCAssert(0, @"callback selector arguments incorrect"); - } - } - } - - va_end(argList); -#endif -} - -NSString *GTMCleanedUserAgentString(NSString *str) { - // Reference http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html - // and http://www-archive.mozilla.org/build/user-agent-strings.html - - if (str == nil) return nil; - - NSMutableString *result = [NSMutableString stringWithString:str]; - - // Replace spaces with underscores - [result replaceOccurrencesOfString:@" " - withString:@"_" - options:0 - range:NSMakeRange(0, [result length])]; - - // Delete http token separators and remaining whitespace - static NSCharacterSet *charsToDelete = nil; - if (charsToDelete == nil) { - // Make a set of unwanted characters - NSString *const kSeparators = @"()<>@,;:\\\"/[]?={}"; - - NSMutableCharacterSet *mutableChars; - mutableChars = [[[NSCharacterSet whitespaceAndNewlineCharacterSet] mutableCopy] autorelease]; - [mutableChars addCharactersInString:kSeparators]; - charsToDelete = [mutableChars copy]; // hang on to an immutable copy - } - - while (1) { - NSRange separatorRange = [result rangeOfCharacterFromSet:charsToDelete]; - if (separatorRange.location == NSNotFound) break; - - [result deleteCharactersInRange:separatorRange]; - }; - - return result; -} - -NSString *GTMSystemVersionString(void) { - NSString *systemString = @""; - -#if TARGET_OS_MAC && !TARGET_OS_IPHONE - // Mac build - static NSString *savedSystemString = nil; - if (savedSystemString == nil) { - // With Gestalt inexplicably deprecated in 10.8, we're reduced to reading - // the system plist file. - NSString *const kPath = @"/System/Library/CoreServices/SystemVersion.plist"; - NSDictionary *plist = [NSDictionary dictionaryWithContentsOfFile:kPath]; - NSString *versString = [plist objectForKey:@"ProductVersion"]; - if ([versString length] == 0) { - versString = @"10.?.?"; - } - savedSystemString = [[NSString alloc] initWithFormat:@"MacOSX/%@", versString]; - } - systemString = savedSystemString; -#elif TARGET_OS_IPHONE - // Compiling against the iPhone SDK - - static NSString *savedSystemString = nil; - if (savedSystemString == nil) { - // Avoid the slowness of calling currentDevice repeatedly on the iPhone - UIDevice* currentDevice = [UIDevice currentDevice]; - - NSString *rawModel = [currentDevice model]; - NSString *model = GTMCleanedUserAgentString(rawModel); - - NSString *systemVersion = [currentDevice systemVersion]; - - savedSystemString = [[NSString alloc] initWithFormat:@"%@/%@", - model, systemVersion]; // "iPod_Touch/2.2" - } - systemString = savedSystemString; - -#elif (GTL_IPHONE || GDATA_IPHONE) - // Compiling iOS libraries against the Mac SDK - systemString = @"iPhone/x.x"; - -#elif defined(_SYS_UTSNAME_H) - // Foundation-only build - struct utsname unameRecord; - uname(&unameRecord); - - systemString = [NSString stringWithFormat:@"%s/%s", - unameRecord.sysname, unameRecord.release]; // "Darwin/8.11.1" -#endif - - return systemString; -} - -// Return a generic name and version for the current application; this avoids -// anonymous server transactions. -NSString *GTMApplicationIdentifier(NSBundle *bundle) { - static NSString *sAppID = nil; - if (sAppID != nil) return sAppID; - - // If there's a bundle ID, use that; otherwise, use the process name - if (bundle == nil) { - bundle = [NSBundle mainBundle]; - } - - NSString *identifier; - NSString *bundleID = [bundle bundleIdentifier]; - if ([bundleID length] > 0) { - identifier = bundleID; - } else { - // Fall back on the procname, prefixed by "proc" to flag that it's - // autogenerated and perhaps unreliable - NSString *procName = [[NSProcessInfo processInfo] processName]; - identifier = [NSString stringWithFormat:@"proc_%@", procName]; - } - - // Clean up whitespace and special characters - identifier = GTMCleanedUserAgentString(identifier); - - // If there's a version number, append that - NSString *version = [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; - if ([version length] == 0) { - version = [bundle objectForInfoDictionaryKey:@"CFBundleVersion"]; - } - - // Clean up whitespace and special characters - version = GTMCleanedUserAgentString(version); - - // Glue the two together (cleanup done above or else cleanup would strip the - // slash) - if ([version length] > 0) { - identifier = [identifier stringByAppendingFormat:@"/%@", version]; - } - - sAppID = [identifier copy]; - return sAppID; -} diff --git a/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetcherService.h b/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetcherService.h deleted file mode 100644 index 9c6cd754..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetcherService.h +++ /dev/null @@ -1,125 +0,0 @@ -/* Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTMHTTPFetcherService.h -// - -// The fetcher service class maintains a history to be used by a sequence -// of fetchers objects generated by the service. -// -// Fetchers that do not need to share a history may be generated independently, -// like -// -// GTMHTTPFetcher* myFetcher = [GTMHTTPFetcher fetcherWithRequest:request]; -// -// Fetchers that should share cookies or an ETagged data cache should be -// generated by a common GTMHTTPFetcherService instance, like -// -// GTMHTTPFetcherService *myFetcherService = [[GTMHTTPFetcherService alloc] init]; -// GTMHTTPFetcher* myFirstFetcher = [myFetcherService fetcherWithRequest:request1]; -// GTMHTTPFetcher* mySecondFetcher = [myFetcherService fetcherWithRequest:request2]; - -#import "GTMHTTPFetcher.h" -#import "GTMHTTPFetchHistory.h" - -@interface GTMHTTPFetcherService : NSObject { - @private - NSMutableDictionary *delayedHosts_; - NSMutableDictionary *runningHosts_; - NSUInteger maxRunningFetchersPerHost_; - - GTMHTTPFetchHistory *fetchHistory_; - NSOperationQueue *delegateQueue_; - NSArray *runLoopModes_; - NSString *userAgent_; - NSTimeInterval timeout_; - NSURLCredential *credential_; // username & password - NSURLCredential *proxyCredential_; // credential supplied to proxy servers - NSInteger cookieStorageMethod_; - - BOOL shouldFetchInBackground_; - - id authorizer_; -} - -// Create a fetcher -// -// These methods will return an autoreleased fetcher, but if -// the fetcher is successfully created, the connection will retain the -// fetcher for the life of the connection as well. So the caller doesn't have -// to retain the fetcher explicitly unless they want to be able to monitor -// or cancel it. -- (GTMHTTPFetcher *)fetcherWithRequest:(NSURLRequest *)request; -- (GTMHTTPFetcher *)fetcherWithURL:(NSURL *)requestURL; -- (GTMHTTPFetcher *)fetcherWithURLString:(NSString *)requestURLString; -- (id)fetcherWithRequest:(NSURLRequest *)request - fetcherClass:(Class)fetcherClass; - -// Queues of delayed and running fetchers. Each dictionary contains arrays -// of fetchers, keyed by host -// -// A max value of 0 means no fetchers should be delayed. -// -// The default limit is 10 simultaneous fetchers targeting each host. -@property (assign) NSUInteger maxRunningFetchersPerHost; -@property (retain, readonly) NSDictionary *delayedHosts; -@property (retain, readonly) NSDictionary *runningHosts; - -- (BOOL)isDelayingFetcher:(GTMHTTPFetcher *)fetcher; - -- (NSUInteger)numberOfFetchers; // running + delayed fetchers -- (NSUInteger)numberOfRunningFetchers; -- (NSUInteger)numberOfDelayedFetchers; - -// Search for running or delayed fetchers with the specified URL. -// -// Returns an array of fetcher objects found, or nil if none found. -- (NSArray *)issuedFetchersWithRequestURL:(NSURL *)requestURL; - -- (void)stopAllFetchers; - -// Properties to be applied to each fetcher; -// see GTMHTTPFetcher.h for descriptions -@property (copy) NSString *userAgent; -@property (assign) NSTimeInterval timeout; -@property (retain) NSOperationQueue *delegateQueue; -@property (retain) NSArray *runLoopModes; -@property (retain) NSURLCredential *credential; -@property (retain) NSURLCredential *proxyCredential; -@property (assign) BOOL shouldFetchInBackground; - -// Fetch history -@property (retain) GTMHTTPFetchHistory *fetchHistory; - -@property (assign) NSInteger cookieStorageMethod; -@property (assign) BOOL shouldRememberETags; // default: NO -@property (assign) BOOL shouldCacheETaggedData; // default: NO - -- (void)clearETaggedDataCache; -- (void)clearHistory; - -@property (nonatomic, retain) id authorizer; - -// Spin the run loop, discarding events, until all running and delayed fetchers -// have completed -// -// This is only for use in testing or in tools without a user interface. -// -// Synchronous fetches should never be done by shipping apps; they are -// sufficient reason for rejection from the app store. -- (void)waitForCompletionOfAllFetchersWithTimeout:(NSTimeInterval)timeoutInSeconds; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetcherService.m b/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetcherService.m deleted file mode 100644 index 15909dbb..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMHTTPFetcherService.m +++ /dev/null @@ -1,490 +0,0 @@ -/* Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTMHTTPFetcherService.m -// - -#import "GTMHTTPFetcherService.h" - -@interface GTMHTTPFetcher (ServiceMethods) -- (BOOL)beginFetchMayDelay:(BOOL)mayDelay - mayAuthorize:(BOOL)mayAuthorize; -@end - -@interface GTMHTTPFetcherService () -@property (retain, readwrite) NSDictionary *delayedHosts; -@property (retain, readwrite) NSDictionary *runningHosts; - -- (void)detachAuthorizer; -@end - -@implementation GTMHTTPFetcherService - -@synthesize maxRunningFetchersPerHost = maxRunningFetchersPerHost_, - userAgent = userAgent_, - timeout = timeout_, - delegateQueue = delegateQueue_, - runLoopModes = runLoopModes_, - credential = credential_, - proxyCredential = proxyCredential_, - cookieStorageMethod = cookieStorageMethod_, - shouldFetchInBackground = shouldFetchInBackground_, - fetchHistory = fetchHistory_; - -- (id)init { - self = [super init]; - if (self) { - fetchHistory_ = [[GTMHTTPFetchHistory alloc] init]; - delayedHosts_ = [[NSMutableDictionary alloc] init]; - runningHosts_ = [[NSMutableDictionary alloc] init]; - cookieStorageMethod_ = kGTMHTTPFetcherCookieStorageMethodFetchHistory; - - maxRunningFetchersPerHost_ = 10; -} - return self; -} - -- (void)dealloc { - [self detachAuthorizer]; - - [delayedHosts_ release]; - [runningHosts_ release]; - [fetchHistory_ release]; - [userAgent_ release]; - [delegateQueue_ release]; - [runLoopModes_ release]; - [credential_ release]; - [proxyCredential_ release]; - [authorizer_ release]; - - [super dealloc]; -} - -#pragma mark Generate a new fetcher - -- (id)fetcherWithRequest:(NSURLRequest *)request - fetcherClass:(Class)fetcherClass { - GTMHTTPFetcher *fetcher = [fetcherClass fetcherWithRequest:request]; - - fetcher.fetchHistory = self.fetchHistory; - fetcher.delegateQueue = self.delegateQueue; - fetcher.runLoopModes = self.runLoopModes; - fetcher.cookieStorageMethod = self.cookieStorageMethod; - fetcher.credential = self.credential; - fetcher.proxyCredential = self.proxyCredential; - fetcher.shouldFetchInBackground = self.shouldFetchInBackground; - fetcher.authorizer = self.authorizer; - fetcher.service = self; - - NSString *userAgent = self.userAgent; - if ([userAgent length] > 0 - && [request valueForHTTPHeaderField:@"User-Agent"] == nil) { - [fetcher.mutableRequest setValue:userAgent - forHTTPHeaderField:@"User-Agent"]; - } - - NSTimeInterval timeout = self.timeout; - if (timeout > 0.0) { - [fetcher.mutableRequest setTimeoutInterval:timeout]; - } - - return fetcher; -} - -- (GTMHTTPFetcher *)fetcherWithRequest:(NSURLRequest *)request { - return [self fetcherWithRequest:request - fetcherClass:[GTMHTTPFetcher class]]; -} - -- (GTMHTTPFetcher *)fetcherWithURL:(NSURL *)requestURL { - return [self fetcherWithRequest:[NSURLRequest requestWithURL:requestURL]]; -} - -- (GTMHTTPFetcher *)fetcherWithURLString:(NSString *)requestURLString { - return [self fetcherWithURL:[NSURL URLWithString:requestURLString]]; -} - -#pragma mark Queue Management - -- (void)addRunningFetcher:(GTMHTTPFetcher *)fetcher - forHost:(NSString *)host { - // Add to the array of running fetchers for this host, creating the array - // if needed - NSMutableArray *runningForHost = [runningHosts_ objectForKey:host]; - if (runningForHost == nil) { - runningForHost = [NSMutableArray arrayWithObject:fetcher]; - [runningHosts_ setObject:runningForHost forKey:host]; - } else { - [runningForHost addObject:fetcher]; - } -} - -- (void)addDelayedFetcher:(GTMHTTPFetcher *)fetcher - forHost:(NSString *)host { - // Add to the array of delayed fetchers for this host, creating the array - // if needed - NSMutableArray *delayedForHost = [delayedHosts_ objectForKey:host]; - if (delayedForHost == nil) { - delayedForHost = [NSMutableArray arrayWithObject:fetcher]; - [delayedHosts_ setObject:delayedForHost forKey:host]; - } else { - [delayedForHost addObject:fetcher]; - } -} - -- (BOOL)isDelayingFetcher:(GTMHTTPFetcher *)fetcher { - @synchronized(self) { - NSString *host = [[[fetcher mutableRequest] URL] host]; - NSArray *delayedForHost = [delayedHosts_ objectForKey:host]; - NSUInteger idx = [delayedForHost indexOfObjectIdenticalTo:fetcher]; - BOOL isDelayed = (delayedForHost != nil) && (idx != NSNotFound); - return isDelayed; - } -} - -- (BOOL)fetcherShouldBeginFetching:(GTMHTTPFetcher *)fetcher { - // Entry point from the fetcher - @synchronized(self) { - NSString *host = [[[fetcher mutableRequest] URL] host]; - - if ([host length] == 0) { -#if DEBUG - NSAssert1(0, @"%@ lacks host", fetcher); -#endif - return YES; - } - - NSMutableArray *runningForHost = [runningHosts_ objectForKey:host]; - if (runningForHost != nil - && [runningForHost indexOfObjectIdenticalTo:fetcher] != NSNotFound) { -#if DEBUG - NSAssert1(0, @"%@ was already running", fetcher); -#endif - return YES; - } - - // We'll save the host that serves as the key for this fetcher's array - // to avoid any chance of the underlying request changing, stranding - // the fetcher in the wrong array - fetcher.serviceHost = host; - fetcher.thread = [NSThread currentThread]; - - if (maxRunningFetchersPerHost_ == 0 - || maxRunningFetchersPerHost_ > [runningForHost count]) { - [self addRunningFetcher:fetcher forHost:host]; - return YES; - } else { - [self addDelayedFetcher:fetcher forHost:host]; - return NO; - } - } - return YES; -} - -// Fetcher start and stop methods, invoked on the appropriate thread for -// the fetcher -- (void)performSelector:(SEL)sel onStartThreadForFetcher:(GTMHTTPFetcher *)fetcher { - NSOperationQueue *delegateQueue = fetcher.delegateQueue; - NSThread *thread = fetcher.thread; - if (delegateQueue != nil || [thread isEqual:[NSThread currentThread]]) { - // The fetcher should run on the thread we're on now, or there's a delegate - // queue specified so it doesn't matter what thread the fetcher is started - // on, since it will call back on the queue. - [self performSelector:sel withObject:fetcher]; - } else { - // Fetcher must run on a specified thread (and that thread must have a - // run loop.) - [self performSelector:sel - onThread:thread - withObject:fetcher - waitUntilDone:NO]; - } -} - -- (void)startFetcherOnCurrentThread:(GTMHTTPFetcher *)fetcher { - [fetcher beginFetchMayDelay:NO - mayAuthorize:YES]; -} - -- (void)startFetcher:(GTMHTTPFetcher *)fetcher { - [self performSelector:@selector(startFetcherOnCurrentThread:) - onStartThreadForFetcher:fetcher]; -} - -- (void)stopFetcherOnCurrentThread:(GTMHTTPFetcher *)fetcher { - [fetcher stopFetching]; -} - -- (void)stopFetcher:(GTMHTTPFetcher *)fetcher { - [self performSelector:@selector(stopFetcherOnCurrentThread:) - onStartThreadForFetcher:fetcher]; -} - -- (void)fetcherDidStop:(GTMHTTPFetcher *)fetcher { - // Entry point from the fetcher - @synchronized(self) { - NSString *host = fetcher.serviceHost; - if (!host) { - // fetcher has been stopped previously - return; - } - - NSMutableArray *runningForHost = [runningHosts_ objectForKey:host]; - [runningForHost removeObject:fetcher]; - - NSMutableArray *delayedForHost = [delayedHosts_ objectForKey:host]; - [delayedForHost removeObject:fetcher]; - - while ([delayedForHost count] > 0 - && [runningForHost count] < maxRunningFetchersPerHost_) { - // Start another delayed fetcher running, scanning for the minimum - // priority value, defaulting to FIFO for equal priorities - GTMHTTPFetcher *nextFetcher = nil; - for (GTMHTTPFetcher *delayedFetcher in delayedForHost) { - if (nextFetcher == nil - || delayedFetcher.servicePriority < nextFetcher.servicePriority) { - nextFetcher = delayedFetcher; - } - } - - [self addRunningFetcher:nextFetcher forHost:host]; - runningForHost = [runningHosts_ objectForKey:host]; - - [delayedForHost removeObjectIdenticalTo:nextFetcher]; - [self startFetcher:nextFetcher]; - } - - if ([runningForHost count] == 0) { - // None left; remove the empty array - [runningHosts_ removeObjectForKey:host]; - } - - if ([delayedForHost count] == 0) { - [delayedHosts_ removeObjectForKey:host]; - } - - // The fetcher is no longer in the running or the delayed array, - // so remove its host and thread properties - fetcher.serviceHost = nil; - fetcher.thread = nil; - } -} - -- (NSUInteger)numberOfFetchers { - @synchronized(self) { - NSUInteger running = [self numberOfRunningFetchers]; - NSUInteger delayed = [self numberOfDelayedFetchers]; - return running + delayed; - } -} - -- (NSUInteger)numberOfRunningFetchers { - @synchronized(self) { - NSUInteger sum = 0; - for (NSString *host in runningHosts_) { - NSArray *fetchers = [runningHosts_ objectForKey:host]; - sum += [fetchers count]; - } - return sum; - } -} - -- (NSUInteger)numberOfDelayedFetchers { - @synchronized(self) { - NSUInteger sum = 0; - for (NSString *host in delayedHosts_) { - NSArray *fetchers = [delayedHosts_ objectForKey:host]; - sum += [fetchers count]; - } - return sum; - } -} - -- (NSArray *)issuedFetchersWithRequestURL:(NSURL *)requestURL { - @synchronized(self) { - NSMutableArray *array = nil; - NSString *host = [requestURL host]; - if ([host length] == 0) return nil; - - NSURL *absRequestURL = [requestURL absoluteURL]; - - NSArray *runningForHost = [runningHosts_ objectForKey:host]; - for (GTMHTTPFetcher *fetcher in runningForHost) { - NSURL *fetcherURL = [[[fetcher mutableRequest] URL] absoluteURL]; - if ([fetcherURL isEqual:absRequestURL]) { - if (array == nil) { - array = [NSMutableArray array]; - } - [array addObject:fetcher]; - } - } - - NSArray *delayedForHost = [delayedHosts_ objectForKey:host]; - for (GTMHTTPFetcher *fetcher in delayedForHost) { - NSURL *fetcherURL = [[[fetcher mutableRequest] URL] absoluteURL]; - if ([fetcherURL isEqual:absRequestURL]) { - if (array == nil) { - array = [NSMutableArray array]; - } - [array addObject:fetcher]; - } - } - return array; - } -} - -- (void)stopAllFetchers { - @synchronized(self) { - // Remove fetchers from the delayed list to avoid fetcherDidStop: from - // starting more fetchers running as a side effect of stopping one - NSArray *delayedForHosts = [delayedHosts_ allValues]; - [delayedHosts_ removeAllObjects]; - - for (NSArray *delayedForHost in delayedForHosts) { - for (GTMHTTPFetcher *fetcher in delayedForHost) { - [self stopFetcher:fetcher]; - } - } - - NSArray *runningForHosts = [runningHosts_ allValues]; - [runningHosts_ removeAllObjects]; - - for (NSArray *runningForHost in runningForHosts) { - for (GTMHTTPFetcher *fetcher in runningForHost) { - [self stopFetcher:fetcher]; - } - } - } -} - -#pragma mark Fetch History Settings - -// Turn on data caching to receive a copy of previously-retrieved objects. -// Otherwise, fetches may return status 304 (No Change) rather than actual data -- (void)setShouldCacheETaggedData:(BOOL)flag { - self.fetchHistory.shouldCacheETaggedData = flag; -} - -- (BOOL)shouldCacheETaggedData { - return self.fetchHistory.shouldCacheETaggedData; -} - -- (void)setETaggedDataCacheCapacity:(NSUInteger)totalBytes { - self.fetchHistory.memoryCapacity = totalBytes; -} - -- (NSUInteger)ETaggedDataCacheCapacity { - return self.fetchHistory.memoryCapacity; -} - -- (void)setShouldRememberETags:(BOOL)flag { - self.fetchHistory.shouldRememberETags = flag; -} - -- (BOOL)shouldRememberETags { - return self.fetchHistory.shouldRememberETags; -} - -// reset the ETag cache to avoid getting a Not Modified status -// based on prior queries -- (void)clearETaggedDataCache { - [self.fetchHistory clearETaggedDataCache]; -} - -- (void)clearHistory { - [self clearETaggedDataCache]; - [self.fetchHistory removeAllCookies]; -} - -#pragma mark Synchronous Wait for Unit Testing - -- (void)waitForCompletionOfAllFetchersWithTimeout:(NSTimeInterval)timeoutInSeconds { - NSDate* giveUpDate = [NSDate dateWithTimeIntervalSinceNow:timeoutInSeconds]; - BOOL isMainThread = [NSThread isMainThread]; - - while ([self numberOfFetchers] > 0 - && [giveUpDate timeIntervalSinceNow] > 0) { - // Run the current run loop 1/1000 of a second to give the networking - // code a chance to work - if (isMainThread || delegateQueue_ == nil) { - NSDate *stopDate = [NSDate dateWithTimeIntervalSinceNow:0.001]; - [[NSRunLoop currentRunLoop] runUntilDate:stopDate]; - } else { - // Sleep on the delegate queue's background thread. - [NSThread sleepForTimeInterval:0.001]; - } - } -} - -#pragma mark Accessors - -- (NSDictionary *)runningHosts { - return runningHosts_; -} - -- (void)setRunningHosts:(NSDictionary *)dict { - [runningHosts_ autorelease]; - runningHosts_ = [dict mutableCopy]; -} - -- (NSDictionary *)delayedHosts { - return delayedHosts_; -} - -- (void)setDelayedHosts:(NSDictionary *)dict { - [delayedHosts_ autorelease]; - delayedHosts_ = [dict mutableCopy]; -} - -- (id )authorizer { - return authorizer_; -} - -- (void)setAuthorizer:(id )obj { - if (obj != authorizer_) { - [self detachAuthorizer]; - } - - [authorizer_ autorelease]; - authorizer_ = [obj retain]; - - // Use the fetcher service for the authorization fetches if the auth - // object supports fetcher services - if ([authorizer_ respondsToSelector:@selector(setFetcherService:)]) { - [authorizer_ setFetcherService:self]; - } -} - -- (void)detachAuthorizer { - // This method is called by the fetcher service's dealloc and setAuthorizer: - // methods; do not override. - // - // The fetcher service retains the authorizer, and the authorizer has a - // weak pointer to the fetcher service (a non-zeroing pointer for - // compatibility with iOS 4 and Mac OS X 10.5/10.6.) - // - // When this fetcher service no longer uses the authorizer, we want to remove - // the authorizer's dependence on the fetcher service. Authorizers can still - // function without a fetcher service. - if ([authorizer_ respondsToSelector:@selector(fetcherService)]) { - GTMHTTPFetcherService *authFS = [authorizer_ fetcherService]; - if (authFS == self) { - [authorizer_ setFetcherService:nil]; - } - } -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTMLogger.h b/External/google-plus-ios-sdk/OpenSource/GTMLogger.h deleted file mode 100644 index c4fd1402..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMLogger.h +++ /dev/null @@ -1,504 +0,0 @@ -// -// GTMLogger.h -// -// Copyright 2007-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -// Key Abstractions -// ---------------- -// -// This file declares multiple classes and protocols that are used by the -// GTMLogger logging system. The 4 main abstractions used in this file are the -// following: -// -// * logger (GTMLogger) - The main logging class that users interact with. It -// has methods for logging at different levels and uses a log writer, a log -// formatter, and a log filter to get the job done. -// -// * log writer (GTMLogWriter) - Writes a given string to some log file, where -// a "log file" can be a physical file on disk, a POST over HTTP to some URL, -// or even some in-memory structure (e.g., a ring buffer). -// -// * log formatter (GTMLogFormatter) - Given a format string and arguments as -// a va_list, returns a single formatted NSString. A "formatted string" could -// be a string with the date prepended, a string with values in a CSV format, -// or even a string of XML. -// -// * log filter (GTMLogFilter) - Given a formatted log message as an NSString -// and the level at which the message is to be logged, this class will decide -// whether the given message should be logged or not. This is a flexible way -// to filter out messages logged at a certain level, messages that contain -// certain text, or filter nothing out at all. This gives the caller the -// flexibility to dynamically enable debug logging in Release builds. -// -// This file also declares some classes to handle the common log writer, log -// formatter, and log filter cases. Callers can also create their own writers, -// formatters, and filters and they can even build them on top of the ones -// declared here. Keep in mind that your custom writer/formatter/filter may be -// called from multiple threads, so it must be thread-safe. - -#import -#import "GTMDefines.h" - -// Predeclaration of used protocols that are declared later in this file. -@protocol GTMLogWriter, GTMLogFormatter, GTMLogFilter; - -// GTMLogger -// -// GTMLogger is the primary user-facing class for an object-oriented logging -// system. It is built on the concept of log formatters (GTMLogFormatter), log -// writers (GTMLogWriter), and log filters (GTMLogFilter). When a message is -// sent to a GTMLogger to log a message, the message is formatted using the log -// formatter, then the log filter is consulted to see if the message should be -// logged, and if so, the message is sent to the log writer to be written out. -// -// GTMLogger is intended to be a flexible and thread-safe logging solution. Its -// flexibility comes from the fact that GTMLogger instances can be customized -// with user defined formatters, filters, and writers. And these writers, -// filters, and formatters can be combined, stacked, and customized in arbitrary -// ways to suit the needs at hand. For example, multiple writers can be used at -// the same time, and a GTMLogger instance can even be used as another -// GTMLogger's writer. This allows for arbitrarily deep logging trees. -// -// A standard GTMLogger uses a writer that sends messages to standard out, a -// formatter that smacks a timestamp and a few other bits of interesting -// information on the message, and a filter that filters out debug messages from -// release builds. Using the standard log settings, a log message will look like -// the following: -// -// 2007-12-30 10:29:24.177 myapp[4588/0xa07d0f60] [lvl=1] foo= -// -// The output contains the date and time of the log message, the name of the -// process followed by its process ID/thread ID, the log level at which the -// message was logged (in the previous example the level was 1: -// kGTMLoggerLevelDebug), and finally, the user-specified log message itself (in -// this case, the log message was @"foo=%@", foo). -// -// Multiple instances of GTMLogger can be created, each configured their own -// way. Though GTMLogger is not a singleton (in the GoF sense), it does provide -// access to a shared (i.e., globally accessible) GTMLogger instance. This makes -// it convenient for all code in a process to use the same GTMLogger instance. -// The shared GTMLogger instance can also be configured in an arbitrary, and -// these configuration changes will affect all code that logs through the shared -// instance. - -// -// Log Levels -// ---------- -// GTMLogger has 3 different log levels: Debug, Info, and Error. GTMLogger -// doesn't take any special action based on the log level; it simply forwards -// this information on to formatters, filters, and writers, each of which may -// optionally take action based on the level. Since log level filtering is -// performed at runtime, log messages are typically not filtered out at compile -// time. The exception to this rule is that calls to the GTMLoggerDebug() macro -// *ARE* filtered out of non-DEBUG builds. This is to be backwards compatible -// with behavior that many developers are currently used to. Note that this -// means that GTMLoggerDebug(@"hi") will be compiled out of Release builds, but -// [[GTMLogger sharedLogger] logDebug:@"hi"] will NOT be compiled out. -// -// Standard loggers are created with the GTMLogLevelFilter log filter, which -// filters out certain log messages based on log level, and some other settings. -// -// In addition to the -logDebug:, -logInfo:, and -logError: methods defined on -// GTMLogger itself, there are also C macros that make usage of the shared -// GTMLogger instance very convenient. These macros are: -// -// GTMLoggerDebug(...) -// GTMLoggerInfo(...) -// GTMLoggerError(...) -// -// Again, a notable feature of these macros is that GTMLogDebug() calls *will be -// compiled out of non-DEBUG builds*. -// -// Standard Loggers -// ---------------- -// GTMLogger has the concept of "standard loggers". A standard logger is simply -// a logger that is pre-configured with some standard/common writer, formatter, -// and filter combination. Standard loggers are created using the creation -// methods beginning with "standard". The alternative to a standard logger is a -// regular logger, which will send messages to stdout, with no special -// formatting, and no filtering. -// -// How do I use GTMLogger? -// ---------------------- -// The typical way you will want to use GTMLogger is to simply use the -// GTMLogger*() macros for logging from code. That way we can easily make -// changes to the GTMLogger class and simply update the macros accordingly. Only -// your application startup code (perhaps, somewhere in main()) should use the -// GTMLogger class directly in order to configure the shared logger, which all -// of the code using the macros will be using. Again, this is just the typical -// situation. -// -// To be complete, there are cases where you may want to use GTMLogger directly, -// or even create separate GTMLogger instances for some reason. That's fine, -// too. -// -// Examples -// -------- -// The following show some common GTMLogger use cases. -// -// 1. You want to log something as simply as possible. Also, this call will only -// appear in debug builds. In non-DEBUG builds it will be completely removed. -// -// GTMLoggerDebug(@"foo = %@", foo); -// -// 2. The previous example is similar to the following. The major difference is -// that the previous call (example 1) will be compiled out of Release builds -// but this statement will not be compiled out. -// -// [[GTMLogger sharedLogger] logDebug:@"foo = %@", foo]; -// -// 3. Send all logging output from the shared logger to a file. We do this by -// creating an NSFileHandle for writing associated with a file, and setting -// that file handle as the logger's writer. -// -// NSFileHandle *f = [NSFileHandle fileHandleForWritingAtPath:@"/tmp/f.log" -// create:YES]; -// [[GTMLogger sharedLogger] setWriter:f]; -// GTMLoggerError(@"hi"); // This will be sent to /tmp/f.log -// -// 4. Create a new GTMLogger that will log to a file. This example differs from -// the previous one because here we create a new GTMLogger that is different -// from the shared logger. -// -// GTMLogger *logger = [GTMLogger standardLoggerWithPath:@"/tmp/temp.log"]; -// [logger logInfo:@"hi temp log file"]; -// -// 5. Create a logger that writes to stdout and does NOT do any formatting to -// the log message. This might be useful, for example, when writing a help -// screen for a command-line tool to standard output. -// -// GTMLogger *logger = [GTMLogger logger]; -// [logger logInfo:@"%@ version 0.1 usage", progName]; -// -// 6. Send log output to stdout AND to a log file. The trick here is that -// NSArrays function as composite log writers, which means when an array is -// set as the log writer, it forwards all logging messages to all of its -// contained GTMLogWriters. -// -// // Create array of GTMLogWriters -// NSArray *writers = [NSArray arrayWithObjects: -// [NSFileHandle fileHandleForWritingAtPath:@"/tmp/f.log" create:YES], -// [NSFileHandle fileHandleWithStandardOutput], nil]; -// -// GTMLogger *logger = [GTMLogger standardLogger]; -// [logger setWriter:writers]; -// [logger logInfo:@"hi"]; // Output goes to stdout and /tmp/f.log -// -// For futher details on log writers, formatters, and filters, see the -// documentation below. -// -// NOTE: GTMLogger is application level logging. By default it does nothing -// with _GTMDevLog/_GTMDevAssert (see GTMDefines.h). An application can choose -// to bridge _GTMDevLog/_GTMDevAssert to GTMLogger by providing macro -// definitions in its prefix header (see GTMDefines.h for how one would do -// that). -// -@interface GTMLogger : NSObject { - @private - id writer_; - id formatter_; - id filter_; -} - -// -// Accessors for the shared logger instance -// - -// Returns a shared/global standard GTMLogger instance. Callers should typically -// use this method to get a GTMLogger instance, unless they explicitly want -// their own instance to configure for their own needs. This is the only method -// that returns a shared instance; all the rest return new GTMLogger instances. -+ (id)sharedLogger; - -// Sets the shared logger instance to |logger|. Future calls to +sharedLogger -// will return |logger| instead. -+ (void)setSharedLogger:(GTMLogger *)logger; - -// -// Creation methods -// - -// Returns a new autoreleased GTMLogger instance that will log to stdout, using -// the GTMLogStandardFormatter, and the GTMLogLevelFilter filter. -+ (id)standardLogger; - -// Same as +standardLogger, but logs to stderr. -+ (id)standardLoggerWithStderr; - -// Same as +standardLogger but levels >= kGTMLoggerLevelError are routed to -// stderr, everything else goes to stdout. -+ (id)standardLoggerWithStdoutAndStderr; - -// Returns a new standard GTMLogger instance with a log writer that will -// write to the file at |path|, and will use the GTMLogStandardFormatter and -// GTMLogLevelFilter classes. If |path| does not exist, it will be created. -+ (id)standardLoggerWithPath:(NSString *)path; - -// Returns an autoreleased GTMLogger instance that will use the specified -// |writer|, |formatter|, and |filter|. -+ (id)loggerWithWriter:(id)writer - formatter:(id)formatter - filter:(id)filter; - -// Returns an autoreleased GTMLogger instance that logs to stdout, with the -// basic formatter, and no filter. The returned logger differs from the logger -// returned by +standardLogger because this one does not do any filtering and -// does not do any special log formatting; this is the difference between a -// "regular" logger and a "standard" logger. -+ (id)logger; - -// Designated initializer. This method returns a GTMLogger initialized with the -// specified |writer|, |formatter|, and |filter|. See the setter methods below -// for what values will be used if nil is passed for a parameter. -- (id)initWithWriter:(id)writer - formatter:(id)formatter - filter:(id)filter; - -// -// Logging methods -// - -// Logs a message at the debug level (kGTMLoggerLevelDebug). -- (void)logDebug:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2); -// Logs a message at the info level (kGTMLoggerLevelInfo). -- (void)logInfo:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2); -// Logs a message at the error level (kGTMLoggerLevelError). -- (void)logError:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2); -// Logs a message at the assert level (kGTMLoggerLevelAssert). -- (void)logAssert:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2); - - -// -// Accessors -// - -// Accessor methods for the log writer. If the log writer is set to nil, -// [NSFileHandle fileHandleWithStandardOutput] is used. -- (id)writer; -- (void)setWriter:(id)writer; - -// Accessor methods for the log formatter. If the log formatter is set to nil, -// GTMLogBasicFormatter is used. This formatter will format log messages in a -// plain printf style. -- (id)formatter; -- (void)setFormatter:(id)formatter; - -// Accessor methods for the log filter. If the log filter is set to nil, -// GTMLogNoFilter is used, which allows all log messages through. -- (id)filter; -- (void)setFilter:(id)filter; - -@end // GTMLogger - - -// Helper functions that are used by the convenience GTMLogger*() macros that -// enable the logging of function names. -@interface GTMLogger (GTMLoggerMacroHelpers) -- (void)logFuncDebug:(const char *)func msg:(NSString *)fmt, ... - NS_FORMAT_FUNCTION(2, 3); -- (void)logFuncInfo:(const char *)func msg:(NSString *)fmt, ... - NS_FORMAT_FUNCTION(2, 3); -- (void)logFuncError:(const char *)func msg:(NSString *)fmt, ... - NS_FORMAT_FUNCTION(2, 3); -- (void)logFuncAssert:(const char *)func msg:(NSString *)fmt, ... - NS_FORMAT_FUNCTION(2, 3); -@end // GTMLoggerMacroHelpers - - -// The convenience macros are only defined if they haven't already been defined. -#ifndef GTMLoggerInfo - -// Convenience macros that log to the shared GTMLogger instance. These macros -// are how users should typically log to GTMLogger. Notice that GTMLoggerDebug() -// calls will be compiled out of non-Debug builds. -#define GTMLoggerDebug(...) \ - [[GTMLogger sharedLogger] logFuncDebug:__func__ msg:__VA_ARGS__] -#define GTMLoggerInfo(...) \ - [[GTMLogger sharedLogger] logFuncInfo:__func__ msg:__VA_ARGS__] -#define GTMLoggerError(...) \ - [[GTMLogger sharedLogger] logFuncError:__func__ msg:__VA_ARGS__] -#define GTMLoggerAssert(...) \ - [[GTMLogger sharedLogger] logFuncAssert:__func__ msg:__VA_ARGS__] - -// If we're not in a debug build, remove the GTMLoggerDebug statements. This -// makes calls to GTMLoggerDebug "compile out" of Release builds -#ifndef DEBUG -#undef GTMLoggerDebug -#define GTMLoggerDebug(...) do {} while(0) -#endif - -#endif // !defined(GTMLoggerInfo) - -// Log levels. -typedef enum { - kGTMLoggerLevelUnknown, - kGTMLoggerLevelDebug, - kGTMLoggerLevelInfo, - kGTMLoggerLevelError, - kGTMLoggerLevelAssert, -} GTMLoggerLevel; - - -// -// Log Writers -// - -// Protocol to be implemented by a GTMLogWriter instance. -@protocol GTMLogWriter -// Writes the given log message to where the log writer is configured to write. -- (void)logMessage:(NSString *)msg level:(GTMLoggerLevel)level; -@end // GTMLogWriter - - -// Simple category on NSFileHandle that makes NSFileHandles valid log writers. -// This is convenient because something like, say, +fileHandleWithStandardError -// now becomes a valid log writer. Log messages are written to the file handle -// with a newline appended. -@interface NSFileHandle (GTMFileHandleLogWriter) -// Opens the file at |path| in append mode, and creates the file with |mode| -// if it didn't previously exist. -+ (id)fileHandleForLoggingAtPath:(NSString *)path mode:(mode_t)mode; -@end // NSFileHandle - - -// This category makes NSArray a GTMLogWriter that can be composed of other -// GTMLogWriters. This is the classic Composite GoF design pattern. When the -// GTMLogWriter -logMessage:level: message is sent to the array, the array -// forwards the message to all of its elements that implement the GTMLogWriter -// protocol. -// -// This is useful in situations where you would like to send log output to -// multiple log writers at the same time. Simply create an NSArray of the log -// writers you wish to use, then set the array as the "writer" for your -// GTMLogger instance. -@interface NSArray (GTMArrayCompositeLogWriter) -@end // GTMArrayCompositeLogWriter - - -// This category adapts the GTMLogger interface so that it can be used as a log -// writer; it's an "adapter" in the GoF Adapter pattern sense. -// -// This is useful when you want to configure a logger to log to a specific -// writer with a specific formatter and/or filter. But you want to also compose -// that with a different log writer that may have its own formatter and/or -// filter. -@interface GTMLogger (GTMLoggerLogWriter) -@end // GTMLoggerLogWriter - - -// -// Log Formatters -// - -// Protocol to be implemented by a GTMLogFormatter instance. -@protocol GTMLogFormatter -// Returns a formatted string using the format specified in |fmt| and the va -// args specified in |args|. -- (NSString *)stringForFunc:(NSString *)func - withFormat:(NSString *)fmt - valist:(va_list)args - level:(GTMLoggerLevel)level NS_FORMAT_FUNCTION(2, 0); -@end // GTMLogFormatter - - -// A basic log formatter that formats a string the same way that NSLog (or -// printf) would. It does not do anything fancy, nor does it add any data of its -// own. -@interface GTMLogBasicFormatter : NSObject - -// Helper method for prettying C99 __func__ and GCC __PRETTY_FUNCTION__ -- (NSString *)prettyNameForFunc:(NSString *)func; - -@end // GTMLogBasicFormatter - - -// A log formatter that formats the log string like the basic formatter, but -// also prepends a timestamp and some basic process info to the message, as -// shown in the following sample output. -// 2007-12-30 10:29:24.177 myapp[4588/0xa07d0f60] [lvl=1] log mesage here -@interface GTMLogStandardFormatter : GTMLogBasicFormatter { - @private - NSDateFormatter *dateFormatter_; // yyyy-MM-dd HH:mm:ss.SSS - NSString *pname_; - pid_t pid_; -} -@end // GTMLogStandardFormatter - - -// -// Log Filters -// - -// Protocol to be imlemented by a GTMLogFilter instance. -@protocol GTMLogFilter -// Returns YES if |msg| at |level| should be filtered out; NO otherwise. -- (BOOL)filterAllowsMessage:(NSString *)msg level:(GTMLoggerLevel)level; -@end // GTMLogFilter - - -// A log filter that filters messages at the kGTMLoggerLevelDebug level out of -// non-debug builds. Messages at the kGTMLoggerLevelInfo level are also filtered -// out of non-debug builds unless GTMVerboseLogging is set in the environment or -// the processes's defaults. Messages at the kGTMLoggerLevelError level are -// never filtered. -@interface GTMLogLevelFilter : NSObject -@end // GTMLogLevelFilter - -// A simple log filter that does NOT filter anything out; -// -filterAllowsMessage:level will always return YES. This can be a convenient -// way to enable debug-level logging in release builds (if you so desire). -@interface GTMLogNoFilter : NSObject -@end // GTMLogNoFilter - - -// Base class for custom level filters. Not for direct use, use the minimum -// or maximum level subclasses below. -@interface GTMLogAllowedLevelFilter : NSObject { - @private - NSIndexSet *allowedLevels_; -} -@end - -// A log filter that allows you to set a minimum log level. Messages below this -// level will be filtered. -@interface GTMLogMininumLevelFilter : GTMLogAllowedLevelFilter - -// Designated initializer, logs at levels < |level| will be filtered. -- (id)initWithMinimumLevel:(GTMLoggerLevel)level; - -@end - -// A log filter that allows you to set a maximum log level. Messages whose level -// exceeds this level will be filtered. This is really only useful if you have -// a composite GTMLogger that is sending the other messages elsewhere. -@interface GTMLogMaximumLevelFilter : GTMLogAllowedLevelFilter - -// Designated initializer, logs at levels > |level| will be filtered. -- (id)initWithMaximumLevel:(GTMLoggerLevel)level; - -@end - - -// For subclasses only -@interface GTMLogger (PrivateMethods) - -- (void)logInternalFunc:(const char *)func - format:(NSString *)fmt - valist:(va_list)args - level:(GTMLoggerLevel)level NS_FORMAT_FUNCTION(2, 0); - -@end - diff --git a/External/google-plus-ios-sdk/OpenSource/GTMLogger.m b/External/google-plus-ios-sdk/OpenSource/GTMLogger.m deleted file mode 100644 index 4b40747b..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMLogger.m +++ /dev/null @@ -1,612 +0,0 @@ -// -// GTMLogger.m -// -// Copyright 2007-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -#import "GTMLogger.h" -#import "GTMGarbageCollection.h" -#import -#import -#import -#import - - -#if !defined(__clang__) && (__GNUC__*10+__GNUC_MINOR__ >= 42) -// Some versions of GCC (4.2 and below AFAIK) aren't great about supporting -// -Wmissing-format-attribute -// when the function is anything more complex than foo(NSString *fmt, ...). -// You see the error inside the function when you turn ... into va_args and -// attempt to call another function (like vsprintf for example). -// So we just shut off the warning for this file. We reenable it at the end. -#pragma GCC diagnostic ignored "-Wmissing-format-attribute" -#endif // !__clang__ - -// Reference to the shared GTMLogger instance. This is not a singleton, it's -// just an easy reference to one shared instance. -static GTMLogger *gSharedLogger = nil; - - -@implementation GTMLogger - -// Returns a pointer to the shared logger instance. If none exists, a standard -// logger is created and returned. -+ (id)sharedLogger { - @synchronized(self) { - if (gSharedLogger == nil) { - gSharedLogger = [[self standardLogger] retain]; - } - } - return [[gSharedLogger retain] autorelease]; -} - -+ (void)setSharedLogger:(GTMLogger *)logger { - @synchronized(self) { - [gSharedLogger autorelease]; - gSharedLogger = [logger retain]; - } -} - -+ (id)standardLogger { - // Don't trust NSFileHandle not to throw - @try { - id writer = [NSFileHandle fileHandleWithStandardOutput]; - id fr = [[[GTMLogStandardFormatter alloc] init] - autorelease]; - id filter = [[[GTMLogLevelFilter alloc] init] autorelease]; - return [[[self alloc] initWithWriter:writer - formatter:fr - filter:filter] autorelease]; - } - @catch (id e) { - // Ignored - } - return nil; -} - -+ (id)standardLoggerWithStderr { - // Don't trust NSFileHandle not to throw - @try { - id me = [self standardLogger]; - [me setWriter:[NSFileHandle fileHandleWithStandardError]]; - return me; - } - @catch (id e) { - // Ignored - } - return nil; -} - -+ (id)standardLoggerWithStdoutAndStderr { - // We're going to take advantage of the GTMLogger to GTMLogWriter adaptor - // and create a composite logger that an outer "standard" logger can use - // as a writer. Our inner loggers should apply no formatting since the main - // logger does that and we want the caller to be able to change formatters - // or add writers without knowing the inner structure of our composite. - - // Don't trust NSFileHandle not to throw - @try { - GTMLogBasicFormatter *formatter = [[[GTMLogBasicFormatter alloc] init] - autorelease]; - GTMLogger *stdoutLogger = - [self loggerWithWriter:[NSFileHandle fileHandleWithStandardOutput] - formatter:formatter - filter:[[[GTMLogMaximumLevelFilter alloc] - initWithMaximumLevel:kGTMLoggerLevelInfo] - autorelease]]; - GTMLogger *stderrLogger = - [self loggerWithWriter:[NSFileHandle fileHandleWithStandardError] - formatter:formatter - filter:[[[GTMLogMininumLevelFilter alloc] - initWithMinimumLevel:kGTMLoggerLevelError] - autorelease]]; - GTMLogger *compositeWriter = - [self loggerWithWriter:[NSArray arrayWithObjects: - stdoutLogger, stderrLogger, nil] - formatter:formatter - filter:[[[GTMLogNoFilter alloc] init] autorelease]]; - GTMLogger *outerLogger = [self standardLogger]; - [outerLogger setWriter:compositeWriter]; - return outerLogger; - } - @catch (id e) { - // Ignored - } - return nil; -} - -+ (id)standardLoggerWithPath:(NSString *)path { - @try { - NSFileHandle *fh = [NSFileHandle fileHandleForLoggingAtPath:path mode:0644]; - if (fh == nil) return nil; - id me = [self standardLogger]; - [me setWriter:fh]; - return me; - } - @catch (id e) { - // Ignored - } - return nil; -} - -+ (id)loggerWithWriter:(id)writer - formatter:(id)formatter - filter:(id)filter { - return [[[self alloc] initWithWriter:writer - formatter:formatter - filter:filter] autorelease]; -} - -+ (id)logger { - return [[[self alloc] init] autorelease]; -} - -- (id)init { - return [self initWithWriter:nil formatter:nil filter:nil]; -} - -- (id)initWithWriter:(id)writer - formatter:(id)formatter - filter:(id)filter { - if ((self = [super init])) { - [self setWriter:writer]; - [self setFormatter:formatter]; - [self setFilter:filter]; - } - return self; -} - -- (void)dealloc { - // Unlikely, but |writer_| may be an NSFileHandle, which can throw - @try { - [formatter_ release]; - [filter_ release]; - [writer_ release]; - } - @catch (id e) { - // Ignored - } - [super dealloc]; -} - -- (id)writer { - return [[writer_ retain] autorelease]; -} - -- (void)setWriter:(id)writer { - @synchronized(self) { - [writer_ autorelease]; - writer_ = nil; - if (writer == nil) { - // Try to use stdout, but don't trust NSFileHandle - @try { - writer_ = [[NSFileHandle fileHandleWithStandardOutput] retain]; - } - @catch (id e) { - // Leave |writer_| nil - } - } else { - writer_ = [writer retain]; - } - } -} - -- (id)formatter { - return [[formatter_ retain] autorelease]; -} - -- (void)setFormatter:(id)formatter { - @synchronized(self) { - [formatter_ autorelease]; - formatter_ = nil; - if (formatter == nil) { - @try { - formatter_ = [[GTMLogBasicFormatter alloc] init]; - } - @catch (id e) { - // Leave |formatter_| nil - } - } else { - formatter_ = [formatter retain]; - } - } -} - -- (id)filter { - return [[filter_ retain] autorelease]; -} - -- (void)setFilter:(id)filter { - @synchronized(self) { - [filter_ autorelease]; - filter_ = nil; - if (filter == nil) { - @try { - filter_ = [[GTMLogNoFilter alloc] init]; - } - @catch (id e) { - // Leave |filter_| nil - } - } else { - filter_ = [filter retain]; - } - } -} - -- (void)logDebug:(NSString *)fmt, ... { - va_list args; - va_start(args, fmt); - [self logInternalFunc:NULL format:fmt valist:args level:kGTMLoggerLevelDebug]; - va_end(args); -} - -- (void)logInfo:(NSString *)fmt, ... { - va_list args; - va_start(args, fmt); - [self logInternalFunc:NULL format:fmt valist:args level:kGTMLoggerLevelInfo]; - va_end(args); -} - -- (void)logError:(NSString *)fmt, ... { - va_list args; - va_start(args, fmt); - [self logInternalFunc:NULL format:fmt valist:args level:kGTMLoggerLevelError]; - va_end(args); -} - -- (void)logAssert:(NSString *)fmt, ... { - va_list args; - va_start(args, fmt); - [self logInternalFunc:NULL format:fmt valist:args level:kGTMLoggerLevelAssert]; - va_end(args); -} - -@end // GTMLogger - -@implementation GTMLogger (GTMLoggerMacroHelpers) - -- (void)logFuncDebug:(const char *)func msg:(NSString *)fmt, ... { - va_list args; - va_start(args, fmt); - [self logInternalFunc:func format:fmt valist:args level:kGTMLoggerLevelDebug]; - va_end(args); -} - -- (void)logFuncInfo:(const char *)func msg:(NSString *)fmt, ... { - va_list args; - va_start(args, fmt); - [self logInternalFunc:func format:fmt valist:args level:kGTMLoggerLevelInfo]; - va_end(args); -} - -- (void)logFuncError:(const char *)func msg:(NSString *)fmt, ... { - va_list args; - va_start(args, fmt); - [self logInternalFunc:func format:fmt valist:args level:kGTMLoggerLevelError]; - va_end(args); -} - -- (void)logFuncAssert:(const char *)func msg:(NSString *)fmt, ... { - va_list args; - va_start(args, fmt); - [self logInternalFunc:func format:fmt valist:args level:kGTMLoggerLevelAssert]; - va_end(args); -} - -@end // GTMLoggerMacroHelpers - -@implementation GTMLogger (PrivateMethods) - -- (void)logInternalFunc:(const char *)func - format:(NSString *)fmt - valist:(va_list)args - level:(GTMLoggerLevel)level { - // Primary point where logging happens, logging should never throw, catch - // everything. - @try { - NSString *fname = func ? [NSString stringWithUTF8String:func] : nil; - NSString *msg = [formatter_ stringForFunc:fname - withFormat:fmt - valist:args - level:level]; - if (msg && [filter_ filterAllowsMessage:msg level:level]) - [writer_ logMessage:msg level:level]; - } - @catch (id e) { - // Ignored - } -} - -@end // PrivateMethods - - -@implementation NSFileHandle (GTMFileHandleLogWriter) - -+ (id)fileHandleForLoggingAtPath:(NSString *)path mode:(mode_t)mode { - int fd = -1; - if (path) { - int flags = O_WRONLY | O_APPEND | O_CREAT; - fd = open([path fileSystemRepresentation], flags, mode); - } - if (fd == -1) return nil; - return [[[self alloc] initWithFileDescriptor:fd - closeOnDealloc:YES] autorelease]; -} - -- (void)logMessage:(NSString *)msg level:(GTMLoggerLevel)level { - @synchronized(self) { - // Closed pipes should not generate exceptions in our caller. Catch here - // as well [GTMLogger logInternalFunc:...] so that an exception in this - // writer does not prevent other writers from having a chance. - @try { - NSString *line = [NSString stringWithFormat:@"%@\n", msg]; - [self writeData:[line dataUsingEncoding:NSUTF8StringEncoding]]; - } - @catch (id e) { - // Ignored - } - } -} - -@end // GTMFileHandleLogWriter - - -@implementation NSArray (GTMArrayCompositeLogWriter) - -- (void)logMessage:(NSString *)msg level:(GTMLoggerLevel)level { - @synchronized(self) { - id child = nil; - GTM_FOREACH_OBJECT(child, self) { - if ([child conformsToProtocol:@protocol(GTMLogWriter)]) - [child logMessage:msg level:level]; - } - } -} - -@end // GTMArrayCompositeLogWriter - - -@implementation GTMLogger (GTMLoggerLogWriter) - -- (void)logMessage:(NSString *)msg level:(GTMLoggerLevel)level { - switch (level) { - case kGTMLoggerLevelDebug: - [self logDebug:@"%@", msg]; - break; - case kGTMLoggerLevelInfo: - [self logInfo:@"%@", msg]; - break; - case kGTMLoggerLevelError: - [self logError:@"%@", msg]; - break; - case kGTMLoggerLevelAssert: - [self logAssert:@"%@", msg]; - break; - default: - // Ignore the message. - break; - } -} - -@end // GTMLoggerLogWriter - - -@implementation GTMLogBasicFormatter - -- (NSString *)prettyNameForFunc:(NSString *)func { - NSString *name = [func stringByTrimmingCharactersInSet: - [NSCharacterSet whitespaceAndNewlineCharacterSet]]; - NSString *function = @"(unknown)"; - if ([name length]) { - if (// Objective C __func__ and __PRETTY_FUNCTION__ - [name hasPrefix:@"-["] || [name hasPrefix:@"+["] || - // C++ __PRETTY_FUNCTION__ and other preadorned formats - [name hasSuffix:@")"]) { - function = name; - } else { - // Assume C99 __func__ - function = [NSString stringWithFormat:@"%@()", name]; - } - } - return function; -} - -- (NSString *)stringForFunc:(NSString *)func - withFormat:(NSString *)fmt - valist:(va_list)args - level:(GTMLoggerLevel)level { - // Performance note: We may want to do a quick check here to see if |fmt| - // contains a '%', and if not, simply return 'fmt'. - if (!(fmt && args)) return nil; - return [[[NSString alloc] initWithFormat:fmt arguments:args] autorelease]; -} - -@end // GTMLogBasicFormatter - - -@implementation GTMLogStandardFormatter - -- (id)init { - if ((self = [super init])) { - dateFormatter_ = [[NSDateFormatter alloc] init]; - [dateFormatter_ setFormatterBehavior:NSDateFormatterBehavior10_4]; - [dateFormatter_ setDateFormat:@"yyyy-MM-dd HH:mm:ss.SSS"]; - pname_ = [[[NSProcessInfo processInfo] processName] copy]; - pid_ = [[NSProcessInfo processInfo] processIdentifier]; - if (!(dateFormatter_ && pname_)) { - [self release]; - return nil; - } - } - return self; -} - -- (void)dealloc { - [dateFormatter_ release]; - [pname_ release]; - [super dealloc]; -} - -- (NSString *)stringForFunc:(NSString *)func - withFormat:(NSString *)fmt - valist:(va_list)args - level:(GTMLoggerLevel)level { - NSString *tstamp = nil; - @synchronized (dateFormatter_) { - tstamp = [dateFormatter_ stringFromDate:[NSDate date]]; - } - return [NSString stringWithFormat:@"%@ %@[%d/%p] [lvl=%d] %@ %@", - tstamp, pname_, pid_, pthread_self(), - level, [self prettyNameForFunc:func], - // |super| has guard for nil |fmt| and |args| - [super stringForFunc:func withFormat:fmt valist:args level:level]]; -} - -@end // GTMLogStandardFormatter - - -@implementation GTMLogLevelFilter - -// Check the environment and the user preferences for the GTMVerboseLogging key -// to see if verbose logging has been enabled. The environment variable will -// override the defaults setting, so check the environment first. -// COV_NF_START -static BOOL IsVerboseLoggingEnabled(void) { - static NSString *const kVerboseLoggingKey = @"GTMVerboseLogging"; - NSString *value = [[[NSProcessInfo processInfo] environment] - objectForKey:kVerboseLoggingKey]; - if (value) { - // Emulate [NSString boolValue] for pre-10.5 - value = [value stringByTrimmingCharactersInSet: - [NSCharacterSet whitespaceAndNewlineCharacterSet]]; - if ([[value uppercaseString] hasPrefix:@"Y"] || - [[value uppercaseString] hasPrefix:@"T"] || - [value intValue]) { - return YES; - } else { - return NO; - } - } - return [[NSUserDefaults standardUserDefaults] boolForKey:kVerboseLoggingKey]; -} -// COV_NF_END - -// In DEBUG builds, log everything. If we're not in a debug build we'll assume -// that we're in a Release build. -- (BOOL)filterAllowsMessage:(NSString *)msg level:(GTMLoggerLevel)level { -#if DEBUG - return YES; -#endif - - BOOL allow = YES; - - switch (level) { - case kGTMLoggerLevelDebug: - allow = NO; - break; - case kGTMLoggerLevelInfo: - allow = IsVerboseLoggingEnabled(); - break; - case kGTMLoggerLevelError: - allow = YES; - break; - case kGTMLoggerLevelAssert: - allow = YES; - break; - default: - allow = YES; - break; - } - - return allow; -} - -@end // GTMLogLevelFilter - - -@implementation GTMLogNoFilter - -- (BOOL)filterAllowsMessage:(NSString *)msg level:(GTMLoggerLevel)level { - return YES; // Allow everything through -} - -@end // GTMLogNoFilter - - -@implementation GTMLogAllowedLevelFilter - -// Private designated initializer -- (id)initWithAllowedLevels:(NSIndexSet *)levels { - self = [super init]; - if (self != nil) { - allowedLevels_ = [levels retain]; - // Cap min/max level - if (!allowedLevels_ || - // NSIndexSet is unsigned so only check the high bound, but need to - // check both first and last index because NSIndexSet appears to allow - // wraparound. - ([allowedLevels_ firstIndex] > kGTMLoggerLevelAssert) || - ([allowedLevels_ lastIndex] > kGTMLoggerLevelAssert)) { - [self release]; - return nil; - } - } - return self; -} - -- (id)init { - // Allow all levels in default init - return [self initWithAllowedLevels:[NSIndexSet indexSetWithIndexesInRange: - NSMakeRange(kGTMLoggerLevelUnknown, - (kGTMLoggerLevelAssert - kGTMLoggerLevelUnknown + 1))]]; -} - -- (void)dealloc { - [allowedLevels_ release]; - [super dealloc]; -} - -- (BOOL)filterAllowsMessage:(NSString *)msg level:(GTMLoggerLevel)level { - return [allowedLevels_ containsIndex:level]; -} - -@end // GTMLogAllowedLevelFilter - - -@implementation GTMLogMininumLevelFilter - -- (id)initWithMinimumLevel:(GTMLoggerLevel)level { - return [super initWithAllowedLevels:[NSIndexSet indexSetWithIndexesInRange: - NSMakeRange(level, - (kGTMLoggerLevelAssert - level + 1))]]; -} - -@end // GTMLogMininumLevelFilter - - -@implementation GTMLogMaximumLevelFilter - -- (id)initWithMaximumLevel:(GTMLoggerLevel)level { - return [super initWithAllowedLevels:[NSIndexSet indexSetWithIndexesInRange: - NSMakeRange(kGTMLoggerLevelUnknown, level + 1)]]; -} - -@end // GTMLogMaximumLevelFilter - -#if !defined(__clang__) && (__GNUC__*10+__GNUC_MINOR__ >= 42) -// See comment at top of file. -#pragma GCC diagnostic error "-Wmissing-format-attribute" -#endif // !__clang__ - diff --git a/External/google-plus-ios-sdk/OpenSource/GTMMethodCheck.h b/External/google-plus-ios-sdk/OpenSource/GTMMethodCheck.h deleted file mode 100644 index 7b0919b0..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMMethodCheck.h +++ /dev/null @@ -1,88 +0,0 @@ -// -// GTMMethodCheck.h -// -// Copyright 2006-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -#import -#import -#import - -/// A macro for enforcing debug time checks to make sure all required methods are linked in -// -// When using categories, it can be very easy to forget to include the -// implementation of a category. -// Let's say you had a class foo that depended on method bar of class baz, and -// method bar was implemented as a member of a category. -// You could add the following code: -// @implementation foo -// GTM_METHOD_CHECK(baz, bar) -// @end -// and the code would check to make sure baz was implemented just before main -// was called. This works for both dynamic libraries, and executables. -// -// Classes (or one of their superclasses) being checked must conform to the -// NSObject protocol. We will check this, and spit out a warning if a class does -// not conform to NSObject. -// -// This is not compiled into release builds. - -#ifdef DEBUG - -#ifdef __cplusplus -extern "C" { -#endif - -// If you get an error for GTMMethodCheckMethodChecker not being defined, -// you need to link in GTMMethodCheck.m. We keep it hidden so that we can have -// it living in several separate images without conflict. -// Functions with the ((constructor)) attribute are called after all +loads -// have been called. See "Initializing Objective-C Classes" in -// http://developer.apple.com/documentation/DeveloperTools/Conceptual/DynamicLibraries/Articles/DynamicLibraryDesignGuidelines.html#//apple_ref/doc/uid/TP40002013-DontLinkElementID_20 - -__attribute__ ((constructor, visibility("hidden"))) void GTMMethodCheckMethodChecker(void); - -#ifdef __cplusplus -}; -#endif - -// This is the "magic". -// A) we need a multi layer define here so that the stupid preprocessor -// expands __LINE__ out the way we want it. We need LINE so that each of -// out GTM_METHOD_CHECKs generates a unique class method for the class. -#define GTM_METHOD_CHECK(class, method) GTM_METHOD_CHECK_INNER(class, method, __LINE__) -#define GTM_METHOD_CHECK_INNER(class, method, line) GTM_METHOD_CHECK_INNER_INNER(class, method, line) - -// B) Create up a class method called xxGMethodCheckMethod+class+line that the -// GTMMethodCheckMethodChecker function can look for and call. We -// look for GTMMethodCheckMethodChecker to enforce linkage of -// GTMMethodCheck.m. -#define GTM_METHOD_CHECK_INNER_INNER(class, method, line) \ -+ (void)xxGTMMethodCheckMethod ## class ## line { \ - void (*addr)() = GTMMethodCheckMethodChecker; \ - if (addr && ![class instancesRespondToSelector:@selector(method)] \ - && ![class respondsToSelector:@selector(method)]) { \ - fprintf(stderr, "%s:%d: error: We need method '%s' to be linked in for class '%s'\n", \ - __FILE__, line, #method, #class); \ - exit(EX_SOFTWARE); \ - } \ -} - -#else // !DEBUG - -// Do nothing in release. -#define GTM_METHOD_CHECK(class, method) - -#endif // DEBUG diff --git a/External/google-plus-ios-sdk/OpenSource/GTMMethodCheck.m b/External/google-plus-ios-sdk/OpenSource/GTMMethodCheck.m deleted file mode 100644 index 650d255f..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMMethodCheck.m +++ /dev/null @@ -1,174 +0,0 @@ -// -// GTMMethodCheck.m -// -// Copyright 2006-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -// Don't want any of this in release builds -#ifdef DEBUG -#import "GTMDefines.h" -#import "GTMMethodCheck.h" -#import "GTMObjC2Runtime.h" -#import - -// Checks to see if the cls passed in (or one of it's superclasses) conforms -// to NSObject protocol. Inheriting from NSObject is the easiest way to do this -// but not all classes (i.e. NSProxy) inherit from NSObject. Also, some classes -// inherit from Object instead of NSObject which is fine, and we'll count as -// conforming to NSObject for our needs. -static BOOL ConformsToNSObjectProtocol(Class cls) { - // If we get nil, obviously doesn't conform. - if (!cls) return NO; - const char *className = class_getName(cls); - if (!className) return NO; - - // We're going to assume that all Apple classes will work - // (and aren't being checked) - // Note to apple: why doesn't obj-c have real namespaces instead of two - // letter hacks? If you name your own classes starting with NS this won't - // work for you. - // Some classes (like _NSZombie) start with _NS. - // On Leopard we have to look for CFObject as well. - // On iPhone we check Object as well - if ((strncmp(className, "NS", 2) == 0) - || (strncmp(className, "_NS", 3) == 0) - || (strncmp(className, "__NS", 4) == 0) - || (strcmp(className, "CFObject") == 0) - || (strcmp(className, "__IncompleteProtocol") == 0) - || (strcmp(className, "__ARCLite__") == 0) - || (strcmp(className, "WebMIMETypeRegistry") == 0) -#if GTM_IPHONE_SDK - || (strcmp(className, "Object") == 0) - || (strcmp(className, "UIKeyboardCandidateUtilities") == 0) -#endif - ) { - return YES; - } - - // iPhone and Mac OS X 10.8 with Obj-C 2 SDKs do not define the |Object| - // class, so we instead test for the |NSObject| class. -#if GTM_IPHONE_SDK || \ - (__OBJC2__ && defined(MAC_OS_X_VERSION_10_8) && \ - MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8) - // Iterate through all the protocols |cls| supports looking for NSObject. - if (cls == [NSObject class] - || class_conformsToProtocol(cls, @protocol(NSObject))) { - return YES; - } -#else - // Iterate through all the protocols |cls| supports looking for NSObject. - if (cls == [Object class] - || class_conformsToProtocol(cls, @protocol(NSObject))) { - return YES; - } -#endif - - // Recursively check the superclasses. - return ConformsToNSObjectProtocol(class_getSuperclass(cls)); -} - -void GTMMethodCheckMethodChecker(void) { - // Run through all the classes looking for class methods that are - // prefixed with xxGMMethodCheckMethod. If it finds one, it calls it. - // See GTMMethodCheck.h to see what it does. -#if !defined(__has_feature) || !__has_feature(objc_arc) - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; -#else - @autoreleasepool { -#endif - int numClasses = 0; - int newNumClasses = objc_getClassList(NULL, 0); - int i; - Class *classes = NULL; - while (numClasses < newNumClasses) { - numClasses = newNumClasses; - classes = (Class *)realloc(classes, sizeof(Class) * numClasses); - _GTMDevAssert(classes, @"Unable to allocate memory for classes"); - newNumClasses = objc_getClassList(classes, numClasses); - } - for (i = 0; i < numClasses && classes; ++i) { - Class cls = classes[i]; - - // Since we are directly calling objc_msgSend, we need to conform to - // @protocol(NSObject), or else we will tumble into a _objc_msgForward - // recursive loop when we try and call a function by name. - if (!ConformsToNSObjectProtocol(cls)) { - // COV_NF_START - _GTMDevLog(@"GTMMethodCheckMethodChecker: Class %s does not conform to " - "@protocol(NSObject), so won't be checked", - class_getName(cls)); - continue; - // COV_NF_END - } - // Since we are looking for a class method (+xxGMMethodCheckMethod...) - // we need to query the isa pointer to see what methods it support, but - // send the method (if it's supported) to the class itself. - unsigned int count; - Class metaClass = objc_getMetaClass(class_getName(cls)); - Method *methods = class_copyMethodList(metaClass, &count); - unsigned int j; - for (j = 0; j < count; ++j) { - SEL selector = method_getName(methods[j]); - const char *name = sel_getName(selector); - if (strstr(name, "xxGTMMethodCheckMethod") == name) { - // Check to make sure that the method we are checking comes - // from the same image that we are in. Since GTMMethodCheckMethodChecker - // is not exported, we should always find the copy in our local - // image. We compare the address of it's image with the address of - // the image which implements the method we want to check. If - // they match we continue. This does two things: - // a) minimizes the amount of calls we make to the xxxGTMMethodCheck - // methods. They should only be called once. - // b) prevents initializers for various classes being called too early - Dl_info methodCheckerInfo; - if (!dladdr(GTMMethodCheckMethodChecker, - &methodCheckerInfo)) { - // COV_NF_START - // Don't know how to force this case in a unittest. - // Certainly hope we never see it. - _GTMDevLog(@"GTMMethodCheckMethodChecker: Unable to get dladdr info " - "for GTMMethodCheckMethodChecker while introspecting +[%s %s]]", - class_getName(cls), name); - continue; - // COV_NF_END - } - Dl_info methodInfo; - if (!dladdr(method_getImplementation(methods[j]), - &methodInfo)) { - // COV_NF_START - // Don't know how to force this case in a unittest - // Certainly hope we never see it. - _GTMDevLog(@"GTMMethodCheckMethodChecker: Unable to get dladdr info " - "for %s while introspecting +[%s %s]]", name, - class_getName(cls), name); - continue; - // COV_NF_END - } - if (methodCheckerInfo.dli_fbase == methodInfo.dli_fbase) { - objc_msgSend(cls, selector); - } - } - } - free(methods); - } - free(classes); -#if !defined(__has_feature) || !__has_feature(objc_arc) - [pool drain]; -#else - } // @autoreleasepool -#endif -} - -#endif // DEBUG diff --git a/External/google-plus-ios-sdk/OpenSource/GTMNSDictionary+URLArguments.h b/External/google-plus-ios-sdk/OpenSource/GTMNSDictionary+URLArguments.h deleted file mode 100644 index b0944111..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMNSDictionary+URLArguments.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// GTMNSDictionary+URLArguments.h -// -// Copyright 2006-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -#import - -/// Utility for building a URL or POST argument string. -@interface NSDictionary (GTMNSDictionaryURLArgumentsAdditions) - -/// Returns a dictionary of the decoded key-value pairs in a http arguments -/// string of the form key1=value1&key2=value2&...&keyN=valueN. -/// Keys and values will be unescaped automatically. -/// Only the first value for a repeated key is returned. -+ (NSDictionary *)gtm_dictionaryWithHttpArgumentsString:(NSString *)argString; - -/// Gets a string representation of the dictionary in the form -/// key1=value1&key2=value2&...&keyN=valueN, suitable for use as either -/// URL arguments (after a '?') or POST body. Keys and values will be escaped -/// automatically, so should be unescaped in the dictionary. -- (NSString *)gtm_httpArgumentsString; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTMNSDictionary+URLArguments.m b/External/google-plus-ios-sdk/OpenSource/GTMNSDictionary+URLArguments.m deleted file mode 100644 index 4799b2de..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMNSDictionary+URLArguments.m +++ /dev/null @@ -1,71 +0,0 @@ -// -// GTMNSDictionary+URLArguments.m -// -// Copyright 2006-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -#import "GTMNSDictionary+URLArguments.h" -#import "GTMNSString+URLArguments.h" -#import "GTMMethodCheck.h" -#import "GTMDefines.h" - -@implementation NSDictionary (GTMNSDictionaryURLArgumentsAdditions) - -GTM_METHOD_CHECK(NSString, gtm_stringByEscapingForURLArgument); -GTM_METHOD_CHECK(NSString, gtm_stringByUnescapingFromURLArgument); - -+ (NSDictionary *)gtm_dictionaryWithHttpArgumentsString:(NSString *)argString { - NSMutableDictionary* ret = [NSMutableDictionary dictionary]; - NSArray* components = [argString componentsSeparatedByString:@"&"]; - NSString* component; - // Use reverse order so that the first occurrence of a key replaces - // those subsequent. - GTM_FOREACH_ENUMEREE(component, [components reverseObjectEnumerator]) { - if ([component length] == 0) - continue; - NSRange pos = [component rangeOfString:@"="]; - NSString *key; - NSString *val; - if (pos.location == NSNotFound) { - key = [component gtm_stringByUnescapingFromURLArgument]; - val = @""; - } else { - key = [[component substringToIndex:pos.location] - gtm_stringByUnescapingFromURLArgument]; - val = [[component substringFromIndex:pos.location + pos.length] - gtm_stringByUnescapingFromURLArgument]; - } - // gtm_stringByUnescapingFromURLArgument returns nil on invalid UTF8 - // and NSMutableDictionary raises an exception when passed nil values. - if (!key) key = @""; - if (!val) val = @""; - [ret setObject:val forKey:key]; - } - return ret; -} - -- (NSString *)gtm_httpArgumentsString { - NSMutableArray* arguments = [NSMutableArray arrayWithCapacity:[self count]]; - NSString* key; - GTM_FOREACH_KEY(key, self) { - [arguments addObject:[NSString stringWithFormat:@"%@=%@", - [key gtm_stringByEscapingForURLArgument], - [[[self objectForKey:key] description] gtm_stringByEscapingForURLArgument]]]; - } - - return [arguments componentsJoinedByString:@"&"]; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTMNSString+URLArguments.h b/External/google-plus-ios-sdk/OpenSource/GTMNSString+URLArguments.h deleted file mode 100644 index d4c7e09a..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMNSString+URLArguments.h +++ /dev/null @@ -1,41 +0,0 @@ -// -// GTMNSString+URLArguments.h -// -// Copyright 2006-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -#import - -/// Utilities for encoding and decoding URL arguments. -@interface NSString (GTMNSStringURLArgumentsAdditions) - -/// Returns a string that is escaped properly to be a URL argument. -// -/// This differs from stringByAddingPercentEscapesUsingEncoding: in that it -/// will escape all the reserved characters (per RFC 3986 -/// ) which -/// stringByAddingPercentEscapesUsingEncoding would leave. -/// -/// This will also escape '%', so this should not be used on a string that has -/// already been escaped unless double-escaping is the desired result. -- (NSString*)gtm_stringByEscapingForURLArgument; - -/// Returns the unescaped version of a URL argument -// -/// This has the same behavior as stringByReplacingPercentEscapesUsingEncoding:, -/// except that it will also convert '+' to space. -- (NSString*)gtm_stringByUnescapingFromURLArgument; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTMNSString+URLArguments.m b/External/google-plus-ios-sdk/OpenSource/GTMNSString+URLArguments.m deleted file mode 100644 index 46d2c99e..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMNSString+URLArguments.m +++ /dev/null @@ -1,45 +0,0 @@ -// -// GTMNSString+URLArguments.m -// -// Copyright 2006-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -#import "GTMNSString+URLArguments.h" -#import "GTMGarbageCollection.h" - -@implementation NSString (GTMNSStringURLArgumentsAdditions) - -- (NSString*)gtm_stringByEscapingForURLArgument { - // Encode all the reserved characters, per RFC 3986 - // () - CFStringRef escaped = - CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, - (CFStringRef)self, - NULL, - (CFStringRef)@"!*'();:@&=+$,/?%#[]", - kCFStringEncodingUTF8); - return GTMCFAutorelease(escaped); -} - -- (NSString*)gtm_stringByUnescapingFromURLArgument { - NSMutableString *resultString = [NSMutableString stringWithString:self]; - [resultString replaceOccurrencesOfString:@"+" - withString:@" " - options:NSLiteralSearch - range:NSMakeRange(0, [resultString length])]; - return [resultString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; -} - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/GTMOAuth2Authentication.h b/External/google-plus-ios-sdk/OpenSource/GTMOAuth2Authentication.h deleted file mode 100644 index 8703164b..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMOAuth2Authentication.h +++ /dev/null @@ -1,356 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES - -// This class implements the OAuth 2 protocol for authorizing requests. -// http://tools.ietf.org/html/draft-ietf-oauth-v2 - -#import - -// GTMHTTPFetcher.h brings in GTLDefines/GDataDefines -#import "GTMHTTPFetcher.h" - -#undef _EXTERN -#undef _INITIALIZE_AS -#ifdef GTMOAUTH2AUTHENTICATION_DEFINE_GLOBALS - #define _EXTERN - #define _INITIALIZE_AS(x) =x -#else - #if defined(__cplusplus) - #define _EXTERN extern "C" - #else - #define _EXTERN extern - #endif - #define _INITIALIZE_AS(x) -#endif - -// Until all OAuth 2 providers are up to the same spec, we'll provide a crude -// way here to override the "Bearer" string in the Authorization header -#ifndef GTM_OAUTH2_BEARER -#define GTM_OAUTH2_BEARER "Bearer" -#endif - -// Service provider name allows stored authorization to be associated with -// the authorizing service -_EXTERN NSString* const kGTMOAuth2ServiceProviderGoogle _INITIALIZE_AS(@"Google"); - -// -// GTMOAuth2SignIn constants, included here for use by clients -// -_EXTERN NSString* const kGTMOAuth2ErrorDomain _INITIALIZE_AS(@"com.google.GTMOAuth2"); - -// Error userInfo keys -_EXTERN NSString* const kGTMOAuth2ErrorMessageKey _INITIALIZE_AS(@"error"); -_EXTERN NSString* const kGTMOAuth2ErrorRequestKey _INITIALIZE_AS(@"request"); -_EXTERN NSString* const kGTMOAuth2ErrorJSONKey _INITIALIZE_AS(@"json"); - -enum { - // Error code indicating that the window was prematurely closed - kGTMOAuth2ErrorWindowClosed = -1000, - kGTMOAuth2ErrorAuthorizationFailed = -1001, - kGTMOAuth2ErrorTokenExpired = -1002, - kGTMOAuth2ErrorTokenUnavailable = -1003, - kGTMOAuth2ErrorUnauthorizableRequest = -1004 -}; - - -// Notifications for token fetches -_EXTERN NSString* const kGTMOAuth2FetchStarted _INITIALIZE_AS(@"kGTMOAuth2FetchStarted"); -_EXTERN NSString* const kGTMOAuth2FetchStopped _INITIALIZE_AS(@"kGTMOAuth2FetchStopped"); - -_EXTERN NSString* const kGTMOAuth2FetcherKey _INITIALIZE_AS(@"fetcher"); -_EXTERN NSString* const kGTMOAuth2FetchTypeKey _INITIALIZE_AS(@"FetchType"); -_EXTERN NSString* const kGTMOAuth2FetchTypeToken _INITIALIZE_AS(@"token"); -_EXTERN NSString* const kGTMOAuth2FetchTypeRefresh _INITIALIZE_AS(@"refresh"); -_EXTERN NSString* const kGTMOAuth2FetchTypeAssertion _INITIALIZE_AS(@"assertion"); -_EXTERN NSString* const kGTMOAuth2FetchTypeUserInfo _INITIALIZE_AS(@"userInfo"); - -// Token-issuance errors -_EXTERN NSString* const kGTMOAuth2ErrorKey _INITIALIZE_AS(@"error"); -_EXTERN NSString* const kGTMOAuth2ErrorObjectKey _INITIALIZE_AS(@"kGTMOAuth2ErrorObjectKey"); - -_EXTERN NSString* const kGTMOAuth2ErrorInvalidRequest _INITIALIZE_AS(@"invalid_request"); -_EXTERN NSString* const kGTMOAuth2ErrorInvalidClient _INITIALIZE_AS(@"invalid_client"); -_EXTERN NSString* const kGTMOAuth2ErrorInvalidGrant _INITIALIZE_AS(@"invalid_grant"); -_EXTERN NSString* const kGTMOAuth2ErrorUnauthorizedClient _INITIALIZE_AS(@"unauthorized_client"); -_EXTERN NSString* const kGTMOAuth2ErrorUnsupportedGrantType _INITIALIZE_AS(@"unsupported_grant_type"); -_EXTERN NSString* const kGTMOAuth2ErrorInvalidScope _INITIALIZE_AS(@"invalid_scope"); - -// Notification that sign-in has completed, and token fetches will begin (useful -// for displaying interstitial messages after the window has closed) -_EXTERN NSString* const kGTMOAuth2UserSignedIn _INITIALIZE_AS(@"kGTMOAuth2UserSignedIn"); - -// Notification for token changes -_EXTERN NSString* const kGTMOAuth2AccessTokenRefreshed _INITIALIZE_AS(@"kGTMOAuth2AccessTokenRefreshed"); -_EXTERN NSString* const kGTMOAuth2RefreshTokenChanged _INITIALIZE_AS(@"kGTMOAuth2RefreshTokenChanged"); -_EXTERN NSString* const kGTMOAuth2AccessTokenRefreshFailed _INITIALIZE_AS(@"kGTMOAuth2AccessTokenRefreshFailed"); - -// Notification for WebView loading -_EXTERN NSString* const kGTMOAuth2WebViewStartedLoading _INITIALIZE_AS(@"kGTMOAuth2WebViewStartedLoading"); -_EXTERN NSString* const kGTMOAuth2WebViewStoppedLoading _INITIALIZE_AS(@"kGTMOAuth2WebViewStoppedLoading"); -_EXTERN NSString* const kGTMOAuth2WebViewKey _INITIALIZE_AS(@"kGTMOAuth2WebViewKey"); -_EXTERN NSString* const kGTMOAuth2WebViewStopKindKey _INITIALIZE_AS(@"kGTMOAuth2WebViewStopKindKey"); -_EXTERN NSString* const kGTMOAuth2WebViewFinished _INITIALIZE_AS(@"finished"); -_EXTERN NSString* const kGTMOAuth2WebViewFailed _INITIALIZE_AS(@"failed"); -_EXTERN NSString* const kGTMOAuth2WebViewCancelled _INITIALIZE_AS(@"cancelled"); - -// Notification for network loss during html sign-in display -_EXTERN NSString* const kGTMOAuth2NetworkLost _INITIALIZE_AS(@"kGTMOAuthNetworkLost"); -_EXTERN NSString* const kGTMOAuth2NetworkFound _INITIALIZE_AS(@"kGTMOAuthNetworkFound"); - -@interface GTMOAuth2Authentication : NSObject { - @private - NSString *clientID_; - NSString *clientSecret_; - NSString *redirectURI_; - NSMutableDictionary *parameters_; - - // authorization parameters - NSURL *tokenURL_; - NSDate *expirationDate_; - - NSString *authorizationTokenKey_; - - NSDictionary *additionalTokenRequestParameters_; - NSDictionary *additionalGrantTypeRequestParameters_; - - // queue of requests for authorization waiting for a valid access token - GTMHTTPFetcher *refreshFetcher_; - NSMutableArray *authorizationQueue_; - - id fetcherService_; // WEAK - - Class parserClass_; - - BOOL shouldAuthorizeAllRequests_; - - // arbitrary data retained for the user - id userData_; - NSMutableDictionary *properties_; -} - -// OAuth2 standard protocol parameters -// -// These should be the plain strings; any needed escaping will be provided by -// the library. - -// Request properties -@property (copy) NSString *clientID; -@property (copy) NSString *clientSecret; -@property (copy) NSString *redirectURI; -@property (retain) NSString *scope; -@property (retain) NSString *tokenType; -@property (retain) NSString *assertion; -@property (retain) NSString *refreshScope; - -// Apps may optionally add parameters here to be provided to the token -// endpoint on token requests and refreshes. -@property (retain) NSDictionary *additionalTokenRequestParameters; - -// Apps may optionally add parameters here to be provided to the token -// endpoint on specific token requests and refreshes, keyed by the grant_type. -// For example, if a different "type" parameter is required for obtaining -// the auth code and on refresh, this might be: -// -// viewController.authentication.additionalGrantTypeRequestParameters = @{ -// @"authorization_code" : @{ @"type" : @"code" }, -// @"refresh_token" : @{ @"type" : @"refresh" } -// }; -@property (retain) NSDictionary *additionalGrantTypeRequestParameters; - -// Response properties -@property (retain) NSMutableDictionary *parameters; - -@property (retain) NSString *accessToken; -@property (retain) NSString *refreshToken; -@property (retain) NSNumber *expiresIn; -@property (retain) NSString *code; -@property (retain) NSString *errorString; - -// URL for obtaining access tokens -@property (copy) NSURL *tokenURL; - -// Calculated expiration date (expiresIn seconds added to the -// time the access token was received.) -@property (copy) NSDate *expirationDate; - -// Service identifier, like "Google"; not used for authentication -// -// The provider name is just for allowing stored authorization to be associated -// with the authorizing service. -@property (copy) NSString *serviceProvider; - -// User ID; not used for authentication -@property (retain) NSString *userID; - -// User email and verified status; not used for authentication -// -// The verified string can be checked with -boolValue. If the result is false, -// then the email address is listed with the account on the server, but the -// address has not been confirmed as belonging to the owner of the account. -@property (retain) NSString *userEmail; -@property (retain) NSString *userEmailIsVerified; - -// Property indicating if this auth has a refresh or access token so is suitable -// for authorizing a request. This does not guarantee that the token is valid. -@property (readonly) BOOL canAuthorize; - -// Property indicating if this object will authorize plain http request -// (as well as any non-https requests.) Default is NO, only requests with the -// scheme https are authorized, since security may be compromised if tokens -// are sent over the wire using an unencrypted protocol like http. -@property (assign) BOOL shouldAuthorizeAllRequests; - -// userData is retained for the convenience of the caller -@property (retain) id userData; - -// Stored property values are retained for the convenience of the caller -@property (retain) NSDictionary *properties; - -// Property for the optional fetcher service instance to be used to create -// fetchers -// -// Fetcher service objects retain authorizations, so this is weak to avoid -// circular retains. -@property (assign) id fetcherService; // WEAK - -// Alternative JSON parsing class; this should implement the -// GTMOAuth2ParserClass informal protocol. If this property is -// not set, the class SBJSON must be available in the runtime. -@property (assign) Class parserClass; - -// Key for the response parameter used for the authorization header; by default, -// "access_token" is used, but some servers may expect alternatives, like -// "id_token". -@property (copy) NSString *authorizationTokenKey; - -// Convenience method for creating an authentication object -+ (id)authenticationWithServiceProvider:(NSString *)serviceProvider - tokenURL:(NSURL *)tokenURL - redirectURI:(NSString *)redirectURI - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret; - -// Clear out any authentication values, prepare for a new request fetch -- (void)reset; - -// Main authorization entry points -// -// These will refresh the access token, if necessary, add the access token to -// the request, then invoke the callback. -// -// The request argument may be nil to just force a refresh of the access token, -// if needed. -// -// NOTE: To avoid accidental leaks of bearer tokens, the request must -// be for a URL with the scheme https unless the shouldAuthorizeAllRequests -// property is set. - -// The finish selector should have a signature matching -// - (void)authentication:(GTMOAuth2Authentication *)auth -// request:(NSMutableURLRequest *)request -// finishedWithError:(NSError *)error; - -- (void)authorizeRequest:(NSMutableURLRequest *)request - delegate:(id)delegate - didFinishSelector:(SEL)sel; - -#if NS_BLOCKS_AVAILABLE -- (void)authorizeRequest:(NSMutableURLRequest *)request - completionHandler:(void (^)(NSError *error))handler; -#endif - -// Synchronous entry point; authorizing this way cannot refresh an expired -// access token -- (BOOL)authorizeRequest:(NSMutableURLRequest *)request; - -// If the authentication is waiting for a refresh to complete, spin the run -// loop, discarding events, until the fetch has completed -// -// This is only for use in testing or in tools without a user interface. -- (void)waitForCompletionWithTimeout:(NSTimeInterval)timeoutInSeconds; - - -////////////////////////////////////////////////////////////////////////////// -// -// Internal properties and methods for use by GTMOAuth2SignIn -// - -// Pending fetcher to get a new access token, if any -@property (retain) GTMHTTPFetcher *refreshFetcher; - -// Check if a request is queued up to be authorized -- (BOOL)isAuthorizingRequest:(NSURLRequest *)request; - -// Check if a request appears to be authorized -- (BOOL)isAuthorizedRequest:(NSURLRequest *)request; - -// Stop any pending refresh fetch. This will also cancel the authorization -// for all fetch requests pending authorization. -- (void)stopAuthorization; - -// Prevents authorization callback for a given request. -- (void)stopAuthorizationForRequest:(NSURLRequest *)request; - -// OAuth fetch user-agent header value -- (NSString *)userAgent; - -// Parse and set token and token secret from response data -- (void)setKeysForResponseString:(NSString *)str; -- (void)setKeysForResponseDictionary:(NSDictionary *)dict; - -// Persistent token string for keychain storage -// -// We'll use the format "refresh_token=foo&serviceProvider=bar" so we can -// easily alter what portions of the auth data are stored -// -// Use these methods for serialization -- (NSString *)persistenceResponseString; -- (void)setKeysForPersistenceResponseString:(NSString *)str; - -// method to begin fetching an access token, used by the sign-in object -- (GTMHTTPFetcher *)beginTokenFetchWithDelegate:(id)delegate - didFinishSelector:(SEL)finishedSel; - -// Entry point to post a notification about a fetcher currently used for -// obtaining or refreshing a token; the sign-in object will also use this -// to indicate when the user's email address is being fetched. -// -// Fetch type constants are above under "notifications for token fetches" -- (void)notifyFetchIsRunning:(BOOL)isStarting - fetcher:(GTMHTTPFetcher *)fetcher - type:(NSString *)fetchType; - -// Arbitrary key-value properties retained for the user -- (void)setProperty:(id)obj forKey:(NSString *)key; -- (id)propertyForKey:(NSString *)key; - -// -// Utilities -// - -+ (NSString *)encodedOAuthValueForString:(NSString *)str; - -+ (NSString *)encodedQueryParametersForDictionary:(NSDictionary *)dict; - -+ (NSDictionary *)dictionaryWithResponseString:(NSString *)responseStr; - -+ (NSDictionary *)dictionaryWithJSONData:(NSData *)data; - -+ (NSString *)scopeWithStrings:(NSString *)firsStr, ... NS_REQUIRES_NIL_TERMINATION; -@end - -#endif // GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES diff --git a/External/google-plus-ios-sdk/OpenSource/GTMOAuth2Authentication.m b/External/google-plus-ios-sdk/OpenSource/GTMOAuth2Authentication.m deleted file mode 100644 index 7f2b0a21..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMOAuth2Authentication.m +++ /dev/null @@ -1,1275 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES - -#define GTMOAUTH2AUTHENTICATION_DEFINE_GLOBALS 1 -#import "GTMOAuth2Authentication.h" - -// standard OAuth keys -static NSString *const kOAuth2AccessTokenKey = @"access_token"; -static NSString *const kOAuth2RefreshTokenKey = @"refresh_token"; -static NSString *const kOAuth2ClientIDKey = @"client_id"; -static NSString *const kOAuth2ClientSecretKey = @"client_secret"; -static NSString *const kOAuth2RedirectURIKey = @"redirect_uri"; -static NSString *const kOAuth2ResponseTypeKey = @"response_type"; -static NSString *const kOAuth2ScopeKey = @"scope"; -static NSString *const kOAuth2ErrorKey = @"error"; -static NSString *const kOAuth2TokenTypeKey = @"token_type"; -static NSString *const kOAuth2ExpiresInKey = @"expires_in"; -static NSString *const kOAuth2CodeKey = @"code"; -static NSString *const kOAuth2AssertionKey = @"assertion"; -static NSString *const kOAuth2RefreshScopeKey = @"refreshScope"; - -// additional persistent keys -static NSString *const kServiceProviderKey = @"serviceProvider"; -static NSString *const kUserIDKey = @"userID"; -static NSString *const kUserEmailKey = @"email"; -static NSString *const kUserEmailIsVerifiedKey = @"isVerified"; - -// fetcher keys -static NSString *const kTokenFetchDelegateKey = @"delegate"; -static NSString *const kTokenFetchSelectorKey = @"sel"; - -static NSString *const kRefreshFetchArgsKey = @"requestArgs"; - -// If GTMNSJSONSerialization is available, it is used for formatting JSON -#if (TARGET_OS_MAC && !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED < 1070)) || \ - (TARGET_OS_IPHONE && (__IPHONE_OS_VERSION_MAX_ALLOWED < 50000)) -@interface GTMNSJSONSerialization : NSObject -+ (id)JSONObjectWithData:(NSData *)data options:(NSUInteger)opt error:(NSError **)error; -@end -#endif - -@interface GTMOAuth2ParserClass : NSObject -// just enough of SBJSON to be able to parse -- (id)objectWithString:(NSString*)repr error:(NSError**)error; -@end - -// wrapper class for requests needing authorization and their callbacks -@interface GTMOAuth2AuthorizationArgs : NSObject { - @private - NSMutableURLRequest *request_; - id delegate_; - SEL sel_; - id completionHandler_; - NSThread *thread_; - NSError *error_; -} - -@property (retain) NSMutableURLRequest *request; -@property (retain) id delegate; -@property (assign) SEL selector; -@property (copy) id completionHandler; -@property (retain) NSThread *thread; -@property (retain) NSError *error; - -+ (GTMOAuth2AuthorizationArgs *)argsWithRequest:(NSMutableURLRequest *)req - delegate:(id)delegate - selector:(SEL)sel - completionHandler:(id)completionHandler - thread:(NSThread *)thread; -@end - -@implementation GTMOAuth2AuthorizationArgs - -@synthesize request = request_, - delegate = delegate_, - selector = sel_, - completionHandler = completionHandler_, - thread = thread_, - error = error_; - -+ (GTMOAuth2AuthorizationArgs *)argsWithRequest:(NSMutableURLRequest *)req - delegate:(id)delegate - selector:(SEL)sel - completionHandler:(id)completionHandler - thread:(NSThread *)thread { - GTMOAuth2AuthorizationArgs *obj; - obj = [[[GTMOAuth2AuthorizationArgs alloc] init] autorelease]; - obj.request = req; - obj.delegate = delegate; - obj.selector = sel; - obj.completionHandler = completionHandler; - obj.thread = thread; - return obj; -} - -- (void)dealloc { - [request_ release]; - [delegate_ release]; - [completionHandler_ release]; - [thread_ release]; - [error_ release]; - - [super dealloc]; -} -@end - - -@interface GTMOAuth2Authentication () - -@property (retain) NSMutableArray *authorizationQueue; -@property (readonly) NSString *authorizationToken; - -- (void)setKeysForResponseJSONData:(NSData *)data; - -- (BOOL)authorizeRequestArgs:(GTMOAuth2AuthorizationArgs *)args; - -- (BOOL)authorizeRequestImmediateArgs:(GTMOAuth2AuthorizationArgs *)args; - -- (BOOL)shouldRefreshAccessToken; - -- (void)updateExpirationDate; - -- (void)tokenFetcher:(GTMHTTPFetcher *)fetcher - finishedWithData:(NSData *)data - error:(NSError *)error; - -- (void)auth:(GTMOAuth2Authentication *)auth -finishedRefreshWithFetcher:(GTMHTTPFetcher *)fetcher - error:(NSError *)error; - -- (void)invokeCallbackArgs:(GTMOAuth2AuthorizationArgs *)args; - -+ (void)invokeDelegate:(id)delegate - selector:(SEL)sel - object:(id)obj1 - object:(id)obj2 - object:(id)obj3; - -+ (NSString *)unencodedOAuthParameterForString:(NSString *)str; -+ (NSString *)encodedQueryParametersForDictionary:(NSDictionary *)dict; - -+ (NSDictionary *)dictionaryWithResponseData:(NSData *)data; - -@end - -@implementation GTMOAuth2Authentication - -@synthesize clientID = clientID_, - clientSecret = clientSecret_, - redirectURI = redirectURI_, - parameters = parameters_, - authorizationTokenKey = authorizationTokenKey_, - tokenURL = tokenURL_, - expirationDate = expirationDate_, - additionalTokenRequestParameters = additionalTokenRequestParameters_, - additionalGrantTypeRequestParameters = additionalGrantTypeRequestParameters_, - refreshFetcher = refreshFetcher_, - fetcherService = fetcherService_, - parserClass = parserClass_, - shouldAuthorizeAllRequests = shouldAuthorizeAllRequests_, - userData = userData_, - properties = properties_, - authorizationQueue = authorizationQueue_; - -// Response parameters -@dynamic accessToken, - refreshToken, - code, - assertion, - refreshScope, - errorString, - tokenType, - scope, - expiresIn, - serviceProvider, - userEmail, - userEmailIsVerified; - -@dynamic canAuthorize; - -+ (id)authenticationWithServiceProvider:(NSString *)serviceProvider - tokenURL:(NSURL *)tokenURL - redirectURI:(NSString *)redirectURI - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret { - GTMOAuth2Authentication *obj = [[[self alloc] init] autorelease]; - obj.serviceProvider = serviceProvider; - obj.tokenURL = tokenURL; - obj.redirectURI = redirectURI; - obj.clientID = clientID; - obj.clientSecret = clientSecret; - return obj; -} - -- (id)init { - self = [super init]; - if (self) { - authorizationQueue_ = [[NSMutableArray alloc] init]; - parameters_ = [[NSMutableDictionary alloc] init]; - } - return self; -} - -- (NSString *)description { - NSArray *props = [NSArray arrayWithObjects:@"accessToken", @"refreshToken", - @"code", @"assertion", @"expirationDate", @"errorString", - nil]; - NSMutableString *valuesStr = [NSMutableString string]; - NSString *separator = @""; - for (NSString *prop in props) { - id result = [self valueForKey:prop]; - if (result) { - [valuesStr appendFormat:@"%@%@=\"%@\"", separator, prop, result]; - separator = @", "; - } - } - - return [NSString stringWithFormat:@"%@ %p: {%@}", - [self class], self, valuesStr]; -} - -- (void)dealloc { - [clientID_ release]; - [clientSecret_ release]; - [redirectURI_ release]; - [parameters_ release]; - [authorizationTokenKey_ release]; - [tokenURL_ release]; - [expirationDate_ release]; - [additionalTokenRequestParameters_ release]; - [additionalGrantTypeRequestParameters_ release]; - [refreshFetcher_ release]; - [authorizationQueue_ release]; - [userData_ release]; - [properties_ release]; - - [super dealloc]; -} - -#pragma mark - - -- (void)setKeysForResponseDictionary:(NSDictionary *)dict { - if (dict == nil) return; - - // If a new code or access token is being set, remove the old expiration - NSString *newCode = [dict objectForKey:kOAuth2CodeKey]; - NSString *newAccessToken = [dict objectForKey:kOAuth2AccessTokenKey]; - if (newCode || newAccessToken) { - self.expiresIn = nil; - } - - BOOL didRefreshTokenChange = NO; - NSString *refreshToken = [dict objectForKey:kOAuth2RefreshTokenKey]; - if (refreshToken) { - NSString *priorRefreshToken = self.refreshToken; - - if (priorRefreshToken != refreshToken - && (priorRefreshToken == nil - || ![priorRefreshToken isEqual:refreshToken])) { - didRefreshTokenChange = YES; - } - } - - [self.parameters addEntriesFromDictionary:dict]; - [self updateExpirationDate]; - - if (didRefreshTokenChange) { - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc postNotificationName:kGTMOAuth2RefreshTokenChanged - object:self - userInfo:nil]; - } - // NSLog(@"keys set ----------------------------\n%@", dict); -} - -- (void)setKeysForResponseString:(NSString *)str { - NSDictionary *dict = [[self class] dictionaryWithResponseString:str]; - [self setKeysForResponseDictionary:dict]; -} - -- (void)setKeysForResponseJSONData:(NSData *)data { - NSDictionary *dict = [[self class] dictionaryWithJSONData:data]; - [self setKeysForResponseDictionary:dict]; -} - -+ (NSDictionary *)dictionaryWithJSONData:(NSData *)data { - NSMutableDictionary *obj = nil; - NSError *error = nil; - - Class serializer = NSClassFromString(@"NSJSONSerialization"); - if (serializer) { - const NSUInteger kOpts = (1UL << 0); // NSJSONReadingMutableContainers - obj = [serializer JSONObjectWithData:data - options:kOpts - error:&error]; -#if DEBUG - if (error) { - NSString *str = [[[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding] autorelease]; - NSLog(@"NSJSONSerialization error %@ parsing %@", - error, str); - } -#endif - return obj; - } else { - // try SBJsonParser or SBJSON - Class jsonParseClass = NSClassFromString(@"SBJsonParser"); - if (!jsonParseClass) { - jsonParseClass = NSClassFromString(@"SBJSON"); - } - if (jsonParseClass) { - GTMOAuth2ParserClass *parser = [[[jsonParseClass alloc] init] autorelease]; - NSString *jsonStr = [[[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding] autorelease]; - if (jsonStr) { - obj = [parser objectWithString:jsonStr error:&error]; -#if DEBUG - if (error) { - NSLog(@"%@ error %@ parsing %@", NSStringFromClass(jsonParseClass), - error, jsonStr); - } -#endif - return obj; - } - } else { -#if DEBUG - NSAssert(0, @"GTMOAuth2Authentication: No parser available"); -#endif - } - } - return nil; -} - -#pragma mark Authorizing Requests - -// General entry point for authorizing requests - -#if NS_BLOCKS_AVAILABLE -// Authorizing with a completion block -- (void)authorizeRequest:(NSMutableURLRequest *)request - completionHandler:(void (^)(NSError *error))handler { - - GTMOAuth2AuthorizationArgs *args; - args = [GTMOAuth2AuthorizationArgs argsWithRequest:request - delegate:nil - selector:NULL - completionHandler:handler - thread:[NSThread currentThread]]; - [self authorizeRequestArgs:args]; -} -#endif - -// Authorizing with a callback selector -// -// Selector has the signature -// - (void)authentication:(GTMOAuth2Authentication *)auth -// request:(NSMutableURLRequest *)request -// finishedWithError:(NSError *)error; -- (void)authorizeRequest:(NSMutableURLRequest *)request - delegate:(id)delegate - didFinishSelector:(SEL)sel { - GTMAssertSelectorNilOrImplementedWithArgs(delegate, sel, - @encode(GTMOAuth2Authentication *), - @encode(NSMutableURLRequest *), - @encode(NSError *), 0); - - GTMOAuth2AuthorizationArgs *args; - args = [GTMOAuth2AuthorizationArgs argsWithRequest:request - delegate:delegate - selector:sel - completionHandler:nil - thread:[NSThread currentThread]]; - [self authorizeRequestArgs:args]; -} - -// Internal routine common to delegate and block invocations -- (BOOL)authorizeRequestArgs:(GTMOAuth2AuthorizationArgs *)args { - BOOL didAttempt = NO; - - @synchronized(authorizationQueue_) { - - BOOL shouldRefresh = [self shouldRefreshAccessToken]; - - if (shouldRefresh) { - // attempt to refresh now; once we have a fresh access token, we will - // authorize the request and call back to the user - didAttempt = YES; - - if (self.refreshFetcher == nil) { - // there's not already a refresh pending - SEL finishedSel = @selector(auth:finishedRefreshWithFetcher:error:); - self.refreshFetcher = [self beginTokenFetchWithDelegate:self - didFinishSelector:finishedSel]; - if (self.refreshFetcher) { - [authorizationQueue_ addObject:args]; - } - } else { - // there's already a refresh pending - [authorizationQueue_ addObject:args]; - } - } - - if (!shouldRefresh || self.refreshFetcher == nil) { - // we're not fetching a new access token, so we can authorize the request - // now - didAttempt = [self authorizeRequestImmediateArgs:args]; - } - } - return didAttempt; -} - -- (void)auth:(GTMOAuth2Authentication *)auth -finishedRefreshWithFetcher:(GTMHTTPFetcher *)fetcher - error:(NSError *)error { - @synchronized(authorizationQueue_) { - // If there's an error, we want to try using the old access token anyway, - // in case it's a backend problem preventing refresh, in which case - // access tokens past their expiration date may still work - - self.refreshFetcher = nil; - - // Swap in a new auth queue in case the callbacks try to immediately auth - // another request - NSArray *pendingAuthQueue = [NSArray arrayWithArray:authorizationQueue_]; - [authorizationQueue_ removeAllObjects]; - - BOOL hasAccessToken = ([self.accessToken length] > 0); - - NSString *noteName; - NSDictionary *userInfo = nil; - if (hasAccessToken && error == nil) { - // Successful refresh. - noteName = kGTMOAuth2AccessTokenRefreshed; - userInfo = nil; - } else { - // Google's OAuth 2 implementation returns a 400 with JSON body - // containing error key "invalid_grant" to indicate the refresh token - // is invalid or has been revoked by the user. We'll promote the - // JSON error key's value for easy inspection by the observer. - noteName = kGTMOAuth2AccessTokenRefreshFailed; - NSString *jsonErr = nil; - if ([error code] == kGTMHTTPFetcherStatusBadRequest) { - NSDictionary *json = [[error userInfo] objectForKey:kGTMOAuth2ErrorJSONKey]; - jsonErr = [json objectForKey:kGTMOAuth2ErrorMessageKey]; - } - // error and jsonErr may be nil - userInfo = [NSMutableDictionary dictionary]; - [userInfo setValue:error forKey:kGTMOAuth2ErrorObjectKey]; - [userInfo setValue:jsonErr forKey:kGTMOAuth2ErrorMessageKey]; - } - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc postNotificationName:noteName - object:self - userInfo:userInfo]; - - for (GTMOAuth2AuthorizationArgs *args in pendingAuthQueue) { - if (!hasAccessToken && args.error == nil) { - args.error = error; - } - - [self authorizeRequestImmediateArgs:args]; - } - } -} - -- (BOOL)isAuthorizingRequest:(NSURLRequest *)request { - BOOL wasFound = NO; - @synchronized(authorizationQueue_) { - for (GTMOAuth2AuthorizationArgs *args in authorizationQueue_) { - if ([args request] == request) { - wasFound = YES; - break; - } - } - } - return wasFound; -} - -- (BOOL)isAuthorizedRequest:(NSURLRequest *)request { - NSString *authStr = [request valueForHTTPHeaderField:@"Authorization"]; - return ([authStr length] > 0); -} - -- (void)stopAuthorization { - @synchronized(authorizationQueue_) { - [authorizationQueue_ removeAllObjects]; - - [self.refreshFetcher stopFetching]; - self.refreshFetcher = nil; - } -} - -- (void)stopAuthorizationForRequest:(NSURLRequest *)request { - @synchronized(authorizationQueue_) { - NSUInteger argIndex = 0; - BOOL found = NO; - for (GTMOAuth2AuthorizationArgs *args in authorizationQueue_) { - if ([args request] == request) { - found = YES; - break; - } - argIndex++; - } - - if (found) { - [authorizationQueue_ removeObjectAtIndex:argIndex]; - - // If the queue is now empty, go ahead and stop the fetcher. - if ([authorizationQueue_ count] == 0) { - [self stopAuthorization]; - } - } - } -} - -- (BOOL)authorizeRequestImmediateArgs:(GTMOAuth2AuthorizationArgs *)args { - // This authorization entry point never attempts to refresh the access token, - // but does call the completion routine - - NSMutableURLRequest *request = args.request; - - NSString *scheme = [[request URL] scheme]; - BOOL isAuthorizableRequest = self.shouldAuthorizeAllRequests - || [scheme caseInsensitiveCompare:@"https"] == NSOrderedSame; - if (!isAuthorizableRequest) { - // Request is not https, so may be insecure - // - // The NSError will be created below -#if DEBUG - NSLog(@"Cannot authorize request with scheme %@ (%@)", scheme, request); -#endif - } - - // Get the access token. - NSString *accessToken = self.authorizationToken; - if (isAuthorizableRequest && [accessToken length] > 0) { - if (request) { - // we have a likely valid access token - NSString *value = [NSString stringWithFormat:@"%s %@", - GTM_OAUTH2_BEARER, accessToken]; - [request setValue:value forHTTPHeaderField:@"Authorization"]; - } - - // We've authorized the request, even if the previous refresh - // failed with an error - args.error = nil; - } else if (args.error == nil) { - NSDictionary *userInfo = nil; - if (request) { - userInfo = [NSDictionary dictionaryWithObject:request - forKey:kGTMOAuth2ErrorRequestKey]; - } - NSInteger code = (isAuthorizableRequest ? - kGTMOAuth2ErrorAuthorizationFailed : - kGTMOAuth2ErrorUnauthorizableRequest); - args.error = [NSError errorWithDomain:kGTMOAuth2ErrorDomain - code:code - userInfo:userInfo]; - } - - // Invoke any callbacks on the proper thread - if (args.delegate || args.completionHandler) { - NSThread *targetThread = args.thread; - BOOL isSameThread = [targetThread isEqual:[NSThread currentThread]]; - - if (isSameThread) { - [self invokeCallbackArgs:args]; - } else { - SEL sel = @selector(invokeCallbackArgs:); - NSOperationQueue *delegateQueue = self.fetcherService.delegateQueue; - if (delegateQueue) { - NSInvocationOperation *op; - op = [[[NSInvocationOperation alloc] initWithTarget:self - selector:sel - object:args] autorelease]; - [delegateQueue addOperation:op]; - } else { - [self performSelector:sel - onThread:targetThread - withObject:args - waitUntilDone:NO]; - } - } - } - - BOOL didAuth = (args.error == nil); - return didAuth; -} - -- (void)invokeCallbackArgs:(GTMOAuth2AuthorizationArgs *)args { - // Invoke the callbacks - NSError *error = args.error; - - id delegate = args.delegate; - SEL sel = args.selector; - if (delegate && sel) { - NSMutableURLRequest *request = args.request; - - NSMethodSignature *sig = [delegate methodSignatureForSelector:sel]; - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig]; - [invocation setSelector:sel]; - [invocation setTarget:delegate]; - [invocation setArgument:&self atIndex:2]; - [invocation setArgument:&request atIndex:3]; - [invocation setArgument:&error atIndex:4]; - [invocation invoke]; - } - -#if NS_BLOCKS_AVAILABLE - id handler = args.completionHandler; - if (handler) { - void (^authCompletionBlock)(NSError *) = handler; - authCompletionBlock(error); - } -#endif -} - -- (BOOL)authorizeRequest:(NSMutableURLRequest *)request { - // Entry point for synchronous authorization mechanisms - GTMOAuth2AuthorizationArgs *args; - args = [GTMOAuth2AuthorizationArgs argsWithRequest:request - delegate:nil - selector:NULL - completionHandler:nil - thread:[NSThread currentThread]]; - return [self authorizeRequestImmediateArgs:args]; -} - -- (BOOL)canAuthorize { - NSString *token = self.refreshToken; - if (token == nil) { - // For services which do not support refresh tokens, we'll just check - // the access token. - token = self.authorizationToken; - } - BOOL canAuth = [token length] > 0; - return canAuth; -} - -- (BOOL)shouldRefreshAccessToken { - // We should refresh the access token when it's missing or nearly expired - // and we have a refresh token - BOOL shouldRefresh = NO; - NSString *accessToken = self.accessToken; - NSString *refreshToken = self.refreshToken; - NSString *assertion = self.assertion; - NSString *code = self.code; - - BOOL hasRefreshToken = ([refreshToken length] > 0); - BOOL hasAccessToken = ([accessToken length] > 0); - BOOL hasAssertion = ([assertion length] > 0); - BOOL hasCode = ([code length] > 0); - - // Determine if we need to refresh the access token - if (hasRefreshToken || hasAssertion || hasCode) { - if (!hasAccessToken) { - shouldRefresh = YES; - } else { - // We'll consider the token expired if it expires 60 seconds from now - // or earlier - NSDate *expirationDate = self.expirationDate; - NSTimeInterval timeToExpire = [expirationDate timeIntervalSinceNow]; - if (expirationDate == nil || timeToExpire < 60.0) { - // access token has expired, or will in a few seconds - shouldRefresh = YES; - } - } - } - return shouldRefresh; -} - -- (void)waitForCompletionWithTimeout:(NSTimeInterval)timeoutInSeconds { - // If there is a refresh fetcher pending, wait for it. - // - // This is only intended for unit test or for use in command-line tools. - GTMHTTPFetcher *fetcher = self.refreshFetcher; - [fetcher waitForCompletionWithTimeout:timeoutInSeconds]; -} - -#pragma mark Token Fetch - -- (NSString *)userAgent { - NSBundle *bundle = [NSBundle mainBundle]; - NSString *appID = [bundle bundleIdentifier]; - - NSString *version = [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; - if (version == nil) { - version = [bundle objectForInfoDictionaryKey:@"CFBundleVersion"]; - } - - if (appID && version) { - appID = [appID stringByAppendingFormat:@"/%@", version]; - } - - NSString *userAgent = @"gtm-oauth2"; - if (appID) { - userAgent = [userAgent stringByAppendingFormat:@" %@", appID]; - } - return userAgent; -} - -- (GTMHTTPFetcher *)beginTokenFetchWithDelegate:(id)delegate - didFinishSelector:(SEL)finishedSel { - - NSMutableDictionary *paramsDict = [NSMutableDictionary dictionary]; - - NSString *fetchType; - - NSString *refreshToken = self.refreshToken; - NSString *code = self.code; - NSString *assertion = self.assertion; - NSString *grantType = nil; - - if (refreshToken) { - // We have a refresh token - grantType = @"refresh_token"; - [paramsDict setObject:refreshToken forKey:@"refresh_token"]; - - NSString *refreshScope = self.refreshScope; - if ([refreshScope length] > 0) { - [paramsDict setObject:refreshScope forKey:@"scope"]; - } - - fetchType = kGTMOAuth2FetchTypeRefresh; - } else if (code) { - // We have a code string - grantType = @"authorization_code"; - [paramsDict setObject:code forKey:@"code"]; - - NSString *redirectURI = self.redirectURI; - if ([redirectURI length] > 0) { - [paramsDict setObject:redirectURI forKey:@"redirect_uri"]; - } - - NSString *scope = self.scope; - if ([scope length] > 0) { - [paramsDict setObject:scope forKey:@"scope"]; - } - - fetchType = kGTMOAuth2FetchTypeToken; - } else if (assertion) { - // We have an assertion string - grantType = @"http://oauth.net/grant_type/jwt/1.0/bearer"; - [paramsDict setObject:assertion forKey:@"assertion"]; - fetchType = kGTMOAuth2FetchTypeAssertion; - } else { -#if DEBUG - NSAssert(0, @"unexpected lack of code or refresh token for fetching"); -#endif - return nil; - } - [paramsDict setObject:grantType forKey:@"grant_type"]; - - NSString *clientID = self.clientID; - if ([clientID length] > 0) { - [paramsDict setObject:clientID forKey:@"client_id"]; - } - - NSString *clientSecret = self.clientSecret; - if ([clientSecret length] > 0) { - [paramsDict setObject:clientSecret forKey:@"client_secret"]; - } - - NSDictionary *additionalParams = self.additionalTokenRequestParameters; - if (additionalParams) { - [paramsDict addEntriesFromDictionary:additionalParams]; - } - NSDictionary *grantTypeParams = - [self.additionalGrantTypeRequestParameters objectForKey:grantType]; - if (grantTypeParams) { - [paramsDict addEntriesFromDictionary:grantTypeParams]; - } - - NSString *paramStr = [[self class] encodedQueryParametersForDictionary:paramsDict]; - NSData *paramData = [paramStr dataUsingEncoding:NSUTF8StringEncoding]; - - NSURL *tokenURL = self.tokenURL; - - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:tokenURL]; - [request setValue:@"application/x-www-form-urlencoded" - forHTTPHeaderField:@"Content-Type"]; - - NSString *userAgent = [self userAgent]; - [request setValue:userAgent forHTTPHeaderField:@"User-Agent"]; - - GTMHTTPFetcher *fetcher; - id fetcherService = self.fetcherService; - if (fetcherService) { - fetcher = [fetcherService fetcherWithRequest:request]; - - // Don't use an authorizer for an auth token fetch - fetcher.authorizer = nil; - } else { - fetcher = [GTMHTTPFetcher fetcherWithRequest:request]; - } - - NSString *const template = (refreshToken ? @"refresh token for %@" : @"fetch tokens for %@"); - [fetcher setCommentWithFormat:template, [tokenURL host]]; - fetcher.postData = paramData; - fetcher.retryEnabled = YES; - fetcher.maxRetryInterval = 15.0; - - // Fetcher properties will retain the delegate - [fetcher setProperty:delegate forKey:kTokenFetchDelegateKey]; - if (finishedSel) { - NSString *selStr = NSStringFromSelector(finishedSel); - [fetcher setProperty:selStr forKey:kTokenFetchSelectorKey]; - } - - if ([fetcher beginFetchWithDelegate:self - didFinishSelector:@selector(tokenFetcher:finishedWithData:error:)]) { - // Fetch began - [self notifyFetchIsRunning:YES fetcher:fetcher type:fetchType]; - return fetcher; - } else { - // Failed to start fetching; typically a URL issue - NSError *error = [NSError errorWithDomain:kGTMHTTPFetcherStatusDomain - code:-1 - userInfo:nil]; - [[self class] invokeDelegate:delegate - selector:finishedSel - object:self - object:nil - object:error]; - return nil; - } -} - -- (void)tokenFetcher:(GTMHTTPFetcher *)fetcher - finishedWithData:(NSData *)data - error:(NSError *)error { - [self notifyFetchIsRunning:NO fetcher:fetcher type:nil]; - - NSDictionary *responseHeaders = [fetcher responseHeaders]; - NSString *responseType = [responseHeaders valueForKey:@"Content-Type"]; - BOOL isResponseJSON = [responseType hasPrefix:@"application/json"]; - BOOL hasData = ([data length] > 0); - - if (error) { - // Failed. If the error body is JSON, parse it and add it to the error's - // userInfo dictionary. - if (hasData) { - if (isResponseJSON) { - NSDictionary *errorJson = [[self class] dictionaryWithJSONData:data]; - if ([errorJson count] > 0) { -#if DEBUG - NSLog(@"Error %@\nError data:\n%@", error, errorJson); -#endif - // Add the JSON error body to the userInfo of the error - NSMutableDictionary *userInfo; - userInfo = [NSMutableDictionary dictionaryWithObject:errorJson - forKey:kGTMOAuth2ErrorJSONKey]; - NSDictionary *prevUserInfo = [error userInfo]; - if (prevUserInfo) { - [userInfo addEntriesFromDictionary:prevUserInfo]; - } - error = [NSError errorWithDomain:[error domain] - code:[error code] - userInfo:userInfo]; - } - } - } - } else { - // Succeeded; we have the requested token. -#if DEBUG - NSAssert(hasData, @"data missing in token response"); -#endif - - if (hasData) { - if (isResponseJSON) { - [self setKeysForResponseJSONData:data]; - } else { - // Support for legacy token servers that return form-urlencoded data - NSString *dataStr = [[[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding] autorelease]; - [self setKeysForResponseString:dataStr]; - } - -#if DEBUG - // Watch for token exchanges that return a non-bearer or unlabeled token - NSString *tokenType = [self tokenType]; - if (tokenType == nil - || [tokenType caseInsensitiveCompare:@"bearer"] != NSOrderedSame) { - NSLog(@"GTMOAuth2: Unexpected token type: %@", tokenType); - } -#endif - } - } - - id delegate = [fetcher propertyForKey:kTokenFetchDelegateKey]; - SEL sel = NULL; - NSString *selStr = [fetcher propertyForKey:kTokenFetchSelectorKey]; - if (selStr) sel = NSSelectorFromString(selStr); - - [[self class] invokeDelegate:delegate - selector:sel - object:self - object:fetcher - object:error]; - - // Prevent a circular reference from retaining the delegate - [fetcher setProperty:nil forKey:kTokenFetchDelegateKey]; -} - -#pragma mark Fetch Notifications - -- (void)notifyFetchIsRunning:(BOOL)isStarting - fetcher:(GTMHTTPFetcher *)fetcher - type:(NSString *)fetchType { - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - - NSString *name = (isStarting ? kGTMOAuth2FetchStarted : kGTMOAuth2FetchStopped); - NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: - fetcher, kGTMOAuth2FetcherKey, - fetchType, kGTMOAuth2FetchTypeKey, // fetchType may be nil - nil]; - [nc postNotificationName:name - object:self - userInfo:dict]; -} - -#pragma mark Persistent Response Strings - -- (void)setKeysForPersistenceResponseString:(NSString *)str { - // All persistence keys can be set directly as if returned by a server - [self setKeysForResponseString:str]; -} - -// This returns a "response string" that can be passed later to -// setKeysForResponseString: to reuse an old access token in a new auth object -- (NSString *)persistenceResponseString { - NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:4]; - - NSString *refreshToken = self.refreshToken; - NSString *accessToken = nil; - if (refreshToken == nil) { - // We store the access token only for services that do not support refresh - // tokens; otherwise, we assume the access token is too perishable to - // be worth storing - accessToken = self.accessToken; - } - - // Any nil values will not set a dictionary entry - [dict setValue:refreshToken forKey:kOAuth2RefreshTokenKey]; - [dict setValue:accessToken forKey:kOAuth2AccessTokenKey]; - [dict setValue:self.serviceProvider forKey:kServiceProviderKey]; - [dict setValue:self.userID forKey:kUserIDKey]; - [dict setValue:self.userEmail forKey:kUserEmailKey]; - [dict setValue:self.userEmailIsVerified forKey:kUserEmailIsVerifiedKey]; - [dict setValue:self.scope forKey:kOAuth2ScopeKey]; - - NSString *result = [[self class] encodedQueryParametersForDictionary:dict]; - return result; -} - -- (BOOL)primeForRefresh { - if (self.refreshToken == nil) { - // Cannot refresh without a refresh token - return NO; - } - self.accessToken = nil; - self.expiresIn = nil; - self.expirationDate = nil; - self.errorString = nil; - return YES; -} - -- (void)reset { - // Reset all per-authorization values - self.code = nil; - self.accessToken = nil; - self.refreshToken = nil; - self.assertion = nil; - self.expiresIn = nil; - self.errorString = nil; - self.expirationDate = nil; - self.userEmail = nil; - self.userEmailIsVerified = nil; - self.authorizationTokenKey = nil; -} - -#pragma mark Accessors for Response Parameters - -- (NSString *)authorizationToken { - // The token used for authorization is typically the access token unless - // the user has specified that an alternative parameter be used. - NSString *authorizationToken; - NSString *authTokenKey = self.authorizationTokenKey; - if (authTokenKey != nil) { - authorizationToken = [self.parameters objectForKey:authTokenKey]; - } else { - authorizationToken = self.accessToken; - } - return authorizationToken; -} - -- (NSString *)accessToken { - return [self.parameters objectForKey:kOAuth2AccessTokenKey]; -} - -- (void)setAccessToken:(NSString *)str { - [self.parameters setValue:str forKey:kOAuth2AccessTokenKey]; -} - -- (NSString *)refreshToken { - return [self.parameters objectForKey:kOAuth2RefreshTokenKey]; -} - -- (void)setRefreshToken:(NSString *)str { - [self.parameters setValue:str forKey:kOAuth2RefreshTokenKey]; -} - -- (NSString *)code { - return [self.parameters objectForKey:kOAuth2CodeKey]; -} - -- (void)setCode:(NSString *)str { - [self.parameters setValue:str forKey:kOAuth2CodeKey]; -} - -- (NSString *)assertion { - return [self.parameters objectForKey:kOAuth2AssertionKey]; -} - -- (void)setAssertion:(NSString *)str { - [self.parameters setValue:str forKey:kOAuth2AssertionKey]; -} - -- (NSString *)refreshScope { - return [self.parameters objectForKey:kOAuth2RefreshScopeKey]; -} - -- (void)setRefreshScope:(NSString *)str { - [self.parameters setValue:str forKey:kOAuth2RefreshScopeKey]; -} - -- (NSString *)errorString { - return [self.parameters objectForKey:kOAuth2ErrorKey]; -} - -- (void)setErrorString:(NSString *)str { - [self.parameters setValue:str forKey:kOAuth2ErrorKey]; -} - -- (NSString *)tokenType { - return [self.parameters objectForKey:kOAuth2TokenTypeKey]; -} - -- (void)setTokenType:(NSString *)str { - [self.parameters setValue:str forKey:kOAuth2TokenTypeKey]; -} - -- (NSString *)scope { - return [self.parameters objectForKey:kOAuth2ScopeKey]; -} - -- (void)setScope:(NSString *)str { - [self.parameters setValue:str forKey:kOAuth2ScopeKey]; -} - -- (NSNumber *)expiresIn { - return [self.parameters objectForKey:kOAuth2ExpiresInKey]; -} - -- (void)setExpiresIn:(NSNumber *)num { - [self.parameters setValue:num forKey:kOAuth2ExpiresInKey]; - [self updateExpirationDate]; -} - -- (void)updateExpirationDate { - // Update our absolute expiration time to something close to when - // the server expects the expiration - NSDate *date = nil; - NSNumber *expiresIn = self.expiresIn; - if (expiresIn) { - unsigned long deltaSeconds = [expiresIn unsignedLongValue]; - if (deltaSeconds > 0) { - date = [NSDate dateWithTimeIntervalSinceNow:deltaSeconds]; - } - } - self.expirationDate = date; -} - -// -// Keys custom to this class, not part of OAuth 2 -// - -- (NSString *)serviceProvider { - return [self.parameters objectForKey:kServiceProviderKey]; -} - -- (void)setServiceProvider:(NSString *)str { - [self.parameters setValue:str forKey:kServiceProviderKey]; -} - -- (NSString *)userID { - return [self.parameters objectForKey:kUserIDKey]; -} - -- (void)setUserID:(NSString *)str { - [self.parameters setValue:str forKey:kUserIDKey]; -} - -- (NSString *)userEmail { - return [self.parameters objectForKey:kUserEmailKey]; -} - -- (void)setUserEmail:(NSString *)str { - [self.parameters setValue:str forKey:kUserEmailKey]; -} - -- (NSString *)userEmailIsVerified { - return [self.parameters objectForKey:kUserEmailIsVerifiedKey]; -} - -- (void)setUserEmailIsVerified:(NSString *)str { - [self.parameters setValue:str forKey:kUserEmailIsVerifiedKey]; -} - -#pragma mark User Properties - -- (void)setProperty:(id)obj forKey:(NSString *)key { - if (obj == nil) { - // User passed in nil, so delete the property - [properties_ removeObjectForKey:key]; - } else { - // Be sure the property dictionary exists - if (properties_ == nil) { - [self setProperties:[NSMutableDictionary dictionary]]; - } - [properties_ setObject:obj forKey:key]; - } -} - -- (id)propertyForKey:(NSString *)key { - id obj = [properties_ objectForKey:key]; - - // Be sure the returned pointer has the life of the autorelease pool, - // in case self is released immediately - return [[obj retain] autorelease]; -} - -#pragma mark Utility Routines - -+ (NSString *)encodedOAuthValueForString:(NSString *)str { - CFStringRef originalString = (CFStringRef) str; - CFStringRef leaveUnescaped = NULL; - CFStringRef forceEscaped = CFSTR("!*'();:@&=+$,/?%#[]"); - - CFStringRef escapedStr = NULL; - if (str) { - escapedStr = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, - originalString, - leaveUnescaped, - forceEscaped, - kCFStringEncodingUTF8); - [(id)CFMakeCollectable(escapedStr) autorelease]; - } - - return (NSString *)escapedStr; -} - -+ (NSString *)encodedQueryParametersForDictionary:(NSDictionary *)dict { - // Make a string like "cat=fluffy@dog=spot" - NSMutableString *result = [NSMutableString string]; - NSArray *sortedKeys = [[dict allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; - NSString *joiner = @""; - for (NSString *key in sortedKeys) { - NSString *value = [dict objectForKey:key]; - NSString *encodedValue = [self encodedOAuthValueForString:value]; - NSString *encodedKey = [self encodedOAuthValueForString:key]; - [result appendFormat:@"%@%@=%@", joiner, encodedKey, encodedValue]; - joiner = @"&"; - } - return result; -} - -+ (void)invokeDelegate:(id)delegate - selector:(SEL)sel - object:(id)obj1 - object:(id)obj2 - object:(id)obj3 { - if (delegate && sel) { - NSMethodSignature *sig = [delegate methodSignatureForSelector:sel]; - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig]; - [invocation setSelector:sel]; - [invocation setTarget:delegate]; - [invocation setArgument:&obj1 atIndex:2]; - [invocation setArgument:&obj2 atIndex:3]; - [invocation setArgument:&obj3 atIndex:4]; - [invocation invoke]; - } -} - -+ (NSString *)unencodedOAuthParameterForString:(NSString *)str { - NSString *plainStr = [str stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - return plainStr; -} - -+ (NSDictionary *)dictionaryWithResponseString:(NSString *)responseStr { - // Build a dictionary from a response string of the form - // "cat=fluffy&dog=spot". Missing or empty values are considered - // empty strings; keys and values are percent-decoded. - if (responseStr == nil) return nil; - - NSArray *items = [responseStr componentsSeparatedByString:@"&"]; - - NSMutableDictionary *responseDict = [NSMutableDictionary dictionaryWithCapacity:[items count]]; - - for (NSString *item in items) { - NSString *key = nil; - NSString *value = @""; - - NSRange equalsRange = [item rangeOfString:@"="]; - if (equalsRange.location != NSNotFound) { - // The parameter has at least one '=' - key = [item substringToIndex:equalsRange.location]; - - // There are characters after the '=' - value = [item substringFromIndex:(equalsRange.location + 1)]; - } else { - // The parameter has no '=' - key = item; - } - - NSString *plainKey = [[self class] unencodedOAuthParameterForString:key]; - NSString *plainValue = [[self class] unencodedOAuthParameterForString:value]; - - [responseDict setObject:plainValue forKey:plainKey]; - } - - return responseDict; -} - -+ (NSDictionary *)dictionaryWithResponseData:(NSData *)data { - NSString *responseStr = [[[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding] autorelease]; - NSDictionary *dict = [self dictionaryWithResponseString:responseStr]; - return dict; -} - -+ (NSString *)scopeWithStrings:(NSString *)str, ... { - // concatenate the strings, joined by a single space - NSString *result = @""; - NSString *joiner = @""; - if (str) { - va_list argList; - va_start(argList, str); - while (str) { - result = [result stringByAppendingFormat:@"%@%@", joiner, str]; - joiner = @" "; - str = va_arg(argList, id); - } - va_end(argList); - } - return result; -} - -@end - -#endif // GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES diff --git a/External/google-plus-ios-sdk/OpenSource/GTMOAuth2SignIn.h b/External/google-plus-ios-sdk/OpenSource/GTMOAuth2SignIn.h deleted file mode 100644 index ded279bd..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMOAuth2SignIn.h +++ /dev/null @@ -1,187 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// This sign-in object opens and closes the web view window as needed for -// users to sign in. For signing in to Google, it also obtains -// the authenticated user's email address. -// -// Typically, this will be managed for the application by -// GTMOAuth2ViewControllerTouch or GTMOAuth2WindowController, so this -// class's interface is interesting only if -// you are creating your own window controller for sign-in. -// -// -// Delegate methods implemented by the window controller -// -// The window controller implements two methods for use by the sign-in object, -// the webRequestSelector and the finishedSelector: -// -// webRequestSelector has a signature matching -// - (void)signIn:(GTMOAuth2SignIn *)signIn displayRequest:(NSURLRequest *)request -// -// The web request selector will be invoked with a request to be displayed, or -// nil to close the window when the final callback request has been encountered. -// -// -// finishedSelector has a signature matching -// - (void)signin:(GTMOAuth2SignIn *)signin finishedWithAuth:(GTMOAuth2Authentication *)auth error:(NSError *)error -// -// The finished selector will be invoked when sign-in has completed, except -// when explicitly canceled by calling cancelSigningIn -// - -#if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES - -#import -#import - -// GTMHTTPFetcher brings in GTLDefines/GDataDefines -#import "GTMHTTPFetcher.h" - -#import "GTMOAuth2Authentication.h" - -@interface GTMOAuth2SignIn : NSObject { - @private - GTMOAuth2Authentication *auth_; - - // the endpoint for displaying the sign-in page - NSURL *authorizationURL_; - NSDictionary *additionalAuthorizationParameters_; - - id delegate_; - SEL webRequestSelector_; - SEL finishedSelector_; - - BOOL hasHandledCallback_; - - GTMHTTPFetcher *pendingFetcher_; - -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT - BOOL shouldFetchGoogleUserEmail_; - BOOL shouldFetchGoogleUserProfile_; - NSDictionary *userProfile_; -#endif - - SCNetworkReachabilityRef reachabilityRef_; - NSTimer *networkLossTimer_; - NSTimeInterval networkLossTimeoutInterval_; - BOOL hasNotifiedNetworkLoss_; - - id userData_; -} - -@property (nonatomic, retain) GTMOAuth2Authentication *authentication; - -@property (nonatomic, retain) NSURL *authorizationURL; -@property (nonatomic, retain) NSDictionary *additionalAuthorizationParameters; - -// The delegate is released when signing in finishes or is cancelled -@property (nonatomic, retain) id delegate; -@property (nonatomic, assign) SEL webRequestSelector; -@property (nonatomic, assign) SEL finishedSelector; - -@property (nonatomic, retain) id userData; - -// By default, signing in to Google will fetch the user's email, but will not -// fetch the user's profile. -// -// The email is saved in the auth object. -// The profile is available immediately after sign-in. -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -@property (nonatomic, assign) BOOL shouldFetchGoogleUserEmail; -@property (nonatomic, assign) BOOL shouldFetchGoogleUserProfile; -@property (nonatomic, retain, readonly) NSDictionary *userProfile; -#endif - -// The default timeout for an unreachable network during display of the -// sign-in page is 30 seconds; set this to 0 to have no timeout -@property (nonatomic, assign) NSTimeInterval networkLossTimeoutInterval; - -// The delegate is retained until sign-in has completed or been canceled -// -// designated initializer -- (id)initWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - delegate:(id)delegate - webRequestSelector:(SEL)webRequestSelector - finishedSelector:(SEL)finishedSelector; - -// A default authentication object for signing in to Google services -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (GTMOAuth2Authentication *)standardGoogleAuthenticationForScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret; -#endif - -#pragma mark Methods used by the Window Controller - -// Start the sequence of fetches and sign-in window display for sign-in -- (BOOL)startSigningIn; - -// Stop any pending fetches, and close the window (but don't call the -// delegate's finishedSelector) -- (void)cancelSigningIn; - -// Window controllers must tell the sign-in object about any redirect -// requested by the web view, and any changes in the webview window title -// -// If these return YES then the event was handled by the -// sign-in object (typically by closing the window) and should be ignored by -// the window controller's web view - -- (BOOL)requestRedirectedToRequest:(NSURLRequest *)redirectedRequest; -- (BOOL)titleChanged:(NSString *)title; -- (BOOL)cookiesChanged:(NSHTTPCookieStorage *)cookieStorage; -- (BOOL)loadFailedWithError:(NSError *)error; - -// Window controllers must tell the sign-in object if the window was closed -// prematurely by the user (but not by the sign-in object); this calls the -// delegate's finishedSelector -- (void)windowWasClosed; - -// Start the sequences for signing in with an authorization code. The -// authentication must contain an authorization code, otherwise the process -// will fail. -- (void)authCodeObtained; - -#pragma mark - - -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -// Revocation of an authorized token from Google -+ (void)revokeTokenForGoogleAuthentication:(GTMOAuth2Authentication *)auth; - -// Create a fetcher for obtaining the user's Google email address or profile, -// according to the current auth scopes. -// -// The auth object must have been created with appropriate scopes. -// -// The fetcher's response data can be parsed with NSJSONSerialization. -+ (GTMHTTPFetcher *)userInfoFetcherWithAuth:(GTMOAuth2Authentication *)auth; -#endif - -#pragma mark - - -// Standard authentication values -+ (NSString *)nativeClientRedirectURI; -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (NSURL *)googleAuthorizationURL; -+ (NSURL *)googleTokenURL; -+ (NSURL *)googleUserInfoURL; -#endif - -@end - -#endif // #if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES diff --git a/External/google-plus-ios-sdk/OpenSource/GTMOAuth2SignIn.m b/External/google-plus-ios-sdk/OpenSource/GTMOAuth2SignIn.m deleted file mode 100644 index 215f719e..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMOAuth2SignIn.m +++ /dev/null @@ -1,936 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES - -#define GTMOAUTH2SIGNIN_DEFINE_GLOBALS 1 -#import "GTMOAuth2SignIn.h" - -// we'll default to timing out if the network becomes unreachable for more -// than 30 seconds when the sign-in page is displayed -static const NSTimeInterval kDefaultNetworkLossTimeoutInterval = 30.0; - -// URI indicating an installed app is signing in. This is described at -// -// http://code.google.com/apis/accounts/docs/OAuth2.html#IA -// -NSString *const kOOBString = @"urn:ietf:wg:oauth:2.0:oob"; - - -@interface GTMOAuth2SignIn () -@property (assign) BOOL hasHandledCallback; -@property (retain) GTMHTTPFetcher *pendingFetcher; -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -@property (nonatomic, retain, readwrite) NSDictionary *userProfile; -#endif - -- (void)invokeFinalCallbackWithError:(NSError *)error; - -- (BOOL)startWebRequest; -+ (NSMutableURLRequest *)mutableURLRequestWithURL:(NSURL *)oldURL - paramString:(NSString *)paramStr; -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -- (void)addScopeForGoogleUserInfo; -- (void)fetchGoogleUserInfo; -#endif -- (void)finishSignInWithError:(NSError *)error; - -- (void)auth:(GTMOAuth2Authentication *)auth -finishedWithFetcher:(GTMHTTPFetcher *)fetcher - error:(NSError *)error; - -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -- (void)infoFetcher:(GTMHTTPFetcher *)fetcher - finishedWithData:(NSData *)data - error:(NSError *)error; -#endif - -- (void)closeTheWindow; - -- (void)startReachabilityCheck; -- (void)stopReachabilityCheck; -- (void)reachabilityTarget:(SCNetworkReachabilityRef)reachabilityRef - changedFlags:(SCNetworkConnectionFlags)flags; -- (void)reachabilityTimerFired:(NSTimer *)timer; - -+ (NSData *)decodeWebSafeBase64:(NSString *)base64Str; -@end - -@implementation GTMOAuth2SignIn - -@synthesize authentication = auth_; - -@synthesize authorizationURL = authorizationURL_; -@synthesize additionalAuthorizationParameters = additionalAuthorizationParameters_; - -@synthesize delegate = delegate_; -@synthesize webRequestSelector = webRequestSelector_; -@synthesize finishedSelector = finishedSelector_; -@synthesize hasHandledCallback = hasHandledCallback_; -@synthesize pendingFetcher = pendingFetcher_; -@synthesize userData = userData_; - -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -@synthesize shouldFetchGoogleUserEmail = shouldFetchGoogleUserEmail_; -@synthesize shouldFetchGoogleUserProfile = shouldFetchGoogleUserProfile_; -@synthesize userProfile = userProfile_; -#endif - -@synthesize networkLossTimeoutInterval = networkLossTimeoutInterval_; - -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (NSURL *)googleAuthorizationURL { - NSString *str = @"https://accounts.google.com/o/oauth2/auth"; - return [NSURL URLWithString:str]; -} - -+ (NSURL *)googleTokenURL { - NSString *str = @"https://accounts.google.com/o/oauth2/token"; - return [NSURL URLWithString:str]; -} - -+ (NSURL *)googleRevocationURL { - NSString *urlStr = @"https://accounts.google.com/o/oauth2/revoke"; - return [NSURL URLWithString:urlStr]; -} - -+ (NSURL *)googleUserInfoURL { - NSString *urlStr = @"https://www.googleapis.com/oauth2/v1/userinfo"; - return [NSURL URLWithString:urlStr]; -} -#endif - -+ (NSString *)nativeClientRedirectURI { - return kOOBString; -} - -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (GTMOAuth2Authentication *)standardGoogleAuthenticationForScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret { - NSString *redirectURI = [self nativeClientRedirectURI]; - NSURL *tokenURL = [self googleTokenURL]; - - GTMOAuth2Authentication *auth; - auth = [GTMOAuth2Authentication authenticationWithServiceProvider:kGTMOAuth2ServiceProviderGoogle - tokenURL:tokenURL - redirectURI:redirectURI - clientID:clientID - clientSecret:clientSecret]; - auth.scope = scope; - - return auth; -} - -- (void)addScopeForGoogleUserInfo { - GTMOAuth2Authentication *auth = self.authentication; - if (self.shouldFetchGoogleUserEmail) { - NSString *const emailScope = @"https://www.googleapis.com/auth/userinfo.email"; - NSString *scope = auth.scope; - if ([scope rangeOfString:emailScope].location == NSNotFound) { - scope = [GTMOAuth2Authentication scopeWithStrings:scope, emailScope, nil]; - auth.scope = scope; - } - } - - if (self.shouldFetchGoogleUserProfile) { - NSString *const profileScope = @"https://www.googleapis.com/auth/userinfo.profile"; - NSString *scope = auth.scope; - if ([scope rangeOfString:profileScope].location == NSNotFound) { - scope = [GTMOAuth2Authentication scopeWithStrings:scope, profileScope, nil]; - auth.scope = scope; - } - } -} -#endif - -- (id)initWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - delegate:(id)delegate - webRequestSelector:(SEL)webRequestSelector - finishedSelector:(SEL)finishedSelector { - // check the selectors on debug builds - GTMAssertSelectorNilOrImplementedWithArgs(delegate, webRequestSelector, - @encode(GTMOAuth2SignIn *), @encode(NSURLRequest *), 0); - GTMAssertSelectorNilOrImplementedWithArgs(delegate, finishedSelector, - @encode(GTMOAuth2SignIn *), @encode(GTMOAuth2Authentication *), - @encode(NSError *), 0); - - // designated initializer - self = [super init]; - if (self) { - auth_ = [auth retain]; - authorizationURL_ = [authorizationURL retain]; - delegate_ = [delegate retain]; - webRequestSelector_ = webRequestSelector; - finishedSelector_ = finishedSelector; - - // for Google authentication, we want to automatically fetch user info -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT - NSString *host = [authorizationURL host]; - if ([host hasSuffix:@".google.com"]) { - shouldFetchGoogleUserEmail_ = YES; - } -#endif - - // default timeout for a lost internet connection while the server - // UI is displayed is 30 seconds - networkLossTimeoutInterval_ = kDefaultNetworkLossTimeoutInterval; - } - return self; -} - -- (void)dealloc { - [self stopReachabilityCheck]; - - [auth_ release]; - [authorizationURL_ release]; - [additionalAuthorizationParameters_ release]; - [delegate_ release]; - [pendingFetcher_ release]; -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT - [userProfile_ release]; -#endif - [userData_ release]; - - [super dealloc]; -} - -#pragma mark Sign-in Sequence Methods - -// stop any pending fetches, and close the window (but don't call the -// delegate's finishedSelector) -- (void)cancelSigningIn { - [self.pendingFetcher stopFetching]; - self.pendingFetcher = nil; - - [self.authentication stopAuthorization]; - - [self closeTheWindow]; - - [delegate_ autorelease]; - delegate_ = nil; -} - -// -// This is the entry point to begin the sequence -// - display the authentication web page, and monitor redirects -// - exchange the code for an access token and a refresh token -// - for Google sign-in, fetch the user's email address -// - tell the delegate we're finished -// -- (BOOL)startSigningIn { - // For signing in to Google, append the scope for obtaining the authenticated - // user email and profile, as appropriate -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT - [self addScopeForGoogleUserInfo]; -#endif - - // start the authorization - return [self startWebRequest]; -} - -- (NSMutableDictionary *)parametersForWebRequest { - GTMOAuth2Authentication *auth = self.authentication; - NSString *clientID = auth.clientID; - NSString *redirectURI = auth.redirectURI; - - BOOL hasClientID = ([clientID length] > 0); - BOOL hasRedirect = ([redirectURI length] > 0 - || redirectURI == [[self class] nativeClientRedirectURI]); - if (!hasClientID || !hasRedirect) { -#if DEBUG - NSAssert(hasClientID, @"GTMOAuth2SignIn: clientID needed"); - NSAssert(hasRedirect, @"GTMOAuth2SignIn: redirectURI needed"); -#endif - return NO; - } - - // invoke the UI controller's web request selector to display - // the authorization page - - // add params to the authorization URL - NSString *scope = auth.scope; - if ([scope length] == 0) scope = nil; - - NSMutableDictionary *paramsDict = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"code", @"response_type", - clientID, @"client_id", - scope, @"scope", // scope may be nil - nil]; - if (redirectURI) { - [paramsDict setObject:redirectURI forKey:@"redirect_uri"]; - } - return paramsDict; -} - -- (BOOL)startWebRequest { - NSMutableDictionary *paramsDict = [self parametersForWebRequest]; - - NSDictionary *additionalParams = self.additionalAuthorizationParameters; - if (additionalParams) { - [paramsDict addEntriesFromDictionary:additionalParams]; - } - - NSString *paramStr = [GTMOAuth2Authentication encodedQueryParametersForDictionary:paramsDict]; - - NSURL *authorizationURL = self.authorizationURL; - NSMutableURLRequest *request; - request = [[self class] mutableURLRequestWithURL:authorizationURL - paramString:paramStr]; - - [delegate_ performSelector:self.webRequestSelector - withObject:self - withObject:request]; - - // at this point, we're waiting on the server-driven html UI, so - // we want notification if we lose connectivity to the web server - [self startReachabilityCheck]; - return YES; -} - -// utility for making a request from an old URL with some additional parameters -+ (NSMutableURLRequest *)mutableURLRequestWithURL:(NSURL *)oldURL - paramString:(NSString *)paramStr { - NSString *query = [oldURL query]; - if ([query length] > 0) { - query = [query stringByAppendingFormat:@"&%@", paramStr]; - } else { - query = paramStr; - } - - NSString *portStr = @""; - NSString *oldPort = [[oldURL port] stringValue]; - if ([oldPort length] > 0) { - portStr = [@":" stringByAppendingString:oldPort]; - } - - NSString *qMark = [query length] > 0 ? @"?" : @""; - NSString *newURLStr = [NSString stringWithFormat:@"%@://%@%@%@%@%@", - [oldURL scheme], [oldURL host], portStr, - [oldURL path], qMark, query]; - NSURL *newURL = [NSURL URLWithString:newURLStr]; - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:newURL]; - return request; -} - -// entry point for the window controller to tell us that the window -// prematurely closed -- (void)windowWasClosed { - [self stopReachabilityCheck]; - - NSError *error = [NSError errorWithDomain:kGTMOAuth2ErrorDomain - code:kGTMOAuth2ErrorWindowClosed - userInfo:nil]; - [self invokeFinalCallbackWithError:error]; -} - -// internal method to tell the window controller to close the window -- (void)closeTheWindow { - [self stopReachabilityCheck]; - - // a nil request means the window should be closed - [delegate_ performSelector:self.webRequestSelector - withObject:self - withObject:nil]; -} - -// entry point for the window controller to tell us what web page has been -// requested -// -// When the request is for the callback URL, this method invokes -// authCodeObtained and returns YES -- (BOOL)requestRedirectedToRequest:(NSURLRequest *)redirectedRequest { - // for Google's installed app sign-in protocol, we'll look for the - // end-of-sign-in indicator in the titleChanged: method below - NSString *redirectURI = self.authentication.redirectURI; - if (redirectURI == nil) return NO; - - // when we're searching for the window title string, then we can ignore - // redirects - NSString *standardURI = [[self class] nativeClientRedirectURI]; - if (standardURI != nil && [redirectURI isEqual:standardURI]) return NO; - - // compare the redirectURI, which tells us when the web sign-in is done, - // to the actual redirection - NSURL *redirectURL = [NSURL URLWithString:redirectURI]; - NSURL *requestURL = [redirectedRequest URL]; - - // avoid comparing to nil host and path values (such as when redirected to - // "about:blank") - NSString *requestHost = [requestURL host]; - NSString *requestPath = [requestURL path]; - BOOL isCallback; - if (requestHost && requestPath) { - isCallback = [[redirectURL host] isEqual:[requestURL host]] - && [[redirectURL path] isEqual:[requestURL path]]; - } else if (requestURL) { - // handle "about:blank" - isCallback = [redirectURL isEqual:requestURL]; - } else { - isCallback = NO; - } - - if (!isCallback) { - // tell the caller that this request is nothing interesting - return NO; - } - - // we've reached the callback URL - - // try to get the access code - if (!self.hasHandledCallback) { - NSString *responseStr = [[redirectedRequest URL] query]; - [self.authentication setKeysForResponseString:responseStr]; - -#if DEBUG - NSAssert([self.authentication.code length] > 0 - || [self.authentication.errorString length] > 0, - @"response lacks auth code or error"); -#endif - - [self authCodeObtained]; - } - // tell the delegate that we did handle this request - return YES; -} - -// entry point for the window controller to tell us when a new page title has -// been loadded -// -// When the title indicates sign-in has completed, this method invokes -// authCodeObtained and returns YES -- (BOOL)titleChanged:(NSString *)title { - // return YES if the OAuth flow ending title was detected - - // right now we're just looking for a parameter list following the last space - // in the title string, but hopefully we'll eventually get something better - // from the server to search for - NSRange paramsRange = [title rangeOfString:@" " - options:NSBackwardsSearch]; - NSUInteger spaceIndex = paramsRange.location; - if (spaceIndex != NSNotFound) { - NSString *responseStr = [title substringFromIndex:(spaceIndex + 1)]; - - NSDictionary *dict = [GTMOAuth2Authentication dictionaryWithResponseString:responseStr]; - - NSString *code = [dict objectForKey:@"code"]; - NSString *error = [dict objectForKey:@"error"]; - if ([code length] > 0 || [error length] > 0) { - - if (!self.hasHandledCallback) { - [self.authentication setKeysForResponseDictionary:dict]; - - [self authCodeObtained]; - } - return YES; - } - } - return NO; -} - -- (BOOL)cookiesChanged:(NSHTTPCookieStorage *)cookieStorage { - // We're ignoring these. - return NO; -}; - -// entry point for the window controller to tell us when a load has failed -// in the webview -// -// if the initial authorization URL fails, bail out so the user doesn't -// see an empty webview -- (BOOL)loadFailedWithError:(NSError *)error { - NSURL *authorizationURL = self.authorizationURL; - NSURL *failedURL = [[error userInfo] valueForKey:@"NSErrorFailingURLKey"]; // NSURLErrorFailingURLErrorKey defined in 10.6 - - BOOL isAuthURL = [[failedURL host] isEqual:[authorizationURL host]] - && [[failedURL path] isEqual:[authorizationURL path]]; - - if (isAuthURL) { - // We can assume that we have no pending fetchers, since we only - // handle failure to load the initial authorization URL - [self closeTheWindow]; - [self invokeFinalCallbackWithError:error]; - return YES; - } - return NO; -} - -- (void)authCodeObtained { - // the callback page was requested, or the authenticate code was loaded - // into a page's title, so exchange the auth code for access & refresh tokens - // and tell the window to close - - // avoid duplicate signals that the callback point has been reached - self.hasHandledCallback = YES; - - // If the signin was request for exchanging an authentication token to a - // refresh token, there is no window to close. - if (self.webRequestSelector) { - [self closeTheWindow]; - } else { - // For signing in to Google, append the scope for obtaining the - // authenticated user email and profile, as appropriate. This is usually - // done by the startSigningIn method, but this method is not called when - // exchanging an authentication token for a refresh token. -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT - [self addScopeForGoogleUserInfo]; -#endif - } - - NSError *error = nil; - - GTMOAuth2Authentication *auth = self.authentication; - NSString *code = auth.code; - if ([code length] > 0) { - // exchange the code for a token - SEL sel = @selector(auth:finishedWithFetcher:error:); - GTMHTTPFetcher *fetcher = [auth beginTokenFetchWithDelegate:self - didFinishSelector:sel]; - if (fetcher == nil) { - error = [NSError errorWithDomain:kGTMHTTPFetcherStatusDomain - code:-1 - userInfo:nil]; - } else { - self.pendingFetcher = fetcher; - } - - // notify the app so it can put up a post-sign in, pre-token exchange UI - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc postNotificationName:kGTMOAuth2UserSignedIn - object:self - userInfo:nil]; - } else { - // the callback lacked an auth code - NSString *errStr = auth.errorString; - NSDictionary *userInfo = nil; - if ([errStr length] > 0) { - userInfo = [NSDictionary dictionaryWithObject:errStr - forKey:kGTMOAuth2ErrorMessageKey]; - } - - error = [NSError errorWithDomain:kGTMOAuth2ErrorDomain - code:kGTMOAuth2ErrorAuthorizationFailed - userInfo:userInfo]; - } - - if (error) { - [self finishSignInWithError:error]; - } -} - -- (void)auth:(GTMOAuth2Authentication *)auth -finishedWithFetcher:(GTMHTTPFetcher *)fetcher - error:(NSError *)error { - self.pendingFetcher = nil; - -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT - if (error == nil - && (self.shouldFetchGoogleUserEmail || self.shouldFetchGoogleUserProfile) - && [self.authentication.serviceProvider isEqual:kGTMOAuth2ServiceProviderGoogle]) { - // fetch the user's information from the Google server - [self fetchGoogleUserInfo]; - } else { - // we're not authorizing with Google, so we're done - [self finishSignInWithError:error]; - } -#else - [self finishSignInWithError:error]; -#endif -} - -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (GTMHTTPFetcher *)userInfoFetcherWithAuth:(GTMOAuth2Authentication *)auth { - // create a fetcher for obtaining the user's email or profile - NSURL *infoURL = [[self class] googleUserInfoURL]; - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:infoURL]; - - if ([auth respondsToSelector:@selector(userAgent)]) { - NSString *userAgent = [auth userAgent]; - [request setValue:userAgent forHTTPHeaderField:@"User-Agent"]; - } - [request setValue:@"no-cache" forHTTPHeaderField:@"Cache-Control"]; - - GTMHTTPFetcher *fetcher; - id fetcherService = nil; - if ([auth respondsToSelector:@selector(fetcherService)]) { - fetcherService = auth.fetcherService; - }; - if (fetcherService) { - fetcher = [fetcherService fetcherWithRequest:request]; - } else { - fetcher = [GTMHTTPFetcher fetcherWithRequest:request]; - } - fetcher.authorizer = auth; - fetcher.retryEnabled = YES; - fetcher.maxRetryInterval = 15.0; - fetcher.comment = @"user info"; - return fetcher; -} - -- (void)fetchGoogleUserInfo { - if (!self.shouldFetchGoogleUserProfile) { - // If we only need email and user ID, not the full profile, and we have an - // id_token, it may have the email and user ID so we won't need to fetch - // them. - GTMOAuth2Authentication *auth = self.authentication; - NSString *idToken = [auth.parameters objectForKey:@"id_token"]; - if ([idToken length] > 0) { - // The id_token has three dot-delimited parts. The second is the - // JSON profile. - // - // http://www.tbray.org/ongoing/When/201x/2013/04/04/ID-Tokens - NSArray *parts = [idToken componentsSeparatedByString:@"."]; - if ([parts count] == 3) { - NSString *part2 = [parts objectAtIndex:1]; - if ([part2 length] > 0) { - NSData *data = [[self class] decodeWebSafeBase64:part2]; - if ([data length] > 0) { - [self updateGoogleUserInfoWithData:data]; - if ([[auth userID] length] > 0 && [[auth userEmail] length] > 0) { - // We obtained user ID and email from the ID token. - [self finishSignInWithError:nil]; - return; - } - } - } - } - } - } - - // Fetch the email and profile from the userinfo endpoint. - GTMOAuth2Authentication *auth = self.authentication; - GTMHTTPFetcher *fetcher = [[self class] userInfoFetcherWithAuth:auth]; - [fetcher beginFetchWithDelegate:self - didFinishSelector:@selector(infoFetcher:finishedWithData:error:)]; - - self.pendingFetcher = fetcher; - - [auth notifyFetchIsRunning:YES - fetcher:fetcher - type:kGTMOAuth2FetchTypeUserInfo]; -} - -- (void)infoFetcher:(GTMHTTPFetcher *)fetcher - finishedWithData:(NSData *)data - error:(NSError *)error { - GTMOAuth2Authentication *auth = self.authentication; - [auth notifyFetchIsRunning:NO - fetcher:fetcher - type:nil]; - - self.pendingFetcher = nil; - - if (error) { -#if DEBUG - if (data) { - NSString *dataStr = [[[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding] autorelease]; - NSLog(@"infoFetcher error: %@\n%@", error, dataStr); - } -#endif - } else { - // We have the authenticated user's info - [self updateGoogleUserInfoWithData:data]; - } - [self finishSignInWithError:error]; -} - -- (void)updateGoogleUserInfoWithData:(NSData *)data { - if (!data) return; - - GTMOAuth2Authentication *auth = self.authentication; - NSDictionary *profileDict = [[auth class] dictionaryWithJSONData:data]; - if (profileDict) { - self.userProfile = profileDict; - - // Save the ID into the auth object - NSString *identifier = [profileDict objectForKey:@"id"]; - [auth setUserID:identifier]; - - // Save the email into the auth object - NSString *email = [profileDict objectForKey:@"email"]; - [auth setUserEmail:email]; - - // The verified_email key is a boolean NSNumber in the userinfo - // endpoint response, but it is a string like "true" in the id_token. - // We want to consistently save it as a string of the boolean value, - // like @"1". - id verified = [profileDict objectForKey:@"verified_email"]; - if ([verified isKindOfClass:[NSString class]]) { - verified = [NSNumber numberWithBool:[verified boolValue]]; - } - - [auth setUserEmailIsVerified:[verified stringValue]]; - } -} - -#endif // !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT - -- (void)finishSignInWithError:(NSError *)error { - [self invokeFinalCallbackWithError:error]; -} - -// convenience method for making the final call to our delegate -- (void)invokeFinalCallbackWithError:(NSError *)error { - if (delegate_ && finishedSelector_) { - GTMOAuth2Authentication *auth = self.authentication; - - NSMethodSignature *sig = [delegate_ methodSignatureForSelector:finishedSelector_]; - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig]; - [invocation setSelector:finishedSelector_]; - [invocation setTarget:delegate_]; - [invocation setArgument:&self atIndex:2]; - [invocation setArgument:&auth atIndex:3]; - [invocation setArgument:&error atIndex:4]; - [invocation invoke]; - } - - // we'll no longer send messages to the delegate - // - // we want to autorelease it rather than assign to the property in case - // the delegate is below us in the call stack - [delegate_ autorelease]; - delegate_ = nil; -} - -#pragma mark Reachability monitoring - -static void ReachabilityCallBack(SCNetworkReachabilityRef target, - SCNetworkConnectionFlags flags, - void *info) { - // pass the flags to the signIn object - GTMOAuth2SignIn *signIn = (GTMOAuth2SignIn *)info; - - [signIn reachabilityTarget:target - changedFlags:flags]; -} - -- (void)startReachabilityCheck { - // the user may set the timeout to 0 to skip the reachability checking - // during display of the sign-in page - if (networkLossTimeoutInterval_ <= 0.0 || reachabilityRef_ != NULL) { - return; - } - - // create a reachability target from the authorization URL, add our callback, - // and schedule it on the run loop so we'll be notified if the network drops - NSURL *url = self.authorizationURL; - const char* host = [[url host] UTF8String]; - reachabilityRef_ = SCNetworkReachabilityCreateWithName(kCFAllocatorSystemDefault, - host); - if (reachabilityRef_) { - BOOL isScheduled = NO; - SCNetworkReachabilityContext ctx = { 0, self, NULL, NULL, NULL }; - - if (SCNetworkReachabilitySetCallback(reachabilityRef_, - ReachabilityCallBack, &ctx)) { - if (SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef_, - CFRunLoopGetCurrent(), - kCFRunLoopDefaultMode)) { - isScheduled = YES; - } - } - - if (!isScheduled) { - CFRelease(reachabilityRef_); - reachabilityRef_ = NULL; - } - } -} - -- (void)destroyUnreachabilityTimer { - [networkLossTimer_ invalidate]; - [networkLossTimer_ autorelease]; - networkLossTimer_ = nil; -} - -- (void)reachabilityTarget:(SCNetworkReachabilityRef)reachabilityRef - changedFlags:(SCNetworkConnectionFlags)flags { - BOOL isConnected = (flags & kSCNetworkFlagsReachable) != 0 - && (flags & kSCNetworkFlagsConnectionRequired) == 0; - - if (isConnected) { - // server is again reachable - [self destroyUnreachabilityTimer]; - - if (hasNotifiedNetworkLoss_) { - // tell the user that the network has been found - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc postNotificationName:kGTMOAuth2NetworkFound - object:self - userInfo:nil]; - hasNotifiedNetworkLoss_ = NO; - } - } else { - // the server has become unreachable; start the timer, if necessary - if (networkLossTimer_ == nil - && networkLossTimeoutInterval_ > 0 - && !hasNotifiedNetworkLoss_) { - SEL sel = @selector(reachabilityTimerFired:); - networkLossTimer_ = [[NSTimer scheduledTimerWithTimeInterval:networkLossTimeoutInterval_ - target:self - selector:sel - userInfo:nil - repeats:NO] retain]; - } - } -} - -- (void)reachabilityTimerFired:(NSTimer *)timer { - // the user may call [[notification object] cancelSigningIn] to - // dismiss the sign-in - if (!hasNotifiedNetworkLoss_) { - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc postNotificationName:kGTMOAuth2NetworkLost - object:self - userInfo:nil]; - hasNotifiedNetworkLoss_ = YES; - } - - [self destroyUnreachabilityTimer]; -} - -- (void)stopReachabilityCheck { - [self destroyUnreachabilityTimer]; - - if (reachabilityRef_) { - SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef_, - CFRunLoopGetCurrent(), - kCFRunLoopDefaultMode); - SCNetworkReachabilitySetCallback(reachabilityRef_, NULL, NULL); - - CFRelease(reachabilityRef_); - reachabilityRef_ = NULL; - } -} - -#pragma mark Token Revocation - -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (void)revokeTokenForGoogleAuthentication:(GTMOAuth2Authentication *)auth { - if (auth.refreshToken != nil - && auth.canAuthorize - && [auth.serviceProvider isEqual:kGTMOAuth2ServiceProviderGoogle]) { - - // create a signed revocation request for this authentication object - NSURL *url = [self googleRevocationURL]; - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; - [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; - - NSString *token = auth.refreshToken; - NSString *encoded = [GTMOAuth2Authentication encodedOAuthValueForString:token]; - if (encoded != nil) { - NSString *body = [@"token=" stringByAppendingString:encoded]; - - [request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]]; - [request setHTTPMethod:@"POST"]; - - NSString *userAgent = [auth userAgent]; - [request setValue:userAgent forHTTPHeaderField:@"User-Agent"]; - - // there's nothing to be done if revocation succeeds or fails - GTMHTTPFetcher *fetcher; - id fetcherService = auth.fetcherService; - if (fetcherService) { - fetcher = [fetcherService fetcherWithRequest:request]; - } else { - fetcher = [GTMHTTPFetcher fetcherWithRequest:request]; - } - fetcher.comment = @"revoke token"; - - // Use a completion handler fetch for better debugging, but only if we're - // guaranteed that blocks are available in the runtime -#if (!TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1060)) || \ - (TARGET_OS_IPHONE && (__IPHONE_OS_VERSION_MIN_REQUIRED >= 40000)) - // Blocks are available - [fetcher beginFetchWithCompletionHandler:^(NSData *data, NSError *error) { - #if DEBUG - if (error) { - NSString *errStr = [[[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding] autorelease]; - NSLog(@"revoke error: %@", errStr); - } - #endif // DEBUG - }]; -#else - // Blocks may not be available - [fetcher beginFetchWithDelegate:nil didFinishSelector:NULL]; -#endif - } - } - [auth reset]; -} - - -// Based on Cyrus Najmabadi's elegent little encoder and decoder from -// http://www.cocoadev.com/index.pl?BaseSixtyFour and on GTLBase64 - -+ (NSData *)decodeWebSafeBase64:(NSString *)base64Str { - static char decodingTable[128]; - static BOOL hasInited = NO; - - if (!hasInited) { - char webSafeEncodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; - memset(decodingTable, 0, 128); - for (unsigned int i = 0; i < sizeof(webSafeEncodingTable); i++) { - decodingTable[(unsigned int) webSafeEncodingTable[i]] = (char)i; - } - hasInited = YES; - } - - // The input string should be plain ASCII. - const char *cString = [base64Str cStringUsingEncoding:NSASCIIStringEncoding]; - if (cString == nil) return nil; - - NSInteger inputLength = (NSInteger)strlen(cString); - // Input length is not being restricted to multiples of 4. - if (inputLength == 0) return [NSData data]; - - while (inputLength > 0 && cString[inputLength - 1] == '=') { - inputLength--; - } - - NSInteger outputLength = inputLength * 3 / 4; - NSMutableData* data = [NSMutableData dataWithLength:(NSUInteger)outputLength]; - uint8_t *output = [data mutableBytes]; - - NSInteger inputPoint = 0; - NSInteger outputPoint = 0; - char *table = decodingTable; - - while (inputPoint < inputLength - 1) { - int i0 = cString[inputPoint++]; - int i1 = cString[inputPoint++]; - int i2 = inputPoint < inputLength ? cString[inputPoint++] : 'A'; // 'A' will decode to \0 - int i3 = inputPoint < inputLength ? cString[inputPoint++] : 'A'; - - output[outputPoint++] = (uint8_t)((table[i0] << 2) | (table[i1] >> 4)); - if (outputPoint < outputLength) { - output[outputPoint++] = (uint8_t)(((table[i1] & 0xF) << 4) | (table[i2] >> 2)); - } - if (outputPoint < outputLength) { - output[outputPoint++] = (uint8_t)(((table[i2] & 0x3) << 6) | table[i3]); - } - } - - return data; -} - -#endif // !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT - -@end - -#endif // #if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES diff --git a/External/google-plus-ios-sdk/OpenSource/GTMOAuth2ViewControllerTouch.h b/External/google-plus-ios-sdk/OpenSource/GTMOAuth2ViewControllerTouch.h deleted file mode 100644 index 23bb07a9..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMOAuth2ViewControllerTouch.h +++ /dev/null @@ -1,366 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTMOAuth2ViewControllerTouch.h -// -// This view controller for iPhone handles sign-in via OAuth to Google or -// other services. -// -// This controller is not reusable; create a new instance of this controller -// every time the user will sign in. -// - -#if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES - -#import - -#if TARGET_OS_IPHONE - -#import - -#import "GTMOAuth2Authentication.h" - -#undef _EXTERN -#undef _INITIALIZE_AS -#ifdef GTMOAUTH2VIEWCONTROLLERTOUCH_DEFINE_GLOBALS -#define _EXTERN -#define _INITIALIZE_AS(x) =x -#else -#define _EXTERN extern -#define _INITIALIZE_AS(x) -#endif - -_EXTERN NSString* const kGTMOAuth2KeychainErrorDomain _INITIALIZE_AS(@"com.google.GTMOAuthKeychain"); - -@class GTMOAuth2SignIn; -@class GTMOAuth2ViewControllerTouch; - -typedef void (^GTMOAuth2ViewControllerCompletionHandler)(GTMOAuth2ViewControllerTouch *viewController, GTMOAuth2Authentication *auth, NSError *error); - -@interface GTMOAuth2ViewControllerTouch : UIViewController { - @private - UIButton *backButton_; - UIButton *forwardButton_; - UIActivityIndicatorView *initialActivityIndicator_; - UIView *navButtonsView_; - UIBarButtonItem *rightBarButtonItem_; - UIWebView *webView_; - - // The object responsible for the sign-in networking sequence; it holds - // onto the authentication object as well. - GTMOAuth2SignIn *signIn_; - - // the page request to load when awakeFromNib occurs - NSURLRequest *request_; - - // The user we're calling back - // - // The delegate is retained only until the callback is invoked - // or the sign-in is canceled - id delegate_; - SEL finishedSelector_; - -#if NS_BLOCKS_AVAILABLE - GTMOAuth2ViewControllerCompletionHandler completionBlock_; - - void (^popViewBlock_)(void); -#endif - - NSString *keychainItemName_; - CFTypeRef keychainItemAccessibility_; - - // if non-nil, the html string to be displayed immediately upon opening - // of the web view - NSString *initialHTMLString_; - - // set to 1 or -1 if the user sets the showsInitialActivityIndicator - // property - int mustShowActivityIndicator_; - - // if non-nil, the URL for which cookies will be deleted when the - // browser view is dismissed - NSURL *browserCookiesURL_; - - id userData_; - NSMutableDictionary *properties_; - -#if __IPHONE_OS_VERSION_MIN_REQUIRED < 60000 - // We delegate the decision to our owning NavigationController (if any). - // But, the NavigationController will call us back, and ask us. - // BOOL keeps us from infinite looping. - BOOL isInsideShouldAutorotateToInterfaceOrientation_; -#endif - - // YES, when view first shown in this signIn session. - BOOL isViewShown_; - - // YES, after the view has fully transitioned in. - BOOL didViewAppear_; - - // YES between sends of start and stop notifications - BOOL hasNotifiedWebViewStartedLoading_; - - // To prevent us from calling our delegate's selector more than once. - BOOL hasCalledFinished_; - - // Set in a webView callback. - BOOL hasDoneFinalRedirect_; - - // Set during the pop initiated by the sign-in object; otherwise, - // viewWillDisappear indicates that some external change of the view - // has stopped the sign-in. - BOOL didDismissSelf_; -} - -// the application and service name to use for saving the auth tokens -// to the keychain -@property (nonatomic, copy) NSString *keychainItemName; - -// the keychain item accessibility is a system constant for use -// with kSecAttrAccessible. -// -// Since it's a system constant, we do not need to retain it. -@property (nonatomic, assign) CFTypeRef keychainItemAccessibility; - -// optional html string displayed immediately upon opening the web view -// -// This string is visible just until the sign-in web page loads, and -// may be used for a "Loading..." type of message or to set the -// initial view color -@property (nonatomic, copy) NSString *initialHTMLString; - -// an activity indicator shows during initial webview load when no initial HTML -// string is specified, but the activity indicator can be forced to be shown -// with this property -@property (nonatomic, assign) BOOL showsInitialActivityIndicator; - -// the underlying object to hold authentication tokens and authorize http -// requests -@property (nonatomic, retain, readonly) GTMOAuth2Authentication *authentication; - -// the underlying object which performs the sign-in networking sequence -@property (nonatomic, retain, readonly) GTMOAuth2SignIn *signIn; - -// user interface elements -@property (nonatomic, retain) IBOutlet UIButton *backButton; -@property (nonatomic, retain) IBOutlet UIButton *forwardButton; -@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *initialActivityIndicator; -@property (nonatomic, retain) IBOutlet UIView *navButtonsView; -@property (nonatomic, retain) IBOutlet UIBarButtonItem *rightBarButtonItem; -@property (nonatomic, retain) IBOutlet UIWebView *webView; - -#if NS_BLOCKS_AVAILABLE -// An optional block to be called when the view should be popped. If not set, -// the view controller will use its navigation controller to pop the view. -@property (nonatomic, copy) void (^popViewBlock)(void); -#endif - -// the default timeout for an unreachable network during display of the -// sign-in page is 30 seconds; set this to 0 to have no timeout -@property (nonatomic, assign) NSTimeInterval networkLossTimeoutInterval; - -// if set, cookies are deleted for this URL when the view is hidden -// -// For Google sign-ins, this is set by default to https://google.com/accounts -// but it may be explicitly set to nil to disable clearing of browser cookies -@property (nonatomic, retain) NSURL *browserCookiesURL; - -// userData is retained for the convenience of the caller -@property (nonatomic, retain) id userData; - -// Stored property values are retained for the convenience of the caller -- (void)setProperty:(id)obj forKey:(NSString *)key; -- (id)propertyForKey:(NSString *)key; - -@property (nonatomic, retain) NSDictionary *properties; - -// Method for creating a controller to authenticate to Google services -// -// scope is the requested scope of authorization -// (like "http://www.google.com/m8/feeds") -// -// keychain item name is used for storing the token on the keychain, -// keychainItemName should be like "My Application: Google Latitude" -// (or set to nil if no persistent keychain storage is desired) -// -// the delegate is retained only until the finished selector is invoked -// or the sign-in is canceled -// -// If you don't like the default nibName and bundle, you can change them -// using the UIViewController properties once you've made one of these. -// -// finishedSelector is called after authentication completes. It should follow -// this signature. -// -// - (void)viewController:(GTMOAuth2ViewControllerTouch *)viewController -// finishedWithAuth:(GTMOAuth2Authentication *)auth -// error:(NSError *)error; -// -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (id)controllerWithScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret - keychainItemName:(NSString *)keychainItemName - delegate:(id)delegate - finishedSelector:(SEL)finishedSelector; - -- (id)initWithScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret - keychainItemName:(NSString *)keychainItemName - delegate:(id)delegate - finishedSelector:(SEL)finishedSelector; - -#if NS_BLOCKS_AVAILABLE -+ (id)controllerWithScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret - keychainItemName:(NSString *)keychainItemName - completionHandler:(GTMOAuth2ViewControllerCompletionHandler)handler; - -- (id)initWithScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret - keychainItemName:(NSString *)keychainItemName - completionHandler:(GTMOAuth2ViewControllerCompletionHandler)handler; -#endif -#endif - -// Create a controller for authenticating to non-Google services, taking -// explicit endpoint URLs and an authentication object -+ (id)controllerWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - keychainItemName:(NSString *)keychainItemName // may be nil - delegate:(id)delegate - finishedSelector:(SEL)finishedSelector; - -// This is the designated initializer -- (id)initWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - keychainItemName:(NSString *)keychainItemName - delegate:(id)delegate - finishedSelector:(SEL)finishedSelector; - -#if NS_BLOCKS_AVAILABLE -+ (id)controllerWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - keychainItemName:(NSString *)keychainItemName // may be nil - completionHandler:(GTMOAuth2ViewControllerCompletionHandler)handler; - -- (id)initWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - keychainItemName:(NSString *)keychainItemName - completionHandler:(GTMOAuth2ViewControllerCompletionHandler)handler; -#endif - -// subclasses may override authNibName to specify a custom name -+ (NSString *)authNibName; - -// subclasses may override authNibBundle to specify a custom bundle -+ (NSBundle *)authNibBundle; - -// subclasses may override setUpNavigation to provide their own navigation -// controls -- (void)setUpNavigation; - -// apps may replace the sign-in class with their own subclass of it -+ (Class)signInClass; -+ (void)setSignInClass:(Class)theClass; - -- (void)cancelSigningIn; - -// revocation of an authorized token from Google -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (void)revokeTokenForGoogleAuthentication:(GTMOAuth2Authentication *)auth; -#endif - -// -// Keychain -// - -// create an authentication object for Google services from the access -// token and secret stored in the keychain; if no token is available, return -// an unauthorized auth object -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (GTMOAuth2Authentication *)authForGoogleFromKeychainForName:(NSString *)keychainItemName - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret; -#endif - -// add tokens from the keychain, if available, to the authentication object -// -// returns YES if the authentication object was authorized from the keychain -+ (BOOL)authorizeFromKeychainForName:(NSString *)keychainItemName - authentication:(GTMOAuth2Authentication *)auth; - -// method for deleting the stored access token and secret, useful for "signing -// out" -+ (BOOL)removeAuthFromKeychainForName:(NSString *)keychainItemName; - -// method for saving the stored access token and secret -+ (BOOL)saveParamsToKeychainForName:(NSString *)keychainItemName - accessibility:(CFTypeRef)accessibility - authentication:(GTMOAuth2Authentication *)auth; - -// older version, defaults to kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly -+ (BOOL)saveParamsToKeychainForName:(NSString *)keychainItemName - authentication:(GTMOAuth2Authentication *)auth; - -@end - -// To function, GTMOAuth2ViewControllerTouch needs a certain amount of access -// to the iPhone's keychain. To keep things simple, its keychain access is -// broken out into a helper class. We declare it here in case you'd like to use -// it too, to store passwords. - -enum { - kGTMOAuth2KeychainErrorBadArguments = -1301, - kGTMOAuth2KeychainErrorNoPassword = -1302 -}; - - -@interface GTMOAuth2Keychain : NSObject - -+ (GTMOAuth2Keychain *)defaultKeychain; - -// OK to pass nil for the error parameter. -- (NSString *)passwordForService:(NSString *)service - account:(NSString *)account - error:(NSError **)error; - -// OK to pass nil for the error parameter. -- (BOOL)removePasswordForService:(NSString *)service - account:(NSString *)account - error:(NSError **)error; - -// OK to pass nil for the error parameter. -// -// accessibility should be one of the constants for kSecAttrAccessible -// such as kSecAttrAccessibleWhenUnlocked -- (BOOL)setPassword:(NSString *)password - forService:(NSString *)service - accessibility:(CFTypeRef)accessibility - account:(NSString *)account - error:(NSError **)error; - -// For unit tests: allow setting a mock object -+ (void)setDefaultKeychain:(GTMOAuth2Keychain *)keychain; - -@end - -#endif // TARGET_OS_IPHONE - -#endif // #if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES diff --git a/External/google-plus-ios-sdk/OpenSource/GTMOAuth2ViewControllerTouch.m b/External/google-plus-ios-sdk/OpenSource/GTMOAuth2ViewControllerTouch.m deleted file mode 100644 index 15ce71e6..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMOAuth2ViewControllerTouch.m +++ /dev/null @@ -1,1047 +0,0 @@ -/* Copyright (c) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// GTMOAuth2ViewControllerTouch.m -// - -#import -#import - -#if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES - -#if TARGET_OS_IPHONE - -#define GTMOAUTH2VIEWCONTROLLERTOUCH_DEFINE_GLOBALS 1 -#import "GTMOAuth2ViewControllerTouch.h" - -#import "GTMOAuth2SignIn.h" -#import "GTMOAuth2Authentication.h" - -static NSString * const kGTMOAuth2AccountName = @"OAuth"; -static GTMOAuth2Keychain* sDefaultKeychain = nil; - -@interface GTMOAuth2ViewControllerTouch() - -@property (nonatomic, copy) NSURLRequest *request; - -- (void)signIn:(GTMOAuth2SignIn *)signIn displayRequest:(NSURLRequest *)request; -- (void)signIn:(GTMOAuth2SignIn *)signIn -finishedWithAuth:(GTMOAuth2Authentication *)auth - error:(NSError *)error; -- (BOOL)isNavigationBarTranslucent; -- (void)moveWebViewFromUnderNavigationBar; -- (void)popView; -- (void)clearBrowserCookies; -@end - -@implementation GTMOAuth2ViewControllerTouch - -// IBOutlets -@synthesize request = request_, - backButton = backButton_, - forwardButton = forwardButton_, - navButtonsView = navButtonsView_, - rightBarButtonItem = rightBarButtonItem_, - webView = webView_, - initialActivityIndicator = initialActivityIndicator_; - -@synthesize keychainItemName = keychainItemName_, - keychainItemAccessibility = keychainItemAccessibility_, - initialHTMLString = initialHTMLString_, - browserCookiesURL = browserCookiesURL_, - signIn = signIn_, - userData = userData_, - properties = properties_; - -#if NS_BLOCKS_AVAILABLE -@synthesize popViewBlock = popViewBlock_; -#endif - -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (id)controllerWithScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret - keychainItemName:(NSString *)keychainItemName - delegate:(id)delegate - finishedSelector:(SEL)finishedSelector { - return [[[self alloc] initWithScope:scope - clientID:clientID - clientSecret:clientSecret - keychainItemName:keychainItemName - delegate:delegate - finishedSelector:finishedSelector] autorelease]; -} - -- (id)initWithScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret - keychainItemName:(NSString *)keychainItemName - delegate:(id)delegate - finishedSelector:(SEL)finishedSelector { - // convenient entry point for Google authentication - - Class signInClass = [[self class] signInClass]; - - GTMOAuth2Authentication *auth; - auth = [signInClass standardGoogleAuthenticationForScope:scope - clientID:clientID - clientSecret:clientSecret]; - NSURL *authorizationURL = [signInClass googleAuthorizationURL]; - return [self initWithAuthentication:auth - authorizationURL:authorizationURL - keychainItemName:keychainItemName - delegate:delegate - finishedSelector:finishedSelector]; -} - -#if NS_BLOCKS_AVAILABLE - -+ (id)controllerWithScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret - keychainItemName:(NSString *)keychainItemName - completionHandler:(GTMOAuth2ViewControllerCompletionHandler)handler { - return [[[self alloc] initWithScope:scope - clientID:clientID - clientSecret:clientSecret - keychainItemName:keychainItemName - completionHandler:handler] autorelease]; -} - -- (id)initWithScope:(NSString *)scope - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret - keychainItemName:(NSString *)keychainItemName - completionHandler:(GTMOAuth2ViewControllerCompletionHandler)handler { - // convenient entry point for Google authentication - - Class signInClass = [[self class] signInClass]; - - GTMOAuth2Authentication *auth; - auth = [signInClass standardGoogleAuthenticationForScope:scope - clientID:clientID - clientSecret:clientSecret]; - NSURL *authorizationURL = [signInClass googleAuthorizationURL]; - self = [self initWithAuthentication:auth - authorizationURL:authorizationURL - keychainItemName:keychainItemName - delegate:nil - finishedSelector:NULL]; - if (self) { - completionBlock_ = [handler copy]; - } - return self; -} - -#endif // NS_BLOCKS_AVAILABLE -#endif // !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT - -+ (id)controllerWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - keychainItemName:(NSString *)keychainItemName - delegate:(id)delegate - finishedSelector:(SEL)finishedSelector { - return [[[self alloc] initWithAuthentication:auth - authorizationURL:authorizationURL - keychainItemName:keychainItemName - delegate:delegate - finishedSelector:finishedSelector] autorelease]; -} - -- (id)initWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - keychainItemName:(NSString *)keychainItemName - delegate:(id)delegate - finishedSelector:(SEL)finishedSelector { - - NSString *nibName = [[self class] authNibName]; - NSBundle *nibBundle = [[self class] authNibBundle]; - - self = [super initWithNibName:nibName bundle:nibBundle]; - if (self != nil) { - delegate_ = [delegate retain]; - finishedSelector_ = finishedSelector; - - Class signInClass = [[self class] signInClass]; - - // use the supplied auth and OAuth endpoint URLs - signIn_ = [[signInClass alloc] initWithAuthentication:auth - authorizationURL:authorizationURL - delegate:self - webRequestSelector:@selector(signIn:displayRequest:) - finishedSelector:@selector(signIn:finishedWithAuth:error:)]; - - // if the user is signing in to a Google service, we'll delete the - // Google authentication browser cookies upon completion - // - // for other service domains, or to disable clearing of the cookies, - // set the browserCookiesURL property explicitly - NSString *authorizationHost = [signIn_.authorizationURL host]; - if ([authorizationHost hasSuffix:@".google.com"]) { - NSString *urlStr = [NSString stringWithFormat:@"https://%@/", - authorizationHost]; - NSURL *cookiesURL = [NSURL URLWithString:urlStr]; - [self setBrowserCookiesURL:cookiesURL]; - } - - [self setKeychainItemName:keychainItemName]; - } - return self; -} - -#if NS_BLOCKS_AVAILABLE -+ (id)controllerWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - keychainItemName:(NSString *)keychainItemName - completionHandler:(GTMOAuth2ViewControllerCompletionHandler)handler { - return [[[self alloc] initWithAuthentication:auth - authorizationURL:authorizationURL - keychainItemName:keychainItemName - completionHandler:handler] autorelease]; -} - -- (id)initWithAuthentication:(GTMOAuth2Authentication *)auth - authorizationURL:(NSURL *)authorizationURL - keychainItemName:(NSString *)keychainItemName - completionHandler:(GTMOAuth2ViewControllerCompletionHandler)handler { - // fall back to the non-blocks init - self = [self initWithAuthentication:auth - authorizationURL:authorizationURL - keychainItemName:keychainItemName - delegate:nil - finishedSelector:NULL]; - if (self) { - completionBlock_ = [handler copy]; - } - return self; -} -#endif - -- (void)dealloc { - [webView_ setDelegate:nil]; - - [backButton_ release]; - [forwardButton_ release]; - [initialActivityIndicator_ release]; - [navButtonsView_ release]; - [rightBarButtonItem_ release]; - [webView_ release]; - [signIn_ release]; - [request_ release]; - [delegate_ release]; -#if NS_BLOCKS_AVAILABLE - [completionBlock_ release]; - [popViewBlock_ release]; -#endif - [keychainItemName_ release]; - [initialHTMLString_ release]; - [browserCookiesURL_ release]; - [userData_ release]; - [properties_ release]; - - [super dealloc]; -} - -+ (NSString *)authNibName { - // subclasses may override this to specify a custom nib name - return @"GTMOAuth2ViewTouch"; -} - -+ (NSBundle *)authNibBundle { - // subclasses may override this to specify a custom nib bundle - return nil; -} - -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (GTMOAuth2Authentication *)authForGoogleFromKeychainForName:(NSString *)keychainItemName - clientID:(NSString *)clientID - clientSecret:(NSString *)clientSecret { - Class signInClass = [self signInClass]; - NSURL *tokenURL = [signInClass googleTokenURL]; - NSString *redirectURI = [signInClass nativeClientRedirectURI]; - - GTMOAuth2Authentication *auth; - auth = [GTMOAuth2Authentication authenticationWithServiceProvider:kGTMOAuth2ServiceProviderGoogle - tokenURL:tokenURL - redirectURI:redirectURI - clientID:clientID - clientSecret:clientSecret]; - [[self class] authorizeFromKeychainForName:keychainItemName - authentication:auth]; - return auth; -} -#endif - -+ (BOOL)authorizeFromKeychainForName:(NSString *)keychainItemName - authentication:(GTMOAuth2Authentication *)newAuth { - newAuth.accessToken = nil; - - BOOL didGetTokens = NO; - GTMOAuth2Keychain *keychain = [GTMOAuth2Keychain defaultKeychain]; - NSString *password = [keychain passwordForService:keychainItemName - account:kGTMOAuth2AccountName - error:nil]; - if (password != nil) { - [newAuth setKeysForResponseString:password]; - didGetTokens = YES; - } - return didGetTokens; -} - -+ (BOOL)removeAuthFromKeychainForName:(NSString *)keychainItemName { - GTMOAuth2Keychain *keychain = [GTMOAuth2Keychain defaultKeychain]; - return [keychain removePasswordForService:keychainItemName - account:kGTMOAuth2AccountName - error:nil]; -} - -+ (BOOL)saveParamsToKeychainForName:(NSString *)keychainItemName - authentication:(GTMOAuth2Authentication *)auth { - return [self saveParamsToKeychainForName:keychainItemName - accessibility:NULL - authentication:auth]; -} - -+ (BOOL)saveParamsToKeychainForName:(NSString *)keychainItemName - accessibility:(CFTypeRef)accessibility - authentication:(GTMOAuth2Authentication *)auth { - [self removeAuthFromKeychainForName:keychainItemName]; - // don't save unless we have a token that can really authorize requests - if (![auth canAuthorize]) return NO; - - if (accessibility == NULL - && &kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly != NULL) { - accessibility = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly; - } - - // make a response string containing the values we want to save - NSString *password = [auth persistenceResponseString]; - GTMOAuth2Keychain *keychain = [GTMOAuth2Keychain defaultKeychain]; - return [keychain setPassword:password - forService:keychainItemName - accessibility:accessibility - account:kGTMOAuth2AccountName - error:nil]; -} - -- (void)loadView { - NSString *nibPath = nil; - NSBundle *nibBundle = [self nibBundle]; - if (nibBundle == nil) { - nibBundle = [NSBundle mainBundle]; - } - NSString *nibName = self.nibName; - if (nibName != nil) { - nibPath = [nibBundle pathForResource:nibName ofType:@"nib"]; - } - if (nibPath != nil && [[NSFileManager defaultManager] fileExistsAtPath:nibPath]) { - [super loadView]; - } else { - // One of the requirements of loadView is that a valid view object is set to - // self.view upon completion. Otherwise, subclasses that attempt to - // access self.view after calling [super loadView] will enter an infinite - // loop due to the fact that UIViewController's -view accessor calls - // loadView when self.view is nil. - self.view = [[[UIView alloc] init] autorelease]; - -#if DEBUG - NSLog(@"missing %@.nib", nibName); -#endif - } -} - - -- (void)viewDidLoad { - [self setUpNavigation]; -} - -- (void)setUpNavigation { - rightBarButtonItem_.customView = navButtonsView_; - self.navigationItem.rightBarButtonItem = rightBarButtonItem_; -} - -- (void)popView { -#if NS_BLOCKS_AVAILABLE - void (^popViewBlock)() = self.popViewBlock; -#else - id popViewBlock = nil; -#endif - - if (popViewBlock || self.navigationController.topViewController == self) { - if (!self.view.hidden) { - // Set the flag to our viewWillDisappear method so it knows - // this is a disappearance initiated by the sign-in object, - // not the user cancelling via the navigation controller - didDismissSelf_ = YES; - - if (popViewBlock) { -#if NS_BLOCKS_AVAILABLE - popViewBlock(); - self.popViewBlock = nil; -#endif - } else { - [self.navigationController popViewControllerAnimated:YES]; - } - self.view.hidden = YES; - } - } -} - -- (void)notifyWithName:(NSString *)name - webView:(UIWebView *)webView - kind:(NSString *)kind { - BOOL isStarting = [name isEqual:kGTMOAuth2WebViewStartedLoading]; - if (hasNotifiedWebViewStartedLoading_ == isStarting) { - // Duplicate notification - // - // UIWebView's delegate methods are so unbalanced that there's little - // point trying to keep a count, as it could easily end up stuck greater - // than zero. - // - // We don't really have a way to track the starts and stops of - // subframe loads, too, as the webView in the notification is always - // for the topmost request. - return; - } - hasNotifiedWebViewStartedLoading_ = isStarting; - - // Notification for webview load starting and stopping - NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: - webView, kGTMOAuth2WebViewKey, - kind, kGTMOAuth2WebViewStopKindKey, // kind may be nil - nil]; - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc postNotificationName:name - object:self - userInfo:dict]; -} - -- (void)cancelSigningIn { - // The application has explicitly asked us to cancel signing in - // (so no further callback is required) - hasCalledFinished_ = YES; - - [delegate_ autorelease]; - delegate_ = nil; - -#if NS_BLOCKS_AVAILABLE - [completionBlock_ autorelease]; - completionBlock_ = nil; -#endif - - // The sign-in object's cancel method will close the window - [signIn_ cancelSigningIn]; - hasDoneFinalRedirect_ = YES; -} - -static Class gSignInClass = Nil; - -+ (Class)signInClass { - if (gSignInClass == Nil) { - gSignInClass = [GTMOAuth2SignIn class]; - } - return gSignInClass; -} - -+ (void)setSignInClass:(Class)theClass { - gSignInClass = theClass; -} - -#pragma mark Token Revocation - -#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT -+ (void)revokeTokenForGoogleAuthentication:(GTMOAuth2Authentication *)auth { - [[self signInClass] revokeTokenForGoogleAuthentication:auth]; -} -#endif - -#pragma mark Browser Cookies - -- (GTMOAuth2Authentication *)authentication { - return self.signIn.authentication; -} - -- (void)clearBrowserCookies { - // if browserCookiesURL is non-nil, then get cookies for that URL - // and delete them from the common application cookie storage - NSURL *cookiesURL = [self browserCookiesURL]; - if (cookiesURL) { - NSHTTPCookieStorage *cookieStorage; - - cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; - NSArray *cookies = [cookieStorage cookiesForURL:cookiesURL]; - - for (NSHTTPCookie *cookie in cookies) { - [cookieStorage deleteCookie:cookie]; - } - } -} - -#pragma mark Accessors - -- (void)setNetworkLossTimeoutInterval:(NSTimeInterval)val { - signIn_.networkLossTimeoutInterval = val; -} - -- (NSTimeInterval)networkLossTimeoutInterval { - return signIn_.networkLossTimeoutInterval; -} - -- (BOOL)shouldUseKeychain { - NSString *name = self.keychainItemName; - return ([name length] > 0); -} - -- (BOOL)showsInitialActivityIndicator { - return (mustShowActivityIndicator_ == 1 || initialHTMLString_ == nil); -} - -- (void)setShowsInitialActivityIndicator:(BOOL)flag { - mustShowActivityIndicator_ = (flag ? 1 : -1); -} - -#pragma mark User Properties - -- (void)setProperty:(id)obj forKey:(NSString *)key { - if (obj == nil) { - // User passed in nil, so delete the property - [properties_ removeObjectForKey:key]; - } else { - // Be sure the property dictionary exists - if (properties_ == nil) { - [self setProperties:[NSMutableDictionary dictionary]]; - } - [properties_ setObject:obj forKey:key]; - } -} - -- (id)propertyForKey:(NSString *)key { - id obj = [properties_ objectForKey:key]; - - // Be sure the returned pointer has the life of the autorelease pool, - // in case self is released immediately - return [[obj retain] autorelease]; -} - -#pragma mark SignIn callbacks - -- (void)signIn:(GTMOAuth2SignIn *)signIn displayRequest:(NSURLRequest *)request { - // This is the signIn object's webRequest method, telling the controller - // to either display the request in the webview, or if the request is nil, - // to close the window. - // - // All web requests and all window closing goes through this routine - -#if DEBUG - if (self.navigationController) { - if (self.navigationController.topViewController != self && request != nil) { - NSLog(@"Unexpected: Request to show, when already on top. request %@", [request URL]); - } else if(self.navigationController.topViewController != self && request == nil) { - NSLog(@"Unexpected: Request to pop, when not on top. request nil"); - } - } -#endif - - if (request != nil) { - const NSTimeInterval kJanuary2011 = 1293840000; - BOOL isDateValid = ([[NSDate date] timeIntervalSince1970] > kJanuary2011); - if (isDateValid) { - // Display the request. - self.request = request; - // The app may prefer some html other than blank white to be displayed - // before the sign-in web page loads. - // The first fetch might be slow, so the client programmer may want - // to show a local "loading" message. - // On iOS 5+, UIWebView will ignore loadHTMLString: if it's followed by - // a loadRequest: call, so if there is a "loading" message we defer - // the loadRequest: until after after we've drawn the "loading" message. - // - // If there is no initial html string, we show the activity indicator - // unless the user set showsInitialActivityIndicator to NO; if there - // is an initial html string, we hide the indicator unless the user set - // showsInitialActivityIndicator to YES. - NSString *html = self.initialHTMLString; - if ([html length] > 0) { - [initialActivityIndicator_ setHidden:(mustShowActivityIndicator_ < 1)]; - [self.webView loadHTMLString:html baseURL:nil]; - } else { - [initialActivityIndicator_ setHidden:(mustShowActivityIndicator_ < 0)]; - [self.webView loadRequest:request]; - } - } else { - // clock date is invalid, so signing in would fail with an unhelpful error - // from the server. Warn the user in an html string showing a watch icon, - // question mark, and the system date and time. Hopefully this will clue - // in brighter users, or at least give them a clue when they report the - // problem to developers. - // - // Even better is for apps to check the system clock and show some more - // helpful, localized instructions for users; this is really a fallback. - NSString *const html = @"
" - @"⌚ ?
System Clock Incorrect
%@" - @"
"; - NSString *errHTML = [NSString stringWithFormat:html, [NSDate date]]; - - [[self webView] loadHTMLString:errHTML baseURL:nil]; - } - } else { - // request was nil. - [self popView]; - } -} - -- (void)signIn:(GTMOAuth2SignIn *)signIn - finishedWithAuth:(GTMOAuth2Authentication *)auth - error:(NSError *)error { - if (!hasCalledFinished_) { - hasCalledFinished_ = YES; - - if (error == nil) { - if (self.shouldUseKeychain) { - NSString *keychainItemName = self.keychainItemName; - if (auth.canAuthorize) { - // save the auth params in the keychain - CFTypeRef accessibility = self.keychainItemAccessibility; - [[self class] saveParamsToKeychainForName:keychainItemName - accessibility:accessibility - authentication:auth]; - } else { - // remove the auth params from the keychain - [[self class] removeAuthFromKeychainForName:keychainItemName]; - } - } - } - - if (delegate_ && finishedSelector_) { - SEL sel = finishedSelector_; - NSMethodSignature *sig = [delegate_ methodSignatureForSelector:sel]; - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig]; - [invocation setSelector:sel]; - [invocation setTarget:delegate_]; - [invocation setArgument:&self atIndex:2]; - [invocation setArgument:&auth atIndex:3]; - [invocation setArgument:&error atIndex:4]; - [invocation invoke]; - } - - [delegate_ autorelease]; - delegate_ = nil; - -#if NS_BLOCKS_AVAILABLE - if (completionBlock_) { - completionBlock_(self, auth, error); - - // release the block here to avoid a retain loop on the controller - [completionBlock_ autorelease]; - completionBlock_ = nil; - } -#endif - } -} - -- (void)moveWebViewFromUnderNavigationBar { - CGRect dontCare; - CGRect webFrame = self.view.bounds; - UINavigationBar *navigationBar = self.navigationController.navigationBar; - CGRectDivide(webFrame, &dontCare, &webFrame, - navigationBar.frame.size.height, CGRectMinYEdge); - [self.webView setFrame:webFrame]; -} - -// isTranslucent is defined in iPhoneOS 3.0 on. -- (BOOL)isNavigationBarTranslucent { - UINavigationBar *navigationBar = [[self navigationController] navigationBar]; - BOOL isTranslucent = - ([navigationBar respondsToSelector:@selector(isTranslucent)] && - [navigationBar isTranslucent]); - return isTranslucent; -} - -#pragma mark - -#pragma mark Protocol implementations - -- (void)viewWillAppear:(BOOL)animated { - // See the comment on clearBrowserCookies in viewDidDisappear. - [self clearBrowserCookies]; - - if (!isViewShown_) { - isViewShown_ = YES; - if ([self isNavigationBarTranslucent]) { - [self moveWebViewFromUnderNavigationBar]; - } - if (![signIn_ startSigningIn]) { - // Can't start signing in. We must pop our view. - // UIWebview needs time to stabilize. Animations need time to complete. - // We remove ourself from the view stack after that. - [self performSelector:@selector(popView) - withObject:nil - afterDelay:0.5 - inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]]; - } - } - [super viewWillAppear:animated]; -} - -- (void)viewDidAppear:(BOOL)animated { - didViewAppear_ = YES; - [super viewDidAppear:animated]; -} - -- (void)viewWillDisappear:(BOOL)animated { - if (!didDismissSelf_) { - // We won't receive further webview delegate messages, so be sure the - // started loading notification is balanced, if necessary - [self notifyWithName:kGTMOAuth2WebViewStoppedLoading - webView:self.webView - kind:kGTMOAuth2WebViewCancelled]; - - // We are not popping ourselves, so presumably we are being popped by the - // navigation controller; tell the sign-in object to close up shop - // - // this will indirectly call our signIn:finishedWithAuth:error: method - // for us - [signIn_ windowWasClosed]; - -#if NS_BLOCKS_AVAILABLE - self.popViewBlock = nil; -#endif - } - - [super viewWillDisappear:animated]; -} - -- (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; - - // prevent the next sign-in from showing in the WebView that the user is - // already signed in. It's possible for the WebView to set the cookies even - // after this, so we also clear them when the view first appears. - [self clearBrowserCookies]; -} - -- (void)viewDidLayoutSubviews { - // We don't call super's version of this method because - // -[UIViewController viewDidLayoutSubviews] is documented as a no-op, that - // didn't exist before iOS 5. - [initialActivityIndicator_ setCenter:[webView_ center]]; -} - -- (BOOL)webView:(UIWebView *)webView - shouldStartLoadWithRequest:(NSURLRequest *)request - navigationType:(UIWebViewNavigationType)navigationType { - - if (!hasDoneFinalRedirect_) { - hasDoneFinalRedirect_ = [signIn_ requestRedirectedToRequest:request]; - if (hasDoneFinalRedirect_) { - // signIn has told the view to close - return NO; - } - } - return YES; -} - -- (void)updateUI { - [backButton_ setEnabled:[[self webView] canGoBack]]; - [forwardButton_ setEnabled:[[self webView] canGoForward]]; -} - -- (void)webViewDidStartLoad:(UIWebView *)webView { - [self notifyWithName:kGTMOAuth2WebViewStartedLoading - webView:webView - kind:nil]; - [self updateUI]; -} - -- (void)webViewDidFinishLoad:(UIWebView *)webView { - [self notifyWithName:kGTMOAuth2WebViewStoppedLoading - webView:webView - kind:kGTMOAuth2WebViewFinished]; - - NSString *title = [webView stringByEvaluatingJavaScriptFromString:@"document.title"]; - if ([title length] > 0) { - [signIn_ titleChanged:title]; - } else { -#if DEBUG - // Verify that Javascript is enabled - NSString *result = [webView stringByEvaluatingJavaScriptFromString:@"1+1"]; - NSAssert([result integerValue] == 2, @"GTMOAuth2: Javascript is required"); -#endif - } - - if (self.request && [self.initialHTMLString length] > 0) { - // The request was pending. - [self setInitialHTMLString:nil]; - [self.webView loadRequest:self.request]; - } else { - [initialActivityIndicator_ setHidden:YES]; - [signIn_ cookiesChanged:[NSHTTPCookieStorage sharedHTTPCookieStorage]]; - - [self updateUI]; - } -} - -- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { - [self notifyWithName:kGTMOAuth2WebViewStoppedLoading - webView:webView - kind:kGTMOAuth2WebViewFailed]; - - // Tell the sign-in object that a load failed; if it was the authorization - // URL, it will pop the view and return an error to the delegate. - if (didViewAppear_) { - BOOL isUserInterruption = ([error code] == NSURLErrorCancelled - && [[error domain] isEqual:NSURLErrorDomain]); - if (isUserInterruption) { - // Ignore this error: - // Users report that this error occurs when clicking too quickly on the - // accept button, before the page has completely loaded. Ignoring - // this error seems to provide a better experience than does immediately - // cancelling sign-in. - // - // This error also occurs whenever UIWebView is sent the stopLoading - // message, so if we ever send that message intentionally, we need to - // revisit this bypass. - return; - } - - [signIn_ loadFailedWithError:error]; - } else { - // UIWebview needs time to stabilize. Animations need time to complete. - [signIn_ performSelector:@selector(loadFailedWithError:) - withObject:error - afterDelay:0.5 - inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]]; - } -} - -#if __IPHONE_OS_VERSION_MIN_REQUIRED < 60000 -// When running on a device with an OS version < 6, this gets called. -// -// Since it is never called in iOS 6 or greater, if your min deployment -// target is iOS6 or greater, then you don't need to have this method compiled -// into your app. -// -// When running on a device with an OS version 6 or greater, this code is -// not called. - (NSUInteger)supportedInterfaceOrientations; would be called, -// if it existed. Since it is absent, -// Allow the default orientations: All for iPad, all but upside down for iPhone. -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - BOOL value = YES; - if (!isInsideShouldAutorotateToInterfaceOrientation_) { - isInsideShouldAutorotateToInterfaceOrientation_ = YES; - UIViewController *navigationController = [self navigationController]; - if (navigationController != nil) { - value = [navigationController shouldAutorotateToInterfaceOrientation:interfaceOrientation]; - } else { - value = [super shouldAutorotateToInterfaceOrientation:interfaceOrientation]; - } - isInsideShouldAutorotateToInterfaceOrientation_ = NO; - } - return value; -} -#endif - - -@end - - -#pragma mark Common Code - -@implementation GTMOAuth2Keychain - -+ (GTMOAuth2Keychain *)defaultKeychain { - if (sDefaultKeychain == nil) { - sDefaultKeychain = [[self alloc] init]; - } - return sDefaultKeychain; -} - - -// For unit tests: allow setting a mock object -+ (void)setDefaultKeychain:(GTMOAuth2Keychain *)keychain { - if (sDefaultKeychain != keychain) { - [sDefaultKeychain release]; - sDefaultKeychain = [keychain retain]; - } -} - -- (NSString *)keyForService:(NSString *)service account:(NSString *)account { - return [NSString stringWithFormat:@"com.google.GTMOAuth.%@%@", service, account]; -} - -// The Keychain API isn't available on the iPhone simulator in SDKs before 3.0, -// so, on early simulators we use a fake API, that just writes, unencrypted, to -// NSUserDefaults. -#if TARGET_IPHONE_SIMULATOR && __IPHONE_OS_VERSION_MAX_ALLOWED < 30000 -#pragma mark Simulator - -// Simulator - just simulated, not secure. -- (NSString *)passwordForService:(NSString *)service account:(NSString *)account error:(NSError **)error { - NSString *result = nil; - if (0 < [service length] && 0 < [account length]) { - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - NSString *key = [self keyForService:service account:account]; - result = [defaults stringForKey:key]; - if (result == nil && error != NULL) { - *error = [NSError errorWithDomain:kGTMOAuth2KeychainErrorDomain - code:kGTMOAuth2KeychainErrorNoPassword - userInfo:nil]; - } - } else if (error != NULL) { - *error = [NSError errorWithDomain:kGTMOAuth2KeychainErrorDomain - code:kGTMOAuth2KeychainErrorBadArguments - userInfo:nil]; - } - return result; - -} - - -// Simulator - just simulated, not secure. -- (BOOL)removePasswordForService:(NSString *)service account:(NSString *)account error:(NSError **)error { - BOOL didSucceed = NO; - if (0 < [service length] && 0 < [account length]) { - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - NSString *key = [self keyForService:service account:account]; - [defaults removeObjectForKey:key]; - [defaults synchronize]; - } else if (error != NULL) { - *error = [NSError errorWithDomain:kGTMOAuth2KeychainErrorDomain - code:kGTMOAuth2KeychainErrorBadArguments - userInfo:nil]; - } - return didSucceed; -} - -// Simulator - just simulated, not secure. -- (BOOL)setPassword:(NSString *)password - forService:(NSString *)service - accessibility:(CFTypeRef)accessibility - account:(NSString *)account - error:(NSError **)error { - BOOL didSucceed = NO; - if (0 < [password length] && 0 < [service length] && 0 < [account length]) { - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - NSString *key = [self keyForService:service account:account]; - [defaults setObject:password forKey:key]; - [defaults synchronize]; - didSucceed = YES; - } else if (error != NULL) { - *error = [NSError errorWithDomain:kGTMOAuth2KeychainErrorDomain - code:kGTMOAuth2KeychainErrorBadArguments - userInfo:nil]; - } - return didSucceed; -} - -#else // ! TARGET_IPHONE_SIMULATOR -#pragma mark Device - -+ (NSMutableDictionary *)keychainQueryForService:(NSString *)service account:(NSString *)account { - NSMutableDictionary *query = [NSMutableDictionary dictionaryWithObjectsAndKeys: - (id)kSecClassGenericPassword, (id)kSecClass, - @"OAuth", (id)kSecAttrGeneric, - account, (id)kSecAttrAccount, - service, (id)kSecAttrService, - nil]; - return query; -} - -- (NSMutableDictionary *)keychainQueryForService:(NSString *)service account:(NSString *)account { - return [[self class] keychainQueryForService:service account:account]; -} - - - -// iPhone -- (NSString *)passwordForService:(NSString *)service account:(NSString *)account error:(NSError **)error { - OSStatus status = kGTMOAuth2KeychainErrorBadArguments; - NSString *result = nil; - if (0 < [service length] && 0 < [account length]) { - CFDataRef passwordData = NULL; - NSMutableDictionary *keychainQuery = [self keychainQueryForService:service account:account]; - [keychainQuery setObject:(id)kCFBooleanTrue forKey:(id)kSecReturnData]; - [keychainQuery setObject:(id)kSecMatchLimitOne forKey:(id)kSecMatchLimit]; - - status = SecItemCopyMatching((CFDictionaryRef)keychainQuery, - (CFTypeRef *)&passwordData); - if (status == noErr && 0 < [(NSData *)passwordData length]) { - result = [[[NSString alloc] initWithData:(NSData *)passwordData - encoding:NSUTF8StringEncoding] autorelease]; - } - if (passwordData != NULL) { - CFRelease(passwordData); - } - } - if (status != noErr && error != NULL) { - *error = [NSError errorWithDomain:kGTMOAuth2KeychainErrorDomain - code:status - userInfo:nil]; - } - return result; -} - - -// iPhone -- (BOOL)removePasswordForService:(NSString *)service account:(NSString *)account error:(NSError **)error { - OSStatus status = kGTMOAuth2KeychainErrorBadArguments; - if (0 < [service length] && 0 < [account length]) { - NSMutableDictionary *keychainQuery = [self keychainQueryForService:service account:account]; - status = SecItemDelete((CFDictionaryRef)keychainQuery); - } - if (status != noErr && error != NULL) { - *error = [NSError errorWithDomain:kGTMOAuth2KeychainErrorDomain - code:status - userInfo:nil]; - } - return status == noErr; -} - -// iPhone -- (BOOL)setPassword:(NSString *)password - forService:(NSString *)service - accessibility:(CFTypeRef)accessibility - account:(NSString *)account - error:(NSError **)error { - OSStatus status = kGTMOAuth2KeychainErrorBadArguments; - if (0 < [service length] && 0 < [account length]) { - [self removePasswordForService:service account:account error:nil]; - if (0 < [password length]) { - NSMutableDictionary *keychainQuery = [self keychainQueryForService:service account:account]; - NSData *passwordData = [password dataUsingEncoding:NSUTF8StringEncoding]; - [keychainQuery setObject:passwordData forKey:(id)kSecValueData]; - - if (accessibility != NULL && &kSecAttrAccessible != NULL) { - [keychainQuery setObject:(id)accessibility - forKey:(id)kSecAttrAccessible]; - } - status = SecItemAdd((CFDictionaryRef)keychainQuery, NULL); - } - } - if (status != noErr && error != NULL) { - *error = [NSError errorWithDomain:kGTMOAuth2KeychainErrorDomain - code:status - userInfo:nil]; - } - return status == noErr; -} - -#endif // ! TARGET_IPHONE_SIMULATOR - -@end - -#endif // TARGET_OS_IPHONE - -#endif // #if GTM_INCLUDE_OAUTH2 || !GDATA_REQUIRE_SERVICE_INCLUDES diff --git a/External/google-plus-ios-sdk/OpenSource/GTMObjC2Runtime.h b/External/google-plus-ios-sdk/OpenSource/GTMObjC2Runtime.h deleted file mode 100644 index e4e2ac72..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMObjC2Runtime.h +++ /dev/null @@ -1,113 +0,0 @@ -// -// GTMObjC2Runtime.h -// -// Copyright 2007-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -#import -#import -#import "GTMDefines.h" - -// These functions exist for code that we want to compile on both the < 10.5 -// sdks and on the >= 10.5 sdks without warnings. It basically reimplements -// certain parts of the objc2 runtime in terms of the objc1 runtime. It is not -// a complete implementation as I've only implemented the routines I know we -// use. Feel free to add more as necessary. -// These functions are not documented because they conform to the documentation -// for the ObjC2 Runtime. - -#if OBJC_API_VERSION >= 2 // Only have optional and req'd keywords in ObjC2. -#define AT_OPTIONAL @optional -#define AT_REQUIRED @required -#else -#define AT_OPTIONAL -#define AT_REQUIRED -#endif - -// The file objc-runtime.h was moved to runtime.h and in Leopard, objc-runtime.h -// was just a wrapper around runtime.h. For the iPhone SDK, this objc-runtime.h -// is removed in the iPhoneOS2.0 SDK. -// -// The |Object| class was removed in the iPhone2.0 SDK too. -#if GTM_IPHONE_SDK -#import -#import -#else -#import -#import -#endif - -#import - -#if GTM_MACOS_SDK && (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) -#import "objc/Protocol.h" - -OBJC_EXPORT Class object_getClass(id obj); -OBJC_EXPORT const char *class_getName(Class cls); -OBJC_EXPORT BOOL class_conformsToProtocol(Class cls, Protocol *protocol); -OBJC_EXPORT BOOL class_respondsToSelector(Class cls, SEL sel); -OBJC_EXPORT Class class_getSuperclass(Class cls); -OBJC_EXPORT Method *class_copyMethodList(Class cls, unsigned int *outCount); -OBJC_EXPORT SEL method_getName(Method m); -OBJC_EXPORT void method_exchangeImplementations(Method m1, Method m2); -OBJC_EXPORT IMP method_getImplementation(Method method); -OBJC_EXPORT IMP method_setImplementation(Method method, IMP imp); -OBJC_EXPORT struct objc_method_description protocol_getMethodDescription(Protocol *p, - SEL aSel, - BOOL isRequiredMethod, - BOOL isInstanceMethod); -OBJC_EXPORT BOOL sel_isEqual(SEL lhs, SEL rhs); - -// If building for 10.4 but using the 10.5 SDK, don't include these. -#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 -// atomics -// On Leopard these are GC aware -// Intentionally did not include the non-barrier versions, because I couldn't -// come up with a case personally where you wouldn't want to use the -// barrier versions. -GTM_INLINE bool OSAtomicCompareAndSwapPtrBarrier(void *predicate, - void *replacement, - void * volatile *theValue) { -#if defined(__LP64__) && __LP64__ - return OSAtomicCompareAndSwap64Barrier((int64_t)predicate, - (int64_t)replacement, - (int64_t *)theValue); -#else // defined(__LP64__) && __LP64__ - return OSAtomicCompareAndSwap32Barrier((int32_t)predicate, - (int32_t)replacement, - (int32_t *)theValue); -#endif // defined(__LP64__) && __LP64__ -} - -#endif // MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 -#endif // GTM_MACOS_SDK && (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) - -#if GTM_MACOS_SDK && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5) - -GTM_INLINE BOOL objc_atomicCompareAndSwapGlobalBarrier(id predicate, - id replacement, - volatile id *objectLocation) { - return OSAtomicCompareAndSwapPtrBarrier(predicate, - replacement, - (void * volatile *)objectLocation); -} -GTM_INLINE BOOL objc_atomicCompareAndSwapInstanceVariableBarrier(id predicate, - id replacement, - volatile id *objectLocation) { - return OSAtomicCompareAndSwapPtrBarrier(predicate, - replacement, - (void * volatile *)objectLocation); -} -#endif // GTM_MACOS_SDK && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5) diff --git a/External/google-plus-ios-sdk/OpenSource/GTMObjC2Runtime.m b/External/google-plus-ios-sdk/OpenSource/GTMObjC2Runtime.m deleted file mode 100644 index f284542c..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GTMObjC2Runtime.m +++ /dev/null @@ -1,163 +0,0 @@ -// -// GTMObjC2Runtime.m -// -// Copyright 2007-2008 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy -// of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. -// - -#import "GTMObjC2Runtime.h" - -#if GTM_MACOS_SDK && (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) -#import -#import - -Class object_getClass(id obj) { - if (!obj) return NULL; - return obj->isa; -} - -const char *class_getName(Class cls) { - if (!cls) return "nil"; - return cls->name; -} - -BOOL class_conformsToProtocol(Class cls, Protocol *protocol) { - // We intentionally don't check cls as it crashes on Leopard so we want - // to crash on Tiger as well. - // I logged - // Radar 5572978 class_conformsToProtocol crashes when arg1 is passed as nil - // because it seems odd that this API won't accept nil for cls considering - // all the other apis will accept nil args. - // If this does get fixed, remember to enable the unit tests. - if (!protocol) return NO; - - struct objc_protocol_list *protos; - for (protos = cls->protocols; protos != NULL; protos = protos->next) { - for (long i = 0; i < protos->count; i++) { - if ([protos->list[i] conformsTo:protocol]) { - return YES; - } - } - } - return NO; -} - -Class class_getSuperclass(Class cls) { - if (!cls) return NULL; - return cls->super_class; -} - -BOOL class_respondsToSelector(Class cls, SEL sel) { - return class_getInstanceMethod(cls, sel) != nil; -} - -Method *class_copyMethodList(Class cls, unsigned int *outCount) { - if (!cls) return NULL; - - unsigned int count = 0; - void *iterator = NULL; - struct objc_method_list *mlist; - Method *methods = NULL; - if (outCount) *outCount = 0; - - while ( (mlist = class_nextMethodList(cls, &iterator)) ) { - if (mlist->method_count == 0) continue; - methods = (Method *)realloc(methods, - sizeof(Method) * (count + mlist->method_count + 1)); - if (!methods) { - //Memory alloc failed, so what can we do? - return NULL; // COV_NF_LINE - } - for (int i = 0; i < mlist->method_count; i++) { - methods[i + count] = &mlist->method_list[i]; - } - count += mlist->method_count; - } - - // List must be NULL terminated - if (methods) { - methods[count] = NULL; - } - if (outCount) *outCount = count; - return methods; -} - -SEL method_getName(Method method) { - if (!method) return NULL; - return method->method_name; -} - -IMP method_getImplementation(Method method) { - if (!method) return NULL; - return method->method_imp; -} - -IMP method_setImplementation(Method method, IMP imp) { - // We intentionally don't test method for nil. - // Leopard fails here, so should we. - // I logged this as Radar: - // 5572981 method_setImplementation crashes if you pass nil for the - // method arg (arg 1) - // because it seems odd that this API won't accept nil for method considering - // all the other apis will accept nil args. - // If this does get fixed, remember to enable the unit tests. - // This method works differently on SnowLeopard than - // on Leopard. If you pass in a nil for IMP on SnowLeopard - // it doesn't change anything. On Leopard it will. Since - // attempting to change a sel to nil is probably an error - // we follow the SnowLeopard way of doing things. - IMP oldImp = NULL; - if (imp) { - oldImp = method->method_imp; - method->method_imp = imp; - } - return oldImp; -} - -void method_exchangeImplementations(Method m1, Method m2) { - if (m1 == m2) return; - if (!m1 || !m2) return; - IMP imp2 = method_getImplementation(m2); - IMP imp1 = method_setImplementation(m1, imp2); - method_setImplementation(m2, imp1); -} - -struct objc_method_description protocol_getMethodDescription(Protocol *p, - SEL aSel, - BOOL isRequiredMethod, - BOOL isInstanceMethod) { - struct objc_method_description *descPtr = NULL; - // No such thing as required in ObjC1. - if (isInstanceMethod) { - descPtr = [p descriptionForInstanceMethod:aSel]; - } else { - descPtr = [p descriptionForClassMethod:aSel]; - } - - struct objc_method_description desc; - if (descPtr) { - desc = *descPtr; - } else { - bzero(&desc, sizeof(desc)); - } - return desc; -} - -BOOL sel_isEqual(SEL lhs, SEL rhs) { - // Apple (informally) promises this will work in the future: - // http://twitter.com/#!/gparker/status/2400099786 - return (lhs == rhs) ? YES : NO; -} - -#endif // GTM_MACOS_SDK && (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) diff --git a/External/google-plus-ios-sdk/OpenSource/GoogleOpenSource.h b/External/google-plus-ios-sdk/OpenSource/GoogleOpenSource.h deleted file mode 100644 index 8703285c..00000000 --- a/External/google-plus-ios-sdk/OpenSource/GoogleOpenSource.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// GoogleOpenSource.h -// Google+ iOS SDK -// -// Copyright 2013 Google Inc. -// -// Use of this SDK is subject to the Google+ Platform Terms of Service: -// https://developers.google.com/+/terms -// - - -// GTM. -#import "GTMDefines.h" -#import "GTMHTTPFetcher.h" -#import "GTMHTTPFetcherService.h" -#import "GTMHTTPFetchHistory.h" -#import "GTMLogger.h" -#import "GTMMethodCheck.h" -#import "GTMNSDictionary+URLArguments.h" -#import "GTMNSString+URLArguments.h" -#import "GTMOAuth2Authentication.h" -#import "GTMOAuth2SignIn.h" -#import "GTMOAuth2ViewControllerTouch.h" -#import "GTMObjC2Runtime.h" - -// Chrome. -#import "OpenInChromeController.h" - -// GTL. -#import "GTLDefines.h" -#import "GTLBatchQuery.h" -#import "GTLBatchResult.h" -#import "GTLDateTime.h" -#import "GTLErrorObject.h" -#import "GTLObject.h" -#import "GTLQuery.h" -#import "GTLRuntimeCommon.h" -#import "GTLService.h" -#import "GTLFramework.h" -#import "GTLJSONParser.h" -#import "GTLUtilities.h" - -// GTLPlus. -#import "GTLPlus.h" diff --git a/External/google-plus-ios-sdk/OpenSource/OpenInChromeController.h b/External/google-plus-ios-sdk/OpenSource/OpenInChromeController.h deleted file mode 100644 index 35363a71..00000000 --- a/External/google-plus-ios-sdk/OpenSource/OpenInChromeController.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2012, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#import - -// This class is used to check if Google Chrome is installed in the system and -// to open a URL in Google Chrome either with or without a callback URL. -@interface OpenInChromeController : NSObject - -// Returns a shared instance of the OpenInChromeController. -+ (OpenInChromeController *)sharedInstance; - -// Returns YES if Google Chrome is installed in the user's system. -- (BOOL)isChromeInstalled; - -// Opens a URL in Google Chrome. -- (BOOL)openInChrome:(NSURL *)url; - -// Open a URL in Google Chrome providing a |callbackURL| to return to the app. -// URLs from the same app will be opened in the same tab unless |createNewTab| -// is set to YES. -// |callbackURL| can be nil. -// The return value of this method is YES if the URL is successfully opened. -- (BOOL)openInChrome:(NSURL *)url - withCallbackURL:(NSURL *)callbackURL - createNewTab:(BOOL)createNewTab; - -@end diff --git a/External/google-plus-ios-sdk/OpenSource/OpenInChromeController.m b/External/google-plus-ios-sdk/OpenSource/OpenInChromeController.m deleted file mode 100644 index 30b18b5e..00000000 --- a/External/google-plus-ios-sdk/OpenSource/OpenInChromeController.m +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2012, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#import - -#import "OpenInChromeController.h" - -static NSString * const kGoogleChromeHTTPScheme = @"googlechrome:"; -static NSString * const kGoogleChromeHTTPSScheme = @"googlechromes:"; -static NSString * const kGoogleChromeCallbackScheme = - @"googlechrome-x-callback:"; - -static NSString * encodeByAddingPercentEscapes(NSString *input) { - NSString *encodedValue = - (NSString *)CFURLCreateStringByAddingPercentEscapes( - kCFAllocatorDefault, - (CFStringRef)input, - NULL, - (CFStringRef)@"!*'();:@&=+$,/?%#[]", - kCFStringEncodingUTF8); - return [encodedValue autorelease]; -} - -@implementation OpenInChromeController - -+ (OpenInChromeController *)sharedInstance { - static OpenInChromeController *sharedInstance; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedInstance = [[self alloc] init]; - }); - return sharedInstance; -} - -- (BOOL)isChromeInstalled { - NSURL *simpleURL = [NSURL URLWithString:kGoogleChromeHTTPScheme]; - NSURL *callbackURL = [NSURL URLWithString:kGoogleChromeCallbackScheme]; - return [[UIApplication sharedApplication] canOpenURL:simpleURL] || - [[UIApplication sharedApplication] canOpenURL:callbackURL]; -} - -- (BOOL)openInChrome:(NSURL *)url { - return [self openInChrome:url withCallbackURL:nil createNewTab:NO]; -} - -- (BOOL)openInChrome:(NSURL *)url - withCallbackURL:(NSURL *)callbackURL - createNewTab:(BOOL)createNewTab { - NSURL *chromeSimpleURL = [NSURL URLWithString:kGoogleChromeHTTPScheme]; - NSURL *chromeCallbackURL = [NSURL URLWithString:kGoogleChromeCallbackScheme]; - if ([[UIApplication sharedApplication] canOpenURL:chromeCallbackURL]) { - NSString *appName = - [[NSBundle mainBundle] - objectForInfoDictionaryKey:@"CFBundleDisplayName"]; - - NSString *scheme = [url.scheme lowercaseString]; - - // Proceed only if scheme is http or https. - if ([scheme isEqualToString:@"http"] || - [scheme isEqualToString:@"https"]) { - - NSMutableString *chromeURLString = [NSMutableString string]; - [chromeURLString appendFormat: - @"%@//x-callback-url/open/?x-source=%@&url=%@", - kGoogleChromeCallbackScheme, - encodeByAddingPercentEscapes(appName), - encodeByAddingPercentEscapes([url absoluteString])]; - if (callbackURL) { - [chromeURLString appendFormat:@"&x-success=%@", - encodeByAddingPercentEscapes([callbackURL absoluteString])]; - } - if (createNewTab) { - [chromeURLString appendString:@"&create-new-tab"]; - } - - NSURL *chromeURL = [NSURL URLWithString:chromeURLString]; - - // Open the URL with Google Chrome. - return [[UIApplication sharedApplication] openURL:chromeURL]; - } - } else if ([[UIApplication sharedApplication] canOpenURL:chromeSimpleURL]) { - NSString *scheme = [url.scheme lowercaseString]; - - // Replace the URL Scheme with the Chrome equivalent. - NSString *chromeScheme = nil; - if ([scheme isEqualToString:@"http"]) { - chromeScheme = kGoogleChromeHTTPScheme; - } else if ([scheme isEqualToString:@"https"]) { - chromeScheme = kGoogleChromeHTTPSScheme; - } - - // Proceed only if a valid Google Chrome URI Scheme is available. - if (chromeScheme) { - NSString *absoluteString = [url absoluteString]; - NSRange rangeForScheme = [absoluteString rangeOfString:@":"]; - NSString *urlNoScheme = - [absoluteString substringFromIndex:rangeForScheme.location + 1]; - NSString *chromeURLString = - [chromeScheme stringByAppendingString:urlNoScheme]; - NSURL *chromeURL = [NSURL URLWithString:chromeURLString]; - - // Open the URL with Google Chrome. - return [[UIApplication sharedApplication] openURL:chromeURL]; - } - } - return NO; -} - -@end diff --git a/External/google-plus-ios-sdk/README b/External/google-plus-ios-sdk/README deleted file mode 100644 index a762f556..00000000 --- a/External/google-plus-ios-sdk/README +++ /dev/null @@ -1,27 +0,0 @@ -This Google+ iOS SDK allows users to sign in and share with Google+ from -third-party apps. The SDK also provides Google+ APIs for the app to access -the list of people in user-selected circles and to read and write user's app -activities. The SDK contains the following files: - -README -- This file. - -Changelog -- The versions and changes of the SDK. - -GooglePlus.framework/ -- The Google+ SDK framework. - -GooglePlus.bundle/ -- Resources that can be used in your app. - Required if |GPPSignInButton| is used. - -GoogleOpenSource.framework/ -- A framework containing all the open source files - used by the SDK. - Either add this framework or add individual - files in OpenSource/ directory into your project. - -OpenSource/ -- Google open source files used by the SDK. - This contains the same code as in GoogleOpenSource.framework. - If you're not adding GoogleOpenSource.framework, add the files - you need from this directory into your project. - -SampleCode/ -- Sample code for your reference only. - Do not include this in your project. - GooglePlusSample.xcodeproj/ -- The Xcode project. diff --git a/External/google-plus-ios-sdk/SampleCode/AppDelegate.h b/External/google-plus-ios-sdk/SampleCode/AppDelegate.h deleted file mode 100644 index 4b7360a2..00000000 --- a/External/google-plus-ios-sdk/SampleCode/AppDelegate.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// AppDelegate.h -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import - -@class GTMOAuth2Authentication; - -@interface AppDelegate : UIResponder - -// The sample app's |UIWindow|. -@property (retain, nonatomic) UIWindow *window; -// The navigation controller. -@property (retain, nonatomic) UINavigationController *navigationController; - -@end diff --git a/External/google-plus-ios-sdk/SampleCode/AppDelegate.m b/External/google-plus-ios-sdk/SampleCode/AppDelegate.m deleted file mode 100644 index 51c4b340..00000000 --- a/External/google-plus-ios-sdk/SampleCode/AppDelegate.m +++ /dev/null @@ -1,90 +0,0 @@ -// -// AppDelegate.m -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "AppDelegate.h" - -#import -#import "MasterViewController.h" - -@interface AppDelegate () - -@end - -@implementation AppDelegate - -@synthesize window = window_; -@synthesize navigationController = navigationController_; - -// DO NOT USE THIS CLIENT ID. IT WILL NOT WORK FOR YOUR APP. -// Please use the client ID created for you by Google. -static NSString * const kClientID = - @"452265719636.apps.googleusercontent.com"; - -#pragma mark Object life-cycle. - -- (void)dealloc { - [window_ release]; - [navigationController_ release]; - [super dealloc]; -} - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Set app's client ID for |GPPSignIn| and |GPPShare|. - [GPPSignIn sharedInstance].clientID = kClientID; - - self.window = [[[UIWindow alloc] - initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; - MasterViewController *masterViewController = - [[[MasterViewController alloc] initWithNibName:@"MasterViewController" - bundle:nil] autorelease]; - self.navigationController = - [[[UINavigationController alloc] - initWithRootViewController:masterViewController] autorelease]; - self.window.rootViewController = self.navigationController; - [self.window makeKeyAndVisible]; - - // Read Google+ deep-link data. - [GPPDeepLink setDelegate:self]; - [GPPDeepLink readDeepLinkAfterInstall]; - return YES; -} - -- (BOOL)application:(UIApplication *)application - openURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication - annotation:(id)annotation { - return [GPPURLHandler handleURL:url - sourceApplication:sourceApplication - annotation:annotation]; -} - -#pragma mark - GPPDeepLinkDelegate - -- (void)didReceiveDeepLink:(GPPDeepLink *)deepLink { - // An example to handle the deep link data. - UIAlertView *alert = [[[UIAlertView alloc] - initWithTitle:@"Deep-link Data" - message:[deepLink deepLinkID] - delegate:nil - cancelButtonTitle:@"OK" - otherButtonTitles:nil] autorelease]; - [alert show]; -} - -@end diff --git a/External/google-plus-ios-sdk/SampleCode/GooglePlusSample-Info.plist b/External/google-plus-ios-sdk/SampleCode/GooglePlusSample-Info.plist deleted file mode 100644 index 707c3762..00000000 --- a/External/google-plus-ios-sdk/SampleCode/GooglePlusSample-Info.plist +++ /dev/null @@ -1,78 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFiles - - Icon.png - Icon-72.png - Icon-144.png - Icon@2x.png - - CFBundleIcons - - CFBundlePrimaryIcon - - CFBundleIconFiles - - Icon.png - Icon-72.png - Icon-144.png - Icon@2x.png - - - - CFBundleIdentifier - com.google.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleURLTypes - - - CFBundleTypeRole - Editor - CFBundleURLName - com.google.GooglePlusSample - CFBundleURLSchemes - - com.google.GooglePlusSample - - - - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/External/google-plus-ios-sdk/SampleCode/GooglePlusSample-Prefix.pch b/External/google-plus-ios-sdk/SampleCode/GooglePlusSample-Prefix.pch deleted file mode 100644 index bda6af71..00000000 --- a/External/google-plus-ios-sdk/SampleCode/GooglePlusSample-Prefix.pch +++ /dev/null @@ -1,14 +0,0 @@ -// -// Prefix header for all source files of the 'GooglePlusSample' target in the 'GooglePlusSample' project -// - -#import - -#ifndef __IPHONE_4_0 -#warning "This project uses features only available in iOS SDK 4.0 and later." -#endif - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/External/google-plus-ios-sdk/SampleCode/GooglePlusSample.xcodeproj/project.pbxproj b/External/google-plus-ios-sdk/SampleCode/GooglePlusSample.xcodeproj/project.pbxproj deleted file mode 100644 index d484a364..00000000 --- a/External/google-plus-ios-sdk/SampleCode/GooglePlusSample.xcodeproj/project.pbxproj +++ /dev/null @@ -1,503 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 0043C79F1580045B000DF02E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0043C79E1580045B000DF02E /* UIKit.framework */; }; - 0043C7A11580045B000DF02E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0043C7A01580045B000DF02E /* Foundation.framework */; }; - 0043C7A31580045B000DF02E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0043C7A21580045B000DF02E /* CoreGraphics.framework */; }; - 00F70E83158006DC0077799E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F70E82158006DC0077799E /* main.m */; }; - 00F70E99158007D90077799E /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00F70E98158007D90077799E /* Security.framework */; }; - 00F70E9B158008040077799E /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00F70E9A158008040077799E /* SystemConfiguration.framework */; }; - 0C52D6F8158BAB1F001510E6 /* button_background.png in Resources */ = {isa = PBXBuildFile; fileRef = 0C52D6F7158BAB1F001510E6 /* button_background.png */; }; - 8E47E994171CB75C003FBA75 /* GoogleOpenSource.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E47E991171CB75C003FBA75 /* GoogleOpenSource.framework */; }; - 8E47E995171CB75C003FBA75 /* GooglePlus.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8E47E992171CB75C003FBA75 /* GooglePlus.bundle */; }; - 8E47E996171CB75C003FBA75 /* GooglePlus.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E47E993171CB75C003FBA75 /* GooglePlus.framework */; }; - D907F676166967D400EB5273 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D907F675166967D400EB5273 /* Icon@2x.png */; }; - D945ED39166AE4950051858C /* ListMomentsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D945ED34166AE4950051858C /* ListMomentsViewController.m */; }; - D945ED3A166AE4950051858C /* ListMomentsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D945ED35166AE4950051858C /* ListMomentsViewController.xib */; }; - D945ED3B166AE4950051858C /* ListPeopleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D945ED37166AE4950051858C /* ListPeopleViewController.m */; }; - D945ED3C166AE4950051858C /* ListPeopleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D945ED38166AE4950051858C /* ListPeopleViewController.xib */; }; - D973B402158ABC1F0083A4B5 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D973B401158ABC1F0083A4B5 /* MessageUI.framework */; }; - D98254A915990D8D0060CA47 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = D98254A715990D8D0060CA47 /* Icon.png */; }; - D9A49D9F1720DD5E009C6DE2 /* Default@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = D9A49D9B1720DD5E009C6DE2 /* Default@2x~iphone.png */; }; - D9A49DA01720DD5E009C6DE2 /* Default~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = D9A49D9C1720DD5E009C6DE2 /* Default~iphone.png */; }; - D9A49DA11720DD5E009C6DE2 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = D9A49D9D1720DD5E009C6DE2 /* Icon-72.png */; }; - D9A49DA21720DD5E009C6DE2 /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = D9A49D9E1720DD5E009C6DE2 /* Icon-144.png */; }; - D9EE74C2158A8E0500EC1D05 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D9EE74B4158A8E0500EC1D05 /* AppDelegate.m */; }; - D9EE74C3158A8E0500EC1D05 /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D9EE74B6158A8E0500EC1D05 /* MasterViewController.m */; }; - D9EE74C4158A8E0500EC1D05 /* MasterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D9EE74B7158A8E0500EC1D05 /* MasterViewController.xib */; }; - D9EE74C5158A8E0500EC1D05 /* MomentsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D9EE74B9158A8E0500EC1D05 /* MomentsViewController.m */; }; - D9EE74C6158A8E0500EC1D05 /* MomentsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D9EE74BA158A8E0500EC1D05 /* MomentsViewController.xib */; }; - D9EE74C7158A8E0500EC1D05 /* ShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D9EE74BC158A8E0500EC1D05 /* ShareViewController.m */; }; - D9EE74C8158A8E0500EC1D05 /* ShareViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D9EE74BD158A8E0500EC1D05 /* ShareViewController.xib */; }; - D9EE74C9158A8E0500EC1D05 /* SignInViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D9EE74BF158A8E0500EC1D05 /* SignInViewController.m */; }; - D9EE74CA158A8E0500EC1D05 /* SignInViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D9EE74C0158A8E0500EC1D05 /* SignInViewController.xib */; }; - D9EE74CD158A8E2900EC1D05 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D9EE74CB158A8E2900EC1D05 /* InfoPlist.strings */; }; - E0681E5F171F46EB0098D356 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E0681E5E171F46EB0098D356 /* Default-568h@2x.png */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 0043C79A1580045B000DF02E /* GooglePlusSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GooglePlusSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 0043C79E1580045B000DF02E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 0043C7A01580045B000DF02E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 0043C7A21580045B000DF02E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 00F70E82158006DC0077799E /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = SOURCE_ROOT; }; - 00F70E98158007D90077799E /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; - 00F70E9A158008040077799E /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; - 0C52D6F7158BAB1F001510E6 /* button_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = button_background.png; path = Resources/button_background.png; sourceTree = SOURCE_ROOT; }; - 8E47E991171CB75C003FBA75 /* GoogleOpenSource.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GoogleOpenSource.framework; path = ../GoogleOpenSource.framework; sourceTree = ""; }; - 8E47E992171CB75C003FBA75 /* GooglePlus.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = GooglePlus.bundle; path = ../GooglePlus.bundle; sourceTree = ""; }; - 8E47E993171CB75C003FBA75 /* GooglePlus.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GooglePlus.framework; path = ../GooglePlus.framework; sourceTree = ""; }; - D907F675166967D400EB5273 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "Resources/Icon@2x.png"; sourceTree = SOURCE_ROOT; }; - D945ED33166AE4950051858C /* ListMomentsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListMomentsViewController.h; sourceTree = SOURCE_ROOT; }; - D945ED34166AE4950051858C /* ListMomentsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListMomentsViewController.m; sourceTree = SOURCE_ROOT; }; - D945ED35166AE4950051858C /* ListMomentsViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ListMomentsViewController.xib; sourceTree = SOURCE_ROOT; }; - D945ED36166AE4950051858C /* ListPeopleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListPeopleViewController.h; sourceTree = SOURCE_ROOT; }; - D945ED37166AE4950051858C /* ListPeopleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListPeopleViewController.m; sourceTree = SOURCE_ROOT; }; - D945ED38166AE4950051858C /* ListPeopleViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ListPeopleViewController.xib; sourceTree = SOURCE_ROOT; }; - D973B401158ABC1F0083A4B5 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; - D98254A715990D8D0060CA47 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = Resources/Icon.png; sourceTree = SOURCE_ROOT; }; - D9A49D9B1720DD5E009C6DE2 /* Default@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x~iphone.png"; path = "Resources/Default@2x~iphone.png"; sourceTree = SOURCE_ROOT; }; - D9A49D9C1720DD5E009C6DE2 /* Default~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default~iphone.png"; path = "Resources/Default~iphone.png"; sourceTree = SOURCE_ROOT; }; - D9A49D9D1720DD5E009C6DE2 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "Resources/Icon-72.png"; sourceTree = SOURCE_ROOT; }; - D9A49D9E1720DD5E009C6DE2 /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-144.png"; path = "Resources/Icon-144.png"; sourceTree = SOURCE_ROOT; }; - D9EE74B1158A8E0500EC1D05 /* GooglePlusSample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GooglePlusSample-Info.plist"; sourceTree = SOURCE_ROOT; }; - D9EE74B2158A8E0500EC1D05 /* GooglePlusSample-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GooglePlusSample-Prefix.pch"; sourceTree = SOURCE_ROOT; }; - D9EE74B3158A8E0500EC1D05 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; }; - D9EE74B4158A8E0500EC1D05 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = SOURCE_ROOT; }; - D9EE74B5158A8E0500EC1D05 /* MasterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = SOURCE_ROOT; }; - D9EE74B6158A8E0500EC1D05 /* MasterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = SOURCE_ROOT; }; - D9EE74B7158A8E0500EC1D05 /* MasterViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MasterViewController.xib; sourceTree = SOURCE_ROOT; }; - D9EE74B8158A8E0500EC1D05 /* MomentsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MomentsViewController.h; sourceTree = SOURCE_ROOT; }; - D9EE74B9158A8E0500EC1D05 /* MomentsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MomentsViewController.m; sourceTree = SOURCE_ROOT; }; - D9EE74BA158A8E0500EC1D05 /* MomentsViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MomentsViewController.xib; sourceTree = SOURCE_ROOT; }; - D9EE74BB158A8E0500EC1D05 /* ShareViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShareViewController.h; sourceTree = SOURCE_ROOT; }; - D9EE74BC158A8E0500EC1D05 /* ShareViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShareViewController.m; sourceTree = SOURCE_ROOT; }; - D9EE74BD158A8E0500EC1D05 /* ShareViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ShareViewController.xib; sourceTree = SOURCE_ROOT; }; - D9EE74BE158A8E0500EC1D05 /* SignInViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignInViewController.h; sourceTree = SOURCE_ROOT; }; - D9EE74BF158A8E0500EC1D05 /* SignInViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignInViewController.m; sourceTree = SOURCE_ROOT; }; - D9EE74C0158A8E0500EC1D05 /* SignInViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SignInViewController.xib; sourceTree = SOURCE_ROOT; }; - D9EE74CC158A8E2900EC1D05 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = SOURCE_ROOT; }; - E0681E5E171F46EB0098D356 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "Resources/Default-568h@2x.png"; sourceTree = SOURCE_ROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 0043C7971580045B000DF02E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8E47E996171CB75C003FBA75 /* GooglePlus.framework in Frameworks */, - 8E47E994171CB75C003FBA75 /* GoogleOpenSource.framework in Frameworks */, - 00F70E9B158008040077799E /* SystemConfiguration.framework in Frameworks */, - 00F70E99158007D90077799E /* Security.framework in Frameworks */, - 0043C79F1580045B000DF02E /* UIKit.framework in Frameworks */, - 0043C7A11580045B000DF02E /* Foundation.framework in Frameworks */, - 0043C7A31580045B000DF02E /* CoreGraphics.framework in Frameworks */, - D973B402158ABC1F0083A4B5 /* MessageUI.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0043C78F1580045B000DF02E = { - isa = PBXGroup; - children = ( - 0043C7A41580045B000DF02E /* GooglePlusSample */, - 0043C79D1580045B000DF02E /* Frameworks */, - 0043C79B1580045B000DF02E /* Products */, - ); - sourceTree = ""; - }; - 0043C79B1580045B000DF02E /* Products */ = { - isa = PBXGroup; - children = ( - 0043C79A1580045B000DF02E /* GooglePlusSample.app */, - ); - name = Products; - sourceTree = ""; - }; - 0043C79D1580045B000DF02E /* Frameworks */ = { - isa = PBXGroup; - children = ( - 8E47E993171CB75C003FBA75 /* GooglePlus.framework */, - 8E47E992171CB75C003FBA75 /* GooglePlus.bundle */, - 8E47E991171CB75C003FBA75 /* GoogleOpenSource.framework */, - D973B401158ABC1F0083A4B5 /* MessageUI.framework */, - 00F70E9A158008040077799E /* SystemConfiguration.framework */, - 00F70E98158007D90077799E /* Security.framework */, - 0043C79E1580045B000DF02E /* UIKit.framework */, - 0043C7A01580045B000DF02E /* Foundation.framework */, - 0043C7A21580045B000DF02E /* CoreGraphics.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 0043C7A41580045B000DF02E /* GooglePlusSample */ = { - isa = PBXGroup; - children = ( - D9EE74B3158A8E0500EC1D05 /* AppDelegate.h */, - D9EE74B4158A8E0500EC1D05 /* AppDelegate.m */, - D945ED33166AE4950051858C /* ListMomentsViewController.h */, - D945ED34166AE4950051858C /* ListMomentsViewController.m */, - D945ED35166AE4950051858C /* ListMomentsViewController.xib */, - D945ED36166AE4950051858C /* ListPeopleViewController.h */, - D945ED37166AE4950051858C /* ListPeopleViewController.m */, - D945ED38166AE4950051858C /* ListPeopleViewController.xib */, - D9EE74B5158A8E0500EC1D05 /* MasterViewController.h */, - D9EE74B6158A8E0500EC1D05 /* MasterViewController.m */, - D9EE74B7158A8E0500EC1D05 /* MasterViewController.xib */, - D9EE74B8158A8E0500EC1D05 /* MomentsViewController.h */, - D9EE74B9158A8E0500EC1D05 /* MomentsViewController.m */, - D9EE74BA158A8E0500EC1D05 /* MomentsViewController.xib */, - D9EE74BB158A8E0500EC1D05 /* ShareViewController.h */, - D9EE74BC158A8E0500EC1D05 /* ShareViewController.m */, - D9EE74BD158A8E0500EC1D05 /* ShareViewController.xib */, - D9EE74BE158A8E0500EC1D05 /* SignInViewController.h */, - D9EE74BF158A8E0500EC1D05 /* SignInViewController.m */, - D9EE74C0158A8E0500EC1D05 /* SignInViewController.xib */, - D98254AB15990DBC0060CA47 /* Resources */, - 0043C7A51580045B000DF02E /* Supporting Files */, - ); - path = GooglePlusSample; - sourceTree = ""; - }; - 0043C7A51580045B000DF02E /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 00F70E82158006DC0077799E /* main.m */, - D9EE74CB158A8E2900EC1D05 /* InfoPlist.strings */, - D9EE74B1158A8E0500EC1D05 /* GooglePlusSample-Info.plist */, - D9EE74B2158A8E0500EC1D05 /* GooglePlusSample-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - D98254AB15990DBC0060CA47 /* Resources */ = { - isa = PBXGroup; - children = ( - 0C52D6F7158BAB1F001510E6 /* button_background.png */, - E0681E5E171F46EB0098D356 /* Default-568h@2x.png */, - D9A49D9B1720DD5E009C6DE2 /* Default@2x~iphone.png */, - D9A49D9C1720DD5E009C6DE2 /* Default~iphone.png */, - D9A49D9E1720DD5E009C6DE2 /* Icon-144.png */, - D9A49D9D1720DD5E009C6DE2 /* Icon-72.png */, - D98254A715990D8D0060CA47 /* Icon.png */, - D907F675166967D400EB5273 /* Icon@2x.png */, - ); - name = Resources; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 0043C7991580045B000DF02E /* GooglePlusSample */ = { - isa = PBXNativeTarget; - buildConfigurationList = 0043C7B21580045B000DF02E /* Build configuration list for PBXNativeTarget "GooglePlusSample" */; - buildPhases = ( - 0043C7961580045B000DF02E /* Sources */, - 0043C7971580045B000DF02E /* Frameworks */, - 0043C7981580045B000DF02E /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = GooglePlusSample; - productName = GooglePlusSample; - productReference = 0043C79A1580045B000DF02E /* GooglePlusSample.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 0043C7911580045B000DF02E /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - ORGANIZATIONNAME = "Google Inc"; - }; - buildConfigurationList = 0043C7941580045B000DF02E /* Build configuration list for PBXProject "GooglePlusSample" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - af, - am, - ar, - be, - bg, - ca, - cs, - da, - de_AT, - de_CH, - de, - el, - en_GB, - en_IE, - en_IN, - en_SG, - en_ZA, - es_419, - es_AR, - es_BO, - es_CL, - es_CO, - es_CR, - es_DO, - es_EC, - es_GT, - es_HN, - es_MX, - es_NI, - es_PA, - es_PE, - es_PR, - es_PY, - es_SV, - es_US, - es_UY, - es_VE, - es, - et, - fa, - fi, - fil, - fr_CH, - fr, - gsw, - he, - hi, - hr, - hu, - id, - in, - it, - iw, - ja, - ko, - ln, - lt, - lv, - mo, - ms, - nb, - nl, - no, - pl, - pt_BR, - pt_PT, - pt, - ro, - ru, - sk, - sl, - sr, - sv, - sw, - th, - tl, - tr, - uk, - vi, - zh_CN, - zh_HK, - zh_TW, - zh, - zu, - ); - mainGroup = 0043C78F1580045B000DF02E; - productRefGroup = 0043C79B1580045B000DF02E /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 0043C7991580045B000DF02E /* GooglePlusSample */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 0043C7981580045B000DF02E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D9EE74C4158A8E0500EC1D05 /* MasterViewController.xib in Resources */, - D9EE74C6158A8E0500EC1D05 /* MomentsViewController.xib in Resources */, - D9EE74C8158A8E0500EC1D05 /* ShareViewController.xib in Resources */, - D9EE74CA158A8E0500EC1D05 /* SignInViewController.xib in Resources */, - D9EE74CD158A8E2900EC1D05 /* InfoPlist.strings in Resources */, - 0C52D6F8158BAB1F001510E6 /* button_background.png in Resources */, - D98254A915990D8D0060CA47 /* Icon.png in Resources */, - D907F676166967D400EB5273 /* Icon@2x.png in Resources */, - D945ED3A166AE4950051858C /* ListMomentsViewController.xib in Resources */, - D945ED3C166AE4950051858C /* ListPeopleViewController.xib in Resources */, - 8E47E995171CB75C003FBA75 /* GooglePlus.bundle in Resources */, - E0681E5F171F46EB0098D356 /* Default-568h@2x.png in Resources */, - D9A49D9F1720DD5E009C6DE2 /* Default@2x~iphone.png in Resources */, - D9A49DA01720DD5E009C6DE2 /* Default~iphone.png in Resources */, - D9A49DA11720DD5E009C6DE2 /* Icon-72.png in Resources */, - D9A49DA21720DD5E009C6DE2 /* Icon-144.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 0043C7961580045B000DF02E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 00F70E83158006DC0077799E /* main.m in Sources */, - D9EE74C2158A8E0500EC1D05 /* AppDelegate.m in Sources */, - D9EE74C3158A8E0500EC1D05 /* MasterViewController.m in Sources */, - D9EE74C5158A8E0500EC1D05 /* MomentsViewController.m in Sources */, - D9EE74C7158A8E0500EC1D05 /* ShareViewController.m in Sources */, - D9EE74C9158A8E0500EC1D05 /* SignInViewController.m in Sources */, - D945ED39166AE4950051858C /* ListMomentsViewController.m in Sources */, - D945ED3B166AE4950051858C /* ListPeopleViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - D9EE74CB158A8E2900EC1D05 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - D9EE74CC158A8E2900EC1D05 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 0043C7B01580045B000DF02E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - OTHER_LDFLAGS = "-ObjC"; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 0043C7B11580045B000DF02E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - OTHER_LDFLAGS = "-ObjC"; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 0043C7B31580045B000DF02E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/..\"", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "GooglePlusSample-Prefix.pch"; - INFOPLIST_FILE = "GooglePlusSample-Info.plist"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)\"", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 0043C7B41580045B000DF02E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/..\"", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "GooglePlusSample-Prefix.pch"; - INFOPLIST_FILE = "GooglePlusSample-Info.plist"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)\"", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 0043C7941580045B000DF02E /* Build configuration list for PBXProject "GooglePlusSample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 0043C7B01580045B000DF02E /* Debug */, - 0043C7B11580045B000DF02E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 0043C7B21580045B000DF02E /* Build configuration list for PBXNativeTarget "GooglePlusSample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 0043C7B31580045B000DF02E /* Debug */, - 0043C7B41580045B000DF02E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 0043C7911580045B000DF02E /* Project object */; -} diff --git a/External/google-plus-ios-sdk/SampleCode/ListMomentsViewController.h b/External/google-plus-ios-sdk/SampleCode/ListMomentsViewController.h deleted file mode 100644 index 340cfc18..00000000 --- a/External/google-plus-ios-sdk/SampleCode/ListMomentsViewController.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// ListMomentsViewController.h -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import - -@class GTLPlusMoment; - -@interface ListMomentsViewController : UIViewController< - UITableViewDelegate, - UITableViewDataSource> { - // A map from activities to verbs used for display. - NSDictionary *verbMap_; - // An array of |GTLPlusMoment|, as the data source. - NSMutableArray *momentsData_; - // Currently selected moment in the |momentsData_| array. - GTLPlusMoment *selectedMoment_; -} - -// The table that displays the list of moments for the user. -@property (retain, nonatomic) IBOutlet UITableView *momentsTable; -// A label to display the status of selected moment, or general status. -@property (retain, nonatomic) IBOutlet UILabel *momentStatus; -// A label to display the target of selected moment. -@property (retain, nonatomic) IBOutlet UILabel *momentTarget; -// A label to display the time of selected moment. -@property (retain, nonatomic) IBOutlet UILabel *momentTime; -// A button to remove selected moment. -@property (retain, nonatomic) IBOutlet UIButton *momentRemoval; - -// Called when the remove button is pressed. -- (IBAction)removeMoment:(id)sender; - -@end diff --git a/External/google-plus-ios-sdk/SampleCode/ListMomentsViewController.m b/External/google-plus-ios-sdk/SampleCode/ListMomentsViewController.m deleted file mode 100644 index 60f6bda1..00000000 --- a/External/google-plus-ios-sdk/SampleCode/ListMomentsViewController.m +++ /dev/null @@ -1,216 +0,0 @@ -// -// ListMomentsViewController.m -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "ListMomentsViewController.h" - -#import -#import - -@interface ListMomentsViewController () -- (void)clearSelectedMoment; -- (void)refreshData; -- (NSString *)textForMoment:(GTLPlusMoment *)moment; -@end - -#pragma mark - View lifecycle - -@implementation ListMomentsViewController - -@synthesize momentsTable = momentsTable_; -@synthesize momentStatus = momentStatus_; -@synthesize momentTarget = momentTarget_; -@synthesize momentTime = momentTime_; -@synthesize momentRemoval = momentsRemoval_; - -#pragma mark - Object lifecycle - -- (id)initWithNibName:(NSString *)nibNameOrNil - bundle:(NSBundle *)nibBundleOrNil { - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - verbMap_ = [[NSDictionary dictionaryWithObjectsAndKeys: - @"Added", @"http://schemas.google.com/AddActivity", - @"Bought", @"http://schemas.google.com/BuyActivity", - @"Checked in", @"http://schemas.google.com/CheckInActivity", - @"Commented on", @"http://schemas.google.com/CommentActivity", - @"Created", @"http://schemas.google.com/CreateActivity", - @"Listened to", @"http://schemas.google.com/ListenActivity", - @"Made a reservation at", @"http://schemas.google.com/ReserveActivity", - @"Reviewed", @"http://schemas.google.com/ReviewActivity", - nil] retain]; - } - return self; -} - -- (void)dealloc { - [verbMap_ release]; - [momentsData_ release]; - [selectedMoment_ release]; - [momentsTable_ release]; - [momentStatus_ release]; - [momentTarget_ release]; - [momentTime_ release]; - [super dealloc]; -} - -#pragma mark - View lifecycle - -- (void)viewDidLoad { - [super viewDidLoad]; - [self refreshData]; -} - -#pragma mark - UITableViewDelegate/UITableViewDataSource - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 1; -} - -- (NSInteger)tableView:(UITableView *)tableView - numberOfRowsInSection:(NSInteger)section { - return momentsData_.count; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView - cellForRowAtIndexPath:(NSIndexPath *)indexPath { - static NSString * const kCellIdentifier = @"Cell"; - UITableViewCell *cell = - [tableView dequeueReusableCellWithIdentifier:kCellIdentifier]; - if (cell == nil) { - cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:kCellIdentifier] - autorelease]; - cell.accessoryType = UITableViewCellAccessoryNone; - } - - // Configure the cell. - GTLPlusMoment *moment = momentsData_[indexPath.row]; - cell.textLabel.text = [self textForMoment:moment]; - return cell; -} - -- (void)tableView:(UITableView *)tableView - didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - GTLPlusMoment *moment = momentsData_[indexPath.row]; - [selectedMoment_ autorelease]; - selectedMoment_ = [moment retain]; - momentStatus_.text = [NSString stringWithFormat:@"Target for \"%@\":", - [self textForMoment:moment]]; - momentTarget_.text = moment.target.url; - momentTime_.text = [NSString stringWithFormat:@"Start time: %@", - [NSDateFormatter localizedStringFromDate:moment.startDate.date - dateStyle:kCFDateFormatterMediumStyle - timeStyle:kCFDateFormatterMediumStyle]]; - momentsRemoval_.hidden = NO; -} - -- (void)tableView:(UITableView *)tableView - didDeselectRowAtIndexPath:(NSIndexPath *)indexPath { - [self clearSelectedMoment]; -} - -#pragma mark - IBActions - -- (IBAction)removeMoment:(id)sender { - if (!selectedMoment_) { - return; - } - - // Here is an example of removing a moment from Google+: - // 1. Create a |GTLQuery| object to remove the moment. - GTLQueryPlus *query = [GTLQueryPlus - queryForMomentsRemoveWithIdentifier:selectedMoment_.identifier]; - - // 2. Execute the query. - [[[GPPSignIn sharedInstance] plusService] executeQuery:query - completionHandler:^(GTLServiceTicket *ticket, - id object, - NSError *error) { - if (error) { - momentStatus_.text = - [NSString stringWithFormat:@"Error: %@", error]; - GTMLoggerError(@"Status: Error: %@", error); - } else { - [momentsData_ removeObject:selectedMoment_]; - [self clearSelectedMoment]; - [momentsTable_ reloadData]; - } - }]; -} - -#pragma mark - Helper methods - -- (void)clearSelectedMoment { - [selectedMoment_ autorelease]; - selectedMoment_ = nil; - momentStatus_.text = @""; - momentTarget_.text = @""; - momentTime_.text = @""; - momentsRemoval_.hidden = YES; -} - -- (void)refreshData { - GTMOAuth2Authentication *auth = [GPPSignIn sharedInstance].authentication; - if (!auth) { - // To authenticate, use Google+ sign-in button. - momentStatus_.text = @"Status: Not authenticated"; - return; - } - // Clear old moments data. - [momentsData_ autorelease]; - momentsData_ = nil; - [momentsTable_ reloadData]; - [self clearSelectedMoment]; - momentStatus_.text = @"Status: Loading"; - - // Here is an example of reading list of moments from Google+: - // 1. Create a |GTLQuery| object to list moments. - GTLQueryPlus *query = - [GTLQueryPlus queryForMomentsListWithUserId:@"me" - collection:kGTLPlusCollectionVault]; - - // 2. Execute the query. - [[[GPPSignIn sharedInstance] plusService] executeQuery:query - completionHandler:^(GTLServiceTicket *ticket, - id object, - NSError *error) { - if (error) { - momentStatus_.text = - [NSString stringWithFormat:@"Error: %@", error]; - GTMLoggerError(@"Status: Error: %@", error); - } else { - GTLPlusMomentsFeed *moments = (GTLPlusMomentsFeed *)object; - momentsData_ = - [[NSMutableArray arrayWithArray:moments.items] retain]; - momentStatus_.text = [NSString stringWithFormat: - @"Status: Loaded %d moment(s)", momentsData_.count]; - [momentsTable_ reloadData]; - } - }]; -} - -- (NSString *)textForMoment:(GTLPlusMoment *)moment { - NSString *verb = [verbMap_ objectForKey:moment.type]; - if (!verb) { - // Fallback for verbs we don't recognize. - verb = [moment.type lastPathComponent]; - } - return [NSString stringWithFormat:@"%@ %@", verb, moment.target.name]; -} - -@end diff --git a/External/google-plus-ios-sdk/SampleCode/ListMomentsViewController.xib b/External/google-plus-ios-sdk/SampleCode/ListMomentsViewController.xib deleted file mode 100644 index 4311cda2..00000000 --- a/External/google-plus-ios-sdk/SampleCode/ListMomentsViewController.xib +++ /dev/null @@ -1,429 +0,0 @@ - - - - 1552 - 12C60 - 3084 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 2083 - - - IBProxyObject - IBUIButton - IBUILabel - IBUITableView - IBUIView - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - - - 292 - {{15, 240}, {285, 42}} - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - - - 1 - MCAwIDAAA - darkTextColor - - - 0 - 2 - - 1 - 17 - - - Helvetica - 17 - 16 - - NO - 285 - - - - 292 - {{15, 359}, {89, 44}} - - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - 1 - Remove - - 3 - MQA - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - 3 - MC41AA - - - 2 - 15 - - - Helvetica-Bold - 15 - 16 - - - - - 292 - - - - 274 - {{20, 20}, {320, 238}} - - - - _NS:9 - - YES - IBCocoaTouchFramework - YES - 1 - 0 - YES - 44 - 22 - 22 - - - {{-20, -20}, {360, 258}} - - - - _NS:10 - - 3 - MQA - - 2 - - - IBCocoaTouchFramework - - - - 292 - {{15, 284}, {285, 42}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - - - - 0 - 2 - - - NO - 285 - - - - 292 - {{15, 330}, {285, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - - - - 0 - - - NO - - - {{0, 20}, {320, 460}} - - - - - 3 - MQA - - - - IBCocoaTouchFramework - - - - - - - view - - - - 3 - - - - momentRemoval - - - - 61 - - - - momentsTable - - - - 33 - - - - momentStatus - - - - 76 - - - - momentTarget - - - - 101 - - - - momentTime - - - - 107 - - - - delegate - - - - 35 - - - - dataSource - - - - 34 - - - - removeMoment: - - - 7 - - 62 - - - - - - 0 - - - - - - 1 - - - - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 14 - - - - - - 56 - - - - - - 66 - - - - - - - - 4 - - - - - - 93 - - - - - - 103 - - - - - - - - ListMomentsViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 151 - - - - - ListMomentsViewController - UIViewController - - removeMoment: - id - - - removeMoment: - - removeMoment: - id - - - - UIButton - UILabel - UILabel - UILabel - UITableView - - - - momentRemoval - UIButton - - - momentStatus - UILabel - - - momentTarget - UILabel - - - momentTime - UILabel - - - momentsTable - UITableView - - - - IBProjectSource - ./Classes/ListMomentsViewController.h - - - - - 0 - IBCocoaTouchFramework - YES - 3 - 2083 - - diff --git a/External/google-plus-ios-sdk/SampleCode/ListPeopleViewController.h b/External/google-plus-ios-sdk/SampleCode/ListPeopleViewController.h deleted file mode 100644 index 61e8c1dd..00000000 --- a/External/google-plus-ios-sdk/SampleCode/ListPeopleViewController.h +++ /dev/null @@ -1,38 +0,0 @@ -// -// GooglePlusSamplePeopleListViewController.h -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import - -// A view controller for listing people that are visible to this sample app. -// The open-source GTLPlus libraries are required. -@interface ListPeopleViewController : UIViewController< - UITableViewDelegate, - UITableViewDataSource> - -// A label to display the result of the listing people action. -@property (retain, nonatomic) IBOutlet UILabel *peopleStatus; -// The table that displays a list of people that is visible to this sample app. -@property (retain, nonatomic) IBOutlet UITableView *peopleTable; - -// A list of people that is visible to this sample app. -@property (retain, nonatomic) NSArray *peopleList; -// A list of people profile images that we will prefetch that is -// visible to this sample app. -@property (retain, nonatomic) NSMutableArray *peopleImageList; - -@end diff --git a/External/google-plus-ios-sdk/SampleCode/ListPeopleViewController.m b/External/google-plus-ios-sdk/SampleCode/ListPeopleViewController.m deleted file mode 100644 index 366253cc..00000000 --- a/External/google-plus-ios-sdk/SampleCode/ListPeopleViewController.m +++ /dev/null @@ -1,186 +0,0 @@ -// -// ListPeopleViewController.m -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "ListPeopleViewController.h" - -#import -#import - -@interface ListPeopleViewController() -- (void)listPeople:(NSString *)collection; -- (void)reportAuthStatus; -- (void)fetchPeopleImages; -@end - -@implementation ListPeopleViewController - -@synthesize peopleTable = peopleTable_; -@synthesize peopleList = peopleList_; -@synthesize peopleStatus = peopleStatus_; -@synthesize peopleImageList = peopleImageList_; - -#pragma mark - Object lifecycle - -- (void)dealloc { - [peopleStatus_ release]; - [super dealloc]; -} - -#pragma mark - View lifecycle - -- (void)viewDidLoad { - // Report whether the user is authenticated with - // https://www.googleapis.com/auth/plus.login scope. - [self reportAuthStatus]; - // Send Google+ request to get list of people that is visible to this app. - [self listPeople:kGTLPlusCollectionVisible]; - [super viewDidLoad]; -} - -- (void)viewDidUnload { - [peopleImageList_ release]; - [peopleList_ release]; - [peopleStatus_ release]; - [super viewDidUnload]; -} - -#pragma mark - UITableViewDelegate/UITableViewDataSource - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 1; -} - -- (NSInteger)tableView:(UITableView *)tableView - numberOfRowsInSection:(NSInteger)section { - return peopleList_.count; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView - cellForRowAtIndexPath:(NSIndexPath *)indexPath { - static NSString *const kCellIdentifier = @"Cell"; - UITableViewCell *cell = - [tableView dequeueReusableCellWithIdentifier:kCellIdentifier]; - if (cell == nil) { - cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:kCellIdentifier] - autorelease]; - cell.accessoryType = UITableViewCellAccessoryNone; - } - - // Configure the cell by extracting a person's name and image from the list - // of people. - if (indexPath.row < peopleList_.count) { - GTLPlusPerson *person = peopleList_[indexPath.row]; - NSString *name = person.displayName; - cell.textLabel.text = name; - - if (indexPath.row < [peopleImageList_ count] && - ![[peopleImageList_ objectAtIndex:indexPath.row] - isEqual:[NSNull null]]) { - cell.imageView.image = - [[[UIImage alloc] - initWithData:[peopleImageList_ objectAtIndex:indexPath.row]] - autorelease]; - } else { - cell.imageView.image = nil; - } - } - - return cell; -} - -#pragma mark - Helper methods - -- (void)listPeople:(NSString *)collection { - GTMOAuth2Authentication *auth = [GPPSignIn sharedInstance].authentication; - if (!auth) { - // To authenticate, use Google+ sign-in button. - peopleStatus_.text = @"Status: Not authenticated"; - return; - } - - // 1. Create a |GTLQuery| object to list people that are visible to this - // sample app. - GTLQueryPlus *query = - [GTLQueryPlus queryForPeopleListWithUserId:@"me" - collection:collection]; - - // 2. Execute the query. - [[[GPPSignIn sharedInstance] plusService] executeQuery:query - completionHandler:^(GTLServiceTicket *ticket, - GTLPlusPeopleFeed *peopleFeed, - NSError *error) { - if (error) { - GTMLoggerError(@"Error: %@", error); - peopleStatus_.text = - [NSString stringWithFormat:@"Status: Error: %@", error]; - } else { - // Get an array of people from |GTLPlusPeopleFeed| and reload - // the table view. - peopleList_ = [peopleFeed.items retain]; - [peopleTable_ reloadData]; - - // Render the status of the Google+ request. - NSNumber *count = peopleFeed.totalItems; - if (count.intValue == 1) { - peopleStatus_.text = [NSString stringWithFormat: - @"Status: Listed 1 person"]; - } else { - peopleStatus_.text = [NSString stringWithFormat: - @"Status: Listed %@ people", count]; - } - [self fetchPeopleImages]; - } - }]; -} - -- (void)fetchPeopleImages { - NSInteger index = 0; - peopleImageList_ = - [[NSMutableArray alloc] initWithCapacity:[peopleList_ count]]; - for (GTLPlusPerson *person in peopleList_) { - NSData *imageData = nil; - NSString *imageURLString = person.image.url; - if (imageURLString) { - NSURL *imageURL = [NSURL URLWithString:imageURLString]; - imageData = [NSData dataWithContentsOfURL:imageURL]; - } - if (imageData) { - [peopleImageList_ setObject:imageData atIndexedSubscript:index]; - } else { - [peopleImageList_ setObject:[NSNull null] atIndexedSubscript:index]; - } - ++index; - } -} - -- (void)reportAuthStatus { - if (![GPPSignIn sharedInstance].authentication) { - return; - } - - if ([[GPPSignIn sharedInstance].scopes containsObject: - kGTLAuthScopePlusLogin]) { - peopleStatus_.text = @"Status: Authenticated with plus.login scope"; - } else { - // To authenticate, use Google+ sign-in button. - peopleStatus_.text = @"Status: Not authenticated with plus.login scope"; - } -} - -@end diff --git a/External/google-plus-ios-sdk/SampleCode/ListPeopleViewController.xib b/External/google-plus-ios-sdk/SampleCode/ListPeopleViewController.xib deleted file mode 100644 index 4d7e098a..00000000 --- a/External/google-plus-ios-sdk/SampleCode/ListPeopleViewController.xib +++ /dev/null @@ -1,300 +0,0 @@ - - - - 1552 - 12C60 - 3084 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 2083 - - - IBProxyObject - IBUILabel - IBUITableView - IBUIView - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - - - 292 - {{6, 11}, {253, 21}} - - - - _NS:9 - {250, 250} - NO - YES - 7 - NO - IBCocoaTouchFramework - People visible to this sample app: - - 1 - MCAwIDAAA - darkTextColor - - - 0 - - 1 - 17 - - - Helvetica - 17 - 16 - - NO - - - - 292 - {{6, 329}, {285, 67}} - - - - _NS:9 - NO - YES - NO - IBCocoaTouchFramework - Status: - - - 0 - 2 - - - NO - 285 - - - - 292 - - - - 274 - {{20, 20}, {320, 263}} - - - - _NS:9 - - 3 - MQA - - YES - IBCocoaTouchFramework - YES - 1 - 0 - YES - 44 - 22 - 22 - - - {{-20, 40}, {360, 303}} - - - - _NS:10 - - 3 - MQA - - 2 - - - IBCocoaTouchFramework - - - {{0, 64}, {320, 416}} - - - - - 3 - MQA - - - - - NO - - IBCocoaTouchFramework - - - - - - - peopleStatus - - - - 55 - - - - view - - - - 56 - - - - peopleTable - - - - 54 - - - - delegate - - - - 32 - - - - dataSource - - - - 31 - - - - - - 0 - - - - - - 1 - - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 10 - - - - - 34 - - - - - - 129 - - - - - - - - 3 - - - - - - - - ListPeopleViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 157 - - - - - ListPeopleViewController - UIViewController - - UILabel - UITableView - - - - peopleStatus - UILabel - - - peopleTable - UITableView - - - - IBProjectSource - ./Classes/ListPeopleViewController.h - - - - - 0 - IBCocoaTouchFramework - YES - 3 - 2083 - - diff --git a/External/google-plus-ios-sdk/SampleCode/MasterViewController.h b/External/google-plus-ios-sdk/SampleCode/MasterViewController.h deleted file mode 100644 index 073f4bad..00000000 --- a/External/google-plus-ios-sdk/SampleCode/MasterViewController.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// MasterViewController.h -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import - -@interface MasterViewController : UITableViewController - -@end diff --git a/External/google-plus-ios-sdk/SampleCode/MasterViewController.m b/External/google-plus-ios-sdk/SampleCode/MasterViewController.m deleted file mode 100644 index 6f918072..00000000 --- a/External/google-plus-ios-sdk/SampleCode/MasterViewController.m +++ /dev/null @@ -1,135 +0,0 @@ -// -// MasterViewController.m -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "MasterViewController.h" - -#import - -static const int kNumViewControllers = 5; -static NSString * const kMenuOptions[kNumViewControllers] = { - @"Sign in", @"Share", @"List people", @"Write moments", - @"List & remove moments" }; -static NSString * const kUnselectableMenuOptions[kNumViewControllers] = { - nil, nil, @"Sign in to list people", @"Sign in to write moments", - @"Sign in to list/remove moments" }; -static NSString * const kNibNames[kNumViewControllers] = { - @"SignInViewController", - @"ShareViewController", - @"ListPeopleViewController", - @"MomentsViewController", - @"ListMomentsViewController" }; - -@interface MasterViewController () -- (BOOL)isSelectable:(NSIndexPath *)indexPath; -@end - -@implementation MasterViewController - -- (id)initWithNibName:(NSString *)nibNameOrNil - bundle:(NSBundle *)nibBundleOrNil { - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - self.title = @"Google+ SDK Sample"; - UIBarButtonItem *backButton = [[[UIBarButtonItem alloc] - initWithTitle:@"Back" - style:UIBarButtonItemStylePlain - target:self - action:@selector(backPressed)] autorelease]; - self.navigationItem.backBarButtonItem = backButton; - } - return self; -} - -- (void)dealloc { - [super dealloc]; -} - -#pragma mark - View lifecycle - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) - interfaceOrientation { - if ([[UIDevice currentDevice] userInterfaceIdiom] == - UIUserInterfaceIdiomPhone) { - return interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown; - } - return YES; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - [self.tableView reloadData]; -} - -#pragma mark - UITableViewDelegate/UITableViewDataSource - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 1; -} - -- (NSInteger)tableView:(UITableView *)tableView - numberOfRowsInSection:(NSInteger)section { - return kNumViewControllers; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView - cellForRowAtIndexPath:(NSIndexPath *)indexPath { - BOOL selectable = [self isSelectable:indexPath]; - NSString * const kCellIdentifier = selectable ? @"Cell" : @"GreyCell"; - UITableViewCell *cell = - [tableView dequeueReusableCellWithIdentifier:kCellIdentifier]; - if (cell == nil) { - cell = - [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:kCellIdentifier] autorelease]; - if (selectable) { - cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; - } else { - cell.selectionStyle = UITableViewCellSelectionStyleNone; - cell.textLabel.textColor = [UIColor lightGrayColor]; - } - } - cell.textLabel.text = (selectable ? kMenuOptions : kUnselectableMenuOptions) - [indexPath.row]; - - return cell; -} - -- (void)tableView:(UITableView *)tableView - didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - if (![self isSelectable:indexPath]) { - return; - } - Class nibClass = NSClassFromString(kNibNames[indexPath.row]); - UIViewController *controller = - [[[nibClass alloc] initWithNibName:nil bundle:nil] autorelease]; - controller.navigationItem.title = kMenuOptions[indexPath.row]; - - [self.navigationController pushViewController:controller animated:YES]; -} - -#pragma mark - Helper methods - -- (BOOL)isSelectable:(NSIndexPath *)indexPath { - if (kUnselectableMenuOptions[indexPath.row]) { - // To use Google+ moments, you need to sign in. - return [GPPSignIn sharedInstance].authentication != nil; - } - return YES; -} - -@end diff --git a/External/google-plus-ios-sdk/SampleCode/MasterViewController.xib b/External/google-plus-ios-sdk/SampleCode/MasterViewController.xib deleted file mode 100644 index 236540a6..00000000 --- a/External/google-plus-ios-sdk/SampleCode/MasterViewController.xib +++ /dev/null @@ -1,251 +0,0 @@ - - - - 1280 - 10K549 - 1938 - 1038.36 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 933 - - - IBUINavigationItem - IBUITableView - IBUITableViewController - IBUINavigationController - IBUINavigationBar - IBProxyObject - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - {{0, 20}, {320, 460}} - - - 3 - MQA - - YES - - IBCocoaTouchFramework - YES - 1 - 0 - YES - 44 - 22 - 22 - - - - - 1 - 1 - - IBCocoaTouchFramework - NO - - - 256 - {0, 0} - NO - YES - YES - IBCocoaTouchFramework - - - - - - 274 - {{0, 64}, {320, 416}} - - - - - NO - YES - NO - IBCocoaTouchFramework - YES - 1 - 0 - YES - 44 - 22 - 22 - - - - Google Plus Sample App - IBCocoaTouchFramework - - - - - 1 - 1 - - IBCocoaTouchFramework - NO - - - - - - - - - view - - - - 3 - - - - dataSource - - - - 4 - - - - delegate - - - - 5 - - - - delegate - - - - 12 - - - - dataSource - - - - 13 - - - - - - 0 - - - - - - -1 - - - File's Owner - - - -2 - - - - - 2 - - - - - 6 - - - - - - - - - 7 - - - - - 10 - - - - - - - - - 11 - - - - - 14 - - - - - - - MasterViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 14 - - - - - MasterViewController - UITableViewController - - IBProjectSource - ./Classes/MasterViewController.h - - - - - 0 - IBCocoaTouchFramework - YES - 3 - 933 - - diff --git a/External/google-plus-ios-sdk/SampleCode/MomentsViewController.h b/External/google-plus-ios-sdk/SampleCode/MomentsViewController.h deleted file mode 100644 index b31357d1..00000000 --- a/External/google-plus-ios-sdk/SampleCode/MomentsViewController.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// MomentsViewController.h -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import - -// A view controller for writing different kinds of moments to Google+. -// The open-source GTLPlus libraries are required. For more details, see -// https://developers.google.com/+/features/app-activities . -@interface MomentsViewController : UIViewController< - UITableViewDelegate, - UITableViewDataSource, - UITextFieldDelegate> { - BOOL keyboardVisible_; -} - -// A label to prompt the selection of a moment. -@property (retain, nonatomic) IBOutlet UILabel *selectionLabel; -// The table that displays the different kinds of moments available. -@property (retain, nonatomic) IBOutlet UITableView *momentsTable; -// The view for the bootom controls. -@property (retain, nonatomic) IBOutlet UIView *bottomControls; -// The target URL to associate with this moment. -@property (retain, nonatomic) IBOutlet UITextField *momentURL; -// A label to display the result of writing a moment. -@property (retain, nonatomic) IBOutlet UILabel *momentStatus; -// The "Add Moment" button. -@property (retain, nonatomic) IBOutlet UIButton *addButton; - -// Called when the user presses the "Add Moment" button. -- (IBAction)momentButton:(id)sender; - -@end diff --git a/External/google-plus-ios-sdk/SampleCode/MomentsViewController.m b/External/google-plus-ios-sdk/SampleCode/MomentsViewController.m deleted file mode 100644 index 74435e9c..00000000 --- a/External/google-plus-ios-sdk/SampleCode/MomentsViewController.m +++ /dev/null @@ -1,332 +0,0 @@ -// -// MomentsViewController.m -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "MomentsViewController.h" - -#import -#import -#import - -@interface MomentsViewController () -- (GTLPlusItemScope *)resultFor:(NSString *)selectedMoment; -- (void)animateKeyboard:(NSNotification *)notification - shouldShow:(BOOL)shouldShow; -- (NSString *)momentURLForIndex:(int)i; -- (void)reportAuthStatus; -@end - -@implementation MomentsViewController - -@synthesize selectionLabel = selectionLabel_; -@synthesize momentsTable = momentsTable_; -@synthesize bottomControls = bottomControls_; -@synthesize momentURL = momentURL_; -@synthesize momentStatus = momentStatus_; -@synthesize addButton = addButton_; - -// The different kinds of moments. -static const int kNumMomentTypes = 8; -static NSString * const kMomentTypes[kNumMomentTypes] = { - @"AddActivity", - @"BuyActivity", - @"CheckInActivity", - @"CommentActivity", - @"CreateActivity", - @"ListenActivity", - @"ReserveActivity", - @"ReviewActivity" }; -static NSString * const kMomentURLs[kNumMomentTypes] = { - @"thing", - @"a-book", - @"place", - @"blog-entry", - @"photo", - @"song", - @"restaurant", - @"widget" }; -static NSString * const kMomentURLFormat = - @"https://developers.google.com/+/plugins/snippet/examples/%@"; - -#pragma mark - Object lifecycle - -- (void)dealloc { - // Unregister for keyboard notifications while not visible. - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:UIKeyboardWillShowNotification - object:nil]; - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:UIKeyboardWillHideNotification - object:nil]; - [selectionLabel_ release]; - [momentsTable_ release]; - [bottomControls_ release]; - [momentURL_ release]; - [momentStatus_ release]; - [addButton_ release]; - [super dealloc]; -} - -#pragma mark - View lifecycle - -- (void)viewDidLoad { - // Set up "Add Moment" button. - [[addButton_ layer] setCornerRadius:5]; - [[addButton_ layer] setMasksToBounds:YES]; - CGColorRef borderColor = [[UIColor colorWithWhite:203.0/255.0 - alpha:1.0] CGColor]; - [[addButton_ layer] setBorderColor:borderColor]; - [[addButton_ layer] setBorderWidth:1.0]; - - // Set up sample view of writing moments. - int selectedRow = [[momentsTable_ indexPathForSelectedRow] row]; - momentURL_.text = [self momentURLForIndex:selectedRow]; - - [self reportAuthStatus]; - [super viewDidLoad]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - - // Register for keyboard notifications while visible. - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:nil]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(keyboardWillHide:) - name:UIKeyboardWillHideNotification - object:nil]; - - // Scale the table view vertically down to its contents if necessary. - [momentsTable_ reloadData]; - CGRect frame = momentsTable_.frame; - if (frame.size.height > momentsTable_.contentSize.height) { - CGFloat shift = frame.size.height - momentsTable_.contentSize.height; - frame.size.height = momentsTable_.contentSize.height; - momentsTable_.frame = frame; - - // Also update the prompt by removing the "scroll for more" part. - selectionLabel_.text = @"Select an activity"; - - // And move the bottom view up for the same shift amount. - frame = bottomControls_.frame; - frame.origin.y -= shift; - bottomControls_.frame = frame; - } -} - -- (void)viewWillDisappear:(BOOL)animated { - // Unregister for keyboard notifications while not visible. - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:UIKeyboardWillShowNotification - object:nil]; - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:UIKeyboardWillHideNotification - object:nil]; - - [super viewWillDisappear:animated]; -} - -#pragma mark - IBActions - -- (IBAction)momentButton:(id)sender { - GTMOAuth2Authentication *auth = [GPPSignIn sharedInstance].authentication; - if (!auth) { - // To authenticate, use Google+ sign-in button. - momentStatus_.text = @"Status: Not authenticated"; - return; - } - - // Here is an example of writing a moment to Google+: - // 1. Create a |GTLPlusMoment| object with required fields. For reference, see - // https://developers.google.com/+/features/app-activities . - int selectedRow = [[momentsTable_ indexPathForSelectedRow] row]; - NSString *selectedMoment = kMomentTypes[selectedRow]; - - GTLPlusMoment *moment = [[[GTLPlusMoment alloc] init] autorelease]; - moment.type = [NSString stringWithFormat:@"http://schemas.google.com/%@", - selectedMoment]; - GTLPlusItemScope *target = [[[GTLPlusItemScope alloc] init] autorelease]; - target.url = momentURL_.text; - if ([target.url isEqualToString:@""]) { - target.url = [self momentURLForIndex:selectedRow]; - } - moment.target = target; - - // CommentActivity, ReserveActivity, and ReviewActivity require setting a - // |result| field in the request. - GTLPlusItemScope *result = [self resultFor:selectedMoment]; - if (result) { - moment.result = result; - } - - // 2. Create a |GTLQuery| object to write a moment. - GTLQueryPlus *query = - [GTLQueryPlus queryForMomentsInsertWithObject:moment - userId:@"me" - collection:kGTLPlusCollectionVault]; - - // 3. Execute the query. - [[[GPPSignIn sharedInstance] plusService] executeQuery:query - completionHandler:^(GTLServiceTicket *ticket, - id object, - NSError *error) { - if (error) { - GTMLoggerError(@"Error: %@", error); - momentStatus_.text = - [NSString stringWithFormat:@"Status: Error: %@", error]; - } else { - momentStatus_.text = [NSString stringWithFormat: - @"Status: Saved to Google+ (%@)", - selectedMoment]; - } - }]; -} - -#pragma mark - UITableViewDelegate/UITableViewDataSource - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 1; -} - -- (NSInteger)tableView:(UITableView *)tableView - numberOfRowsInSection:(NSInteger)section { - return kNumMomentTypes; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView - cellForRowAtIndexPath:(NSIndexPath *)indexPath { - static NSString * const kCellIdentifier = @"Cell"; - UITableViewCell *cell = - [tableView dequeueReusableCellWithIdentifier:kCellIdentifier]; - if (cell == nil) { - cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:kCellIdentifier] - autorelease]; - cell.accessoryType = UITableViewCellAccessoryNone; - } - - // Configure the cell. - cell.textLabel.text = kMomentTypes[indexPath.row]; - return cell; -} - -- (void)tableView:(UITableView *)tableView - didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - int selectedRow = [[momentsTable_ indexPathForSelectedRow] row]; - momentURL_.text = [self momentURLForIndex:selectedRow]; -} - -#pragma mark - UITextFieldDelegate - -- (BOOL)textFieldShouldReturn:(UITextField *)textField { - [textField resignFirstResponder]; - return YES; -} - -#pragma mark - UIKeyboard - -- (void)keyboardWillShow:(NSNotification *)notification { - [self animateKeyboard:notification shouldShow:YES]; -} - -- (void)keyboardWillHide:(NSNotification *)notification { - [self animateKeyboard:notification shouldShow:NO]; -} - -#pragma mark - Private methods - -// Helps set required result field for select moment types. -- (GTLPlusItemScope *)resultFor:(NSString *)selectedMoment { - GTLPlusItemScope *result = [[[GTLPlusItemScope alloc] init] autorelease]; - if ([selectedMoment isEqualToString:@"CommentActivity"]) { - result.type = @"http://schema.org/Comment"; - result.url = @"https://developers.google.com/+/plugins/snippet/" - @"examples/blog-entry#comment-1"; - result.name = @"This is amazing!"; - result.text = @"I can't wait to use it on my site :)"; - return result; - } else if ([selectedMoment isEqualToString:@"ReserveActivity"]) { - result.type = @"http://schemas.google.com/Reservation"; - result.startDate = @"2012-06-28T19:00:00-08:00"; - result.attendeeCount = [[[NSNumber alloc] initWithInt:3] autorelease]; - return result; - } else if ([selectedMoment isEqualToString:@"ReviewActivity"]) { - result.type = @"http://schema.org/Review"; - result.name = @"A Humble Review of Widget"; - result.url = - @"https://developers.google.com/+/plugins/snippet/examples/review"; - result.text = - @"It's amazingly effective at whatever it is that it's supposed to do."; - GTLPlusItemScope *rating = [[[GTLPlusItemScope alloc] init] autorelease]; - rating.type = @"http://schema.org/Rating"; - rating.ratingValue = @"100"; - rating.bestRating = @"100"; - rating.worstRating = @"0"; - result.reviewRating = rating; - return result; - } - return nil; -} - -// Helps animate keyboard for target URL text field. -- (void)animateKeyboard:(NSNotification *)notification - shouldShow:(BOOL)shouldShow { - NSDictionary *userInfo = [notification userInfo]; - CGFloat height = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] - CGRectValue].size.height; - CGFloat duration = [[userInfo - objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue]; - [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationDuration:duration]; - CGRect newFrame = self.view.frame; - if (shouldShow) { - newFrame.size.height -= height; - } else { - newFrame.size.height += height; - } - self.view.frame = newFrame; - [UIView commitAnimations]; - if (shouldShow) { - keyboardVisible_ = YES; - } else { - keyboardVisible_ = NO; - } -} - -- (NSString *)momentURLForIndex:(int)i { - return [NSString stringWithFormat:kMomentURLFormat, kMomentURLs[i]]; -} - -- (void)reportAuthStatus { - if ([GPPSignIn sharedInstance].authentication) { - momentStatus_.text = @"Status: Authenticated"; - } else { - // To authenticate, use Google+ sign-in button. - momentStatus_.text = @"Status: Not authenticated"; - } -} - -@end diff --git a/External/google-plus-ios-sdk/SampleCode/MomentsViewController.xib b/External/google-plus-ios-sdk/SampleCode/MomentsViewController.xib deleted file mode 100644 index 66323a9a..00000000 --- a/External/google-plus-ios-sdk/SampleCode/MomentsViewController.xib +++ /dev/null @@ -1,479 +0,0 @@ - - - - 1552 - 12C60 - 3084 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 2083 - - - IBProxyObject - IBUIButton - IBUILabel - IBUITableView - IBUITextField - IBUIView - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - - - 290 - {{10, 5}, {296, 21}} - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Select an activity (scroll for more) - - 1 - MCAwIDAAA - darkTextColor - - - 1 - 10 - - 1 - 17 - - - Helvetica - 17 - 16 - - - - - 274 - {{0, 32}, {320, 132}} - - - - 3 - MQA - - YES - IBCocoaTouchFramework - YES - 1 - 0 - YES - 44 - 22 - 22 - - - - 266 - - - - 266 - {{11, 20}, {296, 21}} - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Enter a Moment URL - - - 1 - 10 - - - - - - 266 - {{11, 51}, {291, 31}} - - - NO - YES - IBCocoaTouchFramework - 0 - - 3 - - 3 - MAA - - 2 - - - YES - 17 - - IBCocoaTouchFramework - - - 1 - 14 - - - Helvetica - 14 - 16 - - - - - 264 - {{12, 113}, {142, 37}} - - - NO - IBCocoaTouchFramework - 0 - 0 - Add Moment - - 1 - MC40MzkyMTU2ODYzIDAuMTI1NDkwMTk2MSAwLjA2Mjc0NTA5ODA0AA - - - 1 - MC42MzUyOTQxMTc2IDAuMzIxNTY4NjI3NSAwLjI1ODgyMzUyOTQAA - - - 3 - MC41AA - - - NSImage - button_background.png - - - 2 - 15 - - - Helvetica-Bold - 15 - 16 - - - - - 266 - {{11, 180}, {290, 21}} - - NO - YES - 7 - NO - IBCocoaTouchFramework - Status: - - - 1 - 11 - - - - - {{0, 172}, {320, 244}} - - - - IBCocoaTouchFramework - - - {{0, 64}, {320, 416}} - - - 3 - MQA - - - - - - NO - - IBCocoaTouchFramework - - - - - - - view - - - - 3 - - - - momentsTable - - - - 17 - - - - momentStatus - - - - 25 - - - - addButton - - - - 28 - - - - momentURL - - - - 30 - - - - selectionLabel - - - - 32 - - - - bottomControls - - - - 34 - - - - dataSource - - - - 18 - - - - delegate - - - - 19 - - - - delegate - - - - 31 - - - - momentButton: - - - 7 - - 20 - - - - - - 0 - - - - - - 1 - - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 7 - - - - - - 26 - - - - - 27 - - - - - - - - - - - 13 - - - - - 12 - - - - - 16 - - - - - 22 - - - - - - - MomentsViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 34 - - - - - MomentsViewController - UIViewController - - momentButton: - id - - - momentButton: - - momentButton: - id - - - - UIButton - UIView - UILabel - UITextField - UITableView - UILabel - - - - addButton - UIButton - - - bottomView - UIView - - - momentStatus - UILabel - - - momentURL - UITextField - - - momentsTable - UITableView - - - selectionLabel - UILabel - - - - IBProjectSource - ./Classes/MomentsViewController.h - - - - - 0 - IBCocoaTouchFramework - YES - 3 - - button_background.png - {1, 1} - - 2083 - - diff --git a/External/google-plus-ios-sdk/SampleCode/Resources/Default-568h@2x.png b/External/google-plus-ios-sdk/SampleCode/Resources/Default-568h@2x.png deleted file mode 100644 index 0891b7aa..00000000 Binary files a/External/google-plus-ios-sdk/SampleCode/Resources/Default-568h@2x.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/SampleCode/Resources/Default@2x~iphone.png b/External/google-plus-ios-sdk/SampleCode/Resources/Default@2x~iphone.png deleted file mode 100644 index 2b30ecdc..00000000 Binary files a/External/google-plus-ios-sdk/SampleCode/Resources/Default@2x~iphone.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/SampleCode/Resources/Default~iphone.png b/External/google-plus-ios-sdk/SampleCode/Resources/Default~iphone.png deleted file mode 100644 index 84e942ec..00000000 Binary files a/External/google-plus-ios-sdk/SampleCode/Resources/Default~iphone.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/SampleCode/Resources/Icon-144.png b/External/google-plus-ios-sdk/SampleCode/Resources/Icon-144.png deleted file mode 100644 index e5965380..00000000 Binary files a/External/google-plus-ios-sdk/SampleCode/Resources/Icon-144.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/SampleCode/Resources/Icon-72.png b/External/google-plus-ios-sdk/SampleCode/Resources/Icon-72.png deleted file mode 100644 index 6a734733..00000000 Binary files a/External/google-plus-ios-sdk/SampleCode/Resources/Icon-72.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/SampleCode/Resources/Icon.png b/External/google-plus-ios-sdk/SampleCode/Resources/Icon.png deleted file mode 100644 index 8b72f13f..00000000 Binary files a/External/google-plus-ios-sdk/SampleCode/Resources/Icon.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/SampleCode/Resources/Icon@2x.png b/External/google-plus-ios-sdk/SampleCode/Resources/Icon@2x.png deleted file mode 100644 index 4c308280..00000000 Binary files a/External/google-plus-ios-sdk/SampleCode/Resources/Icon@2x.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/SampleCode/Resources/button_background.png b/External/google-plus-ios-sdk/SampleCode/Resources/button_background.png deleted file mode 100644 index b63e8719..00000000 Binary files a/External/google-plus-ios-sdk/SampleCode/Resources/button_background.png and /dev/null differ diff --git a/External/google-plus-ios-sdk/SampleCode/ShareViewController.h b/External/google-plus-ios-sdk/SampleCode/ShareViewController.h deleted file mode 100644 index c3428dde..00000000 --- a/External/google-plus-ios-sdk/SampleCode/ShareViewController.h +++ /dev/null @@ -1,87 +0,0 @@ -// -// ShareViewController.h -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import -#import -#import - -// A view controller for the Google+ share dialog which contains a text field -// to prefill the user comment, and a text field for an optional URL to share. -// A Google+ share button is provided to launch the share dialog. -@interface ShareViewController : UIViewController< - UITextFieldDelegate, - UIActionSheetDelegate, - UIPickerViewDataSource, - UIPickerViewDelegate, - MFMailComposeViewControllerDelegate> { - // Whether the keyboard is visible or not. - BOOL keyboardVisible_; - // The text field being edited. - UITextField *activeField_; -} - -@property (retain, nonatomic) NSArray *callToActions; -@property (copy, nonatomic) NSString *selectedCallToAction; -@property (retain, nonatomic) UIPickerView *callToActionPickerView; -// The text to prefill the user comment in the share dialog. -@property (retain, nonatomic) IBOutlet UITextField *sharePrefillText; -// The URL resource to share in the share dialog. -@property (retain, nonatomic) IBOutlet UITextField *shareURL; -// A label to display the result of the share action. -@property (retain, nonatomic) IBOutlet UILabel *shareStatus; -// A toolbar to share via Google+ or email. -@property (retain, nonatomic) IBOutlet UIToolbar *shareToolbar; -// A switch to toggle Google+ share with content deep linking. -@property (retain, nonatomic) IBOutlet UISwitch *addContentDeepLinkSwitch; -// The content deep-link ID to be attached with the Google+ share to qualify as -// a deep-link share. -@property (retain, nonatomic) IBOutlet UITextField *contentDeepLinkID; -// The share's title. -@property (retain, nonatomic) IBOutlet UITextField *contentDeepLinkTitle; -// The share's description. -@property (retain, nonatomic) IBOutlet UITextField *contentDeepLinkDescription; -// The share's thumbnail URL. -@property (retain, nonatomic) IBOutlet UITextField *contentDeepLinkThumbnailURL; -// The share view. -@property (retain, nonatomic) IBOutlet UIScrollView *shareScrollView; -@property (retain, nonatomic) IBOutlet UIView *shareView; -// Labels for Google+ share sample. -@property (retain, nonatomic) IBOutlet UILabel *addContentDeepLinkLabel; -@property (retain, nonatomic) IBOutlet UILabel *urlToShareLabel; -@property (retain, nonatomic) IBOutlet UILabel *prefillTextLabel; -@property (retain, nonatomic) IBOutlet UILabel *contentDeepLinkIDLabel; -@property (retain, nonatomic) IBOutlet UILabel *contentDeepLinkTitleLabel; -@property (retain, nonatomic) IBOutlet UILabel *contentDeepLinkDescriptionLabel; -@property (retain, nonatomic) IBOutlet UILabel *contentDeepLinkThumbnailURLLabel; -@property (retain, nonatomic) IBOutlet UIButton *shareButton; -@property (retain, nonatomic) IBOutlet UISwitch *urlForContentDeepLinkMetadataSwitch; -@property (retain, nonatomic) IBOutlet UILabel *urlForContentDeepLinkMetadataLabel; -// The switch for adding call-to-action button. -@property (retain, nonatomic) IBOutlet UISwitch *addCallToActionButtonSwitch; -@property (retain, nonatomic) IBOutlet UILabel *addCallToActionButtonLabel; - -// Called when the switch for content deep link is toggled. -- (IBAction)contentDeepLinkSwitchToggle:(id)sender; -// Called when the switch for metadata from URL preview is toggled. -- (IBAction)urlForContentDeepLinkMetadataSwitchToggle:(id)sender; -// Called when the share button is pressed. -- (IBAction)shareButton:(id)sender; -// Called when the toolbar share button is pressed. -- (IBAction)shareToolbar:(id)sender; - -@end diff --git a/External/google-plus-ios-sdk/SampleCode/ShareViewController.m b/External/google-plus-ios-sdk/SampleCode/ShareViewController.m deleted file mode 100644 index 9a262414..00000000 --- a/External/google-plus-ios-sdk/SampleCode/ShareViewController.m +++ /dev/null @@ -1,702 +0,0 @@ -// -// ShareViewController.m -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "ShareViewController.h" - -#import -#import -#import - -@interface ShareViewController() -- (void)animateKeyboard:(NSNotification *)notification - shouldShow:(BOOL)shouldShow; -- (void)layout; -- (void)placeView:(UIView *)view x:(CGFloat)x y:(CGFloat)y; -- (void)populateTextFields; -@end - -@implementation ShareViewController - -@synthesize callToActions = callToActions_; -@synthesize selectedCallToAction = selectedCallToAction_; -@synthesize callToActionPickerView = callToActionPickerView_; -@synthesize addContentDeepLinkSwitch = addContentDeepLinkSwitch_; -@synthesize contentDeepLinkDescription = contentDeepLinkDescription_; -@synthesize contentDeepLinkID = contentDeepLinkID_; -@synthesize contentDeepLinkTitle = contentDeepLinkTitle_; -@synthesize contentDeepLinkThumbnailURL = contentDeepLinkThumbnailURL_; -@synthesize sharePrefillText = sharePrefillText_; -@synthesize shareURL = shareURL_; -@synthesize shareStatus = shareStatus_; -@synthesize shareToolbar = shareToolbar_; -@synthesize shareScrollView = shareScrollView_; -@synthesize shareView = shareView_; -@synthesize addContentDeepLinkLabel = addContentDeepLinkLabel_; -@synthesize urlToShareLabel = urlToShareLabel_; -@synthesize prefillTextLabel = prefillTextLabel_; -@synthesize contentDeepLinkIDLabel = contentDeepLinkIDLabel_; -@synthesize contentDeepLinkTitleLabel = contentDeepLinkTitleLabel_; -@synthesize contentDeepLinkDescriptionLabel = - contentDeepLinkDescriptionLabel_; -@synthesize contentDeepLinkThumbnailURLLabel = - contentDeepLinkThumbnailURLLabel_; -@synthesize shareButton = shareButton_; -@synthesize urlForContentDeepLinkMetadataSwitch = - urlForContentDeepLinkMetadataSwitch_; -@synthesize urlForContentDeepLinkMetadataLabel = - urlForContentDeepLinkMetadataLabel_; -@synthesize addCallToActionButtonSwitch = addCallToActionButtonSwitch_; -@synthesize addCallToActionButtonLabel = addCallToActionButtonLabel_; - -- (void)dealloc { - [callToActions_ release]; - [selectedCallToAction_ release]; - [callToActionPickerView_ release]; - [addContentDeepLinkSwitch_ release]; - [contentDeepLinkID_ release]; - [contentDeepLinkTitle_ release]; - [contentDeepLinkDescription_ release]; - [contentDeepLinkThumbnailURL_ release]; - [sharePrefillText_ release]; - [shareURL_ release]; - [shareStatus_ release]; - [shareToolbar_ release]; - [shareScrollView_ release]; - [shareView_ release]; - [addContentDeepLinkLabel_ release]; - [urlToShareLabel_ release]; - [prefillTextLabel_ release]; - [contentDeepLinkIDLabel_ release]; - [contentDeepLinkTitleLabel_ release]; - [contentDeepLinkDescriptionLabel_ release]; - [contentDeepLinkThumbnailURLLabel_ release]; - [shareButton_ release]; - [urlForContentDeepLinkMetadataSwitch_ release]; - [urlForContentDeepLinkMetadataLabel_ release]; - [addCallToActionButtonSwitch_ release]; - [addCallToActionButtonLabel_ release]; - [super dealloc]; -} - -#pragma mark - View lifecycle - -- (void)viewDidLoad { - // Set up Google+ share dialog. - [GPPShare sharedInstance].delegate = self; - - [addCallToActionButtonSwitch_ setOn:NO]; - [addContentDeepLinkSwitch_ setOn:NO]; - if (![GPPSignIn sharedInstance].authentication || - ![[GPPSignIn sharedInstance].scopes containsObject: - kGTLAuthScopePlusLogin]) { - addCallToActionButtonLabel_.text = @"Sign in for call-to-action"; - addCallToActionButtonSwitch_.enabled = NO; - } - addCallToActionButtonLabel_.adjustsFontSizeToFitWidth = YES; - - self.callToActions = [NSArray arrayWithObjects: - @"ACCEPT", - @"ACCEPT_GIFT", - @"ADD", - @"ANSWER", - @"ADD_TO_CALENDAR", - @"APPLY", - @"ASK", - @"ATTACK", - @"BEAT", - @"BID", - @"BOOK", - @"BOOKMARK", - @"BROWSE", - @"BUY", - @"CAPTURE", - @"CHALLENGE", - @"CHANGE", - @"CHECKIN", - @"CLICK_HERE", - @"CLICK_ME", - @"COLLECT", - @"COMMENT", - @"COMPARE", - @"COMPLAIN", - @"CONFIRM", - @"CONNECT", - @"CONTRIBUTE", - @"COOK", - @"CREATE", - @"DEFEND", - @"DINE", - @"DISCOVER", - @"DISCUSS", - @"DONATE", - @"DOWNLOAD", - @"EARN", - @"EAT", - @"EXPLAIN", - @"FOLLOW", - @"GET", - @"GIFT", - @"GIVE", - @"GO", - @"HELP", - @"IDENTIFY", - @"INSTALL_APP", - @"INTRODUCE", - @"INVITE", - @"JOIN", - @"JOIN_ME", - @"LEARN", - @"LEARN_MORE", - @"LISTEN", - @"LOVE", - @"MAKE", - @"MATCH", - @"OFFER", - @"OPEN", - @"OPEN_APP", - @"OWN", - @"PAY", - @"PIN", - @"PLAN", - @"PLAY", - @"RATE", - @"READ", - @"RECOMMEND", - @"RECORD", - @"REDEEM", - @"REPLY", - @"RESERVE", - @"REVIEW", - @"RSVP", - @"SAVE", - @"SAVE_OFFER", - @"SELL", - @"SEND", - @"SHARE_X", - @"SIGN_IN", - @"SIGN_UP", - @"START", - @"ST0P", - @"TEST", - @"UPVOTE", - @"VIEW", - @"VIEW_ITEM", - @"VIEW_PROFILE", - @"VISIT", - @"VOTE", - @"WANT", - @"WATCH", - @"WRITE", - nil - ]; - self.selectedCallToAction = [callToActions_ objectAtIndex:0]; - self.callToActionPickerView = [[[UIPickerView alloc] init] autorelease]; - callToActionPickerView_.delegate = self; - callToActionPickerView_.dataSource = self; - [addCallToActionButtonSwitch_ addTarget:self - action:@selector(addCallToActionSwitched) - forControlEvents:UIControlEventValueChanged]; - - [self layout]; - [self populateTextFields]; - [super viewDidLoad]; -} - -- (void)viewDidUnload { - [GPPShare sharedInstance].delegate = nil; - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:UIKeyboardWillShowNotification - object:nil]; - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:UIKeyboardWillHideNotification - object:nil]; - - [self setAddContentDeepLinkSwitch:nil]; - [self setContentDeepLinkID:nil]; - [self setContentDeepLinkTitle:nil]; - [self setContentDeepLinkDescription:nil]; - [self setContentDeepLinkThumbnailURL:nil]; - [self setShareScrollView:nil]; - [self setShareView:nil]; - [self setShareToolbar:nil]; - [self setAddContentDeepLinkLabel:nil]; - [self setUrlToShareLabel:nil]; - [self setPrefillTextLabel:nil]; - [self setContentDeepLinkIDLabel:nil]; - [self setContentDeepLinkTitleLabel:nil]; - [self setContentDeepLinkDescriptionLabel:nil]; - [self setContentDeepLinkThumbnailURLLabel:nil]; - [self setShareButton:nil]; - [self setUrlForContentDeepLinkMetadataSwitch:nil]; - [self setUrlForContentDeepLinkMetadataLabel:nil]; - [self setAddCallToActionButtonSwitch:nil]; - [self setAddCallToActionButtonLabel:nil]; - [super viewDidUnload]; -} - -- (void)viewWillAppear:(BOOL)animated { - if ([[UIDevice currentDevice] userInterfaceIdiom] - == UIUserInterfaceIdiomPad) { - shareScrollView_.frame = self.view.frame; - } - [super viewWillAppear:animated]; - - // Register for keyboard notifications while visible. - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:nil]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(keyboardWillHide:) - name:UIKeyboardWillHideNotification - object:nil]; -} - -- (void)viewWillDisappear:(BOOL)animated { - // Unregister for keyboard notifications while not visible. - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:UIKeyboardWillShowNotification - object:nil]; - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:UIKeyboardWillHideNotification - object:nil]; - - [super viewWillDisappear:animated]; -} - -#pragma mark - UITextFieldDelegate - -- (BOOL)textFieldShouldReturn:(UITextField *)textField { - [textField resignFirstResponder]; - return YES; -} - -- (void)textFieldDidBeginEditing:(UITextField *)textField { - activeField_ = textField; -} - -- (void)textFieldDidEndEditing:(UITextField *)textField { - activeField_ = nil; -} - -#pragma mark - GPPShareDelegate - -- (void)finishedSharing:(BOOL)shared { - NSString *text = shared ? @"Success" : @"Canceled"; - shareStatus_.text = [NSString stringWithFormat:@"Status: %@", text]; -} - -#pragma mark - UIActionSheetDelegate - -- (void)actionSheet:(UIActionSheet *)actionSheet - didDismissWithButtonIndex:(NSInteger)buttonIndex { - if (buttonIndex == 0) { - [self shareButton:nil]; - } else if (buttonIndex == 1) { - shareStatus_.text = @"Status: Sharing..."; - MFMailComposeViewController *picker = - [[[MFMailComposeViewController alloc] init] autorelease]; - picker.mailComposeDelegate = self; - [picker setSubject:sharePrefillText_.text]; - [picker setMessageBody:shareURL_.text isHTML:NO]; - - [self presentModalViewController:picker animated:YES]; - } -} - -#pragma mark - MFMailComposeViewControllerDelegate - -- (void)mailComposeController:(MFMailComposeViewController *)controller - didFinishWithResult:(MFMailComposeResult)result - error:(NSError*)error { - NSString *text; - switch (result) { - case MFMailComposeResultCancelled: - text = @"Canceled"; - break; - case MFMailComposeResultSaved: - text = @"Saved"; - break; - case MFMailComposeResultSent: - text = @"Sent"; - break; - case MFMailComposeResultFailed: - text = @"Failed"; - break; - default: - text = @"Not sent"; - break; - } - shareStatus_.text = [NSString stringWithFormat:@"Status: %@", text]; - [self dismissModalViewControllerAnimated:YES]; -} - -#pragma mark - UIKeyboard - -- (void)keyboardWillShow:(NSNotification *)notification { - [self animateKeyboard:notification shouldShow:YES]; -} - -- (void)keyboardWillHide:(NSNotification *)notification { - [self animateKeyboard:notification shouldShow:NO]; -} - -#pragma mark - IBActions - -- (IBAction)shareButton:(id)sender { - shareStatus_.text = @"Status: Sharing..."; - id shareBuilder = [[GPPShare sharedInstance] shareDialog]; - - NSString *inputURL = shareURL_.text; - NSURL *urlToShare = [inputURL length] ? [NSURL URLWithString:inputURL] : nil; - if (urlToShare) { - [shareBuilder setURLToShare:urlToShare]; - } - - if ([contentDeepLinkID_ text]) { - [shareBuilder setContentDeepLinkID:[contentDeepLinkID_ text]]; - NSString *title = [contentDeepLinkTitle_ text]; - NSString *description = [contentDeepLinkDescription_ text]; - if (title && description) { - NSURL *thumbnailURL = - [NSURL URLWithString:[contentDeepLinkThumbnailURL_ text]]; - [shareBuilder setTitle:title - description:description - thumbnailURL:thumbnailURL]; - } - } - - NSString *inputText = sharePrefillText_.text; - NSString *text = [inputText length] ? inputText : nil; - if (text) { - [shareBuilder setPrefillText:text]; - } - - if ([addCallToActionButtonSwitch_ isOn]) { - // Please replace the URL below with your own call-to-action button URL. - NSURL *callToActionURL = [NSURL URLWithString: - @"http://developers.google.com/+/mobile/ios/"]; - [shareBuilder setCallToActionButtonWithLabel:selectedCallToAction_ - URL:callToActionURL - deepLinkID:@"call-to-action"]; - } - - if (![shareBuilder open]) { - shareStatus_.text = @"Status: Error (see console)."; - } -} - -- (IBAction)shareToolbar:(id)sender { - UIActionSheet *actionSheet = - [[[UIActionSheet alloc] initWithTitle:@"Share this post" - delegate:self - cancelButtonTitle:@"Cancel" - destructiveButtonTitle:nil - otherButtonTitles:@"Google+", @"Email", nil] - autorelease]; - [actionSheet showFromToolbar:shareToolbar_]; -} - -- (IBAction)urlForContentDeepLinkMetadataSwitchToggle:(id)sender { - [self layout]; - [self populateTextFields]; -} - -- (IBAction)contentDeepLinkSwitchToggle:(id)sender { - if (!addContentDeepLinkSwitch_.on) { - [urlForContentDeepLinkMetadataSwitch_ setOn:YES]; - } - [self layout]; - [self populateTextFields]; -} - -#pragma mark - Helper methods - -- (void)placeView:(UIView *)view x:(CGFloat)x y:(CGFloat)y { - CGSize frameSize = view.frame.size; - view.frame = CGRectMake(x, y, frameSize.width, frameSize.height); -} - -- (void)layout { - CGFloat originX = 20.0; - CGFloat originY = 10.0; - CGFloat yPadding = 10.0; - CGFloat currentY = originY; - CGFloat middleX = 150; - - // Place the switch for adding call-to-action button. - [self placeView:addCallToActionButtonLabel_ x:originX y:currentY]; - [self placeView:addCallToActionButtonSwitch_ x:middleX * 1.5 y:currentY]; - CGSize frameSize = addCallToActionButtonSwitch_.frame.size; - currentY += frameSize.height + yPadding; - - // Place the switch for attaching content deep-link data. - [self placeView:addContentDeepLinkLabel_ x:originX y:currentY]; - [self placeView:addContentDeepLinkSwitch_ x:middleX * 1.5 y:currentY]; - frameSize = addContentDeepLinkSwitch_.frame.size; - currentY += frameSize.height + yPadding; - - // Place the switch for preview URL. - if (addContentDeepLinkSwitch_.on) { - [self placeView:urlForContentDeepLinkMetadataLabel_ x:originX y:currentY]; - [self placeView:urlForContentDeepLinkMetadataSwitch_ - x:middleX * 1.5 - y:currentY]; - frameSize = urlForContentDeepLinkMetadataSwitch_.frame.size; - currentY += frameSize.height + yPadding; - urlForContentDeepLinkMetadataSwitch_.hidden = NO; - urlForContentDeepLinkMetadataLabel_.hidden = NO; - } else { - urlForContentDeepLinkMetadataSwitch_.hidden = YES; - urlForContentDeepLinkMetadataLabel_.hidden = YES; - } - - // Place the field for URL to share. - if (urlForContentDeepLinkMetadataSwitch_.on) { - [self placeView:urlToShareLabel_ x:originX y:currentY]; - frameSize = urlToShareLabel_.frame.size; - currentY += frameSize.height + 0.5 * yPadding; - - [self placeView:shareURL_ x:originX y:currentY]; - frameSize = shareURL_.frame.size; - currentY += frameSize.height + yPadding; - urlToShareLabel_.hidden = NO; - shareURL_.hidden = NO; - } else { - urlToShareLabel_.hidden = YES; - shareURL_.hidden = YES; - } - - // Place the field for prefill text. - [self placeView:prefillTextLabel_ x:originX y:currentY]; - frameSize = prefillTextLabel_.frame.size; - currentY += frameSize.height + 0.5 * yPadding; - [self placeView:sharePrefillText_ x:originX y:currentY]; - frameSize = sharePrefillText_.frame.size; - currentY += frameSize.height + yPadding; - - // Place the content deep-link ID field. - if (addContentDeepLinkSwitch_.on) { - [self placeView:contentDeepLinkIDLabel_ x:originX y:currentY]; - frameSize = contentDeepLinkIDLabel_.frame.size; - currentY += frameSize.height + 0.5 * yPadding; - [self placeView:contentDeepLinkID_ x:originX y:currentY]; - frameSize = contentDeepLinkID_.frame.size; - currentY += frameSize.height + yPadding; - contentDeepLinkIDLabel_.hidden = NO; - contentDeepLinkID_.hidden = NO; - } else { - contentDeepLinkIDLabel_.hidden = YES; - contentDeepLinkID_.hidden = YES; - } - - // Place fields for content deep-link metadata. - if (addContentDeepLinkSwitch_.on && - !urlForContentDeepLinkMetadataSwitch_.on) { - [self placeView:contentDeepLinkTitleLabel_ x:originX y:currentY]; - frameSize = contentDeepLinkTitleLabel_.frame.size; - currentY += frameSize.height + 0.5 * yPadding; - [self placeView:contentDeepLinkTitle_ x:originX y:currentY]; - frameSize = contentDeepLinkTitle_.frame.size; - currentY += frameSize.height + yPadding; - - [self placeView:contentDeepLinkDescriptionLabel_ x:originX y:currentY]; - frameSize = contentDeepLinkDescriptionLabel_.frame.size; - currentY += frameSize.height + 0.5 * yPadding; - [self placeView:contentDeepLinkDescription_ x:originX y:currentY]; - frameSize = contentDeepLinkDescription_.frame.size; - currentY += frameSize.height + yPadding; - - [self placeView:contentDeepLinkThumbnailURLLabel_ x:originX y:currentY]; - frameSize = contentDeepLinkThumbnailURLLabel_.frame.size; - currentY += frameSize.height + 0.5 * yPadding; - [self placeView:contentDeepLinkThumbnailURL_ x:originX y:currentY]; - frameSize = contentDeepLinkThumbnailURL_.frame.size; - currentY += frameSize.height + yPadding; - - contentDeepLinkTitle_.hidden = NO; - contentDeepLinkTitleLabel_.hidden = NO; - contentDeepLinkDescriptionLabel_.hidden = NO; - contentDeepLinkDescription_.hidden = NO; - contentDeepLinkThumbnailURLLabel_.hidden = NO; - contentDeepLinkThumbnailURL_.hidden = NO; - } else { - contentDeepLinkTitle_.hidden = YES; - contentDeepLinkTitleLabel_.hidden = YES; - contentDeepLinkDescriptionLabel_.hidden = YES; - contentDeepLinkDescription_.hidden = YES; - contentDeepLinkThumbnailURLLabel_.hidden = YES; - contentDeepLinkThumbnailURL_.hidden = YES; - } - - // Place the share button and status. - [[shareButton_ layer] setCornerRadius:5]; - [[shareButton_ layer] setMasksToBounds:YES]; - CGColorRef borderColor = [[UIColor colorWithWhite:203.0/255.0 - alpha:1.0] CGColor]; - [[shareButton_ layer] setBorderColor:borderColor]; - [[shareButton_ layer] setBorderWidth:1.0]; - - [self placeView:shareButton_ x:originX y:currentY + yPadding]; - frameSize = shareButton_.frame.size; - currentY += frameSize.height + yPadding * 2; - - [self placeView:shareStatus_ x:originX y:currentY]; - frameSize = shareStatus_.frame.size; - currentY += frameSize.height + yPadding; - - shareScrollView_.contentSize = - CGSizeMake(shareScrollView_.frame.size.width, currentY); -} - -- (void)populateTextFields { - // Pre-populate text fields for Google+ share sample. - if (sharePrefillText_.hidden) { - sharePrefillText_.text = @""; - } else { - sharePrefillText_.text = @"Welcome to Google+ Platform"; - } - - if (shareURL_.hidden) { - shareURL_.text = @""; - } else { - shareURL_.text = @"http://developers.google.com/+/mobile/ios/"; - } - - if (contentDeepLinkID_.hidden) { - contentDeepLinkID_.text = @""; - } else { - contentDeepLinkID_.text = @"playlist/314159265358"; - } - - if (contentDeepLinkTitle_.hidden) { - contentDeepLinkTitle_.text = @""; - } else { - contentDeepLinkTitle_.text = @"Joe's Pop Music Playlist"; - } - - if (contentDeepLinkDescription_.hidden) { - contentDeepLinkDescription_.text = @""; - } else { - contentDeepLinkDescription_.text = - @"Check out this playlist of my favorite pop songs!"; - } - - if (contentDeepLinkThumbnailURL_.hidden) { - contentDeepLinkThumbnailURL_.text = @""; - } else { - contentDeepLinkThumbnailURL_.text = - @"http://www.google.com/logos/2012/childrensday-2012-hp.jpg"; - } -} - -- (void)animateKeyboard:(NSNotification *)notification - shouldShow:(BOOL)shouldShow { - if (!shouldShow) { - UIEdgeInsets contentInsets = UIEdgeInsetsZero; - shareScrollView_.contentInset = contentInsets; - shareScrollView_.scrollIndicatorInsets = contentInsets; - return; - } - - NSDictionary *userInfo = [notification userInfo]; - CGRect kbFrame = - [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue]; - CGSize kbSize = kbFrame.size; - UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0, kbSize.height, 0.0); - shareScrollView_.contentInset = contentInsets; - shareScrollView_.scrollIndicatorInsets = contentInsets; - - // If active text field is hidden by keyboard, scroll so it's visible. - CGRect aRect = self.view.frame; - aRect.size.height -= kbSize.height; - CGPoint bottomLeft = - CGPointMake(0.0, activeField_.frame.origin.y + - activeField_.frame.size.height + 10); - if (!CGRectContainsPoint(aRect, bottomLeft)) { - CGPoint scrollPoint = CGPointMake(0.0, bottomLeft.y - aRect.size.height); - [shareScrollView_ setContentOffset:scrollPoint animated:YES]; - } - return; -} - -- (void)addCallToActionSwitched { - if (!addCallToActionButtonSwitch_.on) { - return; - } - [self.view addSubview:callToActionPickerView_]; -} - -#pragma mark - UIPickerViewDataSource - -- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { - return 1; -} - -- (NSInteger)pickerView:(UIPickerView *)pickerView - numberOfRowsInComponent:(NSInteger)component { - return callToActions_.count; -} - -#pragma mark - UIPickerViewDelegate - -- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row - forComponent:(NSInteger)component reusingView:(UIView *)view { - UITableViewCell *cell = (UITableViewCell *)view; - if (cell == nil) { - cell = [[[UITableViewCell alloc] - initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:nil] autorelease]; - [cell setBackgroundColor:[UIColor clearColor]]; - [cell setBounds: CGRectMake(0, 0, cell.frame.size.width - 20 , 44)]; - UITapGestureRecognizer *singleTapGestureRecognizer = - [[[UITapGestureRecognizer alloc] - initWithTarget:self - action:@selector(toggleSelection:)] autorelease]; - singleTapGestureRecognizer.numberOfTapsRequired = 1; - [cell addGestureRecognizer:singleTapGestureRecognizer]; - } - NSString *callToAction = [callToActions_ objectAtIndex:row]; - if ([selectedCallToAction_ isEqualToString:callToAction]) { - cell.accessoryType = UITableViewCellAccessoryCheckmark; - } else { - cell.accessoryType = UITableViewCellAccessoryNone; - } - cell.textLabel.text = callToAction; - cell.textLabel.font = [UIFont systemFontOfSize:12]; - cell.tag = row; - return cell; -} - -- (void)toggleSelection:(UITapGestureRecognizer *)recognizer { - int row = recognizer.view.tag; - self.selectedCallToAction = [callToActions_ objectAtIndex:row]; - [callToActionPickerView_ removeFromSuperview]; - // Force refresh checked/unchecked marks. - [callToActionPickerView_ reloadAllComponents]; - addCallToActionButtonLabel_.text = - [NSString stringWithFormat:@"Call-to-Action: %@", selectedCallToAction_]; -} - -@end diff --git a/External/google-plus-ios-sdk/SampleCode/ShareViewController.xib b/External/google-plus-ios-sdk/SampleCode/ShareViewController.xib deleted file mode 100644 index 25fa0a57..00000000 --- a/External/google-plus-ios-sdk/SampleCode/ShareViewController.xib +++ /dev/null @@ -1,1231 +0,0 @@ - - - - 1536 - 12C60 - 2844 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1930 - - - IBProxyObject - IBUIBarButtonItem - IBUIButton - IBUILabel - IBUIScrollView - IBUISwitch - IBUITextField - IBUIToolbar - IBUIView - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - - - 292 - - - - 292 - {{26, 126}, {280, 31}} - - - - NO - YES - IBCocoaTouchFramework - 0 - http://developers.google.com/+/mobile/ios/ - 3 - - 3 - MAA - - 2 - - - YES - 17 - - IBCocoaTouchFramework - - 3 - - 1 - 14 - - - Helvetica - 14 - 16 - - - - - 292 - {{26, 89}, {179, 21}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - URL to share (optional) - - 1 - MCAwIDAAA - darkTextColor - - - 1 - 10 - - 1 - 17 - - - Helvetica - 17 - 16 - - - - - 292 - {{31, 261}, {112, 32}} - - - - NO - IBCocoaTouchFramework - 0 - 0 - Share - - 3 - MQA - - - 1 - MC41MjE1Njg2NTYgMC4wNTU3MzQ0MTc0NyAwLjA4MTU0NTQ3OTkzAA - - - 3 - MC41AA - - - NSImage - button_background.png - - - 2 - 15 - - - Helvetica-Bold - 15 - 16 - - - - - 292 - {{26, 165}, {156, 21}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Prefill text (optional) - - - 1 - 10 - - - - - - 290 - {{38, 312}, {268, 21}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Status: - - - 1 - 15 - - - - - - 292 - {{208, 35}, {94, 27}} - - - - NO - IBCocoaTouchFramework - 0 - 0 - YES - - - - 292 - {{20, 38}, {172, 21}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Add content deep link - - - 1 - 10 - - - - - - 292 - {{26, 198}, {280, 31}} - - - - NO - YES - IBCocoaTouchFramework - 0 - Welcome to Google+ Platform - 3 - - 3 - MAA - - - YES - 17 - - IBCocoaTouchFramework - - 3 - - - - - - 292 - {{26, 247}, {280, 30}} - - - - _NS:9 - NO - YES - IBCocoaTouchFramework - 0 - - 3 - - 3 - MAA - - - YES - 17 - - IBCocoaTouchFramework - - 3 - - - - - - 292 - {{26, 292}, {246, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Content deep-link ID (required) - - - 0 - - - NO - - - - 292 - {{26, 335}, {171, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Title (required) - - - 0 - - - NO - - - - 292 - {{26, 402}, {280, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Description (optional) - - - 0 - - - NO - - - - 292 - {{24, 469}, {194, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Thumbnail URL (optional) - - - 0 - - - NO - - - - 292 - {{26, 431}, {280, 30}} - - - - _NS:9 - NO - YES - IBCocoaTouchFramework - 0 - - 3 - - 3 - MAA - - - YES - 17 - - IBCocoaTouchFramework - - 3 - - - - - - 292 - {{26, 498}, {280, 30}} - - - - _NS:9 - NO - YES - IBCocoaTouchFramework - 0 - - 3 - - 3 - MAA - - - YES - 17 - - IBCocoaTouchFramework - - 3 - - - - - - 292 - {{26, 364}, {280, 30}} - - - - _NS:9 - NO - YES - IBCocoaTouchFramework - 0 - - 3 - - 3 - MAA - - - YES - 17 - - IBCocoaTouchFramework - - 3 - - - - - - 292 - {{208, 66}, {94, 27}} - - - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - YES - - - - 292 - {{20, 4530}, {172, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Use URL for preview - - - 0 - - - NO - - - - 292 - {{208, 4}, {94, 27}} - - - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - YES - - - - 292 - {{20, 4}, {184, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Add call-to-action button - - - 0 - - - NO - - - {320, 372} - - - - _NS:9 - YES - YES - IBCocoaTouchFramework - - - - 266 - {{0, 372}, {320, 44}} - - - NO - NO - IBCocoaTouchFramework - - - IBCocoaTouchFramework - - 5 - - - IBCocoaTouchFramework - 1 - - 9 - - - - - {{0, 64}, {320, 416}} - - - - - 3 - MQA - - - - - NO - - IBCocoaTouchFramework - - - - - - - view - - - - 3 - - - - shareView - - - - 42 - - - - shareToolbar - - - - 43 - - - - contentDeepLinkThumbnailURLLabel - - - - 58 - - - - addContentDeepLinkLabel - - - - 52 - - - - shareButton - - - - 59 - - - - contentDeepLinkTitle - - - - 49 - - - - urlToShareLabel - - - - 53 - - - - contentDeepLinkDescriptionLabel - - - - 57 - - - - sharePrefillText - - - - 11 - - - - contentDeepLinkTitleLabel - - - - 56 - - - - urlForContentDeepLinkMetadataLabel - - - - 64 - - - - contentDeepLinkThumbnailURL - - - - 51 - - - - shareURL - - - - 21 - - - - contentDeepLinkDescription - - - - 50 - - - - prefillTextLabel - - - - 54 - - - - addContentDeepLinkSwitch - - - - 28 - - - - shareScrollView - - - - 41 - - - - shareStatus - - - - 14 - - - - contentDeepLinkIDLabel - - - - 55 - - - - urlForContentDeepLinkMetadataSwitch - - - - 62 - - - - contentDeepLinkID - - - - 48 - - - - addCallToActionButtonLabel - - - - 68 - - - - addCallToActionButtonSwitch - - - - 69 - - - - delegate - - - - 23 - - - - delegate - - - - 22 - - - - shareButton: - - - 7 - - 10 - - - - shareToolbar: - - - - 20 - - - - contentDeepLinkSwitchToggle: - - - 13 - - 31 - - - - delegate - - - - 44 - - - - delegate - - - - 46 - - - - delegate - - - - 47 - - - - delegate - - - - 45 - - - - urlForContentDeepLinkMetadataSwitchToggle: - - - 13 - - 63 - - - - - - 0 - - - - - - 1 - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 15 - - - - - - - - - 17 - - - - - 18 - - - - - 32 - - - - - - - - - - - - - - - - - - - - - - - - - - - 6 - - - - - 8 - - - - - 5 - - - - - 39 - - - - - 37 - - - - - 38 - - - - - 36 - - - - - 40 - - - - - 9 - - - - - 13 - - - - - 26 - - - - - 29 - - - - - 7 - - - - - 34 - - - - - 35 - - - - - 60 - - - - - 61 - - - - - 33 - - - - - 65 - - - - - 66 - - - - - - - ShareViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 69 - - - - - ShareViewController - UIViewController - - id - id - id - id - - - - contentDeepLinkSwitchToggle: - id - - - shareButton: - id - - - shareToolbar: - id - - - urlForContentDeepLinkMetadataSwitchToggle: - id - - - - UILabel - UISwitch - UILabel - UISwitch - UITextField - UILabel - UITextField - UILabel - UITextField - UILabel - UITextField - UILabel - UILabel - UIButton - UITextField - UIScrollView - UILabel - UIToolbar - UITextField - UIView - UILabel - UISwitch - UILabel - - - - addCallToActionButtonLabel - UILabel - - - addCallToActionButtonSwitch - UISwitch - - - addContentDeepLinkLabel - UILabel - - - addContentDeepLinkSwitch - UISwitch - - - contentDeepLinkDescription - UITextField - - - contentDeepLinkDescriptionLabel - UILabel - - - contentDeepLinkID - UITextField - - - contentDeepLinkIDLabel - UILabel - - - contentDeepLinkThumbnailURL - UITextField - - - contentDeepLinkThumbnailURLLabel - UILabel - - - contentDeepLinkTitle - UITextField - - - contentDeepLinkTitleLabel - UILabel - - - prefillTextLabel - UILabel - - - shareButton - UIButton - - - sharePrefillText - UITextField - - - shareScrollView - UIScrollView - - - shareStatus - UILabel - - - shareToolbar - UIToolbar - - - shareURL - UITextField - - - shareView - UIView - - - urlForContentDeepLinkMetadataLabel - UILabel - - - urlForContentDeepLinkMetadataSwitch - UISwitch - - - urlToShareLabel - UILabel - - - - IBProjectSource - ./Classes/ShareViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - YES - 3 - - button_background.png - {1, 1} - - 1930 - - diff --git a/External/google-plus-ios-sdk/SampleCode/SignInViewController.h b/External/google-plus-ios-sdk/SampleCode/SignInViewController.h deleted file mode 100644 index 4b15cff5..00000000 --- a/External/google-plus-ios-sdk/SampleCode/SignInViewController.h +++ /dev/null @@ -1,51 +0,0 @@ -// -// SignInViewController.h -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import - -@class GPPSignInButton; - -// A view controller for the Google+ sign-in button which initiates a standard -// OAuth 2.0 flow and provides an access token and a refresh token. A "Sign out" -// button is provided to allow users to sign out of this application. -@interface SignInViewController : UIViewController - -// The button that handles Google+ sign-in. -@property (retain, nonatomic) IBOutlet GPPSignInButton *signInButton; -// A label to display the result of the sign-in action. -@property (retain, nonatomic) IBOutlet UILabel *signInAuthStatus; -// A label to display the signed-in user's display name. -@property (retain, nonatomic) IBOutlet UILabel *signInDisplayName; -// A button to sign out of this application. -@property (retain, nonatomic) IBOutlet UIButton *signOutButton; -// A button to disconnect user from this application. -@property (retain, nonatomic) IBOutlet UIButton *disconnectButton; -// A switch for whether to request -// https://www.googleapis.com/auth/userinfo.email scope to get user's email -// address after the sign-in action. -@property (retain, nonatomic) IBOutlet UISwitch *userinfoEmailScope; - -// Called when the user presses the "Sign out" button. -- (IBAction)signOut:(id)sender; -// Called when the user presses the "Disconnect" button. -- (IBAction)disconnect:(id)sender; -// Called when the user toggles the -// https://www.googleapis.com/auth/userinfo.email scope. -- (IBAction)userinfoEmailScopeToggle:(id)sender; - -@end diff --git a/External/google-plus-ios-sdk/SampleCode/SignInViewController.m b/External/google-plus-ios-sdk/SampleCode/SignInViewController.m deleted file mode 100644 index 3f9e623c..00000000 --- a/External/google-plus-ios-sdk/SampleCode/SignInViewController.m +++ /dev/null @@ -1,168 +0,0 @@ -// -// SignInViewController.m -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import "SignInViewController.h" - -#import -#import -#import - -@interface SignInViewController () -- (void)enableSignInSettings:(BOOL)enable; -- (void)reportAuthStatus; -- (void)retrieveUserInfo; -@end - -@implementation SignInViewController - -@synthesize signInButton = signInButton_; -@synthesize signInAuthStatus = signInAuthStatus_; -@synthesize signInDisplayName = signInDisplayName_; -@synthesize signOutButton = signOutButton_; -@synthesize disconnectButton = disconnectButton_; -@synthesize userinfoEmailScope = userinfoEmailScope_; - -- (void)dealloc { - [signInButton_ release]; - [signInAuthStatus_ release]; - [signInDisplayName_ release]; - [signOutButton_ release]; - [userinfoEmailScope_ release]; - [super dealloc]; -} - -#pragma mark - View lifecycle - -- (void)viewDidLoad { - // Make sure the GPPSignInButton class is linked in because references from - // xib file doesn't count. - [GPPSignInButton class]; - - GPPSignIn *signIn = [GPPSignIn sharedInstance]; - userinfoEmailScope_.on = - signIn.shouldFetchGoogleUserEmail; - - // Set up sign-out and disconnect buttons. - [self setUpButton:signOutButton_]; - [self setUpButton:disconnectButton_]; - - // Set up sample view of Google+ sign-in. - // The client ID has been set in the app delegate. - signIn.delegate = self; - signIn.shouldFetchGoogleUserEmail = userinfoEmailScope_.on; - signIn.actions = [NSArray arrayWithObjects: - @"http://schemas.google.com/AddActivity", - @"http://schemas.google.com/BuyActivity", - @"http://schemas.google.com/CheckInActivity", - @"http://schemas.google.com/CommentActivity", - @"http://schemas.google.com/CreateActivity", - @"http://schemas.google.com/ListenActivity", - @"http://schemas.google.com/ReserveActivity", - @"http://schemas.google.com/ReviewActivity", - nil]; - - [self reportAuthStatus]; - [signIn trySilentAuthentication]; - [super viewDidLoad]; -} - -- (void)viewDidUnload { - [self setSignInButton:nil]; - [self setSignInAuthStatus:nil]; - [self setSignInDisplayName:nil]; - [self setSignOutButton:nil]; - [self setDisconnectButton:nil]; - [self setUserinfoEmailScope:nil]; - [super viewDidUnload]; -} - -#pragma mark - GPPSignInDelegate - -- (void)finishedWithAuth:(GTMOAuth2Authentication *)auth - error:(NSError *)error { - if (error) { - signInAuthStatus_.text = - [NSString stringWithFormat:@"Status: Authentication error: %@", error]; - return; - } - [self reportAuthStatus]; -} - -- (void)didDisconnectWithError:(NSError *)error { - if (error) { - signInAuthStatus_.text = - [NSString stringWithFormat:@"Status: Failed to disconnect: %@", error]; - } else { - signInAuthStatus_.text = - [NSString stringWithFormat:@"Status: Disconnected"]; - signInDisplayName_.text = @""; - [self enableSignInSettings:YES]; - } -} - -#pragma mark - Helper methods - -- (void)setUpButton:(UIButton *)button { - [[button layer] setCornerRadius:5]; - [[button layer] setMasksToBounds:YES]; - CGColorRef borderColor = [[UIColor colorWithWhite:203.0/255.0 - alpha:1.0] CGColor]; - [[button layer] setBorderColor:borderColor]; - [[button layer] setBorderWidth:1.0]; -} - -- (void)enableSignInSettings:(BOOL)enable { - userinfoEmailScope_.enabled = enable; -} - -- (void)reportAuthStatus { - if ([GPPSignIn sharedInstance].authentication) { - signInAuthStatus_.text = @"Status: Authenticated"; - [self retrieveUserInfo]; - [self enableSignInSettings:NO]; - } else { - // To authenticate, use Google+ sign-in button. - signInAuthStatus_.text = @"Status: Not authenticated"; - [self enableSignInSettings:YES]; - } -} - -- (void)retrieveUserInfo { - signInDisplayName_.text = [NSString stringWithFormat:@"Email: %@", - [GPPSignIn sharedInstance].authentication.userEmail]; -} - -#pragma mark - IBActions - -- (IBAction)signOut:(id)sender { - [[GPPSignIn sharedInstance] signOut]; - - [self reportAuthStatus]; - signInDisplayName_.text = @""; -} - -- (IBAction)disconnect:(id)sender { - [[GPPSignIn sharedInstance] disconnect]; -} - -- (IBAction)userinfoEmailScopeToggle:(id)sender { - [GPPSignIn sharedInstance].shouldFetchGoogleUserEmail = - userinfoEmailScope_.on; -} - -@end diff --git a/External/google-plus-ios-sdk/SampleCode/SignInViewController.xib b/External/google-plus-ios-sdk/SampleCode/SignInViewController.xib deleted file mode 100644 index 11350f6a..00000000 --- a/External/google-plus-ios-sdk/SampleCode/SignInViewController.xib +++ /dev/null @@ -1,514 +0,0 @@ - - - - 1552 - 12C60 - 3084 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 2083 - - - IBProxyObject - IBUIButton - IBUILabel - IBUISwitch - IBUIView - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - - - 292 - {{19, 171}, {117, 35}} - - - - NO - IBCocoaTouchFramework - 0 - 0 - Sign out - - 1 - MC42MzUyOTQxMTc2IDAuMzIxNTY4NjI3NSAwLjI1ODgyMzUyOTQAA - - - 1 - MC42MzUyOTQxMTc2IDAuMzIxNTY4NjI3NSAwLjI1ODgyMzUyOTQAA - - - 3 - MC41AA - - - NSImage - button_background.png - - - 2 - 15 - - - Helvetica-Bold - 15 - 16 - - - - - 292 - {{18, 112}, {118, 32}} - - - - - 3 - MQA - - 2 - - - IBCocoaTouchFramework - - - - 290 - {{20, 241}, {280, 21}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Status: - - 1 - MCAwIDAAA - darkTextColor - - - 1 - 13 - - 1 - 17 - - - Helvetica - 17 - 16 - - - - - 290 - {{20, 270}, {280, 65}} - - - NO - YES - 7 - NO - IBCocoaTouchFramework - - - - 1 - 13 - 2 - - - 280 - - - - 292 - {{18, 15}, {273, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Sign-in setting (sign out to change) - - - 0 - - - NO - - - - 292 - {{18, 44}, {197, 27}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - get userinfo.email scope - - - 0 - - - NO - - - - 292 - {{208, 44}, {94, 27}} - - - - _NS:9 - NO - IBCocoaTouchFramework - NO - 0 - 0 - - - - 292 - {{181, 171}, {119, 35}} - - - - NO - IBCocoaTouchFramework - 0 - 0 - Disconnect - - 1 - MC42MzUyOTQxMTc2IDAuMzIxNTY4NjI3NSAwLjI1ODgyMzUyOTQAA - - - 1 - MC42MzUyOTQxMTc2IDAuMzIxNTY4NjI3NSAwLjI1ODgyMzUyOTQAA - - - - - - - - {{0, 20}, {320, 460}} - - - - - 3 - MQA - - - - IBCocoaTouchFramework - - - - - - - view - - - - 4 - - - - signInButton - - - - 14 - - - - signInAuthStatus - - - - 23 - - - - signOutButton - - - - 24 - - - - signInDisplayName - - - - 28 - - - - userinfoEmailScope - - - - 39 - - - - disconnectButton - - - - 51 - - - - signOut: - - - 7 - - 26 - - - - userinfoEmailScopeToggle: - - - 13 - - 40 - - - - disconnect: - - - 7 - - 50 - - - - - - 0 - - - - - - 1 - - - - - - - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 7 - - - - - 6 - - - - - 22 - - - - - 27 - - - - - 37 - - - - - 38 - - - - - 30 - - - - - 48 - - - - - - - SignInViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - GPPSignInButton - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 51 - - - - - GPPSignInButton - UIButton - - IBProjectSource - ./Classes/GPPSignInButton.h - - - - SignInViewController - UIViewController - - id - id - id - - - - disconnect: - id - - - signOut: - id - - - userinfoEmailScopeToggle: - id - - - - UIButton - UILabel - GPPSignInButton - UILabel - UIButton - UISwitch - - - - disconnectButton - UIButton - - - signInAuthStatus - UILabel - - - signInButton - GPPSignInButton - - - signInDisplayName - UILabel - - - signOutButton - UIButton - - - userinfoEmailScope - UISwitch - - - - IBProjectSource - ./Classes/SignInViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - YES - 3 - - button_background.png - {1, 1} - - 2083 - - diff --git a/External/google-plus-ios-sdk/SampleCode/en.lproj/InfoPlist.strings b/External/google-plus-ios-sdk/SampleCode/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff..00000000 --- a/External/google-plus-ios-sdk/SampleCode/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/External/google-plus-ios-sdk/SampleCode/main.m b/External/google-plus-ios-sdk/SampleCode/main.m deleted file mode 100644 index edb0a020..00000000 --- a/External/google-plus-ios-sdk/SampleCode/main.m +++ /dev/null @@ -1,28 +0,0 @@ -// -// main.m -// -// Copyright 2012 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#import - -#import "AppDelegate.h" - -int main(int argc, char *argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, - NSStringFromClass([AppDelegate class])); - } -} diff --git a/External/iOS/Crashlytics.framework/Crashlytics b/External/iOS/Crashlytics.framework/Crashlytics new file mode 120000 index 00000000..7074275f --- /dev/null +++ b/External/iOS/Crashlytics.framework/Crashlytics @@ -0,0 +1 @@ +Versions/Current/Crashlytics \ No newline at end of file diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Headers b/External/iOS/Crashlytics.framework/Headers similarity index 100% rename from External/google-plus-ios-sdk/GoogleOpenSource.framework/Headers rename to External/iOS/Crashlytics.framework/Headers diff --git a/External/iOS/Crashlytics.framework/Resources b/External/iOS/Crashlytics.framework/Resources new file mode 120000 index 00000000..953ee36f --- /dev/null +++ b/External/iOS/Crashlytics.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/External/Crashlytics.framework/Versions/A/Crashlytics b/External/iOS/Crashlytics.framework/Versions/A/Crashlytics similarity index 61% rename from External/Crashlytics.framework/Versions/A/Crashlytics rename to External/iOS/Crashlytics.framework/Versions/A/Crashlytics index 1230b7e0..f5c38d4f 100644 Binary files a/External/Crashlytics.framework/Versions/A/Crashlytics and b/External/iOS/Crashlytics.framework/Versions/A/Crashlytics differ diff --git a/External/iOS/Crashlytics.framework/Versions/A/Headers/Crashlytics.h b/External/iOS/Crashlytics.framework/Versions/A/Headers/Crashlytics.h new file mode 100644 index 00000000..59addeff --- /dev/null +++ b/External/iOS/Crashlytics.framework/Versions/A/Headers/Crashlytics.h @@ -0,0 +1,217 @@ +// +// Crashlytics.h +// Crashlytics +// +// Copyright 2013 Crashlytics, Inc. All rights reserved. +// + +#import + +/** + * + * The CLS_LOG macro provides as easy way to gather more information in your log messages that are + * sent with your crash data. CLS_LOG prepends your custom log message with the function name and + * line number where the macro was used. If your app was built with the DEBUG preprocessor macro + * defined CLS_LOG uses the CLSNSLog function which forwards your log message to NSLog and CLSLog. + * If the DEBUG preprocessor macro is not defined CLS_LOG uses CLSLog only. + * + * Example output: + * -[AppDelegate login:] line 134 $ login start + * + * If you would like to change this macro, create a new header file, unset our define and then define + * your own version. Make sure this new header file is imported after the Crashlytics header file. + * + * #undef CLS_LOG + * #define CLS_LOG(__FORMAT__, ...) CLSNSLog... + * + **/ +#ifdef DEBUG +#define CLS_LOG(__FORMAT__, ...) CLSNSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) +#else +#define CLS_LOG(__FORMAT__, ...) CLSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) +#endif + +/** + * + * Add logging that will be sent with your crash data. This logging will not show up in the system.log + * and will only be visible in your Crashlytics dashboard. + * + **/ +OBJC_EXTERN void CLSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2); + +/** + * + * Add logging that will be sent with your crash data. This logging will show up in the system.log + * and your Crashlytics dashboard. It is not recommended for Release builds. + * + **/ +OBJC_EXTERN void CLSNSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2); + +@protocol CrashlyticsDelegate; + +@interface Crashlytics : NSObject + +@property (nonatomic, readonly, copy) NSString *apiKey; +@property (nonatomic, readonly, copy) NSString *version; +@property (nonatomic, assign) BOOL debugMode; + +@property (nonatomic, assign) NSObject *delegate; + +/** + * + * The recommended way to install Crashlytics into your application is to place a call + * to +startWithAPIKey: in your -application:didFinishLaunchingWithOptions: method. + * + * This delay defaults to 1 second in order to generally give the application time to + * fully finish launching. + * + **/ ++ (Crashlytics *)startWithAPIKey:(NSString *)apiKey; ++ (Crashlytics *)startWithAPIKey:(NSString *)apiKey afterDelay:(NSTimeInterval)delay; + +/** + * + * If you need the functionality provided by the CrashlyticsDelegate protocol, you can use + * these convenience methods to activate the framework and set the delegate in one call. + * + **/ ++ (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(NSObject *)delegate; ++ (Crashlytics *)startWithAPIKey:(NSString *)apiKey delegate:(NSObject *)delegate afterDelay:(NSTimeInterval)delay; + +/** + * + * Access the singleton Crashlytics instance. + * + **/ ++ (Crashlytics *)sharedInstance; + +/** + * + * The easiest way to cause a crash - great for testing! + * + **/ +- (void)crash; + +/** + * + * Many of our customers have requested the ability to tie crashes to specific end-users of their + * application in order to facilitate responses to support requests or permit the ability to reach + * out for more information. We allow you to specify up to three separate values for display within + * the Crashlytics UI - but please be mindful of your end-user's privacy. + * + * We recommend specifying a user identifier - an arbitrary string that ties an end-user to a record + * in your system. This could be a database id, hash, or other value that is meaningless to a + * third-party observer but can be indexed and queried by you. + * + * Optionally, you may also specify the end-user's name or username, as well as email address if you + * do not have a system that works well with obscured identifiers. + * + * Pursuant to our EULA, this data is transferred securely throughout our system and we will not + * disseminate end-user data unless required to by law. That said, if you choose to provide end-user + * contact information, we strongly recommend that you disclose this in your application's privacy + * policy. Data privacy is of our utmost concern. + * + **/ +- (void)setUserIdentifier:(NSString *)identifier; +- (void)setUserName:(NSString *)name; +- (void)setUserEmail:(NSString *)email; + ++ (void)setUserIdentifier:(NSString *)identifier; ++ (void)setUserName:(NSString *)name; ++ (void)setUserEmail:(NSString *)email; + +/** + * + * Set a value for a key to be associated with your crash data. + * + **/ +- (void)setObjectValue:(id)value forKey:(NSString *)key; +- (void)setIntValue:(int)value forKey:(NSString *)key; +- (void)setBoolValue:(BOOL)value forKey:(NSString *)key; +- (void)setFloatValue:(float)value forKey:(NSString *)key; + ++ (void)setObjectValue:(id)value forKey:(NSString *)key; ++ (void)setIntValue:(int)value forKey:(NSString *)key; ++ (void)setBoolValue:(BOOL)value forKey:(NSString *)key; ++ (void)setFloatValue:(float)value forKey:(NSString *)key; + +@end + +/** + * The CLSCrashReport protocol exposes methods that you can call on crash report objects passed + * to delegate methods. If you want these values or the entire object to stay in memory retain + * them or copy them. + **/ +@protocol CLSCrashReport +@required + +/** + * Returns the session identifier for the crash report. + **/ +@property (nonatomic, readonly) NSString *identifier; + +/** + * Returns the custom key value data for the crash report. + **/ +@property (nonatomic, readonly) NSDictionary *customKeys; + +/** + * Returns the CFBundleVersion of the application that crashed. + **/ +@property (nonatomic, readonly) NSString *bundleVersion; + +/** + * Returns the CFBundleShortVersionString of the application that crashed. + **/ +@property (nonatomic, readonly) NSString *bundleShortVersionString; + +/** + * Returns the date that the application crashed at. + **/ +@property (nonatomic, readonly) NSDate *crashedOnDate; + +/** + * Returns the os version that the application crashed on. + **/ +@property (nonatomic, readonly) NSString *OSVersion; + +/** + * Returns the os build version that the application crashed on. + **/ +@property (nonatomic, readonly) NSString *OSBuildVersion; + +@end + +/** + * + * The CrashlyticsDelegate protocol provides a mechanism for your application to take + * action on events that occur in the Crashlytics crash reporting system. You can make + * use of these calls by assigning an object to the Crashlytics' delegate property directly, + * or through the convenience startWithAPIKey:delegate:... methods. + * + **/ +@protocol CrashlyticsDelegate +@optional + +/** + * + * Called once a Crashlytics instance has determined that the last execution of the + * application ended in a crash. This is called some time after the crash reporting + * process has begun. If you have specified a delay in one of the + * startWithAPIKey:... calls, this will take at least that long to be invoked. + * + **/ +- (void)crashlyticsDidDetectCrashDuringPreviousExecution:(Crashlytics *)crashlytics; + +/** + * + * Just like crashlyticsDidDetectCrashDuringPreviousExecution this delegate method is + * called once a Crashlytics instance has determined that the last execution of the + * application ended in a crash. A CLSCrashReport is passed back that contains data about + * the last crash report that was generated. See the CLSCrashReport protocol for method details. + * This method is called after crashlyticsDidDetectCrashDuringPreviousExecution. + * + **/ +- (void)crashlytics:(Crashlytics *)crashlytics didDetectCrashDuringPreviousExecution:(id )crash; + +@end diff --git a/External/Crashlytics.framework/Versions/A/Resources/Info.plist b/External/iOS/Crashlytics.framework/Versions/A/Resources/Info.plist similarity index 94% rename from External/Crashlytics.framework/Versions/A/Resources/Info.plist rename to External/iOS/Crashlytics.framework/Versions/A/Resources/Info.plist index 60ba0760..4971ea17 100644 --- a/External/Crashlytics.framework/Versions/A/Resources/Info.plist +++ b/External/iOS/Crashlytics.framework/Versions/A/Resources/Info.plist @@ -15,13 +15,13 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.1.7 + 2.1.9 CFBundleSupportedPlatforms iPhoneOS CFBundleVersion - 26 + 31 DTPlatformName iphoneos MinimumOSVersion diff --git a/External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/Current b/External/iOS/Crashlytics.framework/Versions/Current similarity index 100% rename from External/google-plus-ios-sdk/GoogleOpenSource.framework/Versions/Current rename to External/iOS/Crashlytics.framework/Versions/Current diff --git a/External/iOS/Crashlytics.framework/run b/External/iOS/Crashlytics.framework/run new file mode 100755 index 00000000..599d7616 Binary files /dev/null and b/External/iOS/Crashlytics.framework/run differ diff --git a/MasterPassword.xcworkspace/xcshareddata/MasterPassword.xccheckout b/MasterPassword.xcworkspace/xcshareddata/MasterPassword.xccheckout index 69d287bd..663349ee 100644 --- a/MasterPassword.xcworkspace/xcshareddata/MasterPassword.xccheckout +++ b/MasterPassword.xcworkspace/xcshareddata/MasterPassword.xccheckout @@ -5,13 +5,11 @@ IDESourceControlProjectFavoriteDictionaryKey IDESourceControlProjectIdentifier - D4AB9F0C-D746-4319-AABF-B24705099AED + 3D68B2F1-988A-48C3-8450-B37D43BDFE92 IDESourceControlProjectName MasterPassword IDESourceControlProjectOriginsDictionary - 2B6DA448-3730-4F84-B2C3-51272E0D42F3 - ssh://github.com/lhunath/DCIntrospect.git 5263993D-5FE8-464F-B66E-B0F7C2DFF410 ssh://github.com/lhunath/UbiquityStoreManager.git 6A449EC2-A2A3-4635-9C5F-A811E011EAC3 @@ -24,8 +22,10 @@ git://github.com/lhunath/uicolor-utilities.git B0F634DD-AEE1-4F0D-AE35-4FAF51AD1B5A git://github.com/lhunath/RHStatusItemView.git - CBA93B91-B799-4CC6-85B6-749792B76DD4 - ssh://github.com/lhunath/InAppSettingsKit.git + CDDE92CF-0136-4DE0-8318-80EDB5C8CAF9 + git://github.com/lhunath/InAppSettingsKit.git + D5CE8AB8-2F69-4A08-A2CE-93C70E0F0567 + https://github.com/lhunath/DCIntrospect.git E4C8E206-229C-4DA8-A130-0C544DEC7E07 git://github.com/jonmarimba/jrswizzle.git FF42A9E0-F41C-42FC-88CD-F2CCDE15DBB6 @@ -35,8 +35,6 @@ MasterPassword.xcworkspace IDESourceControlProjectRelativeInstallPathDictionary - 2B6DA448-3730-4F84-B2C3-51272E0D42F3 - ../External/DCIntrospect 5263993D-5FE8-464F-B66E-B0F7C2DFF410 ../External/UbiquityStoreManager 6A449EC2-A2A3-4635-9C5F-A811E011EAC3 @@ -49,8 +47,10 @@ ../External/Pearl/External/uicolor-utilities B0F634DD-AEE1-4F0D-AE35-4FAF51AD1B5A ../External/RHStatusItemView - CBA93B91-B799-4CC6-85B6-749792B76DD4 + CDDE92CF-0136-4DE0-8318-80EDB5C8CAF9 ../External/InAppSettingsKit + D5CE8AB8-2F69-4A08-A2CE-93C70E0F0567 + ../External/DCIntrospect E4C8E206-229C-4DA8-A130-0C544DEC7E07 ../External/Pearl/External/jrswizzle FF42A9E0-F41C-42FC-88CD-F2CCDE15DBB6 @@ -68,7 +68,7 @@ IDESourceControlRepositoryExtensionIdentifierKey public.vcs.git IDESourceControlWCCIdentifierKey - 2B6DA448-3730-4F84-B2C3-51272E0D42F3 + D5CE8AB8-2F69-4A08-A2CE-93C70E0F0567 IDESourceControlWCCName DCIntrospect @@ -84,7 +84,7 @@ IDESourceControlRepositoryExtensionIdentifierKey public.vcs.git IDESourceControlWCCIdentifierKey - CBA93B91-B799-4CC6-85B6-749792B76DD4 + CDDE92CF-0136-4DE0-8318-80EDB5C8CAF9 IDESourceControlWCCName InAppSettingsKit diff --git a/MasterPassword/ObjC/MPAlgorithm.h b/MasterPassword/ObjC/MPAlgorithm.h index 8bbf6b4f..b7dd2e3b 100644 --- a/MasterPassword/ObjC/MPAlgorithm.h +++ b/MasterPassword/ObjC/MPAlgorithm.h @@ -37,6 +37,8 @@ - (NSString *)shortNameOfType:(MPElementType)type; - (NSString *)classNameOfType:(MPElementType)type; - (Class)classOfType:(MPElementType)type; +- (NSArray *)allTypes; +- (NSArray *)allTypesStartingWith:(MPElementType)startingType; - (MPElementType)nextType:(MPElementType)type; - (MPElementType)previousType:(MPElementType)type; diff --git a/MasterPassword/ObjC/MPAlgorithmV0.m b/MasterPassword/ObjC/MPAlgorithmV0.m index 03a2ed86..efa47966 100644 --- a/MasterPassword/ObjC/MPAlgorithmV0.m +++ b/MasterPassword/ObjC/MPAlgorithmV0.m @@ -1,12 +1,12 @@ /** - * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) - * - * See the enclosed file LICENSE for license information (LGPLv3). If you did - * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt - * - * @author Maarten Billemont - * @license http://www.gnu.org/licenses/lgpl-3.0.txt - */ +* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) +* +* See the enclosed file LICENSE for license information (LGPLv3). If you did +* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt +* +* @author Maarten Billemont +* @license http://www.gnu.org/licenses/lgpl-3.0.txt +*/ // // MPAlgorithmV0 @@ -31,6 +31,21 @@ return 0; } +- (NSString *)description { + + return strf( @"<%@: version=%lu>", NSStringFromClass( [self class] ), (unsigned long)self.version ); +} + +- (BOOL)isEqual:(id)other { + + if (other == self) + return YES; + if (!other || ![other conformsToProtocol:@protocol(MPAlgorithm)]) + return NO; + + return [(id)other version] == [self version]; +} + - (BOOL)migrateUser:(MPUserEntity *)user inContext:(NSManagedObjectContext *)moc { NSError *error = nil; @@ -38,7 +53,7 @@ migrationRequest.predicate = [NSPredicate predicateWithFormat:@"version_ < %d AND user == %@", self.version, user]; NSArray *migrationElements = [moc executeFetchRequest:migrationRequest error:&error]; if (!migrationElements) { - err(@"While looking for elements to migrate: %@", error); + err( @"While looking for elements to migrate: %@", error ); return NO; } @@ -53,7 +68,7 @@ - (BOOL)migrateElement:(MPElementEntity *)element explicit:(BOOL)explicit { if (element.version != [self version] - 1) - // Only migrate from previous version. + // Only migrate from previous version. return NO; if (!explicit) { @@ -70,18 +85,19 @@ - (MPKey *)keyForPassword:(NSString *)password ofUserNamed:(NSString *)userName { - uint32_t nuserNameLength = htonl(userName.length); + uint32_t nuserNameLength = htonl( userName.length ); NSDate *start = [NSDate date]; NSData *keyData = [PearlSCrypt deriveKeyWithLength:MP_dkLen fromPassword:[password dataUsingEncoding:NSUTF8StringEncoding] - usingSalt:[NSData dataByConcatenatingDatas: - [@"com.lyndir.masterpassword" dataUsingEncoding:NSUTF8StringEncoding], - [NSData dataWithBytes:&nuserNameLength - length:sizeof(nuserNameLength)], - [userName dataUsingEncoding:NSUTF8StringEncoding], - nil] N:MP_N r:MP_r p:MP_p]; + usingSalt:[NSData dataByConcatenatingDatas: + [@"com.lyndir.masterpassword" dataUsingEncoding:NSUTF8StringEncoding], + [NSData dataWithBytes:&nuserNameLength + length:sizeof( nuserNameLength )], + [userName dataUsingEncoding:NSUTF8StringEncoding], + nil] N:MP_N r:MP_r p:MP_p]; MPKey *key = [self keyFromKeyData:keyData]; - trc(@"User: %@, password: %@ derives to key ID: %@ (took %0.2fs)", userName, password, [key.keyID encodeHex], -[start timeIntervalSinceNow]); + trc( @"User: %@, password: %@ derives to key ID: %@ (took %0.2fs)", userName, password, [key.keyID encodeHex], + -[start timeIntervalSinceNow] ); return key; } @@ -127,7 +143,7 @@ return @"Device Private Password"; } - Throw(@"Type not supported: %lu", (long)type); + Throw( @"Type not supported: %lu", (long)type ); } - (NSString *)shortNameOfType:(MPElementType)type { @@ -161,7 +177,7 @@ return @"Device"; } - Throw(@"Type not supported: %lu", (long)type); + Throw( @"Type not supported: %lu", (long)type ); } - (NSString *)classNameOfType:(MPElementType)type { @@ -172,7 +188,7 @@ - (Class)classOfType:(MPElementType)type { if (!type) - Throw(@"No type given."); + Throw( @"No type given." ); switch (type) { case MPElementTypeGeneratedMaximum: @@ -200,14 +216,27 @@ return [MPElementStoredEntity class]; } - Throw(@"Type not supported: %lu", (long)type); + Throw( @"Type not supported: %lu", (long)type ); +} + +- (NSArray *)allTypes { + + return [self allTypesStartingWith:MPElementTypeGeneratedMaximum]; +} + +- (NSArray *)allTypesStartingWith:(MPElementType)startingType { + + NSMutableArray *allTypes = [[NSMutableArray alloc] initWithCapacity:8]; + MPElementType currentType = startingType; + do { + [allTypes addObject:@(currentType)]; + } while ((currentType = [self nextType:currentType]) != startingType); + + return allTypes; } - (MPElementType)nextType:(MPElementType)type { - if (!type) - Throw(@"No type given."); - switch (type) { case MPElementTypeGeneratedMaximum: return MPElementTypeStoredDevicePrivate; @@ -225,9 +254,9 @@ return MPElementTypeGeneratedPIN; case MPElementTypeStoredDevicePrivate: return MPElementTypeStoredPersonal; + default: + return MPElementTypeGeneratedLong; } - - Throw(@"Type not supported: %lu", (long)type); } - (MPElementType)previousType:(MPElementType)type { @@ -247,38 +276,38 @@ [[NSBundle mainBundle] URLForResource:@"ciphers" withExtension:@"plist"]]; // Determine the seed whose bytes will be used for calculating a password - uint32_t ncounter = htonl(counter), nnameLength = htonl(name.length); - NSData *counterBytes = [NSData dataWithBytes:&ncounter length:sizeof(ncounter)]; - NSData *nameLengthBytes = [NSData dataWithBytes:&nnameLength length:sizeof(nnameLength)]; - trc(@"seed from: hmac-sha256(%@, 'com.lyndir.masterpassword' | %@ | %@ | %@)", [key.keyData encodeBase64], [nameLengthBytes encodeHex], name, [counterBytes encodeHex]); + uint32_t ncounter = htonl( counter ), nnameLength = htonl( name.length ); + NSData *counterBytes = [NSData dataWithBytes:&ncounter length:sizeof( ncounter )]; + NSData *nameLengthBytes = [NSData dataWithBytes:&nnameLength length:sizeof( nnameLength )]; + trc( @"seed from: hmac-sha256(%@, 'com.lyndir.masterpassword' | %@ | %@ | %@)", [key.keyData encodeBase64], + [nameLengthBytes encodeHex], name, [counterBytes encodeHex] ); NSData *seed = [[NSData dataByConcatenatingDatas: [@"com.lyndir.masterpassword" dataUsingEncoding:NSUTF8StringEncoding], - nameLengthBytes, - [name dataUsingEncoding:NSUTF8StringEncoding], - counterBytes, - nil] + nameLengthBytes, [name dataUsingEncoding:NSUTF8StringEncoding], + counterBytes, nil] hmacWith:PearlHashSHA256 key:key.keyData]; - trc(@"seed is: %@", [seed encodeBase64]); + trc( @"seed is: %@", [seed encodeBase64] ); const char *seedBytes = seed.bytes; // Determine the cipher from the first seed byte. - NSAssert([seed length], @"Missing seed."); - NSArray *typeCiphers = [[MPTypes_ciphers valueForKey:[self classNameOfType:type]] - valueForKey:[self nameOfType:type]]; - NSString *cipher = typeCiphers[htons(seedBytes[0]) % [typeCiphers count]]; - trc(@"type %@, ciphers: %@, selected: %@", [self nameOfType:type], typeCiphers, cipher); + NSAssert( [seed length], @"Missing seed." ); + NSString *typeClass = [self classNameOfType:type]; + NSString *typeName = [self nameOfType:type]; + id classCiphers = [MPTypes_ciphers valueForKey:typeClass]; + NSArray *typeCiphers = [classCiphers valueForKey:typeName]; + NSString *cipher = typeCiphers[htons( seedBytes[0] ) % [typeCiphers count]]; + trc( @"type %@, ciphers: %@, selected: %@", typeName, typeCiphers, cipher ); // Encode the content, character by character, using subsequent seed bytes and the cipher. - NSAssert([seed length] >= [cipher length] + 1, @"Insufficient seed bytes to encode cipher."); + NSAssert( [seed length] >= [cipher length] + 1, @"Insufficient seed bytes to encode cipher." ); NSMutableString *content = [NSMutableString stringWithCapacity:[cipher length]]; for (NSUInteger c = 0; c < [cipher length]; ++c) { - uint16_t keyByte = htons(seedBytes[c + 1]); + uint16_t keyByte = htons( seedBytes[c + 1] ); NSString *cipherClass = [cipher substringWithRange:NSMakeRange( c, 1 )]; NSString *cipherClassCharacters = [[MPTypes_ciphers valueForKey:@"MPCharacterClasses"] valueForKey:cipherClass]; - NSString *character = [cipherClassCharacters substringWithRange:NSMakeRange( keyByte % [cipherClassCharacters length], - 1 )]; + NSString *character = [cipherClassCharacters substringWithRange:NSMakeRange( keyByte % [cipherClassCharacters length], 1 )]; - trc(@"class %@ has characters: %@, index: %u, selected: %@", cipherClass, cipherClassCharacters, keyByte, character); + trc( @"class %@ has characters: %@, index: %u, selected: %@", cipherClass, cipherClassCharacters, keyByte, character ); [content appendString:character]; } @@ -292,7 +321,7 @@ - (void)saveContent:(NSString *)clearContent toElement:(MPElementEntity *)element usingKey:(MPKey *)elementKey { - NSAssert([elementKey.keyID isEqualToData:element.user.keyID], @"Element does not belong to current user."); + NSAssert( [elementKey.keyID isEqualToData:element.user.keyID], @"Element does not belong to current user." ); switch (element.type) { case MPElementTypeGeneratedMaximum: case MPElementTypeGeneratedLong: @@ -300,13 +329,14 @@ case MPElementTypeGeneratedBasic: case MPElementTypeGeneratedShort: case MPElementTypeGeneratedPIN: { - NSAssert(NO, @"Cannot save content to element with generated type %lu.", (long)element.type); + NSAssert( NO, @"Cannot save content to element with generated type %lu.", (long)element.type ); break; } case MPElementTypeStoredPersonal: { - NSAssert([element isKindOfClass:[MPElementStoredEntity class]], - @"Element with stored type %lu is not an MPElementStoredEntity, but a %@.", (long)element.type, [element class]); + NSAssert( [element isKindOfClass:[MPElementStoredEntity class]], + @"Element with stored type %lu is not an MPElementStoredEntity, but a %@.", (long)element.type, + [element class] ); NSData *encryptedContent = [[clearContent dataUsingEncoding:NSUTF8StringEncoding] encryptWithSymmetricKey:[elementKey subKeyOfLength:PearlCryptKeySize].keyData padding:YES]; @@ -314,8 +344,9 @@ break; } case MPElementTypeStoredDevicePrivate: { - NSAssert([element isKindOfClass:[MPElementStoredEntity class]], - @"Element with stored type %lu is not an MPElementStoredEntity, but a %@.", (long)element.type, [element class]); + NSAssert( [element isKindOfClass:[MPElementStoredEntity class]], + @"Element with stored type %lu is not an MPElementStoredEntity, but a %@.", (long)element.type, + [element class] ); NSData *encryptedContent = [[clearContent dataUsingEncoding:NSUTF8StringEncoding] encryptWithSymmetricKey:[elementKey subKeyOfLength:PearlCryptKeySize].keyData padding:YES]; @@ -349,9 +380,9 @@ return result; } -- (void)resolveContentForElement:(MPElementEntity *)element usingKey:(MPKey *)elementKey result:(void (^)(NSString *result))resultBlock { +- (void)resolveContentForElement:(MPElementEntity *)element usingKey:(MPKey *)elementKey result:(void ( ^ )(NSString *result))resultBlock { - NSAssert([elementKey.keyID isEqualToData:element.user.keyID], @"Element does not belong to current user."); + NSAssert( [elementKey.keyID isEqualToData:element.user.keyID], @"Element does not belong to current user." ); switch (element.type) { case MPElementTypeGeneratedMaximum: case MPElementTypeGeneratedLong: @@ -359,17 +390,18 @@ case MPElementTypeGeneratedBasic: case MPElementTypeGeneratedShort: case MPElementTypeGeneratedPIN: { - NSAssert([element isKindOfClass:[MPElementGeneratedEntity class]], - @"Element with generated type %lu is not an MPElementGeneratedEntity, but a %@.", (long)element.type, [element class]); + NSAssert( [element isKindOfClass:[MPElementGeneratedEntity class]], + @"Element with generated type %lu is not an MPElementGeneratedEntity, but a %@.", (long)element.type, + [element class] ); NSString *name = element.name; MPElementType type = element.type; NSUInteger counter = ((MPElementGeneratedEntity *)element).counter; id algorithm = nil; if (!element.name.length) - err(@"Missing name."); + err( @"Missing name." ); else if (!elementKey.keyData.length) - err(@"Missing key."); + err( @"Missing key." ); else algorithm = element.algorithm; @@ -381,8 +413,9 @@ } case MPElementTypeStoredPersonal: { - NSAssert([element isKindOfClass:[MPElementStoredEntity class]], - @"Element with stored type %lu is not an MPElementStoredEntity, but a %@.", (long)element.type, [element class]); + NSAssert( [element isKindOfClass:[MPElementStoredEntity class]], + @"Element with stored type %lu is not an MPElementStoredEntity, but a %@.", (long)element.type, + [element class] ); NSData *encryptedContent = ((MPElementStoredEntity *)element).contentObject; @@ -393,8 +426,9 @@ break; } case MPElementTypeStoredDevicePrivate: { - NSAssert([element isKindOfClass:[MPElementStoredEntity class]], - @"Element with stored type %lu is not an MPElementStoredEntity, but a %@.", (long)element.type, [element class]); + NSAssert( [element isKindOfClass:[MPElementStoredEntity class]], + @"Element with stored type %lu is not an MPElementStoredEntity, but a %@.", (long)element.type, + [element class] ); NSDictionary *elementQuery = [self queryForDevicePrivateElementNamed:element.name]; NSData *encryptedContent = [PearlKeyChain dataOfItemForQuery:elementQuery]; @@ -411,7 +445,7 @@ - (void)importProtectedContent:(NSString *)protectedContent protectedByKey:(MPKey *)importKey intoElement:(MPElementEntity *)element usingKey:(MPKey *)elementKey { - NSAssert([elementKey.keyID isEqualToData:element.user.keyID], @"Element does not belong to current user."); + NSAssert( [elementKey.keyID isEqualToData:element.user.keyID], @"Element does not belong to current user." ); switch (element.type) { case MPElementTypeGeneratedMaximum: case MPElementTypeGeneratedLong: @@ -422,8 +456,9 @@ break; case MPElementTypeStoredPersonal: { - NSAssert([element isKindOfClass:[MPElementStoredEntity class]], - @"Element with stored type %lu is not an MPElementStoredEntity, but a %@.", (long)element.type, [element class]); + NSAssert( [element isKindOfClass:[MPElementStoredEntity class]], + @"Element with stored type %lu is not an MPElementStoredEntity, but a %@.", (long)element.type, + [element class] ); if ([importKey.keyID isEqualToData:elementKey.keyID]) ((MPElementStoredEntity *)element).contentObject = [protectedContent decodeBase64]; @@ -441,7 +476,7 @@ - (void)importClearTextContent:(NSString *)clearContent intoElement:(MPElementEntity *)element usingKey:(MPKey *)elementKey { - NSAssert([elementKey.keyID isEqualToData:element.user.keyID], @"Element does not belong to current user."); + NSAssert( [elementKey.keyID isEqualToData:element.user.keyID], @"Element does not belong to current user." ); switch (element.type) { case MPElementTypeGeneratedMaximum: case MPElementTypeGeneratedLong: @@ -463,7 +498,7 @@ - (NSString *)exportContentForElement:(MPElementEntity *)element usingKey:(MPKey *)elementKey { - NSAssert([elementKey.keyID isEqualToData:element.user.keyID], @"Element does not belong to current user."); + NSAssert( [elementKey.keyID isEqualToData:element.user.keyID], @"Element does not belong to current user." ); if (!(element.type & MPElementFeatureExportContent)) return nil; @@ -480,8 +515,9 @@ } case MPElementTypeStoredPersonal: { - NSAssert([element isKindOfClass:[MPElementStoredEntity class]], - @"Element with stored type %lu is not an MPElementStoredEntity, but a %@.", (long)element.type, [element class]); + NSAssert( [element isKindOfClass:[MPElementStoredEntity class]], + @"Element with stored type %lu is not an MPElementStoredEntity, but a %@.", (long)element.type, + [element class] ); result = [((MPElementStoredEntity *)element).contentObject encodeBase64]; break; } diff --git a/MasterPassword/ObjC/MPAppDelegate_Key.m b/MasterPassword/ObjC/MPAppDelegate_Key.m index 6c6e2737..69286ae8 100644 --- a/MasterPassword/ObjC/MPAppDelegate_Key.m +++ b/MasterPassword/ObjC/MPAppDelegate_Key.m @@ -16,7 +16,7 @@ static NSDictionary *keyQuery(MPUserEntity *user) { return [PearlKeyChain createQueryForClass:kSecClassGenericPassword attributes:@{ (__bridge id)kSecAttrService : @"Saved Master Password", - (__bridge id)kSecAttrAccount : IfNotNilElse(user.name, @"") + (__bridge id)kSecAttrAccount : IfNotNilElse( user.name, @"" ) } matches:nil]; } @@ -25,11 +25,11 @@ static NSDictionary *keyQuery(MPUserEntity *user) { NSData *keyData = [PearlKeyChain dataOfItemForQuery:keyQuery( user )]; if (!keyData) { - inf(@"No key found in keychain for: %@", user.userID); + inf( @"No key found in keychain for: %@", user.userID ); return nil; } - inf(@"Found key in keychain for: %@", user.userID); + inf( @"Found key in keychain for: %@", user.userID ); return [MPAlgorithmDefault keyFromKeyData:keyData]; } @@ -39,7 +39,7 @@ static NSDictionary *keyQuery(MPUserEntity *user) { NSData *existingKeyData = [PearlKeyChain dataOfItemForQuery:keyQuery( user )]; if (![existingKeyData isEqualToData:self.key.keyData]) { - inf(@"Saving key in keychain for: %@", user.userID); + inf( @"Saving key in keychain for: %@", user.userID ); [PearlKeyChain addOrUpdateItemForQuery:keyQuery( user ) withAttributes:@{ @@ -56,7 +56,7 @@ static NSDictionary *keyQuery(MPUserEntity *user) { OSStatus result = [PearlKeyChain deleteItemForQuery:keyQuery( user )]; if (result == noErr) { - inf(@"Removed key from keychain for: %@", user.userID); + inf( @"Removed key from keychain for: %@", user.userID ); [[NSNotificationCenter defaultCenter] postNotificationName:MPKeyForgottenNotification object:self]; } @@ -74,7 +74,7 @@ static NSDictionary *keyQuery(MPUserEntity *user) { - (BOOL)signInAsUser:(MPUserEntity *)user saveInContext:(NSManagedObjectContext *)moc usingMasterPassword:(NSString *)password { if (password) - NSAssert(![NSThread isMainThread], @"Computing key must not happen from the main thread."); + NSAssert( ![NSThread isMainThread], @"Computing key must not happen from the main thread." ); if (!user) return NO; @@ -92,14 +92,14 @@ static NSDictionary *keyQuery(MPUserEntity *user) { // Method 2: Depending on the user's saveKey, load or remove the key from the keychain. if (!user.saveKey) - // Key should not be stored in keychain. Delete it. + // Key should not be stored in keychain. Delete it. [self forgetSavedKeyFor:user]; else if (!tryKey) { // Key should be saved in keychain. Load it. if ((tryKey = [self loadSavedKeyFor:user]) && ![user.keyID isEqual:tryKey.keyID]) { // Loaded password doesn't match user's keyID. Forget saved password: it is incorrect. - inf(@"Saved password doesn't match keyID for: %@", user.userID); + inf( @"Saved password doesn't match keyID for: %@", user.userID ); tryKey = nil; [self forgetSavedKeyFor:user]; @@ -110,7 +110,7 @@ static NSDictionary *keyQuery(MPUserEntity *user) { if (!tryKey) { if ([password length]) if ((tryKey = [MPAlgorithmDefault keyForPassword:password ofUserNamed:user.name])) if (![user.keyID isEqual:tryKey.keyID]) { - inf(@"Key derived from password doesn't match keyID for: %@", user.userID); + inf( @"Key derived from password doesn't match keyID for: %@", user.userID ); tryKey = nil; } @@ -119,13 +119,13 @@ static NSDictionary *keyQuery(MPUserEntity *user) { // No more methods left, fail if key still not known. if (!tryKey) { if (password) { - inf(@"Login failed for: %@", user.userID); + inf( @"Login failed for: %@", user.userID ); MPCheckpoint( MPCheckpointSignInFailed, nil ); } return NO; } - inf(@"Logged in: %@", user.userID); + inf( @"Logged in: %@", user.userID ); if (![self.key isEqualToKey:tryKey]) { self.key = tryKey; @@ -147,13 +147,19 @@ static NSDictionary *keyQuery(MPUserEntity *user) { } } @catch (id exception) { - err(@"While setting username: %@", exception); + err( @"While setting username: %@", exception ); } user.lastUsed = [NSDate date]; [moc saveToStore]; self.activeUser = user; + // Perform a data sanity check now that we're logged in as the user to allow fixes that require the user's key. + if ([[MPConfig get].checkInconsistency boolValue]) + [MPAppDelegate_Shared managedObjectContextPerformBlockAndWait:^(NSManagedObjectContext *context) { + [self findAndFixInconsistenciesSaveInContext:context]; + }]; + [[NSNotificationCenter defaultCenter] postNotificationName:MPSignedInNotification object:self]; MPCheckpoint( MPCheckpointSignedIn, nil ); @@ -163,12 +169,13 @@ static NSDictionary *keyQuery(MPUserEntity *user) { - (void)migrateElementsForUser:(MPUserEntity *)user saveInContext:(NSManagedObjectContext *)moc toKey:(MPKey *)newKey { if (![user.elements count]) - // Nothing to migrate. + // Nothing to migrate. return; MPKey *recoverKey = newKey; #ifdef PEARL_UIKIT - PearlOverlay *activityOverlay = [PearlOverlay showOverlayWithTitle:PearlString( @"Migrating %ld sites...", (long)[user.elements count] )]; + PearlOverlay *activityOverlay = [PearlOverlay showProgressOverlayWithTitle:PearlString( @"Migrating %ld sites...", + (long)[user.elements count] )]; #endif for (MPElementEntity *element in user.elements) { @@ -183,12 +190,12 @@ static NSDictionary *keyQuery(MPUserEntity *user) { dispatch_group_enter( recoverPasswordGroup ); [PearlAlert showAlertWithTitle:@"Enter Old Master Password" message:PearlString( @"Your old master password is required to migrate the stored password for %@", - element.name ) + element.name ) viewStyle:UIAlertViewStyleSecureTextInput initAlert:nil tappedButtonBlock:^(UIAlertView *alert_, NSInteger buttonIndex_) { @try { if (buttonIndex_ == [alert_ cancelButtonIndex]) - // Don't Migrate + // Don't Migrate return; masterPassword = [alert_ textFieldAtIndex:0].text; @@ -200,14 +207,14 @@ static NSDictionary *keyQuery(MPUserEntity *user) { dispatch_group_wait( recoverPasswordGroup, DISPATCH_TIME_FOREVER ); #endif if (!masterPassword) - // Don't Migrate + // Don't Migrate break; recoverKey = [element.algorithm keyForPassword:masterPassword ofUserNamed:user.name]; } if (!content) - // Don't Migrate + // Don't Migrate break; if (![recoverKey isEqualToKey:newKey]) diff --git a/MasterPassword/ObjC/MPAppDelegate_Shared.h b/MasterPassword/ObjC/MPAppDelegate_Shared.h index d961130d..96e2f0ff 100644 --- a/MasterPassword/ObjC/MPAppDelegate_Shared.h +++ b/MasterPassword/ObjC/MPAppDelegate_Shared.h @@ -16,11 +16,12 @@ #endif @property(strong, nonatomic) MPKey *key; +@property(strong, nonatomic) NSManagedObjectID *activeUserOID; + (instancetype)get; - (MPUserEntity *)activeUserForMainThread; -- (MPUserEntity *)activeUserInContext:(NSManagedObjectContext *)moc; +- (MPUserEntity *)activeUserInContext:(NSManagedObjectContext *)context; - (void)setActiveUser:(MPUserEntity *)activeUser; @end diff --git a/MasterPassword/ObjC/MPAppDelegate_Shared.m b/MasterPassword/ObjC/MPAppDelegate_Shared.m index ad495b2a..cdfcfe02 100644 --- a/MasterPassword/ObjC/MPAppDelegate_Shared.m +++ b/MasterPassword/ObjC/MPAppDelegate_Shared.m @@ -10,9 +10,7 @@ #import "MPAppDelegate_Store.h" #import "MPAppDelegate_Key.h" -@implementation MPAppDelegate_Shared { - NSManagedObjectID *_activeUserOID; -} +@implementation MPAppDelegate_Shared + (MPAppDelegate_Shared *)get { @@ -30,17 +28,15 @@ return [self activeUserInContext:[MPAppDelegate_Shared managedObjectContextForMainThreadIfReady]]; } -- (MPUserEntity *)activeUserInContext:(NSManagedObjectContext *)moc { +- (MPUserEntity *)activeUserInContext:(NSManagedObjectContext *)context { - if (!_activeUserOID || !moc) + NSManagedObjectID *activeUserOID = self.activeUserOID; + if (!activeUserOID || !context) return nil; - NSError *error; - MPUserEntity *activeUser = (MPUserEntity *)[moc existingObjectWithID:_activeUserOID error:&error]; - if (!activeUser) { + MPUserEntity *activeUser = [MPUserEntity existingObjectWithID:activeUserOID inContext:context]; + if (!activeUser) [self signOutAnimated:YES]; - err(@"Failed to retrieve active user: %@", error); - } return activeUser; } @@ -51,7 +47,7 @@ if (activeUser.objectID.isTemporaryID && ![activeUser.managedObjectContext obtainPermanentIDsForObjects:@[ activeUser ] error:&error]) err(@"Failed to obtain a permanent object ID after setting active user: %@", error); - _activeUserOID = activeUser.objectID; + self.activeUserOID = activeUser.objectID; } @end diff --git a/MasterPassword/ObjC/MPAppDelegate_Store.h b/MasterPassword/ObjC/MPAppDelegate_Store.h index b0dacec0..cd5b5c62 100644 --- a/MasterPassword/ObjC/MPAppDelegate_Store.h +++ b/MasterPassword/ObjC/MPAppDelegate_Store.h @@ -9,6 +9,7 @@ #import "MPAppDelegate_Shared.h" #import "UbiquityStoreManager.h" +#import "MPFixable.h" typedef enum { MPImportResultSuccess, @@ -21,17 +22,20 @@ typedef enum { @interface MPAppDelegate_Shared(Store) + (NSManagedObjectContext *)managedObjectContextForMainThreadIfReady; ++ (BOOL)managedObjectContextForMainThreadPerformBlock:(void (^)(NSManagedObjectContext *mainContext))mocBlock; ++ (BOOL)managedObjectContextForMainThreadPerformBlockAndWait:(void (^)(NSManagedObjectContext *mainContext))mocBlock; + (BOOL)managedObjectContextPerformBlock:(void (^)(NSManagedObjectContext *context))mocBlock; + (BOOL)managedObjectContextPerformBlockAndWait:(void (^)(NSManagedObjectContext *context))mocBlock; - (UbiquityStoreManager *)storeManager; +- (MPFixableResult)findAndFixInconsistenciesSaveInContext:(NSManagedObjectContext *)context; /** @param completion The block to execute after adding the element, executed from the main thread with the new element in the main MOC. */ - (void)addElementNamed:(NSString *)siteName completion:(void (^)(MPElementEntity *element))completion; -- (MPElementEntity *)changeElement:(MPElementEntity *)element inContext:(NSManagedObjectContext *)context toType:(MPElementType)type; +- (MPElementEntity *)changeElement:(MPElementEntity *)element saveInContext:(NSManagedObjectContext *)context toType:(MPElementType)type; - (MPImportResult)importSites:(NSString *)importedSitesString askImportPassword:(NSString *(^)(NSString *userName))importPassword askUserPassword:(NSString *(^)(NSString *userName, NSUInteger importCount, NSUInteger deleteCount))userPassword; -- (NSString *)exportSitesShowingPasswords:(BOOL)showPasswords; +- (NSString *)exportSitesRevealPasswords:(BOOL)revealPasswords; @end diff --git a/MasterPassword/ObjC/MPAppDelegate_Store.m b/MasterPassword/ObjC/MPAppDelegate_Store.m index a381f758..ee238736 100644 --- a/MasterPassword/ObjC/MPAppDelegate_Store.m +++ b/MasterPassword/ObjC/MPAppDelegate_Store.m @@ -18,13 +18,13 @@ #define MPMigrationLevelLocalStoreKey @"MPMigrationLevelLocalStoreKey" #define MPMigrationLevelCloudStoreKey @"MPMigrationLevelCloudStoreKey" -typedef NS_ENUM(NSInteger, MPMigrationLevelLocalStore) { +typedef NS_ENUM( NSInteger, MPMigrationLevelLocalStore ) { MPMigrationLevelLocalStoreV1, MPMigrationLevelLocalStoreV2, MPMigrationLevelLocalStoreCurrent = MPMigrationLevelLocalStoreV2, }; -typedef NS_ENUM(NSInteger, MPMigrationLevelCloudStore) { +typedef NS_ENUM( NSInteger, MPMigrationLevelCloudStore ) { MPMigrationLevelCloudStoreV1, MPMigrationLevelCloudStoreV2, MPMigrationLevelCloudStoreV3, @@ -32,15 +32,18 @@ typedef NS_ENUM(NSInteger, MPMigrationLevelCloudStore) { }; @implementation MPAppDelegate_Shared(Store) - PearlAssociatedObjectProperty(NSManagedObjectContext*, PrivateManagedObjectContext, privateManagedObjectContext); -PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, mainManagedObjectContext); +PearlAssociatedObjectProperty( id, SaveObserver, saveObserver ); + +PearlAssociatedObjectProperty( NSManagedObjectContext*, PrivateManagedObjectContext, privateManagedObjectContext ); + +PearlAssociatedObjectProperty( NSManagedObjectContext*, MainManagedObjectContext, mainManagedObjectContext ); #pragma mark - Core Data setup + (NSManagedObjectContext *)managedObjectContextForMainThreadIfReady { - NSAssert([[NSThread currentThread] isMainThread], @"Can only access main MOC from the main thread."); + NSAssert( [[NSThread currentThread] isMainThread], @"Can only access main MOC from the main thread." ); NSManagedObjectContext *mainManagedObjectContext = [[self get] mainManagedObjectContextIfReady]; if (!mainManagedObjectContext || ![[NSThread currentThread] isMainThread]) return nil; @@ -48,14 +51,40 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, return mainManagedObjectContext; } -+ (BOOL)managedObjectContextPerformBlock:(void (^)(NSManagedObjectContext *context))mocBlock { ++ (BOOL)managedObjectContextForMainThreadPerformBlock:(void ( ^ )(NSManagedObjectContext *mainContext))mocBlock { NSManagedObjectContext *mainManagedObjectContext = [[self get] mainManagedObjectContextIfReady]; if (!mainManagedObjectContext) return NO; + [mainManagedObjectContext performBlock:^{ + mocBlock( mainManagedObjectContext ); + }]; + + return YES; +} + ++ (BOOL)managedObjectContextForMainThreadPerformBlockAndWait:(void ( ^ )(NSManagedObjectContext *mainContext))mocBlock { + + NSManagedObjectContext *mainManagedObjectContext = [[self get] mainManagedObjectContextIfReady]; + if (!mainManagedObjectContext) + return NO; + + [mainManagedObjectContext performBlockAndWait:^{ + mocBlock( mainManagedObjectContext ); + }]; + + return YES; +} + ++ (BOOL)managedObjectContextPerformBlock:(void ( ^ )(NSManagedObjectContext *context))mocBlock { + + NSManagedObjectContext *privateManagedObjectContextIfReady = [[self get] privateManagedObjectContextIfReady]; + if (!privateManagedObjectContextIfReady) + return NO; + NSManagedObjectContext *moc = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; - moc.parentContext = mainManagedObjectContext; + moc.parentContext = privateManagedObjectContextIfReady; [moc performBlock:^{ mocBlock( moc ); }]; @@ -63,14 +92,14 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, return YES; } -+ (BOOL)managedObjectContextPerformBlockAndWait:(void (^)(NSManagedObjectContext *context))mocBlock { ++ (BOOL)managedObjectContextPerformBlockAndWait:(void ( ^ )(NSManagedObjectContext *context))mocBlock { - NSManagedObjectContext *mainManagedObjectContext = [[self get] mainManagedObjectContextIfReady]; - if (!mainManagedObjectContext) + NSManagedObjectContext *privateManagedObjectContextIfReady = [[self get] privateManagedObjectContextIfReady]; + if (!privateManagedObjectContextIfReady) return NO; NSManagedObjectContext *moc = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; - moc.parentContext = mainManagedObjectContext; + moc.parentContext = privateManagedObjectContextIfReady; [moc performBlockAndWait:^{ mocBlock( moc ); }]; @@ -105,14 +134,14 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationWillTerminateNotification object:UIApp queue:[NSOperationQueue mainQueue] usingBlock: ^(NSNotification *note) { - [[self mainManagedObjectContext] saveToStore]; - }]; + [[self mainManagedObjectContext] saveToStore]; + }]; [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationWillResignActiveNotification object:UIApp queue:[NSOperationQueue mainQueue] usingBlock: ^(NSNotification *note) { - [[self mainManagedObjectContext] saveToStore]; - }]; + [[self mainManagedObjectContext] saveToStore]; + }]; #else [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationWillTerminateNotification object:NSApp queue:[NSOperationQueue mainQueue] usingBlock: @@ -124,6 +153,41 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, return storeManager; } +- (MPFixableResult)findAndFixInconsistenciesSaveInContext:(NSManagedObjectContext *)context { + + NSError *error = nil; + NSFetchRequest *fetchRequest = [NSFetchRequest new]; + fetchRequest.fetchBatchSize = 50; + + MPFixableResult result = MPFixableResultNoProblems; + for (NSEntityDescription *entity in [context.persistentStoreCoordinator.managedObjectModel entities]) + if (class_conformsToProtocol( NSClassFromString( entity.managedObjectClassName ), @protocol(MPFixable) )) { + fetchRequest.entity = entity; + NSArray *objects = [context executeFetchRequest:fetchRequest error:&error]; + if (!objects) { + err( @"Failed to fetch %@ objects: %@", entity, error ); + continue; + } + + for (NSManagedObject *object in objects) + result = MPApplyFix( result, ^MPFixableResult { + return [object findAndFixInconsistenciesInContext:context]; + } ); + } + + if (result == MPFixableResultNoProblems) + inf( @"Sanity check found no problems in store." ); + + else { + [context saveToStore]; + [[NSNotificationCenter defaultCenter] postNotificationName:MPFoundInconsistenciesNotification object:nil userInfo:@{ + MPInconsistenciesFixResultUserKey : @(result) + }]; + } + + return result; +} + - (void)migrateStoreForManager:(UbiquityStoreManager *)manager isCloud:(BOOL)isCloudStore { [self migrateLocalStore]; @@ -136,42 +200,42 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, MPMigrationLevelLocalStore migrationLevel = (signed)[[NSUserDefaults standardUserDefaults] integerForKey:MPMigrationLevelLocalStoreKey]; if (migrationLevel >= MPMigrationLevelLocalStoreCurrent) - // Local store up-to-date. + // Local store up-to-date. return; - inf(@"Local store migration level: %d (current %d)", (signed)migrationLevel, (signed)MPMigrationLevelLocalStoreCurrent); + inf( @"Local store migration level: %d (current %d)", (signed)migrationLevel, (signed)MPMigrationLevelLocalStoreCurrent ); if (migrationLevel <= MPMigrationLevelLocalStoreV1) if (![self migrateV1LocalStore]) { - inf(@"Failed to migrate old V1 to new local store."); + inf( @"Failed to migrate old V1 to new local store." ); return; } [[NSUserDefaults standardUserDefaults] setInteger:MPMigrationLevelLocalStoreCurrent forKey:MPMigrationLevelLocalStoreKey]; - inf(@"Successfully migrated old to new local store."); + inf( @"Successfully migrated old to new local store." ); } - (void)migrateCloudStore { MPMigrationLevelCloudStore migrationLevel = (signed)[[NSUserDefaults standardUserDefaults] integerForKey:MPMigrationLevelCloudStoreKey]; if (migrationLevel >= MPMigrationLevelCloudStoreCurrent) - // Cloud store up-to-date. + // Cloud store up-to-date. return; - inf(@"Cloud store migration level: %d (current %d)", (signed)migrationLevel, (signed)MPMigrationLevelCloudStoreCurrent); + inf( @"Cloud store migration level: %d (current %d)", (signed)migrationLevel, (signed)MPMigrationLevelCloudStoreCurrent ); if (migrationLevel <= MPMigrationLevelCloudStoreV1) { if (![self migrateV1CloudStore]) { - inf(@"Failed to migrate old V1 to new cloud store."); + inf( @"Failed to migrate old V1 to new cloud store." ); return; } } else if (migrationLevel <= MPMigrationLevelCloudStoreV2) { if (![self migrateV2CloudStore]) { - inf(@"Failed to migrate old V2 to new cloud store."); + inf( @"Failed to migrate old V2 to new cloud store." ); return; } } [[NSUserDefaults standardUserDefaults] setInteger:MPMigrationLevelCloudStoreCurrent forKey:MPMigrationLevelCloudStoreKey]; - inf(@"Successfully migrated old to new cloud store."); + inf( @"Successfully migrated old to new cloud store." ); } - (BOOL)migrateV1CloudStore { @@ -184,11 +248,11 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, // Migrate cloud store. NSString *uuid = [[NSUserDefaults standardUserDefaults] stringForKey:@"LocalUUIDKey"]; if (!uuid) { - inf(@"No V1 cloud store to migrate."); + inf( @"No V1 cloud store to migrate." ); return YES; } - inf(@"Migrating V1 cloud store: %@ -> %@", uuid, [self.storeManager valueForKey:@"storeUUID"]); + inf( @"Migrating V1 cloud store: %@ -> %@", uuid, [self.storeManager valueForKey:@"storeUUID"] ); NSURL *cloudContainerURL = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:MPCloudContainerIdentifier]; NSURL *oldCloudContentURL = [[cloudContainerURL URLByAppendingPathComponent:@"Data" isDirectory:YES] @@ -205,11 +269,11 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, // Migrate cloud store. NSString *uuid = [[NSUbiquitousKeyValueStore defaultStore] stringForKey:@"USMStoreUUIDKey"]; if (!uuid) { - inf(@"No V2 cloud store to migrate."); + inf( @"No V2 cloud store to migrate." ); return YES; } - inf(@"Migrating V2 cloud store: %@ -> %@", uuid, [self.storeManager valueForKey:@"storeUUID"]); + inf( @"Migrating V2 cloud store: %@ -> %@", uuid, [self.storeManager valueForKey:@"storeUUID"] ); NSURL *cloudContainerURL = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:MPCloudContainerIdentifier]; NSURL *oldCloudContentURL = [[cloudContainerURL URLByAppendingPathComponent:@"CloudLogs" isDirectory:YES] @@ -228,11 +292,11 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, NSURL *oldLocalStoreURL = [[applicationFilesDirectory URLByAppendingPathComponent:@"MasterPassword" isDirectory:NO] URLByAppendingPathExtension:@"sqlite"]; if (![[NSFileManager defaultManager] fileExistsAtPath:oldLocalStoreURL.path isDirectory:NO]) { - inf(@"No V1 local store to migrate."); + inf( @"No V1 local store to migrate." ); return YES; } - inf(@"Migrating V1 local store"); + inf( @"Migrating V1 local store" ); return [self migrateFromLocalStore:oldLocalStoreURL]; } @@ -240,7 +304,7 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, NSURL *newLocalStoreURL = [self.storeManager URLForLocalStore]; if ([[NSFileManager defaultManager] fileExistsAtPath:newLocalStoreURL.path isDirectory:NO]) { - wrn(@"Can't migrate local store: A new local store already exists."); + wrn( @"Can't migrate local store: A new local store already exists." ); return YES; } @@ -251,14 +315,14 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, return NO; } - inf(@"Successfully migrated to new local store."); + inf( @"Successfully migrated to new local store." ); return YES; } - (BOOL)migrateFromCloudStore:(NSURL *)oldCloudStoreURL cloudContent:(NSURL *)oldCloudContentURL { if (![self.storeManager cloudSafeForSeeding]) { - inf(@"Can't migrate cloud store: A new cloud store already exists."); + inf( @"Can't migrate cloud store: A new cloud store already exists." ); return YES; } @@ -268,7 +332,7 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, strategy:0 error:nil cause:nil context:nil]) return NO; - inf(@"Successfully migrated to new cloud store."); + inf( @"Successfully migrated to new cloud store." ); return YES; } @@ -282,7 +346,7 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, - (void)ubiquityStoreManager:(UbiquityStoreManager *)manager log:(NSString *)message { - inf(@"[StoreManager] %@", message); + inf( @"[StoreManager] %@", message ); } - (void)ubiquityStoreManager:(UbiquityStoreManager *)manager willLoadStoreIsCloud:(BOOL)isCloudStore { @@ -292,6 +356,11 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, [moc saveToStore]; [moc reset]; + if (self.saveObserver) { + [[NSNotificationCenter defaultCenter] removeObserver:self.saveObserver]; + self.saveObserver = nil; + } + self.privateManagedObjectContext = nil; self.mainManagedObjectContext = nil; }]; @@ -302,14 +371,14 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, - (void)ubiquityStoreManager:(UbiquityStoreManager *)manager didLoadStoreForCoordinator:(NSPersistentStoreCoordinator *)coordinator isCloud:(BOOL)isCloudStore { - inf(@"Using iCloud? %@", @(isCloudStore)); + inf( @"Using iCloud? %@", @(isCloudStore) ); MPCheckpoint( MPCheckpointCloud, @{ @"enabled" : @(isCloudStore) } ); // Create our contexts. - NSManagedObjectContext - *privateManagedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; + NSManagedObjectContext *privateManagedObjectContext = + [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; [privateManagedObjectContext performBlockAndWait:^{ privateManagedObjectContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy; privateManagedObjectContext.persistentStoreCoordinator = coordinator; @@ -332,25 +401,42 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, NSManagedObjectContext *mainManagedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType]; mainManagedObjectContext.parentContext = privateManagedObjectContext; + if (self.saveObserver) + [[NSNotificationCenter defaultCenter] removeObserver:self.saveObserver]; + self.saveObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSManagedObjectContextDidSaveNotification + object:privateManagedObjectContext queue:nil usingBlock: + ^(NSNotification *note) { + // When privateManagedObjectContext is saved, import the changes into mainManagedObjectContext. + [mainManagedObjectContext performBlock:^{ + [mainManagedObjectContext mergeChangesFromContextDidSaveNotification:note]; + }]; + }]; + self.privateManagedObjectContext = privateManagedObjectContext; self.mainManagedObjectContext = mainManagedObjectContext; + + // Perform a data sanity check on the newly loaded store to find and fix any issues. + if ([[MPConfig get].checkInconsistency boolValue]) + [MPAppDelegate_Shared managedObjectContextPerformBlockAndWait:^(NSManagedObjectContext *context) { + [self findAndFixInconsistenciesSaveInContext:context]; + }]; } - (void)ubiquityStoreManager:(UbiquityStoreManager *)manager didEncounterError:(NSError *)error cause:(UbiquityStoreErrorCause)cause context:(id)context { - err(@"[StoreManager] ERROR: cause=%@, context=%@, error=%@", NSStringFromUSMCause( cause ), context, error); + err( @"[StoreManager] ERROR: cause=%@, context=%@, error=%@", NSStringFromUSMCause( cause ), context, error ); MPCheckpoint( MPCheckpointMPErrorUbiquity, @{ @"cause" : @(cause), @"error.code" : @(error.code), - @"error.domain" : NilToNSNull(error.domain), - @"error.reason" : NilToNSNull(IfNotNilElse( [error localizedFailureReason], [error localizedDescription] )), + @"error.domain" : NilToNSNull( error.domain ), + @"error.reason" : NilToNSNull( IfNotNilElse( [error localizedFailureReason], [error localizedDescription] ) ), } ); } #pragma mark - Utilities -- (void)addElementNamed:(NSString *)siteName completion:(void (^)(MPElementEntity *element))completion { +- (void)addElementNamed:(NSString *)siteName completion:(void ( ^ )(MPElementEntity *element))completion { if (![siteName length]) { completion( nil ); @@ -359,47 +445,46 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, [MPAppDelegate_Shared managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { MPUserEntity *activeUser = [self activeUserInContext:context]; - NSAssert(activeUser, @"Missing user."); - if (!activeUser) + NSAssert( activeUser, @"Missing user." ); + if (!activeUser) { + completion( nil ); return; + } MPElementType type = activeUser.defaultType; - if (!type) - type = activeUser.defaultType = MPElementTypeGeneratedLong; - NSString *typeEntityClassName = [MPAlgorithmDefault classNameOfType:type]; - - MPElementEntity *element = [NSEntityDescription insertNewObjectForEntityForName:typeEntityClassName - inManagedObjectContext:context]; + NSString *typeEntityName = [MPAlgorithmDefault classNameOfType:type]; + MPElementEntity *element = [NSEntityDescription insertNewObjectForEntityForName:typeEntityName inManagedObjectContext:context]; element.name = siteName; element.user = activeUser; element.type = type; element.lastUsed = [NSDate date]; element.version = MPAlgorithmDefaultVersion; - [context saveToStore]; NSError *error = nil; if (element.objectID.isTemporaryID && ![context obtainPermanentIDsForObjects:@[ element ] error:&error]) - err(@"Failed to obtain a permanent object ID after creating new element: %@", error); + err( @"Failed to obtain a permanent object ID after creating new element: %@", error ); - NSManagedObjectID *elementOID = [element objectID]; - dispatch_async( dispatch_get_main_queue(), ^{ - completion( - (MPElementEntity *)[[MPAppDelegate_Shared managedObjectContextForMainThreadIfReady] objectRegisteredForID:elementOID] ); - } ); + [context saveToStore]; + + completion( element ); }]; } -- (MPElementEntity *)changeElement:(MPElementEntity *)element inContext:(NSManagedObjectContext *)context toType:(MPElementType)type { +- (MPElementEntity *)changeElement:(MPElementEntity *)element saveInContext:(NSManagedObjectContext *)context toType:(MPElementType)type { - if ([element.algorithm classOfType:type] == element.typeClass) + if (element.type == type) + return element; + + if ([element.algorithm classOfType:type] == element.typeClass) { element.type = type; + [context saveToStore]; + } else { // Type requires a different class of element. Recreate the element. - MPElementEntity *newElement - = [NSEntityDescription insertNewObjectForEntityForName:[element.algorithm classNameOfType:type] - inManagedObjectContext:context]; + NSString *typeEntityName = [element.algorithm classNameOfType:type]; + MPElementEntity *newElement = [NSEntityDescription insertNewObjectForEntityForName:typeEntityName inManagedObjectContext:context]; newElement.type = type; newElement.name = element.name; newElement.user = element.user; @@ -408,15 +493,14 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, newElement.version = element.version; newElement.loginName = element.loginName; + NSError *error = nil; + if (![context obtainPermanentIDsForObjects:@[ newElement ] error:&error]) + err( @"Failed to obtain a permanent object ID after changing object type: %@", error ); + [context deleteObject:element]; - // TODO: Dodgy... we're not saving consistently here. - // Either we should save regardless and change the method signature to saveInContext: or not save at all. [context saveToStore]; - NSError *error; - if (![context obtainPermanentIDsForObjects:@[ newElement ] error:&error]) - err(@"Failed to obtain a permanent object ID after changing object type: %@", error); - + [[NSNotificationCenter defaultCenter] postNotificationName:MPElementUpdatedNotification object:element.objectID]; element = newElement; } @@ -425,10 +509,10 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, } - (MPImportResult)importSites:(NSString *)importedSitesString - askImportPassword:(NSString *(^)(NSString *userName))importPassword - askUserPassword:(NSString *(^)(NSString *userName, NSUInteger importCount, NSUInteger deleteCount))userPassword { + askImportPassword:(NSString *( ^ )(NSString *userName))importPassword + askUserPassword:(NSString *( ^ )(NSString *userName, NSUInteger importCount, NSUInteger deleteCount))userPassword { - NSAssert(![[NSThread currentThread] isMainThread], @"This method should not be invoked from the main thread."); + NSAssert( ![[NSThread currentThread] isMainThread], @"This method should not be invoked from the main thread." ); __block MPImportResult result = MPImportResultCancelled; do { @@ -444,8 +528,8 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, } - (MPImportResult)importSites:(NSString *)importedSitesString - askImportPassword:(NSString *(^)(NSString *userName))askImportPassword - askUserPassword:(NSString *(^)(NSString *userName, NSUInteger importCount, NSUInteger deleteCount))askUserPassword + askImportPassword:(NSString *( ^ )(NSString *userName))askImportPassword + askUserPassword:(NSString *( ^ )(NSString *userName, NSUInteger importCount, NSUInteger deleteCount))askUserPassword saveInContext:(NSManagedObjectContext *)context { // Compile patterns. @@ -456,7 +540,7 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, initWithPattern:@"^#[[:space:]]*([^:]+): (.*)" options:(NSRegularExpressionOptions)0 error:&error]; if (error) { - err(@"Error loading the header pattern: %@", error); + err( @"Error loading the header pattern: %@", error ); return MPImportResultInternalError; } } @@ -465,13 +549,13 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, initWithPattern:@"^([^[:space:]]+)[[:space:]]+([[:digit:]]+)[[:space:]]+([[:digit:]]+)(:[[:digit:]]+)?[[:space:]]+([^\t]+)\t(.*)" options:(NSRegularExpressionOptions)0 error:&error]; if (error) { - err(@"Error loading the site pattern: %@", error); + err( @"Error loading the site pattern: %@", error ); return MPImportResultInternalError; } } // Parse import data. - inf(@"Importing sites."); + inf( @"Importing sites." ); __block MPUserEntity *user = nil; id importAlgorithm = nil; NSString *importBundleVersion = nil, *importUserName = nil; @@ -499,7 +583,7 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, // Header if ([headerPattern numberOfMatchesInString:importedSiteLine options:(NSMatchingOptions)0 range:NSMakeRange( 0, [importedSiteLine length] )] != 1) { - err(@"Invalid header format in line: %@", importedSiteLine); + err( @"Invalid header format in line: %@", importedSiteLine ); return MPImportResultMalformedInput; } NSTextCheckingResult *headerElements = [[headerPattern matchesInString:importedSiteLine options:(NSMatchingOptions)0 @@ -513,16 +597,16 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, userFetchRequest.predicate = [NSPredicate predicateWithFormat:@"name == %@", importUserName]; NSArray *users = [context executeFetchRequest:userFetchRequest error:&error]; if (!users) { - err(@"While looking for user: %@, error: %@", importUserName, error); + err( @"While looking for user: %@, error: %@", importUserName, error ); return MPImportResultInternalError; } if ([users count] > 1) { - err(@"While looking for user: %@, found more than one: %lu", importUserName, (unsigned long)[users count]); + err( @"While looking for user: %@, found more than one: %lu", importUserName, (unsigned long)[users count] ); return MPImportResultInternalError; } user = [users count]? [users lastObject]: nil; - dbg(@"Found user: %@", [user debugDescription]); + dbg( @"Found user: %@", [user debugDescription] ); } if ([headerName isEqualToString:@"Key ID"]) importKeyID = [headerValue decodeHex]; @@ -547,7 +631,7 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, // Site if ([sitePattern numberOfMatchesInString:importedSiteLine options:(NSMatchingOptions)0 range:NSMakeRange( 0, [importedSiteLine length] )] != 1) { - err(@"Invalid site format in line: %@", importedSiteLine); + err( @"Invalid site format in line: %@", importedSiteLine ); return MPImportResultMalformedInput; } NSTextCheckingResult *siteElements = [[sitePattern matchesInString:importedSiteLine options:(NSMatchingOptions)0 @@ -566,25 +650,26 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, elementFetchRequest.predicate = [NSPredicate predicateWithFormat:@"name == %@ AND user == %@", name, user]; NSArray *existingSites = [context executeFetchRequest:elementFetchRequest error:&error]; if (!existingSites) { - err(@"Lookup of existing sites failed for site: %@, user: %@, error: %@", name, user.userID, error); + err( @"Lookup of existing sites failed for site: %@, user: %@, error: %@", name, user.userID, error ); return MPImportResultInternalError; } if ([existingSites count]) { - dbg(@"Existing sites: %@", existingSites); + dbg( @"Existing sites: %@", existingSites ); [elementsToDelete addObjectsFromArray:existingSites]; } } [importedSiteElements addObject:@[ lastUsed, uses, type, version, name, exportContent ]]; - dbg(@"Will import site: lastUsed=%@, uses=%@, type=%@, version=%@, name=%@, exportContent=%@", - lastUsed, uses, type, version, name, exportContent); + dbg( @"Will import site: lastUsed=%@, uses=%@, type=%@, version=%@, name=%@, exportContent=%@", + lastUsed, uses, type, version, name, exportContent ); } // Ask for confirmation to import these sites and the master password of the user. - inf(@"Importing %lu sites, deleting %lu sites, for user: %@", (unsigned long)[importedSiteElements count], (unsigned long)[elementsToDelete count], [MPUserEntity idFor:importUserName]); + inf( @"Importing %lu sites, deleting %lu sites, for user: %@", (unsigned long)[importedSiteElements count], + (unsigned long)[elementsToDelete count], [MPUserEntity idFor:importUserName] ); NSString *userMasterPassword = askUserPassword( user? user.name: importUserName, [importedSiteElements count], [elementsToDelete count] ); if (!userMasterPassword) { - inf(@"Import cancelled."); + inf( @"Import cancelled." ); return MPImportResultCancelled; } MPKey *userKey = [MPAlgorithmDefault keyForPassword:userMasterPassword ofUserNamed:user? user.name: importUserName]; @@ -600,17 +685,16 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, // Delete existing sites. if (elementsToDelete.count) [elementsToDelete enumerateObjectsUsingBlock:^(id obj, BOOL *stop) { - inf(@"Deleting site: %@, it will be replaced by an imported site.", [obj name]); + inf( @"Deleting site: %@, it will be replaced by an imported site.", [obj name] ); [context deleteObject:obj]; }]; // Make sure there is a user. if (!user) { - user = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass( [MPUserEntity class] ) - inManagedObjectContext:context]; + user = [MPUserEntity insertNewObjectInContext:context]; user.name = importUserName; user.keyID = importKeyID; - dbg(@"Created User: %@", [user debugDescription]); + dbg( @"Created User: %@", [user debugDescription] ); } // Import new sites. @@ -623,9 +707,8 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, NSString *exportContent = siteElements[5]; // Create new site. - MPElementEntity - *element = [NSEntityDescription insertNewObjectForEntityForName:[MPAlgorithmForVersion( version ) classNameOfType:type] - inManagedObjectContext:context]; + NSString *typeEntityName = [MPAlgorithmForVersion( version ) classNameOfType:type]; + MPElementEntity *element = [NSEntityDescription insertNewObjectForEntityForName:typeEntityName inManagedObjectContext:context]; element.name = name; element.user = user; element.type = type; @@ -639,13 +722,13 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, [element.algorithm importProtectedContent:exportContent protectedByKey:importKey intoElement:element usingKey:userKey]; } - dbg(@"Created Element: %@", [element debugDescription]); + dbg( @"Created Element: %@", [element debugDescription] ); } if (![context saveToStore]) return MPImportResultInternalError; - inf(@"Import completed successfully."); + inf( @"Import completed successfully." ); MPCheckpoint( MPCheckpointSitesImported, nil ); [[NSNotificationCenter defaultCenter] postNotificationName:MPSitesImportedNotification object:nil userInfo:@{ @@ -655,15 +738,15 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, return MPImportResultSuccess; } -- (NSString *)exportSitesShowingPasswords:(BOOL)showPasswords { +- (NSString *)exportSitesRevealPasswords:(BOOL)revealPasswords { MPUserEntity *activeUser = [self activeUserForMainThread]; - inf(@"Exporting sites, %@, for: %@", showPasswords? @"showing passwords": @"omitting passwords", activeUser.userID); + inf( @"Exporting sites, %@, for: %@", revealPasswords? @"revealing passwords": @"omitting passwords", activeUser.userID ); // Header. NSMutableString *export = [NSMutableString new]; [export appendFormat:@"# Master Password site export\n"]; - if (showPasswords) + if (revealPasswords) [export appendFormat:@"# Export of site names and passwords in clear-text.\n"]; else [export appendFormat:@"# Export of site names and stored passwords (unless device-private) encrypted with the master key.\n"]; @@ -673,7 +756,7 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, [export appendFormat:@"# User Name: %@\n", activeUser.name]; [export appendFormat:@"# Key ID: %@\n", [activeUser.keyID encodeHex]]; [export appendFormat:@"# Date: %@\n", [[NSDateFormatter rfc3339DateFormatter] stringFromDate:[NSDate date]]]; - if (showPasswords) + if (revealPasswords) [export appendFormat:@"# Passwords: VISIBLE\n"]; else [export appendFormat:@"# Passwords: PROTECTED\n"]; @@ -693,7 +776,7 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, // Determine the content to export. if (!(type & MPElementFeatureDevicePrivate)) { - if (showPasswords) + if (revealPasswords) content = [element.algorithm resolveContentForElement:element usingKey:self.key]; else if (type & MPElementFeatureExportContent) content = [element.algorithm exportContentForElement:element usingKey:self.key]; @@ -702,11 +785,11 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, [export appendFormat:@"%@ %8ld %8s %20s\t%@\n", [[NSDateFormatter rfc3339DateFormatter] stringFromDate:lastUsed], (long)uses, [PearlString( @"%lu:%lu", (long)type, (unsigned long)version ) UTF8String], [name UTF8String], content - ? content: @""]; + ? content: @""]; } MPCheckpoint( MPCheckpointSitesExported, @{ - @"showPasswords" : @(showPasswords) + @"showPasswords" : @(revealPasswords) } ); return export; diff --git a/MasterPassword/ObjC/MPConfig.h b/MasterPassword/ObjC/MPConfig.h index e5784706..e8bffa16 100644 --- a/MasterPassword/ObjC/MPConfig.h +++ b/MasterPassword/ObjC/MPConfig.h @@ -14,5 +14,6 @@ @property(nonatomic, retain) NSNumber *rememberLogin; @property(nonatomic, retain) NSNumber *iCloudDecided; +@property(nonatomic, retain) NSNumber *checkInconsistency; @end diff --git a/MasterPassword/ObjC/MPConfig.m b/MasterPassword/ObjC/MPConfig.m index 1424d9d2..68783083 100644 --- a/MasterPassword/ObjC/MPConfig.m +++ b/MasterPassword/ObjC/MPConfig.m @@ -6,12 +6,11 @@ // Copyright (c) 2012 Lyndir. All rights reserved. // -#import "MPConfig.h" #import "MPAppDelegate_Shared.h" @implementation MPConfig -@dynamic sendInfo, rememberLogin, iCloudDecided; +@dynamic sendInfo, rememberLogin, iCloudDecided, checkInconsistency; - (id)init { @@ -19,11 +18,12 @@ return nil; [self.defaults registerDefaults:@{ - NSStringFromSelector( @selector(askForReviews) ) : @YES, + NSStringFromSelector( @selector( askForReviews ) ) : @YES, - NSStringFromSelector( @selector(sendInfo) ) : @NO, - NSStringFromSelector( @selector(rememberLogin) ) : @NO, - NSStringFromSelector( @selector(iCloudDecided) ) : @NO + NSStringFromSelector( @selector( sendInfo ) ) : @NO, + NSStringFromSelector( @selector( rememberLogin ) ) : @NO, + NSStringFromSelector( @selector( iCloudDecided ) ) : @NO, + NSStringFromSelector( @selector( checkInconsistency ) ) : @NO }]; self.delegate = [MPAppDelegate_Shared get]; diff --git a/MasterPassword/ObjC/MPElementEntity.h b/MasterPassword/ObjC/MPElementEntity.h index 587ea556..510d14f6 100644 --- a/MasterPassword/ObjC/MPElementEntity.h +++ b/MasterPassword/ObjC/MPElementEntity.h @@ -8,10 +8,11 @@ #import #import +#import "MPFixable.h" @class MPUserEntity; -@interface MPElementEntity : NSManagedObject +@interface MPElementEntity : NSManagedObject @property(nonatomic, retain) NSDate *lastUsed; @property(nonatomic, retain) NSString *loginName; diff --git a/MasterPassword/ObjC/MPElementEntity.m b/MasterPassword/ObjC/MPElementEntity.m index 52289517..d90110a4 100644 --- a/MasterPassword/ObjC/MPElementEntity.m +++ b/MasterPassword/ObjC/MPElementEntity.m @@ -19,4 +19,9 @@ @dynamic version_; @dynamic user; +- (MPFixableResult)findAndFixInconsistenciesInContext:(NSManagedObjectContext *)context { + + return MPFixableResultNoProblems; +} + @end diff --git a/MasterPassword/ObjC/MPElementGeneratedEntity.m b/MasterPassword/ObjC/MPElementGeneratedEntity.m index 5f0441fe..6914a180 100644 --- a/MasterPassword/ObjC/MPElementGeneratedEntity.m +++ b/MasterPassword/ObjC/MPElementGeneratedEntity.m @@ -7,9 +7,49 @@ // #import "MPElementGeneratedEntity.h" +#import "MPAppDelegate_Shared.h" @implementation MPElementGeneratedEntity @dynamic counter_; +- (MPFixableResult)findAndFixInconsistenciesInContext:(NSManagedObjectContext *)context { + + MPFixableResult result = [super findAndFixInconsistenciesInContext:context]; + + if (!self.type || self.type == (MPElementType)NSNotFound || ![[self.algorithm allTypes] containsObject:self.type_]) + // Invalid self.type + result = MPApplyFix( result, ^MPFixableResult { + wrn( @"Invalid type for: %@ of %@, type: %ld. Will use %ld instead.", + self.name, self.user.name, (long)self.type, (long)self.user.defaultType ); + self.type = self.user.defaultType; + return MPFixableResultProblemsFixed; + } ); + if (!self.type || self.type == (MPElementType)NSNotFound || ![[self.algorithm allTypes] containsObject:self.type_]) + // Invalid self.user.defaultType + result = MPApplyFix( result, ^MPFixableResult { + wrn( @"Invalid type for: %@ of %@, type: %ld. Will use %ld instead.", + self.name, self.user.name, (long)self.type, (long)MPElementTypeGeneratedLong ); + self.type = MPElementTypeGeneratedLong; + return MPFixableResultProblemsFixed; + } ); + if (![self isKindOfClass:[self.algorithm classOfType:self.type]]) + // Mismatch between self.type and self.class + result = MPApplyFix( result, ^MPFixableResult { + for (MPElementType newType = self.type; self.type != (newType = [self.algorithm nextType:newType]);) + if ([self isKindOfClass:[self.algorithm classOfType:newType]]) { + wrn( @"Mismatching type for: %@ of %@, type: %lu, class: %@. Will use %ld instead.", + self.name, self.user.name, (long)self.type, self.class, (long)newType ); + self.type = newType; + return MPFixableResultProblemsFixed; + } + + err( @"Mismatching type for: %@ of %@, type: %lu, class: %@. Couldn't find a type to fix problem with.", + self.name, self.user.name, (long)self.type, self.class ); + return MPFixableResultProblemsNotFixed; + } ); + + return result; +} + @end diff --git a/MasterPassword/ObjC/MPElementStoredEntity.h b/MasterPassword/ObjC/MPElementStoredEntity.h index c4cda5d7..0d0a4600 100644 --- a/MasterPassword/ObjC/MPElementStoredEntity.h +++ b/MasterPassword/ObjC/MPElementStoredEntity.h @@ -12,6 +12,6 @@ @interface MPElementStoredEntity : MPElementEntity -@property(nonatomic, retain) id contentObject; +@property(nonatomic, retain) NSData *contentObject; @end diff --git a/MasterPassword/ObjC/MPElementStoredEntity.m b/MasterPassword/ObjC/MPElementStoredEntity.m index 98d8360f..af6ecd6c 100644 --- a/MasterPassword/ObjC/MPElementStoredEntity.m +++ b/MasterPassword/ObjC/MPElementStoredEntity.m @@ -7,9 +7,31 @@ // #import "MPElementStoredEntity.h" +#import "MPEntities.h" +#import "MPAppDelegate_Shared.h" @implementation MPElementStoredEntity @dynamic contentObject; +- (MPFixableResult)findAndFixInconsistenciesInContext:(NSManagedObjectContext *)context { + + MPFixableResult result = [super findAndFixInconsistenciesInContext:context]; + + if (self.contentObject && ![self.contentObject isKindOfClass:[NSData class]]) + result = MPApplyFix( result, ^MPFixableResult { + MPKey *key = [MPAppDelegate_Shared get].key; + if (key && [[MPAppDelegate_Shared get] activeUserInContext:context] == self.user) { + wrn( @"Content object not encrypted for: %@ of %@. Will re-encrypt.", self.name, self.user.name ); + [self.algorithm saveContent:[self.contentObject description] toElement:self usingKey:key]; + return MPFixableResultProblemsFixed; + } + + err( @"Content object not encrypted for: %@ of %@. Couldn't fix, please sign in.", self.name, self.user.name ); + return MPFixableResultProblemsNotFixed; + } ); + + return result; +} + @end diff --git a/MasterPassword/ObjC/MPEntities.h b/MasterPassword/ObjC/MPEntities.h index b91737dc..dc6d1351 100644 --- a/MasterPassword/ObjC/MPEntities.h +++ b/MasterPassword/ObjC/MPEntities.h @@ -35,6 +35,8 @@ - (NSUInteger)use; - (BOOL)migrateExplicitly:(BOOL)explicit; +- (NSString *)resolveContentUsingKey:(MPKey *)key; +- (void)resolveContentUsingKey:(MPKey *)key result:(void (^)(NSString *))result; @end diff --git a/MasterPassword/ObjC/MPEntities.m b/MasterPassword/ObjC/MPEntities.m index 5b5fbc32..8cd60ba3 100644 --- a/MasterPassword/ObjC/MPEntities.m +++ b/MasterPassword/ObjC/MPEntities.m @@ -8,13 +8,14 @@ #import "MPEntities.h" #import "MPAppDelegate_Shared.h" +#import "MPAppDelegate_Store.h" @implementation NSManagedObjectContext(MP) - (BOOL)saveToStore { __block BOOL success = YES; - if ([self hasChanges]) + if ([self hasChanges]) { [self performBlockAndWait:^{ @try { NSError *error = nil; @@ -26,6 +27,7 @@ err(@"While saving: %@", exception); } }]; + } return success && (!self.parentContext || [self.parentContext saveToStore]); } @@ -36,26 +38,11 @@ - (MPElementType)type { - // Some people got elements with type == 0. - MPElementType type = (MPElementType)[self.type_ unsignedIntegerValue]; - if (!type || type == (MPElementType)NSNotFound) - type = [self.user defaultType]; - if (!type || type == (MPElementType)NSNotFound) - type = MPElementTypeGeneratedLong; - - return type; + return (MPElementType)[self.type_ unsignedIntegerValue]; } - (void)setType:(MPElementType)aType { - // Make sure we don't poison our model data with invalid values. - if (!aType || aType == (MPElementType)NSNotFound) - aType = [self.user defaultType]; - if (!aType || aType == (MPElementType)NSNotFound) - aType = MPElementTypeGeneratedLong; - if (![self isKindOfClass:[self.algorithm classOfType:aType]]) - Throw(@"This object's class does not support the type: %lu", (long)aType); - self.type_ = @(aType); } @@ -122,12 +109,12 @@ - (NSString *)description { - return PearlString( @"%@:%@", [self class], [self name] ); + return strf( @"%@:%@", [self class], [self name] ); } - (NSString *)debugDescription { - return PearlString( @"{%@: name=%@, user=%@, type=%lu, uses=%ld, lastUsed=%@, version=%ld, loginName=%@, requiresExplicitMigration=%d}", + return strf( @"{%@: name=%@, user=%@, type=%lu, uses=%ld, lastUsed=%@, version=%ld, loginName=%@, requiresExplicitMigration=%d}", NSStringFromClass( [self class] ), self.name, self.user.name, (long)self.type, (long)self.uses, self.lastUsed, (long)self.version, self.loginName, self.requiresExplicitMigration ); } @@ -145,6 +132,16 @@ return YES; } +- (NSString *)resolveContentUsingKey:(MPKey *)key { + + return [self.algorithm resolveContentForElement:self usingKey:key]; +} + +- (void)resolveContentUsingKey:(MPKey *)key result:(void (^)(NSString *))result { + + [self.algorithm resolveContentForElement:self usingKey:key result:result]; +} + @end @implementation MPElementGeneratedEntity(MP) @@ -189,7 +186,7 @@ - (MPElementType)defaultType { - return (MPElementType)[self.defaultType_ unsignedIntegerValue]; + return IfElse((MPElementType)[self.defaultType_ unsignedIntegerValue], MPElementTypeGeneratedLong); } - (void)setDefaultType:(MPElementType)aDefaultType { diff --git a/MasterPassword/ObjC/MPFixable.h b/MasterPassword/ObjC/MPFixable.h new file mode 100644 index 00000000..7ad01702 --- /dev/null +++ b/MasterPassword/ObjC/MPFixable.h @@ -0,0 +1,33 @@ +/** +* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) +* +* See the enclosed file LICENSE for license information (LGPLv3). If you did +* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt +* +* @author Maarten Billemont +* @license http://www.gnu.org/licenses/lgpl-3.0.txt +*/ + +// +// MPFixable.h +// MPFixable +// +// Created by lhunath on 2014-04-26. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import + +typedef NS_ENUM( NSUInteger, MPFixableResult ) { + MPFixableResultNoProblems, + MPFixableResultProblemsFixed, + MPFixableResultProblemsNotFixed, +}; + +MPFixableResult MPApplyFix(MPFixableResult previousResult, MPFixableResult(^fixBlock)(void)); + +@protocol MPFixable + +- (MPFixableResult)findAndFixInconsistenciesInContext:(NSManagedObjectContext *)context; + +@end diff --git a/MasterPassword/ObjC/MPFixable.m b/MasterPassword/ObjC/MPFixable.m new file mode 100644 index 00000000..519981e8 --- /dev/null +++ b/MasterPassword/ObjC/MPFixable.m @@ -0,0 +1,40 @@ +/** +* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) +* +* See the enclosed file LICENSE for license information (LGPLv3). If you did +* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt +* +* @author Maarten Billemont +* @license http://www.gnu.org/licenses/lgpl-3.0.txt +*/ + +// +// MPFixable.m +// MPFixable +// +// Created by lhunath on 2014-04-26. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPFixable.h" + +MPFixableResult MPApplyFix(MPFixableResult previousResult, MPFixableResult(^fixBlock)(void)) { + + MPFixableResult additionalResult = fixBlock(); + switch (previousResult) { + case MPFixableResultNoProblems: + return additionalResult; + case MPFixableResultProblemsFixed: + switch (additionalResult) { + case MPFixableResultNoProblems: + case MPFixableResultProblemsFixed: + return previousResult; + case MPFixableResultProblemsNotFixed: + return additionalResult; + } + case MPFixableResultProblemsNotFixed: + return additionalResult; + } + + Throw( @"Unexpected previous=%ld or additional=%ld result.", (long)previousResult, (long)additionalResult ); +} diff --git a/MasterPassword/ObjC/MPTypes.h b/MasterPassword/ObjC/MPTypes.h index c9fd7949..338fbd1e 100644 --- a/MasterPassword/ObjC/MPTypes.h +++ b/MasterPassword/ObjC/MPTypes.h @@ -77,8 +77,10 @@ typedef NS_ENUM(NSUInteger, MPElementType) { #define MPElementUpdatedNotification @"MPElementUpdatedNotification" #define MPCheckConfigNotification @"MPCheckConfigNotification" #define MPSitesImportedNotification @"MPSitesImportedNotification" +#define MPFoundInconsistenciesNotification @"MPFoundInconsistenciesNotification" #define MPSitesImportedNotificationUserKey @"MPSitesImportedNotificationUserKey" +#define MPInconsistenciesFixResultUserKey @"MPInconsistenciesFixResultUserKey" static void MPCheckpoint(NSString *checkpoint, NSDictionary *attributes) { diff --git a/MasterPassword/ObjC/Mac/MPElementCollectionView.m b/MasterPassword/ObjC/Mac/MPElementCollectionView.m index d90c3c01..498e71f8 100644 --- a/MasterPassword/ObjC/Mac/MPElementCollectionView.m +++ b/MasterPassword/ObjC/Mac/MPElementCollectionView.m @@ -113,9 +113,8 @@ // "Next type" button. [MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { MPElementEntity *element = [self.representedObject entityInContext:context]; - element = [[MPMacAppDelegate get] changeElement:element inContext:context + element = [[MPMacAppDelegate get] changeElement:element saveInContext:context toType:[element.algorithm nextType:element.type]]; - [context saveToStore]; self.representedObject = [[MPElementModel alloc] initWithEntity:element]; }]; @@ -131,9 +130,8 @@ // "Previous type" button. [MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { MPElementEntity *element = [self.representedObject entityInContext:context]; - element = [[MPMacAppDelegate get] changeElement:element inContext:context + element = [[MPMacAppDelegate get] changeElement:element saveInContext:context toType:[element.algorithm previousType:element.type]]; - [context saveToStore]; self.representedObject = [[MPElementModel alloc] initWithEntity:element]; }]; diff --git a/MasterPassword/ObjC/Mac/MPMacAppDelegate.m b/MasterPassword/ObjC/Mac/MPMacAppDelegate.m index c7fe0911..b5dad96e 100644 --- a/MasterPassword/ObjC/Mac/MPMacAppDelegate.m +++ b/MasterPassword/ObjC/Mac/MPMacAppDelegate.m @@ -243,8 +243,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven - (void)didUpdateConfigForKey:(SEL)configKey fromValue:(id)oldValue { - [[NSNotificationCenter defaultCenter] - postNotificationName:MPCheckConfigNotification object:NSStringFromSelector( configKey ) userInfo:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification object:NSStringFromSelector( configKey )]; } #pragma mark - NSApplicationDelegate diff --git a/MasterPassword/ObjC/Mac/MPPasswordWindowController.m b/MasterPassword/ObjC/Mac/MPPasswordWindowController.m index bf450bfc..15cebd38 100644 --- a/MasterPassword/ObjC/Mac/MPPasswordWindowController.m +++ b/MasterPassword/ObjC/Mac/MPPasswordWindowController.m @@ -182,7 +182,7 @@ // "Create" button. [[MPMacAppDelegate get] addElementNamed:[self.siteField stringValue] completion:^(MPElementEntity *element) { if (element) - [self updateElements]; + PearlMainQueue( ^{ [self updateElements]; } ); }]; break; } @@ -453,7 +453,7 @@ - (void)setElementSelectionIndexes:(NSIndexSet *)elementSelectionIndexes { // First reset bounds. - PearlMainThread(^{ + PearlMainQueue(^{ NSUInteger selectedIndex = self.elementSelectionIndexes.firstIndex; if (selectedIndex != NSNotFound && selectedIndex < self.elements.count) [[self selectedView].animator setBoundsOrigin:NSZeroPoint]; diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.xcodeproj/project.pbxproj b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.xcodeproj/project.pbxproj index ed27033b..7ff69c34 100644 --- a/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.xcodeproj/project.pbxproj +++ b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + DA3B84581915577F00246EEA /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA3B84571915577F00246EEA /* Crashlytics.framework */; }; DAD9B5CF176299B9001835F9 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DAD9B5CD176299B9001835F9 /* InfoPlist.strings */; }; DAD9B5D1176299B9001835F9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DAD9B5D0176299B9001835F9 /* main.m */; }; DAD9B5D8176299B9001835F9 /* MPLoginAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DAD9B5D7176299B9001835F9 /* MPLoginAppDelegate.m */; }; @@ -14,6 +15,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + DA3B84571915577F00246EEA /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Crashlytics.framework; path = ../../../../External/Mac/Crashlytics.framework; sourceTree = ""; }; DAD9B5C1176299B9001835F9 /* MasterPassword-Mac-LoginHelper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "MasterPassword-Mac-LoginHelper.app"; sourceTree = BUILT_PRODUCTS_DIR; }; DAD9B5CC176299B9001835F9 /* MasterPassword-Mac-LoginHelper-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MasterPassword-Mac-LoginHelper-Info.plist"; sourceTree = ""; }; DAD9B5CE176299B9001835F9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -30,6 +32,7 @@ buildActionMask = 2147483647; files = ( DAD9B5EC1762AAA6001835F9 /* AppKit.framework in Frameworks */, + DA3B84581915577F00246EEA /* Crashlytics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -56,6 +59,7 @@ DAD9B5C3176299B9001835F9 /* Frameworks */ = { isa = PBXGroup; children = ( + DA3B84571915577F00246EEA /* Crashlytics.framework */, DAD9B5EB1762AAA6001835F9 /* AppKit.framework */, ); name = Frameworks; @@ -164,7 +168,69 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - DAD9B5DC176299B9001835F9 /* Debug */ = { + DA3B845A1916AC5100246EEA /* AppStore-Mac */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES; + CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES; + CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_CXX0X_EXTENSIONS = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; + GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNKNOWN_PRAGMAS = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + PRODUCT_NAME = "${TARGET_NAME}"; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = "AppStore-Mac"; + }; + DA3B845B1916AC5100246EEA /* AppStore-Mac */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_ENTITLEMENTS = "MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.entitlements"; + CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application: Maarten Billemont (HL3Q45LX9N)"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + /Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Mac, + ); + INFOPLIST_FILE = "$(SRCROOT)/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper-Info.plist"; + }; + name = "AppStore-Mac"; + }; + DAD9B5DC176299B9001835F9 /* Debug-Mac */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -185,7 +251,6 @@ CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; - CODE_SIGN_IDENTITY = "Developer ID Application: Maarten Billemont"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; @@ -215,13 +280,12 @@ MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "${TARGET_NAME}"; - PROVISIONING_PROFILE = ""; SDKROOT = macosx; SKIP_INSTALL = YES; }; - name = Debug; + name = "Debug-Mac"; }; - DAD9B5DD176299B9001835F9 /* Release */ = { + DAD9B5DD176299B9001835F9 /* AdHoc-Mac */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -242,7 +306,6 @@ CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; - CODE_SIGN_IDENTITY = "Developer ID Application: Maarten Billemont"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -265,31 +328,38 @@ GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.8; PRODUCT_NAME = "${TARGET_NAME}"; - PROVISIONING_PROFILE = ""; SDKROOT = macosx; SKIP_INSTALL = YES; }; - name = Release; + name = "AdHoc-Mac"; }; - DAD9B5DF176299B9001835F9 /* Debug */ = { + DAD9B5DF176299B9001835F9 /* Debug-Mac */ = { isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_ENTITLEMENTS = "MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.entitlements"; - CODE_SIGN_IDENTITY = "Developer ID Application: Maarten Billemont"; + CODE_SIGN_IDENTITY = "Mac Developer: Maarten Billemont (DWGU95U4ZD)"; COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + /Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Mac, + ); INFOPLIST_FILE = "$(SRCROOT)/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper-Info.plist"; - PROVISIONING_PROFILE = ""; }; - name = Debug; + name = "Debug-Mac"; }; - DAD9B5E0176299B9001835F9 /* Release */ = { + DAD9B5E0176299B9001835F9 /* AdHoc-Mac */ = { isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_ENTITLEMENTS = "MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.entitlements"; + CODE_SIGN_IDENTITY = "Mac Developer: Maarten Billemont (DWGU95U4ZD)"; COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + /Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Mac, + ); INFOPLIST_FILE = "$(SRCROOT)/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper-Info.plist"; }; - name = Release; + name = "AdHoc-Mac"; }; /* End XCBuildConfiguration section */ @@ -297,20 +367,22 @@ DAD9B5BC176299B9001835F9 /* Build configuration list for PBXProject "MasterPassword-Mac-LoginHelper" */ = { isa = XCConfigurationList; buildConfigurations = ( - DAD9B5DC176299B9001835F9 /* Debug */, - DAD9B5DD176299B9001835F9 /* Release */, + DAD9B5DC176299B9001835F9 /* Debug-Mac */, + DAD9B5DD176299B9001835F9 /* AdHoc-Mac */, + DA3B845A1916AC5100246EEA /* AppStore-Mac */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = "AdHoc-Mac"; }; DAD9B5DE176299B9001835F9 /* Build configuration list for PBXNativeTarget "MasterPassword-Mac-LoginHelper" */ = { isa = XCConfigurationList; buildConfigurations = ( - DAD9B5DF176299B9001835F9 /* Debug */, - DAD9B5E0176299B9001835F9 /* Release */, + DAD9B5DF176299B9001835F9 /* Debug-Mac */, + DAD9B5E0176299B9001835F9 /* AdHoc-Mac */, + DA3B845B1916AC5100246EEA /* AppStore-Mac */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = "AdHoc-Mac"; }; /* End XCConfigurationList section */ }; diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj b/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj index 71e50721..be1a2a59 100644 --- a/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj +++ b/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj @@ -21,6 +21,12 @@ DA16B344170661EE000A0EAB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA16B343170661EE000A0EAB /* Cocoa.framework */; }; DA16B345170661F2000A0EAB /* libPearl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAC77CAD148291A600BCF976 /* libPearl.a */; }; DA1E4D50176E0E280065E0EF /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DA1E4D4F176E0E280065E0EF /* Media.xcassets */; }; + DA2CA4ED18D323D3007798F8 /* NSError+PearlFullDescription.m in Sources */ = {isa = PBXBuildFile; fileRef = DA2CA4E718D323D3007798F8 /* NSError+PearlFullDescription.m */; }; + DA2CA4EE18D323D3007798F8 /* NSError+PearlFullDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = DA2CA4E818D323D3007798F8 /* NSError+PearlFullDescription.h */; }; + DA2CA4EF18D323D3007798F8 /* NSArray+Pearl.m in Sources */ = {isa = PBXBuildFile; fileRef = DA2CA4E918D323D3007798F8 /* NSArray+Pearl.m */; }; + DA2CA4F018D323D3007798F8 /* NSArray+Pearl.h in Headers */ = {isa = PBXBuildFile; fileRef = DA2CA4EA18D323D3007798F8 /* NSArray+Pearl.h */; }; + DA2CA4F118D323D3007798F8 /* NSTimer+PearlBlock.m in Sources */ = {isa = PBXBuildFile; fileRef = DA2CA4EB18D323D3007798F8 /* NSTimer+PearlBlock.m */; }; + DA2CA4F218D323D3007798F8 /* NSTimer+PearlBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = DA2CA4EC18D323D3007798F8 /* NSTimer+PearlBlock.h */; }; DA30E9CE15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DA30E9CB15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h */; }; DA30E9CF15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = DA30E9CC15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m */; }; DA30E9D015722ECA00A68B4C /* Pearl.m in Sources */ = {isa = PBXBuildFile; fileRef = DA30E9CD15722ECA00A68B4C /* Pearl.m */; }; @@ -29,6 +35,10 @@ DA30E9D815723E6900A68B4C /* PearlLazy.m in Sources */ = {isa = PBXBuildFile; fileRef = DA30E9D615723E6900A68B4C /* PearlLazy.m */; }; DA3509FE15F101A500C14A8E /* PearlQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = DA3509FC15F101A500C14A8E /* PearlQueue.h */; }; DA3509FF15F101A500C14A8E /* PearlQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = DA3509FD15F101A500C14A8E /* PearlQueue.m */; }; + DA3B844F190FC60900246EEA /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA3B844A190FC5A900246EEA /* Crashlytics.framework */; }; + DA3B8452190FC86F00246EEA /* NSManagedObject+Pearl.m in Sources */ = {isa = PBXBuildFile; fileRef = DA3B8450190FC86F00246EEA /* NSManagedObject+Pearl.m */; }; + DA3B8453190FC86F00246EEA /* NSManagedObject+Pearl.h in Headers */ = {isa = PBXBuildFile; fileRef = DA3B8451190FC86F00246EEA /* NSManagedObject+Pearl.h */; }; + DA3B8456190FC89700246EEA /* MPFixable.m in Sources */ = {isa = PBXBuildFile; fileRef = DA3B8454190FC89700246EEA /* MPFixable.m */; }; DA3EF17B15A47744003ABF4E /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA3EF17A15A47744003ABF4E /* SenTestingKit.framework */; }; DA3EF17D15A47744003ABF4E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; }; DA4425CC1557BED40052177D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; }; @@ -109,9 +119,6 @@ DACA27361705DF81002C6C22 /* avatar-0@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DACA24561705DF7D002C6C22 /* avatar-0@2x.png */; }; DACA27371705DF81002C6C22 /* avatar-10@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DACA24571705DF7D002C6C22 /* avatar-10@2x.png */; }; DACA27381705DF81002C6C22 /* menu-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = DACA24581705DF7D002C6C22 /* menu-icon.png */; }; - DACA29641705DF81002C6C22 /* Exo-ExtraBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = DACA268B1705DF81002C6C22 /* Exo-ExtraBold.otf */; }; - DACA29651705DF81002C6C22 /* Exo-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = DACA268C1705DF81002C6C22 /* Exo-Regular.otf */; }; - DACA29661705DF81002C6C22 /* Exo-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = DACA268D1705DF81002C6C22 /* Exo-Bold.otf */; }; DACA29671705DF81002C6C22 /* SourceCodePro-ExtraLight.otf in Resources */ = {isa = PBXBuildFile; fileRef = DACA268E1705DF81002C6C22 /* SourceCodePro-ExtraLight.otf */; }; DACA29681705DF81002C6C22 /* SourceCodePro-Black.otf in Resources */ = {isa = PBXBuildFile; fileRef = DACA268F1705DF81002C6C22 /* SourceCodePro-Black.otf */; }; DACA296D1705DF81002C6C22 /* Localytics.plist in Resources */ = {isa = PBXBuildFile; fileRef = DACA26961705DF81002C6C22 /* Localytics.plist */; }; @@ -204,6 +211,10 @@ DAEB942818AB0FFD000490CC /* sysendian.h in Headers */ = {isa = PBXBuildFile; fileRef = DAEB93D718AB0FFD000490CC /* sysendian.h */; }; DAEB942918AB0FFD000490CC /* warn.h in Headers */ = {isa = PBXBuildFile; fileRef = DAEB93D818AB0FFD000490CC /* warn.h */; }; DAEB942E18B47FB3000490CC /* MPInitialWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA0933C91747A56A00DE1CEF /* MPInitialWindow.xib */; }; + DAF4EF56190A828100023C90 /* Exo2.0-Thin.otf in Resources */ = {isa = PBXBuildFile; fileRef = DAF4EF52190A828100023C90 /* Exo2.0-Thin.otf */; }; + DAF4EF57190A828100023C90 /* Exo2.0-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = DAF4EF53190A828100023C90 /* Exo2.0-Regular.otf */; }; + DAF4EF58190A828100023C90 /* Exo2.0-ExtraBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = DAF4EF54190A828100023C90 /* Exo2.0-ExtraBold.otf */; }; + DAF4EF59190A828100023C90 /* Exo2.0-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = DAF4EF55190A828100023C90 /* Exo2.0-Bold.otf */; }; DAFE4A1315039824003ABA7C /* NSObject+PearlExport.h in Headers */ = {isa = PBXBuildFile; fileRef = DAFE45D815039823003ABA7C /* NSObject+PearlExport.h */; }; DAFE4A1415039824003ABA7C /* NSObject+PearlExport.m in Sources */ = {isa = PBXBuildFile; fileRef = DAFE45D915039823003ABA7C /* NSObject+PearlExport.m */; }; DAFE4A1515039824003ABA7C /* NSString+PearlNSArrayFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = DAFE45DA15039823003ABA7C /* NSString+PearlNSArrayFormat.h */; }; @@ -308,6 +319,12 @@ DA16B340170661DB000A0EAB /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; DA16B343170661EE000A0EAB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; DA1E4D4F176E0E280065E0EF /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Media.xcassets; path = MasterPassword/Media.xcassets; sourceTree = ""; }; + DA2CA4E718D323D3007798F8 /* NSError+PearlFullDescription.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSError+PearlFullDescription.m"; sourceTree = ""; }; + DA2CA4E818D323D3007798F8 /* NSError+PearlFullDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSError+PearlFullDescription.h"; sourceTree = ""; }; + DA2CA4E918D323D3007798F8 /* NSArray+Pearl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Pearl.m"; sourceTree = ""; }; + DA2CA4EA18D323D3007798F8 /* NSArray+Pearl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Pearl.h"; sourceTree = ""; }; + DA2CA4EB18D323D3007798F8 /* NSTimer+PearlBlock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTimer+PearlBlock.m"; sourceTree = ""; }; + DA2CA4EC18D323D3007798F8 /* NSTimer+PearlBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTimer+PearlBlock.h"; sourceTree = ""; }; DA30E9CB15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+PearlMutableInfo.h"; sourceTree = ""; }; DA30E9CC15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+PearlMutableInfo.m"; sourceTree = ""; }; DA30E9CD15722ECA00A68B4C /* Pearl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Pearl.m; sourceTree = ""; }; @@ -316,6 +333,12 @@ DA30E9D615723E6900A68B4C /* PearlLazy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlLazy.m; sourceTree = ""; }; DA3509FC15F101A500C14A8E /* PearlQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlQueue.h; sourceTree = ""; }; DA3509FD15F101A500C14A8E /* PearlQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlQueue.m; sourceTree = ""; }; + DA3B8448190FC5A900246EEA /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = ""; }; + DA3B844A190FC5A900246EEA /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = ""; }; + DA3B8450190FC86F00246EEA /* NSManagedObject+Pearl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSManagedObject+Pearl.m"; sourceTree = ""; }; + DA3B8451190FC86F00246EEA /* NSManagedObject+Pearl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSManagedObject+Pearl.h"; sourceTree = ""; }; + DA3B8454190FC89700246EEA /* MPFixable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPFixable.m; sourceTree = ""; }; + DA3B8455190FC89700246EEA /* MPFixable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPFixable.h; sourceTree = ""; }; DA3EF17915A47744003ABF4E /* Tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; DA3EF17A15A47744003ABF4E /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; DA4425CB1557BED40052177D /* libUbiquityStoreManager.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libUbiquityStoreManager.a; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -381,7 +404,6 @@ DAC632871486D95D0075AEA5 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; DAC77CAD148291A600BCF976 /* libPearl.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPearl.a; sourceTree = BUILT_PRODUCTS_DIR; }; DAC77CB1148291A600BCF976 /* Pearl-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Pearl-Prefix.pch"; path = "../../MasterPassword/ObjC/Pearl/Pearl-Prefix.pch"; sourceTree = ""; }; - DACA22181705DE28002C6C22 /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = ""; }; DACA22B71705DE7D002C6C22 /* UbiquityStoreManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UbiquityStoreManager.m; sourceTree = ""; }; DACA22B81705DE7D002C6C22 /* NSError+UbiquityStoreManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSError+UbiquityStoreManager.h"; sourceTree = ""; }; DACA22B91705DE7D002C6C22 /* NSError+UbiquityStoreManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSError+UbiquityStoreManager.m"; sourceTree = ""; }; @@ -428,9 +450,6 @@ DACA24561705DF7D002C6C22 /* avatar-0@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "avatar-0@2x.png"; sourceTree = ""; }; DACA24571705DF7D002C6C22 /* avatar-10@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "avatar-10@2x.png"; sourceTree = ""; }; DACA24581705DF7D002C6C22 /* menu-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "menu-icon.png"; sourceTree = ""; }; - DACA268B1705DF81002C6C22 /* Exo-ExtraBold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo-ExtraBold.otf"; sourceTree = ""; }; - DACA268C1705DF81002C6C22 /* Exo-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo-Regular.otf"; sourceTree = ""; }; - DACA268D1705DF81002C6C22 /* Exo-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo-Bold.otf"; sourceTree = ""; }; DACA268E1705DF81002C6C22 /* SourceCodePro-ExtraLight.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SourceCodePro-ExtraLight.otf"; sourceTree = ""; }; DACA268F1705DF81002C6C22 /* SourceCodePro-Black.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SourceCodePro-Black.otf"; sourceTree = ""; }; DACA26961705DF81002C6C22 /* Localytics.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Localytics.plist; sourceTree = ""; }; @@ -524,6 +543,10 @@ DAEB93D718AB0FFD000490CC /* sysendian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sysendian.h; sourceTree = ""; }; DAEB93D818AB0FFD000490CC /* warn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = warn.h; sourceTree = ""; }; DAEBC45214F6364500987BF6 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + DAF4EF52190A828100023C90 /* Exo2.0-Thin.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo2.0-Thin.otf"; sourceTree = ""; }; + DAF4EF53190A828100023C90 /* Exo2.0-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo2.0-Regular.otf"; sourceTree = ""; }; + DAF4EF54190A828100023C90 /* Exo2.0-ExtraBold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo2.0-ExtraBold.otf"; sourceTree = ""; }; + DAF4EF55190A828100023C90 /* Exo2.0-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo2.0-Bold.otf"; sourceTree = ""; }; DAFE45D815039823003ABA7C /* NSObject+PearlExport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+PearlExport.h"; sourceTree = ""; }; DAFE45D915039823003ABA7C /* NSObject+PearlExport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+PearlExport.m"; sourceTree = ""; }; DAFE45DA15039823003ABA7C /* NSString+PearlNSArrayFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+PearlNSArrayFormat.h"; sourceTree = ""; }; @@ -598,6 +621,7 @@ DA16B341170661DB000A0EAB /* Carbon.framework in Frameworks */, DA16B342170661E0000A0EAB /* Security.framework in Frameworks */, DA16B345170661F2000A0EAB /* libPearl.a in Frameworks */, + DA3B844F190FC60900246EEA /* Crashlytics.framework in Frameworks */, DA16B344170661EE000A0EAB /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -631,6 +655,22 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + DA3B8447190FC5A900246EEA /* iOS */ = { + isa = PBXGroup; + children = ( + DA3B8448190FC5A900246EEA /* Crashlytics.framework */, + ); + path = iOS; + sourceTree = ""; + }; + DA3B8449190FC5A900246EEA /* Mac */ = { + isa = PBXGroup; + children = ( + DA3B844A190FC5A900246EEA /* Crashlytics.framework */, + ); + path = Mac; + sourceTree = ""; + }; DA5BFA39147E415C00F98B1E = { isa = PBXGroup; children = ( @@ -689,6 +729,8 @@ DA5E5C961724A667003798D8 /* ObjC */ = { isa = PBXGroup; children = ( + DA3B8454190FC89700246EEA /* MPFixable.m */, + DA3B8455190FC89700246EEA /* MPFixable.h */, DA5E5CB21724A667003798D8 /* Mac */, DA5E5C971724A667003798D8 /* MPAlgorithm.h */, DA5E5C981724A667003798D8 /* MPAlgorithm.m */, @@ -773,9 +815,10 @@ DACA22121705DDC5002C6C22 /* External */ = { isa = PBXGroup; children = ( + DA3B8447190FC5A900246EEA /* iOS */, + DA3B8449190FC5A900246EEA /* Mac */, DABC6C0E175D8CE1000C15D4 /* RHStatusItemView */, DACA29751705E2BD002C6C22 /* jrswizzle */, - DACA22181705DE28002C6C22 /* Crashlytics.framework */, DAC77CAF148291A600BCF976 /* Pearl */, DACA22B61705DE7D002C6C22 /* UbiquityStoreManager */, ); @@ -879,9 +922,10 @@ DACA268A1705DF81002C6C22 /* Fonts */ = { isa = PBXGroup; children = ( - DACA268B1705DF81002C6C22 /* Exo-ExtraBold.otf */, - DACA268C1705DF81002C6C22 /* Exo-Regular.otf */, - DACA268D1705DF81002C6C22 /* Exo-Bold.otf */, + DAF4EF52190A828100023C90 /* Exo2.0-Thin.otf */, + DAF4EF53190A828100023C90 /* Exo2.0-Regular.otf */, + DAF4EF54190A828100023C90 /* Exo2.0-ExtraBold.otf */, + DAF4EF55190A828100023C90 /* Exo2.0-Bold.otf */, DACA268E1705DF81002C6C22 /* SourceCodePro-ExtraLight.otf */, DACA268F1705DF81002C6C22 /* SourceCodePro-Black.otf */, ); @@ -1038,6 +1082,14 @@ DAFE45D715039823003ABA7C /* Pearl */ = { isa = PBXGroup; children = ( + DA3B8450190FC86F00246EEA /* NSManagedObject+Pearl.m */, + DA3B8451190FC86F00246EEA /* NSManagedObject+Pearl.h */, + DA2CA4E718D323D3007798F8 /* NSError+PearlFullDescription.m */, + DA2CA4E818D323D3007798F8 /* NSError+PearlFullDescription.h */, + DA2CA4E918D323D3007798F8 /* NSArray+Pearl.m */, + DA2CA4EA18D323D3007798F8 /* NSArray+Pearl.h */, + DA2CA4EB18D323D3007798F8 /* NSTimer+PearlBlock.m */, + DA2CA4EC18D323D3007798F8 /* NSTimer+PearlBlock.h */, DA3509FC15F101A500C14A8E /* PearlQueue.h */, DA3509FD15F101A500C14A8E /* PearlQueue.m */, 93D393B97158D7BE9332EA53 /* NSDictionary+Indexing.h */, @@ -1145,6 +1197,7 @@ DAEB93FD18AB0FFD000490CC /* mdc2.h in Headers */, DAEB942718AB0FFD000490CC /* sha256.h in Headers */, DAEB940818AB0FFD000490CC /* pkcs7.h in Headers */, + DA2CA4F218D323D3007798F8 /* NSTimer+PearlBlock.h in Headers */, DAEB93DF18AB0FFD000490CC /* bn.h in Headers */, DAEB940718AB0FFD000490CC /* pkcs12.h in Headers */, DAEB941A18AB0FFD000490CC /* txt_db.h in Headers */, @@ -1154,6 +1207,7 @@ DAEB941018AB0FFD000490CC /* seed.h in Headers */, DAEB942618AB0FFD000490CC /* scryptenc_cpuperf.h in Headers */, DAFE4A1715039824003ABA7C /* NSString+PearlSEL.h in Headers */, + DA3B8453190FC86F00246EEA /* NSManagedObject+Pearl.h in Headers */, DAEB93F518AB0FFD000490CC /* evp.h in Headers */, DAEB941918AB0FFD000490CC /* ts.h in Headers */, DAEB93F818AB0FFD000490CC /* krb5_asn.h in Headers */, @@ -1172,6 +1226,7 @@ DAFE4A2415039824003ABA7C /* PearlInfoPlist.h in Headers */, DAEB940618AB0FFD000490CC /* pem2.h in Headers */, DAFE4A2615039824003ABA7C /* PearlLogger.h in Headers */, + DA2CA4F018D323D3007798F8 /* NSArray+Pearl.h in Headers */, DAEB93FC18AB0FFD000490CC /* md5.h in Headers */, DAFE4A2815039824003ABA7C /* PearlMathUtils.h in Headers */, DAFE4A2A15039824003ABA7C /* PearlObjectUtils.h in Headers */, @@ -1242,6 +1297,7 @@ DAEB93DB18AB0FFD000490CC /* asn1_mac.h in Headers */, DAEB940518AB0FFD000490CC /* pem.h in Headers */, DAEB942818AB0FFD000490CC /* sysendian.h in Headers */, + DA2CA4EE18D323D3007798F8 /* NSError+PearlFullDescription.h in Headers */, DAEB93FF18AB0FFD000490CC /* obj_mac.h in Headers */, DAEB93E718AB0FFD000490CC /* crypto.h in Headers */, DAEB941318AB0FFD000490CC /* ssl2.h in Headers */, @@ -1295,9 +1351,9 @@ DA5BFA40147E415C00F98B1E /* Sources */, DA5BFA41147E415C00F98B1E /* Frameworks */, DA5BFA42147E415C00F98B1E /* Resources */, + DAD9B5EE1762CA3A001835F9 /* Copy LoginHelper */, DA6556E314D55F3000841C99 /* Run Script: GIT version -> Info.plist */, DAD3125D155288AA00A3F9ED /* Run Script: Crashlytics */, - DAD9B5EE1762CA3A001835F9 /* Copy LoginHelper */, ); buildRules = ( ); @@ -1434,9 +1490,11 @@ DACA27121705DF81002C6C22 /* avatar-13@2x.png in Resources */, DACA27131705DF81002C6C22 /* avatar-3@2x.png in Resources */, DACA27141705DF81002C6C22 /* avatar-7.png in Resources */, + DAF4EF57190A828100023C90 /* Exo2.0-Regular.otf in Resources */, DACA27151705DF81002C6C22 /* avatar-0.png in Resources */, DACA27161705DF81002C6C22 /* avatar-12.png in Resources */, DACA27171705DF81002C6C22 /* avatar-15.png in Resources */, + DAF4EF59190A828100023C90 /* Exo2.0-Bold.otf in Resources */, DACA27181705DF81002C6C22 /* avatar-9.png in Resources */, DACA27191705DF81002C6C22 /* avatar-1@2x.png in Resources */, DACA271A1705DF81002C6C22 /* avatar-11@2x.png in Resources */, @@ -1465,6 +1523,8 @@ DACA272F1705DF81002C6C22 /* avatar-3.png in Resources */, DACA27301705DF81002C6C22 /* avatar-18.png in Resources */, DACA27311705DF81002C6C22 /* avatar-4.png in Resources */, + DAF4EF58190A828100023C90 /* Exo2.0-ExtraBold.otf in Resources */, + DAF4EF56190A828100023C90 /* Exo2.0-Thin.otf in Resources */, DACA27321705DF81002C6C22 /* avatar-16.png in Resources */, DACA27331705DF81002C6C22 /* avatar-12@2x.png in Resources */, DACA27341705DF81002C6C22 /* avatar-2@2x.png in Resources */, @@ -1472,9 +1532,6 @@ DACA27361705DF81002C6C22 /* avatar-0@2x.png in Resources */, DACA27371705DF81002C6C22 /* avatar-10@2x.png in Resources */, DACA27381705DF81002C6C22 /* menu-icon.png in Resources */, - DACA29641705DF81002C6C22 /* Exo-ExtraBold.otf in Resources */, - DACA29651705DF81002C6C22 /* Exo-Regular.otf in Resources */, - DACA29661705DF81002C6C22 /* Exo-Bold.otf in Resources */, DACA29671705DF81002C6C22 /* SourceCodePro-ExtraLight.otf in Resources */, DACA29681705DF81002C6C22 /* SourceCodePro-Black.otf in Resources */, DACA296D1705DF81002C6C22 /* Localytics.plist in Resources */, @@ -1535,7 +1592,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = "/bin/bash -e"; - shellScript = "../../../External/Crashlytics.framework/run \\\n \"$(/usr/libexec/PlistBuddy -c \"Print :'API Key'\" ../../Resources/Crashlytics/Crashlytics.plist)\""; + shellScript = "../../../External/Mac/Crashlytics.framework/run \\\n \"$(/usr/libexec/PlistBuddy -c \"Print :'API Key'\" ../../Resources/Crashlytics/Crashlytics.plist)\""; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -1571,6 +1628,7 @@ DA5E5CFD1724A667003798D8 /* MPElementEntity.m in Sources */, DA5E5CFE1724A667003798D8 /* MPElementGeneratedEntity.m in Sources */, DA5E5CFF1724A667003798D8 /* MPElementStoredEntity.m in Sources */, + DA3B8456190FC89700246EEA /* MPFixable.m in Sources */, DA5E5D001724A667003798D8 /* MPEntities.m in Sources */, DA5E5D011724A667003798D8 /* MPKey.m in Sources */, DA5E5D021724A667003798D8 /* MPUserEntity.m in Sources */, @@ -1607,6 +1665,7 @@ DAFE4A1415039824003ABA7C /* NSObject+PearlExport.m in Sources */, DAFE4A1615039824003ABA7C /* NSString+PearlNSArrayFormat.m in Sources */, DAFE4A1815039824003ABA7C /* NSString+PearlSEL.m in Sources */, + DA2CA4ED18D323D3007798F8 /* NSError+PearlFullDescription.m in Sources */, DAFE4A1B15039824003ABA7C /* PearlAbstractStrings.m in Sources */, DAFE4A1F15039824003ABA7C /* PearlCodeUtils.m in Sources */, DAFE4A2115039824003ABA7C /* PearlConfig.m in Sources */, @@ -1622,8 +1681,11 @@ DAFE4A3915039824003ABA7C /* PearlRSAKey.m in Sources */, DAFE4A3B15039824003ABA7C /* PearlSCrypt.m in Sources */, DA30E9CF15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m in Sources */, + DA2CA4F118D323D3007798F8 /* NSTimer+PearlBlock.m in Sources */, + DA3B8452190FC86F00246EEA /* NSManagedObject+Pearl.m in Sources */, DA30E9D015722ECA00A68B4C /* Pearl.m in Sources */, DA30E9D215722EE500A68B4C /* Pearl-Crypto.m in Sources */, + DA2CA4EF18D323D3007798F8 /* NSArray+Pearl.m in Sources */, DA30E9D815723E6900A68B4C /* PearlLazy.m in Sources */, DAFE4A63150399FF003ABA86 /* NSObject+PearlKVO.m in Sources */, DAFE4A63150399FF003ABA92 /* NSDateFormatter+RFC3339.m in Sources */, @@ -1814,7 +1876,6 @@ CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( @@ -1867,7 +1928,6 @@ ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "${TARGET_NAME}"; - PROVISIONING_PROFILE = ""; SDKROOT = macosx; SKIP_INSTALL = YES; }; @@ -1894,7 +1954,6 @@ CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( @@ -1946,7 +2005,6 @@ MACOSX_DEPLOYMENT_TARGET = 10.8; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "${TARGET_NAME}"; - PROVISIONING_PROFILE = ""; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -1960,7 +2018,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_ENTITLEMENTS = MasterPassword.entitlements; + CODE_SIGN_IDENTITY = "Mac Developer: Maarten Billemont (DWGU95U4ZD)"; COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + /Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Mac, + ); GCC_PREFIX_HEADER = "MasterPassword-Prefix.pch"; INFOPLIST_FILE = "MasterPassword-Info.plist"; SKIP_INSTALL = NO; @@ -1974,7 +2037,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_ENTITLEMENTS = MasterPassword.entitlements; + CODE_SIGN_IDENTITY = "Developer ID Application: Maarten Billemont (HL3Q45LX9N)"; COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + /Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Mac, + ); GCC_PREFIX_HEADER = "MasterPassword-Prefix.pch"; INFOPLIST_FILE = "MasterPassword-Info.plist"; SKIP_INSTALL = NO; @@ -2003,7 +2071,6 @@ CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; - CODE_SIGN_IDENTITY = "Mac Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( @@ -2055,7 +2122,6 @@ MACOSX_DEPLOYMENT_TARGET = 10.8; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "${TARGET_NAME}"; - PROVISIONING_PROFILE = ""; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -2069,7 +2135,12 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_ENTITLEMENTS = MasterPassword.entitlements; + CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application: Maarten Billemont (HL3Q45LX9N)"; COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + /Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/Mac, + ); GCC_PREFIX_HEADER = "MasterPassword-Prefix.pch"; INFOPLIST_FILE = "MasterPassword-Info.plist"; SKIP_INSTALL = NO; diff --git a/MasterPassword/ObjC/iOS/MPAppSettingsViewController.h b/MasterPassword/ObjC/iOS/MPAppSettingsViewController.h new file mode 100644 index 00000000..937f0250 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPAppSettingsViewController.h @@ -0,0 +1,23 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPAppSettingsViewController.h +// MPAppSettingsViewController +// +// Created by lhunath on 2014-04-18. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import +#import "IASKAppSettingsViewController.h" + +@interface MPAppSettingsViewController : IASKAppSettingsViewController +@end diff --git a/MasterPassword/ObjC/iOS/MPAppSettingsViewController.m b/MasterPassword/ObjC/iOS/MPAppSettingsViewController.m new file mode 100644 index 00000000..37e48c40 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPAppSettingsViewController.m @@ -0,0 +1,63 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPAppSettingsViewController.h +// MPAppSettingsViewController +// +// Created by lhunath on 2014-04-18. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPAppSettingsViewController.h" +#import "UIColor+Expanded.h" + +@interface MPTableView:UITableView +@end + +@implementation MPTableView + +- (void)layoutSubviews { + + [super layoutSubviews]; +} + +- (void)setContentInset:(UIEdgeInsets)contentInset { + + [super setContentInset:contentInset]; +} + +@end + +@implementation MPAppSettingsViewController { +} + +- (void)viewWillAppear:(BOOL)animated { + + [super viewWillAppear:animated]; + + self.tableView.contentInset = UIEdgeInsetsMake( 64, 0, 49, 0 ); +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath]; + cell.backgroundColor = [UIColor clearColor]; + cell.textLabel.textColor = [UIColor whiteColor]; + + if (cell.selectionStyle != UITableViewCellSelectionStyleNone) { + cell.selectedBackgroundView = [[UIView alloc] initWithFrame:cell.bounds]; + cell.selectedBackgroundView.backgroundColor = [UIColor colorWithRGBAHex:0x78DDFB33]; + } + + return cell; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPAvatarCell.h b/MasterPassword/ObjC/iOS/MPAvatarCell.h new file mode 100644 index 00000000..b3429acb --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPAvatarCell.h @@ -0,0 +1,47 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPAvatarCell.h +// MPAvatarCell +// +// Created by lhunath on 2014-03-11. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import +#import "MPEntities.h" +@class MPAvatarCell; + +/* Avatar with a "+" symbol. */ +extern const long MPAvatarAdd; + +typedef NS_ENUM(NSUInteger, MPAvatarMode) { + MPAvatarModeLowered, + MPAvatarModeRaisedButInactive, + MPAvatarModeRaisedAndActive, + MPAvatarModeRaisedAndHidden, + MPAvatarModeRaisedAndMinimized, +}; + +@interface MPAvatarCell : UICollectionViewCell +@property (copy, nonatomic) NSString *name; +@property (assign, nonatomic) long avatar; +@property (assign, nonatomic) MPAvatarMode mode; +@property (assign, nonatomic) CGFloat visibility; +@property (assign, nonatomic) BOOL spinnerActive; +@property (assign, nonatomic, readonly) BOOL newUser; + ++ (NSString *)reuseIdentifier; + +- (void)setVisibility:(CGFloat)visibility animated:(BOOL)animated; +- (void)setMode:(MPAvatarMode)mode animated:(BOOL)animated; + +@end diff --git a/MasterPassword/ObjC/iOS/MPAvatarCell.m b/MasterPassword/ObjC/iOS/MPAvatarCell.m new file mode 100644 index 00000000..b8056be1 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPAvatarCell.m @@ -0,0 +1,287 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPAvatarCell.h +// MPAvatarCell +// +// Created by lhunath on 2014-03-11. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPAvatarCell.h" +#import "MPPasswordLargeCell.h" + +const long MPAvatarAdd = 10000; + +@interface MPAvatarCell() + +@property(strong, nonatomic) IBOutlet UIImageView *avatarImageView; +@property(strong, nonatomic) IBOutlet UILabel *nameLabel; +@property(strong, nonatomic) IBOutlet UIView *nameContainer; +@property(strong, nonatomic) IBOutlet UIImageView *spinner; +@property(strong, nonatomic) IBOutlet NSLayoutConstraint *nameToCenterConstraint; +@property(strong, nonatomic) IBOutlet NSLayoutConstraint *avatarSizeConstraint; +@property(strong, nonatomic) IBOutlet NSLayoutConstraint *avatarToTopConstraint; +@property(strong, nonatomic) IBOutlet NSLayoutConstraint *avatarRaisedConstraint; + +@end + +@implementation MPAvatarCell { + CAAnimationGroup *_targetedShadowAnimation; +} + ++ (NSString *)reuseIdentifier { + + return NSStringFromClass( self ); +} + +#pragma mark - Life cycle + +- (void)awakeFromNib { + + [super awakeFromNib]; + + self.alpha = 0; + + self.nameContainer.layer.cornerRadius = 5; + + self.avatarImageView.hidden = NO; + self.avatarImageView.layer.cornerRadius = self.avatarImageView.bounds.size.height / 2; + self.avatarImageView.layer.masksToBounds = NO; + self.avatarImageView.backgroundColor = [UIColor clearColor]; + + [self observeKeyPath:@"selected" withBlock:^(id from, id to, NSKeyValueChange cause, id _self) { + [_self updateAnimated:YES]; + }]; + [self observeKeyPath:@"highlighted" withBlock:^(id from, id to, NSKeyValueChange cause, id _self) { + [_self updateAnimated:YES]; + }]; + + CABasicAnimation *toShadowOpacityAnimation = [CABasicAnimation animationWithKeyPath:@"shadowOpacity"]; + toShadowOpacityAnimation.toValue = @0.2f; + toShadowOpacityAnimation.duration = 0.5f; + + CABasicAnimation *pulseShadowOpacityAnimation = [CABasicAnimation animationWithKeyPath:@"shadowOpacity"]; + pulseShadowOpacityAnimation.fromValue = @0.2f; + pulseShadowOpacityAnimation.toValue = @0.6f; + pulseShadowOpacityAnimation.beginTime = 0.5f; + pulseShadowOpacityAnimation.duration = 2.0f; + pulseShadowOpacityAnimation.autoreverses = YES; + pulseShadowOpacityAnimation.repeatCount = MAXFLOAT; + + _targetedShadowAnimation = [CAAnimationGroup new]; + _targetedShadowAnimation.animations = @[ toShadowOpacityAnimation, pulseShadowOpacityAnimation ]; + _targetedShadowAnimation.duration = MAXFLOAT; + self.avatarImageView.layer.shadowColor = [UIColor whiteColor].CGColor; + self.avatarImageView.layer.shadowOffset = CGSizeZero; +} + +- (void)prepareForReuse { + + [super prepareForReuse]; + + _newUser = NO; + [self setVisibility:0 animated:NO]; + [self setMode:MPAvatarModeLowered animated:NO]; + [self setSpinnerActive:NO animated:NO]; +} + +- (void)dealloc { + + [self removeKeyPathObservers]; +} + +#pragma mark - Properties + +- (void)setAvatar:(long)avatar { + + _avatar = avatar == MPAvatarAdd? MPAvatarAdd: (avatar + MPAvatarCount) % MPAvatarCount; + + if (_avatar == MPAvatarAdd) { + self.avatarImageView.image = [UIImage imageNamed:@"avatar-add"]; + self.name = strl( @"New User" ); + _newUser = YES; + } + else + self.avatarImageView.image = [UIImage imageNamed:strf( @"avatar-%ld", _avatar )]; +} + +- (NSString *)name { + + return self.nameLabel.text; +} + +- (void)setName:(NSString *)name { + + self.nameLabel.text = name; +} + +- (void)setVisibility:(CGFloat)visibility { + + [self setVisibility:visibility animated:YES]; +} + +- (void)setVisibility:(CGFloat)visibility animated:(BOOL)animated { + + _visibility = visibility; + + [self updateAnimated:animated]; +} + +- (void)setHighlighted:(BOOL)highlighted { + + super.highlighted = highlighted; + + [UIView animateWithDuration:0.1f animations:^{ + self.avatarImageView.transform = highlighted? CGAffineTransformMakeScale( 1.1f, 1.1f ): CGAffineTransformIdentity; + }]; +} + +- (void)setMode:(MPAvatarMode)mode { + + [self setMode:mode animated:YES]; +} + +- (void)setMode:(MPAvatarMode)mode animated:(BOOL)animated { + + _mode = mode; + + [self updateAnimated:animated]; +} + +- (void)setSpinnerActive:(BOOL)spinnerActive { + + [self setSpinnerActive:spinnerActive animated:YES]; +} + +- (void)setSpinnerActive:(BOOL)spinnerActive animated:(BOOL)animated { + + if (_spinnerActive == spinnerActive) + return; + _spinnerActive = spinnerActive; + + CABasicAnimation *rotate = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; + rotate.toValue = [NSNumber numberWithDouble:2 * M_PI]; + rotate.duration = 5.0; + + if (spinnerActive) { + rotate.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; + rotate.fromValue = @0.0; + rotate.repeatCount = MAXFLOAT; + } + else { + rotate.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; + rotate.repeatCount = 1; + } + + [self.spinner.layer removeAnimationForKey:@"rotation"]; + [self.spinner.layer addAnimation:rotate forKey:@"rotation"]; + + [self updateAnimated:animated]; +} + +#pragma mark - Private + +- (void)updateAnimated:(BOOL)animated { + + [UIView animateWithDuration:animated? 0.2f: 0 animations:^{ + self.avatarImageView.transform = CGAffineTransformIdentity; + }]; + [UIView animateWithDuration:animated? 0.3f: 0 delay:0 options:UIViewAnimationOptionOverrideInheritedDuration animations:^{ + self.alpha = 1; + + if (self.newUser) { + if (self.mode == MPAvatarModeLowered) + self.avatar = MPAvatarAdd; + else if (self.avatar == MPAvatarAdd) + self.avatar = arc4random() % MPAvatarCount; + } + + switch (self.mode) { + + case MPAvatarModeLowered: { + + self.avatarSizeConstraint.constant = self.avatarImageView.image.size.height; + self.avatarRaisedConstraint.priority = UILayoutPriorityDefaultLow; + self.avatarToTopConstraint.priority = UILayoutPriorityDefaultLow; + self.nameToCenterConstraint.priority = UILayoutPriorityDefaultLow; + self.nameContainer.alpha = self.visibility; + self.nameContainer.backgroundColor = [UIColor clearColor]; + self.avatarImageView.alpha = self.visibility / 0.7f + 0.3f; + self.avatarImageView.layer.shadowRadius = 15 * self.visibility * self.visibility; + break; + } + case MPAvatarModeRaisedButInactive: { + self.avatarSizeConstraint.constant = self.avatarImageView.image.size.height; + self.avatarRaisedConstraint.priority = UILayoutPriorityDefaultHigh; + self.avatarToTopConstraint.priority = UILayoutPriorityDefaultLow; + self.nameToCenterConstraint.priority = UILayoutPriorityDefaultLow; + self.nameContainer.alpha = self.visibility; + self.nameContainer.backgroundColor = [UIColor clearColor]; + self.avatarImageView.alpha = 0; + self.avatarImageView.layer.shadowRadius = 15 * self.visibility * self.visibility; + break; + } + case MPAvatarModeRaisedAndActive: { + self.avatarSizeConstraint.constant = self.avatarImageView.image.size.height; + self.avatarRaisedConstraint.priority = UILayoutPriorityDefaultHigh; + self.avatarToTopConstraint.priority = UILayoutPriorityDefaultLow; + self.nameToCenterConstraint.priority = UILayoutPriorityDefaultHigh; + self.nameContainer.alpha = self.visibility; + self.nameContainer.backgroundColor = [UIColor blackColor]; + self.avatarImageView.alpha = 1; + self.avatarImageView.layer.shadowRadius = 15 * self.visibility * self.visibility; + break; + } + case MPAvatarModeRaisedAndHidden: { + self.avatarSizeConstraint.constant = self.avatarImageView.image.size.height; + self.avatarRaisedConstraint.priority = UILayoutPriorityDefaultHigh; + self.avatarToTopConstraint.priority = UILayoutPriorityDefaultLow; + self.nameToCenterConstraint.priority = UILayoutPriorityDefaultHigh; + self.nameContainer.alpha = 0; + self.nameContainer.backgroundColor = [UIColor blackColor]; + self.avatarImageView.alpha = 0; + self.avatarImageView.layer.shadowRadius = 15 * self.visibility * self.visibility; + break; + } + case MPAvatarModeRaisedAndMinimized: { + self.avatarSizeConstraint.constant = 36; + self.avatarRaisedConstraint.priority = UILayoutPriorityDefaultLow; + self.avatarToTopConstraint.priority = UILayoutPriorityDefaultHigh; + self.nameToCenterConstraint.priority = UILayoutPriorityDefaultHigh; + self.nameContainer.alpha = 0; + self.nameContainer.backgroundColor = [UIColor blackColor]; + self.avatarImageView.alpha = 1; + break; + } + } + [self.avatarSizeConstraint apply]; + [self.avatarRaisedConstraint apply]; + [self.avatarToTopConstraint apply]; + [self.nameToCenterConstraint apply]; + + // Avatar minimized. + if (self.mode == MPAvatarModeRaisedAndMinimized) + [self.avatarImageView.layer removeAllAnimations]; + else if (![self.avatarImageView.layer animationForKey:@"targetedShadow"]) + [self.avatarImageView.layer addAnimation:_targetedShadowAnimation forKey:@"targetedShadow"]; + + // Avatar selection and spinner. + if (self.mode != MPAvatarModeRaisedAndMinimized && (self.selected || self.highlighted) && !self.spinnerActive) + self.avatarImageView.backgroundColor = self.avatarImageView.tintColor; + else + self.avatarImageView.backgroundColor = [UIColor clearColor]; + self.avatarImageView.layer.cornerRadius = self.avatarImageView.bounds.size.height / 2; + self.spinner.alpha = self.spinnerActive? 1: 0; + } completion:nil]; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPCell.h b/MasterPassword/ObjC/iOS/MPCell.h new file mode 100644 index 00000000..5a518452 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPCell.h @@ -0,0 +1,23 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPCell.h +// MPCell +// +// Created by lhunath on 2014-03-27. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import + +@interface MPCell : UICollectionViewCell + +@end diff --git a/MasterPassword/ObjC/iOS/MPCell.m b/MasterPassword/ObjC/iOS/MPCell.m new file mode 100644 index 00000000..e18e16ba --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPCell.m @@ -0,0 +1,24 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPCell.h +// MPCell +// +// Created by lhunath on 2014-03-27. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPCell.h" + +@implementation MPCell { +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPCoachmarkViewController.h b/MasterPassword/ObjC/iOS/MPCoachmarkViewController.h new file mode 100644 index 00000000..98e63497 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPCoachmarkViewController.h @@ -0,0 +1,48 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPCoachmarkViewController.h +// MPCoachmarkViewController +// +// Created by lhunath on 2014-04-22. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import + +@interface MPCoachmark : NSObject + +@property(nonatomic, strong) Class coachedClass; +@property(nonatomic) NSInteger coachedVersion; +@property(nonatomic) BOOL coached; + ++ (instancetype)coachmarkForClass:(Class)class version:(NSInteger)version; + +@end + +@interface MPCoachmarkViewController : UIViewController + +@property(nonatomic, strong) MPCoachmark *coachmark; +@property(nonatomic, strong) IBOutlet UIView *view0; +@property(nonatomic, strong) IBOutlet UIView *view1; +@property(nonatomic, strong) IBOutlet UIView *view2; +@property(nonatomic, strong) IBOutlet UIView *view3; +@property(nonatomic, strong) IBOutlet UIView *view4; +@property(nonatomic, strong) IBOutlet UIView *view5; +@property(nonatomic, strong) IBOutlet UIView *view6; +@property(nonatomic, strong) IBOutlet UIView *view7; +@property(nonatomic, strong) IBOutlet UIView *view8; +@property(nonatomic, strong) IBOutlet UIView *view9; +@property(nonatomic, strong) IBOutlet UIProgressView *viewProgress; + +- (IBAction)close:(id)sender; + +@end diff --git a/MasterPassword/ObjC/iOS/MPCoachmarkViewController.m b/MasterPassword/ObjC/iOS/MPCoachmarkViewController.m new file mode 100644 index 00000000..40c4ec87 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPCoachmarkViewController.m @@ -0,0 +1,104 @@ +/** +* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) +* +* See the enclosed file LICENSE for license information (LGPLv3). If you did +* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt +* +* @author Maarten Billemont +* @license http://www.gnu.org/licenses/lgpl-3.0.txt +*/ + +// +// MPCoachmarkViewController.h +// MPCoachmarkViewController +// +// Created by lhunath on 2014-04-22. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPCoachmarkViewController.h" + +@implementation MPCoachmarkViewController { + NSArray *_views; + NSUInteger _nextView; + __weak NSTimer *_viewTimer; +} + +- (void)viewDidLoad { + + [super viewDidLoad]; + + _views = [NSArray arrayWithObjects: + self.view0, self.view1, self.view2, self.view3, self.view4, self.view5, self.view6, self.view7, self.view8, self.view9, nil]; +} + +- (void)viewWillAppear:(BOOL)animated { + + [super viewWillAppear:animated]; + + self.viewProgress.hidden = NO; + self.viewProgress.progress = 0; + [_views makeObjectsPerformSelector:@selector( setAlpha: ) withObject:@0]; + _nextView = 0; +} + +- (void)viewDidAppear:(BOOL)animated { + + [super viewDidAppear:animated]; + + [UIView animateWithDuration:0.3f animations:^{ + [_views[_nextView++] setAlpha:1]; + }]; + + _viewTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 block:^(NSTimer *timer) { + self.viewProgress.progress += 1.0f / 50; + + if (self.viewProgress.progress == 1) + [UIView animateWithDuration:0.3f animations:^{ + self.viewProgress.progress = 0; + [_views[_nextView++] setAlpha:1]; + + if (_nextView >= [_views count]) { + [_viewTimer invalidate]; + self.viewProgress.hidden = YES; + } + }]; + } repeats:YES]; +} + +- (UIStatusBarStyle)preferredStatusBarStyle { + + return UIStatusBarStyleLightContent; +} + +- (IBAction)close:(id)sender { + + [self dismissViewControllerAnimated:YES completion:^{ + self.coachmark.coached = YES; + }]; +} + +@end + +@implementation MPCoachmark + ++ (instancetype)coachmarkForClass:(Class)coachedClass version:(NSInteger)coachedVersion { + + MPCoachmark *coachmark = [self new]; + coachmark.coachedClass = coachedClass; + coachmark.coachedVersion = coachedVersion; + + return coachmark; +} + +- (BOOL)coached { + + return [[NSUserDefaults standardUserDefaults] boolForKey:strf( @"%@.%ld.coached", self.coachedClass, (long)self.coachedVersion )]; +} + +- (void)setCoached:(BOOL)coached { + + [[NSUserDefaults standardUserDefaults] setBool:coached forKey:strf( @"%@.%ld.coached", self.coachedClass, (long)self.coachedVersion )]; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPCombinedViewController.h b/MasterPassword/ObjC/iOS/MPCombinedViewController.h new file mode 100644 index 00000000..43762f46 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPCombinedViewController.h @@ -0,0 +1,29 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPCombinedViewController.h +// MPCombinedViewController +// +// Created by lhunath on 2014-03-08. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +typedef NS_ENUM(NSUInteger, MPCombinedMode) { + MPCombinedModeUserSelection, + MPCombinedModePasswordSelection, +}; + +@interface MPCombinedViewController : UIViewController + +@property(assign, nonatomic) MPCombinedMode mode; +@property(strong, nonatomic) IBOutlet UIView *usersView; + +@end diff --git a/MasterPassword/ObjC/iOS/MPCombinedViewController.m b/MasterPassword/ObjC/iOS/MPCombinedViewController.m new file mode 100644 index 00000000..abaeb6c9 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPCombinedViewController.m @@ -0,0 +1,187 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPCombinedViewController.h +// MPCombinedViewController +// +// Created by lhunath on 2014-03-08. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPCombinedViewController.h" +#import "MPUsersViewController.h" +#import "MPPasswordsViewController.h" +#import "MPEmergencySegue.h" +#import "MPEmergencyViewController.h" +#import "MPPasswordsSegue.h" + +@interface MPCombinedViewController() + +@property(nonatomic, weak) MPUsersViewController *usersVC; +@property(nonatomic, weak) MPEmergencyViewController *emergencyVC; +@end + +@implementation MPCombinedViewController { + NSArray *_notificationObservers; + MPPasswordsViewController *_passwordsVC; +} + +- (void)viewDidLoad { + + [super viewDidLoad]; + + [self setMode:MPCombinedModeUserSelection animated:NO]; +} + +- (void)viewWillAppear:(BOOL)animated { + + [super viewWillAppear:animated]; + + [[self navigationController] setNavigationBarHidden:YES animated:animated]; +} + +- (void)viewDidAppear:(BOOL)animated { + + [super viewDidAppear:animated]; + + [self registerObservers]; +} + +- (void)viewWillDisappear:(BOOL)animated { + + [super viewWillDisappear:animated]; + + [self removeObservers]; +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + + if ([segue.identifier isEqualToString:@"users"]) + self.usersVC = segue.destinationViewController; + if ([segue.identifier isEqualToString:@"passwords"]) { + NSAssert([segue isKindOfClass:[MPPasswordsSegue class]], @"passwords segue should be MPPasswordsSegue: %@", segue); + NSAssert([sender isKindOfClass:[NSDictionary class]], @"sender should be dictionary: %@", sender); + NSAssert([[sender objectForKey:@"animated"] isKindOfClass:[NSNumber class]], @"sender should contain 'animated': %@", sender); + [(MPPasswordsSegue *)segue setAnimated:[sender[@"animated"] boolValue]]; + UIViewController *destinationVC = segue.destinationViewController; + _passwordsVC = [destinationVC isKindOfClass:[MPPasswordsViewController class]]? (MPPasswordsViewController *)destinationVC: nil; + } + if ([segue.identifier isEqualToString:@"emergency"]) + self.emergencyVC = segue.destinationViewController; +} + +- (BOOL)prefersStatusBarHidden { + + return self.mode == MPCombinedModeUserSelection; +} + +- (UIStatusBarStyle)preferredStatusBarStyle { + + return UIStatusBarStyleLightContent; +} + +- (BOOL)canBecomeFirstResponder { + + return YES; +} + +- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event { + + if (motion == UIEventSubtypeMotionShake && !self.emergencyVC) + [self performSegueWithIdentifier:@"emergency" sender:self]; +} + +- (UIStoryboardSegue *)segueForUnwindingToViewController:(UIViewController *)toViewController + fromViewController:(UIViewController *)fromViewController identifier:(NSString *)identifier { + + if ([identifier isEqualToString:@"unwind-emergency"]) { + MPEmergencySegue *segue = [[MPEmergencySegue alloc] initWithIdentifier:identifier + source:fromViewController destination:toViewController]; + segue.unwind = YES; + dbg_return(segue); + } + + dbg_return((id)nil); +} + +#pragma mark - Properties + +- (void)setMode:(MPCombinedMode)mode { + + [self setMode:mode animated:YES]; +} + +- (void)setMode:(MPCombinedMode)mode animated:(BOOL)animated { + + if (_mode == mode && animated) + return; + _mode = mode; + + [self setNeedsStatusBarAppearanceUpdate]; + [self becomeFirstResponder]; + [self.usersVC setNeedsStatusBarAppearanceUpdate]; + [self.usersVC.view setNeedsUpdateConstraints]; + [self.usersVC.view setNeedsLayout]; + + switch (self.mode) { + case MPCombinedModeUserSelection: { + self.usersView.userInteractionEnabled = YES; + [self.usersVC setActive:YES animated:animated]; + if (_passwordsVC) { + MPPasswordsSegue *segue = [[MPPasswordsSegue alloc] initWithIdentifier:@"passwords" source:_passwordsVC destination:self]; + [self prepareForSegue:segue sender:@{ @"animated" : @(animated) }]; + [segue perform]; + } + break; + } + case MPCombinedModePasswordSelection: { + self.usersView.userInteractionEnabled = NO; + [self.usersVC setActive:NO animated:animated]; + [self performSegueWithIdentifier:@"passwords" sender:@{ @"animated" : @(animated) }]; + break; + } + } +} + +#pragma mark - Private + +- (void)registerObservers { + + if ([_notificationObservers count]) + return; + + Weakify(self); + _notificationObservers = @[ + [[NSNotificationCenter defaultCenter] + addObserverForName:MPSignedInNotification object:nil + queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + Strongify(self); + + [self setMode:MPCombinedModePasswordSelection]; + }], + [[NSNotificationCenter defaultCenter] + addObserverForName:MPSignedOutNotification object:nil + queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + Strongify(self); + + [self setMode:MPCombinedModeUserSelection animated:[note.userInfo[@"animated"] boolValue]]; + }], + ]; +} + +- (void)removeObservers { + + for (id observer in _notificationObservers) + [[NSNotificationCenter defaultCenter] removeObserver:observer]; + _notificationObservers = nil; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPElementListAllViewController.m b/MasterPassword/ObjC/iOS/MPElementListAllViewController.m index 381f732f..6c46ff69 100644 --- a/MasterPassword/ObjC/iOS/MPElementListAllViewController.m +++ b/MasterPassword/ObjC/iOS/MPElementListAllViewController.m @@ -66,10 +66,11 @@ __weak MPElementListAllViewController *wSelf = self; [[MPiOSAppDelegate get] addElementNamed:[alert textFieldAtIndex:0].text completion:^(MPElementEntity *element) { - if (element) { - [wSelf.delegate didSelectElement:element]; - [wSelf close:nil]; - } + if (element) + PearlMainQueue( ^{ + [wSelf.delegate didSelectElement:element]; + [wSelf close:nil]; + } ); }]; } cancelTitle:[PearlStrings get].commonButtonCancel otherTitles:[PearlStrings get].commonButtonOkay, nil]; @@ -85,7 +86,7 @@ if (buttonIndex == [alert cancelButtonIndex]) return; - PearlOverlay *activity = [PearlOverlay showOverlayWithTitle:@"Upgrading Sites"]; + PearlOverlay *activity = [PearlOverlay showProgressOverlayWithTitle:@"Upgrading Sites"]; [self performUpgradeAllWithCompletion:^(BOOL success, NSDictionary *changes) { dispatch_async( dispatch_get_main_queue(), ^{ [self showUpgradeChanges:changes]; @@ -149,7 +150,7 @@ if (buttonIndex == [alert cancelButtonIndex]) return; - [PearlEMail sendEMailTo:nil subject:@"[Master Password] Upgrade Changes" body:formattedChanges]; + [PearlEMail sendEMailTo:nil fromVC:self subject:@"[Master Password] Upgrade Changes" body:formattedChanges]; } cancelTitle:@"Don't Email" otherTitles:@"Send Email", nil]; } diff --git a/MasterPassword/ObjC/iOS/MPElementListController.m b/MasterPassword/ObjC/iOS/MPElementListController.m index 444748ba..edf657c6 100644 --- a/MasterPassword/ObjC/iOS/MPElementListController.m +++ b/MasterPassword/ObjC/iOS/MPElementListController.m @@ -260,12 +260,9 @@ forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { NSManagedObjectID *elementOID = [self elementForTableIndexPath:indexPath].objectID; [MPiOSAppDelegate managedObjectContextPerformBlockAndWait:^(NSManagedObjectContext *context) { - NSError *error = nil; - MPElementEntity *element = (MPElementEntity *)[context existingObjectWithID:elementOID error:&error]; - if (!element) { - err(@"Failed to retrieve element to delete: %@", error); + MPElementEntity *element = [MPElementEntity existingObjectWithID:elementOID inContext:context]; + if (!element) return; - } inf(@"Deleting element: %@", element.name); [context deleteObject:element]; diff --git a/MasterPassword/ObjC/iOS/MPElementListSearchController.m b/MasterPassword/ObjC/iOS/MPElementListSearchController.m index 1572a32e..88b04629 100644 --- a/MasterPassword/ObjC/iOS/MPElementListSearchController.m +++ b/MasterPassword/ObjC/iOS/MPElementListSearchController.m @@ -105,7 +105,7 @@ UISearchBar *searchBar = self.searchDisplayController.searchBar; CGRect searchBarFrame = searchBar.frame; - [searchBar.superview enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) { + [searchBar.superview enumerateViews:^(UIView *subview, BOOL *stop, BOOL *recurse) { if ([subview isKindOfClass:[UIControl class]] && CGPointEqualToPoint( @@ -118,7 +118,7 @@ *stop = YES; } - } recurse:NO]; + } recurse:NO]; } - (BOOL)newSiteSectionNeeded { @@ -193,7 +193,7 @@ NSString *query = [self.searchDisplayController.searchBar.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; cell.textLabel.text = query; cell.detailTextLabel.text = PearlString( @"New site: %@", - [MPAlgorithmDefault shortNameOfType:[[[MPiOSAppDelegate get] activeUserForMainThread] defaultType]] ); + [MPAlgorithmDefault shortNameOfType:[[MPiOSAppDelegate get] activeUserForMainThread].defaultType] ); } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { @@ -220,7 +220,9 @@ __weak MPElementListController *wSelf = self; [[MPiOSAppDelegate get] addElementNamed:siteName completion:^(MPElementEntity *element) { if (element) - [wSelf.delegate didSelectElement:element]; + PearlMainQueue( ^{ + [wSelf.delegate didSelectElement:element]; + } ); }]; } cancelTitle:[PearlStrings get].commonButtonCancel otherTitles:[PearlStrings get].commonButtonYes, nil]; } diff --git a/MasterPassword/ObjC/iOS/MPEmergencySegue.h b/MasterPassword/ObjC/iOS/MPEmergencySegue.h new file mode 100644 index 00000000..b527d467 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPEmergencySegue.h @@ -0,0 +1,24 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPEmergencySegue.h +// MPEmergencySegue +// +// Created by lhunath on 2014-04-09. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import + +@interface MPEmergencySegue : UIStoryboardSegue + +@property(nonatomic) BOOL unwind; +@end diff --git a/MasterPassword/ObjC/iOS/MPEmergencySegue.m b/MasterPassword/ObjC/iOS/MPEmergencySegue.m new file mode 100644 index 00000000..1bef02c3 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPEmergencySegue.m @@ -0,0 +1,57 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPEmergencySegue.h +// MPEmergencySegue +// +// Created by lhunath on 2014-04-09. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPEmergencySegue.h" + +@implementation MPEmergencySegue { +} + +- (void)perform { + + UIViewController *sourceViewController = self.sourceViewController; + UIViewController *destinationViewController = self.destinationViewController; + + if (!self.unwind) { + // Winding + [sourceViewController addChildViewController:destinationViewController]; + [sourceViewController.view addSubview:destinationViewController.view]; + CGRectSetY(destinationViewController.view.bounds, sourceViewController.view.frame.size.height); + [UIView transitionWithView:sourceViewController.view duration:0.3f options:UIViewAnimationOptionAllowAnimatedContent + animations:^{ + CGRectSetY(destinationViewController.view.bounds, 0); + } completion:^(BOOL finished) { + if (finished) + [destinationViewController didMoveToParentViewController:sourceViewController]; + }]; + } + else { + // Unwinding + [sourceViewController willMoveToParentViewController:nil]; + [UIView transitionWithView:sourceViewController.parentViewController.view duration:0.3f options:UIViewAnimationOptionAllowAnimatedContent + animations:^{ + CGRectSetY(sourceViewController.view.bounds, sourceViewController.parentViewController.view.frame.size.height); + } completion:^(BOOL finished) { + if (finished) { + [sourceViewController.view removeFromSuperview]; + [sourceViewController removeFromParentViewController]; + } + }]; + } +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPEmergencyViewController.h b/MasterPassword/ObjC/iOS/MPEmergencyViewController.h new file mode 100644 index 00000000..b2eea923 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPEmergencyViewController.h @@ -0,0 +1,38 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPCombinedViewController.h +// MPCombinedViewController +// +// Created by lhunath on 2014-03-08. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "LLGitTip.h" + +@interface MPEmergencyViewController : UIViewController + +@property(weak, nonatomic) IBOutlet UIView *dialogView; +@property(weak, nonatomic) IBOutlet UIView *containerView; +@property(weak, nonatomic) IBOutlet UITextField *userNameField; +@property(weak, nonatomic) IBOutlet UITextField *masterPasswordField; +@property(weak, nonatomic) IBOutlet UITextField *siteField; +@property(weak, nonatomic) IBOutlet UIStepper *counterStepper; +@property(weak, nonatomic) IBOutlet UISegmentedControl *typeControl; +@property(weak, nonatomic) IBOutlet UILabel *counterLabel; +@property(weak, nonatomic) IBOutlet UIActivityIndicatorView *activity; +@property(weak, nonatomic) IBOutlet UILabel *passwordLabel; +@property(weak, nonatomic) IBOutlet UIView *tipContainer; + +- (IBAction)controlChanged:(UIControl *)control; +- (IBAction)copyPassword:(UITapGestureRecognizer *)recognizer; + +@end diff --git a/MasterPassword/ObjC/iOS/MPEmergencyViewController.m b/MasterPassword/ObjC/iOS/MPEmergencyViewController.m new file mode 100644 index 00000000..1f86f655 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPEmergencyViewController.m @@ -0,0 +1,202 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPCombinedViewController.h +// MPCombinedViewController +// +// Created by lhunath on 2014-03-08. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPEmergencyViewController.h" +#import "MPEntities.h" + +@implementation MPEmergencyViewController { + MPKey *_key; + NSOperationQueue *_emergencyKeyQueue; + NSOperationQueue *_emergencyPasswordQueue; + NSArray *_notificationObservers; +} + +- (void)viewDidLoad { + + [super viewDidLoad]; + + [_emergencyKeyQueue = [NSOperationQueue new] setMaxConcurrentOperationCount:1]; + [_emergencyPasswordQueue = [NSOperationQueue new] setMaxConcurrentOperationCount:1]; + + self.view.backgroundColor = [UIColor clearColor]; + self.dialogView.layer.cornerRadius = 5; +} + +- (void)viewWillAppear:(BOOL)animated { + + [super viewWillAppear:animated]; + + [self reset]; + [self registerObservers]; +} + +- (void)viewDidDisappear:(BOOL)animated { + + [super viewDidDisappear:animated]; + + [self removeObservers]; + [self reset]; +} + +- (BOOL)canPerformUnwindSegueAction:(SEL)action fromViewController:(UIViewController *)fromViewController withSender:(id)sender { + + return [self respondsToSelector:action]; +} + +#pragma mark - Actions + +- (IBAction)unwindToCombined:(UIStoryboardSegue *)sender { + + dbg(@"unwindToCombined:%@", sender); +} + +#pragma mark - UITextFieldDelegate + +- (BOOL)textFieldShouldReturn:(UITextField *)textField { + + [textField resignFirstResponder]; + return YES; +} + +#pragma mark - Actions + +- (IBAction)controlChanged:(UIControl *)control { + + if (control == self.userNameField || control == self.masterPasswordField) + [self updateKey]; + else + [self updatePassword]; +} + +- (IBAction)copyPassword:(UITapGestureRecognizer *)recognizer { + + if (recognizer.state == UIGestureRecognizerStateEnded) { + NSString *sitePassword = self.passwordLabel.text; + if ([sitePassword length]) { + [UIPasteboard generalPasteboard].string = sitePassword; + [UIView animateWithDuration:0.3f animations:^{ + self.tipContainer.alpha = 1; + } completion:^(BOOL finished) { + if (finished) + PearlMainQueueAfter( 3, ^{ + self.tipContainer.alpha = 0; + } ); + }]; + } + } +} + +#pragma mark - Private + +- (void)updateKey { + + NSString *userName = self.userNameField.text; + NSString *masterPassword = self.masterPasswordField.text; + + self.passwordLabel.text = nil; + [self.activity startAnimating]; + [_emergencyKeyQueue cancelAllOperations]; + [_emergencyKeyQueue addOperationWithBlock:^{ + if ([masterPassword length] && [userName length]) + _key = [MPAlgorithmDefault keyForPassword:masterPassword ofUserNamed:userName]; + else + _key = nil; + + PearlMainQueue( ^{ + [self updatePassword]; + } ); + }]; +} + +- (void)updatePassword { + + NSString *siteName = self.siteField.text; + MPElementType siteType = [self siteType]; + NSUInteger siteCounter = (NSUInteger)self.counterStepper.value; + self.counterLabel.text = strf( @"%lu", (unsigned long)siteCounter ); + + self.passwordLabel.text = nil; + [self.activity startAnimating]; + [_emergencyPasswordQueue cancelAllOperations]; + [_emergencyPasswordQueue addOperationWithBlock:^{ + NSString *sitePassword = nil; + if (_key && [siteName length]) + sitePassword = [MPAlgorithmDefault generateContentNamed:siteName ofType:siteType withCounter:siteCounter usingKey:_key]; + + PearlMainQueue( ^{ + [self.activity stopAnimating]; + self.passwordLabel.text = sitePassword; + } ); + }]; +} + +- (enum MPElementType)siteType { + + switch (self.typeControl.selectedSegmentIndex) { + case 0: + return MPElementTypeGeneratedMaximum; + case 1: + return MPElementTypeGeneratedLong; + case 2: + return MPElementTypeGeneratedMedium; + case 3: + return MPElementTypeGeneratedBasic; + case 4: + return MPElementTypeGeneratedShort; + case 5: + return MPElementTypeGeneratedPIN; + default: + Throw(@"Unsupported type index: %ld", (long)self.typeControl.selectedSegmentIndex); + } +} + +- (void)reset { + + self.userNameField.text = nil; + self.masterPasswordField.text = nil; + self.siteField.text = nil; + self.counterStepper.value = 1; + self.typeControl.selectedSegmentIndex = 1; + [self updateKey]; +} + +- (void)registerObservers { + + if ([_notificationObservers count]) + return; + + Weakify(self); + _notificationObservers = @[ + [[NSNotificationCenter defaultCenter] + addObserverForName:UIApplicationWillResignActiveNotification object:nil + queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + Strongify(self); + + [self performSegueWithIdentifier:@"unwind-emergency" sender:self]; + }], + ]; +} + +- (void)removeObservers { + + for (id observer in _notificationObservers) + [[NSNotificationCenter defaultCenter] removeObserver:observer]; + _notificationObservers = nil; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPLogsViewController.m b/MasterPassword/ObjC/iOS/MPLogsViewController.m index 81bb8c04..66829353 100644 --- a/MasterPassword/ObjC/iOS/MPLogsViewController.m +++ b/MasterPassword/ObjC/iOS/MPLogsViewController.m @@ -28,12 +28,12 @@ [super viewDidLoad]; + self.view.backgroundColor = [UIColor clearColor]; + [[NSNotificationCenter defaultCenter] addObserverForName:NSUserDefaultsDidChangeNotification object:nil - queue:nil usingBlock: + queue:[NSOperationQueue mainQueue] usingBlock: ^(NSNotification *note) { - dispatch_async( dispatch_get_main_queue(), ^{ - self.levelControl.selectedSegmentIndex = [[MPiOSConfig get].traceMode boolValue]? 1: 0; - } ); + self.levelControl.selectedSegmentIndex = [[MPiOSConfig get].traceMode boolValue]? 1: 0; }]; } @@ -41,6 +41,8 @@ [super viewWillAppear:animated]; + self.logView.contentInset = UIEdgeInsetsMake( 64, 0, 93, 0 ); + [self refresh:nil]; self.levelControl.selectedSegmentIndex = [[MPiOSConfig get].traceMode boolValue]? 1: 0; @@ -62,7 +64,7 @@ if (buttonIndex_ == alert.cancelButtonIndex) return; - _switchCloudStoreProgress = [PearlOverlay showOverlayWithTitle:@"Enumerating Stores"]; + _switchCloudStoreProgress = [PearlOverlay showProgressOverlayWithTitle:@"Enumerating Stores"]; dispatch_async( dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0 ), ^{ [self switchCloudStore]; } ); @@ -105,8 +107,10 @@ - (void)switchCloudStore { NSDictionary *cloudStores = [[MPiOSAppDelegate get].storeManager enumerateCloudStores]; - if (!cloudStores) - wrn(@"Failed enumerating cloud stores."); + if (!cloudStores) { + wrn( @"Failed enumerating cloud stores." ); + return; + } NSString *currentStoreUUID = nil; NSMutableDictionary *stores = [NSMutableDictionary dictionary]; diff --git a/MasterPassword/ObjC/iOS/MPMainViewController.m b/MasterPassword/ObjC/iOS/MPMainViewController.m index 88dfeed9..e862deb9 100644 --- a/MasterPassword/ObjC/iOS/MPMainViewController.m +++ b/MasterPassword/ObjC/iOS/MPMainViewController.m @@ -715,11 +715,6 @@ [self setHelpHidden:NO animated:YES]; break; } - case 1: { - inf(@"Action: Guide"); - [[MPiOSAppDelegate get] showGuide]; - break; - } case 2: { inf(@"Action: Preferences"); [self performSegueWithIdentifier:@"MP_UserProfile" sender:self]; @@ -776,7 +771,7 @@ @"If you continue, the password for this site will change. " @"You will need to update your account's old password to the new one." do:^BOOL(MPElementEntity *activeElement, NSManagedObjectContext *context) { - _activeElementOID = [[MPiOSAppDelegate get] changeElement:activeElement inContext:context + _activeElementOID = [[MPiOSAppDelegate get] changeElement:activeElement saveInContext:context toType:type].objectID; return YES; }]; diff --git a/MasterPassword/ObjC/iOS/MPPasswordCell.h b/MasterPassword/ObjC/iOS/MPPasswordCell.h new file mode 100644 index 00000000..5eba3dbe --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordCell.h @@ -0,0 +1,28 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPAvatarCell.h +// MPAvatarCell +// +// Created by lhunath on 2014-03-11. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import +#import "MPEntities.h" +#import "MPCell.h" + +@interface MPPasswordCell : MPCell + +/** Populate our UI to reflect the current state. */ +- (void)updateAnimated:(BOOL)animated; + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordCell.m b/MasterPassword/ObjC/iOS/MPPasswordCell.m new file mode 100644 index 00000000..2c69f422 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordCell.m @@ -0,0 +1,75 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPAvatarCell.h +// MPAvatarCell +// +// Created by lhunath on 2014-03-11. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPPasswordCell.h" +#import "MPiOSAppDelegate.h" +#import "MPAppDelegate_Store.h" + +@implementation MPPasswordCell + +#pragma mark - Life cycle + +- (void)prepareForReuse { + + [super prepareForReuse]; + [self updateAnimated:NO]; +} + +// Unblocks animations for all CALayer properties (eg. shadowOpacity) +- (id)actionForLayer:(CALayer *)layer forKey:(NSString *)event { + + id defaultAction = [super actionForLayer:layer forKey:event]; + if (defaultAction == (id)[NSNull null] && [event isEqualToString:@"position"]) + return defaultAction; + + return NSNullToNil(defaultAction); +} + +#pragma mark - Properties + +- (void)setSelected:(BOOL)selected { + + [super setSelected:selected]; + + [self updateAnimated:YES]; +} + +- (void)setHighlighted:(BOOL)highlighted { + + [super setHighlighted:highlighted]; + + [self updateAnimated:YES]; +} + +#pragma mark - Private + +- (void)updateAnimated:(BOOL)animated { + + if (![NSThread isMainThread]) { + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + [self updateAnimated:animated]; + }]; + return; + } + + [UIView animateWithDuration:animated? 0.3f: 0 animations:^{ + self.layer.shadowOpacity = self.selected? 1: self.highlighted? 0.3f: 0; + }]; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordLargeCell.h b/MasterPassword/ObjC/iOS/MPPasswordLargeCell.h new file mode 100644 index 00000000..c3bae0e8 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordLargeCell.h @@ -0,0 +1,50 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPAvatarCell.h +// MPAvatarCell +// +// Created by lhunath on 2014-03-11. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import +#import "MPEntities.h" +#import "MPCell.h" +#import "MPPasswordCell.h" + +typedef NS_ENUM (NSUInteger, MPContentFieldMode) { + MPContentFieldModePassword, + MPContentFieldModeUser, +}; + +@interface MPPasswordLargeCell : MPPasswordCell + +@property(nonatomic) MPElementType type; +@property(nonatomic) MPContentFieldMode contentFieldMode; +@property(nonatomic, strong) IBOutlet UILabel *typeLabel; +@property(nonatomic, strong) IBOutlet UITextField *contentField; +@property(nonatomic, strong) IBOutlet UIButton *upgradeButton; +@property(nonatomic, strong) IBOutlet UILabel *nameLabel; +@property(nonatomic, strong) IBOutlet UIButton *loginButton; + ++ (instancetype)dequeueCellWithType:(MPElementType)type fromCollectionView:(UICollectionView *)collectionView atIndexPath:(NSIndexPath *)indexPath; + +- (void)update; +- (void)updateWithElement:(MPElementEntity *)mainElement; +- (void)updateWithTransientSite:(NSString *)siteName; + +- (void)resolveContentOfCellTypeForTransientSite:(NSString *)siteName usingKey:(MPKey *)key result:(void (^)(NSString *))resultBlock; +- (void)resolveContentOfCellTypeForElement:(MPElementEntity *)element usingKey:(MPKey *)key result:(void (^)(NSString *))resultBlock; + +- (MPElementEntity *)saveContentTypeWithElement:(MPElementEntity *)element saveInContext:(NSManagedObjectContext *)context; + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordLargeCell.m b/MasterPassword/ObjC/iOS/MPPasswordLargeCell.m new file mode 100644 index 00000000..0f9cedb3 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordLargeCell.m @@ -0,0 +1,235 @@ +/** +* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) +* +* See the enclosed file LICENSE for license information (LGPLv3). If you did +* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt +* +* @author Maarten Billemont +* @license http://www.gnu.org/licenses/lgpl-3.0.txt +*/ + +// +// MPAvatarCell.h +// MPAvatarCell +// +// Created by lhunath on 2014-03-11. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPPasswordLargeCell.h" +#import "MPiOSAppDelegate.h" +#import "MPAppDelegate_Store.h" +#import "MPPasswordLargeGeneratedCell.h" +#import "MPPasswordLargeStoredCell.h" +#import "MPPasswordTypesCell.h" + +@implementation MPPasswordLargeCell + +#pragma mark - Life + ++ (instancetype)dequeueCellWithType:(MPElementType)type fromCollectionView:(UICollectionView *)collectionView + atIndexPath:(NSIndexPath *)indexPath { + + NSString *reuseIdentifier; + if (type & MPElementTypeClassGenerated) + reuseIdentifier = NSStringFromClass( [MPPasswordLargeGeneratedCell class] ); + else if (type & MPElementTypeClassStored) + reuseIdentifier = NSStringFromClass( [MPPasswordLargeStoredCell class] ); + else + Throw( @"Unexpected password type: %@", [MPAlgorithmDefault nameOfType:type] ); + + MPPasswordLargeCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:reuseIdentifier forIndexPath:indexPath]; + cell.type = type; + + return cell; +} + +- (void)awakeFromNib { + + [super awakeFromNib]; + + self.layer.cornerRadius = 5; + self.layer.shadowOffset = CGSizeZero; + self.layer.shadowRadius = 5; + self.layer.shadowOpacity = 0; + self.layer.shadowColor = [UIColor whiteColor].CGColor; + + [self prepareForReuse]; +} + +- (void)prepareForReuse { + + _contentFieldMode = 0; + self.contentField.text = nil; + + [super prepareForReuse]; +} + +- (void)update { + + self.loginButton.alpha = 0; + self.upgradeButton.alpha = 0; + self.nameLabel.text = @""; + self.typeLabel.text = @""; + self.contentField.text = @""; + self.contentField.placeholder = nil; + self.contentField.enabled = self.contentFieldMode == MPContentFieldModeUser; + self.loginButton.selected = self.contentFieldMode == MPContentFieldModeUser; + + switch (self.contentFieldMode) { + case MPContentFieldModePassword: { + if (self.type & MPElementTypeClassStored) + self.contentField.placeholder = strl( @"Set custom password" ); + else if (self.type & MPElementTypeClassGenerated) + self.contentField.placeholder = strl( @"Generating..." ); + break; + } + case MPContentFieldModeUser: { + self.contentField.placeholder = strl( @"Enter your login name" ); + break; + } + } +} + +- (void)updateWithTransientSite:(NSString *)siteName { + + [self update]; + + self.nameLabel.text = strl( @"%@ - Tap to create", siteName ); + self.typeLabel.text = [MPAlgorithmDefault nameOfType:self.type]; + + [self resolveContentOfCellTypeForTransientSite:siteName usingKey:[MPiOSAppDelegate get].key result:^(NSString *string) { + PearlMainQueue( ^{ self.contentField.text = string; } ); + }]; +} + +- (void)updateWithElement:(MPElementEntity *)mainElement { + + [self update]; + + if (!mainElement) + return; + + self.loginButton.alpha = 1; + if (mainElement.requiresExplicitMigration) + self.upgradeButton.alpha = 1; + + self.nameLabel.text = mainElement.name; + if (self.type == (MPElementType)NSNotFound) + self.typeLabel.text = @"Delete"; + else + self.typeLabel.text = [mainElement.algorithm nameOfType:self.type]; + + switch (self.contentFieldMode) { + case MPContentFieldModePassword: { + MPKey *key = [MPiOSAppDelegate get].key; + if (self.type == mainElement.type) + [mainElement resolveContentUsingKey:key result:^(NSString *string) { + PearlMainQueue( ^{ self.contentField.text = string; } ); + }]; + else + [self resolveContentOfCellTypeForElement:mainElement usingKey:key result:^(NSString *string) { + PearlMainQueue( ^{ self.contentField.text = string; } ); + }]; + break; + } + case MPContentFieldModeUser: { + self.contentField.text = mainElement.loginName; + break; + } + } +} + +- (void)resolveContentOfCellTypeForTransientSite:(NSString *)siteName usingKey:(MPKey *)key result:(void ( ^ )(NSString *))resultBlock { + + resultBlock( nil ); +} + +- (void)resolveContentOfCellTypeForElement:(MPElementEntity *)element usingKey:(MPKey *)key result:(void ( ^ )(NSString *))resultBlock { + + resultBlock( nil ); +} + +- (MPElementEntity *)saveContentTypeWithElement:(MPElementEntity *)element saveInContext:(NSManagedObjectContext *)context { + + return [[MPiOSAppDelegate get] changeElement:element saveInContext:context toType:self.type]; +} + +#pragma mark - UITextFieldDelegate + +- (BOOL)textFieldShouldReturn:(UITextField *)textField { + + [textField resignFirstResponder]; + return YES; +} + +- (void)textFieldDidEndEditing:(UITextField *)textField { + + if (textField == self.contentField) { + NSString *newContent = textField.text; + textField.enabled = NO; + + if (self.contentFieldMode == MPContentFieldModeUser) + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + MPElementEntity *element = [[MPPasswordTypesCell findAsSuperviewOf:self] elementInContext:context]; + if (!element) + return; + + element.loginName = newContent; + [context saveToStore]; + + PearlMainQueue( ^{ + [self updateAnimated:YES]; + [PearlOverlay showTemporaryOverlayWithTitle:@"Login Updated" dismissAfter:2]; + } ); + }]; + } +} + +#pragma mark - Actions + +- (IBAction)doUser:(id)sender { + + switch (self.contentFieldMode) { + case MPContentFieldModePassword: { + self.contentFieldMode = MPContentFieldModeUser; + break; + } + case MPContentFieldModeUser: { + self.contentFieldMode = MPContentFieldModePassword; + break; + } + } +} + +- (IBAction)doUpgrade:(UIButton *)sender { + + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + if ([[[MPPasswordTypesCell findAsSuperviewOf:self] elementInContext:context] migrateExplicitly:YES]) { + [context saveToStore]; + + PearlMainQueue( ^{ + [[MPPasswordTypesCell findAsSuperviewOf:self] reloadData]; + [PearlOverlay showTemporaryOverlayWithTitle:@"Site Upgraded" dismissAfter:2]; + } ); + } + else + PearlMainQueue( ^{ + [PearlOverlay showTemporaryOverlayWithTitle:@"Site Not Upgraded" dismissAfter:2]; + } ); + }]; +} + +#pragma mark - Properties + +- (void)setContentFieldMode:(MPContentFieldMode)contentFieldMode { + + if (_contentFieldMode == contentFieldMode) + return; + + _contentFieldMode = contentFieldMode; + + [[MPPasswordTypesCell findAsSuperviewOf:self] reloadData]; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordLargeDeleteCell.h b/MasterPassword/ObjC/iOS/MPPasswordLargeDeleteCell.h new file mode 100644 index 00000000..03add62f --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordLargeDeleteCell.h @@ -0,0 +1,24 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPPasswordLargeDeleteCell.h +// MPPasswordLargeDeleteCell +// +// Created by lhunath on 2014-03-19. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import +#import "MPPasswordLargeCell.h" + +@interface MPPasswordLargeDeleteCell : MPPasswordLargeCell + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordLargeDeleteCell.m b/MasterPassword/ObjC/iOS/MPPasswordLargeDeleteCell.m new file mode 100644 index 00000000..a422f54a --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordLargeDeleteCell.m @@ -0,0 +1,30 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPPasswordLargeDeleteCell.h +// MPPasswordLargeDeleteCell +// +// Created by lhunath on 2014-03-19. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPPasswordLargeDeleteCell.h" + +@implementation MPPasswordLargeDeleteCell + +#pragma mark - Lifecycle + +- (MPElementEntity *)saveContentTypeWithElement:(MPElementEntity *)element saveInContext:(NSManagedObjectContext *)context { + + return element; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordLargeGeneratedCell.h b/MasterPassword/ObjC/iOS/MPPasswordLargeGeneratedCell.h new file mode 100644 index 00000000..fa34073b --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordLargeGeneratedCell.h @@ -0,0 +1,27 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPPasswordLargeGeneratedCell.h +// MPPasswordLargeGeneratedCell +// +// Created by lhunath on 2014-03-19. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import +#import "MPPasswordLargeCell.h" + +@interface MPPasswordLargeGeneratedCell : MPPasswordLargeCell + +@property(strong, nonatomic) IBOutlet UILabel *counterLabel; +@property(strong, nonatomic) IBOutlet UIButton *counterButton; + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordLargeGeneratedCell.m b/MasterPassword/ObjC/iOS/MPPasswordLargeGeneratedCell.m new file mode 100644 index 00000000..3f2229a8 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordLargeGeneratedCell.m @@ -0,0 +1,139 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPPasswordLargeGeneratedCell.h +// MPPasswordLargeGeneratedCell +// +// Created by lhunath on 2014-03-19. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPPasswordLargeGeneratedCell.h" +#import "MPiOSAppDelegate.h" +#import "MPAppDelegate_Store.h" +#import "MPPasswordTypesCell.h" + +@implementation MPPasswordLargeGeneratedCell + +- (void)awakeFromNib { + + [super awakeFromNib]; + + UILongPressGestureRecognizer *gestureRecognizer = [[UILongPressGestureRecognizer alloc] + initWithTarget:self action:@selector(doResetCounterRecognizer:)]; + [self.counterButton addGestureRecognizer:gestureRecognizer]; +} + +- (void)updateWithElement:(MPElementEntity *)mainElement { + + [super updateWithElement:mainElement]; + + MPElementGeneratedEntity *generatedElement = [self generatedElement:mainElement]; + if (generatedElement) + self.counterLabel.text = strf( @"%lu", (unsigned long)generatedElement.counter ); + else + self.counterLabel.text = @"1"; + + if (!mainElement || mainElement.requiresExplicitMigration) { + self.counterLabel.alpha = 0; + self.counterButton.alpha = 0; + } + else { + self.counterLabel.alpha = 1; + self.counterButton.alpha = 1; + } +} + +- (void)resolveContentOfCellTypeForTransientSite:(NSString *)siteName usingKey:(MPKey *)key result:(void (^)(NSString *))resultBlock { + + PearlNotMainQueue( ^{ + resultBlock( [MPAlgorithmDefault generateContentNamed:siteName ofType:self.type withCounter:1 usingKey:key] ); + } ); +} + +- (void)resolveContentOfCellTypeForElement:(MPElementEntity *)element usingKey:(MPKey *)key result:(void (^)(NSString *))resultBlock { + + id algorithm = element.algorithm; + NSString *siteName = element.name; + + PearlNotMainQueue( ^{ + resultBlock( [algorithm generateContentNamed:siteName ofType:self.type withCounter:1 usingKey:key] ); + } ); +} + +- (MPElementEntity *)saveContentTypeWithElement:(MPElementEntity *)element saveInContext:(NSManagedObjectContext *)context { + + element = [super saveContentTypeWithElement:element saveInContext:context]; + + MPElementGeneratedEntity *generatedElement = [self generatedElement:element]; + if (generatedElement) { + generatedElement.counter = [self.counterLabel.text intValue]; + [context saveToStore]; + } + + return element; +} + +#pragma mark - Actions + +- (IBAction)doIncrementCounter:(UIButton *)sender { + + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + MPElementGeneratedEntity *generatedElement = [self generatedElementInContext:context]; + if (!generatedElement) + return; + + ++generatedElement.counter; + [context saveToStore]; + + PearlMainQueue( ^{ + [self updateAnimated:YES]; + [PearlOverlay showTemporaryOverlayWithTitle:@"Counter Incremented" dismissAfter:2]; + } ); + }]; +} + +- (void)doResetCounterRecognizer:(UILongPressGestureRecognizer *)gestureRecognizer { + + if (gestureRecognizer.state != UIGestureRecognizerStateEnded) + return; + + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + MPElementGeneratedEntity *generatedElement = [self generatedElementInContext:context]; + if (!generatedElement) + return; + + generatedElement.counter = 1; + [context saveToStore]; + + PearlMainQueue( ^{ + [self updateAnimated:YES]; + [PearlOverlay showTemporaryOverlayWithTitle:@"Counter Reset" dismissAfter:2]; + } ); + }]; +} + +#pragma mark - Properties + +- (MPElementGeneratedEntity *)generatedElementInContext:(NSManagedObjectContext *)context { + + return [self generatedElement:[[MPPasswordTypesCell findAsSuperviewOf:self] elementInContext:context]]; +} + +- (MPElementGeneratedEntity *)generatedElement:(MPElementEntity *)element { + + if (![element isKindOfClass:[MPElementGeneratedEntity class]]) + return nil; + + return (MPElementGeneratedEntity *)element; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordLargeStoredCell.h b/MasterPassword/ObjC/iOS/MPPasswordLargeStoredCell.h new file mode 100644 index 00000000..3f8e4da4 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordLargeStoredCell.h @@ -0,0 +1,24 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPPasswordLargeStoredCell.h +// MPPasswordLargeStoredCell +// +// Created by lhunath on 2014-03-19. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import +#import "MPPasswordLargeCell.h" + +@interface MPPasswordLargeStoredCell : MPPasswordLargeCell + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordLargeStoredCell.m b/MasterPassword/ObjC/iOS/MPPasswordLargeStoredCell.m new file mode 100644 index 00000000..89525318 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordLargeStoredCell.m @@ -0,0 +1,103 @@ +/** +* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) +* +* See the enclosed file LICENSE for license information (LGPLv3). If you did +* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt +* +* @author Maarten Billemont +* @license http://www.gnu.org/licenses/lgpl-3.0.txt +*/ + +// +// MPPasswordLargeGeneratedCell.h +// MPPasswordLargeGeneratedCell +// +// Created by lhunath on 2014-03-19. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPPasswordLargeStoredCell.h" +#import "MPiOSAppDelegate.h" +#import "MPAppDelegate_Store.h" +#import "MPPasswordTypesCell.h" + +@interface MPPasswordLargeStoredCell() + +@property(strong, nonatomic) IBOutlet UIButton *editButton; + +@end + +@implementation MPPasswordLargeStoredCell + +#pragma mark - Lifecycle + +- (void)resolveContentOfCellTypeForElement:(MPElementEntity *)element usingKey:(MPKey *)key result:(void ( ^ )(NSString *))resultBlock { + + if (element.type & MPElementTypeClassStored) + [element resolveContentUsingKey:key result:resultBlock]; + else + [super resolveContentOfCellTypeForElement:element usingKey:key result:resultBlock]; +} + +- (MPElementEntity *)saveContentTypeWithElement:(MPElementEntity *)element saveInContext:(NSManagedObjectContext *)context { + + element = [super saveContentTypeWithElement:element saveInContext:context]; + + MPElementStoredEntity *storedElement = [self storedElement:element]; + [storedElement.algorithm saveContent:self.contentField.text toElement:storedElement usingKey:[MPiOSAppDelegate get].key]; + [context saveToStore]; + + return element; +} + +#pragma mark - Actions + +- (IBAction)doEditContent:(UIButton *)sender { + + UITextField *textField = self.contentField; + textField.enabled = YES; + [textField becomeFirstResponder]; +} + +#pragma mark - UITextFieldDelegate + +- (void)textFieldDidEndEditing:(UITextField *)textField { + + [super textFieldDidEndEditing:textField]; + + if (textField == self.contentField) { + NSString *newContent = textField.text; + + if (self.contentFieldMode == MPContentFieldModePassword) + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + MPElementStoredEntity *storedElement = [self storedElementInContext:context]; + if (!storedElement) + return; + + [storedElement.algorithm saveContent:newContent toElement:storedElement usingKey:[MPiOSAppDelegate get].key]; + [context saveToStore]; + + PearlMainQueue( ^{ + [self updateAnimated:YES]; + [PearlOverlay showTemporaryOverlayWithTitle:@"Password Updated" dismissAfter:2]; + } ); + }]; + } +} + +#pragma mark - Properties + +- (MPElementStoredEntity *)storedElementInContext:(NSManagedObjectContext *)context { + + return [self storedElement:[[MPPasswordTypesCell findAsSuperviewOf:self] elementInContext:context]]; +} + +- (MPElementStoredEntity *)storedElement:(MPElementEntity *)element { + + if (![element isKindOfClass:[MPElementStoredEntity class]]) + return nil; + + return (MPElementStoredEntity *)element; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordTypesCell.h b/MasterPassword/ObjC/iOS/MPPasswordTypesCell.h new file mode 100644 index 00000000..1a48f773 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordTypesCell.h @@ -0,0 +1,44 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPPasswordTypesCell.h +// MPPasswordTypesCell +// +// Created by lhunath on 2014-03-27. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import +#import "MPCell.h" +#import "MPPasswordCell.h" +#import "MPPasswordsViewController.h" + +@interface MPPasswordTypesCell : MPPasswordCell + +@property(nonatomic, strong) IBOutlet UICollectionView *contentCollectionView; + +@property(nonatomic, weak) MPPasswordsViewController *passwordsViewController; +@property(nonatomic, copy) NSString *transientSite; + +@property(nonatomic, strong) id algorithm; +@property(nonatomic) MPElementType activeType; + +- (MPElementEntity *)mainElement; +- (MPElementEntity *)elementInContext:(NSManagedObjectContext *)context; +- (void)setElement:(MPElementEntity *)element; +- (void)reloadData; + ++ (instancetype)dequeueCellForElement:(MPElementEntity *)element + fromCollectionView:(UICollectionView *)collectionView atIndexPath:(NSIndexPath *)indexPath; ++ (instancetype)dequeueCellForTransientSite:(NSString *)siteName + fromCollectionView:(UICollectionView *)collectionView atIndexPath:(NSIndexPath *)indexPath; + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordTypesCell.m b/MasterPassword/ObjC/iOS/MPPasswordTypesCell.m new file mode 100644 index 00000000..c316d21d --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordTypesCell.m @@ -0,0 +1,371 @@ +/** +* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) +* +* See the enclosed file LICENSE for license information (LGPLv3). If you did +* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt +* +* @author Maarten Billemont +* @license http://www.gnu.org/licenses/lgpl-3.0.txt +*/ + +// +// MPPasswordTypesCell.h +// MPPasswordTypesCell +// +// Created by lhunath on 2014-03-27. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPPasswordTypesCell.h" +#import "MPPasswordLargeCell.h" +#import "MPiOSAppDelegate.h" +#import "MPAppDelegate_Store.h" +#import "MPPasswordLargeDeleteCell.h" + +@implementation MPPasswordTypesCell { + NSManagedObjectID *_elementOID; +} + +#pragma mark - Lifecycle + ++ (instancetype)dequeueCellForTransientSite:(NSString *)siteName fromCollectionView:(UICollectionView *)collectionView + atIndexPath:(NSIndexPath *)indexPath { + + MPPasswordTypesCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass( [MPPasswordTypesCell class] ) + forIndexPath:indexPath]; + [cell setTransientSite:siteName]; + + return cell; +} + ++ (instancetype)dequeueCellForElement:(MPElementEntity *)element fromCollectionView:(UICollectionView *)collectionView + atIndexPath:(NSIndexPath *)indexPath { + + MPPasswordTypesCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass( [MPPasswordTypesCell class] ) + forIndexPath:indexPath]; + [cell setElement:element]; + + return cell; +} + +- (void)awakeFromNib { + + [super awakeFromNib]; + + self.backgroundColor = [UIColor clearColor]; + self.layer.shadowColor = [UIColor clearColor].CGColor; + + [self prepareForReuse]; +} + +- (void)prepareForReuse { + + _elementOID = nil; + _transientSite = nil; + _activeType = 0; + _algorithm = MPAlgorithmDefault; + + [super prepareForReuse]; +} + +- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes { + + [super applyLayoutAttributes:layoutAttributes]; + + [self.contentCollectionView.collectionViewLayout invalidateLayout]; + [self scrollToActiveType]; +} + +#pragma mark - UICollectionViewDataSource + +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout + sizeForItemAtIndexPath:(NSIndexPath *)indexPath { + + return collectionView.bounds.size; +} + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + + if (!self.algorithm) + dbg_return_tr( 0, @, @(section) ); + + if (self.transientSite) + dbg_return_tr( [[self.algorithm allTypes] count], @, @(section) ); + + dbg_return_tr( [[self.algorithm allTypes] count] + 1 /* Delete */, @, @(section) ); +} + +- (MPPasswordLargeCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + + MPPasswordLargeCell *cell; + if (indexPath.item == 0) + cell = [MPPasswordLargeDeleteCell dequeueCellWithType:(MPElementType)NSNotFound fromCollectionView:collectionView + atIndexPath:indexPath]; + else + cell = [MPPasswordLargeCell dequeueCellWithType:[self typeForContentIndexPath:indexPath] fromCollectionView:collectionView + atIndexPath:indexPath]; + + if (self.transientSite) + [cell updateWithTransientSite:self.transientSite]; + else + [cell updateWithElement:self.mainElement]; + + dbg_return( cell, indexPath ); +} + +#pragma mark - UICollectionViewDelegateFlowLayout + +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { + + NSString *newSiteName = self.transientSite; + if (newSiteName) { + [[UIResponder findFirstResponder] resignFirstResponder]; + [PearlAlert showAlertWithTitle:@"Create Site" + message:strf( @"Do you want to create a new site named:\n%@", newSiteName ) + viewStyle:UIAlertViewStyleDefault + initAlert:nil tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) { + if (buttonIndex == [alert cancelButtonIndex]) { + // Cancel + for (NSIndexPath *selectedIndexPath in [collectionView indexPathsForSelectedItems]) + [collectionView deselectItemAtIndexPath:selectedIndexPath animated:YES]; + return; + } + + // Create + [[MPiOSAppDelegate get] addElementNamed:newSiteName completion:^(MPElementEntity *element) { + [self copyContentOfElement:element]; + PearlMainQueue( ^{ + [self.passwordsViewController updatePasswords]; + } ); + }]; + } cancelTitle:[PearlStrings get].commonButtonCancel otherTitles:[PearlStrings get].commonButtonYes, nil]; + return; + } + + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + BOOL used = NO; + MPElementEntity *element = [self elementInContext:context]; + if (!element) + wrn(@"No element to use for: %@", self); + else if (indexPath.item == 0) { + [context deleteObject:element]; + [context saveToStore]; + } else + used = [self copyContentOfElement:element]; + + PearlMainQueueAfter( 0.2f, ^{ + for (NSIndexPath *selectedIndexPath in [collectionView indexPathsForSelectedItems]) + [collectionView deselectItemAtIndexPath:selectedIndexPath animated:YES]; + + if (used) + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context_) { + [[self elementInContext:context_] use]; + [context_ saveToStore]; + }]; + } ); + }]; +} + +- (BOOL)copyContentOfElement:(MPElementEntity *)element { + + inf( @"Copying password for: %@", element.name ); + MPCheckpoint( MPCheckpointCopyToPasteboard, @{ + @"type" : NilToNSNull( element.typeName ), + @"version" : @(element.version), + @"emergency" : @NO + } ); + + NSString *result = [element resolveContentUsingKey:[MPAppDelegate_Shared get].key]; + if ([result length]) { + [UIPasteboard generalPasteboard].string = result; + [PearlOverlay showTemporaryOverlayWithTitle:@"Password Copied" dismissAfter:2]; + return YES; + } + + return NO; +} + +#pragma mark - UIScrollViewDelegate + +- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity + targetContentOffset:(inout CGPoint *)targetContentOffset { + + if (scrollView == self.contentCollectionView) { + NSIndexPath *targetIndexPath = [self.contentCollectionView indexPathForItemAtPoint: + CGPointPlusCGPoint( *targetContentOffset, self.contentCollectionView.center )]; + *targetContentOffset = CGPointFromCGRectTopLeft( + [self.contentCollectionView layoutAttributesForItemAtIndexPath:targetIndexPath].frame ); + } +} + +- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { + + if (scrollView == self.contentCollectionView && !decelerate) + [self saveContentType]; +} + +- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { + + if (scrollView == self.contentCollectionView) + [self saveContentType]; +} + +#pragma mark - Private + +- (void)reloadData { + + if (self.transientSite) + PearlMainQueue( ^{ + self.activeType = IfElse( [[MPiOSAppDelegate get] activeUserForMainThread].defaultType, MPElementTypeGeneratedLong ); + + for (NSInteger section = 0; section < [self.contentCollectionView numberOfSections]; ++section) + for (NSInteger item = 0; item < [self.contentCollectionView numberOfItemsInSection:section]; ++item) + [(MPPasswordLargeCell *)[self.contentCollectionView cellForItemAtIndexPath: + [NSIndexPath indexPathForItem:item inSection:section]] updateWithTransientSite:self.transientSite]; + + } ); + else + [MPiOSAppDelegate managedObjectContextForMainThreadPerformBlockAndWait:^(NSManagedObjectContext *mainContext) { + MPElementEntity *mainElement = [self mainElement]; + + self.algorithm = IfNotNilElse( mainElement.algorithm, MPAlgorithmDefault ); + self.activeType = mainElement.type; + + for (NSInteger section = 0; section < [self.contentCollectionView numberOfSections]; ++section) + for (NSInteger item = 0; item < [self.contentCollectionView numberOfItemsInSection:section]; ++item) + [(MPPasswordLargeCell *)[self.contentCollectionView cellForItemAtIndexPath: + [NSIndexPath indexPathForItem:item inSection:section]] updateWithElement:mainElement]; + }]; +} + +- (void)scrollToActiveType { + + if (self.activeType && self.activeType != (MPElementType)NSNotFound) + [self.contentCollectionView scrollToItemAtIndexPath:[self contentIndexPathForType:self.activeType] + atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:NO]; +} + +- (MPElementType)typeForContentIndexPath:(NSIndexPath *)indexPath { + + if (self.transientSite) + return [[self.algorithm allTypesStartingWith:MPElementTypeGeneratedPIN][indexPath.item] unsignedIntegerValue]; + + if (indexPath.item == 0) + return (MPElementType)NSNotFound; + + return [[self.algorithm allTypesStartingWith:MPElementTypeGeneratedPIN][indexPath.item - 1] unsignedIntegerValue]; +} + +- (NSIndexPath *)contentIndexPathForType:(MPElementType)type { + + NSArray *types = [self.algorithm allTypesStartingWith:MPElementTypeGeneratedPIN]; + for (NSInteger t = 0; t < [types count]; ++t) + if ([types[t] unsignedIntegerValue] == type) { + if (self.transientSite) + return [NSIndexPath indexPathForItem:t inSection:0]; + else + return [NSIndexPath indexPathForItem:t + 1 inSection:0]; + } + + Throw(@"Unsupported type: %lud", (long)type); +} + +- (void)saveContentType { + + CGPoint centerPoint = CGPointFromCGRectCenter( self.contentCollectionView.bounds ); + NSIndexPath *centerIndexPath = [self.contentCollectionView indexPathForItemAtPoint:centerPoint]; + MPElementType type = [self typeForContentIndexPath:centerIndexPath]; + if (type == ((MPElementType)NSNotFound)) + // Active cell is not a type cell. + return; + + self.activeType = type; + + if (self.transientSite) + return; + + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + MPPasswordLargeCell *cell = (MPPasswordLargeCell *)[self.contentCollectionView cellForItemAtIndexPath:centerIndexPath]; + if (!cell) { + err( @"Couldn't find cell to change type: centerIndexPath=%@", centerIndexPath ); + return; + } + + MPElementEntity *element = [self elementInContext:context]; + if (!element || element.type == cell.type) + // Nothing changed. + return; + + self.element = [cell saveContentTypeWithElement:element saveInContext:context]; + }]; +} + +#pragma mark - State + +- (void)setTransientSite:(NSString *)transientSite { + + if ([_transientSite isEqualToString:transientSite]) + return; + + dbg( @"transientSite: %@ -> %@", _transientSite, transientSite ); + + _transientSite = transientSite; + _elementOID = nil; + + [self updateAnimated:YES]; + [self reloadData]; +} + +- (void)setElement:(MPElementEntity *)element { + + NSManagedObjectID *newElementOID = element.objectID; + NSAssert( !newElementOID.isTemporaryID, @"Element doesn't have a permanent objectID: %@", element ); + if ([_elementOID isEqual:newElementOID]) + return; + + dbg( @"element: %@ -> %@", _elementOID, newElementOID ); + + _transientSite = nil; + _elementOID = newElementOID; + + [self updateAnimated:YES]; + [self reloadData]; +} + +- (MPElementEntity *)mainElement { + + return [self elementInContext:[MPiOSAppDelegate managedObjectContextForMainThreadIfReady]]; +} + +- (MPElementEntity *)elementInContext:(NSManagedObjectContext *)context { + + return [MPElementEntity existingObjectWithID:_elementOID inContext:context]; +} + +- (void)setActiveType:(MPElementType)activeType { + + _activeType = activeType; + + [self scrollToActiveType]; +} + +- (void)setSelected:(BOOL)selected { + + [super setSelected:selected]; + + if (!selected) + for (NSIndexPath *indexPath in [self.contentCollectionView indexPathsForSelectedItems]) + [self.contentCollectionView deselectItemAtIndexPath:indexPath animated:YES]; +} + +- (void)setAlgorithm:(id)algorithm { + + if ([_algorithm isEqual:algorithm]) + return; + + _algorithm = algorithm; + + [self.contentCollectionView reloadData]; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordsCoachmarkViewController.h b/MasterPassword/ObjC/iOS/MPPasswordsCoachmarkViewController.h new file mode 100644 index 00000000..4d224383 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordsCoachmarkViewController.h @@ -0,0 +1,23 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPPasswordsCoachmarkViewController.h +// MPPasswordsCoachmarkViewController +// +// Created by lhunath on 2014-04-23. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import +#import "MPCoachmarkViewController.h" + +@interface MPPasswordsCoachmarkViewController : MPCoachmarkViewController +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordsCoachmarkViewController.m b/MasterPassword/ObjC/iOS/MPPasswordsCoachmarkViewController.m new file mode 100644 index 00000000..1198589a --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordsCoachmarkViewController.m @@ -0,0 +1,51 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPPasswordsCoachmarkViewController.h +// MPPasswordsCoachmarkViewController +// +// Created by lhunath on 2014-04-23. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPPasswordsCoachmarkViewController.h" +#import "MPPasswordLargeGeneratedCell.h" +#import "MPPasswordLargeStoredCell.h" + +@implementation MPPasswordsCoachmarkViewController + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + + return 2; +} + +- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + + if (indexPath.item == 0) { + MPPasswordLargeGeneratedCell *cell = [MPPasswordLargeGeneratedCell dequeueCellWithType:MPElementTypeGeneratedLong + fromCollectionView:collectionView atIndexPath:indexPath]; + [cell updateWithTransientSite:@"apple.com"]; + + return cell; + } + else if (indexPath.item == 1) { + MPPasswordLargeStoredCell *cell = [MPPasswordLargeStoredCell dequeueCellWithType:MPElementTypeStoredPersonal + fromCollectionView:collectionView atIndexPath:indexPath]; + [cell updateWithTransientSite:@"gmail.com"]; + [cell.contentField setText:@"PaS$w0rD"]; + + return cell; + } + + Throw(@"Unexpected item for indexPath: %@", indexPath); +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordsSegue.h b/MasterPassword/ObjC/iOS/MPPasswordsSegue.h new file mode 100644 index 00000000..29dabbbe --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordsSegue.h @@ -0,0 +1,25 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPPasswordsSegue.h +// MPPasswordsSegue +// +// Created by lhunath on 2014-04-12. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import + +@interface MPPasswordsSegue : UIStoryboardSegue + +@property (nonatomic, assign) BOOL animated; + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordsSegue.m b/MasterPassword/ObjC/iOS/MPPasswordsSegue.m new file mode 100644 index 00000000..9da16166 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordsSegue.m @@ -0,0 +1,72 @@ +/** +* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) +* +* See the enclosed file LICENSE for license information (LGPLv3). If you did +* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt +* +* @author Maarten Billemont +* @license http://www.gnu.org/licenses/lgpl-3.0.txt +*/ + +// +// MPPasswordsSegue.h +// MPPasswordsSegue +// +// Created by lhunath on 2014-04-12. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPPasswordsSegue.h" +#import "MPPasswordsViewController.h" +#import "MPCombinedViewController.h" + +@implementation MPPasswordsSegue { +} + +- (id)initWithIdentifier:(NSString *)identifier source:(UIViewController *)source destination:(UIViewController *)destination { + + if (!(self = [super initWithIdentifier:identifier source:source destination:destination])) + return nil; + + self.animated = YES; + + return self; +} + +- (void)perform { + + if ([self.destinationViewController isKindOfClass:[MPPasswordsViewController class]]) { + __weak MPPasswordsViewController *passwordsVC = self.destinationViewController; + MPCombinedViewController *combinedVC = self.sourceViewController; + [combinedVC addChildViewController:passwordsVC]; + passwordsVC.active = NO; + + UIView *passwordsView = passwordsVC.view; + passwordsView.translatesAutoresizingMaskIntoConstraints = NO; + [combinedVC.view insertSubview:passwordsView belowSubview:combinedVC.usersView]; + [combinedVC.view addConstraintsWithVisualFormats:@[ @"H:|[passwordsView]|", @"V:|[passwordsView]|" ] + options:0 metrics:nil + views:NSDictionaryOfVariableBindings( passwordsView )]; + + [passwordsVC setActive:YES animated:self.animated completion:^(BOOL finished) { + if (!finished) + return; + + [passwordsVC didMoveToParentViewController:combinedVC]; + }]; + } + else if ([self.sourceViewController isKindOfClass:[MPPasswordsViewController class]]) { + __weak MPPasswordsViewController *passwordsVC = self.sourceViewController; + + [passwordsVC willMoveToParentViewController:nil]; + [passwordsVC setActive:NO animated:self.animated completion:^(BOOL finished) { + if (!finished) + return; + + [passwordsVC.view removeFromSuperview]; + [passwordsVC removeFromParentViewController]; + }]; + } +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordsViewController.h b/MasterPassword/ObjC/iOS/MPPasswordsViewController.h new file mode 100644 index 00000000..eacf3ba8 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordsViewController.h @@ -0,0 +1,44 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPCombinedViewController.h +// MPCombinedViewController +// +// Created by lhunath on 2014-03-08. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "LLGitTip.h" +@class MPElementEntity; +@class MPCoachmark; + +@interface MPPasswordsViewController : UIViewController + +@property(strong, nonatomic) IBOutlet UIView *passwordSelectionContainer; +@property(strong, nonatomic) IBOutlet UICollectionView *passwordCollectionView; +@property(strong, nonatomic) IBOutlet UISearchBar *passwordsSearchBar; +@property(strong, nonatomic) IBOutlet NSLayoutConstraint *passwordsToBottomConstraint; +@property(strong, nonatomic) IBOutlet NSLayoutConstraint *navigationBarToTopConstraint; +@property(strong, nonatomic) IBOutlet NSLayoutConstraint *popdownToTopConstraint; +@property(strong, nonatomic) IBOutlet UIView *popdownView; +@property(strong, nonatomic) IBOutlet UIView *popdownContainer; + +@property(assign, nonatomic) BOOL active; + +@property(nonatomic, readonly) MPCoachmark *coachmark; + +- (void)setActive:(BOOL)active animated:(BOOL)animated completion:(void (^)(BOOL finished))completion; +- (void)updatePasswords; + +- (IBAction)dismissPopdown:(id)sender; +- (IBAction)signOut:(id)sender; + +@end diff --git a/MasterPassword/ObjC/iOS/MPPasswordsViewController.m b/MasterPassword/ObjC/iOS/MPPasswordsViewController.m new file mode 100644 index 00000000..2c9b6286 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPasswordsViewController.m @@ -0,0 +1,434 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPPasswordsViewController.h +// MPPasswordsViewController +// +// Created by lhunath on 2014-03-08. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPPasswordsViewController.h" +#import "MPiOSAppDelegate.h" +#import "MPAppDelegate_Store.h" +#import "MPPasswordLargeCell.h" +#import "MPPasswordTypesCell.h" +#import "MPPopdownSegue.h" +#import "MPAppDelegate_Key.h" +#import "MPCoachmarkViewController.h" + +@interface MPPasswordsViewController() + +@property(nonatomic, strong) IBOutlet UINavigationBar *navigationBar; +@property(nonatomic, readonly) NSString *query; + +@end + +@implementation MPPasswordsViewController { + __weak id _storeObserver; + __weak id _mocObserver; + NSArray *_notificationObservers; + __weak UITapGestureRecognizer *_passwordsDismissRecognizer; + NSFetchedResultsController *_fetchedResultsController; + BOOL _exactMatch; + UIColor *_backgroundColor; + UIColor *_darkenedBackgroundColor; + __weak UIViewController *_popdownVC; +} + +#pragma mark - Life + +- (void)viewDidLoad { + + [super viewDidLoad]; + + _backgroundColor = self.passwordCollectionView.backgroundColor; + _darkenedBackgroundColor = [_backgroundColor colorWithAlphaComponent:0.6f]; + _coachmark = [MPCoachmark coachmarkForClass:[self class] version:0]; + + self.view.backgroundColor = [UIColor clearColor]; + [self.passwordCollectionView automaticallyAdjustInsetsForKeyboard]; +} + +- (void)viewWillAppear:(BOOL)animated { + + [super viewWillAppear:animated]; + + [self registerObservers]; + [self observeStore]; + [self updateFromConfig]; + [self updatePasswords]; +} + +- (void)viewDidAppear:(BOOL)animated { + + [super viewDidAppear:animated]; + + PearlMainQueueAfter( 1, ^{ + if (!self.coachmark.coached) + [self performSegueWithIdentifier:@"coachmarks" sender:self]; + } ); +} + +- (void)viewWillDisappear:(BOOL)animated { + + [super viewWillDisappear:animated]; + + [self removeObservers]; + [self stopObservingStore]; +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + + if ([segue.identifier isEqualToString:@"popdown"]) + _popdownVC = segue.destinationViewController; + if ([segue.identifier isEqualToString:@"coachmarks"]) + ((MPCoachmarkViewController *)segue.destinationViewController).coachmark = self.coachmark; +} + +- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { + + [self.passwordCollectionView.collectionViewLayout invalidateLayout]; + + [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; +} + +#pragma mark - UICollectionViewDelegateFlowLayout + +- (CGSize) collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout +referenceSizeForHeaderInSection:(NSInteger)section { + + return CGSizeMake( collectionView.bounds.size.width, CGPointFromCGRectBottom( self.passwordsSearchBar.frame ).y ); +} + +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout + sizeForItemAtIndexPath:(NSIndexPath *)indexPath { + + if (collectionView == self.passwordCollectionView) { + UICollectionViewFlowLayout *layout = (UICollectionViewFlowLayout *)collectionViewLayout; + CGFloat itemWidth = UIEdgeInsetsInsetRect(self.passwordCollectionView.bounds, layout.sectionInset).size.width; + return CGSizeMake( itemWidth, 100 ); + } + + Throw(@"Unexpected collection view: %@", collectionView); +} + +#pragma mark - UICollectionViewDataSource + +- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { + + if (collectionView == self.passwordCollectionView) + return [self.fetchedResultsController.sections count]; + + Throw(@"Unexpected collection view: %@", collectionView); +} + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + + if (collectionView == self.passwordCollectionView) + return ![MPiOSAppDelegate get].activeUserOID? 0: + ((id)self.fetchedResultsController.sections[section]).numberOfObjects + + (!_exactMatch && [[self query] length]? 1: 0); + + Throw(@"Unexpected collection view: %@", collectionView); +} + +- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + + if (collectionView == self.passwordCollectionView) { + [UIView setAnimationsEnabled:NO]; + MPPasswordTypesCell *cell; + if (indexPath.item < ((id)self.fetchedResultsController.sections[indexPath.section]).numberOfObjects) { + MPElementEntity *element = [self.fetchedResultsController objectAtIndexPath:indexPath]; + cell = [MPPasswordTypesCell dequeueCellForElement:element fromCollectionView:collectionView atIndexPath:indexPath]; + } + else + // New Site. + cell = [MPPasswordTypesCell dequeueCellForTransientSite:self.query fromCollectionView:collectionView atIndexPath:indexPath]; + cell.passwordsViewController = self; + + [UIView setAnimationsEnabled:YES]; + dbg_return(cell, indexPath); + } + + Throw(@"Unexpected collection view: %@", collectionView); +} + +- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind + atIndexPath:(NSIndexPath *)indexPath { + + return [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"MPPasswordHeader" forIndexPath:indexPath]; +} + +#pragma mark - NSFetchedResultsControllerDelegate + +- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath + forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath { + + if (controller == _fetchedResultsController) { + [self.passwordCollectionView reloadSections:[NSIndexSet indexSetWithIndex:indexPath.section]]; + [self.passwordCollectionView reloadSections:[NSIndexSet indexSetWithIndex:newIndexPath.section]]; + } +} + +- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id)sectionInfo + atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type { + + if (controller == _fetchedResultsController) + [self.passwordCollectionView reloadData]; +} + +#pragma mark - UISearchBarDelegate + +- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar { + + if (searchBar == self.passwordsSearchBar) { + searchBar.text = nil; + return YES; + } + + return NO; +} + +- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar { + + if (searchBar == self.passwordsSearchBar) + [UIView animateWithDuration:0.3f animations:^{ + self.passwordCollectionView.backgroundColor = _darkenedBackgroundColor; + }]; +} + +- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar { + + if (searchBar == self.passwordsSearchBar) { + self.passwordsSearchBar.showsCancelButton = NO; + if (_passwordsDismissRecognizer) + [self.view removeGestureRecognizer:_passwordsDismissRecognizer]; + + [UIView animateWithDuration:0.3f animations:^{ + self.passwordCollectionView.backgroundColor = _backgroundColor; + }]; + } +} + +- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { + + [searchBar resignFirstResponder]; +} + +- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { + + if (searchBar == self.passwordsSearchBar) + [self updatePasswords]; +} + + +#pragma mark - Private + +- (void)registerObservers { + + if ([_notificationObservers count]) + return; + + Weakify(self); + _notificationObservers = @[ + [[NSNotificationCenter defaultCenter] + addObserverForName:UIApplicationWillResignActiveNotification object:nil + queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + Strongify(self); + + self.passwordSelectionContainer.alpha = 0; + }], + [[NSNotificationCenter defaultCenter] + addObserverForName:MPSignedOutNotification object:nil + queue:nil usingBlock:^(NSNotification *note) { + Strongify(self); + + _fetchedResultsController = nil; + self.passwordsSearchBar.text = nil; + [self updatePasswords]; + }], + [[NSNotificationCenter defaultCenter] + addObserverForName:UIApplicationDidBecomeActiveNotification object:nil + queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + Strongify(self); + + [self updatePasswords]; + [UIView animateWithDuration:1 animations:^{ + self.passwordSelectionContainer.alpha = 1; + }]; + }], + [[NSNotificationCenter defaultCenter] + addObserverForName:MPCheckConfigNotification object:nil + queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + [self updateFromConfig]; + }], + ]; +} + +- (void)removeObservers { + + for (id observer in _notificationObservers) + [[NSNotificationCenter defaultCenter] removeObserver:observer]; + _notificationObservers = nil; +} + +- (void)observeStore { + + Weakify(self); + + NSManagedObjectContext *mainContext = [MPiOSAppDelegate managedObjectContextForMainThreadIfReady]; + if (!_mocObserver && mainContext) + _mocObserver = [[NSNotificationCenter defaultCenter] + addObserverForName:NSManagedObjectContextObjectsDidChangeNotification object:mainContext + queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { +// Strongify(self); +// [self updatePasswords]; + }]; + if (!_storeObserver) + _storeObserver = [[NSNotificationCenter defaultCenter] + addObserverForName:USMStoreDidChangeNotification object:nil + queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + Strongify(self); + _fetchedResultsController = nil; + [self updatePasswords]; + }]; +} + +- (void)stopObservingStore { + + if (_mocObserver) + [[NSNotificationCenter defaultCenter] removeObserver:_mocObserver]; + if (_storeObserver) + [[NSNotificationCenter defaultCenter] removeObserver:_storeObserver]; +} + +- (void)updateFromConfig { + + self.passwordsSearchBar.keyboardType = [[MPiOSConfig get].dictationSearch boolValue]? UIKeyboardTypeDefault: UIKeyboardTypeURL; +} + +- (void)updatePasswords { + + NSString *query = self.query; + NSManagedObjectID *activeUserOID = [MPiOSAppDelegate get].activeUserOID; + if (!activeUserOID) { + self.passwordsSearchBar.text = nil; + PearlMainQueue( ^{ + [self.passwordCollectionView reloadData]; + [self.passwordCollectionView setContentOffset:CGPointMake( 0, -self.passwordCollectionView.contentInset.top ) animated:YES]; + } ); + return; + } + + [self.fetchedResultsController.managedObjectContext performBlock:^{ + NSError *error = nil; + self.fetchedResultsController.fetchRequest.predicate = + [query length]? + [NSPredicate predicateWithFormat:@"user == %@ AND name BEGINSWITH[cd] %@", activeUserOID, query]: + [NSPredicate predicateWithFormat:@"user == %@", activeUserOID]; + if (![self.fetchedResultsController performFetch:&error]) + err(@"Couldn't fetch elements: %@", error); + + _exactMatch = NO; + for (MPElementEntity *entity in self.fetchedResultsController.fetchedObjects) + if ([entity.name isEqualToString:query]) { + _exactMatch = YES; + break; + } + + PearlMainQueue( ^{ + [self.passwordCollectionView performBatchUpdates:^{ + NSInteger fromSections = self.passwordCollectionView.numberOfSections; + NSInteger toSections = [self numberOfSectionsInCollectionView:self.passwordCollectionView]; + for (int section = 0; section < MAX(toSections, fromSections); section++) { + if (section >= fromSections) { + dbg(@"insertSections:%d", section); + [self.passwordCollectionView insertSections:[NSIndexSet indexSetWithIndex:section]]; + } + else if (section >= toSections) { + dbg(@"deleteSections:%d", section); + [self.passwordCollectionView deleteSections:[NSIndexSet indexSetWithIndex:section]]; + } + else { + dbg(@"reloadSections:%d", section); + [self.passwordCollectionView reloadSections:[NSIndexSet indexSetWithIndex:section]]; + } + } + } completion:^(BOOL finished) { + if (finished) + [self.passwordCollectionView setContentOffset:CGPointMake( 0, -self.passwordCollectionView.contentInset.top ) + animated:YES]; + }]; + } ); + }]; +} + +#pragma mark - Properties + +- (NSString *)query { + + return [self.passwordsSearchBar.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; +} + +- (NSFetchedResultsController *)fetchedResultsController { + + if (!_fetchedResultsController) { + [MPiOSAppDelegate managedObjectContextForMainThreadPerformBlockAndWait:^(NSManagedObjectContext *mainContext) { + NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPElementEntity class] )]; + fetchRequest.sortDescriptors = @[ + [[NSSortDescriptor alloc] initWithKey:NSStringFromSelector( @selector(lastUsed) ) ascending:NO] + ]; + fetchRequest.fetchBatchSize = 10; + _fetchedResultsController = [[NSFetchedResultsController alloc] + initWithFetchRequest:fetchRequest managedObjectContext:mainContext sectionNameKeyPath:nil cacheName:nil]; + _fetchedResultsController.delegate = self; + }]; + [self observeStore]; + } + + return _fetchedResultsController; +} + +- (void)setActive:(BOOL)active { + + [self setActive:active animated:NO completion:nil]; +} + +- (void)setActive:(BOOL)active animated:(BOOL)animated completion:(void (^)(BOOL finished))completion { + + _active = active; + + [UIView animateWithDuration:animated? 0.4f: 0 animations:^{ + self.navigationBarToTopConstraint.priority = active? 1: UILayoutPriorityDefaultHigh; + self.passwordsToBottomConstraint.priority = active? 1: UILayoutPriorityDefaultHigh; + + [self.navigationBarToTopConstraint apply]; + [self.passwordsToBottomConstraint apply]; + } completion:completion]; +} + +#pragma mark - Actions + +- (IBAction)dismissPopdown:(id)sender { + + if (_popdownVC) + [[[MPPopdownSegue alloc] initWithIdentifier:@"unwind-popdown" source:_popdownVC destination:self] perform]; + else + self.popdownToTopConstraint.priority = UILayoutPriorityDefaultHigh; +} + +- (IBAction)signOut:(id)sender { + + [[MPiOSAppDelegate get] signOutAnimated:YES]; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPPopdownSegue.h b/MasterPassword/ObjC/iOS/MPPopdownSegue.h new file mode 100644 index 00000000..1d1e4f28 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPopdownSegue.h @@ -0,0 +1,22 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPPopdownSegue.h +// MPPopdownSegue +// +// Created by lhunath on 2014-04-17. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import + +@interface MPPopdownSegue : UIStoryboardSegue +@end diff --git a/MasterPassword/ObjC/iOS/MPPopdownSegue.m b/MasterPassword/ObjC/iOS/MPPopdownSegue.m new file mode 100644 index 00000000..f5a007da --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPopdownSegue.m @@ -0,0 +1,65 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPPopdownSegue.h +// MPPopdownSegue +// +// Created by lhunath on 2014-04-17. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPPopdownSegue.h" +#import "MPPasswordsViewController.h" + +@implementation MPPopdownSegue { +} + +- (void)perform { + + MPPasswordsViewController *passwordsVC; + UIViewController *popdownVC; + if ([self.sourceViewController isKindOfClass:[MPPasswordsViewController class]]) { + passwordsVC = self.sourceViewController; + popdownVC = self.destinationViewController; + UIView *popdownView = popdownVC.view; + popdownView.translatesAutoresizingMaskIntoConstraints = NO; + + [passwordsVC addChildViewController:popdownVC]; + [passwordsVC.popdownContainer addSubview:popdownView]; + [passwordsVC.popdownContainer addConstraintsWithVisualFormats:@[ @"H:|[popdownView]|", @"V:|[popdownView]|" ] options:0 + metrics:nil views:NSDictionaryOfVariableBindings(popdownView)]; + + [UIView animateWithDuration:0.3f animations:^{ + passwordsVC.popdownToTopConstraint.priority = 1; + [passwordsVC.popdownToTopConstraint apply]; + } completion:^(BOOL finished) { + if (finished) + [popdownVC didMoveToParentViewController:passwordsVC]; + }]; + } + else if ([self.destinationViewController isKindOfClass:[MPPasswordsViewController class]]) { + popdownVC = self.sourceViewController; + passwordsVC = self.destinationViewController; + + [popdownVC willMoveToParentViewController:nil]; + [UIView animateWithDuration:0.3f delay:0 options:UIViewAnimationOptionOverrideInheritedDuration animations:^{ + passwordsVC.popdownToTopConstraint.priority = UILayoutPriorityDefaultHigh; + [passwordsVC.popdownToTopConstraint apply]; + } completion:^(BOOL finished) { + if (finished) { + [popdownVC.view removeFromSuperview]; + [popdownVC removeFromParentViewController]; + } + }]; + } +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPPreferencesViewController.h b/MasterPassword/ObjC/iOS/MPPreferencesViewController.h index 3af98c05..a865d42f 100644 --- a/MasterPassword/ObjC/iOS/MPPreferencesViewController.h +++ b/MasterPassword/ObjC/iOS/MPPreferencesViewController.h @@ -9,15 +9,20 @@ #import #import "MPTypeViewController.h" -@interface MPPreferencesViewController : UITableViewController +@interface MPPreferencesViewController : UITableViewController -@property(weak, nonatomic) IBOutlet UIScrollView *avatarsView; -@property(weak, nonatomic) IBOutlet UIButton *avatarTemplate; @property(weak, nonatomic) IBOutlet UISwitch *savePasswordSwitch; +@property(weak, nonatomic) IBOutlet UITableViewCell *signOutCell; +@property(weak, nonatomic) IBOutlet UITableViewCell *feedbackCell; +@property(weak, nonatomic) IBOutlet UITableViewCell *coachmarksCell; @property(weak, nonatomic) IBOutlet UITableViewCell *exportCell; -@property(weak, nonatomic) IBOutlet UITableViewCell *changeMPCell; -@property(weak, nonatomic) IBOutlet UILabel *defaultTypeLabel; +@property(weak, nonatomic) IBOutlet UITableViewCell *checkInconsistencies; +@property(weak, nonatomic) IBOutlet UIImageView *avatarImage; +@property(weak, nonatomic) IBOutlet UISegmentedControl *generatedTypeControl; +@property(weak, nonatomic) IBOutlet UISegmentedControl *storedTypeControl; -- (IBAction)didToggleSwitch:(UISwitch *)sender; +- (IBAction)previousAvatar:(id)sender; +- (IBAction)nextAvatar:(id)sender; +- (IBAction)valueChanged:(id)sender; @end diff --git a/MasterPassword/ObjC/iOS/MPPreferencesViewController.m b/MasterPassword/ObjC/iOS/MPPreferencesViewController.m index f9144b4e..d51b04f1 100644 --- a/MasterPassword/ObjC/iOS/MPPreferencesViewController.m +++ b/MasterPassword/ObjC/iOS/MPPreferencesViewController.m @@ -6,12 +6,13 @@ // Copyright (c) 2012 Lyndir. All rights reserved. // -#import - #import "MPPreferencesViewController.h" #import "MPiOSAppDelegate.h" #import "MPAppDelegate_Key.h" #import "MPAppDelegate_Store.h" +#import "UIColor+Expanded.h" +#import "MPPasswordsViewController.h" +#import "MPCoachmarkViewController.h" @interface MPPreferencesViewController() @@ -21,158 +22,202 @@ - (void)viewDidLoad { - self.avatarTemplate.hidden = YES; - - for (int a = 0; a < MPAvatarCount; ++a) { - UIButton *avatar = [self.avatarTemplate clone]; - avatar.tag = a; - avatar.hidden = NO; - avatar.center = CGPointMake( - self.avatarTemplate.center.x * (a + 1) + self.avatarTemplate.bounds.size.width / 2 * a, - self.avatarTemplate.center.y ); - [avatar setBackgroundImage:[UIImage imageNamed:PearlString( @"avatar-%d", a )] - forState:UIControlStateNormal]; - [avatar setSelectionInSuperviewCandidate:YES isClearable:NO]; - - avatar.layer.cornerRadius = avatar.bounds.size.height / 2; - avatar.layer.shadowColor = [UIColor blackColor].CGColor; - avatar.layer.shadowOpacity = 1; - avatar.layer.shadowRadius = 5; - avatar.backgroundColor = [UIColor clearColor]; - - [avatar onHighlightOrSelect:^(BOOL highlighted, BOOL selected) { - if (highlighted || selected) - avatar.backgroundColor = self.avatarTemplate.backgroundColor; - else - avatar.backgroundColor = [UIColor clearColor]; - } options:0]; - [avatar onSelect:^(BOOL selected) { - if (selected) { - [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *moc) { - [[MPiOSAppDelegate get] activeUserInContext:moc].avatar = (unsigned)avatar.tag; - [moc saveToStore]; - }]; - } - } options:0]; - avatar.selected = (a == [[MPiOSAppDelegate get] activeUserForMainThread].avatar); - } - [super viewDidLoad]; + + self.view.backgroundColor = [UIColor clearColor]; } - (void)viewWillAppear:(BOOL)animated { - inf(@"Preferences will appear"); - [self.avatarsView autoSizeContent]; - [self.avatarsView enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) { - if (subview.tag && ((UIControl *)subview).selected) { - [self.avatarsView setContentOffset:CGPointMake( subview.center.x - self.avatarsView.bounds.size.width / 2, 0 ) - animated:animated]; - } - } recurse:NO]; + inf( @"Preferences will appear" ); + [super viewWillAppear:animated]; MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserForMainThread]; + self.generatedTypeControl.selectedSegmentIndex = [self generatedSegmentIndexForType:activeUser.defaultType]; + self.storedTypeControl.selectedSegmentIndex = [self storedSegmentIndexForType:activeUser.defaultType]; + self.avatarImage.image = [UIImage imageNamed:strf( @"avatar-%ld", (long)activeUser.avatar )]; self.savePasswordSwitch.on = activeUser.saveKey; - self.defaultTypeLabel.text = [[MPiOSAppDelegate get].key.algorithm shortNameOfType:activeUser.defaultType]; - [super viewWillAppear:animated]; -} - -- (void)viewDidAppear:(BOOL)animated { - -#ifdef LOCALYTICS - [[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Preferences"]; -#endif - - [super viewDidAppear:animated]; -} - -- (void)viewWillDisappear:(BOOL)animated { - - inf(@"Preferences will disappear"); - [super viewWillDisappear:animated]; -} - -- (BOOL)canBecomeFirstResponder { - - return YES; -} - -- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event { - - if (motion == UIEventSubtypeMotionShake) { - MPCheckpoint( MPCheckpointLogs, @{ - @"trace" : [MPiOSConfig get].traceMode - } ); - [self performSegueWithIdentifier:@"MP_Logs" sender:self]; - } -} - -- (BOOL)shouldAutorotate { - - return NO; -} - -- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { - - return UIInterfaceOrientationPortrait; -} - -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - - if ([[segue identifier] isEqualToString:@"MP_ChooseType"]) - ((MPTypeViewController *)[segue destinationViewController]).delegate = self; + self.tableView.contentInset = UIEdgeInsetsMake( 64, 0, 49, 0 ); } #pragma mark - UITableViewDelegate +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath]; + if (cell.selectionStyle != UITableViewCellSelectionStyleNone) { + cell.selectedBackgroundView = [[UIView alloc] initWithFrame:cell.bounds]; + cell.selectedBackgroundView.backgroundColor = [UIColor colorWithRGBAHex:0x78DDFB33]; + } + + return cell; +} + - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [self tableView:tableView cellForRowAtIndexPath:indexPath]; - if (cell == self.exportCell) - [[MPiOSAppDelegate get] export]; - - else if (cell == self.changeMPCell) { - [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *moc) { - MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserInContext:moc]; - [[MPiOSAppDelegate get] changeMasterPasswordFor:activeUser saveInContext:moc didResetBlock:nil]; - }]; + if (cell == self.signOutCell) { + MPPasswordsViewController *passwordsVC = [self dismissPopup]; + [[MPiOSAppDelegate get] signOutAnimated:YES]; } + if (cell == self.feedbackCell) + [[MPiOSAppDelegate get] showFeedbackWithLogs:YES forVC:self]; + if (cell == self.exportCell) + [[MPiOSAppDelegate get] showExportForVC:self]; + if (cell == self.coachmarksCell) { + MPPasswordsViewController *passwordsVC = [self dismissPopup]; + passwordsVC.coachmark.coached = NO; + [passwordsVC performSegueWithIdentifier:@"coachmarks" sender:self]; + } + if (cell == self.checkInconsistencies) + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + if ([[MPiOSAppDelegate get] findAndFixInconsistenciesSaveInContext:context] == MPFixableResultNoProblems) + [PearlAlert showAlertWithTitle:@"No Inconsistencies" message: + @"No inconsistencies were detected in your sites." + viewStyle:UIAlertViewStyleDefault initAlert:nil + tappedButtonBlock:nil cancelTitle:[PearlStrings get].commonButtonOkay otherTitles:nil]; + }]; [tableView deselectRowAtIndexPath:indexPath animated:YES]; } -#pragma mark - MPTypeDelegate - -- (void)didSelectType:(MPElementType)type { - - self.defaultTypeLabel.text = [[MPiOSAppDelegate get].key.algorithm shortNameOfType:type]; - - [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { - MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserInContext:context]; - activeUser.defaultType = type; - [context saveToStore]; - }]; -} - -- (MPElementType)selectedType { - - return [[MPiOSAppDelegate get] activeUserForMainThread].defaultType; -} - #pragma mark - IBActions -- (IBAction)didToggleSwitch:(UISwitch *)sender { +- (IBAction)valueChanged:(id)sender { if (sender == self.savePasswordSwitch) - [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *moc) { - MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserInContext:moc]; - if ((activeUser.saveKey = sender.on)) + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserInContext:context]; + if ((activeUser.saveKey = self.savePasswordSwitch.on)) [[MPiOSAppDelegate get] storeSavedKeyFor:activeUser]; else [[MPiOSAppDelegate get] forgetSavedKeyFor:activeUser]; - [moc saveToStore]; + [context saveToStore]; }]; + + if (sender == self.generatedTypeControl || sender == self.storedTypeControl) { + if (sender == self.generatedTypeControl) + self.storedTypeControl.selectedSegmentIndex = -1; + else if (sender == self.storedTypeControl) + self.generatedTypeControl.selectedSegmentIndex = -1; + + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + MPElementType defaultType = [[MPiOSAppDelegate get] activeUserInContext:context].defaultType = [self typeForSelectedSegment]; + [context saveToStore]; + + PearlMainQueue( ^{ + self.generatedTypeControl.selectedSegmentIndex = [self generatedSegmentIndexForType:defaultType]; + self.storedTypeControl.selectedSegmentIndex = [self storedSegmentIndexForType:defaultType]; + } ); + }]; + } +} + +- (IBAction)previousAvatar:(id)sender { + + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserInContext:context]; + activeUser.avatar = (activeUser.avatar - 1 + MPAvatarCount) % MPAvatarCount; + [context saveToStore]; + + long avatar = activeUser.avatar; + PearlMainQueue( ^{ + self.avatarImage.image = [UIImage imageNamed:strf( @"avatar-%ld", avatar )]; + } ); + }]; +} + +- (IBAction)nextAvatar:(id)sender { + + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserInContext:context]; + activeUser.avatar = (activeUser.avatar + 1 + MPAvatarCount) % MPAvatarCount; + [context saveToStore]; + + long avatar = activeUser.avatar; + PearlMainQueue( ^{ + self.avatarImage.image = [UIImage imageNamed:strf( @"avatar-%ld", avatar )]; + } ); + }]; +} + +#pragma mark - Private + +- (MPPasswordsViewController *)dismissPopup { + + for (UIViewController *vc = self; (vc = vc.parentViewController);) + if ([vc isKindOfClass:[MPPasswordsViewController class]]) { + MPPasswordsViewController *passwordsVC = (MPPasswordsViewController *)vc; + [passwordsVC dismissPopdown:self]; + return passwordsVC; + } + + return nil; +} + +- (enum MPElementType)typeForSelectedSegment { + + NSInteger selectedGeneratedIndex = self.generatedTypeControl.selectedSegmentIndex; + NSInteger selectedStoredIndex = self.storedTypeControl.selectedSegmentIndex; + + switch (selectedGeneratedIndex) { + case 0: + return MPElementTypeGeneratedMaximum; + case 1: + return MPElementTypeGeneratedLong; + case 2: + return MPElementTypeGeneratedMedium; + case 3: + return MPElementTypeGeneratedBasic; + case 4: + return MPElementTypeGeneratedShort; + case 5: + return MPElementTypeGeneratedPIN; + default: + + switch (selectedStoredIndex) { + case 0: + return MPElementTypeStoredPersonal; + case 1: + return MPElementTypeStoredDevicePrivate; + default: + Throw( @"unsupported selected type index: generated=%ld, stored=%ld", (long)selectedGeneratedIndex, + (long)selectedStoredIndex ); + } + } +} + +- (NSInteger)generatedSegmentIndexForType:(MPElementType)type { + + switch (type) { + case MPElementTypeGeneratedMaximum: + return 0; + case MPElementTypeGeneratedLong: + return 1; + case MPElementTypeGeneratedMedium: + return 2; + case MPElementTypeGeneratedBasic: + return 3; + case MPElementTypeGeneratedShort: + return 4; + case MPElementTypeGeneratedPIN: + return 5; + default: + return -1; + } +} + +- (NSInteger)storedSegmentIndexForType:(MPElementType)type { + + switch (type) { + case MPElementTypeStoredPersonal: + return 0; + case MPElementTypeStoredDevicePrivate: + return 1; + default: + return -1; + } } @end diff --git a/MasterPassword/ObjC/iOS/MPPreferencesViewControllerOld.h b/MasterPassword/ObjC/iOS/MPPreferencesViewControllerOld.h new file mode 100644 index 00000000..3561068b --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPreferencesViewControllerOld.h @@ -0,0 +1,23 @@ +// +// MPPreferencesViewController.h +// MasterPassword-iOS +// +// Created by Maarten Billemont on 04/06/12. +// Copyright (c) 2012 Lyndir. All rights reserved. +// + +#import +#import "MPTypeViewController.h" + +@interface MPPreferencesViewControllerOld : UITableViewController + +@property(weak, nonatomic) IBOutlet UIScrollView *avatarsView; +@property(weak, nonatomic) IBOutlet UIButton *avatarTemplate; +@property(weak, nonatomic) IBOutlet UISwitch *savePasswordSwitch; +@property(weak, nonatomic) IBOutlet UITableViewCell *exportCell; +@property(weak, nonatomic) IBOutlet UITableViewCell *changeMPCell; +@property(weak, nonatomic) IBOutlet UILabel *defaultTypeLabel; + +- (IBAction)didToggleSwitch:(UISwitch *)sender; + +@end diff --git a/MasterPassword/ObjC/iOS/MPPreferencesViewControllerOld.m b/MasterPassword/ObjC/iOS/MPPreferencesViewControllerOld.m new file mode 100644 index 00000000..ac481a6d --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPPreferencesViewControllerOld.m @@ -0,0 +1,178 @@ +// +// MPPreferencesViewController.m +// MasterPassword-iOS +// +// Created by Maarten Billemont on 04/06/12. +// Copyright (c) 2012 Lyndir. All rights reserved. +// + +#import + +#import "MPPreferencesViewControllerOld.h" +#import "MPiOSAppDelegate.h" +#import "MPAppDelegate_Key.h" +#import "MPAppDelegate_Store.h" + +@interface MPPreferencesViewControllerOld() + +@end + +@implementation MPPreferencesViewControllerOld + +- (void)viewDidLoad { + + self.avatarTemplate.hidden = YES; + + for (NSUInteger a = 0; a < MPAvatarCount; ++a) { + UIButton *avatar = [self.avatarTemplate clone]; + avatar.tag = a; + avatar.hidden = NO; + avatar.center = CGPointMake( + self.avatarTemplate.center.x * (a + 1) + self.avatarTemplate.bounds.size.width / 2 * a, + self.avatarTemplate.center.y ); + [avatar setBackgroundImage:[UIImage imageNamed:PearlString( @"avatar-%ld", (long)a )] + forState:UIControlStateNormal]; + [avatar setSelectionInSuperviewCandidate:YES isClearable:NO]; + + avatar.layer.cornerRadius = avatar.bounds.size.height / 2; + avatar.layer.shadowColor = [UIColor blackColor].CGColor; + avatar.layer.shadowOpacity = 1; + avatar.layer.shadowRadius = 5; + avatar.backgroundColor = [UIColor clearColor]; + + [avatar onHighlightOrSelect:^(BOOL highlighted, BOOL selected) { + if (highlighted || selected) + avatar.backgroundColor = self.avatarTemplate.backgroundColor; + else + avatar.backgroundColor = [UIColor clearColor]; + } options:0]; + [avatar onSelect:^(BOOL selected) { + if (selected) { + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *moc) { + [[MPiOSAppDelegate get] activeUserInContext:moc].avatar = (unsigned)avatar.tag; + [moc saveToStore]; + }]; + } + } options:0]; + avatar.selected = (a == [[MPiOSAppDelegate get] activeUserForMainThread].avatar); + } + + [super viewDidLoad]; +} + +- (void)viewWillAppear:(BOOL)animated { + + inf(@"Preferences will appear"); + [self.avatarsView autoSizeContent]; + [self.avatarsView enumerateViews:^(UIView *subview, BOOL *stop, BOOL *recurse) { + if (subview.tag && ((UIControl *)subview).selected) { + [self.avatarsView setContentOffset:CGPointMake( subview.center.x - self.avatarsView.bounds.size.width / 2, 0 ) + animated:animated]; + } + } recurse:NO]; + + MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserForMainThread]; + self.savePasswordSwitch.on = activeUser.saveKey; + self.defaultTypeLabel.text = [[MPiOSAppDelegate get].key.algorithm shortNameOfType:activeUser.defaultType]; + + [super viewWillAppear:animated]; +} + +- (void)viewDidAppear:(BOOL)animated { + +#ifdef LOCALYTICS + [[LocalyticsSession sharedLocalyticsSession] tagScreen:@"Preferences"]; +#endif + + [super viewDidAppear:animated]; +} + +- (void)viewWillDisappear:(BOOL)animated { + + inf(@"Preferences will disappear"); + [super viewWillDisappear:animated]; +} + +- (BOOL)canBecomeFirstResponder { + + return YES; +} + +- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event { + + if (motion == UIEventSubtypeMotionShake) { + MPCheckpoint( MPCheckpointLogs, @{ + @"trace" : [MPiOSConfig get].traceMode + } ); + [self performSegueWithIdentifier:@"MP_Logs" sender:self]; + } +} + +- (BOOL)shouldAutorotate { + + return NO; +} + +- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { + + return UIInterfaceOrientationPortrait; +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + + if ([[segue identifier] isEqualToString:@"MP_ChooseType"]) + ((MPTypeViewController *)[segue destinationViewController]).delegate = self; +} + +#pragma mark - UITableViewDelegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + + UITableViewCell *cell = [self tableView:tableView cellForRowAtIndexPath:indexPath]; + if (cell == self.exportCell) + [[MPiOSAppDelegate get] showExportForVC:self]; + + else if (cell == self.changeMPCell) { + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *moc) { + MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserInContext:moc]; + [[MPiOSAppDelegate get] changeMasterPasswordFor:activeUser saveInContext:moc didResetBlock:nil]; + }]; + } + + [tableView deselectRowAtIndexPath:indexPath animated:YES]; +} + +#pragma mark - MPTypeDelegate + +- (void)didSelectType:(MPElementType)type { + + self.defaultTypeLabel.text = [[MPiOSAppDelegate get].key.algorithm shortNameOfType:type]; + + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserInContext:context]; + activeUser.defaultType = type; + [context saveToStore]; + }]; +} + +- (MPElementType)selectedType { + + return [[MPiOSAppDelegate get] activeUserForMainThread].defaultType; +} + +#pragma mark - IBActions + +- (IBAction)didToggleSwitch:(UISwitch *)sender { + + if (sender == self.savePasswordSwitch) + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *moc) { + MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserInContext:moc]; + if ((activeUser.saveKey = sender.on)) + [[MPiOSAppDelegate get] storeSavedKeyFor:activeUser]; + else + [[MPiOSAppDelegate get] forgetSavedKeyFor:activeUser]; + [moc saveToStore]; + }]; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPSetupViewController.m b/MasterPassword/ObjC/iOS/MPSetupViewController.m index 34495bba..4b812d52 100644 --- a/MasterPassword/ObjC/iOS/MPSetupViewController.m +++ b/MasterPassword/ObjC/iOS/MPSetupViewController.m @@ -54,12 +54,4 @@ [self dismissViewControllerAnimated:YES completion:nil]; } -- (IBAction)showGuide:(UIBarButtonItem *)sender { - - [MPiOSConfig get].showSetup = @NO; - [self dismissViewControllerAnimated:YES completion:^{ - [[MPiOSAppDelegate get] showGuide]; - }]; -} - @end diff --git a/MasterPassword/ObjC/iOS/MPUnlockViewController.m b/MasterPassword/ObjC/iOS/MPUnlockViewController.m index 58143131..228b1f8d 100644 --- a/MasterPassword/ObjC/iOS/MPUnlockViewController.m +++ b/MasterPassword/ObjC/iOS/MPUnlockViewController.m @@ -46,15 +46,15 @@ [alert addSubview:alertAvatarScrollView]; CGPoint selectedOffset = CGPointZero; - for (int a = 0; a < MPAvatarCount; ++a) { + for (NSUInteger a = 0; a < MPAvatarCount; ++a) { UIButton *avatar = [self.avatarTemplate cloneAddedTo:alertAvatarScrollView]; - avatar.tag = a; + avatar.tag = (NSInteger)a; avatar.hidden = NO; avatar.center = CGPointMake( (20 + self.avatarTemplate.bounds.size.width / 2) * (a + 1) + self.avatarTemplate.bounds.size.width / 2 * a, 20 + self.avatarTemplate.bounds.size.height / 2 ); - [avatar setBackgroundImage:[UIImage imageNamed:PearlString( @"avatar-%d", a )] forState:UIControlStateNormal]; + [avatar setBackgroundImage:[UIImage imageNamed:PearlString( @"avatar-%ld", (long)a )] forState:UIControlStateNormal]; [avatar setSelectionInSuperviewCandidate:YES isClearable:NO]; avatar.layer.cornerRadius = avatar.bounds.size.height / 2; @@ -102,11 +102,7 @@ UILabel *alertNameLabel = [self.nameLabel cloneAddedTo:container]; alertNameLabel.center = alertAvatar.center; alertNameLabel.text = user.name; - alertNameLabel.bounds = CGRectSetHeight( alertNameLabel.bounds, - [alertNameLabel.text sizeWithFont:self.nameLabel.font - constrainedToSize:CGSizeMake( alertNameLabel.bounds.size.width - 10, - 100 ) - lineBreakMode:self.nameLabel.lineBreakMode].height ); + [alertNameLabel sizeToFit]; alertNameLabel.layer.cornerRadius = 5; alertNameLabel.backgroundColor = [UIColor blackColor]; } @@ -166,11 +162,11 @@ self.wordList = wordListLines; self.wordWall.alpha = 0; - [self.wordWall enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) { + [self.wordWall enumerateViews:^(UIView *subview, BOOL *stop, BOOL *recurse) { UILabel *wordLabel = (UILabel *)subview; [self initializeWordLabel:wordLabel]; - } recurse:NO]; + } recurse:NO]; [[NSNotificationCenter defaultCenter] addObserverForName:USMStoreDidChangeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock: @@ -276,12 +272,6 @@ [super viewWillDisappear:animated]; } -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - - if ([segue.identifier isEqualToString:@"MP_Settings"]) - [self.navigationController setNavigationBarHidden:NO animated:YES]; -} - - (BOOL)prefersStatusBarHidden { return YES; @@ -292,6 +282,12 @@ return UIStatusBarAnimationSlide; } +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + + if ([segue.identifier isEqualToString:@"MP_Settings"]) + [self.navigationController setNavigationBarHidden:NO animated:YES]; +} + - (BOOL)canBecomeFirstResponder { return YES; @@ -368,7 +364,7 @@ avatar.layer.shadowRadius = 20; avatar.layer.masksToBounds = NO; avatar.backgroundColor = [UIColor clearColor]; - avatar.tag = user.avatar; + avatar.tag = (NSInteger)user.avatar; [avatar setBackgroundImage:[UIImage imageNamed:PearlString( @"avatar-%lu", (unsigned long)user.avatar )] forState:UIControlStateNormal]; @@ -420,8 +416,7 @@ - (void)didSelectNewUserAvatar:(UIButton *)newUserAvatar { if (![MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { - MPUserEntity *newUser = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass( [MPUserEntity class] ) - inManagedObjectContext:context]; + MPUserEntity *newUser = [MPUserEntity insertNewObjectInContext:context]; [self showNewUserNameAlertFor:newUser saveInContext:context completion:^(BOOL finished) { newUserAvatar.selected = NO; @@ -590,7 +585,7 @@ targetedUser = [self userForAvatar:targetedAvatar inContext:[MPiOSAppDelegate managedObjectContextForMainThreadIfReady]]; } - [self.avatarsView enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) { + [self.avatarsView enumerateViews:^(UIView *subview, BOOL *stop, BOOL *recurse) { if (![[self.avatarToUserOID allKeys] containsObject:[NSValue valueWithNonretainedObject:subview]]) // This subview is not one of the user avatars. return; @@ -599,10 +594,10 @@ BOOL isTargeted = avatar == targetedAvatar; avatar.userInteractionEnabled = isTargeted; - avatar.alpha = isTargeted? 1: [self selectedUserForThread]? 0.1: 0.4; + avatar.alpha = isTargeted? 1: [self selectedUserForThread]? 0.1F: 0.4F; [self updateAvatarShadowColor:avatar isTargeted:isTargeted]; - } recurse:NO]; + } recurse:NO]; if (allowScroll) { CGPoint targetContentOffset = CGPointMake( @@ -614,10 +609,7 @@ // Lay out user name label. self.nameLabel.text = targetedAvatar? (targetedUser? targetedUser.name: @"New User"): nil; - self.nameLabel.bounds = CGRectSetHeight( self.nameLabel.bounds, - [self.nameLabel.text sizeWithFont:self.nameLabel.font - constrainedToSize:CGSizeMake( self.nameLabel.bounds.size.width - 10, 100 ) - lineBreakMode:self.nameLabel.lineBreakMode].height ); + [self.nameLabel sizeToFit]; self.oldNameLabel.bounds = self.nameLabel.bounds; if (completion) completion( YES ); @@ -625,22 +617,22 @@ - (void)beginWordWallAnimation { - [self.wordWall enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) { + [self.wordWall enumerateViews:^(UIView *subview, BOOL *stop, BOOL *recurse) { UILabel *wordLabel = (UILabel *)subview; if (wordLabel.frame.origin.x < -self.wordWall.frame.size.width / 3) { wordLabel.frame = CGRectSetX( wordLabel.frame, wordLabel.frame.origin.x + self.wordWall.frame.size.width ); [self initializeWordLabel:wordLabel]; } - } recurse:NO]; + } recurse:NO]; if (self.wordWallAnimating) [UIView animateWithDuration:15 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ - [self.wordWall enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) { + [self.wordWall enumerateViews:^(UIView *subview, BOOL *stop, BOOL *recurse) { UILabel *wordLabel = (UILabel *)subview; wordLabel.frame = CGRectSetX( wordLabel.frame, wordLabel.frame.origin.x - self.wordWall.frame.size.width / 3 ); - } recurse:NO]; + } recurse:NO]; } completion:^(BOOL finished) { if (finished) [self beginWordWallAnimation]; @@ -649,7 +641,7 @@ - (void)initializeWordLabel:(UILabel *)wordLabel { - wordLabel.alpha = 0.05 + (random() % 35) / 100.0F; + wordLabel.alpha = 0.05F + (random() % 35) / 100.0F; wordLabel.text = (self.wordList)[(NSUInteger)random() % [self.wordList count]]; } @@ -725,7 +717,7 @@ - (void)setSpinnerActive:(BOOL)active { - PearlMainThread(^{ + PearlMainQueue( ^{ CABasicAnimation *rotate = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; rotate.toValue = [NSNumber numberWithDouble:2 * M_PI]; rotate.duration = 5.0; @@ -751,7 +743,7 @@ else [self avatarForUser:[self selectedUserForThread]].backgroundColor = self.avatarTemplate.backgroundColor; }]; - }); + } ); } - (void)updateAvatarShadowColor:(UIButton *)avatar isTargeted:(BOOL)targeted { @@ -1132,9 +1124,9 @@ - (IBAction)google:(id)sender { - id shareDialog = [[GPPShare sharedInstance] shareDialog]; - [[[shareDialog setURLToShare:[NSURL URLWithString:@"http://masterpasswordapp.com"]] - setPrefillText:@"I've started doing passwords properly thanks to Master Password."] open]; +// id shareDialog = [[GPPShare sharedInstance] shareDialog]; +// [[[shareDialog setURLToShare:[NSURL URLWithString:@"http://masterpasswordapp.com"]] +// setPrefillText:@"I've started doing passwords properly thanks to Master Password."] open]; } - (IBAction)mail:(id)sender { @@ -1186,7 +1178,7 @@ } if (buttonIndex == [sheet firstOtherButtonIndex] + 3) { // Mailing List - [PearlEMail sendEMailTo:@"masterpassword-join@lists.lyndir.com" subject:@"Subscribe" + [PearlEMail sendEMailTo:@"masterpassword-join@lists.lyndir.com" fromVC:self subject:@"Subscribe" body:@"Press 'Send' now to subscribe to the Master Password mailing list.\n\n" @"You'll be kept up-to-date on the evolution of and discussions revolving Master Password."]; return; diff --git a/MasterPassword/ObjC/iOS/MPUsersViewController.h b/MasterPassword/ObjC/iOS/MPUsersViewController.h new file mode 100644 index 00000000..d3866669 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPUsersViewController.h @@ -0,0 +1,46 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPCombinedViewController.h +// MPCombinedViewController +// +// Created by lhunath on 2014-03-08. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "LLGitTip.h" + +@interface MPUsersViewController : UIViewController + +@property (strong, nonatomic) IBOutlet UINavigationBar *navigationBar; +@property(weak, nonatomic) IBOutlet UIView *userSelectionContainer; +@property(weak, nonatomic) IBOutlet UIButton *marqueeButton; +@property(weak, nonatomic) IBOutlet UIView *gitTipTip; +@property(weak, nonatomic) IBOutlet LLGitTip *gitTipButton; +@property(weak, nonatomic) IBOutlet UITextField *entryField; +@property(weak, nonatomic) IBOutlet UILabel *entryLabel; +@property(weak, nonatomic) IBOutlet UILabel *entryTipTitleLabel; +@property(weak, nonatomic) IBOutlet UILabel *entryTipSubtitleLabel; +@property(weak, nonatomic) IBOutlet UIView *entryTipContainer; +@property(weak, nonatomic) IBOutlet UIView *entryContainer; +@property(weak, nonatomic) IBOutlet UIView *footerContainer; +@property(weak, nonatomic) IBOutlet UIActivityIndicatorView *storeLoadingActivity; +@property(weak, nonatomic) IBOutlet UICollectionView *avatarCollectionView; +@property (strong, nonatomic) IBOutlet NSLayoutConstraint *navigationBarToTopConstraint; +@property (strong, nonatomic) IBOutlet UIButton *nextAvatarButton; +@property (strong, nonatomic) IBOutlet UIButton *previousAvatarButton; + +@property(assign, nonatomic) BOOL active; + +- (void)setActive:(BOOL)active animated:(BOOL)animated; +- (IBAction)changeAvatar:(UIButton *)sender; + +@end diff --git a/MasterPassword/ObjC/iOS/MPUsersViewController.m b/MasterPassword/ObjC/iOS/MPUsersViewController.m new file mode 100644 index 00000000..9e0a9d3a --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPUsersViewController.m @@ -0,0 +1,833 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPCombinedViewController.h +// MPCombinedViewController +// +// Created by lhunath on 2014-03-08. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPUsersViewController.h" +#import "MPEntities.h" +#import "MPAvatarCell.h" +#import "MPiOSAppDelegate.h" +#import "MPAppDelegate_Store.h" +#import "MPAppDelegate_Key.h" +#import "PearlSizedTextView.h" +#import "MPWebViewController.h" + +typedef NS_ENUM(NSUInteger, MPActiveUserState) { + /** The users are all inactive */ + MPActiveUserStateNone, + /** The selected user is activated and being logged in with */ + MPActiveUserStateLogin, + /** The selected user is activated and its user name is being asked for */ + MPActiveUserStateUserName, + /** The selected user is activated and its new master password is being asked for */ + MPActiveUserStateMasterPasswordChoice, + /** The selected user is activated and the confirmation of the previously entered master password is being asked for */ + MPActiveUserStateMasterPasswordConfirmation, + /** The selected user is activated displayed at the top with the rest of the UI inactive */ + MPActiveUserStateMinimized, +}; + +@interface MPUsersViewController() + +@property(nonatomic) MPActiveUserState activeUserState; +@property(nonatomic, strong) NSArray *userIDs; +@property(nonatomic, strong) NSTimer *marqueeTipTimer; +@property(nonatomic, strong) NSArray *marqueeTipTexts; +@property(nonatomic) NSUInteger marqueeTipTextIndex; +@end + +@implementation MPUsersViewController { + __weak id _storeObserver; + __weak id _mocObserver; + NSArray *_notificationObservers; + NSString *_masterPasswordChoice; + NSOperationQueue *_afterUpdates; +} + +- (void)viewDidLoad { + + [super viewDidLoad]; + + _afterUpdates = [NSOperationQueue new]; + + self.marqueeTipTexts = @[ + strl( @"Thanks, lhunath ➚" ), + strl( @"Press and hold to delete or reset user." ), + strl( @"Shake for emergency generator." ), + ]; + + self.view.backgroundColor = [UIColor clearColor]; + self.avatarCollectionView.allowsMultipleSelection = YES; + [self.entryField addTarget:self action:@selector(textFieldEditingChanged:) forControlEvents:UIControlEventEditingChanged]; + + [self setActive:YES animated:NO]; +} + +- (void)viewWillAppear:(BOOL)animated { + + [super viewWillAppear:animated]; + + self.userSelectionContainer.alpha = 0; + + [self observeStore]; + [self registerObservers]; + [self reloadUsers]; + + [self.marqueeTipTimer invalidate]; + self.marqueeTipTimer = [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(firedMarqueeTimer:) + userInfo:nil repeats:YES]; + [self firedMarqueeTimer:nil]; +} + +- (void)viewWillDisappear:(BOOL)animated { + + [super viewWillDisappear:animated]; + + [self removeObservers]; + [self stopObservingStore]; + + [self.marqueeTipTimer invalidate]; +} + +- (void)viewDidLayoutSubviews { + + [super viewDidLayoutSubviews]; + + [self.avatarCollectionView.collectionViewLayout invalidateLayout]; +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + + if ([segue.identifier isEqualToString:@"web"]) + ((MPWebViewController *)segue.destinationViewController).initialURL = [NSURL URLWithString:@"http://thanks.lhunath.com"]; +} + +#pragma mark - UITextFieldDelegate + +- (void)textFieldDidEndEditing:(UITextField *)textField { +} + +- (BOOL)textFieldShouldReturn:(UITextField *)textField { + + if (textField == self.entryField) { + switch (self.activeUserState) { + case MPActiveUserStateNone: { + [textField resignFirstResponder]; + break; + } + case MPActiveUserStateLogin: { + [self.entryField endEditing:YES]; + [self selectedAvatar].spinnerActive = YES; + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + BOOL signedIn = NO, isNew = NO; + MPUserEntity *user = [self selectedUserInContext:context isNew:&isNew]; + if (!isNew && user) + signedIn = [[MPiOSAppDelegate get] signInAsUser:user saveInContext:context + usingMasterPassword:self.entryField.text]; + + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + self.entryField.text = @""; + [self selectedAvatar].spinnerActive = NO; + + if (!signedIn) { + // Sign in failed. + [self showEntryTip:strl( @"Looks like a typo!\nTry again; that password was incorrect." )]; + return; + } + }]; + }]; + break; + } + case MPActiveUserStateUserName: { + NSString *userName = self.entryField.text; + if (![userName length]) { + // No name entered. + [self showEntryTip:strl( @"First, enter your name." )]; + return NO; + } + + [self selectedAvatar].name = userName; + self.activeUserState = MPActiveUserStateMasterPasswordChoice; + break; + } + case MPActiveUserStateMasterPasswordChoice: { + NSString *masterPassword = self.entryField.text; + if (![masterPassword length]) { + // No password entered. + [self showEntryTip:strl( @"Pick a master password." )]; + return NO; + } + + self.activeUserState = MPActiveUserStateMasterPasswordConfirmation; + break; + } + case MPActiveUserStateMasterPasswordConfirmation: { + NSString *masterPassword = self.entryField.text; + if (![masterPassword length]) { + // No password entered. + [self showEntryTip:strl( @"Confirm your master password." )]; + return NO; + } + + if (![masterPassword isEqualToString:_masterPasswordChoice]) { + // Master password confirmation failed. + [self showEntryTip:strl( @"Looks like a typo!\nTry again; enter your master password twice." )]; + self.activeUserState = MPActiveUserStateMasterPasswordChoice; + return NO; + } + + [self.entryField endEditing:YES]; + MPAvatarCell *avatarCell = [self selectedAvatar]; + avatarCell.spinnerActive = YES; + if (![MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + BOOL isNew = NO; + MPUserEntity *user = [self userForAvatar:avatarCell inContext:context isNew:&isNew]; + if (isNew) { + user = [MPUserEntity insertNewObjectInContext:context]; + user.avatar = avatarCell.avatar; + user.name = avatarCell.name; + } + + BOOL signedIn = [[MPiOSAppDelegate get] signInAsUser:user saveInContext:context usingMasterPassword:masterPassword]; + PearlMainQueue( ^{ + self.entryField.text = @""; + [self selectedAvatar].spinnerActive = NO; + + if (!signedIn) { + // Sign in failed, shouldn't happen for a new user. + [self showEntryTip:strl( @"Couldn't create new user." )]; + self.activeUserState = MPActiveUserStateNone; + return; + } + } ); + }]) + avatarCell.spinnerActive = NO; + + break; + } + case MPActiveUserStateMinimized: { + [textField resignFirstResponder]; + break; + } + } + } + + return NO; +} + +// This isn't really in UITextFieldDelegate. We fake it from UITextFieldTextDidChangeNotification. +- (void)textFieldEditingChanged:(UITextField *)textField { + + if (textField == self.entryField) { + switch (self.activeUserState) { + case MPActiveUserStateNone: + break; + case MPActiveUserStateLogin: + break; + case MPActiveUserStateUserName: { + NSString *userName = self.entryField.text; + [self selectedAvatar].name = [userName length]? userName: strl( @"New User" ); + break; + } + case MPActiveUserStateMasterPasswordChoice: + break; + case MPActiveUserStateMasterPasswordConfirmation: + break; + case MPActiveUserStateMinimized: + break; + } + } +} + +#pragma mark - UICollectionViewDelegateFlowLayout + +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout + sizeForItemAtIndexPath:(NSIndexPath *)indexPath { + + if (collectionView == self.avatarCollectionView) { + CGSize parentSize = self.avatarCollectionView.bounds.size; + return CGSizeMake( parentSize.width / 2, parentSize.height ); + } + + Throw(@"unexpected collection view: %@", collectionView); +} + +#pragma mark - UICollectionViewDataSource + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + + if (collectionView == self.avatarCollectionView) + return [self.userIDs count] + 1; + + Throw(@"unexpected collection view: %@", collectionView); +} + +- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + + if (collectionView == self.avatarCollectionView) { + MPAvatarCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:[MPAvatarCell reuseIdentifier] forIndexPath:indexPath]; + [cell addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(didLongPress:)]]; + [self updateModeForAvatar:cell atIndexPath:indexPath animated:NO]; + [self updateVisibilityForAvatar:cell atIndexPath:indexPath animated:NO]; + + BOOL isNew = NO; + MPUserEntity *user = [self userForIndexPath:indexPath inContext:[MPiOSAppDelegate managedObjectContextForMainThreadIfReady] + isNew:&isNew]; + if (isNew) + // New User + cell.avatar = MPAvatarAdd; + else { + // Existing User + cell.avatar = user.avatar; + cell.name = user.name; + } + + return cell; + } + + Throw(@"unexpected collection view: %@", collectionView); +} + +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { + + if (collectionView == self.avatarCollectionView) { + [self.avatarCollectionView scrollToItemAtIndexPath:indexPath + atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES]; + + // Deselect all other cells. + for (NSUInteger otherItem = 0; otherItem < [collectionView numberOfItemsInSection:indexPath.section]; ++otherItem) + if (otherItem != indexPath.item) { + NSIndexPath *otherIndexPath = [NSIndexPath indexPathForItem:otherItem inSection:indexPath.section]; + [collectionView deselectItemAtIndexPath:otherIndexPath animated:YES]; + } + + BOOL isNew = NO; + MPUserEntity *user = [self userForIndexPath:indexPath inContext:[MPiOSAppDelegate managedObjectContextForMainThreadIfReady] + isNew:&isNew]; + + if (isNew) + self.activeUserState = MPActiveUserStateUserName; + else if (!user.keyID) + self.activeUserState = MPActiveUserStateMasterPasswordChoice; + else + self.activeUserState = MPActiveUserStateLogin; + } +} + +- (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath { + + if (collectionView == self.avatarCollectionView) + self.activeUserState = MPActiveUserStateNone; +} + +#pragma mark - UILongPressGestureRecognizer + +- (void)didLongPress:(UILongPressGestureRecognizer *)recognizer { + + if ([recognizer.view isKindOfClass:[MPAvatarCell class]]) { + if (recognizer.state != UIGestureRecognizerStateBegan) + // Don't show the action menu unless the state is Began. + return; + + MPAvatarCell *avatarCell = (MPAvatarCell *)recognizer.view; + NSManagedObjectContext *mainContext = [MPiOSAppDelegate managedObjectContextForMainThreadIfReady]; + + BOOL isNew = NO; + MPUserEntity *user = [self userForAvatar:avatarCell inContext:mainContext isNew:&isNew]; + NSManagedObjectID *userID = user.objectID; + if (isNew || !user) + return; + + [PearlSheet showSheetWithTitle:user.name + viewStyle:UIActionSheetStyleBlackTranslucent + initSheet:nil tappedButtonBlock:^(UIActionSheet *sheet, NSInteger buttonIndex) { + if (buttonIndex == [sheet cancelButtonIndex]) + return; + + if (buttonIndex == [sheet destructiveButtonIndex]) { + // Delete User + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + MPUserEntity *user_ = [MPUserEntity existingObjectWithID:userID inContext:context]; + if (!user_) + return; + + [context deleteObject:user_]; + [context saveToStore]; + }]; + return; + } + + if (buttonIndex == [sheet firstOtherButtonIndex]) + // Reset Password + [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { + MPUserEntity *user_ = [MPUserEntity existingObjectWithID:userID inContext:context]; + if (!user_) + return; + + [[MPiOSAppDelegate get] changeMasterPasswordFor:user_ saveInContext:context didResetBlock:^{ + PearlMainQueue( ^{ + NSIndexPath *avatarIndexPath = [self.avatarCollectionView indexPathForCell:avatarCell]; + [self.avatarCollectionView selectItemAtIndexPath:avatarIndexPath animated:NO + scrollPosition:UICollectionViewScrollPositionNone]; + [self collectionView:self.avatarCollectionView didSelectItemAtIndexPath:avatarIndexPath]; + } ); + }]; + }]; + } cancelTitle:[PearlStrings get].commonButtonCancel + destructiveTitle:@"Delete User" otherTitles:@"Reset Password", nil]; + } +} + +#pragma mark - UIScrollViewDelegate + +- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity + targetContentOffset:(inout CGPoint *)targetContentOffset { + + if (scrollView == self.avatarCollectionView) { + CGPoint offsetToCenter = self.avatarCollectionView.center; + NSIndexPath *avatarIndexPath = [self.avatarCollectionView indexPathForItemAtPoint: + CGPointPlusCGPoint( *targetContentOffset, offsetToCenter )]; + CGPoint targetCenter = [self.avatarCollectionView layoutAttributesForItemAtIndexPath:avatarIndexPath].center; + *targetContentOffset = CGPointMinusCGPoint( targetCenter, offsetToCenter ); + NSAssert([self.avatarCollectionView indexPathForItemAtPoint:targetCenter].item == avatarIndexPath.item, @"should be same item"); + } +} + +#pragma mark - Private + +- (void)showEntryTip:(NSString *)message { + + NSUInteger newlineIndex = [message rangeOfString:@"\n"].location; + NSString *messageTitle = newlineIndex == NSNotFound? message: [message substringToIndex:newlineIndex]; + NSString *messageSubtitle = newlineIndex == NSNotFound? nil: [message substringFromIndex:newlineIndex]; + self.entryTipTitleLabel.text = messageTitle; + self.entryTipSubtitleLabel.text = messageSubtitle; + + [UIView animateWithDuration:0.3f animations:^{ + self.entryTipContainer.alpha = 1; + } completion:^(BOOL finished) { + if (finished) + PearlMainQueueAfter( 4, ^{ + [UIView animateWithDuration:0.3f animations:^{ + self.entryTipContainer.alpha = 0; + }]; + } ); + }]; +} + +- (void)firedMarqueeTimer:(NSTimer *)timer { + + NSString *nextMarqueeString = self.marqueeTipTexts[self.marqueeTipTextIndex++ % [self.marqueeTipTexts count]]; + if ([nextMarqueeString isEqualToString:[self.marqueeButton titleForState:UIControlStateNormal]]) + return; + + [UIView animateWithDuration:timer? 0.5: 0 animations:^{ + self.marqueeButton.alpha = 0; + } completion:^(BOOL finished) { + if (!finished) + return; + + [self.marqueeButton setTitle:nextMarqueeString forState:UIControlStateNormal]; + [UIView animateWithDuration:timer? 0.5: 0 animations:^{ + self.marqueeButton.alpha = 0.5; + }]; + }]; +} + +- (MPAvatarCell *)selectedAvatar { + + NSArray *selectedIndexPaths = self.avatarCollectionView.indexPathsForSelectedItems; + if (![selectedIndexPaths count]) { + // No selected user. + return nil; + } + + return (MPAvatarCell *)[self.avatarCollectionView cellForItemAtIndexPath:selectedIndexPaths.firstObject]; +} + +- (MPUserEntity *)selectedUserInContext:(NSManagedObjectContext *)context isNew:(BOOL *)isNew { + + MPAvatarCell *selectedAvatar = [self selectedAvatar]; + if (!selectedAvatar) { + // No selected user. + *isNew = NO; + return nil; + } + + return [self userForAvatar:selectedAvatar inContext:context isNew:isNew]; +} + +- (MPUserEntity *)userForAvatar:(MPAvatarCell *)cell inContext:(NSManagedObjectContext *)context isNew:(BOOL *)isNew { + + return [self userForIndexPath:[self.avatarCollectionView indexPathForCell:cell] inContext:context isNew:isNew]; +} + +- (MPUserEntity *)userForIndexPath:(NSIndexPath *)indexPath inContext:(NSManagedObjectContext *)context isNew:(BOOL *)isNew { + + if ((*isNew = indexPath.item >= [self.userIDs count])) + return nil; + + return [MPUserEntity existingObjectWithID:self.userIDs[indexPath.item] inContext:context]; +} + +- (void)updateAvatars { + + self.previousAvatarButton.alpha = 0; + self.nextAvatarButton.alpha = 0; + for (NSIndexPath *indexPath in self.avatarCollectionView.indexPathsForVisibleItems) + [self updateAvatarAtIndexPath:indexPath]; +} + +- (void)updateAvatarAtIndexPath:(NSIndexPath *)indexPath { + + MPAvatarCell *cell = (MPAvatarCell *)[self.avatarCollectionView cellForItemAtIndexPath:indexPath]; + [self updateModeForAvatar:cell atIndexPath:indexPath animated:NO]; + [self updateVisibilityForAvatar:cell atIndexPath:indexPath animated:NO]; +} + +- (void)updateModeForAvatar:(MPAvatarCell *)avatarCell atIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated { + + switch (self.activeUserState) { + case MPActiveUserStateNone: { + [self.avatarCollectionView deselectItemAtIndexPath:indexPath animated:YES]; + [avatarCell setMode:MPAvatarModeLowered animated:animated]; + break; + } + case MPActiveUserStateLogin: + case MPActiveUserStateUserName: + case MPActiveUserStateMasterPasswordChoice: + case MPActiveUserStateMasterPasswordConfirmation: { + if ([self.avatarCollectionView.indexPathsForSelectedItems containsObject:indexPath]) + [avatarCell setMode:MPAvatarModeRaisedAndActive animated:animated]; + else + [avatarCell setMode:MPAvatarModeRaisedButInactive animated:animated]; + break; + } + case MPActiveUserStateMinimized: { + if ([self.avatarCollectionView.indexPathsForSelectedItems containsObject:indexPath]) + [avatarCell setMode:MPAvatarModeRaisedAndMinimized animated:animated]; + else + [avatarCell setMode:MPAvatarModeRaisedAndHidden animated:animated]; + break; + } + } +} + +- (void)updateVisibilityForAvatar:(MPAvatarCell *)cell atIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated { + + CGFloat current = [self.avatarCollectionView layoutAttributesForItemAtIndexPath:indexPath].center.x - + self.avatarCollectionView.contentOffset.x; + CGFloat max = self.avatarCollectionView.bounds.size.width; + + CGFloat visibility = MAX(0, MIN( 1, 1 - ABS( current / (max / 2) - 1 ) )); + [cell setVisibility:visibility animated:animated]; + + if (cell.newUser) { + self.previousAvatarButton.alpha = cell.mode == MPAvatarModeRaisedAndActive? visibility * 0.7f: 0; + self.nextAvatarButton.alpha = cell.mode == MPAvatarModeRaisedAndActive? visibility * 0.7f: 0; + } +} + +- (void)afterUpdatesMainQueue:(void (^)(void))block { + + [_afterUpdates addOperationWithBlock:^{ + PearlMainQueue( block ); + }]; +} + +- (void)registerObservers { + + if ([_notificationObservers count]) + return; + + Weakify(self); + _notificationObservers = @[ + [[NSNotificationCenter defaultCenter] + addObserverForName:UIApplicationWillResignActiveNotification object:nil + queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + Strongify(self); + +// [self emergencyCloseAnimated:NO]; + self.userSelectionContainer.alpha = 0; + }], + [[NSNotificationCenter defaultCenter] + addObserverForName:UIApplicationDidBecomeActiveNotification object:nil + queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + Strongify(self); + + [self reloadUsers]; + + [UIView animateWithDuration:1 animations:^{ + self.userSelectionContainer.alpha = 1; + }]; + }], + ]; + + [self observeKeyPath:@"avatarCollectionView.contentOffset" withBlock: + ^(id from, id to, NSKeyValueChange cause, MPUsersViewController *_self) { + [_self updateAvatars]; + }]; +} + +- (void)removeObservers { + + for (id observer in _notificationObservers) + [[NSNotificationCenter defaultCenter] removeObserver:observer]; + _notificationObservers = nil; + + [self removeKeyPathObservers]; +} + +- (void)observeStore { + + Weakify(self); + + NSManagedObjectContext *mainContext = [MPiOSAppDelegate managedObjectContextForMainThreadIfReady]; + [UIView animateWithDuration:0.3f animations:^{ + self.avatarCollectionView.alpha = mainContext? 1: 0; + }]; + if (mainContext && self.storeLoadingActivity.isAnimating) + [self.storeLoadingActivity stopAnimating]; + if (!mainContext && !self.storeLoadingActivity.isAnimating) + [self.storeLoadingActivity startAnimating]; + + if (!_mocObserver && mainContext) + _mocObserver = [[NSNotificationCenter defaultCenter] + addObserverForName:NSManagedObjectContextObjectsDidChangeNotification object:mainContext + queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + Strongify(self); + NSSet *insertedObjects = note.userInfo[NSInsertedObjectsKey]; + NSSet *deletedObjects = note.userInfo[NSDeletedObjectsKey]; + if ([[NSSetUnion(insertedObjects, deletedObjects) + filteredSetUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) { + return [evaluatedObject isKindOfClass:[MPUserEntity class]]; + }]] count]) + [self reloadUsers]; + }]; + if (!_storeObserver) + _storeObserver = [[NSNotificationCenter defaultCenter] + addObserverForName:USMStoreDidChangeNotification object:nil + queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) { + Strongify(self); + [self reloadUsers]; + }]; +} + +- (void)stopObservingStore { + + if (_mocObserver) + [[NSNotificationCenter defaultCenter] removeObserver:_mocObserver]; + if (_storeObserver) + [[NSNotificationCenter defaultCenter] removeObserver:_storeObserver]; +} + +- (void)reloadUsers { + + [self afterUpdatesMainQueue:^{ + [self observeStore]; + [MPiOSAppDelegate managedObjectContextForMainThreadPerformBlockAndWait:^(NSManagedObjectContext *mainContext) { + NSError *error = nil; + NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPUserEntity class] )]; + fetchRequest.sortDescriptors = @[ + [NSSortDescriptor sortDescriptorWithKey:NSStringFromSelector( @selector(lastUsed) ) ascending:NO] + ]; + NSArray *users = [mainContext executeFetchRequest:fetchRequest error:&error]; + if (!users) { + err(@"Failed to load users: %@", error); + self.userIDs = nil; + } + + NSMutableArray *userIDs = [NSMutableArray arrayWithCapacity:[users count]]; + for (MPUserEntity *user in users) + [userIDs addObject:user.objectID]; + self.userIDs = userIDs; + }]; + }]; +} + +#pragma mark - Properties + +- (void)setActive:(BOOL)active { + + [self setActive:active animated:NO]; +} + +- (void)setActive:(BOOL)active animated:(BOOL)animated { + + _active = active; + dbg(@"active -> %d", active); + + if (active) + [self setActiveUserState:MPActiveUserStateNone animated:animated]; + else + [self setActiveUserState:MPActiveUserStateMinimized animated:animated]; +} + +- (void)setUserIDs:(NSArray *)userIDs { + + _userIDs = userIDs; + dbg(@"userIDs -> %lu", (unsigned long)[userIDs count]); + + PearlMainQueue( ^{ + BOOL isNew = NO; + NSManagedObjectID *selectUserID = [MPiOSAppDelegate get].activeUserOID; + if (!selectUserID) + selectUserID = [self selectedUserInContext:[MPiOSAppDelegate managedObjectContextForMainThreadIfReady] + isNew:&isNew].objectID; + [self.avatarCollectionView reloadData]; + + NSUInteger selectedAvatarItem = isNew? [_userIDs count]: selectUserID? [_userIDs indexOfObject:selectUserID]: NSNotFound; + if (selectedAvatarItem != NSNotFound) + [self.avatarCollectionView selectItemAtIndexPath:[NSIndexPath indexPathForItem:selectedAvatarItem inSection:0] animated:NO + scrollPosition:UICollectionViewScrollPositionCenteredHorizontally]; + + [UIView animateWithDuration:0.3f animations:^{ + self.userSelectionContainer.alpha = 1; + }]; + } ); +} + +- (void)setActiveUserState:(MPActiveUserState)activeUserState { + + [self setActiveUserState:activeUserState animated:YES]; +} + +- (void)setActiveUserState:(MPActiveUserState)activeUserState animated:(BOOL)animated { + + _activeUserState = activeUserState; + _masterPasswordChoice = nil; + + if (activeUserState != MPActiveUserStateMinimized && (!self.active || [MPiOSAppDelegate get].activeUserOID)) { + [[MPiOSAppDelegate get] signOutAnimated:YES]; + return; + } + + [_afterUpdates setSuspended:YES]; + dbg(@"suspend updates"); + __block BOOL requestFirstResponder = NO; + [UIView animateWithDuration:animated? 0.4f: 0 animations:^{ + MPAvatarCell *selectedAvatar = [self selectedAvatar]; + + // Set avatar modes. + for (NSUInteger item = 0; item < [self.avatarCollectionView numberOfItemsInSection:0]; ++item) { + NSIndexPath *indexPath = [NSIndexPath indexPathForItem:item inSection:0]; + MPAvatarCell *avatarCell = (MPAvatarCell *)[self.avatarCollectionView cellForItemAtIndexPath:indexPath]; + [self updateModeForAvatar:avatarCell atIndexPath:indexPath animated:animated]; + [self updateVisibilityForAvatar:avatarCell atIndexPath:indexPath animated:animated]; + + if (selectedAvatar && avatarCell == selectedAvatar) + [self.avatarCollectionView scrollToItemAtIndexPath:indexPath + atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:NO]; + } + + // Set the entry container's contents. + switch (activeUserState) { + case MPActiveUserStateNone: + dbg(@"activeUserState -> none"); + break; + case MPActiveUserStateLogin: { + dbg(@"activeUserState -> login"); + self.entryLabel.text = strl( @"Enter your master password:" ); + self.entryField.text = nil; + self.entryField.secureTextEntry = YES; + self.entryField.autocapitalizationType = UITextAutocapitalizationTypeNone; + break; + } + case MPActiveUserStateUserName: { + dbg(@"activeUserState -> userName"); + self.entryLabel.text = strl( @"Enter your full name:" ); + self.entryField.text = nil; + self.entryField.secureTextEntry = NO; + self.entryField.autocapitalizationType = UITextAutocapitalizationTypeWords; + break; + } + case MPActiveUserStateMasterPasswordChoice: { + dbg(@"activeUserState -> masterPasswordChoice"); + self.entryLabel.text = strl( @"Choose your master password:" ); + self.entryField.text = nil; + self.entryField.secureTextEntry = YES; + self.entryField.autocapitalizationType = UITextAutocapitalizationTypeNone; + break; + } + case MPActiveUserStateMasterPasswordConfirmation: { + dbg(@"activeUserState -> masterPasswordConfirmation"); + _masterPasswordChoice = self.entryField.text; + self.entryLabel.text = strl( @"Confirm your master password:" ); + self.entryField.text = nil; + self.entryField.secureTextEntry = YES; + self.entryField.autocapitalizationType = UITextAutocapitalizationTypeNone; + break; + } + case MPActiveUserStateMinimized: + dbg(@"activeUserState -> minimized"); + break; + } + + // Manage the entry container depending on whether a user is activate or not. + switch (activeUserState) { + case MPActiveUserStateNone: { + self.navigationBarToTopConstraint.priority = UILayoutPriorityDefaultHigh; + self.avatarCollectionView.scrollEnabled = YES; + self.entryContainer.alpha = 0; + self.footerContainer.alpha = 1; + break; + } + case MPActiveUserStateLogin: + case MPActiveUserStateUserName: + case MPActiveUserStateMasterPasswordChoice: + case MPActiveUserStateMasterPasswordConfirmation: { + self.navigationBarToTopConstraint.priority = UILayoutPriorityDefaultHigh; + self.avatarCollectionView.scrollEnabled = NO; + self.entryContainer.alpha = 1; + self.footerContainer.alpha = 1; + requestFirstResponder = YES; + break; + } + case MPActiveUserStateMinimized: { + self.navigationBarToTopConstraint.priority = 1; + self.avatarCollectionView.scrollEnabled = NO; + self.entryContainer.alpha = 0; + self.footerContainer.alpha = 0; + break; + } + } + [self.navigationBarToTopConstraint apply]; + } completion:^(BOOL finished) { + dbg(@"resume updates"); + [_afterUpdates setSuspended:NO]; + }]; + + UIResponder *oldFirstResponder = [UIResponder findFirstResponder]; + if (requestFirstResponder) + [self.entryField becomeFirstResponder]; + else + [self.entryField resignFirstResponder]; + UIResponder *newFirstResponder = [UIResponder findFirstResponder]; + if (newFirstResponder != oldFirstResponder) + dbg(@"first responder: %@ -> %@", oldFirstResponder, newFirstResponder); +} + +#pragma mark - Actions + +- (IBAction)changeAvatar:(UIButton *)sender { + + if (sender == self.previousAvatarButton) + --[self selectedAvatar].avatar; + if (sender == self.nextAvatarButton) + ++[self selectedAvatar].avatar; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPWebViewController.h b/MasterPassword/ObjC/iOS/MPWebViewController.h new file mode 100644 index 00000000..2bbf6286 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPWebViewController.h @@ -0,0 +1,29 @@ +/** + * Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) + * + * See the enclosed file LICENSE for license information (LGPLv3). If you did + * not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt + * + * @author Maarten Billemont + * @license http://www.gnu.org/licenses/lgpl-3.0.txt + */ + +// +// MPWebViewController.h +// MPWebViewController +// +// Created by lhunath on 2014-05-09. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import + + +@interface MPWebViewController : UIViewController + +@property(nonatomic) IBOutlet UIWebView *webView; +@property(nonatomic) IBOutlet UINavigationItem *webNavigationItem; + +@property(nonatomic) NSURL *initialURL; + +@end diff --git a/MasterPassword/ObjC/iOS/MPWebViewController.m b/MasterPassword/ObjC/iOS/MPWebViewController.m new file mode 100644 index 00000000..327244d0 --- /dev/null +++ b/MasterPassword/ObjC/iOS/MPWebViewController.m @@ -0,0 +1,85 @@ +/** +* Copyright Maarten Billemont (http://www.lhunath.com, lhunath@lyndir.com) +* +* See the enclosed file LICENSE for license information (LGPLv3). If you did +* not receive this file, see http://www.gnu.org/licenses/lgpl-3.0.txt +* +* @author Maarten Billemont +* @license http://www.gnu.org/licenses/lgpl-3.0.txt +*/ + +// +// MPWebViewController.h +// MPWebViewController +// +// Created by lhunath on 2014-05-09. +// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. +// + +#import "MPWebViewController.h" + +@implementation MPWebViewController + +- (void)viewDidLoad { + + [super viewDidLoad]; + + [self.view adjustContentInsets]; +} + +- (void)viewWillAppear:(BOOL)animated { + + [super viewWillAppear:animated]; + + if (!self.initialURL) + self.initialURL = [NSURL URLWithString:@"http://masterpasswordapp.com"]; + + self.webView.alpha = 0; + [self.webView loadRequest:[[NSURLRequest alloc] initWithURL:self.initialURL]]; +} + +- (UIStatusBarStyle)preferredStatusBarStyle { + + return UIStatusBarStyleLightContent; +} + +#pragma mark - UIWebViewDelegate + +- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request + navigationType:(UIWebViewNavigationType)navigationType { + + if ([request.URL isEqual:request.mainDocumentURL]) { + self.webNavigationItem.title = request.URL.host; + self.webNavigationItem.prompt = strl( @"Loading" ); + } + + return YES; +} + +- (void)webViewDidStartLoad:(UIWebView *)webView { + + UIActivityIndicatorView *activityView = + [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; + [self.webNavigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithCustomView:activityView]]; + [activityView startAnimating]; +} + +- (void)webViewDidFinishLoad:(UIWebView *)webView { + + [UIView animateWithDuration:0.3 animations:^{ + self.webView.alpha = 1; + }]; + + [self.webNavigationItem setLeftBarButtonItem:[webView canGoBack]? [[UIBarButtonItem alloc] + initWithTitle:@"⬅︎" style:UIBarButtonItemStylePlain target:webView action:@selector( goBack )]: nil]; + self.webNavigationItem.prompt = [webView stringByEvaluatingJavaScriptFromString:@"document.title"]; +} + +#pragma mark - Actions + +- (IBAction)done:(id)sender { + + [self dismissViewControllerAnimated:YES completion:nil]; +} + +@end diff --git a/MasterPassword/ObjC/iOS/MPiOSAppDelegate.h b/MasterPassword/ObjC/iOS/MPiOSAppDelegate.h index 0d67edff..abeb98b5 100644 --- a/MasterPassword/ObjC/iOS/MPiOSAppDelegate.h +++ b/MasterPassword/ObjC/iOS/MPiOSAppDelegate.h @@ -10,16 +10,13 @@ #import #import "MPAppDelegate_Shared.h" -#import @interface MPiOSAppDelegate : MPAppDelegate_Shared -- (void)showGuide; -- (void)showSetup; - (void)showFeedbackWithLogs:(BOOL)logs forVC:(UIViewController *)viewController; - (void)openFeedbackWithLogs:(BOOL)logs forVC:(UIViewController *)viewController; -- (void)export; +- (void)showExportForVC:(UIViewController *)viewController; - (void)changeMasterPasswordFor:(MPUserEntity *)user saveInContext:(NSManagedObjectContext *)moc didResetBlock:(void (^)(void))didReset; @end diff --git a/MasterPassword/ObjC/iOS/MPiOSAppDelegate.m b/MasterPassword/ObjC/iOS/MPiOSAppDelegate.m index 51dfe31a..42359679 100644 --- a/MasterPassword/ObjC/iOS/MPiOSAppDelegate.m +++ b/MasterPassword/ObjC/iOS/MPiOSAppDelegate.m @@ -13,21 +13,24 @@ @interface MPiOSAppDelegate() -@property(nonatomic, strong) PearlAlert *handleCloudContentAlert; -@property(nonatomic, strong) PearlAlert *fixCloudContentAlert; -@property(nonatomic, strong) PearlOverlay *storeLoading; +@property(nonatomic, weak) PearlAlert *handleCloudDisabledAlert; +@property(nonatomic, weak) PearlAlert *handleCloudContentAlert; +@property(nonatomic, weak) PearlAlert *fixCloudContentAlert; +@property(nonatomic, weak) PearlOverlay *storeLoadingOverlay; @end @implementation MPiOSAppDelegate + (void)initialize { - [PearlLogger get].historyLevel = [[MPiOSConfig get].traceMode boolValue]? PearlLogLevelTrace: PearlLogLevelInfo; + if ([self class] == [MPiOSAppDelegate class]) { + [PearlLogger get].historyLevel = [[MPiOSConfig get].traceMode boolValue]? PearlLogLevelTrace: PearlLogLevelInfo; #ifdef DEBUG - [PearlLogger get].printLevel = PearlLogLevelDebug; + [PearlLogger get].printLevel = PearlLogLevelDebug; #else - [PearlLogger get].printLevel = [[MPiOSConfig get].traceMode boolValue]? PearlLogLevelDebug: PearlLogLevelInfo; + [PearlLogger get].printLevel = [[MPiOSConfig get].traceMode boolValue]? PearlLogLevelDebug: PearlLogLevelInfo; #endif + } } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { @@ -59,11 +62,6 @@ TESTFLIGHT_SDK_VERSION, [PearlInfoPlist get].CFBundleName, [PearlInfoPlist get].CFBundleVersion ); } #endif - NSString *googlePlusClientID = [self googlePlusClientID]; - if ([googlePlusClientID length]) { - inf(@"Initializing Google+"); - [[GPPSignIn sharedInstance] setClientID:googlePlusClientID]; - } #ifdef CRASHLYTICS NSString *crashlyticsAPIKey = [self crashlyticsAPIKey]; if ([crashlyticsAPIKey length]) { @@ -113,78 +111,20 @@ #endif } @catch (id exception) { - err(@"During Analytics Setup: %@", exception); - } - @try { - if (floor( NSFoundationVersionNumber ) <= NSFoundationVersionNumber_iOS_6_1) { - UIImage *navBarImage = [[UIImage imageNamed:@"ui_navbar_container"] resizableImageWithCapInsets:UIEdgeInsetsMake( 0, 5, 0, 5 )]; - [[UINavigationBar appearance] setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault]; - [[UINavigationBar appearance] setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsLandscapePhone]; - [[UINavigationBar appearance] setTitleTextAttributes: - @{ - UITextAttributeTextColor : [UIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:1.0f], - UITextAttributeTextShadowColor : [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.8f], - UITextAttributeTextShadowOffset : [NSValue valueWithUIOffset:UIOffsetMake( 0, -1 )], - UITextAttributeFont : [UIFont fontWithName:@"Exo-Bold" size:20.0f] - }]; - - UIImage *navBarButton = [[UIImage imageNamed:@"ui_navbar_button"] resizableImageWithCapInsets:UIEdgeInsetsMake( 0, 5, 0, 5 )]; - UIImage *navBarBack = [[UIImage imageNamed:@"ui_navbar_back"] resizableImageWithCapInsets:UIEdgeInsetsMake( 0, 13, 0, 5 )]; - [[UIBarButtonItem appearance] setBackgroundImage:navBarButton forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; - [[UIBarButtonItem appearance] setBackgroundImage:nil forState:UIControlStateNormal barMetrics:UIBarMetricsLandscapePhone]; - [[UIBarButtonItem appearance] - setBackButtonBackgroundImage:navBarBack forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; - [[UIBarButtonItem appearance] - setBackButtonBackgroundImage:nil forState:UIControlStateNormal barMetrics:UIBarMetricsLandscapePhone]; - [[UIBarButtonItem appearance] setTitleTextAttributes: - @{ - UITextAttributeTextColor : [UIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:1.0f], - UITextAttributeTextShadowColor : [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.5f], - UITextAttributeTextShadowOffset : [NSValue valueWithUIOffset:UIOffsetMake( 0, 1 )]//, - // Causes a bug in iOS where image views get oddly stretched... or something. - //UITextAttributeFont: [UIFont fontWithName:@"HelveticaNeue" size:13.0f] - } - forState:UIControlStateNormal]; - - UIImage *toolBarImage = [[UIImage imageNamed:@"ui_toolbar_container"] - resizableImageWithCapInsets:UIEdgeInsetsMake( 25, 5, 5, 5 )]; - [[UISearchBar appearance] setBackgroundImage:toolBarImage]; - [[UIToolbar appearance] setBackgroundImage:toolBarImage forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault]; - - // UIImage *minImage = [[UIImage imageNamed:@"slider-minimum"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 5, 0, 0)]; - // UIImage *maxImage = [[UIImage imageNamed:@"slider-maximum"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 5, 0, 0)]; - // UIImage *thumbImage = [UIImage imageNamed:@"slider-handle"]; - // - // [[UISlider appearance] setMaximumTrackImage:maxImage forState:UIControlStateNormal]; - // [[UISlider appearance] setMinimumTrackImage:minImage forState:UIControlStateNormal]; - // [[UISlider appearance] setThumbImage:thumbImage forState:UIControlStateNormal]; - // - // UIImage *segmentSelected = [[UIImage imageNamed:@"segcontrol_sel"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 4, 0, 4)]; - // UIImage *segmentUnselected = [[UIImage imageNamed:@"segcontrol_uns"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)]; - // UIImage *segmentSelectedUnselected = [UIImage imageNamed:@"segcontrol_sel-uns"]; - // UIImage *segUnselectedSelected = [UIImage imageNamed:@"segcontrol_uns-sel"]; - // UIImage *segmentUnselectedUnselected = [UIImage imageNamed:@"segcontrol_uns-uns"]; - // - // [[UISegmentedControl appearance] setBackgroundImage:segmentUnselected forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; - // [[UISegmentedControl appearance] setBackgroundImage:segmentSelected forState:UIControlStateSelected barMetrics:UIBarMetricsDefault]; - // - // [[UISegmentedControl appearance] setDividerImage:segmentUnselectedUnselected forLeftSegmentState:UIControlStateNormal rightSegmentState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; - // [[UISegmentedControl appearance] setDividerImage:segmentSelectedUnselected forLeftSegmentState:UIControlStateSelected rightSegmentState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; - // [[UISegmentedControl appearance] setDividerImage:segUnselectedSelected forLeftSegmentState:UIControlStateNormal rightSegmentState:UIControlStateSelected barMetrics:UIBarMetricsDefault]; - } - } - @catch (id exception) { - err(@"During Theme Setup: %@", exception); + err( @"During Analytics Setup: %@", exception ); } @try { [[NSNotificationCenter defaultCenter] addObserverForName:MPCheckConfigNotification object:nil queue:nil usingBlock: ^(NSNotification *note) { - [self checkConfig]; - }]; - [[NSNotificationCenter defaultCenter] - addObserverForName:kIASKAppSettingChanged object:nil queue:nil usingBlock:^(NSNotification *note) { - [[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification - object:note userInfo:nil]; + [self updateFromConfig]; + }]; + [[NSNotificationCenter defaultCenter] addObserverForName:kIASKAppSettingChanged object:nil queue:nil usingBlock: + ^(NSNotification *note) { + [[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification object:note userInfo:nil]; + }]; + [[NSNotificationCenter defaultCenter] addObserverForName:NSUserDefaultsDidChangeNotification object:nil queue:nil usingBlock: + ^(NSNotification *note) { + [[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification object:note userInfo:nil]; }]; #ifdef ADHOC @@ -200,20 +140,43 @@ #endif } @catch (id exception) { - err(@"During Config Test: %@", exception); + err( @"During Config Test: %@", exception ); } @try { [super application:application didFinishLaunchingWithOptions:launchOptions]; } @catch (id exception) { - err(@"During Pearl Application Launch: %@", exception); + err( @"During Pearl Application Launch: %@", exception ); } @try { - inf(@"Started up with device identifier: %@", [PearlKeyChain deviceIdentifier]); + inf( @"Started up with device identifier: %@", [PearlKeyChain deviceIdentifier] ); - dispatch_async( dispatch_get_main_queue(), ^{ + [[NSNotificationCenter defaultCenter] addObserverForName:MPFoundInconsistenciesNotification object:nil queue:nil usingBlock: + ^(NSNotification *note) { + switch ((MPFixableResult)[note.userInfo[MPInconsistenciesFixResultUserKey] unsignedIntegerValue]) { + + case MPFixableResultNoProblems: + break; + case MPFixableResultProblemsFixed: + [PearlAlert showAlertWithTitle:@"Inconsistencies Fixed" message: + @"Some inconsistencies were detected in your sites.\n" + @"All issues were fixed." + viewStyle:UIAlertViewStyleDefault initAlert:nil + tappedButtonBlock:nil cancelTitle:[PearlStrings get].commonButtonOkay otherTitles:nil]; + break; + case MPFixableResultProblemsNotFixed: + [PearlAlert showAlertWithTitle:@"Inconsistencies Found" message: + @"Some inconsistencies were detected in your sites.\n" + @"Not all issues could be fixed. Try signing in to each user or checking the logs." + viewStyle:UIAlertViewStyleDefault initAlert:nil + tappedButtonBlock:nil cancelTitle:[PearlStrings get].commonButtonOkay otherTitles:nil]; + break; + } + }]; + + PearlMainQueue( ^{ if ([[MPiOSConfig get].showSetup boolValue]) - [[MPiOSAppDelegate get] showSetup]; + [self.navigationController performSegueWithIdentifier:@"setup" sender:self]; } ); MPCheckpoint( MPCheckpointStarted, @{ @@ -229,7 +192,7 @@ } ); } @catch (id exception) { - err(@"During Post-Startup: %@", exception); + err( @"During Post-Startup: %@", exception ); } return YES; @@ -242,10 +205,6 @@ if (!url) return NO; - // Google+ - if ([[GPPSignIn sharedInstance] handleURL:url sourceApplication:sourceApplication annotation:annotation]) - return YES; - // Arbitrary URL to mpsites data. dispatch_async( dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 ), ^{ NSError *error; @@ -253,11 +212,11 @@ NSData *importedSitesData = [NSURLConnection sendSynchronousRequest:[NSURLRequest requestWithURL:url] returningResponse:&response error:&error]; if (error) - err(@"While reading imported sites from %@: %@", url, error); + err( @"While reading imported sites from %@: %@", url, error ); if (!importedSitesData) return; - PearlOverlay *activityOverlay = [PearlOverlay showOverlayWithTitle:@"Importing"]; + PearlOverlay *activityOverlay = [PearlOverlay showProgressOverlayWithTitle:@"Importing"]; NSString *importedSitesString = [[NSString alloc] initWithData:importedSitesData encoding:NSUTF8StringEncoding]; MPImportResult result = [self importSites:importedSitesString askImportPassword:^NSString *(NSString *userName) { @@ -294,7 +253,7 @@ dispatch_async( dispatch_get_main_queue(), ^{ [PearlAlert showAlertWithTitle:PearlString( @"Master Password for\n%@", userName ) message:PearlString( @"Imports %lu sites, overwriting %lu.", - (unsigned long)importCount, (unsigned long)deleteCount ) + (unsigned long)importCount, (unsigned long)deleteCount ) viewStyle:UIAlertViewStyleSecureTextInput initAlert:nil tappedButtonBlock:^(UIAlertView *alert_, NSInteger buttonIndex_) { @try { @@ -337,7 +296,7 @@ - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - inf(@"Received memory warning."); + inf( @"Received memory warning." ); [super applicationDidReceiveMemoryWarning:application]; } @@ -374,7 +333,7 @@ - (void)applicationWillResignActive:(UIApplication *)application { - inf(@"Will deactivate"); + inf( @"Will deactivate" ); if (![[MPiOSConfig get].rememberLogin boolValue]) [self signOutAnimated:NO]; @@ -388,9 +347,8 @@ - (void)applicationDidBecomeActive:(UIApplication *)application { - inf(@"Re-activated"); - [[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification - object:application userInfo:nil]; + inf( @"Re-activated" ); + [[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification object:application]; #ifdef LOCALYTICS [[LocalyticsSession sharedLocalyticsSession] resume]; @@ -402,25 +360,11 @@ #pragma mark - Behavior -- (void)showGuide { - - [self.navigationController performSegueWithIdentifier:@"MP_Guide" sender:self]; - - MPCheckpoint( MPCheckpointShowGuide, nil ); -} - -- (void)showSetup { - - [self.navigationController performSegueWithIdentifier:@"MP_Setup" sender:self]; - - MPCheckpoint( MPCheckpointShowSetup, nil ); -} - - (void)showReview { - MPCheckpoint( MPCheckpointReview, nil ); - [super showReview]; + + MPCheckpoint( MPCheckpointReview, nil ); } - (void)showFeedbackWithLogs:(BOOL)logs forVC:(UIViewController *)viewController { @@ -458,14 +402,14 @@ [[[PearlEMail alloc] initForEMailTo:@"Master Password Development " subject:PearlString( @"Feedback for Master Password [%@]", - [[PearlKeyChain deviceIdentifier] stringByDeletingMatchesOf:@"-.*"] ) + [[PearlKeyChain deviceIdentifier] stringByDeletingMatchesOf:@"-.*"] ) body:PearlString( @"\n\n\n" @"--\n" @"%@" @"Master Password %@, build %@", - userName? ([userName stringByAppendingString:@"\n"]): @"", - [PearlInfoPlist get].CFBundleShortVersionString, - [PearlInfoPlist get].CFBundleVersion ) + userName? ([userName stringByAppendingString:@"\n"]): @"", + [PearlInfoPlist get].CFBundleShortVersionString, + [PearlInfoPlist get].CFBundleVersion ) attachments:(logs ? [[PearlEMailAttachment alloc] @@ -479,32 +423,32 @@ showComposerForVC:viewController]; } -- (void)export { +- (void)showExportForVC:(UIViewController *)viewController { [PearlAlert showNotice: @"This will export all your site names.\n\n" @"You can open the export with a text editor to get an overview of all your sites.\n\n" @"The file also acts as a personal backup of your site list in case you don't sync with iCloud/iTunes." tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) { - [PearlAlert showAlertWithTitle:@"Reveal Passwords?" message: - @"Would you like to make all your passwords visible in the export?\n\n" - @"A safe export will only include your stored passwords, in an encrypted manner, " - @"making the result safe from falling in the wrong hands.\n\n" - @"If all your passwords are shown and somebody else finds the export, " - @"they could gain access to all your sites!" - viewStyle:UIAlertViewStyleDefault initAlert:nil - tappedButtonBlock:^(UIAlertView *alert_, NSInteger buttonIndex_) { - if (buttonIndex_ == [alert_ firstOtherButtonIndex] + 0) - // Safe Export - [self exportShowPasswords:NO]; - if (buttonIndex_ == [alert_ firstOtherButtonIndex] + 1) - // Show Passwords - [self exportShowPasswords:YES]; - } cancelTitle:[PearlStrings get].commonButtonCancel otherTitles:@"Safe Export", @"Show Passwords", nil]; - } otherTitles:nil]; + [PearlAlert showAlertWithTitle:@"Reveal Passwords?" message: + @"Would you like to make all your passwords visible in the export?\n\n" + @"A safe export will only include your stored passwords, in an encrypted manner, " + @"making the result safe from falling in the wrong hands.\n\n" + @"If all your passwords are shown and somebody else finds the export, " + @"they could gain access to all your sites!" + viewStyle:UIAlertViewStyleDefault initAlert:nil + tappedButtonBlock:^(UIAlertView *alert_, NSInteger buttonIndex_) { + if (buttonIndex_ == [alert_ firstOtherButtonIndex] + 0) + // Safe Export + [self showExportRevealPasswords:NO forVC:viewController]; + if (buttonIndex_ == [alert_ firstOtherButtonIndex] + 1) + // Show Passwords + [self showExportRevealPasswords:YES forVC:viewController]; + } cancelTitle:[PearlStrings get].commonButtonCancel otherTitles:@"Safe Export", @"Show Passwords", nil]; + } otherTitles:nil]; } -- (void)exportShowPasswords:(BOOL)showPasswords { +- (void)showExportRevealPasswords:(BOOL)revealPasswords forVC:(UIViewController *)viewController { if (![PearlEMail canSendMail]) { [PearlAlert showAlertWithTitle:@"Cannot Send Mail" @@ -517,10 +461,10 @@ return; } - NSString *exportedSites = [self exportSitesShowingPasswords:showPasswords]; + NSString *exportedSites = [self exportSitesRevealPasswords:revealPasswords]; NSString *message; - if (showPasswords) + if (revealPasswords) message = PearlString( @"Export of Master Password sites with passwords included.\n\n" @"REMINDER: Make sure nobody else sees this file! Passwords are visible!\n\n\n" @"--\n" @@ -541,7 +485,7 @@ NSDateFormatter *exportDateFormatter = [NSDateFormatter new]; [exportDateFormatter setDateFormat:@"yyyy'-'MM'-'dd"]; - [PearlEMail sendEMailTo:nil subject:@"Master Password Export" body:message + [PearlEMail sendEMailTo:nil fromVC:viewController subject:@"Master Password Export" body:message attachments:[[PearlEMailAttachment alloc] initWithContent:[exportedSites dataUsingEncoding:NSUTF8StringEncoding] mimeType:@"text/plain" fileName: PearlString( @"%@ (%@).mpsites", [self activeUserForMainThread].name, @@ -549,7 +493,7 @@ nil]; } -- (void)changeMasterPasswordFor:(MPUserEntity *)user saveInContext:(NSManagedObjectContext *)moc didResetBlock:(void (^)(void))didReset { +- (void)changeMasterPasswordFor:(MPUserEntity *)user saveInContext:(NSManagedObjectContext *)moc didResetBlock:(void ( ^ )(void))didReset { [PearlAlert showAlertWithTitle:@"Changing Master Password" message: @@ -562,7 +506,7 @@ return; [moc performBlockAndWait:^{ - inf(@"Unsetting master password for: %@.", user.userID); + inf( @"Unsetting master password for: %@.", user.userID ); user.keyID = nil; [self forgetSavedKeyFor:user]; [moc saveToStore]; @@ -578,16 +522,14 @@ otherTitles:[PearlStrings get].commonButtonContinue, nil]; } - #pragma mark - PearlConfigDelegate - (void)didUpdateConfigForKey:(SEL)configKey fromValue:(id)value { - [[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification - object:NSStringFromSelector( configKey ) userInfo:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:MPCheckConfigNotification object:NSStringFromSelector( configKey )]; } -- (void)checkConfig { +- (void)updateFromConfig { // iCloud enabled / disabled BOOL iCloudEnabled = [[MPiOSConfig get].iCloudEnabled boolValue]; @@ -600,7 +542,7 @@ NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPElementEntity class] )]; NSError *error = nil; if ((siteCount = [context countForFetchRequest:fetchRequest error:&error]) == NSNotFound) { - wrn(@"Couldn't count current sites: %@", error); + wrn( @"Couldn't count current sites: %@", error ); return; } }]; @@ -617,11 +559,11 @@ @"or overwrite them with your current sites." viewStyle:UIAlertViewStyleDefault initAlert:nil tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) { - if (buttonIndex == [alert cancelButtonIndex]) - setConfirmationAnswer( NO ); - if (buttonIndex == [alert firstOtherButtonIndex]) - setConfirmationAnswer( YES ); - } + if (buttonIndex == [alert cancelButtonIndex]) + setConfirmationAnswer( NO ); + if (buttonIndex == [alert firstOtherButtonIndex]) + setConfirmationAnswer( YES ); + } cancelTitle:@"Use Old" otherTitles:@"Overwrite", nil]; }]; else @@ -631,7 +573,7 @@ NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPElementEntity class] )]; NSError *error = nil; if ((siteCount = [context countForFetchRequest:fetchRequest error:&error]) == NSNotFound) { - wrn(@"Couldn't count current sites: %@", error); + wrn( @"Couldn't count current sites: %@", error ); return; } }]; @@ -647,11 +589,11 @@ @"or overwrite them with your current iCloud sites." viewStyle:UIAlertViewStyleDefault initAlert:nil tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) { - if (buttonIndex == [alert cancelButtonIndex]) - setConfirmationAnswer( NO ); - if (buttonIndex == [alert firstOtherButtonIndex]) - setConfirmationAnswer( YES ); - } + if (buttonIndex == [alert cancelButtonIndex]) + setConfirmationAnswer( NO ); + if (buttonIndex == [alert firstOtherButtonIndex]) + setConfirmationAnswer( YES ); + } cancelTitle:@"Use Old" otherTitles:@"Overwrite", nil]; }]; } @@ -711,23 +653,22 @@ @"helpHidden" : @([[MPiOSConfig get].helpHidden boolValue]), @"showQuickStart" : @([[MPiOSConfig get].showSetup boolValue]), @"firstRun" : @([[PearlConfig get].firstRun boolValue]), - @"launchCount" : NilToNSNull([PearlConfig get].launchCount), + @"launchCount" : NilToNSNull( [PearlConfig get].launchCount ), @"askForReviews" : @([[PearlConfig get].askForReviews boolValue]), - @"reviewAfterLaunches" : NilToNSNull([PearlConfig get].reviewAfterLaunches), - @"reviewedVersion" : NilToNSNull([PearlConfig get].reviewedVersion) + @"reviewAfterLaunches" : NilToNSNull( [PearlConfig get].reviewAfterLaunches ), + @"reviewedVersion" : NilToNSNull( [PearlConfig get].reviewedVersion ) } ); } } - #pragma mark - UbiquityStoreManager - (void)ubiquityStoreManager:(UbiquityStoreManager *)manager willLoadStoreIsCloud:(BOOL)isCloudStore { dispatch_async( dispatch_get_main_queue(), ^{ [self.handleCloudContentAlert cancelAlertAnimated:YES]; - if (![self.storeLoading isVisible]) - self.storeLoading = [PearlOverlay showOverlayWithTitle:@"Loading Sites"]; + if (!self.storeLoadingOverlay) + self.storeLoadingOverlay = [PearlOverlay showProgressOverlayWithTitle:@"Loading Sites"]; } ); [super ubiquityStoreManager:manager willLoadStoreIsCloud:isCloudStore]; @@ -739,32 +680,49 @@ [MPiOSConfig get].iCloudEnabled = @(isCloudStore); [super ubiquityStoreManager:manager didLoadStoreForCoordinator:coordinator isCloud:isCloudStore]; - dispatch_async( dispatch_get_main_queue(), ^{ - [self.handleCloudContentAlert cancelAlertAnimated:YES]; - [self.fixCloudContentAlert cancelAlertAnimated:YES]; - [self.storeLoading cancelOverlayAnimated:YES]; - } ); + [self.handleCloudContentAlert cancelAlertAnimated:YES]; + [self.fixCloudContentAlert cancelAlertAnimated:YES]; + [self.storeLoadingOverlay cancelOverlayAnimated:YES]; + [self.handleCloudDisabledAlert cancelAlertAnimated:YES]; } - (void)ubiquityStoreManager:(UbiquityStoreManager *)manager failedLoadingStoreWithCause:(UbiquityStoreErrorCause)cause context:(id)context wasCloud:(BOOL)wasCloudStore { - dispatch_async( dispatch_get_main_queue(), ^{ - [self.storeLoading cancelOverlayAnimated:YES]; - } ); + [self.storeLoadingOverlay cancelOverlayAnimated:YES]; + [self.handleCloudDisabledAlert cancelAlertAnimated:YES]; } - (BOOL)ubiquityStoreManager:(UbiquityStoreManager *)manager handleCloudContentCorruptionWithHealthyStore:(BOOL)storeHealthy { - if (manager.cloudEnabled && !storeHealthy && !([self.handleCloudContentAlert.alertView isVisible] || [self.fixCloudContentAlert.alertView isVisible])) - dispatch_async( dispatch_get_main_queue(), ^{ - [self.storeLoading cancelOverlayAnimated:YES]; - [self showCloudContentAlert]; - } ); + if (manager.cloudEnabled && !storeHealthy && !(self.handleCloudContentAlert || self.fixCloudContentAlert)) { + [self.storeLoadingOverlay cancelOverlayAnimated:YES]; + [self.handleCloudDisabledAlert cancelAlertAnimated:YES]; + [self showCloudContentAlert]; + }; return NO; } +- (BOOL)ubiquityStoreManagerHandleCloudDisabled:(UbiquityStoreManager *)manager { + + if (!self.handleCloudDisabledAlert) + self.handleCloudDisabledAlert = [PearlAlert showAlertWithTitle:@"iCloud Login" message: + @"You haven't added an iCloud account to your device yet.\n" + @"To add one, go into Apple's Settings -> iCloud." + viewStyle:UIAlertViewStyleDefault initAlert:nil + tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) { + if (buttonIndex == alert.firstOtherButtonIndex) { + [MPiOSConfig get].iCloudEnabled = @NO; + return; + } + + [self.storeManager reloadStore]; + } cancelTitle:@"Try Again" otherTitles:@"Disable iCloud", nil]; + + return YES; +} + - (void)showCloudContentAlert { __weak MPiOSAppDelegate *wSelf = self; @@ -774,52 +732,29 @@ message:@"Waiting for your other device to auto‑correct the problem..." viewStyle:UIAlertViewStyleDefault initAlert:nil tappedButtonBlock: ^(UIAlertView *alert, NSInteger buttonIndex) { - if (buttonIndex == [alert firstOtherButtonIndex]) - wSelf.fixCloudContentAlert = [PearlAlert showAlertWithTitle:@"Fix iCloud Now" message: - @"This problem can be auto‑corrected by opening the app on another device where you recently made changes.\n" - @"You can fix the problem from this device anyway, but recent changes from another device might get lost.\n\n" - @"You can also turn iCloud off for now." - viewStyle:UIAlertViewStyleDefault - initAlert:nil tappedButtonBlock: - ^(UIAlertView *alert_, NSInteger buttonIndex_) { - if (buttonIndex_ == alert_.cancelButtonIndex) - [wSelf showCloudContentAlert]; - if (buttonIndex_ == [alert_ firstOtherButtonIndex]) - [wSelf.storeManager rebuildCloudContentFromCloudStoreOrLocalStore:YES]; - if (buttonIndex_ == [alert_ firstOtherButtonIndex] + 1) - [MPiOSConfig get].iCloudEnabled = @NO; - } - cancelTitle:[PearlStrings get].commonButtonBack - otherTitles:@"Fix Anyway", - @"Turn Off", nil]; - if (buttonIndex == [alert firstOtherButtonIndex] + 1) - [MPiOSConfig get].iCloudEnabled = @NO; - } cancelTitle:nil otherTitles:@"Fix Now", @"Turn Off", nil]; + if (buttonIndex == [alert firstOtherButtonIndex]) + wSelf.fixCloudContentAlert = [PearlAlert showAlertWithTitle:@"Fix iCloud Now" message: + @"This problem can be auto‑corrected by opening the app on another device where you recently made changes.\n" + @"You can fix the problem from this device anyway, but recent changes from another device might get lost.\n\n" + @"You can also turn iCloud off for now." + viewStyle:UIAlertViewStyleDefault + initAlert:nil tappedButtonBlock: + ^(UIAlertView *alert_, NSInteger buttonIndex_) { + if (buttonIndex_ == alert_.cancelButtonIndex) + [wSelf showCloudContentAlert]; + if (buttonIndex_ == [alert_ firstOtherButtonIndex]) + [wSelf.storeManager rebuildCloudContentFromCloudStoreOrLocalStore:YES]; + if (buttonIndex_ == [alert_ firstOtherButtonIndex] + 1) + [MPiOSConfig get].iCloudEnabled = @NO; + } + cancelTitle:[PearlStrings get].commonButtonBack + otherTitles:@"Fix Anyway", + @"Turn Off", nil]; + if (buttonIndex == [alert firstOtherButtonIndex] + 1) + [MPiOSConfig get].iCloudEnabled = @NO; + } cancelTitle:nil otherTitles:@"Fix Now", @"Turn Off", nil]; } - -#pragma mark - Google+ - -- (NSDictionary *)googlePlusInfo { - - static NSDictionary *googlePlusInfo = nil; - if (googlePlusInfo == nil) - googlePlusInfo = [[NSDictionary alloc] initWithContentsOfURL: - [[NSBundle mainBundle] URLForResource:@"Google+" withExtension:@"plist"]]; - - return googlePlusInfo; -} - -- (NSString *)googlePlusClientID { - - NSString *googlePlusClientID = NSNullToNil([[self googlePlusInfo] valueForKeyPath:@"ClientID"]); - if (![googlePlusClientID length]) - wrn(@"Google+ client ID not set. User won't be able to share via Google+."); - - return googlePlusClientID; -} - - #pragma mark - TestFlight - (NSDictionary *)testFlightInfo { @@ -834,14 +769,13 @@ - (NSString *)testFlightToken { - NSString *testFlightToken = NSNullToNil([[self testFlightInfo] valueForKeyPath:@"Application Token"]); + NSString *testFlightToken = NSNullToNil( [[self testFlightInfo] valueForKeyPath:@"Application Token"] ); if (![testFlightToken length]) - wrn(@"TestFlight token not set. Test Flight won't be aware of this test."); + wrn( @"TestFlight token not set. Test Flight won't be aware of this test." ); return testFlightToken; } - #pragma mark - Crashlytics - (NSDictionary *)crashlyticsInfo { @@ -856,14 +790,13 @@ - (NSString *)crashlyticsAPIKey { - NSString *crashlyticsAPIKey = NSNullToNil([[self crashlyticsInfo] valueForKeyPath:@"API Key"]); + NSString *crashlyticsAPIKey = NSNullToNil( [[self crashlyticsInfo] valueForKeyPath:@"API Key"] ); if (![crashlyticsAPIKey length]) - wrn(@"Crashlytics API key not set. Crash logs won't be recorded."); + wrn( @"Crashlytics API key not set. Crash logs won't be recorded." ); return crashlyticsAPIKey; } - #pragma mark - Localytics - (NSDictionary *)localyticsInfo { @@ -879,12 +812,12 @@ - (NSString *)localyticsKey { #ifdef DEBUG - NSString *localyticsKey = NSNullToNil([[self localyticsInfo] valueForKeyPath:@"Key.development"]); + NSString *localyticsKey = NSNullToNil( [[self localyticsInfo] valueForKeyPath:@"Key.development"] ); #else NSString *localyticsKey = NSNullToNil([[self localyticsInfo] valueForKeyPath:@"Key.distribution"]); #endif if (![localyticsKey length]) - wrn(@"Localytics key not set. Demographics won't be collected."); + wrn( @"Localytics key not set. Demographics won't be collected." ); return localyticsKey; } diff --git a/MasterPassword/ObjC/iOS/MPiOSConfig.h b/MasterPassword/ObjC/iOS/MPiOSConfig.h index cbb0b2b4..434d30b7 100644 --- a/MasterPassword/ObjC/iOS/MPiOSConfig.h +++ b/MasterPassword/ObjC/iOS/MPiOSConfig.h @@ -18,5 +18,6 @@ @property(nonatomic, retain) NSNumber *loginNameTipShown; @property(nonatomic, retain) NSNumber *traceMode; @property(nonatomic, retain) NSNumber *iCloudEnabled; +@property(nonatomic, retain) NSNumber *dictationSearch; @end diff --git a/MasterPassword/ObjC/iOS/MPiOSConfig.m b/MasterPassword/ObjC/iOS/MPiOSConfig.m index 7234b221..82ca660b 100644 --- a/MasterPassword/ObjC/iOS/MPiOSConfig.m +++ b/MasterPassword/ObjC/iOS/MPiOSConfig.m @@ -8,7 +8,7 @@ @implementation MPiOSConfig -@dynamic helpHidden, siteInfoHidden, showSetup, actionsTipShown, typeTipShown, loginNameTipShown, traceMode, iCloudEnabled; +@dynamic helpHidden, siteInfoHidden, showSetup, actionsTipShown, typeTipShown, loginNameTipShown, traceMode, iCloudEnabled, dictationSearch; - (id)init { @@ -24,7 +24,8 @@ NSStringFromSelector( @selector(typeTipShown) ) : @(!self.firstRun), NSStringFromSelector( @selector(loginNameTipShown) ) : @NO, NSStringFromSelector( @selector(traceMode) ) : @NO, - NSStringFromSelector( @selector(iCloudEnabled) ) : @NO + NSStringFromSelector( @selector(iCloudEnabled) ) : @NO, + NSStringFromSelector( @selector( dictationSearch) ) : @NO }]; return self; diff --git a/MasterPassword/ObjC/iOS/MainStoryboard_iPhone.storyboard b/MasterPassword/ObjC/iOS/MainStoryboard_iPhone.storyboard index f34dfcd0..c35b254c 100644 --- a/MasterPassword/ObjC/iOS/MainStoryboard_iPhone.storyboard +++ b/MasterPassword/ObjC/iOS/MainStoryboard_iPhone.storyboard @@ -1,8 +1,8 @@ - + - - + + @@ -470,15 +470,15 @@ Your passwords will be AES-encrypted with your master password. - + - + - + 119-20:51:52 MPiOSAppDelegate.m:36 | INFO : Initializing TestFlight @@ -508,7 +508,7 @@ Your passwords will be AES-encrypted with your master password. - + @@ -1198,6 +1198,7 @@ L4m3P4sSw0rD + @@ -1640,6 +1641,7 @@ You can use the words in the background for inspiration in finding a memorable m + @@ -1823,6 +1825,112 @@ You can use the words in the background for inspiration in finding a memorable m + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1873,11 +1981,11 @@ You can use the words in the background for inspiration in finding a memorable m - Enabling iCloud will keep all your iPhones, iPads and Macs nicely in-sync. Any site you add on this device will automatically appear on all your others as well. + Enabling iCloud will keep all your iPhones, iPads and Macs nicely in-sync. Any site you add on this device will automatically appear on all your others as well. Note that even without iCloud syncing, you can make your passwords available from any device by simply creating the same user on all your devices. Enabling iCloud is mainly benefitial to keep the list of sites you use in sync on all your devices. -Only site names and custom passwords are sent to iCloud. Passwords are encrypted with your master password and illegible by Apple or any interceptor. +Only site names and custom passwords are sent to iCloud. Passwords are encrypted with your master password and illegible by Apple or any interceptor. @@ -2158,7 +2266,7 @@ Only site names and custom passwords are sent to iCloud. Passwords are encrypte - + @@ -2215,7 +2323,7 @@ Only site names and custom passwords are sent to iCloud. Passwords are encrypte @@ -3061,9 +3170,9 @@ However, it means that anyone who finds your device unlocked can do the same. - - - + + + - \ No newline at end of file + diff --git a/MasterPassword/ObjC/iOS/MasterPassword-Info.plist b/MasterPassword/ObjC/iOS/MasterPassword-Info.plist index 1e2ee930..20ed0e9f 100644 --- a/MasterPassword/ObjC/iOS/MasterPassword-Info.plist +++ b/MasterPassword/ObjC/iOS/MasterPassword-Info.plist @@ -71,14 +71,15 @@ UIAppFonts - Exo-Bold.otf - Exo-ExtraBold.otf - Exo-Regular.otf + Exo2.0-Bold.otf + Exo2.0-ExtraBold.otf + Exo2.0-Regular.otf + Exo2.0-Thin.otf SourceCodePro-Black.otf SourceCodePro-ExtraLight.otf UIMainStoryboardFile - MainStoryboard_iPhone + Storyboard UIStatusBarHidden UIStatusBarStyle diff --git a/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/project.pbxproj b/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/project.pbxproj index 2fabec83..27fe8b30 100644 --- a/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/project.pbxproj +++ b/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/project.pbxproj @@ -7,25 +7,64 @@ objects = { /* Begin PBXBuildFile section */ + 93D391C07818F4C2DC1B6956 /* MPPasswordsCoachmarkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D397E3650384498E7E53C4 /* MPPasswordsCoachmarkViewController.m */; }; + 93D391ECBD9BD2C64115B5DD /* PearlSizedTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39156E806BB78E04F78B9 /* PearlSizedTextView.m */; }; + 93D391ED37C9F687FA51EAA1 /* MPEmergencySegue.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3937712BF1B67623E5764 /* MPEmergencySegue.m */; }; 93D3922A53E41A54832E90D9 /* PearlOverlay.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D390FADEB325D8D54A957D /* PearlOverlay.m */; }; 93D39233C3EDD9A947ABA52D /* LLButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39BF6BCBDFFE844E7D34C /* LLButtonView.m */; }; 93D39262A8A97DB748213309 /* PearlEMail.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D393BB973253D4BAAC84AA /* PearlEMail.m */; }; + 93D392A8777DC30C11361647 /* UITextView+PearlAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D39AA10CD00D05937671B1 /* UITextView+PearlAttributes.h */; }; 93D392EC39DA43C46C692C12 /* NSDictionary+Indexing.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D393B97158D7BE9332EA53 /* NSDictionary+Indexing.h */; }; 93D3932889B6B4206E66A6D6 /* PearlEMail.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D39F7C9F47BF6387FBC5C3 /* PearlEMail.h */; }; + 93D39392DEDA376F93C6C718 /* MPCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39BAA71DE51B4D8A1286C /* MPCell.m */; }; + 93D393DB5325820241BA90A7 /* PearlSizedTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D39A4759186F6D2D34AA6B /* PearlSizedTextView.h */; }; + 93D394982CBD25D46692DD7C /* MPWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3990E0CD1B5CF9FBB2C07 /* MPWebViewController.m */; }; + 93D394B5036C882B33C71872 /* MPPasswordsSegue.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39E7A12CC352B2825AA66 /* MPPasswordsSegue.m */; }; + 93D394F6D3F6E2553AA0D684 /* MPPasswordLargeStoredCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3947F6BB69CA9A9124A5D /* MPPasswordLargeStoredCell.m */; }; + 93D39536EB550E811CCD04BC /* UIResponder+PearlFirstResponder.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D394482BB07F90E8FD1314 /* UIResponder+PearlFirstResponder.h */; }; + 93D3954E96236384AFA00453 /* UIScrollView+PearlAdjustInsets.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D390FB3110DCCE68E600DC /* UIScrollView+PearlAdjustInsets.m */; }; + 93D3954FCE045A3CC7E804B7 /* MPUsersViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D399E571F61E50A9BF8FAF /* MPUsersViewController.m */; }; + 93D3957237D303DE2D38C267 /* MPAvatarCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39B381350802A194BF332 /* MPAvatarCell.m */; }; 93D395F08A087F8A24689347 /* NSArray+Indexing.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39067C0AFDC581794E2B8 /* NSArray+Indexing.m */; }; + 93D39673DDC085BE72C34D7C /* MPPopdownSegue.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39B050DD5F55E9794EFD4 /* MPPopdownSegue.m */; }; 93D396AA30690B256F30378A /* PearlNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3956915634581E737B38C /* PearlNavigationController.m */; }; 93D396BA1C74C4A06FD86437 /* PearlOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D3942A356B639724157982 /* PearlOverlay.h */; }; + 93D396D8B67DA6522CDBA142 /* MPCoachmarkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3995B1D4DCE5A30D882BA /* MPCoachmarkViewController.m */; }; 93D397952F5635C793C24DF1 /* NSError+PearlFullDescription.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39F9106F2CCFB94283188 /* NSError+PearlFullDescription.m */; }; + 93D3980046016EFD05B35BC5 /* PearlUICollectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D39B1D8177A86C5B9EDDE3 /* PearlUICollectionView.h */; }; + 93D398BD8B83FEE8BE4EFFFC /* MPPasswordLargeDeleteCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39EFBC4D6BA3C8581865F /* MPPasswordLargeDeleteCell.m */; }; + 93D398ECD7D1A0DEDDADF516 /* MPEmergencyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39ACBA9F4878B6A1CC33B /* MPEmergencyViewController.m */; }; + 93D399246DC90F50913A1287 /* UIResponder+PearlFirstResponder.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39A1DDFA09AE2E14D26DC /* UIResponder+PearlFirstResponder.m */; }; + 93D399278165FD6D950F0025 /* MPPasswordTypesCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39097C0AAE62C1C321BFC /* MPPasswordTypesCell.m */; }; 93D3992FA1546E01F498F665 /* PearlNavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D398567FD02DB2647B8CF3 /* PearlNavigationController.h */; }; 93D399433EA75E50656040CB /* Twitter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93D394077F8FAB8167647187 /* Twitter.framework */; }; 93D399BBC0A7EC746CB1B19B /* MPLogsViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D391943675426839501BB8 /* MPLogsViewController.h */; }; + 93D39A5FF670957C0AF8298D /* MPPasswordCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39DEA995041A13DC9CAF7 /* MPPasswordCell.m */; }; + 93D39A8EA1C49CE43B63F47B /* PearlUICollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39D8A953779B35403AF6E /* PearlUICollectionView.m */; }; + 93D39B21156EC9A0B4C2BC83 /* MPPreferencesViewControllerOld.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D390381D3D3AE241B5D341 /* MPPreferencesViewControllerOld.m */; }; + 93D39B76DD5AB108BA8928E8 /* UIScrollView+PearlAdjustInsets.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D39DE2CB351D4E3789462B /* UIScrollView+PearlAdjustInsets.h */; }; 93D39B842AB9A5D072810D76 /* NSError+PearlFullDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D398C95847261903D781D3 /* NSError+PearlFullDescription.h */; }; + 93D39B8F90F58A5D158DDBA3 /* MPPasswordsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3924EE15017F8A12CB436 /* MPPasswordsViewController.m */; }; + 93D39BA1EA3CAAC8A220B4A6 /* MPAppSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3916C1D8F1427DFBDEBCA /* MPAppSettingsViewController.m */; }; 93D39C34FE35830EF5BE1D2A /* NSArray+Indexing.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D396D04E57792A54D437AC /* NSArray+Indexing.h */; }; 93D39C8AD8EAB747856B3A8C /* LLModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3923B42DA2DA18F287092 /* LLModel.m */; }; + 93D39CB5E2EC1078E898F46A /* MPPasswordLargeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3937863061C3916AF7AD2 /* MPPasswordLargeCell.m */; }; + 93D39D596A2E376D6F6F5DA1 /* MPCombinedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D393310223DDB35218467A /* MPCombinedViewController.m */; }; 93D39E281E3658B30550CB55 /* NSDictionary+Indexing.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39AA1EE2E1E7B81372240 /* NSDictionary+Indexing.m */; }; + 93D39E34FD28D24FE3442C48 /* UITextView+PearlAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3977321EB249981821AB0 /* UITextView+PearlAttributes.m */; }; + 93D39EAA4D064193074D3021 /* MPFixable.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39A813CA9D7E192261ED2 /* MPFixable.m */; }; 93D39F8A9254177891F38705 /* MPSetupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39A28369954D147E239BA /* MPSetupViewController.m */; }; + 93D39FA97F4C3F69A75D5A03 /* MPPasswordLargeGeneratedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3993422E207BF0B21D089 /* MPPasswordLargeGeneratedCell.m */; }; DA04E33E14B1E70400ECA4F3 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA04E33D14B1E70400ECA4F3 /* MobileCoreServices.framework */; }; + DA071BF3190187FE00179766 /* empty@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA071BF1190187FE00179766 /* empty@2x.png */; }; + DA071BF4190187FE00179766 /* empty.png in Resources */ = {isa = PBXBuildFile; fileRef = DA071BF2190187FE00179766 /* empty.png */; }; DA095E75172F4CD8001C948B /* MPLogsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3979190DACEBD1F6AE9F4 /* MPLogsViewController.m */; }; + DA2CA4DD18D28859007798F8 /* NSArray+Pearl.m in Sources */ = {isa = PBXBuildFile; fileRef = DA2CA4D918D28859007798F8 /* NSArray+Pearl.m */; }; + DA2CA4DE18D28859007798F8 /* NSArray+Pearl.h in Headers */ = {isa = PBXBuildFile; fileRef = DA2CA4DA18D28859007798F8 /* NSArray+Pearl.h */; }; + DA2CA4DF18D28859007798F8 /* NSTimer+PearlBlock.m in Sources */ = {isa = PBXBuildFile; fileRef = DA2CA4DB18D28859007798F8 /* NSTimer+PearlBlock.m */; }; + DA2CA4E018D28859007798F8 /* NSTimer+PearlBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = DA2CA4DC18D28859007798F8 /* NSTimer+PearlBlock.h */; }; + DA2CA4E418D28866007798F8 /* NSLayoutConstraint+PearlUIKit.h in Headers */ = {isa = PBXBuildFile; fileRef = DA2CA4E218D28866007798F8 /* NSLayoutConstraint+PearlUIKit.h */; }; + DA2CA4E618D2AC10007798F8 /* NSLayoutConstraint+PearlUIKit.m in Sources */ = {isa = PBXBuildFile; fileRef = DA2CA4E518D2AC10007798F8 /* NSLayoutConstraint+PearlUIKit.m */; }; DA30E9CE15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DA30E9CB15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h */; }; DA30E9CF15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = DA30E9CC15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m */; }; DA30E9D015722ECA00A68B4C /* Pearl.m in Sources */ = {isa = PBXBuildFile; fileRef = DA30E9CD15722ECA00A68B4C /* Pearl.m */; }; @@ -35,8 +74,18 @@ DA30E9D815723E6900A68B4C /* PearlLazy.m in Sources */ = {isa = PBXBuildFile; fileRef = DA30E9D615723E6900A68B4C /* PearlLazy.m */; }; DA3509FE15F101A500C14A8E /* PearlQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = DA3509FC15F101A500C14A8E /* PearlQueue.h */; }; DA3509FF15F101A500C14A8E /* PearlQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = DA3509FD15F101A500C14A8E /* PearlQueue.m */; }; + DA38D6A318CCB5BF009AEB3E /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DA38D6A218CCB5BF009AEB3E /* Storyboard.storyboard */; }; + DA3B844E190FC5DF00246EEA /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA3B844D190FC5DF00246EEA /* Crashlytics.framework */; }; DA4425CC1557BED40052177D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; }; DA44260A1557D9E40052177D /* libUbiquityStoreManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA4425CB1557BED40052177D /* libUbiquityStoreManager.a */; }; + DA4522441902355C008F650A /* icon_book.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD370C1711E29500CF925C /* icon_book.png */; }; + DA4522451902355C008F650A /* icon_book@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD370D1711E29500CF925C /* icon_book@2x.png */; }; + DA45224719062899008F650A /* icon_settings.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD38141711E29600CF925C /* icon_settings.png */; }; + DA45224819062899008F650A /* icon_settings@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD38151711E29600CF925C /* icon_settings@2x.png */; }; + DA452249190628A1008F650A /* icon_wrench.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD386A1711E29700CF925C /* icon_wrench.png */; }; + DA45224A190628A1008F650A /* icon_wrench@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD386B1711E29700CF925C /* icon_wrench@2x.png */; }; + DA45224B190628B2008F650A /* icon_gear.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD37821711E29500CF925C /* icon_gear.png */; }; + DA45224C190628B2008F650A /* icon_gear@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD37831711E29500CF925C /* icon_gear@2x.png */; }; DA4DA1D91564471A00F6F596 /* libjrswizzle.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAC6326C148680650075AEA5 /* libjrswizzle.a */; }; DA4DA1DA1564471F00F6F596 /* libuicolor-utilities.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAC6325D1486805C0075AEA5 /* libuicolor-utilities.a */; }; DA5A09DF171A70E4005284AB /* play.png in Resources */ = {isa = PBXBuildFile; fileRef = DA5A09DD171A70E4005284AB /* play.png */; }; @@ -53,15 +102,22 @@ DA6701E016406BB400B61001 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA6701DF16406BB400B61001 /* AdSupport.framework */; settings = {ATTRIBUTES = (Required, ); }; }; DA672D2F14F92C6B004A189C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DA672D2E14F92C6B004A189C /* libz.dylib */; }; DA672D3014F9413D004A189C /* libPearl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAC77CAD148291A600BCF976 /* libPearl.a */; }; + DA67460D18DE7F0C00DFE240 /* Exo2.0-Thin.otf in Resources */ = {isa = PBXBuildFile; fileRef = DA67460918DE7F0C00DFE240 /* Exo2.0-Thin.otf */; }; + DA67460E18DE7F0C00DFE240 /* Exo2.0-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = DA67460A18DE7F0C00DFE240 /* Exo2.0-Regular.otf */; }; + DA67460F18DE7F0C00DFE240 /* Exo2.0-ExtraBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = DA67460B18DE7F0C00DFE240 /* Exo2.0-ExtraBold.otf */; }; + DA67461018DE7F0C00DFE240 /* Exo2.0-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = DA67460C18DE7F0C00DFE240 /* Exo2.0-Bold.otf */; }; DA69540617D975D900BF294E /* icon_gears.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD37841711E29500CF925C /* icon_gears.png */; }; DA69540717D975D900BF294E /* icon_gears@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD37851711E29500CF925C /* icon_gears@2x.png */; }; DA70EC801811B13C00F65DB2 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA70EC7F1811B13C00F65DB2 /* StoreKit.framework */; }; - DA829E52159847E0002417D3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; }; - DA829E6215984832002417D3 /* libFontReplacer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA829E51159847E0002417D3 /* libFontReplacer.a */; }; + DA854C8318D4CFBF00106317 /* avatar-add@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DA854C8118D4CFBF00106317 /* avatar-add@2x.png */; }; + DA854C8418D4CFBF00106317 /* avatar-add.png in Resources */ = {isa = PBXBuildFile; fileRef = DA854C8218D4CFBF00106317 /* avatar-add.png */; }; DA945C8717E3F3FD0053236B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DA945C8617E3F3FD0053236B /* Images.xcassets */; }; DA95D5F214DF0B2C008D1B94 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA95D5F014DF0B1E008D1B94 /* MessageUI.framework */; }; DA9B51551895D79E009D2A0B /* gittip.png in Resources */ = {isa = PBXBuildFile; fileRef = DA9B51541895D79E009D2A0B /* gittip.png */; }; DA9B51581895D853009D2A0B /* LLGitTip.m in Sources */ = {isa = PBXBuildFile; fileRef = DA9B51561895D853009D2A0B /* LLGitTip.m */; }; + DAA141201922FF020032B392 /* PearlTween.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA1411C1922FF020032B392 /* PearlTween.m */; }; + DAA141211922FF020032B392 /* PearlTween.h in Headers */ = {isa = PBXBuildFile; fileRef = DAA1411D1922FF020032B392 /* PearlTween.h */; }; + DAA141221922FF020032B392 /* map-macro.h in Headers */ = {isa = PBXBuildFile; fileRef = DAA1411F1922FF020032B392 /* map-macro.h */; }; DABB981615100B4000B05417 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DABB981515100B4000B05417 /* SystemConfiguration.framework */; }; DABD38DB1711E29700CF925C /* ui_background.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD360F1711E29400CF925C /* ui_background.png */; }; DABD38DC1711E29700CF925C /* ui_background@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD36101711E29400CF925C /* ui_background@2x.png */; }; @@ -129,9 +185,6 @@ DABD395C1711E29700CF925C /* avatar-9@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD36911711E29400CF925C /* avatar-9@2x.png */; }; DABD395D1711E29700CF925C /* background.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD36931711E29400CF925C /* background.png */; }; DABD395E1711E29700CF925C /* background@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD36941711E29400CF925C /* background@2x.png */; }; - DABD39841711E29700CF925C /* Exo-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = DABD36BC1711E29500CF925C /* Exo-Bold.otf */; }; - DABD39851711E29700CF925C /* Exo-ExtraBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = DABD36BD1711E29500CF925C /* Exo-ExtraBold.otf */; }; - DABD39861711E29700CF925C /* Exo-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = DABD36BE1711E29500CF925C /* Exo-Regular.otf */; }; DABD39871711E29700CF925C /* SourceCodePro-Black.otf in Resources */ = {isa = PBXBuildFile; fileRef = DABD36BF1711E29500CF925C /* SourceCodePro-Black.otf */; }; DABD39881711E29700CF925C /* SourceCodePro-ExtraLight.otf in Resources */ = {isa = PBXBuildFile; fileRef = DABD36C01711E29500CF925C /* SourceCodePro-ExtraLight.otf */; }; DABD39A01711E29700CF925C /* icon_action.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD36DA1711E29500CF925C /* icon_action.png */; }; @@ -179,8 +232,6 @@ DABD3B981711E29800CF925C /* pull-up@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD38D41711E29700CF925C /* pull-up@2x.png */; }; DABD3B991711E29800CF925C /* social-facebook.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD38D51711E29700CF925C /* social-facebook.png */; }; DABD3B9A1711E29800CF925C /* social-facebook@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD38D61711E29700CF925C /* social-facebook@2x.png */; }; - DABD3B9B1711E29800CF925C /* social-google+.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD38D71711E29700CF925C /* social-google+.png */; }; - DABD3B9C1711E29800CF925C /* social-google+@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD38D81711E29700CF925C /* social-google+@2x.png */; }; DABD3B9D1711E29800CF925C /* social-twitter.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD38D91711E29700CF925C /* social-twitter.png */; }; DABD3B9E1711E29800CF925C /* social-twitter@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD38DA1711E29700CF925C /* social-twitter@2x.png */; }; DABD3BFD1711E2DC00CF925C /* MPAlgorithm.m in Sources */ = {isa = PBXBuildFile; fileRef = DABD3BA11711E2DC00CF925C /* MPAlgorithm.m */; }; @@ -219,15 +270,12 @@ DABD3FCB1712446200CF925C /* cloud@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD3FC91712446200CF925C /* cloud@2x.png */; }; DABD3FCE1714F45C00CF925C /* identity.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD3FCC1714F45B00CF925C /* identity.png */; }; DABD3FCF1714F45C00CF925C /* identity@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD3FCD1714F45B00CF925C /* identity@2x.png */; }; - DABF632417B744F900DA7E38 /* GoogleOpenSource.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DABF632217B744F900DA7E38 /* GoogleOpenSource.framework */; }; - DABF632517B744F900DA7E38 /* GooglePlus.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DABF632317B744F900DA7E38 /* GooglePlus.framework */; }; DAC6325E1486805C0075AEA5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; }; DAC6326D148680650075AEA5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; }; DAC632891486D9690075AEA5 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAC632871486D95D0075AEA5 /* Security.framework */; }; DAC77CAE148291A600BCF976 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; }; - DACA22161705DE13002C6C22 /* UIFont+Replacement.m in Sources */ = {isa = PBXBuildFile; fileRef = DACA22141705DE13002C6C22 /* UIFont+Replacement.m */; }; - DACA22171705DE13002C6C22 /* UIFont+Replacement.h in Headers */ = {isa = PBXBuildFile; fileRef = DACA22151705DE13002C6C22 /* UIFont+Replacement.h */; }; - DACA22191705DE28002C6C22 /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DACA22181705DE28002C6C22 /* Crashlytics.framework */; }; + DAC8DF47192831E100BA7D71 /* icon_key.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD379A1711E29600CF925C /* icon_key.png */; }; + DAC8DF48192831E100BA7D71 /* icon_key@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DABD379B1711E29600CF925C /* icon_key@2x.png */; }; DACA22BB1705DE7D002C6C22 /* UbiquityStoreManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DACA22B71705DE7D002C6C22 /* UbiquityStoreManager.m */; }; DACA22BC1705DE7D002C6C22 /* NSError+UbiquityStoreManager.h in Headers */ = {isa = PBXBuildFile; fileRef = DACA22B81705DE7D002C6C22 /* NSError+UbiquityStoreManager.h */; }; DACA22BD1705DE7D002C6C22 /* NSError+UbiquityStoreManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DACA22B91705DE7D002C6C22 /* NSError+UbiquityStoreManager.m */; }; @@ -235,7 +283,6 @@ DACA22C61705DE9D002C6C22 /* libTestFlight.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DACA22C31705DE9D002C6C22 /* libTestFlight.a */; }; DACA296C1705DF81002C6C22 /* TestFlight.plist in Resources */ = {isa = PBXBuildFile; fileRef = DACA26941705DF81002C6C22 /* TestFlight.plist */; }; DACA296D1705DF81002C6C22 /* Localytics.plist in Resources */ = {isa = PBXBuildFile; fileRef = DACA26961705DF81002C6C22 /* Localytics.plist */; }; - DACA296E1705DF81002C6C22 /* Google+.plist in Resources */ = {isa = PBXBuildFile; fileRef = DACA26981705DF81002C6C22 /* Google+.plist */; }; DACA296F1705DF81002C6C22 /* Crashlytics.plist in Resources */ = {isa = PBXBuildFile; fileRef = DACA269A1705DF81002C6C22 /* Crashlytics.plist */; }; DACA29731705E1A8002C6C22 /* ciphers.plist in Resources */ = {isa = PBXBuildFile; fileRef = DACA29711705E1A8002C6C22 /* ciphers.plist */; }; DACA29741705E1A8002C6C22 /* dictionary.lst in Resources */ = {isa = PBXBuildFile; fileRef = DACA29721705E1A8002C6C22 /* dictionary.lst */; }; @@ -267,12 +314,6 @@ DADEF44D1810F9BF0052CA3E /* libLoveLyndir.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DADEF4221810D5530052CA3E /* libLoveLyndir.a */; }; DADEF44E1810FA3B0052CA3E /* LoveLyndir.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DADEF4481810D5A70052CA3E /* LoveLyndir.storyboard */; }; DAE1EF2217E942DE00BC0086 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = DAE1EF2417E942DE00BC0086 /* Localizable.strings */; }; - DAE1EF2A17ED112700BC0086 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; }; - DAE1EF5817ED115E00BC0086 /* DCCrossHairView.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE1EF5017ED115E00BC0086 /* DCCrossHairView.m */; }; - DAE1EF5917ED115E00BC0086 /* DCFrameView.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE1EF5217ED115E00BC0086 /* DCFrameView.m */; }; - DAE1EF5A17ED115E00BC0086 /* DCIntrospect.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE1EF5417ED115E00BC0086 /* DCIntrospect.m */; }; - DAE1EF5B17ED115E00BC0086 /* DCStatusBarOverlay.m in Sources */ = {isa = PBXBuildFile; fileRef = DAE1EF5717ED115E00BC0086 /* DCStatusBarOverlay.m */; }; - DAE1EF5C17ED118400BC0086 /* libDCIntrospect.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAE1EF2917ED112600BC0086 /* libDCIntrospect.a */; }; DAEB933318AA537D000490CC /* crypto_aesctr.h in Headers */ = {isa = PBXBuildFile; fileRef = DAEB92E118AA537D000490CC /* crypto_aesctr.h */; }; DAEB933418AA537D000490CC /* crypto_scrypt.h in Headers */ = {isa = PBXBuildFile; fileRef = DAEB92E218AA537D000490CC /* crypto_scrypt.h */; }; DAEB933518AA537D000490CC /* memlimit.h in Headers */ = {isa = PBXBuildFile; fileRef = DAEB92E318AA537D000490CC /* memlimit.h */; }; @@ -355,6 +396,12 @@ DAEB938218AA537D000490CC /* x509_vfy.h in Headers */ = {isa = PBXBuildFile; fileRef = DAEB933118AA537D000490CC /* x509_vfy.h */; }; DAEB938318AA537D000490CC /* x509v3.h in Headers */ = {isa = PBXBuildFile; fileRef = DAEB933218AA537D000490CC /* x509v3.h */; }; DAEBC45314F6364500987BF6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAEBC45214F6364500987BF6 /* QuartzCore.framework */; }; + DAEC85B518E3DD9A007FC0DF /* PearlUIView.m in Sources */ = {isa = PBXBuildFile; fileRef = DAEC85B118E3DD9A007FC0DF /* PearlUIView.m */; }; + DAEC85B618E3DD9A007FC0DF /* PearlUINavigationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = DAEC85B218E3DD9A007FC0DF /* PearlUINavigationBar.m */; }; + DAEC85B718E3DD9A007FC0DF /* PearlUINavigationBar.h in Headers */ = {isa = PBXBuildFile; fileRef = DAEC85B318E3DD9A007FC0DF /* PearlUINavigationBar.h */; }; + DAEC85B818E3DD9A007FC0DF /* PearlUIView.h in Headers */ = {isa = PBXBuildFile; fileRef = DAEC85B418E3DD9A007FC0DF /* PearlUIView.h */; }; + DAF4EF50190A81E400023C90 /* NSManagedObject+Pearl.m in Sources */ = {isa = PBXBuildFile; fileRef = DAF4EF4E190A81E400023C90 /* NSManagedObject+Pearl.m */; }; + DAF4EF51190A81E400023C90 /* NSManagedObject+Pearl.h in Headers */ = {isa = PBXBuildFile; fileRef = DAF4EF4F190A81E400023C90 /* NSManagedObject+Pearl.h */; }; DAFC5656172C573B00CB5CC5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA5BFA4A147E415C00F98B1E /* Foundation.framework */; }; DAFC5683172C57EC00CB5CC5 /* IASKAppSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DAFC5665172C57EC00CB5CC5 /* IASKAppSettingsViewController.m */; }; DAFC5684172C57EC00CB5CC5 /* IASKAppSettingsWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DAFC5667172C57EC00CB5CC5 /* IASKAppSettingsWebViewController.m */; }; @@ -472,43 +519,94 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - DAE1EF2717ED112600BC0086 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/$(PRODUCT_NAME)"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 93D390381D3D3AE241B5D341 /* MPPreferencesViewControllerOld.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPreferencesViewControllerOld.m; sourceTree = ""; }; + 93D390519405B76CC6A57C4F /* MPCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPCell.h; sourceTree = ""; }; 93D39067C0AFDC581794E2B8 /* NSArray+Indexing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Indexing.m"; sourceTree = ""; }; + 93D39097C0AAE62C1C321BFC /* MPPasswordTypesCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordTypesCell.m; sourceTree = ""; }; 93D390A66F69AB1CDB0BFF93 /* LLModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LLModel.h; sourceTree = ""; }; 93D390FADEB325D8D54A957D /* PearlOverlay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlOverlay.m; sourceTree = ""; }; + 93D390FB3110DCCE68E600DC /* UIScrollView+PearlAdjustInsets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+PearlAdjustInsets.m"; sourceTree = ""; }; + 93D390FD93EFCFECB5193DEF /* MPPasswordsCoachmarkViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordsCoachmarkViewController.h; sourceTree = ""; }; + 93D391243F64A77798B4D6A4 /* MPPasswordTypesCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordTypesCell.h; sourceTree = ""; }; + 93D3914D7597F9A28DB9D85E /* MPPasswordsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordsViewController.h; sourceTree = ""; }; + 93D39156E806BB78E04F78B9 /* PearlSizedTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlSizedTextView.m; sourceTree = ""; }; + 93D3916C1D8F1427DFBDEBCA /* MPAppSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAppSettingsViewController.m; sourceTree = ""; }; 93D391943675426839501BB8 /* MPLogsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPLogsViewController.h; sourceTree = ""; }; 93D3923B42DA2DA18F287092 /* LLModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LLModel.m; sourceTree = ""; }; + 93D3924EE15017F8A12CB436 /* MPPasswordsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordsViewController.m; sourceTree = ""; }; + 93D392876BE5C011DE73B43F /* MPPopdownSegue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPopdownSegue.h; sourceTree = ""; }; + 93D393310223DDB35218467A /* MPCombinedViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPCombinedViewController.m; sourceTree = ""; }; + 93D3937712BF1B67623E5764 /* MPEmergencySegue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPEmergencySegue.m; sourceTree = ""; }; + 93D3937863061C3916AF7AD2 /* MPPasswordLargeCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordLargeCell.m; sourceTree = ""; }; 93D393B97158D7BE9332EA53 /* NSDictionary+Indexing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+Indexing.h"; sourceTree = ""; }; 93D393BB973253D4BAAC84AA /* PearlEMail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlEMail.m; sourceTree = ""; }; 93D394077F8FAB8167647187 /* Twitter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Twitter.framework; path = System/Library/Frameworks/Twitter.framework; sourceTree = SDKROOT; }; 93D3942A356B639724157982 /* PearlOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlOverlay.h; sourceTree = ""; }; + 93D394482BB07F90E8FD1314 /* UIResponder+PearlFirstResponder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIResponder+PearlFirstResponder.h"; sourceTree = ""; }; + 93D3947F6BB69CA9A9124A5D /* MPPasswordLargeStoredCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordLargeStoredCell.m; sourceTree = ""; }; 93D3956915634581E737B38C /* PearlNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlNavigationController.m; sourceTree = ""; }; + 93D395BA6B2CFF5F49A4D25F /* MPPasswordLargeStoredCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordLargeStoredCell.h; sourceTree = ""; }; + 93D3966B527CA47A0A661CE2 /* MPPasswordLargeDeleteCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordLargeDeleteCell.h; sourceTree = ""; }; 93D396D04E57792A54D437AC /* NSArray+Indexing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Indexing.h"; sourceTree = ""; }; + 93D3971FE104BB4052484151 /* MPUsersViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPUsersViewController.h; sourceTree = ""; }; 93D39730673227EFF6DEFF19 /* MPSetupViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPSetupViewController.h; sourceTree = ""; }; + 93D3977321EB249981821AB0 /* UITextView+PearlAttributes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITextView+PearlAttributes.m"; sourceTree = ""; }; 93D3979190DACEBD1F6AE9F4 /* MPLogsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPLogsViewController.m; sourceTree = ""; }; + 93D397E3650384498E7E53C4 /* MPPasswordsCoachmarkViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordsCoachmarkViewController.m; sourceTree = ""; }; 93D3983278751A530262F64E /* LLConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LLConfig.h; sourceTree = ""; }; 93D398567FD02DB2647B8CF3 /* PearlNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlNavigationController.h; sourceTree = ""; }; 93D398C95847261903D781D3 /* NSError+PearlFullDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSError+PearlFullDescription.h"; sourceTree = ""; }; + 93D3990E0CD1B5CF9FBB2C07 /* MPWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPWebViewController.m; sourceTree = ""; }; + 93D3993422E207BF0B21D089 /* MPPasswordLargeGeneratedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordLargeGeneratedCell.m; sourceTree = ""; }; + 93D3995B1D4DCE5A30D882BA /* MPCoachmarkViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPCoachmarkViewController.m; sourceTree = ""; }; + 93D39961CD6A43648CC0B0DB /* MPPreferencesViewControllerOld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPreferencesViewControllerOld.h; sourceTree = ""; }; + 93D39975CE5AEC99E3F086C7 /* MPPasswordCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordCell.h; sourceTree = ""; }; + 93D3999693660C89A7465F4E /* MPCoachmarkViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPCoachmarkViewController.h; sourceTree = ""; }; + 93D399E571F61E50A9BF8FAF /* MPUsersViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPUsersViewController.m; sourceTree = ""; }; + 93D399F244BB522A317811BB /* MPFixable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPFixable.h; sourceTree = ""; }; + 93D39A1DDFA09AE2E14D26DC /* UIResponder+PearlFirstResponder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIResponder+PearlFirstResponder.m"; sourceTree = ""; }; 93D39A28369954D147E239BA /* MPSetupViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPSetupViewController.m; sourceTree = ""; }; 93D39A3CC4D8330831FC8CB4 /* LLToggleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LLToggleViewController.h; sourceTree = ""; }; + 93D39A41340CF778E00D0E6D /* MPEmergencySegue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPEmergencySegue.h; sourceTree = ""; }; + 93D39A4759186F6D2D34AA6B /* PearlSizedTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlSizedTextView.h; sourceTree = ""; }; + 93D39A813CA9D7E192261ED2 /* MPFixable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPFixable.m; sourceTree = ""; }; + 93D39AA10CD00D05937671B1 /* UITextView+PearlAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITextView+PearlAttributes.h"; sourceTree = ""; }; 93D39AA1EE2E1E7B81372240 /* NSDictionary+Indexing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+Indexing.m"; sourceTree = ""; }; + 93D39ACBA9F4878B6A1CC33B /* MPEmergencyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPEmergencyViewController.m; sourceTree = ""; }; + 93D39B050DD5F55E9794EFD4 /* MPPopdownSegue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPopdownSegue.m; sourceTree = ""; }; + 93D39B1D8177A86C5B9EDDE3 /* PearlUICollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlUICollectionView.h; sourceTree = ""; }; + 93D39B381350802A194BF332 /* MPAvatarCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAvatarCell.m; sourceTree = ""; }; 93D39BA6C5CB452973918B7D /* LLButtonView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LLButtonView.h; sourceTree = ""; }; + 93D39BAA71DE51B4D8A1286C /* MPCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPCell.m; sourceTree = ""; }; 93D39BF6BCBDFFE844E7D34C /* LLButtonView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LLButtonView.m; sourceTree = ""; }; + 93D39C44361BE57AF0B3071F /* MPPasswordsSegue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordsSegue.h; sourceTree = ""; }; + 93D39C86E984EC65DA5ACB1D /* MPAppSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAppSettingsViewController.h; sourceTree = ""; }; 93D39C8E26B06F01566785B7 /* LLToggleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LLToggleViewController.m; sourceTree = ""; }; + 93D39CDD434AFD6E1B0DA359 /* MPEmergencyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPEmergencyViewController.h; sourceTree = ""; }; + 93D39CE1138FDA4D3D1B847A /* MPPasswordLargeGeneratedCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordLargeGeneratedCell.h; sourceTree = ""; }; + 93D39CF8ADF4542CDC4CD385 /* MPCombinedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPCombinedViewController.h; sourceTree = ""; }; + 93D39D8A953779B35403AF6E /* PearlUICollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlUICollectionView.m; sourceTree = ""; }; + 93D39DA27D768B53C8B1330C /* MPAvatarCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAvatarCell.h; sourceTree = ""; }; + 93D39DE2CB351D4E3789462B /* UIScrollView+PearlAdjustInsets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+PearlAdjustInsets.h"; sourceTree = ""; }; + 93D39DEA995041A13DC9CAF7 /* MPPasswordCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordCell.m; sourceTree = ""; }; + 93D39E02F69CACAB61C056F8 /* MPPasswordLargeCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordLargeCell.h; sourceTree = ""; }; + 93D39E7A12CC352B2825AA66 /* MPPasswordsSegue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordsSegue.m; sourceTree = ""; }; + 93D39EFBC4D6BA3C8581865F /* MPPasswordLargeDeleteCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordLargeDeleteCell.m; sourceTree = ""; }; + 93D39F556F2F142740A65E59 /* MPWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPWebViewController.h; sourceTree = ""; }; 93D39F7C9F47BF6387FBC5C3 /* PearlEMail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlEMail.h; sourceTree = ""; }; 93D39F9106F2CCFB94283188 /* NSError+PearlFullDescription.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSError+PearlFullDescription.m"; sourceTree = ""; }; DA04E33D14B1E70400ECA4F3 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; + DA071BF1190187FE00179766 /* empty@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "empty@2x.png"; sourceTree = ""; }; + DA071BF2190187FE00179766 /* empty.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = empty.png; sourceTree = ""; }; + DA2CA4D918D28859007798F8 /* NSArray+Pearl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Pearl.m"; sourceTree = ""; }; + DA2CA4DA18D28859007798F8 /* NSArray+Pearl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Pearl.h"; sourceTree = ""; }; + DA2CA4DB18D28859007798F8 /* NSTimer+PearlBlock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTimer+PearlBlock.m"; sourceTree = ""; }; + DA2CA4DC18D28859007798F8 /* NSTimer+PearlBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTimer+PearlBlock.h"; sourceTree = ""; }; + DA2CA4E218D28866007798F8 /* NSLayoutConstraint+PearlUIKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSLayoutConstraint+PearlUIKit.h"; sourceTree = ""; }; + DA2CA4E518D2AC10007798F8 /* NSLayoutConstraint+PearlUIKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSLayoutConstraint+PearlUIKit.m"; sourceTree = ""; }; DA30E9CB15722ECA00A68B4C /* NSBundle+PearlMutableInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+PearlMutableInfo.h"; sourceTree = ""; }; DA30E9CC15722ECA00A68B4C /* NSBundle+PearlMutableInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+PearlMutableInfo.m"; sourceTree = ""; }; DA30E9CD15722ECA00A68B4C /* Pearl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Pearl.m; sourceTree = ""; }; @@ -520,6 +618,8 @@ DA340E9F17CD830E00712B77 /* TestFlight+ManualSessions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TestFlight+ManualSessions.h"; sourceTree = ""; }; DA3509FC15F101A500C14A8E /* PearlQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlQueue.h; sourceTree = ""; }; DA3509FD15F101A500C14A8E /* PearlQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlQueue.m; sourceTree = ""; }; + DA38D6A218CCB5BF009AEB3E /* Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Storyboard.storyboard; sourceTree = ""; }; + DA3B844D190FC5DF00246EEA /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Crashlytics.framework; path = ../../../External/iOS/Crashlytics.framework; sourceTree = ""; }; DA3EF17A15A47744003ABF4E /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; DA4425CB1557BED40052177D /* libUbiquityStoreManager.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libUbiquityStoreManager.a; sourceTree = BUILT_PRODUCTS_DIR; }; DA5A09DD171A70E4005284AB /* play.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = play.png; sourceTree = ""; }; @@ -536,13 +636,23 @@ DA6701DD16406B7300B61001 /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; }; DA6701DF16406BB400B61001 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; DA672D2E14F92C6B004A189C /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; + DA67460918DE7F0C00DFE240 /* Exo2.0-Thin.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo2.0-Thin.otf"; sourceTree = ""; }; + DA67460A18DE7F0C00DFE240 /* Exo2.0-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo2.0-Regular.otf"; sourceTree = ""; }; + DA67460B18DE7F0C00DFE240 /* Exo2.0-ExtraBold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo2.0-ExtraBold.otf"; sourceTree = ""; }; + DA67460C18DE7F0C00DFE240 /* Exo2.0-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo2.0-Bold.otf"; sourceTree = ""; }; DA70EC7F1811B13C00F65DB2 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; }; - DA829E51159847E0002417D3 /* libFontReplacer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFontReplacer.a; sourceTree = BUILT_PRODUCTS_DIR; }; + DA854C8118D4CFBF00106317 /* avatar-add@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "avatar-add@2x.png"; sourceTree = ""; }; + DA854C8218D4CFBF00106317 /* avatar-add.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "avatar-add.png"; sourceTree = ""; }; DA945C8617E3F3FD0053236B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; DA95D5F014DF0B1E008D1B94 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; DA9B51541895D79E009D2A0B /* gittip.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = gittip.png; sourceTree = ""; }; DA9B51561895D853009D2A0B /* LLGitTip.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LLGitTip.m; sourceTree = ""; }; DA9B51571895D853009D2A0B /* LLGitTip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LLGitTip.h; sourceTree = ""; }; + DAA141191922FED80032B392 /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = ""; }; + DAA1411B1922FED80032B392 /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = ""; }; + DAA1411C1922FF020032B392 /* PearlTween.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlTween.m; sourceTree = ""; }; + DAA1411D1922FF020032B392 /* PearlTween.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlTween.h; sourceTree = ""; }; + DAA1411F1922FF020032B392 /* map-macro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "map-macro.h"; sourceTree = ""; }; DAAC35DD156BD77D00C5FD93 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; DABB981515100B4000B05417 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; DABD360F1711E29400CF925C /* ui_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ui_background.png; sourceTree = ""; }; @@ -677,9 +787,6 @@ DABD36911711E29400CF925C /* avatar-9@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "avatar-9@2x.png"; sourceTree = ""; }; DABD36931711E29400CF925C /* background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = background.png; sourceTree = ""; }; DABD36941711E29400CF925C /* background@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "background@2x.png"; sourceTree = ""; }; - DABD36BC1711E29500CF925C /* Exo-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo-Bold.otf"; sourceTree = ""; }; - DABD36BD1711E29500CF925C /* Exo-ExtraBold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo-ExtraBold.otf"; sourceTree = ""; }; - DABD36BE1711E29500CF925C /* Exo-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Exo-Regular.otf"; sourceTree = ""; }; DABD36BF1711E29500CF925C /* SourceCodePro-Black.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SourceCodePro-Black.otf"; sourceTree = ""; }; DABD36C01711E29500CF925C /* SourceCodePro-ExtraLight.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SourceCodePro-ExtraLight.otf"; sourceTree = ""; }; DABD36DA1711E29500CF925C /* icon_action.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_action.png; sourceTree = ""; }; @@ -1180,8 +1287,6 @@ DABD38D41711E29700CF925C /* pull-up@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pull-up@2x.png"; sourceTree = ""; }; DABD38D51711E29700CF925C /* social-facebook.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "social-facebook.png"; sourceTree = ""; }; DABD38D61711E29700CF925C /* social-facebook@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "social-facebook@2x.png"; sourceTree = ""; }; - DABD38D71711E29700CF925C /* social-google+.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "social-google+.png"; sourceTree = ""; }; - DABD38D81711E29700CF925C /* social-google+@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "social-google+@2x.png"; sourceTree = ""; }; DABD38D91711E29700CF925C /* social-twitter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "social-twitter.png"; sourceTree = ""; }; DABD38DA1711E29700CF925C /* social-twitter@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "social-twitter@2x.png"; sourceTree = ""; }; DABD3BA01711E2DC00CF925C /* MPAlgorithm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAlgorithm.h; sourceTree = ""; }; @@ -1253,16 +1358,11 @@ DABD3FC91712446200CF925C /* cloud@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "cloud@2x.png"; sourceTree = ""; }; DABD3FCC1714F45B00CF925C /* identity.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = identity.png; sourceTree = ""; }; DABD3FCD1714F45B00CF925C /* identity@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "identity@2x.png"; sourceTree = ""; }; - DABF632217B744F900DA7E38 /* GoogleOpenSource.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GoogleOpenSource.framework; sourceTree = ""; }; - DABF632317B744F900DA7E38 /* GooglePlus.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GooglePlus.framework; sourceTree = ""; }; DAC6325D1486805C0075AEA5 /* libuicolor-utilities.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libuicolor-utilities.a"; sourceTree = BUILT_PRODUCTS_DIR; }; DAC6326C148680650075AEA5 /* libjrswizzle.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libjrswizzle.a; sourceTree = BUILT_PRODUCTS_DIR; }; DAC632871486D95D0075AEA5 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; DAC77CAD148291A600BCF976 /* libPearl.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPearl.a; sourceTree = BUILT_PRODUCTS_DIR; }; DAC77CB1148291A600BCF976 /* Pearl-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Pearl-Prefix.pch"; path = "../../MasterPassword/ObjC/Pearl/Pearl-Prefix.pch"; sourceTree = ""; }; - DACA22141705DE13002C6C22 /* UIFont+Replacement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIFont+Replacement.m"; sourceTree = ""; }; - DACA22151705DE13002C6C22 /* UIFont+Replacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIFont+Replacement.h"; sourceTree = ""; }; - DACA22181705DE28002C6C22 /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = ""; }; DACA22B71705DE7D002C6C22 /* UbiquityStoreManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UbiquityStoreManager.m; sourceTree = ""; }; DACA22B81705DE7D002C6C22 /* NSError+UbiquityStoreManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSError+UbiquityStoreManager.h"; sourceTree = ""; }; DACA22B91705DE7D002C6C22 /* NSError+UbiquityStoreManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSError+UbiquityStoreManager.m"; sourceTree = ""; }; @@ -1271,7 +1371,6 @@ DACA22C31705DE9D002C6C22 /* libTestFlight.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libTestFlight.a; sourceTree = ""; }; DACA26941705DF81002C6C22 /* TestFlight.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = TestFlight.plist; sourceTree = ""; }; DACA26961705DF81002C6C22 /* Localytics.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Localytics.plist; sourceTree = ""; }; - DACA26981705DF81002C6C22 /* Google+.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Google+.plist"; sourceTree = ""; }; DACA269A1705DF81002C6C22 /* Crashlytics.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Crashlytics.plist; sourceTree = ""; }; DACA29711705E1A8002C6C22 /* ciphers.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = ciphers.plist; sourceTree = ""; }; DACA29721705E1A8002C6C22 /* dictionary.lst */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dictionary.lst; sourceTree = ""; }; @@ -1283,6 +1382,7 @@ DACA29BB1705E2DE002C6C22 /* UIColor+HSV.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+HSV.m"; sourceTree = ""; }; DAD3127115528CD200A3F9ED /* libLocalytics.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libLocalytics.a; sourceTree = BUILT_PRODUCTS_DIR; }; DAD312C01552A20800A3F9ED /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; + DADBB55918DB0CFC00D099FE /* keyboard-dark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "keyboard-dark@2x.png"; sourceTree = ""; }; DADEF4061810D2940052CA3E /* love-lyndir.button.green.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "love-lyndir.button.green.png"; sourceTree = ""; }; DADEF4071810D2940052CA3E /* love-lyndir.button.green@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "love-lyndir.button.green@2x.png"; sourceTree = ""; }; DADEF4081810D2940052CA3E /* love-lyndir.button.grey.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "love-lyndir.button.grey.png"; sourceTree = ""; }; @@ -1300,17 +1400,7 @@ DADEF4491810E7F30052CA3E /* love-lyndir.picker.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "love-lyndir.picker.png"; sourceTree = ""; }; DADEF44A1810E7F30052CA3E /* love-lyndir.picker@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "love-lyndir.picker@2x.png"; sourceTree = ""; }; DAE1EF2317E942DE00BC0086 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; - DAE1EF2917ED112600BC0086 /* libDCIntrospect.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDCIntrospect.a; sourceTree = BUILT_PRODUCTS_DIR; }; DAE1EF3717ED112700BC0086 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; - DAE1EF4F17ED115E00BC0086 /* DCCrossHairView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCCrossHairView.h; sourceTree = ""; }; - DAE1EF5017ED115E00BC0086 /* DCCrossHairView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCCrossHairView.m; sourceTree = ""; }; - DAE1EF5117ED115E00BC0086 /* DCFrameView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCFrameView.h; sourceTree = ""; }; - DAE1EF5217ED115E00BC0086 /* DCFrameView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCFrameView.m; sourceTree = ""; }; - DAE1EF5317ED115E00BC0086 /* DCIntrospect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCIntrospect.h; sourceTree = ""; }; - DAE1EF5417ED115E00BC0086 /* DCIntrospect.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCIntrospect.m; sourceTree = ""; }; - DAE1EF5517ED115E00BC0086 /* DCIntrospectSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCIntrospectSettings.h; sourceTree = ""; }; - DAE1EF5617ED115E00BC0086 /* DCStatusBarOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCStatusBarOverlay.h; sourceTree = ""; }; - DAE1EF5717ED115E00BC0086 /* DCStatusBarOverlay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCStatusBarOverlay.m; sourceTree = ""; }; DAEB92E118AA537D000490CC /* crypto_aesctr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_aesctr.h; sourceTree = ""; }; DAEB92E218AA537D000490CC /* crypto_scrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto_scrypt.h; sourceTree = ""; }; DAEB92E318AA537D000490CC /* memlimit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memlimit.h; sourceTree = ""; }; @@ -1393,10 +1483,13 @@ DAEB933118AA537D000490CC /* x509_vfy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x509_vfy.h; sourceTree = ""; }; DAEB933218AA537D000490CC /* x509v3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x509v3.h; sourceTree = ""; }; DAEBC45214F6364500987BF6 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + DAEC85B118E3DD9A007FC0DF /* PearlUIView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlUIView.m; sourceTree = ""; }; + DAEC85B218E3DD9A007FC0DF /* PearlUINavigationBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlUINavigationBar.m; sourceTree = ""; }; + DAEC85B318E3DD9A007FC0DF /* PearlUINavigationBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlUINavigationBar.h; sourceTree = ""; }; + DAEC85B418E3DD9A007FC0DF /* PearlUIView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlUIView.h; sourceTree = ""; }; + DAF4EF4E190A81E400023C90 /* NSManagedObject+Pearl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSManagedObject+Pearl.m"; sourceTree = ""; }; + DAF4EF4F190A81E400023C90 /* NSManagedObject+Pearl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSManagedObject+Pearl.h"; sourceTree = ""; }; DAFC5655172C573B00CB5CC5 /* libInAppSettingsKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libInAppSettingsKit.a; sourceTree = BUILT_PRODUCTS_DIR; }; - DAFC5659172C573B00CB5CC5 /* InAppSettingsKit-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "InAppSettingsKit-Prefix.pch"; sourceTree = ""; }; - DAFC565A172C573B00CB5CC5 /* InAppSettingsKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InAppSettingsKit.h; sourceTree = ""; }; - DAFC565C172C573B00CB5CC5 /* InAppSettingsKit.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InAppSettingsKit.m; sourceTree = ""; }; DAFC5664172C57EC00CB5CC5 /* IASKAppSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IASKAppSettingsViewController.h; sourceTree = ""; }; DAFC5665172C57EC00CB5CC5 /* IASKAppSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IASKAppSettingsViewController.m; sourceTree = ""; }; DAFC5666172C57EC00CB5CC5 /* IASKAppSettingsWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IASKAppSettingsWebViewController.h; sourceTree = ""; }; @@ -1534,12 +1627,10 @@ buildActionMask = 2147483647; files = ( DADEF44D1810F9BF0052CA3E /* libLoveLyndir.a in Frameworks */, - DAE1EF5C17ED118400BC0086 /* libDCIntrospect.a in Frameworks */, DAFC5691172C582A00CB5CC5 /* libInAppSettingsKit.a in Frameworks */, DA6701E016406BB400B61001 /* AdSupport.framework in Frameworks */, DA6701DE16406B7300B61001 /* Social.framework in Frameworks */, DA6701B816406A4100B61001 /* Accounts.framework in Frameworks */, - DA829E6215984832002417D3 /* libFontReplacer.a in Frameworks */, DA44260A1557D9E40052177D /* libUbiquityStoreManager.a in Frameworks */, DAD312C21552A22700A3F9ED /* libsqlite3.dylib in Frameworks */, DAD312BF1552A1BD00A3F9ED /* libLocalytics.a in Frameworks */, @@ -1555,18 +1646,8 @@ DA5BFA4D147E415C00F98B1E /* CoreGraphics.framework in Frameworks */, DA5BFA4F147E415C00F98B1E /* CoreData.framework in Frameworks */, 93D399433EA75E50656040CB /* Twitter.framework in Frameworks */, - DACA22191705DE28002C6C22 /* Crashlytics.framework in Frameworks */, + DA3B844E190FC5DF00246EEA /* Crashlytics.framework in Frameworks */, DACA22C61705DE9D002C6C22 /* libTestFlight.a in Frameworks */, - DABF632417B744F900DA7E38 /* GoogleOpenSource.framework in Frameworks */, - DABF632517B744F900DA7E38 /* GooglePlus.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DA829E4E159847E0002417D3 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - DA829E52159847E0002417D3 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1614,14 +1695,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - DAE1EF2617ED112600BC0086 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - DAE1EF2A17ED112700BC0086 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; DAFC5652172C573B00CB5CC5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -1639,9 +1712,10 @@ DABD3B9F1711E2DB00CF925C /* ObjC */, DACA23B41705DF7D002C6C22 /* Resources */, DACA22121705DDC5002C6C22 /* External */, - DAFC5657172C573B00CB5CC5 /* InAppSettingsKit */, DA5BFA47147E415C00F98B1E /* Frameworks */, DA5BFA45147E415C00F98B1E /* Products */, + 93D3966B527CA47A0A661CE2 /* MPPasswordLargeDeleteCell.h */, + 93D39EFBC4D6BA3C8581865F /* MPPasswordLargeDeleteCell.m */, ); sourceTree = ""; }; @@ -1654,9 +1728,7 @@ DAC6326C148680650075AEA5 /* libjrswizzle.a */, DAD3127115528CD200A3F9ED /* libLocalytics.a */, DA4425CB1557BED40052177D /* libUbiquityStoreManager.a */, - DA829E51159847E0002417D3 /* libFontReplacer.a */, DAFC5655172C573B00CB5CC5 /* libInAppSettingsKit.a */, - DAE1EF2917ED112600BC0086 /* libDCIntrospect.a */, DADEF4221810D5530052CA3E /* libLoveLyndir.a */, ); name = Products; @@ -1665,6 +1737,7 @@ DA5BFA47147E415C00F98B1E /* Frameworks */ = { isa = PBXGroup; children = ( + DA3B844D190FC5DF00246EEA /* Crashlytics.framework */, DA70EC7F1811B13C00F65DB2 /* StoreKit.framework */, DABD3FC617122ADD00CF925C /* libscrypt-bin-ios.a */, DA6701DF16406BB400B61001 /* AdSupport.framework */, @@ -1707,9 +1780,36 @@ path = include; sourceTree = ""; }; + DAA141181922FED80032B392 /* iOS */ = { + isa = PBXGroup; + children = ( + DAA141191922FED80032B392 /* Crashlytics.framework */, + ); + path = iOS; + sourceTree = ""; + }; + DAA1411A1922FED80032B392 /* Mac */ = { + isa = PBXGroup; + children = ( + DAA1411B1922FED80032B392 /* Crashlytics.framework */, + ); + path = Mac; + sourceTree = ""; + }; + DAA1411E1922FF020032B392 /* include */ = { + isa = PBXGroup; + children = ( + DAA1411F1922FF020032B392 /* map-macro.h */, + ); + path = include; + sourceTree = ""; + }; DABD360D1711E29400CF925C /* Media */ = { isa = PBXGroup; children = ( + DA071BF1190187FE00179766 /* empty@2x.png */, + DA071BF2190187FE00179766 /* empty.png */, + DADBB55918DB0CFC00D099FE /* keyboard-dark@2x.png */, DA945C8617E3F3FD0053236B /* Images.xcassets */, DA5E5C3C1723681B003798D8 /* Square-bottom.png */, DA5A09E8171BB0F7005284AB /* unlocked.png */, @@ -1744,8 +1844,6 @@ DABD38D41711E29700CF925C /* pull-up@2x.png */, DABD38D51711E29700CF925C /* social-facebook.png */, DABD38D61711E29700CF925C /* social-facebook@2x.png */, - DABD38D71711E29700CF925C /* social-google+.png */, - DABD38D81711E29700CF925C /* social-google+@2x.png */, DABD38D91711E29700CF925C /* social-twitter.png */, DABD38DA1711E29700CF925C /* social-twitter@2x.png */, ); @@ -1854,6 +1952,8 @@ DABD366B1711E29400CF925C /* Avatars */ = { isa = PBXGroup; children = ( + DA854C8118D4CFBF00106317 /* avatar-add@2x.png */, + DA854C8218D4CFBF00106317 /* avatar-add.png */, DABD366C1711E29400CF925C /* avatar-0.png */, DABD366D1711E29400CF925C /* avatar-0@2x.png */, DABD366E1711E29400CF925C /* avatar-1.png */, @@ -1908,9 +2008,10 @@ DABD36BB1711E29500CF925C /* Fonts */ = { isa = PBXGroup; children = ( - DABD36BC1711E29500CF925C /* Exo-Bold.otf */, - DABD36BD1711E29500CF925C /* Exo-ExtraBold.otf */, - DABD36BE1711E29500CF925C /* Exo-Regular.otf */, + DA67460918DE7F0C00DFE240 /* Exo2.0-Thin.otf */, + DA67460A18DE7F0C00DFE240 /* Exo2.0-Regular.otf */, + DA67460B18DE7F0C00DFE240 /* Exo2.0-ExtraBold.otf */, + DA67460C18DE7F0C00DFE240 /* Exo2.0-Bold.otf */, DABD36BF1711E29500CF925C /* SourceCodePro-Black.otf */, DABD36C01711E29500CF925C /* SourceCodePro-ExtraLight.otf */, ); @@ -2443,6 +2544,8 @@ DABD3BB91711E2DC00CF925C /* MPUserEntity.h */, DABD3BBA1711E2DC00CF925C /* MPUserEntity.m */, DABD3BD01711E2DC00CF925C /* MasterPassword.xcdatamodeld */, + 93D399F244BB522A317811BB /* MPFixable.h */, + 93D39A813CA9D7E192261ED2 /* MPFixable.m */, ); name = ObjC; path = ..; @@ -2451,6 +2554,12 @@ DABD3BD71711E2DC00CF925C /* iOS */ = { isa = PBXGroup; children = ( + 93D39975CE5AEC99E3F086C7 /* MPPasswordCell.h */, + 93D39DEA995041A13DC9CAF7 /* MPPasswordCell.m */, + 93D39ACBA9F4878B6A1CC33B /* MPEmergencyViewController.m */, + 93D39CDD434AFD6E1B0DA359 /* MPEmergencyViewController.h */, + 93D390381D3D3AE241B5D341 /* MPPreferencesViewControllerOld.m */, + 93D39961CD6A43648CC0B0DB /* MPPreferencesViewControllerOld.h */, DABD3BD81711E2DC00CF925C /* MPiOSAppDelegate.h */, DABD3BD91711E2DC00CF925C /* MPiOSAppDelegate.m */, DABD3BDA1711E2DC00CF925C /* MPAppViewController.h */, @@ -2488,6 +2597,39 @@ 93D39730673227EFF6DEFF19 /* MPSetupViewController.h */, 93D3979190DACEBD1F6AE9F4 /* MPLogsViewController.m */, 93D391943675426839501BB8 /* MPLogsViewController.h */, + 93D3924EE15017F8A12CB436 /* MPPasswordsViewController.m */, + 93D3914D7597F9A28DB9D85E /* MPPasswordsViewController.h */, + 93D393310223DDB35218467A /* MPCombinedViewController.m */, + 93D39CF8ADF4542CDC4CD385 /* MPCombinedViewController.h */, + DA38D6A218CCB5BF009AEB3E /* Storyboard.storyboard */, + 93D39B381350802A194BF332 /* MPAvatarCell.m */, + 93D39DA27D768B53C8B1330C /* MPAvatarCell.h */, + 93D3993422E207BF0B21D089 /* MPPasswordLargeGeneratedCell.m */, + 93D39CE1138FDA4D3D1B847A /* MPPasswordLargeGeneratedCell.h */, + 93D399E571F61E50A9BF8FAF /* MPUsersViewController.m */, + 93D3971FE104BB4052484151 /* MPUsersViewController.h */, + 93D39E02F69CACAB61C056F8 /* MPPasswordLargeCell.h */, + 93D3937863061C3916AF7AD2 /* MPPasswordLargeCell.m */, + 93D395BA6B2CFF5F49A4D25F /* MPPasswordLargeStoredCell.h */, + 93D3947F6BB69CA9A9124A5D /* MPPasswordLargeStoredCell.m */, + 93D39BAA71DE51B4D8A1286C /* MPCell.m */, + 93D390519405B76CC6A57C4F /* MPCell.h */, + 93D39097C0AAE62C1C321BFC /* MPPasswordTypesCell.m */, + 93D391243F64A77798B4D6A4 /* MPPasswordTypesCell.h */, + 93D3937712BF1B67623E5764 /* MPEmergencySegue.m */, + 93D39A41340CF778E00D0E6D /* MPEmergencySegue.h */, + 93D39E7A12CC352B2825AA66 /* MPPasswordsSegue.m */, + 93D39C44361BE57AF0B3071F /* MPPasswordsSegue.h */, + 93D39B050DD5F55E9794EFD4 /* MPPopdownSegue.m */, + 93D392876BE5C011DE73B43F /* MPPopdownSegue.h */, + 93D3916C1D8F1427DFBDEBCA /* MPAppSettingsViewController.m */, + 93D39C86E984EC65DA5ACB1D /* MPAppSettingsViewController.h */, + 93D3995B1D4DCE5A30D882BA /* MPCoachmarkViewController.m */, + 93D3999693660C89A7465F4E /* MPCoachmarkViewController.h */, + 93D397E3650384498E7E53C4 /* MPPasswordsCoachmarkViewController.m */, + 93D390FD93EFCFECB5193DEF /* MPPasswordsCoachmarkViewController.h */, + 93D3990E0CD1B5CF9FBB2C07 /* MPWebViewController.m */, + 93D39F556F2F142740A65E59 /* MPWebViewController.h */, ); path = iOS; sourceTree = ""; @@ -2508,12 +2650,9 @@ DACA22121705DDC5002C6C22 /* External */ = { isa = PBXGroup; children = ( + DAA141181922FED80032B392 /* iOS */, + DAA1411A1922FED80032B392 /* Mac */, DADEF3E91810D1980052CA3E /* LoveLyndir */, - DAE1EF4E17ED115E00BC0086 /* DCIntrospect */, - DABF632217B744F900DA7E38 /* GoogleOpenSource.framework */, - DABF632317B744F900DA7E38 /* GooglePlus.framework */, - DACA22181705DE28002C6C22 /* Crashlytics.framework */, - DACA22131705DE13002C6C22 /* UIFont+Replacement */, DAFC5662172C57EC00CB5CC5 /* InAppSettingsKit */, DACA22C71705DEB0002C6C22 /* Localytics */, DAC77CAF148291A600BCF976 /* Pearl */, @@ -2524,16 +2663,6 @@ path = ../../../External; sourceTree = ""; }; - DACA22131705DE13002C6C22 /* UIFont+Replacement */ = { - isa = PBXGroup; - children = ( - DACA22141705DE13002C6C22 /* UIFont+Replacement.m */, - DACA22151705DE13002C6C22 /* UIFont+Replacement.h */, - ); - name = "UIFont+Replacement"; - path = "FontReplacer/UIFont+Replacement"; - sourceTree = ""; - }; DACA22B61705DE7D002C6C22 /* UbiquityStoreManager */ = { isa = PBXGroup; children = ( @@ -2578,7 +2707,6 @@ DACA29701705E1A8002C6C22 /* Data */, DABD360D1711E29400CF925C /* Media */, DACA26991705DF81002C6C22 /* Crashlytics */, - DACA26971705DF81002C6C22 /* Google+ */, DACA26951705DF81002C6C22 /* Localytics */, DACA26931705DF81002C6C22 /* TestFlight */, DAE1EF2417E942DE00BC0086 /* Localizable.strings */, @@ -2603,14 +2731,6 @@ path = Localytics; sourceTree = ""; }; - DACA26971705DF81002C6C22 /* Google+ */ = { - isa = PBXGroup; - children = ( - DACA26981705DF81002C6C22 /* Google+.plist */, - ); - path = "Google+"; - sourceTree = ""; - }; DACA26991705DF81002C6C22 /* Crashlytics */ = { isa = PBXGroup; children = ( @@ -2698,23 +2818,6 @@ path = Resources; sourceTree = ""; }; - DAE1EF4E17ED115E00BC0086 /* DCIntrospect */ = { - isa = PBXGroup; - children = ( - DAE1EF4F17ED115E00BC0086 /* DCCrossHairView.h */, - DAE1EF5017ED115E00BC0086 /* DCCrossHairView.m */, - DAE1EF5117ED115E00BC0086 /* DCFrameView.h */, - DAE1EF5217ED115E00BC0086 /* DCFrameView.m */, - DAE1EF5317ED115E00BC0086 /* DCIntrospect.h */, - DAE1EF5417ED115E00BC0086 /* DCIntrospect.m */, - DAE1EF5517ED115E00BC0086 /* DCIntrospectSettings.h */, - DAE1EF5617ED115E00BC0086 /* DCStatusBarOverlay.h */, - DAE1EF5717ED115E00BC0086 /* DCStatusBarOverlay.m */, - ); - name = DCIntrospect; - path = DCIntrospect/DCIntrospect; - sourceTree = ""; - }; DAEB92E018AA537D000490CC /* scrypt */ = { isa = PBXGroup; children = ( @@ -2810,24 +2913,6 @@ path = openssl; sourceTree = ""; }; - DAFC5657172C573B00CB5CC5 /* InAppSettingsKit */ = { - isa = PBXGroup; - children = ( - DAFC565A172C573B00CB5CC5 /* InAppSettingsKit.h */, - DAFC565C172C573B00CB5CC5 /* InAppSettingsKit.m */, - DAFC5658172C573B00CB5CC5 /* Supporting Files */, - ); - path = InAppSettingsKit; - sourceTree = ""; - }; - DAFC5658172C573B00CB5CC5 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - DAFC5659172C573B00CB5CC5 /* InAppSettingsKit-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; DAFC5662172C57EC00CB5CC5 /* InAppSettingsKit */ = { isa = PBXGroup; children = ( @@ -2892,6 +2977,15 @@ DAFE45D715039823003ABA7C /* Pearl */ = { isa = PBXGroup; children = ( + DAA1411C1922FF020032B392 /* PearlTween.m */, + DAA1411D1922FF020032B392 /* PearlTween.h */, + DAA1411E1922FF020032B392 /* include */, + DAF4EF4E190A81E400023C90 /* NSManagedObject+Pearl.m */, + DAF4EF4F190A81E400023C90 /* NSManagedObject+Pearl.h */, + DA2CA4D918D28859007798F8 /* NSArray+Pearl.m */, + DA2CA4DA18D28859007798F8 /* NSArray+Pearl.h */, + DA2CA4DB18D28859007798F8 /* NSTimer+PearlBlock.m */, + DA2CA4DC18D28859007798F8 /* NSTimer+PearlBlock.h */, DA3509FC15F101A500C14A8E /* PearlQueue.h */, DA3509FD15F101A500C14A8E /* PearlQueue.m */, 93D393B97158D7BE9332EA53 /* NSDictionary+Indexing.h */, @@ -2973,6 +3067,12 @@ DAFE460715039823003ABA7C /* Pearl-UIKit */ = { isa = PBXGroup; children = ( + DAEC85B118E3DD9A007FC0DF /* PearlUIView.m */, + DAEC85B218E3DD9A007FC0DF /* PearlUINavigationBar.m */, + DAEC85B318E3DD9A007FC0DF /* PearlUINavigationBar.h */, + DAEC85B418E3DD9A007FC0DF /* PearlUIView.h */, + DA2CA4E518D2AC10007798F8 /* NSLayoutConstraint+PearlUIKit.m */, + DA2CA4E218D28866007798F8 /* NSLayoutConstraint+PearlUIKit.h */, 93D39F7C9F47BF6387FBC5C3 /* PearlEMail.h */, 93D393BB973253D4BAAC84AA /* PearlEMail.m */, DAFE4A63150399FF003ABA8F /* UIScrollView+PearlFlashingIndicators.h */, @@ -3020,6 +3120,16 @@ 93D3942A356B639724157982 /* PearlOverlay.h */, 93D3956915634581E737B38C /* PearlNavigationController.m */, 93D398567FD02DB2647B8CF3 /* PearlNavigationController.h */, + 93D390FB3110DCCE68E600DC /* UIScrollView+PearlAdjustInsets.m */, + 93D39DE2CB351D4E3789462B /* UIScrollView+PearlAdjustInsets.h */, + 93D39D8A953779B35403AF6E /* PearlUICollectionView.m */, + 93D39B1D8177A86C5B9EDDE3 /* PearlUICollectionView.h */, + 93D39A1DDFA09AE2E14D26DC /* UIResponder+PearlFirstResponder.m */, + 93D394482BB07F90E8FD1314 /* UIResponder+PearlFirstResponder.h */, + 93D39156E806BB78E04F78B9 /* PearlSizedTextView.m */, + 93D39A4759186F6D2D34AA6B /* PearlSizedTextView.h */, + 93D3977321EB249981821AB0 /* UITextView+PearlAttributes.m */, + 93D39AA10CD00D05937671B1 /* UITextView+PearlAttributes.h */, ); path = "Pearl-UIKit"; sourceTree = ""; @@ -3044,14 +3154,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - DA829E4F159847E0002417D3 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - DACA22171705DE13002C6C22 /* UIFont+Replacement.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; DAC6325B1486805C0075AEA5 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -3102,6 +3204,7 @@ DAEB935A18AA537D000490CC /* idea.h in Headers */, DAEB933A18AA537D000490CC /* sysendian.h in Headers */, DAFE4A2415039824003ABA7C /* PearlInfoPlist.h in Headers */, + DA2CA4E418D28866007798F8 /* NSLayoutConstraint+PearlUIKit.h in Headers */, DAFE4A2615039824003ABA7C /* PearlLogger.h in Headers */, DAFE4A2815039824003ABA7C /* PearlMathUtils.h in Headers */, DAEB934418AA537D000490CC /* camellia.h in Headers */, @@ -3113,6 +3216,7 @@ DAEB935318AA537D000490CC /* ec.h in Headers */, DAEB937818AA537D000490CC /* ssl3.h in Headers */, DAEB935E18AA537D000490CC /* md4.h in Headers */, + DA2CA4E018D28859007798F8 /* NSTimer+PearlBlock.h in Headers */, DAEB933518AA537D000490CC /* memlimit.h in Headers */, DAFE4A3315039824003ABA7C /* Pearl-Crypto.h in Headers */, DAEB937318AA537D000490CC /* seed.h in Headers */, @@ -3131,6 +3235,7 @@ DAEB933C18AA537D000490CC /* aes.h in Headers */, DAEB937618AA537D000490CC /* ssl2.h in Headers */, DAFE4A3C15039824003ABA7C /* Pearl-UIKit-Dependencies.h in Headers */, + DAEC85B818E3DD9A007FC0DF /* PearlUIView.h in Headers */, DAEB935B18AA537D000490CC /* krb5_asn.h in Headers */, DAEB935818AA537D000490CC /* evp.h in Headers */, DAEB934118AA537D000490CC /* blowfish.h in Headers */, @@ -3175,6 +3280,7 @@ DA30E9D715723E6900A68B4C /* PearlLazy.h in Headers */, DAEB936918AA537D000490CC /* pem2.h in Headers */, DAEB937F18AA537D000490CC /* ui_compat.h in Headers */, + DAA141211922FF020032B392 /* PearlTween.h in Headers */, DAFE4A63150399FF003ABA84 /* UIControl+PearlBlocks.h in Headers */, DAEB934A18AA537D000490CC /* crypto.h in Headers */, DAEB935618AA537D000490CC /* engine.h in Headers */, @@ -3189,6 +3295,7 @@ DAEB936C18AA537D000490CC /* pqueue.h in Headers */, DAEB937B18AA537D000490CC /* tls1.h in Headers */, DAEB933818AA537D000490CC /* scryptenc_cpuperf.h in Headers */, + DA2CA4DE18D28859007798F8 /* NSArray+Pearl.h in Headers */, 93D392EC39DA43C46C692C12 /* NSDictionary+Indexing.h in Headers */, DAEB935418AA537D000490CC /* ecdh.h in Headers */, DAEB937D18AA537D000490CC /* txt_db.h in Headers */, @@ -3198,6 +3305,7 @@ DAEB935C18AA537D000490CC /* kssl.h in Headers */, DAEB933418AA537D000490CC /* crypto_scrypt.h in Headers */, DA3509FE15F101A500C14A8E /* PearlQueue.h in Headers */, + DAEC85B718E3DD9A007FC0DF /* PearlUINavigationBar.h in Headers */, DAEB934918AA537D000490CC /* conf_api.h in Headers */, 93D396BA1C74C4A06FD86437 /* PearlOverlay.h in Headers */, DAEB937518AA537D000490CC /* ssl.h in Headers */, @@ -3205,6 +3313,13 @@ 93D39B842AB9A5D072810D76 /* NSError+PearlFullDescription.h in Headers */, DAEB936218AA537D000490CC /* obj_mac.h in Headers */, DAEB934218AA537D000490CC /* bn.h in Headers */, + DAF4EF51190A81E400023C90 /* NSManagedObject+Pearl.h in Headers */, + DAA141221922FF020032B392 /* map-macro.h in Headers */, + 93D39B76DD5AB108BA8928E8 /* UIScrollView+PearlAdjustInsets.h in Headers */, + 93D3980046016EFD05B35BC5 /* PearlUICollectionView.h in Headers */, + 93D39536EB550E811CCD04BC /* UIResponder+PearlFirstResponder.h in Headers */, + 93D393DB5325820241BA90A7 /* PearlSizedTextView.h in Headers */, + 93D392A8777DC30C11361647 /* UITextView+PearlAttributes.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3246,6 +3361,7 @@ buildPhases = ( DA5BFA40147E415C00F98B1E /* Sources */, DA5BFA41147E415C00F98B1E /* Frameworks */, + DA67460818DE7B2C00DFE240 /* Run Script: Moarfonts */, DA5BFA42147E415C00F98B1E /* Resources */, DA6556E314D55F3000841C99 /* Run Script: GIT version -> Info.plist */, DAD3125D155288AA00A3F9ED /* Run Script: Crashlytics */, @@ -3259,23 +3375,6 @@ productReference = DA5BFA44147E415C00F98B1E /* MasterPassword.app */; productType = "com.apple.product-type.application"; }; - DA829E50159847E0002417D3 /* FontReplacer */ = { - isa = PBXNativeTarget; - buildConfigurationList = DA829E59159847E0002417D3 /* Build configuration list for PBXNativeTarget "FontReplacer" */; - buildPhases = ( - DA829E4D159847E0002417D3 /* Sources */, - DA829E4E159847E0002417D3 /* Frameworks */, - DA829E4F159847E0002417D3 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = FontReplacer; - productName = FontReplacer; - productReference = DA829E51159847E0002417D3 /* libFontReplacer.a */; - productType = "com.apple.product-type.library.static"; - }; DAC6325C1486805C0075AEA5 /* uicolor-utilities */ = { isa = PBXNativeTarget; buildConfigurationList = DAC632651486805C0075AEA5 /* Build configuration list for PBXNativeTarget "uicolor-utilities" */; @@ -3361,23 +3460,6 @@ productReference = DADEF4221810D5530052CA3E /* libLoveLyndir.a */; productType = "com.apple.product-type.library.static"; }; - DAE1EF2817ED112600BC0086 /* DCIntrospect */ = { - isa = PBXNativeTarget; - buildConfigurationList = DAE1EF4617ED112700BC0086 /* Build configuration list for PBXNativeTarget "DCIntrospect" */; - buildPhases = ( - DAE1EF2517ED112600BC0086 /* Sources */, - DAE1EF2617ED112600BC0086 /* Frameworks */, - DAE1EF2717ED112600BC0086 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = DCIntrospect; - productName = DCIntrospect; - productReference = DAE1EF2917ED112600BC0086 /* libDCIntrospect.a */; - productType = "com.apple.product-type.library.static"; - }; DAFC5654172C573B00CB5CC5 /* InAppSettingsKit */ = { isa = PBXNativeTarget; buildConfigurationList = DAFC565E172C573B00CB5CC5 /* Build configuration list for PBXNativeTarget "InAppSettingsKit" */; @@ -3520,9 +3602,7 @@ DAC6326B148680650075AEA5 /* jrswizzle */, DAD3127015528CD200A3F9ED /* Localytics */, DA4425CA1557BED40052177D /* UbiquityStoreManager */, - DA829E50159847E0002417D3 /* FontReplacer */, DAFC5654172C573B00CB5CC5 /* InAppSettingsKit */, - DAE1EF2817ED112600BC0086 /* DCIntrospect */, DADEF4211810D5530052CA3E /* LoveLyndir */, ); }; @@ -3536,7 +3616,6 @@ DAFE4A5A1503982E003ABA7C /* Pearl.strings in Resources */, DACA296C1705DF81002C6C22 /* TestFlight.plist in Resources */, DACA296D1705DF81002C6C22 /* Localytics.plist in Resources */, - DACA296E1705DF81002C6C22 /* Google+.plist in Resources */, DACA296F1705DF81002C6C22 /* Crashlytics.plist in Resources */, DADEF4171810D2940052CA3E /* love-lyndir.button.red@2x.png in Resources */, DACA29731705E1A8002C6C22 /* ciphers.plist in Resources */, @@ -3553,17 +3632,23 @@ DABD38FA1711E29700CF925C /* ui_list_middle@2x.png in Resources */, DABD38FB1711E29700CF925C /* ui_navbar_back.png in Resources */, DABD38FC1711E29700CF925C /* ui_navbar_back@2x.png in Resources */, + DA45224C190628B2008F650A /* icon_gear@2x.png in Resources */, DABD38FD1711E29700CF925C /* ui_navbar_button.png in Resources */, DABD38FE1711E29700CF925C /* ui_navbar_button@2x.png in Resources */, DABD38FF1711E29700CF925C /* ui_navbar_container.png in Resources */, DABD39001711E29700CF925C /* ui_navbar_container@2x.png in Resources */, DABD39011711E29700CF925C /* ui_panel_container.png in Resources */, + DA854C8318D4CFBF00106317 /* avatar-add@2x.png in Resources */, + DA45224A190628A1008F650A /* icon_wrench@2x.png in Resources */, DABD39021711E29700CF925C /* ui_panel_container@2x.png in Resources */, DABD39031711E29700CF925C /* ui_panel_display.png in Resources */, DABD39041711E29700CF925C /* ui_panel_display@2x.png in Resources */, + DA071BF4190187FE00179766 /* empty.png in Resources */, DABD391D1711E29700CF925C /* ui_spinner.png in Resources */, DABD391E1711E29700CF925C /* ui_spinner@2x.png in Resources */, DA69540617D975D900BF294E /* icon_gears.png in Resources */, + DA67460D18DE7F0C00DFE240 /* Exo2.0-Thin.otf in Resources */, + DA4522451902355C008F650A /* icon_book@2x.png in Resources */, DABD39271711E29700CF925C /* ui_textfield.png in Resources */, DABD39281711E29700CF925C /* ui_textfield@2x.png in Resources */, DABD39291711E29700CF925C /* ui_toolbar_container.png in Resources */, @@ -3578,6 +3663,7 @@ DABD393D1711E29700CF925C /* avatar-11@2x.png in Resources */, DABD393E1711E29700CF925C /* avatar-12.png in Resources */, DABD393F1711E29700CF925C /* avatar-12@2x.png in Resources */, + DA67461018DE7F0C00DFE240 /* Exo2.0-Bold.otf in Resources */, DABD39401711E29700CF925C /* avatar-13.png in Resources */, DABD39411711E29700CF925C /* avatar-13@2x.png in Resources */, DABD39421711E29700CF925C /* avatar-14.png in Resources */, @@ -3589,12 +3675,17 @@ DABD39471711E29700CF925C /* avatar-16@2x.png in Resources */, DABD39481711E29700CF925C /* avatar-17.png in Resources */, DABD39491711E29700CF925C /* avatar-17@2x.png in Resources */, + DAC8DF47192831E100BA7D71 /* icon_key.png in Resources */, + DAC8DF48192831E100BA7D71 /* icon_key@2x.png in Resources */, DABD394A1711E29700CF925C /* avatar-18.png in Resources */, DABD394B1711E29700CF925C /* avatar-18@2x.png in Resources */, DABD394C1711E29700CF925C /* avatar-1@2x.png in Resources */, + DA071BF3190187FE00179766 /* empty@2x.png in Resources */, + DA67460E18DE7F0C00DFE240 /* Exo2.0-Regular.otf in Resources */, DABD394D1711E29700CF925C /* avatar-2.png in Resources */, DABD394E1711E29700CF925C /* avatar-2@2x.png in Resources */, DABD394F1711E29700CF925C /* avatar-3.png in Resources */, + DA67460F18DE7F0C00DFE240 /* Exo2.0-ExtraBold.otf in Resources */, DABD39501711E29700CF925C /* avatar-3@2x.png in Resources */, DABD39511711E29700CF925C /* avatar-4.png in Resources */, DABD39521711E29700CF925C /* avatar-4@2x.png in Resources */, @@ -3610,10 +3701,8 @@ DABD395B1711E29700CF925C /* avatar-9.png in Resources */, DABD395C1711E29700CF925C /* avatar-9@2x.png in Resources */, DABD395D1711E29700CF925C /* background.png in Resources */, + DA45224719062899008F650A /* icon_settings.png in Resources */, DABD395E1711E29700CF925C /* background@2x.png in Resources */, - DABD39841711E29700CF925C /* Exo-Bold.otf in Resources */, - DABD39851711E29700CF925C /* Exo-ExtraBold.otf in Resources */, - DABD39861711E29700CF925C /* Exo-Regular.otf in Resources */, DA945C8717E3F3FD0053236B /* Images.xcassets in Resources */, DABD39871711E29700CF925C /* SourceCodePro-Black.otf in Resources */, DADEF4161810D2940052CA3E /* love-lyndir.button.red.png in Resources */, @@ -3652,6 +3741,7 @@ DABD3B571711E29800CF925C /* tip_basic_black_bottom_right@2x.png in Resources */, DABD3B581711E29800CF925C /* tip_basic_black_top.png in Resources */, DABD3B591711E29800CF925C /* tip_basic_black_top@2x.png in Resources */, + DA4522441902355C008F650A /* icon_book.png in Resources */, DABD3B5A1711E29800CF925C /* tip_basic_black_top_right.png in Resources */, DABD3B5B1711E29800CF925C /* tip_basic_black_top_right@2x.png in Resources */, DABD3B881711E29800CF925C /* book.png in Resources */, @@ -3671,13 +3761,14 @@ DABD3B971711E29800CF925C /* pull-up.png in Resources */, DABD3B981711E29800CF925C /* pull-up@2x.png in Resources */, DABD3B991711E29800CF925C /* social-facebook.png in Resources */, + DA452249190628A1008F650A /* icon_wrench.png in Resources */, DABD3B9A1711E29800CF925C /* social-facebook@2x.png in Resources */, - DABD3B9B1711E29800CF925C /* social-google+.png in Resources */, + DA45224819062899008F650A /* icon_settings@2x.png in Resources */, DADEF4121810D2940052CA3E /* love-lyndir.button.green.png in Resources */, - DABD3B9C1711E29800CF925C /* social-google+@2x.png in Resources */, DABD3B9D1711E29800CF925C /* social-twitter.png in Resources */, DABD3B9E1711E29800CF925C /* social-twitter@2x.png in Resources */, DABD3C191711E2DC00CF925C /* MPElementListCellView.xib in Resources */, + DA854C8418D4CFBF00106317 /* avatar-add.png in Resources */, DABD3C221711E2DC00CF925C /* MainStoryboard_iPhone.storyboard in Resources */, DABD3C241711E2DC00CF925C /* MasterPassword.entitlements in Resources */, DABD3C251711E2DC00CF925C /* Settings.bundle in Resources */, @@ -3687,7 +3778,9 @@ DABD3FCE1714F45C00CF925C /* identity.png in Resources */, DABD3FCF1714F45C00CF925C /* identity@2x.png in Resources */, DADEF4151810D2940052CA3E /* love-lyndir.button.grey@2x.png in Resources */, + DA45224B190628B2008F650A /* icon_gear.png in Resources */, DAE1EF2217E942DE00BC0086 /* Localizable.strings in Resources */, + DA38D6A318CCB5BF009AEB3E /* Storyboard.storyboard in Resources */, DA5A09DF171A70E4005284AB /* play.png in Resources */, DA5A09E0171A70E4005284AB /* play@2x.png in Resources */, DA5A09EA171BB0F7005284AB /* unlocked.png in Resources */, @@ -3714,6 +3807,21 @@ shellPath = "/bin/bash -e"; shellScript = "PATH+=:/usr/libexec\n\naddPlistWithKey() {\n local key=$1 type=$2 value=$3 plist=${4:-\"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH\"}\n \n PlistBuddy -c \"Delete :'$key'\" \"$plist\" 2>/dev/null || true\n PlistBuddy -c \"Add :'$key' '$type' '$value'\" \"$plist\"\n}\nsetPlistWithKey() {\n local key=$1 value=$2 plist=${3:-\"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH\"}\n \n PlistBuddy -c \"Set :'$key' '$value'\" \"$plist\"\n}\ngetPlistWithKey() {\n local key=$1 plist=${2:-\"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH\"}\n \n PlistBuddy -c \"Print :'$key'\" \"$plist\"\n}\nsetSettingWithTitle() {\n local i title=$1 value=$2 plist=${3:-\"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Settings.bundle/Root.plist\"}\n \n for (( i=0; 1; ++i )); do\n PlistBuddy -c \"Print :PreferenceSpecifiers:$i\" \"$plist\" &>/dev/null || break\n echo \"Checking preference specifier $i\"\n \n [[ $(PlistBuddy -c \"Print :PreferenceSpecifiers:$i:Title\" \"$plist\" 2>/dev/null) = $title ]] || continue\n \n echo \"Correct title, setting value.\"\n PlistBuddy -c \"Set :PreferenceSpecifiers:$i:DefaultValue $value\" \"$plist\"\n break\n done\n}\n\ndescription=$(git describe --always --dirty --long)\nversion=${description%-g*}\nIFS=- read major minor <<< \"$version\"\nprintf -v version '%s.%02d' \"$major\" \"$minor\"\nprintf -v commit '%09d' \"$((16#${description##*-g}))\"\n\naddPlistWithKey GITDescription string \"$description\"\nsetPlistWithKey CFBundleVersion \"${version//.}$commit\" # No separator between version and commit because I had already submitted a CFBundleVersion with a really high major. Cry.\nsetPlistWithKey CFBundleShortVersionString \"$version\"\n\nsetSettingWithTitle \"Build\" \"$commit\"\nsetSettingWithTitle \"Version\" \"$version\"\nsetSettingWithTitle \"Copyright\" \"$(getPlistWithKey NSHumanReadableCopyright)\"\n\nif [[ $DEPLOYMENT_LOCATION = YES ]]; then\n # This build is a release. Do some release checks.\n passed=1\n [[ $description != *-dirty ]] || \\\n { passed=0; echo >&2 \"ERROR: Cannot release a dirty version, first commit any changes.\"; }\n [[ $(PlistBuddy -c \"Print :'API Key'\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Crashlytics.plist\") ]] || \\\n { passed=0; echo >&2 \"ERROR: Cannot release: Crashlytics API key is missing.\"; }\n [[ $(PlistBuddy -c \"Print :'ClientID'\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Google+.plist\") ]] || \\\n { passed=0; echo >&2 \"ERROR: Cannot release: Google+ ClientID is missing.\"; }\n [[ $(PlistBuddy -c \"Print :'Key.distribution'\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Localytics.plist\") ]] || \\\n { passed=0; echo >&2 \"ERROR: Cannot release: Localytics distribution key is missing.\"; }\n (( passed )) || \\\n { echo >&2 \"Failed to pass release checks. Fix the above errors and re-try. Aborting.\"; exit 1; }\nfi"; }; + DA67460818DE7B2C00DFE240 /* Run Script: Moarfonts */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script: Moarfonts"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = "/bin/bash -e"; + shellScript = "[[ -x /usr/local/bin/moarfonts ]] || {\n echo >&2 \"moarfonts not installed, embedded fonts will not show up in IB.\"\n exit\n}\n\n[[ ! -w \"$SDKROOT/System/Library/.lilid/.lilic\" ]] && {\n printf 'run:\\nSDKROOT=%q /usr/local/bin/moarfonts reset\\n' \"$SDKROOT\"\n}\n\nfind \"${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}\" -name '*.otf' -exec /usr/local/bin/moarfonts install {} +"; + showEnvVarsInLog = 0; + }; DAD3125D155288AA00A3F9ED /* Run Script: Crashlytics */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -3726,7 +3834,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = "/bin/bash -e"; - shellScript = "../../../External/Crashlytics.framework/run \\\n \"$(/usr/libexec/PlistBuddy -c \"Print :'API Key'\" ../../Resources/Crashlytics/Crashlytics.plist)\" || [[ $DEPLOYMENT_LOCATION != YES ]]"; + shellScript = "../../../External/iOS/Crashlytics.framework/run \\\n \"$(/usr/libexec/PlistBuddy -c \"Print :'API Key'\" ../../Resources/Crashlytics/Crashlytics.plist)\" || [[ $DEPLOYMENT_LOCATION != YES ]]"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -3774,14 +3882,27 @@ DABD3C271711E2DC00CF925C /* main.m in Sources */, 93D39F8A9254177891F38705 /* MPSetupViewController.m in Sources */, DA095E75172F4CD8001C948B /* MPLogsViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DA829E4D159847E0002417D3 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - DACA22161705DE13002C6C22 /* UIFont+Replacement.m in Sources */, + 93D39D596A2E376D6F6F5DA1 /* MPCombinedViewController.m in Sources */, + 93D3957237D303DE2D38C267 /* MPAvatarCell.m in Sources */, + 93D39B8F90F58A5D158DDBA3 /* MPPasswordsViewController.m in Sources */, + 93D3954FCE045A3CC7E804B7 /* MPUsersViewController.m in Sources */, + 93D39CB5E2EC1078E898F46A /* MPPasswordLargeCell.m in Sources */, + 93D39FA97F4C3F69A75D5A03 /* MPPasswordLargeGeneratedCell.m in Sources */, + 93D394F6D3F6E2553AA0D684 /* MPPasswordLargeStoredCell.m in Sources */, + 93D39392DEDA376F93C6C718 /* MPCell.m in Sources */, + 93D399278165FD6D950F0025 /* MPPasswordTypesCell.m in Sources */, + 93D39A5FF670957C0AF8298D /* MPPasswordCell.m in Sources */, + 93D398ECD7D1A0DEDDADF516 /* MPEmergencyViewController.m in Sources */, + 93D391ED37C9F687FA51EAA1 /* MPEmergencySegue.m in Sources */, + 93D394B5036C882B33C71872 /* MPPasswordsSegue.m in Sources */, + 93D39673DDC085BE72C34D7C /* MPPopdownSegue.m in Sources */, + 93D39B21156EC9A0B4C2BC83 /* MPPreferencesViewControllerOld.m in Sources */, + 93D39BA1EA3CAAC8A220B4A6 /* MPAppSettingsViewController.m in Sources */, + 93D396D8B67DA6522CDBA142 /* MPCoachmarkViewController.m in Sources */, + 93D391C07818F4C2DC1B6956 /* MPPasswordsCoachmarkViewController.m in Sources */, + 93D39EAA4D064193074D3021 /* MPFixable.m in Sources */, + 93D394982CBD25D46692DD7C /* MPWebViewController.m in Sources */, + 93D398BD8B83FEE8BE4EFFFC /* MPPasswordLargeDeleteCell.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3835,6 +3956,7 @@ DAFE4A5115039824003ABA7C /* PearlUIDebug.m in Sources */, DAFE4A5315039824003ABA7C /* PearlUIUtils.m in Sources */, DAFE4A5515039824003ABA7C /* PearlValidatingTextField.m in Sources */, + DAEC85B618E3DD9A007FC0DF /* PearlUINavigationBar.m in Sources */, DAFE4A5715039824003ABA7C /* PearlWebViewController.m in Sources */, DAFE4A5915039824003ABA7C /* UIImage+PearlScaling.m in Sources */, DAFE4A62150399FF003ABA7C /* PearlAppDelegate.m in Sources */, @@ -3845,16 +3967,27 @@ DA30E9D815723E6900A68B4C /* PearlLazy.m in Sources */, DAFE4A63150399FF003ABA82 /* UIControl+PearlBlocks.m in Sources */, DAFE4A63150399FF003ABA86 /* NSObject+PearlKVO.m in Sources */, + DAEC85B518E3DD9A007FC0DF /* PearlUIView.m in Sources */, + DA2CA4DD18D28859007798F8 /* NSArray+Pearl.m in Sources */, DAFE4A63150399FF003ABA8A /* UIControl+PearlSelect.m in Sources */, DAFE4A63150399FF003ABA8E /* UIScrollView+PearlFlashingIndicators.m in Sources */, DAFE4A63150399FF003ABA92 /* NSDateFormatter+RFC3339.m in Sources */, + DA2CA4E618D2AC10007798F8 /* NSLayoutConstraint+PearlUIKit.m in Sources */, 93D395F08A087F8A24689347 /* NSArray+Indexing.m in Sources */, 93D39E281E3658B30550CB55 /* NSDictionary+Indexing.m in Sources */, + DAF4EF50190A81E400023C90 /* NSManagedObject+Pearl.m in Sources */, 93D39262A8A97DB748213309 /* PearlEMail.m in Sources */, DA3509FF15F101A500C14A8E /* PearlQueue.m in Sources */, 93D3922A53E41A54832E90D9 /* PearlOverlay.m in Sources */, 93D396AA30690B256F30378A /* PearlNavigationController.m in Sources */, 93D397952F5635C793C24DF1 /* NSError+PearlFullDescription.m in Sources */, + DA2CA4DF18D28859007798F8 /* NSTimer+PearlBlock.m in Sources */, + 93D3954E96236384AFA00453 /* UIScrollView+PearlAdjustInsets.m in Sources */, + 93D39A8EA1C49CE43B63F47B /* PearlUICollectionView.m in Sources */, + 93D399246DC90F50913A1287 /* UIResponder+PearlFirstResponder.m in Sources */, + DAA141201922FF020032B392 /* PearlTween.m in Sources */, + 93D391ECBD9BD2C64115B5DD /* PearlSizedTextView.m in Sources */, + 93D39E34FD28D24FE3442C48 /* UITextView+PearlAttributes.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3879,17 +4012,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - DAE1EF2517ED112600BC0086 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - DAE1EF5817ED115E00BC0086 /* DCCrossHairView.m in Sources */, - DAE1EF5B17ED115E00BC0086 /* DCStatusBarOverlay.m in Sources */, - DAE1EF5917ED115E00BC0086 /* DCFrameView.m in Sources */, - DAE1EF5A17ED115E00BC0086 /* DCIntrospect.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; DAFC5651172C573B00CB5CC5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -3980,7 +4102,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; CLANG_WARN_OBJC_RECEIVER_WEAK = NO; @@ -4025,7 +4147,7 @@ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_SIGN_COMPARE = NO; GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = NO; @@ -4067,7 +4189,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; CLANG_WARN_OBJC_RECEIVER_WEAK = NO; @@ -4116,7 +4238,7 @@ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_SIGN_COMPARE = NO; GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; @@ -4147,11 +4269,14 @@ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_ENTITLEMENTS = MasterPassword.entitlements; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; EXCLUDED_SOURCE_FILE_NAMES = libTestFlight.a; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + /Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/iOS, + ); GCC_PREFIX_HEADER = "MasterPassword-Prefix.pch"; INFOPLIST_FILE = "MasterPassword-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; OTHER_LDFLAGS = ( "$(inherited)", "-framework", @@ -4171,41 +4296,23 @@ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_ENTITLEMENTS = MasterPassword.entitlements; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; - EXCLUDED_SOURCE_FILE_NAMES = ""; + EXCLUDED_SOURCE_FILE_NAMES = libDCIntrospect.a; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + /Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/iOS, + ); GCC_PREFIX_HEADER = "MasterPassword-Prefix.pch"; INFOPLIST_FILE = "MasterPassword-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; PROVISIONING_PROFILE = ""; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "4CBD21E7-DB60-4F7F-80F8-98DFA83D2CE0"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = "90E2D6C0-0269-4862-AE5F-015956C15CCF"; SKIP_INSTALL = NO; STRIP_INSTALLED_PRODUCT = YES; TARGETED_DEVICE_FAMILY = 1; }; name = "AdHoc-iOS"; }; - DA829E5A159847E0002417D3 /* Debug-iOS */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_WARN_INHIBIT_ALL_WARNINGS = YES; - }; - name = "Debug-iOS"; - }; - DA829E5B159847E0002417D3 /* AdHoc-iOS */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_WARN_INHIBIT_ALL_WARNINGS = YES; - }; - name = "AdHoc-iOS"; - }; - DA829E5C159847E0002417D3 /* AppStore-iOS */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_WARN_INHIBIT_ALL_WARNINGS = YES; - }; - name = "AppStore-iOS"; - }; DA95D60914DF3F3B008D1B94 /* AppStore-iOS */ = { isa = XCBuildConfiguration; buildSettings = { @@ -4225,7 +4332,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; CLANG_WARN_OBJC_RECEIVER_WEAK = NO; @@ -4273,7 +4380,7 @@ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_SIGN_COMPARE = NO; GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; @@ -4304,15 +4411,18 @@ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_ENTITLEMENTS = MasterPassword.entitlements; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; EXCLUDED_SOURCE_FILE_NAMES = ( libTestFlight.a, libDCIntrospect.a, ); + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + /Users/lhunath/Documents/workspace/lyndir/MasterPassword/External/iOS, + ); GCC_PREFIX_HEADER = "MasterPassword-Prefix.pch"; INFOPLIST_FILE = "MasterPassword-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; PROVISIONING_PROFILE = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "6C6B84DD-9D8F-4321-BD77-5F737DBE1778"; SKIP_INSTALL = NO; @@ -4498,27 +4608,6 @@ }; name = "AppStore-iOS"; }; - DAE1EF4717ED112700BC0086 /* Debug-iOS */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_WARN_INHIBIT_ALL_WARNINGS = YES; - }; - name = "Debug-iOS"; - }; - DAE1EF4817ED112700BC0086 /* AdHoc-iOS */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_WARN_INHIBIT_ALL_WARNINGS = YES; - }; - name = "AdHoc-iOS"; - }; - DAE1EF4917ED112700BC0086 /* AppStore-iOS */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_WARN_INHIBIT_ALL_WARNINGS = YES; - }; - name = "AppStore-iOS"; - }; DAFC565F172C573B00CB5CC5 /* Debug-iOS */ = { isa = XCBuildConfiguration; buildSettings = { @@ -4585,16 +4674,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = "AdHoc-iOS"; }; - DA829E59159847E0002417D3 /* Build configuration list for PBXNativeTarget "FontReplacer" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DA829E5A159847E0002417D3 /* Debug-iOS */, - DA829E5B159847E0002417D3 /* AdHoc-iOS */, - DA829E5C159847E0002417D3 /* AppStore-iOS */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = "AdHoc-iOS"; - }; DAC632651486805C0075AEA5 /* Build configuration list for PBXNativeTarget "uicolor-utilities" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -4645,16 +4724,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = "AdHoc-iOS"; }; - DAE1EF4617ED112700BC0086 /* Build configuration list for PBXNativeTarget "DCIntrospect" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DAE1EF4717ED112700BC0086 /* Debug-iOS */, - DAE1EF4817ED112700BC0086 /* AdHoc-iOS */, - DAE1EF4917ED112700BC0086 /* AppStore-iOS */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = "AdHoc-iOS"; - }; DAFC565E172C573B00CB5CC5 /* Build configuration list for PBXNativeTarget "InAppSettingsKit" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword iOS (Development).xcscheme b/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword iOS (Development).xcscheme index 9cc7e2ed..3a8466bd 100644 --- a/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword iOS (Development).xcscheme +++ b/MasterPassword/ObjC/iOS/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword iOS (Development).xcscheme @@ -57,6 +57,16 @@ ReferencedContainer = "container:MasterPassword-iOS.xcodeproj"> + + + + + + diff --git a/MasterPassword/ObjC/iOS/Settings.bundle/Root.plist b/MasterPassword/ObjC/iOS/Settings.bundle/Root.plist index e3ffcd59..30099a7c 100644 --- a/MasterPassword/ObjC/iOS/Settings.bundle/Root.plist +++ b/MasterPassword/ObjC/iOS/Settings.bundle/Root.plist @@ -70,6 +70,24 @@ Type PSToggleSwitchSpecifier + + FooterText + Enabling support for dictation in the site search box will enable the dictation button next to the space bar at the bottom of the keyboard. Press this button and speak the name of your site to look it up. Enabling dictation will change your keyboard which might make it slightly more difficult to enter a site name manually. + Title + + Type + PSGroupSpecifier + + + DefaultValue + + Key + dictationSearch + Title + Dictation Search + Type + PSToggleSwitchSpecifier + Type PSGroupSpecifier @@ -88,6 +106,24 @@ DefaultValue + + Type + PSGroupSpecifier + Title + + FooterText + If the app tends to crash on login, enable this to check if there are any inconsistencies in your site data. It may slow down login a bit, so keep it off when no issues are reported on login. + + + Type + PSToggleSwitchSpecifier + Title + Check For Inconsistencies + Key + checkInconsistency + DefaultValue + + StringsTable Root diff --git a/MasterPassword/ObjC/iOS/Storyboard.storyboard b/MasterPassword/ObjC/iOS/Storyboard.storyboard new file mode 100644 index 00000000..2bd6b34d --- /dev/null +++ b/MasterPassword/ObjC/iOS/Storyboard.storyboard @@ -0,0 +1,2784 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 119-20:51:52 MPiOSAppDelegate.m:36 | INFO : Initializing TestFlight +119-20:51:52 MPiOSAppDelegate.m:70 | INFO : Initializing Google+ +119-20:51:52 MPiOSAppDelegate.m:80 | INFO : Initializing Crashlytics +119-20:51:52 MPiOSAppDelegate.m:109 | INFO : Initializing Localytics +119-20:51:53 PearlAppDelegate.m:71 | INFO : Master Password (MasterPassword) 1.4 (1.4.0) (GIT: 1.4-0-g8a4eecd-dirty) +119-20:51:53 MPiOSAppDelegate.m:257 | INFO : Started up with device identifier: A8C51CDA-6F60-4F0C-BFC9-68A08F2F2DD7 +119-20:51:59 MPAppDelegate_Store.m:278 | DEBUG : [StoreManager] (Re)loading store... +119-20:51:59 MPAppDelegate_Store.m:278 | DEBUG : [StoreManager] Will load cloud store: 0B3CA2DF-5796-44DF-B5E0-121EC3846464 (definite). +119-20:51:59 PearlConfig.m:193 | INFO : Lock screen will appear +119-20:51:59 MPiOSAppDelegate.m:412 | INFO : Re-activated +119-20:51:59 PearlConfig.m:180 | DEBUG : MPiOSConfig.launchCount = [70 ->] 71 +119-20:52:02 MPAppDelegate_Store.m:278 | DEBUG : [StoreManager] Clearing stores... +119-20:52:03 MPAppDelegate_Store.m:278 | DEBUG : [StoreManager] Loading store without seeding. +119-20:52:09 MPAppDelegate_Store.m:278 | DEBUG : [StoreManager] Cloud enabled and successfully loaded cloud store. +119-20:52:09 MPAppDelegate_Store.m:299 | INFO : Using iCloud? 1 +119-20:52:12 MPAppDelegate_Key.m:28 | INFO : Found key in keychain for: b55911588b178466be1d6392597e899b8de46f9a +119-20:52:12 MPAppDelegate_Key.m:132 | INFO : Logged in: b55911588b178466be1d6392597e899b8de46f9a +119-20:52:13 MPUnlockViewController.m:229 | INFO : Lock screen will disappear +119-20:52:13 MPMainViewController.m:142 | INFO : Main will appear +119-20:52:16 MPMainViewController.m:734 | INFO : Action: Preferences +119-20:52:17 MPMainViewController.m:187 | INFO : Main will disappear. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MasterPassword/Resources/Media/Avatars/avatar-add.png b/MasterPassword/Resources/Media/Avatars/avatar-add.png new file mode 100644 index 00000000..be68d16e Binary files /dev/null and b/MasterPassword/Resources/Media/Avatars/avatar-add.png differ diff --git a/MasterPassword/Resources/Media/Avatars/avatar-add@2x.png b/MasterPassword/Resources/Media/Avatars/avatar-add@2x.png new file mode 100644 index 00000000..3e91b6dc Binary files /dev/null and b/MasterPassword/Resources/Media/Avatars/avatar-add@2x.png differ diff --git a/MasterPassword/Resources/Media/Fonts/Exo-Bold.otf b/MasterPassword/Resources/Media/Fonts/Exo-Bold.otf deleted file mode 100644 index 02ff3b55..00000000 Binary files a/MasterPassword/Resources/Media/Fonts/Exo-Bold.otf and /dev/null differ diff --git a/MasterPassword/Resources/Media/Fonts/Exo-ExtraBold.otf b/MasterPassword/Resources/Media/Fonts/Exo-ExtraBold.otf deleted file mode 100644 index 1e1c3311..00000000 Binary files a/MasterPassword/Resources/Media/Fonts/Exo-ExtraBold.otf and /dev/null differ diff --git a/MasterPassword/Resources/Media/Fonts/Exo-Regular.otf b/MasterPassword/Resources/Media/Fonts/Exo-Regular.otf deleted file mode 100644 index 4c4691f2..00000000 Binary files a/MasterPassword/Resources/Media/Fonts/Exo-Regular.otf and /dev/null differ diff --git a/MasterPassword/Resources/Media/Fonts/Exo2.0-Bold.otf b/MasterPassword/Resources/Media/Fonts/Exo2.0-Bold.otf new file mode 100644 index 00000000..1e7072dd Binary files /dev/null and b/MasterPassword/Resources/Media/Fonts/Exo2.0-Bold.otf differ diff --git a/MasterPassword/Resources/Media/Fonts/Exo2.0-ExtraBold.otf b/MasterPassword/Resources/Media/Fonts/Exo2.0-ExtraBold.otf new file mode 100644 index 00000000..32dadb3f Binary files /dev/null and b/MasterPassword/Resources/Media/Fonts/Exo2.0-ExtraBold.otf differ diff --git a/MasterPassword/Resources/Media/Fonts/Exo2.0-Regular.otf b/MasterPassword/Resources/Media/Fonts/Exo2.0-Regular.otf new file mode 100644 index 00000000..4bd82f98 Binary files /dev/null and b/MasterPassword/Resources/Media/Fonts/Exo2.0-Regular.otf differ diff --git a/MasterPassword/Resources/Media/Fonts/Exo2.0-Thin.otf b/MasterPassword/Resources/Media/Fonts/Exo2.0-Thin.otf new file mode 100644 index 00000000..768f03f3 Binary files /dev/null and b/MasterPassword/Resources/Media/Fonts/Exo2.0-Thin.otf differ diff --git a/MasterPassword/Resources/Media/empty.png b/MasterPassword/Resources/Media/empty.png new file mode 100644 index 00000000..09274f55 Binary files /dev/null and b/MasterPassword/Resources/Media/empty.png differ diff --git a/MasterPassword/Resources/Media/empty@2x.png b/MasterPassword/Resources/Media/empty@2x.png new file mode 100644 index 00000000..cb000701 Binary files /dev/null and b/MasterPassword/Resources/Media/empty@2x.png differ diff --git a/MasterPassword/Resources/Media/keyboard-dark@2x.png b/MasterPassword/Resources/Media/keyboard-dark@2x.png new file mode 100644 index 00000000..53675f6d Binary files /dev/null and b/MasterPassword/Resources/Media/keyboard-dark@2x.png differ diff --git a/Scripts/updateDependencies b/Scripts/updateDependencies index 99d0d2e4..752dd904 100755 --- a/Scripts/updateDependencies +++ b/Scripts/updateDependencies @@ -5,7 +5,7 @@ shopt -s extglob ## Submodules that need to be checked out. -dependencies=( External/{FontReplacer,InAppSettingsKit,Pearl{,:External/jrswizzle,:External/uicolor-utilities},google-plus-ios-sdk,UbiquityStoreManager,RHStatusItemView,LoveLyndir,DCIntrospect} ) +dependencies=( External/{InAppSettingsKit,Pearl{,:External/jrswizzle,:External/uicolor-utilities},UbiquityStoreManager,RHStatusItemView,LoveLyndir} ) ## Custom migration. # None yet.