All Projects → kingwang666 → Appaddupdate

kingwang666 / Appaddupdate

Licence: apache-2.0
Android app 增量更新

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Appaddupdate

RocketXPlugin
🔥🔥 android 端编译加速插件🚀 自动识别未改动 module 并在编译流程中替换为 aar ,只编译改动模块,加速 Android apk 的编译速度。
Stars: ✭ 408 (+112.5%)
Mutual labels:  gradle, apk
Easyincrementalupdate
Android差分补丁库,通过native层合并APK,实现增量更新升级,让你更新的APK更小。
Stars: ✭ 233 (+21.35%)
Mutual labels:  apk, incremental
AndroidDevTools
收集整理Android开发所需的Android SDK、开发中用到的工具、Android开发教程、Android设计规范,免费的设计素材等。
Stars: ✭ 7,284 (+3693.75%)
Mutual labels:  ndk, gradle
Packer Ng Plugin
下一代Android打包工具,100个渠道包只需要10秒钟
Stars: ✭ 4,732 (+2364.58%)
Mutual labels:  gradle, apk
Vab
V Android Bootstrapper
Stars: ✭ 77 (-59.9%)
Mutual labels:  apk, ndk
Piracychecker
An Android library that prevents your app from being pirated / cracked using Google Play Licensing (LVL), APK signature protection and more. API 14+ required.
Stars: ✭ 1,359 (+607.81%)
Mutual labels:  gradle, apk
Androidanimationexercise
Android 动画各种实现,包括帧动画、补间动画和属性动画的总结分享
Stars: ✭ 1,254 (+553.13%)
Mutual labels:  gradle, apk
Fastdex
🚀 加快 apk 的编译速度 🚀
Stars: ✭ 1,457 (+658.85%)
Mutual labels:  gradle, apk
Gradle 3 User Guide
Gradle 3 User Guide 中文翻译《Gradle 3 用户指南》
Stars: ✭ 177 (-7.81%)
Mutual labels:  gradle
Qmbform
Create simple Android forms
Stars: ✭ 184 (-4.17%)
Mutual labels:  gradle
Netbeans Gradle Project
This project is a NetBeans plugin able to open Gradle based Java projects. The implementation is based on Geertjan Wielenga's plugin.
Stars: ✭ 175 (-8.85%)
Mutual labels:  gradle
Gradle Launch4j
A gradle-plugin to create windows executables with launch4j
Stars: ✭ 177 (-7.81%)
Mutual labels:  gradle
Mvvmtemplate
An Android Template with MVVM and Clean Architecture
Stars: ✭ 182 (-5.21%)
Mutual labels:  gradle
Click Debounce
Using ASM to handle Android's click debounce, specially a quick double click.
Stars: ✭ 175 (-8.85%)
Mutual labels:  gradle
Richeditor
基于原生EditText+span实现的Android富文本编辑器
Stars: ✭ 191 (-0.52%)
Mutual labels:  gradle
Gradlewiki
关于Gradle编译你需要知道的一切
Stars: ✭ 174 (-9.37%)
Mutual labels:  gradle
Jitpack.io
Documentation and issues of https://jitpack.io
Stars: ✭ 2,156 (+1022.92%)
Mutual labels:  gradle
Ddd Java
Spring Boot + Java [ DDD Sample ]
Stars: ✭ 191 (-0.52%)
Mutual labels:  gradle
Mwengine
Audio engine and DSP for Android, written in C++ providing low latency performance in a musical context, supporting both OpenSL and AAudio.
Stars: ✭ 190 (-1.04%)
Mutual labels:  ndk
Stubbornjava
Unconventional Java code for building web servers / services without a framework. Think dropwizard but as a seed project instead of a framework. If this project had a theme it would be break the rules but be mindful of your decisions.
Stars: ✭ 184 (-4.17%)
Mutual labels:  gradle

AppAddUpdate

Download

Android app 增量更新

参考https://github.com/cundong/SmartAppUpdates

该app未提供服务端代码(服务端代码的增量更新实现可参考diff.c和patch.c,原理和客户端一致)

ScreenShoots

Gradle

implementation 'com.wang.appupdate:appupdate:1.0.2'

Android Studio NDK

  1. 首先下载NDK
  2. 在项目的gradle.properties文件下添加android.useDeprecatedNdk=true
  3. 新建含有native方法的类(如 PatchUtil.java)
  4. 编译一下在app\build\intermediates\classes\debug目录下对应类的包名下会自动创建出PatchUtil.clasee
  5. 点击Android Studio的Terminal进入app\build\intermediates\classes\debug目录下
  6. Android Studio2.0及以上输入javah -classpath . -jni om.wang.appupdate.util(packName).PatchUtil(ClassName) 其他版本输入javah -jni om.wang.appupdate.util(packName).PatchUtil(ClassName)创建对应的.h文件(在app\build\intermediates\classes\debug根目录下)
  7. 新建jni文件夹

    创建的.h文件剪切过来。编写对应的c文件(命名随意)
  8. 在app的build.gradle配置
  9. 运行即可,对应的.so在文件夹

API

PatchUtil

  • int diff(String oldApkPath, String newApkPath,String patchPath)
    比较路径为oldPath的apk与newPath的apk之间差异,并生成patch包.

  • int patch(String oldApkPath, String newApkPath, String patchPath)
    使用路径为oldApkPath的apk与路径为patchPath的补丁包,合成新的apk,并存储newApkPath

返回码

0-success
1-缺少文件路径
2-读取旧apk失败
3-读取新的apk失败
4-打开或读取patch文件失败
5-内存分配失败
6-创建、打开或读取patch文件失败
7-计算文件差异性或者写入patch文件失败
8-计算压缩的大小差异数据失败
9-无用的patch补丁
10-合并apk失败

SignUtil

  • String getMd5ByFile(File file)
    获取对应文件的md5值

  • boolean checkMd5(File file, String md5)
    判断文件的MD5是否为指定值

  • boolean checkMd5(String filePath, String md5)
    判断文件的MD5是否为指定值

ApkUtil

  • PackageInfo getInstalledApkPackageInfo(Context context, String packageName)
    获取已安装apk的PackageInfo

  • boolean isInstalled(Context context, String packageName)
    判断apk是否已安装

  • String getSourceApkPath(Context context, String packageName)
    获取已安装Apk文件的源Apk文件

  • String getSourceApkPath(Context context)
    获取已安装Apk文件的源Apk文件

  • void installApk(Context context, String apkPath)
    安装Apk

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