登录

  • 登录
  • 忘记密码?点击找回

注册

  • 获取手机验证码 60
  • 注册

找回密码

  • 获取手机验证码60
  • 找回
毕业论文网 > 毕业论文 > 计算机类 > 计算机科学与技术 > 正文

Android热更新方案的设计与实现毕业论文

 2021-03-21 09:03  

摘 要

近几年是移动互联网爆炸式增长的时代,PC互联网市场的渐渐饱和以及手持终端设备成本的降低,都在加速着移动互联网技术的发展。根据CamStore的调查数据表示,将近一半(45%)的智能手机用户应用使用时间都花费在他们的最常使用的App上,同时,他们73%的时间花费在前三App上。由于移动设备存储容量的限制,移动用户不愿再下载很多的应用程序了,或者不会再打开已经下载过的程序了,用户更愿意花时间在社交网络、音乐、游戏上。

面对挑剔的移动用户群体,移动开发者和运营者必须保证良好的用户体验,这就需要移动应用具有良好的动态化能力。动态化包括两个方面,代码热部署和代码热修复。动态化技术能让移动应用增量地更新,并且可以在用户无感知的情况下更新。本文就Android应用的热更新方案进行探讨与设计。热修复方案包含三个主要的环节,分别是补丁的构建、补丁的发布、补丁的合成加载。

首先,本文对补丁的构建工具工作流程作了详细的阐述,补丁工具对Android软件包中的Dex文件、资源文件、依赖库文件分别构建补丁。该工具基于Android工程构建工具gradle来实现,补丁构建过程的配置都由gradle脚本来管理。

根据补丁构建工具生成的补丁文件,需要经过补丁的合成过程才能被应用程序正确加载。本文的第二部分详细介绍了补丁的合成流程及加载方式,并探讨了合成补丁的算法。

本文设计并实现了一个补丁的发布管理平台,该平台由PHP语言实现,将服务搭载在Nginx服务器上,为Android应用开发者提供补丁的发布、管理和数据统计服务。

最后,本文对热更新方案的优劣进行了总结,提出了系统进一步改进的方向,希望这套更新方案具有更广泛适用范围和更好的接入体验。

关键词:移动;热更新;动态化;

Abstract

In recent years,the mobile Internet boom. PC Internet market gradually saturated and handheld terminal equipment costs are reduced, are accelerating the development of mobile Internet technology. According to CamStore survey data, nearly half (45%) of smartphone user spend their time on their most frequently used App, while they spend 73% of their time on the top three App. Due to the limitations of mobile device storage capacity, mobile users do not want to download a lot of applications, or not open programs downloaded again.Users is more willing to spend time on social networks, music, games.

In the face of critical mobile user groups, mobile developers and operators must ensure a good user experience, which requires mobile applications with good dynamic capabilities. Dynamic includes two aspects, code hot deployment and code hot fix. Dynamic technology allows mobile applications to be incrementally updated and can be updated without user awareness. This thesis explore and design one plan of hot patch on the Android application. The hot fix solution consists of three main links, which are the construction of the patch, the release of the patch, the synthetic loading of the patch.

First of all, this article on the patch construction tool workflow made a detailed description of the patch tool on the Android package Dex files, resource files, dependent library files were built patch. The tool is based on the Android project builder gradle, and the configuration of the patch build process is managed by the gradle script.

The patch file generated by the patch build tool should be recoveredbefore properly loaded by the application. The second part of this paper introduces the recovery process and the loading method of the patch, and discusses the algorithm of thepatch process.

This paper designs and implements a patch release management platform, which is implemented by PHP language, and server on Nginx to provide patch release, management and data statistics service for Android application developers.

Finally, this paper summarizes the advantages and disadvantages of the hot update scheme, and puts forward the direction of further improvement of the system. It is hoped that this update scheme will have a wider scope of application and a better access experience.

Key Words:mobile;hot patch;dynamic;

目录

第1章 绪论 1

1.1研究背景与意义 1

1.2国内外研究现状 1

1.3本文研究内容 2

1.4本文组织结构 3

第2章 基于Gradle的补丁自动化构建工具设计与实现 4

2.1 Gradle介绍 4

2.2 Binary diff/patch 工具 5

2.3 补丁的构建 5

2.3.1 Dex文件补丁生成 5

2.3.2 Resource补丁生成 7

2.3.3 so补丁文件生成 9

2.4 注意事项 10

2.4.1 Manifest文件校验 10

2.4.2资源文件id映射 10

2.4.3混淆文件映射 12

第3章 补丁合成算法的设计与实现 13

3.1补丁合成前的校验 13

3.1.1 Android应用签名 13

3.1.2 签名的校验 13

3.2 DEX补丁文件的合成 14

3.2.1 DEX文件有效性校验 14

3.2.2 DEX文件合成算法 15

3.3 资源补丁文件的合成 16

3.3.1 资源文件补丁有效性校验 16

3.3.2 资源补丁的合成 17

第4章 补丁的加载流程的设计与实现 18

4.1 Application代理 18

4.2 DEX补丁的加载 19

4.3 资源补丁的加载 19

4.4 so补丁的加载 20

4.4.1 ABI的选择 20

4.4.2 so文件加载 22

第5章 补丁发布平台的设计与实现 22

5.1 总体设计 22

5.1.1 功能描述 22

5.1.2 PHP与Nginx 23

5.2数据库设计 23

第6章 系统测试 26

6.1 补丁构建工具测试 26

6.2 接入补丁发布平台测试 27

第7章 总结与展望 31

7.1本文工作总结 31

7.2 未来工作展望 31

参考文献 32

致谢 33

第1章 绪论

1.1研究背景与意义

2003年10月,“Android之父”安迪·鲁宾在美国创建了Android科技公司。2005年7月月11日,Google收购了Android科技公司。2007年11月,Google发布Android1.0系统(Beta版),并联合硬件制造商、软件开发商以及移动运营商组建Open Handest Alliance(OHA,开放手机联盟),共同研发与改进Android系统。2008年9月,Google正式发布了Android1.0系统。随着3G、4G等网络基础设施的进一步发展,Android操作系统在全球范围内也普及开来。据《Android发展的分析与研究》[1]研究表明,2011年第一季度,Android在全球的市场份额首次超过塞班系统,跃居全球第一。2012年2月,Android占据全球智能手机操作系统市场52.5%的份额,中国市场占有率为68.4%。

Android作为移动终端设备,给用户带来方便的同时,也对Android应用的开发者带来了一些困扰。Android上的原生应用一般采用的CS架构,可执行的代码已经预先安装在Android终端设备上。如果需要更新可执行代码,则需要重新发布应用版本,终端用户则需要重新下载新的Apk安装文件包,然后安装运行。这种更新方式需要用户去主动的下载并安装,流程长且成本高。面对竞争压力巨大的市场,很多产品需要快速迭代,而漫长的发版周期成为了限制公司业务发展的瓶颈。再者,即使经过再严密的测试,面对多种多样的用户使用场景,应用程序厂商发布的产品也会有一些线上的问题暴露出来。在问题暴露出来之后,需要快速发布新版本去替换旧的有问题的安装包。如果用户不去及时更新自己已经安装的Apk,那么线上问题就会一直存在。

您需要先支付 80元 才能查看全部内容!立即支付

企业微信

Copyright © 2010-2022 毕业论文网 站点地图