5 Commits

Author SHA1 Message Date
zx
2d16015c78 chore: bump version to v1.1.6 2024-09-16 20:26:37 -04:00
zx
4c979a91e7 template: grammar?
idrk
2024-09-16 20:25:55 -04:00
zx
b4aa6c9b69 chore: use enhancement label 2024-09-16 20:24:13 -04:00
zx
246f6ace80 docs: recommended flags
also issue templates
2024-09-16 20:23:19 -04:00
zx
511cb4bbe3 chore: use unzip and zip when available 2024-09-16 20:07:23 -04:00
10 changed files with 107 additions and 13 deletions

22
.github/ISSUE_TEMPLATE/bug.yaml vendored Normal file
View File

@@ -0,0 +1,22 @@
# thanks to uYouEnhanced for the issue template:
# https://github.com/arichornlover/uYouEnhanced/blob/main/.github/ISSUE_TEMPLATE/bug.yaml?plain=1
name: bug
description: report a bug in cyan
title: "[bug] "
labels: bug
body:
- type: checkboxes
attributes:
label: have you searched the existing issues?
options:
- label: this is a unique issue. i agree that if this isn't a unique issue, i'll be BLOCKED from the cyan repo
required: true
- type: textarea
attributes:
label: describe the bug.
description: attach videos or screenshots if possible
validations:
required: true

View File

@@ -0,0 +1,22 @@
# thanks to uYouEnhanced for the issue template:
# https://github.com/arichornlover/uYouEnhanced/blob/main/.github/ISSUE_TEMPLATE/bug.yaml?plain=1
name: feature request
description: request a feature to be added to cyan
title: "[feature request] "
labels: enhancement
body:
- type: checkboxes
attributes:
label: have you searched the existing issues?
options:
- label: this is a unique feature request. i agree that if this isn't a unique request, i'll be BLOCKED from the cyan repo
required: true
- type: textarea
attributes:
label: describe the feature request.
description: what exactly are you requesting? can you provide an example where this would be useful?
validations:
required: true

View File

