문제

I have the paid content on my application on App Store. And I save it using the following code:

paidContentCount = [[NSUserDefaults standardUserDefaults] integerForKey:@"paidContentCount"];

But it's easy to hack it. How can I protect integer data from hacking?

도움이 되었습니까?

해결책 2

You can try saving your content as string with [NSString hash] method, and after your app is loaded, compare paid content's hashes with value from NSUserDefaults

UPDATE: forgot that [NSString hash] returns NSInteger

다른 팁

Never store such settings in NSUserDefaults! Use an iOS Keychain for it. Here is the wrapper, which makes the biggest part of work.

Besides it, you can read this article from Ray Wenderlich - there are a lot of good ideas of basic security.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top