All Projects → Meituan-Dianping → Robust

Meituan-Dianping / Robust

Licence: apache-2.0
Robust is an Android HotFix solution with high compatibility and high stability. Robust can fix bugs immediately without a reboot.

Programming Languages

java
68154 projects - #9 most used programming language
groovy
2714 projects

Projects that are alternatives of or similar to Robust

Drawablecolorchange
Android Library to dynamically change color of drawable.
Stars: ✭ 101 (-97.55%)
Mutual labels:  gradle, dynamic
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 (-85.82%)
Mutual labels:  hotfix, robust
Fastdex
🚀 加快 apk 的编译速度 🚀
Stars: ✭ 1,457 (-64.68%)
Mutual labels:  gradle, hotfix
Tinker Manager
微信tinker补丁管理,后端代码+客户端sdk
Stars: ✭ 670 (-83.76%)
Mutual labels:  hotfix, robust
Tinker
Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk.
Stars: ✭ 16,151 (+291.54%)
Mutual labels:  hotfix, dynamic
Calces Gradle Plugin
Android构建工具集:包含快速实现组件化构建脚本,快速实现屏幕最小宽度适配脚本
Stars: ✭ 366 (-91.13%)
Mutual labels:  gradle
Gradle Maven Publish Plugin
Gradle plugin that configures an uploadArchives task to automatically upload all of your Java, Kotlin or Android libraries to any Maven instance.
Stars: ✭ 392 (-90.5%)
Mutual labels:  gradle
Gradle Kotlin Dsl Migration Guide
The missing migration guide to the Gradle Kotlin DSL
Stars: ✭ 364 (-91.18%)
Mutual labels:  gradle
Stark
Stark is a hot-fix framework for Android. It supports swapping new implementations of classes without restarting a running Android application, and updated Android resources (icons, layout, etc) while only restarting the Android Activity. Most importantly, there is no private API invoked in Stark.
Stars: ✭ 360 (-91.27%)
Mutual labels:  gradle
Ng Dynamic Component
Dynamic components with full life-cycle support for inputs and outputs for Angular
Stars: ✭ 396 (-90.4%)
Mutual labels:  dynamic
Drawer Behavior
Drawer behavior is a library that provide an extra behavior on drawer, such as, move view or scaling view's height while drawer on slide.
Stars: ✭ 394 (-90.45%)
Mutual labels:  gradle
Pantheon
An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client
Stars: ✭ 383 (-90.72%)
Mutual labels:  gradle
Ttpatch
热修复、热更新、JS代码动态下发、动态创建类
Stars: ✭ 372 (-90.98%)
Mutual labels:  hotfix
Ms Backend Boilerplates
Boilerplate for Your Server Side(Backend) Application, Java | Spring(Boot, Cloud) | Node.js(Express, Koa, Egg) | Go | Python | DevOps 💫 服务端项目模板
Stars: ✭ 394 (-90.45%)
Mutual labels:  gradle
C Cpp Notes
Notes about modern C++, C++11, C++14 and C++17, Boost Libraries, ABI, foreign function interface and reference cards.
Stars: ✭ 363 (-91.2%)
Mutual labels:  dynamic
Dryrun
☁️ Try the demo project of any Android Library
Stars: ✭ 3,845 (-6.79%)
Mutual labels:  gradle
Lion
使用Gradle构建,基于Java 8/11/13、SpringBoot 2.2.6.RELEASE、SpringCloud Hoxton.SR2、Spring Cloud Alibaba 2.2.0.RELEASE、MyBatis Plus 3.3.1等核心技术体系实现的一套支持云原生的分布式微服务架构,提供OAuth2/JWT权限认证、分布式事务、灰度、限流、熔断降级、分布式锁、链路追踪、MQ等功能,支持Docker容器化部署、镜像交付、K8S容器编排
Stars: ✭ 360 (-91.27%)
Mutual labels:  gradle
Dynamic Kg
Dynamic (Temporal) Knowledge Graph Completion (Reasoning)
Stars: ✭ 381 (-90.76%)
Mutual labels:  dynamic
Grassbending
A replacement for Unity's terrain grass shader with alpha blended rendering and touch bending effect
Stars: ✭ 397 (-90.38%)
Mutual labels:  dynamic
Retrofit2demo
Stars: ✭ 378 (-90.84%)
Mutual labels:  gradle

Robust

Download PRs Welcome License

Robust is an Android HotFix solution with high compatibility and high stability. Robust can fix bugs immediately without publishing apk.

