A method and device for detecting properties of Android application programs

Through static analysis and probabilistic cognitive logic model detection, the state diagram and multi-agent system of the Android application are constructed, which solves the problem of the inability to effectively detect the abnormal behavior of the Android application in the existing technology and achieves effective verification of the nature of the application. and security improvements.

CN114637664BActive Publication Date: 2024-09-10INST OF SOFTWARE - CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111171245.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-12-16
Filing Date
2021-10-08
Publication Date
2024-09-10
Estimated Expiration
2041-10-08

AI Technical Summary

Technical Problem

Existing technology is difficult to effectively detect abnormal behavior of Android applications and cannot prove its correctness. Model detection technology is rarely used in Android applications, and there is a lack of research on establishing models and applying model detection algorithms.

Method used

Extract Activity information and jump information from the Android application installation package through static analysis, build a state diagram to form a probabilistic multi-agent system, and use the probabilistic cognitive logic model detection method to verify the nature of the application.

Benefits of technology

It can prove the satisfaction or dissatisfaction of properties, verify the interactive properties of Android applications on different devices, improve program usability, reduce vulnerabilities, and enhance security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114637664B_ABST
    Figure CN114637664B_ABST
Patent Text Reader

Abstract

The present invention discloses a detection method and device for the properties of Android applications, including constructing a state diagram based on Activity information and jump information between Activities for each application in different Android devices, and combining each state diagram as an agent to obtain a probabilistic multi-agent system; characterizing the target property as a probabilistic cognitive logic formula; inputting the probabilistic multi-agent system and the probabilistic cognitive logic formula into a model detection tool to obtain the detection result of the target property. The present invention can prove that the property is satisfied or give a counterexample that it is not satisfied, can model a system in which the same Android application runs on different devices, and verify the properties related to the interaction between Android applications running on different devices; can analyze the properties of a system composed of Android applications running on multiple devices, which has positive significance for developers to debug programs, improve program usability, and reduce program vulnerabilities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of program analysis and security, and in particular to a detection method and device for properties of Android application programs. Background Art

[0002] With the rapid development of smartphones, Android is increasingly used in daily life. However, as an open system, the applications developed by many developers on it bring convenience, but also contain many vulnerabilities, hidden dangers and other abnormal behaviors. These abnormal behaviors will affect the user experience of the application and may even cause privacy leakage or property loss of users. Therefore, how to ensure the correctness of Android applications, that is, to eliminate abnormal behaviors, has become an important research issue.

[0003] Most existing technologies are based on software testing, which checks whether the behavior of the application meets the requirements by executing the proposed test cases. However, software testing is limited by path coverage and can only try to find the existing abnormal behavior, but cannot prove that the abnormal behavior does not exist. Model checking can solve this problem. Its principle is to traverse the reachable state space to prove that the abnormal behavior does not exist (or find the existing abnormal behavior).

[0004] However, there are relatively few studies on applying model checking technology to Android applications at this stage, and none of them provide information on how to build a model of Android applications, how to characterize the properties to be verified, and how to apply model checking algorithms. Summary of the invention

[0005] The present invention provides a detection method and device for the properties of Android applications. A static analysis method is used to extract text information in the Activity and the jump information between each Activity from the Android application installation package. Then a model of a single application is constructed. Multiple models are combined together to construct a probabilistic multi-agent system. Finally, a probabilistic cognitive logic model detection method is used to verify whether the Android application meets the required properties.

[0006] The technical contents of the present invention include:

[0007] A method for detecting properties of an Android application, the steps comprising:

[0008] 1) For each application in different Android devices, a state graph is constructed based on the activity information and the jump information between activities, and each state graph is combined as an agent to obtain a probabilistic multi-agent system;

[0009] 2) Characterize the target properties as probabilistic cognitive logic formulas;

[0010] 3) Input the probabilistic multi-agent system and probabilistic cognitive logic formula into the model detection tool to obtain the detection results of the target properties.

