Skip to content

Commit

Permalink
fix: Adjust --no-res option handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ksg97031 authored Nov 11, 2024
1 parent a78b1f3 commit 6d3b7e9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,10 @@ def run(apk_path: str, arch: str, config: str, no_res:bool, main_activity: str,
decompiled_path.mkdir()

# APK decompile with apktool
run_apktool(['d', '-o', str(decompiled_path.resolve()), '-f'], str(apk_path.resolve()))
decompile_option = ['d', '-o', str(decompiled_path.resolve()), '-f']
if no_res:
decompile_option += ['--no-res']
run_apktool(decompile_option, str(apk_path.resolve()))
else:
if not decompiled_path.exists():
logger.error("Decompiled directory not found: %s", decompiled_path)
Expand All @@ -343,8 +346,6 @@ def run(apk_path: str, arch: str, config: str, no_res:bool, main_activity: str,
recompile_option = ['b']
if use_aapt2:
recompile_option += ['--use-aapt2']
if no_res:
recompile_option += ['--no-res']

run_apktool(recompile_option, str(decompiled_path.resolve()))
apk_path = decompiled_path.joinpath('dist', apk_path.name)
Expand Down

0 comments on commit 6d3b7e9

Please sign in to comment.