CN113360373A - 一种移动应用Activity页面全遍历的测试方法 - Google Patents

一种移动应用Activity页面全遍历的测试方法 Download PDF

Info

Publication number
CN113360373A
CN113360373A CN202110575758.8A CN202110575758A CN113360373A CN 113360373 A CN113360373 A CN 113360373A CN 202110575758 A CN202110575758 A CN 202110575758A CN 113360373 A CN113360373 A CN 113360373A
Authority
CN
China
Prior art keywords
component
exported
authority
page
android
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110575758.8A
Other languages
English (en)
Inventor
龙柏林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Manxi Technology Co ltd
Original Assignee
Shanghai Manxi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Manxi Technology Co ltd filed Critical Shanghai Manxi Technology Co ltd
Priority to CN202110575758.8A priority Critical patent/CN113360373A/zh
Publication of CN113360373A publication Critical patent/CN113360373A/zh
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本发明公开了一种移动应用Activity页面全遍历的测试方法,包括如下步骤:S1,获取到需要分析的样本;S2,安装到目标机器上;S3,通过解析样本中AndroidMan i fest.xml配置文件,获取activity节点中android:name属性值,并存储,并获取android:exported值,判断组件是否导出;S4,对于导出组件即android:exported=”true”的组件,使用普通权限通过am start PackageName/ActivityName命令即可直接启动组件;S5,对于未导出的组件,在API<=19的机器上仍然可以通过步骤S4进行启动,对于API>19的机器上,可以在相应权限下通过am start PackageName/ActivityName命令即可直接启动组件;S6,通过步骤S4和步骤S5,对步骤S3解析到的组件进行遍历,即可全部遍历页面。本发明,提供的方法针对移动APP自动化测试进行全页面遍历:兼容性高、复用度强。

Description

一种移动应用Activity页面全遍历的测试方法
技术领域
本发明涉及信息安全和移动安全应用技术领域,具体为一种移动应用Activity页面全遍历的测试方法。
背景技术
随着科技的发展,大量的移动APP投入市场,广泛地应用于社会生活的各个领域。在移动APP的软件测试领域,怎样避免繁琐的重复劳动,以节省时间,降低成本已成为企业研发面临的一大难题,自动化测试技术可以有效地提高软件测试效率,加速软件的开发和版本的迭代,而在现有的移动应用测试中,应用的界面测试大致有以下两种表现形式:一是通过编写脚本程序,让脚本程序按指定的顺序去执行页面操作,从而达到测试某条路径的目的,由于脚本的运行是在已知界面点击指定控件,有很高的准确性,但这种需要针对每个应用进行编写脚本程序,兼容性极差,此外,这种方式的可迁移性低、复用性差。二是利用一些开源测试工具如monkey,这种工具的特点是不再像脚本那样过度依赖界面,能在任意应用甚至跨应用运行,其主要的操作在页面中进行随机的点击,兼容性高,复用性强。但是,由于测试工具是随机的在界面中点击,准确度和覆盖率就很难有所保证,所以需要有一种能够遍历移动应用Activity页面的全遍历测试技术。
发明内容
本发明的目的在于提供一种移动应用Activity页面全遍历的测试方法,以解决上述背景技术中提出的问题。
为实现上述目的,本发明提供如下技术方案:一种移动应用Activity页面全遍历的测试方法,包括如下步骤:
S1,获取到需要分析的样本;
S2,安装到目标机器上;
S3,通过解析样本中AndroidManifest.xml配置文件,获取activity节点中android:name属性值,并存储,并获取android:exported值,判断组件是否导出;
S4,对于导出组件即android:exported=”true”的组件,使用普通权限通过amstart PackageName/ActivityName命令即可直接启动组件;
S5,对于未导出的组件,在API<=19的机器上仍然可以通过步骤S4进行启动,对于API>19的机器上,可以在相应权限下通过am start PackageName/ActivityName命令即可直接启动组件;
S6,通过步骤S4和步骤S5,对步骤S3解析到的组件进行遍历,即可全部遍历页面。
优选的,所述步骤S4中的普通权限为hell(uid=2000)权限或者用户权限(uid>2000)。
优选的,所述步骤S5中的相应权限为root(uid=0)或者system(uid=1000)权限。
与现有技术相比,本发明的有益效果是:
本发明,提供的方法针对移动APP自动化测试进行全页面遍历:兼容性高、复用度强,可针对所有的移动应用进行全页面遍历;可对未导出activity页面进行遍历;可全自动化进行activity页面遍历。
附图说明
图1是本发明的流程图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
请参阅图1,本发明提供一种技术方案:一种移动应用Activity页面全遍历的测试方法,包括如下步骤:
S1,获取到需要分析的样本;
S2,安装到目标机器上。
S3,通过解析样本中AndroidManifest.xml配置文件,获取activity节点中android:name属性值,并存储,并获取android:exported值,判断组件是否导出。
S4,对于导出组件即android:exported=”true”的组件,使用普通权限即shell(uid=2000)权限或者用户权限(uid>2000)通过am start PackageName/ActivityName命令即可直接启动组件。
S5,对于未导出的组件,在API<=19的机器上仍然可以通过步骤四进行启动,对于API>19的机器上,可以在root(uid=0)、system(uid=1000)权限下通过am startPackageName/ActivityName命令即可直接启动组件
S6,通过步骤S4和步骤S5步骤,对步骤S3解析到的组件进行遍历,即可全部遍历页面。
尽管已经示出和描述了本发明的实施例,对于本领域的普通技术人员而言,可以理解在不脱离本发明的原理和精神的情况下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由所附权利要求及其等同物限定。

