Apple’s Autoscanning iTunes Card Promo Codes Work via Hidden Font, Can be Replicated by Devs

移动互联 2017-07-15 阅读原文

When you purchase an iTunes gift card and redeem it in the App Store, the camera on your iPhone, iPad, or Mac can scan the code on the card to recognize it automatically, saving you the time of typing the numbers in manually.

Equinux, the company behind Mail Designer Pro 3, dug into how Apple's promo code engine works in an effort to make their own scannable cards, and the results are quite interesting. As it turns out, the scanning feature in the App Store is tuned to recognize two things: a unique, hidden font and the dimensions of the box around it.

Equinux tried the box alone with a range of fonts like Courier and Monaco, and attempted to identify the unique characteristics of the font to find it, but were unsuccessful. Ultimately, the team realized the font that Apple's using is hidden deep within iTunes.

The breakthrough came when we noticed that when you scan a card with your iPhone, the app briefly displays a "scanned" overlay of the code. This means the font must be embedded in the app somewhere. We tried the same with iTunes on macOS. And voilà - the iTunes on Mac behaves the same way.

Hidden in the CoreRecognition.framework, there are two fonts: "Scancardium," for entering and recognizing codes, and "Spendcardium," which appears to be for obscuring credit card details as they're entered. The two fonts can be found by going to Finder on a Mac, clicking Go, choosing Go to Folder and pasting the following: /System/Library/PrivateFrameworks/CoreRecognition.framework/Resources/Fonts/

With a simple double click, the fonts can be installed on a Mac and can be used within different apps. While this is a neat breakdown for end users, it's of particular interest to developers because these fonts can be used to create custom App Store promo code cards that can be scanned in the same way as iTunes gift cards.

Equinux outlines the exact font height to use and how to position it within the surrounding box to get Apple's engine to recognize it, details the company uncovered after investing a lot of time in tweaking fonts and the border of the required box.

Equinux even went one step further and created helpful Sketch and Photoshop templates that developers can use to create App Store promo code cards that can be automatically scanned using a device camera and recognized by the App Store.

Tags:App Store, iTunes




躲过了千年虫,却没能躲过勒索病毒,台积电到底怎么了?... 8月3日晚间,台积电在台湾北、中、南三处重要生产基地,均因电脑病毒入侵导致生产停摆。台积电随后反驳遭遇黑客攻击的不实言论,表示正逐步恢复生产。在...
【钛晨报】苹果不再使用英特尔5G芯片,联发科或从中受益... 图片来源:视觉中国 【钛媒体综合】7月5日据国外媒体报道,苹果已经向英特尔发出通知,决定不在未来的iPhone上使用来自于英特尔的调制解调器,而此...
Palava Hills Vintage Please, please, please! Can I ask for your email? Every week, I'd like ...
向通用公司看齐 苹果成了谨慎的巨兽企业... 现在的它可能更像是秉承着通用一贯谨慎做法的通用电气或通用汽车,而不再是 15 或 30 年前的苹果。 一本由科技记者 Brian Merch...
苹果带来iTunes 12.7.1更新 能有多大改变?... 原标题:苹果带来iTunes 12.7.1更新 能有多大改变? 在 9 月份的时候,iTunes 迎来了一次重大的更新。iTunes 12.7 的发布完全...