> For the complete documentation index, see [llms.txt](https://docs.talsec.app/freerasp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talsec.app/freerasp/freerasp/wiki/threat-detection/app-data-migration-detection-formerly-device-binding.md).

# App Data Migration detection (formerly Device Binding)

App Data Migration detection identifies situations where application data is restored, transferred, and reused on a different physical device. This behavior can indicate that sensitive application state, credentials, or tokens have been migrated outside the original environment.

{% hint style="warning" %}
A new install of the application (e.g. in case of buying a new device and transfer the apps) is not detected.
{% endhint %}

On iOS, **deviceID** detects whether the [device identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor) has changed. It is triggered after the app is reinstalled if no other apps from the same vendor are installed. The value can also change when you install test builds with Xcode or distribute the app ad hoc.

Below are code snippets showing how this feature is reported across various platforms:

```dart
// Android device binding check
override fun onDeviceBinding() {
    TODO("Not yet implemented")
}

// iOS device binding methods
case deviceChange
case deviceID

// Flutter 
// device binding and device change detection
onDeviceBinding: () => print("Device binding")

// device ID 
onDeviceID: () => print("Device ID")  // iOS only

// Cordova 
// device binding and device change detection
deviceBinding: () => {
    // Place your reaction here
}

// device ID 
deviceID: () => {  // iOS only
    // Place your reaction here 
}

// React Native 
// device binding and device change detection
deviceBinding: () => {
    // Place your reaction here
}

// deviceID
deviceID: () => {  // iOS only
    // Place your reaction here 
}

// Capacitor 
// device binding and device change detection
deviceBinding: () => {
    // Place your reaction here
}

// deviceID
deviceID: () => {  // iOS only
    // Place your reaction here 
}
```

{% hint style="info" %}
**Recommended action:** Log the event on your BE. Act on it if you need to keep an app instance tied to a specific device, such as during activation. Otherwise, you can ignore it.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.talsec.app/freerasp/freerasp/wiki/threat-detection/app-data-migration-detection-formerly-device-binding.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
