Permission monitoring processing method, device, computer equipment and medium
By intercepting the calls to the permission interface by third-party SDKs and executing monitoring rules, the problems of inefficient auditing and detection of private data acquisition codes in the existing technology are solved, and automatic control of third-party SDKs and effective protection of private data are achieved.
Patent Information
- Application Number
- CN202011086749.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-12
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-10-12
AI Technical Summary
The existing technology requires a lot of labor costs when reviewing third-party SDKs, which is inefficient and cannot effectively detect the privacy information acquisition code added by third-party SDKs during upgrade and updates.
通过拦截第三方SDK对权限接口的调用,确定并执行监控处理规则,插入注入点以监控权限接口调用,实现对第三方SDK的自动管控。
It improves control over third-party SDKs, reduces the need for manual audits, enhances the protection of private data, and improves the audit efficiency of third-party SDKs.
Smart Images

Figure CN112199720B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to computer technology, and in particular to a permission monitoring processing method, device, computer equipment and medium. Background Art
[0002] On current mobile devices, if an application applies for a certain system permission or has access to certain private data, all software development kits (SDKs) within it can use the permission at will and share the private data obtained by the application.
[0003] In order to solve the third-party privacy issue, application (APP) manufacturers often take the approach of decompiling and reverse code auditing before connecting to the third-party SDK. If they find that the third-party SDK is non-compliant, they will refuse to connect to the SDK or require them to make corrections.
[0004] In the process of implementing the present invention, the inventors found that the prior art has the following defects: the audit method requires a lot of manpower costs and the audit efficiency is low. In addition, during the upgrade and update process of the third-party SDK after access, hidden code for obtaining user privacy information may be added to the upgrade code, and the above upgrade code cannot be effectively detected in manual audits. Summary of the invention
[0005] The embodiments of the present invention provide a permission monitoring processing method, apparatus, computer equipment and medium, which can realize automatic control of a third-party SDK access to a privacy interface by an application.
[0006] In a first aspect, an embodiment of the present invention provides a permission monitoring processing method, including:
[0007] When detecting that a target third-party SDK embedded in the application program calls a target permission interface, intercepting the call;
[0008] According to the target third-party SDK and / or the target permission interface, a matching monitoring and processing rule is determined, and the monitoring and processing rule is executed.
[0009] In a second aspect, an embodiment of the present invention further provides a permission monitoring processing method, including:
[0010] Among the third-party SDKs embedded in the application installation package, identifying at least one high-level interpreted language SDK as a preprocessing SDK;
[0011] In each of the pre-processing SDKs, scan and obtain each permission interface call statement respectively;
[0012] Insert an injection point in the line before each permission interface call statement, and set the notification function of each injection point to the permission monitoring processing interface;
[0013] The return position of each permission monitoring processing interface is set to the line after the position of the matching permission interface call statement;
[0014] The permission monitoring and processing interface is used to execute matching monitoring and processing rules according to the permission interface called by the pre-processing SDK during the running of the application.
[0015] In a third aspect, an embodiment of the present invention further provides a permission monitoring processing device, including:
[0016] A call interception module is used to intercept the call when it is detected that the target third-party SDK embedded in the application program calls the target permission interface;
[0017] The rule execution module is used to determine the matching monitoring and processing rules according to the target third-party SDK and / or the target permission interface, and execute the monitoring and processing rules.
[0018] In a fourth aspect, an embodiment of the present invention further provides a permission monitoring processing device, including:
[0019] An SDK identification module, used to identify at least one high-level interpreted language SDK as a pre-processing SDK among third-party SDKs embedded in the application installation package;
[0020] A statement scanning module, used to scan and obtain the calling statements of each permission interface in each of the pre-processing SDKs;
[0021] An interface setting module, used to insert an injection point in the line before each permission interface call statement, and set the notification function of each injection point to the permission monitoring processing interface;
[0022] A position setting module, used to set the return position of each permission monitoring processing interface to the line after the position of the matching permission interface call statement;
[0023] The permission monitoring and processing interface is used to execute matching monitoring and processing rules according to the permission interface called by the pre-processing SDK during the running of the application.
[0024] In a fifth aspect, an embodiment of the present invention further provides a computer device, the computer device comprising:
[0025] one or more processors;
[0026] a storage device for storing one or more programs,
[0027] When the one or more programs are executed by the one or more processors, the one or more processors implement the permission monitoring processing method provided by any embodiment of the present invention.
[0028] In a sixth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute a permission monitoring processing method as provided in any embodiment of the present invention.
[0029] The embodiment of the present invention intercepts the call to the target permission interface when it is detected that the target third-party SDK embedded in the application program calls the call, determines the matching monitoring and processing rules based on the target third-party SDK and / or the target permission interface, and executes the monitoring and processing rules. The embodiment of the present invention controls the target third-party SDK to call the target permission interface according to the monitoring and processing rules, thereby achieving automatic management and control of the third-party SDK's access to the privacy interface and strengthening the control over the third-party SDK. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a flowchart of a permission monitoring processing method provided by Embodiment 1 of the present invention;
[0031] Figure 2 is a flow chart of another permission monitoring processing method provided by Embodiment 2 of the present invention;
[0032] Figure 3 This is a system architecture diagram of an application provided by Embodiment 2 of the present invention;
[0033] Figure 4 is a flowchart of another permission monitoring processing method provided by Embodiment 3 of the present invention;
[0034] Figure 5 It is a schematic diagram of the working principle of a permission monitoring processing method provided by Embodiment 3 of the present invention when the target third-party SDK is a compiled language SDK;
[0035] Figure 6 It is a schematic diagram of the working principle of a permission monitoring processing method provided by Embodiment 3 of the present invention when the target third-party SDK is a high-level interpreted language SDK;
[0036] Figure 7 is a flow chart of another permission monitoring processing method provided by Embodiment 4 of the present invention;
[0037] Figure 8 It is a structural diagram of a permission monitoring processing device provided by Embodiment 5 of the present invention;
[0038] Fig. 9 It is a structural diagram of a permission monitoring processing device provided by Embodiment 6 of the present invention;
[0039] Fig.10 A schematic diagram of the structure of a computer device provided in Embodiment 7 of the present invention. DETAILED DESCRIPTION
[0040] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0041] Embodiment 1
[0042] Figure 1 This is a flowchart of a permission monitoring method provided by the first embodiment of the present invention. This embodiment is applicable to the case of managing the permissions of a third-party SDK accessed within an application. The method can be executed by a permission monitoring device, which can be implemented in software and / or hardware and can generally be integrated into the application in the form of an SDK, plug-in or program code. Figure 1 As shown, the method includes:
[0043] Step S101: When it is detected that a target third-party SDK embedded in an application program calls a target permission interface, the call is intercepted.
[0044] The application program may be a collection of various programming languages that can be used by users, and programs compiled in various programming languages, to meet the application needs of users, for example, it may include self-integrated general applications and embedded third-party SDKs.
[0045] A third-party SDK can be a toolkit provided by a third-party service provider to implement specific functions. It is used to provide additional application functions to users by loading when the application is started. For example, it can be a toolkit that provides hardware services such as Android development tools, or a toolkit that provides software functions such as image recognition technology, mobile payment technology, or resource sharing technology. The target third-party SDK is the third-party SDK that calls the target permission interface in the third-party SDK embedded in the application.
[0046] The permission interface may be a permission interface for obtaining user privacy data in a mobile terminal. For example, the permission interface may be an interface for obtaining privacy data such as an address book, International Mobile Equipment Identity (IMEI), private file reading and writing, or establishing a network connection; or, the permission interface may also be an interface for enabling a service in a terminal device for obtaining user privacy data, for example, the permission interface may also be an access interface for hardware such as a camera or microphone.
[0047] For example, when it is detected that the embedded target third-party SDK calls the address book interface to obtain the address book data recorded in the user's mobile phone, the call will be intercepted.
[0048] Optionally, a hook may be pre-set in each third-party SDK within the application at the location of the permission interface for obtaining privacy data, and when it is detected that the embedded target third-party SDK calls the target permission interface, the call is intercepted by the hook.
[0049] A hook can be understood as a program segment that processes messages. It is used to capture and intercept the call request when the target third-party SDK needs to send a call request to the target permission interface to call the target permission interface. The hook can be set up in an inline hook, a global offset table (GOT) hook, a procedure linkage table (PLT) hook, a java hook, or a JavaScript patch (JSPatch).
[0050] In this embodiment, by using hook technology to intercept the third-party SDK's access to the permission interface, it is possible to avoid intrusive modification of the code of each third-party SDK in the application, thereby strengthening the permission control of each third-party SDK during the operation of the application.
[0051] Step S102: Determine matching monitoring and processing rules according to the target third-party SDK and / or target permission interface, and execute the monitoring and processing rules.
[0052] In an optional implementation of this embodiment, a mapping relationship table between the target third-party SDK and / or target permission interface and the monitoring processing rules can be established in advance, and the matching monitoring processing rules can be determined by querying the mapping relationship table.
[0053] Optionally, only a mapping relationship table between the identification information of the third-party SDK and the monitoring and processing rules can be established, or only a mapping relationship table between the identification information of the permission interface and the monitoring and processing rules can be established, or a mapping relationship table between the identification information of the third-party SDK, the identification information of the permission interface and the monitoring and processing rules can be established at the same time. The monitoring and processing rules can be the calling rules of the target third-party SDK for the target permission interface, which are used to determine whether the third-party SDK can call the target permission interface. The monitoring and processing rules can be pre-set by the user in the application, and the user can record the monitoring and processing logic corresponding to all third-party SDKs and target permission interfaces in the application in the monitoring and processing rules in advance.
[0054] For example, the monitoring and processing rules can record which third-party SDKs can call the permission interface normally, which third-party SDKs need to pop up the application permission pop-up window, which third-party SDKs need to provide pseudo-privacy data, or which third-party SDKs must enter a specific page to have specific permissions to call, and other monitoring and processing logic related to third-party SDKs. The monitoring and processing rules can also record which permission interfaces can be called normally, which permission interfaces need to pop up the application permission pop-up window when called, which permission interfaces need to provide pseudo-privacy data when called, or which permission interfaces must enter a specific page when called to be called, and other monitoring and processing logic related to permission interfaces.
[0055] The embodiment of the present invention intercepts the call when it detects that the target third-party SDK embedded in the application calls the target permission interface, determines the matching monitoring and processing rules according to the target third-party SDK and / or the target permission interface, and executes the monitoring and processing rules. The embodiment of the present invention realizes automatic management and control of the third-party SDK's access to the privacy interface by controlling the target third-party SDK to call the target permission interface according to the monitoring and processing rules, thereby strengthening the control over the third-party SDK.
[0056] It should be noted that there are many ways to integrate the permission monitoring processing method provided in the embodiment of the present invention into the application program, which may specifically include but are not limited to:
[0057] 1. Integrate into an SDK (such as .podspec, .aar, .jar, .so or .a file) and integrate it into the application;
[0058] 2. Integrate into a gradle plugin, maven plugin or cosoapod plugin and integrate into the application;
[0059] 3. Develop a one-click integration platform to facilitate users to upload apk or ipa, and then automatically generate the application installation package apk ipa that has integrated this solution;
[0060] 4. Manual integration by developers. Developers integrate operations through the technology middle platform, thus achieving technical requirements for data compliance with low investment.
[0061] Embodiment 2
[0062] Figure 2 is a flow chart of another permission monitoring processing method provided by Embodiment 2 of the present invention. This embodiment is optimized on the basis of the above embodiment. Figure 2 As shown, the method includes:
[0063] Step S201: When it is detected that a target third-party SDK embedded in an application program calls a target permission interface, the call is intercepted.
[0064] Figure 3 This is a system architecture diagram of an application provided by Embodiment 2 of the present invention. Figure 3 As shown, the system architecture of the application may include an application layer, a system layer, and a privacy management layer. The application layer may include application business codes and third-party SDKs. Among them, the application business code may be understood as other code modules other than the third-party SDK, and the third-party SDK may be understood as a third-party SDK that needs to be monitored. The system layer may include a permission interface, an application permission pop-up window, and an application programming interface (Application Programming Interface, API) hook. Among them, the application permission pop-up window of the system layer may be understood as when the permission interface is called for the first time, the permission application interface of the system layer needs to be called first, and the permission application interface pops up. The user can obtain the permission only after agreeing. The API hook is used to intercept the target third-party SDK from calling the target permission interface. The privacy management layer may include monitoring processing rules. The monitoring processing rules may at least include normal calls to the permission interface, pop-ups of application permission pop-ups, and / or providing pseudo-privacy data. Among them, the pop-up application permission pop-up window may be understood as a permission pop-up window at the SDK level. The monitoring processing rules may also include real-time recording of the calls to the permission interface by each third-party SDK under different monitoring processing rules through monitoring logs.
[0065] It should be noted that the hook provided in the embodiment of the present invention is not limited to API hook, and any method that can intercept calls falls within the scope of protection of the present invention.
[0066] Step S202: Determine matching monitoring and processing rules according to the target third-party SDK and / or target permission interface, and execute steps S203, S204, and S205 respectively.
[0067] In this embodiment, the monitoring processing rules may include normal calling of the permission interface, popping up an application permission pop-up window and / or providing pseudo-privacy data. It should be noted that the monitoring processing rules may also include other rules, which are not described in detail in this embodiment of the present invention.
[0068] Step S203, monitor whether the processing rule is a normal call permission interface, if so, execute step S206, otherwise return to execute step S202.
[0069] Step S204, monitor whether the processing rule is to pop up an application permission pop-up window, if so, execute step S207, otherwise return to execute step S202.
[0070] Step S205: monitor whether the processing rule is to provide pseudo-privacy data. If so, execute step S209; otherwise, return to execute step S202.
[0071] Step S206: calling the target permission interface, and providing the calling result fed back by the target permission interface to the target third-party SDK.
[0072] Specifically, according to the target third-party SDK and / or the target permission interface, it is determined that the matched monitoring processing rule is a normal call permission interface, and the target third-party SDK is allowed to call the target permission interface normally. The target permission interface can feedback the call result and provide the call result to the target third-party SDK. Among them, the call result is used to reflect the call status of the target third-party SDK to the target permission interface, for example, it can include the call status and / or call record, etc.
[0073] For example, when a certain SDK is detected to call IMEI, the call is intercepted, and the SDK and IMEI are matched with the preset monitoring processing rules corresponding to the SDK and IMEI. If the SDK can directly call IMEI, the call is directly executed.
[0074] Step S207, detecting whether confirmation authorization information for authorizing the target third-party SDK to call the target permission interface is currently stored, if so, executing step S206, otherwise executing step S208.
[0075] The confirmation authorization information may be the authorization information stored in the application that allows the target third-party SDK to directly call the target permission interface. If the confirmation authorization information for the target third-party SDK to call the target permission interface is currently stored, the target permission interface is called, and the call result fed back by the target permission interface is provided to the target third-party SDK.
[0076] Step S208: pop up an application permission pop-up window in the display interface, and upon receiving a confirmation authorization response corresponding to the application permission pop-up window, store confirmation authorization information for authorizing the target third-party SDK to call the target permission interface.
[0077] The application permission pop-up window can be an application permission application dialog box, which is used to obtain the confirmation authorization response information or the blocking authorization response information selected by the user. When the user selects that the application permission is authorized in the application permission pop-up window, the target third-party SDK is allowed to obtain real data by calling the target permission interface; when the user selects that the application permission is not authorized in the application permission pop-up window, the target third-party SDK is blocked from calling the target permission interface.
[0078] When a confirmation authorization response corresponding to the application permission pop-up window is received, the confirmation authorization information used to authorize the target third-party SDK to call the target permission interface can be stored, so that when the same target third-party SDK is detected calling the target permission interface in the future, the calling operation can be directly performed according to the stored confirmation authorization information, thereby improving the efficiency of third-party SDK auditing.
[0079] Step S209: Detect whether pseudo-privacy data corresponding to the target permission interface is currently stored. If so, execute step S210; otherwise, execute step S211.
[0080] Pseudo-privacy data can be data defined according to preset rules, which is used to forge privacy data and send it to a third-party SDK so that the third-party SDK can call the target permission interface normally without leaking the real privacy data.
[0081] Step S210: providing the stored pseudo-privacy data to a target third-party SDK.
[0082] Specifically, if it is detected that pseudo-privacy data corresponding to the target permission interface is currently stored, the stored pseudo-privacy data is directly provided to the target third-party SDK, so that the target third-party SDK can continue to perform subsequent services based on the pseudo-privacy data without leaking real privacy data.
[0083] Step S211: Generate pseudo-privacy data and provide it to a target third-party SDK, and store the pseudo-privacy data for a target permission interface.
[0084] Specifically, if it is detected that the pseudo-privacy data corresponding to the target permission interface is not currently stored, pseudo-privacy data is generated and provided to the target third-party SDK, so that the target third-party SDK can call the target permission interface normally without leaking the real privacy data. The pseudo-privacy data for the target permission interface is stored, so that when the same target third-party SDK is detected to call the target permission interface later, the stored pseudo-privacy data can be directly provided to the target third-party SDK, thereby improving the efficiency of third-party SDK auditing.
[0085] The embodiment of the present invention executes different monitoring and processing rules according to the different matched monitoring and processing rules, and can adapt to the scenarios of various third-party SDKs calling the rights interface, effectively preventing the third-party SDK from leaking the user's real daily and monthly active data without authorization, and realizing that after the application is connected to the third-party SDK, the third-party SDK's behavior of obtaining privacy data can still be continuously monitored. In addition, it is helpful to distinguish the responsibilities of the application and the third-party SDK for collecting and processing personal information, and reduce corporate joint disputes. If the matched monitoring and processing rule is a normal call to the permission interface, the target permission interface is called directly. If the matched monitoring and processing rule is a pop-up application permission window, it is detected whether the confirmation authorization information is currently stored. If so, the target permission interface is called directly, otherwise the application permission window is popped up in the display interface and the confirmation authorization information is stored, effectively guaranteeing the user's right to informed consent to the third-party SDK processing of personal information, strengthening the user's control over the third-party SDK, and improving the efficiency of third-party SDK audits. If the matched monitoring and processing rule is to provide pseudo-privacy data, it is detected whether pseudo-privacy is currently stored. If so, the stored pseudo-privacy data is provided to the target third-party SDK. Otherwise, pseudo-privacy data is generated and provided to the target third-party SDK and stored. By forging privacy data, the normal operation of the third-party SDK can still be maintained, which can effectively protect the user's privacy data.
[0086] Embodiment 3
[0087] Figure 4 is a flow chart of another permission monitoring processing method provided by Embodiment 3 of the present invention. This embodiment is optimized on the basis of the above embodiment. Figure 4 As shown, the method includes:
[0088] Step S301: When it is detected that the target third-party SDK calls the target permission interface, the call is intercepted and the execution is jumped to the permission monitoring processing interface.
[0089] The permission monitoring processing interface may be an interface for performing permission monitoring processing on the target third-party SDK when the target third-party SDK calls the target permission interface, and is used to monitor the legality of the call.
[0090] In this embodiment, the target third-party SDK can be a compiled language SDK or a high-level interpreted language SDK. Different interception and jump methods can be adopted for SDKs of different programming languages to intercept the call and jump to the execution permission monitoring processing interface.
[0091] First of all, when the target third-party SDK is a compiled language SDK, if the target third-party SDK wants to run the code in a certain code block, it needs to load the code block into the memory first. Accordingly, when each code block in the target third-party SDK is loaded into the memory, the code block can be scanned and processed in a certain way. Then, when the target third-party SDK calls the permission interface, the call can be intercepted and the execution can be jumped to the permission monitoring processing interface.
[0092] At the same time, even if the target third-party SDK is upgraded during use, the updated content must be loaded into the memory in advance before it is run. Therefore, any call to the permission interface by the target third-party SDK can be intercepted and corresponding permission monitoring processing can be taken.
[0093] Accordingly, when it is detected that the target third-party SDK calls the target permission interface, before intercepting the call, the following may also be included:
[0094] When it is detected that the code block in the target third-party SDK is loaded into the memory, the target import table matching the target third-party SDK is updated; in the target import table, the memory address corresponding to the permission interface is modified to the memory address of the permission monitoring processing interface.
[0095] Compiled languages can be languages that require a compiler to compile source code into machine code before they can be executed, such as C, C++, or ObjC. Compiled language SDK can be understood as the language of the target third-party SDK being a compiled language. Compiled language SDKs can be files such as so, dylib, or dll that are composed of compiled languages.
[0096] The memory may be the running memory when the program is running in the system. When the target third-party SDK calls the target permission interface, the code block in the target third-party SDK may be loaded into the memory, and the code block may be detected and loaded into the memory.
[0097] The target import table records the mapping relationship between the target third-party SDK's calling interface and the memory address of the calling interface. For example, the target import table can be a binary dynamic library file or a dynamic library file that has been loaded into the running memory.
[0098] Optionally, if the target third-party SDK is a compiled language SDK, when it is detected that the target third-party SDK calls the target permission interface, the call is intercepted and the execution is redirected to the permission monitoring processing interface, which can be implemented in the following ways:
[0099] When it is detected that the target third-party SDK calls the target permission interface, the target import table matching the target third-party SDK is queried; in the target import table, the target memory address matching the target permission interface is obtained, and according to the target memory address, the execution permission monitoring processing interface is jumped.
[0100] For example, Figure 5 1 is a schematic diagram of the working principle of a permission monitoring processing method provided by Embodiment 3 of the present invention when the target third-party SDK is a compiled language SDK. Figure 5 As shown, the common interface imported by the compiled language SDK can directly call the system interface. When the imported privacy interface calls the system interface, it needs to call the hook module first, and then the hook module calls the system interface. Among them, the hook module can query the target import table that matches the compiled language SDK, obtain the target memory address that matches the target permission interface in the target import table, and jump to the execution permission monitoring processing interface according to the target memory address. The hook module can use the GOT hook or PLT hook method. Since the module where the third-party SDK is located is definitely not the same module as the module where the system interface is located, this working principle is effective for third-party SDKs implemented in compiled languages such as c, c++ or objc.
[0101] Furthermore, when the target third-party SDK is a high-level interpreted language SDK, it is impossible to perform permission monitoring on the code blocks in the SDK in the memory. Therefore, for the SDK of the programming language, it can be scanned and processed before being packaged into the application. Then, when the target third-party SDK calls the permission interface, the call can be intercepted and the permission monitoring processing interface can be jumped to execute. At the same time, when the SDK of the programming language is upgraded, the update content can be intercepted through the update interface, and the update content can be scanned and processed accordingly.
[0102] Correspondingly, in the target third-party SDK, the injection point information corresponding to each permission interface call statement is pre-inserted, and the injection point information includes: the injection point position, the notification function of the injection point and the return position of the notification function; the injection point position is located in the previous line of the location of the matching permission interface call statement, the notification function of the injection point is the permission monitoring processing interface, and the return position of the permission monitoring processing interface is located in the next line of the location of the matching permission call statement.
[0103] The high-level interpreted language may be a language that does not require compilation and is translated and executed line by line at runtime, such as Java or Kotlin, etc. The high-level interpreted language SDK may be understood as the language of the target third-party SDK being a high-level interpreted language.
[0104] The injection point can be understood as a cut point added to the code block of the target third-party SDK. The notification function of the injection point can be understood as a callback function, which is used to execute the monitoring processing rules and return to execute the jump instruction. The jump instruction is used to skip the code of the original target permission interface and execute other code.
[0105] For example, Figure 6 This is a schematic diagram of the working principle of a permission monitoring processing method provided by the third embodiment of the present invention when the target third-party SDK is a high-level interpreted language SDK. Figure 6 As shown, the aspect-oriented framework aspectj is used to insert an injection point in the code block of the high-level interpreted language SDK. The notification function of the injection point can execute the monitoring processing rules. If the preset conditions are met, the high-level interpreted language SDK can call the system interface. If the preset conditions are not met, the high-level interpreted language SDK cannot call the system interface. The return position of the permission monitoring processing interface is located in the next line after the matching Java bytecode that calls the privacy interface. That is, when the jump instruction is executed, the original privacy interface call fingerprint is skipped and other bytecodes are executed.
[0106] Step S302: through the permission monitoring processing interface, according to the target third-party SDK and / or the target permission interface, determine the matching monitoring processing rules, and execute the monitoring processing rules.
[0107] Specifically, through the permission monitoring and processing interface, the target third-party SDK and / or target permission interface are matched with the third-party SDK and / or permission interface in the monitoring and processing rules, the monitoring and processing rules corresponding to the target third-party SDK and / or target permission interface are determined, and the monitoring and processing rules are executed.
[0108] Optionally, when it is detected that the target third-party SDK calls the update interface to update data, the update content is intercepted, and at least one permission interface call statement is identified in the update content; an injection point is inserted in the line before each permission interface call statement, and the notification function of each injection point is set to the permission monitoring processing interface; the return position of each permission monitoring processing interface is set to the line after the location of the matching permission interface call statement; the updated content after the setting is completed is provided to the target third-party SDK.
[0109] The update interface can be understood as the permission interface called by the target third-party SDK after the update. When the target third-party SDK calls the update interface, the code block of the target third-party SDK will update the data. The update content can be understood as the code block in the target third-party SDK for calling the target permission interface after the update. The code block at least includes the permission interface call statement.
[0110] The embodiment of the present invention intercepts the call when it detects that the target third-party SDK calls the target permission interface, and jumps to execute the permission monitoring and processing interface. Through the permission monitoring and processing interface, according to the target third-party SDK and / or the target permission interface, the matching monitoring and processing rules are determined, and the monitoring and processing rules are executed, thereby realizing automatic control of the third-party SDK's access to the privacy interface and strengthening the control over the third-party SDK. By analyzing the permission monitoring and processing methods in the two cases where the target third-party SDK is a compiled language SDK or a high-level interpreted language SDK, the applicability of controlling the third-party SDK's access to the privacy interface is improved. By blocking, jumping, etc., the third-party SDK is restricted to access specific interfaces only in specific scenarios to avoid leaking user privacy or exposing real daily activity data, while being able to access and use third-party SDK services normally. It is also possible to quickly audit the privacy permissions used by the third-party SDK, locate the location of related code, and improve the efficiency of SDK auditing.
[0111] Embodiment 4
[0112] Figure 7 Flow chart of another permission monitoring method provided by the fourth embodiment of the present invention. This embodiment is applicable to the case of managing the permissions of a third-party SDK accessed within an application. The method can be executed by a permission monitoring device, which can be implemented in software and / or hardware and can generally be integrated into the application in the form of SDK, plug-in or program code. Figure 7 As shown, the method includes:
[0113] Step S401: Identify at least one high-level interpreted language SDK in the third-party SDK embedded in the application installation package as a pre-processing SDK.
[0114] Step S402: In each pre-processing SDK, scan and obtain each permission interface call statement respectively.
[0115] The preprocessing SDK may at least include permission interface call statements and other bytecodes.
[0116] Step S403: insert an injection point in the line before each permission interface call statement, and set the notification function of each injection point to the permission monitoring processing interface.
[0117] Among them, the permission monitoring and processing interface is used to execute matching monitoring and processing rules according to the permission interface called by the pre-processing SDK during the operation of the application.
[0118] For example, Figure 6 As shown, obtain the Java bytecode that calls the privacy interface in the preprocessing SDK, insert an injection point in the previous line of the Java bytecode that calls the privacy interface, and set the notification function of the injection point to the permission monitoring processing interface.
[0119] Step S404: Set the return position of each permission monitoring processing interface to the line after the position of the matching permission interface call statement.
[0120] For example, Figure 6 As shown, there is a jump instruction bytecode between the injection point and the Java bytecode that calls the privacy interface. In the jump instruction bytecode, the return position of the permission monitoring processing interface is set to the line after the location of the matching permission interface call statement, that is, the location of other bytecodes.
[0121] The embodiment of the present invention identifies at least one pre-processing SDK in a third-party SDK embedded in an application installation package, scans and obtains each permission interface call statement in each pre-processing SDK, inserts an injection point in the line before each permission interface call statement, sets the notification function of each injection point to the permission monitoring processing interface, and sets the return position of each permission monitoring processing interface to the line after the matching permission interface call statement. The embodiment of the present invention intercepts the call of the permission interface by the high-level interpreted language SDK by inserting an injection point in the third-party SDK before access.
[0122] Embodiment 5
[0123] Figure 8 Schematic diagram of the structure of a permission monitoring processing device provided in Embodiment 5 of the present invention. The device can be implemented by software and / or hardware, and can generally be integrated in a computer device, and can automatically control the access of a third-party SDK to a privacy interface by executing a permission monitoring processing method. Figure 8 As shown, the device comprises:
[0124] A call interception module 501 is used to intercept the call when it is detected that a target third-party SDK embedded in the application program calls a target permission interface;
[0125] The rule execution module 502 is used to determine the matching monitoring and processing rules according to the target third-party SDK and / or the target permission interface, and execute the monitoring and processing rules.
[0126] Optionally, the monitoring processing rules include: calling the permission interface normally;
[0127] The rule execution module 502 is specifically used for:
[0128] The target permission interface is called, and the calling result fed back by the target permission interface is provided to the target third-party SDK.
[0129] Optionally, the monitoring processing rules include: popping up an application permission pop-up window;
[0130] The rule execution module 502 is specifically used for:
[0131] Detect whether confirmation authorization information for authorizing the target third-party SDK to call the target permission interface is currently stored;
[0132] If yes, then call the target permission interface, and provide the call result fed back by the target permission interface to the target third-party SDK;
[0133] If not, an application permission pop-up window is popped up in the display interface, and when a confirmation authorization response corresponding to the application permission pop-up window is received, confirmation authorization information for authorizing the target third-party SDK to call the target permission interface is stored.
[0134] Optionally, the monitoring processing rules include: providing pseudo-privacy data;
[0135] The rule execution module 502 is specifically used for:
[0136] Detecting whether pseudo-privacy data corresponding to the target permission interface is currently stored;
[0137] If yes, providing the stored pseudo-privacy data to the target third-party SDK;
[0138] If not, pseudo-privacy data is generated and provided to the target third-party SDK, and the pseudo-privacy data for the target permission interface is stored.
[0139] Optionally, the call interception module 501 is specifically used to:
[0140] When it is detected that the target third-party SDK calls the target permission interface, the call is intercepted and the execution is redirected to the permission monitoring processing interface;
[0141] Determine a matching monitoring and processing rule according to the target third-party SDK and / or the target permission interface, and execute the monitoring and processing rule, including:
[0142] Through the permission monitoring processing interface, according to the target third-party SDK and / or the target permission interface, the matching monitoring processing rules are determined and the monitoring processing rules are executed.
[0143] Optionally, the target third-party SDK is a compiled language SDK;
[0144] The device further comprises:
[0145] An import table update module is used to update a target import table matching the target third-party SDK when it is detected that the target third-party SDK calls the target permission interface and before intercepting the call and when it is detected that the code block in the target third-party SDK is loaded into the memory;
[0146] The target import table records the mapping relationship between the calling interface of the target third-party SDK and the memory address of the calling interface;
[0147] The address modification module is used to modify the memory address corresponding to the permission interface in the target import table to the memory address of the permission monitoring processing interface.
[0148] Optionally, the call interception module 501 is specifically used to:
[0149] When it is detected that the target third-party SDK calls the target permission interface, querying a target import table that matches the target third-party SDK;
[0150] In the target import table, a target memory address matching the target permission interface is obtained, and according to the target memory address, the permission monitoring processing interface is jumped and executed.
[0151] Optionally, the target third-party SDK is a high-level interpreted language SDK;
[0152] In the target third-party SDK, the injection point information corresponding to each permission interface call statement is pre-inserted, and the injection point information includes: the injection point position, the notification function of the injection point and the return position of the notification function;
[0153] The injection point is located in the previous line of the matching permission interface call statement, the notification function of the injection point is the permission monitoring processing interface, and the return position of the permission monitoring processing interface is located in the next line of the matching permission call statement.
[0154] Optionally, the device further comprises:
[0155] A statement recognition module is used to intercept the update content when detecting that the target third-party SDK calls the update interface to update data, and identify at least one permission interface call statement in the update content;
[0156] An injection point insertion module is used to insert an injection point in the line before each permission interface call statement, and set the notification function of each injection point to the permission monitoring processing interface;
[0157] A return position setting module, used to set the return position of each permission monitoring processing interface to the line after the position where the matching permission interface call statement is located;
[0158] The content providing module is used to provide the updated content after setting to the target third-party SDK.
[0159] The permission monitoring processing device provided in the embodiment of the present invention can execute the permission monitoring processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0160] Embodiment 6
[0161] Fig. 9 Schematic diagram of the structure of a permission monitoring processing device provided by the sixth embodiment of the present invention. The device can be implemented by software and / or hardware, and can generally be integrated in a computer device, and can automatically control the access of a third-party SDK to a privacy interface by executing a permission monitoring processing method. Fig. 9 As shown, the device comprises:
[0162] SDK identification module 601, used to identify at least one high-level interpreted language SDK as a pre-processing SDK among third-party SDKs embedded in the application installation package;
[0163] A statement scanning module 602 is used to scan and obtain each permission interface call statement in each of the pre-processing SDKs;
[0164] The interface setting module 603 is used to insert an injection point in the line before each permission interface call statement, and set the notification function of each injection point to the permission monitoring processing interface;
[0165] A position setting module 604 is used to set the return position of each permission monitoring processing interface to the line after the position where the matching permission interface call statement is located;
[0166] The permission monitoring and processing interface is used to execute matching monitoring and processing rules according to the permission interface called by the pre-processing SDK during the running of the application.
[0167] The permission monitoring processing device provided in the embodiment of the present invention can execute the permission monitoring processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0168] Embodiment 7
[0169] Fig.10 A schematic diagram of the structure of a computer device provided in Embodiment 7 of the present invention. Fig.10 A block diagram of an exemplary computer device 712 suitable for use in implementing embodiments of the present invention is shown. Fig.10 The computer device 712 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0170] like Fig.10 As shown, the computer device 712 is in the form of a general-purpose computing device. The components of the computer device 712 may include, but are not limited to: one or more processors or processing units 716, a system memory 728, and a bus 718 that connects different system components (including the system memory 728 and the processing unit 716).
[0171] Bus 718 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0172] The computer device 712 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 712, including volatile and non-volatile media, removable and non-removable media.
[0173] The system memory 728 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 730 and / or cache memory 732. The computer device 712 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 734 may be used to read and write non-removable, non-volatile magnetic media ( Fig.10 not shown, usually called a "hard drive"). Although Fig.10Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to bus 718 via one or more data medium interfaces. Memory 728 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of various embodiments of the present invention.
[0174] A program / utility 740 having a set (at least one) of program modules 742 may be stored, for example, in the memory 728, such program modules 742 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 742 generally perform the functions and / or methods of the embodiments described herein.
[0175] The computer device 712 may also communicate with one or more external devices 714 (e.g., keyboard, pointing device, display 724, etc.), may also communicate with one or more devices that enable a user to interact with the computer device 712, and / or communicate with any device that enables the computer device 712 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface 722. In addition, the computer device 712 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) via a network adapter 720. As shown, the network adapter 720 communicates with other modules of the computer device 712 via a bus 718. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 712, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0176] The processing unit 716 executes various functional applications and data processing by running the programs stored in the system memory 728, such as implementing the permission monitoring processing method provided in the embodiment of the present invention.
[0177] Embodiment 8
[0178] Embodiment 8 of the present invention further provides a storage medium comprising computer executable instructions, wherein the computer executable instructions are used to execute the permission monitoring processing method provided in any embodiment of the present invention when executed by a computer processor, that is:
[0179] When detecting that a target third-party SDK embedded in the application program calls a target permission interface, intercepting the call;
[0180] According to the target third-party SDK and / or the target permission interface, a matching monitoring and processing rule is determined, and the monitoring and processing rule is executed.
[0181] Alternatively, the computer executable instructions are used to execute another permission monitoring processing method provided by any embodiment of the present invention when executed by a computer processor, that is:
[0182] Among the third-party SDKs embedded in the application installation package, identifying at least one high-level interpreted language SDK as a preprocessing SDK;
[0183] In each of the pre-processing SDKs, scan and obtain each permission interface call statement respectively;
[0184] Insert an injection point in the line before each permission interface call statement, and set the notification function of each injection point to the permission monitoring processing interface;
[0185] The return position of each permission monitoring processing interface is set to the line after the position of the matching permission interface call statement;
[0186] The permission monitoring and processing interface is used to execute matching monitoring and processing rules according to the permission interface called by the pre-processing SDK during the running of the application.
[0187] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.
[0188] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0189] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0190] Computer program code for performing the operation of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0191] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A permission monitoring processing method, characterized in that: include: When detecting that a target third-party software development kit SDK embedded in the application program calls a target permission interface, intercepting the call; Determine a matching monitoring and processing rule according to the target third-party SDK and / or the target permission interface, and execute the monitoring and processing rule; When detecting that a target third-party software development kit SDK embedded in the application program calls a target permission interface, intercepting the call includes: When it is detected that the target third-party SDK calls the target permission interface, the call is intercepted and the execution is redirected to the permission monitoring processing interface; Wherein, the target third-party SDK is a compiled language SDK; When it is detected that the target third-party SDK calls the target permission interface, before intercepting the call, the method further includes: When it is detected that the code block in the target third-party SDK is loaded into the memory, updating the target import table matching the target third-party SDK; The target import table records the mapping relationship between the calling interface of the target third-party SDK and the memory address of the calling interface; In the target import table, the memory address corresponding to the permission interface is modified to the memory address of the permission monitoring processing interface.
2. The method according to claim 1, characterized in that The monitoring processing rules include: normal calling of the permission interface; The executing of the monitoring processing rule comprises: The target permission interface is called, and the calling result fed back by the target permission interface is provided to the target third-party SDK.
3. The method according to claim 1, characterized in that The monitoring processing rules include: popping up an application permission pop-up window; The executing of the monitoring processing rule comprises: Detect whether confirmation authorization information for authorizing the target third-party SDK to call the target permission interface is currently stored; If yes, then call the target permission interface, and provide the call result fed back by the target permission interface to the target third-party SDK; If not, an application permission pop-up window is popped up in the application display interface, and when a confirmation authorization response corresponding to the application permission pop-up window is received, confirmation authorization information for authorizing the target third-party SDK to call the target permission interface is stored.
4. The method according to claim 1, characterized in that: The monitoring processing rules include: providing pseudo-privacy data; The executing of the monitoring processing rule comprises: Detecting whether pseudo-privacy data corresponding to the target permission interface is currently stored; If yes, providing the stored pseudo-privacy data to the target third-party SDK; If not, pseudo-privacy data is generated and provided to the target third-party SDK, and the pseudo-privacy data for the target permission interface is stored.
5. The method according to any one of claims 1 to 4, characterized in that: Determine a matching monitoring and processing rule according to the target third-party SDK and / or the target permission interface, and execute the monitoring and processing rule, including: Through the permission monitoring processing interface, according to the target third-party SDK and / or the target permission interface, the matching monitoring processing rules are determined and the monitoring processing rules are executed.
6. The method according to claim 1, characterized in that When it is detected that the target third-party SDK calls the target permission interface, the call is intercepted and the permission monitoring processing interface is executed, including: When it is detected that the target third-party SDK calls the target permission interface, querying a target import table that matches the target third-party SDK; In the target import table, a target memory address matching the target permission interface is obtained, and according to the target memory address, the permission monitoring processing interface is jumped and executed.
7. The method according to claim 1, characterized in that The target third-party SDK is a high-level interpreted language SDK; In the target third-party SDK, the injection point information corresponding to each permission interface call statement is pre-inserted, and the injection point information includes: the injection point position, the notification function of the injection point and the return position of the notification function; The injection point is located in the previous line of the matching permission interface call statement, the notification function of the injection point is the permission monitoring processing interface, and the return position of the permission monitoring processing interface is located in the next line of the matching permission call statement.
8. The method according to claim 7, characterized in that Also includes: When detecting that the target third-party SDK calls an update interface to update data, intercepting the update content, and identifying at least one permission interface call statement in the update content; Insert an injection point in the line before each permission interface call statement, and set the notification function of each injection point to the permission monitoring processing interface; The return position of each permission monitoring processing interface is set to the line after the position of the matching permission interface call statement; The updated content after setting is provided to the target third-party SDK.
9. A permission monitoring processing device, characterized in that: include: A call interception module is used to intercept the call when it is detected that the target third-party software development kit SDK embedded in the application program calls the target permission interface; A rule execution module, used to determine a matching monitoring processing rule according to the target third-party SDK and / or the target permission interface, and execute the monitoring processing rule; The call interception module is used to: When it is detected that the target third-party SDK calls the target permission interface, the call is intercepted and the execution is redirected to the permission monitoring processing interface; Wherein, the target third-party SDK is a compiled language SDK; The device further comprises: An import table update module is used to update a target import table matching the target third-party SDK when it is detected that the target third-party SDK calls the target permission interface and before intercepting the call and when it is detected that the code block in the target third-party SDK is loaded into the memory; The target import table records the mapping relationship between the calling interface of the target third-party SDK and the memory address of the calling interface; The address modification module is used to modify the memory address corresponding to the permission interface in the target import table to the memory address of the permission monitoring processing interface.
10. A computer device, characterized in that: The computer device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the permission monitoring processing method as described in any one of claims 1-8.
11. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the permission monitoring processing method as described in any one of claims 1-8 when executed by a computer processor.
