All Projects → alibaba → Andfix

alibaba / Andfix

Licence: other
AndFix is a library that offer hot-fix for Android App.

Programming Languages

C++
36643 projects - #6 most used programming language
java
68154 projects - #9 most used programming language
c
50402 projects - #5 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to Andfix

Xlua UGUI Demo
A MVC UGUI hot fix demo using Xlua.
Stars: ✭ 16 (-99.77%)
Mutual labels:  hotfix
Ilruntime hotgames
基于ILRuntime的热更新能力实现的可以直接使用的框架,友情赠送C# WebService + WebSocketServer服务器端。
Stars: ✭ 293 (-95.77%)
Mutual labels:  hotfix
Jengine
JEngine是针对Unity开发者设计的开箱即用的框架,封装了强大的功能,小白也能快速上手,轻松制作可以热更新的游戏 | JEngine is a streamlined and easy-to-use framework designed for Unity Programmers which contains powerful features, beginners can start up quickly and making hot update-able games easily
Stars: ✭ 564 (-91.86%)
Mutual labels:  hotfix
KSFramework xlua
KSFramework的xlua分支,已整合xlua和KEngin: https://github.com/mr-kelly/KSFramework/
Stars: ✭ 29 (-99.58%)
Mutual labels:  hotfix
Tinker
Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk.
Stars: ✭ 16,151 (+133.23%)
Mutual labels:  hotfix
Ocrunner
Execute Objective-C patch file generated by ORPatchGenerator. iOS hotfix SDK.
Stars: ✭ 314 (-95.47%)
Mutual labels:  hotfix
symdl
symdl is a simple little tool, its function is very similar to dlsym, with symdl, you can pass any global C function name string, so as to achieve the dynamic call of C function.
Stars: ✭ 49 (-99.29%)
Mutual labels:  hotfix
Aceso
A hotfix library for Android
Stars: ✭ 790 (-88.59%)
Mutual labels:  hotfix
Tinkerpatch Sdk
TinkerPatch SDK
Stars: ✭ 290 (-95.81%)
Mutual labels:  hotfix
Small
A small framework to split app into small parts
Stars: ✭ 5,012 (-27.62%)
Mutual labels:  hotfix
tinkerpatch-easy-sample
无需修改自己App代码,一键接入的Sample
Stars: ✭ 79 (-98.86%)
Mutual labels:  hotfix
CSwift
C Module for Swift, Swift Script and Dynamic Library Call;Swift中直接调用C语言源程序的展示程序
Stars: ✭ 46 (-99.34%)
Mutual labels:  hotfix
Ttpatch
热修复、热更新、JS代码动态下发、动态创建类
Stars: ✭ 372 (-94.63%)
Mutual labels:  hotfix
GeekServer
基于.Netcore的开发效率高,性能强,跨平台,持久化层透明,支持不停服热更新的游戏服务器。Best for your unity game server!
Stars: ✭ 171 (-97.53%)
Mutual labels:  hotfix
Sdkhotfix
在用户规模千万级别的app中验证过,稳定无兼容问题,5分钟让你的SDK拥有热修复能力。A SDK hotfix library with stable verified in tens of millions of users can be accessed in only five minutes.
Stars: ✭ 585 (-91.55%)
Mutual labels:  hotfix
JVMTI Demo
android p jvmti/android studio apply change
Stars: ✭ 46 (-99.34%)
Mutual labels:  hotfix
Knight
Knight is a game framework based on Unity3D engine. It includes a complete assetbundle manager, a c# hotfix module based on ILRuntime, and a UI module based on MVVM, and other basic functions support.
Stars: ✭ 302 (-95.64%)
Mutual labels:  hotfix
Mango
MangoFix is a DSL which syntax is very similar to Objective-C,MangoFix is also an iOS App hotfix SDK. You can use MangoFix method replace any Objective-C method.
Stars: ✭ 847 (-87.77%)
Mutual labels:  hotfix
Tinker Manager
微信tinker补丁管理,后端代码+客户端sdk
Stars: ✭ 670 (-90.32%)
Mutual labels:  hotfix
Robust
Robust is an Android HotFix solution with high compatibility and high stability. Robust can fix bugs immediately without a reboot.
Stars: ✭ 4,125 (-40.43%)
Mutual labels:  hotfix

AndFix

Download Build Status Software License

Gitter

AndFix is a solution to fix the bugs online instead of redistributing Android App. It is distributed as Android Library.

Andfix is an acronym for "Android hot-fix".

AndFix supports Android version from 2.3 to 7.0, both ARM and X86 architecture, both Dalvik and ART runtime, both 32bit and 64bit.

The compressed file format of AndFix's patch is .apatch. It is dispatched from your own server to client to fix your App's bugs.

Principle

The implementation principle of AndFix is method body's replacing,

image

Method replacing

AndFix judges the methods should be replaced by java custom annotation and replaces it by hooking it. AndFix has a native method art_replaceMethod in ART or dalvik_replaceMethod in Dalvik.

For more details, here.

Fix Process

image

Integration

How to get?

Directly add AndFix aar to your project as compile libraries.

For your maven dependency,

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

For your gradle dependency,

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

How to use?

  1. Initialize PatchManager,
patchManager = new PatchManager(context);
patchManager.init(appversion);//current version
  1. Load patch,
patchManager.loadPatch();

You should load patch as early as possible, generally, in the initialization phase of your application(such as Application.onCreate()).

  1. Add patch,
patchManager.addPatch(path);//path of the patch file that was downloaded

When a new patch file has been downloaded, it will become effective immediately by addPatch.

Developer Tool

AndFix provides a patch-making tool called apkpatch.

How to get?

The apkpatch tool can be found here.

How to use?

  • Prepare two android packages, one is the online package, the other one is the package after you fix bugs by coding.

  • Generate .apatch file by providing the two package,

usage: apkpatch -f <new> -t <old> -o <output> -k <keystore> -p <***> -a <alias> -e <***>
 -a,--alias <alias>     keystore entry alias.
 -e,--epassword <***>   keystore 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.

Now you get the application savior, the patch file. Then you need to dispatch it to your client in some way, push or pull.

Sometimes, your team members may fix each other's bugs, and generate not only one .apatch. For this situation, you can merge .apatch files using this tool,

usage: apkpatch -m <apatch_path...> -o <output> -k <keystore> -p <***> -a <alias> -e <***>
 -a,--alias <alias>     keystore entry alias.
 -e,--epassword <***>   keystore 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 samplesI/AndFixDemo to your IDE, append AndFixDemo dependencies with 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 tool to make a patch.
  6. Rename the patch file to out.apatch, and then copy it to sdcard.
  7. Run 1.apk and view log.

Notice

ProGuard

If you enable ProGuard, you must save the mapping.txt, so your new version's build can use it with "-applymapping".

And it is necessary to keep classes as follow,

  • Native method

    com.alipay.euler.andfix.AndFix

  • Annotation

    com.alipay.euler.andfix.annotation.MethodReplace

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.

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

Self-Modifying Code

If you use it, such as Bangcle. To generate patch file, you'd better to use raw apk.

Security

The following is important but out of AndFix's range.

  • verify the signature of patch file
  • verify the fingerprint of optimize file

API Documentation

The libraries javadoc can be found here.

Contact

...

License

Apache License, Version 2.0

Copyright (c) 2015, alipay.com

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].