[0011] Furthermore, the method for extracting Activity information and jump information between Activities includes: extracting from the application installation package using a static analysis tool.

[0012] Furthermore, the static analysis tools include: Gator or BACKSTAGE.

[0013] Furthermore, the state diagram is constructed by the following steps:

[0014] 1) Use the Activity information as the state and as the vertex of the state diagram, where the first Activity information entered after opening the application is used as the initial state;

[0015] 2) Use the jump information between Activities to build the edges of the state graph;

[0016] 3) On the corresponding edge, mark the event that triggers page migration as an action;

[0017] 4) Set the corresponding atomic proposition and state label function.

[0018] Furthermore, the elements of the state diagram also include: transition probability.

[0019] Furthermore, the probabilistic cognitive logic formula includes: a state formula and a path formula.

[0020] Furthermore, the state formula in is the state formula, p is the atomic proposition, is the negation operator, ∧ is the conjunction operator, is the probability operator, It represents four relationships: greater than, greater than or equal to, less than, and less than or equal to. d represents a real number between [0,1]. is a knowledge recognition operator, i is an intelligent agent, is the knowledge cognition operator for each person, G is the multi-agent set, is the distributed knowledge cognition operator, and ψ is the path formula.

[0021] Furthermore, the path formula is Where X is the next operator and U is the until operator. is the state formula.

[0022] A storage medium stores a computer program, wherein the computer program is configured to execute the method described above when running.

[0023] An electronic device comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer to execute the method described above.

[0024] Compared with the prior art, the present invention has the following advantages:

[0025] 1) Using model checking techniques, it is possible to prove that the property is satisfied or to give counterexamples that it is not satisfied.

[0026] 2) Ability to model systems where the same Android application runs on different devices and verify properties related to the interaction between Android applications running on different devices;

[0027] 3) It can analyze the nature of the system composed of Android applications running on multiple devices, which is of positive significance to developers in debugging programs, improving program usability and reducing program vulnerabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is a system architecture diagram of the present invention.

[0029] Figure 2 It is the work flow chart of the present invention.

[0030] Figure 3 This is a single application model of an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The present invention will be further described below by way of embodiments in conjunction with the accompanying drawings.

[0032] The detection method of the present invention builds a model from the Android application installation package file, uses a logical formula to characterize the properties to be verified, and applies a model detection algorithm. By applying this set of methods, the paths in the Android application that do not satisfy the properties can be found, or a conclusion that the properties are satisfied can be given.

[0033] 1. System composition

[0034] The system architecture of the present invention is as follows Figure 1 As shown in the figure, it is mainly composed of four modules, namely Android application parsing tool module, model building module, property input module and model detection module.

[0035] 2. Workflow

[0036] The workflow of the present invention is as follows Figure 2 As shown:

[0037] (1) First, we use static analysis tools such as Gator (http: / / web.cse.ohio-state.edu / presto / software / gator / ) and BACKSTAGE (https: / / www.st.cs.uni-saarland.de / appmining / backstage / ) to extract data from the Android application installation package, including Activity information and jump information between Activities.

[0038] (2) Then use this data to construct a state graph for a single application. The state graph for a single application includes the following elements: a finite set of states, an initial state, a finite set of actions, a state transition function, a finite set of atomic propositions, and a state label function. The specific construction method is: take the Activity as the state; take the first Activity entered after opening the application as the initial state; take the event on the page that can trigger page migration (such as clicking a button, etc.) as the action; take the jump between Activities as the migration, which involves the migration of network connections. Since there is a certain probability of failure in network transmission, it is necessary to introduce a probability factor (for example, when the user clicks the login button on the login page, the application enters the next page with a probability of 0.99 and stays on the login page with a probability of 0.01); the atomic proposition and state label function can be defined differently according to different application scenarios.

[0039] Figure 3 An example of a simple single application model is given.

[0040] (3) Then, each single application is regarded as an agent, and multiple application clients running on different devices are combined into a probabilistic multi-agent system, that is, the global state is the combination of each local state, the global action is the combination of local actions, and the global migration is the combination of local migrations. However, each agent can only obtain local information, that is, it only knows which state it is in, but does not know which state other agents are in.

