GithubHelp home page GithubHelp logo

laurenceyang / tinker-dex-dump Goto Github PK

View Code? Open in Web Editor NEW
115.0 7.0 15.0 698 KB

用来查看tinker生成的dexdiff格式内容工具,收录于微信tinker官方wiki

Home Page: https://github.com/LaurenceYang/tinker-dex-dump

Java 100.00%
tinker dexdiff hotfix dexdump

tinker-dex-dump's Introduction

tinker-dex-dump

序言

Tinker是微信推出的热更新开源项目,同其它热更新方案相比具有补丁包小,支持类,so,资源文件的替换等优点。其中在类替换的方案里自主研发了DexDiff算法,使得补丁包变的更小。DexDiff算法最终生成的产物虽然也以.dex作为格式后缀,但和实际虚拟机中的dex文件是二种完全不同的格式。  

关于tinker-dex-dump

  tinker-dex-dump是针对dexdiff生成的.dex格式文件,查看其内部数据的工具。主要目的是帮助大家对dexdiff生成的dex格式有一个更加直观的了解。如果使用该工具能让你更容易了解tinker相关原理,那该工具的目的也就达到了,也算是个人对Tinker的致敬。  

tinker-dex-dump的使用方法  

1、首先下载tinker-dex-dump.jar文件

下载地址

2、通过命令行方式执行  

命令格式

java -jar tinker-dex-dump.jar --dex *.dex [--header] [--section section-name]

--dex           必选项,后接需要dump的dex路径  

--header      可选项,显示header区域信息

--section      可选项,显示section区域信息,后接要显示的section名字  

--section参数列表,参数的意义同其命名

  • StringData
  • TypeId
  • ProtoId
  • FieldId
  • MethodId
  • ClassDef
  • TypeList
  • AnnotationSetRefList
  • AnnotationSet
  • ClassData
  • Code
  • DebugInfo
  • Annotation
  • StaticValue
  • AnnotationsDirectory

范例一:显示头部信息  

java -jar tinker-dex-dump.jar --dex classes.dex --header

显示头部信息

范例二:显示StringData区域信息  

java -jar tinker-dex-dump.jar --dex classes.dex --section StringData

显示section信息

范例三:显示帮助信息  

java -jar tinker-dex-dump.jar --help

显示帮助信息

tinker dex格式参考

tinker dex格式主要包括两大部分:头部和各个section区域的操作列表,如下图: tinker dex format

更多关于tinker dex格式可以参考Tinker项目的DexPatchGenerator文件

TODO  

1、复杂区域如ClassData等的表现形式  

也欢迎大家多多提出意见

参考  

Tinker官方Github  

Tinker官方Wiki  

热更新相关文档

More...>>>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.