From ab5eaff57125f0598d0cdf922a20da03615ada7b Mon Sep 17 00:00:00 2001 From: zx Date: Sat, 6 Apr 2024 15:50:03 -0400 Subject: [PATCH] chore: beginning --- .gitignore | 1 + LICENSE | 2 +- README.md | 2 +- cyan.py | 26 ++++++++++++++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c18dd8d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__/ diff --git a/LICENSE b/LICENSE index 3c577b0..fdddb29 100644 --- a/LICENSE +++ b/LICENSE @@ -21,4 +21,4 @@ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -For more information, please refer to \ No newline at end of file +For more information, please refer to diff --git a/README.md b/README.md index 83ff9ba..4d9c604 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,4 @@ rewriting [pyzule](https://github.com/asdfzxcvbn/pyzule), but actually good this this is pretty much just a hobby project that i'll work on when i'm bored. pyzule in its current state is kinda ugly, but it works and i haven't really had the motivation to work on it. there really isn't any need for improvements, anyway.. -`cyan` will target python v3.12 (finally!), be pep8-compliant (hopefully..), and be statically typed! +`cyan` will target python v3.12 (finally!), be pep8-compliant (hopefully..), and be type-hinted! diff --git a/cyan.py b/cyan.py index f61262e..0ca5d0f 100644 --- a/cyan.py +++ b/cyan.py @@ -1 +1,27 @@ # cyan, aka pyzule-rw; by zx, 2024 + +import os +import sys +import argparse + +parser: argparse.ArgumentParser = argparse.ArgumentParser( + description="cyan, an azule \"clone\" for modifying iOS apps") +parser.add_argument("-o", metavar="output", + help="if unspecified, overwrites input") +parser.add_argument("-f", metavar="file", nargs="+", + 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) +WORKING_DIR: str = os.getcwd() +PZ_DIR: str = os.path.expanduser("~/.config/cyan") +changed: bool = False + +if not (INPUT.endswith(".ipa") or INPUT.endswith(".app")): + sys.exit("[!] input must be a .ipa/.app") +elif not os.path.exists(INPUT): + sys.exit("[!] input does not exist") +elif not args.o and (input("[<] override your input file? [y/N] ").strip() + .lower() not in ("y", "yes")): + sys.exit("[!] not overriding input, missing -o")