Claims (3)

1.一种移动应用Activity页面全遍历的测试方法,其特征在于包括如下步骤:
S1,获取到需要分析的样本;
S2,安装到目标机器上;
S3,通过解析样本中AndroidManifest.xml配置文件,获取activity节点中android:name属性值,并存储,并获取android:exported值,判断组件是否导出;
S4,对于导出组件即android:exported=”true”的组件,使用普通权限通过am startPackageName/ActivityName命令即可直接启动组件;
S5,对于未导出的组件,在API<=19的机器上仍然可以通过步骤S4进行启动,对于API>19的机器上,可以在相应权限下通过am start PackageName/ActivityName命令即可直接启动组件;
S6,通过步骤S4和步骤S5,对步骤S3解析到的组件进行遍历,即可全部遍历页面。
2.根据权利要求1所述的一种移动应用Activity页面全遍历的测试方法,其特征在于:所述步骤S4中的普通权限为hell(uid=2000)权限或者用户权限(uid>2000)。
3.根据权利要求1所述的一种移动应用Activity页面全遍历的测试方法,其特征在于:所述步骤S5中的相应权限为root(uid=0)或者system(uid=1000)权限。
CN202110575758.8A 2021-05-26 2021-05-26 一种移动应用Activity页面全遍历的测试方法 Pending CN113360373A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110575758.8A CN113360373A (zh) 2021-05-26 2021-05-26 一种移动应用Activity页面全遍历的测试方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110575758.8A CN113360373A (zh) 2021-05-26 2021-05-26 一种移动应用Activity页面全遍历的测试方法

Publications (1)

Publication Number Publication Date
CN113360373A true CN113360373A (zh) 2021-09-07

Family

ID=77527597

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110575758.8A Pending CN113360373A (zh) 2021-05-26 2021-05-26 一种移动应用Activity页面全遍历的测试方法

Country Status (1)

