IT박스

APK에서 .smali 파일 디 컴파일

itboxs 2020. 7. 14. 20:56
반응형

APK에서 .smali 파일 디 컴파일


이 질문에는 이미 답변이 있습니다.

APK 파일의 압축을 풀 수있는 APK Manager다운로드했습니다 .

그러나 압축을 풀고 .smali 파일을 .java로 디 컴파일하지 않습니다.

.smali를 .java로 디 컴파일 할 수 있습니까?


아니요, APK 관리자.dex파일 을 사람이 읽을 수있는 xml .smali, 이진 .xml디 컴파일 합니다 .

패키지를 선택하는 순서는 APK Manager 4.9를 기준으로하는 22 입니다. 그런 다음 패키지를 해제하려면 9 입니다. 9 대신 1을 누르면 압축을 풉니 다 (.png 이미지를 교환하려는 경우에만 유용함).

.java파일로 다시 디 컴파일하는 데 사용할 수있는 도구가 없으며 대부분 도구 가 아닙니다. dex2jar사용 하여 dex 파일을 파일로 변환 .class한 다음 jar 디 컴파일러 (예 : 무료 jd-gui )를 일반 텍스트 java 로 사용하는 대안이 있습니다 . 프로세스는 최적과는 거리가 멀고 작업 코드를 생성하지 않지만 읽을 수있을 정도로 괜찮습니다.

dex2jar : https://github.com/pxb1988/dex2jar

jd-gui : http://jd.benow.ca/

편집 : 여기에 어딘가에 비슷한 답변이있는 질문이 있다는 것을 알았습니다 ... DEX를 Java 소스 코드로 디 컴파일


dex2jar는 apk를 디 컴파일하는 데 도움이되지만 100 %는 아닙니다. .smali 파일에 문제가있을 것입니다. Dex2jar가 Java로 변환 할 수 없습니다. apk 소스 파일을 디 컴파일 할 수 있고 .smali 파일에 문제가없는 응용 프로그램을 알고 있습니다. 여기 링크 http://www.hensence.com/en/smali2java/


새로운 크로스 플랫폼 (java) 및 오픈 소스 도구가 있습니다. https://bytecodeviewer.com을 확인 하십시오.

여기에 이미지 설명을 입력하십시오

=========

편집 : 2017 년 4 월 현재 Google이 개발 한 새로운 오픈 소스 도구가 있습니다.이 도구는 우리가 찾고 있던 것을 수행하기 위해 => https://github.com/google/android-classyshark


My recommendation is Virtuous Ten Studio. The tool is free but they suggest a donation. It combines all the necessary steps (unpacking APK, baksmaliing, decompiling, etc.) into one easy-to-use UI-based import process. Within five minutes you should have Java source code, less than it takes to figure out the command line options of one of the above mentioned tools.

Decompiling smali to Java is an inexact process, especially if the smali artifacts went through an obfuscator. You can find several decompilers on the web but only some of them are still maintained. Some will give you better decompiled code than others. Read "better" as in "more understandable" than others. Don't expect that the reverse-engineered Java code will compile out of the box. Virtuous Ten Studio comes with multiple free Java decompilers built-in so you can easily try out different decompilers (the "Generate Java source" step) to see which one gives you the best results, saving you the time to find those decompilers yourself and figure out how to use them. Amongst them is CFR, which is one of the few free and still maintained decompilers.

As output you receive, amongst other things, a folder structure that contains all the decompiled Java source code. You can then import this into IntelliJ IDEA or Eclipse for further editing, analysis (e.g. Go to definition, Find usages), etc.


I second that.

Dex2jar will generate a WORKING jar, which you can add as your project source, with the xmls you got from apktool.

However, JDGUI generates .java files which have ,more often than not, errors.

It has got something to do with code obfuscation I guess.


For getting the practical view of converting .apk file into .java files just check out https://www.youtube.com/watch?v=-AX4NYE-9V8 video . you will get more benefited and understand clearly. It clearly demonstrates the steps you required if you are using mac OS.

이를 수행하기위한 기본 요구 사항입니다. 1. http://code.google.com/p/dex2jar/
2. http://jd.benow.ca/

참고 URL : https://stackoverflow.com/questions/5582824/decompile-smali-files-on-an-apk

반응형