mirror of
https://github.com/NohamR/pyzule-rw.git
synced 2026-10-10 18:39:41 +00:00
chore: remove unnecessary typing
This commit is contained in:
5
.ruff.toml
Normal file
5
.ruff.toml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
line-length = 78
|
||||||
|
indent-width = 4
|
||||||
|
|
||||||
|
[lint]
|
||||||
|
select = ["E", "F"]
|
||||||
21
cyan.py
Normal file → Executable file
21
cyan.py
Normal file → Executable file
@@ -1,27 +1,32 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
# cyan, aka pyzule-rw; by zx, 2024
|
# cyan, aka pyzule-rw; by zx, 2024
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
parser: argparse.ArgumentParser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description="cyan, an azule \"clone\" for modifying iOS apps")
|
description="cyan, an azule \"clone\" for modifying iOS apps")
|
||||||
parser.add_argument("-o", metavar="output",
|
parser.add_argument("-o", metavar="output",
|
||||||
help="if unspecified, overwrites input")
|
help="if unspecified, overwrites input")
|
||||||
parser.add_argument("-f", metavar="file", nargs="+",
|
parser.add_argument("-f", metavar="file", nargs="+",
|
||||||
help="a tweak to inject/item to be added to the bundle")
|
help="a tweak to inject/item to be added to the bundle")
|
||||||
parser.add_argument("input", help="the app to be modified (.app/.ipa)")
|
|
||||||
args: argparse.Namespace = parser.parse_args()
|
|
||||||
|
|
||||||
INPUT: str = os.path.realpath(args.input)
|
parser.add_argument("--overwrite", action="store_true",
|
||||||
WORKING_DIR: str = os.getcwd()
|
help="skip overwrite confirmation")
|
||||||
PZ_DIR: str = os.path.expanduser("~/.config/cyan")
|
|
||||||
changed: bool = False
|
parser.add_argument("input", help="the app to be modified (.app/.ipa)")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
INPUT = os.path.realpath(args.input)
|
||||||
|
WORKING_DIR = os.getcwd()
|
||||||
|
PZ_DIR = os.path.expanduser("~/.config/cyan")
|
||||||
|
changed = False
|
||||||
|
|
||||||
if not (INPUT.endswith(".ipa") or INPUT.endswith(".app")):
|
if not (INPUT.endswith(".ipa") or INPUT.endswith(".app")):
|
||||||
sys.exit("[!] input must be a .ipa/.app")
|
sys.exit("[!] input must be a .ipa/.app")
|
||||||
elif not os.path.exists(INPUT):
|
elif not os.path.exists(INPUT):
|
||||||
sys.exit("[!] input does not exist")
|
sys.exit("[!] input does not exist")
|
||||||
elif not args.o and (input("[<] override your input file? [y/N] ").strip()
|
elif not args.o and (input("[<] override your input file? [y/N] ").strip()
|
||||||
.lower() not in ("y", "yes")):
|
.lower() not in ("y", "yes")):
|
||||||
sys.exit("[!] not overriding input, missing -o")
|
sys.exit("[!] not overriding input, missing -o")
|
||||||
|
|||||||
Reference in New Issue
Block a user