Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Replaced JSONKit with NSJSONSerialization (and set deployment target …

…to 5.0)
  • Loading branch information...
commit f87a37fe0eac333ef400b6317e89d8cebc9894c4 1 parent d1f9014
Ole Zorn authored
View
10 AppSales.xcodeproj/project.pbxproj
@@ -77,7 +77,6 @@
7F709D8F13BD064E0008DBAD /* ASAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F709D8E13BD064D0008DBAD /* ASAccount.m */; };
7F7F1D0C13F6442C00F18143 /* PromoCodesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F7F1D0B13F6442C00F18143 /* PromoCodesViewController.m */; };
7F7F1D0F13F6455A00F18143 /* PromoCodesAppViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F7F1D0E13F6455900F18143 /* PromoCodesAppViewController.m */; };
- 7F7F4A0513E4F4AD006C6651 /* JSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F7F4A0413E4F4AD006C6651 /* JSONKit.m */; };
7F7F4A3F13E50A52006C6651 /* PaymentsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F7F4A3E13E50A52006C6651 /* PaymentsViewController.m */; };
7F7F4A4213E51A99006C6651 /* YearView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F7F4A4113E51A99006C6651 /* YearView.m */; };
7F89BCDE13DFA45F001C607F /* ReviewDownloadManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F89BCDD13DFA45F001C607F /* ReviewDownloadManager.m */; };
@@ -779,8 +778,6 @@
7F7F1D0B13F6442C00F18143 /* PromoCodesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PromoCodesViewController.m; sourceTree = "<group>"; };
7F7F1D0D13F6455900F18143 /* PromoCodesAppViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PromoCodesAppViewController.h; sourceTree = "<group>"; };
7F7F1D0E13F6455900F18143 /* PromoCodesAppViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PromoCodesAppViewController.m; sourceTree = "<group>"; };
- 7F7F4A0313E4F4AD006C6651 /* JSONKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONKit.h; sourceTree = "<group>"; };
- 7F7F4A0413E4F4AD006C6651 /* JSONKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONKit.m; sourceTree = "<group>"; };
7F7F4A3D13E50A52006C6651 /* PaymentsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaymentsViewController.h; sourceTree = "<group>"; };
7F7F4A3E13E50A52006C6651 /* PaymentsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PaymentsViewController.m; sourceTree = "<group>"; };
7F7F4A4013E51A99006C6651 /* YearView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YearView.h; sourceTree = "<group>"; };
@@ -1799,8 +1796,6 @@
isa = PBXGroup;
children = (
7FDCCE721594315100124140 /* ZipFile */,
- 7F7F4A0313E4F4AD006C6651 /* JSONKit.h */,
- 7F7F4A0413E4F4AD006C6651 /* JSONKit.m */,
7F454F9E13D5C24F00AE47D1 /* UIColor+Extensions.h */,
7F454F9F13D5C24F00AE47D1 /* UIColor+Extensions.m */,
7F1499C813BE15F500D89064 /* NSData+Compression.h */,
@@ -3045,7 +3040,6 @@
7F26DF9113E13319001D0F33 /* ReviewDetailViewController.m in Sources */,
7F24E70713E40A0D0056EA97 /* DashboardViewController.m in Sources */,
7F24E70A13E4187A0056EA97 /* ReviewsViewController.m in Sources */,
- 7F7F4A0513E4F4AD006C6651 /* JSONKit.m in Sources */,
7F7F4A3F13E50A52006C6651 /* PaymentsViewController.m in Sources */,
7F7F4A4213E51A99006C6651 /* YearView.m in Sources */,
7FAEB66613E6D0EE00750788 /* BadgedCell.m in Sources */,
@@ -3142,7 +3136,7 @@
GCC_PREFIX_HEADER = "OtherSources/AppSales-Prefix.pch";
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "Support/AppSales-Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = AppSalesMobile;
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
@@ -3156,7 +3150,7 @@
GCC_PREFIX_HEADER = "OtherSources/AppSales-Prefix.pch";
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "Support/AppSales-Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = AppSalesMobile;
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
View
251 Classes/JSONKit.h
@@ -1,251 +0,0 @@
-//
-// JSONKit.h
-// http://github.com/johnezang/JSONKit
-// Dual licensed under either the terms of the BSD License, or alternatively
-// under the terms of the Apache License, Version 2.0, as specified below.
-//
-
-/*
- Copyright (c) 2011, John Engelhart
-
- 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 the Zang Industries 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.
-*/
-
-/*
- Copyright 2011 John Engelhart
-
- 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 <stddef.h>
-#include <stdint.h>
-#include <limits.h>
-#include <TargetConditionals.h>
-#include <AvailabilityMacros.h>
-
-#ifdef __OBJC__
-#import <Foundation/NSArray.h>
-#import <Foundation/NSData.h>
-#import <Foundation/NSDictionary.h>
-#import <Foundation/NSError.h>
-#import <Foundation/NSObjCRuntime.h>
-#import <Foundation/NSString.h>
-#endif // __OBJC__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-// For Mac OS X < 10.5.
-#ifndef NSINTEGER_DEFINED
-#define NSINTEGER_DEFINED
-#if defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
-typedef long NSInteger;
-typedef unsigned long NSUInteger;
-#define NSIntegerMin LONG_MIN
-#define NSIntegerMax LONG_MAX
-#define NSUIntegerMax ULONG_MAX
-#else // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
-typedef int NSInteger;
-typedef unsigned int NSUInteger;
-#define NSIntegerMin INT_MIN
-#define NSIntegerMax INT_MAX
-#define NSUIntegerMax UINT_MAX
-#endif // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
-#endif // NSINTEGER_DEFINED
-
-
-#ifndef _JSONKIT_H_
-#define _JSONKIT_H_
-
-#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465)
-#define JK_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
-#else
-#define JK_DEPRECATED_ATTRIBUTE
-#endif
-
-#define JSONKIT_VERSION_MAJOR 1
-#define JSONKIT_VERSION_MINOR 4
-
-typedef NSUInteger JKFlags;
-
-/*
- JKParseOptionComments : Allow C style // and /_* ... *_/ (without a _, obviously) comments in JSON.
- JKParseOptionUnicodeNewlines : Allow Unicode recommended (?:\r\n|[\n\v\f\r\x85\p{Zl}\p{Zp}]) newlines.
- JKParseOptionLooseUnicode : Normally the decoder will stop with an error at any malformed Unicode.
- This option allows JSON with malformed Unicode to be parsed without reporting an error.
- Any malformed Unicode is replaced with \uFFFD, or "REPLACEMENT CHARACTER".
- */
-
-enum {
- JKParseOptionNone = 0,
- JKParseOptionStrict = 0,
- JKParseOptionComments = (1 << 0),
- JKParseOptionUnicodeNewlines = (1 << 1),
- JKParseOptionLooseUnicode = (1 << 2),
- JKParseOptionPermitTextAfterValidJSON = (1 << 3),
- JKParseOptionValidFlags = (JKParseOptionComments | JKParseOptionUnicodeNewlines | JKParseOptionLooseUnicode | JKParseOptionPermitTextAfterValidJSON),
-};
-typedef JKFlags JKParseOptionFlags;
-
-enum {
- JKSerializeOptionNone = 0,
- JKSerializeOptionPretty = (1 << 0),
- JKSerializeOptionEscapeUnicode = (1 << 1),
- JKSerializeOptionEscapeForwardSlashes = (1 << 4),
- JKSerializeOptionValidFlags = (JKSerializeOptionPretty | JKSerializeOptionEscapeUnicode | JKSerializeOptionEscapeForwardSlashes),
-};
-typedef JKFlags JKSerializeOptionFlags;
-
-#ifdef __OBJC__
-
-typedef struct JKParseState JKParseState; // Opaque internal, private type.
-
-// As a general rule of thumb, if you use a method that doesn't accept a JKParseOptionFlags argument, it defaults to JKParseOptionStrict
-
-@interface JSONDecoder : NSObject {
- JKParseState *parseState;
-}
-+ (id)decoder;
-+ (id)decoderWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
-- (id)initWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
-- (void)clearCache;
-
-// The parse... methods were deprecated in v1.4 in favor of the v1.4 objectWith... methods.
-- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithUTF8String:length: instead.
-- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length error:(NSError **)error JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithUTF8String:length:error: instead.
-// The NSData MUST be UTF8 encoded JSON.
-- (id)parseJSONData:(NSData *)jsonData JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithData: instead.
-- (id)parseJSONData:(NSData *)jsonData error:(NSError **)error JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4. Use objectWithData:error: instead.
-
-// Methods that return immutable collection objects.
-- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length;
-- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error;
-// The NSData MUST be UTF8 encoded JSON.
-- (id)objectWithData:(NSData *)jsonData;
-- (id)objectWithData:(NSData *)jsonData error:(NSError **)error;
-
-// Methods that return mutable collection objects.
-- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length;
-- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error;
-// The NSData MUST be UTF8 encoded JSON.
-- (id)mutableObjectWithData:(NSData *)jsonData;
-- (id)mutableObjectWithData:(NSData *)jsonData error:(NSError **)error;
-
-@end
-
-////////////
-#pragma mark Deserializing methods
-////////////
-
-@interface NSString (JSONKitDeserializing)
-- (id)objectFromJSONString;
-- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
-- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
-- (id)mutableObjectFromJSONString;
-- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
-- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
-@end
-
-@interface NSData (JSONKitDeserializing)
-// The NSData MUST be UTF8 encoded JSON.
-- (id)objectFromJSONData;
-- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
-- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
-- (id)mutableObjectFromJSONData;
-- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags;
-- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;
-@end
-
-////////////
-#pragma mark Serializing methods
-////////////
-
-@interface NSString (JSONKitSerializing)
-// Convenience methods for those that need to serialize the receiving NSString (i.e., instead of having to serialize a NSArray with a single NSString, you can "serialize to JSON" just the NSString).
-// Normally, a string that is serialized to JSON has quotation marks surrounding it, which you may or may not want when serializing a single string, and can be controlled with includeQuotes:
-// includeQuotes:YES `a "test"...` -> `"a \"test\"..."`
-// includeQuotes:NO `a "test"...` -> `a \"test\"...`
-- (NSData *)JSONData; // Invokes JSONDataWithOptions:JKSerializeOptionNone includeQuotes:YES
-- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error;
-- (NSString *)JSONString; // Invokes JSONStringWithOptions:JKSerializeOptionNone includeQuotes:YES
-- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error;
-@end
-
-@interface NSArray (JSONKitSerializing)
-- (NSData *)JSONData;
-- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
-- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
-- (NSString *)JSONString;
-- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
-- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
-@end
-
-@interface NSDictionary (JSONKitSerializing)
-- (NSData *)JSONData;
-- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
-- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
-- (NSString *)JSONString;
-- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;
-- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;
-@end
-
-#ifdef __BLOCKS__
-
-@interface NSArray (JSONKitSerializingBlockAdditions)
-- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
-- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
-@end
-
-@interface NSDictionary (JSONKitSerializingBlockAdditions)
-- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
-- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;
-@end
-
-#endif
-
-
-#endif // __OBJC__
-
-#endif // _JSONKIT_H_
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
View
3,024 Classes/JSONKit.m
0 additions, 3,024 deletions not shown
View
3  Classes/ReportDownloadOperation.m
@@ -421,7 +421,8 @@ - (void)parsePaymentsPage:(NSString *)paymentsPage inAccount:(ASAccount *)accoun
graphDataJSON = [graphDataJSON stringByAppendingString:@"}"];
graphDataJSON = [graphDataJSON stringByReplacingOccurrencesOfString:@"'" withString:@"\""];
NSError *jsonError = nil;
- NSDictionary *graphDict = [graphDataJSON objectFromJSONStringWithParseOptions:JKParseOptionUnicodeNewlines | JKParseOptionLooseUnicode error:&jsonError];
+
+ NSDictionary *graphDict = [NSJSONSerialization JSONObjectWithData:[graphDataJSON dataUsingEncoding:NSUTF8StringEncoding] options:0 error:&jsonError];
if (graphDict) {
NSSet *allExistingPayments = account.payments;
NSMutableSet *existingPaymentIdentifiers = [NSMutableSet set];
View
2  README.md
@@ -16,7 +16,7 @@ AppSales allows iOS and Mac App Store developers to download and analyze their s
Please see the screenshot below for a visual guide to AppSales' main interface and some tips and tricks.
##Requirements
-AppSales requires the iOS 4.2 SDK or later.
+AppSales requires the iOS 5.0 SDK or later.
Because there is no API to access some parts of iTunes Connect, AppSales scrapes [itunesconnect.apple.com](https://itunesconnect.apple.com). This means that even small changes on this website can break some functionality. In most cases, this is easy to fix and I'll try to make a new version available here. The report download itself uses Apple's auto-ingestion interface to iTunes Connect and should generally be unaffected by changes to the website.
Please sign in to comment.
Something went wrong with that request. Please try again.