[0041] (4) The properties in the present invention are characterized using probabilistic cognitive logic. This logic combines probabilistic computation tree logic and cognitive logic. This logic includes state formulas and path formulas, where the state formula

[0042]

[0043] Among them, the meaning of each element of the state formula is:

[0044] ① Atomic proposition p, such as "the value of variable s is 3";

[0045] ② Negation operator make Represents a state formula, then express Not true;

[0046] ③ Conjunction operator ∧, let and Represent two state formulas respectively, then express and Established at the same time;

[0047] ④Probability Operator in represents four relations: greater than, greater than or equal to, less than, and less than or equal to. d represents a real number between [0,1]. Let ψ represent a path formula, then The probability that ψ holds satisfies relationship.

[0048] ⑤ Cognitive operators, including knowledge Everyone's Knowledge Distributed Knowledge Where i represents an agent (in this invention, it can be a user or a client), and G is a multi-agent set. Represents a state formula, then Indicates that from the perspective of user i, the state is equivalent to the current state. are all true, that is, user i knows Established. Accordingly, It means that all users in G know Established, If users in G can share information, they can know Established.

[0049] The path formula is

[0050]

[0051] Among them, the meaning of each element of the state formula is:

[0052] ① Next operator X, let Represents a state formula, then Indicates that after the next step, Established;

[0053] ②Until operator U, let and Represent two state formulas respectively, then express It will be established after a certain step in the future, before that Has always been established.

[0054] By combining the above operators, we can express many properties, such as "user_count>=2∧K Bob s Alice = logged_in" can describe "in the whole system, the number of users is greater than 2 and user Bob knows that Alice has logged in".

[0055] (5) Finally, the probabilistic multi-agent system obtained in (3) and the property formula obtained in (4) are input into the probabilistic cognitive logic model checking tool (https: / / github.com / fuchen1991 / epmc-petl) for model checking to verify whether the properties are satisfied.

[0056] The above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. A person skilled in the art may modify or make equivalent substitutions for the technical solutions of the present invention without departing from the spirit and scope of the present invention. The protection scope of the present invention shall be subject to the claims.

Claims

1. A method for detecting properties of an Android application, comprising the following steps: 1) For each application in different Android devices, a state graph is constructed based on activity information and jump information between activities, and each state graph is combined as an agent to obtain a probabilistic multi-agent system; wherein, for each application in different Android devices, a state graph is constructed based on activity information and jump information between activities, including: The Activity information is used as the state and as the vertex of the state diagram. The first Activity information entered after opening the application is used as the initial state. Use the jump information between Activities to build the edges of the state graph; On the corresponding edge, mark the event that triggers page migration as an action; Set the corresponding atomic proposition and state label function; 2) Characterize the target properties as a probabilistic cognitive logic formula; wherein the probabilistic cognitive logic formula includes: a state formula and a path formula, the state formula p is an atomic proposition, is the negation operator, ∧ is the conjunction operator, is the probability operator, It represents four relationships: greater than, greater than or equal to, less than, and less than or equal to. d represents a real number between [0,1]. is a knowledge recognition operator, i is an intelligent agent, is the knowledge cognition operator for each person, G is the multi-agent set, is a distributed knowledge cognition operator, ψ is a path formula, and the path formula X is the next operator, and U is the until operator; 3) Input the probabilistic multi-agent system and the probabilistic cognitive logic formula into the model detection tool to obtain the detection results of the target properties.

2. The method according to claim 1, wherein The method for extracting Activity information and jump information between Activities includes: extracting from the application installation package using a static parsing tool.

3. The method according to claim 2, wherein Static analysis tools include: Gator or BACKSTAGE.

4. The method according to claim 1, wherein The elements of the state diagram also include: transition probability.

5. A storage medium storing a computer program, wherein: The computer program is configured to execute the method according to any one of claims 1 to 4 when executed.

6. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 4.