Android application privacy compliance detection method and system
By dynamically extracting and analyzing the application privacy policy, combining static and dynamic methods to obtain permissions, consistency comparison is carried out, and the problems of low detection accuracy and high false alarm rate in the existing technology are solved, and efficient Android application privacy combination is achieved. Measurement detection can detect new attack behaviors.
Patent Information
- Application Number
- CN202410461885.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-17
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-04-17
AI Technical Summary
When detecting privacy compliance of Android applications, the prior art ignores the application's functions and privacy policy information, resulting in low detection accuracy, high false alarm rate, and difficulty in detecting new attack behaviors.
By dynamically extracting the application privacy policy, analyzing the declaration permissions, combining static and dynamic methods to obtain the application application and use permissions, conducting consistency comparisons, and generating reports on excessive declarations, application and use permissions.
It realizes the detection of permission abuse problems in Android applications with low false positive rates and high accuracy, can detect new attacks, and provides detailed judgment basis to support user review.
Smart Images

Figure CN118395428B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of security detection, and specifically relates to a detection method and system for Android application privacy compliance. Background Art
[0002] With the rise of mobile Internet, the penetration rate of mobile terminal devices has increased year by year. As the operating system with the highest market share in mobile devices, Android system has a huge user scale. In contrast, security incidents targeting the Android platform have occurred frequently. Attackers have purposefully launched malicious applications on the Android platform, carried out destructive activities or stolen users' private data, causing immeasurable loss of life and property to victims. In order to strictly regulate the behavior of the application market and reduce the risk of user privacy leakage, the state has issued a series of laws and policies to impose mandatory requirements on application developers and application platforms, requiring the listed applications to comply with privacy compliance standards and protect user privacy security. This measure has effectively regulated the market chaos, but it has also brought many challenges to regulatory authorities and application platforms. On the one hand, the number of Android applications is huge, reaching millions, and the growth rate is fast, with an increase of more than 30,000 applications per month, which brings a great burden to reviewers; on the other hand, non-compliant applications may cause user privacy leakage, which will lead to serious consequences if not discovered in time. At present, the privacy compliance detection methods for Android applications mainly include manual review, static code analysis, and dynamic behavior analysis of applications. Manual review has problems such as high workload of detection personnel, easy misjudgment, and low efficiency of privacy compliance and security detection. Therefore, we should focus on static code analysis with a higher degree of automation and applied dynamic behavior analysis methods.
[0003] In terms of static code analysis, it is mainly through means such as program analysis. Before program analysis, the installation file needs to be decompiled to extract code features that can describe the application behavior, and then security detection matching is performed according to the pre-defined detection pattern features. For example, using the static code analysis method to detect whether an application has permission abuse behavior, the usual practice is to first obtain the sensitive API of the decompiled code in the application, map these sensitive APIs with Android permissions, and obtain an application permission set based on sensitive API calls. By comparing this permission set with the permission set applied by the developer in the Manifest file in the installation package, permission abuse detection can be achieved. The obvious shortcoming of this type of method is that when analyzing the program, the function of the application is not considered, and the privacy policy semantics information provided by the application is ignored. For example, for users, an alarm clock application, regardless of whether it calls the API related to READ_SMS, the user believes that the alarm clock application is not allowed to read text messages on the mobile device. If the alarm clock application has the behavior of applying for READ__SMS permission, it will be considered by the user as a malicious behavior. In addition, static code analysis methods also have problems such as low detection accuracy when facing obfuscated code analysis.
[0004] In terms of dynamic behavior analysis, the application is mainly placed in a monitored environment, and by generating application input, data that can reflect the program behavior, such as the system call sequence of the program, the trajectory of program execution, and network data packets, are collected. Then these program behavior data are compared with the pre-defined normal program behavior data. If there are some abnormal behavior data, malicious applications are detected and identified. Similarly, the dynamic behavior analysis method has the same problems as the static code analysis method. When detecting the permissions of the application, the functions of the application are ignored. In the process of dynamic program behavior analysis, the malicious behavior of the application is not considered to be related to the context of the program function. At the same time, dynamic program behavior analysis also has defects such as incomplete traversal paths. The behavior pattern needs to be defined in advance during detection, and there are related problems such as detection failure when facing new attacks. Summary of the invention
[0005] One purpose of the present invention is to address the deficiencies of the prior art and provide a method for detecting privacy compliance of Android applications. The method can efficiently detect security issues of various permission abuses in Android applications, including excessive collection, illegal collection of sensitive data, excessive application for permissions, etc. Compared with the prior art, the method has the advantages of low false alarm rate, high accuracy, and the ability to detect new attacks.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] A method for detecting privacy compliance of an Android application comprises the following steps:
[0008] Step 1: Dynamically extract the application privacy policy and parse the declared permissions;
[0009] Step 2: statically obtain the application's application permissions and privileged behaviors;
[0010] Step 3: Monitor the calls of privileged APIs during application use;
[0011] Step 4: According to the mapping relationship between privileged APIs and permissions, the API call results obtained by the dynamic and static methods are integrated to obtain the permissions actually used when the application is running;
[0012] Step 5: Perform consistency comparison on the declared permissions, applied permissions, and actually used permissions to obtain a report on excessively declared permissions, excessively applied permissions, and excessively used permissions.
[0013] Furthermore, step 1 specifically includes the following steps:
[0014] Step 1.1, automatically install and run the application to be tested according to the installation package of the application to be tested, and detect whether a pop-up window is displayed to explain the privacy policy to the user when the application is run for the first time;
[0015] Step 1.2: If a privacy policy pop-up box is detected, the text in the pop-up box is further obtained, and a link text in the pop-up box that jumps to the full privacy policy content is triggered by a simulated click event;
[0016] Step 1.3, crawl the complete privacy policy text content;
[0017] Step 1.4, extract the declared permissions from the privacy policy using predefined keywords and keyword matching methods.
[0018] Furthermore, the specific implementation of step 1.1 is as follows:
[0019] Use command line commands to automatically install the application installation package and start the application to ensure that the application is running for the first time. After starting the application, check whether there is a pop-up window on the interface.
[0020] When a pop-up window appears, whether the pop-up window contains keywords such as privacy and policy is detected to identify whether the pop-up window is a privacy policy notification pop-up window.
[0021] Furthermore, the specific implementation of step 1.2 is as follows:
[0022] By identifying UI controls and locating the position range of the pop-up box, the app's privacy policy is fully displayed in the privacy policy notification pop-up box. By simulating the user's scrolling, the privacy policy text in the pop-up box is extracted;
[0023] For apps that do not fully display the privacy policy in the privacy policy notification pop-up box, the privacy policy is provided as a link text for users to click and view. At this time, by simulating user click events, each pixel within the pop-up interface is clicked to identify whether the interface has jumped. When the jump occurs, different processing methods are used to extract the privacy policy of the app depending on whether the jump is within the app or outside the app.
[0024] Furthermore, for the application that has been redirected, the method for extracting the privacy policy of the application is:
[0025] When the jump is within the app, two methods are used to obtain the privacy policy of the app: one is to continue to identify the text content displayed on the interface through the UI control; the other is that when the app displays the complete privacy policy content in the form of WebView, different rendering methods are used, resulting in the privacy policy text content being unable to be recognized. At this time, the Wi-Fi and data connection of the test machine is cut off, making the test machine offline. At this time, the jump interface shows that it is inaccessible and gives a link to the network resource to be accessed, which is the privacy policy link of the app;
[0026] When the jump is outside the application, it means that the privacy policy of the application is opened by the browser. Then, by setting the default browser in the test machine, locating the control position, and automatically extracting the link address of the application jump, that is, the privacy policy link of the application.
[0027] Furthermore, step 3 specifically includes:
[0028] Step 3.1, hook all privileged APIs in the test machine, and record the calls of privileged APIs before they are actually executed;
[0029] Step 3.2, automatically trigger the application behavior, simulate the interaction process between the application and the user by simulating events such as user clicks, stop running the application after executing a certain number of interaction events, and obtain the privileged API call status of the application during this period.
[0030] Furthermore, step 4 specifically includes:
[0031] Step 4.1, obtain the mapping relationship between privileged API and permissions under each Android system version;
[0032] Step 4.2, integrating the application privilege API call information obtained by static and dynamic methods;
[0033] Step 4.3, according to the privileged API call situation of the application, combined with the mapping relationship between the privileged API and the permission, obtain the permission information used by the application.
[0034] Furthermore, the specific implementation of step 4.1 is as follows:
[0035] Step 4.1.1, scan the source code of each Android system version, and obtain the correspondence between privileged APIs and permissions based on the comments of system APIs in the source code;
[0036] Step 4.1.2, scan the official Android developer documentation and build the correspondence between privileged APIs and permissions according to the description in the documentation;
[0037] Step 4.1.3, obtain all APIs of each Android system version through reflection, then construct a zero-privilege Android application sample, call each collected API one by one, and determine the correspondence between privileged APIs and permissions based on the compiler's error report;
[0038] Step 4.1.4, integrate the correspondence between privileged API and permissions obtained by the above method to obtain the final mapping of privileged API and permissions.
[0039] Furthermore, step 5 specifically includes:
[0040] Step 5.1: When there is a situation where the permissions declared in the privacy policy are not applied for, report the excessive declaration of permissions by the application;
[0041] Step 5.2: When an app applies for permissions that are not stated in the privacy policy, report the app's excessive application for permissions;
[0042] Step 5.3: When the permissions used by the app are not declared in the privacy policy, that is, the app not only applies for but also uses the permissions excessively, a report on the app's excessive use of permissions is made.
[0043] Another object of the present invention is to provide a system for implementing the above-mentioned Android application privacy compliance detection method, characterized in that it includes the following steps:
[0044] The declared permissions parsing module is used to dynamically extract the application privacy policy and parse the declared permissions therein;
[0045] The application permission and privilege behavior acquisition module is used to statically obtain the application application permissions and privilege behaviors by decompiling the installation package of the application to be tested;
[0046] The privileged API monitoring module is used to monitor the calling of privileged APIs during application use;
[0047] The actual usage permission acquisition module is used to integrate the API call results obtained by dynamic and static methods according to the mapping relationship between privileged APIs and permissions, and obtain the permissions actually used when the application is running;
[0048] The application excessive permission acquisition module is used to compare the declared permissions, applied permissions, and actually used permissions for consistency, and obtain reports on excessive application of permissions, excessive application of permissions, and excessive use of permissions.
[0049] Compared with the prior art, the beneficial effects of the present invention are as follows: starting from the discovery of application functions disclosed in the application privacy policy, the present invention combines the application application and usage permissions to make a judgment on whether the application has privacy compliance issues and gives a report on the basis of the judgment for user review. Compared with traditional program analysis and dynamic behavior analysis methods, the present invention can efficiently detect security issues of various permission abuses in Android applications, and has the characteristics of low false alarm rate, high accuracy, and the ability to detect new attacks. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is a flowchart of a method for detecting privacy compliance of Android applications according to an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The technical solutions in the embodiments of the present invention will be described clearly and completely below in combination with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0053] The present invention will be further described below in conjunction with specific embodiments, but the present invention is not limited thereto.
[0054] A privacy policy is a normative document. The "Information Security Technology—Personal Information Security Specification" (GB / T35273—2020) provides a privacy policy template, which should include seven parts: the collection of personal information, the storage of personal information, the use of personal information, the rights of the subject of personal information, the entrusted processing of personal information, sharing, transfer, public disclosure, and the organization's personal information security management requirements. The content of the privacy policy indicates to users what user information the application needs to collect, and Android uses a permission mechanism to protect the security of user information. Permissions closely related to privacy information are considered dangerous permissions. Based on this, an embodiment of the present invention analyzes the text related to the collection of user information in the application privacy policy from the perspective of permissions and obtains a set of declared permissions with certain legal effect. Combined with the permissions applied for by the application in the code and the permissions actually used during operation, it detects whether there are excessive or default statements on the rules for collecting and using personal information in the application's privacy policy.
[0055] The embodiment of the present invention discloses a method for detecting Android application privacy compliance, which specifically includes three parts: extraction and analysis of application privacy policy, extraction of application application and usage permission, and consistency comparison of application declaration, application and usage permission set. The framework flow chart is shown in Figure 1 As shown, the steps are:
[0056] Extraction and parsing of application privacy policies
[0057] Step 1: Dynamically extract the application privacy policy and parse the declared permissions. The dynamic extraction of the privacy policy here includes the judgment of whether the application has a privacy policy reminder. According to the "Method for Identifying Illegal and Irregular Collection and Use of Personal Information by Apps", "not prompting users to read the privacy policy and other collection and use rules through pop-ups or other obvious means when the App is first run" is considered an illegal and irregular behavior of "undisclosed collection and use rules". Therefore, it is determined whether the application has a privacy policy reminder by detecting whether the application informs users of the privacy policy in the form of an obvious pop-up box. For applications with privacy policy notification pop-ups, further collect the pop-up box content. For text with jump links in the pop-up box content, further collect the jump link content to obtain the complete application privacy policy. The purpose of this step is to extract the declared permissions in the privacy policy, so it is also necessary to parse the extracted privacy policy to obtain the application's declared permissions list. The details are as follows:
[0058] Step 1.1, automatically install and run the application to be tested according to the installation package of the application to be tested, and check whether a pop-up box is displayed to explain the privacy policy to the user when the application is run for the first time. After obtaining the installation package of the application to be tested, the application can be automatically installed and run on the test machine through command line commands. At this time, it can be guaranteed that the application is run for the first time, and then check the existence of the privacy policy pop-up box. The purpose of this step is to filter out the illegal applications of "undisclosed collection and use rules" and report and warn, as follows:
[0059] Step 1.1.1, automatically install the application installation package and start the application through the command line command, wait for a few seconds, and then check whether there is a pop-up window on the interface. Some applications may have opening screen ads, so after starting the application, wait for 5 seconds to eliminate the interference caused by ads, and then check the pop-up window;
[0060] Step 1.1.2: When a pop-up window appears, identify whether the pop-up window is a privacy policy notification pop-up window by detecting whether keywords such as "privacy" and "policy" appear in the pop-up window. Since the privacy policy pop-up window is used to inform users of the user information and usage that the application needs to collect and obtain user consent, the privacy pop-up window interface usually informs users in an obvious way that this pop-up window is a privacy policy pop-up window, which contains sensitive words such as "privacy", "policy", "user agreement", and "personal information".
[0061] Step 1.2: If a privacy policy pop-up box is detected, the text in the pop-up box is further obtained, and a link text in the pop-up box that jumps to the full privacy policy content is triggered by a simulated click event, as follows:
[0062] Step 1.2.1, locate the position of the pop-up box by identifying the UI control, and extract the text in the pop-up box completely by simulating the user's scrolling. This is the first step to extract the privacy policy of the application. Some applications directly display the privacy policy of the application in the privacy policy notification pop-up box;
[0063] Step 1.2.2: For apps that do not fully display the privacy policy in the privacy policy notification pop-up box, the privacy policy will be displayed in the form of a link text for users to click and view. At this time, by simulating a user click event, click each pixel within the pop-up interface, and identify whether a jump has occurred by observing whether the interface changes. When a jump occurs, different processing methods are used to extract the privacy policy of the app depending on whether the jump is within the app or outside the app. When the jump is within the application, two methods are used to obtain the privacy policy of the application: one is to continue to obtain the text content displayed on the interface through UI control identification; the other is that because the application may display the complete privacy policy content in the form of WebView, the use of different rendering methods will cause the privacy policy text content to be unrecognizable. At this time, the Wi-Fi and data connection of the test machine can be cut off to make the test machine offline. The privacy policy of the application is usually pulled through network resources, so its jump interface will show that it is inaccessible and give a link to the network resource to be accessed, that is, the privacy policy link of the application; when the jump is outside the application, it means that the privacy policy of the application is opened by the browser. At this time, the default browser in the test machine can be set to locate the control position and automatically extract the link address of the application jump, that is, the privacy policy link of the application; after obtaining the privacy policy link of the application, crawl the web page content of the corresponding link as the complete privacy policy text of the application.
[0064] Step 1.3, crawl the web page content that you jump to. The privacy policy text in some links is a dynamic page, and direct crawling cannot obtain the dynamic page content. Therefore, Selenium can be used to simulate the actual browser opening link process to obtain the privacy policy text displayed on the dynamic page. In addition, different web pages use different encoding methods, and direct acquisition may obtain garbled text. Therefore, you need to pay attention to the encoding method of the page and decode it according to its web page encoding method to obtain the normally displayed web page text.
[0065] Step 1.4, for the obtained privacy policy text, the mapping from the privacy policy text to the permissions is achieved by pre-defining keywords and matching keywords. For example, if keywords such as "microphone", "recording", and "audio" appear in the text, it is considered that the application has applied for the use of the microphone permission group, and the permissions in the microphone permission group are all declared permissions of the application. Keywords are collected manually by reviewing the privacy policy texts of the top 100 most popular applications in the app store, and the keywords that best represent various permission groups are selected and continuously expanded.
[0066] 2. Application and permission extraction
[0067] Step 2: Statically obtain the application's application permissions and privileges. Application developers will apply for the required permissions in AndroidManifest.xml, but the application may not actually use these permissions, so there may be security issues of excessive application for permissions, as follows:
[0068] Step 2.1: Use the decompilation tool apktool to unpack and decompile the application installation package to obtain the application source code in smali format;
[0069] Step 2.2: The application source code obtained contains the application manifest configuration file AndroidManifest.xml, which contains the permissions applied for by the application. <uses-permission>Tags obtain application permission information;
[0070] Step 2.3, use the static analysis tool Androguard to extract the methods called in the application. The principle is that after decompiling the application installation package and obtaining the application source code, you can traverse each class in the source code package and extract all method signatures in each class for matching with the privileged API, thereby obtaining all methods called in the application source code.
[0071] Step 3: Monitor the calls of privileged APIs during the use of the application. The method used in step 2 to obtain the privileged APIs of the application is static code analysis. The limitation of static code analysis is that it cannot resist the interference of obfuscation technology. Therefore, dynamic analysis is needed to obtain the privileged APIs actually called by the application. The details are as follows:
[0072] Step 3.1, hook all privileged APIs in the test machine, and record the calls of privileged APIs before they are actually executed, so that the application will run in a monitored environment;
[0073] Step 3.2, automatically trigger application behavior, simulate the interaction process between the application and the user by simulating events such as user clicks, and after executing a certain number (10,000 in this embodiment) of interaction events, stop running the application and obtain the privileged API call status of the application during this period.
[0074] Step 4: According to the mapping relationship between privileged API and permissions, the API call results obtained by dynamic and static methods are integrated to obtain the permissions actually used when the application is running. The details are as follows:
[0075] Step 4.1, obtain the mapping relationship between privileged API and permissions under each Android system version. The current mapping relationship between privileged API and permissions is outdated, cannot adapt to the latest system, and has low accuracy. Therefore, it is necessary to first establish a more comprehensive and accurate API-permission mapping relationship, as follows:
[0076] Step 4.1.1, scan the source code of each Android system version, and obtain the correspondence between privileged APIs and permissions based on the comments of system APIs in the source code;
[0077] Step 4.1.2, scan the official Android developer documentation and build the correspondence between privileged APIs and permissions according to the description in the documentation;
[0078] Step 4.1.3, obtain all APIs of each Android system version through reflection, then construct a zero-privilege Android application sample, call each collected API one by one, and determine the correspondence between privileged APIs and permissions based on the compiler's error report;
[0079] Step 4.1.4, integrate the correspondence between privileged API and permissions obtained by the above method to obtain the final mapping of privileged API and permissions.
[0080] Step 4.2, integrating the application privilege API call information obtained by static and dynamic methods;
[0081] Step 4.3, according to the privileged API call situation of the application, combined with the mapping relationship between the privileged API and the permission, obtain the permission information used by the application.
[0082] 3. Comparison of the consistency of application declaration, application and usage permission sets
[0083] Step 5: Compare the declared permissions, applied permissions, and used permissions for consistency, as follows:
[0084] Step 5.1: When there is a situation where the permissions declared in the privacy policy are not applied for, report the excessive declaration of permissions by the application;
[0085] Step 5.2: When an app applies for permissions that are not stated in the privacy policy, report the app's excessive application for permissions;
[0086] Step 5.3: When the permissions used by the app are not declared in the privacy policy, that is, the app not only applies for but also uses the permissions excessively, a report on the app's excessive use of permissions is made.
[0087] Ultimately, you can get a report on whether the app under test has "undisclosed collection and use rules", excessive declarations, excessive applications, and excessive use of permissions. Users can further determine the harmfulness of the app based on the dangerous permissions involved in the report.
[0088] From the above description, it can be seen that the embodiment of the present invention starts from the discovery of application functions disclosed by the application privacy policy, combines the application application and usage permissions, makes a judgment on whether the application has privacy compliance issues, and gives a report on the basis of the judgment for user review. Compared with traditional program analysis and dynamic behavior analysis methods, the method of the present invention has the characteristics of low false alarm rate, high accuracy, and the ability to detect new attacks.
[0089] The embodiment of the present invention further provides a system for implementing the above-mentioned Android application privacy compliance detection method, comprising the following steps:
[0090] The declared permissions parsing module is used to dynamically extract the application privacy policy and parse the declared permissions therein;
[0091] The application permission and privilege behavior acquisition module is used to statically obtain the application application permissions and privilege behaviors by decompiling the installation package of the application to be tested;
[0092] The privileged API monitoring module is used to monitor the calling of privileged APIs during application use;
[0093] The actual usage permission acquisition module is used to integrate the API call results obtained by dynamic and static methods according to the mapping relationship between privileged APIs and permissions, and obtain the permissions actually used when the application is running;
[0094] The application excessive permission acquisition module is used to compare the declared permissions, applied permissions, and actually used permissions for consistency, and obtain reports on excessive application of permissions, excessive application of permissions, and excessive use of permissions.
[0095] The above are only preferred embodiments of the present invention, and are not intended to limit the implementation methods and protection scope of the present invention. Those skilled in the art should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the contents of the specification of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting privacy compliance of Android applications, characterized in that: The steps include: Step 1: Dynamically extract the application privacy policy and parse the declared permissions; Step 2: statically obtain the application's application permissions and privileged behaviors; Step 3: Monitor the calls of privileged APIs during application use; Step 4: According to the mapping relationship between privileged APIs and permissions, the API call results obtained by the dynamic and static methods are integrated to obtain the permissions actually used when the application is running; Step 5: Compare the declared permissions, applied permissions, and actually used permissions for consistency, and obtain reports on excessively declared permissions, excessively applied permissions, and excessively used permissions, respectively; Step 4 specifically includes: Step 4.1, obtain the mapping relationship between privileged API and permissions under each Android system version; Step 4.2, integrating the application privilege API call information obtained by static and dynamic methods; Step 4.3, according to the privileged API call of the application, combined with the mapping relationship between the privileged API and the permissions, obtain the permission information used by the application; The specific implementation method of step 4.1 is: Step 4.1.1, scan the source code of each Android system version, and obtain the correspondence between privileged APIs and permissions based on the comments of system APIs in the source code; Step 4.1.2, scan the official Android developer documentation and build the correspondence between privileged APIs and permissions according to the description in the documentation; Step 4.1.3, obtain all APIs of each Android system version through reflection, then construct a zero-privilege Android application sample, call each collected API one by one, and determine the correspondence between privileged APIs and permissions based on the compiler's error report; Step 4.1.4, integrate the correspondence between privileged API and permissions obtained by the above method to obtain the final mapping of privileged API and permissions.
2. The method for detecting Android application privacy compliance according to claim 1, characterized in that: Step 1 specifically includes the following steps: Step 1.1, automatically install and run the application to be tested according to the installation package of the application to be tested, and detect whether a pop-up window is displayed to explain the privacy policy to the user when the application is run for the first time; Step 1.2: If a privacy policy pop-up box is detected, the text in the pop-up box is further obtained, and a link text in the pop-up box that jumps to the full privacy policy content is triggered by a simulated click event; Step 1.3, crawl the complete privacy policy text content.
3. The method for detecting Android application privacy compliance according to claim 2, characterized in that: The specific implementation of step 1.1 is as follows: Use command line commands to automatically install the application installation package and start the application to ensure that the application is running for the first time. After starting the application, check whether there is a pop-up window on the interface. When a pop-up window appears, whether the pop-up window contains keywords such as privacy and policy is detected to identify whether the pop-up window is a privacy policy notification pop-up window.
4. The method for detecting Android application privacy compliance according to claim 2, characterized in that: The specific implementation method of step 1.2 is: By identifying UI controls and locating the position range of the pop-up box, the app's privacy policy is fully displayed in the privacy policy notification pop-up box. By simulating the user's scrolling, the privacy policy text in the pop-up box is extracted; For apps that do not fully display the privacy policy in the privacy policy notification pop-up box, the privacy policy is provided in the form of a link text for users to click and view. By simulating user click events, each pixel within the pop-up interface is clicked to identify whether the interface has jumped. When the jump occurs, different processing methods are used to extract the privacy policy of the app depending on whether the jump is within the app or outside the app.
5. The method for detecting Android application privacy compliance according to claim 4, characterized in that: For apps that are redirected, the method to extract the app's privacy policy is: When the jump is within the app, two methods are used to obtain the privacy policy of the app: one is to continue to identify the text content displayed on the acquisition interface through the UI control; the other is to cut off the Wi-Fi and data connection of the test machine to make the test machine offline. At this time, the jump interface shows that it is inaccessible and gives a link to the network resource to be accessed, which is the privacy policy link of the app; When the jump is outside the application, it means that the privacy policy of the application is opened by the browser. Then, by setting the default browser in the test machine, locating the control position, and automatically extracting the link address of the application jump, that is, the privacy policy link of the application.
6. The method for detecting Android application privacy compliance according to claim 1, characterized in that: Step 3 specifically includes: Step 3.1, hook all privileged APIs in the test machine, and record the calls of privileged APIs before they are actually executed; Step 3.2, automatically trigger the application behavior, simulate the interaction process between the application and the user by simulating events such as user clicks, stop running the application after executing a certain number of interaction events, and obtain the privileged API call status of the application during this period.
7. The method for detecting Android application privacy compliance according to claim 1, characterized in that: Step 5 specifically includes: Step 5.1: When there is a situation where the permissions declared in the privacy policy are not applied for, report the excessive declaration of permissions by the application; Step 5.2: When an app applies for permissions that are not stated in the privacy policy, report the app's excessive application for permissions; Step 5.3: When the permissions used by the app are not declared in the privacy policy, that is, the app not only applies for but also uses the permissions excessively, a report on the app's excessive use of permissions is made.
8. A system for implementing the Android application privacy compliance detection method according to any one of claims 1 to 7, characterized in that: The steps include: The declared permissions parsing module is used to dynamically extract the application privacy policy and parse the declared permissions therein; The application permission and privilege behavior acquisition module is used to statically obtain the application application permissions and privilege behaviors by decompiling the installation package of the application to be tested; The privileged API monitoring module is used to monitor the calling of privileged APIs during application use; The actual usage permission acquisition module is used to integrate the API call results obtained by dynamic and static methods according to the mapping relationship between privileged APIs and permissions, and obtain the permissions actually used when the application is running; The application excessive permission acquisition module is used to compare the declared permissions, applied permissions, and actually used permissions for consistency, and obtain reports on excessive application of permissions, excessive application of permissions, and excessive use of permissions.
