本文共 4099 字,大约阅读时间需要 13 分钟。
直接下载,放在本地目录。我的习惯是放在如下本地目录(home/dev_tool/),并设置相关的快捷访问方式(注 意要 : chmod +x ClassyShark.jar)
# 在.bash_profile添加如下aliasalias classyshark='java -jar ${HOME}/dev_tool/jars/ClassyShark.jar'
示例:使用classyshark官中窥豹Bilibili APP
先看看帮忙说明
luogw@luogw-MacBook-Pro Downloads$ classyshark -hmissing command line argumentsUsage: java -jar ClassyShark.jar [-options][args...] (to execute a ClassyShark on binary archive jar/apk/dex/class)where options include: -open open an archive with GUI -export export to file -methodcounts packages with method counts -inspect experimental prints apk analysis -update updates ClassySharkwhere args is an optional classname
luogw@luogw-MacBook-Pro Downloads$ classyshark -open iBiliPlayer-bili.apk
luogw@luogw-MacBook-Pro Downloads$ classyshark -export iBiliPlayer-bili.apkmethod_counts.txtParsing classes.dexParsing classes2.dexParsing classes3.dexParsing classes4.dex
输出的文件如下
-rw-r--r-- 1 luogw staff 102710 6 15 11:06 AndroidManifest.xml_dump-rw-r--r-- 1 luogw staff 981951 6 15 11:06 all_classes.txt-rw-r--r-- 1 luogw staff 7284500 6 15 11:06 all_methods.txt-rw-r--r-- 1 luogw staff 6534696 6 15 11:06 all_strings.txt-rw-r--r-- 1 luogw staff 982666 6 15 11:06 method_counts.txt
luogw@luogw-MacBook-Pro temp$ classyshark -methodcounts
iBiliPlayer-bili.apk
端终上输出method_counts.txt的内容
输出App的dex情况和使用的主要组件
uogw@luogw-MacBook-Pro temp$ classyshark -inspect iBiliPlayer-bili.apk ~ APK DASHBOARD ~+-------------------+------------------------------------------------------------------------------------------------------------------------------------+| Recommendation | Description |+-------------------+------------------------------------------------------------------------------------------------------------------------------------+| | || classes.dex | 65241 methods || classes2.dex | 64840 methods || classes3.dex | 65053 methods || classes4.dex | 37920 methods || | || Java | Duplicate image loading libraries - picasso fresco || | || System Broadcast | android.intent.action.DOWNLOAD_COMPLETE ==> com.bilibili.ad.adview.web.apkdownload.ApkMgr$ApkDownloadReceiver || System Broadcast | android.intent.action.MEDIA_BUTTON ==> tv.danmaku.biliplayer.features.headset.HeadsetControlPlayAdapter$HeadsetMediaButtonReceiver || System Broadcast | android.net.conn.CONNECTIVITY_CHANGE ==> com.xiaomi.push.service.receivers.NetworkStatusReceiver || | |+-------------------+------------------------------------------------------------------------------------------------------------------------------------+