
Static analysis tool for Android APKs that inspects Dalvik bytecode, decodes XML resources, and detects potential issues. Supports binary modification, repackaging, and logcat verification.
Copyright (C) 2012 Sony Mobile Communications AB
このファイルは ApkAnalyser の一部です。
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
==============================================================================
ApkAnalyser は、Android アプリの開発作業を検証・妥当性確認するための静的仮想解析ツールです。バイナリアプリケーションに追加の出力を埋め込む変更をサポートする完全なツールチェーンです。再パッケージ、インストール、実行、そして logcat からの結果確認が可能です。また、リソース解析もサポートしており、XML のデコード、リソース参照の検索、アプリ内の潜在的な問題の検出が行えます。
これはスタンドアロンの J2SE アプリケーションで、Apache 2.0 ライセンスのもとで公開されており、100% Java で記述されています。
以下の OSS プロジェクトのコードの一部をインポートし、修正しています。
以下の OSS プロジェクトを jar ライブラリとして使用しています。
まず、最新の ApkAnalyser は以下から入手できます。
https://github.com/sonyxperiadev/ApkAnalyser
ApkAnalyser には smali と apktool の 2 つのオープンソースプロジェクトが含まれています。 これらのプロジェクトは以下の順序でビルドする必要があります。
すべてのプロジェクトは Maven2 ビルドシステムで管理されています。
http://maven.apache.org/download.html
このプロジェクトは JDK1.5、1.6、または 1.7 でビルドできます。
最新のコードを取得 git clone git://github.com/sonyxperiadev/ApkAnalyser.git
smali プロジェクトをビルド cd smali mvn install
apktool プロジェクトをビルド cd ../apktool mvn install
jgraphx をローカル Maven リポジトリにインストール cd ../apkanalyser mvn install:install-file -Dfile=lib/jgraphx.jar -DgroupId=com.mxgraph -DartifactId=jgraphx -Dversion=1.7.1.9 -Dpackaging=jar -DgeneratePom=true
ApkAnalyser をビルド・パッケージング mvn assembly:assembly
実行可能 jar ファイルは以下の場所に生成されます apkanalyser\target\apkanalyser-{version}-exec.jar
必要に応じて、"mvn eclipse:eclipse" コマンドで Eclipse プロジェクトを生成することもできます。
起動するには、次のコマンドを実行します。
java -jar ApkAnalyser.jar
ApkAnalyser は dalvik バイトコードの解析に大量のメモリを消費することがあります。特に、大きな odex された APK ファイルを複数読み込むとメモリ不足になる可能性があります。その場合は、"-Xmx1024m" パラメータで最大ヒープサイズを明示的に増やしてください。
java -Xmx1024m -jar ApkAnalyser.jar
Zhang Bojie、Sony Mobile Communications [email protected]