TheZ3ro / apk2java-linux

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

Runtime Error #13

Closed MarcinMoskala closed 6 years ago

MarcinMoskala commented 7 years ago

I started on Ubuntu, and I get follwing error:

marcin@marcin-comp:~/Projects$ python3 apk2java.py d MakeMeBetter.apk 
Running: cp MakeMeBetter.apk /home/marcin/Projects/makemebetter-new.apk
*********************************************
**       Extract, fix resource files       **
*********************************************
Running: /home/marcin/Projects/apk2java/tool/apktool_200rc3.jar d MakeMeBetter.apk -o /home/marcin/Projects/makemebetter -f
Traceback (most recent call last):
  File "apk2java.py", line 213, in <module>
    main()
  File "apk2java.py", line 185, in main
    apktool(options.smali)
  File "apk2java.py", line 85, in apktool
    call(cmd)
  File "apk2java.py", line 14, in call
    return subprocess.call(cmd, **kwargs)
  File "/usr/lib/python3.5/subprocess.py", line 557, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
OSError: [Errno 8] Exec format error

The same with normal python:

marcin@marcin-comp:~/Projects$ ./apk2java.py d MakeMeBetter.apk 
Running: cp MakeMeBetter.apk /home/marcin/Projects/makemebetter-new.apk
*********************************************
**       Extract, fix resource files       **
*********************************************
Running: /home/marcin/Projects/apk2java/tool/apktool_200rc3.jar d MakeMeBetter.apk -o /home/marcin/Projects/makemebetter -f
Traceback (most recent call last):
  File "./apk2java.py", line 213, in <module>
    main()
  File "./apk2java.py", line 185, in main
    apktool(options.smali)
  File "./apk2java.py", line 85, in apktool
    call(cmd)
  File "./apk2java.py", line 14, in call
    return subprocess.call(cmd, **kwargs)
  File "/usr/lib/python3.5/subprocess.py", line 557, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
OSError: [Errno 8] Exec format error
TheZ3ro commented 7 years ago

Can you try this command? /home/marcin/Projects/apk2java/tool/apktool_200rc3.jar d MakeMeBetter.apk -o /home/marcin/Projects/makemebetter -f

MarcinMoskala commented 7 years ago
/home/marcin/Projects/apk2java/tool/apktool_200rc3.jar d MakeMeBetter.apk -o /home/marcin/Projects/makemebetter -f
bash: /home/marcin/Projects/apk2java/tool/apktool_200rc3.jar: cannot execute binary file: Exec format error
TheZ3ro commented 7 years ago

Have you java installed? Try to execute chmod +x /home/marcin/Projects/apk2java/tool/apktool_200rc3.jar

MarcinMoskala commented 7 years ago
marcin@marcin-comp:~/Projects$ java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.04.2-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
marcin@marcin-comp:~/Projects$ chmod +x /home/marcin/Projects/apk2java/tool/apktool_200rc3.jar
marcin@marcin-comp:~/Projects$ /home/marcin/Projects/apk2java/tool/apktool_200rc3.jar d MakeMeBetter.apk -o /home/marcin/Projects/makemebetter -f
bash: /home/marcin/Projects/apk2java/tool/apktool_200rc3.jar: cannot execute binary file: Exec format error

Maybe it is trying to use ARM architecture binary? Like in this suggestion: https://askubuntu.com/questions/648555/bash-program-cannot-execute-binary-file-exec-format-error

TheZ3ro commented 7 years ago

it's a problem of the java file. I will work on this in the next few days if I have some free time.

You can check out #6 that should works fine.