中文说明

More help on Wiki

Environment

  • Mac Linux and Windows
  • Gradle 2.10+ , include 3.0
  • Java 1.7 +

Usage

  1. Add below codes in the module's build.gradle.

    apply plugin: 'com.android.application'
    //please uncomment fellow line before you build a patch
    //apply plugin: 'auto-patch-plugin'
    apply plugin: 'robust'
    
    compile 'com.meituan.robust:robust:0.4.99'
    
  2. Add below codes in the outest project's build.gradle file.

     buildscript {
        repositories {
            jcenter()
        }
        dependencies {
             classpath 'com.meituan.robust:gradle-plugin:0.4.99'
             classpath 'com.meituan.robust:auto-patch-plugin:0.4.99'
       }
    }
  3. There are some configure items in app/robust.xml,such as classes which Robust will insert code,this may diff from projects to projects.Please copy this file to your project.

Advantages

  • Support 2.3 to 10 Android OS
  • Perfect compatibility
  • Patch takes effect without a reboot
  • Support fixing at method level,including static methods
  • Support add classes and methods
  • Support ProGuard,including inline methods or changing methods' signature

When you build APK,you may need to save "mapping.txt" and the files in directory "build/outputs/robust/".

AutoPatch

AutoPatch will generate patch for Robust automatically. You just need to fellow below steps to genrate patches. For more details please visit website http://tech.meituan.com/android_autopatch.html

Steps

  1. Put 'auto-patch-plugin' just behind 'com.android.application',but in the front of others plugins。like this:

     apply plugin: 'com.android.application'
     apply plugin: 'auto-patch-plugin'
  2. Put mapping.txt and methodsMap.robust which are generated when you build the apks in diretory app/robust/,if not exists ,create it!

  3. After modifying the code ,please put annotation @Modify on the modified methods or invoke RobustModify.modify() (designed for Lambda Expression )in the modified methods:

       @Modify
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
         }
         //
         protected void onCreate(Bundle savedInstanceState) {
            RobustModify.modify()
            super.onCreate(savedInstanceState);
         }
         

    Use annotation @Add when you neeed to add methods or classes.

        //add method
        @Add
        public String getString() {
            return "Robust";
        }
        
        //add class
        
        @Add
        public class NewAddCLass {
            public static String get() {
               return "robust";
             }
        }
  4. After those steps,you need to run the same gradle command as you build the apk,then you will get patches in directory app/build/outputs/robust/patch.jar.

  5. Generating patches always end like this,which means patches is done Success in generating patch

Demo Usage

  1. Excute fellow command to build apk:

    ./gradlew clean  assembleRelease --stacktrace --no-daemon
  2. After install apk on your phone,you need to save mapping.txt and app/build/outputs/robust/methodsMap.robust

  3. Put mapping.txt and methodsMap.robust which are generated when you build the apks into diretory app/robust/,if directory not exists ,create it!

  4. After modifying the code ,please put annotation @Modify on the modified methods or invoke RobustModify.modify() (designed for Lambda Expression )in the modified methods.

  5. Run the same gradle command as you build the apk:

    ./gradlew clean  assembleRelease --stacktrace --no-daemon
  6. Generating patches always end like this,which means patches is done Success in generating patch

  7. Copy patch to your phone:

    adb push ~/Desktop/code/robust/app/build/outputs/robust/patch.jar /sdcard/robust/patch.jar

    patch directory can be configured in PatchManipulateImp.

  8. Open app,and click Patch button,patch is used.

  9. Also you can use our sample patch in app/robust/sample_patch.jar ,this dex change text after you click Jump_second_Activity Button.

  10. In the demo ,we change the text showed on the second activity which is configured in the method getTextInfo(String meituan) in class SecondActivity

Attentions

  1. You should modify inner classes' private constructors to public modifier.

  2. AutoPatch cannot handle situations which method returns this,you may need to wrap it like belows:

    method a(){
      return this;
    }

    changed to

    method a(){
      return new B().setThis(this).getThis();
    }
  3. Not Support add fields,but you can add classes currently, this feature is under testing.

  4. Classes added in patch should be static nested classes or non-inner classes,and all fields and methods in added class should be public.

  5. Support to fix bugs in constructors currently is under testing.

  6. Not support methods which only use fields,without method call or new expression.

  7. Support to resources and so file is under testing.

  8. For more help, please visit Wiki

License

Copyright 2017 Meituan-Dianping

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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].