Home

Awesome

Magisk Modules Repo Util

This util is to build module repository for MMRL

Getting Started

Install dependencies

pip3 install -r util/requirements.txt

New config.json

You can write it to your-repo/json/config.json by yourself, or

cli.py config --stdin << EOF
{
  "name": "Your Magisk Repo",
  "base_url": "https://you.github.io/magisk-modules-repo/",
  "max_num": 3,
  "enable_log": true,
  "log_dir": "log"
}
EOF

or

cli.py config --write name="Your Magisk Repo" base_url="https://you.github.io/magisk-modules-repo/" max_num=3 enable_log=true log_dir="log"

New track.json

You can write it to your-repo/modules/{id}/track.json by yourself, or

cli.py track --stdin << EOF
{
  "id": "zygisk_lsposed",
  "update_to": "https://lsposed.github.io/LSPosed/release/zygisk.json",
  "license": "GPL-3.0"
}
EOF

or

cli.py track --add id="zygisk_lsposed" update_to="https://lsposed.github.io/LSPosed/release/zygisk.json" license="GPL-3.0"

If you want to generate track.jsons from repositories on github

cli.py github --token <github-token> -u <user-name> -r <repo-name ...>

[!TIP] Click here to create a new api token.

Sync

cli.py sync

Generate a sitemap

cli.py sitemap --base-url "https://mmrl.dergoogler.com/?module="

How to update by GitHub Actions?

cli.py

cli.py --help
usage: cli.py [-h] [-v] [-V] command ...

Magisk Modules Repo Util

positional arguments:
  command
    config            Modify config of repository.
    track             Module tracks utility.
    github            Generate tracks from GitHub.
    sync              Sync modules in repository.
    index             Generate modules.json from local.
    check             Content check and migrate.
    sitemap           Sitemap generator.

options:
  -h, --help          Show this help message and exit.
  -v, --version       Show util version and exit.
  -V, --version-code  Show util version code and exit.

config.json

{
  "name": "Googlers Magisk Repo",
  "website": "https://mmrl.dergoogler.com",
  "support": "https://github.com/Googlers-Repo/repo/issues",
  "donate": "https://github.com/sponsors/DerGoogler",
  "submission": null,
  "base_url": "https://gr.dergoogler.com/repo/",
  "max_num": 3,
  "enable_log": true,
  "log_dir": "log"
}
KeyAttributeDescription
namerequiredName of your module repository
base_urlrequiredNeed to end with /
websiteoptionalName of your website
donateoptionalName of your donation url
submissionoptionalLink to your submission requests
supportoptionalLink to your support chat
max_numoptionalMax num of versions for modules, default is 3
enable_logoptionaldefault is true
log_diroptionaldefault is null

track.json

{
  "id": "str",
  "enable": "bool",
  "verified": "bool",
  "update_to": "str",
  "source": "str",
  "readme": "str",
  "max_num": "int",
  "antifeatures": ["array"]
}
KeyAttributeTypeDescription
idrequiredStrId of Module (in module.prop)
enablerequiredBoolWhether to enable updates
update_torequiredStrFollow examples below
sourceoptionalStrUrl of where the source code lives
homepageoptionalStrURL
readmeoptionalStrURL with e.g. description, instructions
changelogoptionalStrMarkdown or Simple Text (no HTML)
supportoptionalStrURL to issue tracker/support forum
donateoptionalStrURL to donation page
coveroptionalStrURL to cover image (featureGraphic)
iconoptionalStrURL to icon.png (squared, max 512x512 px)
screenshotsoptionalStr[]URLs to screenshots of the module
licenseoptionalStrSPDX identifier (see below)
antifeaturesoptionalStr[]potentially unwanted "features" (see below)
categoryoptionalStrcategory the module belongs to (deprecated)
categoriesoptionalStr[]array of categories the module belongs to
requireoptionalStr[]array of module_ids this module depends on
verifiedoptionalBoolif module has good quality and is well maintained
max_numoptionalIntOverload MAX_NUM in config.json
versionsautoInthow many versions are present (do not touch!)

Examples for antifeatures and their meanings can e.g. be found here.

For SPDX identifiers, see the SPDX license list.

common/repo.json

[!IMPORTANT] This file can be placed in the modules root directory. If a repo owner has added your module to his repo he can override those fields with the track.json file

{
  "support": "str",
  "donate": "str",
  "cover": "str",
  "icon": "str",
  "license": "str",
  "homepage": "str",
  "readme": "str",
  "screenshots": ["array"],
  "category": "str",
  "categories": ["array"],
  "require": ["array"],
  "note": {
    "title": "str", // optional
    "color": "red,blue,yellow,green", // optional
    "message": "str" // required
  },
  "root": {
    "kernelsu": ">= 1.0.0",
    "magisk": ">= 24.0
  }
}
KeyAttributeDescription
licenseoptionalSPDX ID
coveroptionalUrl
iconoptionalUrl
readmeoptionalStr
screenshotsoptionalUrl[]
antifeaturesoptionalStr[]
categoryoptionalStr
categoriesoptionalStr[]
homepageoptionalUrl
supportoptionalUrl
donateoptionalUrl
noteoptionalNote
rootoptionalRootSolutions (you should follow the semver) syntax

