Skip to content

Commit

Permalink
Merge pull request #37 from cirosec/pr-autoupdate
Browse files Browse the repository at this point in the history
Enable Updates via Magisk
  • Loading branch information
ViRb3 committed Aug 11, 2023
2 parents 3e6c5da + fd447cc commit 38988ca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ jobs:
if: hashFiles('NEW_TAG.txt') != ''
uses: ncipollo/[email protected]
with:
artifacts: build/*.zip
artifacts: build/*.zip,build/updater.json
tag: "${{ env.NEW_TAG }}"
body: https://github.com/frida/frida/releases
17 changes: 16 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import threading
import zipfile
import concurrent.futures
import json

import requests

Expand Down Expand Up @@ -57,7 +58,8 @@ def create_module_prop(path: Path, project_tag: str):
version={project_tag}
versionCode={project_tag.replace(".", "").replace("-", "")}
author=ViRb3
description=Run frida-server on boot"""
description=Run frida-server on boot
updateJson=https://github.com/ViRb3/magisk-frida/releases/latest/updater.json"""

with open(path.joinpath("module.prop"), "w", newline="\n") as f:
f.write(module_prop)
Expand Down Expand Up @@ -87,6 +89,18 @@ def fill_module(arch: str, frida_tag: str, project_tag: str):
extract_file(frida_server_path, files_dir.joinpath(f"frida-server-{arch}"))


def create_updater_json(project_tag: str):
logger.info("Creating updater.json")

updater ={
"version": project_tag,
"versionCode": int(project_tag.replace(".", "").replace("-", "")),
"zipUrl": f"https://github.com/ViRb3/magisk-frida/releases/download/{project_tag}/MagiskFrida-{project_tag}.zip"
}

with open(PATH_BUILD.joinpath("updater.json"), "w", newline="\n") as f:
f.write(json.dumps(updater, indent = 4))

def package_module(project_tag: str):
logger.info("Packaging module")

Expand Down Expand Up @@ -120,5 +134,6 @@ def do_build(frida_tag: str, project_tag: str):
# executor.shutdown()

package_module(project_tag)
create_updater_json(project_tag)

logger.info("Done")

0 comments on commit 38988ca

Please sign in to comment.