1
0
Fork 0
mirror of https://github.com/Radiquum/anixart-patcher.git synced 2025-09-06 03:03:50 +05:00
anixart-patcher/scripts/select_apk.py
2025-08-31 19:51:58 +05:00

27 lines
No EOL
780 B
Python

import os
from beaupy import select
from config import config, log, console
def get_apks() -> list[str]:
apks = []
if not os.path.exists(config["folders"]["apks"]):
log.info(f"creating `apks` folder: {config['folders']['apks']}")
os.mkdir(config["folders"]["apks"])
return apks
for file in os.listdir(config["folders"]["apks"]):
if file.endswith(".apk") and os.path.isfile(f"{config['folders']['apks']}/{file}"):
apks.append(file)
return apks
def select_apk(apks: list[str]) -> str:
console.print("select apk file to patch")
apks.append("cancel")
apk = select(apks, cursor="->", cursor_style="cyan")
if apk == "cancel":
log.info("patching cancelled")
exit(0)
return apk