Update from updateJson

For those modules that provide updateJson.

{
  "id": "zygisk_lsposed",
  "update_to": "https://lsposed.github.io/LSPosed/release/zygisk.json",
  "license": "GPL-3.0"
}

Update from local updateJson

update_to requires a relative directory of local.

{
  "id": "zygisk_lsposed",
  "update_to": "zygisk.json",
  "license": "GPL-3.0"
}

Update from url

For those have a same url to release new modules.

{
  "id": "zygisk_lsposed",
  "update_to": "https://github.com/LSPosed/LSPosed/releases/download/v1.8.6/LSPosed-v1.8.6-6712-zygisk-release.zip",
  "license": "GPL-3.0",
  "changelog": "https://lsposed.github.io/LSPosed/release/changelog.md"
}

Update from git

For those we can get module by packaging all files in the repository, such as Magisk-Modules-Repo and Magisk-Modules-Alt-Repo.

{
  "id": "busybox-ndk",
  "update_to": "https://github.com/Magisk-Modules-Repo/busybox-ndk.git"
}

Update from local zip

update_to and changelog requires a relative directory of local.

{
  "id": "zygisk_lsposed",
  "update_to": "LSPosed-v1.8.6-6712-zygisk-release.zip",
  "license": "GPL-3.0",
  "changelog": "changelog.md"
}

For developer

your-repo
├── json
│   ├── config.json
│   └── modules.json
│
├── local
│   ├── ...
│   └── ...
│
├── log
│   ├── sync_2023-03-18.log
│   ├── ...
│   └── ...
│
├── modules
│   ├── zygisk_lsposed
│   │   ├── track.json
│   │   ├── update.json
│   │   ├── v1.8.6_6712.md
│   │   ├── v1.8.6_6712.zip
│   │   ├── ...
│   │   └── ...
│   │
│   ├── another_module
│   │   ├── ...
│   │   └── ...
│   └── .
│
└── util

update.json

{
  "id": "zygisk_lsposed",
  "timestamp": 1673882223.0,
  "versions": [
    {
      "timestamp": 1673882223.0,
      "version": "v1.8.6 (6712)",
      "versionCode": 6712,
      "zipUrl": "{base_url}modules/zygisk_lsposed/v1.8.6_(6712)_6712.zip",
      "changelog": "{base_url}modules/zygisk_lsposed/v1.8.6_(6712)_6712.md"
    }
  ]
}

track.json

{
  "id": "zygisk_lsposed",
  "update_to": "https://lsposed.github.io/LSPosed/release/zygisk.json",
  "license": "GPL-3.0",
  "homepage": "https://lsposed.org/",
  "source": "https://github.com/LSPosed/LSPosed.git",
  "support": "https://github.com/LSPosed/LSPosed/issues",
  "added": 1679025505.129431,
  "last_update": 1673882223.0,
  "versions": 1
}

modules.json

version 1

{
  "name": "{name}",
  "metadata": {
    "version": 1,
    "timestamp": 1692439764.10608
  },
  "modules": [
    {
      "id": "zygisk_lsposed",
      "name": "Zygisk - LSPosed",
      "version": "v1.8.6 (6712)",
      "versionCode": 6712,
      "author": "LSPosed Developers",
      "description": "Another enhanced implementation of Xposed Framework. Supports Android 8.1 ~ 13. Requires Magisk 24.0+ and Zygisk enabled.",
      "track": {
        "type": "ONLINE_JSON",
        "added": 1679025505.129431,
        "license": "GPL-3.0",
        "homepage": "https://lsposed.org/",
        "source": "https://github.com/LSPosed/LSPosed.git",
        "support": "https://github.com/LSPosed/LSPosed/issues",
        "donate": ""
      },
      "versions": [
        {
          "timestamp": 1673882223.0,
          "version": "v1.8.6 (6712)",
          "versionCode": 6712,
          "zipUrl": "{base_url}modules/zygisk_lsposed/v1.8.6_(6712)_6712.zip",
          "changelog": "{base_url}modules/zygisk_lsposed/v1.8.6_(6712)_6712.md"
        }
      ]
    }
  ]
}

version 0

{
  "name": "{name}",
  "timestamp": 1692439602.46997,
  "modules": [
    {
      "id": "zygisk_lsposed",
      "name": "Zygisk - LSPosed",
      "version": "v1.8.6 (6712)",
      "versionCode": 6712,
      "author": "LSPosed Developers",
      "description": "Another enhanced implementation of Xposed Framework. Supports Android 8.1 ~ 13. Requires Magisk 24.0+ and Zygisk enabled.",
      "license": "GPL-3.0",
      "states": {
        "zipUrl": "{base_url}modules/zygisk_lsposed/v1.8.6_(6712)_6712.zip",
        "changelog": "{base_url}modules/zygisk_lsposed/v1.8.6_(6712)_6712.md"
      }
    }
  ]
}