How revanced-apks/build-apps works
Project and Its Purpose
• This project is an extensive builder for ReVanced Magisk modules and non-root APKs. Its primary purpose is to patch and optimize Android apps (like YouTube) by generating Magisk modules. It leverages various tools and scripts to automate the building, patching, and packaging operations.
• Features include handling patch inclusion/exclusion, automated daily builds via GitHub Actions, and integrations for notifications (through push-notify and telegram-script).
File Structure
• Top-Level Directories:
– .github: Contains CI/CD workflows (build, CI, matrix builds, merge upstream, notify, etc.). This indicates a strong emphasis on automated builds and integration.
– bin: Houses critical binaries and JARs (such as aapt2, apk signer, dexlib2, htmlq, paccer.jar) that support resource processing, signing, and bytecode manipulation.
– revanced-magisk: Contains the core Magisk module components (META-INF, update binaries, scripts such as customize.sh, service.sh, uninstall.sh), which are used for module installation and integrity management.
– push-notify and telegram-script: These directories are dedicated to notification functionalities; they house their Python entry points, configuration, and requirements.
– Other files (build.sh, build-termux.sh, config.toml, CONFIG.md, etc.) support local builds and configuration settings.
• The presence of multiple shell scripts, configuration files, and GitHub workflows suggests a design built around an automated build and deployment pipeline supporting both local and CI environments.
Key Components
a. Configuration and Setup:
– Components such as config.toml and CONFIG.md serve as the input for build parameters (e.g., selecting patches for different apps).
– GitHub Actions workflows (in .github) monitor changes and trigger builds.
b. Build Orchestration Layer:
– Build scripts (build.sh, build-termux.sh) are the entry points initiating the local build process.
– The GitHub workflows coordinate automated pipelines.
c. Tooling and Dependency Layer:
– The bin directory contains essential binaries (aapt2, apksigner, dexlib2, htmlq, paccer.jar), each of which is invoked during the build process for resource compilation, signing, and APK manipulation.
d. Magisk Module Generation:
– The revanced-magisk directory represents the heart of the module generation process. It includes META-INF and shell scripts for installation, update, and uninstallation.
e. Notification and Integration:
– Components such as push-notify and telegram-script are designed for sending build notifications and status updates externally.
f. Output/Release:
– The final artifacts (modules and APKs) are gathered and published to the Releases page via the CI pipeline.
Relationships and Interactions
• Data Flow:
– The configuration files (config.toml, CONFIG.md) feed settings into the build scripts.
– Build scripts call binaries (tools in bin) to process resources, compile patches, and sign APKs.
– The revanced-magisk module scripts manage the assembly of the module package.
– GitHub Actions workflows periodically trigger builds, monitor changes, and initiate CI pipelines.
– Post-build, notification services (push-notify, telegram-script) communicate build status and results to external channels (e.g., Telegram).
• Dependency Flow:
– CI workflows and local scripts are highly dependent on the consistency of the configuration and tooling layers.