CN114637664A - Detection method and device for android application program properties - Google Patents

Detection method and device for android application program properties Download PDF

Info

Publication number
CN114637664A
CN114637664A CN202111171245.7A CN202111171245A CN114637664A CN 114637664 A CN114637664 A CN 114637664A CN 202111171245 A CN202111171245 A CN 202111171245A CN 114637664 A CN114637664 A CN 114637664A
Authority
CN
China
Prior art keywords
state
probability
formula
operator
application program
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
CN202111171245.7A
Other languages
Chinese (zh)
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.)
Institute of Software of CAS
Original Assignee
Institute of Software of CAS
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 Institute of Software of CAS filed Critical Institute of Software of CAS
Publication of CN114637664A publication Critical patent/CN114637664A/en
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/3604Software analysis for verifying properties of programs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (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

The invention discloses a method and a device for detecting properties of android application programs, which comprises the steps of constructing a state diagram based on Activity information and jump information among activities for each application program in different android equipment, and combining the state diagrams as intelligent agents to obtain a probabilistic multi-intelligent-agent system; depicting the target property as a probability cognition logic formula; and inputting the probability multi-agent system and the probability cognitive logic formula into a model detection tool to obtain a detection result of the target property. The method can prove that the property is satisfied or give an unsatisfied counterexample, can model a system under the condition that the same android application runs on different devices, and verifies the property related to interaction between the android applications running on different devices; the property of a system formed by android application programs running on a plurality of devices can be analyzed, and the method has positive significance for debugging the programs by developers, improving the usability of the programs and reducing program bugs.

Description

Detection method and device for android application program properties
Technical Field
The invention belongs to the field of program analysis and safety, and particularly relates to a method and a device for detecting the property of an android application program.
Background
With the rapid development of smart phones, the android system is more and more widely used in daily life. However, as an open system, many developers develop applications that bring convenience and are accompanied by many abnormal behaviors such as bugs and hidden dangers. These abnormal behaviors may affect the use experience of the application program and may even cause privacy disclosure or property loss of the user. Therefore, how to ensure the correctness of the android application, i.e. eliminate the abnormal behavior, becomes an important research problem.
Most of the prior art is based on software test, and checks whether the behavior of the application program meets the requirements by executing a formulated test case. However, the software test is limited by the path coverage rate, and only can try to find the existing abnormal behavior, and the absence of the abnormal behavior cannot be proved. Model detection can solve this problem by traversing the reachable state space to prove that abnormal behavior is not present (or to find out what abnormal behavior is present).
At the present stage, the research on applying the model detection technology to the android application program is less, and how to establish the model of the android application program, how to depict the property to be verified and how to apply the model detection algorithm are not given.
Disclosure of Invention
The invention provides a method and a device for detecting properties of an android application program, which are characterized in that text information in Activities and jump information among Activities are extracted from an android application program installation package by using a static analysis method, then a model of a single application program is constructed, a plurality of models are combined together to construct a probabilistic multi-agent system, and finally a probabilistic cognitive logic model detection method is used to verify whether the android application program meets the required properties.
The technical content of the invention comprises:
a detection method for android application program properties comprises the following steps:
1) aiming at each application program in different android devices, constructing a state diagram based on Activity information and jump information between activities, and combining the state diagrams as intelligent agents to obtain a probabilistic multi-intelligent-agent system;
2) the target property is characterized as a probability cognition logic formula;
3) and inputting the probability multi-agent system and the probability cognitive logic formula into a model detection tool to obtain a detection result of the target property.
Further, the method for extracting Activity information and jump information between activities includes: and extracting from the application program installation package by using a static analysis tool.
Further, the static resolution tool comprises: gator or BACKSTAGE.
Further, the state diagram is constructed by:
1) taking the Activity information as a state and a vertex of a state diagram, wherein the first Activity information entered after the application program is opened is taken as an initial state;
2) constructing the edge of the state diagram by using the jumping information between Activities;
3) on the corresponding edge, marking an event triggering page migration as an action;
4) and setting corresponding atom propositions and state label functions.
Further, the elements of the state diagram further include: the probability of migration.
Further, the probabilistic cognitive logic formula comprises: a state formula and a path formula.
Further, the state formula
Figure BDA0003293312750000021
Wherein
Figure BDA0003293312750000022
Is a state formula, p is an atom proposition,
Figure BDA0003293312750000023
taking a non-operational character, taking a conjunction operational character,
Figure BDA0003293312750000024
in the form of a probability operator, the probability operator,
Figure BDA0003293312750000025
representing four relations of greater than, greater than or equal to, less than or equal to, and less than or equal to, d represents in [0,1 ]]A real number in between (c) and (d),
Figure BDA0003293312750000026
is a knowledge-aware operator, i is an agent,
Figure BDA0003293312750000027
for each person knowledge cognitive operator, G is a multi-agent set,
Figure BDA0003293312750000028
for the distributed knowledge-aware operator, ψ is the path formula.
Further, the path is formulated as
Figure BDA0003293312750000029
Where X is the next operator, U is the up to operator,
Figure BDA00032933127500000210
is a state formula.
A storage medium having stored therein a computer program, wherein the computer program is arranged to perform the above-mentioned method when executed.
An electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer to perform the method as described above.
Compared with the prior art, the invention has the following advantages:
1) using model detection techniques, it can be demonstrated that properties are satisfied or give an unsatisfied counter-example.
2) The method can model a system under the condition that the same android application runs on different devices, and verify the properties related to interaction between the android applications running on different devices;
3) the property of a system formed by android application programs running on a plurality of devices can be analyzed, and the method has positive significance for debugging the programs by developers, improving the usability of the programs and reducing program bugs.
Drawings
FIG. 1 is a system architecture diagram of the present invention.
Fig. 2 is a flow chart of the present invention.
FIG. 3 is a single application model of an embodiment of the present invention.
Detailed Description
The invention will be further described by way of example with reference to the accompanying drawings.
According to the detection method, a model is built from the android application installation package file, the property to be verified and an application model detection algorithm are described by using a logic formula, and a path which does not meet the property in the android application can be found out or a conclusion that the property is met can be given by applying the set of method.
1. System components
The system architecture of the invention is shown in figure 1 and mainly comprises 4 modules, namely an android application program analysis tool module, a model construction module, a property input module and a model detection module.
2. Workflow process
The working flow of the invention is shown in figure 2:
(1) first, data including jump information between Activity information and Activity is extracted from the android application installation package through a static parsing tool, such as gate (http:// web. cs. o. hio-state. edu/presto/software/gate /), BACKSTAGE (https:// www.st.cs.uni-sarland. de/uploading/BACKSTAGE /), and the like.
(2) These data are then used to build a state diagram for the individual application. The state diagram for a single application includes the following elements: a limited set of states, an initial state, a limited set of actions, a state migration function, a limited set of atomic propositions, and a state tagging function. The specific construction method comprises the following steps: taking Activity as a state; taking the first Activity entered after the application program is opened as an initial state; taking an event (such as clicking a button and the like) which can trigger page migration on a page as an action; taking the jump between activities as migration, wherein the migration related to network connection needs to introduce probability factors because network transmission has certain failure probability (for example, when a user clicks a login button on a login page, an application enters the next page with the probability of 0.99, and stays on the login page with the probability of 0.01); the atomic proposition and state label function can give different definitions according to different application scenarios.
Figure 3 gives an example of a simple single application model.
(3) Then, each single application program is regarded as an agent, and a plurality of application program clients running on different devices are combined into a probabilistic multi-agent system, namely, the global state is the combination of each local state, the global action is the combination of the local actions, and the global migration is the combination of the local migration. Each agent can only get local information, i.e. only knows in which state it is, and not in which state the other agents are.
(4) The properties in the present invention are characterized using probabilistic cognitive logic. The logic integrates probabilistic computational tree logic and cognitive logic. The logic includes a state formula and a path formula, wherein the state formula
Figure BDA0003293312750000041
Wherein, the meaning of each element of the state formula is as follows:
(ii) atomic propositions p, e.g. "variable s has a value of 3";
② taking non-operational characters
Figure BDA0003293312750000042
Order to
Figure BDA0003293312750000043
Represents a formula of states, then
Figure BDA0003293312750000044
To represent
Figure BDA0003293312750000045
The method is not established;
③ to get an operator ^ to make
Figure BDA0003293312750000046
And
Figure BDA0003293312750000047
respectively represent two state formulas, then
Figure BDA0003293312750000048
To represent
Figure BDA0003293312750000049
And
Figure BDA00032933127500000410
simultaneously, the two steps are carried out;
probability operator
Figure BDA00032933127500000411
Wherein
Figure BDA00032933127500000412
Representing four relations of greater than, greater than or equal to, less than or equal to, and less than or equal to, d represents in [0,1 ]]Real number in between. Let psi denote a path formula, then
Figure BDA00032933127500000413
Indicates that the probability of psi being satisfied
Figure BDA00032933127500000414
The relationship (c) in (c).
Fifth cognitive operator, including Knowledge (Knowledge)
Figure BDA00032933127500000415
Knowledge of each person (Everyone's Knowledge)
Figure BDA00032933127500000416
Distributed Knowledge (Distributed Knowledge)
Figure BDA00032933127500000417
Where i represents an agent (which in the present invention may be a user, or a client), and G is a multi-agent set. Order to
Figure BDA00032933127500000418
Represents a formula of states, then
Figure BDA00032933127500000419
Indicating a state equivalent to the current state from the user i's perspective,
Figure BDA00032933127500000420
are all true, i.e. user i knows
Figure BDA00032933127500000421
This is true. Accordingly, the number of the first and second electrodes,
Figure BDA00032933127500000422
all users in the representation G know
Figure BDA00032933127500000423
It is true that the first and second sensors,
Figure BDA00032933127500000424
the user in the representation G can know if the user can share the information
Figure BDA00032933127500000425
This is true.
The path is formulated as
Figure BDA00032933127500000426
Wherein, the meaning of each element of the state formula is as follows:
next (Next) operator X, order
Figure BDA00032933127500000427
Represents a formula of states, then
Figure BDA00032933127500000428
It is shown that after the next step,
Figure BDA00032933127500000429
if true;
② Up to (Until) operator U, order
Figure BDA00032933127500000430
And
Figure BDA00032933127500000431
respectively represent two state formulas, then
Figure BDA00032933127500000432
To represent
Figure BDA00032933127500000433
Will be established after a future step, before
Figure BDA00032933127500000434
This is always true.
By combining the above operators, we can express many properties, such as "user _ count>=2∧KBobsAlice"the number of users is greater than 2 and the user Bob knows that Alice has logged in" in the entire system.
(5) And finally, inputting the probabilistic multi-agent system obtained in the step (3) and the property formula obtained in the step (4) into a probabilistic cognitive logic model detection tool (https:// github. com/fuchen1991/epmc-petl) for model detection so as to verify whether the property is met.
The above embodiments are only intended to illustrate the technical solution of the present invention and not to limit the same, and a person skilled in the art can modify the technical solution of the present invention or substitute the same without departing from the spirit and scope of the present invention, and the scope of the present invention should be determined by the claims.

Claims (10)

1. A detection method for android application program properties comprises the following steps:
1) aiming at each application program in different android devices, constructing a state diagram based on Activity information and jump information between activities, and combining the state diagrams as intelligent agents to obtain a probabilistic multi-intelligent-agent system;
2) depicting the target property as a probability cognition logic formula;
3) and inputting the probability multi-agent system and the probability cognitive logic formula into a model detection tool to obtain a detection result of the target property.
2. The method of claim 1, wherein extracting Activity information and jump between activities information comprises: extracted from the application installation package using a static parsing tool.
3. The method of claim 2, wherein the static resolution tool comprises: gator or BACKSTAGE.
4. The method of claim 1, wherein the state diagram is constructed by:
1) taking the Activity information as a state and a vertex of a state diagram, wherein the first Activity information entered after the application program is opened is taken as an initial state;
2) constructing the edge of the state diagram by using the jumping information between Activities;
3) on the corresponding edge, marking an event triggering page migration as an action;
4) and setting corresponding atom propositions and state label functions.
5. The method of claim 4, wherein the elements of the state diagram further comprise: the probability of migration.
6. The method of claim 1, wherein the probabilistic cognitive logic formula comprises: a state formula and a path formula.
7. The method of claim 6, wherein the state formula
Figure FDA0003293312740000011
Figure FDA0003293312740000012
Wherein p is an atomic proposition,
Figure FDA0003293312740000018
taking a non-operational character, taking a combined operational character,
Figure FDA00032933127400000110
in the form of a probability operator, the probability operator,
Figure FDA0003293312740000019
representing four relations of greater than, greater than or equal to, less than or equal to, and less than or equal to, d represents in [0,1 ]]The real number in between (a) and (b),
Figure FDA0003293312740000013
is a knowledge-aware operator, i is an agent,
Figure FDA0003293312740000014
for each person knowledge-aware operational characters, g is a multi-agent set,
Figure FDA0003293312740000015
for the distributed knowledge-aware operator, ψ is the path formula.
8. The method of claim 6, wherein the path formula
Figure FDA0003293312740000016
Where ψ is the path formula, X is the next operator, U is the up to operator,
Figure FDA0003293312740000017
is a state formula.
9. A storage medium having a computer program stored thereon, wherein the computer program is arranged to, when run, perform the method of any of claims 1-8.
10. An electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the method according to any of claims 1-8.
CN202111171245.7A 2020-12-16 2021-10-08 Detection method and device for android application program properties Pending CN114637664A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011486579 2020-12-16
CN2020114865799 2020-12-16

