Skip to content

Why the app writes settings

The practical side of this finding is on the phone app page, with the numbers. This page is about the idea underneath it, because the idea shows up again in other tools and is easy to miss.

Most apps that control a device keep their own copy of the device’s settings. When you change the return-home delay on screen, the app remembers the new value in its own storage. A replay is what happens on the next connection: the app takes its remembered copy and writes it back to the device, whatever the device currently holds.

FreeFlight Pro does this on every connect. From the app’s decompiled code, the order is that the drone connects, the app saves a snapshot of its own copy of the settings, reads what the drone reports, and then writes the snapshot back to the drone and saves it. The list is about twenty settings long. It covers the limits you would expect, such as maximum altitude, distance and tilt, and it also covers return-home delay, geofence, banked turn, hull protection and some video options.

The drone’s own log shows the same thing from the other side. About two seconds into a connection it records lines for setting a value, a different kind of line from the ones where it merely answers a question about its state. We nearly missed that. Our first search of the log looked only for commands the drone had received, found date and time and two state requests, and concluded the app had written nothing. The drone simply does not log a setting write in that form. It logs the effect. So the session we first read as having no writes was the one with the writes in it.

The sources do not say why Parrot built it this way, so this part is our reading. The component that does the work is called an offline engine in the code, which suggests the aim is to keep the app and the aircraft in agreement. That is a reasonable thing for a consumer app to want. It is also a design that assumes the app’s copy is the one that is right.

A fresh install is where that assumption goes wrong. It has no remembered settings, so what it replays is its own built-in defaults. Those defaults include a 3 second return-home delay and banked turn switched on, and those are the values our drone ended up with.

A limit on a drone is only worth something if it is the value the drone really holds. Return-home delay is the clearest case. It decides how long the drone tolerates a lost link before it flies home by itself, and ours went from 30 seconds to 3. Nothing about that change looks dramatic on a screen, and it survived a power cycle because settings of this kind live in a configuration file on the aircraft.

There is a second consequence for anyone who tightens a limit from another tool. We lowered the maximum distance from 2000 m to 150 m and kept the geofence on so that the limit would actually be enforced. The app stores a 2000 m value, so connecting it again will most likely write that back. Replaying does not respect the fact that someone else changed the aircraft in between.

The general habit that comes out of this is to treat opening a syncing app as a write, and to read the aircraft before and after instead of trusting that looking at screens changed nothing.

What we know, what we infer, what we do not know

Section titled “What we know, what we infer, what we do not know”

We know, from measurement, that three stored settings differed after the app sessions and that every other setting in the same file was unchanged. We know, from the app’s code and separately from the drone’s log, that the app replays its saved settings after it connects, and that it sets the drone’s clock as well.

We infer that the first connection did the damage. The reasoning is that a fresh install replays defaults and two of the three values match those defaults. The log of that first session was lost when the drone was rebooted for a battery swap, so we cannot look at it.

The geofence turning on is explained by the app’s code. The value it replays starts at zero, and the code takes zero to mean block, which sends the geofence on, so a fresh install turns it on. That matches the drone’s log. It comes from decompiled code that we read and did not run, so we hold it as the reading the evidence supports and not as something we watched happen.

We do not know whether other app versions behave the same way, and we have not seen what a second phone with different stored settings would write.

For the method behind those labels, see how we know what we know.

Comments

Spotted a mistake, or tried this on your own Bebop? Leave a note. Comments are kept on this site's own server.