Closed diabitogoaway closed 9 months ago
Hi, thanks for the detailed report! From the logs, it looks like apktool
fails when invoked from Obfuscapk, but you wrote that it works when you use apktool
directly. Can you please provide the exact command that you are using with Docker and it's generating the error?
Hello @ClaudiuGeorgiu > Thank you so much for replying I didn't expected HAHA
So here are my commands that I get the same error:
With docker: docker run --rm -it -u $(id -u):$(id -g) -v "${PWD}":"/workdir" obfuscapk -o RandomManifest -o Rebuild -o NewAlignment -o NewSignature original.apk With docker without RandomManifest: docker run --rm -it -u $(id -u):$(id -g) -v "${PWD}":"/workdir" obfuscapk -o Rebuild -o NewAlignment -o NewSignature original.apk Using python (I installed the tool using python before using docker and got the same error but It might be helpful for you to help me: python3 -m obfuscapk.cli -o RandomManifest -o Rebuild -o NewAlignment -o NewSignature -p --use-aapt2 -w obfuscated/apktool/ -d obfuscated/obfuscated.apk original.apk
I just tried with the latest Docker image and this apk mentioned in your message and I got no error, so I guess there's something wrong with your apk file.
docker run --rm -it -u $(id -u):$(id -g) -v "${PWD}":"/workdir" -e LOG_LEVEL=DEBUG claudiugeorgiu/obfuscapk -o RandomManifest -o Rebuild -o NewAlignment -o NewSignature original.apk
02/02/2023 13:25:17> [DEBUG][obfuscapk.main][check_external_tool_dependencies()] Checking external tool dependencies
02/02/2023 13:25:17> [DEBUG][obfuscapk.main][check_external_tool_dependencies()] Checking external tool dependencies
02/02/2023 13:25:17> [DEBUG][obfuscapk.obfuscation][__init__()] Auto-generated random secret key for encryption: "4CCL2SkRT91RVZcpvHWGJxLuoeDQiR0l"
02/02/2023 13:25:17> [DEBUG][obfuscapk.obfuscation][__init__()] No working directory provided, the operations will take place in the same directory as the input file, in the directory "obfuscation_working_dir"
02/02/2023 13:25:17> [DEBUG][obfuscapk.obfuscation][__init__()] No obfuscated apk path provided, the result will be saved as "obfuscation_working_dir/original_obfuscated.apk"
02/02/2023 13:25:17> [INFO][yapsy_loaded_plugin_RandomManifest_1.random_manifest.RandomManifest][obfuscate()] Running "RandomManifest" obfuscator
02/02/2023 13:25:17> [INFO][obfuscapk.tool.Apktool][decode()] Running decode command "/usr/local/bin/apktool --frame-path /tmp d --force original.apk -o obfuscation_working_dir/original"
02/02/2023 13:25:21> [INFO][yapsy_loaded_plugin_Rebuild_1.rebuild.Rebuild][obfuscate()] Running "Rebuild" obfuscator
02/02/2023 13:25:21> [INFO][obfuscapk.tool.Apktool][build()] Running build command "/usr/local/bin/apktool --frame-path /tmp b --force-all obfuscation_working_dir/original -o obfuscation_working_dir/original_obfuscated.apk"
02/02/2023 13:25:38> [INFO][yapsy_loaded_plugin_NewAlignment_1.new_alignment.NewAlignment][obfuscate()] Running "NewAlignment" obfuscator
02/02/2023 13:25:38> [INFO][obfuscapk.tool.Zipalign][align()] Running align command "/android-sdk-linux/build-tools/33.0.0/zipalign -p -v -f 4 obfuscation_working_dir/original_obfuscated.copy.apk obfuscation_working_dir/original_obfuscated.apk"
02/02/2023 13:25:38> [INFO][yapsy_loaded_plugin_NewSignature_1.new_signature.NewSignature][obfuscate()] Running "NewSignature" obfuscator
02/02/2023 13:25:38> [INFO][obfuscapk.tool.ApkSigner][resign()] Removing current signature from apk "obfuscation_working_dir/original_obfuscated.apk"
02/02/2023 13:25:39> [INFO][obfuscapk.tool.ApkSigner][sign()] Running sign command "/android-sdk-linux/build-tools/33.0.0/apksigner sign -v --ks /Obfuscapk/obfuscapk/resources/obfuscation_keystore.jks --ks-key-alias obfuscation_key --ks-pass pass:obfuscation_password obfuscation_working_dir/original_obfuscated.apk"
@ClaudiuGeorgiu Could you please tell me these so I try it too? Version of docker? Version of apktool? version of zipalign? OS and version of OS? and other tools being used?
Os: Ubuntu 22.04.1 LTS
Docker: 20.10.22, build 3a2c30b
All the other tools are those inside the latest Docker image.
@ClaudiuGeorgiu I still get the same error When you tried did you try it on the apk file that I provided? Because I tried on many versions of the tools and also different type of OS But still get the same error If the problem is with the apk how can I fix it? Because I used any type of decompiler and could be able to decompile the apk
When you tried did you try it on the apk file that I provided?
Yes.
There is a similar issue in Apktool's repository: https://github.com/iBotPeaches/Apktool/issues/2173. The problem seems to be that the apk file is corrupted, maybe try downloading it again or try with other apk files to see if you still get the same error. I never had this error and I can't replicate, sorry.
Prerequisites
Before opening this issue, I tried the following steps:
[x] Installed the tool in a way described in the readme and ran
python3 -m obfuscapk.cli --help
without any errors[x] Ran the tool using:
python3 -m obfuscapk.cli -o Rebuild -o NewAlignment -o NewSignature original.apk
to verify that the app is not using anti-repackaging techniques[x] Ran the tool using
--ignore-libs
flag to exclude third party libraries from the obfuscation[x] Checked FAQ and troubleshooting
[x] Checked for existing similar issues on GitHub
Description
I have these errors all the time and I'm guessing It's because of apktool or my app
Steps to reproduce
Expected behavior:
Actual behavior:
Versions
Additional information
This is the app that I'm using: app
Apk file(s):