# Detecting Unofficial Installation

Users can share a copy of the application on unofficial stores or various pirate forums. While some users download these copies to avoid paying for the product, they can include unknown and possibly dangerous modifications. Verifying an official installation consequently protects both the users and the owner. This reaction is also triggered, if you install the application through alternative ways like unofficial store or Xcode build.

Below are code snippets demonstrating detection of unofficial installation across various platforms:

```dart
// Android
override fun onUntrustedInstallationSourceDetected() {...}

// iOS
case unofficialStore

// Flutter
onUnofficialStore: () => print("Unofficial store")

// Cordova 
unofficialStore: () => {
    // Place your reaction here 
}

// React Native
unofficialStore: () => {
    // Place your reaction here 
}

// Capacitor
unofficialStore: () => {
    // Place your reaction here 
}
```

{% hint style="info" %}
**Recommended action:** Notify users that the application is installed from an unofficial store. In some cases, it is recommended to even kill the application.
{% endhint %}

## Define alternative supported stores

If you want to define which applications can install the application, insert its package name in the `supportedAlternativeStores` (or `supportedStores` on Flutter) parameter. If you publish on **Google Play**, **Huawei AppGallery**, **App Store (iOS)**, and **TestFlight (iOS)**, you don't need to assign anything, as they are already **supported out of the box**.

| Store / Distribution method | Package name                      | Notes                                    |
| --------------------------- | --------------------------------- | ---------------------------------------- |
| App Store (iOS)             |                                   | Included by default, no action needed    |
| TestFlight (iOS)            |                                   | Included by default, no action needed    |
| Google Play                 |                                   | Included by default, no action needed    |
| Huawei AppGallery           |                                   | Included by default, no action needed    |
| Firebase App Distribution   | `dev.firebase.appdistribution`    |                                          |
| Samsung Galaxy Store        | `com.sec.android.app.samsungapps` | Common on Samsung devices                |
| Vivo App Store              | `com.vivo.appstore`               | Common on Vivo devices                   |
| HeyTap                      | `com.heytap.market`               | Common on Realme and Oppo devices        |
| Oppo App Market             | `com.oppo.market`                 | Common on Oppo devices                   |
| GetApps                     | `com.xiaomi.mipicks`              | Common on Xiaomi, Redmi and POCO devices |

The application can also be installed by **"cloning"** apps, which users employ to transfer apps between devices. The following list comprises popular examples of such apps. By default, freeRASP categorizes them as installations from an unofficial store .

| Mover / Cloner app        | Package name                 |
| ------------------------- | ---------------------------- |
| Mi Mover (Xiaomi)         | `com.miui.huanji`            |
| Phone Clone (Huawei)      | `com.hicloud.android.clone`  |
| Samsung Smart Switch      | `com.sec.android.easyMover`  |
| Samsung Cloud for Wear OS | `com.samsung.android.scloud` |
| OPPO Clone Phone          | `com.coloros.backuprestore`  |
| EasyShare (Vivo)          | `com.vivo.easyshare`         |
| Clone Phone (OnePlus)     | `com.oneplus.backuprestore`  |
| SHAREit (Lenovo)          | `com.lenovo.anyshare.gps`    |
| SHAREit Lite              | `shareit.lite`               |
| ShareMe (Xiaomi)          | `com.xiaomi.midrop`          |
| MIUI Backup (Xiaomi)      | `com.miui.backup`            |
| Phone Clone (Honor)       | `com.hihonor.android.clone`  |

Finally, it's very common application gets installed through **browser**, **file manager**, **cloud storage** or various **messaging** apps. By default, freeRASP categorizes them as installations from unofficial store.


---

# Agent Instructions: 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:

```
GET https://docs.talsec.app/freerasp/freerasp/wiki/threat-detection/detecting-unofficial-installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
