WO2022022422A1 - 一种权限管理方法及终端设备 - Google Patents

一种权限管理方法及终端设备 Download PDF

Info

Publication number
WO2022022422A1
WO2022022422A1 PCT/CN2021/108199 CN2021108199W WO2022022422A1 WO 2022022422 A1 WO2022022422 A1 WO 2022022422A1 CN 2021108199 W CN2021108199 W CN 2021108199W WO 2022022422 A1 WO2022022422 A1 WO 2022022422A1
Authority
WO
WIPO (PCT)
Prior art keywords
permission
application
special
permissions
app
Prior art date
Application number
PCT/CN2021/108199
Other languages
English (en)
French (fr)
Inventor
唐发明
沈晨凯
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to US18/007,425 priority Critical patent/US20230297700A1/en
Priority to EP21849627.1A priority patent/EP4181003A4/en
Publication of WO2022022422A1 publication Critical patent/WO2022022422A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/121Restricting unauthorised execution of programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/33User authentication using certificates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/51Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems at application loading time, e.g. accepting, rejecting, starting or inhibiting executable software based on integrity or source reliability
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/53Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by executing in a restricted environment, e.g. sandbox or secure virtual machine
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/604Tools and structures for managing or administering access control systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/629Protecting access to data via a platform, e.g. using keys or access control rules to features or functions of an application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Definitions

  • the embodiments of the present application relate to the field of terminal technologies, and in particular, to a rights management method and a terminal device.
  • an application can implement more and more functions, and some functions can only be implemented by the APP having corresponding permissions.
  • the positioning function can only be implemented by the APP having the location permission.
  • an APP wants to have a certain permission of the terminal device to realize the corresponding function
  • the developer of the APP can declare the permission in the permission configuration file of the APP, so that the APP can run based on the permission configuration file.
  • the permission declared in the APP applies to the terminal device or user for permission.
  • the terminal device or user authorizes the APP, the APP will have the permission, so that the APP can call the application programming interface controlled by the permission. , API) to implement the corresponding functions.
  • the permission management mechanism if a permission is required by at least one APP, the permission will be opened to all APPs by the permission service agency, that is, the permission service agency allows any APP to apply for the permission at runtime, which will result in the permission Excessive application by APP, or even malicious use by some APPs, resulting in low security of the terminal system and high risk of leakage of user's private data.
  • the embodiments of the present application provide a rights management method and a terminal device, which can reduce the possibility of special rights being abused by applications, improve the security of the terminal system, and reduce the risk of leakage of users' private data.
  • an embodiment of the present application provides a rights management method, which may include:
  • the one or more permissions include a special permission
  • the installation package of the application does not contain a privilege certificate, set the special permission to an unavailable state, and continue to install the application; the privilege certificate Used to record special permissions that the application is allowed to request at runtime.
  • one or more permissions that the application needs to apply for when running can be recorded in the permission configuration file of the application, and the permission configuration file can be included in the installation package of the application.
  • the above-mentioned special permissions may be permissions related to the system security of the terminal device and/or the user's private data. Special permissions are not allowed to be applied by any application at runtime by default. Only when the permission service organization grants the application the right to apply for a special permission, the special permission is allowed to be applied by the application at runtime.
  • a rights service authority can record the special rights that an application is allowed to request at runtime in the privilege certificate issued for the application.
  • the application program cannot apply for the special permission that is set to be unavailable at runtime, the application program cannot obtain the data controlled by the above-mentioned special permission when it is running, which can improve the security of the terminal system and reduce the user's Risk of private data being leaked.
  • the method further includes:
  • the one or more rights include special rights
  • the installation package of the application includes the privilege certificate, and the privilege certificate is an invalid privilege certificate
  • the one or more rights include all the rights.
  • the special permission is set to unavailable state, and the installation of the application continues.
  • an invalid privilege certificate indicates that the privilege certificate is not issued by a privilege service organization and/or the installation time of the application is not within the validity period of the privilege certificate (that is, the privilege certificate has expired when the application is installed).
  • the installation package of the application program contains a privilege certificate, but the privilege certificate is invalid, it means that the application program has not been granted the right to apply for any special permission by the authorization service organization, or that the application program is serviced by the authorization service.
  • the right to apply for special permissions granted by the institution has expired. Therefore, by setting the special permissions that the application needs to apply for at runtime to an unavailable state, the application cannot perform special permissions that are set to an unavailable state at runtime. application, thereby reducing the possibility of special permissions being abused by the application, improving the security of the terminal system, and reducing the risk of leakage of the user's private data.
  • the method further includes:
  • the installation package of the application includes the privilege certificate, and the privilege certificate is a valid privilege certificate, and the one or more rights include the If at least one of the special permissions is not included in the privilege certificate, the special permission not included in the privilege certificate is set to an unavailable state, and the application is continued to be installed.
  • the installation package of the application program contains a privilege certificate and the privilege certificate is valid, it means that the application program has been granted the right to apply for some special rights by the rights service organization.
  • the special permissions that the application needs to apply for at runtime and the special permissions included in the privilege certificate are the special permissions that the application is allowed to apply for at runtime, and are not included in the special permissions that the application needs to apply for at runtime.
  • the special permissions in the privilege certificate are special permissions that the application is not allowed to apply at runtime.
  • the method further includes:
  • the installation package of the application includes the privilege certificate, and the privilege certificate is a valid privilege certificate, and the one or more rights include the If the special permissions are included in the privilege certificate, the installation of the application is continued.
  • the method further includes:
  • the method further includes:
  • the first permission applied for by the application program is a permission that is not set to an unavailable state among the one or more permissions, and the type of the first permission is Terminal Required If the device is authorized by the device, the first permission is granted to the application.
  • the method further includes:
  • the authorization request for the first permission is used to confirm whether the user is allowed to grant the first permission to the application; exemplarily, a prompt can be displayed on the display interface of the application box, in which the authorization request for the first permission is displayed;
  • the first permission is granted to the application.
  • the method further includes:
  • the first permission is not granted to the application program.
  • the application since the application is only allowed to apply for special permissions that are not set to the unavailable state in its rights configuration file at runtime, the application is not allowed to apply for the special permission that is set to the unavailable state in its rights configuration file at runtime. Therefore, when the mobile phone runs an application, it will only display a prompt box for the permission that is not set to be unavailable in the permission configuration file of the application, and the type is the permission that requires user authorization.
  • the rights management method of the present invention can reduce the influence of the display operation of the prompt box on the running process of the application program for all types of rights in the rights configuration file of the application program that require user authorization to display a prompt box.
  • the method further includes:
  • the data controlled by the first authority is returned to the application program.
  • the application program can obtain the service controlled and controlled by the first authority.
  • the method further includes:
  • the method further includes:
  • preset data is returned to the application program; the preset data includes empty data or fake data, and the fake data is Data different from the data governed by the first special authority.
  • the first special permission applied for by such an application at runtime is included in the above list of unavailable permissions, it means that the first special permission is a special permission that is not allowed to be applied for by the application at runtime, but in order to avoid
  • the first special permission can be granted to the application first, but when the application calls the application programming interface controlled by the first special permission, by returning empty data or false data to the application, the The application cannot obtain the real data controlled by the first special permission, which not only enables the application to run normally, but also improves the security of the terminal system and reduces the risk of leakage of the user's private data.
  • the method further includes:
  • the first prompt information is displayed on the display interface of the application program; the first prompt information is used to prompt the user that the data related to the first special permission acquired by the application program is inaccurate.
  • the method further includes:
  • first special permission is a permission involving the user's private data
  • second prompt information is displayed on the display interface of the application; the second prompt information is used to confirm whether the user is allowed to return the requested information to the application.
  • the data controlled by the first special authority is a permission involving the user's private data
  • the user since the user can decide whether to allow the data controlled by the first special permission to be returned to the application, it can not only reduce the risk of leakage of the user's private data, but also improve the user's experience of using the application. And because the user can be prompted whether to allow the data controlled by the first special authority to be returned to the application program when the application program calls the application programming interface controlled by the first special authority, it is convenient for the user to perform real-time changes to the first special authority. manage.
  • the method further includes:
  • the first special permission is set to an available state, and the first special permission is changed from the unavailable state. Removed from the permission list.
  • the method further includes:
  • the data controlled by the first special authority is returned to the application program.
  • the first special authority when the user allows to return the data controlled by the first special authority to the application, when the application calls the application programming interface controlled by the first special authority, the first special authority can be returned to the application.
  • the controlled data enables the application to obtain the system services controlled by the first special authority, which enriches the functions of the application.
  • the method further includes:
  • the permission setting interface displays the permissions that are not set to the unavailable state among the one or more permissions and the special permissions included in the unavailable permission list of the application permission, the usage status of the permission that is not set to the unavailable state is the available state, and the usage status of the special permission included in the unavailable permission list of the application is the unavailable state; and the usage status of the permission that is not set
  • the setting state of the permission of the unavailable state is the first state
  • the setting state of the special permission involving the user's private data included in the unavailable permission list of the application program is the first state
  • the unavailable permission list of the application program is the first state.
  • the setting state of the special permission that does not involve the user's private data contained in the permission list is the second state; the first state is used to indicate that the use state of the permission can be set by the user, and the second state is used to indicate that the permission is used.
  • the usage status cannot be set by the user.
  • the user can set the usage status of one or more permissions of the application program according to his own needs, thereby improving the user's experience of using the application program.
  • the method when the application is installed in a test environment, after acquiring one or more permissions that the application needs to apply for when running, the method further includes :
  • the installation package of the application does not contain a privilege certificate, the installation of the application is stopped.
  • the method when the application is installed in a test environment, after acquiring one or more permissions that the application needs to apply for when running, the method further includes :
  • the installation package of the application includes the privilege certificate, and the privilege certificate is an invalid privilege certificate, the installation of the application is stopped.
  • the method when the application is installed in a test environment, after acquiring one or more permissions that the application needs to apply for when running, the method further includes :
  • the installation package of the application includes the privilege certificate, and the privilege certificate is a valid privilege certificate, and the one or more rights include the If at least one of the special rights is not included in the privilege certificate, the installation of the application is stopped.
  • the method further includes:
  • the user when the application is installed in the test environment, in the above three cases, the user can be prompted to apply to the authority service agency for the application for special authority by stopping the installation of the application and/or outputting the third prompt message.
  • the right to apply so as to facilitate developers to repair the loopholes existing in the application.
  • an embodiment of the present application provides a terminal device, including:
  • a first acquiring unit configured to acquire one or more permissions that the application needs to apply for when running when it is detected that the application is installed;
  • an installation control unit configured to set the special permission to an unavailable state if the one or more permissions include a special permission and the installation package of the application does not contain a privilege certificate, and continue to install the application Program; the privilege certificate is used to record the special permissions that the application program is allowed to apply for at runtime.
  • the installation control unit is further configured to: if the one or more permissions include special permissions, and the installation package of the application program includes the privilege certificate, and If the privilege certificate is an invalid privilege certificate, set the special permission included in the one or more permissions to an unavailable state, and continue to install the application.
  • the installation control unit is further configured to: if the one or more permissions include special permissions, and the installation package of the application program includes the privilege certificate, and the privilege certificate is a valid privilege certificate, and at least one of the special rights included in the one or more rights is not included in the privilege certificate, it will not be included in the privilege certificate set the special permission to unavailable, and proceed to install the application.
  • the installation control unit is further configured to: if the one or more permissions include special permissions, and the installation package of the application program includes the privilege certificate, And the privilege certificate is a valid privilege certificate, and the special rights included in the one or more rights are all included in the privilege certificate, then continue to install the application.
  • the installation control unit is further configured to: if the one or more permissions do not include a special permission, continue to install the application.
  • the terminal device further includes:
  • the authorization control unit is configured to, when running the application program, if it is detected that the first permission applied for by the application program is a permission that is not set to an unavailable state among the one or more permissions, and the first permission If the type of permission is a permission that requires authorization from the terminal device, the first permission is granted to the application.
  • the terminal device further includes:
  • the display unit is used for, when running the application program, if it is detected that the first permission applied by the application program is a permission that is not set to an unavailable state among the one or more permissions, and the first permission
  • the type is the permission that requires user authorization, then the authorization request for the first permission is displayed; the authorization request is used to confirm whether the user is allowed to grant the first permission to the application;
  • the authorization control unit is further configured to: grant the first permission to the application if it is detected that the user indicates an operation to allow the grant of the first permission to the application.
  • the authorization control unit is further configured to: not grant the application program if an operation indicating that the user is not allowed to grant the first permission is detected. the first authority.
  • the terminal device further includes:
  • the data processing unit is configured to return the data controlled by the first authority to the application program if it is detected that the application program calls the application programming interface controlled by the first authority.
  • the terminal device further includes:
  • a list creation unit used for establishing an unavailable permission list in the installation package of the application
  • a list modification unit configured to record the special rights set to the unavailable state among the special rights included in the one or more rights in the unavailable rights list.
  • the authorization control unit is further configured to: when running the application, if it is detected that the first special permission applied for by the application is included in the unavailable in the permission list, grant the first special permission to the application;
  • the data processing unit is further configured to: when it is detected that the application program invokes the application programming interface controlled by the first special authority, return preset data to the application program; the preset data includes null data Or fake data, where the fake data is data different from the data controlled by the first special authority.
  • the display unit is further configured to: display first prompt information on a display interface of the application program; the first prompt information is used to prompt the user of the application program The acquired data related to the first special permission is inaccurate.
  • the display unit is further configured to: if the first special permission is a permission involving the user's private data, display the second special permission on the display interface of the application program Prompt information; the second prompt information is used to confirm whether the user is allowed to return the data controlled by the first special permission to the application program.
  • the terminal device further includes:
  • an authority management unit configured to set the first special authority to a usable state, and set the first special authority Special permissions are removed from the list of unavailable permissions.
  • the data processing unit is further configured to: if it is detected that the application program calls an application programming interface controlled by the first special authority, return the data controlled by the first special authority to the application program.
  • the display unit is further configured to: display a permission setting interface of the application; the permission setting interface displays that the one or more permissions are not set The permission in the unavailable state and the special permission included in the unavailable permission list of the application, the usage state of the permission not set to the unavailable state is the available state, and the unavailable permission of the application is in the available state.
  • the use status of the special permission included in the permission list is an unavailable state; and the setting state of the permission that is not set to the unavailable state is the first state, and the permissions included in the unavailable permission list of the application are in the first state.
  • the setting state of the special permission involving the user's private data is the first state
  • the setting state of the special permission that does not involve the user's private data included in the unavailable permission list of the application is the second state
  • the first state The use state for indicating the right can be set by the user
  • the second state is for indicating the use state of the right cannot be set by the user.
  • the installation control unit is further configured to: if the one or more permissions include special permissions, and the installation package of the application does not contain a privilege certificate, then Stop installing the application.
  • the installation control unit is further configured to: if the one or more permissions include special permissions, and the installation package of the application program includes the privilege certificate, And the privileged certificate is an invalid privileged certificate, the installation of the application is stopped.
  • the installation control unit is further configured to: if the one or more permissions include special permissions, and the installation package of the application program includes the privilege certificate, And the privilege certificate is a valid privilege certificate, and at least one of the special rights included in the one or more rights is not included in the privilege certificate, then the installation of the application is stopped.
  • the display unit is further configured to: display third prompt information on a display interface of the application program; the third prompt information is used to prompt the installation of the application program reason of failure.
  • embodiments of the present application provide a terminal device, including: at least one processor; at least one memory; wherein, the at least one memory stores computer instructions, and when the computer instructions are processed by the at least one memory When the device is executed, the terminal device is caused to execute the rights management method described in the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium, including computer instructions.
  • the terminal device executes the rights management method described in the first aspect above. .
  • the present application provides a computer program product that, when the computer program product runs on a terminal device, enables the terminal device to execute the rights management method described in any one of the above-mentioned first aspects.
  • the present application provides a chip system, the chip system includes a memory and a processor, and the processor executes a computer program stored in the memory to implement any one of the above-mentioned first aspects. Rights management method.
  • the present application provides another chip system, the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory, so as to implement the above-mentioned first aspect
  • FIG. 1 is a schematic structural diagram of a system involved in a process for an APP to apply for special permissions according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of an interface provided by an embodiment of the present application.
  • Fig. 3 is another interface schematic diagram provided by the embodiment of the present application.
  • Fig. 4 is another interface schematic diagram provided by the embodiment of the present application.
  • FIG. 5 is a schematic diagram of a hardware structure of a terminal device according to an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a software structure of a terminal device according to an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a rights management method provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a group of interfaces provided by an embodiment of the present application.
  • FIG. 9 is another set of interface schematic diagrams provided by an embodiment of the present application.
  • Fig. 10 is another interface schematic diagram provided by an embodiment of the present application.
  • FIG. 11 is another set of interface schematic diagrams provided by an embodiment of the present application.
  • FIG. 12 is another set of interface schematic diagrams provided by an embodiment of the present application.
  • FIG. 13 is another set of interface schematic diagrams provided by an embodiment of the present application.
  • FIG. 14 is another set of interface schematic diagrams provided by an embodiment of the present application.
  • FIG. 15 is another set of interface schematic diagrams provided by an embodiment of the present application.
  • FIG. 16 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
  • a plurality refers to two or more than two; “comprising” indicates the existence of the described features, wholes, steps, operations, elements and/or components, but does not excludes the presence or addition of one or more other features, integers, steps, operations, elements, components and/or sets thereof; “first”, “second”, “third” etc. are only used to distinguish the description, not understood as indicating or implying relative importance.
  • Permission a right used to obtain the system service corresponding to the permission.
  • the permissions in the embodiments of the present application may include: location permissions, address book permissions, short message permissions, phone permissions, call recording permissions, camera permissions, microphone permissions, memory card read/write permissions, notification permissions, and volume adjustment permissions.
  • the APP can obtain the system service corresponding to the permission.
  • the APP can obtain the system service corresponding to the permission by calling the API controlled by the permission.
  • the APP can obtain the location service by calling the API controlled by the location permission.
  • permissions can at least be divided into special permissions and ordinary permissions.
  • the special permission may be related to the system security of the terminal device and/or the user's private data, and/or the permission required by a small number of APPs to expand the user's functions.
  • a small amount can be determined according to actual needs, for example, a small amount can be less than 5; the user function refers to the function that is really required by the user, not the function that the developer of the APP thinks the user needs.
  • Ordinary permissions can be permissions that do not involve system security and user's private data.
  • the special permissions may include, but are not limited to: location permissions, address book permissions, short message permissions, phone permissions, call recording permissions, camera permissions, microphone permissions, and memory card read/write permissions.
  • Common permissions may include but are not limited to: notification permissions and volume adjustment permissions.
  • the special permission is not allowed to be applied by any APP at runtime by default, and the special permission is only allowed when the permission service organization grants an APP the right to apply for a certain special permission. Applied by the APP at runtime.
  • the APP's right to apply for special permissions refers to the APP's right to apply for special permissions at runtime. Normal permissions are allowed to be applied by any APP at runtime.
  • a first permission list and/or a second permission list may be pre-configured for the terminal device.
  • the first permission list is used to store the identifiers of all special permissions
  • the second permission list is used to store the identifiers of all ordinary permissions.
  • the identifier of the permission may be the name of the permission.
  • the terminal device may identify whether a certain permission is a special permission or a common permission based on the first permission list and/or the second permission list. Specifically, if the terminal device detects that the first permission list includes an identifier of a certain permission, it determines that the permission is a special permission; if the terminal device detects that the first permission list does not include an identifier of a certain permission, it determines the permission for ordinary permissions. Or, if the terminal device detects that the identifier of a certain permission is not included in the second permission list, it determines that the permission is a special permission; if the terminal device detects that the identifier of a certain permission is included in the second permission list, it determines that the permission is Ordinary permissions.
  • rights can at least be divided into rights requiring user authorization and rights requiring terminal device authorization.
  • Permissions that require user authorization refer to permissions that require the authorization of the user to be possessed by the APP.
  • Permissions requiring terminal device authorization refer to permissions that require the authorization of the terminal device to be possessed by the APP.
  • the permissions requiring user authorization may be permissions involving the user's private data and/or sensitive operations.
  • permissions requiring user authorization may include, but are not limited to: location permissions, notification permissions, address book permissions, and short message permissions. , phone permission, call record permission, camera permission, microphone permission, memory card read/write permission and notification permission.
  • the authority requiring the authorization of the terminal device may be the authority that does not involve the user's private data and sensitive operations.
  • the authority requiring the authorization of the terminal device may include but not limited to: volume adjustment authority.
  • the terminal device can directly grant the APP the requested permission; if the type of permission applied by the APP at runtime is the permission that requires user authorization, With the consent of the user, the terminal device can grant the APP the permissions it has applied for.
  • a third authority list and/or a fourth authority list may be pre-configured for the terminal device.
  • the third permission list is used to store all the identifiers of the permissions requiring authorization from the terminal device
  • the fourth permission list is used to store the identifiers of all the permissions that require user authorization.
  • the terminal device may identify, based on the third permission list and/or the fourth permission list, whether a certain permission is a permission requiring terminal device authorization or a permission requiring user authorization. Specifically, if the terminal device detects that the third permission list includes an identifier of a certain permission, it determines that the permission is a permission that requires authorization from the terminal device; if the terminal device detects that the third permission list does not include an identifier of a certain permission, Then it is determined that the permission is a permission that requires user authorization.
  • the terminal device detects that the fourth permission list does not include an identifier of a certain permission, it determines that the permission is a permission that requires authorization from the terminal device; if the terminal device detects that the fourth permission list includes an identifier of a certain permission, then Make sure that the permission is a permission that requires user authorization.
  • Authorization service organization An organization that can provide APP with authorization services for the application right for special authorizations.
  • the authority service organization may be a terminal equipment manufacturer (original equipment manufacturer, OEM), an APP ecological alliance, or a system developer, or the like.
  • Privilege certificate an electronic certificate issued by an authority service agency for an APP to record the special authority that the APP is allowed to apply for at runtime.
  • the format of the above-mentioned electronic certificate may be a preset format, and the name of the above-mentioned electronic certificate may carry a privilege certificate identifier.
  • the preset format may be a portable document format (portable document format, PDF), a text (text, TXT) format, or an Extensible Markup Language (Extensible Markup Language, XML) format, or the like.
  • the privileged certificate ID can be the name of the privileged certificate.
  • Permission configuration file a file used to record the permissions that the APP needs to apply for when it is running.
  • the rights configuration file may be a file in TXT format, or a file in XML format, or a file in other formats.
  • the permission configuration file may be the AndroidManifest.xml file.
  • the number of permissions that the APP needs to apply for during running may be one or multiple, and the embodiment of the present application does not specifically limit the number of permissions that the APP needs to apply for during running.
  • the one or more permissions above can be ordinary permissions or special permissions; in terms of the authorization type of permissions, the above one or more permissions can be permissions that require authorization from the terminal device, It can also be a permission that requires user authorization.
  • FIG. 1 is a schematic structural diagram of a system involved in a process of applying for a special permission by an APP according to an embodiment of the present application.
  • the system may include a first terminal 100 , a second terminal 200 and a server 300 .
  • the first terminal 100 may be a terminal device used by any user
  • the second terminal 200 may be a terminal device used by an APP developer to develop an APP
  • the server 300 may be a server of an authority service organization.
  • An application mall APP101 may be installed on the first terminal 100 , and the application mall APP101 may be a service obtained by the first terminal 100 from the server 300 .
  • the application mall APP101 can be used by the developer of the APP to list the installation package of the APP developed by the APP, and can also be used by the first terminal 100 to obtain the installation package of the APP that it needs to install.
  • the first terminal 100, the second terminal 200, and the server 300 may all be mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR)/virtual reality (VR) Devices, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (personal digital assistants, PDAs) and other electronic devices.
  • FIG. 1 is an example of illustrating that the first terminal 100 is a mobile phone, the second terminal 200 is a notebook computer, and the server 300 is a notebook computer.
  • the authorization request needs to include at least the following information: the identity of the APP requesting authorization, the identity of the developer of the APP requesting authorization, the identity of the special permission requested by the APP requesting authorization, and the APP requesting authorization at runtime.
  • the identifier of the APP may be the name of the installation package of the APP; the identifier of the developer of the APP may be the self-signed public key related to the APP owned by the APP developer.
  • the self-signed public key owned by the developer of the APP requesting authorization can be signed by the server 300 in the privilege certificate for the APP.
  • the server 300 in the privilege certificate for the APP.
  • only the developer who has the private key corresponding to the above self-signed public key can The content in the privileged certificate for the APP is obtained, so that the privileged certificate for the APP can be prevented from being used by other developers.
  • the second terminal 200 when detecting an operation instructed by the developer to generate an authorization request, the second terminal 200 may, according to the identifier of the APP requesting authorization input by the developer, the identifier of the developer of the APP requesting authorization, the The identification of the special permission requested by the APP and the necessity and rationality of the APP requesting authorization to apply for the requested special permission at runtime are used to generate an authorization request for the right to apply for the special permission.
  • the second terminal 200 may send the above authorization request to the server 300 when detecting an operation instructed by the developer to send an authorization request.
  • the developer of the first APP can apply for the following three special permissions in the online authorization request template 21 shown in FIG. 2 .
  • the first input box 211, the second input box 212, the third input box 213 and the fourth input box 214 respectively input the name of the installation package of the first APP "app1.apk", the The self-signed public key related to the first APP, the special permissions "location permission, microphone permission and camera permission” requested by the first APP, and the necessity and rationality of the first APP's application for location permission, microphone permission and camera permission.
  • the second terminal 200 detects that the developer clicks the submit control 215 in the online authorization request template 21, it confirms the detection of an operation instructing the developer to generate an authorization request and an operation instructing the developer to send an authorization request.
  • the above content input in the first input box 211 , the second input box 212 , the third input box 213 and the fourth input box 214 generates an authorization request, and sends the authorization request to the server 300 .
  • the online authorization request template 21 may be provided by an authorization service organization.
  • the server 300 may display the identification of the APP requesting authorization included in the authorization request, the identification of the developer of the APP requesting authorization, and the identification of the special permission requested by the APP requesting authorization And a description of the necessity and rationality of the APP requesting authorization to apply for the requested special permission at runtime.
  • the reviewers of the authority service agency can check whether the above-mentioned operation of the APP requesting for authorization to apply for the above-mentioned special authority when actually running is based on the necessity and rationality of the application for the above-mentioned authorization requesting application when it is running. is reasonable and necessary.
  • the reviewer determines that the operation of applying for some special permissions among the above-mentioned special permissions when the APP requesting authorization is actually running is reasonable and necessary, the reviewer can mark these special permissions as The special authority that has passed the audit, and instructs the server 300 to generate a privilege certificate for recording the above-mentioned special authority that has passed the audit.
  • the special permission that has passed the review is the special permission that the APP requesting authorization is allowed to apply for at runtime.
  • the privilege certificate may include at least the following information: the identifier of the APP that is allowed to apply for special permission, the identity of the developer of the APP that is allowed to apply for special permission, and the identifier of the special permission that is allowed to be applied for by the APP.
  • the identification of the APP that is allowed to apply for special permissions is the same as the identification of the APP that requests authorization included in the authorization request for the APP; the identification of the developer of the APP that is allowed to apply for special permissions is the same as that in the authorization request for the APP.
  • the identity of the developer of the APP that includes the authorization request is the same; the special permission that is allowed to be applied for by the APP is the special permission that has been reviewed and approved in the special permission requested by the APP.
  • the server 300 detects an operation instructed by the auditor to generate a privilege certificate, according to the identifiers of the APPs that are allowed to apply for special rights, the identifiers of the developers of the APPs that are allowed to apply for special rights, and the identifiers that are allowed to be The identifier of the special permission applied for by the APP, and the privilege certificate is generated.
  • the reviewer can enter the first input box in the privilege certificate template 31 as shown in FIG. 3 . 311.
  • the second input box 312 and the third input box 313 enter the name of the installation package of the first APP "app1.apk", the self-signed public key related to the first APP, and the special permission that is allowed to be applied for by the first APP, respectively.
  • the identifier "Location Permissions”.
  • the privilege certificate may further include the validity period of the privilege certificate.
  • the validity period of the privilege certificate may be the effective expiration date of the privilege certificate, which may be determined by the auditor according to the actual situation. Exemplarily, if the validity period of the privilege certificate is July 13, 2020, it can be considered that the effective expiration date of the privilege certificate is July 13, 2020, that is, the privilege certificate expires on July 14, 2020.
  • the server 300 detects an operation instructed by the auditor to generate a privilege certificate, according to the identifier of the APP that is allowed to apply for special permissions, the identity of the developer of the APP that is allowed to apply for special permissions, and the ID of the developer of the APP that is allowed to apply for the special permission input by the auditor.
  • the identifier of the special authority applied for by the APP and the validity period of the privilege certificate, and the privilege certificate is generated.
  • the reviewer can enter the first input box 311 and the second input in the privilege certificate template 31 as shown in FIG. 3 .
  • the third input box 313 and the fourth input box 314 respectively input the name of the installation package of the first APP "app1.apk", the self-signed public key related to the first APP, and the special permission to be applied by the first APP.
  • the identity of the authority is "Location Authority” and the validity period of the privilege certificate is "July 13, 2020".
  • the server 300 detects that the auditor clicks on the save control 315 in the privilege certificate template 31, it determines that the operation instructing the auditor to generate the privilege certificate is detected.
  • 313 and the input content in the fourth input box 314 generate a privilege certificate for the first APP.
  • the privilege certificate does not include the validity period of the privilege certificate, it can be considered that the privilege certificate is permanently effective; when the privilege certificate includes the validity period of the privilege certificate, it can be considered that the privilege certificate is only within the validity period of the privilege certificate effective.
  • the server 300 may use the private key of the privileged service organization to perform a digital signature on the privileged certificate when detecting the operation of the auditor instructing the privileged certificate to be digitally signed. Digitally sign.
  • the server 300 sends the digitally signed privilege certificate to the second terminal 200 when the server 300 detects an operation instructed by the auditor to send the privilege certificate.
  • the server 300 detects that the auditor clicks on the encryption control 316 in the privileged certificate template 31 as shown in FIG. 3, it confirms that the operation of digitally signing the privileged certificate instructed by the auditor is detected, and the server 300 adopts a privilege service organization. the private key to digitally sign the privileged certificate.
  • the server 300 detects that the auditor clicks on the sending control 411 in the mail sending interface as shown in FIG. 4 , it determines that the operation of the auditor instructing the sending of the privilege certificate is detected, and the server 300 sends the first APP developer's mailbox 412 to the first APP developer's mailbox 412.
  • the second terminal sends an email whose attachment is the privilege certificate 413 for the first APP.
  • the mailbox of the APP developer may be provided to the server 300 when the second terminal sends the authorization request.
  • the developer of the APP can configure the privileged certificate in the installation package of the APP that requests authorization, and then put the installation package on the APP of the application mall for users to use. download.
  • the embodiments of the present application provide a method for rights management, which may be applied to the first terminal 100 in FIG. 1 .
  • the embodiments of the present application describe the rights management method in detail by taking the first terminal 100 as a mobile phone as an example.
  • FIG. 5 is a schematic diagram of a hardware structure of a mobile phone according to an embodiment of the present application.
  • the mobile phone 500 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, Antenna 1, Antenna 2, Mobile Communication Module 150, Wireless Communication Module 160, Audio Module 170, Speaker 170A, Receiver 170B, Microphone 170C, Headphone Interface 170D, Sensor Module 180, Key 190, Motor 191, Indicator 192, Camera 193, Display screen 194, and subscriber identification module (subscriber identification module, SIM) card interface 195 and so on.
  • SIM subscriber identification module
  • 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, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the mobile phone 500 .
  • the mobile phone 500 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processor
  • ISP image signal processor
  • controller video codec
  • digital signal processor digital signal processor
  • baseband processor baseband processor
  • neural-network processing unit neural-network processing unit
  • the controller may be the nerve center and command center of the mobile phone 500 .
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may contain multiple sets of I2C buses.
  • the processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flash, the camera 193 and the like through different I2C bus interfaces.
  • the processor 110 can couple the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate with each other through the I2C bus interface, so as to realize the touch function of the mobile phone 500 .
  • the I2S interface can be used for audio communication.
  • the processor 110 may contain multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170 .
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communications, sampling, quantizing and encoding analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is typically used to connect the processor 110 with the wireless communication module 160 .
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 .
  • MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc.
  • the processor 110 communicates with the camera 193 through the CSI interface, so as to realize the shooting function of the mobile phone 500 .
  • the processor 110 communicates with the display screen 194 through the DSI interface to realize the display function of the mobile phone 500 .
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface may be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like.
  • the GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the mobile phone 500, and can also be used to transmit data between the mobile phone 500 and peripheral devices. It can also be used to connect headphones to play audio through the headphones.
  • the interface can also be used to connect other mobile phones, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the mobile phone 500 .
  • the mobile phone 500 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive wireless charging input through the wireless charging coil of the mobile phone 500 . While the charging management module 140 charges the battery 142 , it can also supply power to the mobile phone through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140 and supplies power to the processor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the mobile phone 500 can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in handset 500 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 can provide a wireless communication solution including 2G/3G/4G/5G, etc. applied on the mobile phone 500 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify 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 then turn it into an electromagnetic wave for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110, and may be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the mobile phone 500 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • frequency modulation frequency modulation, FM
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates 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 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves
  • the antenna 1 of the mobile phone 500 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the mobile phone 500 can communicate with the network and other devices through wireless communication technology.
  • Wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband code division Multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM , and/or IR technology, etc.
  • GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi-zenith) satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the mobile phone 500 realizes the display function through the GPU, the display screen 194, and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 194 is used to display images, videos, and the like.
  • Display screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • emitting diode, AMOLED organic light-emitting diode
  • flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • cell phone 500 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • the mobile phone 500 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.
  • the ISP is used to process the data fed back by the camera 193 .
  • the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin tone.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object is projected through the lens to generate an optical image onto the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • cell phone 500 may include 1 or N cameras 193, where N is a positive integer greater than 1.
  • a digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the mobile phone 500 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point, and so on.
  • Video codecs are used to compress or decompress digital video.
  • Cell phone 500 may support one or more video codecs.
  • the mobile phone 500 can play or record videos in various encoding formats, for example, moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
  • MPEG moving picture experts group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the mobile phone 500 can be realized through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 500 .
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the storage data area can store data (such as audio data, phone book, etc.) created during the use of the mobile phone 500 and the like.
  • the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the processor 110 executes various functional applications and data processing of the mobile phone 500 by executing the instructions stored in the internal memory 121 and/or the instructions stored in the memory provided in the processor.
  • the mobile phone 500 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the audio module 170 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
  • Speaker 170A also referred to as a "speaker" is used to convert audio electrical signals into sound signals.
  • the mobile phone 500 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also referred to as "earpiece" is used to convert audio electrical signals into sound signals.
  • the voice can be received by placing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through a human mouth, and input the sound signal into the microphone 170C.
  • the mobile phone 500 may be provided with at least one microphone 170C. In other embodiments, the mobile phone 500 may be provided with two microphones 170C, which can implement a noise reduction function in addition to collecting sound signals. In other embodiments, the mobile phone 500 may be further provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions.
  • the earphone jack 170D is used to connect wired earphones.
  • the earphone interface 170D can be a USB interface 130, or can be a 3.5mm open mobile terminal platform (open mobile terminal platform, OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals.
  • the pressure sensor 180A may be provided on the display screen 194 .
  • the capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes.
  • the cell phone 500 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the mobile phone 500 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the mobile phone 500 can also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
  • the gyro sensor 180B can be used to determine the motion attitude of the mobile phone 500 .
  • the angular velocity of cell phone 500 about three axes may be determined by gyro sensor 180B.
  • the gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyroscope sensor 180B detects the shaking angle of the mobile phone 500, calculates the distance to be compensated by the lens module according to the angle, and allows the lens to offset the shaking of the mobile phone 500 through reverse motion to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenarios.
  • the air pressure sensor 180C is used to measure air pressure.
  • the mobile phone 500 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the mobile phone 500 can use the magnetic sensor 180D to detect the opening and closing of the flip holster.
  • the mobile phone 500 can detect the opening and closing of the flip according to the magnetic sensor 180D. Further, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, characteristics such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the mobile phone 500 in various directions (generally three axes). When the mobile phone 500 is stationary, the magnitude and direction of gravity can be detected. It can also be used to recognize the posture of mobile phones, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • the cell phone 500 can measure distance by infrared or laser. In some embodiments, when shooting a scene, the mobile phone 500 can use the distance sensor 180F to measure the distance to achieve fast focusing.
  • Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diodes may be infrared light emitting diodes.
  • the mobile phone 500 emits infrared light through the light emitting diodes.
  • Cell phone 500 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the cell phone 500 . When insufficient reflected light is detected, the cell phone 500 may determine that there is no object near the cell phone 500 .
  • the mobile phone 500 can use the proximity light sensor 180G to detect that the user holds the mobile phone 500 close to the ear to talk, so as to automatically turn off the screen to save power.
  • Proximity light sensor 180G can also be used in holster mode, pocket mode automatically unlocks and locks the screen.
  • the ambient light sensor 180L is used to sense ambient light brightness.
  • the mobile phone 500 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the mobile phone 500 is in the pocket to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the mobile phone 500 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering incoming calls with fingerprints, and the like.
  • the temperature sensor 180J is used to detect the temperature.
  • the cell phone 500 uses the temperature detected by the temperature sensor 180J to execute the temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the mobile phone 500 reduces the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the mobile phone 500 heats the battery 142 to avoid abnormal shutdown of the mobile phone 500 caused by the low temperature. In some other embodiments, when the temperature is lower than another threshold, the mobile phone 500 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 180K also called “touch device”.
  • the touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to touch operations may be provided through display screen 194 .
  • the touch sensor 180K may also be disposed on the surface of the mobile phone 500 , which is different from the position where the display screen 194 is located.
  • the bone conduction sensor 180M can acquire vibration signals.
  • the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice.
  • the bone conduction sensor 180M can also contact the pulse of the human body and receive the blood pressure beating signal.
  • the bone conduction sensor 180M can also be disposed in the earphone, and combined with the bone conduction earphone.
  • the audio module 170 can analyze the voice signal based on the vibration signal of the vocal vibration bone block obtained by the bone conduction sensor 180M, so as to realize the voice function.
  • the application processor can analyze the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M, and realize the function of heart rate detection.
  • the keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key.
  • the cell phone 500 can receive key input and generate key signal input related to user settings and function control of the cell phone 500 .
  • Motor 191 can generate vibrating cues.
  • the motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback.
  • touch operations acting on different applications can correspond to different vibration feedback effects.
  • the motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 194 .
  • Different application scenarios for example: time reminder, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.
  • the SIM card interface 195 is used to connect a SIM card.
  • the SIM card can be contacted and separated from the mobile phone 500 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195 .
  • the mobile phone 500 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • the SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card and so on. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards may be the same or different.
  • the SIM card interface 195 can also be compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the mobile phone 500 interacts with the network through the SIM card to realize functions such as call and data communication.
  • the handset 500 employs an eSIM, ie an embedded SIM card.
  • the eSIM card can be embedded in the mobile phone 500 and cannot be separated from the mobile phone 500 .
  • the software system of the mobile phone 500 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiments of the present application take an Android system with a layered architecture as an example to illustrate the software structure of the mobile phone 500 as an example.
  • FIG. 6 is a block diagram of a software structure of a mobile phone according to an embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
  • the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, and a kernel layer.
  • the application layer can include a series of application packages.
  • the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and so on.
  • the application framework layer provides APIs and programming frameworks for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer may include window managers, content providers, view systems, telephony managers, resource managers, notification managers, and the like.
  • a window manager is used to manage window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
  • Content providers are used to store and retrieve data and make these data accessible to applications.
  • the data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications.
  • a display interface can consist of one or more views.
  • the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide the communication function of the mobile phone 500 .
  • the management of call status including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
  • the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the mobile phone vibrates, and the indicator light flashes.
  • Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
  • the core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.
  • the application layer and the application framework layer run in virtual machines.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
  • a system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
  • surface manager surface manager
  • media library Media Libraries
  • 3D graphics processing library eg: OpenGL ES
  • 2D graphics engine eg: SGL
  • the Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
  • 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.
  • the mobile phone when the mobile phone detects that an APP is installed, it determines whether one or more permissions that the APP needs to apply for during running include special permissions. When the mobile phone determines that one or more permissions that the APP needs to apply for when running includes special permissions, it detects whether the installation package of the APP contains a valid privilege certificate for the APP. When the mobile phone determines that the APP's installation package contains a valid privilege certificate for the APP, it will verify the special permissions that the APP needs to apply for at runtime according to the special permissions recorded in the privilege certificate that allow the APP to apply during runtime. test.
  • the mobile phone can set them to an unavailable state, so that the APP cannot apply for the special permissions that are set to an unavailable state when running, thereby reducing the risk of special permissions being abused by the APP.
  • Possibility since the APP cannot apply for the special permission set to the unavailable state at runtime, the APP cannot obtain the data controlled by the special permission set to the unavailable state at runtime, which can improve the performance of the terminal.
  • the security of the system reduces the risk of user privacy data being leaked.
  • the rights management method provided by the embodiment of the present application may include:
  • S71 When the mobile phone detects that an application is installed, obtains one or more permissions that the application needs to apply for when running, and determines whether the one or more permissions include special permissions.
  • the mobile phone when the mobile phone detects an operation instructed by the user to install an APP or an operation instructed by the user to update an APP, it is determined that an APP installation is detected.
  • the mobile phone when the mobile phone detects that the user clicks on the icon 801 of the application mall APP shown in (a) in FIG. 8 , the mobile phone opens the application mall APP, and displays as shown in (b) in interface shown.
  • the mobile phone detects that the user clicks the installation control 802 corresponding to the first APP (eg email APP) 805 shown in (b) of FIG.
  • the mobile phone detects that the user clicks on the management control 803 shown in (b) in FIG. 8
  • the interface as shown in (c) in FIG. 8 is displayed, and the mobile phone detects that the user clicks (c) in FIG. 8 .
  • the control 804 corresponding to the shown browser APP is updated, it is determined that an operation instructing the installation of the browser APP by the user is detected.
  • the mobile phone When the mobile phone detects an operation instructed by the user to install the APP, it can obtain the installation package of the APP, and check the installation package of the APP. As an example and not a limitation, the mobile phone may obtain the installation package of the APP that has been put on the shelves in the application store from the application store APP.
  • the process of checking the APP installation package by the mobile phone may include:
  • the mobile phone detects whether the installation package of the APP contains a permission configuration file.
  • the mobile phone obtains one or more permissions that the APP needs to apply for when running from the rights configuration file, and determines whether the above one or more permissions include special permissions.
  • the mobile phone when checking the installation package of the APP, may display the installation progress of the APP and/or indicate that the APP is being installed.
  • the mobile phone when the mobile phone detects that the user clicks the installation control 802 corresponding to the first APP 805 shown in (b) in FIG. 8 , the mobile phone obtains the installation package of the first APP 805 and checks the installation package of the first APP 805 .
  • the installation control 802 corresponding to the first APP 805 in the interface shown in (b) in FIG. 8 can be switched to the interface shown in (a) in FIG. 9 . to indicate to the user that the APP is being installed; or switch to the installation progress control 902 in the interface as shown in (b) of FIG. 9 .
  • the mobile phone when the mobile phone checks the installation package of the APP, if it detects that the installation package of the APP contains a rights configuration file, the mobile phone can also display that the APP recorded in the rights configuration file is running One or more permissions that need to be applied for.
  • the mobile phone when the mobile phone detects that the user clicks the installation control 802 corresponding to the first APP 805 shown in (b) in FIG. 8 , the mobile phone obtains the installation package of the first APP 805 and checks the installation package of the first APP 805 .
  • the mobile phone checks the installation package of the first APP805, if it detects that the following 5 permissions are recorded in the permission configuration file in the installation package of the first APP805: notification permission, location permission, volume adjustment permission, microphone permission and camera permission, Then, the mobile phone can display the interface shown in FIG. 10 , and the interface displays the above-mentioned five permissions that the first APP 805 needs to apply for when running.
  • the process of checking the installation package of the APP by the mobile phone may further include the following S72-S76.
  • S72 when the mobile phone determines that one or more permissions that the APP needs to apply for when running includes special permissions, S72 is executed.
  • the mobile phone determines that one or more permissions that the APP needs to apply for when running does not include special permissions, the checking of the installation package of the APP is completed, and the mobile phone executes S77.
  • S72 The mobile phone detects whether the installation package of the application contains a privilege certificate. Among them, the privilege certificate is used to record the special permissions that the application is allowed to request at runtime.
  • the mobile phone when the mobile phone detects that the installation package of the APP contains an electronic file whose format is in a preset format and the name carries the identity of the privilege certificate, it is determined that the installation package of the APP contains the privilege certificate; the mobile phone detects the installation of the APP When the package does not contain an electronic file whose format is a preset format and whose name carries the identification of the privileged certificate, it is determined that the installation package of the APP does not contain the privileged certificate.
  • S73 The mobile phone determines whether the privilege certificate is valid.
  • the process of determining whether the privilege certificate is valid by the mobile phone may include:
  • the mobile phone determines whether the privilege certificate is issued by an authorized service agency.
  • the mobile phone determines whether the current time is within the validity period of the privilege certificate.
  • the current time may be the time when the mobile phone detects that the APP is installed.
  • the mobile phone to determine whether the privilege certificate is issued by the authority service organization may specifically include: the mobile phone adopts the public key of the authority service organization. Validate the privilege certificate.
  • the public key of the authorized service organization may be obtained by the mobile phone from the server 300 of the authorized service organization.
  • the mobile phone uses the public key of the authority service agency to verify the signature of the privileged certificate successfully, it is determined that the privileged certificate is issued by the authority service agency; Issued by authorized service agencies. It should be noted that when the mobile phone successfully verifies the privileged certificate, the content of the privileged certificate can be obtained; when the mobile phone fails to verify the signature of the privileged certificate, the content of the privileged certificate cannot be obtained.
  • the mobile phone after the mobile phone obtains the content of the privilege certificate, if it detects that the content of the privilege certificate includes the validity period of the privilege certificate, and the current time is within the validity period of the privilege certificate, it means that the privilege certificate has not expired, Therefore, the mobile phone can determine that the privilege certificate is valid, and execute S74.
  • the mobile phone after the mobile phone obtains the content of the privilege certificate, if it detects that the content of the privilege certificate includes the validity period of the privilege certificate, and the current time is not within the validity period of the privilege certificate, it means that the privilege certificate has expired , so the mobile phone can determine that the privilege certificate is invalid and execute S76.
  • the mobile phone after the mobile phone obtains the content of the privilege certificate, if it is detected that the content of the privilege certificate does not include the validity period of the privilege certificate, the mobile phone determines that the current time is within the limited period of the privilege certificate, that is, determines the privilege The certificate is valid and S74 is executed.
  • the mobile phone when the mobile phone determines that the privileged certificate is not issued by an authority service organization, the mobile phone determines that the privileged certificate is invalid, and executes S76.
  • S74 The mobile phone determines whether the privilege certificate contains all the special permissions that the application needs to apply for when running.
  • the privilege certificate is used to record the special rights that are allowed to be applied by the APP at runtime, that is, the special rights contained in the privilege certificate are the special rights that are allowed to be applied by the APP at runtime, while the special rights not included in the privilege certificate are not. Allows special permissions requested by APP at runtime. Therefore, after determining that the privilege certificate in the installation package of the APP is valid, the mobile phone determines whether the privilege certificate contains all the special permissions that the APP needs to apply for when running.
  • the mobile phone determines that all special permissions that the APP needs to apply for during running are included in the privilege certificate of the APP, the inspection of the APP installation package is completed, and the mobile phone executes S77.
  • S75 The mobile phone sets the special permissions that are not included in the privilege certificate among the special permissions that the application needs to apply for when running, to an unavailable state.
  • the APP after the mobile phone sets the special permission that is not included in the privilege certificate among the permissions that the APP needs to apply for during operation to an unavailable state, the APP cannot apply for the special permission that is in an unavailable state during operation, and further It is impossible to obtain the data controlled by the special authority in the unavailable state, which can improve the security of the terminal system and reduce the risk of leakage of the user's private data.
  • the above-mentioned special permissions not included in the privilege certificate may be all the special permissions that the APP needs to apply for when running, or some of the special permissions that the APP needs to apply for during running.
  • the mobile phone sets the special permissions that are not included in the privilege certificate in the permissions that the APP needs to apply for during operation to an unavailable state, which may specifically include:
  • the mobile phone deletes the special permissions that are not included in the privilege certificate from the permissions that the APP needs to apply for when it is running.
  • the permissions that are not deleted are the permissions that are allowed to be applied for by the APP during runtime.
  • the permissions that have not been deleted may include ordinary permissions and/or special permissions.
  • the mobile phone after the mobile phone deletes the special permissions that are not included in the privilege certificate from the permissions that the APP needs to apply for during running, the mobile phone can only display the permissions that are not deleted from the permissions that the APP needs to apply for during running, and indicate the above
  • the permissions that are not deleted are the permissions that are allowed to be applied by the APP at runtime.
  • the permissions that need to be applied include: notification permission, location permission, volume adjustment permission, microphone permission and camera permission.
  • the notification permission and volume adjustment permission are ordinary permissions
  • the location permission, microphone permission and camera permission are special permissions
  • the location permission is included in the privilege certificate, but the microphone permission and camera permission are not included in the privilege certificate, then the mobile phone starts from the first
  • an APP805 deletes the microphone permission and camera permission from the permissions that need to be applied for at runtime, it can display an interface as shown in (a) in FIG. 11 , which only displays a notification that is allowed to be applied by the first APP805 during runtime. Permissions, location permissions and volume adjustment permissions.
  • the mobile phone sets the special permissions that are not included in the privilege certificate in the permissions that the APP needs to apply for when running to an unavailable state, which may specifically include:
  • the mobile phone marks the special permissions that are not included in the privilege certificate among the permissions that the APP needs to apply for at runtime.
  • the marked special permissions are those that are not allowed to be applied by the APP at runtime; the unmarked permissions are the permissions that are allowed to be applied by the APP at runtime.
  • the unmarked rights may include ordinary rights and/or special rights.
  • the mobile phone after the mobile phone marks the special permissions that are not included in the privilege certificate among the permissions that the APP needs to apply for during running, the mobile phone can mark the special permissions that the APP needs to apply for during running and the unmarked permissions. All permissions are displayed, indicating that the above unmarked permissions are permissions that are allowed to be applied by the APP at runtime, and the above marked special permissions are permissions that are not allowed to be applied by the APP at runtime.
  • the permissions include: notification permission, location permission, volume adjustment permission, microphone permission and camera permission, where notification permission and The volume adjustment permission is a common permission, the location permission, the microphone permission and the camera permission are special permissions, and the location permission is included in the privilege certificate, but the microphone permission and camera permission are not included in the privilege certificate, then the mobile phone to the first APP805 when running
  • the interface as shown in (c) in FIG. 11 can be displayed, and the interface displays the notification permission and the location permission that are allowed to be applied for by the first APP805 at runtime. and volume adjustment permissions, it also shows that there are microphone permissions and camera permissions that are not allowed to be applied for by the first APP805 during runtime.
  • the inspection of the APP installation package is completed, and the mobile phone executes S77.
  • S76 The mobile phone sets all special permissions in the permissions that the application needs to apply for when it is running to an unavailable state.
  • the checking of the APP installation package is completed, and the mobile phone executes S77 at this time.
  • the mobile phone after the mobile phone completes checking the installation package of the APP, it may continue to install the APP after detecting an operation instructing the user to continue to install the APP.
  • the mobile phone will use the first APP 805 during running.
  • the interface shown in (a) of FIG. 12 can be displayed.
  • the mobile phone detects that the user clicks on the continue installation control 121 in the interface shown in (a) in FIG. 12, it is determined to detect the operation that the user instructs to continue to install the APP, the mobile phone continues to install the first APP 805, and displays as shown in FIG. 12. (b) The interface shown.
  • the mobile phone after the mobile phone completes checking the installation package of the APP, it can automatically continue to install the APP.
  • the mobile phone will After all the above-mentioned special permissions that an APP 805 needs to apply for during running are set to an unavailable state, the first APP 805 can be automatically installed, and the interface shown in (b) in FIG. 12 is directly displayed.
  • the mobile phone executes the above S77, so that after the APP is successfully installed, the mobile phone runs the APP when it detects the operation instructed by the user to run the APP, and the APP may not be set in its permission configuration file during running. File a permission request for a permission in an unavailable state.
  • the APP usually does not apply for the permission that is set to an unavailable state in its permission configuration file when running.
  • the mobile phone when the mobile phone is running an APP, if it is detected that the first permission applied for by the APP is a permission that is not set to an unavailable state in the permission configuration file of the APP, and the type of the first permission is If the permission authorized by the terminal device is required, the mobile phone can directly authorize the first permission of the APP, so that the APP has the first permission, so that the APP can call the API controlled by the first permission to realize the corresponding function.
  • the mobile phone when the mobile phone runs an APP, if it detects that the first permission applied for by the APP is a permission that is not set to an unavailable state in the permission configuration file of the APP, and the type of the first permission is For a permission that requires user authorization, the mobile phone may display an authorization request for the first permission, and the authorization request is used to confirm whether the user is allowed to grant the first permission to the APP.
  • the mobile phone can grant the first permission to the APP when detecting the operation that the user indicates that the first permission is allowed to be granted to the APP; permissions.
  • displaying the authorization request for the first permission on the mobile phone may include: the mobile phone displays a prompt box on the display interface of the APP, where the authorization request for the first permission is displayed in the prompt box.
  • the mobile phone when the mobile phone detects that the user clicks the icon of the first APP 805 in the interface shown in (a) in The first APP 805 displays an interface as shown in (b) of FIG. 13 .
  • the mobile phone is running the first APP805
  • the mobile phone can directly grant the first APP805 the volume adjustment permission, so the first APP805 With the volume adjustment permission, the first APP805 can call the API controlled by the volume adjustment permission to realize the volume adjustment function.
  • the mobile phone When the mobile phone is running the first APP805, if it is detected that the first APP805 applies for notification permission, since the notification permission is a permission that requires user authorization, the mobile phone can display the display interface of the first APP805 as shown in (c) in FIG. 13 .
  • the prompt box 132, the prompt box 132 displays the authorization request 133 for the notification permission, the first control 134 and the second control 135, wherein the first control 134 is used for the user to reject the above authorization request, and the second control 135 is used for For the user to agree to the above authorization request.
  • the mobile phone detects that the user clicks the first control 134 shown in (c) in FIG.
  • the mobile phone determines that the user indicates that the operation of not granting the notification permission to the first APP805 is detected, and the mobile phone does not grant the notification permission to the first APP805.
  • APP805 cannot have the notification authority, and cannot realize the notification function; when the mobile phone detects that the user clicks on the second control 135 shown in (c) in FIG.
  • the first APP 805 is granted the notification permission, so that the first APP 805 has the notification permission, and the first APP 805 can call the API controlled by the notification permission to realize the notification function.
  • the APP since the APP is only allowed to apply for the special permission that is not set to the unavailable state in its permission configuration file at runtime, the APP is not allowed to apply for the special permission that is set to the unavailable state in its permission configuration file during the runtime. Therefore, when a mobile phone runs an APP, it will only display a prompt box for permissions that are not set to unavailable in the APP's permission configuration file, and the type is a permission that requires user authorization. Compared with the existing permission management methods For all types of permissions in the APP's permission configuration file that require user authorization, a prompt box is displayed, which can reduce the impact of the prompt box display operation on the running process of the APP.
  • the mobile phone after the mobile phone grants the first permission to the APP, when it is detected that the APP calls the API controlled by the first permission, the mobile phone can return the data controlled by the permission to the APP, and the data is the first permission Real data corresponding to the managed service, so that the application can obtain the service controlled by the first permission.
  • the mobile phone can return the positioning information currently obtained through the positioning system to the APP.
  • such APP may apply for a special permission set to an unavailable state in its rights configuration file when running. , if such an APP cannot obtain the data controlled by a special permission recorded in the permission configuration file when it is launched, the APP may crash and other abnormal conditions, which will cause the APP to fail to run normally.
  • the mobile phone when the mobile phone installs such an APP, if the above S71 ⁇ S76 are used to check the installation package of the APP, and the permissions of such APP are configured during the check. If at least one special permission in the file is set to an unavailable state, the mobile phone can also execute S78 in FIG. 7 after executing the above S71 to S76 and before executing S77, which is described in detail as follows:
  • S78 The mobile phone establishes a list of unavailable permissions in the installation package of the application, and records the permissions that are set to an unavailable state among the permissions that the application needs to apply for when running, in the list of unavailable permissions.
  • the permissions that the APP needs to apply for when it is running are the permissions recorded in the permission configuration file of the APP when the APP is put on the shelf.
  • the mobile phone can also execute S79 to S80 in FIG. 7 , which are detailed as follows:
  • the preset data may be empty data or false data.
  • the fake data may be data randomly generated by the mobile phone and different from the data controlled by the first authority. In this way, it is not only possible to prevent the APP from running abnormally, but also to reduce the risk of data leakage controlled by the special permission set to an unavailable state, thereby improving the security of the system.
  • the mobile phone when the mobile phone is running the second APP, if it is detected that the second APP applies for the location permission, and the location permission is included in the list of unavailable permissions in the installation package of the second APP, the mobile phone can first grant the location to the second APP. permissions.
  • the mobile phone can return a null data to the second APP when the second APP calls the API controlled by the location permission; or the mobile phone can randomly generate a different data from the current positioning system when the second APP calls the API controlled by the location permission. The obtained false data of the positioning information is returned to the second APP.
  • the mobile phone detects that the user clicks the departure control 141 in the address selection interface of the ticketing APP as shown in (a) of FIG.
  • the interface shown in (b) of FIG. 14 is displayed to indicate to the user that the positioning is currently being performed. If the mobile phone determines that the current positioning city of the mobile phone is Beijing through the positioning system, the mobile phone can return a location data with the positioning information as Shanghai to the ticketing APP, and at the same time, the mobile phone can select the departure interface as shown in (c) in Figure 14.
  • the positioning box 142 of the mobile phone shows that the current positioning city of the mobile phone is Shanghai.
  • the mobile phone Since the mobile phone returns empty data or fake data to the APP, it may affect the user's experience of using the APP. Therefore, in order to improve the user's experience of using the APP, in another embodiment of the present application, after the mobile phone returns empty data or false data to the APP, the mobile phone can also display the first prompt information on the display interface of the APP.
  • the first prompt information It is used to prompt the user that the data related to the first special permission currently obtained by the APP (ie, the preset data) is inaccurate.
  • a prompt box 143 may also be displayed on the departure place selection interface, and In the prompt box 143 , first prompt information such as “the current location city is inaccurate” is displayed to prompt the user that the current location information is inaccurate.
  • the special permission is usually a permission related to the system security of the terminal device and/or the user's private data
  • the user can decide whether to allow the mobile phone to The APP returns the data controlled by the first special permission.
  • the identifier of the permission involving the user's private data may be marked in the first permission list in advance.
  • the mobile phone can identify whether the first special permission is a permission involving the user's private data according to whether the identifier of the first special permission is marked in the first permission list.
  • the mobile phone detects that the identifier of the first special permission is marked in the first permission list, it is determined that the first special permission is a permission involving the user's private data; if the mobile phone detects that the identifier of the first special permission is not in the first permission list If a permission list is marked, it is determined that the first special permission is a permission that does not involve the user's private data.
  • the mobile phone when the mobile phone displays the first prompt information on the display interface of the APP, or after the mobile phone displays the first prompt information on the display interface of the APP, if the first special permission is detected as involving the user's private data permission, the mobile phone can also display second prompt information on the display interface of the APP, and the second prompt information is used to confirm whether the user allows the mobile phone to return the data controlled by the first special permission to the APP.
  • the mobile phone may display a prompt box 144 on the departure place selection interface, and display second prompt information such as “whether the ticketing APP is allowed to obtain the exact location” in the prompt box 144 .
  • the prompt box 144 further includes a third control 145 and a fourth control 146 .
  • the mobile phone detects that the user clicks on the third control 145, it confirms that it detects an operation that the user instructs to allow the mobile phone to return the data controlled by the first special permission to the APP;
  • the mobile phone detects that the user clicks on the fourth control 146 it confirms that it detects the user Indicates that the mobile phone is not allowed to return the data controlled by the first special permission to the APP.
  • the mobile phone when the mobile phone detects an operation that the user instructs to allow the mobile phone to return the data controlled by the first special permission to the APP, the mobile phone can set the first special permission to an available state, and set the first special permission to the APP. Special permissions are removed from the list of unavailable permissions. After that, when the APP calls the API controlled by the first special permission again, the mobile phone can return the data controlled by the first special permission to the APP.
  • the first special permission applied by the APP is a permission involving the user's private data
  • since the user can decide whether to allow the data controlled by the first special permission to be returned to the APP not only can the user's privacy be reduced
  • the risk of private data being leaked can also improve the user experience of using the APP.
  • the mobile phone can prompt the user whether to allow the data controlled by the first special permission to be returned to the APP when the APP calls the API controlled by the first special permission, it is convenient for the user to manage the first special permission in real time.
  • the user can also set the usage status of the special permission related to the user's private data included in the unavailable permission list of the APP in the permission setting interface of the APP.
  • the mobile phone when the mobile phone detects an operation instructing the user to open the permission setting interface of the APP, the mobile phone can display the permission setting interface of the APP.
  • the permission setting interface can display the permissions that are not set as unavailable in the permission configuration file of the APP and the special permissions included in the unavailable permission list of the APP.
  • the usage status of the permission not set as unavailable state displayed on the permission setting interface is the available state
  • the usage status of the special permission included in the unavailable permission list of the APP displayed on the permission setting interface is the unavailable state.
  • the available status is used to indicate that the permission can be applied for by the APP at runtime, and when the APP calls the API controlled by the permission, the mobile phone will return the data controlled by the permission to the APP; the unavailable status is used for Yu means that the permission is not allowed to be applied by the APP at runtime, or when the APP applies for the permission, the mobile phone will return empty data or fake data to the APP.
  • the setting state of the above-mentioned permission that is not set to the unavailable state displayed on the permission setting interface and the setting state of the special permission involving the user's private data included in the unavailable permission list of the above-mentioned APP are both the first state, and the permission setting interface is the first state.
  • the setting states of the special permissions that do not involve the user's private data included in the displayed list of unavailable permissions of the above-mentioned APP are all the second state.
  • the first state is used to indicate that the use state of the right can be set by the user; the second state is used to indicate that the use state of the right cannot be set by the user.
  • the mobile phone may display the permissions that are not marked as unavailable in the permission configuration file of the first APP in the “Allowed” column in the permission setting interface, “ The usage status of each permission included in the Allowed column is available.
  • the mobile phone can display all the special permissions included in the unavailable permission list of the first APP in the "Forbidden” column in the permission setting interface, and the usage status of each permission included in the "Forbidden” column is unavailable.
  • the mobile phone may gray out the permission in the unavailable state.
  • the mobile phone can display the special permissions related to the user's private data in the unavailable permission list of the first APP in the "can be set” column of the "prohibited” column, and display the special permissions that are not in the unavailable permission list of the first APP.
  • Special permissions involving the user's private data are displayed in the "Not Settable” column of the "Prohibited” column.
  • the setting status of each permission included in the "Allowed” column and the "Can be set” column is the first state
  • the setting status of each permission included in the "Cannot be set” column is the second state.
  • the mobile phone can display a setting control 151 in the permission setting interface for each permission whose setting state is the first state. The user can set the usage status of the permission by clicking the setting control 151 .
  • the user can set the usage status of each permission included in the "Allowed” column and the "Settable” column.
  • the mobile phone may display the display interface as shown in (b) in FIG. 15 .
  • the mobile phone detects that the user clicks the permission control 152 as shown in (b) in FIG. 15 , it determines that an operation instructing the user to set the location permission to the available state is detected, the mobile phone sets the location permission to the available state, and the mobile phone can access the location permission from the user.
  • the location permission is deleted from the unavailable permission list of the first APP.
  • the mobile phone When the mobile phone returns to the permission setting interface of the first APP, as shown in (c) of FIG. 15 , the mobile phone can display the location permission in the “Allowed” column. In this way, when the first APP calls the API controlled by the location permission, the mobile phone can return the data controlled by the location permission to the first APP.
  • the user can set the usage status of one or more permissions of the first APP according to his own needs, so that the user's experience of using the first APP can be improved.
  • the mobile phone when the mobile phone installs the APP in the testing phase of the APP, in order to enable the developer of the APP to know the defects of the APP in time, the mobile phone can stop installing the APP when the following situations are determined:
  • the mobile phone determines that one or more permissions that the APP needs to apply for when running includes special permissions, but when the APP installation package does not contain a privilege certificate, stop installing the APP;
  • the mobile phone determines that one or more permissions that the APP needs to apply for when running includes special permissions, and the installation package of the APP contains a privileged certificate, but when the privileged certificate is invalid, stop installing the APP;
  • the mobile phone determines that one or more permissions that the APP needs to apply for when it is running include special permissions, and the installation package of the APP contains a privileged certificate, and the privileged certificate is valid, but at least one of the permissions that the APP needs to apply for during running When the special permission is not included in the above privilege certificate, stop installing the app.
  • a third prompt message for prompting the reason for the failure of the APP installation may also be displayed, so that the developer of the APP can know the reason for the failure of the APP installation.
  • the third prompt information may be "the rights configuration file contains special rights that are not allowed to apply”.
  • the user when the application is installed in the test environment, in the above three cases, the user can be prompted to apply to the authority service organization for the application for special authority by stopping the installation of the application and/or outputting the third prompt message.
  • the right to apply so as to facilitate developers to repair the loopholes existing in the application.
  • the terminal device includes corresponding hardware and/or software modules for executing each function.
  • the present application can be implemented in hardware or in the form of a combination of hardware and computer software in conjunction with the algorithm steps of each example described in conjunction with the embodiments disclosed herein. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functionality for each particular application in conjunction with the embodiments, but such implementations should not be considered beyond the scope of this application.
  • the terminal device may be divided into functional modules according to the foregoing method examples.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware. It should be noted that, the division of modules in the embodiments of the present application is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
  • FIG. 16 shows a possible schematic structural diagram of the terminal device 100 involved in the above embodiment.
  • the terminal device 100 may include: a first The acquisition unit 161 and the installation control unit 162 and the like.
  • the first obtaining unit 161 may be used to support the terminal device 100 to perform the above-mentioned S71, and/or other processes used for the technology described in the text.
  • the installation control unit 162 may be used to support the terminal device 100 to perform the above-described S72-S77, and/or other processes for the techniques described in the text.
  • the terminal device 100 may further include: a list creation unit and a list modification unit.
  • the list creation unit and the list modification unit are used to support the terminal device 100 to perform the above-mentioned S78, and/or other processes for the techniques described in the text.
  • the terminal device 100 may further include: an authorization control unit.
  • the authorization control unit is used to support the terminal device 100 to perform the above-mentioned S79, and/or other processes for the techniques described in the text.
  • the terminal device 100 may further include: a data processing unit.
  • the data processing unit is used to support the terminal device 100 to perform the above-mentioned S80, and/or other processes for the techniques described in the text.
  • An embodiment of the present application further provides a computer storage medium, where a computer instruction is stored in the computer storage medium, and when the computer instruction is executed on a terminal device, the terminal device executes the above-mentioned relevant method steps to realize the rights management method in the above-mentioned embodiment. .
  • Embodiments of the present application further provide a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the above-mentioned relevant steps, so as to implement the rights management method in the above-mentioned embodiment.
  • the embodiments of the present application also provide an apparatus, which may specifically be a chip, a component or a module, and the apparatus may include a connected processor and a memory; wherein, the memory is used for storing computer execution instructions, and when the apparatus is running, The processor can execute the computer-executable instructions stored in the memory, so that the chip executes the rights management methods in the foregoing method embodiments.
  • the terminal equipment, computer storage medium, computer program product or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, for the beneficial effects that can be achieved, reference may be made to the corresponding methods provided above. The beneficial effects of the method are not repeated here.
  • the disclosed apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or May be integrated into another device, or some features may be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • Units described as separate components may or may not be physically separated, and components shown as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium.
  • a readable storage medium including several instructions to make a device (may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Automation & Control Theory (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Stored Programmes (AREA)

Abstract

一种权限管理方法及终端设备。其中,该权限管理方法包括:当检测到有应用程序安装时,获取所述应用程序在运行时需要申请的一个或多个权限;若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中未包含特权证书,则将所述特殊权限设置为不可用状态,并继续安装所述应用程序;所述特权证书用于记录允许所述应用程序在运行时申请的特殊权限。该方法可以降低特殊权限被应用程序滥用的可能性,提高终端系统的安全性,降低用户的隐私数据被泄露的风险。

Description

一种权限管理方法及终端设备
本申请要求于2020年07月31日提交国家知识产权局、申请号为202010765594.0、申请名称为“一种权限管理方法及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及终端技术领域,尤其涉及一种权限管理方法及终端设备。
背景技术
随着科技的快速发展,应用程序(application,APP)能够实现的功能越来越多,其中,某些功能需要APP拥有相应的权限才能实现,例如,定位功能需要APP拥有位置权限才能实现。当某个APP想要拥有终端设备的某个权限来实现相应功能时,该APP的开发者可以在该APP的权限配置文件中声明该权限,这样,该APP在运行时便可基于权限配置文件中声明的权限向终端设备或用户提出权限申请,在终端设备或用户授权的情况下,该APP便会拥有该权限,这样该APP便可调用该权限所管控的应用程序编程接口(application programming interface,API)来实现相应功能。
目前的权限管理机制中,如果某个权限被至少一个APP需要,那么该权限便会被权限服务机构开放给所有APP,即权限服务机构允许任何APP在运行时申请该权限,这样会导致该权限被APP过度申请,甚至被某些APP恶意使用,从而导致终端系统的安全性较低,用户的隐私数据被泄露的风险较高。
发明内容
有鉴于此,本申请实施例提供一种权限管理方法及终端设备,能够降低特殊权限被应用程序滥用的可能性,提高终端系统的安全性,降低用户的隐私数据被泄露的风险。
为达到上述目的,本申请实施例采用如下技术方案:
第一方面,本申请实施例提供了一种权限管理方法,该方法可以包括:
当检测到有应用程序安装时,获取所述应用程序在运行时需要申请的一个或多个权限;
若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中未包含特权证书,则将所述特殊权限设置为不可用状态,并继续安装所述应用程序;所述特权证书用于记录允许所述应用程序在运行时申请的特殊权限。
其中,应用程序在运行时需要申请的一个或多个权限可以记录在该应用程序的权限配置文件中,该权限配置文件可以包含在该应用程序的安装包中。
上述特殊权限可以是涉及终端设备的系统安全和/或用户的隐私数据的权限。特殊权限在默认情况下不允许被任何应用程序在运行时申请,只有当权限服务机构授予应用程序对某个特殊权限的申请权,该特殊权限才允许被该应用程序在运行时申请。权限服务机构可以将允许应用程序在运行时申请的特殊权限记录在为该应用程序颁发的特权证书中。
本申请实施例提供的权限管理方法,在应用程序安装时,如果检测到该应用程序在运行时需要申请的一个或多个权限包括特殊权限,但该应用程序的安装包中未包含特权证书,则说明该应用程序未被权限服务机构授予对任一特殊权限的申请权,因此,通过将应用程序在运行时需要申请的特殊权限设置为不可用状态,使得应用程序在运行时无法对被设置为不可用状态的特殊权限进行申请,从而可以降低特殊权限被应用程序滥用的可能性。由于应用程序在运行时无法对被设置为不可用状态的特殊权限进行申请,因此,应用程序在运行时无法获取到上述特殊权限所管控的数据,从而可以提高终端系统的安全性,降低用户的隐私数据被泄露的风险。
在第一方面的一种可能的实施方式中,所述获取所述应用程序在运行时需要申请的一个或多个权限之后,所述方法还包括:
若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权证书,且所述特权证书为无效的特权证书,则将所述一个或多个权限包括的所述特殊权限设置为不可用状态,并继续安装所述应用程序。
其中,无效的特权证书表示该特权证书不是权限服务机构颁发的和/或该应用程序的安装时间不在该特权证书的有效期内(即应用程序安装时该特权证书已过期)。
上述实施方式中,当应用程序的安装包中包含特权证书,但该特权证书无效时,说明该应用程序未被权限服务机构授予对任一特殊权限的申请权,或者说明该应用程序被权限服务机构授予的对特殊权限的申请权已过期,因此,通过将应用程序在运行时需要申请的特殊权限设置为不可用状态,使得应用程序在运行时无法对被设置为不可用状态的特殊权限进行申请,从而可以降低特殊权限被应用程序滥用的可能性,提高终端系统的安全性,降低用户的隐私数据被泄露的风险。
在第一方面的另一种可能的实施方式中,所述获取所述应用程序在运行时需要申请的一个或多个权限之后,所述方法还包括:
若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权证书,且所述特权证书为有效的特权证书,且所述一个或多个权限包括的所述特殊权限中至少有一个特殊权限未包含在所述特权证书中,则将未包含在所述特权证书中的所述特殊权限设置为不可用状态,并继续安装所述应用程序。
上述实施方式中,当应用程序的安装包中包含特权证书,且该特权证书有效时,说明该应用程序被权限服务机构授予对一些特殊权限的申请权。其中,该应用程序在运行时需要申请的特殊权限中包含在特权证书中的特殊权限为允许该应用程序在运行时申请的特殊权限,该应用程序在运行时需要申请的特殊权限中未包含在特权证书中的特殊权限为不允许该应用程序在运行时申请的特殊权限,因此,通过将应用程序在运行时需要申请的特殊权限中未包含在特权证书中的特殊权限设置为不可用状态,使得应用程序在运行时无法对被设置为不可用状态的特殊权限进行申请,从而可以降低特殊权限被应用程序滥用的可能性,提高终端系统的安全性,降低用户的隐私数据被泄露的风险。
在第一方面的又一种可能的实施方式中,所述获取所述应用程序在运行时需要申请的一个或多个权限之后,所述方法还包括:
若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权 证书,且所述特权证书为有效的特权证书,且所述一个或多个权限包括的所述特殊权限均包含在所述特权证书中,则继续安装所述应用程序。
上述实施方式中,当应用程序在运行时需要申请的所有特殊权限均包含在特权证书中时,说明该应用程序在运行时需要申请的所有特殊权限均允许被应用程序在运行时申请,因此,可以不用对应用程序在运行时需要申请的特殊权限进行处理,使得应用程序在运行时可以申请到上述特殊权限,从而获取到这些特殊权限对应的系统服务,使得应用程序可以实现更多的功能。
在第一方面的又一种可能的实施方式中,所述获取所述应用程序在运行时需要申请的一个或多个权限之后,所述方法还包括:
若所述一个或多个权限不包括特殊权限,则继续安装所述应用程序。
在第一方面的又一种可能的实施方式中,所述继续安装所述应用程序之后,所述方法还包括:
在运行所述应用程序时,若检测到所述应用程序申请的第一权限为所述一个或多个权限中未被设置为不可用状态的权限,且所述第一权限的类型为需要终端设备授权的权限,则授予所述应用程序所述第一权限。
在第一方面的又一种可能的实施方式中,所述继续安装所述应用程序之后,所述方法还包括:
在运行所述应用程序时,若检测到所述应用程序申请的第一权限为所述一个或多个权限中未被设置为不可用状态的权限,且所述第一权限的类型为需要用户授权的权限,则显示针对所述第一权限的授权请求;所述授权请求用于确认用户是否允许授予所述应用程序所述第一权限;示例性的,可在应用程序的显示界面显示提示框,在该提示框中显示针对第一权限的授权请求;
若检测到用户指示允许授予所述应用程序所述第一权限的操作,则授予所述应用程序所述第一权限。
在第一方面的又一种可能的实施方式中,所述显示针对所述第一权限的授权请求之后,所述方法还包括:
若检测到用户指示不允许授予所述应用程序所述第一权限的操作,则不授予所述应用程序所述第一权限。
上述实施方式中,由于仅允许应用程序在运行时申请其权限配置文件中未被设置为不可用状态的特殊权限,而不允许应用程序在运行时申请其权限配置文件中被设置为不可用状态的特殊权限,因此,手机在运行某个应用程序时,只会针对该应用程序的权限配置文件中未被设置为不可用状态,且类型为需要用户授权的权限显示提示框,相对于现有的权限管理方法针对应用程序的权限配置文件中的所有类型为需要用户授权的权限均显示提示框而言,能够减小提示框显示操作对应用程序运行进程的影响。
在第一方面的又一种可能的实施方式中,所述授予所述应用程序所述第一权限之后,所述方法还包括:
若检测到所述应用程序调用所述第一权限所管控的应用程序编程接口,则向所述应用程序返回所述第一权限所管控的数据。
上述实施方式中,由于第一权限所管控的数据为第一权限所管控的服务对应的真 实数据,从而可以使应用程序获取到第一权限所管控的服务。
在第一方面的又一种可能的实施方式中,在将所述特殊权限设置为不可用状态之后,在所述继续安装所述应用程序之前,所述方法还包括:
在所述应用程序的安装包中建立不可用权限列表;
将所述一个或多个权限包括的特殊权限中被设置为所述不可用状态的特殊权限记录在所述不可用权限列表中。
在第一方面的又一种可能的实施方式中,所述继续安装所述应用程序之后,所述方法还包括:
在运行所述应用程序时,若检测到所述应用程序申请的第一特殊权限包含在所述不可用权限列表中,则授予所述应用程序所述第一特殊权限;
当检测到所述应用程序调用所述第一特殊权限所管控的应用程序编程接口时,向所述应用程序返回预设数据;所述预设数据包括空数据或假数据,所述假数据为不同于所述第一特殊权限所管控的数据的数据。
上述实施方式中,对于已经上架的基于传统的权限管理机制开发的应用程序,这类应用程序在运行时如果获取不到其上架时权限配置文件中记录的某个权限所管控的数据,则可能会发生闪退等异常情况,进而导致应用程序无法正常运行。因此,在安装此类应用程序时,可以将此类应用程序在运行时需要申请的特殊权限中被设置为不可用状态的特殊权限记录在不可用权限列表中。基于此,当此类应用程序在运行时申请的第一特殊权限包含在上述不可用权限列表中时,说明第一特殊权限是不允许被该应用程序在运行时申请的特殊权限,但为了避免该应用程序发生异常,可以先将第一特殊权限授予该应用程序,但在该应用程序调用第一特殊权限所管控的应用程序编程接口,通过向该应用程序返回空数据或假数据,使得该应用程序无法获取到第一特殊权限所管控的真实数据,如此不仅使得该应用程序可以正常运行,还能够提高终端系统的安全性,降低用户的隐私数据被泄露的风险。
在第一方面的又一种可能的实施方式中,所述向所述应用程序返回预设数据之后,所述方法还包括:
在所述应用程序的显示界面显示第一提示信息;所述第一提示信息用于提示用户所述应用程序获取到的与所述第一特殊权限相关的数据不准确。
上述实施方式中,由于在向应用程序返回空数据或假数据后,还会提示用户应用程序获取到的与第一特殊权限相关的数据不准确,因此可以提高用户对应用程序的使用体验。
在第一方面的又一种可能的实施方式中,所述向所述应用程序返回预设数据之后,所述方法还包括:
若所述第一特殊权限为涉及用户的隐私数据的权限,则在所述应用程序的显示界面显示第二提示信息;所述第二提示信息用于确认用户是否允许向所述应用程序返回所述第一特殊权限所管控的数据。
上述实施方式中,由于可以由用户决定是否允许向应用程序返回第一特殊权限所管控的数据,因此,不仅可以降低用户的隐私数据被泄露的风险,还可以提高用户对应用程序的使用体验。且由于可以在应用程序调用第一特殊权限所管控的应用程序编 程接口时提示用户是否允许向该应用程序返回第一特殊权限所管控的数据,因此,方便用户对第一特殊权限进行即时性的管理。
在第一方面的又一种可能的实施方式中,所述在所述应用程序的显示界面显示第二提示信息之后,所述方法还包括:
若检测到用户指示允许向所述应用程序返回所述第一特殊权限所管控的数据的操作,则将所述第一特殊权限设置为可用状态,并将所述第一特殊权限从所述不可用权限列表中移除。
在第一方面的又一种可能的实施方式中,所述将所述第一特殊权限设置为可用状态之后,所述方法还包括:
若检测到所述应用程序调用所述第一特殊权限所管控的应用程序编程接口,则向所述应用程序返回所述第一特殊权限所管控的数据。
上述实施方式中,在用户允许向应用程序返回第一特殊权限所管控的数据的情况下,在应用程序调用第一特殊权限所管控的应用程序编程接口时,可以向应用程序返回第一特殊权限所管控的数据,从而使得应用程序可以获取到第一特殊权限所管控的系统服务,丰富了应用程序的功能。
在第一方面的又一种可能的实施方式中,所述继续安装所述应用程序后,所述方法还包括:
显示所述应用程序的权限设置界面;所述权限设置界面显示有所述一个或多个权限中未被设置为所述不可用状态的权限以及所述应用程序的不可用权限列表中包含的特殊权限,所述未被设置为所述不可用状态的权限的使用状态为可用状态,所述应用程序的不可用权限列表中包含的特殊权限的使用状态为不可用状态;且所述未被设置为所述不可用状态的权限的设置状态为第一状态,所述应用程序的不可用权限列表中包含的涉及用户的隐私数据的特殊权限的设置状态为第一状态,所述应用程序的不可用权限列表中包含的不涉及用户的隐私数据的特殊权限的设置状态为第二状态;所述第一状态用于表示权限的使用状态可被用户设置,所述第二状态用于表示权限的使用状态不可被用户设置。
上述实施例中,用户可以根据自身需求对应用程序的一个或多个权限的使用状态进行设置,从而能够提高用户对应用程序的使用体验。
在第一方面的又一种可能的实施方式中,所述应用程序在测试环境下安装时,所述获取所述应用程序在运行时需要申请的一个或多个权限之后,所述方法还包括:
若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中未包含特权证书,则停止安装所述应用程序。
在第一方面的又一种可能的实施方式中,所述应用程序在测试环境下安装时,所述获取所述应用程序在运行时需要申请的一个或多个权限之后,所述方法还包括:
若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权证书,且所述特权证书为无效的特权证书,则停止安装所述应用程序。
在第一方面的又一种可能的实施方式中,所述应用程序在测试环境下安装时,所述获取所述应用程序在运行时需要申请的一个或多个权限之后,所述方法还包括:
若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权 证书,且所述特权证书为有效的特权证书,且所述一个或多个权限包括的所述特殊权限中至少有一个特殊权限未包含在所述特权证书中,则停止安装所述应用程序。
在第一方面的又一种可能的实施方式中,所述停止安装所述应用程序之后,所述方法还包括:
在所述应用程序的显示界面显示第三提示信息;所述第三提示信息用于提示所述应用程序安装失败的原因。
上述实施方式中,应用程序在测试环境下安装时,在上述三种情况下,可以通过停止安装应用程序和/或输出第三提示信息来提示用户需要向权限服务机构申请应用程序对特殊权限的申请权,从而便于开发者对应用程序存在的漏洞进行修复。
第二方面,本申请实施例提供了一种终端设备,包括:
第一获取单元,用于当检测到有应用程序安装时,获取所述应用程序在运行时需要申请的一个或多个权限;
安装控制单元,用于若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中未包含特权证书,则将所述特殊权限设置为不可用状态,并继续安装所述应用程序;所述特权证书用于记录允许所述应用程序在运行时申请的特殊权限。
在第二方面的一种可能的实施方式中,所述安装控制单元还用于:若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权证书,且所述特权证书为无效的特权证书,则将所述一个或多个权限包括的所述特殊权限设置为不可用状态,并继续安装所述应用程序。
在第二方面的另一种可能的实施方式中,所述安装控制单元还用于:若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权证书,且所述特权证书为有效的特权证书,且所述一个或多个权限包括的所述特殊权限中至少有一个特殊权限未包含在所述特权证书中,则将未包含在所述特权证书中的所述特殊权限设置为不可用状态,并继续安装所述应用程序。
在第二方面的又一种可能的实施方式中,所述安装控制单元还用于:若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权证书,且所述特权证书为有效的特权证书,且所述一个或多个权限包括的所述特殊权限均包含在所述特权证书中,则继续安装所述应用程序。
在第二方面的又一种可能的实施方式中,所述安装控制单元还用于:若所述一个或多个权限不包括特殊权限,则继续安装所述应用程序。
在第二方面的又一种可能的实施方式中,该终端设备还包括:
授权控制单元,用于在运行所述应用程序时,若检测到所述应用程序申请的第一权限为所述一个或多个权限中未被设置为不可用状态的权限,且所述第一权限的类型为需要终端设备授权的权限,则授予所述应用程序所述第一权限。
在第二方面的又一种可能的实施方式中,该终端设备还包括:
显示单元,用于在运行所述应用程序时,若检测到所述应用程序申请的第一权限为所述一个或多个权限中未被设置为不可用状态的权限,且所述第一权限的类型为需要用户授权的权限,则显示针对所述第一权限的授权请求;所述授权请求用于确认用户是否允许授予所述应用程序所述第一权限;
所述授权控制单元还用于:若检测到用户指示允许授予所述应用程序所述第一权限的操作,则授予所述应用程序所述第一权限。
在第二方面的又一种可能的实施方式中,所述授权控制单元还用于:若检测到用户指示不允许授予所述应用程序所述第一权限的操作,则不授予所述应用程序所述第一权限。
在第二方面的又一种可能的实施方式中,该终端设备还包括:
数据处理单元,用于若检测到所述应用程序调用所述第一权限所管控的应用程序编程接口,则向所述应用程序返回所述第一权限所管控的数据。
在第二方面的又一种可能的实施方式中,该终端设备还包括:
列表创建单元,用于在所述应用程序的安装包中建立不可用权限列表;
列表修改单元,用于将所述一个或多个权限包括的特殊权限中被设置为所述不可用状态的特殊权限记录在所述不可用权限列表中。
在第二方面的又一种可能的实施方式中,所述授权控制单元还用于:在运行所述应用程序时,若检测到所述应用程序申请的第一特殊权限包含在所述不可用权限列表中,则授予所述应用程序所述第一特殊权限;
所述数据处理单元还用于:当检测到所述应用程序调用所述第一特殊权限所管控的应用程序编程接口时,向所述应用程序返回预设数据;所述预设数据包括空数据或假数据,所述假数据为不同于所述第一特殊权限所管控的数据的数据。
在第二方面的又一种可能的实施方式中,所述显示单元还用于:在所述应用程序的显示界面显示第一提示信息;所述第一提示信息用于提示用户所述应用程序获取到的与所述第一特殊权限相关的数据不准确。
在第二方面的又一种可能的实施方式中,所述显示单元还用于:若所述第一特殊权限为涉及用户的隐私数据的权限,则在所述应用程序的显示界面显示第二提示信息;所述第二提示信息用于确认用户是否允许向所述应用程序返回所述第一特殊权限所管控的数据。
在第二方面的又一种可能的实施方式中,该终端设备还包括:
权限管理单元,用于若检测到用户指示允许向所述应用程序返回所述第一特殊权限所管控的数据的操作,则将所述第一特殊权限设置为可用状态,并将所述第一特殊权限从所述不可用权限列表中移除。
所述数据处理单元还用于:若检测到所述应用程序调用所述第一特殊权限所管控的应用程序编程接口,则向所述应用程序返回所述第一特殊权限所管控的数据。
在第二方面的又一种可能的实施方式中,所述显示单元还用于:显示所述应用程序的权限设置界面;所述权限设置界面显示有所述一个或多个权限中未被设置为所述不可用状态的权限以及所述应用程序的不可用权限列表中包含的特殊权限,所述未被设置为所述不可用状态的权限的使用状态为可用状态,所述应用程序的不可用权限列表中包含的特殊权限的使用状态为不可用状态;且所述未被设置为所述不可用状态的权限的设置状态为第一状态,所述应用程序的不可用权限列表中包含的涉及用户的隐私数据的特殊权限的设置状态为第一状态,所述应用程序的不可用权限列表中包含的不涉及用户的隐私数据的特殊权限的设置状态为第二状态;所述第一状态用于表示权 限的使用状态可被用户设置,所述第二状态用于表示权限的使用状态不可被用户设置。
在第二方面的又一种可能的实施方式中,所述安装控制单元还用于:若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中未包含特权证书,则停止安装所述应用程序。
在第二方面的又一种可能的实施方式中,所述安装控制单元还用于:若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权证书,且所述特权证书为无效的特权证书,则停止安装所述应用程序。
在第二方面的又一种可能的实施方式中,所述安装控制单元还用于:若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权证书,且所述特权证书为有效的特权证书,且所述一个或多个权限包括的所述特殊权限中至少有一个特殊权限未包含在所述特权证书中,则停止安装所述应用程序。
在第二方面的又一种可能的实施方式中,所述显示单元还用于:在所述应用程序的显示界面显示第三提示信息;所述第三提示信息用于提示所述应用程序安装失败的原因。
第三方面,本申请实施例提供了一种终端设备,包括:至少一个处理器;至少一个存储器;其中,所述至少一个存储器中存储有计算机指令,当所述计算机指令被所述至少一个处理器执行时,使得所述终端设备执行如上述第一方面所述的权限管理方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,包括计算机指令,当所述计算机指令在终端设备上运行时,所述终端设备执行如上述第一方面所述的权限管理方法。
第五方面,本申请提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面中任一项所述的权限管理方法。
第六方面,本申请提供了一种芯片系统,所述芯片系统包括存储器和处理器,所述处理器执行所述存储器中存储的计算机程序,以实现上述第一方面中任一项所述的权限管理方法。
第七方面,本申请提供了另一种芯片系统,所述芯片系统包括处理器,所述处理器与存储器耦合,所述处理器执行所述存储器中存储的计算机程序,以实现上述第一方面中任一项所述的权限管理方法。
可以理解的是,上述第二方面至第七方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。
附图说明
图1为本申请实施例提供的一种APP申请特殊权限的过程所涉及的系统的结构示意图;
图2为本申请实施例提供的一种界面示意图;
图3为本申请实施例提供的另一种界面示意图;
图4为本申请实施例提供的又一种界面示意图;
图5为本申请实施例提供的一种终端设备的硬件结构示意图;
图6为本申请实施例提供的一种终端设备的软件结构示意图;
图7为本申请实施例提供的一种权限管理方法的示意性流程图;
图8为本申请实施例提供的一组界面示意图;
图9为本申请实施例提供的另一组界面示意图;
图10为本申请实施例提供的又一种界面示意图;
图11为本申请实施例提供的又一组界面示意图;
图12为本申请实施例提供的又一组界面示意图;
图13为本申请实施例提供的又一组界面示意图;
图14为本申请实施例提供的又一组界面示意图;
图15为本申请实施例提供的又一组界面示意图;
图16为本申请实施例提供的一种终端设备的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:A,B,以及AB这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个;“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加;“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
在介绍本申请实施例之前,首先对本申请实施例中涉及到的相关名词作如下释义:
1、权限:用于获取该权限对应的系统服务的一种权利。
本申请实施例中的权限可以包括:位置权限、通讯录权限、短信息权限、电话权限、通话记录权限、相机权限、麦克风权限、存储卡的读/写权限、通知权限及音量调节权限等。
如果某个APP拥有某个权限,则该APP可以获取到该权限对应的系统服务。在具体应用中,当某个APP拥有某个权限时,该APP可以通过调用该权限所管控的API来获取该权限对应的系统服务。示例性的,如果某个APP拥有位置权限,则某个APP可以通过调用位置权限所管控的API来获取位置服务。
从权限的权限级别方面而言,权限至少可以被分为特殊权限和普通权限。
特殊权限可以是涉及终端设备的系统安全和/或用户的隐私数据,和/或被少量APP为扩展用户功能所需的权限。其中,少量可以根据实际需求确定,例如,少量可以是少于5个;用户功能指真正被用户所需的功能,而并非APP的开发者认为用户需要的功能。
普通权限可以是不涉及系统安全和用户的隐私数据的权限。
示例性的,特殊权限可以包括但不限于:位置权限、通讯录权限、短信息权限、电话权限、通话记录权限、相机权限、麦克风权限及存储卡的读/写权限。普通权限可以包括但不限于:通知权限和音量调节权限。
需要说明的是,本申请实施例中,特殊权限在默认情况下不允许被任何APP在运行时申请,只有当权限服务机构授予某个APP对某个特殊权限的申请权,该特殊权限 才允许被该APP在运行时申请。其中,APP对特殊权限的申请权指APP在运行时申请特殊权限的权利。普通权限允许被任何APP在运行时申请。
本申请实施例中,为了使终端设备能够识别出特殊权限或普通权限,可以预先为终端设备配置一个第一权限列表和/或第二权限列表。第一权限列表用于存储所有特殊权限的标识,第二权限列表用于存储所有普通权限的标识。其中,权限的标识可以是权限的名称。
终端设备可以基于第一权限列表和/或第二权限列表来识别某个权限是否为特殊权限或普通权限。具体的,终端设备若检测到第一权限列表中包括某个权限的标识,则确定该权限为特殊权限;终端设备若检测到第一权限列表中不包括某个权限的标识,则确定该权限为普通权限。或者,终端设备若检测到第二权限列表中不包括某个权限的标识,则确定该权限为特殊权限;终端设备若检测到第二权限列表中包括某个权限的标识,则确定该权限为普通权限。
从权限的授权类型方面而言,权限至少可以被分为需要用户授权的权限和需要终端设备授权的权限。
需要用户授权的权限指需要获得用户的授权才能被APP拥有的权限。
需要终端设备授权的权限指需要获得终端设备的授权才能被APP拥有的权限。
示例性的,需要用户授权的权限可以是涉及用户的隐私数据和/或敏感操作的权限,例如,需要用户授权的权限可以包括但不限于:位置权限、通知权限、通讯录权限、短信息权限、电话权限、通话记录权限、相机权限、麦克风权限、存储卡的读/写权限及通知权限。需要终端设备授权的权限可以是不涉及用户的隐私数据及敏感操作的权限,例如,需要终端设备授权的权限可以包括但不限于:音量调节权限。
如果APP在运行时申请的权限的类型为需要终端设备授权的权限,则终端设备可以直接授予该APP其所申请的权限;如果APP在运行时申请的权限的类型为需要用户授权的权限,则在征得用户的同意下,终端设备才能授予该APP其所申请的权限。
本申请实施例中,为了使终端设备能够识别出需要终端设备授权的权限或需要用户授权的权限,可以预先为终端设备配置一个第三权限列表和/或第四权限列表。第三权限列表用于存储所有需要终端设备授权的权限的标识,第四权限列表用于存储所有需要用户授权的权限的标识。
终端设备可以基于第三权限列表和/或第四权限列表来识别某个权限是否为需要终端设备授权的权限或需要用户授权的权限。具体的,终端设备若检测到第三权限列表中包括某个权限的标识,则确定该权限为需要终端设备授权的权限;终端设备若检测到第三权限列表中不包括某个权限的标识,则确定该权限为需要用户授权的权限。或者,终端设备若检测到第四权限列表中不包括某个权限的标识,则确定该权限为需要终端设备授权的权限;终端设备若检测到第四权限列表中包括某个权限的标识,则确定该权限为需要用户授权的权限。
2、权限服务机构:能够为APP提供针对特殊权限的申请权的授权服务的机构。
作为示例而非限定,权限服务机构可以是终端设备厂商(original equipment manufacturer,OEM),也可以是APP生态联盟,或者还可以是系统开发商等。
3、特权证书:由权限服务机构为APP颁发的用于记录允许该APP在运行时申请 的特殊权限的电子证书。
其中,上述电子证书的格式可以是预设格式,上述电子证书的名称中可以携带特权证书标识。作为示例而非限定,预设格式可以是便携式文件格式(portable document format,PDF),也可以是文本(text,TXT)格式,也可以是可扩展标记语言(Extensible Markup Language,XML)格式等。特权证书标识可以是特权证书的名称。
4、权限配置文件:用于记录APP在运行时需要申请的权限的文件。
作为示例而非限定,权限配置文件可以是TXT格式的文件,也可以是XML格式的文件,也可以是其他格式的文件等。以APP所适用的软件系统为Android系统为例,权限配置文件可以是AndroidManifest.xml文件。
需要说明的是,APP在运行时需要申请的权限可以是一个,也可以是多个,本申请实施例不对APP在运行时需要申请的权限的个数做特别限定。
从权限的权限级别方面而言,上述一个或多个权限可以是普通权限,也可以是特殊权限;从权限的授权类型方面而言,上述一个或多个权限可以是需要终端设备授权的权限,也可以是需要用户授权的权限。
请参阅图1,图1为本申请实施例提供的一种APP申请特殊权限的过程所涉及的系统的结构示意图。如图1所示,该系统可以包括第一终端100、第二终端200及服务器300。其中,第一终端100可以是任一用户所使用的终端设备,第二终端200可以是APP的开发者用于开发APP的终端设备,服务器300可以是权限服务机构的服务器。
第一终端100上可以安装有应用商城APP101,应用商城APP101可以是第一终端100从服务器300中获取到的服务。应用商城APP101可以供APP的开发者上架其所开发的APP的安装包,也可以供第一终端100获取其需要安装的APP的安装包。
本申请实施例中,第一终端100、第二终端200及服务器300均可以是手机、平板电脑、可穿戴设备、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等电子设备。图1是以第一终端100为手机,第二终端200为笔记本电脑,服务器300为笔记本电脑为例进行示例性说明。
由于特殊权限在默认情况下不允许被任何APP在运行时申请,因此,如果某个APP在运行时想要申请某个特殊权限,进而获取该特殊权限对应的系统服务,那么,该APP的开发者在开发该APP时,可以通过其使用的第二终端200向服务器300发送针对该特殊权限的申请权的授权请求,以请求权限服务机构授予该APP对该特殊权限的申请权。
其中,授权请求中至少需要包括如下信息:请求授权的APP的标识、请求授权的APP的开发者的身份标识、请求授权的APP所请求的特殊权限的标识以及请求授权的APP在运行时申请所请求的特殊权限的必要性和合理性说明。作为示例而非限定,APP的标识可以是APP的安装包的名称;APP的开发者的身份标识可以是APP开发者拥有的与APP相关的自签名公钥。
需要说明的是,请求授权的APP的开发者拥有的自签名公钥可以供服务器300签 署在针对该APP的特权证书中,这样,只有拥有与上述自签名公钥对应的私钥的开发者才能获取到针对该APP的特权证书中的内容,从而能够避免针对该APP的特权证书被其他开发者使用。
本申请实施例中,第二终端200可以在检测到开发者指示生成授权请求的操作时,根据开发者输入的请求授权的APP的标识、请求授权的APP的开发者的身份标识、请求授权的APP所请求的特殊权限的标识以及请求授权的APP在运行时申请所请求的特殊权限的必要性和合理性说明,生成针对特殊权限的申请权的授权请求。第二终端200可以在检测到开发者指示发送授权请求的操作时,向服务器300发送上述授权请求。
示例性的,如果第一APP在运行时想要申请以下3个特殊权限:位置权限、麦克风权限及相机权限,则第一APP的开发者可以在如图2所示的在线授权请求模板21中的第一输入框211、第二输入框212、第三输入框213及第四输入框214中分别输入第一APP的安装包的名称“app1.apk”、第一APP的开发者拥有的与第一APP相关的自签名公钥、第一APP所请求的特殊权限“位置权限、麦克风权限及相机权限”及第一APP申请位置权限、麦克风权限及相机权限的必要性和合理性说明。第二终端200检测到开发者点击在线授权请求模板21中的提交控件215时,确认检测到开发者指示生成授权请求的操作以及开发者指示发送授权请求的操作,第二终端200基于开发者分别在第一输入框211、第二输入框212、第三输入框213及第四输入框214中输入的上述内容,生成授权请求,并向服务器300发送该授权请求。其中,在线授权请求模板21可以是权限服务机构提供的。
服务器300接收到第二终端200发送的授权请求后,可以显示授权请求中包括的请求授权的APP的标识、请求授权的APP的开发者的身份标识、请求授权的APP所请求的特殊权限的标识以及请求授权的APP在运行时申请所请求的特殊权限的必要性和合理性说明。
权限服务机构的审核人员可以根据上述请求授权的APP在运行时申请所请求的特殊权限的必要性和合理性说明,审核上述请求授权的APP在实际运行时申请上述所请求的特殊权限的操作是否是合理且必要的。
本申请实施例中,审核人员如果确定上述请求授权的APP在实际运行时申请上述所请求的特殊权限中的某些特殊权限的操作是合理且必要的,则审核人员可以将这些特殊权限标记为审核通过的特殊权限,并指示服务器300生成用于记录上述审核通过的特殊权限的特权证书。其中,审核通过的特殊权限为允许请求授权的APP在运行时申请的特殊权限。
示例性的,结合上一个示例,如果审核人员确定第一APP在运行时申请位置权限的操作是合理且必要的,申请麦克风权限和相机权限的操作是不合理和/或不必要的,则审核人员可以将位置权限标记为审核通过的特殊权限,并指示服务器300生成用于记录位置权限的特权证书。
在本申请的一个实施例中,特权证书中至少可以包括如下信息:允许申请特殊权限的APP的标识、允许申请特殊权限的APP的开发者的身份标识、允许被APP申请的特殊权限的标识。其中,允许申请特殊权限的APP的标识与针对该APP提出的授 权请求中包括的请求授权的APP的标识相同;允许申请特殊权限的APP的开发者的身份标识与针对该APP提出的授权请求中包括的请求授权的APP的开发者的身份标识相同;允许被APP申请的特殊权限为该APP所请求的特殊权限中审核通过的特殊权限。
本实施例中,服务器300可以在检测到审核人员指示生成特权证书的操作时,根据审核人员输入的允许申请特殊权限的APP的标识、允许申请特殊权限的APP的开发者的身份标识及允许被APP申请的特殊权限的标识,生成特权证书。
示例性的,结合上一个示例,如果第一APP所请求的特殊权限中只有位置权限为审核通过的特殊权限,则审核人员可以在如图3所示的特权证书模板31中的第一输入框311、第二输入框312及第三输入框313中分别输入第一APP的安装包的名称“app1.apk”、与第一APP相关的自签名公钥以及允许被第一APP申请的特殊权限的标识“位置权限”。服务器300检测到审核人员点击特权证书模板31中的保存控件315时,确定检测到审核人员指示生成特权证书的操作,服务器300根据上述第一输入框311、第二输入框312及第三输入框313中的输入内容生成针对第一APP的特权证书。
在本申请的另一个实施例中,特权证书中还可以包括特权证书的有效期。特权证书的有效期可以是特权证书的生效截止日,其可以由审核人员根据实际情况确定。示例性的,假如特权证书的有效期为2020年7月13日,则可以认为该特权证书的生效截止日为2020年7月13日,即该特权证书在2020年7月14日失效。
本实施例中,服务器300可以在检测到审核人员指示生成特权证书的操作时,根据审核人员输入的允许申请特殊权限的APP的标识、允许申请特殊权限的APP的开发者的身份标识、允许被APP申请的特殊权限的标识及特权证书的有效期,生成特权证书。
示例性的,如果第一APP所请求的特殊权限中只有位置权限为审核通过的特殊权限,则审核人员可以在如图3所示的特权证书模板31中的第一输入框311、第二输入框312、第三输入框313及第四输入框314中分别输入第一APP的安装包的名称“app1.apk”、与第一APP相关的自签名公钥、允许被第一APP申请的特殊权限的标识“位置权限”以及特权证书的有效期“2020年7月13日”。服务器300检测到审核人员点击特权证书模板31中的保存控件315时,确定检测到审核人员指示生成特权证书的操作,服务器300根据上述第一输入框311、第二输入框312、第三输入框313及第四输入框314中的输入内容生成针对第一APP的特权证书。
需要说明的是,当特权证书中不包括特权证书的有效期时,可以认为该特权证书是永久生效的;当特权证书中包括特权证书的有效期时,可以认为该特权证书只在特权证书的有效期内生效。
在本申请的又一个实施例中,为了防止特权证书被伪造或被恶意篡改,服务器300可以在检测到审核人员指示对特权证书进行数字签名的操作时,采用权限服务机构的私钥对特权证书进行数字签名。服务器300检测到审核人员指示发送特权证书的操作时,向第二终端200发送数字签名后的特权证书。
示例性的,服务器300检测到审核人员点击如图3所示的特权证书模板31中的加 密控件316时,确认检测到到审核人员指示对特权证书进行数字签名的操作,服务器300采用权限服务机构的私钥对特权证书进行数字签名。服务器300检测到审核人员点击如图4所示的邮件发送界面中的发送控件411时,确定检测到审核人员指示发送特权证书的操作,服务器300向登录有第一APP开发者的邮箱412的第二终端发送附件为针对第一APP的特权证书413的邮件。其中,APP开发者的邮箱可以是第二终端发送授权请求时提供给服务器300的。
本申请实施例中,APP的开发者获取到与请求授权的APP对应的特权证书后,可以将该特权证书配置在请求授权的APP的安装包中,再将安装包上架至应用商城APP供用户下载。
结合上述实施例及相应的附图,本申请实施例提供了一种权限管理方法,该方法可以应用于图1中的第一终端100。本申请实施例以第一终端100为手机为例,对权限管理方法进行详细说明。
示例性的,图5为本申请实施例提供的一种手机的硬件结构示意图。如图5所示,手机500可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本申请实施例示意的结构并不构成对手机500的具体限定。在本申请另一些实施例中,手机500可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是手机500的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路 (inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现手机500的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在另一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在另一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现手机500的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现手机500的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为手机500充电,也可以用于手机500与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他手机,例如AR设备等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对手机500的结构限定。在本申请另一些实施例中,手机500也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过手机500的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为手机供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
手机500的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。手机500中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在手机500上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在另一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在手机500上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR) 等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,手机500的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得手机500可以通过无线通信技术与网络以及其他设备通信。无线通信技术可以包括全球移动通讯系统(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,和/或IR技术等。GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
手机500通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,手机500可以包括1个或N个显示屏194,N为大于1的正整数。
手机500可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,手机500可以包括1个或N个摄像头193,N为大于1的 正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当手机500在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。手机500可以支持一种或多种视频编解码器。这样,手机500可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现手机500的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展手机500的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储手机500使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行手机500的各种功能应用以及数据处理。
手机500可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。手机500可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当手机500接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。手机500可以设置至少一个麦克风170C。在另一些实施例中,手机500可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,手机500还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以 是3.5mm的开放移动手机平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。手机500根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,手机500根据压力传感器180A检测所述触摸操作强度。手机500也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定手机500的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定手机500围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测手机500抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消手机500的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,手机500通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。手机500可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当手机500是翻盖机时,手机500可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测手机500在各个方向上(一般为三轴)加速度的大小。当手机500静止时可检测出重力的大小及方向。还可以用于识别手机姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。手机500可以通过红外或激光测量距离。在一些实施例中,拍摄场景,手机500可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。手机500通过发光二极管向外发射红外光。手机500使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定手机500附近有物体。当检测到不充分的反射光时,手机500可以确定手机500附近没有物体。手机500可以利用接近光传感器180G检测用户手持手机500贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。手机500可以根据感知的环境光亮度自 适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测手机500是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。手机500可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,手机500利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,手机500执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,手机500对电池142加热,以避免低温导致手机500异常关机。在其他一些实施例中,当温度低于又一阈值时,手机500对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于手机500的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在另一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。手机500可以接收按键输入,产生与手机500的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和手机500的接触和分离。手机500可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。手机500通过SIM卡和网络交互,实现通话以及数据通信等功能。 在一些实施例中,手机500采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在手机500中,不能和手机500分离。
手机500的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的安卓(Android)系统为例,示例性说明手机500的软件结构。
图6为本申请实施例提供的一种手机的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图6所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供API和编程框架。应用程序框架层包括一些预先定义的函数。
如图6所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供手机500的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,手机振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
本申请实施例提供的权限管理方法,手机检测到有APP安装时,判断该APP在运行时需要申请的一个或多个权限是否包括特殊权限。手机确定该APP在运行时需要申请的一个或多个权限包括特殊权限时,检测该APP的安装包中是否包含针对该APP的有效的特权证书。手机确定该APP的安装包中包含针对该APP的有效的特权证书时,根据该特权证书中记录的允许该APP在运行时申请的特殊权限,对该APP在运行时需要申请的特殊权限进行校验。对于校验未通过的特殊权限,手机可以将其设置为不可用状态,这样,该APP在运行时便无法对被设置为不可用状态的特殊权限进行申请,从而可以降低特殊权限被APP滥用的可能性;由于该APP在运行时无法对被设置为不可用状态的特殊权限进行申请,因此该APP在运行时无法获取到被设置为不可用状态的特殊权限所管控的数据,从而能够提高终端系统的安全性,降低用户的隐私数据被泄露的风险。
如图7所示,本申请实施例提供的权限管理方法可以包括:
S71:手机检测到有应用程序安装时,获取所述应用程序在运行时需要申请的一个或多个权限,判断所述一个或多个权限是否包括特殊权限。
本申请实施例中,手机检测到用户指示安装APP的操作或用户指示更新APP的操作时,确定检测到有APP安装。
示例性的,如图8所示,当手机检测到用户点击图8中的(a)所示的应用商城APP的图标801时,手机打开应用商城APP,显示如图8中的(b)所示的界面。手机在检测到用户点击图8中的(b)所示的第一APP(例如电子邮件APP)805对应的安装控件802时,确定检测到用户指示安装第一APP805的操作。或者,手机在检测到用户点击图8中的(b)所示的管理控件803时,显示如图8中的(c)所示的界面,手机在检测到用户点击图8中的(c)所示的浏览器APP对应的更新控件804时,确定检测到用户指示安装浏览器APP的操作。
手机检测到用户指示安装APP的操作时,可以获取该APP的安装包,并对该APP的安装包进行查验。作为示例而非限定,手机可以从应用商城APP中获取已上架至应用商城的该APP的安装包。
手机对APP的安装包进行查验的过程可以包括:
1、手机检测APP的安装包中是否包含权限配置文件。
2、在APP的安装包中包含权限配置文件的情况下,手机从权限配置文件中获取APP在运行时需要申请的一个或多个权限,判断上述一个或多个权限是否包括特殊权限。
在本申请的一个实施例中,手机在对APP的安装包进行查验时,可以显示该APP的安装进度和/或示意该APP正在安装。
示例性的,手机在检测到用户点击图8中的(b)所示的第一APP805对应的安装控件802时,获取第一APP805的安装包,并对第一APP805的安装包进行查验。手机对第一APP805的安装包进行查验时,可以将图8中的(b)所示的界面中与第一APP805对应的安装控件802切换为如图9中的(a)所示的界面中的安装中控件901,以向用户示意该APP正在安装;或者切换为如图9中的(b)所示的界面中的安装进度控件902。
在本申请的另一个实施例中,手机在对APP的安装包进行查验时,如果检测到该APP的安装包中包含权限配置文件,手机还可以显示该权限配置文件中记录的该APP在运行时需要申请的一个或多个权限。
示例性的,手机在检测到用户点击图8中的(b)所示的第一APP805对应的安装控件802时,获取第一APP805的安装包,并对第一APP805的安装包进行查验。手机对第一APP805的安装包进行查验时,如果检测到第一APP805的安装包中的权限配置文件中记录了以下5个权限:通知权限、位置权限、音量调节权限、麦克风权限及相机权限,则手机可以显示如图10所示的界面,该界面显示有第一APP805在运行时需要申请的上述5个权限。
本申请实施例中,手机对APP的安装包进行查验的过程还可以包括后续的S72~S76。
具体的,在本申请的一个实施例中,手机确定APP在运行时需要申请的一个或多个权限包括特殊权限时,执行S72。
在本申请的另一个实施例中,手机确定APP在运行时需要申请的一个或多个权限不包括特殊权限时,即完成对APP的安装包的查验,此时手机执行S77。
S72:手机检测应用程序的安装包中是否包含特权证书。其中,特权证书用于记录允许应用程序在运行时申请的特殊权限。
本申请实施例中,手机检测到APP的安装包中包含格式为预设格式,且名称中携带特权证书标识的电子文件时,确定该APP的安装包中包含特权证书;手机检测到APP的安装包中不包含格式为预设格式,且名称中携带特权证书标识的电子文件时,确定该APP的安装包中不包含特权证书。
在本申请的一个实施例中,手机确定APP的安装包中包含特权证书时,执行S73。
在本申请的另一个实施例中,手机确定APP的安装包中不包含特权证书时,执行S76。
S73:手机判断特权证书是否有效。
本申请实施例中,手机判断特权证书是否有效的过程可以包括:
1、手机判断特权证书是否是权限服务机构颁发的。
2、手机判断当前时间是否在特权证书的有效期内。其中,当前时间可以是手机检 测到有APP安装时的时间。
本申请实施例中,由于权限服务机构向APP颁发的特权证书通常是经过数字签名的特权证书,因此,手机判断特权证书是否是权限服务机构颁发的具体可以包括:手机采用权限服务机构的公钥对特权证书进行验签。其中,权限服务机构的公钥可以是手机从权限服务机构的服务器300中获得的。
手机若采用权限服务机构的公钥对特权证书验签成功,则确定该特权证书是权限服务机构颁发的;手机若采用权限服务机构的公钥对特权证书验签失败,则确定该特权证书不是权限服务机构颁发的。需要说明的是,手机对特权证书验签成功时,可以获取到该特权证书的内容;手机对特权证书验签失败时,无法获取到该特权证书的内容。
在本申请的一个实施例中,手机获取到特权证书的内容后,如果检测到特权证书的内容中包括特权证书的有效期,且当前时间在特权证书的有效期内,则说明该特权证书未过期,因此手机可以确定特权证书有效,并执行S74。
在本申请的另一个实施例中,手机获取到特权证书的内容后,如果检测到特权证书的内容中包括特权证书的有效期,且当前时间不在特权证书的有效期内,则说明该特权证书已过期,因此手机可以确定特权证书无效,并执行S76。
在本申请的又一个实施例中,手机获取到特权证书的内容后,如果检测到特权证书的内容中不包括特权证书的有效期,则手机确定当前时间在特权证书的有限期内,即确定特权证书有效,并执行S74。
在本申请的再一个实施例中,手机确定特权证书不是权限服务机构颁发的时,确定特权证书无效,并执行S76。
S74:手机判断特权证书中是否包含应用程序在运行时需要申请的所有特殊权限。
由于特权证书用于记录允许被APP在运行时申请的特殊权限,即包含在特权证书中的特殊权限是允许被APP在运行时申请的特殊权限,而未包含在特权证书中的特殊权限是不允许被APP在运行时申请的特殊权限。因此,手机确定APP的安装包中的特权证书有效后,判断该特权证书中是否包含该APP在运行时需要申请的所有特殊权限。
在本申请的一个实施例中,手机确定APP在运行时需要申请的特殊权限中至少有一个特殊权限未包含在该APP的特权证书中时,执行S75。
在本申请的另一个实施例中,手机确定APP在运行时需要申请的所有特殊权限均包含在该APP的特权证书中时,即完成对APP的安装包的查验,此时手机执行S77。
S75:手机将应用程序在运行时需要申请的特殊权限中未包含在特权证书中的特殊权限设置为不可用状态。
本申请实施例中,手机将APP在运行时需要申请的权限中未包含在特权证书中的特殊权限设置为不可用状态后,该APP在运行时便无法申请处于不可用状态的特殊权限,进而无法获取到处于不可用状态的特殊权限所管控的数据,如此能够提高终端系统的安全性,降低用户的隐私数据被泄露的风险。
其中,上述未包含在特权证书中的特殊权限可以是APP在运行时需要申请的所有特殊权限,也可是APP在运行时需要申请的特殊权限中的部分特殊权限。
在本申请的一个实施例中,手机将APP在运行时需要申请的权限中未包含在特权证书中的特殊权限设置为不可用状态具体可以包括:
手机从APP在运行时需要申请的权限中删除未包含在特权证书中的特殊权限。
需要说明的是,APP在运行时需要申请的权限中未被删除的权限为允许被APP在运行时申请的权限。其中,未被删除的权限可以包括普通权限和/或特殊权限。
本实施例中,手机从APP在运行时需要申请的权限中删除了未包含在特权证书中的特殊权限后,可以仅显示APP在运行时需要申请的权限中未被删除的权限,并示意上述未被删除的权限为允许被APP在运行时申请的权限。
在一个示例中,如图11中的(a)所示,若第一APP805在运行时需要申请的权限包括:通知权限、位置权限、音量调节权限、麦克风权限及相机权限。其中,通知权限和音量调节权限为普通权限,位置权限、麦克风权限及相机权限为特殊权限,且位置权限包含在特权证书中,而麦克风权限和相机权限未包含在特权证书中,则手机从第一APP805在运行时需要申请的权限中删除了麦克风权限和相机权限后,可以显示如图11中的(a)所示的界面,该界面仅显示有允许被第一APP805在运行时申请的通知权限、位置权限及音量调节权限。
在另一个示例中,如图11中的(b)所示,若第一APP805在运行时需要申请的上述所有特殊权限(位置权限、麦克风权限及相机权限)均未包含在特权证书中,则手机从第一APP805在运行时需要申请的权限中删除了上述所有特殊权限后,可以显示如图11中的(b)所示的界面,该界面仅显示有允许被第一APP805在运行时申请的通知权限和音量调节权限。
在本申请的另一个实施例中,手机将APP在运行时需要申请的权限中未包含在特权证书中的特殊权限设置为不可用状态具体可以包括:
手机对APP在运行时需要申请的权限中未包含在特权证书中的特殊权限进行标记。
需要说明的是,APP在运行时需要申请的权限中,被标记了的特殊权限为不允许被APP在运行时申请的特殊权限;未被标记的权限为允许被APP在运行时申请的权限。其中,未被标记的权限可以包括普通权限和/或特殊权限。
本实施例中,手机对APP在运行时需要申请的权限中未包含在特权证书中的特殊权限进行标记后,可以将APP在运行时需要申请的权限中被标记的特殊权限和未被标记的权限均进行显示,并示意上述未被标记的权限为允许被APP在运行时申请的权限,上述被标记的特殊权限为不允许被APP在运行时申请的权限。
在一个示例中,如图11中的(c)所示,若第一APP805在运行时需要申请的权限包括:通知权限、位置权限、音量调节权限、麦克风权限及相机权限,其中,通知权限和音量调节权限为普通权限,位置权限、麦克风权限及相机权限为特殊权限,且位置权限包含在特权证书中,而麦克风权限和相机权限未包含在特权证书中,则手机对第一APP805在运行时需要申请的权限中的麦克风权限和相机权限进行标记后,可以显示如图11中的(c)所示的界面,该界面中显示有允许被第一APP805在运行时申请的通知权限、位置权限及音量调节权限,也显示有不允许被第一APP805在运行时申请的麦克风权限和相机权限。
在又一个示例中,如图11中的(d)所示,若第一APP805在运行时需要申请的 上述所有特殊权限(位置权限、麦克风权限及相机权限)均未包含在特权证书中,则手机对第一APP805在运行时需要申请的上述所有特殊权限均进行标记后,可以显示如图11中的(d)所示的界面,该界面显示有允许被第一APP805在运行时申请的通知权限和音量调节权限,也显示有不允许被第一APP805在运行时申请的所有特殊权限(位置权限、麦克风权限及相机权限)。
本申请实施例中,手机将APP在运行时需要申请的权限中未包含在特权证书中的特殊权限设置为不可用状态后,即完成对APP的安装包的查验,此时手机执行S77。
S76:手机将应用程序在运行时需要申请的权限中的所有特殊权限均设置为不可用状态。
需要说明的是,S76与S75中的APP在运行时需要申请的所有特殊权限均未包含在特权证书中的情况类似,具体请参照S75中的APP在运行时需要申请的所有特殊权限均未包含在特权证书中的情况对应的相关描述,此处不再赘述。
本申请实施例中,手机将APP在运行时需要申请的权限中的所有特殊权限均设置为不可用状态后,即完成对APP的安装包的查验,此时手机执行S77。
S77:手机继续安装应用程序。
在本申请的一个实施例中,手机完成对APP的安装包的查验后,可以在检测到用户指示继续安装APP的操作后,再继续安装APP。
示例性的,如图12所示,若第一APP805在运行时需要申请的所有特殊权限(位置权限、麦克风权限及相机权限)均未包含在特权证书中,则手机将第一APP805在运行时需要申请的上述所有特殊权限均设置为不可用状态后,可以显示如图12中的(a)所示的界面。手机在检测到用户点击图12中的(a)所示的界面中的继续安装控件121时,确定检测到用户指示继续安装APP的操作,手机继续安装第一APP805,并显示如图12中的(b)所示的界面。
在本申请的另一个实施例中,手机完成对APP的安装包的查验后,可以自动继续安装APP。
示例性的,如图12中的(b)所示,若第一APP805在运行时需要申请的所有特殊权限(位置权限、麦克风权限及相机权限)均未包含在特权证书中,则手机将第一APP805在运行时需要申请的上述所有特殊权限均设置为不可用状态后,可以自动继续安装第一APP805,并直接显示如图12中的(b)所示的界面。
本申请实施例中,手机执行了上述S77,使得APP安装成功后,手机在检测到用户指示运行该APP的操作时,运行该APP,该APP在运行时可以针对其权限配置文件中未被设置为不可用状态的权限提出权限申请。
需要说明的是,对于基于本申请提供的权限管理机制开发的APP,该APP在运行时通常不会对其权限配置文件中被设置为不可用状态的权限进行提出申请。
在本申请的一个实施例中,手机在运行APP时,若检测到该APP申请的第一权限为该APP的权限配置文件中未被设置为不可用状态的权限,且第一权限的类型为需要终端设备授权的权限,则手机可以直接授权该APP第一权限,使得该APP拥有第一权限,这样该APP便可以调用第一权限所管控的API来实现相应功能。
在本申请的另一个实施例中,手机在运行APP时,若检测到该APP申请的第一 权限为该APP的权限配置文件中未被设置为不可用状态的权限,且第一权限的类型为需要用户授权的权限,则手机可以显示针对第一权限的授权请求,该授权请求用于确认用户是否允许授予该APP第一权限。手机可以在检测到用户指示允许授予该APP第一权限的操作时,授予该APP第一权限;手机可以在检测到用户指示不允许授予该APP第一权限的操作时,不授予该APP第一权限。
作为示例而非限定,手机显示针对第一权限的授权请求可以包括:手机在该APP的显示界面显示提示框,在该提示框中显示针对第一权限的授权请求。
示例性的,如图13所示,当手机检测到用户点击图13中的(a)所示的界面中的第一APP805的图标时,确认检测到用户指示运行第一APP805的操作,手机运行第一APP805,显示如图13中的(b)所示的界面。手机在运行第一APP805时,如果检测到第一APP805申请音量调节权限,由于音量调节权限的类型为需要终端设备授权的权限,因此,手机可以直接授予第一APP805音量调节权限,如此第一APP805便拥有了音量调节权限,第一APP805便可以调用音量调节权限所管控的API来实现音量调节功能。
手机在运行第一APP805时,如果检测到第一APP805申请通知权限,由于通知权限为需要用户授权的权限,因此,手机可以在第一APP805的显示界面显示如图13中的(c)所示的提示框132,提示框132中显示有针对通知权限的授权请求133、第一控件134及第二控件135,其中,第一控件134用于供用户拒绝上述授权请求,第二控件135用于供用户同意上述授权请求。手机检测到用户点击图13中的(c)所示的第一控件134时,确定检测到用户指示不允许授予第一APP805通知权限的操作,则手机不授予第一APP805通知权限,如此第一APP805便无法拥有通知权限,无法实现通知功能;手机检测到用户点击图13中的(c)所示的第二控件135时,确定检测到用户指示允许授予第一APP805通知权限的操作,则手机授予第一APP805通知权限,如此第一APP805便拥有了通知权限,第一APP805便可以调用通知权限所管控的API来实现通知功能。
本实施例中,由于仅允许APP在运行时申请其权限配置文件中未被设置为不可用状态的特殊权限,而不允许APP在运行时申请其权限配置文件中被设置为不可用状态的特殊权限,因此,手机在运行某个APP时,只会针对该APP的权限配置文件中未被设置为不可用状态,且类型为需要用户授权的权限显示提示框,相对于现有的权限管理方法针对APP的权限配置文件中的所有类型为需要用户授权的权限均显示提示框而言,能够减小提示框显示操作对APP运行进程的影响。
本申请实施例中,手机授予了该APP第一权限后,当检测到该APP调用第一权限所管控的API时,手机可以向该APP返回该权限所管控的数据,该数据为第一权限所管控的服务对应的真实数据,从而可以使应用程序获取到第一权限所管控的服务。
示例性的,假如手机授予了第一APP位置权限,则当第一APP调用位置权限所管控的API时,手机可以将当前通过定位系统获取到的定位信息返回给该APP。
在本申请的又一个实施例中,对于已经上架的基于传统的权限管理机制开发的APP,这类APP在运行时,可能会对其权限配置文件中被设置为不可用状态的特殊权限进行申请,如果此类APP在运行时获取不到其上架时权限配置文件中记录的某个特 殊权限所管控的数据,则该APP可能会发生闪退等异常情况,进而导致该APP无法正常运行。
因此,为了避免上述情况的发生,提高终端系统的兼容性,手机在安装此类APP时,如果采用上述S71~S76对该APP的安装包进行查验,且在查验时将此类APP的权限配置文件中的至少一个特殊权限设置为不可用状态,则手机在执行了上述S71~S76之后,在执行S77之前,还可以执行图7中的S78,详述如下:
S78:手机在应用程序的安装包中建立不可用权限列表,并将该应用程序在运行时需要申请的权限中被设置为不可用状态的权限记录在不可用权限列表中。
其中,APP在运行时需要申请的权限即为APP上架时记录在该APP的权限配置文件中的权限。
基于此,当该APP安装成功后,手机还可以执行图7中的S79~S80,详述如下:
S79:手机运行应用程序时,若检测到该应用程序申请第一特殊权限,且第一特殊权限包含在不可用权限列表中,则手机授予应用程序第一特殊权限。
S80:手机在检测到应用程序调用第一特殊权限所管控的API时,向该应用程序返回预设数据。
其中,预设数据可以是空数据,也可以是假数据。假数据可以是手机随机生成的不同于第一权限所管控的数据的数据。这样,不仅可以避免该APP在运行时发生异常,还可以降低被设置为不可用状态的特殊权限所管控的数据被泄露的风险,提高了系统的安全性。
示例性的,手机在运行第二APP时,如果检测到第二APP申请位置权限,且位置权限包含在第二APP的安装包中的不可用权限列表中,则手机可以先授予第二APP位置权限。手机可以在第二APP调用位置权限所管控的API时,向第二APP返回一个空数据;或者手机可以在第二APP调用位置权限所管控的API时,随机生成一个不同于其当前通过定位系统获得的定位信息的假数据,将该假数据返回至第二APP。
例如,手机可以在检测到用户点击如图14中的(a)所示的票务APP的地址选择界面中的出发地控件141时,确定检测到该票务APP调用位置权限所管控的API,手机可以显示如图14中的(b)所示的界面,以向用户示意当前正在定位。手机如果通过定位系统确定手机当前的定位城市为北京,则手机可以向票务APP返回一个定位信息为上海的位置数据,同时,手机可以在如图14中的(c)所示的出发地选择界面的定位框142中显示手机当前的定位城市为上海。
由于手机向APP返回空数据或假数据后,可能会影响用户对该APP的使用体验。因此,为了提高用户对APP的使用体验,在本申请的又一个实施例中,手机向APP返回空数据或假数据后,还可以在APP的显示界面显示第一提示信息,该第一提示信息用于提示用户该APP当前获取到的与第一特殊权限相关的数据(即预设数据)不准确。
示例性的,如图14中的(d)所示,手机在出发地选择界面的定位框142中显示手机当前的定位城市为上海后,还可以在出发地选择界面显示一提示框143,并在该提示框143中显示例如“当前定位城市不准确”的第一提示信息,以提示用户当前定位信息不准确。
由于特殊权限通常为涉及终端设备的系统安全和/或用户的隐私数据的权限,因此,当APP申请的上述第一特殊权限为涉及用户的隐私数据的权限时,可以由用户决定是否允许手机向该APP返回该第一特殊权限所管控的数据。
本申请实施例中,为了使手机能够识别出第一特殊权限是否为涉及用户的隐私数据的权限,可以预先在第一权限列表中对涉及用户的隐私数据的权限的标识进行标记。手机可以根据第一特殊权限的标识是否在第一权限列表中被标记,来识别第一特殊权限是否为涉及用户的隐私数据的权限。具体的,手机如果检测到第一特殊权限的标识在第一权限列表中被标记,则确定第一特殊权限为涉及用户的隐私数据的权限;手机如果检测到第一特殊权限的标识未在第一权限列表中被标记,则确定第一特殊权限为不涉及用户的隐私数据的权限。
在本申请的一个实施例中,手机在APP的显示界面显示第一提示信息的同时,或者手机在APP的显示界面显示第一提示信息之后,如果检测到第一特殊权限为涉及用户的隐私数据的权限,则手机还可以在该APP的显示界面显示第二提示信息,该第二提示信息用于确认用户是否允许手机向该APP返回第一特殊权限所管控的数据。
示例性的,如图14中的(e)所示,手机可以在出发地选择界面显示一提示框144,并在提示框144中显示例如“是否允许票务APP获取准确位置”的第二提示信息。其中,提示框144还包括第三控件145和第四控件146。手机在检测到用户点击第三控件145时,确认检测到用户指示允许手机向该APP返回第一特殊权限所管控的数据的操作;手机在检测到用户点击第四控件146时,确认检测到用户指示不允许手机向该APP返回第一特殊权限所管控的数据的操作。
在本实施例的一种实现方式中,手机在检测到用户指示允许手机向该APP返回第一特殊权限所管控的数据的操作时,可以将第一特殊权限设置为可用状态,并将第一特殊权限从所述不可用权限列表中移除。之后,当该APP再次调用第一特殊权限所管控的API时,手机可以向该APP返回第一特殊权限所管控的数据。
本实施例中,当APP申请的第一特殊权限为涉及用户的隐私数据的权限时,由于可以由用户决定是否允许向该APP返回第一特殊权限所管控的数据,因此,不仅可以降低用户的隐私数据被泄露的风险,还可以提高用户对该APP的使用体验。且由于手机可以在APP调用第一特殊权限所管控的API时提示用户是否允许向该APP返回第一特殊权限所管控的数据,因此,方便用户对第一特殊权限进行即时性的管理。
在本申请的另一个实施例中,用户还可以在APP的权限设置界面中对该APP的不可用权限列表中包含的涉及用户的隐私数据的特殊权限的使用状态进行设置。
具体的,手机检测到用户指示打开APP的权限设置界面的操作时,手机可以显示该APP的权限设置界面。该权限设置界面中可以显示有APP的权限配置文件中未被设置为不可用状态的权限以及该APP的不可用权限列表中包含的特殊权限。
其中,权限设置界面显示的上述未被设置为不可用状态的权限的使用状态为可用状态,权限设置界面中显示的APP的不可用权限列表中包含的特殊权限的使用状态为不可用状态。需要说明的是,可用状态用于表示该权限可以被该APP在运行时申请,且该APP调用该权限所管控的API时,手机会向该APP返回该权限所管控的数据;不可用状态用于表示该权限不允许被该APP在运行时申请,或该APP在申请该权限 时,手机会向该APP返回空数据或假数据。
且权限设置界面显示的上述未被设置为不可用状态的权限的设置状态以及上述APP的不可用权限列表中包含的涉及用户的隐私数据的特殊权限的设置状态均为第一状态,权限设置界面显示的上述APP的不可用权限列表中包含的不涉及用户的隐私数据的特殊权限的设置状态均为第二状态。其中,第一状态用于表示该权限的使用状态可被用户设置;第二状态用于表示该权限的使用状态不可被用户设置。
示例性的,如图15中的(a)所示,手机可以将第一APP的权限配置文件中未被标记为不可用状态的权限显示在权限设置界面中的“已允许”栏中,“已允许”栏中包括的各个权限的使用状态均为可用状态。手机可以将第一APP的不可用权限列表中包含的所有特殊权限显示在权限设置界面中的“已禁止”栏中,“已禁止”栏中包括的各个权限的使用状态均为不可用状态。示例性的,手机可以将不可用状态的权限置灰。
更进一步的,手机可以将第一APP的不可用权限列表中涉及用户的隐私数据的特殊权限显示在“已禁止”栏的“可设置”栏中,将第一APP的不可用权限列表中不涉及用户的隐私数据的特殊权限显示在“已禁止”栏的“不可设置”栏中。其中,“已允许”栏和“可设置”栏中包括的各个权限的设置状态为第一状态,“不可设置”栏中包括的各个权限的设置状态为第二状态。如图15中的(a)所示,手机可以在权限设置界面中针对每个设置状态为第一状态的权限均显示一个设置控件151。用户可以通过点击设置控件151来实现对权限的使用状态的设置。
基于此,用户可以对“已允许”栏和“可设置”栏中包括的各个权限的使用状态进行设置。示例性的,手机在检测到用户点击如图15中的(a)所示的位置权限对应的设置控件151时,可以显示如图15中的(b)所示的显示界面。手机在检测到用户点击如图15中的(b)所示的允许控件152时,确定检测到用户指示将位置权限设置为可用状态的操作,手机将位置权限设置为可用状态,且手机可以从该第一APP的不可用权限列表中删除位置权限。当手机返回第一APP的权限设置界面时,如图15中的(c)所示,手机可以将位置权限显示在“已允许”栏中。如此,第一APP在调用位置权限所管控的API时,手机可以向该第一APP返回位置权限所管控的数据。
上述实施例中,用户可以根据自身需求对第一APP的一个或多个权限的使用状态进行设置,从而能够提高用户对第一APP的使用体验。
在本申请的又一个实施例中,手机在APP的测试阶段安装该APP时,为了使该APP的开发者能够及时获知该APP的缺陷,手机可以在确定以下几种情况时停止安装该APP:
1、手机确定该APP在运行时需要申请的一个或多个权限包括特殊权限,但该APP的安装包中不包含特权证书时,停止安装该APP;
2、手机确定APP在运行时需要申请的一个或多个权限包括特殊权限,且该APP的安装包中包含特权证书,但该特权证书无效时,停止安装该APP;
3、手机确定APP在运行时需要申请的一个或多个权限包括特殊权限,且该APP的安装包中包含特权证书,且该特权证书有效,但APP在运行时需要申请的权限中至少有一个特殊权限未包含在上述特权证书中时,停止安装该APP。
手机停止安装APP时,还可以显示一个用于提示APP安装失败的原因的第三提示信息,以便APP的开发者获知APP安装失败的原因。例如,该第三提示信息可以为“权限配置文件中包含不被允许申请的特殊权限”。
上述实施例中,应用程序在测试环境下安装时,在上述三种情况下,可以通过停止安装应用程序和/或输出第三提示信息来提示用户需要向权限服务机构申请应用程序对特殊权限的申请权,从而便于开发者对应用程序存在的漏洞进行修复。
可以理解的是,终端设备为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请实施例可以根据上述方法示例对终端设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块可以采用硬件的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
在采用对应各个功能划分各个功能模块的情况下,图16示出了上述实施例中涉及的终端设备100的一种可能的结构示意图,如图16所示,该终端设备100可以包括:第一获取单元161和安装控制单元162等。
其中,第一获取单元161可以用于支持终端设备100执行上述S71,和/或用于文本所描述的技术的其他过程。
安装控制单元162可以用于支持终端设备100执行上述S72~S77,和/或用于文本所描述的技术的其他过程。
在一种可能的实现方式中,终端设备100还可以包括:列表创建单元和列表修改单元。
列表创建单元和列表修改单元用于支持终端设备100执行上述S78,和/或用于文本所描述的技术的其他过程。
在一种可能的实现方式中,终端设备100还可以包括:授权控制单元。
授权控制单元用于支持终端设备100执行上述S79,和/或用于文本所描述的技术的其他过程。
在一种可能的实现方式中,终端设备100还可以包括:数据处理单元。
数据处理单元用于支持终端设备100执行上述S80,和/或用于文本所描述的技术的其他过程。
本申请实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在终端设备上运行时,使得终端设备执行上述相关方法步骤实现上述实施例中的权限管理方法。
本申请实施例还提供一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的权限管理方法。
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的权限管理方法。
其中,本申请实施例提供的终端设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (23)

  1. 一种权限管理方法,其特征在于,包括:
    当检测到有应用程序安装时,获取所述应用程序在运行时需要申请的一个或多个权限;
    若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中未包含特权证书,则将所述特殊权限设置为不可用状态,并继续安装所述应用程序;所述特权证书用于记录允许所述应用程序在运行时申请的特殊权限。
  2. 根据权利要求1所述的方法,其特征在于,所述获取所述应用程序在运行时需要申请的一个或多个权限之后,所述方法还包括:
    若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权证书,且所述特权证书为无效的特权证书,则将所述一个或多个权限包括的所述特殊权限设置为不可用状态,并继续安装所述应用程序。
  3. 根据权利要求1所述的方法,其特征在于,所述获取所述应用程序在运行时需要申请的一个或多个权限之后,所述方法还包括:
    若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权证书,且所述特权证书为有效的特权证书,且所述一个或多个权限包括的所述特殊权限中至少有一个特殊权限未包含在所述特权证书中,则将未包含在所述特权证书中的所述特殊权限设置为不可用状态,并继续安装所述应用程序。
  4. 根据权利要求1所述的方法,其特征在于,所述获取所述应用程序在运行时需要申请的一个或多个权限之后,所述方法还包括:
    若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权证书,且所述特权证书为有效的特权证书,且所述一个或多个权限包括的所述特殊权限均包含在所述特权证书中,则继续安装所述应用程序。
  5. 根据权利要求1所述的方法,其特征在于,所述获取所述应用程序在运行时需要申请的一个或多个权限之后,所述方法还包括:
    若所述一个或多个权限不包括特殊权限,则继续安装所述应用程序。
  6. 根据权利要求1至5任一项所述的方法,其特征在于,所述继续安装所述应用程序之后,所述方法还包括:
    在运行所述应用程序时,若检测到所述应用程序申请的第一权限为所述一个或多个权限中未被设置为不可用状态的权限,且所述第一权限的类型为需要终端设备授权的权限,则授予所述应用程序所述第一权限。
  7. 根据权利要求1至5任一项所述的方法,其特征在于,所述继续安装所述应用程序之后,所述方法还包括:
    在运行所述应用程序时,若检测到所述应用程序申请的第一权限为所述一个或多个权限中未被设置为不可用状态的权限,且所述第一权限的类型为需要用户授权的权限,则显示针对所述第一权限的授权请求;所述授权请求用于确认用户是否允许授予所述应用程序所述第一权限;
    若检测到用户指示允许授予所述应用程序所述第一权限的操作,则授予所述应用程序所述第一权限。
  8. 根据权利要求7所述的方法,其特征在于,所述显示针对所述第一权限的授权请求之后,所述方法还包括:
    若检测到用户指示不允许授予所述应用程序所述第一权限的操作,则不授予所述应用程序所述第一权限。
  9. 根据权利要求6或7所述的方法,其特征在于,所述授予所述应用程序所述第一权限之后,所述方法还包括:
    若检测到所述应用程序调用所述第一权限所管控的应用程序编程接口,则向所述应用程序返回所述第一权限所管控的数据。
  10. 根据权利要求1至5任一项所述的方法,其特征在于,在将所述特殊权限设置为不可用状态之后,在所述继续安装所述应用程序之前,所述方法还包括:
    在所述应用程序的安装包中建立不可用权限列表;
    将所述一个或多个权限包括的特殊权限中被设置为所述不可用状态的特殊权限记录在所述不可用权限列表中。
  11. 根据权利要求10所述的方法,其特征在于,所述继续安装所述应用程序之后,所述方法还包括:
    在运行所述应用程序时,若检测到所述应用程序申请的第一特殊权限包含在所述不可用权限列表中,则授予所述应用程序所述第一特殊权限;
    当检测到所述应用程序调用所述第一特殊权限所管控的应用程序编程接口时,向所述应用程序返回预设数据;所述预设数据包括空数据或假数据,所述假数据为不同于所述第一特殊权限所管控的数据的数据。
  12. 根据权利要求11所述的方法,其特征在于,所述向所述应用程序返回预设数据之后,所述方法还包括:
    在所述应用程序的显示界面显示第一提示信息;所述第一提示信息用于提示用户所述应用程序获取到的与所述第一特殊权限相关的数据不准确。
  13. 根据权利要求11所述的方法,其特征在于,所述向所述应用程序返回预设数据之后,所述方法还包括:
    若所述第一特殊权限为涉及用户的隐私数据的权限,则在所述应用程序的显示界面显示第二提示信息;所述第二提示信息用于确认用户是否允许向所述应用程序返回所述第一特殊权限所管控的数据。
  14. 根据权利要求13所述的方法,其特征在于,所述在所述应用程序的显示界面显示第二提示信息之后,所述方法还包括:
    若检测到用户指示允许向所述应用程序返回所述第一特殊权限所管控的数据的操作,则将所述第一特殊权限设置为可用状态,并将所述第一特殊权限从所述不可用权限列表中移除。
  15. 根据权利要求14所述的方法,其特征在于,所述将所述第一特殊权限设置为可用状态之后,所述方法还包括:
    若检测到所述应用程序调用所述第一特殊权限所管控的应用程序编程接口,则向所述应用程序返回所述第一特殊权限所管控的数据。
  16. 根据1至15任一项所述的方法,其特征在于,所述继续安装所述应用程序后,所述方法还包括:
    显示所述应用程序的权限设置界面;所述权限设置界面显示有所述一个或多个权限中未被设置为所述不可用状态的权限以及所述应用程序的不可用权限列表中包含的特殊权限,所述未被设置为所述不可用状态的权限的使用状态为可用状态,所述应用程序的不可用权限列表中包含的特殊权限的使用状态为不可用状态;且所述未被设置为所述不可用状态的权限的设置状态为第一状态,所述应用程序的不可用权限列表中包含的涉及用户的隐私数据的特殊权限的设置状态为第一状态,所述应用程序的不可用权限列表中包含的不涉及用户的隐私数据的特殊权限的设置状态为第二状态;所述第一状态用于表示权限的使用状态可被用户设置,所述第二状态用于表示权限的使用 状态不可被用户设置。
  17. 根据权利要求1所述的方法,其特征在于,所述应用程序在测试环境下安装时,所述获取所述应用程序在运行时需要申请的一个或多个权限之后,所述方法还包括:
    若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中未包含特权证书,则停止安装所述应用程序。
  18. 根据权利要求1所述的方法,其特征在于,所述应用程序在测试环境下安装时,所述获取所述应用程序在运行时需要申请的一个或多个权限之后,所述方法还包括:
    若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权证书,且所述特权证书为无效的特权证书,则停止安装所述应用程序。
  19. 根据权利要求1所述的方法,其特征在于,所述应用程序在测试环境下安装时,所述获取所述应用程序在运行时需要申请的一个或多个权限之后,所述方法还包括:
    若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中包含所述特权证书,且所述特权证书为有效的特权证书,且所述一个或多个权限包括的所述特殊权限中至少有一个特殊权限未包含在所述特权证书中,则停止安装所述应用程序。
  20. 根据权利要求17至18任一项所述的方法,其特征在于,所述停止安装所述应用程序之后,所述方法还包括:
    在所述应用程序的显示界面显示第三提示信息;所述第三提示信息用于提示所述应用程序安装失败的原因。
  21. 一种终端设备,其特征在于,包括:
    第一获取单元,用于当检测到有应用程序安装时,获取所述应用程序在运行时需要申请的一个或多个权限;
    安装控制单元,用于若所述一个或多个权限包括特殊权限,且所述应用程序的安装包中未包含特权证书,则将所述特殊权限设置为不可用状态,并继续安装所述应用程序;所述特权证书用于记录允许所述应用程序在运行时申请的特殊权限。
  22. 一种终端设备,其特征在于,包括:至少一个处理器;至少一个存储器;其中,所述至少一个存储器中存储有计算机指令,当所述计算机指令被所述至少一个处理器执行时,使得所述终端设备执行如权利要求1至20任一项所述的权限管理方法。
  23. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在终端设备上运行时,所述终端设备执行如权利要求1至20任一项所述的权限管理方法。
PCT/CN2021/108199 2020-07-31 2021-07-23 一种权限管理方法及终端设备 WO2022022422A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US18/007,425 US20230297700A1 (en) 2020-07-31 2021-07-23 Permission Management Method and Terminal Device
EP21849627.1A EP4181003A4 (en) 2020-07-31 2021-07-23 PERMISSION MANAGEMENT METHOD AND TERMINAL DEVICE

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010765594.0A CN114065229A (zh) 2020-07-31 2020-07-31 一种权限管理方法及终端设备
CN202010765594.0 2020-07-31

Publications (1)

Publication Number Publication Date
WO2022022422A1 true WO2022022422A1 (zh) 2022-02-03

Family

ID=80037592

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/108199 WO2022022422A1 (zh) 2020-07-31 2021-07-23 一种权限管理方法及终端设备

Country Status (4)

Country Link
US (1) US20230297700A1 (zh)
EP (1) EP4181003A4 (zh)
CN (2) CN114741720B (zh)
WO (1) WO2022022422A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114692093A (zh) * 2022-05-27 2022-07-01 荣耀终端有限公司 一种应用程序安装方法及电子设备
CN116049809A (zh) * 2022-06-14 2023-05-02 荣耀终端有限公司 一种驱动调用方法和设备

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116049799B (zh) * 2022-07-14 2023-11-07 荣耀终端有限公司 系统权限管理方法、系统及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130055377A1 (en) * 2011-08-31 2013-02-28 Lenovo (Singapore) Pte. Ltd. Providing selective system privileges on an information handling device
CN105354489A (zh) * 2015-10-29 2016-02-24 小米科技有限责任公司 权限授予方法及装置
CN107169320A (zh) * 2017-04-20 2017-09-15 北京小米移动软件有限公司 校验方法及装置
CN109076126A (zh) * 2017-03-21 2018-12-21 华为技术有限公司 权限更新方法和终端设备

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1898624A (zh) * 2003-12-24 2007-01-17 皇家飞利浦电子股份有限公司 在使用授权证书时维护私密性
US9009856B2 (en) * 2011-12-16 2015-04-14 Dell Products L.P. Protected application programming interfaces
CN103858130A (zh) * 2013-08-23 2014-06-11 华为终端有限公司 管理权限方法、装置及终端
SG10201509221YA (en) * 2015-11-06 2017-06-29 Huawei Int Pte Ltd System and method for managing installation of an application package requiring high-risk permission access
US10749690B2 (en) * 2017-03-10 2020-08-18 Samsung Electronics Co., Ltd. System and method for certificate authority for certifying accessors

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130055377A1 (en) * 2011-08-31 2013-02-28 Lenovo (Singapore) Pte. Ltd. Providing selective system privileges on an information handling device
CN105354489A (zh) * 2015-10-29 2016-02-24 小米科技有限责任公司 权限授予方法及装置
CN109076126A (zh) * 2017-03-21 2018-12-21 华为技术有限公司 权限更新方法和终端设备
CN107169320A (zh) * 2017-04-20 2017-09-15 北京小米移动软件有限公司 校验方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4181003A4

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114692093A (zh) * 2022-05-27 2022-07-01 荣耀终端有限公司 一种应用程序安装方法及电子设备
CN114692093B (zh) * 2022-05-27 2022-10-25 荣耀终端有限公司 一种应用程序安装方法及电子设备
CN116049809A (zh) * 2022-06-14 2023-05-02 荣耀终端有限公司 一种驱动调用方法和设备
CN116049809B (zh) * 2022-06-14 2023-11-07 荣耀终端有限公司 一种驱动调用方法和设备

Also Published As

Publication number Publication date
EP4181003A4 (en) 2023-11-29
EP4181003A1 (en) 2023-05-17
CN114741720B (zh) 2023-03-24
CN114741720A (zh) 2022-07-12
US20230297700A1 (en) 2023-09-21
CN114065229A (zh) 2022-02-18

Similar Documents

Publication Publication Date Title
WO2020182065A1 (zh) 快捷功能启动的方法及电子设备
WO2020150917A1 (zh) 一种应用权限的管理方法及电子设备
WO2022022422A1 (zh) 一种权限管理方法及终端设备
WO2020238728A1 (zh) 智能终端的登录方法及电子设备
EP4063203A1 (en) Authentication method and medium and electronic apparatus thereof
CN113581127B (zh) 一种业务处理方法及设备
WO2021253975A1 (zh) 应用程序的权限管理方法、装置和电子设备
WO2022160991A1 (zh) 权限控制方法和电子设备
WO2020107463A1 (zh) 一种电子设备的控制方法及电子设备
WO2022089121A1 (zh) 处理推送消息的方法和装置
WO2021057982A1 (zh) 应用程序的处理方法及相关产品
CN111859418A (zh) 原子能力调用方法及终端设备
WO2022253158A1 (zh) 一种用户隐私保护方法及装置
WO2022111469A1 (zh) 一种文件共享方法、装置及电子设备
WO2023284555A1 (zh) 安全调用服务的方法、安全注册服务的方法及装置
CN114692119A (zh) 校验应用的方法和电子设备
WO2024061326A1 (zh) 一种数据保护方法及电子设备
US20240135033A1 (en) Access control method, electronic device, and system
CN115202559A (zh) 权限管理方法及相关设备
CN114692132A (zh) 应用程序管控方法、装置、电子设备及可读存储介质
CN115114618A (zh) 应用处理方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21849627

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021849627

Country of ref document: EP

Effective date: 20230209

NENP Non-entry into the national phase

Ref country code: DE