@@ -4,7 +4,7 @@ a rewrite of [pyzule](https://github.com/asdfzxcvbn/pyzule) that doesn't (comple
## features ## features
you can open an issue to request a feature :D !! you can open an issue to request a feature :D !! also see my [recommended flags](https://github.com/asdfzxcvbn/pyzule-rw/wiki/recommended-flags)
- generate and use shareable .cyan files to configure IPAs! - generate and use shareable .cyan files to configure IPAs!
- inject deb, dylib, framework, bundle, and appex files/folders - inject deb, dylib, framework, bundle, and appex files/folders
@@ -26,6 +26,8 @@ first, make sure you have [ar](https://command-not-found.com/ar) and [tar](https
also obviously install python, version 3.9 or greater is required also obviously install python, version 3.9 or greater is required
the `zip` and `unzip` commands are *optional* dependencies, they may [fix issues when extracting certain IPAs with chinese characters](https://github.com/asdfzxcvbn/pyzule-rw/wiki/file-does-not-exist-(executable)-%3F), etc
<details> <details>
<summary><b>linux/WSL/macOS instructions</b></summary> <summary><b>linux/WSL/macOS instructions</b></summary>
<br/> <br/>

View File

@@ -95,7 +95,7 @@ def main() -> None:
) )
parser.add_argument( parser.add_argument(
"--version", action="version", version="cyan v1.1.5" "--version", action="version", version="cyan v1.1.6"
) )
from cyan import logic from cyan import logic

View File

@@ -4,24 +4,34 @@
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>English</string> <string>English</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>Cephei</string> <string>Cephei</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>ws.hbang.common</string> <string>ws.hbang.common</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>Cephei</string> <string>Cephei</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>BNDL</string> <string>BNDL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0.0</string> <string>1.0.0</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>DTPlatformName</key> <key>DTPlatformName</key>
<string>iphoneos</string> <string>iphoneos</string>
<key>HBPackageIdentifier</key> <key>HBPackageIdentifier</key>
<string>ws.hbang.common</string> <string>ws.hbang.common</string>
</dict> </dict>

View File

@@ -4,26 +4,37 @@
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>English</string> <string>English</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>CepheiPrefs</string> <string>CepheiPrefs</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>ws.hbang.common.prefs</string> <string>ws.hbang.common.prefs</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>Cephei</string> <string>Cephei</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>BNDL</string> <string>BNDL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0.0</string> <string>1.0.0</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>DTPlatformName</key> <key>DTPlatformName</key>
<string>iphoneos</string> <string>iphoneos</string>
<key>HBPackageIdentifier</key> <key>HBPackageIdentifier</key>
<string>ws.hbang.common</string> <string>ws.hbang.common</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>
<string>HBDemoRootListController</string> <string>HBDemoRootListController</string>
</dict> </dict>

View File

@@ -35,7 +35,12 @@ class Executable:
def __init__(self, path: str, bundle_path: Optional[str] = None): def __init__(self, path: str, bundle_path: Optional[str] = None):
if not os.path.isfile(path): if not os.path.isfile(path):
sys.exit(f"[!] {path} does not exist (executable)") print(f"[!] {path} does not exist (executable)", file=sys.stderr)
sys.exit(
"[?] check the wiki for info: "
"https://github.com/asdfzxcvbn/pyzule-rw/wiki/"
"file-does-not-exist-(executable)-%3F"
)
self.path = path self.path = path
self.bundle_path = bundle_path self.bundle_path = bundle_path

View File

@@ -10,6 +10,9 @@ from glob import glob, iglob
from argparse import Namespace from argparse import Namespace
from typing import Optional, Any from typing import Optional, Any
HAS_ZIP = shutil.which("zip") is not None
HAS_UNZIP = shutil.which("unzip") is not None
def validate_inputs(args: Namespace) -> Optional[str]: def validate_inputs(args: Namespace) -> Optional[str]:
if not ( if not (
@@ -81,7 +84,15 @@ def get_app(path: str, tmpdir: str, is_ipa: bool) -> str:
elif not any(name.endswith(".app/Info.plist") for name in names): elif not any(name.endswith(".app/Info.plist") for name in names):
sys.exit("[!] no Info.plist, invalid app") sys.exit("[!] no Info.plist, invalid app")
# using unzip fixes extraction errors in ipas with chinese chars, etc
if HAS_UNZIP:
subprocess.run(
["unzip", path, "-d", tmpdir],
stdout=subprocess.DEVNULL
)
else:
ipa.extractall(tmpdir) ipa.extractall(tmpdir)
app = glob(f"{payload}/*.app")[0] app = glob(f"{payload}/*.app")[0]
except (KeyError, IndexError): except (KeyError, IndexError):
sys.exit("[!] couldn't find either Payload or app folder, invalid ipa") sys.exit("[!] couldn't find either Payload or app folder, invalid ipa")
@@ -180,6 +191,17 @@ def make_ipa(tmpdir: str, output: str, level: int) -> None:
os.chdir(tmpdir) os.chdir(tmpdir)
weird = 0 weird = 0
if HAS_ZIP:
try:
os.remove(output) # zip command updates zipfiles by default
except FileNotFoundError:
pass
subprocess.run(
["zip", f"-{level}", "-r", output, "Payload"],
stdout=subprocess.DEVNULL
)
else:
with zipfile.ZipFile( with zipfile.ZipFile(
output, "w", zipfile.ZIP_DEFLATED, compresslevel=level output, "w", zipfile.ZIP_DEFLATED, compresslevel=level
) as zf: ) as zf:

View File

@@ -4,7 +4,7 @@ from setuptools import setup
setup( setup(
name="cyan", name="cyan",
version="1.1.5", version="1.1.6",
description="finally, pyzule doesn't suck", description="finally, pyzule doesn't suck",
author="zx", author="zx",
author_email="zx@hrzn.email", author_email="zx@hrzn.email",