NDK实战(五)—— 增量更新(下)—— 合并差分包

本文介绍了在Android平台下如何进行NDK实战,特别是增量更新的下篇,详细讲解了如何合并patch差分包,包括添加文件、在CMakeLists.txt配置、调用bspatch的main方法以及安装合并后的apk步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Android平台下合并patch差分包

一、添加文件

bzip2 的所有 .c.h 文件以及bspatch.c 复制到Android Studio 的 cpp 目录下(记得修改main方法名,保证只有一个main入口)

二、在Cmake.txt中链接所有文件

使用

file(GLOB c_path src/main/cpp/*.c)

可以将所有文件添加为一个 c_path 路径变量
image

file(GLOB c_path src/main/cpp/bzip2/*.c)

add_library( # Sets the name of the library.
        bspacth-lib
        SHARED
        ${c_path}
        src/main/cpp/bspatch.c)

add_library( # Sets the name of the library.
        native-lib
        SHARED
        src/main/cpp/native-lib.c)

find_library( # Sets the name of the path variable.
        log-lib
        log)

target_link_libraries( # Specifies the target library.
        native-lib
        bspacth-lib
        ${log-lib}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值