Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Claude Code now reads AGENTS.md if there is no Claude.md(claude.com ↗)
    87comments
  2. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    166comments
  3. Saving another 100TB of RAM(cloudflare.com ↗)
    29comments
  4. Cloudflare Quick Tunnels(cloudflare.com ↗)
    214comments
  5. Xcode 27.1 Beta Release Notes(developer.apple.com ↗)
    54comments
  6. Cache-to-Cache: Direct Semantic Communication Between LLMs (2025)(arxiv.org ↗)
    10comments
  7. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    41comments
  8. How to Write with an LLM(sockpuppet.org ↗)
    235comments
  9. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    70comments
  10. Cyclomatic Complexity in C#(ndepend.com ↗)
    3comments
  11. OpenJev(openjev.com ↗)
    234comments
  12. The Implications of Linguistic Illegibility for LLM Security(arxiv.org ↗)
    14comments
  13. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    29comments
  14. Two parallel neural ectoderm progenitors contribute to the developing brain(newscientist.com ↗)
    49comments
  15. A search-and-inference database from scratch in pure Zig(antfly.io ↗)
    14comments
  16. From Geometry to Algebra and Back Again: 4000 Years of Papers (2023) [video](youtube.com ↗)
    discuss
  17. C++26: Trivial infinite loops are no longer undefined behaviour(sandordargo.com ↗)
    160comments
  18. How SpaceX streamlined the Raptor engine(construction-physics.com ↗)
    19comments
  19. Size-Specialized Memory Allocation(go.dev ↗)
    discuss
  20. Minimal Phone 2(minimalcompany.com ↗)
    138comments
  21. I vibed a proof of Conway's conjecture(overreacted.io ↗)
    172comments
  22. Inside ZCode: Silently uploading your Git history to the cloud(ferstar.org ↗)
    88comments
  23. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    12comments
  24. Korea raises data breach fines to 10% of revenue(koreajoongangdaily.com ↗)
    59comments
  25. US Military had close call after using AI for hallucinated intelligence report(cnn.com ↗)
    262comments
  26. Border agents can search cellphones without a warrant or reasonable suspicion(lawandcrime.com ↗)
    121comments
  27. Cekura (YC F24) Is Hiring(ycombinator.com ↗)
    discuss
  28. Show HN: Ax-check.com – Can agents use your product?(ax-check.com ↗)
    25comments
  29. Mathematicians Build Long-Awaited Graph Sandwich(quantamagazine.org ↗)
    15comments
  30. Show HN: Scry, programmable internet search w/ congestion pricing(scry.io ↗)
    16comments

A9ChipSource: small open-source iOS utility to identify A9 foundry

37 pointsby 11y agogithub.com
23 comments
11y agoHN ↗

I haven't done any iOS development before but is there any real reason why a tiny app with what seems to be ~100 lines of code needs to be split into several small files with even fewer lines in them?

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?

11y agoHN ↗

AppDelegate.m and main.m are boilerplate. They are generated by Xcode when you create a new project. Often you don't change them. The ViewController is where you should start examining the code.

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...

11y agoHN ↗

Most of what you see is the boilerplate of generating a new iOS app.

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.

11y agoHN ↗

That's not much verbosity/fluff. It's the typical default auto-generated code files; basically the author said "new project" and filled in a few lines. No need to hand-optimize this into minimum files.

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.

11y agoHN ↗

Exactly, I spent less than half an hour writing this up, and wasn't aiming for the lowest LOC possible. This is all mostly boilerplate.

11y agoHN ↗

I should have come to the comments before trying to work out which file the functional code was in.

11y agoHN ↗

How do you do this in Swift?

CFStringRef val = (CFStringRef)MGCopyAnswer(CFSTR("HardwarePlatform"));

NSString* chipIdentifier =(__bridge NSString * _Nullable)(val);

11y agoHN ↗

Theoretically just:

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

11y agoHN ↗

That's not correct. You can define it with @asmname.

11y agoHN ↗

I hope this code finds way into mainstream system information apps on App Store.

11y agoHN ↗

Why would I care where the processor in my phone is made?

11y agoHN ↗

Most people won't care but let's say the Samsung gets another half hour of battery life. For some people that may be worth the hassle of exchanging (and restocking fee?).

11y agoHN ↗

Please pardon my ignorance...

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 ?

11y agoHN ↗

Anyone can build it and put it on their device, all you need is Xcode and a Mac in addition to your iOS device.

11y agoHN ↗

iOS apps can be built/signed/installed from a Mac running Xcode 7 without any extra requirements. I'm surprised this fact hasn't gotten more press.

11y agoHN ↗

Now this is interesting, had to dig it out:

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?

11y agoHN ↗

I believe that you still have to build it to install it on your iPhone, so the likelihood of this being used for piracy is low. Not many commercial apps will have their source code available publicly.

11y agoHN ↗

Hi guys, I'm the creator of this little utility. Just noticed a flood of Stars on the repo, and thought it might be posted here.

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.