How j-hc/revanced-magisk-module works
Main Components
• CI/CD Pipeline:
– Represent the GitHub Actions workflows (found under .github/workflows, including build.yml and ci.yml). These handle both scheduled (daily) builds and triggered builds when changes occur.
• Build Scripts & Execution Environment:
– Include the build scripts (build.sh and build-termux.sh) that initiate the build process on different platforms (desktop vs. Termux).
• Configuration Management:
– Highlight key configuration files (config.toml and CONFIG.md), which allow customization (possibly generated/edited via rvmm-config-gen). They control which patches are applied and how the builder behaves.
• Binary Toolkit:
– Show the “bin” directory containing various executable tools and libraries (aapt2, apksigner.jar, dexlib2.jar, paccer.jar, htmlq, and toml binaries) that perform essential tasks such as parsing, signing, and assembling APKs.
• Magisk Module Packaging:
– Emphasize the “revanced-magisk” directory. This contains MAGISK-specific resources such as the META-INF (with updater-script and update-binary), and scripts (customize.sh, service.sh, uninstall.sh) that manage installation, updates, and removal within the Magisk ecosystem.
• External Dependencies and Integrations:
– Indicate external tools or services such as the rvmm-config-gen webpage, and reference the links in the README (e.g., zygisk-detach) that assist end users.
• Distribution:
– Note the GitHub Releases and the CI workflow that pushes the final APKs and modules after a successful build.
Relationships and Interactions
– The source repository (including configuration and build scripts) is continuously integrated via GitHub Actions. A code change or a timer-based trigger pushes the build into motion.
– The CI/CD pipeline first invokes the build script (either build.sh or build-termux.sh). In turn, these scripts invoke various tools from the “bin” folder.
– Configuration files (config.toml) feed customization parameters into the build process, determining which patches or app modules get processed.
– After building and patching, the project generates deliverables (APK files and/or Magisk modules) and uses the revanced-magisk folder structure for packaging. These deliverables are then pushed to GitHub Releases.
– The CI process also ensures that the modules integrate seamlessly with Magisk and do not trigger safety-net or root detections, relying on prescribed scripts in the module folder.
Architectural Patterns and Design Principles
– Modular Separation: Each major component (CI/CD, build scripts, toolkit, configuration, packaging) is logically separated. This helps in isolating concerns (for example, build tools and packaging logic).
– Extensibility: The configuration mechanism (via config.toml and using rvmm-config-gen) allows for easy inclusion/exclusion of patches, supporting future app and patch updates.
– Automation & Continuous Integration: GitHub Actions orchestrate the entire build process in a reproducible, automated manner.
– Platform Independence: Through different build scripts (Termux vs. Desktop) and platform-specific binaries in the “bin” directory, the project supports multiple environments.