CN104346559A - Authority request response method and device thereof - Google Patents
Authority request response method and device thereof Download PDFInfo
- Publication number
- CN104346559A CN104346559A CN201410696530.4A CN201410696530A CN104346559A CN 104346559 A CN104346559 A CN 104346559A CN 201410696530 A CN201410696530 A CN 201410696530A CN 104346559 A CN104346559 A CN 104346559A
- Authority
- CN
- China
- Prior art keywords
- permission
- permission request
- authentication list
- communication
- feature
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/30—Authentication, i.e. establishing the identity or authorisation of security principals
- G06F21/45—Structures or tools for the administration of authentication
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Telephonic Communication Services (AREA)
Abstract
本发明以Android应用场景为例,公开一种权限请求响应方法,包括以下步骤:启动属于系统级别的通信接口,通过该通信接口监听外部权限请求;依据该权限请求获得请求方的特征标识,在预置的认证列表中检索该特征标识是否处于被允许的状态;当该特征标识为被允许状态时,为该权限请求向系统申请权限。借助本发明所实现的权限请求管理功能,具有通信快速高效、技术安全可靠的特点。
Taking the Android application scene as an example, the present invention discloses a permission request response method, which includes the following steps: starting a communication interface belonging to the system level, and monitoring external permission requests through the communication interface; obtaining the characteristic identification of the requesting party according to the permission request, and then Check whether the feature identifier is in the allowed state from the preset authentication list; when the feature identifier is in the allowed state, apply for permission to the system for the permission request. The authority request management function realized by means of the present invention has the characteristics of fast and efficient communication, safe and reliable technology.
Description
技术领域technical field
本发明涉及计算机操作系统的权限管理技术,尤其涉及一种权限请求响应方法及相应的装置。The invention relates to the rights management technology of a computer operating system, in particular to a method for responding to a rights request and a corresponding device.
背景技术Background technique
基于Uinux诞生的操作系统,从Linux系列到移动终端的Android操作系统,均存在严格的用户管理机制。其中,以Android为例,系统的最高权限帐号为Root,该帐号的权限也代表着权限管理机制的最高级别,可以启动或停止一个进程,删除或增加用户,增加或禁用硬件等等。移动终端设备出厂时,厂商出于安全因素考虑,一般不向用户开放Root权限。在这种情况下,用户对移动终端设备所进行的系统操作,或者第三方应用例如手机安全软件需要实现某些诸如卸载出厂应用之类的功能时,便会受到阻碍。因此,获取Root权限便变得越来越普遍。Based on the operating system born from Uinux, from the Linux series to the Android operating system of mobile terminals, there are strict user management mechanisms. Among them, taking Android as an example, the highest authority account of the system is Root, and the authority of this account also represents the highest level of the authority management mechanism, which can start or stop a process, delete or add users, add or disable hardware, and so on. When the mobile terminal device leaves the factory, the manufacturer generally does not open the Root authority to the user for security reasons. In this case, when the system operation performed by the user on the mobile terminal device, or when a third-party application such as mobile phone security software needs to implement certain functions such as uninstalling the factory application, it will be hindered. Therefore, obtaining Root privileges has become more and more common.
目前市面上的手机安全软件,例如“360手机助手”,通常配备有针对手机应用而提供的权限管理模块。获得Root权限后,需要进一步加强对权限请求的管理,因便实现对操作系统的安全监控,防止恶意应用随意实现自身目的,例如请求联系人权限、请求手机IMEI权限等,以便做到既给予用户更大的操作自由度,又能够确保技术上的安全性。Mobile phone security software currently on the market, such as "360 Mobile Assistant", is usually equipped with a rights management module for mobile phone applications. After obtaining Root permission, it is necessary to further strengthen the management of permission requests, so as to realize the security monitoring of the operating system and prevent malicious applications from achieving their own purposes at will, such as requesting contact permissions, requesting mobile phone IMEI permissions, etc., so as to give users Greater freedom of operation, but also to ensure technical safety.
现有技术在很大程度上实现了Root权限管理,但是,也存在如下不足:一方面,由于进行权限管理的通信机制利用不善的缘故,导致Root权限管理的效率不高;另一方面,过分依赖于系统的功能,导致权限管理的运行效率不高。Existing technology has realized Root authority management to a large extent, but also has following deficiency: on the one hand, because the communication mechanism that carries out authority management is not utilized well, causes the efficiency of Root authority management not high; On the other hand, excessive Depending on the function of the system, the operating efficiency of rights management is not high.
发明内容Contents of the invention
本发明的目的在于提供一种运行效率较为高效的权限请求响应方法及其相应的装置。The object of the present invention is to provide a permission request response method with relatively high operating efficiency and a corresponding device.
为实现本发明的目的,本发明采取如下技术方案:For realizing the purpose of the present invention, the present invention takes following technical scheme:
本发明提供的一种权限请求响应方法,包括以下步骤:A permission request response method provided by the present invention includes the following steps:
启动属于系统级别的通信接口,通过该通信接口监听外部权限请求;Start the communication interface belonging to the system level, and monitor external permission requests through the communication interface;
依据该权限请求获得请求方的特征标识,在预置的认证列表中检索该特征标识是否处于被允许的状态;Obtain the requester's feature ID according to the permission request, and check whether the feature ID is allowed in the preset authentication list;
当该特征标识为被允许状态时,为该权限请求向系统申请权限。When the feature is identified as being allowed, apply for permission to the system for the permission request.
较佳的,所述系统级别的通信接口,是指基于Android的Binder机制而建立的通信服务进程,用于与发起权限请求的外部应用进程通信。Preferably, the system-level communication interface refers to a communication service process established based on Android's Binder mechanism, which is used to communicate with an external application process that initiates a permission request.
较佳的,所述的特征标识,是指Android系统中的UID,每个UID对应于一个应用。Preferably, the feature identifier refers to a UID in the Android system, and each UID corresponds to an application.
根据本发明一种实施例所揭示,所述预置的认证列表,存储有若干特征标识,特征标识在认证列表中的存在,表征该特征标识为被允许状态。According to an embodiment of the present invention, the preset authentication list stores several feature identifiers, and the presence of a feature identifier in the authentication list indicates that the feature identifier is in an allowed state.
根据本发明另一实施例所揭示,所述预置的认证列表,存储有若干特征标识和对应每个特征标识设置的状态识别字段,当某个特征标识的相应的状态识别字段被设置为表征被允许的符号时,以该符号表征该特征标识为被允许状态。According to another embodiment of the present invention, the preset authentication list stores several feature identifiers and a state identification field corresponding to each feature identifier. When the corresponding state identification field of a certain feature identifier is set to represent When the symbol is allowed, the symbol is used to represent the feature flag as the allowed state.
进一步,当所述特征标识为非被允许状态时,拒绝所述的权限请求。Further, when the feature identification is in a non-allowed state, deny the permission request.
优选地,本方法包括另一步骤:从远程接口获取公共认证列表数据并更新本地的所述认证列表。Preferably, the method comprises the further step of obtaining public authentication list data from a remote interface and updating said authentication list locally.
进一步,当采用该权限请求成功获取Root权限后,绑定发起该权限请求的用户进程与服务进程的通信,服务进程用于响应执行由用户进程请求执行的指令。Further, when the permission request is used to successfully obtain the Root permission, the communication between the user process that initiates the permission request and the service process is bound, and the service process is used to execute the instruction requested by the user process in response.
较佳的,本地的所述认证列表中,设置有用于表征与所述特征标识相对应的用户程序的权限作用周期的类型标识,在向系统申请权限时,对应所述类型标识申请不同类型的权限。Preferably, the local authentication list is provided with a type identifier used to characterize the authorization period of the user program corresponding to the feature identifier, and when applying for authorization to the system, apply for different types of authorization corresponding to the type identifier. authority.
本发明提供的一种权限请求响应装置,其包括:A permission request response device provided by the present invention includes:
通信接口,被以系统级别的方式启动,用于监听外部权限请求;The communication interface is activated at the system level and is used to monitor external permission requests;
检索单元,用于依据该权限请求获得请求方的特征标识,在预置的认证列表中检索该特征标识是否处于被允许的状态;A retrieval unit, configured to obtain the characteristic identifier of the requesting party according to the permission request, and retrieve whether the characteristic identifier is in a permitted state in the preset authentication list;
处理单元,当该特征标识为被允许状态时,用于为该权限请求向系统申请权限。The processing unit is configured to apply for permission to the system for the permission request when the feature identifier is in an allowed state.
具体的,所述通信接口,为基于Android的Binder机制而建立的置于系统级别的通信服务进程,通过与外部应用进程通信获取所述权限请求。Specifically, the communication interface is a system-level communication service process established based on the Android Binder mechanism, and obtains the permission request by communicating with an external application process.
较佳的,所述的特征标识,是指Android系统中的UID,每个UID对应于一个应用。Preferably, the feature identifier refers to a UID in the Android system, and each UID corresponds to an application.
根据本发明的一种实施例所揭示,所述预置的认证列表,用于存储若干特征标识,特征标识在认证列表中的存在,表征该特征标识为被允许状态。According to an embodiment of the present invention, the preset authentication list is used to store several feature identifiers, and the existence of a feature identifier in the authentication list indicates that the feature identifier is allowed.
根据本发明的另一实施例所揭示,所述预置的认证列表,用于存储有若干特征标识和对应每个特征标识设置的状态识别字段,当某个特征标识的相应的状态识别字段被设置为表征被允许的符号时,以该符号表征该特征标识为被允许状态。According to another embodiment of the present invention, the preset authentication list is used to store several feature identifiers and a state identification field corresponding to each feature identifier. When the corresponding state identification field of a certain feature identifier is When it is set as a symbol that is allowed, the symbol is used to represent the feature flag as the allowed state.
进一步,所述处理单元,当所述特征标识为非被允许状态时,用于拒绝所述的权限请求。Further, the processing unit is configured to reject the permission request when the feature identifier is in an unallowed state.
优先地,本发明包括维护单元,用于从远程接口获取公共认证列表数据并更新本地的所述认证列表。Preferably, the present invention comprises a maintenance unit for obtaining public authentication list data from a remote interface and updating said authentication list locally.
进一步,该装置还包括服务进程,当采用该权限请求成功获取Root权限后,与发起该权限请求的用户进程绑定通信,该服务进程用于响应执行由用户进程请求执行的指令。Further, the device also includes a service process, which binds and communicates with the user process that initiates the permission request after the root permission is successfully obtained by using the permission request, and the service process is used to execute instructions requested by the user process in response.
较佳的,本地的所述认证列表中,设置有用于表征与所述特征标识相对应的用户程序的权限作用周期的类型标识,在向系统申请权限时,对应所述类型标识申请不同类型的权限。Preferably, the local authentication list is provided with a type identifier used to characterize the authorization period of the user program corresponding to the feature identifier, and when applying for authorization to the system, apply for different types of authorization corresponding to the type identifier. authority.
相较于现有技术,本发明至少具有如下优点:本发明使用系统级别的通信接口为基础,建立基于外部应用的权限请求的权限管理机制,具有通信快速、成功率高等优点,进一步,通过建立预置的认证列表,可以实现对外部应用的权限请求的独立管理,从技术角度来看,此一认证列表具备类似于防火墙的作用,具有数据集中、运行高效、安全可靠等优点。Compared with the prior art, the present invention has at least the following advantages: the present invention uses a system-level communication interface as the basis to establish a permission management mechanism based on permission requests from external applications, which has the advantages of fast communication and high success rate. Further, by establishing The preset authentication list can realize independent management of permission requests for external applications. From a technical point of view, this authentication list has the function similar to a firewall, and has the advantages of data concentration, efficient operation, safety and reliability.
本发明附加的方面和优点将在下面的描述中部分给出,这些将从下面的描述中变得明显,或通过本发明的实践了解到。Additional aspects and advantages of the invention will be set forth in part in the description which follows, and will become apparent from the description, or may be learned by practice of the invention.
附图说明Description of drawings
本发明上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become apparent and easy to understand from the following description of the embodiments in conjunction with the accompanying drawings, wherein:
图1是本发明的权限请求响应方法的原理框图;Fig. 1 is a functional block diagram of the permission request response method of the present invention;
图2是本发明的权限请求响应装置的原理框图。Fig. 2 is a functional block diagram of the permission request responding device of the present invention.
具体实施方式Detailed ways
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本发明,而不能解释为对本发明的限制。Embodiments of the present invention are described in detail below, examples of which are shown in the drawings, wherein the same or similar reference numerals designate the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the figures are exemplary only for explaining the present invention and should not be construed as limiting the present invention.
本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可包括复数形式。应该进一步理解的是,本发明的说明书中使用的措辞“包括”是指存在所述特征、整数、步骤、操作、元件和/或组件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元件、组件和/或它们的组。应该理解,当我们称元件被“连接”或“耦接”到另一元件时,它可以直接连接或耦接到其他元件,或者也可以存在中间元件。此外,这里使用的“连接”或“耦接”可以包括无线连接或无线耦接。这里使用的措辞“和/或”包括一个或更多个相关联的列出项的全部或任一单元和全部组合。Those skilled in the art will understand that unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the word "comprising" used in the description of the present invention refers to the presence of said features, integers, steps, operations, elements and/or components, but does not exclude the presence or addition of one or more other features, Integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Additionally, "connected" or "coupled" as used herein may include wireless connection or wireless coupling. The expression "and/or" used herein includes all or any elements and all combinations of one or more associated listed items.
本技术领域技术人员可以理解,除非另外定义,这里使用的所有术语(包括技术术语和科学术语),具有与本发明所属领域中的普通技术人员的一般理解相同的意义。还应该理解的是,诸如通用字典中定义的那些术语,应该被理解为具有与现有技术的上下文中的意义一致的意义,并且除非像这里一样被特定定义,否则不会用理想化或过于正式的含义来解释。Those skilled in the art can understand that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art to which this invention belongs. It should also be understood that terms, such as those defined in commonly used dictionaries, should be understood to have meanings consistent with their meaning in the context of the prior art, and unless specifically defined as herein, are not intended to be idealized or overly Formal meaning to explain.
本技术领域技术人员可以理解,这里所使用的“终端”、“终端设备”既包括无线信号接收器的设备,其仅具备无发射能力的无线信号接收器的设备,又包括接收和发射硬件的设备,其具有能够在双向通信链路上,执行双向通信的接收和发射硬件的设备。这种设备可以包括:蜂窝或其他通信设备,其具有单线路显示器或多线路显示器或没有多线路显示器的蜂窝或其他通信设备;PCS(Personal Communications Service,个人通信系统),其可以组合语音、数据处理、传真和/或数据通信能力;PDA(PersonalDigital Assistant,个人数字助理),其可以包括射频接收器、寻呼机、互联网/内联网访问、网络浏览器、记事本、日历和/或GPS(Global PositioningSystem,全球定位系统)接收器;常规膝上型和/或掌上型计算机或其他设备,其具有和/或包括射频接收器的常规膝上型和/或掌上型计算机或其他设备。这里所使用的“终端”、“终端设备”可以是便携式、可运输、安装在交通工具(航空、海运和/或陆地)中的,或者适合于和/或配置为在本地运行,和/或以分布形式,运行在地球和/或空间的任何其他位置运行。这里所使用的“终端”、“终端设备”还可以是通信终端、上网终端、音乐/视频播放终端,例如可以是PDA、MID(Mobile Internet Device,移动互联网设备)和/或具有音乐/视频播放功能的移动电话,也可以是智能电视、机顶盒等设备。Those skilled in the art can understand that the "terminal" and "terminal equipment" used here not only include wireless signal receiver equipment, which only has wireless signal receiver equipment without transmission capabilities, but also include receiving and transmitting hardware. A device having receiving and transmitting hardware capable of performing bi-directional communication over a bi-directional communication link. Such equipment may include: cellular or other communication equipment, which has a single-line display or a multi-line display or a cellular or other communication equipment without a multi-line display; PCS (Personal Communications Service, personal communication system), which can combine voice, data Processing, facsimile and/or data communication capabilities; PDA (Personal Digital Assistant, Personal Digital Assistant), which may include radio frequency receiver, pager, Internet/Intranet access, web browser, notepad, calendar and/or GPS (Global Positioning System , Global Positioning System) receiver; a conventional laptop and/or palmtop computer or other device having and/or including a radio frequency receiver. As used herein, a "terminal", "terminal device" may be portable, transportable, installed in a vehicle (air, sea, and/or land), or adapted and/or configured to operate locally, and/or In distributed form, the operation operates at any other location on Earth and/or in space. The "terminal" and "terminal device" used here can also be a communication terminal, an Internet terminal, a music/video player terminal, such as a PDA, a MID (Mobile Internet Device, a mobile Internet device) and/or a music/video player Functional mobile phones, smart TVs, set-top boxes and other devices.
本技术领域技术人员可以理解,这里所使用的服务器、云端、远端网络设备等概念,具有等同效果,其包括但不限于计算机、网络主机、单个网络服务器、多个网络服务器集或多个服务器构成的云。在此,云由基于云计算(Cloud Computing)的大量计算机或网络服务器构成,其中,云计算是分布式计算的一种,由一群松散耦合的计算机集组成的一个超级虚拟计算机。本发明的实施例中,远端网络设备、终端设备与WNS服务器之间可通过任何通信方式实现通信,包括但不限于,基于3GPP、LTE、WIMAX的移动通信、基于TCP/IP、UDP协议的计算机网络通信以及基于蓝牙、红外传输标准的近距无线传输方式。Those skilled in the art can understand that the concepts of server, cloud, and remote network equipment used here have equivalent effects, including but not limited to computers, network hosts, single network servers, multiple network server sets, or multiple servers. Composed of clouds. Here, the cloud is composed of a large number of computers or network servers based on cloud computing (Cloud Computing), where cloud computing is a type of distributed computing, a super virtual computer composed of a group of loosely coupled computer sets. In the embodiment of the present invention, the communication between the remote network equipment, the terminal equipment and the WNS server can be realized through any communication method, including but not limited to, mobile communication based on 3GPP, LTE, WIMAX, based on TCP/IP, UDP protocol Computer network communication and short-distance wireless transmission methods based on Bluetooth and infrared transmission standards.
本领域技术人员应当理解,本发明所称的“应用”、“应用程序”、“应用软件”以及类似表述的概念,是业内技术人员所公知的相同概念,是指由一系列计算机指令及相关数据资源有机构造的适于电子运行的计算机软件。除非特别指定,这种命名本身不受编程语言种类、级别,也不受其赖以运行的操作系统或平台所限制。理所当然地,此类概念也不受任何形式的终端所限制。Those skilled in the art should understand that the concepts of "application", "application program", "application software" and similar expressions referred to in the present invention are the same concepts well known to those skilled in the art, and refer to a series of computer instructions and related Computer software that is organically constructed from data resources and suitable for electronic operation. Unless otherwise specified, this naming itself is not limited by the type of programming language, level, or the operating system or platform on which it runs. Naturally, such concepts are also not limited by any form of terminal.
本发明一种权限请求响应方法的应用场景,以基于Unix系为基础的操作系统环境中实现的。为了实现本方法,需要将本方法实例化成应用程序,获取Root权限,安装并运行于相关操作系统中。The application scene of the permission request response method of the present invention is realized in the operating system environment based on the Unix system. In order to implement this method, it is necessary to instantiate this method into an application program, obtain Root authority, install and run it on a relevant operating system.
众所周知,Root权限是指Unix类操作系统(包括Linux、Android)的系统管理员权限,类似于Windows(视窗)系统中的Administrator(管理员)权限;Root权限可以访问和修改用户的移动设备中几乎所有的文件(Android系统文件及用户文件,不包括ROM)。但是,由于目前移动终端系统对于Root权限的管理是非常严格的,通常情况下多数应用或程序都不具备Root权限,因此对于某些需要具备Root权限的操作就无法执行,例如安装或卸载应用等操作;同时,此类操作调用进程每次执行相应操作时都需要向系统申请Root权限,但如果此时其他应用进程正在使用Root权限进行相关操作,则此调用进程的Root权限申请便无法成功;更甚者,如果用户在系统中设置了禁用Root权限的操作,则相关调用进程便无法进行相关操作。基于此,本发明提出只需要向系统发送一次Root权限获取请求,具体可通过调用系统内置的SU(Super User,超级用户)命令获取Root权限,或者通过获取具有Root权限的shell获取Root权限并在shell中启动进程,然后在获取所述系统的Root权限授权后,即可使后续其他调用进程需执行相关操作时无需重复申请Root权限;具体Root权限获取过程可参照现有技术的Root权限调用函数,本发明在此不再赘述。基于上述的先导知识,以下结合图1详细揭示本发明的权限请求响应方法。该方法包括如下步骤:As we all know, Root authority refers to the system administrator authority of Unix-like operating systems (including Linux, Android), similar to the Administrator (administrator) authority in Windows (Windows) system; Root authority can access and modify almost All files (Android system files and user files, excluding ROM). However, because the current mobile terminal system is very strict about the management of Root permissions, most applications or programs do not have Root permissions usually, so some operations that require Root permissions cannot be performed, such as installing or uninstalling applications, etc. At the same time, the calling process of this type of operation needs to apply for root permission from the system every time it performs the corresponding operation, but if other application processes are using the root permission to perform related operations at this time, the root permission application of the calling process cannot be successful; What's more, if the user sets the operation of disabling the Root permission in the system, the relevant calling process cannot perform the relevant operation. Based on this, the present invention only needs to send a Root permission acquisition request to the system, specifically, the SU (Super User, super user) command built into the system can be called to obtain the Root permission, or the shell with the Root permission can be obtained to obtain the Root permission and in the system. Start the process in the shell, and then after obtaining the Root authority authorization of the system, it is not necessary to repeatedly apply for Root authority when other subsequent calling processes need to perform related operations; the specific Root authority acquisition process can refer to the Root authority call function of the prior art , the present invention will not be described in detail here. Based on the foregoing prior knowledge, the permission request response method of the present invention will be disclosed in detail below in conjunction with FIG. 1 . The method comprises the steps of:
S11、启动属于系统级别的通信接口,通过该通信接口监听外部权限请求:S11. Start a communication interface belonging to the system level, and monitor external authority requests through the communication interface:
本实施例所称的通信接口,是指由以本方法所实现的一个程序模块运行于内存中,通过内存中的相应主进程实现如前所述的提权操作后,向系统注册一个通信服务进程。以Android为例,该通信服务进程基于Android系统所提供的Binder机制,向System Manager注册自身,通过Android提供的固有的Binder机制,在通信服务进程与其监听的外部应用进程之间建立C/S架构的沟通管道。具体而言,当获取到系统的Root权限后,为了便于后续实现对外部应用进程的监听以及相关操作功能,本发明首先启动具有已经获得Root权限的由本方法实例化后得以运行而形成的主进程,通过主进程在系统中插入所述通信服务进程,例如可通过系统调用函数ServiceManager.addService来实现插入操作,由此实现对本方法的实例化程序的成功运行,不仅使本方法的主进程常驻内存,而且由其建立的通信服务进程也成为系统级别的通信接口。需要注意的是,所述通信服务进程通过上述的配置,已经成为系统级别的服务进程级别,其权限显然高于其他外部应用进程甚至所述主进程和其它进程等这些调用它的进程的权限,因此该通信服务进程可以作为通信基础,为其他调用它的进程提供通信保障,完成系统与其他调用它的进程之间的通信连接。由此也可以进一步推知,其他任何遵守本发明的通信接口的通信规范的客户端,均可通过Binder机制与本发明的通信接口进行通信,获取相应的权限。The communication interface referred to in this embodiment refers to a program module implemented by this method running in the memory, and registering a communication service with the system after the corresponding main process in the memory realizes the above-mentioned power escalation operation process. Taking Android as an example, the communication service process is based on the Binder mechanism provided by the Android system, registers itself with the System Manager, and establishes a C/S architecture between the communication service process and the external application process it monitors through the inherent Binder mechanism provided by Android. communication channels. Specifically, after obtaining the Root authority of the system, in order to facilitate subsequent monitoring of external application processes and related operating functions, the present invention first starts the main process that has obtained the Root authority and is instantiated and run by this method , insert the communication service process in the system through the main process, for example, the insertion operation can be realized by calling the function ServiceManager. Memory, and the communication service process established by it also becomes a system-level communication interface. It should be noted that the communication service process has become a system-level service process level through the above configuration, and its authority is obviously higher than that of other external application processes or even the main process and other processes that call it. Therefore, the communication service process can be used as a communication basis to provide communication guarantee for other processes that call it, and complete the communication connection between the system and other processes that call it. It can be further deduced from this that any other client that complies with the communication specification of the communication interface of the present invention can communicate with the communication interface of the present invention through the Binder mechanism to obtain corresponding permissions.
因此,所述的通信接口,在本实施例中表现为所述的通信服务进程,其功能用于实现主进程与外部应用进程之间的Binder通信,这种通信方式具有快速稳定的特点。对于本方法的核心要旨而言,所述通信服务进程主要用于监听外部应用进程所发起的权限请求,这一权限请求一般即是指期望获得Root权限实现对系统资源的深层访问的提权请求。对于本方法而言,除所述通信服务进程可用于建立通信接口外,当然,也可以通过其它进程来实现其它不同的功能,并且这些其它进程可以借助所述的通信服务进程与外部应用进程进行通信,从而内外结合完成其它特殊操作指令。例如,这些其它进程可以执行如下一种或多种操作,且不受此处的局限:执行预置应用的卸载、执行应用程序的安装或卸载、执行应用数据的备份或还原、执行应用程序的启用或禁用等。Therefore, the communication interface described in this embodiment is represented as the communication service process, and its function is to realize the Binder communication between the main process and the external application process. This communication mode has the characteristics of fast and stable. For the core gist of this method, the communication service process is mainly used to monitor the permission request initiated by the external application process, and this permission request generally refers to a request for escalation of authority that is expected to obtain Root permission to achieve deep access to system resources . For this method, except that the communication service process can be used to establish a communication interface, of course, other different functions can also be realized through other processes, and these other processes can communicate with external application processes by means of the communication service process. Communication, so as to complete other special operation instructions through combination of internal and external. For example, these other processes may perform one or more of the following operations, and are not limited here: perform uninstallation of preset applications, perform installation or uninstallation of application programs, perform backup or restoration of application data, perform Enable or disable etc.
所述的通信接口,成为进程间通信基础后,便可实现对外部应用进程的监听,当外部应用进程需要获得Root权限时,便会向系统发送获取Root权限的权限请求,通信服务进程由于其所处级别较高,便能优先获得并处理这一用户请求。通信服务进程获得该权限请求后,便可将其提交给本发明所述的主进程,由主进程做进一步的处理。After the above communication interface becomes the basis of inter-process communication, it can monitor the external application process. When the external application process needs to obtain the Root authority, it will send a permission request to the system to obtain the Root authority. The communication service process is due to its At a higher level, this user request can be obtained and processed with priority. After the communication service process obtains the permission request, it can submit it to the main process of the present invention, and the main process will do further processing.
S12、依据该权限请求获得请求方的特征标识,在预置的认证列表中检索该特征标识是否处于被允许的状态:S12. According to the permission request, obtain the characteristic identifier of the requesting party, and search whether the characteristic identifier is in the allowed state in the preset authentication list:
众所周知的,Android系统中对UID(User Identifier,用户标识)的定义,是为每一个具体应用所特定的识别符号,具有唯一特征,因此,UID即是每个具体应用的唯一性的特征标识。本实施例中,本方法所实现的主进程,从通信接口转发的源自外部应用程序的进程的权限请求中,可以获得该外部应用程序进程的特征标识,依据该特征标识可以进一步识别相应的应用程序,并且决定是否予以开放权限请求响应。As we all know, the definition of UID (User Identifier, User Identifier) in the Android system is a specific identification symbol for each specific application and has unique characteristics. Therefore, UID is the unique characteristic identification of each specific application. In this embodiment, the main process implemented by this method can obtain the feature identifier of the external application program process from the permission request of the process of the external application program forwarded by the communication interface, and can further identify the corresponding application, and decide whether to respond to the open permission request.
本步骤中,藉由用于实现本步骤的主进程还负责一个认证列表的维护。该认证列表可以采用多种形式实现,各种形式的不同主要体现在其内部映射关系上,以下列举两种形式供参照:In this step, the main process for realizing this step is also responsible for maintaining an authentication list. The certification list can be implemented in various forms, and the difference between various forms is mainly reflected in its internal mapping relationship. The following two forms are listed for reference:
A、可以仅仅存储每个默认允许获得Root权限的应用程序的UID,由此,进入该认证列表的特征标识所对应的应用程序,便被视为期望获得Root权限的请求,处于被允许的状态,将得到满足。A. You can only store the UID of each application that is allowed to obtain Root permission by default. Therefore, the application corresponding to the feature identifier that enters the authentication list is regarded as a request to obtain Root permission and is in an allowed state. , will be satisfied.
B、可以在A方案的认证列表中增加一个状态标识字段,为每个特征标识对应映射一个状态标识字符,例如,当某个UID所在的记录的状态标识字符为“Y”时,表征该UID所对应的权限请求为被允许状态;当为“N”时,表征该UID所对应的权限请求为非被允许状态。B. A state identification field can be added to the authentication list of scheme A, and a state identification character is mapped to each characteristic identification. For example, when the state identification character of the record where a certain UID is located is "Y", it represents the UID The corresponding permission request is in the allowed state; when it is "N", it indicates that the permission request corresponding to the UID is not in the allowed state.
除以上两种方式实现所述认证列表之外,为了便于进程调度,可以进一步增加进程标识PID,在主进程的生命周期中,并且在外部应用程序进行首次发送权限请求时,从中获得对应的PID,存储到认证列表中,供所述外部应用进程在下次发起权限请求时对照使用,以PID和UID共同决定权限请求的被允许状态。如此,可以进一步将权限请求管理细化到外部应用程序的子进程。In addition to the above two ways to implement the authentication list, in order to facilitate process scheduling, the process identification PID can be further added, and the corresponding PID can be obtained from it during the life cycle of the main process and when the external application program sends the permission request for the first time , stored in the authentication list, for comparison and use when the external application process initiates a permission request next time, and the permission status of the permission request is jointly determined by the PID and UID. In this way, permission request management can be further refined to sub-processes of external applications.
当以本方法实现的主进程收到通信接口转发的权限请求之后,提取其中的UID(以及PID,下同),然后以该UID去所述认证列表中检索,对于方式A,当认证列表中存在该UID时,即可确认所述UID所对应的权限请求应当被允许,如果认证列表中没有对应的UID,则表征该UID未被允许;对于方式B,当认证列表中存在该UID并且其状态标识字段的状态标识符为“Y”时,表征该UID所对应的权限请求应当被允许,反之,状态标识符为“N”时,表征该UID所对应的权限请求未被允许。After the main process implemented with this method receives the permission request forwarded by the communication interface, it extracts the UID (and PID, the same below), and then uses the UID to retrieve it from the authentication list. When the UID exists, it can be confirmed that the permission request corresponding to the UID should be allowed. If there is no corresponding UID in the authentication list, it means that the UID is not allowed; for method B, when the UID exists in the authentication list and its When the status identifier of the status identifier field is "Y", it indicates that the permission request corresponding to the UID should be allowed; otherwise, when the status identifier is "N", it indicates that the permission request corresponding to the UID is not allowed.
可以看出,采用本发明的认证列表,通过获取系统Root权限后启动具有Root权限的服务进程并向系统中插入通信服务进程,即可使调用通信服务进程的外部应用进程执行相应操作时无需重复申请Root权限,而可通过启动的主进程来执行相应操作,有效地避免了因Root权限正在使用或被禁用所带来的操作失败,进而大大提高了数据通信的效率。It can be seen that by adopting the authentication list of the present invention, by starting the service process with Root authority after obtaining the system Root authority and inserting the communication service process into the system, the external application process that calls the communication service process can perform corresponding operations without repeating Apply for Root permission, and the corresponding operation can be performed through the started main process, which effectively avoids the operation failure caused by the Root permission being used or disabled, and thus greatly improves the efficiency of data communication.
所述的认证列表中原始数据的获取,可以是在本方法的历史使用过程中,依用户使用习惯而生成。例如,用户首次针对某个外部应用程序进程的请求,给予一个允许其获取Root权限的主观指示,即被本发明的主进程添加到该认证列表中,标记为被允许获取相应权限的状态,后续便可免弹窗询问。所述的认证列表也可以被远程维护,通过所述的主进程调用远程通信接口,定时或不定时地从云端下载最新的认证列表数据,以更新本地的认证列表,由此可以发挥大数据优势,使认证列表中的数据更具安全性。The acquisition of the original data in the authentication list may be generated according to the user's usage habits during the historical use of the method. For example, for the first time, the user gives a subjective indication to allow it to obtain the Root permission for the request of an external application process, that is, it is added to the authentication list by the main process of the present invention and marked as a state of being allowed to obtain the corresponding permission. You can avoid pop-up window inquiries. The authentication list can also be maintained remotely, by calling the remote communication interface through the main process, and downloading the latest authentication list data from the cloud regularly or irregularly, so as to update the local authentication list, thereby taking advantage of big data , making the data in the authentication list more secure.
适应上述情况,云端维护一张公共认证列表,由安装有以本发明的方法的程序的主进程上传用户针对各程序UID所做出的允许获取权限与否的数据,然后根据统计方法对各个UID进行统计,当多数用户例如60%允许某个UID可以获取Root权限时,标记该UID对应的状态标识字为“Y”,否则,标记为“N”。本地主进程通过远程接口下载该公共认证列表中,与本地的认证列表进行比对,在尊重用户主观指示的基础上,添加公共认证列表中的新增记录到本地认证列表中。当然,为了安全起见,可以针对两个表中,UID相同而状态不同的记录进行弹窗询问,看用户是否采用公共认证列表的数据,如果用户选择是,则将公共认证列表的该UID相关的记录替换本地认证列表的相应记录,如果不是,则放弃后续操作。可以看出,通过这种方式可以实现对认证列表的动态维护,使认证列表在技术实现的角度大大发挥了其安全作用。To adapt to the above situation, the cloud maintains a public authentication list, and the main process of the program installed with the method of the present invention uploads the data of whether the user is allowed to obtain permission or not for each program UID, and then according to the statistical method for each UID Statistically, when most users, for example 60%, allow a certain UID to obtain Root authority, mark the status identifier corresponding to the UID as "Y", otherwise, mark it as "N". The local master process downloads the public authentication list through the remote interface, compares it with the local authentication list, and adds new records in the public authentication list to the local authentication list on the basis of respecting the user's subjective instructions. Of course, for the sake of safety, pop-up queries can be made for records with the same UID but different states in the two tables to see if the user adopts the data of the public authentication list. If the user chooses yes, the UID related to the public authentication list The record replaces the corresponding record in the local authentication list, if not, the subsequent operation is discarded. It can be seen that the dynamic maintenance of the authentication list can be realized in this way, so that the authentication list can greatly play its security role from the perspective of technical implementation.
可以理解,云端维护的公共认证列表的形式应不局限于所述UID、PID的字段信息,进一步可以推广到为其添加调用该通信服务进程的程序或者服务的签名信息等,使得通信服务进程可以进一步通过验证发起权限请求的程序或服务的签名信息来确定是否为其开放Root权限,强化其安全防护效果。It can be understood that the form of the public authentication list maintained by the cloud should not be limited to the field information of the UID and PID, and can be further extended to add the signature information of the program or service that invokes the communication service process, so that the communication service process can Further, by verifying the signature information of the program or service that initiated the permission request, it is determined whether to open Root permission for it, and its security protection effect is strengthened.
需要指出的是,所述的认证列表的存储形式,既可以是内存中的链表,也可以是存储于本地的数据库或文本文件的形式,可由本领域技术人员灵活实现。It should be pointed out that the storage form of the authentication list can be a linked list in memory, or a database or a text file stored locally, which can be flexibly implemented by those skilled in the art.
S13、当该特征标识为被允许状态时,为该权限请求向系统申请权限。S13. When the feature identifier is in an allowed state, apply for permission to the system for the permission request.
通过前一步骤的实施,便可判断一个权限请求是所对应的特征标识是否为被允许状态,如果是,则可由本发明所实现的主进程为该权限请求放行,为该权限请求系统的Root权限,由系统向相应的外部应用程序进程开放Root权限。而如果前一步骤获得的结果是相应的特征标识为非被允许状态,那么,主进程可以拒绝该权限请求,通过其通信接口向外部应用进程返回假消息,使得外部应用进程所发放的权限请求无功而返;或者,也可直接返回权限请求不成功的回复。Through the implementation of the previous step, it can be judged whether a permission request is the corresponding feature identification is allowed state, if so, then the main process realized by the present invention can be released for the permission request, and the Root of the permission request system Permission, the system grants Root permission to the corresponding external application process. And if the result obtained in the previous step is that the corresponding feature identification is not allowed, then the main process can reject the permission request, and return a false message to the external application process through its communication interface, so that the permission request issued by the external application process return without success; or, directly return a reply that the permission request is unsuccessful.
通过本发明以上关于其权限请求响应方法,可以实现运行更高效的权限管理机制,不仅确保各进程之间的通信更为快速有效,而且在技术层面上,通过认证列表的作用,也能使得权限管理更为安全。Through the above method of responding to the authority request of the present invention, a more efficient authority management mechanism can be realized, which not only ensures faster and more effective communication between processes, but also at the technical level, through the role of the authentication list, the authority can also be made Management is safer.
相应的,本发明可以依照前述的方法而提供一种权限请求响应装置,借助该装置所实现的各个模块,分别实现该方法的各个步骤,也可实现相应的功能。该装置可以在处理器上以逻辑功能的方式集中实现。请参阅图2,具体而言,本发明提供的权限请求响应装置,包括通信接口11、检索单元12以及处理单元13。Correspondingly, the present invention can provide a permission request responding device according to the aforementioned method, and each step of the method can be realized by means of each module realized by the device, and corresponding functions can also be realized. The device can be implemented centrally in the form of logic functions on the processor. Please refer to FIG. 2 , specifically, the permission request response device provided by the present invention includes a communication interface 11 , a retrieval unit 12 and a processing unit 13 .
所述的通信接口11,由一运行于内存中的通信服务进程构建,通过内存中的相应主进程实现如前所述的提权操作后,向系统注册一个通信服务进程而实现。以Android为例,该通信服务进程基于Android系统所提供的Binder机制,向System Manager注册自身,通过Android提供的固有的Binder机制,在通信服务进程与其监听的外部应用进程之间建立C/S架构的沟通管道,通信服务进程便形成了所述的通信接口11。具体而言,当获取到系统的Root权限后,为了便于后续实现对外部应用进程的监听以及相关操作功能,本发明通过一主进程在系统中插入所述通信服务进程,例如可通过系统调用函数ServiceManager.addService来实现插入操作,由此,不仅能使该主进程常驻内存,而且由其建立的通信服务进程也成为系统级别的通信接口11。需要注意的是,所述通信服务进程通过上述的配置,已经成为系统级别的服务进程级别,其权限显然高于其他外部应用进程甚至所述主进程和其它进程等这些调用它的进程的权限,因此该通信服务进程可以作为通信基础,为其他调用它的进程提供通信保障,完成系统与其他调用它的进程之间的通信连接。The communication interface 11 is constructed by a communication service process running in the memory, which is implemented by registering a communication service process with the system after the corresponding main process in the memory realizes the privilege escalation operation as mentioned above. Taking Android as an example, the communication service process is based on the Binder mechanism provided by the Android system, registers itself with the System Manager, and establishes a C/S architecture between the communication service process and the external application process it monitors through the inherent Binder mechanism provided by Android. The communication channel, the communication service process forms the communication interface 11. Specifically, after obtaining the Root authority of the system, in order to facilitate subsequent monitoring of external application processes and related operating functions, the present invention inserts the communication service process into the system through a main process, for example, through the system call function ServiceManager.addService is used to implement the insert operation, so that not only the main process can be resident in memory, but also the communication service process established by it can also become the communication interface 11 at the system level. It should be noted that the communication service process has become a system-level service process level through the above configuration, and its authority is obviously higher than that of other external application processes or even the main process and other processes that call it. Therefore, the communication service process can be used as a communication basis to provide communication guarantee for other processes that call it, and complete the communication connection between the system and other processes that call it.
因此,所述的通信接口11,在本实施例中表现为所述的通信服务进程,其功能用于实现主进程与外部应用进程之间的Binder通信,这种通信方式具有快速稳定的特点。对于本装置的核心要旨而言,所述通信服务进程主要用于监听外部应用进程所发起的权限请求,这一权限请求一般即是指期望获得Root权限实现对系统资源的深层访问的提权请求。对于本装置而言,除所述通信服务进程可用于建立通信接口11外,当然,也可以通过其它进程来实现其它不同的功能,并且这些其它进程可以借助所述的通信服务进程与外部应用进程进行通信,从而内外结合完成其它特殊操作指令。例如,这些其它进程可以执行如下一种或多种操作,且不受此处的局限:执行预置应用的卸载、执行应用程序的安装或卸载、执行应用数据的备份或还原、执行应用程序的启用或禁用等、执行内存清理功能等。Therefore, the communication interface 11 in this embodiment is represented as the communication service process, and its function is to realize the Binder communication between the main process and the external application process. This communication method has the characteristics of fast and stable. As far as the core gist of this device is concerned, the communication service process is mainly used to monitor permission requests initiated by external application processes. This permission request generally refers to a request for privilege escalation that is expected to obtain Root permission to achieve deep access to system resources. . For this device, except that the communication service process can be used to establish the communication interface 11, of course, other processes can also be used to realize other different functions, and these other processes can communicate with the external application process by means of the communication service process. Communication, so as to complete other special operation instructions through combination of internal and external. For example, these other processes may perform one or more of the following operations, and are not limited here: perform uninstallation of preset applications, perform installation or uninstallation of application programs, perform backup or restoration of application data, perform Enable or disable, etc., perform memory cleaning functions, etc.
所述的通信接口11,成为进程间通信基础后,便可实现对外部应用进程的监听,当外部应用进程需要获得Root权限时,便会向系统发送获取Root权限的权限请求,通信服务进程由于其所处级别较高,便能优先获得并处理这一用户请求。通信服务进程获得该权限请求后,便可将其提交给本发明所述的主进程,由主进程做进一步的处理。After the communication interface 11 becomes the basis of inter-process communication, it can realize the monitoring of the external application process. When the external application process needs to obtain the Root authority, it will send a permission request to the system to obtain the Root authority. The communication service process is due to It is at a higher level, so it can obtain and process this user request first. After the communication service process obtains the permission request, it can submit it to the main process of the present invention, and the main process will do further processing.
所述的检索单元12,用于依据该权限请求获得请求方的特征标识,在预置的认证列表中检索该特征标识是否处于被允许的状态。The retrieval unit 12 is configured to obtain the requester's characteristic identifier according to the permission request, and retrieve whether the characteristic identifier is in a permitted state in the preset authentication list.
众所周知的,Android系统中对UID(User Identifier,用户标识)的定义,是为每一个具体应用所特定的识别符号,具有唯一特征,因此,UID即是每个具体应用的唯一性的特征标识。本实施例中,本装置所实现的主进程,从通信接口11转发的源自外部应用程序的进程的权限请求中,可以获得该外部应用程序进程的特征标识,依据该特征标识可以进一步识别相应的应用程序,并且决定是否予以开放权限请求响应。As we all know, the definition of UID (User Identifier, User Identifier) in the Android system is a specific identification symbol for each specific application and has unique characteristics. Therefore, UID is the unique characteristic identification of each specific application. In this embodiment, the main process implemented by this device can obtain the characteristic identifier of the external application program process from the permission request of the process originating from the external application program forwarded by the communication interface 11, and can further identify the corresponding application and decide whether to respond to the open permission request.
本检索单元12中,藉由用于实现本检索单元12的主进程还负责一个认证列表的维护,基于此而构建一维护单元(未图示),用于维护所述的认证列表。逻辑上,该维护单元可以与本检索单元12合二为一,也可相互独立。该认证列表可以采用多种形式实现,各种形式的不同主要体现在其内部映射关系上,以下列举两种形式供参照:In the retrieval unit 12, the main process for realizing the retrieval unit 12 is also responsible for maintaining an authentication list, based on which a maintenance unit (not shown) is constructed to maintain the authentication list. Logically, the maintenance unit can be integrated with the retrieval unit 12, or can be independent of each other. The certification list can be implemented in various forms, and the difference between various forms is mainly reflected in its internal mapping relationship. The following two forms are listed for reference:
A、可以仅仅存储每个默认允许获得Root权限的应用程序的UID,由此,进入该认证列表的特征标识所对应的应用程序,便被视为期望获得Root权限的请求,处于被允许的状态,将得到满足。A. You can only store the UID of each application that is allowed to obtain Root permission by default. Therefore, the application corresponding to the feature identifier that enters the authentication list is regarded as a request to obtain Root permission and is in an allowed state. , will be satisfied.
B、可以在A方案的认证列表中增加一个状态标识字段,为每个特征标识对应映射一个状态标识字符,例如,当某个UID所在的记录的状态标识字符为“Y”时,表征该UID所对应的权限请求为被允许状态;当为“N”时,表征该UID所对应的权限请求为非被允许状态。B. A state identification field can be added to the authentication list of scheme A, and a state identification character is mapped to each characteristic identification. For example, when the state identification character of the record where a certain UID is located is "Y", it represents the UID The corresponding permission request is in the allowed state; when it is "N", it indicates that the permission request corresponding to the UID is not in the allowed state.
除以上两种方式实现所述认证列表之外,为了便于进程调度,可以进一步增加进程标识PID,在主进程的生命周期中,并且在外部应用程序进行首次发送权限请求时,从中获得对应的PID,存储到认证列表中,供所述外部应用进程在下次发起权限请求时对照使用,以PID和UID共同决定权限请求的被允许状态。如此,可以进一步将权限请求管理细化到外部应用程序的子进程。In addition to the above two ways to implement the authentication list, in order to facilitate process scheduling, the process identification PID can be further added, and the corresponding PID can be obtained from it during the life cycle of the main process and when the external application program sends the permission request for the first time , stored in the authentication list, for comparison and use when the external application process initiates a permission request next time, and the permission status of the permission request is jointly determined by the PID and UID. In this way, permission request management can be further refined to sub-processes of external applications.
当以本装置实现的主进程收到通信接口11转发的权限请求之后,提取其中的UID(以及PID,下同),然后以该UID去所述认证列表中检索,对于方式A,当认证列表中存在该UID时,即可确认所述UID所对应的权限请求应当被允许,如果认证列表中没有对应的UID,则表征该UID未被允许;对于方式B,当认证列表中存在该UID并且其状态标识字段的状态标识符为“Y”时,表征该UID所对应的权限请求应当被允许,反之,状态标识符为“N”时,表征该UID所对应的权限请求未被允许。After the main process implemented with this device receives the permission request forwarded by the communication interface 11, it extracts the UID (and PID, the same below), and then uses the UID to retrieve the authentication list. For mode A, when the authentication list When the UID exists in the UID, it can be confirmed that the permission request corresponding to the UID should be allowed. If there is no corresponding UID in the authentication list, it means that the UID is not allowed; for method B, when the UID exists in the authentication list and When the status identifier of the status identifier field is "Y", it indicates that the permission request corresponding to the UID should be allowed; otherwise, when the status identifier is "N", it indicates that the permission request corresponding to the UID is not allowed.
可以看出,采用本发明的认证列表,通过获取系统Root权限后启动具有Root权限的服务进程并向系统中插入通信服务进程,即可使调用通信服务进程的外部应用进程执行相应操作时无需重复申请Root权限,而可通过启动的主进程来执行相应操作,有效地避免了因Root权限正在使用或被禁用所带来的操作失败,进而大大提高了数据通信的效率。It can be seen that by adopting the authentication list of the present invention, by starting the service process with Root authority after obtaining the system Root authority and inserting the communication service process into the system, the external application process that calls the communication service process can perform corresponding operations without repeating Apply for Root permission, and the corresponding operation can be performed through the started main process, which effectively avoids the operation failure caused by the Root permission being used or disabled, and thus greatly improves the efficiency of data communication.
所述认证列表的维护,由所述维护单元实现,包括如何使认证列表形成基础数据和如何更新其中的数据。The maintenance of the authentication list is realized by the maintenance unit, including how to make the authentication list form basic data and how to update the data therein.
所述的认证列表中原始数据的获取,可以是在本装置的历史使用过程中,依用户使用习惯而生成。例如,用户首次针对某个外部应用程序进程的请求,给予一个允许其获取Root权限的主观指示,即被本发明的主进程添加到该认证列表中,标记为被允许获取相应权限的状态,后续便可免弹窗询问。所述的认证列表也可以结合云端进行远程维护,通过所述的主进程调用远程通信接口11,定时或不定时地从云端下载最新的认证列表数据,以更新本地的认证列表,由此可以发挥大数据优势,使认证列表中的数据更具安全性。The acquisition of the original data in the authentication list may be generated according to the usage habits of the user during the historical use of the device. For example, for the first time, the user gives a subjective indication to allow it to obtain the Root permission for the request of an external application process, that is, it is added to the authentication list by the main process of the present invention and marked as a state of being allowed to obtain the corresponding permission. You can avoid pop-up window inquiries. The authentication list can also be remotely maintained in combination with the cloud, and the remote communication interface 11 is invoked through the main process to download the latest authentication list data from the cloud regularly or irregularly to update the local authentication list. The advantage of big data makes the data in the certification list more secure.
适应上述情况,云端维护一张公共认证列表,由安装有以本发明的主进程上传用户针对各程序UID所做出的允许获取权限与否的数据,然后根据统计方法对各个UID进行统计,当多数用户例如60%允许某个UID可以获取Root权限时,标记该UID对应的状态标识字为“Y”,否则,标记为“N”。本地主进程通过远程接口下载该公共认证列表中,与本地的认证列表进行比对,在尊重用户主观指示的基础上,添加公共认证列表中的新增记录到本地认证列表中。当然,为了安全起见,可以针对两个表中,UID相同而状态不同的记录进行弹窗询问,看用户是否采用公共认证列表的数据,如果用户选择是,则将公共认证列表的该UID相关的记录替换本地认证列表的相应记录,如果不是,则放弃后续操作。显然,本地端的这些操作,应由所述的维护单元中的认证列表动态更新模块来实现,这样更符合逻辑划分。维护单元还可以进一步包括一程序升级模块,用于跟进本发明所实现的程序的动态更新。可以看出,通过这种方式可以实现对认证列表的动态维护,使认证列表在技术实现的角度大大发挥了其安全作用。To adapt to the above situation, the cloud maintains a public authentication list, and the main process of the present invention is installed to upload the data on whether the user is allowed to obtain permission for each program UID, and then perform statistics on each UID according to the statistical method. When most users, for example 60%, allow a certain UID to obtain Root authority, mark the status identifier corresponding to the UID as "Y", otherwise, mark it as "N". The local master process downloads the public authentication list through the remote interface, compares it with the local authentication list, and adds new records in the public authentication list to the local authentication list on the basis of respecting the user's subjective instructions. Of course, for the sake of safety, pop-up queries can be made for records with the same UID but different states in the two tables to see if the user adopts the data of the public authentication list. If the user chooses yes, the UID related to the public authentication list The record replaces the corresponding record in the local authentication list, if not, the subsequent operation is discarded. Obviously, these operations on the local side should be implemented by the authentication list dynamic update module in the maintenance unit, which is more logically divided. The maintenance unit may further include a program upgrade module, which is used to follow up the dynamic update of the program implemented by the present invention. It can be seen that the dynamic maintenance of the authentication list can be realized in this way, so that the authentication list can greatly play its security role from the perspective of technical implementation.
需要指出的是,所述的认证列表的存储形式,既可以是内存中的链表,也可以是存储于本地的数据库或文本文件的形式,可由本领域技术人员灵活实现。It should be pointed out that the storage form of the authentication list can be a linked list in memory, or a database or a text file stored locally, which can be flexibly implemented by those skilled in the art.
所述的处理单元13,当该特征标识为被允许状态时,用于为该权限请求向系统申请权限;当该特征标识为未被允许状态时,用于拒绝该权限请求。The processing unit 13 is configured to apply for permission to the system for the permission request when the feature is identified as being allowed; and is used to reject the permission request when the feature is not allowed.
通过检索单元12的处理,便可判断一个权限请求是所对应的特征标识是否为被允许状态,如果是,则可由本发明所实现的主进程为该权限请求放行,为该权限请求系统的Root权限,由系统向相应的外部应用程序进程开放Root权限。而如果检索单元12获得的结果是相应的特征标识为非被允许状态,那么,主进程可以拒绝该权限请求,通过其通信接口11向外部应用进程返回假消息,使得外部应用进程所发放的权限请求无功而返;或者,也可直接返回权限请求不成功的回复。Through the processing of the retrieval unit 12, it can be judged whether a permission request is the corresponding feature mark is allowed state, if so, then the main process realized by the present invention can be released for the permission request, and the Root of the permission request system Permission, the system grants Root permission to the corresponding external application process. And if the result obtained by the retrieval unit 12 is that the corresponding feature identification is not allowed, then the main process can reject the permission request, and return a false message to the external application process through its communication interface 11, so that the permission issued by the external application process The request returns without success; alternatively, it can also directly return a reply that the permission request is unsuccessful.
需要注意的是,Root权限的获取方式,从权限作用的生命周期来看,包括永久Root权限和临时Root权限,顾名思义,永久Root权限情况下,应用程序一经Root授权,以后可不必再进行Root提权操作;而临时Root权限情况下,权限作用的生命周期只是操作系统的一次从开机到关机的过程,下次开机依然需要进行Root。本发明的实现不受这种分类限制,但可以依据这两种不同方式来做可选的程序实现。例如,可以提供用户界面供用户选定是否进行永久Root或临时Root,结合所述本地认证列表中为各UID附加是否永久Root或临时Root的类型标识,然后按照不同的标识对发起请求的用户程序/进程做不同的权限请求开放处理。It should be noted that, from the perspective of the life cycle of permissions, the way to obtain root permissions includes permanent root permissions and temporary root permissions. In the case of temporary root authority, the life cycle of the authority function is only a process from booting to shutting down of the operating system, and rooting is still required for the next boot. The realization of the present invention is not limited by this classification, but alternative program realization can be done according to these two different ways. For example, a user interface can be provided for the user to select whether to perform permanent Root or temporary Root, and in combination with the local authentication list, attach the type identification of whether permanent Root or temporary Root to each UID, and then program the requesting user according to different identifications. / process does different permission request opening processing.
如前所述,本发明可以通过服务进程来实现权限请求后的后续指令执行。服务进程可以是独立的,为说明的方便,称其为指令服务进程。当本发明实现权限管理的相关服务进程为用户权限请求成功获取系统Root权限后,即可绑定该服务进程与发起权限请求的用户进程之间的直接通信,然后,由用户进程向该服务进程发送指令,例如:执行预置应用的卸载、执行应用程序的安装或卸载、执行应用数据的备份或还原、执行应用程序的启用或禁用等、执行内存或缓存清理功能等。该服务进程构造有执行这些功能的函数,服务进程通过解析用户进程的指令,调用与用户目标功能相应的函数,实现相应的功能,从而解决用户的需求。As mentioned above, the present invention can implement the execution of subsequent instructions after the permission request through the service process. The service process can be independent, and for the convenience of description, it is called an instruction service process. When the relevant service process of the present invention realizes authority management for the user authority request and successfully obtains the system Root authority, the direct communication between the service process and the user process that initiates the authority request can be bound, and then, the user process sends the service process to the service process. Sending instructions, such as: uninstalling preset applications, installing or uninstalling applications, backing up or restoring application data, enabling or disabling applications, performing memory or cache cleaning functions, etc. The service process is constructed with functions to perform these functions. The service process analyzes the instructions of the user process, calls the function corresponding to the user's target function, and realizes the corresponding function, thereby solving the user's demand.
综上,通过上述的实施例可以看出,本发明的所实现的权限请求管理功能,具有通信快速高效、技术安全可靠的特点。In summary, it can be seen from the above embodiments that the permission request management function implemented in the present invention has the characteristics of fast and efficient communication, and technical safety and reliability.
以上所述仅是本发明的部分实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above descriptions are only part of the embodiments of the present invention. It should be pointed out that those skilled in the art can make some improvements and modifications without departing from the principles of the present invention. It should be regarded as the protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410696530.4A CN104346559B (en) | 2014-11-26 | 2014-11-26 | Authority request response method and corresponding device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410696530.4A CN104346559B (en) | 2014-11-26 | 2014-11-26 | Authority request response method and corresponding device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104346559A true CN104346559A (en) | 2015-02-11 |
CN104346559B CN104346559B (en) | 2018-01-02 |
Family
ID=52502140
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410696530.4A Expired - Fee Related CN104346559B (en) | 2014-11-26 | 2014-11-26 | Authority request response method and corresponding device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104346559B (en) |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105243325A (en) * | 2015-09-29 | 2016-01-13 | 北京奇虎科技有限公司 | Method for residual process file in mobile terminal, mobile terminal and server |
CN105282241A (en) * | 2015-09-28 | 2016-01-27 | 青岛海尔智能家电科技有限公司 | Internet of Things equipment control method and apparatus |
CN105808536A (en) * | 2014-12-27 | 2016-07-27 | 北京奇虎科技有限公司 | A file processing method and device |
CN105912930A (en) * | 2016-04-11 | 2016-08-31 | 北京奇虎科技有限公司 | Mobile terminal and system resource safety control method thereof |
CN106127031A (en) * | 2016-06-23 | 2016-11-16 | 北京金山安全软件有限公司 | Method and device for protecting process and electronic equipment |
CN106296129A (en) * | 2016-08-16 | 2017-01-04 | 天脉聚源(北京)传媒科技有限公司 | A kind of status indicator method and device |
CN106503577A (en) * | 2016-09-28 | 2017-03-15 | 乐视控股(北京)有限公司 | A kind of System right management method, device and corresponding equipment |
CN106570390A (en) * | 2016-10-27 | 2017-04-19 | 努比亚技术有限公司 | Equipment permission control method and device |
CN106886715A (en) * | 2015-12-15 | 2017-06-23 | 北京奇虎科技有限公司 | authority request response method and corresponding device |
CN106886712A (en) * | 2015-12-16 | 2017-06-23 | 北京奇虎科技有限公司 | The method and device of installation procedure |
CN106919812A (en) * | 2015-12-26 | 2017-07-04 | 腾讯科技(深圳)有限公司 | A kind of application process right management method and device |
CN107203706A (en) * | 2016-03-16 | 2017-09-26 | 阿里巴巴集团控股有限公司 | The detection method and device of authority inside APP |
CN107333150A (en) * | 2017-08-15 | 2017-11-07 | 四川长虹电器股份有限公司 | The method that management and control is installed in Android intelligent television application |
WO2018040972A1 (en) * | 2016-08-31 | 2018-03-08 | 福建联迪商用设备有限公司 | Method and system for improving application security of payment terminal |
CN109936550A (en) * | 2017-12-18 | 2019-06-25 | 福建天泉教育科技有限公司 | The setting method and terminal of network firewall in a kind of Android system |
CN115314247A (en) * | 2022-06-30 | 2022-11-08 | 中化学交通建设集团有限公司 | Internet of things equipment management method and related equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102591727A (en) * | 2012-01-04 | 2012-07-18 | 华为终端有限公司 | Method for processing application data and computing node |
CN103617389A (en) * | 2013-11-08 | 2014-03-05 | 上海天奕达网络科技有限公司 | Terminal rights management method and terminal device |
CN103826215A (en) * | 2014-02-11 | 2014-05-28 | 北京奇虎科技有限公司 | Method and apparatus for carrying out root authority management at terminal equipment |
US20140242945A1 (en) * | 2011-11-15 | 2014-08-28 | Beijing Netqin Technology Co., Ltd. | Method and system for monitoring application program of mobile device |
-
2014
- 2014-11-26 CN CN201410696530.4A patent/CN104346559B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140242945A1 (en) * | 2011-11-15 | 2014-08-28 | Beijing Netqin Technology Co., Ltd. | Method and system for monitoring application program of mobile device |
CN102591727A (en) * | 2012-01-04 | 2012-07-18 | 华为终端有限公司 | Method for processing application data and computing node |
CN103617389A (en) * | 2013-11-08 | 2014-03-05 | 上海天奕达网络科技有限公司 | Terminal rights management method and terminal device |
CN103826215A (en) * | 2014-02-11 | 2014-05-28 | 北京奇虎科技有限公司 | Method and apparatus for carrying out root authority management at terminal equipment |
Cited By (21)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105808536A (en) * | 2014-12-27 | 2016-07-27 | 北京奇虎科技有限公司 | A file processing method and device |
CN105808536B (en) * | 2014-12-27 | 2021-01-12 | 北京奇虎科技有限公司 | File processing method and device |
CN105282241A (en) * | 2015-09-28 | 2016-01-27 | 青岛海尔智能家电科技有限公司 | Internet of Things equipment control method and apparatus |
CN105243325A (en) * | 2015-09-29 | 2016-01-13 | 北京奇虎科技有限公司 | Method for residual process file in mobile terminal, mobile terminal and server |
CN106886715A (en) * | 2015-12-15 | 2017-06-23 | 北京奇虎科技有限公司 | authority request response method and corresponding device |
CN106886712A (en) * | 2015-12-16 | 2017-06-23 | 北京奇虎科技有限公司 | The method and device of installation procedure |
CN106886712B (en) * | 2015-12-16 | 2021-03-19 | 北京奇虎科技有限公司 | Method and device for installing program |
CN106919812A (en) * | 2015-12-26 | 2017-07-04 | 腾讯科技(深圳)有限公司 | A kind of application process right management method and device |
CN106919812B (en) * | 2015-12-26 | 2020-06-16 | 腾讯科技(深圳)有限公司 | Application process authority management method and device |
CN107203706A (en) * | 2016-03-16 | 2017-09-26 | 阿里巴巴集团控股有限公司 | The detection method and device of authority inside APP |
CN105912930A (en) * | 2016-04-11 | 2016-08-31 | 北京奇虎科技有限公司 | Mobile terminal and system resource safety control method thereof |
CN105912930B (en) * | 2016-04-11 | 2019-02-01 | 北京奇虎科技有限公司 | Mobile terminal and system resource security control method thereof |
CN106127031A (en) * | 2016-06-23 | 2016-11-16 | 北京金山安全软件有限公司 | Method and device for protecting process and electronic equipment |
CN106296129A (en) * | 2016-08-16 | 2017-01-04 | 天脉聚源(北京)传媒科技有限公司 | A kind of status indicator method and device |
WO2018040972A1 (en) * | 2016-08-31 | 2018-03-08 | 福建联迪商用设备有限公司 | Method and system for improving application security of payment terminal |
CN106503577A (en) * | 2016-09-28 | 2017-03-15 | 乐视控股(北京)有限公司 | A kind of System right management method, device and corresponding equipment |
CN106570390A (en) * | 2016-10-27 | 2017-04-19 | 努比亚技术有限公司 | Equipment permission control method and device |
CN107333150A (en) * | 2017-08-15 | 2017-11-07 | 四川长虹电器股份有限公司 | The method that management and control is installed in Android intelligent television application |
CN109936550A (en) * | 2017-12-18 | 2019-06-25 | 福建天泉教育科技有限公司 | The setting method and terminal of network firewall in a kind of Android system |
CN115314247A (en) * | 2022-06-30 | 2022-11-08 | 中化学交通建设集团有限公司 | Internet of things equipment management method and related equipment |
CN115314247B (en) * | 2022-06-30 | 2024-02-09 | 中化学交通建设集团有限公司 | Internet of things equipment management method and related equipment |
Also Published As
Publication number | Publication date |
---|---|
CN104346559B (en) | 2018-01-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104346559B (en) | Authority request response method and corresponding device | |
CN104375869B (en) | Self-starting application control method and device | |
CN105427096B (en) | Payment security sandbox implementation method and system and application program monitoring method and system | |
CN105095746B (en) | Application program launching method for authenticating and device | |
CN104239786B (en) | ROOT-free active defense configuration method and device | |
AU2014235181B2 (en) | Certificate based profile confirmation | |
CN104375494B (en) | Security sandbox construction method and security sandbox construction device | |
CN104376256B (en) | Program process hatching control and device | |
CN104850779A (en) | Safe application program installing method and safe application program installing device | |
WO2017071207A1 (en) | Application installation method, corresponding apparatus, and application installation system | |
CN103677935A (en) | Installation and control method, system and device for application programs | |
CN105183307A (en) | Application message display control method and application message display control device | |
CN104376257B (en) | Application program self-protection, active defense method and device | |
CN104881601A (en) | Floating window display setup, control method and device | |
CN104376255A (en) | Application program running control method and device | |
CN104391729B (en) | Programme upgrade method and device based on Root authority | |
CN104376268B (en) | Using method for hidden controlling and device | |
CN104239797B (en) | Active defense method and device | |
CN105100515A (en) | Smart wearable device and its incoming call processing method and system | |
CN102572804B (en) | Data calling method and device | |
CN106022128A (en) | Method and device for detecting process access right and mobile terminal | |
CN106909833A (en) | A kind of safety protecting method and device | |
US9851980B1 (en) | Distributed update service enabling update requests | |
CN104573489A (en) | Method and device for forbidding application to establish desktop icon | |
CN104184821B (en) | The method and apparatus of session and terminal responds feedback based on sending out notice |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220727 Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015 Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park) Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Patentee before: Qizhi software (Beijing) Co.,Ltd. |
|
TR01 | Transfer of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20180102 |
|
CF01 | Termination of patent right due to non-payment of annual fee |