摘要
随着移动设备硬件技术和5G等通信技术的发展,智能应用软件不断涌现,其提供的功能已涉及人们生活和工作的方方面面。应用内功能众多,不仅可以满足应用使用者的需求,还能被进一步发布成应用程序接口(API)用于外部调用,例如应用发布的API可以被智能语音助手调用。然而,为了生成应用内功能的API,开发者通常需要在应用开发阶段通过手工编码来实现,对于开发时没有发布的API,在应用上线以后,其功能则无法被外部调用。针对此问题,文中提出了一种基于计算反射的Android应用API自动生成方法。该方法能够在不修改源代码的情况下,基于计算反射机制重建Android应用的Activity界面运行时软件体系结构;面向指定功能的测试用例,分析用户行为工作流以及对应的程序调用;通过模拟用户行为的方式调用指定功能,并生成对应的API。针对“豌豆荚”Android应用商店中的300个流行应用进行方法评估,实验结果显示,所提方法适用于其中的280个应用;对于指定功能,所提方法能够在15 min左右实现其API,且API的性能满足外部调用的需求。
With the development of mobile hardware and 5G communication technologies,smart applications are booming,which has penetrated into all the aspects of our life and work.There are many functions in applications,which can not only satisfy the user’s requirements,but also be further released as APIs for external invocations.For instance,the APIs provided by applications can be invoked by the intelligent voice assistant.However,these functions must be released as APIs during the development phase,otherwise they cannot be used for external invocations.To address this problem,this paper proposes an approach to automatic release of APIs of Android applications based on computational reflection.It first rebuilds runtime software architecture for the activities of Android applications based on the reflection mechanism,without modifying the source code of application.Then,based on test cases of the specified function,it analyzes its user-behavior workflow and corresponding procedure calls.Finally,the function can be invoked by simulating the user behaviors,and then is released as the corresponding API.We evaluate our approach with 300 popular apps on Android app store Wandoujia,and the results show that our approach is effective for 280 of them.For the specified functions,APIs can be implemented by our approach in about 15 minutes,and their runtime performance is desirable.
作者
王毅
陈迎仁
陈星
林兵
马郓
WANG Yi;CHEN Ying-ren;CHEN Xing;LIN Bin;MA Yun(College of Mathematics and Computer Science,Fuzhou University,Fuzhou 350116,China;Fujian Key Laboratory of Network Computing and Intelligent Information Processing,Fuzhou 350116,China;College of Physics and Energy,Fujian Normal University,Fuzhou 350117,China;School of Electronics Engineering and Computer Science,Peking University,Beijing 100871,China)
出处
《计算机科学》
CSCD
北大核心
2022年第12期136-145,共10页
Computer Science
基金
国家重点研发计划(2018YFB1004800)
福建省自然科学基金杰青项目(2020J06014)
中央引导地方科技发展专项(2019L3002)。