### Start Docker Container with Customizations (11.0.0) Source: https://github.com/ayasa520/redroid-script/blob/main/README.md Example command to start a docker container with Gapps, NDK, Magisk, and Widevine. Ensure the image tag matches the components added. ```bash docker run -itd --rm --privileged \ -v ~/data:/data \ -p 5555:5555 \ redroid/redroid:11.0.0-gapps-ndk-magisk-widevine \ ro.product.cpu.abilist=x86_64,arm64-v8a,x86,armeabi-v7a,armeabi \ ro.product.cpu.abilist64=x86_64,arm64-v8a \ ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi \ ro.dalvik.vm.isa.arm=x86 \ ro.dalvik.vm.isa.arm64=x86_64 \ ro.enable.native.bridge.exec=1 \ ro.vendor.enable.native.bridge.exec=1 \ ro.vendor.enable.native.bridge.exec64=1 \ ro.dalvik.vm.native.bridge=libndk_translation.so \ ro.ndk_translation.version=0.2.3 \ ``` -------------------------------- ### General Base Class for Installable Components Source: https://context7.com/ayasa520/redroid-script/llms.txt This abstract base class handles the download, extraction, and copying pipeline for installable components. Subclasses must define specific attributes and override the copy method. The install() method orchestrates the entire process with MD5 verification. ```Python from stuff.general import General class MyComponent(General): dl_link = "https://example.com/package.zip" dl_file_name = "/tmp/mydownloads/package.zip" act_md5 = "abc123deadbeef" extract_to = "/tmp/myextract" copy_dir = "./mycomponent" def copy(self): import shutil, os if os.path.exists(self.copy_dir): shutil.rmtree(self.copy_dir) shutil.copytree(self.extract_to, self.copy_dir, dirs_exist_ok=True) # Run the full pipeline: download (with md5 check) → unzip → copy MyComponent().install() ``` -------------------------------- ### Start Docker Container with libndk (12.0.0_64only) Source: https://github.com/ayasa520/redroid-script/blob/main/README.md Specific command to start a docker container with libndk on the redroid:12.0.0_64only image. Note the different volume mount and image tag. ```bash docker run -itd --rm --privileged \ -v ~/data12:/data \ -p 5555:5555 \ redroid/redroid:12.0.0_64only-ndk \ androidboot.use_memfd=1 \ ro.product.cpu.abilist=x86_64,arm64-v8a \ ro.product.cpu.abilist64=x86_64,arm64-v8a \ ro.dalvik.vm.isa.arm64=x86_64 \ ro.enable.native.bridge.exec=1 \ ro.dalvik.vm.native.bridge=libndk_translation.so ``` -------------------------------- ### Main entry point for ReDroid image building Source: https://context7.com/ayasa520/redroid-script/llms.txt Parses CLI flags, orchestrates component installation, generates a Dockerfile, and builds the final ReDroid image using Docker or Podman. ```bash # Install Python dependencies first pip install -r requirements.txt # requests==2.28.1, tqdm==4.64.1 # Basic: Android 11 base image (no extras) python redroid.py -a 11.0.0 # Full feature stack: Gapps + libndk + Magisk + Widevine on Android 11 python redroid.py -a 11.0.0 -g -n -m -w # Builds image tagged: redroid/redroid:11.0.0_gapps_ndk_magisk_widevine # LiteGapps + Houdini on Android 13 with Podman python redroid.py -a 13.0.0 -lg -i -c podman ``` -------------------------------- ### Install libhoudini ARM translation layer Source: https://context7.com/ayasa520/redroid-script/llms.txt Installs Intel's libhoudini ARM translation layer for specified Android versions. Raises ValueError if no build is available for the given version. ```python from stuff.houdini import Houdini # Install libhoudini for Android 12.0.0 h = Houdini("12.0.0") h.install() # Result: ./houdini/system/ with houdini/houdini64 binaries + houdini.rc # Raises ValueError if version has no available libhoudini build: try: Houdini("10.0.0").install() except ValueError as e: print(e) # "No available libhoudini for Android 10.0.0" # Equivalent CLI usage: # python redroid.py -a 12.0.0 -i ``` -------------------------------- ### MindTheGapps Installation for Android 12.0.0-15.0.0 Source: https://context7.com/ayasa520/redroid-script/llms.txt Installs MindTheGapps for Android versions 12.0.0 through 15.0.0. It downloads a pre-built ZIP, extracts it, and copies the system tree. Requires the Android version string as a constructor argument. ```Python from stuff.mindthegapps import MindTheGapps # Install MindTheGapps for Android 14.0.0 mtg = MindTheGapps("14.0.0") mtg.install() # Result: ./mindthegapps/system/ ready for Docker COPY # Equivalent CLI usage: # python redroid.py -a 14.0.0 -mtg ``` -------------------------------- ### Install bootless Magisk variant Source: https://context7.com/ayasa520/redroid-script/llms.txt Installs a bootless variant of Magisk into the ReDroid image, supporting Zygisk and LSPosed. Writes an init script to launch Magisk at post-fs-data and boot_completed. ```python from stuff.magisk import Magisk m = Magisk() m.install() # Results: # ./magisk/system/etc/init/magisk/ — magisk binaries + magisk.apk # ./magisk/system/etc/init/bootanim.rc — triggers Magisk on boot # ./magisk/sbin/ — sbin mount point # Equivalent CLI usage: # python redroid.py -m # Docker run after build: # docker run -itd --rm --privileged \ # redroid/redroid:11.0.0-magisk \ # ro.product.cpu.abilist=x86_64,arm64-v8a,... ``` -------------------------------- ### Gapps Installation for Android 11.0.0 Source: https://context7.com/ayasa520/redroid-script/llms.txt Installs OpenGapps (pico variant) for Android 11.0.0. It downloads, unpacks, and copies necessary APKs and extras to the gapps directory. Host architecture is auto-detected. ```Python from stuff.gapps import Gapps # Host architecture is auto-detected via platform.machine() # Only valid for Android 11.0.0; warn the user otherwise gapps = Gapps() gapps.install() # Result: ./gapps/ directory ready to be COPYed in Dockerfile # Dockerfile line appended: COPY gapps / # Equivalent CLI usage: # python redroid.py -a 11.0.0 -g ``` -------------------------------- ### LiteGapps Installation for Android 8.1.0-15.0.0 Source: https://context7.com/ayasa520/redroid-script/llms.txt Installs LiteGapps for specified Android versions, including 64-bit only variants. It resolves download URLs and MD5 from a lookup table and copies the system tree. Requires the Android version string as a constructor argument. ```Python from stuff.litegapps import LiteGapps # Install LiteGapps for Android 13.0.0 lg = LiteGapps("13.0.0") lg.install() # Result: ./litegapps/system/ populated with Google Play Services etc. # 64-bit-only variant lg64 = LiteGapps("13.0.0__64only") lg64.install() # Equivalent CLI usage: # python redroid.py -a 13.0.0 -lg ``` -------------------------------- ### Ndk Installation for ARM-to-x86 Translation Source: https://context7.com/ayasa520/redroid-script/llms.txt Installs Google's libndk_translation for ARM-to-x86 binary translation on x86/x86_64 hosts and Android 11.0.0–12.0.0. It downloads prebuilt libraries and copies the system tree, including an init script. Requires host architecture check. ```Python from stuff.ndk import Ndk from tools.helper import host arch, bits = host() # e.g. ("x86_64", 64) if arch in ("x86", "x86_64"): ndk = Ndk() ndk.install() # Result: ./ndk/system/ with libndk_translation.so and init rc # Equivalent CLI usage: # python redroid.py -a 11.0.0 -n # Docker run flags required after build: # ro.dalvik.vm.native.bridge=libndk_translation.so # ro.ndk_translation.version=0.2.3 # ro.product.cpu.abilist=x86_64,arm64-v8a,x86,armeabi-v7a,armeabi ``` -------------------------------- ### Specify Container Type Source: https://github.com/ayasa520/redroid-script/blob/main/README.md Use the -c or --container option to specify the containerization technology (docker or podman). Defaults to docker. ```bash -c {docker,podman}, --container {docker,podman} ``` -------------------------------- ### Add Multiple Components Simultaneously Source: https://github.com/ayasa520/redroid-script/blob/main/README.md Combine flags to add multiple components like Gapps, Magisk, Libndk, and Widevine in a single operation. ```bash python redroid.py -a 11.0.0 -gmnw ``` -------------------------------- ### Check Play Protect Certification (Troubleshooting) Source: https://github.com/ayasa520/redroid-script/blob/main/README.md Commands to check the device ID for Play Protect certification issues. Requires root access. ```bash adb root adb shell 'sqlite3 /data/data/com.google.android.gsf/databases/gservices.db \ "select * from main where name = \"android_id\";"' ``` -------------------------------- ### Build Android 14 with MindTheGapps using Python Source: https://context7.com/ayasa520/redroid-script/llms.txt Use this command to build an Android 14 image with MindTheGapps pre-installed. Ensure Python 3 and necessary libraries are available. ```bash python redroid.py -a 14.0.0 -mtg ``` -------------------------------- ### Integrate Google Widevine DRM (Level 3) Source: https://context7.com/ayasa520/redroid-script/llms.txt Integrates Google Widevine DRM (Level 3) into the ReDroid image. Raises KeyError if the arch/version combination has no prebuilt. ```python from stuff.widevine import Widevine wv = Widevine("13.0.0") wv.install() # Result: ./widevine/vendor/ with Widevine shared libs and init rc # Raises KeyError if arch/version combo has no prebuilt: try: Widevine("10.0.0").install() except KeyError as e: print(f"No Widevine prebuilt for this combination: {e}") # Equivalent CLI usage: # python redroid.py -a 13.0.0 -w ``` -------------------------------- ### Add Magisk to ReDroid Image Source: https://github.com/ayasa520/redroid-script/blob/main/README.md Use the -m flag to add Magisk to the ReDroid image. Zygisk and modules like LSPosed should function correctly. ```bash python redroid.py -m ``` -------------------------------- ### Add liteGapps to ReDroid Image Source: https://github.com/ayasa520/redroid-script/blob/main/README.md Use the -lg flag to add liteGapps to the ReDroid image. ```bash python redroid.py -lg ``` -------------------------------- ### Add OpenGapps to ReDroid Image Source: https://github.com/ayasa520/redroid-script/blob/main/README.md Use the -g flag to add OpenGapps to the ReDroid image. ```bash python redroid.py -g ``` -------------------------------- ### Run Redroid Docker Image Source: https://context7.com/ayasa520/redroid-script/llms.txt This command launches a Redroid Android container using Docker. It mounts a local directory for data persistence and exposes port 5555 for ADB connection. Various system properties are set to configure the Android environment, including ABI lists and native bridge settings. ```bash docker run -itd --rm --privileged \ -v ~/data:/data \ -p 5555:5555 \ redroid/redroid:11.0.0_gapps_ndk_magisk_widevine \ ro.product.cpu.abilist=x86_64,arm64-v8a,x86,armeabi-v7a,armeabi \ ro.product.cpu.abilist64=x86_64,arm64-v8a \ ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi \ ro.dalvik.vm.isa.arm=x86 \ ro.dalvik.vm.isa.arm64=x86_64 \ ro.enable.native.bridge.exec=1 \ ro.dalvik.vm.native.bridge=libndk_translation.so \ ro.ndk_translation.version=0.2.3 ``` -------------------------------- ### Add MindTheGapps to ReDroid Image Source: https://github.com/ayasa520/redroid-script/blob/main/README.md Use the -mtg flag to add MindTheGapps to the ReDroid image. ```bash python redroid.py -mtg ``` -------------------------------- ### Add libndk arm translation to ReDroid Image Source: https://github.com/ayasa520/redroid-script/blob/main/README.md Use the -n flag to add libndk arm translation to the ReDroid image. This may offer better performance than libhoudini on AMD. ```bash python redroid.py -n ``` -------------------------------- ### Add Widevine DRM (L3) to ReDroid Image Source: https://github.com/ayasa520/redroid-script/blob/main/README.md Use the -w flag to add Widevine DRM (L3) to the ReDroid image. ```bash python redroid.py -w ``` -------------------------------- ### Shared utility functions for ReDroid scripts Source: https://context7.com/ayasa520/redroid-script/llms.txt Provides shared utility functions including host architecture detection, MD5-verified file download with progress, subprocess execution, download cache resolution, and colored terminal output. ```python from tools.helper import host, download_file, run, get_download_dir, print_color, bcolors # Detect host architecture arch, bits = host() # e.g. arch="x86_64", bits=64 # Supported: i686→x86, x86_64→x86_64, aarch64→arm64, armv7l/armv8l→arm # Resolve (and create) the download cache directory cache_dir = get_download_dir() # Respects $XDG_CACHE_HOME; falls back to ~/.cache/redroid/downloads/ # Download a file with MD5 verification md5 = download_file("https://example.com/file.zip", "/tmp/file.zip") print(f"Downloaded, MD5: {md5}") # Run a subprocess, raising CalledProcessError on stderr output result = run(["tar", "-xvf", "/tmp/file.zip", "-C", "/tmp/out"]) # Colored terminal output print_color("Build succeeded!", bcolors.GREEN) print_color("Warning: unsupported version", bcolors.YELLOW) print_color("Error: download failed", bcolors.RED) ``` -------------------------------- ### Pull Latest Android Image Source: https://github.com/ayasa520/redroid-script/blob/main/README.md Use the -a or --android-version flag to specify the Android version for the image to be pulled. The default is 11.0.0. ```bash python redroid.py -a 11.0.0 ``` -------------------------------- ### Supplement Houdini with compatibility patches Source: https://context7.com/ayasa520/redroid-script/llms.txt Applies compatibility patches from redroid_libhoudini_hack after Houdini.install(). Sets correct permissions for init.rc on Android versions above 9.0.0. ```python from stuff.houdini import Houdini from stuff.houdini_hack import Houdini_Hack version = "11.0.0" Houdini(version).install() # Only apply hack for versions other than 8.1.0 if version != "8.1.0": Houdini_Hack(version).install() # Result: ./houdini/system/ patched with compatibility overrides # Equivalent CLI usage (hack is applied automatically): # python redroid.py -a 11.0.0 -i ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.