Skip to content

About

A comprehensive Android solution that forces USB UVC cameras to be the only available system cameras, completely blocking internal cameras while maintaining system stability and Play Integrity.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

UVC Camera Enforcer

A comprehensive Android solution that forces USB UVC cameras to be the only available system cameras, completely blocking internal cameras while maintaining system stability and Play Integrity.

🎯 Project Overview

This project provides a runtime-only solution for forcing USB UVC cameras as the exclusive system cameras on Android devices. It's specifically designed for the Pixel 8a (akita) running EvolutionX 15, but compatible with other Android 10+ devices.

Key Features

  • Complete Internal Camera Blocking: Internal front/back cameras become inaccessible
  • UVC Camera Promotion: USB UVC cameras are mapped to camera IDs 0 and 1
  • System-wide Enforcement: Works with all camera apps and video calling applications
  • Dual-layer Protection: LSPosed Java hooks + Zygisk native enforcement
  • Play Integrity Safe: Maintains system integrity and passes safety checks
  • Runtime Only: No ROM building, vendor modifications, or HAL changes required

πŸ“‹ Requirements

System Requirements

  • Device: Pixel 8a (akita) or any Android 10+ device
  • ROM: EvolutionX 15 (Android 15) or any Android 10+ ROM
  • Root: Magisk with Zygisk enabled
  • Framework: LSPosed installed and active
  • Architecture: ARM64 (arm64-v8a)

Hardware Requirements

  • USB UVC Camera: UVC compliant USB camera
  • USB OTG: Device must support USB OTG functionality
  • Power: Adequate power delivery for USB camera

πŸ—οΈ Architecture

LSPosed Module (Java Layer)

  • CameraManager Hooks: Intercepts camera enumeration and access
  • Camera ID Remapping: Maps UVC cameras to IDs 0 and 1
  • App Compatibility: Works with all Java-based camera apps
  • Runtime Injection: No permanent system modifications

Zygisk Module (Native Layer)

  • NDK Camera Hooks: Intercepts native Camera2 API calls
  • Low-level Enforcement: Blocks camera access at native level
  • Performance Optimized: Minimal overhead and system impact
  • Universal Coverage: Works with native camera implementations

Magisk Integration

  • Module Management: Easy installation via Magisk Manager
  • Boot Service: Automatic initialization on device boot
  • Permission Handling: Automatic permission granting
  • System Integration: Seamless integration with Android system

πŸ“ Project Structure

UvcCameraEnforcer/
β”œβ”€β”€ app/                           # LSPosed Module
β”‚   β”œβ”€β”€ src/main/
β”‚   β”‚   β”œβ”€β”€ java/com/yourname/uvccameraenforcer/
β”‚   β”‚   β”‚   β”œβ”€β”€ MainHook.kt       # Main Xposed hooks
β”‚   β”‚   β”‚   └── MainActivity.kt   # Module UI
β”‚   β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   β”‚   └── xposed_init       # Xposed initialization
β”‚   β”‚   β”œβ”€β”€ res/
β”‚   β”‚   β”‚   └── values/
β”‚   β”‚   β”‚       └── xposed_scope.xml  # Hook scope configuration
β”‚   β”‚   └── AndroidManifest.xml   # Module manifest
β”‚   └── build.gradle.kts          # Gradle configuration
β”œβ”€β”€ zygisk/                        # Native Zygisk Module
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   └── main.cpp              # C++ hooks implementation
β”‚   β”œβ”€β”€ CMakeLists.txt            # CMake build configuration
β”‚   └── build.gradle.kts          # Gradle configuration
β”œβ”€β”€ magisk/                        # Magisk Module Files
β”‚   β”œβ”€β”€ module.prop               # Module metadata
β”‚   β”œβ”€β”€ install.sh                # Installation script
β”‚   β”œβ”€β”€ service.sh                # Boot service
β”‚   └── README.md                 # Module documentation
β”œβ”€β”€ build_magisk.sh               # Build script
β”œβ”€β”€ INSTALLATION.md               # Installation guide
β”œβ”€β”€ DEMO.md                      # Demo instructions
└── README.md                    # This file

