A9ChipSource: small open-source iOS utility to identify A9 foundry
github.com
github.com
Information on the chip identifiers was derived from the original closed source tool, and theiphonewiki (https://www.theiphonewiki.com/wiki/S8003 and https://www.theiphonewiki.com/wiki/S8000).
Motivation was basically to have an open source version of the tool, which didn't relay information back to a server or use advertising. Plus having people install unauthorised apps using a leaked/dodgy enterprise distribution certificate is a dangerous game; having an open source tool allows people in the know to install it on their own devices, safe in the knowledge what it's going to do.
https://github.com/WDUK/A9ChipSource/tree/master/A9ChipSourc...
As far as I can see, the actual work is performed by around 5 lines of code in this file, which reads a configuration value, performs two string comparisons, and outputs to 2 text fields:
https://github.com/WDUK/A9ChipSource/blob/master/A9ChipSourc...
In other words, is this level of verbosity/"fluff" typical of iOS apps?
ETA: With some cut-and-paste & removing stubs, and preserving the storyboards, the whole thing can be reduced to 20 lines in just main.m, smaller if you shift into "obfuscated objective-c" mode.
Of course, you have the .h files too. With Swift these go away so there's fewer files. Finally, you can do scripting that doesn't have any boilerplate: http://www.h4labs.com/dev/ios/swift.html?age=10000&q=scripti...
Objective-C isn't too bad. I've certainly had more boilerplate to deal with on various other platforms. In terms of names, it is verbose though. It's one of the things I really like about it.
You're right, all of the interesting code is in ViewController.m, and if this were extracted to a library it would be much smaller.
I think the point of this repo is a demo app that you can build and run on your phone to find out which chip manufacturer you have.
[0] http://www.macrumors.com/2015/09/29/a9-chip-split-tsmc-samsu...
My impression was that only apple approved, app-store delivered software could run on iPhone/iPad/iWhatever ...
Am I wrong to be surprised to see an "iOS utility" hosted on github ? What am I missing here ?
Free On-Device Development
Now everyone can run and test their own app on a device—for free. You can run and debug your own creations on a Mac, iPhone, iPad, iPod touch, or Apple Watch without any fees, and no programs to join. All you need to do is enter your free Apple ID into Xcode. You can even use the same Apple ID you already use for the App Store or iTunes. Once you’ve perfected your app the Apple Developer Program can help you get it on the App Store.
See Launching Your App on Devices for detailed information about installing and running on devices.
( From the feature list for xcode 7 — https://developer.apple.com/library/prerelease/ios/documenta... )
My theory was that the whole developer key thing was a very effective piracy countermeasure — registering and paying $100/year (iirc) is expensive and inconvenient enough that it's easier to just buy things. What has changed?
https://github.com/WDUK/A9ChipSource/blob/master/A9ChipSourc...
CFStringRef val = (CFStringRef)MGCopyAnswer(CFSTR("HardwarePlatform"));
NSString* chipIdentifier =(__bridge NSString * _Nullable)(val);
let u = MGCopyAnswer("HardwarePlatform")
However, the problem is that MGCopyAnswer is a private method, and thus you have to define an interface for it. You can't do that in Swift, however you can do it by creating a bridging header for Swift.
So you'd need to add a bridging-header.h to the project, then set the compile target up to use the bridging header, and finally add this to the bridging header:
#include <CoreFoundation/CoreFoundation.h> #if __cplusplus extern "C" { #endif CFPropertyListRef MGCopyAnswer(CFStringRef property); #if __cplusplus } #endif