CN105183307B - Application messages display control method and device - Google Patents
Application messages display control method and device Download PDFInfo
- Publication number
- CN105183307B CN105183307B CN201510330052.XA CN201510330052A CN105183307B CN 105183307 B CN105183307 B CN 105183307B CN 201510330052 A CN201510330052 A CN 201510330052A CN 105183307 B CN105183307 B CN 105183307B
- Authority
- CN
- China
- Prior art keywords
- message
- notification bar
- display
- application program
- notification
- 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.)
- Active
Links
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
本发明提供一种应用程序消息显示控制方法,包括步骤:向系统注入并运行用于接管系统通知栏服务的控制模块;所述控制模块依据预设条件过滤应用程序发送的通知栏消息以确定允许显示的通知栏消息;所述控制模块仅向SystemUI发送显示所述允许显示的通知栏消息的消息指令,使SystemUI仅显示所述允许显示的通知栏消息。相应的,本发明还提供一种应用程序消息显示控制装置,本发明所述方法可以控制应用程序选择性地显示通知栏消息,隐藏无用的通知栏消息,显示有用的通知栏消息,避免大量的无用通知栏消息给用户造成的干扰,同时又不丢失重要的消息。
The present invention provides a method for controlling the display of application program messages, comprising the steps of: injecting into the system and running a control module for taking over the system notification bar service; the control module filters the notification bar messages sent by the application program according to preset conditions to determine the allowed Displayed notification bar message: the control module only sends a message instruction to display the allowed notification bar message to SystemUI, so that SystemUI only displays the allowed displayed notification bar message. Correspondingly, the present invention also provides an application program message display control device. The method of the present invention can control the application program to selectively display notification bar messages, hide useless notification bar messages, and display useful notification bar messages, avoiding a large number of Useless notification bar messages disturb users without losing important messages.
Description
技术领域technical field
本发明涉及计算机安全领域,具体而言,本发明涉及一种应用程序消息显示控制方法及装置。The invention relates to the field of computer security, in particular, the invention relates to a method and device for controlling application program message display.
背景技术Background technique
近年来,随着智能手机的广泛应用,Android系统平台作为全球最流行的移动操作系统已具有数以亿计的用户。Android系统为了方便用户查看应用程序的消息通知,提供了通知栏消息服务以便于显示应用程序发送的消息,提醒用户一些重要信息。但同时也给一些恶意广告软件带来了可乘之机,恶意应用程序或者有些正常的第三方应用程序频繁利用系统的消息通知接口显示通知栏消息,而大量的通知栏消息是无用的,多数为广告消息,频繁弹出多条通知栏消息会给用户造成极大的干扰。In recent years, with the widespread use of smart phones, the Android system platform, as the most popular mobile operating system in the world, has hundreds of millions of users. In order to facilitate the user to view the message notification of the application program, the Android system provides a notification bar message service to display the message sent by the application program and remind the user of some important information. But at the same time, it also brings opportunities for some malicious adware. Malicious applications or some normal third-party applications frequently use the system’s message notification interface to display notification bar messages, and a large number of notification bar messages are useless. For advertising messages, frequent pop-up of multiple notification bar messages will cause great disturbance to users.
发明内容Contents of the invention
本发明的目的旨在解决上述至少一个问题,提供一种应用程序消息显示控制方法及装置。The object of the present invention is to solve at least one of the problems above, and provide a method and device for controlling application message display.
为了实现上述目的,本发明提供一种应用程序消息显示控制方法,包括以下步骤:In order to achieve the above object, the present invention provides an application program message display control method, comprising the following steps:
向系统注入并运行用于接管系统通知栏服务的控制模块;Inject into the system and run the control module used to take over the system notification bar service;
所述控制模块依据预设条件过滤应用程序发送的通知栏消息以确定允许显示的通知栏消息;The control module filters the notification bar messages sent by the application program according to preset conditions to determine the notification bar messages that are allowed to be displayed;
所述控制模块仅向SystemUI发送显示所述允许显示的通知栏消息的消息指令,使SystemUI仅显示所述允许显示的通知栏消息。The control module only sends a message instruction to the SystemUI to display the message in the notification bar that is allowed to be displayed, so that the SystemUI only displays the message in the notification bar that is allowed to be displayed.
进一步的,所述控制模块向SystemUI发送消息指令的过程如下:将确定显示的应用程序的通知栏消息对应的消息标识符和消息对象作为参数替换未被允许显示的应用程序通知栏消息的相应参数,通过所述的消息指令传递该参数通知SystemUI显示消息,从而显示允许显示的通知栏消息而隐藏未被允许显示的通知栏消息。Further, the process of the control module sending a message instruction to the SystemUI is as follows: use the message identifier and message object corresponding to the notification bar message of the application that is determined to be displayed as parameters to replace the corresponding parameters of the notification bar message of the application that is not allowed to be displayed , passing the parameter through the message instruction to notify the SystemUI to display the message, so as to display the notification bar messages that are allowed to be displayed and hide the notification bar messages that are not allowed to be displayed.
具体的,所述消息指令为系统提供的接口函数NotificationManager.notify()。Specifically, the message instruction is an interface function NotificationManager.notify() provided by the system.
具体的,所述系统通知栏服务具体指NotificationManagerService,用于接收应用程序发送的消息并执行显示操作。Specifically, the system notification bar service specifically refers to NotificationManagerService, which is used to receive messages sent by applications and perform display operations.
进一步的,还包括如下步骤:接收设定白名单的指令,生成用于记录允许显示其发送的通知栏消息的应用程序包名的列表,以构造所述的用于过滤的预设条件。Further, the method further includes the following steps: receiving an instruction for setting a white list, and generating a list for recording application package names that are allowed to display the notification bar messages sent by it, so as to construct the preset condition for filtering.
进一步的,还包括如下步骤:接收设定黑名单的指令,生成用于记录禁止显示其发送的系统消息的应用程序包名的列表,以构造所述的用于过滤的预设条件。Further, the method further includes the following steps: receiving an instruction for setting a blacklist, and generating a list for recording application package names whose system messages are prohibited from being displayed, so as to construct the preset conditions for filtering.
进一步的,还包括如下步骤:通过远程端口接收云端推送的白名单,以根据该白名单所构造的预设条件实施过滤,以允许显示记录于该白名单中的应用程序包名对应的应用程序发送的通知栏消息。Further, it also includes the following steps: receiving the white list pushed by the cloud through the remote port, so as to implement filtering according to the preset conditions constructed by the white list, so as to allow the display of the application corresponding to the application package name recorded in the white list The notification bar message sent.
进一步的,还包括如下步骤:通过远程端口接收云端推送的黑名单,以根据该黑名单所构造的预设条件实施过滤,以禁止显示记录于该黑名单中的应用程序包名对应的应用程序发送的通知栏消息。Further, it also includes the following steps: receiving the blacklist pushed by the cloud through the remote port, so as to implement filtering according to the preset conditions constructed by the blacklist, so as to prohibit displaying the application corresponding to the application package name recorded in the blacklist The notification bar message sent.
具体的,所述预设条件为判定通知栏消息所属应用程序是否安全的过滤依据,当该应用程序被认证为安全时,确定允许显示其通知栏消息。Specifically, the preset condition is a filtering basis for determining whether the application program to which the notification bar message belongs is safe, and when the application program is certified as safe, it is determined that the notification bar message is allowed to be displayed.
具体的,所述预设条件为判定应用程序发送的通知栏消息重要程度是否高于预设值的过滤依据,当该通知栏消息的重要程度高于预设值时,确定允许显示该通知栏消息。Specifically, the preset condition is a filtering basis for determining whether the importance of the notification bar message sent by the application is higher than the preset value, and when the importance of the notification bar message is higher than the preset value, it is determined that the notification bar is allowed to be displayed information.
具体的,所述预设条件为判定应用程序发送的通知栏消息被允许显示的用户统计数据是否高于预设值的过滤依据,当该通知栏消息的被允许显示的用户统计数据高于预设值时,确定允许显示该通知栏消息。Specifically, the preset condition is a filtering basis for determining whether the user statistical data allowed to be displayed in the notification bar message sent by the application program is higher than a preset value. When the user statistical data allowed to be displayed in the notification bar message is higher than the preset value When set, confirms that the notification bar message is allowed to be displayed.
进一步的,还包括如下步骤:响应于查看指令,通过用户界面显示未经过滤的由应用程序发送的所有通知栏消息,包括所述允许显示的通知栏消息,和未被允许显示的通知栏消息。Further, the method further includes the following step: in response to the viewing instruction, displaying through the user interface all unfiltered notification bar messages sent by the application program, including the notification bar messages that are allowed to be displayed and the notification bar messages that are not allowed to be displayed .
一种应用程序消息显示控制装置,包括:An application program message display control device, comprising:
注入单元,用于向系统注入并运行用于接管系统通知栏服务的控制模块;An injection unit is used to inject into the system and run a control module for taking over the system notification bar service;
过滤单元,用于所述控制模块依据预设条件过滤应用程序发送的通知栏消息以确定允许显示的通知栏消息;The filtering unit is used for the control module to filter the notification bar messages sent by the application program according to preset conditions to determine the notification bar messages that are allowed to be displayed;
显示单元,用于所述控制模块仅向SystemUI发送显示所述允许显示的通知栏消息的消息指令,使SystemUI仅显示所述允许显示的通知栏消息。The display unit is used for the control module to only send a message instruction to display the message in the notification bar that is allowed to be displayed to the SystemUI, so that the SystemUI only displays the message in the notification bar that is allowed to be displayed.
具体的,所述控制模块向SystemUI发送消息指令的过程如下:将确定显示的应用程序的通知栏消息对应的消息标识符和消息对象作为参数替换未被允许显示的应用程序通知栏消息的相应参数,通过所述的消息指令传递该参数通知SystemUI显示消息,从而显示允许显示的通知栏消息而隐藏未被允许显示的通知栏消息。Specifically, the process of the control module sending a message instruction to the SystemUI is as follows: use the message identifier and message object corresponding to the notification bar message of the application that is determined to be displayed as parameters to replace the corresponding parameters of the notification bar message of the application program that is not allowed to be displayed , passing the parameter through the message instruction to notify the SystemUI to display the message, so as to display the notification bar messages that are allowed to be displayed and hide the notification bar messages that are not allowed to be displayed.
具体的,所述消息指令为系统提供的接口函数NotificationManager.notify()。Specifically, the message instruction is an interface function NotificationManager.notify() provided by the system.
具体的,所述系统通知栏服务具体指NotificationManagerService,用于接收应用程序发送的消息并执行显示操作。Specifically, the system notification bar service specifically refers to NotificationManagerService, which is used to receive messages sent by applications and perform display operations.
进一步的,还包括白名单生成单元,接收设定白名单的指令,生成用于记录允许显示其发送的通知栏消息的应用程序包名的列表,以构造所述的用于过滤的预设条件。Further, it also includes a whitelist generation unit, which receives an instruction to set a whitelist, and generates a list for recording the names of application packages that are allowed to display the notification bar messages sent by it, so as to construct the preset conditions for filtering .
进一步的,还包括黑名单生成单元,接收设定黑名单的指令,生成用于记录禁止显示其发送的系统消息的应用程序包名的列表,以构造所述的用于过滤的预设条件。Further, it also includes a blacklist generation unit, which receives an instruction for setting a blacklist, and generates a list for recording application package names whose system messages are prohibited from being displayed, so as to construct the preset conditions for filtering.
进一步的,所述过滤单元通过远程端口接收云端推送的白名单,以根据该白名单所构造的预设条件实施过滤,以允许显示记录于该白名单中的应用程序包名对应的应用程序发送的通知栏消息。Further, the filtering unit receives the white list pushed by the cloud through the remote port, so as to perform filtering according to the preset conditions constructed by the white list, so as to allow displaying the sending of the application program corresponding to the application package name recorded in the white list. notification bar message.
进一步的,所述过滤单元通过远程端口接收云端推送的黑名单,以根据该黑名单所构造的预设条件实施过滤,以禁止显示记录于该黑名单中的应用程序包名对应的应用程序发送的通知栏消息。Further, the filtering unit receives the blacklist pushed by the cloud through the remote port, so as to perform filtering according to the preset conditions constructed by the blacklist, so as to prohibit the sending of the application corresponding to the application package name recorded in the blacklist. notification bar message.
具体的,所述预设条件为判定通知栏消息所属应用程序是否安全的过滤依据,当该应用程序被认证为安全时,确定允许显示其通知栏消息。Specifically, the preset condition is a filtering basis for determining whether the application program to which the notification bar message belongs is safe, and when the application program is certified as safe, it is determined that the notification bar message is allowed to be displayed.
具体的,所述预设条件为判定应用程序发送的通知栏消息重要程度是否高于预设值的过滤依据,当该通知栏消息的重要程度高于预设值时,确定允许显示该通知栏消息。Specifically, the preset condition is a filtering basis for determining whether the importance of the notification bar message sent by the application is higher than the preset value, and when the importance of the notification bar message is higher than the preset value, it is determined that the notification bar is allowed to be displayed information.
具体的,所述预设条件为判定应用程序发送的通知栏消息被允许显示的用户统计数据是否高于预设值的过滤依据,当该通知栏消息的被允许显示的用户统计数据高于预设值时,确定允许显示该通知栏消息。Specifically, the preset condition is a filtering basis for determining whether the user statistical data allowed to be displayed in the notification bar message sent by the application program is higher than a preset value. When the user statistical data allowed to be displayed in the notification bar message is higher than the preset value When set, confirms that the notification bar message is allowed to be displayed.
具体的,所述显示单元响应于查看指令,通过用户界面显示未经过滤的由应用程序发送的所有通知栏消息,包括所述允许显示的通知栏消息,和未被允许显示的通知栏消息。Specifically, in response to the viewing instruction, the display unit displays all unfiltered notification bar messages sent by the application through the user interface, including the notification bar messages that are allowed to be displayed and the notification bar messages that are not allowed to be displayed.
相比现有技术,本发明的方案具有以下优点:Compared with the prior art, the solution of the present invention has the following advantages:
1、通过注入控制模块,运行使其接管系统的通知栏管理服务,依据预设条件过滤应用程序发送的通知栏消息,将过滤后允许显示的通知栏消息,发送至SystemUI以显示相应的通知栏消息,从而可以禁止无用通知栏消息的显示,减少无用通知栏消息对用户造成的干扰,同时也不会丢失重要的通知栏消息。1. By injecting the control module, run the notification bar management service to make it take over the system, filter the notification bar messages sent by the application according to the preset conditions, and send the filtered notification bar messages that are allowed to be displayed to SystemUI to display the corresponding notification bar Messages, so that the display of useless notification bar messages can be prohibited, reducing the interference caused by useless notification bar messages to the user, and at the same time, important notification bar messages will not be lost.
2、本发明依据用户设定的黑白名单过滤应用程序的通知栏消息,使得用户可以自主选择接收的通知栏消息,同时结合云端服务器自动生成的黑白名单,推荐允许或禁止显示的应用程序的通知栏消息,尽可能减少无用通知栏消息,保留有用的重要的且用户需要的应用程序的通知栏消息,使得通知栏消息的显示更符合用户的需求。2. The present invention filters the notification bar messages of the application program according to the black and white lists set by the user, so that the user can independently select the notification bar messages to be received, and at the same time combine the black and white lists automatically generated by the cloud server to recommend the notifications of the application programs that are allowed or prohibited to be displayed Bar messages, reduce useless notification bar messages as much as possible, and retain useful and important notification bar messages of applications that users need, so that the display of notification bar messages can better meet the needs of users.
本发明附加的方面和优点将在下面的描述中部分给出,这些将从下面的描述中变得明显,或通过本发明的实践了解到。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 schematic diagram of the principles of the application program message display control method of the present invention;
图2为本发明所述应用程序消息显示控制装置示意框图。Fig. 2 is a schematic block diagram of an application program message display control device according to 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(Personal Digital Assistant,个人数字助理),其可以包括射频接收器、寻呼机、互联网/内联网访问、网络浏览器、记事本、日历和/或GPS(Global Positioning System,全球定位系统)接收器;常规膝上型和/或掌上型计算机或其他设备,其具有和/或包括射频接收器的常规膝上型和/或掌上型计算机或其他设备。这里所使用的“终端”、“终端设备”可以是便携式、可运输、安装在交通工具(航空、海运和/或陆地)中的,或者适合于和/或配置为在本地运行,和/或以分布形式,运行在地球和/或空间的任何其他位置运行。这里所使用的“终端”、“终端设备”还可以是通信终端、上网终端、音乐/视频播放终端,例如可以是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 equipment" used here can also be communication terminals, Internet terminals, music/video playback terminals, such as PDAs, MIDs (Mobile Internet Devices, mobile Internet devices) and/or with music/video playback terminals. 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 remote network device used here includes, but is not limited to, a computer, a network host, a single network server, a set of multiple network servers, or a cloud formed by multiple servers. Here, the cloud is composed of a large number of computers or network servers based on cloud computing (Cloud Computing), wherein cloud computing is a kind 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.
在Android系统中,状态栏通知是一个重要的功能,系统或应用程序通过系统的通知服务发送通知消息以提醒用户。Notification,即通知,是一种具有全局效果的通知,展示在屏幕的顶端,表现为一个图标的形式,当用户向下滑动的时候展示出通知的具体内容。通知一般通过NotificationManagerService发送一个Notification对象来完成。其中,NotificationManagerService是一个系统级服务,位于应用程序的框架层,应用程序通过接口函数NotificationManager.notify()向系统发送全局通知。具体在发送通知时,需要创建一个Notification对象来承载通知的内容,该对象不会直接通过Notification的构造方法获取,而是通过类Notification.Builder实例化一个Builder对象设置通知的各项属性,通过Notification.Builder.builder()方法得到一个Notification对象,然后使用该Notification对象通过方法NotificationManager.notify()发送通知。其中,Notification对象设置的通知的属性包括图标、文字、提示声音、振动、灯光等。In the Android system, the status bar notification is an important function, and the system or the application program sends a notification message through the notification service of the system to remind the user. Notification, that is, notification, is a notification with a global effect. It is displayed on the top of the screen in the form of an icon. When the user slides down, the specific content of the notification is displayed. Notification is generally done by sending a Notification object through NotificationManagerService. Among them, NotificationManagerService is a system-level service, located in the framework layer of the application program, and the application program sends global notifications to the system through the interface function NotificationManager.notify(). Specifically, when sending a notification, you need to create a Notification object to carry the content of the notification. This object will not be obtained directly through the construction method of Notification, but through the class Notification.Builder to instantiate a Builder object to set the properties of the notification, and through Notification The .Builder.builder() method gets a Notification object, and then uses the Notification object to send a notification through the method NotificationManager.notify(). Among them, the properties of the notification set by the Notification object include icon, text, prompt sound, vibration, light and so on.
为了接管上述NotificationManagerService服务,本发明对Root后的Android系统注入相应的控制模块,以实现对应用程序发送的通知栏消息的管理。In order to take over the above-mentioned NotificationManagerService service, the present invention injects a corresponding control module into the rooted Android system, so as to realize the management of the notification message sent by the application program.
众所周知,Root权限是指Unix类操作系统(包括Linux、Android)的系统管理员权限,类似于Windows(视窗)系统中的Administrator(管理员)权限;Root权限可以访问和修改用户的移动设备中几乎所有的文件(Android系统文件及用户文件,不包括ROM)。鉴于此,业内提供了多种多样的提权方案用于获取Android系统的Root权限,实现用户权限提升,达致全面控制操作系统的目的。这些提权方案,依提权后权限作用的生命周期来看,包括永久Root权限和临时Root权限,顾名思义,永久Root权限情况下,应用程序一经Root授权,以后可不必再进行Root提权;而临时Root权限情况下,权限作用的生命周期只是操作系统的一次从开机到关机的过程,下次开机依然需要进行Root。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). In view of this, the industry provides a variety of privilege escalation schemes to obtain the Root privilege of the Android system, realize user privilege escalation, and achieve the purpose of fully controlling the operating system. These privilege escalation schemes, according to the life cycle of privileges after privilege escalation, include permanent root privileges and temporary root privileges. As the name implies, in the case of permanent root privileges, once the application is root-authorized, there is no need to perform root privilege escalation in the future; and In the case of temporary root authority, the life cycle of the authority is only a process from booting to shutting down of the operating system, and rooting is still required for the next boot.
无论采用何种Root方式,提权的基本原理均是通过向系统植入用于接收权限请求的su,再结合SuperUser.apk应用程序实现人机交互,通过su与SuperUser.apk在运行时的相互配合,来实现有效的权限管理。本发明获取Root权限以便于在系统中注入控制模块,以接管原来的系统通知栏服务NotificationManagerService,对应用程序发送通知的行为进行监控。但采用何种Root方式不作为对本发明的限制。Regardless of the root method adopted, the basic principle of privilege escalation is to implant su to the system to receive permission requests, and then combine the SuperUser.apk application to realize human-computer interaction. Through the mutual interaction between su and SuperUser.apk Cooperate to achieve effective rights management. The present invention obtains the Root authority so as to inject the control module into the system, so as to take over the original system notification bar service NotificationManagerService, and monitor the behavior of sending notifications by the application program. However, which Root method is adopted is not a limitation of the present invention.
基于上述原理,参考图1所示,本发明提供一种应用程序消息显示控制方法,包括以下步骤:Based on the above principles, as shown in FIG. 1, the present invention provides a method for controlling application message display, which includes the following steps:
S11、向系统注入并运行用于接管系统通知栏服务的控制模块;S11. Injecting into the system and running a control module for taking over the system notification bar service;
为了控制应用程序发送的通知栏消息,可以选择性地为用户提供通知栏消息,向系统注入用于接管系统通知栏服务的控制模块,即接管NotificationManagerService的控制模块,本发明实施例采用注入so文件的方式将控制模块植入进行Root后的Android系统,具体注入过程如下:In order to control the notification bar message sent by the application program, the user can be selectively provided with the notification bar message, and the control module used to take over the system notification bar service, that is, the control module that takes over the NotificationManagerService, can be injected into the system. The embodiment of the present invention adopts the method of injecting the so file The control module is implanted into the rooted Android system in the following way, and the specific injection process is as follows:
首先,暂停系统服务进程,即挂起目的进程;First, suspend the system service process, that is, suspend the target process;
然后,将修改后的系统服务进程的库文件覆盖原库文件;其中,修改后的库文件中的函数包含本发明所述控制模块的功能代码、jar包、.so文件等。从而将所述监控模块注入系统服务进程,对指定的其他服务进程的特定操作进行监控。Then, the library file of the modified system service process is covered with the original library file; wherein, the functions in the modified library file include the function code, jar package, .so file, etc. of the control module of the present invention. Therefore, the monitoring module is injected into the system service process to monitor specific operations of other designated service processes.
所述控制模块的代码被注入并运行于SystemServer进程,由此接管系统通知栏服务,监控应用程序发送通知栏消息的行为。当有应用程序调用接口函数NotificationManager.notify(int id,Notification notification)向NotificationManagerService发送通知时,所述控制模块对其进行拦截,获取消息标识符和消息对象,其中所述消息标识符id用于记录消息对象在内存中的存储地址,消息对象notification用于记录应用程序发送的消息内容、属性等信息。The code of the control module is injected and runs in the SystemServer process, thereby taking over the system notification bar service, and monitoring the behavior of the application program sending the notification bar message. When an application program calls the interface function NotificationManager.notify(int id, Notification notification) to send a notification to the NotificationManagerService, the control module intercepts it to obtain a message identifier and a message object, wherein the message identifier id is used for recording The storage address of the message object in the memory, and the message object notification is used to record information such as message content and attributes sent by the application.
S12、所述控制模块依据预设条件过滤应用程序发送的通知栏消息以确定允许显示的通知栏消息;S12. The control module filters the notification bar messages sent by the application program according to preset conditions to determine the notification bar messages that are allowed to be displayed;
依据预设条件过滤应用程序发送的通知栏消息,以确定允许显示的通知栏消息。在具体实施例中,所述预设条件可以由用户设定的白名单构造,即允许属于白名单的应用程序显示其发送的通知栏消息。用户可以将重要的应用软件设定为白名单,如网银类等软件。接受用户设定白名单的指令,将用户选定的应用程序的包名记录于一个列表以允许该些应用程序显示其发送的通知栏消息。向用户提供一个设定白名单的界面,依次显示所有应用程序,每个应用程序对应提供一个按钮,用于接受用户将其加入白名单的选中操作。该白名单还可以通过远程端口传到云端服务器,对应存储于服务器中与第三方应用账户对应的预分配内存。The notification bar messages sent by the application are filtered according to preset conditions, so as to determine the notification bar messages that are allowed to be displayed. In a specific embodiment, the preset condition may be constructed by a whitelist set by the user, that is, applications belonging to the whitelist are allowed to display notification bar messages sent by them. Users can set important application software as a white list, such as online banking and other software. Accept the instruction of the user to set the white list, and record the package names of the applications selected by the user in a list to allow these applications to display the notification bar messages sent by them. Provide the user with an interface for setting the whitelist, displaying all applications in turn, and each application provides a button for accepting the user's selection operation to add it to the whitelist. The white list can also be transmitted to the cloud server through a remote port, corresponding to the pre-allocated memory stored in the server corresponding to the third-party application account.
在其他具体实施例中,所述预设条件可以由用户设定的黑名单构造,即禁止属于黑名单的应用程序显示其发送的通知栏消息。用户可以对一些经常显示广告通知栏消息的应用软件设定黑名单。接受用户设定黑名单的指令,将用户选定的应用程序的包名记录于一个列表以禁止该些应用程序显示其发送的通知栏消息。向用户提供一个设定黑名单的界面,依次显示所有应用程序,每个应用程序对应提供一个按钮,用于接受用户将其加入黑名单的选中操作。该黑名单还可以通过远程端口传到云端服务器,对应存储于服务器中与第三方应用账户对应的预分配内存。In other specific embodiments, the preset condition may be constructed by a blacklist set by the user, that is, applications belonging to the blacklist are prohibited from displaying notification bar messages sent by them. Users can set a blacklist for some application software that often displays advertisement notification bar messages. Accept the instruction of the user to set the blacklist, and record the package names of the applications selected by the user in a list to prohibit these applications from displaying the notification bar messages sent by them. Provide the user with an interface for setting the blacklist, displaying all applications in turn, and each application provides a corresponding button for accepting the user's selection operation to add it to the blacklist. The blacklist can also be transmitted to the cloud server through a remote port, corresponding to the pre-allocated memory stored in the server corresponding to the third-party application account.
在其他实施例中,云端服务器配置白名单和/或黑名单,通过远程端口推送该白名单和/或黑名单。采用动态分析方法或静态分析方法分析确定应用程序的安全性,其中,In other embodiments, the cloud server configures the whitelist and/or blacklist, and pushes the whitelist and/or blacklist through a remote port. Use dynamic analysis method or static analysis method to analyze and determine the security of the application program, wherein,
所述静态分析方法具体操作为:提取安装文件的特征信息,如包名、版本号、MD5签名、代码、字符串等信息,与云端服务器的特征码数据库中的特征码一一进行匹配,根据匹配确定表征安装文件安全性的判定信息,即安全等级信息,根据安全等级确定安装文件是否安全。其中,所述特征码数据库记录特征码信息与该特征码信息所对应的安全等级之间的映射关系。The specific operation of the static analysis method is: extract the feature information of the installation file, such as package name, version number, MD5 signature, code, character string and other information, and match the feature codes in the feature code database of the cloud server one by one, according to Matching determines the judgment information representing the security of the installation file, that is, the security level information, and determines whether the installation file is safe according to the security level. Wherein, the feature code database records the mapping relationship between feature code information and the security level corresponding to the feature code information.
所述动态分析方法具体操作为:解析安装文件,创建与应用程序运行环境相应的虚拟机环境,监控应用程序运行在所述虚拟机上的动态行为和网络交换信息,根据监控结果确定表征安装文件安全性的判定信息,即安全等级信息,根据安全等级确定安装文件是否安全。The specific operation of the dynamic analysis method is: parsing the installation file, creating a virtual machine environment corresponding to the application program running environment, monitoring the dynamic behavior and network exchange information of the application program running on the virtual machine, and determining the representative installation file according to the monitoring results The security judgment information, that is, the security level information, determines whether the installation file is safe according to the security level.
经过上述静态分析或动态分析,将确定安全的应用程序包名记录于白名单,将确定不安全的应用程序包名记录于黑名单。经过远程端口推送相应的白名单和/或黑名单,以允许或禁止显示白名单或黑名单中记录的应用程序发送的通知栏消息。After the above static analysis or dynamic analysis, the names of the application packages that are determined to be safe are recorded in the white list, and the names of the application packages that are determined to be unsafe are recorded in the black list. Push the corresponding whitelist and/or blacklist through the remote port to allow or prohibit the display of notification bar messages sent by applications recorded in the whitelist or blacklist.
云端服务器也可以将沙箱中的应用程序放入黑名单推送,沙箱是虚拟软件,通过重定向技术,把应用程序生成和修改的文件定向到自身文件夹中。云端服务器会隔离一些安全性不确定的应用程序,使其运行在虚拟的环境中,与真实的系统环境隔离,以避免其对系统造成威胁。故云端服务器将沙箱中的应用程序放入黑名单,以禁止其显示发送的通知栏消息。The cloud server can also put the applications in the sandbox into the blacklist and push them. The sandbox is a virtual software that directs the files generated and modified by the application to its own folder through redirection technology. The cloud server will isolate some applications with uncertain security, make them run in a virtual environment, and isolate them from the real system environment, so as to avoid threats to the system. Therefore, the cloud server puts the application program in the sandbox into the blacklist to prohibit it from displaying the notification bar message sent.
在其他实施例中,通过判定应用程序是否安全,从而确定是否允许其显示发送的通知栏消息。调用安全软件对其进行扫描,如果扫描结果确定其安全,则允许其显示发送的通知栏消息,否则不允许。In other embodiments, by determining whether the application program is safe, it is determined whether to allow it to display the sent notification bar message. Call the security software to scan it, if the scanning result confirms that it is safe, it is allowed to display the notification bar message sent, otherwise it is not allowed.
在其他实施例中,云端服务器通过统计应用程序被允许显示通知栏消息的用户数量确定是否允许其显示发送的通知栏消息。如果统计的用户数量高于预设值,则允许其显示发送的通知栏消息,将其加入白名单,否则不允许,将其加入黑名单。In other embodiments, the cloud server determines whether to allow the application program to display the sent notification bar message by counting the number of users allowed to display the notification bar message. If the counted number of users is higher than the preset value, it is allowed to display the sent notification bar message and added to the whitelist, otherwise it is not allowed and added to the blacklist.
根据上述构造的预设条件,对用户系统安装的所有应用程序发送的通知栏消息进行过滤,确定允许显示的通知栏消息。According to the preset conditions of the above structure, the notification bar messages sent by all the application programs installed in the user system are filtered to determine the notification bar messages that are allowed to be displayed.
S13、所述控制模块仅向SystemUI发送显示所述允许显示的通知栏消息的消息指令,使SystemUI仅显示所述允许显示的通知栏消息。S13. The control module only sends a message instruction to display the message in the notification bar that is allowed to be displayed to the SystemUI, so that the SystemUI only displays the message in the notification bar that is allowed to be displayed.
Android2.2以后的版本,都将原本存在于framework-res.apk中的状态栏和下拉通知栏界面控制被分割出一个单独的apk文件,保存在System/app文件夹中。SystemUI.apk包括状态栏图标、XML、控制文件等,将SystemUI.apk分割出来是为了更方便地对其进行修改,以满足开发者的设计需求。其中,SystemUI包括USB和Statusbar两个模块,状态栏主要用来显示一些系统图标、系统时间、应用通知图标、应用通知内容等信息。其中,Statusbar模块用于控制和管理状态栏。For versions after Android 2.2, the status bar and drop-down notification bar interface controls that originally existed in framework-res.apk are divided into a separate apk file and saved in the System/app folder. SystemUI.apk includes status bar icons, XML, control files, etc. The purpose of separating SystemUI.apk is to modify it more conveniently to meet the design needs of developers. Among them, SystemUI includes two modules of USB and Statusbar, and the status bar is mainly used to display some system icons, system time, application notification icons, application notification content and other information. Among them, the Statusbar module is used to control and manage the status bar.
状态栏与Toast都可以起到通知和提醒的作用,但两者的实现原理和表现形式不同。Toast相当于一个Widget组件,类似于没有按钮的对话框。而状态栏可以与系统中的其他应用进行交互,显示其他应用发送的通知栏消息,可以在不使用Activity的情况下给用户提醒和通知。Both the status bar and the toast can play the role of notification and reminder, but the implementation principles and manifestations of the two are different. Toast is equivalent to a Widget component, similar to a dialog box without buttons. The status bar can interact with other applications in the system, display notification bar messages sent by other applications, and can remind and notify the user without using the Activity.
具体为NotificationManagerService调用notifiy方法发送通知,与StatusBarManagerService通过Binder机制进行交互,将发送的通知传到StatusBarManagerService,由该服务调用addNotification方法将通知消息进行显示,其中,addNotificationViews(keys,notification)用于显示图标,tick(notification)用于显示消息内容。本发明实施例中,所述控制模块接管NotificationManagerService,对应用程序调用notifiy方法发送通知的行为进行拦截,具体可以通过调用cancel函数取消应用程序发通知栏消息的行为,以禁止不允许显示通知栏消息的应用程序。还可以通过将确定显示的应用程序的通知栏消息对应的消息标识符和消息对象作为参数替换未被允许显示的应用程序通知栏消息的相应参数,从而通过notifiy方法传递该参数以显示允许显示的通知栏消息,隐藏未被允许显示的通知栏消息。由此,所述控制模块通过限制被禁止显示的消息的应用程序调用notifiy方法向SystemUI发送显示消息通知栏的消息指令,仅向SystemUI发送显示所述允许显示的通知栏消息的消息指令,从而使SystemUI仅显示所述允许显示的通知栏消息。Specifically, the NotificationManagerService calls the notifiy method to send notifications, interacts with the StatusBarManagerService through the Binder mechanism, and passes the sent notifications to the StatusBarManagerService, and the service calls the addNotification method to display the notification message. Among them, addNotificationViews(keys, notification) is used to display icons, tick(notification) is used to display message content. In the embodiment of the present invention, the control module takes over the NotificationManagerService, and intercepts the behavior of the application program calling the notify method to send notifications. Specifically, the behavior of the application program sending notification bar messages can be canceled by calling the cancel function, so as to prohibit the display of notification bar messages s application. You can also use the message identifier and message object corresponding to the notification bar message of the application that is determined to be displayed as a parameter to replace the corresponding parameter of the notification bar message of the application that is not allowed to be displayed, so as to pass the parameter through the notifiy method to display the message that is allowed to be displayed. Notification bar messages, hide notification bar messages that are not allowed to be displayed. Thus, the control module calls the notifiy method to send a message instruction for displaying a message notification bar to the SystemUI by restricting the application program of the message that is prohibited from being displayed, and only sends a message instruction for displaying the message in the notification bar message that is allowed to be displayed to the SystemUI, so that SystemUI only displays the notification bar messages that are allowed to be displayed.
此外,对应于所有的应用程序发送的所有通知栏消息提供一个消息管理界面,响应于用户的查看指令,通过该消息管理界面显示未经过滤的由应用程序发送的所有通知栏消息,包括允许显示的通知栏消息和不被允许显示的通知栏消息。In addition, a message management interface is provided corresponding to all notification bar messages sent by all applications, and in response to user viewing instructions, all notification bar messages sent by applications without filtering are displayed through the message management interface, including allowing display The notification bar message and the notification bar message that are not allowed to be displayed.
参考图2所示,本发明还提供一种应用程序消息显示控制装置,包括注入单元11、过滤单元12、显示单元13,其中,Referring to FIG. 2, the present invention also provides an application program message display control device, including an injection unit 11, a filter unit 12, and a display unit 13, wherein,
注入单元11用于向系统注入并运行用于接管系统通知栏服务的控制模块;The injection unit 11 is used for injecting into the system and running a control module for taking over the system notification bar service;
为了控制应用程序发送的通知栏消息,可以选择性地为用户提供通知栏消息,由注入单元11向系统注入用于接管系统通知栏服务的控制模块,即接管NotificationManagerService的控制模块,本发明实施例注入单元11采用注入so文件的方式将控制模块植入进行Root后的Android系统,具体注入过程如下:In order to control the notification bar message sent by the application program, the notification bar message can be selectively provided to the user, and the injection unit 11 injects into the system a control module for taking over the notification bar service of the system, that is, a control module for taking over NotificationManagerService, the embodiment of the present invention The injection unit 11 implants the control module into the Android system after rooting by injecting the so file, and the specific injection process is as follows:
首先,暂停系统服务进程,即挂起目的进程;First, suspend the system service process, that is, suspend the target process;
然后,将修改后的系统服务进程的库文件覆盖原库文件;其中,修改后的库文件中的函数包含本发明所述控制模块的功能代码、jar包、.so文件等。从而将所述监控模块注入系统服务进程,对指定的其他服务进程的特定操作进行监控。Then, the library file of the modified system service process is covered with the original library file; wherein, the functions in the modified library file include the function code, jar package, .so file, etc. of the control module of the present invention. Therefore, the monitoring module is injected into the system service process to monitor specific operations of other designated service processes.
所述控制模块的代码被注入并运行于SystemServer进程,由此接管系统通知栏服务,监控应用程序发送通知栏消息的行为。当有应用程序调用接口函数NotificationManager.notify(int id,Notification notification)向NotificationManagerService发送通知时,所述控制模块对其进行拦截,获取消息标识符和消息对象,其中所述消息标识符id用于记录消息对象在内存中的存储地址,消息对象notification用于记录应用程序发送的消息内容、属性等信息。The code of the control module is injected and runs in the SystemServer process, thereby taking over the system notification bar service, and monitoring the behavior of the application program sending the notification bar message. When an application program calls the interface function NotificationManager.notify(int id, Notification notification) to send a notification to the NotificationManagerService, the control module intercepts it to obtain a message identifier and a message object, wherein the message identifier id is used for recording The storage address of the message object in the memory, and the message object notification is used to record information such as message content and attributes sent by the application.
过滤单元12用于所述控制模块依据预设条件过滤应用程序发送的通知栏消息以确定允许显示的通知栏消息;The filtering unit 12 is used for the control module to filter notification bar messages sent by applications according to preset conditions to determine the notification bar messages that are allowed to be displayed;
过滤单元12依据预设条件过滤应用程序发送的通知栏消息,以确定允许显示的通知栏消息。在具体实施例中,所述预设条件可以由用户设定的白名单构造,即过滤单元12允许属于白名单的应用程序显示其发送的通知栏消息。用户可以将重要的应用软件设定为白名单,如网银类等软件。接受用户设定白名单的指令,将用户选定的应用程序的包名记录于一个列表以允许该些应用程序显示其发送的通知栏消息。向用户提供一个设定白名单的界面,依次显示所有应用程序,每个应用程序对应提供一个按钮,用于接受用户将其加入白名单的选中操作。该白名单还可以通过远程端口传到云端服务器,对应存储于服务器中与第三方应用账户对应的预分配内存。The filtering unit 12 filters the notification bar messages sent by the application program according to preset conditions, so as to determine the notification bar messages that are allowed to be displayed. In a specific embodiment, the preset condition may be constructed by a whitelist set by the user, that is, the filtering unit 12 allows applications belonging to the whitelist to display notification bar messages sent by them. Users can set important application software as a white list, such as online banking and other software. Accept the instruction of the user to set the white list, and record the package names of the applications selected by the user in a list to allow these applications to display the notification bar messages sent by them. Provide the user with an interface for setting the whitelist, displaying all applications in turn, and each application provides a button for accepting the user's selection operation to add it to the whitelist. The white list can also be transmitted to the cloud server through a remote port, corresponding to the pre-allocated memory stored in the server corresponding to the third-party application account.
在其他具体实施例中,所述预设条件可以由用户设定的黑名单构造,即禁止属于黑名单的应用程序显示其发送的通知栏消息。用户可以对一些经常显示广告通知栏消息的应用软件设定黑名单。接受用户设定黑名单的指令,将用户选定的应用程序的包名记录于一个列表以禁止该些应用程序显示其发送的通知栏消息。向用户提供一个设定黑名单的界面,依次显示所有应用程序,每个应用程序对应提供一个按钮,用于接受用户将其加入黑名单的选中操作。该黑名单还可以通过远程端口传到云端服务器,对应存储于服务器中与第三方应用账户对应的预分配内存。In other specific embodiments, the preset condition may be constructed by a blacklist set by the user, that is, applications belonging to the blacklist are prohibited from displaying notification bar messages sent by them. Users can set a blacklist for some application software that often displays advertisement notification bar messages. Accept the instruction of the user to set the blacklist, and record the package names of the applications selected by the user in a list to prohibit these applications from displaying the notification bar messages sent by them. Provide the user with an interface for setting the blacklist, displaying all applications in turn, and each application provides a corresponding button for accepting the user's selection operation to add it to the blacklist. The blacklist can also be transmitted to the cloud server through a remote port, corresponding to the pre-allocated memory stored in the server corresponding to the third-party application account.
在其他实施例中,云端服务器配置白名单和/或黑名单,通过远程端口推送该白名单和/或黑名单。采用动态分析方法或静态分析方法分析确定应用程序的安全性,其中,In other embodiments, the cloud server configures the whitelist and/or blacklist, and pushes the whitelist and/or blacklist through a remote port. Use dynamic analysis method or static analysis method to analyze and determine the security of the application program, wherein,
所述静态分析方法具体操作为:提取安装文件的特征信息,如包名、版本号、MD5签名、代码、字符串等信息,与云端服务器的特征码数据库中的特征码一一进行匹配,根据匹配确定表征安装文件安全性的判定信息,即安全等级信息,根据安全等级确定安装文件是否安全。其中,所述特征码数据库记录特征码信息与该特征码信息所对应的安全等级之间的映射关系。The specific operation of the static analysis method is: extract the feature information of the installation file, such as package name, version number, MD5 signature, code, character string and other information, and match the feature codes in the feature code database of the cloud server one by one, according to Matching determines the judgment information representing the security of the installation file, that is, the security level information, and determines whether the installation file is safe according to the security level. Wherein, the feature code database records the mapping relationship between feature code information and the security level corresponding to the feature code information.
所述动态分析方法具体操作为:解析安装文件,创建与应用程序运行环境相应的虚拟机环境,监控应用程序运行在所述虚拟机上的动态行为和网络交换信息,根据监控结果确定表征安装文件安全性的判定信息,即安全等级信息,根据安全等级确定安装文件是否安全。The specific operation of the dynamic analysis method is: parsing the installation file, creating a virtual machine environment corresponding to the application program running environment, monitoring the dynamic behavior and network exchange information of the application program running on the virtual machine, and determining the representative installation file according to the monitoring results The security judgment information, that is, the security level information, determines whether the installation file is safe according to the security level.
经过上述静态分析或动态分析,将确定安全的应用程序包名记录于白名单,将确定不安全的应用程序包名记录于黑名单。经过远程端口推送相应的白名单和/或黑名单,过滤单元12基于该白名单和/或黑名单以允许或禁止显示白名单或黑名单中记录的应用程序发送的通知栏消息。After the above static analysis or dynamic analysis, the names of the application packages that are determined to be safe are recorded in the white list, and the names of the application packages that are determined to be unsafe are recorded in the black list. The corresponding whitelist and/or blacklist are pushed through the remote port, and the filtering unit 12 allows or prohibits display of notification bar messages sent by applications recorded in the whitelist or blacklist based on the whitelist and/or blacklist.
云端服务器也可以将沙箱中的应用程序放入黑名单推送,沙箱是虚拟软件,通过重定向技术,把应用程序生成和修改的文件定向到自身文件夹中。云端服务器会隔离一些安全性不确定的应用程序,使其运行在虚拟的环境中,与真实的系统环境隔离,以避免其对系统造成威胁。故云端服务器将沙箱中的应用程序放入黑名单,以禁止其显示发送的通知栏消息。The cloud server can also put the applications in the sandbox into the blacklist and push them. The sandbox is a virtual software that directs the files generated and modified by the application to its own folder through redirection technology. The cloud server will isolate some applications with uncertain security, make them run in a virtual environment, and isolate them from the real system environment, so as to avoid threats to the system. Therefore, the cloud server puts the application program in the sandbox into the blacklist to prohibit it from displaying the notification bar message sent.
在其他实施例中,通过判定应用程序是否安全,从而确定是否允许其显示发送的通知栏消息。调用安全软件对其进行扫描,如果扫描结果确定其安全,则允许其显示发送的通知栏消息,否则不允许。In other embodiments, by determining whether the application program is safe, it is determined whether to allow it to display the sent notification bar message. Call the security software to scan it, if the scanning result confirms that it is safe, it is allowed to display the notification bar message sent, otherwise it is not allowed.
在其他实施例中,云端服务器通过统计应用程序被允许显示通知栏消息的用户数量确定是否允许其显示发送的通知栏消息。如果统计的用户数量高于预设值,则允许其显示发送的通知栏消息,将其加入白名单,否则不允许,将其加入黑名单。In other embodiments, the cloud server determines whether to allow the application program to display the sent notification bar message by counting the number of users allowed to display the notification bar message. If the counted number of users is higher than the preset value, it is allowed to display the sent notification bar message and added to the whitelist, otherwise it is not allowed and added to the blacklist.
根据上述构造的预设条件,过滤单元12对用户系统安装的所有应用程序发送的通知栏消息进行过滤,确定允许显示的通知栏消息。According to the preset conditions of the above structure, the filtering unit 12 filters the notification bar messages sent by all the application programs installed in the user system, and determines the notification bar messages that are allowed to be displayed.
显示单元13用于所述控制模块仅向systemUI发送显示所述允许显示的通知栏消息的消息指令,使systemUI仅显示所述允许显示的通知栏消息。The display unit 13 is used for the control module to only send a message instruction to display the message in the notification bar that is allowed to be displayed to the systemUI, so that the systemUI only displays the message in the notification bar that is allowed to be displayed.
Android2.2以后的版本,都将原本存在于framework-res.apk中的状态栏和下拉通知栏界面控制被分割出一个单独的apk文件,保存在System/app文件夹中。SystemUI.apk包括状态栏图标、XML、控制文件等,将SystemUI.apk分割出来是为了更方便地对其进行修改,以满足开发者的设计需求。其中,SystemUI包括USB和Statusbar两个模块,状态栏主要用来显示一些系统图标、系统时间、应用通知图标、应用通知内容等信息。其中,Statusbar模块用于控制和管理状态栏。For versions after Android 2.2, the status bar and drop-down notification bar interface controls that originally existed in framework-res.apk are divided into a separate apk file and saved in the System/app folder. SystemUI.apk includes status bar icons, XML, control files, etc. The purpose of separating SystemUI.apk is to modify it more conveniently to meet the design needs of developers. Among them, SystemUI includes two modules of USB and Statusbar, and the status bar is mainly used to display some system icons, system time, application notification icons, application notification content and other information. Among them, the Statusbar module is used to control and manage the status bar.
状态栏与Toast都可以起到通知和提醒的作用,但两者的实现原理和表现形式不同。Toast相当于一个Widget组件,类似于没有按钮的对话框。而状态栏可以与系统中的其他应用进行交互,显示其他应用发送的通知栏消息,可以在不使用Activity的情况下给用户提醒和通知。Both the status bar and the toast can play the role of notification and reminder, but the implementation principles and manifestations of the two are different. Toast is equivalent to a Widget component, similar to a dialog box without buttons. The status bar can interact with other applications in the system, display notification bar messages sent by other applications, and can remind and notify the user without using the Activity.
具体为NotificationManagerService调用notifiy方法发送通知,与StatusBarManagerService通过Binder机制进行交互,将发送的通知传到StatusBarManagerService,由该服务调用addNotification方法将通知消息进行显示,其中,addNotificationViews(keys,notification)用于显示图标,tick(notification)用于显示消息内容。本发明实施例中,所述控制模块接管NotificationManagerService,对应用程序调用notifiy方法发送通知的行为进行拦截,具体可以通过调用cancel函数取消应用程序发通知栏消息的行为,以禁止不允许显示通知栏消息的应用程序。还可以通过将确定显示的应用程序的通知栏消息对应的消息标识符和消息对象作为参数替换未被允许显示的应用程序通知栏消息的相应参数,从而通过notifiy方法传递该参数以使显示单元13显示允许显示的通知栏消息,隐藏未被允许显示的通知栏消息。由此,所述控制模块通过限制被禁止显示的消息的应用程序调用notifiy方法向显示单元13的SystemUI发送显示消息通知栏的消息指令,仅向显示单元13的SystemUI发送显示所述允许显示的通知栏消息的消息指令,从而使显示单元13的SystemUI仅显示所述允许显示的通知栏消息。Specifically, the NotificationManagerService calls the notifiy method to send notifications, interacts with the StatusBarManagerService through the Binder mechanism, and passes the sent notifications to the StatusBarManagerService, and the service calls the addNotification method to display the notification message. Among them, addNotificationViews(keys, notification) is used to display icons, tick(notification) is used to display message content. In the embodiment of the present invention, the control module takes over the NotificationManagerService, and intercepts the behavior of the application program calling the notify method to send notifications. Specifically, the behavior of the application program sending notification bar messages can be canceled by calling the cancel function, so as to prohibit the display of notification bar messages s application. It is also possible to use the message identifier and message object corresponding to the notification bar message of the application that is determined to be displayed as parameters to replace the corresponding parameters of the notification bar message of the application program that is not allowed to be displayed, so that the parameter is passed through the notifiy method to make the display unit 13 Display the notification bar messages that are allowed to be displayed, and hide the notification bar messages that are not allowed to be displayed. Thus, the control module calls the notifiy method to send a message instruction to display the message notification column to the SystemUI of the display unit 13 by restricting the application program of the message that is prohibited from being displayed, and only sends a notification that displays the display permission to the SystemUI of the display unit 13. The message command of the bar message, so that the SystemUI of the display unit 13 only displays the notification bar message that is allowed to be displayed.
此外,对应于所有的应用程序发送的所有通知栏消息,显示单元13提供一个消息管理界面,响应于用户的查看指令,通过该消息管理界面显示未经过滤的由应用程序发送的所有通知栏消息,包括允许显示的通知栏消息和不被允许显示的通知栏消息。In addition, corresponding to all notification bar messages sent by all application programs, the display unit 13 provides a message management interface, in response to the user's viewing instruction, through the message management interface, unfiltered all notification bar messages sent by the application programs are displayed , including notification bar messages that are allowed to be displayed and notification bar messages that are not allowed to be displayed.
综上所述,本发明通过注入控制模块的方式,使该控制模块控制应用程序发送的通知栏消息的显示,基于用户预设和/或云端服务器推送的黑白名单,仅显示允许显示的通知栏消息,隐藏不允许显示的通知栏消息,有选择性地向用户展示通知栏消息,既避免了无用的消息频繁弹出干扰用户,也不丢失有用的消息,更符合用户需求,提高了用户体验度。To sum up, the present invention injects into the control module, so that the control module controls the display of the notification bar message sent by the application program, and only displays the notification bar that is allowed to be displayed based on the user preset and/or the black and white list pushed by the cloud server Messages, hide notification bar messages that are not allowed to be displayed, and selectively display notification bar messages to users, which not only avoids frequent pop-ups of useless messages that interfere with users, but also does not lose useful messages, which is more in line with user needs and improves user experience. .
以上所述仅是本发明的部分实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。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 (20)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510330052.XA CN105183307B (en) | 2015-06-15 | 2015-06-15 | Application messages display control method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510330052.XA CN105183307B (en) | 2015-06-15 | 2015-06-15 | Application messages display control method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN105183307A CN105183307A (en) | 2015-12-23 |
| CN105183307B true CN105183307B (en) | 2018-05-04 |
Family
ID=54905418
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510330052.XA Active CN105183307B (en) | 2015-06-15 | 2015-06-15 | Application messages display control method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN105183307B (en) |
Families Citing this family (24)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105631322A (en) * | 2015-12-25 | 2016-06-01 | 北京奇虎科技有限公司 | Method and device for managing notification bar without ROOT |
| CN105892833A (en) * | 2015-12-30 | 2016-08-24 | 乐视致新电子科技(天津)有限公司 | Popup message processing method and device |
| CN105743774B (en) * | 2016-01-28 | 2019-04-02 | 广州市动景计算机科技有限公司 | Pushed information monitoring device, pushed information monitoring method and client |
| CN105808235A (en) * | 2016-02-24 | 2016-07-27 | 北京奇虎科技有限公司 | Management method and device for notification bar messages of mobile terminal, and mobile terminal |
| CN105808288A (en) * | 2016-02-26 | 2016-07-27 | 深圳天珑无线科技有限公司 | Message push control method and device of operating system |
| CN105892818A (en) * | 2016-03-31 | 2016-08-24 | 北京金山安全软件有限公司 | Information processing method and device and electronic equipment |
| CN107305499B (en) * | 2016-04-22 | 2022-03-04 | 中兴通讯股份有限公司 | Method and device for clearing notification messages of mobile terminal |
| CN106020814A (en) * | 2016-05-16 | 2016-10-12 | 北京奇虎科技有限公司 | Notification bar message processing method and apparatus as well as mobile terminal |
| CN106130974A (en) * | 2016-06-21 | 2016-11-16 | 广东欧珀移动通信有限公司 | A method and terminal for intercepting notification |
| CN106027788A (en) * | 2016-06-21 | 2016-10-12 | 珠海市魅族科技有限公司 | Method and device for processing popup message |
| CN106203150A (en) * | 2016-06-22 | 2016-12-07 | 广州市久邦数码科技有限公司 | A kind of notification management method based on Android system and system thereof |
| CN106095463A (en) * | 2016-06-22 | 2016-11-09 | 北京金山安全软件有限公司 | Notification bar message processing method and device and terminal equipment |
| CN106210009A (en) * | 2016-06-30 | 2016-12-07 | 宇龙计算机通信科技(深圳)有限公司 | A kind of notifier processes method and system of application program |
| CN106371824A (en) * | 2016-08-23 | 2017-02-01 | 广州优视网络科技有限公司 | Portable device and application popup message display control method and apparatus |
| CN106354571B (en) * | 2016-08-29 | 2019-12-27 | 北京小米移动软件有限公司 | Message reminding method and device |
| CN106375349B (en) * | 2016-11-29 | 2019-11-08 | 北京元心科技有限公司 | Multi-system notification message processing method and device |
| CN106685801A (en) * | 2016-12-26 | 2017-05-17 | 维沃移动通信有限公司 | Method for controlling notification message and mobile terminal |
| CN107071751B (en) * | 2016-12-30 | 2019-09-17 | Oppo广东移动通信有限公司 | Message interception method based on mobile terminal architecture and mobile terminal |
| CN107329761B (en) * | 2017-06-30 | 2021-01-15 | 联想(北京)有限公司 | Message prompt processing method and electronic equipment |
| CN107864275B (en) * | 2017-10-27 | 2020-02-11 | Oppo广东移动通信有限公司 | Application setting method and device, mobile terminal and computer readable storage medium |
| CN108572853A (en) * | 2018-04-24 | 2018-09-25 | 北京奇虎科技有限公司 | Interface providing method, apparatus and computing device for system hiding method |
| CN110737491B (en) * | 2018-07-20 | 2024-04-05 | 北京字节跳动网络技术有限公司 | Notification display method, device, equipment and computer readable storage medium |
| CN109085913B (en) * | 2018-08-27 | 2019-09-17 | 珠海格力电器股份有限公司 | APP message pushing management method, intelligent terminal and storage medium |
| CN114741210A (en) * | 2020-12-23 | 2022-07-12 | 成都鼎桥通信技术有限公司 | Multi-system notification message processing method, device, terminal and storage medium |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102693394A (en) * | 2012-06-07 | 2012-09-26 | 奇智软件(北京)有限公司 | Method and device for intercepting calling for service of application program |
| CN102752730A (en) * | 2012-07-19 | 2012-10-24 | 腾讯科技(深圳)有限公司 | Method and device for message handling |
| CN103080936A (en) * | 2010-09-01 | 2013-05-01 | 摩托罗拉移动有限责任公司 | Method and system for reducing notifications to mobile devices based on user preferences |
| CN103116722A (en) * | 2013-02-06 | 2013-05-22 | 北京奇虎科技有限公司 | Processing method, processing device and processing system of notification board information |
| CN103546641A (en) * | 2013-10-29 | 2014-01-29 | 广东欧珀移动通信有限公司 | Mobile terminal notification bar message filtering method and device |
| CN103577749A (en) * | 2013-11-15 | 2014-02-12 | 北京奇虎科技有限公司 | Method and device for processing notification column message |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20040004975A (en) * | 2002-07-08 | 2004-01-16 | 백태선 | Automatic drainage device for a chamber pot |
-
2015
- 2015-06-15 CN CN201510330052.XA patent/CN105183307B/en active Active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103080936A (en) * | 2010-09-01 | 2013-05-01 | 摩托罗拉移动有限责任公司 | Method and system for reducing notifications to mobile devices based on user preferences |
| CN102693394A (en) * | 2012-06-07 | 2012-09-26 | 奇智软件(北京)有限公司 | Method and device for intercepting calling for service of application program |
| CN102752730A (en) * | 2012-07-19 | 2012-10-24 | 腾讯科技(深圳)有限公司 | Method and device for message handling |
| CN103116722A (en) * | 2013-02-06 | 2013-05-22 | 北京奇虎科技有限公司 | Processing method, processing device and processing system of notification board information |
| CN103546641A (en) * | 2013-10-29 | 2014-01-29 | 广东欧珀移动通信有限公司 | Mobile terminal notification bar message filtering method and device |
| CN103577749A (en) * | 2013-11-15 | 2014-02-12 | 北京奇虎科技有限公司 | Method and device for processing notification column message |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105183307A (en) | 2015-12-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN105183307B (en) | Application messages display control method and device | |
| EP3610403B1 (en) | Isolated container event monitoring | |
| CN104462961B (en) | Mobile terminal and its privacy authority optimization method | |
| CN104376263B (en) | The method and apparatus that application behavior intercepts | |
| US7743336B2 (en) | Widget security | |
| CN104376255B (en) | Application program running control method and device | |
| CN104239786B (en) | ROOT-free active defense configuration method and device | |
| CN104881601A (en) | Floating window display setting, control method and device | |
| US10686836B1 (en) | Host-based deception security technology | |
| US20130333039A1 (en) | Evaluating Whether to Block or Allow Installation of a Software Application | |
| WO2015096695A1 (en) | Installation control method, system and device for application program | |
| CN105072255A (en) | Mobile device privacy authority control method, device and corresponding mobile phone device | |
| CN104462880B (en) | Application program shell adding collocation method and device | |
| US9747449B2 (en) | Method and device for preventing application in an operating system from being uninstalled | |
| CN105550595A (en) | Private data access method and system for intelligent communication equipment | |
| CN104462997B (en) | Method, device and system for protecting work data in mobile terminal | |
| CN104408367A (en) | Application program configuration method and device | |
| Egners et al. | Messing with Android's permission model | |
| CN104392176A (en) | Mobile terminal and method for intercepting device manager authority thereof | |
| CN105631322A (en) | Method and device for managing notification bar without ROOT | |
| CN104850779A (en) | Safe application program installing method and safe application program installing device | |
| CN107077565A (en) | Method and device for configuring safety indication information | |
| CN104239797B (en) | Active defense method and device | |
| CN106022128A (en) | Method and device for detecting process access right and mobile terminal | |
| Rahimi et al. | Android security and its rooting—a possible improvement of its security architecture |
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 | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20220727 Address after: 300450 No. 9-3-401, No. 39, Gaoxin 6th Road, Binhai Science Park, Binhai New Area, Tianjin Patentee after: 3600 Technology Group 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 | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20230627 Address after: 1765, floor 17, floor 15, building 3, No. 10 Jiuxianqiao Road, Chaoyang District, Beijing 100015 Patentee after: Beijing Hongxiang Technical Service Co.,Ltd. Address before: 300450 No. 9-3-401, No. 39, Gaoxin 6th Road, Binhai Science Park, Binhai New Area, Tianjin Patentee before: 3600 Technology Group Co.,Ltd. |
|
| CP03 | Change of name, title or address | ||
| CP03 | Change of name, title or address |
Address after: 1765, floor 17, floor 15, building 3, No. 10 Jiuxianqiao Road, Chaoyang District, Beijing 100015 Patentee after: Beijing 360 Zhiling Technology Co.,Ltd. Country or region after: China Address before: 1765, floor 17, floor 15, building 3, No. 10 Jiuxianqiao Road, Chaoyang District, Beijing 100015 Patentee before: Beijing Hongxiang Technical Service Co.,Ltd. Country or region before: China |