πŸš€ Installation

Quick Install

  1. Download the latest UvcCameraEnforcer_v1.0.zip
  2. Install via Magisk Manager
  3. Reboot device
  4. Enable module in LSPosed Manager
  5. Connect USB UVC camera
  6. Test with any camera app

Detailed Instructions

See INSTALLATION.md for comprehensive installation guide.

πŸ”§ Building from Source

Prerequisites

  • Android Studio or Android SDK
  • NDK (Native Development Kit)
  • Gradle
  • Git

Build Steps

# Clone repository
git clone <repository-url>
cd UvcCameraEnforcer

# Build everything
chmod +x build_magisk.sh
./build_magisk.sh

Manual Build

# Build LSPosed module
./gradlew assembleDebug

# Build Zygisk module
cd zygisk
../gradlew assembleRelease

# Package into Magisk module
# Follow build_magisk.sh script

πŸ“± Usage

After Installation

  1. Connect your USB UVC camera to the device
  2. Open any camera app (Google Camera, Instagram, WhatsApp, etc.)
  3. The app will only see and use the UVC camera
  4. Internal cameras will be completely inaccessible

Module Status

  • Open the UVC Camera Enforcer app to check status
  • View detected cameras and their mappings
  • Enable debug logging if needed

πŸ§ͺ Testing

Validation Steps

  1. Camera Enumeration: Verify only UVC cameras are listed
  2. App Testing: Test with multiple camera apps
  3. Video Calling: Test with WhatsApp, Discord, Zoom
  4. System Stability: Ensure no crashes or instability
  5. Play Integrity: Verify safety checks pass

Expected Results

  • Camera 0: First UVC camera
  • Camera 1: Second UVC camera (if available)
  • Internal cameras: Completely blocked
  • All apps: Use UVC camera exclusively

πŸ” Technical Details

Camera Detection

The module identifies UVC cameras by:

  • External lens facing (LENS_FACING_EXTERNAL)
  • Hardware model containing "UVC" or "USB"
  • Common UVC vendor IDs (Logitech, Sonix, Realtek, etc.)

Hook Implementation

  • Java Layer: Xposed hooks on CameraManager methods
  • Native Layer: PLT hooks on Camera2 NDK functions
  • System Integration: Magisk module for boot-time initialization

Safety Features

  • No system partition modifications
  • Reversible installation
  • Play Integrity compliant
  • Minimal performance impact

πŸ› Troubleshooting

Common Issues

  • Module not working: Check LSPosed activation and permissions
  • UVC camera not detected: Verify USB OTG and camera compatibility
  • App crashes: Check logcat for specific error messages
  • Play Integrity issues: Temporarily disable module to isolate

Debug Information

# View module logs
logcat | grep UvcCameraEnforcer

# Check camera enumeration
logcat | grep CameraManager

# System information
getprop ro.product.model
magisk -v

πŸ“„ License

This project is released under the MIT License. See LICENSE file for details.

⚠️ Disclaimer

This module modifies system camera behavior. Use at your own risk. The developer is not responsible for any damage to your device or loss of functionality.

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“ž Support

For issues and support:

  • Check the troubleshooting section
  • Provide device model, Android version, and ROM details
  • Include logcat output when reporting issues
  • Create detailed bug reports with reproduction steps

πŸŽ₯ Demo

See DEMO.md for instructions on creating a demonstration video showing the module in action.


Note: This is a highly technical Android development project intended for developers with experience in LSPosed, Zygisk, Magisk modules, and Android Camera2 internals. Generic explanations or conceptual diagrams are not considered valid submissions - only working modules with actual implementations.

About

A comprehensive Android solution that forces USB UVC cameras to be the only available system cameras, completely blocking internal cameras while maintaining system stability and Play Integrity.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages