by

iCloud Locations in macOS

EN

Sandboxed vs. Non-Sandboxed

On macOS, an app may or may not be sandboxed. Since macOS Sierra, apps distributed outside the Mac App Store can access iCloud APIs, so a non-sandboxed app can use these locations to sync data.

So, if you want to access a sandboxed iCloud location, you should go to the app container and use it as the home path.

$SANDBOXED_CONTAINER = ~/Library/Container/com.example.app/Data

iCloud Documents

Each app can have one or more document containers inside, named with its bundle ID:

~/Library/Mobile Documents/

The information and details of each container are stored here:

~/Library/Application Support/CloudDocs/session/containers

The info is stored in a plist file with the name of the container, for example:

iCloud.com.pvieito.Example.plist

And the icons are stored in a folder with the name of the container:

iCloud.com.pvieito.Example/40x40_iOS.png
iCloud.com.pvieito.Example/80x80_iOS.png
iCloud.com.pvieito.Example/120x120_iOS.png

Key-Value Store

This synced data is stored as a property list file in:

~/Library/SyncedPreferences/
$(SANDBOXED_CONTAINER)/Library/SyncedPreferences/

CloudKit

CloudKit works online, but macOS stores a cache of its contents in a folder appropriately called CloudKit:

~/Caches/CloudKit
$(SANDBOXED_CONTAINER)/CloudKit

Coldplay Xyloband Reverse Engineering

EN

The Xyloband is the wristband that Coldplay gives to the audience to create a colorful light show during its concerts.

Xyloband

Fotografía de Carlos RM (CC) 2012.

The wristband receives data from a central transmitter. The new version of the band is not only able to light the LEDs but can also receive audio and play it through a built-in speaker.

Contents

Procedure

First, we will disassemble the device and list the different components that we find on the PCB. Then we will try to investigate them by looking for datasheets and all the available information to reconstruct the behavior of the circuit. Finally, we can recover the blueprint of the tracks on the PCB and analyze the complete system.

Disassembly

So I took the Dave Jones approach: “Don’t turn it on, take it apart!” First, I opened the wristband and extracted the PCB with the LED band.

Xyloband internals

Xyloband internals: speaker, LED/antenna flat-flex and PCB.

These are the internal parts of the Xyloband. We can see the speaker, the flat-flex with the LEDs and the main PCB. From this view, we can infer that the flat-flex will probably not only power the color LEDs but also act as an antenna to receive the signal.

PCB Inspection

To get a good view of the PCB layers, I took two photos from each side, one front-lit and another back-lit. After that, we can create a composite image for each side to determine whether there are internal layers. And indeed, there are.

Xyloband PCB Front

Both sides of the PCB, front-lit, back-lit and composite.

The PCB has 4 layers, two external and two internal. In parentheses is the color used later in the PCB track blueprint:

  • Front side (Orange)
  • Back side (Cyan)
  • Internal ground layer (Navy Blue)
  • Internal track layer (Purple)

Now we will analyze each layer in detail.

Front

So here is the first composite image of the front side with its main areas, power and data reception, demodulation and decoding (RX):

Xyloband PCB Front

Composite image of the front of the Xyloband PCB. Horizontally flipped image to match the back layer.

In the front of the Xyloband PCB we can find these devices:

  • Silicon Labs Si4362 High-Performance, Low-Current Receiver
  • 30 MHz Crystal Oscillator
  • IC IACMF Voltage Regulator
  • 3 mH Inductor

The Si4362 IC is the main component of the RX area. This chip will receive the transmission from the antenna (we can see it is connected to the uppermost pin of the flat-flex), amplify it using a low-noise amplifier and demodulate it. Then, the final digital signal will be sent to the microcontroller on the other side of the board through an I²C connection.

The power section of the front side is mainly a voltage controller that generates the suitable voltage to drive the LEDs and the audio amplifier.

Back

On the back, the main areas are the logic microcontroller, the audio amplifier, the LED drivers and a part of the power section that enables the connection of the battery to the voltage regulator on the other side.

Xyloband PCB Back

Composite image of the back of the Xyloband PCB.

On the back, we can see the following ICs:

The ARM processor is connected to the Si4362 receiver through I2C and decodes the information, namely the audio and LED colors. Then, it will light the LEDs through the driver and output the audio signal with its DAC.

The audio signal goes to the SSM2211 audio amplifier, which is connected to the speaker.

PCB Reverse Engineering

Now we are going to analyze the board and extract the tracks printed on it to obtain the full circuit schematic.

Front Tracks

Xyloband PCB Front Tracks

Back Tracks

Xyloband PCB Back Tracks

Internal Tracks

Xyloband PCB Inside Tracks

All Tracks Superimposed

Xyloband PCB Inside Tracks

Conclusion

The main controller of the Xyloband is an Atmel SAM D20, which outputs the audio and controls the lights of the wristband. The audio output is amplified by the Analog Devices SSM2211 low-distortion power amplifier and the LEDs are managed by three transistors. Finally, all the data is received and decoded by the Silicon Labs Si4362 receiver and sent through the I2C bus to the main processor.

GIF Support Coming to WhatsApp

EN

After our friends from AndroidTR found some resources in the new update of WhatsApp for Android, I wanted to go deeper and analyze the iOS version to see if it was prepared to handle GIFs as well.

New glyphs for GIF support

New glyphs for GIF support.

In the last update of WhatsApp for iOS (version 2.16.7), there are the same three new GIF glyphs found in Android and two more, apparently for Live Photos support.

New methods and classes for GIF support

New methods and classes for GIF support.

Then, in the app binary, there are a lot of new methods designed to handle GIFs. They have even created a new class, WAGIFCreator, which seems to allow users to create GIFs from scratch with various images or a video.

It seems this feature is complete, but the WhatsApp team has to enable it remotely, as they have previously done with other capabilities like end-to-end encryption.

Interesting Courses on Coursera

EN

Coursera is a MOOC platform with thousands of courses from different universities and institutions. These are some I have found very interesting: