/Cloaking

Primary LanguageKotlinApache License 2.0Apache-2.0

Android Cloaking Techniques

This repository contains an implementation of various techniques to detect Android emulators. These techniques help in identifying whether an application is running on a real device or an emulator, enhancing security by preventing potential attacks or misuse in a controlled environment.

Techniques Implemented

  1. Check if Camera Flash Unit is Available

    • Real devices typically have a camera flash, while emulators usually do not. This check helps in differentiating between the two.
  2. Camera Count Check

    • Most real Android devices have more than two cameras (front and back), whereas emulators may have one or none.
  3. Accelerometer Sensor Check

    • Real devices have accelerometers that detect movement. Emulators do not move, so they lack this sensor.
  4. Light Sensor Check

    • Real devices have light sensors that respond to changes in light conditions. Emulators typically do not simulate changes in light.
  5. Kernel and Android Version Check

    • Emulators often use a different kernel and Android version compared to real devices. This check can reveal discrepancies.
  6. Build Name Check

    • The build name of the device can provide clues about whether it is an emulator. Emulators often have generic or specific build names.
  7. CPU Info Check

    • Real devices and emulators have different CPU configurations. By examining the CPU info, it is possible to identify an emulator.
  8. Device Drivers Check

    • Emulators use specific device drivers that differ from those in real devices. Checking for these can help detect an emulator.
  9. SIM Card Operator Check

    • Real devices usually have valid SIM card operators, while emulators might not have SIM cards or use generic operators.
  10. Android OS Build Information Check

    • Information such as board, device, brand, manufacturer, and product details can indicate whether the device is real or an emulator.

Getting Started

Clone this repository to your local machine and follow the instructions below to implement the cloaking techniques in your Android application.

Prerequisites

  • Android Studio
  • Android device or emulator for testing

Installation

  1. Clone the repository:
    git clone [https://github.com/yourusername/android-cloaking-techniques.git](https://github.com/sec-zone/Cloaking.git)
  2. Open the project in Android Studio.
  3. Sync the project with Gradle files.

Usage

Integrate the provided checks into your application as needed. Each technique is implemented in a separate method for modularity and ease of use.

Example:

if (isEmulator()) {
    // Handle emulator case
} else {
    // Handle real device case
}