Publications (1)

Publication Number Publication Date
CN114637664A true CN114637664A (en) 2022-06-17

Family

ID=81946763

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111171245.7A Pending CN114637664A (en) 2020-12-16 2021-10-08 Detection method and device for android application program properties

Country Status (1)

Country Link
CN (1) CN114637664A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115496017A (en) * 2022-09-06 2022-12-20 中国科学院软件研究所 Similar SVA (singular value analysis) extension and formal verification method for Chisel assertion language

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2013251256A1 (en) * 2007-01-26 2013-11-21 Accenture Global Services Limited Virtual information technology assistant
CN108846282A (en) * 2018-06-04 2018-11-20 西安电子科技大学 Android application program permission based on the analysis of static stain reveals leak detection method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2013251256A1 (en) * 2007-01-26 2013-11-21 Accenture Global Services Limited Virtual information technology assistant
CN108846282A (en) * 2018-06-04 2018-11-20 西安电子科技大学 Android application program permission based on the analysis of static stain reveals leak detection method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
于鹏洋;黄俊飞;宫云战;: "Android应用隐私泄露静态代码分析", 软件, no. 10, 15 October 2012 (2012-10-15) *
柳毅;麻志毅;何啸;邵维忠;: "一种从UML模型到可靠性分析模型的转换方法", 软件学报, no. 02, 15 February 2010 (2010-02-15) *
谷林涛;徐立华;: "基于GUI的Android移动软件性能测试", 计算机系统应用, no. 08, 15 August 2018 (2018-08-15) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115496017A (en) * 2022-09-06 2022-12-20 中国科学院软件研究所 Similar SVA (singular value analysis) extension and formal verification method for Chisel assertion language
CN115496017B (en) * 2022-09-06 2023-04-11 中国科学院软件研究所 SVA-like extension and formal verification method for Chisel assertion language

