How nikgapps/project works
Project type and purpose
• This is an open-source, command-line Python tool (“NikGapps”) for building custom Google Apps (GApps) packages for Android.
• It packages, overlays, compresses, and releases GApps variants based on user configuration.
File structure
• Top-level:
• Dockerfile, setup.py, requirements.txt – build & packaging.
• script.sh, update_version.py – release automation.
• NikGapps/ – the Python package.
• Inside NikGapps/:
• build/ – core build engine: Build.py, Manager, Overlay logic, Release slicing.
• config/ – configuration loader & definitions.
• helper/ – utility subsystems (AppSet, Assets, Package, git wrappers, overlay metadata, compression).
• cache.py, copy_repos.py, overlay_control.py – orchestration scripts.
• main.py – CLI entrypoint; test.py – test harness.
• assets (shell scripts, JSON/YAML) under helper/assets drive installer scripts and defaults.
• Configuration files (build_config.py, config_upload.py) govern build parameters.
README insights
• Outlines build prerequisites (python3, aapt, apktool, git, git-lfs).
• Describes feature set (custom partitioning, addon.d support, debloater config).
• CLI usage: nikgapps --androidVersion X --packageList Y.
• Emphasis on full configurability and variant packaging.
Main components & interactions
a. Components
1. CLI Interface (main.py)
2. Configuration Loader (NikGapps/config)
3. Build Manager (NikGapps/build/NikGappsManager.py)
4. Overlay & Release Engine (NikGapps/build & helper/overlay)
5. Compression Engine (helper/compression)
6. Asset Generator (helper/assets shell scripts)
7. Git & Repository Interface (helper/git)
8. Cache & File System (cache.py, copy_repos.py)
9. External Tools (aapt, apktool, git, zip utilities)
10. Output Sink (Releases directory)
b. Relationships & data flow
• User invokes CLI →
Configuration Loader parses command-line args & nikgapps.config →
Build Manager orchestrates:
– fetches sources (helper/git & copy_repos) →
– generates overlays & metadata (helper/overlay) →
– invokes compression routines (helper/compression) →
– assembles shell assets (helper/assets) →
– writes to output directories →
– triggers Release module to tag, zip, and move packages.
• All file operations go through cache and temp folders.
• External tools invoked at overlay extraction and asset packaging steps.
c. Architectural patterns & principles
• Modular layered architecture: CLI → Core → Helpers → External tools.
• Separation of concerns: config parsing, build orchestration, overlay processing, packaging.
• Plugin-like helpers: easy to extend overlay or compression strategies.
• Declarative assets: shell scripts and JSON/YAML define install behaviors.
d. Key technologies & frameworks
• Python 3.x packaging (setup.py, installable NikGapps CLI)
• Shell scripting (helper/assets/*.sh)
• apktool, aapt (Android package processing)
• Git & Git-LFS (source retrieval)
• Standard compression libraries (zip, tar) via Python and shell
Detail
• External commands (aapt, apktool, git) as separate nodes.
• Configuration files (nikgapps.config, debloater.config) feeding into the Manager.
• Final output directory and release process.