mirror of
https://github.com/Radiquum/anixart-patcher.git
synced 2025-09-05 10:45:32 +05:00
27 lines
No EOL
780 B
Python
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 |