Rights management method, related device and system
By granting permissions only when the user operates the security system controls in the electronic device, the problem of the application obtaining permissions when the user has no intention of operation is solved, and the protection of user privacy and the improvement of electronic device security is achieved.
Patent Information
- Application Number
- CN202410356281.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-16
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2043-02-16
AI Technical Summary
In the prior art, applications obtain permissions when the user has no intention of operation and use this permission to obtain privacy data, resulting in user privacy being infringed.
By implementing the permission management method in an electronic device, the corresponding permissions are granted to the application only after receiving the user's operation on the security system controls to ensure that the permission usage is consistent with the user's operation intention.
It effectively avoids the application from obtaining permissions when the user has no intention of operating, protects user privacy, enhances the security of electronic devices, and improves the user experience.
Smart Images

Figure CN118503995B_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202310144870.5, and the original application date is February 16, 2023. The entire contents of the original application are incorporated into this application by reference. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a permission management method, related devices and systems. Background Art
[0003] To protect user privacy, when an application (APP) installed in an electronic device uses certain permissions for the first time or each time, the system will pop up a dialog box to ask the user to confirm whether to authorize. If the user agrees to authorize, the application can access the corresponding system resources; if the user refuses to authorize, the application cannot access the corresponding system resources.
[0004] Authorization through a pop-up window requires user confirmation. Since the pop-up window may provide users with multiple authorization options with different time limits, many users are not clear about how to choose, which brings a certain usage threshold. On the other hand, after the user agrees to the authorization, the application will continue to have the permission within the corresponding time limit. As long as the electronic device starts the application, even if the user does not actively use the permission, the application may secretly use the permission in the background, and the application's behavior cannot be detected by the user or is difficult to be detected by the user, causing privacy infringement. Summary of the invention
[0005] The present application provides a permission management method, related devices and systems, which can prevent applications from obtaining permissions and using the permissions to obtain private data when the user has no operation intention, thereby protecting user privacy, enhancing the security of user-side electronic devices, and improving user experience.
[0006] In a first aspect, a permission management method is provided, the method comprising: an electronic device runs a first application and displays a first system control; the electronic device receives a user operation acting on the first system control; the electronic device determines whether the first system control is a safe system control; if so, the electronic device grants a first permission to the first application, and executes a first business based on the first permission.
[0007] By implementing the permission management method provided in the first aspect, the electronic device grants the permission corresponding to the security system control to the application only after receiving the user operation acting on the security system control, which is equivalent to authorization based on the user's operation intention, and authorization is performed only when the user triggers the service through user operation. In this way, it can be avoided that the application obtains the permission corresponding to the system control when the user has no operation intention and uses the permission to obtain the user's privacy data. It can be seen that this method limits the conditions under which the application can obtain and use permissions, avoids giving the application too much freedom to use permissions, thereby protecting user privacy, enhancing the security of electronic devices on the user side, and improving user experience.
[0008] In conjunction with the first aspect, in some implementations, a secure system control refers to a system control that is triggered by a user operation received by an electronic device to grant a corresponding permission, and the system control integrates a calling interface for obtaining a corresponding permission in the electronic device. This is equivalent to a secure system control that is bound to a user operation during application development, so that the electronic device will call the interface authorization only after receiving a user operation acting on the secure system control.
[0009] In conjunction with the first aspect, in some implementations, before the electronic device displays the first system control, a callback function may be registered for the first application. The electronic device may call the callback function to determine whether the first system control is a safe system control.
[0010] By registering a callback function and calling the callback function, the security of the first system control can be checked inside the electronic device to ensure the implementation of the permission management method provided in this application.
[0011] In combination with the previous implementation, the electronic device can obtain information about all developed security system controls from the information obtained by the application installation package of the first application, so the electronic device calls the callback function, and the callback function can use this information to determine the security of the system controls.
[0012] Here, the information of the security system control may include but is not limited to: the coordinates of the security system control in the user interface, the type of the security system control (including the type related to the business corresponding to the security system control), the identifier, etc.
[0013] In combination with the previous implementation, the electronic device can register a callback function for the first application during the trusted stage of running the first application. The trusted stage refers to the stage when the first application is still in the incubation stage and has not yet been run. The entire trusted stage is controlled by the system of the electronic device and is therefore trustworthy. Based on this, the callback function registered by the electronic device during the trusted stage is trustworthy and can be used to perform some subsequent verification of the first system control to ensure the accuracy of the verification result.
[0014] In conjunction with the first aspect, in some implementations, the electronic device may obtain information about the first system control, and then determine whether it is a safe system control based on the information about the first system control. The information about the first system control may include, but is not limited to: the coordinates of the first system control in the user interface, the type of the first system control (including the type related to the business corresponding to the first system control), an identifier, and the like.
[0015] In conjunction with the first aspect, in some implementations, before the electronic device calls the callback function to determine whether the first system control is a safe system control, it can first determine whether the first application has registered the callback function. If the first application has registered the callback function, it means that the first application can call the callback function for subsequent verification.
[0016] In combination with the previous implementation, the method for the electronic device to determine whether the first application has registered a callback function may include the following two methods:
[0017] Method 1: When the electronic device registers a callback function for the first application, the electronic device will cache the information of the first application, such as the process PID, and the electronic device can determine whether the registered cache information contains the PID of the first application. If so, it is considered that the first application has registered a callback function.
[0018] Method 2: Based on the fact that the electronic device caches the information of the first application, such as the random value, when registering the callback function for the first application, the electronic device can determine whether the registered cache information contains the random value of the first application. If so, it is considered that the first application has registered the callback function.
[0019] The above two methods can also be implemented in combination.
[0020] In combination with the first aspect, in some embodiments, before the electronic device receives a user operation acting on the first system control, it registers one or more secure system controls provided for the first application; before the electronic device determines whether the first system control is a secure system control, it determines that the first system control has been registered.
[0021] Through the previous implementation, since only safe system controls can be registered successfully, it is equivalent to that the electronic device has verified the first system control once before determining whether it is a safe system control, which is equivalent to double verification and can enhance the credibility of the result.
[0022] In combination with the previous implementation, the electronic device can call the callback function to determine whether the first system control is a safe system control, and if so, complete the registration of the first system control. The process of determining whether the first system control is safe during registration is similar to the process of determining whether the electronic device is safe before authorization, and reference may be made to the relevant description in the previous text.
[0023] In combination with the first aspect, in some implementations, before the electronic device runs the first application, it can install the first application according to the application installation package, and during the installation of the first application, obtain information about one or more secure system controls provided by the first application from the application installation package.
[0024] In combination with the previous implementation, the electronic device can also obtain information about one or more non-secure system controls provided by the first application from the application installation package during the installation of the first application. The non-secure system control refers to a system control that can trigger the granting of corresponding permissions without the need for the electronic device to receive user operations, and the system control integrates a calling interface for the acquisition method of the corresponding permissions in the electronic device.
[0025] By comparison, the difference between secure system controls and unsecure system controls is that secure system controls require user operation to call the permission interface, while unsecure system controls can call the interface without user operation. The method provided in this application is to avoid the latter situation and prevent unsecure system controls from calling the interface to obtain authorization without the user's intention.
[0026] In conjunction with the first aspect, in some implementations, after the electronic device completes the first service, the first permission granted to the first application can be revoked, so that resources in the electronic device can be more strictly controlled to prevent the application from privately obtaining the user's private data.
[0027] In conjunction with the first aspect, in some implementations, the first permission may include permission to use one or more different resources.
[0028] In combination with the first aspect, in some implementations, the first permission may include camera permission, location permission, clipboard permission, etc.
[0029] In combination with the first aspect, in some implementations, the first system control may include a photo control, a positioning control, a paste control, and the like.
[0030] In a second aspect, an embodiment of the present application provides an electronic device, comprising: a memory, one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute: run a first application and display a first system control; receive a user operation acting on the first system control; determine whether the first system control is a safe system control; if so, grant a first permission to the first application, and execute a first business based on the first permission.
[0031] In conjunction with the second aspect, in some implementations, a secure system control refers to a system control that is triggered by a user operation received by an electronic device to grant a corresponding permission, and the system control integrates a calling interface for obtaining the corresponding permission in the electronic device. This is equivalent to a secure system control that is bound to a user operation during the application development process, so that the electronic device will call the interface authorization only after receiving a user operation acting on the secure system control.
[0032] In conjunction with the second aspect, in some implementations, the one or more processors are further configured to call a computer instruction to cause the electronic device to execute: register a callback function for the first application before displaying the first system control. The one or more processors are specifically configured to call a computer instruction to cause the electronic device to execute: call the callback function to determine whether the first system control is a safe system control.
[0033] In combination with the previous embodiment, one or more processors are also used to call computer instructions to enable the electronic device to execute: obtain information about all developed security system controls from the information obtained in the application installation package of the first application, so that a callback function can be called, and the callback function can use this information to determine the security of the system controls.
[0034] Here, the information of the security system control may include but is not limited to: the coordinates of the security system control in the user interface, the type of the security system control (including the type related to the business corresponding to the security system control), the identifier, etc.
[0035] In combination with the previous implementation, one or more processors are specifically used to call computer instructions to enable the electronic device to execute: in the trusted stage of running the first application, register a callback function for the first application. The trusted stage refers to the stage when the first application is still in the incubation stage and has not yet been run. The entire trusted stage is controlled by the system of the electronic device and is therefore trustworthy. Based on this, the callback function registered by the electronic device in the trusted stage is trustworthy and can be used to perform some subsequent verification of the first system control to ensure the accuracy of the verification result.
[0036] In conjunction with the second aspect, in some embodiments, one or more processors are further used to call computer instructions to enable the electronic device to execute: obtaining information of the first system control, and then determining whether it is a safe system control based on the information of the first system control. The information of the first system control may include but is not limited to: the coordinates of the first system control in the user interface, the type of the first system control (including the type related to the business corresponding to the first system control), the identifier, etc.
[0037] In conjunction with the second aspect, in some implementations, one or more processors are further configured to call a computer instruction to cause the electronic device to execute: before calling a callback function to determine whether the first system control is a safe system control, first determine whether the first application has registered the callback function. If the first application has registered the callback function, it means that the first application can call the callback function for subsequent verification.
[0038] In combination with the previous implementation, the method for the electronic device to determine whether the first application has registered a callback function may include the following two methods:
[0039] Method 1: When the electronic device registers a callback function for the first application, the electronic device will cache the information of the first application, such as the process PID, and the electronic device can determine whether the registered cache information contains the PID of the first application. If so, it is considered that the first application has registered a callback function.
[0040] Method 2: Based on the fact that the electronic device caches the information of the first application, such as the random value, when registering the callback function for the first application, the electronic device can determine whether the registered cache information contains the random value of the first application. If so, it is considered that the first application has registered the callback function.
[0041] The above two methods can also be implemented in combination.
[0042] In combination with the second aspect, in some embodiments, one or more processors are also used to call computer instructions to cause the electronic device to execute: before receiving a user operation acting on the first system control, registering one or more secure system controls provided for the first application; before determining whether the first system control is a secure system control, determining that the first system control has been registered.
[0043] In combination with the previous implementation, one or more processors are specifically used to call computer instructions to enable the electronic device to execute: calling the callback function to determine whether the first system control is a safe system control, and if so, completing the registration of the first system control. The process of determining whether the first system control is safe during registration is similar to the process of determining whether the electronic device is safe before authorization in the previous text, and reference may be made to the relevant description in the previous text.
[0044] In combination with the second aspect, in some embodiments, one or more processors are also used to call computer instructions to cause the electronic device to execute: before running the first application, install the first application according to the application installation package, and during the installation of the first application, obtain information about one or more security system controls provided by the first application from the application installation package.
[0045] In combination with the previous implementation, one or more processors are further used to call computer instructions to enable the electronic device to execute: in the process of installing the first application, obtain information about one or more non-secure system controls provided by the first application from the application installation package. Among them, the non-secure system control refers to a system control that can trigger the granting of corresponding permissions without the electronic device receiving a user operation, and the system control integrates a calling interface for the acquisition method of the corresponding permissions in the electronic device.
[0046] By comparison, the difference between secure system controls and unsecure system controls is that secure system controls require user operation to call the permission interface, while unsecure system controls can call the interface without user operation. The method provided in this application is to avoid the latter situation and prevent unsecure system controls from calling the interface to obtain authorization without the user's intention.
[0047] In conjunction with the second aspect, in some implementations, one or more processors are further configured to call a computer instruction to cause the electronic device to execute: after completing the first service, revoke the first permission granted to the first application. This can more strictly control the resources in the electronic device and prevent the application from privately obtaining the user's private data.
[0048] In conjunction with the second aspect, in some implementations, the first permission may include permission to use one or more different resources.
[0049] In conjunction with the second aspect, in some implementations, the first permission may include camera permission, location permission, clipboard permission, etc.
[0050] In conjunction with the second aspect, in some implementations, the first system control may include a photo control, a positioning control, a paste control, and the like.
[0051] The specific implementation of the second aspect and any implementation method of the second aspect, as well as the technical effects, can refer to the relevant description of the first aspect and each implementation method of the first aspect, and will not be repeated here.
[0052] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, causes the electronic device to execute a method executed by the electronic device in the first aspect or any one of the embodiments of the first aspect.
[0053] In a fourth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the method executed by the electronic device in the first aspect or any one of the embodiments of the first aspect.
[0054] In a fifth aspect, an embodiment of the present application provides a chip system, which includes at least one processor for implementing a method executed by an electronic device in the first aspect or any one of the embodiments of the first aspect.
[0055] By implementing the technical solution provided by this application, the electronic device only grants the corresponding permission to the application after receiving the user operation acting on the system control, and then authorizes the business corresponding to the permission when the user triggers the business through user operation, which can prevent the application from obtaining permission and using the permission to obtain private data when the user has no operation intention, thereby protecting the user's privacy, enhancing the security of the user-side electronic device, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1A A schematic diagram of the structure of a communication system 10 provided in an embodiment of the present application;
[0057] Figure 1B A hardware structure block diagram of the device 100 provided in an embodiment of the present application;
[0058] Figure 1C A hardware structure block diagram of an electronic device 300 provided in an embodiment of the present application;
[0059] Figure 1D The software architecture of the electronic device 300 provided in the embodiment of the present application;
[0060] Figure 2A-2E A set of user interfaces displayed on the electronic device 300 provided in an embodiment of the present application;
[0061] Figure 3 A flowchart of a rights management method provided in an embodiment of the present application;
[0062] Figure 4 An internal interaction diagram of some steps of the permission management method implemented by the electronic device 300 provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0064] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0065] The term "user interface (UI)" in the following embodiments of the present application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device, and finally presented as content that can be recognized by the user. The commonly used form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.
[0066] The following embodiments of the present application provide a permission management method, related devices and systems.
[0067] In an embodiment of the present application, the user-side electronic device manufacturer provides one or more system control calling interfaces for application developers to call on demand when developing applications, thereby implementing corresponding system controls in the developed applications.
[0068] System controls refer to controls provided by the user-side electronic device, which may be interface elements implemented in the form of buttons, icons, tabs, etc.
[0069] The calling interface of the system control integrates the way to obtain permissions in the user-side electronic device. Optionally, the calling interface of the system control can also integrate: the display logic of the system control, or the execution logic of the business triggered by the system control. The display logic of the system control refers to the implementation method of the electronic device drawing the system control on the user interface through modules such as the UI framework, the way to obtain permissions refers to the process of granting permissions to the electronic device through the permission management module, and the execution logic of the business refers to the process of the electronic device calling related software and / or hardware to execute the corresponding business.
[0070] The permissions and services integrated in the calling interface of the system control can be regarded as corresponding to the system control. A system control can correspond to one or more permissions, and can also correspond to one or more services. For example, the user-side electronic device can encapsulate the display logic of the photo control, the way to obtain camera permissions, and the execution logic of the photo service into the calling interface of the photo control; or, the user-side electronic device can encapsulate the display logic of the positioning control, the way to obtain positioning permissions, and the execution logic of the positioning service into the calling interface of the positioning control; or, the user-side electronic device can encapsulate the display logic of the paste control, the way to obtain clipboard permissions, and the execution logic of the paste service into the calling interface of the paste control.
[0071] In an embodiment of the present application, the equipment manufacturer can encapsulate sensitive permissions and corresponding sensitive services in the user-side electronic device, such as taking pictures, recording, video recording, positioning, clipboard, etc., as a calling interface of the system control. For example, a calling interface for the positioning control, a calling interface for the pasting control, a calling interface for the photo control, a calling interface for the video recording control, and so on can be provided. Of course, sensitive services can also be encapsulated as other interfaces different from the system control calling interface, and do not need to be called by the same interface as sensitive permissions. In some other implementations, the equipment manufacturer can also encapsulate other permissions and services in the user-side electronic device, such as non-sensitive permissions and non-sensitive services, as system controls, which are not limited here.
[0072] If the application developer uses the calling interface of the system control when developing the application, the user-side electronic device can call the calling interface of the system control in the user-side electronic device during the running of the application. The following operations can be performed through the calling interface of the system control: display the system control, apply for permission, and execute the business triggered by the system control based on the permission.
[0073] Application developers use the system control calling interface provided by the device manufacturer to develop system controls in applications, which can be divided into the following two categories:
[0074] 1. Security system controls
[0075] When application developers develop applications using the calling interface of system controls, if they bind system controls to user operations and declare that the permission application and business execution corresponding to the system controls need to be triggered under the user operation, then only after the user-side electronic device receives the user operation will it apply for the corresponding permission and execute the corresponding business. This is equivalent to the user-side electronic device applying for the corresponding permission only when the user actively triggers it and the user has the intention to operate. This can prevent the application in the user-side electronic device from spontaneously applying for the permission and using the permission to steal the user's privacy data when the user has no intention to operate.
[0076] Since system controls bound to user operations can protect user privacy, this type of control can be called a secure system control.
[0077] 2. Non-security system controls
[0078] When application developers develop applications using the calling interface of system controls, if they do not bind user operations to system controls and do not declare that the permission application and business execution corresponding to the system controls need to be triggered by user operations, then the application in the user-side electronic device can apply for the corresponding permissions and execute the corresponding business at any time. This is equivalent to applying for the corresponding permissions by the user-side electronic device without the user's active triggering, even if the user has no intention to operate. In this way, the application in the user-side electronic device can spontaneously apply for the permission and use the permission to steal the user's privacy data without the user's intention to operate.
[0079] Since system controls that are not bound to user operations may bring risks of user privacy leakage, this type of control can be called non-secure system controls.
[0080] In the permission management method provided by the present application, after the user-side electronic device installs and runs the application developed using the calling interface of the system control as described above, only after receiving the user operation acting on the system control, the corresponding permission is granted to the application through the calling interface of the system control, and then the service corresponding to the system control is executed through the application. In addition, the user-side electronic device will refuse or prohibit granting the corresponding permission to the application through the calling interface of the system control without receiving the user operation.
[0081] According to the properties of the security system control and the non-security system control described above, the security system control is bound to the user operation, so the electronic device will call the interface authorization only after receiving the user operation acting on the security system control; the non-security system control is not bound to the user operation, so the electronic device may use the system control interface corresponding to the non-security system control to apply for permission without receiving the user operation. Based on this, the method provided by this application is implemented, and the electronic device only grants the permission corresponding to the security system control after receiving the user operation acting on the security system control, and refuses or prohibits granting the permission corresponding to the non-security system control, which is equivalent to the electronic device being able to distinguish between the security system control and the non-security system control, and performing different permission management for the two system controls.
[0082] Through the permission management method provided by the present application, the electronic device only grants the permission corresponding to the security system control to the application after receiving the user operation acting on the security system control, which is equivalent to authorization based on the user's operation intention, and authorization is only performed when the user triggers the service through user operation. In this way, it can be avoided that the application obtains the permission corresponding to the system control (including security system controls and non-security system controls) when the user has no operation intention and uses the permission to obtain the user's privacy data. It can be seen that this method limits the conditions under which the application can obtain and use permissions, avoids giving the application too much freedom to use permissions, thereby protecting user privacy, enhancing the security of electronic devices on the user side, and improving user experience.
[0083] The method provided in the present application triggers authorization and business execution simultaneously by user operation, which is equivalent to combining the operation of triggering the business and the authorization operation into one. There is no need for the user to trigger authorization separately through explicit operations such as clicking on options in a pop-up window, which can simplify user operations and provide users with a better application usage experience.
[0084] In some implementations, if the device manufacturer encapsulates the sensitive permissions or corresponding sensitive services in the user-side electronic device as a calling interface of the system control, and the application developer uses the calling interface to develop a secure system control, then by implementing the permission management method provided by this application, the application can only obtain the sensitive permissions required for the sensitive service when the user actively triggers the sensitive service. In other cases, the application cannot obtain the permissions required for the sensitive service and cannot execute the sensitive service. This method can ensure the security of sensitive data.
[0085] In some implementations, the electronic device grants the corresponding permissions of the security system control to the application, and after the application executes the corresponding service, the permission can be revoked after the service is executed. This can ensure that the permissions granted to the application are only used for the service that the user wants to execute, avoid giving the application too much freedom of permissions, and avoid the application from privately using the permissions to steal the user's privacy after obtaining the permissions.
[0086] Regarding how the electronic device can grant the application the permission corresponding to the security system control only after receiving the user operation acting on the security system control, please refer to the detailed description of the subsequent method embodiments, which will not be repeated here.
[0087] Below, the communication system provided by the embodiment of the present application is first introduced.
[0088] like Figure 1A As shown, the embodiment of the present application provides a communication system 10. The communication system 10 includes: a device 100 for developing applications, a platform 200 for listing applications, and a user-side electronic device 300 for installing and running applications.
[0089] Device 100 is a device used by developers to develop applications, for example, it may be a computer.
[0090] An integrated development environment (IDE) is installed in the device 100. IDE is an application that provides a program development environment, integrating software development functions such as code writing, analysis, compilation, and debugging. There is no restriction on the development language provided by the IDE installed in the device 100, which may include but is not limited to JS, eTS, c, c++, c#, Java, Python, etc.
[0091] The IDE installed in the device 100 may be provided by the device manufacturer of the user-side electronic device 300. The device manufacturer may include the manufacturer, supplier, provider or operator of the electronic device. The manufacturer may refer to a manufacturer that manufactures electronic devices with self-made or purchased parts and raw materials. The supplier may refer to a manufacturer that provides the whole machine, raw materials or parts of the electronic device. The operator may refer to a manufacturer responsible for the distribution of the electronic device.
[0092] The device 100 is used to develop applications through the installed IDE. The process of developing applications by the device 100 may at least include: 1. Receiving the code input by the developer for implementing the application function. In this process, the developer integrates the calling interface of the system control in the user-side electronic device into the code. 2. Compiling and packaging the program written by the developer into a binary executable file, thereby obtaining an application installation package.
[0093] The IDE can provide an application programming interface (API) for developers to integrate the calling interface of the system control in the user-side electronic device when developing applications, so that the developed application can implement the system control at runtime.
[0094] When a developer develops an application through the device 100 , the developer may set a system control in one or more user interfaces of the application as needed. A user interface may include one or more system controls.
[0095] A code example is provided below to explain how an application developer can call the interface of the system control to implement the system control when developing an application in the device 100 .
[0096] build(){
[0097] Row(){
[0098] Column(){
[0099] Text(this.message')
[0100] .fontSize(50)
[0101] .fontWeight(FontWeight.Bold)
[0102] SecurePasteButton(){
[0103] Text( 'Paste' )
[0104] .fontSize(20)
[0105] .fontWeight(FontWeight.Bold)
[0106] }.type(ButtonType.Capsule)
[0107] .margin({
[0108] top:20
[0109] })
[0110] .backgroundColor( '#0D9FF8' )
[0111] .width( '35%' )
[0112] .height( '5%' )
[0113] .onClick((data,err)=>{
[0114] if(err==null){
[0115] }
[0116] The above code example is a part of the code written by the developer on the device 100, which declares a system control (i.e., the SecurePasteButton secure paste control). The system control has the text "Paste", and after the system control is clicked, the system will notify the application of the click event. The position of the system control is determined by the width, height, margin and other parameters set in the above code. For example, width('35%') means that the button width is 40% of the screen width, height('5%') means that the button height is 5% of the screen height, and it is centered by default. (margin top:20) means that it is offset 20 units downward from the center line. The background color of the system control can be determined by backgroundColor('#0D9FF8'). In addition, the acquisition of the clipboard permission and the paste service behind the paste control need to be triggered by the user's click operation. The paste control is bound to the user operation and therefore belongs to a secure system control.
[0117] Each function in the above code is the calling interface of the system control provided by the device manufacturer. For example, the SecurePasteButton() function is the calling interface of the paste control provided by the device manufacturer. Although the display logic of the system control is implemented through this calling interface, some information of the system control, such as the text, position, background color, etc. displayed on it, can be customized by the application developer. For example, referring to the above code, the application developer can customize some information of the paste control in the SecurePasteButton() function, such as the text on the control indicated by the underlined part in the above code, the position of the control on the screen, the background color, etc.
[0118] The following is an example to illustrate how developers can call the system control interface to implement non-secure system controls when developing applications.
[0119] registerSystemComponent()
[0120] grantPermission()
[0121] The above example only contains part of the code. The two functions in the above example can be called without user triggering, thereby obtaining system authorization and using the authorization to perform subsequent business. Therefore, the system control declared in the above example is a non-secure system control.
[0122] The relevant information of the system controls set by the application developer must comply with the regulations. For example, if the background color of the system control declared in the code is transparent, it is very easy for users to accidentally touch the system control; or, the text on the system control declared in the code is far from the function of the system control (such as setting the text "Grab a red envelope" on the system control that obtains location information), which will induce users to touch the system control. Therefore, the above two settings do not comply with the regulations.
[0123] In order to ensure that the code developed by the application developer complies with the regulations, the IDE can preset compliance rules, and can parse the information of the system controls declared in the code, and check whether the information of the system controls is compliant according to the preset compliance rules. Only when the information of all system controls declared in the code is compliant, the code is compliant, and the device 100 will package the code into an application installation package.
[0124] The platform 200 can be used to integrate various applications developed by different developers. The platform 200 can be implemented as a server, such as a physical server or a cloud server. For example, the platform 200 can be a server that provides services for an application store or an application download website. The platform 200 can be provided by a device manufacturer or a third party. After the device 100 has developed the application and obtained the application installation package, the application installation package can be sent to the platform 200 so that the platform 200 displays the application installation package to the user for the user to download. Not limited to the platform 200, the device 100 can also send the application installation package to other network locations for the user to download.
[0125] In some implementations, before the platform 200 puts the application on the shelf, it can also parse the application installation package to analyze whether all system controls declared by the application are compliant. The platform 200 can check compliance in the manner described above for the device 100.
[0126] The electronic device 300 is used to download and install the application installation package from the platform 200 or other network locations. Afterwards, the electronic device 300 can run the application, and only after receiving the user operation acting on the system control, grant the corresponding permission to the application through the calling interface of the system control, and then execute the business corresponding to the system control through the application. After the business is completed, the electronic device 300 can also reclaim the permission granted to the current application through the system. The electronic device 300 can also refuse or prohibit granting the corresponding permission to the application through the calling interface of the system control without receiving the user operation.
[0127] For the specific manner in which the electronic device 300 manages permissions, please refer to the detailed description of the subsequent method embodiments.
[0128] The electronic device 300 is a smart terminal device, which can be of various types, and the embodiments of the present application do not limit its specific type. For example, the electronic device 300 can be a mobile phone, and can also include a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, a smart screen, a wearable device, an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a car machine, a smart headset, a game console, and can also be an Internet of Things (IOT) device or a smart home device such as a smart water heater, a smart lamp, a smart air conditioner, etc. Without limitation, the electronic device 300 can also include a laptop computer with a touch-sensitive surface or a touch panel, a desktop computer with a touch-sensitive surface or a touch panel, and other non-portable terminal devices, etc.
[0129] The above-mentioned devices in the communication system 10 can establish connections and communicate through various technologies, which are not limited in the embodiments of the present application. For example, the above-mentioned devices can communicate through Bluetooth (BT), wireless local area networks (WLAN) such as wireless fidelity point to point (Wi-Fi P2P), cellular networks, etc.
[0130] Each device in the communication system 10 may be configured with a different software operating system (OS), or may be configured with the same OS, which is not limited here. For example, the OS configured in the electronic device 300 may include but is not limited to: etc.
[0131] Figure 1A The communication system 10 shown is only an example. In a specific implementation, the communication system 10 may include more or fewer devices, and some devices may be combined or separated.
[0132] For the specific implementation of the operations performed by each device in the communication system 10, reference may be made to the relevant description of the subsequent method embodiments, which will not be repeated here.
[0133] refer to Figure 1B , Figure 1B The hardware structure diagram of the device 100 for developing applications provided in the embodiment of the present application. The device 100 may be Figure 1A An apparatus 100 in a communication system is shown.
[0134] like Figure 1B As shown, the device 100 may include: one or more processors 601, memory 602, communication interface 603, transmitter 605, receiver 206, coupler 207, antenna 208 and display screen 209. These components may be connected via bus 204 or other means. Figure 1B Take bus connection as an example.
[0135] In the embodiment of the present application, the processor 601 can be used to read and execute computer-readable instructions. Specifically, the processor 601 can be used to call a program stored in the memory 602, such as the implementation program of the rights management method provided in the embodiment of the present application in the device 100, and execute the instructions contained in the program.
[0136] The memory 602 is coupled to the processor 601 and is used to store various software programs and / or multiple sets of instructions. Specifically, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage devices, flash memory devices or other non-volatile solid-state storage devices.
[0137] The memory 602 may store an operating system. The memory 602 may also store a network communication program, which may be used to communicate with the platform 200. The memory 602 may also store an IDE installation package and operating data.
[0138] The communication interface 603 may be used for the device 100 to communicate with other communication devices, such as the platform 200, etc. Specifically, the communication interface 603 may be a 3G communication interface, a long term evolution (LTE) (4G) communication interface, a 5G communication interface, a WLAN communication interface, a WAN communication interface, etc. Not limited to a wireless communication interface, the device 100 may also be configured with a wired communication interface 603 to support wired communication, for example, the backhaul link between the device 100 and the platform 200 may be a wired communication connection.
[0139] The transmitter 605 and the receiver 206 can be regarded as a wireless modem. The transmitter 605 can be used to transmit and process the signal output by the processor 601. The receiver 206 can be used to receive the signal. In the device 100, the number of the transmitter 605 and the receiver 206 can be one or more. The antenna 208 can be used to convert the electromagnetic energy in the transmission line into electromagnetic waves in the free space, or convert the electromagnetic waves in the free space into electromagnetic energy in the transmission line. The coupler 207 can be used to divide the mobile communication signal into multiple paths and distribute it to multiple receivers 206. It can be understood that the antenna 208 of the network device can be implemented as a large-scale antenna array.
[0140] The display screen 209 can be used to display images. The display screen 209 can be used to provide a graphical user interface of an IDE for developers to input codes for implementing application functions, and can also be used to output the result of the processor 601 checking whether the code complies with the specification.
[0141] The processor 601 may be used to compile the code written by the developer, check whether the code complies with the specification, and package the code that passes the check into a binary executable file, namely, an installation package.
[0142] The transmitter 605 may be used to send the installation package generated by the processor 601 to the platform 200 , so that the platform 200 can display the installation package to the user, thereby allowing the user to download it.
[0143] Figure 1B The device 100 shown is only one implementation of the embodiment of the present application. In practical applications, the device 100 may also include more or fewer components, which is not limited here. The specific functions of the device 100 can be referred to the detailed description of the subsequent method embodiments, which will not be described here.
[0144] refer to Figure 1C , Figure 1C The hardware structure diagram of the electronic device 300 provided in the embodiment of the present application. The electronic device 300 may be Figure 1A An electronic device 300 in a communication system is shown.
[0145] like Figure 1C As shown, the electronic device 300 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0146] The structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 300. In other embodiments of the present application, the electronic device 300 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0147] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0148] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0149] A memory may also be provided in the processor 110 for storing instructions and data, such as an implementation program of the rights management method provided in the embodiment of the present application on the electronic device 300 side. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
[0150] The wireless communication function of the electronic device 300 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0151] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 300 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0152] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 300. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0153] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0154] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 300. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, demodulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0155] In some embodiments, the antenna 1 of the electronic device 300 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 300 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0156] The electronic device 300 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0157] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display panel can also be made of an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), miniled, microled, micro-oled, quantum dot light emitting diodes (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0158] The display screen 194 may be used to display a user interface implemented on the electronic device 300 provided in subsequent embodiments.
[0159] The electronic device 300 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0160] The ISP is used to process data fed back by the camera 193 .
[0161] The camera 193 is used to capture still images or videos. In some embodiments, the electronic device 300 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0162] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0163] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.
[0164] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .
[0165] The electronic device 300 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0166] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0167] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 300 can listen to music or listen to a hands-free call through the speaker 170A.
[0168] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 300 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0169] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals.
[0170] In the embodiment of the present application, the mobile communication module 150 or the wireless communication module 160 is used to download the application installation package from the platform 200 or other network locations. The downloaded application installation package can be stored in the internal memory 121.
[0171] Processor 601 is used to read the application installation package and run the application installation package to complete the installation of the application. Afterwards, processor 110 is used to run the installed application, and only after the electronic device 300 receives a user operation acting on the system control, the corresponding permission is granted to the application through the calling interface of the system control, and then the corresponding business of the system control is executed through the application. In addition, processor 110 is also used to refuse or prohibit granting the corresponding permission to the application through the calling interface of the system control when the electronic device 300 does not receive a user operation. Processor 110 is also used to reclaim the permission granted to the current application after the business is completed.
[0172] The software system of the electronic device 300 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The present application embodiment takes a mobile operating system with a layered architecture as an example to exemplify the software structure of the electronic device 300.
[0173] Figure 1D is a software structure diagram of the electronic device 300 of the embodiment of the present application. The electronic device 300 may be Figure 1A An electronic device 300 in the communication system 10 is shown.
[0174] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the mobile operating system is divided into four layers, from top to bottom: application layer, program framework layer / core service layer, system library and runtime, and kernel layer.
[0175] The system library may include a system database for storing information of applications.
[0176] The application layer can include a series of application packages.
[0177] like Figure 1D As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc., and may also include applications developed by developers through device 100. In the subsequent embodiments of this application, the application developed by the developer through device 100 and containing the security system control is referred to as the first application.
[0178] The program framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The program framework layer includes some predefined functions.
[0179] like Figure 1D As shown, the program framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and may also include a process incubator 301, a UI framework 302, a security system control generation module 303, a security system control management module 304, a permission management module 305, and the like.
[0180] in,
[0181] The process incubator 301 is used to run applications at the application layer, such as the first application.
[0182] The UI framework 302 is used to call back the application's business implementation according to input events.
[0183] The security system control generation module 303 is used to register a callback function and identify the security system control under the instruction of the security system control management module 304. One first application corresponds to one security system control generation module 303, and different applications correspond to different security system control generation modules 303. Of course, in some other implementations, multiple applications may also correspond to one security system control generation module 303.
[0184] The security system control management module 304 is used to verify whether the system control is a security system control, and is also used to apply for the corresponding permission of the security system control from the permission management module 305 after the verification is passed. One security system control management module 304 can be set in one electronic device.
[0185] The security system control generation module 303 and the security system control management module 304 can collaborate to identify permission application requests initiated by security system controls and non-security system controls. For details, please refer to the detailed description of the subsequent method embodiments.
[0186] The permission management module 305 is used to manage (including granting, revoking, etc.) various permissions in the electronic device 300. Its specific functions can be referred to the relevant description of the subsequent method embodiments.
[0187] Part or all of the above-mentioned process incubator, UI framework, security system control generation module, security system control management module, and permission management module may also be located in other layers of the electronic device, such as a system library, etc., which is not limited here.
[0188] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0189] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0190] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0191] The phone manager is used to provide communication functions for electronic devices, such as the management of call status (including answering, hanging up, etc.).
[0192] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0193] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0194] The runtime can refer to all code libraries, frameworks, etc. required for the program to run. For example, for the C language, the runtime includes a series of function libraries required for the C program to run. For the Java language, in addition to the core library, the runtime also includes the virtual machine required for the Java program to run. The above core library may include the function functions that the Java language needs to call.
[0195] The database may include multiple functional modules, such as a surface manager, a media library, a 3D graphics processing library (such as OpenGL ES), a 2D graphics engine (such as SGL), etc.
[0196] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0197] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0198] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0199] A 2D graphics engine is a drawing engine for 2D drawings.
[0200] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0201] Figure 1D The electronic device 300 shown is only one implementation method of the embodiment of the present application. In actual applications, the software architecture of the electronic device 300 may also include more or fewer modules, or some modules may be combined, and the levels of each module may also vary, which is not limited here.
[0202] The following is an example of the workflow of the electronic device software and hardware in conjunction with capturing a photo scene.
[0203] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a touch single-click operation and the control corresponding to the single-click operation is the control of the camera application icon, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer to capture static images or videos through the camera 193.
[0204] The following introduces an exemplary user interface implemented on the electronic device 300 provided by the present application.
[0205] Figure 2A-2B A set of interfaces involved in managing location permissions for the electronic device 300.
[0206] refer to Figure 2A The user interface 21 displayed by the electronic device 300 may be provided by an instant messaging application, and the user interface 21 includes a control 201 for sending a location. The instant messaging application may be a first application developed by the device 100, and the control 201 may be a security system control.
[0207] like Figure 2A As shown, after receiving the user operation acting on the control 201, the electronic device 300 can first grant the current instant messaging application permission to use the positioning function, and then start the wireless communication module 160 for positioning based on the permission.
[0208] Figure 2B The electronic device 300 receives the Figure 2A The user interface 22 is displayed after the user operates on the control 201. The user interface 22 displays: a cancel control 202, a send control 203, a map around the current location of the electronic device 300, the location of the electronic device 300 in the map, and landmarks near the location.
[0209] Among them, the sending control 203 can be used to receive user operations, and the electronic device 300 can respond to the user operation and share the current location of the electronic device 300 or the location selected by the user to the contact "Kate".
[0210] In some embodiments of the present application, the electronic device 300 can revoke the location permission granted to the instant messaging application after detecting the user operation on the cancel control 202 or the send control 203. In this way, the location permission is granted to the instant messaging application only when the user has a location requirement, which can prevent the instant messaging application from abusing the location permission and leaking the user's location.
[0211] Figure 2C-2E A set of interfaces involved in managing clipboard permissions for the electronic device 300.
[0212] refer to Figure 2C The user interface 23 displayed by the electronic device 300 may be provided by an instant messaging application, and the user interface 23 includes a text input box 204. The instant messaging application may be a first application developed by the device 100.
[0213] like Figure 2C As shown, after receiving a click operation or a long press operation on the text input box 204, the electronic device may display the following Figure 2D Paste control 205 is shown. Paste control 205 can be a security system control. After receiving the user operation acting on paste control 205, electronic device 300 can first grant the current instant messaging application permission to use the clipboard, then obtain the content in the current clipboard based on the permission, and fill the content into text input box 204.
[0214] like Figure 2E The user interface 23 is exemplarily shown after the electronic device 300 fills the content in the clipboard into the text input box 204 .
[0215] In some embodiments of the present application, the electronic device 300 can reclaim the clipboard permission granted to the instant messaging application after filling the content in the clipboard into the text input box 204. In this way, the clipboard permission is granted to the instant messaging application only when the user has a pasting requirement, which can prevent the instant messaging application from abusing the clipboard permission and leaking the content in the clipboard.
[0216] Above Figure 2A-2B , Figure 2C-Figure 2E The UI implementation example shown is only an example and does not constitute a limitation on the permission management method provided in this application.
[0217] Through the above UIs, it can be seen that when the electronic device 300 enables the above functions, the electronic device 300 does not need to obtain the user's explicit authorization through a pop-up window. When the user needs to use the above functions, the electronic device 300 can automatically authorize, giving the user an imperceptible and excellent usage experience.
[0218] Not limited to the above Figure 2A-2B , Figure 2C-2E The location permission and clipboard permission in the UI embodiment shown, other permissions can also be granted or revoked through the permission management method provided in the embodiment of this application, and the details can be referred to the detailed description of the subsequent method embodiment. Other permissions may include, but are not limited to, photo permission, audio permission, video permission, speaker permission, etc.
[0219] based on Figure 1A The communication system shown, Figure 1B The device 100 shown, Figure 1C-Figure 1D The electronic device 300 shown, and the user interface provided above, and the permission management method provided in the embodiment of the present application are described in detail below.
[0220] refer to Figure 3 , Figure 3 The flowchart of the method for implementing the rights management by the electronic device 300 in the embodiment of the present application is exemplified.
[0221] like Figure 3 As shown, the method may include the following steps:
[0222] S101, the electronic device 300 installs a first application.
[0223] The first application is the application developed through the calling interface of the system control introduced above.
[0224] The electronic device 300 is a user-side device. The electronic device 300 can find the information of the first application through the application corresponding to the platform 200 (such as the application store), web pages and other channels, and then download the application installation package of the first application from the platform 200. Not limited to the platform 200, in some other embodiments of the present application, the device 100 can send the application installation package to other network locations, and the electronic device 300 can also download the application installation package from other network locations.
[0225] After obtaining the application installation package, the electronic device 300 can run the application installation package, release all files of the application installation package to the corresponding storage area, parse the information carried in the application installation package, and complete the modification of the registry, modification of system settings, creation of shortcuts, etc., so as to install the first application. Among them, the information carried by the application installation package may include any one or more of the following: the number and category of declared system controls (such as security system controls and non-security system controls), the user interface where each system control is located, the permissions and services corresponding to each system control, the user operations bound to the security system controls, the coordinates, color, shape, and text on each security system control in the user interface, etc.
[0226] After the electronic device 300 installs the first application, the application icon of the first application can be displayed on the main interface or other pages of the desktop.
[0227] S102, the electronic device 300 runs a first application.
[0228] The electronic device 300 may run the first application in response to the received user operation. For example, the electronic device 300 may receive a user operation (such as a click operation, a touch operation, etc.) on the icon of the first application on the desktop, or receive other types of operations, and start the first application in response to the user operation.
[0229] Combine the following Figure 1D The various modules of the electronic device 300 are described in detail to implement S102.
[0230] refer to Figure 4 , Figure 4 A detailed introduction to some steps in the rights management method provided in the embodiment of the present application mainly involves the collaboration of internal modules.
[0231] like Figure 4 As shown, S102 may specifically include the following steps 1-14:
[0232] Trusted Phase:
[0233] Step 1: The process incubator 301 calls the fork() function to start the first process.
[0234] There is a running process in the electronic device 300, which calls the fork() function to generate a child process and generates a process identification number (PID) of the child process. The original process is called the parent process, and the created child process has the same code segment and data as the parent process. Step 1 is equivalent to cloning a process.
[0235] Step 2: the process incubator 301 instructs the security system control generation module 303 to initialize the system control.
[0236] The process of initializing the system controls includes the subsequent steps 3-4.
[0237] Step 3: The security system control generation module 303 registers a callback function with the security system control management module 304 .
[0238] The callback function is used to process the event. The callback function in the embodiment of the present application is used to determine the type of system control (such as security system control, non-security system control), and to identify whether the system control is provided by the first application. The specific role of the callback function can be referred to the detailed introduction of the subsequent steps.
[0239] Registering a callback function means passing the callback function pointer as a parameter so that the security system control management module 304 can use the callback function through the pointer.
[0240] The registration here is a global registration, and a process can only be registered once after being started. Of course, after the electronic device 300 exits the first application or uninstalls the first application or restarts, if the first application is started again, the callback function can also be re-registered.
[0241] Optionally, in step 3, the security system control generation module 303 may also generate a random value, and transmit the random value to the security system control management module 304. The random value may be used to characterize this registration.
[0242] Step 4: The security system control management module 304 associates and stores the pointer of the callback function and the PID of the first process.
[0243] The PID of the first process may be acquired by the security system control management module 304 through interprocess communication (IPC).
[0244] Optionally, in step 4, the security system control management module 304 may also associate and store the random value passed in by the security system control generation module 303 .
[0245] In some other implementations, the security system control management module 304 may also generate a random value and transmit the random value back to the security system control generation module 303 .
[0246] Through steps 3-4, the registration of the callback function is completed. Since only one registration process is supported, the subsequent first process or other processes can be prevented from registering again.
[0247] Step 5: The security system control management module 304 returns a successful registration result to the security system control generation module 303.
[0248] Step 6: The security system control generation module 303 returns a successful registration result to the process incubator.
[0249] At this point, the initialization of the system controls is completed.
[0250] Untrusted stage:
[0251] Step 7: The process incubator 301 runs the code of the first application through the first process and starts the UI framework 302.
[0252] This is equivalent to the process incubator 301 running the code of the first application and loading the UI framework.
[0253] Taking step 7 as the dividing line, the first application is still in the incubation stage in the process of steps 1-6 before step 7, and the first application has not yet been run, so the whole process is controlled by the electronic device system, which belongs to the trusted stage. In step 7 and the process after step 7, the first application has been running, and since the first application itself is untrustworthy, it belongs to the untrustworthy stage. In the untrustworthy stage, the electronic device needs to rely on the information in the trusted stage to do some verification, which can be referred to in the subsequent description for details.
[0254] Step 8: The UI framework 302 instructs the security system control generation module 303 to create a security system control.
[0255] Step 8 may be performed when the electronic device 300 needs to display a user interface including security system controls.
[0256] For example, if the main interface of the first application includes a security system control, the UI framework 302 can directly instruct the creation of the security system control. If the main interface of the first application does not include a security system control, but the sub-interface includes a security system control, the UI framework 302 can instruct the creation of the security system control after receiving an event reported by the bottom layer for clicking to enter the sub-interface. For another example, the UI framework 302 can instruct the creation of all security system controls included in the first application. Among them, whether each user interface in the first application includes a security system control can be learned from the information of the application installation package.
[0257] Step 9: The security system control generation module 303 calls a registration function to transfer the information of the security system control to the security system control management module 304 .
[0258] The information of the security system control may include any one or more of the following: the coordinates of the security system control in the user interface, the type of the security system control. This information can be obtained from the application installation package by the security system control generation module 303. Here, the type of the security system control is related to the business corresponding to the security system control, for example, it can be divided into positioning security system controls, pasting security system controls, taking pictures of security system controls, etc.
[0259] In some implementations, the security system control generation module 303 may generate a control identification (identity, ID) for the registered security system control, and transmit the control ID to the security system control management module 304 in step 9. In other implementations, the security system control management module 304 may generate a control ID for the currently registered security system control after step 9, and transmit the control ID back to the security system control generation module 303.
[0260] In some implementations, the security system control generation module 303 may also transfer the random values involved in the above steps 3-4 to the security system control management module 304 .
[0261] Step 10: The security system control management module 304 determines whether the registration is initiated by the first process.
[0262] There are two ways to judge:
[0263] 1. Determine whether the information cached by the security system control management module 304 contains cache information corresponding to the PID of the process initiating the registration.
[0264] If yes, it is considered that the process currently initiating registration has been registered in the trusted phase. The security system control management module 304 can obtain the PID of the process currently initiating registration from the bottom layer through IPC.
[0265] 2. Determine whether the random value passed in step 9 is the same as the random value in the trusted stage. Since the random value in the trusted stage is ultimately returned only to the first process of the process incubator, it is equivalent to being known only to the first process. Therefore, if the judgment result is yes, it can be considered that the registration is initiated by the first process.
[0266] If the result of step 10 is yes, then in step 9, when the security system control management module 304 receives the information transmitted by the real security system control generation module 303, it can be determined that the current registration is initiated by the trusted first process. Based on the premise that the trusted first process will not register non-security system controls, it can be considered that when the result of step 10 is yes, the currently registered is the security system control.
[0267] However, there is a situation where the first application steals the random value during operation and uses the random value to initiate registration for the non-security system control to the security system control management module 304. Since step 10 cannot identify the registration that is not initiated by the trusted first process, the judgment result is unreliable. The subsequent steps 11-14 can identify this situation to ensure the credibility of the judgment result.
[0268] Step 11, if the judgment result of step 10 is yes, the security system control management module 304 finds the associated stored function pointer according to the PID of the first process, uses the pointer to call the callback function registered in steps 3-4, and returns the information of the currently incoming system control to the system control generation module 303.
[0269] Here, the security system control management module 304 can directly obtain the PID of the first process from the bottom layer through IPC.
[0270] In some implementations, the security system control management module 304 can also find the corresponding random value according to the PID of the first process, and determine whether the random value passed in by the security system control generation module 303 in step 9 is the same as the found random value, and if they are the same, call the callback function. By verifying the random value in this way, it can be further determined that the current registration is initiated by the trusted first process.
[0271] Step 12: the security system control generation module 303 runs the callback function and determines whether the system control is a security system control based on the information of the returned system control.
[0272] The information of the system control indicates a unique system control, and the electronic device 300 can obtain information of all developed system controls from the information obtained by the application installation package, so the system control generation module 303 can use this information to determine the security of the system control. It can be seen that the role of the callback function includes determining the security of the system control.
[0273] Specifically, the UI framework 302 can obtain the information in the application installation package, and when instructing the security system control generation module 303 to create a security system control in step 8, the UI framework 302 passes the information of the security system control to the system control generation module 303, so that the system control generation module 303 can know which system controls are safe.
[0274] Through step 12, even if the first application steals the random value and uses the random value to initiate registration with the security system control management module 304, the system control generation module 303 can still determine whether the currently registered system control is a security system control by running the callback function. In this way, the scenario where the registration is not initiated by the trusted first process is identified, ensuring the credibility of the determination result.
[0275] Step 13: If the judgment result of step 12 is yes, the security system control generation module 303 sends a verification success result to the security system control management module 304.
[0276] Step 14: the security system control management module 304 stores information of the security system control.
[0277] At this point, the registration of the security system controls is completed.
[0278] If the user interface displayed by the first application in the electronic device 300 includes multiple security system controls, or the first application includes multiple security system controls, steps 9-14 can be executed multiple times, and one execution can be used to register one security system control.
[0279] In the embodiment of the present application, the process of registering the security system control shown in steps 9-14 is an optional operation. In some implementations, it is not necessary to perform the registration process. In the registration process, step 10 and steps 11-13 can be performed simultaneously, or only one of them can be performed.
[0280] Through the above registration process, it is equivalent to storing the relevant information of the security system control in the first application at the security system control management module 304.
[0281] In some implementations, during the above registration process, the security system control generation module 303 and / or the security system control management module 304 may also determine whether the security system control is compliant, and the registration can only be successful if it is compliant. The compliance of the system control can refer to the relevant description above.
[0282] Step S103: the electronic device 300 displays a first system control in the user interface of the first application.
[0283] Step 104: the electronic device 300 receives a first operation acting on a first system control.
[0284] The electronic device 300 can interact with the user during the process of running the first application. The user can input various user operations to the electronic device 300 to use various functions provided by the first application.
[0285] The first operation may be of various types and forms, such as a click operation, a long press operation, an air gesture, a voice command, etc., which are not limited here.
[0286] refer to Figure 4 , step 104 may include the following steps 15-16:
[0287] Step 15: The UI framework 302 receives the reported event of the first operation.
[0288] Step 16: The UI framework 302 distributes the event of the first operation to the security system control generation module 303.
[0289] Step S105 , the electronic device 300 determines whether the first system control is a security system control.
[0290] Since there are essential differences between safety system controls and non-safety system controls, please refer to the above description for details, so the electronic device 300 can determine whether the first system control is a safety system control.
[0291] refer to Figure 4 , S105 may include the following steps 17-21:
[0292] Step 17: The security system control generation module 303 applies to the security system control management module 304 for the permission corresponding to the first system control, and transmits the information of the first system control to the security system control management module 304.
[0293] The information of the first system control may include one or more of the coordinates of the first system control in the user interface, the type of control, and the control ID. The control type here is related to the business corresponding to the first system control, for example, it may include positioning security system controls, pasting security system controls, taking photos of security system controls, etc.
[0294] In some implementations, the security system control generation module 303 may also transfer the random values involved in the above steps 3-4 to the security system control management module 304 .
[0295] Optionally, after step 17 and before step 18, after receiving the event of the first operation, the security system control generation module 303 may first determine whether the first operation is a user operation bound to the first system control, and if so, execute subsequent steps. This ensures that the user triggers the relevant permission granting and business execution through the operation defined by the developer when developing the application.
[0296] Step 18: The security system control management module 304 determines whether the permission application is initiated by the first process.
[0297] There are two ways to judge:
[0298] 1. Determine whether the information cached by the security system control management module 304 contains cache information corresponding to the PID of the process that initiated the permission application.
[0299] If yes, it is considered that the process currently initiating the permission application has been registered in the trusted phase. The security system control management module 304 can obtain the PID of the process currently initiating the permission application from the bottom layer through IPC.
[0300] 2. Determine whether the random value passed in step 17 is the same as the random value in the trusted stage. Since the random value in the trusted stage is ultimately returned only to the first process of the process incubator, it is equivalent to being known only to the first process. Therefore, if the judgment result is yes, it can be considered that the permission application is initiated by the first process.
[0301] If the result of step 18 is yes, then in step 17, when the security system control management module 304 receives the information transmitted by the real security system control generation module 303, it can be determined that the permission application is currently initiated by the trusted first process. Based on the premise that the trusted first process will not apply for permissions for non-security system controls, it can be considered that when the result of step 18 is yes, the current permission application is for the security system control.
[0302] However, there is a situation where the first application steals the random value during operation and uses the random value to initiate a permission application for the non-security system control to the security system control management module 304. Since step 18 cannot identify the permission application that is not initiated by the trusted first process, the judgment result is unreliable. Subsequent steps 19-21 can identify this situation to ensure the credibility of the judgment result.
[0303] Step 19, if the judgment result of step 18 is yes, the security system control management module 304 finds the associated stored function pointer according to the PID of the first process, uses the pointer to call the callback function registered in steps 3-4, and returns the information of the currently incoming first system control to the system control generation module 303.
[0304] Here, the security system control management module 304 can directly obtain the PID of the first process from the bottom layer through IPC.
[0305] In some implementations, the security system control management module 304 can also find the corresponding random value according to the PID of the first process, and determine whether the random value passed in by the security system control generation module 303 in step 17 is the same as the found random value, and if they are the same, call the callback function. By verifying the random value in this way, it can be further determined that the current permission application is initiated by the trusted first process.
[0306] Step 20: the security system control generation module 303 runs the callback function and determines whether the first system control is a security system control based on the information of the first system control returned.
[0307] The information of the first system control indicates the first system control, and the electronic device 300 can obtain information of all developed system controls from the information obtained in the application installation package, so the system control generation module 303 can use this information to determine the security of the first system control.
[0308] Specifically, the UI framework 302 can obtain the information in the application installation package, and when instructing the security system control generation module 303 to create a security system control in step 8, the UI framework 302 passes the information of the security system control to the system control generation module 303, so that the system control generation module 303 can know which system controls are safe.
[0309] Through step 20, even if the first application steals the random value of the first process and uses the random value of the first process to initiate a permission application to the security system control management module 304, the system control generation module 303 can still determine whether the first system control currently applying for permission is a security system control by running the callback function. In this way, the scenario where the permission application is not initiated by the trusted first process is identified, ensuring the credibility of the determination result.
[0310] In an optional implementation, in step 20, the security system control generation module 303 can also determine whether the first system control actually receives the user operation based on the information of the first system control transmitted back, for example, it can ask the event-driven module whether there is an event of operation acting on the first system control within a certain period of time. Since the security system control generation module 303 receives the event distributed by the UI framework 302, it can know which system controls have received the user operation, and can also determine whether the first system control has received the user operation. In this way, it can be avoided that the first application steals the random value of the first process when no user operation is actually received, and uses the random value of the first process to initiate a permission application to the security system control management module 304.
[0311] Step 21 , if the judgment result of step 20 is yes, the security system control generation module 303 sends a verification success result to the security system control management module 304 .
[0312] At this point, the verification of the first system control is completed, and it can be determined that the first system control is a safety system control.
[0313] If the registration process of the above steps 9-14 is executed, the security system control management module 304 in step 18 can also determine whether the first system control is a registered system control. If so, the subsequent steps are executed, and if not, the process is terminated.
[0314] In the verification process for the first system control shown in steps 17-21, step 18 and steps 19-21 can be executed simultaneously, or only one of them can be executed.
[0315] In some implementations, during the above verification process, the security system control generation module 303 and / or the security system control management module 304 may also determine whether the security system control is compliant, and verification is successful only if it is compliant. The compliance of the system control can refer to the above description.
[0316] Step S106: If the judgment result of S105 is yes, the electronic device 300 grants the first permission corresponding to the first system control to the first application.
[0317] Specifically, the electronic device 300 may grant the corresponding permission to the first application through the calling interface of the first system control.
[0318] The electronic device 300 can learn the first permission corresponding to the first system control from the application installation package. For example, if the first system control is a positioning control, the first control includes the positioning permission; if the first system control is a paste control, the first control includes the permission to use the clipboard; if the first system control is a photo taking control, the first control includes the permission to use the camera, and so on.
[0319] refer to Figure 4 S106 may specifically include the following steps 22-23:
[0320] Step 22 , the security system control management module 304 applies to the permission management module 305 for the first permission.
[0321] Step 23: the permission management module 305 grants the first permission to the first process.
[0322] Step S107 : the electronic device 300 executes the first service through the first application based on the first permission.
[0323] After granting the first permission to the first application, the electronic device 300 can execute the first service through the first application. The first service is the service corresponding to the first system control. The electronic device 300 can learn the first service corresponding to the first system control from the application installation package.
[0324] For example, reference Figure 2A-2B After the electronic device 300 receives the user operation acting on the control 201 and grants the location permission to the instant messaging application, the location function can be started for positioning.
[0325] For example, reference Figure 2C-2E After receiving the user operation on the paste control 205, the electronic device 300 grants the instant messaging application the permission to use the clipboard, and can access the clipboard and fill the content in the clipboard into the text box.
[0326] In some embodiments of the present application, the electronic device 300 may run the first application in the foreground or in the background when using the first permission to perform the first service. For example, in some scenarios, when the electronic device 300 uses the microphone permission to record, even if the electronic device 300 has switched the first application to the background, the first application may continue to hold the microphone permission and record according to the permission until the user inputs an operation to stop recording.
[0327] Optional step S108: after executing the first service, the electronic device 300 revokes the first permission granted to the first application.
[0328] The electronic device 300 may terminate the execution of the first service in any of the following situations:
[0329] 1. The electronic device 300 has obtained the desired service data. For example, refer to Figure 2B After the electronic device 300 is successfully located, or after receiving an operation acting on the sending control 203, the location permission can be revoked.
[0330] 2. The electronic device 300 receives an operation from a user indicating that the first service should be terminated, and terminates the execution of the first service in response to the user operation. Figure 2B After receiving the user operation on the cancel control 202, the electronic device 300 may turn off the positioning function. Figure 2E After the electronic device 300 fills the content of the clipboard into the text input box, the permission to use the clipboard can be revoked.
[0331] In some implementations, if the first permission includes permissions to use multiple different resources, the electronic device 300 can reclaim the permissions to use the multiple different resources in steps, and after the first service is executed, the permissions to use the multiple different resources are all reclaimed. This way of reclaiming the multiple permissions included in the first permission in steps makes the permission control of the first application more detailed, and can more strictly control permissions, thereby ensuring the privacy of users and devices.
[0332] It can be seen that the electronic device 300 can continue to hold the first authority in the device executing the first service.
[0333] Through step S108, the resources in the electronic device 300 can be more strictly controlled to prevent applications from privately obtaining the user's private data.
[0334] pass Figure 3 The permission management method shown enables electronic devices to distinguish between secure system controls and non-secure system controls, and perform different permission management for the two types of system controls, thereby limiting the conditions under which applications can obtain and use permissions, avoiding granting applications excessive freedom to use permissions, thereby protecting user privacy, enhancing the security of electronic devices on the user side, and improving user experience.
[0335] It should be understood that each step in the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.
[0336] The present application also provides an electronic device, which may include: a memory and a processor. The memory may be used to store a computer program; the processor may be used to call the computer program in the memory, so that the electronic device executes the method executed by the developer-side device 100 or the user-side electronic device 300 in any of the above embodiments.
[0337] The present application also provides an electronic device, which may include: a memory and a processor. The memory may be used to store a computer program; the processor may be used to call the computer program in the memory, so that the electronic device executes the method executed by the developer-side device 100 or the user-side electronic device 300 in any of the above embodiments.
[0338] The present application also provides a chip system, which includes at least one processor for implementing the functions involved in the developer-side device 100 or the user-side electronic device 300 in any of the above embodiments.
[0339] In one possible design, the chip system also includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.
[0340] The chip system may be composed of the chip, or may include the chip and other discrete devices.
[0341] Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.
[0342] Optionally, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.
[0343] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.
[0344] The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which, when executed, enables a computer to execute the method executed by the developer-side device 100 or the user-side electronic device 300 in any of the above-mentioned embodiments.
[0345] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the method executed by the developer-side device 100 or the user-side electronic device 300 in any of the above embodiments.
[0346] The various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.
[0347] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.
[0348] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0349] In short, the above is only an embodiment of the technical solution of this application, and is not intended to limit the protection scope of this application. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of this application shall be included in the protection scope of this application.
Claims
1. A rights management method, applied to an electronic device, characterized in that: The method comprises: In response to a first trigger event, running a first application and displaying a first system control; receiving a user operation acting on the first system control; Determining whether the first system control is a safe system control, wherein the safe system control refers to a system control that triggers the granting of a corresponding permission when the electronic device receives the user operation, and the system control integrates a calling interface for a method of obtaining the corresponding permission in the electronic device; When the first system control is a secure system control, a first permission is granted to the first application, and a first service is executed based on the first permission.
2. The method according to claim 1, characterized in that Before the electronic device displays the first system control, the method further includes: the electronic device registering a callback function for the first application; The electronic device determines whether the first system control is a safe system control, specifically including: the electronic device calls the callback function to determine whether the first system control is a safe system control.
3. The method according to claim 2, characterized in that The electronic device registers the callback function for the first application during a trusted phase of running the first application.
4. The method according to claim 2 or 3, characterized in that: After the electronic device receives a user operation acting on the first system control, the method further includes: The electronic device obtains information about the first system control, and the information about the first system control is used by the electronic device to determine whether the first system control is a safe system control.
5. The method according to claim 4, characterized in that The information of the first system control includes any one or more of the following: an identifier of the first system control, coordinates in the user interface, a type of control or a business type corresponding to the control.
6. The method according to claim 2 or 3, characterized in that: Before the electronic device calls the callback function to determine whether the first system control is a safe system control, the method further includes: The electronic device determines that the first application has registered the callback function.
7. The method according to any one of claims 1 to 3, characterized in that: Before the electronic device receives a user operation acting on the first system control, the method further includes: the electronic device registering one or more secure system controls provided by the first application; Before the electronic device determines whether the first system control is a safe system control, the method further includes: the electronic device determining that the first system control has been registered.
8. The method according to any one of claims 1 to 3, characterized in that: Before the electronic device runs the first application, the method further includes: The electronic device installs the first application according to the application installation package, and during the process of installing the first application, obtains information about one or more secure system controls provided by the first application from the application installation package.
9. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: After the electronic device completes the first service, the first permission granted to the first application is revoked.
10. An electronic device, characterized in that: include: A memory and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method as described in any one of claims 1-9.
11. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device executes the method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Electronic equipment authority verification method, device and system and readable medium
CN111159693A
Permission management method and terminal device
WO2022022422A1