Terminal application permission management method, device and computer readable storage medium
By parsing and repackaging the resource package of the terminal application, the target object permission information is automatically added to the application resource package, which solves the problem of low permission management efficiency in the existing technology and realizes efficient permission management of terminal applications.
Patent Information
- Application Number
- CN202111094112.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-17
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2041-09-17
AI Technical Summary
Existing terminal application permission management methods rely on third-party SDKs, resulting in low efficiency in permission adjustment, requiring manual code modification, and incurring high resource and time costs.
By obtaining the target object's permission configuration information, parsing and repackaging the terminal application's resource package, the target object's permission information is automatically added to the application resource package, thereby enabling automatic processing of the target object's operation behavior.
It improves the efficiency of permission management for terminal applications, reduces manual intervention, and enhances the automation of permission adjustment.
Smart Images

Figure CN115826993B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and more specifically to a method, apparatus, and computer-readable storage medium for managing permissions in terminal applications. Background Technology
[0002] In recent years, with the rapid development of internet technology, an increasing number of terminal applications have been developed. For the security of these applications, users often require various permissions to perform operations. However, with technological advancements, these user permissions sometimes need to be adjusted. Current methods for managing user permissions in terminal applications often involve manually integrating the necessary permissions into a third-party SDK (Software Development Kit).
[0003] In the process of researching and practicing existing technologies, the inventors of this invention discovered that when accessing via an SDK, the terminal application itself does not have the ability to process user operations. It still relies on the SDK to process user operations, and it is also necessary to manually modify the code to access the SDK and call the SDK according to the access documentation, which greatly increases the resources and time for permission adjustment. Therefore, the efficiency of permission management of the terminal application is low. Summary of the Invention
[0004] This invention provides a method, apparatus, and computer-readable storage medium for managing permissions of terminal applications, which can improve the efficiency of permission management for terminal applications.
[0005] A method for managing permissions in a terminal application, comprising: Obtain the target object permission configuration information for the terminal application. The target object permission configuration information is the configuration information of the target object permissions that need to be adjusted. The target object permissions are the operation permissions corresponding to the operation behavior of the target object. The target object permission configuration information is parsed to obtain the target object permission information of the terminal application. Based on the target object permission information, the application resource package of the terminal application is repackaged to obtain the target application resource package; The target application resource package is sent to the terminal so that the terminal can process the target object operation behavior of the terminal application based on the target application resource package.
[0006] Optionally, embodiments of the present invention also provide a method for managing permissions of a terminal application, including: Receive the target application resource package of the terminal application sent by the server; Extract the target configuration information and target object permission information from the target application resource package; The terminal application is run according to the target application resource package, and the currently running terminal application is detected according to the target configuration information; When a target object operation is detected for the terminal application, the target object operation is processed according to the target object permission information.
[0007] Accordingly, embodiments of the present invention provide a permission management device for terminal applications, comprising: The acquisition unit is used to acquire target object permission configuration information for the terminal application. The target object permission configuration information is the configuration information of the target object permissions that need to be adjusted. The target object permissions are the operation permissions corresponding to the operation behavior of the target object. The parsing unit is used to parse the target object permission configuration information to obtain the target object permission information of the terminal application; The repackaging unit is used to repackage the application resource package of the terminal application according to the permission information of the target object to obtain the target application resource package; The sending unit is used to send the target application resource package to the terminal, so that the terminal can process the target object operation behavior of the terminal application based on the target application resource package.
[0008] Optionally, embodiments of the present invention also provide a permission management device for terminal applications, comprising: The receiving unit is used to receive the target application resource package of the terminal application sent by the server; The extraction unit is used to extract target configuration information and target object permission information from the target application resource package; The detection unit is used to run the terminal application according to the target application resource package, and to detect the currently running terminal application according to the target configuration information. The processing unit is configured to process the target object operation behavior according to the target object permission information when a target object operation behavior is detected for the terminal application.
[0009] Optionally, in some embodiments, the repackaging unit may be specifically used to obtain the application resource package of the terminal application, and decompile the application resource package to obtain the code resource information of the terminal application; adjust the code resource information according to the target object permission information to obtain the adjusted code resource information; recompile the adjusted code resource information, and sign the recompiled application resource package to obtain the target application resource package.
[0010] Optionally, in some embodiments, the repackaging unit may be used to copy the target object permission information to the code resource information to obtain basic code resource information; identify the current configuration information in the code resource information and modify the current configuration information according to preset behavior configuration information to obtain target configuration information, the target configuration information being used to call the target object permission information; and merge the target configuration information with the basic code resource information to obtain adjusted code resource information.
[0011] Optionally, in some embodiments, the repackaging unit may be specifically used to extract the target object permission code and target object permission resources from the target object permission information; identify the original code and original resources of the terminal application from the code resource information; merge the target object permission code and the original code; and merge the target object permission resources and the original resources to obtain basic code resource information.
[0012] Optionally, in some embodiments, the repackaging unit may be specifically used to obtain the resource identifiers of the target object permission resources and the original resources; classify the target object permission resources and the original resources according to the resource type; adjust the resource identifiers based on the classification results; and merge the target object permission resources with the adjusted resource identifiers and the original resources with the adjusted resource identifiers.
[0013] Optionally, in some embodiments, the repackaging unit may be used to obtain resource identifier configuration information corresponding to each resource type; filter out resource identifiers of the same resource type from the resource identifiers to obtain target resource identifiers; and based on the resource identifier configuration information, eliminate identifier conflicts between the target resource identifiers to obtain the adjusted resource identifiers.
[0014] Optionally, in some embodiments, the repackaging unit may be specifically used to obtain preset behavior configuration information corresponding to the terminal application, and parse the preset behavior configuration information to determine at least one configuration item that needs to be modified; identify the basic configuration information corresponding to each configuration item in the current configuration information; and modify each basic configuration information based on the preset behavior configuration information to obtain target configuration information.
[0015] Optionally, in some embodiments, the acquisition unit may be specifically used to receive target object permission configuration page information for the terminal application sent by the terminal; extract the target operation behavior of the target object to be configured and the operation permission corresponding to the target operation behavior from the target object permission configuration page information; configure the target operation behavior and the operation permission corresponding to the target operation behavior to obtain target object permission configuration information.
[0016] Optionally, in some embodiments, the detection unit may be specifically used to call the target object permission information according to the target configuration information to start the behavior detection service; obtain the application interface of the currently running terminal application, and detect the application interface based on the behavior detection service.
[0017] Optionally, in some embodiments, the processing unit may be specifically used to obtain the interface call request corresponding to the target object's operation behavior; determine the operation type of the target object's operation behavior based on the interface call request; and process the interface call request based on the operation type and the target object's permission information.
[0018] Optionally, in some embodiments, the processing unit may be specifically used to identify the target object permission corresponding to the operation type in the target object permission information; when the target object permission is an allowed operation, the target application interface is invoked according to the interface call request; when the target object permission is a denied operation, the interface request call is denied.
[0019] Optionally, in some embodiments, the permission management device of the terminal application may further include a reporting unit, which may be used to obtain the target object identity identifier corresponding to the target object operation behavior; based on the target object identity identifier, to count the target object operation behavior and the processing result of the target object operation behavior within a preset time period to obtain behavior statistics information; and to report the behavior statistics information to the server.
[0020] Furthermore, embodiments of the present invention also provide an electronic device, including a processor and a memory, wherein the memory stores an application program, and the processor is used to run the application program in the memory to implement the terminal application permission management method provided in embodiments of the present invention.
[0021] Furthermore, embodiments of the present invention also provide a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the terminal application permission management methods provided in embodiments of the present invention.
[0022] In this embodiment of the invention, after obtaining the target object permission configuration information for a terminal application, the target object permission configuration information is parsed to obtain the target object permission information of the terminal application. Based on the target object permission information, the application resource package of the terminal application is repackaged to obtain the target application resource package, which is then sent to the terminal. This allows the terminal to process the target object operation behavior of the terminal application based on the target application resource package. Because this solution obtains the target object permission information by parsing the target object permission configuration information and repackages the terminal application based on this target object permission information, automatically adding the target object permission information to the application resource package and automatically completing the access process, and then sending the target application resource package to the terminal, the terminal application can automatically process the target object operation behavior based on the target object permission information during runtime. Therefore, the efficiency of terminal application permission management can be improved. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a schematic diagram of the terminal application permission management system provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a scenario for the permission management method for terminal applications provided in an embodiment of the present invention; Figure 3 This is a flowchart illustrating the permission management method for terminal applications provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the target object permission configuration page provided in an embodiment of the present invention; Figure 5 This is a code diagram illustrating the packaging configuration information provided in an embodiment of the present invention; Figure 6 This is a schematic diagram illustrating the copying of target object permission information provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the process for resolving resource identifier conflicts provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of the process for modifying the current configuration information provided in an embodiment of the present invention; Figure 9 This is another flowchart illustrating the permission management process for terminal applications provided in this embodiment of the invention; Figure 10 This is a module architecture diagram of the terminal application permission management system provided in the embodiments of the present invention; Figure 11 This is another flowchart illustrating the terminal application permission management method provided in this embodiment of the invention; Figure 12 This is a schematic diagram of the permission management process for terminal applications provided in an embodiment of the present invention; Figure 13 This is a schematic diagram of the process for detecting and processing the operation behavior of a target object according to an embodiment of the present invention; Figure 14 This is a schematic diagram of the structure of the permission management device for the first terminal application provided in an embodiment of the present invention; Figure 15 This is a schematic diagram of the structure of the permission management device for the second terminal application provided in an embodiment of the present invention; Figure 16 This is another structural schematic diagram of the permission management device for the second terminal application provided in this embodiment of the invention; Figure 17 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] This invention provides a method, apparatus, and computer-readable storage medium for managing permissions of a terminal application. The permission management apparatus for the terminal application can be integrated into an electronic device, which may be a server or a terminal, etc. Specifically, this invention provides a permission management apparatus for a terminal application applicable to a first electronic device (for distinction, it may be referred to as a permission management apparatus for the first terminal application), and a permission management apparatus for a terminal application applicable to a second electronic device (for distinction, it may be referred to as a permission management apparatus for the second terminal application).
[0027] The first electronic device can be a network-side device such as a server. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The second electronic device can be a terminal, such as a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0028] This embodiment of the invention uses a server as an example and a terminal as a second electronic device to illustrate the data processing method.
[0029] For example, see Figure 1 The present invention provides a terminal application permission management system including a server 10 and a terminal 20. The server 10 and the terminal 20 are connected via a network, such as a valid or wireless network. The data processing device can be integrated into the terminal, for example, in the form of a client.
[0030] Server 10 can obtain target object permission configuration information for a terminal application, parse the target object permission configuration information to obtain the target object permission information for the terminal application, then repackage the application resource package of the terminal application according to the target object permission information to obtain the target application resource package, and then send the target application resource package to the terminal so that the terminal can run the terminal application based on the target application resource package and detect the currently running terminal application. When a target object operation behavior is detected for the currently running terminal application, the target object operation behavior is processed according to the target object permission information, thereby improving the efficiency of terminal application permission management, such as... Figure 2 As shown.
[0031] Specifically, terminal 20 can obtain the target application resource package of the terminal application from server 10. There are multiple ways to obtain it, and terminal 20 can do so in the following ways: The system receives the target application resource package of the terminal application sent by the server. Then, it extracts the target configuration information and target object permission information from the target application resource package, runs the terminal application according to the target application resource package, and detects the currently running terminal application according to the target configuration information. When it detects an operation behavior targeting the target object of the terminal application, it processes the operation behavior according to the target object permission information.
[0032] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.
[0033] In this embodiment, the description will be from the perspective of the permission management device of the second terminal application. Specifically, the permission management device of the second terminal application can be integrated into an electronic device, with the electronic device as a server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0034] A method for managing permissions in a terminal application, comprising: Obtain the target object permission configuration information for the terminal application. This target object permission configuration information is the configuration information of the target object permissions that need to be adjusted. The target object permissions are the operation permissions corresponding to the target object operation behavior. Parse the target object permission configuration information to obtain the target object permission information of the terminal application. Based on the target object permission information, repackage the application resource package of the terminal application to obtain the target application resource package. Send the target application resource package to the terminal so that the terminal can process the target object operation behavior of the terminal application based on the target application resource package.
[0035] like Figure 3 As shown, the specific process of the permission management method for this terminal application is as follows: 101. Obtain the target object permission configuration information for the terminal application.
[0036] In this context, a terminal application can be understood as an application running on a terminal. This application can run directly on the terminal's operating system in the form of an APP, or it can run on an application platform in the form of a mini-program, such as a WeChat mini-program or a mini-program on other application platforms.
[0037] The target object permission configuration information refers to the configuration information of the target object's permissions that need to be adjusted, used to adjust the permissions of the target object in the terminal application. This target object permission configuration information is obtained by configuring the operation behavior of the target object to be adjusted and the corresponding operation permissions of that operation behavior selected on the target object permission configuration page displayed on the terminal. Target object permissions are the operation permissions corresponding to the target object's operation behavior. The target object can be an object that operates or uses the terminal application; for example, it can be a user who operates or uses the terminal application through the terminal.
[0038] There are several ways to obtain the permission configuration information of the target object, as follows: For example, it can receive target object permission configuration page information sent by the terminal for the terminal application, extract the target operation behavior and the corresponding operation permission of the target object to be configured from the target object permission configuration page information, configure the target operation behavior and the corresponding operation permission, and obtain the target object permission configuration information.
[0039] The target object permission configuration page information allows the target object to select at least one target operation behavior to be adjusted and the corresponding operation permission for that operation behavior. The target operation behavior and operation permission can also be understood as the terminal application's target object permissions for the target object. These target object permissions can take various forms, such as: prohibiting / allowing copying / pasting, prohibiting / allowing screenshots / screen recording, prohibiting / allowing access to the camera, prohibiting / allowing printing, prohibiting / allowing access to the system photo album, prohibiting / allowing access to system folders, prohibiting / allowing access to Bluetooth, prohibiting / allowing sharing and forwarding, prohibiting / restricting network access, prohibiting / adding a visible watermark, prohibiting / adding a hidden watermark, prohibiting / allowing making phone calls, prohibiting / allowing sending / reading SMS messages, prohibiting / allowing access to contacts, prohibiting / allowing access to call logs, prohibiting / allowing access to geolocation, prohibiting / allowing access to applications, file redirection permissions, or encryption permissions, etc.
[0040] The target object permission configuration page is primarily used to set various permissions for the target object on the terminal application. These permissions can be categorized according to their function, and may include settings for data leakage prevention, anti-phishing protection, and personal information protection, among others. The target object permission configuration page can be configured as follows: Figure 4 As shown, you can select the target object's operation behavior and the corresponding operation permission based on the actual application. The operation permission can include prohibition and permission, and permission can be further divided into permission under multiple conditions. Different configurations enable different target object operation behavior detection capabilities.
[0041] 102. Parse the target object permission configuration information to obtain the target object permission information of the terminal application.
[0042] Among them, the target object permission information can include the target object operation behavior that the terminal application needs to adjust, as well as the code and resource information corresponding to the operation permission of the target object operation behavior.
[0043] There are several ways to parse the permission configuration information of the target object, as follows: For example, packaging configuration information is identified within the target object's permission configuration information. Based on this packaging configuration information, the target object's permission code and target object's permission resources are extracted from the target object's configuration information. The path configuration information for the target object's permission code and target object's permission resources is then obtained. This path configuration information is used to repackage the code and resources into the application resource package of the terminal application. The target object's permission code, target object's permission resources, and path configuration information are then used as the target object's permission information.
[0044] The packaging configuration information is used to indicate the code and resources whose permissions for the target object need to be adjusted, such as... Figure 5 As shown, true indicates that the relevant target object permission information will be packaged into the APK (Application Resource Package), and the terminal application will control these behaviors when the APK is run.
[0045] 103. Based on the target object's permission information, repackage the application resource package of the terminal application to obtain the target application resource package.
[0046] Repackaging can be understood as decompiling an existing terminal application's APK to obtain relevant code and resources, then modifying, adding, or deleting these resources to achieve the required product functionality, and finally recompiling it back into an APK and signing it. In this solution, newly added or adjusted target object permissions and the ability to control those permissions can be integrated into the terminal application to adjust the currently set target object permissions for the target object's actions within the application.
[0047] There are several ways to repackage the application resource package of the terminal application, as follows: For example, the application resource package of the terminal application is obtained and decompiled to obtain the code resource information of the terminal application. Based on the target object's permission information, the code resource information is adjusted to obtain the adjusted code resource information. The adjusted code resource information is then recompiled, and the recompiled application resource package is signed to obtain the target application resource package.
[0048] There are several ways to obtain the application resource package of a terminal application. For example, you can directly receive the application resource package of the terminal application sent by the terminal, or you can obtain the application resource package of the target terminal application from the network, or you can receive the storage address of the application resource package sent by the terminal and obtain the application resource package of the terminal application from memory, cache or third-party database according to the storage address.
[0049] There are several ways to adjust code resource information based on the target object's permission information. For example, the target object's permission information can be copied to the code resource information to obtain basic code resource information. The current configuration information can be identified in the code resource information and modified according to the preset behavior configuration information to obtain the target configuration information. This target configuration information is used to call the target object's permission information. The target configuration information and the basic code resource information are then merged to obtain the adjusted code resource information.
[0050] There are several ways to copy the target object's permission information to the code resource information. For example, the target object's permission code and resources can be extracted from the target object's permission information. The original code and resources of the terminal application can be identified from the code resource information. The target object's permission code can be merged with the current code, and the target object's permission resources can be merged with the original resources to obtain the basic code resource information. Figure 6 As shown.
[0051] In the process of merging target object permission resources and original resources, the issue of resource conflicts needs to be considered. Resource conflicts can be understood as conflicts in resource IDs. Different types of resources have different naming rules for their IDs, and different resources must be named according to these rules. However, the naming rules for the original resources within the terminal application and the subsequently reconfigured target object permission resources may differ. Therefore, when merging target object permission resources into the original resources of the terminal application, the problem of resource ID conflicts needs to be resolved. Thus, there are several ways to merge target object permission resources and original resources. For example, one method is to obtain the resource identifiers of the target object permission resources and original resources, classify them according to resource type, adjust the resource identifiers based on the classification results, and then merge the target object permission resources with the adjusted resource identifiers and the original resources.
[0052] The resource types of the target object's permission resources and the original resources can be various, such as images, strings, layout files, animation resources, and custom attributes, etc.
[0053] Among them, resource identifiers are adjusted based on the classification results. There are multiple ways to adjust them. One method is to obtain the resource identifier configuration information corresponding to each resource type, filter out the resource identifiers of the same resource type from the resource identifiers to obtain the target resource identifiers, and eliminate the identifier conflicts between the target resource identifiers based on the resource identifier configuration information to obtain the adjusted resource identifiers.
[0054] Resource identifier configuration information can be understood as the naming rules for resource identifiers of each resource type. There are several ways to eliminate identifier conflicts between target resource identifiers based on resource identifier configuration information. For example, based on the resource identifier configuration information, conflicting abnormal resource identifiers can be filtered out from the target resource identifiers. Then, these abnormal resource identifiers can be modified so that they do not conflict. Abnormal resource identifiers can be resource identifiers that do not meet the naming rules or duplicate resource identifiers. When an abnormal resource identifier does not meet the naming rules, for example, if the naming rule for type A resource identifiers is XXX01-XXX, then all instances where the fourth digit of the resource identifier (ID) is not 01 can be changed to 01. When an abnormal resource identifier is a duplicate resource identifier, the resources with duplicate identifiers can be deleted, such as duplicate images, strings, or animations. Furthermore, after revising abnormal resource identifiers, it is possible to check for duplicate names in the modified resource identifiers. If duplicate names are found, the duplicate resource identifiers are then modified to eliminate identifier conflicts between target resource identifiers. In the process of eliminating resource identifier conflicts, conflict elimination can be performed on resource identifiers of one resource type at a time until there are no more conflicts for that resource type. Then, conflict elimination can be performed on resource identifiers of the next resource type. After all resource identifier conflicts for all resource types have been eliminated, the conflict elimination is synchronized to the resource identifiers referenced by the target object's permission code and the original code.
[0055] The process for resolving resource identifier conflicts can be as follows: Figure 7As shown, different solutions can be used to resolve resource identifier conflicts depending on the type of resource. For example, for image duplication conflicts, step S1 can be used, which mainly involves filtering out duplicate images based on their identifiers and deleting them. For string duplication conflicts, step S2 can be used, which mainly involves filtering out duplicate strings based on their identifiers and deleting them. For layout file conflicts, step S3 can be used, which mainly involves extracting the first naming rule for layout files from the resource configuration information, filtering out abnormal layout files based on the first naming rule (where abnormal layout files are those that do not meet the first naming rule), and modifying the identifier of the abnormal layout files to conform to the first naming rule. For animation resource conflicts, step S4 can be used, which mainly involves extracting the second naming rule for animation resources from the resource configuration information, filtering out abnormal animation resources based on the second naming rule, and modifying the identifier of the abnormal animation resources to conform to the second naming rule. To address custom attribute conflicts, step S5 can be used. This mainly involves extracting the third naming rule corresponding to the custom attribute from the resource configuration information, filtering out abnormal custom attributes based on the third naming rule, and modifying the identifier of the abnormal custom attribute to conform to the third naming rule. After modifying and deleting these resources, resource identifiers can be validated, referring to step S6. This mainly involves validating the resource identifiers of images, strings, layout files, animation resources, and custom attributes. After successful validation, the validated resource identifiers are synchronized to the resource identifiers referenced in the code. It should be noted that... Figure 7 The processing order is not fixed. Other processing orders can be used to process the resource identifiers corresponding to these resource types, thereby integrating the resource identifiers of different resource types and making the resource identifiers of the same resource type the same, thus avoiding conflicts.
[0056] There are several ways to modify the current configuration information of a terminal application. For example, you can obtain the preset behavior configuration information corresponding to the terminal application, parse the preset behavior configuration information to determine at least one configuration item that needs to be modified, identify the basic configuration information corresponding to each configuration item in the current configuration information, and modify each basic configuration information based on the preset behavior configuration information to obtain the target configuration information.
[0057] The preset behavior configuration information can be configuration information for detecting or calling various interfaces of the terminal application, such as hookconfiq (the permission configuration file corresponding to the hook function). There are also multiple ways to determine the configuration items that need to be modified. For example, the preset behavior configuration information can be parsed to obtain the behavior configuration information that needs to be injected into the current configuration information, the type of each behavior configuration information can be identified, and based on the type of configuration information, at least one configuration item that needs to be modified can be determined.
[0058] The basic configuration information can be the configuration items obtained by parsing the Manifest.xml (the basic configuration file of the terminal application) from the application resource package of the terminal application. There are various types of basic configuration information, such as Manifest configuration information (basic file configuration information), Application class configuration information (application class configuration information), and Launcher class configuration information (launch class configuration information). There are several ways to modify the basic configuration information. For example, the Manifest configuration information, Application class configuration information, and Launcher class configuration information can be modified separately based on the configuration items in the preset behavior configuration information to obtain the modified target configuration information. Taking Manifest configuration information, Application class configuration information, and Launcher class configuration information as examples, the process of modifying the current configuration information can be described as follows: Figure 8 As shown, the specific steps are as follows: C1 obtains the preset behavior configuration information and the basic configuration file of the terminal application; C2 parses the preset behavior configuration information to obtain the adjustment configuration information for adjusting the basic configuration file; C3 parses the basic file configuration information (Manifest), application class configuration information (Application class), and launcher class configuration information (Launcher class) of the terminal application from the basic configuration file; C4 filters the basic file adjustment information corresponding to the basic file configuration information from the adjustment configuration information and modifies the basic file configuration information based on the basic file adjustment information; C5 filters the application class adjustment information corresponding to the application class configuration information from the adjustment configuration information and modifies the application class configuration information based on the application class adjustment information; C6 filters the launcher class adjustment information corresponding to the launcher class configuration information from the adjustment configuration information and modifies the launcher class configuration information based on the launcher class adjustment information. The basic file configuration information, application class configuration information, and launcher class configuration information can be modified simultaneously or in sequence, and this sequence is not fixed, except... Figure 8 In addition to the timing sequence specified in the original text, other timing sequences can also be used. 104. Send the target application resource package to the terminal so that the terminal can process the target object operation behavior of the terminal application based on the target application resource package.
[0059] For example, the target application resource package can be sent directly to the terminal, or the storage address of the target application resource package can be sent to the terminal, so that the terminal can obtain the target application resource package of the terminal application based on the storage address.
[0060] After obtaining the target application resource package, the terminal can extract the target configuration information and target object permission information from it. It then runs the terminal application based on the resource package and performs detection on the currently running application according to the target configuration information. When it detects an operation targeting the target object, it processes the operation based on the target object's permission information. The terminal can also statistically analyze target object operations and their corresponding processing results within a preset time period and report this information to the server.
[0061] As can be seen from the above, in this embodiment of the application, after obtaining the target object permission configuration information for the terminal application, the target object permission configuration information is parsed to obtain the target object permission information of the terminal application. Based on the target object permission information, the application resource package of the terminal application is repackaged to obtain the target application resource package, and the target application resource package is sent to the terminal so that the terminal can process the target object operation behavior of the terminal application based on the target application resource package. Since this solution obtains the target object permission information by parsing the target object permission configuration information and repackages the terminal application based on the target object permission information, so as to automatically add the target object permission information to the application resource package, automatically complete the access process, and send the target application resource package to the terminal, the target object operation behavior can be automatically processed based on the target object permission information when the terminal application is running. Therefore, the efficiency of terminal application permission management can be improved.
[0062] This embodiment will be described from the perspective of the permission management device of the second terminal application. The permission management device of the second terminal application can be integrated into an electronic device, which can be a terminal or other device. The terminal can include tablet computers, laptop computers, personal computers (PCs), wearable devices, virtual reality devices or other smart devices that can process data.
[0063] A method for managing permissions in a terminal application, comprising: The system receives the target application resource package of the terminal application sent by the server, extracts the target configuration information and target object permission information from the target application resource package, runs the terminal application according to the target application resource package, and detects the currently running terminal application according to the target configuration information. When a target object operation behavior is detected, the target object operation behavior is processed according to the target object permission information.
[0064] like Figure 9 The specific process of the permission management method for this terminal application is as follows: 201. Receive the target application resource package of the terminal application sent by the server.
[0065] For example, it can directly receive the target application resource package of the terminal application sent by the server. Alternatively, when there are many terminal applications or the memory of the target application resource package is large, it can indirectly receive the target application resource package of the terminal application sent by the server. For instance, it can receive the permission management request of the terminal application sent by the server, which carries the storage address of the target application resource package. Based on the storage address, it can obtain the target application resource package of the terminal application from the server.
[0066] 202. Extract the target configuration information and target object permission information from the target application resource package.
[0067] For example, regarding target object permission information, target code resource information can be extracted from the code resource information of the target application resource package. Target object code and target object resources can then be identified from the target code resource information to obtain the target object permission information. Similarly, regarding target configuration information, current configuration information can be extracted from the target application resource package. Configuration information used to call target object permission information can then be identified from the current configuration information to obtain the target configuration information.
[0068] 203. Run the terminal application according to the target application resource package, and detect the currently running terminal application according to the target configuration information.
[0069] There are several ways to run a terminal based on the target application resource package, as follows: For example, you can add the target application resource package to an application container and launch the terminal application in the application container, so that the terminal application can run on the terminal. Alternatively, you can directly load the target application resource package so that the terminal application corresponding to the target application resource package can run on the terminal.
[0070] After running the terminal application, you can then perform detection on the currently running terminal application. This detection mainly refers to detecting the target object's operation behavior on the target object of the terminal application. There are various detection methods. For example, you can call the target object's permission information based on the target configuration information to start the behavior detection service, obtain the application interface of the currently running terminal application, and then perform detection on the application interface based on the behavior detection service.
[0071] The behavior detection service can be understood as a Hook service started through the hook configuration information. The Hook service detects / retrieves the detection switch configuration in the target object's permission information, and calls the detection code in the target object's permission information to detect the corresponding application interfaces. This causes the terminal to execute the detection code, thereby realizing the detection of the application interfaces of the terminal application. 204. When an operation is detected targeting a terminal application, the operation is processed according to the target object's permission information.
[0072] The target object's operation behavior can be understood as the behavior generated by the target object triggering operations on the application interface of the terminal application on the terminal. For example, it may include copying information, clicking controls, entering specific information, modifying or adjusting the content on the page, reading specific information in the terminal application, or accessing internal and external links in the terminal application, etc.
[0073] There are several ways to process the operation behavior of a target object based on its permission information, as follows: For example, when a target object operation behavior is detected for a terminal application, the corresponding interface call request can be obtained. Based on the interface call request, the operation type of the target object operation behavior can be determined. Based on the operation type and the target object permission information, the interface call request can be processed.
[0074] There are several ways to determine the operation type of the target object's operation behavior based on the interface call request. For example, based on the interface call request, the target application interface that the target object needs to call can be filtered out from the application interface of the terminal application. Based on the interface type of the target application interface, the operation type of the target object's operation behavior can be determined. For example, when the interface type is a content copy interface, the operation type of the target object's operation behavior can be determined to be a copy operation. When the interface type is a screenshot interface, the operation type of the target object's operation behavior can be determined to be a screenshot operation, and so on.
[0075] After determining the operation type of the target object's operation behavior, the interface call request can be processed based on the operation type and the target object's permission information. There are several specific processing methods. For example, the target object's permission corresponding to the operation type can be identified in the target object's permission information. When the target object's permission is "allowed operation", the target application interface can be called according to the interface call request. When the target object's permission is "denied operation", the interface call request can be denied.
[0076] Optionally, after processing the target object's operation behavior, the target object's operation behavior information can also be statistically analyzed and reported. For example, the target object's identity identifier corresponding to the target object's operation behavior can be obtained. Based on the target object's identity identifier, the target object's operation behavior and the processing results of the target object's operation behavior within a preset time period can be statistically analyzed to obtain behavior statistics information, which can then be reported to the server.
[0077] In the process of managing permissions for terminal applications, it can be viewed as an interaction between the server and the terminal through three modules, specifically as follows: Figure 10 As shown, the server's backend configuration module primarily configures the target object's operation behaviors and corresponding permissions by setting them, thereby obtaining the target object's permission configuration information. The packaging module then parses this configuration information to extract the target object's permission information and packages it into the application resource package. Finally, the terminal's target object operation behavior processing unit processes the target object's operation behaviors based on the permission information. The packaging module can be located on either the server or the terminal side. If set on the server side, the target object can be packaged with a single click, and the server then sends the packaged target resource package to the terminal. If set on the terminal side, the terminal can automatically add the target object's permission information to the application resource package through the packaging module, completing the packaging process. As can be seen from the above, in this embodiment, after receiving the target application resource package of the terminal application sent by the server, the target configuration information and target object permission information are extracted from the target application resource package. Then, the terminal application is run according to the target application resource package, and the currently running terminal application is detected according to the target configuration information. When a target object operation behavior is detected, the target object operation behavior is processed according to the target object permission information. Since this solution can obtain the packaged target application resource package from the server, detect the target object operation behavior according to the target configuration information in the target application resource package, and process the target object operation behavior based on the target object permission information, it does not require the use of third-party tools to process the target object operation behavior. This enables the terminal application itself to have the ability to process the target object operation behavior, thus improving the efficiency of terminal application permission management.
[0078] Based on the method described in the above embodiments, the following examples will provide further detailed explanations.
[0079] In this embodiment, the permission management device for the first terminal application is specifically integrated into the first electronic device, which is a server. The permission management device for the second terminal application is integrated into the second electronic device, which is a terminal. The target object is the user who uses or operates the terminal application. The target object's permissions are user permissions, and the user permissions are behavior control. The target object's permission information is user permission information, and the user permission information may include behavior control capability items and behavior control capability switches. The behavior control capability switches can be used to detect and process the application interface corresponding to the user's operation behavior. The target object's permission configuration information is user permission configuration information, and the user permission configuration information is the configuration information of the behavior control capability items package and the configuration information of the behavior control capability switches, as an example, will be used for illustration. like Figure 11 As shown, a method for managing permissions in a terminal application is described, with the following specific process: 301. The server obtains user permission configuration information for the terminal application.
[0080] For example, the server can receive user permission configuration page information for terminal applications sent by the terminal, extract the target operation behavior and operation permission corresponding to the target user corresponding to the behavior control capability to be configured from the user permission configuration page information, configure the target operation behavior and operation permission corresponding to the target operation behavior, and obtain user permission configuration information.
[0081] 302. The server parses the user permission configuration information to obtain the user permission information of the terminal application.
[0082] For example, the server identifies the packaging configuration information in the user permission configuration information, and based on the packaging configuration information, extracts the user permission code and user permission resources from the user configuration information, and obtains the path configuration information of the user permission code and user permission resources.
[0083] This path configuration information is used to specify the path to the application resource package of the terminal application when repackaging code and resources. Specifically, it can be shown below: <resources> <libdir> / User / peihejiang / Documents / MDLP / xxxx / lib / / Code path information <smalidir> / User / peihejiang / Documents / MDLP / xxxx / smali / / Resource path information <resdir>< / resDir> <dexdir>< / dexdir> < / resdir> < / smalidir> < / libdir> < / resources> The server uses user permission codes, user permission resources, and path configuration information as user permission information.
[0084] 303. The server repackages the application resource package of the terminal application based on the user's permission information to obtain the target application resource package.
[0085] For example, the server can directly receive the application resource package of the terminal application sent by the terminal, or it can obtain the application resource package of the target terminal application from the network, or it can receive the storage address of the application resource package sent by the terminal, and retrieve the application resource package of the terminal application from memory, cache or third-party database based on the storage address. The obtained application resource package of the terminal application is then decompiled to obtain the code resource information of the terminal application.
[0086] The server can extract user permission code and user permission resources from user permission information, identify the original code and resources of the terminal application from the code resource information, and merge the user permission code and the current code to obtain the merged code.
[0087] The server obtains the resource identifiers of user-authorized resources and the original resources. Based on the resource type, it categorizes the user-authorized resources and the original resources, and retrieves the resource identifier configuration information corresponding to each resource type. It then filters out resource identifiers of the same resource type from the resource identifiers to obtain target resource identifiers. Based on the resource identifier configuration information, it filters out conflicting abnormal resource identifiers from the target resource identifiers. These abnormal resource identifiers are then modified to eliminate conflicts, resulting in adjusted resource identifiers. The user-authorized resources with adjusted resource identifiers are then merged with the original resources to obtain the merged resources. The merged code and the merged resources are used as the base code resource information.
[0088] The server identifies the Manifest.xml file from the code resource information as the current configuration information. The server retrieves the hookconfiq configuration file as the preset behavior configuration information, parses it to obtain the behavior configuration information to be injected into the current configuration information, identifies the type of each behavior configuration information, and determines at least one configuration item that needs to be modified based on the type. The server parses the Manifest.xml file to obtain basic information, and modifies the Manifest configuration information, Application class configuration information, and Launcher class configuration information according to the configuration information of the preset behavior configuration information, thereby obtaining the modified target configuration information.
[0089] The modification of basic configuration information is mainly used to find the corresponding Application / launch page Activity, and to call the behavior control (user permission) code in the onCreate lifecycle to hook different system services to detect user operation behavior.
[0090] The server merges the target configuration information and the basic code resource information to obtain the adjusted code resource information. It then recompiles the adjusted code resource information and signs the recompiled application resource package to obtain the target application resource package.
[0091] 304. The server sends the target application resource package to the terminal.
[0092] For example, the server can directly send the target application resource package to the terminal, or send the storage address of the target application resource package to the terminal, so that the terminal can obtain the target application resource package of the terminal application based on the storage address.
[0093] 305. The terminal extracts the target configuration information and user permission information from the target application resource package.
[0094] For example, regarding user permission information, the terminal can extract target code resource information from the code resource information of the target application resource package, identify user code and user resources in the target code resource information, and thus obtain user permission information. Regarding target configuration information, the terminal can extract current configuration information from the target application resource package, identify configuration information used to call user permission information in the current configuration information, and thus obtain target configuration information.
[0095] 306. The terminal runs the terminal application according to the target application resource package and detects the currently running terminal application according to the target configuration information.
[0096] For example, a terminal can add the target application resource package to an application container and launch the terminal application in the application container, so that the terminal application can run on the terminal. Alternatively, the terminal can directly load the target application resource package, so that the terminal application corresponding to the target application resource package can run on the terminal.
[0097] The terminal starts a Hook service through the hook configuration information. The Hook service detects / retrieves the detection switch configuration in the user permission information, and calls the detection code in the user permission information to detect the corresponding application interfaces. This causes the terminal to execute the detection code, thereby realizing the detection of the application interfaces of the terminal application. 307. When a user operation is detected targeting a terminal application, the terminal processes the user operation based on the user permission information.
[0098] For example, when a user action is detected targeting a terminal application, the terminal can obtain the corresponding API call request. Based on the API call request, it can filter the target application API that the user needs to call from the terminal application's application APIs. Based on the interface type of the target application API, it can determine the operation type of the user action. The user permission information is then used to identify the user permission corresponding to the operation type. If the user permission is "allowed," the target application API is called according to the API call request; if the user permission is "denied," the API call request is denied.
[0099] Optionally, after processing the user's operation behavior, the terminal can also obtain the user identity identifier corresponding to the user's operation behavior, and based on the user identity identifier, count the user's operation behavior and the processing results of the user's operation behavior within a preset time period to obtain behavior statistics information, and report the behavior statistics information to the server.
[0100] The entire process of terminal application permission management can be as follows: Figure 12 As shown, this process relies on the cooperation of a server and a terminal. The server primarily obtains user permission configuration information, parses it, determines which behavior control capabilities to package into the application APK, decompiles the APK, copies the corresponding behavior control implementation code resources (user permission code and user permission resources) to the decompiled code resource information, calls the behavior control code (modifying the current configuration information of the terminal application) in the corresponding code, recompiles the APK, re-signs it to generate the final APK, and obtains the target terminal application. On the terminal, the user uses the APK application (terminal application), which detects the user's operation behavior, prohibits or allows allowed behavior based on the configuration (user permission information), and then reports the user's behavior statistics. It can be seen that the terminal, in the terminal application's permission management process, mainly executes the user permission information in the target application resource package of the terminal application to detect and process user operation behavior, specifically as follows... Figure 13 As shown.
[0101] As can be seen from the above, in this embodiment, after obtaining the user permission configuration information for the terminal application, the electronic device parses the user permission configuration information to obtain the user permission information of the terminal application. Based on the user permission information, it repackages the application resource package of the terminal application to obtain the target application resource package, and sends the target application resource package to the terminal so that the terminal can process the user operation behavior of the terminal application based on the target application resource package. Since this solution obtains the user permission information by parsing the user permission configuration information and repackages the terminal application based on the user permission information, so as to automatically add the user permission information to the application resource package, automatically complete the access process, and send the target application resource package to the terminal, it can automatically process the user operation behavior based on the user permission information when the terminal application is running. Therefore, it can improve the efficiency of terminal application permission management.
[0102] To better implement the above methods, embodiments of the present invention provide a permission management device for a terminal application (i.e., a permission management device for a first terminal application). This permission management device for the first terminal application can be integrated into a server, which can be a single server or a server cluster composed of multiple servers.
[0103] For example, such as Figure 14 As shown, the permission management device for the first terminal application may include an acquisition unit 401, a parsing unit 402, a repackaging unit 403, and a sending unit 404, as follows: (1) Obtain unit 401; The acquisition unit 401 is used to acquire the target object permission configuration information for the terminal application. The target object permission configuration information is the configuration information of the target object permissions that need to be adjusted. The target object permissions are the operation permissions corresponding to the operation behavior of the target object.
[0104] For example, the acquisition unit can specifically be used to receive the target object permission configuration page information for the terminal application sent by the terminal, extract the target operation behavior and the operation permission corresponding to the target operation behavior from the target object permission configuration page information, configure the target operation behavior and the operation permission corresponding to the target operation behavior, and obtain the target object permission configuration information.
[0105] (2) Analysis unit 402; The parsing unit 402 is used to parse the target object permission configuration information to obtain the target object permission information of the terminal application.
[0106] For example, parsing unit 402 can be used to identify packaging configuration information in the target object permission configuration information, extract the target object permission code and target object permission resources from the target object configuration information based on the packaging configuration information, and obtain the path configuration information of the target object permission code and target object permission resources. The target object permission code, target object permission resources, and path configuration information are then used as the target object permission information.
[0107] (3) Repackaging unit 403; The repackaging unit 403 is used to repackage the application resource package of the terminal application according to the permission information of the target object to obtain the target application resource package.
[0108] For example, repackaging unit 403 is used to obtain the application resource package of the terminal application, decompile the application resource package to obtain the code resource information of the terminal application. Based on the target object's permission information, the code resource information is adjusted to obtain the adjusted code resource information. The adjusted code resource information is then recompiled, and the recompiled application resource package is signed to obtain the target application resource package.
[0109] (4) Transmitting unit 404; The sending unit 404 is used to send the target application resource package to the terminal so that the terminal can process the target object operation behavior of the terminal application based on the target application resource package.
[0110] For example, the sending unit 404 can be used to directly send the target application resource package to the terminal, or to send the storage address of the target application resource package to the terminal, so that the terminal can obtain the target application resource package of the terminal application according to the storage address, so that the terminal can process the target object operation behavior of the terminal application based on the target application resource package.
[0111] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.
[0112] As can be seen from the above, in this embodiment, after the acquisition unit 401 acquires the target object permission configuration information for the terminal application, the parsing unit 402 parses the target object permission configuration information to obtain the target object permission information of the terminal application. The repackaging unit 403 repackages the application resource package of the terminal application according to the target object permission information to obtain the target application resource package. The sending unit 404 sends the target application resource package to the terminal so that the terminal can process the target object operation behavior of the terminal application based on the target application resource package. Since this scheme obtains the target object permission information by parsing the target object permission configuration information and repackages the terminal application based on the target object permission information, so as to automatically add the target object permission information to the application resource package, automatically complete the access process, and send the target application resource package to the terminal, the terminal application can automatically process the target object operation behavior based on the target object permission information during runtime. Therefore, the permission management efficiency of the terminal application can be improved.
[0113] To better implement the above methods, embodiments of the present invention also provide a terminal application permission management device (i.e., a second terminal application permission management device), which can be integrated into a terminal, including tablet computers, laptop computers, and / or personal computers, etc.
[0114] For example, such as Figure 15 As shown, the first data processing device may include a receiving unit 501, an extraction unit 502, a detection unit 503, and a processing unit 504, as follows: (1) Receiving unit 501; The receiving unit 501 is used to receive the target application resource package of the terminal application sent by the server.
[0115] For example, receiving unit 501 can be used to directly receive the target application resource package of the terminal application sent by the server, or, when the number of terminal applications is large or the memory of the target application resource package is large, it can also indirectly receive the target application resource package of the terminal application sent by the server. (2) Extraction unit 502; Extraction unit 502 is used to extract target configuration information and target object permission information from the target application resource package.
[0116] For example, the extraction unit can be used to extract target code resource information from the code resource information of the target application resource package, identify target object code and target object resources in the target code resource information to obtain target object permission information, extract current configuration information from the target application resource package, identify configuration information used to call target object permission information in the current configuration information to obtain target configuration information.
[0117] (3) Detection unit 503; The detection unit 503 is used to run the terminal application according to the target application resource package and to detect the currently running terminal application according to the target configuration information.
[0118] For example, detection unit 503 can be used to add the target application resource package to the application container and start the terminal application in the application container, so that the terminal can run. Alternatively, it can directly load the target application resource package, so that the terminal application corresponding to the target application resource package runs on the terminal. Based on the target configuration information, the target object permission information is called to start the behavior detection service, obtain the application interface of the currently running terminal application, and detect the application interface based on the behavior detection service.
[0119] (4) Processing unit 504; The processing unit 504 is used to process the target object operation behavior according to the target object permission information when the target object operation behavior is detected.
[0120] For example, the processing unit 504 can be used to obtain the interface call request corresponding to the target object operation behavior when the target object operation behavior is detected, determine the operation type of the target object operation behavior according to the interface call request, and process the interface call request based on the operation type and the target object permission information.
[0121] Optionally, the permission management device for the second terminal application may also include a reporting unit 505, such as... Figure 16 As shown, the specific details are as follows: The reporting unit 505 is used to collect statistics on the target object's operation behavior and the corresponding processing results, and then report them to the server.
[0122] For example, the reporting unit 505 can be used to obtain the target object identity identifier corresponding to the target object's operation behavior, and based on the target object identity identifier, to count the target object's operation behavior and the processing results of the target object's operation behavior within a preset time period, obtain behavior statistics information, and report the behavior statistics information to the server.
[0123] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.
[0124] As can be seen from the above, in this embodiment, after the receiving unit 501 receives the target application resource package of the terminal application sent by the server, the extraction unit 502 extracts the target configuration information and target object permission information from the target application resource package. Then, the detection unit 503 runs the terminal application according to the target application resource package and detects the currently running terminal application according to the target configuration information. When the processing unit 504 detects the target object operation behavior for the terminal application, it processes the target object operation behavior according to the target object permission information. Since this solution can obtain the packaged target application resource package from the server, detect the target object operation behavior according to the target configuration information in the target application resource package, and process the target object operation behavior based on the target object permission information, it does not require the use of third-party tools to process the target object operation behavior. This enables the terminal application itself to have the ability to process the target object operation behavior, thus improving the efficiency of terminal application permission management.
[0125] This invention also provides an electronic device, such as... Figure 17 As shown, it illustrates a structural schematic diagram of the electronic device involved in an embodiment of the present invention, specifically: The electronic device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will understand that... Figure 17 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 601 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 602, and by calling data stored in the memory 602, it performs various functions and processes data, thereby performing overall detection of the electronic device. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, target interface, and application programs, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 601.
[0126] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0127] The electronic device also includes a power supply 603 that supplies power to the various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 603 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0128] The electronic device may also include an input unit 604, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to target object settings and function control.
[0129] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 601 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 602 according to the following instructions, and the processor 601 runs the applications stored in the memory 602 to realize various functions, as follows: The system retrieves the target object permission configuration information for the terminal application. This target object permission configuration information contains the configuration information of the target object permissions that need to be adjusted. The target object permissions are the operation permissions corresponding to the operation behavior of the target object. The system parses the target object permission configuration information to obtain the target object permission information of the terminal application. Based on the target object permission information, the application resource package of the terminal application is repackaged to obtain the target application resource package. The target application resource package is then sent to the terminal so that the terminal can process the target object operation behavior of the terminal application based on the target application resource package.
[0130] or, The system receives the target application resource package of the terminal application sent by the server, extracts the target configuration information and target object permission information from the target application resource package, runs the terminal application according to the target application resource package, and detects the currently running terminal application according to the target configuration information. When a target object operation behavior is detected, the target object operation behavior is processed according to the target object permission information.
[0131] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0132] As can be seen from the above, after obtaining the target object permission configuration information for the terminal application, the embodiments of the present invention parse the target object permission configuration information to obtain the target object permission information of the terminal application. Based on the target object permission information, the application resource package of the terminal application is repackaged to obtain the target application resource package, and the target application resource package is sent to the terminal so that the terminal can process the target object operation behavior of the terminal application based on the target application resource package. Since this solution obtains the target object permission information by parsing the target object permission configuration information and repackages the terminal application based on the target object permission information, so as to automatically add the target object permission information to the application resource package, automatically complete the access process, and send the target application resource package to the terminal, the terminal application can automatically process the target object operation behavior based on the target object permission information during runtime, thus improving the permission management efficiency of the terminal application.
[0133] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0134] To this end, embodiments of the present invention provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the permission management methods for terminal applications provided in the embodiments of the present invention. For example, the instructions can execute the following steps: Obtain the target object permission configuration information for the terminal application. This target object permission configuration information is the configuration information of the target object permissions that need to be adjusted. The target object permissions are the operation permissions corresponding to the operation behavior of the target object. Parse the target object permission configuration information to obtain the target object permission information of the terminal application. Based on the target object permission information, repackage the application resource package of the terminal application to obtain the target application resource package. Send the target application resource package to the terminal so that the terminal can process the target object operation behavior of the terminal application based on the target application resource package.
[0135] or, The system receives the target application resource package of the terminal application sent by the server, extracts the target configuration information and target object permission information from the target application resource package, runs the terminal application according to the target application resource package, and detects the currently running terminal application according to the target configuration information. When a target object operation behavior is detected, the target object operation behavior is processed according to the target object permission information.
[0136] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0137] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0138] Since the instructions stored in the computer-readable storage medium can execute the steps in the permission management method of any terminal application provided in the embodiments of the present invention, the beneficial effects that the permission management method of any terminal application provided in the embodiments of the present invention can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0139] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the methods provided in various optional implementations of the aforementioned terminal application's permission management or target object operation behavior control.
[0140] The foregoing has provided a detailed description of a terminal application permission management method, apparatus, and computer-readable storage medium provided by embodiments of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for managing permissions in a terminal application, characterized in that, include: Obtaining target object permission configuration information for a terminal application, wherein the target object permission configuration information is the configuration information of the target object permissions that need to be adjusted, and the target object permissions are the operation permissions corresponding to the operation behavior of the target object, includes: receiving target object permission configuration page information for the terminal application sent by the terminal; extracting the target operation behavior of the target object to be configured and the operation permissions corresponding to the target operation behavior from the target object permission configuration page information; configuring the target operation behavior and the operation permissions corresponding to the target operation behavior to obtain target object permission configuration information; The target object permission configuration information is parsed to obtain the target object permission information of the terminal application. Obtain the application resource package of the terminal application, and decompile the application resource package to obtain the code resource information of the terminal application; Extract the target object permission code and target object permission resources from the target object permission information; The original code and original resources of the terminal application are identified from the code resource information; The target object permission code and the original code are merged, and the target object permission resources and the original resources are merged to obtain basic code resource information; The current configuration information is identified in the code resource information, and the current configuration information is modified according to the preset behavior configuration information to obtain the target configuration information. The preset behavior configuration information is the configuration information for detecting or calling various interfaces of the terminal application. The target configuration information is fused with the basic code resource information to obtain the adjusted code resource information; the adjusted code resource information is recompiled, and the recompiled application resource package is signed to obtain the target application resource package; The target application resource package is sent to the terminal so that the terminal can process the target object operation behavior of the terminal application based on the target application resource package.
2. The terminal application permission management method according to claim 1, characterized in that, The process of merging the target object's permission resources and the original resources includes: Obtain the resource identifiers of the target object's permission resources and original resources; Based on resource type, the target object's permission resources and original resources are classified; Based on the classification results, the resource identifiers are adjusted, and the target object permission resources after the resource identifiers are adjusted are merged with the original resources after the resource identifiers are adjusted.
3. The terminal application permission management method according to claim 2, characterized in that, The adjustment of the resource identifier based on the classification results includes: Obtain the resource identifier configuration information corresponding to each resource type; Filter out resource identifiers of the same resource type from the resource identifiers to obtain the target resource identifier; Based on the resource identifier configuration information, the identifier conflicts between the target resource identifiers are eliminated.
4. The terminal application permission management method according to claim 1, characterized in that, The step of modifying the current configuration information according to preset behavior configuration information to obtain target configuration information includes: Obtain the preset behavior configuration information corresponding to the terminal application, and parse the preset behavior configuration information to determine at least one configuration item that needs to be modified; Identify the basic configuration information corresponding to each configuration item in the current configuration information; Based on the preset behavior configuration information, each of the basic configuration information is modified to obtain the target configuration information.
5. A method for managing permissions in a terminal application, characterized in that, include: Receive the target application resource package of the terminal application generated by the permission management method according to claim 1, sent by the server; Extract the target configuration information and target object permission information from the target application resource package; The terminal application is run according to the target application resource package, and the currently running terminal application is detected according to the target configuration information; When a target object operation is detected for the terminal application, the target object operation is processed according to the target object permission information.
6. The terminal application permission management method according to claim 5, characterized in that, The step of detecting the currently running terminal application based on the target configuration information includes: Based on the target configuration information, the target object permission information is invoked to start the behavior detection service; Obtain the application interface of the currently running terminal application, and perform detection on the application interface based on the behavior detection service.
7. The terminal application permission management method according to claim 5, characterized in that, The step of processing the target object's operation behavior based on the target object's permission information includes: Obtain the interface call request corresponding to the operation behavior of the target object; Based on the interface call request, determine the operation type of the target object's operation behavior; The interface call request is processed based on the operation type and the target object's permission information.
8. The terminal application permission management method according to claim 7, characterized in that, The process of handling the interface call request based on the operation type and target object permission information includes: The target object permissions corresponding to the operation type are identified in the target object permission information; When the target object's permission is set to allow operation, the target application interface is invoked according to the interface call request; When the target object's permission is set to deny operation, the interface request call is denied.
9. The terminal application permission management method according to claim 5, characterized in that, After processing the target object's operation behavior based on the target object's permission information, the method further includes: Obtain the target object identity identifier corresponding to the target object's operation behavior; Based on the target object's identity identifier, the target object's operational behavior and the processing results of the target object's operational behavior within a preset time period are statistically analyzed to obtain behavioral statistical information; The behavioral statistics are reported to the server.
10. A permission management device for a terminal application, characterized in that, include: The acquisition unit is used to acquire target object permission configuration information for a terminal application. The target object permission configuration information is the configuration information of the target object permissions that need to be adjusted. The target object permissions are the operation permissions corresponding to the operation behavior of the target object. The acquisition unit includes: receiving target object permission configuration page information for the terminal application sent by the terminal; extracting the target operation behavior of the target object to be configured and the operation permissions corresponding to the target operation behavior from the target object permission configuration page information; configuring the target operation behavior and the operation permissions corresponding to the target operation behavior to obtain the target object permission configuration information. The parsing unit is used to parse the target object permission configuration information to obtain the target object permission information of the terminal application; The repackaging unit is used to obtain the application resource package of the terminal application, and decompile the application resource package to obtain the code resource information of the terminal application; extract the target object permission code and target object permission resources from the target object permission information; identify the original code and original resources of the terminal application from the code resource information; merge the target object permission code and the original code, and merge the target object permission resources and the original resources to obtain basic code resource information; identify the current configuration information from the code resource information, and modify the current configuration information according to preset behavior configuration information to obtain target configuration information, wherein the preset behavior configuration information is configuration information for detecting or calling various interfaces of the terminal application; merge the target configuration information with the basic code resource information to obtain adjusted code resource information; recompile the adjusted code resource information, and sign the recompiled application resource package to obtain the target application resource package; The sending unit is used to send the target application resource package to the terminal, so that the terminal can process the target object operation behavior of the terminal application based on the target application resource package.
11. A permission management device for a terminal application, characterized in that, include: A receiving unit is used to receive a target application resource package of a terminal application generated by the permission management method according to claim 1, sent by the server. The extraction unit is used to extract target configuration information and target object permission information from the target application resource package; The detection unit is used to run the terminal application according to the target application resource package, and to detect the currently running terminal application according to the target configuration information. The processing unit is configured to process the target object operation behavior according to the target object permission information when a target object operation behavior is detected for the terminal application.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to execute the steps of the permission management method for a terminal application according to any one of claims 1 to 9.
13. An electronic device, characterized in that, It includes a processor and a memory, the memory storing an application program, and the processor running the application program in the memory to implement the permission management method for the terminal application according to any one of claims 1 to 9.
14. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the steps in the permission management method of the terminal application according to any one of claims 1 to 9.
Citation Information
Patent Citations
Application permission management method, device and equipment and storage medium
CN111523136A