Giter VIP home page Giter VIP logo

classpatch's Introduction

ClassPatch

第一、原理介绍

相关原理请参考:http://blog.csdn.net/xwl198937/article/details/49801975

第二、生成patch apk

 1、将改动的java文件编译生成class文件。
 2、将所有的class文件放进/ClassPatch/classes/目录下面,
 3、执行sample生成classes.dex文件在/ClassPatch/classes/
 4、随便找一个apk,重命名为.zip文件,将刚刚生成的clases.dex文件放进去,在重命名为.apk
 5、将apk放进data/data/app-packageName/patch目录下。(具体参考sample中的复制按钮选项)
 6、重启app后,patch才能生效
 或者你使用tool目录下面的工具生成patch apk(这个是阿里巴巴andfix开源中的patch生成器)(这个还是有点问题)之后我会自己弄一个出来。包括资源,混淆,dex等等

第三、说明

1、由于现在还在完善中,后期考虑加入patch实时生效的能力,还有替换布局的能力。具体参考我的另一个博客:http://blog.csdn.net/xwl198937/article/details/50134861
2、目录下面的patch是已经生成的patch apk,可以直接用,将其放进sdcard中,并重命名为ClassPatch
3、so hook 是正在研究的项目,有兴趣的可以一起讨论一下。sample中so替换功能是不能实现的。
4、现在已经基本实现dalvik系统中patch实时生效的能力。原理是在proxyDvmResolveClass增加标识,不选择从dvmDexGetResolvedClass获取class。

classpatch's People

Contributors

xwl198937 avatar jarlene avatar

Watchers

James Cloos avatar  avatar

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.