Country Link
CN (1) CN113360373A (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114968687A (zh) * 2022-06-09 2022-08-30 腾讯科技(深圳)有限公司 遍历测试方法、装置、电子设备、程序产品以及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120107193A (ko) * 2011-03-21 2012-10-02 엔에이치엔비즈니스플랫폼 주식회사 키워드에 기반하여 웹 서비스의 테스트를 자동적으로 수행하는 시스템 및 방법
CN105740144A (zh) * 2016-01-27 2016-07-06 浪潮(北京)电子信息产业有限公司 一种Android移动终端的自动化测试方法及***
CN105868105A (zh) * 2016-03-24 2016-08-17 厦门美图移动科技有限公司 一种应用遍历测试方法、设备及移动终端
CN108090355A (zh) * 2017-11-28 2018-05-29 西安交通大学 一种apk自动触发工具
CN112560090A (zh) * 2020-12-15 2021-03-26 建信金融科技有限责任公司 一种数据检测方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120107193A (ko) * 2011-03-21 2012-10-02 엔에이치엔비즈니스플랫폼 주식회사 키워드에 기반하여 웹 서비스의 테스트를 자동적으로 수행하는 시스템 및 방법
CN105740144A (zh) * 2016-01-27 2016-07-06 浪潮(北京)电子信息产业有限公司 一种Android移动终端的自动化测试方法及***
CN105868105A (zh) * 2016-03-24 2016-08-17 厦门美图移动科技有限公司 一种应用遍历测试方法、设备及移动终端
CN108090355A (zh) * 2017-11-28 2018-05-29 西安交通大学 一种apk自动触发工具
CN112560090A (zh) * 2020-12-15 2021-03-26 建信金融科技有限责任公司 一种数据检测方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WEIXIN_39673051: "android默认exported_AndroidManifest.xml文件中exported属性解析", 《CSDN HTTPS://BLOG.CSDN.NET/WEIXIN_39673051/ARTICLE/DETAILS/111517625》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114968687A (zh) * 2022-06-09 2022-08-30 腾讯科技(深圳)有限公司 遍历测试方法、装置、电子设备、程序产品以及存储介质

Similar Documents

Publication Publication Date Title
US9274923B2 (en) System and method for stack crawl testing and caching
CN110008113B (zh) 一种测试方法、装置、电子设备
US8286149B2 (en) Apparatus for and method of implementing feedback directed dependency analysis of software applications
US7900198B2 (en) Method and system for parameter profile compiling
US10133871B1 (en) Method and system for identifying functional attributes that change the intended operation of a compiled binary extracted from a target system
CN103186463B (zh) 确定软件的测试范围的方法和***
US9116714B2 (en) Methods and systems for file processing
CN112631704A (zh) 一种界面元素识别方法、装置、存储介质及电子设备
CN111221721B (zh) 一种单元测试案例自动化录制和执行方法及装置
CN115357898A (zh) 一种java组件的依赖分析方法、装置及介质
CN109063040B (zh) 客户端程序数据采集方法及***
Wang et al. Fast reproducing web application errors
CN116841543A (zh) 基于Flutter动态生成跨平台多端应用的开发方法
US20220334955A1 (en) Automated unit testing in a mainframe cics environment
CN112861138A (zh) 软件安全性分析方法及分析装置、电子设备及存储介质
CN116578282A (zh) 代码生成方法、装置、电子设备及介质
CN113360373A (zh) 一种移动应用Activity页面全遍历的测试方法
CN108121658B (zh) 基于windows端测试工具测试linux端被测软件的方法
US9032372B2 (en) Runtime environment and method for non-invasive monitoring of software applications
CN115407997A (zh) 基于低代码的敏捷开发应用方法及***
CN113220586A (zh) 一种自动化的接口压力测试执行方法、装置和***
CN113031964A (zh) 一种大数据应用的管理方法、装置、设备及存储介质
CN109857636A (zh) 一种在安卓客户端UI自动化过程中定位App首页的方法和应用
CN110688430A (zh) 一种获得数据旁路的方法、装置及电子设备
CN113296834B (zh) 一种基于逆向工程的安卓闭源服务类型信息提取方法

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210907