Similar Documents

Publication Publication Date Title
US20100229230A1 (en) System and method for securing computer system against unauthorized access
Alalfi et al. Modelling methods for web application verification and testing: state of the art
Zhang et al. Monitoring of probabilistic timed property sequence charts
CN113158189B (en) Method, device, equipment and medium for generating malicious software analysis report
CN115270131A (en) Java anti-serialization vulnerability detection method and system
Cimatti et al. Combining MILS with contract-based design for safety and security requirements
CN113590454A (en) Test method, test device, computer equipment and storage medium
Kriaa et al. A new safety and security risk analysis framework for industrial control systems
Reger Automata based monitoring and mining of execution traces
CN114637664A (en) Detection method and device for android application program properties
Waly et al. A complete framework for kernel trace analysis
Riley et al. Evaluating verification awareness as a method for assessing adaptation risk
CN111190813B (en) Android application network behavior information extraction system and method based on automatic testing
CN109165509A (en) The software method of credible measurement, equipment, system and storage medium in real time
Schulz et al. Continuous Secure Software Development and Analysis.
Zhao et al. A systematic review of fuzzing
Kayes et al. The network of faults: a complex network approach to prioritize test cases for regression testing
Liu Software vulnerability mining techniques based on data fusion and reverse engineering
Abuserrieh et al. A Survey of Analysis Methods for Security and Safety verification in IoT Systems
Jiang et al. An exploitability analysis technique for binary vulnerability based on automatic exception suppression
Grahl Deductive verification of concurrent programs and its application to secure information flow for Java
CN111859387A (en) Automatic construction method for Android platform software vulnerability model
Tao et al. A reinforcement learning-based approach to testing GUI of moblie applications
Alalfi et al. Modeling methods for web application verification and testing: State of the art
CN117687890B (en) Abnormal operation identification method, system, medium and equipment based on operation log

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