7
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MACでapkファイルをjavaのソースコードへ逆コンパイルする方法

Last updated at Posted at 2018-08-05

CTFのrev問題でapkファイルを渡された場合、javaのソースコードへ逆コンパイルする必要がある。

dex2jarjad を使う。

.apk -> .dex -> .jar -> .class -> .jad という流れ。

.jad ファイルを開けばjava のソースコードが見れる。

参考:

0. dex2jar, jad のインストール

dex2jar

brewを使う。

パスを通す必要あり。

brew install dex2jar

echo 'export PATH="$PATH:/usr/local/Cellar/dex2jar/2.0/bin"' >> ~/.bash_profile
source ~/.bash_profile

jad

brew cask を使う。

brew tap caskroom/cask
brew install caskroom/cask/jad

1. apk -> dex

unzip hoge.apk

2. dex -> jar

d2j-dex2jar hoge.dex

3. jar -> class

jar xf hoge.jar 

4. class -> jad

jad -r path/hoge.class 
7
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?