LoginSignup
6
4

More than 5 years have passed since last update.

dex2jar を buildして、新しめのandroid のclasses.dex で利用する

Posted at

Overview

新しめのclasses.dexは.dex IRが変更になっているため?(Java8対応か?)dex2jar-2.1とかでは例外を吐いて動作しない。

しかし、数ヶ月前にdex2jarに対応commitが入ったので、buildして利用します。

dex2jarの取得

$ cd ~/work
$ git clone https://github.com/pxb1988/dex2jar.git

もし、proxy環境下であれば、

~/.gradle/gradle.properties
systemProp.http.proxyHost=proxy.hoge.com
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=****
systemProp.http.proxyPassword=****
systemProp.https.proxyHost=proxy.hoge.com
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=****
systemProp.https.proxyPassword=****

build

なお、2017/11/1現在では、

dx:23.0.0 でエラーが出るので、削除してください ( //行を削除 or // で comment out )

~/work/dex2jar/dex-tools/build.gradle
mainClassName="com.googlecode.dex2jar.tools.BaseCmd"

dependencies {
  compile project(':dex-translator')
  compile project(':d2j-smali')
  compile project(':d2j-jasmin')
  compile project(':dex-writer')
  compile project(':d2j-base-cmd')
//  compile "com.google.android.tools:dx:23.0.0"
}
$ cd ~/work/dex2jar
$ gradle clean distZip

~/work/dex2jar/dex-tools/build/distributions/dex-tools-2.1-SNAPSHOT みたいなところに、build結果が出ます。

6
4
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
6
4