欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

工欲善其事,必先利其器之—Android 反编译利器-classyshark

程序员文章站 2022-07-12 19:47:24
...

介绍

工欲善其事,必先利其器之—Android 反编译利器-classyshark
Android-classyshark,Google出口必属精品,你值得拥有!
classyshark的优点:
* 直接打开并反编译dex、apk、jar、arr
* 图形化操作,方便查看各类文件信息,方法类占比情况等
* 支持代码的增量搜索

安装

直接下载jar包,放在本地目录。我的习惯是放在如下本地目录(home/dev_tool/),并设置相关的快捷访问方式(注 意要 : chmod +x ClassyShark.jar)

# 在.bash_profile添加如下alias
alias classyshark='{HOME}/dev_tool/ClassyShark.jar'

使用

示例:使用classyshark官中窥豹Bilibili APP

帮助

先看看帮忙说明

aaa@qq.com Downloads$ classyshark -h
missing command line arguments


Usage: java -jar ClassyShark.jar [-options] <archive> [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 ClassyShark
where args is an optional classname

实践

打开apk

aaa@qq.com Downloads$ classyshark -open iBiliPlayer-bili.apk

工欲善其事,必先利其器之—Android 反编译利器-classyshark

工欲善其事,必先利其器之—Android 反编译利器-classyshark

工欲善其事,必先利其器之—Android 反编译利器-classyshark

工欲善其事,必先利其器之—Android 反编译利器-classyshark

工欲善其事,必先利其器之—Android 反编译利器-classyshark

导出分析文件

aaa@qq.com Downloads$ classyshark -export iBiliPlayer-bili.apk
method_counts.txt
Parsing classes.dex
Parsing classes2.dex
Parsing classes3.dex
Parsing 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

列出方法数

aaa@qq.com temp$ classyshark -methodcounts
iBiliPlayer-bili.apk

端终上输出method_counts.txt的内容

简要的分析

输出App的dex情况和使用的主要组件

aaa@qq.com 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                                   |
|                   |                                                                                                                                    |
+-------------------+------------------------------------------------------------------------------------------------------------------------------------+
相关标签: android classyshark