mirror of
https://github.com/LSPosed/MagiskOnWSALocal.git
synced 2025-05-06 14:56:36 +08:00
Use absolute path when unzip WSA
This commit is contained in:
parent
e7b1e89ada
commit
975bdcf4d8
@ -39,7 +39,7 @@ print(
|
|||||||
env_file = Path(env_file_raw).resolve()
|
env_file = Path(env_file_raw).resolve()
|
||||||
|
|
||||||
workdir = rootdir / "wsa"
|
workdir = rootdir / "wsa"
|
||||||
archdir = Path(workdir / arch)
|
archdir = Path(workdir / arch).resolve()
|
||||||
pridir = workdir / archdir / 'pri'
|
pridir = workdir / archdir / 'pri'
|
||||||
xmldir = workdir / archdir / 'xml'
|
xmldir = workdir / archdir / 'xml'
|
||||||
if not Path(rootdir).is_dir():
|
if not Path(rootdir).is_dir():
|
||||||
@ -57,7 +57,7 @@ if not Path(archdir).is_dir():
|
|||||||
archdir.mkdir()
|
archdir.mkdir()
|
||||||
uid = os.getuid()
|
uid = os.getuid()
|
||||||
workdir_rw = os.access(workdir, os.W_OK)
|
workdir_rw = os.access(workdir, os.W_OK)
|
||||||
print(f"Uid {uid} can write to {workdir} {workdir_rw}", flush=True)
|
print(f"Uid {uid} can write to {archdir} {workdir_rw}", flush=True)
|
||||||
with zipfile.ZipFile(wsa_zip_path) as zip:
|
with zipfile.ZipFile(wsa_zip_path) as zip:
|
||||||
for f in zip.filelist:
|
for f in zip.filelist:
|
||||||
if arch in f.filename.lower():
|
if arch in f.filename.lower():
|
||||||
@ -94,5 +94,7 @@ with zipfile.ZipFile(wsa_zip_path) as zip:
|
|||||||
print(f"extracting {g.filename}", flush=True)
|
print(f"extracting {g.filename}", flush=True)
|
||||||
l.extract(g, archdir)
|
l.extract(g, archdir)
|
||||||
with zipfile.ZipFile(zip_path) as zip:
|
with zipfile.ZipFile(zip_path) as zip:
|
||||||
|
stat = Path(zip_path).stat()
|
||||||
|
print(f"stat {zip_path}: {stat}", flush=True)
|
||||||
print(f"unzipping from {zip_path}", flush=True)
|
print(f"unzipping from {zip_path}", flush=True)
|
||||||
zip.extractall(archdir)
|
zip.extractall(archdir)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user