Coder Social home page Coder Social logo

andfix's Introduction

AndFix

Download Build Status Software License

Gitter

AndFix is a library that offer hot-fix for Android App. It could help Android developer to fix App bugs online. Andfix is an acronym for "Android hot-fix".

AndFix supports Android 2.3 to 6.0, arm and x86 architecture, dalvik runtime and art runtime.

AndFix's patch is .apatch file.

Principle

The implementation principle of AndFix is method's body replace :

image

bug fix process:

image

Integration

How to get?

  1. directly add AndFix aar to your project as compile libraries.

  2. maven dependency:

    <dependency>
    	<groupId>com.alipay.euler</groupId>
    	<artifactId>andfix</artifactId>
    	<version>0.3.0</version>
    	<type>aar</type>
    </dependency>
    

or gradle dependency:

```
dependencies {
	compile 'com.alipay.euler:andfix:0.3.0@aar'
}
```

How to use?

  1. initialize PatchManager:

    patchManager = new PatchManager(context);
    patchManager.init(appversion);//current version
    
  2. load patch. load patch as early as possible, generally, at the initialization phase of your app (such as application.oncreate()):

    patchManager.loadPatch();
    
  3. add patch. when new patch file has be downloaded,the patch will become effective immediately by add.

    patchManager.addPatch(path);//path of the patch file that be downloaded
    

ProGuard

To ensure that these classes can be found after running an obfuscation and static analysis tool like ProGuard add the configuration below to your ProGuard configuration file.

  • native method

    com.euler.cloudfix.CloudFix

  • annotation

    com.euler.cloudfix.annotation.MethodReplace

     -keep class * extends java.lang.annotation.Annotation
     -keepclasseswithmembernames class * {
     	native <methods>;
     }
    

Developer Tool

The patch make tool is apkpatch.

How to get?

Apkpatch can be found here

How to use?

  • generate .apatch file:
usage: apkpatch -f <new> -t <old> -o <output> -k <keystore> -p <***> -a <alias> -e <***>
 -a,--alias <alias>     alias.
 -e,--epassword <***>   entry password.
 -f,--from <loc>        new Apk file path.
 -k,--keystore <loc>    keystore path.
 -n,--name <name>       patch name.
 -o,--out <dir>         output dir.
 -p,--kpassword <***>   keystore password.
 -t,--to <loc>          old Apk file path.
  • merge .apatch files:
usage: apkpatch -m <apatch_path...> -k <keystore> -p <***> -a <alias> -e <***>
 -a,--alias <alias>     alias.
 -e,--epassword <***>   entry password.
 -k,--keystore <loc>    keystore path.
 -m,--merge <loc...>    path of .apatch files.
 -n,--name <name>       patch name.
 -o,--out <dir>         output dir.
 -p,--kpassword <***>   keystore password.

Running sample

  1. import samples/AndFixDemo to your IDE, set AndFixDemo depend on AndFix(library project or aar).
  2. build project, save the package as 1.apk, and then install on device/emulator.
  3. modify com.euler.test.A, references com.euler.test.Fix.
  4. build project, save the package as 2.apk.
  5. use apkpatch to make a patch.
  6. rename the patch file to out.apatch, and then copy it onto sdcard.
  7. run 1.apk,view logcat.

API Documentation

The libraries javadoc can be found here

Contact

...

License

Apache License, Version 2.0

Copyright (c) 2015, alipay.com

andfix's People

Contributors

supern avatar

Watchers

 avatar  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.