question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Obfuscation always returning non-zero exit status 255.

See original GitHub issue

Hi.

I’m trying to obfuscate an. apk that is signed and process always returns non-zero exit status 255.

I suspect that I’m doing it the wrong way.

sudo docker run --rm -it -u $(id -u):$(id -g) -v "${PWD}":"/workdir" obfuscapk -o RandomManifest -o Rebuild -o NewAlignment -o NewSignature original.apk -p --keystore-file XXXX.key --keystore-password PASS --key-alias PASS --key-password PASS

The result is always this:

Traceback (most recent call last): File "/Obfuscapk/obfuscapk/main.py", line 153, in perform_obfuscation (obfuscator_name_to_function[obfuscator_name])(obfuscation) File "/Obfuscapk/obfuscapk/obfuscators/new_alignment/new_alignment.py", line 20, in obfuscate obfuscation_info.align_obfuscated_apk() File "/Obfuscapk/obfuscapk/obfuscation.py", line 620, in align_obfuscated_apk zipalign.align(self.obfuscated_apk_path) File "/Obfuscapk/obfuscapk/tool.py", line 247, in align output = subprocess.check_output( File "/usr/local/lib/python3.10/subprocess.py", line 420, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/local/lib/python3.10/subprocess.py", line 524, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['/android-sdk-linux/build-tools/32.0.0/zipalign', '-p', '-v', '-f', '4', 'obfuscation_working_dir/original_obfuscated.copy.apk', 'obfuscation_working_dir/original_obfuscated.apk']' returned non-zero exit status 255. Traceback (most recent call last): File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/Obfuscapk/obfuscapk/cli.py", line 189, in <module> main() File "/Obfuscapk/obfuscapk/cli.py", line 171, in main perform_obfuscation( File "/Obfuscapk/obfuscapk/main.py", line 153, in perform_obfuscation (obfuscator_name_to_function[obfuscator_name])(obfuscation) File "/Obfuscapk/obfuscapk/obfuscators/new_alignment/new_alignment.py", line 20, in obfuscate obfuscation_info.align_obfuscated_apk() File "/Obfuscapk/obfuscapk/obfuscation.py", line 620, in align_obfuscated_apk zipalign.align(self.obfuscated_apk_path) File "/Obfuscapk/obfuscapk/tool.py", line 247, in align output = subprocess.check_output( File "/usr/local/lib/python3.10/subprocess.py", line 420, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/local/lib/python3.10/subprocess.py", line 524, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['/android-sdk-linux/build-tools/32.0.0/zipalign', '-p', '-v', '-f', '4', 'obfuscation_working_dir/original_obfuscated.copy.apk', 'obfuscation_working_dir/original_obfuscated.apk']' returned non-zero exit status 255.

What I’m doing wrong?

Thanks in advance Jose

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bluecatpixelcommented, Oct 20, 2022

LOL…makes sense

thanks for the quick response

0reactions
ClaudiuGeorgiucommented, Oct 20, 2022

What I’m doing wrong?

You are using some obfuscators after rebuilding the app, see FAQ. Put -o Rebuild -o NewAlignment -o NewSignature after all the other obfuscators.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · ClaudiuGeorgiu/Obfuscapk - GitHub
An automatic obfuscation tool for Android apps that works in a black-box fashion ... Obfuscation always returning non-zero exit status 255. question Further ......
Read more >
IQService Returned Non Zero Exit Code 255 - Compass
Depending on our shell, exit code 255 might mean that the returned exit code is outside of the 0-255 range. If the error...
Read more >
realloc() failure - Google Groups
To the best of my knowledge, the DOS exit code is also 0 to 255. So is the Return Code in CMS. VMS...
Read more >
Overview | Deciphering Strange Arduino Code | Adafruit Learning ...
This wasn't always the case, so you don't see it in older code. ... One could put the nested loops inside their own...
Read more >
[Freeipa-users] FreeIPA 4.2.0 / Replica / Join Issue
Process finished, return code=255 stdout= ... in /etc/ipa/nssdb: Command ''/usr/bin/certutil' '-d' '/etc/ipa/nssdb' '-L'' returned non-zero exit status 255
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found