# AntiCloudManager: Installation Guide

This guide walks through installing and running the AntiCloudManager Android application on physical Android devices, emulators, or building from source.

---

## 📋 System Requirements

* **Target Device:** Android 7.0 (API Level 24 - Nougat) or higher.
* **Architecture:** ARM64-v8a, armeabi-v7a, x86_64.
* **Storage Space:** Minimum 50 MB free internal storage.
* **Network:** Wi-Fi or Mobile Data connection (configurable).

---

## 📲 Option 1: Direct APK Installation (Recommended)

The pre-compiled debug APK is located at:
```
release/app-debug.apk
```

### Method A: Install via Android Debug Bridge (ADB)
1. Enable **Developer Options** and **USB Debugging** on your Android device:
   * Navigate to `Settings` > `About Phone`.
   * Tap `Build Number` 7 times until you see "You are now a developer!".
   * Go back to `Settings` > `System` > `Developer Options`.
   * Enable `USB Debugging`.
2. Connect your device to your computer via USB.
3. Open a terminal and verify ADB recognizes your device:
   ```bash
   adb devices
   ```
4. Install the application:
   ```bash
   adb install -r release/app-debug.apk
   ```

### Method B: Direct Sideloading onto Device
1. Transfer `release/app-debug.apk` to your phone via Google Drive, USB file transfer, Bluetooth, or local network.
2. On your device, open your File Manager and tap `app-debug.apk`.
3. If prompted, grant permission to "Install Unknown Apps" for your File Manager.
4. Tap **Install** and then open **AntiCloudManager**.

---

## 🛠️ Option 2: Running on an Android Emulator

1. Launch Android Studio and open the **Device Manager**.
2. Start an emulator running API 30+ (e.g., Pixel 7 running Android 14 / API 34).
3. Drag and drop `release/app-debug.apk` directly onto the emulator screen.
4. The application will install and appear in the app drawer.

---

## 💻 Option 3: Building from Source

### Prerequisites
* **Flutter SDK:** 3.24.0 or higher (Dart 3.5.0+)
* **JDK:** OpenJDK 17 or Eclipse Temurin 17
* **Android SDK:** Platforms 34/35, Android Build Tools 34.0.0+

### Steps
1. Clone or navigate to the project directory:
   ```bash
   cd anti_gmail
   ```
2. Fetch dependencies:
   ```bash
   flutter pub get
   ```
3. Verify your toolchain:
   ```bash
   flutter doctor -v
   ```
4. Build the debug APK:
   ```bash
   flutter build apk --debug
   ```
5. The generated APK will be placed at:
   ```
   build/app/outputs/flutter-apk/app-debug.apk
   ```

---

## 🔐 Required Device Permissions

Upon first launch and use, AntiCloudManager may request the following Android permissions:
* **POST_NOTIFICATIONS:** Displays ongoing backup notifications, account switching alerts, and quota warnings.
* **READ_EXTERNAL_STORAGE / READ_MEDIA_IMAGES / READ_MEDIA_VIDEO:** Scans local photos, videos, and documents to allow the user to select items for backup.
* **ACCESS_NETWORK_STATE / INTERNET:** Checks whether Wi-Fi is active and sends data to Google Drive.
* **WAKE_LOCK / FOREGROUND_SERVICE:** Ensures background transfers initiated by WorkManager complete without being killed by the Android OS battery optimizer.
