ClaudiuGeorgiu / Obfuscapk

An automatic obfuscation tool for Android apps that works in a black-box fashion, supports advanced obfuscation features and has a modular architecture easily extensible with new techniques
MIT License
1.11k stars 287 forks source link

My Errors in Ofuscapk #51

Closed ImanCol closed 4 years ago

ImanCol commented 4 years ago
python -m obfuscapk.cli -p -d C:\Users\GAMER\Downloads\apk\obfuscation_working_dir\OUT\obfuscated.apk -o Rebuild -o NewAlignment -o NewSignature Sopa.apk
Running obfuscators (NewSignature):  67%|█████████████████████████████▎              |[03:47<02:39, 159.05s/obfuscator]10/08/2020 23:07:10> [ERROR][obfuscapk.tool.Jarsigner][sign()] Error during sign command: jarsigner: unable to sign jar: java.net.UnknownHostException: timestamp.comodoca.com

10/08/2020 23:07:10> [ERROR][obfuscapk.obfuscation][sign_obfuscated_apk()] Error during apk signing: Command '['C:\\Program Files\\Java\\jdk1.8.0_221\\bin\\jarsigner.exe', '-tsa', 'http://timestamp.comodoca.com/rfc3161', '-sigalg', 'SHA1withRSA', '-digestalg', 'SHA1', '-keystore', 'C:\\Users\\GAMER\\Obfuscapk\\src\\obfuscapk\\resources\\obfuscation_keystore.jks', '-storepass', 'obfuscation_password', 'C:\\Users\\GAMER\\Downloads\\apk\\obfuscation_working_dir\\OUT\\obfuscated.apk', 'obfuscation_key']' returned non-zero exit status 1.
10/08/2020 23:07:10> [ERROR][yapsy_loaded_plugin_NewSignature_1.new_signature.NewSignature][obfuscate()] Error during execution of "NewSignature" obfuscator: Command '['C:\\Program Files\\Java\\jdk1.8.0_221\\bin\\jarsigner.exe', '-tsa', 'http://timestamp.comodoca.com/rfc3161', '-sigalg', 'SHA1withRSA', '-digestalg', 'SHA1', '-keystore', 'C:\\Users\\GAMER\\Obfuscapk\\src\\obfuscapk\\resources\\obfuscation_keystore.jks', '-storepass', 'obfuscation_password', 'C:\\Users\\GAMER\\Downloads\\apk\\obfuscation_working_dir\\OUT\\obfuscated.apk', 'obfuscation_key']' returned non-zero exit status 1.
10/08/2020 23:07:10> [CRITICAL][obfuscapk.main][perform_obfuscation()] Error during obfuscation: Command '['C:\\Program Files\\Java\\jdk1.8.0_221\\bin\\jarsigner.exe', '-tsa', 'http://timestamp.comodoca.com/rfc3161', '-sigalg', 'SHA1withRSA', '-digestalg', 'SHA1', '-keystore', 'C:\\Users\\GAMER\\Obfuscapk\\src\\obfuscapk\\resources\\obfuscation_keystore.jks', '-storepass', 'obfuscation_password', 'C:\\Users\\GAMER\\Downloads\\apk\\obfuscation_working_dir\\OUT\\obfuscated.apk', 'obfuscation_key']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "C:\Users\GAMER\Obfuscapk\src\obfuscapk\main.py", line 144, in perform_obfuscation
    (obfuscator_name_to_function[obfuscator_name])(obfuscation)
  File "C:\Users\GAMER\Obfuscapk\src\obfuscapk\obfuscators\new_signature\new_signature.py", line 20, in obfuscate
    obfuscation_info.sign_obfuscated_apk()
  File "C:\Users\GAMER\Obfuscapk\src\obfuscapk\obfuscation.py", line 538, in sign_obfuscated_apk
    jarsigner.resign(
  File "C:\Users\GAMER\Obfuscapk\src\obfuscapk\tool.py", line 305, in resign
    return self.sign(
  File "C:\Users\GAMER\Obfuscapk\src\obfuscapk\tool.py", line 244, in sign
    output = subprocess.check_output(sign_cmd, stderr=subprocess.STDOUT).strip()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\\Program Files\\Java\\jdk1.8.0_221\\bin\\jarsigner.exe', '-tsa', 'http://timestamp.comodoca.com/rfc3161', '-sigalg', 'SHA1withRSA', '-digestalg', 'SHA1', '-keystore', 'C:\\Users\\GAMER\\Obfuscapk\\src\\obfuscapk\\resources\\obfuscation_keystore.jks', '-storepass', 'obfuscation_password', 'C:\\Users\\GAMER\\Downloads\\apk\\obfuscation_working_dir\\OUT\\obfuscated.apk', 'obfuscation_key']' returned non-zero exit status 1.
Running obfuscators (NewSignature):  67%|█████████████████████████████▎              |[04:01<02:00, 120.92s/obfuscator]
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\GAMER\Obfuscapk\src\obfuscapk\cli.py", line 177, in <module>
    main()
  File "C:\Users\GAMER\Obfuscapk\src\obfuscapk\cli.py", line 161, in main
    perform_obfuscation(
  File "C:\Users\GAMER\Obfuscapk\src\obfuscapk\main.py", line 144, in perform_obfuscation
    (obfuscator_name_to_function[obfuscator_name])(obfuscation)
  File "C:\Users\GAMER\Obfuscapk\src\obfuscapk\obfuscators\new_signature\new_signature.py", line 20, in obfuscate
    obfuscation_info.sign_obfuscated_apk()
  File "C:\Users\GAMER\Obfuscapk\src\obfuscapk\obfuscation.py", line 538, in sign_obfuscated_apk
    jarsigner.resign(
  File "C:\Users\GAMER\Obfuscapk\src\obfuscapk\tool.py", line 305, in resign
    return self.sign(
  File "C:\Users\GAMER\Obfuscapk\src\obfuscapk\tool.py", line 244, in sign
    output = subprocess.check_output(sign_cmd, stderr=subprocess.STDOUT).strip()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\\Program Files\\Java\\jdk1.8.0_221\\bin\\jarsigner.exe', '-tsa', 'http://timestamp.comodoca.com/rfc3161', '-sigalg', 'SHA1withRSA', '-digestalg', 'SHA1', '-keystore', 'C:\\Users\\GAMER\\Obfuscapk\\src\\obfuscapk\\resources\\obfuscation_keystore.jks', '-storepass', 'obfuscation_password', 'C:\\Users\\GAMER\\Downloads\\apk\\obfuscation_working_dir\\OUT\\obfuscated.apk', 'obfuscation_key']' returned non-zero exit status 1.
ClaudiuGeorgiu commented 4 years ago

java.net.UnknownHostException: timestamp.comodoca.com is very strange, maybe it was only a temporary error. Are you able to navigate to http://timestamp.comodoca.com? If you are able to open the site but the error still persists the there is something wrong with your version of jarsigner.

ImanCol commented 4 years ago

I know it's a lot to ask, but can you share how you have the system / patch variables configured? Try both as the guide and my own method. According to the guide it says to create three variables that are called:

APKTOOL_PATH image

JARSIGNER_PATH image

ZIPALIGN_PATH image

Also put the files in System32, although Ofuscapk did not give me an error except for jarsigner, in the commands it told me that it could not find the files, although Ofuscapk did find them.

Could you provide the Hash ?. These are the SHA-1 files with CRC-SHA 7zip

Nombre: apktool.bat Tamaño: 1103 bytes (1 KiB) SHA1: 4215A05ADAE55C3A26E7614E1EAFD07CFBA8177F

Nombre: apktool.jar Tamaño: 17661172 bytes (16 MiB) SHA1: 36DF33B49F5B70A6A9EA464BD8D9FC340CE1F617

Nombre: jarsigner.exe Tamaño: 15824 bytes (15 KiB) SHA1: 5BC213D31EB297BB71FBD62224547BB1A9991963

Nombre: zipalign.exe Tamaño: 744960 bytes (727 KiB) SHA1: F140842B93736329AEDF21D02C9DF093C5480550

I have used different APKs and they have the same problem.

I have also presented errors when using the obfuscation commands after the -o But then I share more information.

ImanCol commented 4 years ago

image I used these variables in PATCH so that the cmd would recognize me