Interesting read: http://gizmodo.com/why-its-easier-to-innovate-in-china-than-in-the-united-1709911838
iPhone BLE Privacy Feature
When you scan for BLE devices, you probably notice a lot of no name devices.
More likely, there are iPhones. It’s good privacy feature as you don’t want to advertise your phone name to everyone.
In addition, Apple uses new Bluetooth 4.0 Privacy Feature, which changes its ID on a frequent basis. Thus, you can’t track.
- The only way to tell if it’s iPhone is using Manufacturer data. But you can’t track a particular one.
- Per Bluetooth Core Specification, Manufacturer data is type 0xFF.
Note: You can see this value from Core Bluetooth API \ didDiscoverPeripheral function \ advertisementData \ kCBAdvDataManufacturerData. - 1st 2-byte is Company ID in little endian.
- If the is “0x004C”, which indicates Apple, Inc.
- Complete list here: https://www.bluetooth.org/en-us/specification/assigned-numbers/company-identifiers
Notes on Apple Core Bluetooth Peripheral ID
- The only peripheral ID that Core Bluetooth API offers after discovery is CBPeripheral.identifier.
- Not MAC address.
You can’t get MAC address via Core Bluetooth. There is no public API for this. If this is an internal or jailbreak application you can get the value of the kLockdownBluetoothAddressKey key via liblockdown.dylib. - It’s obtained via callback function didDiscoverPeripheral. (iPhone acts as central device)
- Type is NSUUID, not CBUUID. UUID is deprecated as of iOS 7.0.
- identifier has been moved to CBPeer class, which is base class of CBPeripheral. So net effect is the same.
- A different central will return a different id for the same peripheral.
- A central will return the same id for a peripheral. Thus, it can be stored and used later per Apple doc.
However, I don’t know how long it will return the same id.
Important: assuming the peripheral doesn’t use Bluetooth 4.0 Privacy feature, which changes its ID periodically. - Peripheral MAC & central id (& possible time) is used (by Core Bluetooth) in generating this CBPeripheral.identifier.
The future of jobs
The economist published a thought-provoking article “The future of jobs” on Jan 18th 2014.
I’d like to share it to everyone here if you haven’t read it:
Link to the article: The future of jobs
git svn broken in OS X Yosemite
Type ‘git svn’ command, you will get the error below:
$ git svn
Can't locate SVN/Core.pm in @INC (you may need to install the SVN::Core module) (@INC contains: /usr/local/git/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level /usr/local/git/lib/perl5/site_perl/5.18.2 /usr/local/git/lib/perl5/site_perl /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /usr/local/git/lib/perl5/site_perl/Git/SVN/Utils.pm line 6.
BEGIN failed--compilation aborted at /usr/local/git/lib/perl5/site_perl/Git/SVN/Utils.pm line 6.
Compilation failed in require at /usr/local/git/lib/perl5/site_perl/Git/SVN.pm line 26.
BEGIN failed--compilation aborted at /usr/local/git/lib/perl5/site_perl/Git/SVN.pm line 33.
Compilation failed in require at /usr/local/git/libexec/git-core/git-svn line 25.
BEGIN failed--compilation aborted at /usr/local/git/libexec/git-core/git-svn line 25.
Solution
The problem is that prerequisite Perl libraries which are missing.
You can use existing Xcode Perl libraries by using the below 2 commands:
$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level/SVN /System/Library/Perl/Extras/5.18/SVN
$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level/auto/SVN/ /System/Library/Perl/Extras/5.18/auto/SVN
Notes
– If you have OS X Mavericks, change 5.18 in the above commands to 5.16.
– If you have OS X Mountain Lion, change 5.18 in the above commands to 5.12.
– You must install Xcode Command Line Tools in advance.
– If you don’t run the 2nd command, you will get the error below:
$ git svn
Can't locate loadable object for module SVN::_Core in @INC (@INC contains: /usr/local/git/lib/perl5/site_perl/5.18.2/darwin-thread-multi-2level /usr/local/git/lib/perl5/site_perl/5.18.2 /usr/local/git/lib/perl5/site_perl /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /System/Library/Perl/Extras/5.18/SVN/Base.pm line 59.
BEGIN failed--compilation aborted at /System/Library/Perl/Extras/5.18/SVN/Core.pm line 5.
Compilation failed in require at /usr/local/git/lib/perl5/site_perl/Git/SVN/Utils.pm line 6.
BEGIN failed--compilation aborted at /usr/local/git/lib/perl5/site_perl/Git/SVN/Utils.pm line 6.
Compilation failed in require at /usr/local/git/lib/perl5/site_perl/Git/SVN.pm line 26.
BEGIN failed--compilation aborted at /usr/local/git/lib/perl5/site_perl/Git/SVN.pm line 33.
Compilation failed in require at /usr/local/git/libexec/git-core/git-svn line 25.
BEGIN failed--compilation aborted at /usr/local/git/libexec/git-core/git-svn line 25.
– If you don’t want to make symbolic link, you can install using this command:
brew install git svn
Swift programming language disambiguation
Recent Apple’s announcement of new Swift programming language caused confusion among developers. Swift, which should be called Apple Swift, is new programing language from Apple. Other Swift languages are not Apple Swift.
Apple Swift has JavaScript-like syntax and is similar to Rust http://www.rust-lang.org.
- Apple Swift: https://developer.apple.com/swift/
- Swift (parallel scripting language): http://swift-lang.org/
- Swift for building web applications: http://www.cs.cornell.edu/jif/swift/doc/index.html
How to get VMPA Version
VMPA = Visa Mobile Payment Application
Send below 2 APDUs to get VMPA version:
00A4040007A0000000031010 (select VMPA)
80CA9F7D00 (get version)
Open my garage door using iPhone
I’m a big fan of home automation. Sometimes, I forget to close the garage & I was too late for work to drive back home. I always wanted to control from my phone. I now have full control of my garage door.
The HW is Raspberry Pi + PiFace. SW is Web2py + python + jQuery for mobile.
NFC Smart Card Info
This app shows Secure Element applications (a.k.a Java Card applet or Smart Card application) are installed on a contact-less Smart Card or EMV credit card using Android NFC phones.
https://play.google.com/store/apps/details?id=com.inoapp.cardinfo
NXP NFC controller: PN544, PN65, PN547 & variants
- PN544 has 2 variants: PN544 C2 & PN544 C3.
- PN544 C2 with FW version ranging from 106 to 110.16.
- PN544 C3 with FW version ranging from 1.6 to 1.34.
- It’s strange that C2 & C3 has 2 different version ranges. I guess they are considered different HW.
- PN65 also has 2 variants: PN65N & PN65O.
- PN65N = PN544 C2 + SmartMX.
- PN65O = PN544 C3 + SmartMX.
- PN547 is not out yet
- C1 is only available for big customer. Version range: 6.3.7 to 6.3.11