mirror of
https://github.com/NohamR/pyzule-rw.git
synced 2026-10-10 18:39:41 +00:00
refactor: use python zipfile
this might cause some issues with some specific apps bc of that stupid 1980 error thingy, but idc
This commit is contained in:
@@ -5,7 +5,7 @@ import zipfile
|
||||
import platform
|
||||
import plistlib
|
||||
import subprocess
|
||||
from glob import glob
|
||||
from glob import glob, iglob
|
||||
from argparse import Namespace
|
||||
from importlib import resources # type: ignore
|
||||
from typing import Optional, Any
|
||||
@@ -150,3 +150,14 @@ def extract_deb(deb: str, tweaks: dict[str, str], tmpdir: str) -> None:
|
||||
print(f"[*] extracted {os.path.basename(deb)}")
|
||||
del tweaks[os.path.basename(deb)]
|
||||
|
||||
|
||||
def make_ipa(tmpdir: str, output: str, level: int) -> None:
|
||||
# ensure names are written as Payload/...
|
||||
os.chdir(tmpdir)
|
||||
|
||||
with zipfile.ZipFile(
|
||||
output, "w", zipfile.ZIP_DEFLATED, compresslevel=level
|
||||
) as zf:
|
||||
for f in iglob("Payload/**", recursive=True):
|
||||
zf.write(f)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user