TheZ3ro / apk2java-linux

Decompile apk and get java or smali source
84 stars 31 forks source link

invalid file (bad magic number): Exec format error #3

Closed filipproch closed 9 years ago

filipproch commented 9 years ago

This is what I get when I try to use your utility (I am on Linux Mint 17)

python3 apk2java.py d cz.pilsfree.iptv-1.apk 
cp: nelze vytvořit obyčejný soubor „/tmp/apk2java/cz.pilsfree.iptv-1-new.apk“: Adresář nebo soubor neexistuje
*********************************************
**      Extract, fix resource files        **
*********************************************
/bin/sh: 1: /opt/apk2java/tool/apktool_200rc3.jar: Permission denied
mv: nelze získat informace o „/tmp/apk2java/cz.pilsfree.iptv-1/classes.dex“: Adresář nebo soubor neexistuje
Done
*********************************************
**          Convert 'apk' to 'jar'         **
*********************************************
dex2jar cz.pilsfree.iptv-1.apk -> /tmp/apk2java/cz.pilsfree.iptv-1.jar
verify /tmp/apk2java/cz.pilsfree.iptv-1.jar
Done
*********************************************
**        Decompiling class files          **
*********************************************
invalid file (bad magic number): Exec format error
Done
TheZ3ro commented 9 years ago

Can you post the output of this command? ls -al /opt/apk2java/tool

Thanks


Edit: I think that you don't have write permission on /opt/apk2java folder

filipproch commented 9 years ago
drwxr-xr-x 3 toor root    4096 úno 17 14:03 .
drwxr-xr-x 3 toor root    4096 úno 17 13:59 ..
-r--r--r-- 1 toor root    9193 úno 17 13:59 apktool_LICENSE.txt
-rw-r----- 1 toor toor 6241096 úno 17 13:47 apktool_200rc3.jar
drwxr-xr-x 3 toor root    4096 úno 17 13:59 dex2jar-0.0.9.15
-r-xr--r-x 1 toor root 1761244 úno 17 13:59 procyon-decompiler-0528.jar
-r--r--r-- 1 toor root    9193 úno 17 13:59 procyon_LICENSE.txt
-r--r--r-- 1 toor root   27864 úno 17 13:59 sample.apk

Edit: I have write permission as when I create the folders manually

TheZ3ro commented 9 years ago

apktool_200rc3.jar don't have execution permission, please execute: chmod +x /opt/apk2java/tool/apktool_200rc3.jar with root privilege

Maybe in the tool.zip apktool_200rc3.jar have wrong permission

filipproch commented 9 years ago

Thanks, it works now

TheZ3ro commented 9 years ago

No problem :)

kartikagarwal799 commented 2 years ago

Hello, Team I'm facing the same issue.

[root@c3514-node2 uploads]# chmod 777 simpleApp.jar [root@c3514-node2 uploads]# ./simpleApp.jar invalid file (bad magic number): Exec format error