dana-at-cp / backdoor-apk

backdoor-apk is a shell script that simplifies the process of adding a backdoor to any Android APK file. Users of this shell script should have working knowledge of Linux, Bash, Metasploit, Apktool, the Android SDK, smali, etc. This shell script is provided as-is without warranty of any kind and is intended for educational purposes only.
Apache License 2.0
2.17k stars 699 forks source link

Failed to recompile original project with backdoor #176

Closed majid-d closed 1 year ago

majid-d commented 4 years ago

"Failed to recompile original project with backdoor" Stuck at this process, i have tried with other .apk files but no success using Parrot OS the latest version on virtual box am i the only one confronting with this issue ?

yeguangxiadedaya commented 4 years ago

hello,i had the same issue with that process?,i don't know how to do ,please tell me if you knew already.thanks

sindikto commented 4 years ago

oh my friend, no I am with this problem too, I've kali 19 roling and probe diferent options and nothing to do if you know how do it please write me, thanks.

Alexandre-ux commented 4 years ago

Devem instalar zipalign. sudo apt-get install zipalign

frostKn commented 4 years ago

Devem instalar zipalign. sudo apt-get install zipalign

that doesn't solve the problem for me .... normal decompile and recompile works just fine I tried changing the apktools.jar zipalign is installed installed lib32ncurses5 changed to java 8 no luck yet.


this is the run.log error


invoke-static {}, Lcom/snaptube/premium/gjqzy/Jlwfr;->start()V The smali file was hooked successfully

I: Using Apktool 2.4.1 I: Checking whether sources has changed... I: Smaling smali folder into classes.dex... Exception in thread "main" org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method Landroid/support/v4/util/LongSparseArray;->clone()Landroid/support/v4/util/LongSparseArray; at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:917) at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:341) at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:297) at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:61) at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:36) at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:418) at brut.androlib.Androlib.buildSources(Androlib.java:349) at brut.androlib.Androlib.build(Androlib.java:301) at brut.androlib.Androlib.build(Androlib.java:268) at brut.apktool.Main.cmdBuild(Main.java:251) at brut.apktool.Main.main(Main.java:79) Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x13 at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1190) at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:913) ... 10 more Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65537 at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116) at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:356) at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1150) ... 11 more

Forcing cleanup due to a failure or error state!

frostKn commented 4 years ago

Alright here is how I fixed the error : first, check if these r installed

ib32z1 lib32ncurses5 lib32stdc++6

then,

apt-get purge apktool

and now we will install it manually go to https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool and copy everything to a blank file and name it apktool

now give it permissions by

chmod +x apktool

download the latest apktool from here https://bitbucket.org/iBotPeaches/apktool/downloads/ and rename it apktool.jar

give it permissions

chmod +x apktool.jar

now move both of them to /usr/local/bin

sudo mv apktool /usr/local/bin && sudo mv apktool.jar /usr/local/bin

now apktool in terminal and see if it works.

i am using java11 with no issues but if r still having problems try changing it to java8 by

update-alternatives --config java

ghost commented 3 years ago

chmod +x apktool_2.4.1.jar

dana-at-cp commented 1 year ago

Always use the latest version of Apktool.