CN112417533A - Anti-screenshot method and device, computer equipment and storage medium - Google Patents
Anti-screenshot method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN112417533A CN112417533A CN202011348616.XA CN202011348616A CN112417533A CN 112417533 A CN112417533 A CN 112417533A CN 202011348616 A CN202011348616 A CN 202011348616A CN 112417533 A CN112417533 A CN 112417533A
- Authority
- CN
- China
- Prior art keywords
- target
- window
- attribute data
- view
- data
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 207
- 238000012544 monitoring process Methods 0.000 claims description 28
- 238000004891 communication Methods 0.000 claims description 27
- 238000004590 computer program Methods 0.000 claims description 26
- 230000007246 mechanism Effects 0.000 claims description 20
- 230000008569 process Effects 0.000 claims description 19
- 239000003550 marker Substances 0.000 claims description 5
- 238000012986 modification Methods 0.000 claims description 5
- 230000004048 modification Effects 0.000 claims description 5
- 230000002265 prevention Effects 0.000 abstract description 12
- 230000002787 reinforcement Effects 0.000 abstract description 10
- 230000000694 effects Effects 0.000 abstract description 8
- 238000009434 installation Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 230000008859 change Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 239000011230 binding agent Substances 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000012856 packing Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000006978 adaptation Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000006837 decompression Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
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/70—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
- G06F21/82—Protecting input, output or interconnection devices
- G06F21/84—Protecting input, output or interconnection devices output devices, e.g. displays or monitors
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Human Computer Interaction (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The application relates to an anti-screenshot method, an anti-screenshot device, a computer device and a storage medium. The method comprises the following steps: whether a target method of a target interface is called is monitored, and if the target method is monitored, original window attribute data in the target method are obtained; and modifying the original window attribute data according to the target data to obtain target window attribute data. And the target data is used for setting the target interface as an interface for prohibiting screen capture, and then the target interface is displayed according to the target window attribute data, so that the screen capture prevention effect of all window objects is reinforced, the reinforcement quality is improved, the screen capture of malicious programs is prevented, the malicious programs are prevented from being captured comprehensively, and information leakage is avoided.
Description
Technical Field
The present application relates to the field of data security technologies, and in particular, to a screen capture prevention method and apparatus, a computer device, and a storage medium.
Background
Mobile terminals have become one of the most common consumer electronics products in people's daily lives. With the increase of the demand of people for mobile terminals, the functions realized by the mobile terminals are more and more. The screenshot is an important function of the mobile terminal. Screenshot is that screen elements such as desktop, window, dialog box, tab and the like on the screen are saved as pictures. However, during screenshot, especially when a malicious program running in the background performs screenshot on some pages such as password input and personal privacy, the privacy content, the security content, and the like of the user may be recorded, so that the privacy content, the security content, and the like of the user may be leaked.
In the conventional technology, a screen capture prevention operation is performed through a monitor, and an application program is monitored to capture, position, intercept and the like a screen capture action. However, the monitoring programs rely on that the malicious programs use the screenshot mode provided by the operating system, and some malicious programs may not use the screenshot mode provided by the operating system, so that the screen shots of the malicious programs prevented by the monitoring programs cannot completely prevent the malicious programs from screenshot, and information leakage is caused.
Disclosure of Invention
In view of the above, it is necessary to provide a screen capture prevention method, apparatus, computer device and storage medium capable of effectively preventing information leakage.
An anti-screen capture method, the method comprising:
monitoring whether a target method of a target interface is called, wherein the target method is a method for setting window attributes to display the target interface;
if the target method is monitored, acquiring original window attribute data in the target method;
modifying the original window attribute data according to target data to obtain target window attribute data, wherein the target data is used for setting the target interface as an interface for prohibiting screen capture;
and displaying the target interface according to the target window attribute data.
In one embodiment, the target data is security marker data; the modifying the original window attribute data through the target data to obtain the target window attribute data comprises:
adding a mark parameter in a parameter list of the original window attribute data;
and setting the safety mark data as the parameter value of the marking parameter to obtain the attribute data of the target window.
In one embodiment, the displaying the target interface according to the target window attribute data includes:
sending the target window attribute data to a window management service, the target window attribute data comprising at least one view;
displaying, by the window management service, the at least one view in the target interface according to the target window attribute data.
In one embodiment, before the listening for whether the target method of the target interface is called, the method further includes:
intercepting the call of a window management object based on a hook mechanism; the window management object is used for adding each view required by the target interface into a window and generating the target interface.
In one embodiment, the intercepting a call to a window management object based on a hook mechanism includes:
in the process of adding the view, calling a view adding method through the window management object, and calling a view attribute setting method;
based on the hook mechanism, intercepting the view attribute setting method to call a window communication object so as to intercept the original window attribute data sent to a window management service.
In one embodiment, the invoking a view adding method and a view property setting method through the window management object includes:
and calling a view adding method through the window management object, and calling a view attribute setting method through a view connection link so as to draw a view in the window.
In one embodiment, the intercepting the view attribute setting method calls a window communication object to intercept sending the original window attribute data to a window management service, including:
and calling a window communication object mWindowSession through an interface IWindowSession by the view attribute interception setting method, and sending the original window attribute data to a window management service by an interception window display method addToDisplay.
An anti-screen capture device, the device comprising:
the method monitoring module is used for monitoring whether a target method of a target interface is called or not, wherein the target method is a method for setting window attributes to display the target interface;
the data acquisition module is used for acquiring original window attribute data in the target method if the target method is monitored;
the data modification module is used for modifying the original window attribute data according to target data to obtain target window attribute data, and the target data is used for setting the target interface as an interface for prohibiting screen capture;
an interface display module for displaying the target interface according to the target window attribute data
A computer device comprising a memory storing a computer program and a processor implementing the method steps in the above embodiments when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method steps of the above-mentioned embodiments.
The anti-screenshot method, the anti-screenshot device, the computer equipment and the storage medium are provided. The method comprises the following steps: whether a target method of a target interface is called is monitored, and if the target method is monitored, original window attribute data in the target method are obtained; and modifying the original window attribute data according to the target data to obtain target window attribute data. And the target data is used for setting the target interface as an interface for prohibiting screen capture, and then the target interface is displayed according to the target window attribute data, so that the screen capture prevention effect of all window objects is reinforced, the reinforcement quality is improved, the screen capture of malicious programs is prevented, the malicious programs are prevented from being captured comprehensively, and information leakage is avoided.
Drawings
FIG. 1 is a schematic flow chart diagram of an anti-screenshot method in one embodiment;
FIG. 2 is a flowchart illustrating step S130 according to an embodiment;
FIG. 3a is a flowchart illustrating step S140 according to an embodiment;
FIG. 3b is a schematic flow chart of view addition in one embodiment;
FIG. 4 is a schematic flow chart diagram illustrating an anti-screenshot method in one embodiment;
FIG. 5 is a flowchart illustrating step S410 according to an embodiment;
FIG. 6a is a schematic flow chart illustrating an anti-screenshot method according to another embodiment;
FIG. 6b is a schematic diagram illustrating a process for intercepting a communication object according to another embodiment;
FIG. 7 is a block diagram of an anti-screenshot device in one embodiment;
FIG. 8 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Screenshots are one of the more important functions of mobile terminals. Screenshots are screenshots that save screen elements such as desktop, windows, dialog boxes, tabs, etc. on the screen as pictures. However, during screenshot, especially when a malicious program running in the background performs screenshot on some pages such as password input and personal privacy, the privacy content, the security content, and the like of the user may be recorded, so that the privacy content, the security content, and the like of the user may be leaked. Two methods for preventing screen capture in the related art are illustrated below:
on one hand, the specific position is positioned to add an anti-screen capture code, and the specific process comprises the following steps: the method comprises the steps of firstly decompressing an application installation package, then performing decompiling operation to obtain source codes, then positioning to a specific interface window and a specific position, adding anti-screen capture codes, and finally recompiling, packing and reissuing. However, the positioning method has the problems that the difficulty and the complexity are high in the encoding process, and the performance is poor in the code complexity, the code compatibility and the code running efficiency, for example, the file decompiling process is time-consuming, and the anti-screenshot efficiency is limited to a great extent by operations such as unpacking and packing of an installation package; the compatibility is poor, and the positioning means may be different due to the limitation of different page structures of different versions of different systems.
On the one hand, screen capture prevention operation is carried out through a monitor, because an operating system does not have an interface for directly monitoring screen capture events and does not have broadcasting, the screen capture event monitoring method can only be used for solving the screen capture event monitoring method through other monitoring modes, and the idea of comparing the mainstream is as follows: refreshing data; monitoring the change condition of a screenshot file in a screenshot directory; monitoring the change of all resources to judge; and (3) monitoring the screen capture shortcut key (due to the diversity of the manufacturer-defined operating system and the difference of the shortcut key and a third-party application, the mode of monitoring the screen capture shortcut key is basically infeasible).
For example, in the Android system, by refreshing data in the onPause (), when the device is used for screen capture, in order to make the user feel that the screen capture is successful, an animation effect of a screenshot is designed to prompt the user that the screenshot is successful, and here, the Activity of the screenshot runs into the life cycle of the onPause (). And monitoring the resource change condition in the specific directory by using the FileObserver, and acquiring the file path by taking the resource change condition as a trigger condition. And monitoring the change of the multimedia picture library resource through the contentObserver. When a new picture file is generated on the terminal, a record is inserted into the picture database through the MediaProvider class so as to facilitate the picture query of the picture database of the system, a picture insertion event can be received through the ContentObserver, and the URI of the inserted picture is obtained.
However, the above method still has the following problems: 1) due to the adoption of a partial screenshot mode, screenshot animation is not set, so that information leakage is caused due to the fact that monitoring cannot be carried out; 2) the default screen capturing paths of different mobile phones are possibly different, and a large amount of adaptation processing needs to be carried out; 3) the event names triggered by different mobile phone screenshots may be different, and a large number of test adaptations are required. 4) The picture cannot be acquired immediately after the screen capture event is monitored, and a delay is needed.
Based on the problems, the application provides an anti-screenshot method, which monitors whether a target method of a target interface is called or not, wherein the target method is a method for setting window attributes to display the target interface; if the target method is monitored, acquiring original window attribute data in the target method; modifying the original window attribute data according to the target data to obtain target window attribute data, wherein the target data is used for setting a target interface as an interface for prohibiting screen capture; and displaying the target interface according to the target window attribute data. The anti-screenshot effects of all window objects are reinforced, the reinforcement quality is improved, and therefore screenshots of malicious programs are prevented, the malicious programs are comprehensively prevented from being screenshot, and information leakage is avoided.
In one embodiment, as shown in FIG. 1, there is provided an anti-screenshot method comprising the steps of:
and S110, monitoring whether a target method of the target interface is called or not.
And S120, if the target method is monitored, acquiring original window attribute data in the target method.
Wherein the target method is a method for setting a window property to display the target interface. The window attribute data refers to attribute data of a window set for displaying a target interface, such as attributes of length, width, height, contrast, proportion, and the like of each view to be displayed. Specifically, when an operating system opens an application, the operating system opens the corresponding active component. An Activity component (Activity) is a component that may contain a user interface, primarily for interacting with a user. An application may contain multiple active components. In order to display the target interface, after the active component is started, the operating system creates a window object, and a target method needs to be called in the process of adding the window. In order to prevent malicious programs from capturing images, the target method is monitored in the embodiment, so that all window objects can be protected, the anti-capture of all window objects is reinforced, and the reinforcement quality of the anti-capture is improved. And monitoring a target method of a target interface, wherein the target method carries original window attribute data, and the target interface displayed according to the original window attribute data can be subjected to screen capture by a malicious program, so that if the target method is called, the target method is intercepted, and the original window attribute data in the target method is acquired. The operating system may be an Android system, an IOS mobile operating system, a MacOS operating system, a Microsoft Windows operating system, or the like.
S130, modifying the original window attribute data according to the target data to obtain the target window attribute data.
And S140, displaying a target interface according to the target window attribute data.
And the target data is used for setting the target interface as the interface for prohibiting screen capture. Specifically, if the target interface is displayed using the original window attribute data, the target interface is vulnerable to attack by a malicious program. Therefore, it is necessary to modify the original window attribute data by using the target data with the screen capture prohibition attribute to obtain the target window attribute data, and display the target interface by using the target window attribute data, and the modified target window attribute data no longer allows the target interface to be captured.
In the anti-screenshot method, whether a target method of a target interface is called or not is monitored, and if the target method is monitored, original window attribute data in the target method is acquired; and modifying the original window attribute data according to the target data to obtain the target window attribute data. The target data is used for setting the target interface as the interface for prohibiting screen capture, the target interface is displayed according to the target window attribute data, the screen capture prevention effect of all window objects is reinforced, the reinforcement quality is improved, the screen capture of malicious programs is prevented, the malicious programs are prevented from being captured comprehensively, and information leakage is avoided. Further, compared with the reinforcement processes of decompression, decompiling, positioning, recompiling, packing and reissuing of the installation package in the related art, the method disclosed by the embodiment realizes the reinforcement of the screen capture prevention of the application installation package on the basis of the complete installation package of the application program, not only improves the efficiency of the screen capture prevention reinforcement work, but also further makes up the compatibility of the summary of the related art, and realizes the compatibility between different terminal models and operating system versions.
In one embodiment, as shown in FIG. 2, the target data is security token data. In step S130, the original window attribute data is modified by the target data to obtain target window attribute data, including the following steps:
s210, adding a mark parameter in a parameter list of the original window attribute data.
S220, setting the safety mark data as a parameter value of the marking parameter to obtain the attribute data of the target window.
The safety mark data is used for marking that a certain window or a certain display interface is safe and forbidden to capture. Thus, the original window attribute data is modified using the security token data as the target data. Specifically, the original window attribute data corresponds to a parameter list, and an additional parameter, i.e., a flag parameter, is added to the parameter list. And assigning values by using the target data as the mark parameters, setting the safety mark data as the parameter values of the mark parameters to obtain the attribute data of the target window, and thus, modifying the original window attribute data.
In this embodiment, the target window attribute data is obtained by adding the flag parameter to the parameter list of the original window attribute data and setting the safety flag data as the parameter value of the flag parameter. The screen capture prevention reinforcement processing of the installation package of the application program is achieved, and the quality of application screen capture prevention reinforcement in the operating system is improved.
In one embodiment, as shown in fig. 3a, in step S140, displaying the target interface according to the target window attribute data includes:
s310, sending the target window attribute data to a window management service.
And S320, displaying at least one view in the target interface according to the target window attribute data through the window management service.
Wherein the target window property data comprises at least one view. The window management service is mainly used for managing some states, attributes, view addition, view deletion, view update, window sequence, message collection and processing and the like of the window. Specifically, since transmission of the original window attribute data is intercepted, after the original window attribute data is modified to obtain the target window attribute data, the target window attribute data needs to be transmitted in order to ensure display of the target interface, and then the target window attribute data is sent to the window management service. The target window attribute data includes at least one view, and the window management service may be configured to perform view addition, and then display, by the window management service, the at least one view in the target interface, for example, in the layer order according to the target window attribute data.
Illustratively, a window management service calls View (View) addition to implement the interface display. As shown in fig. 3b, the view adding process needs a method of adding addView () to the view of the windows management object WindowManager, and after the adding is completed, the interface is finally displayed in the terminal screen through a series of operations.
In this embodiment, the target window attribute data is sent to the window management service, and at least one view is displayed in the target interface according to the target window attribute data through the window management service, so that the terminal is ensured to normally display the target interface, and the target interface is in an installation state where screen capture is not allowed, thereby avoiding leakage of user information.
In one embodiment, as shown in fig. 4, before listening whether a target method of a target interface is called, the method further includes: s410, intercepting the call to the window management object based on the hook mechanism.
The window management object is used for adding each view required by the target interface into the window and generating the target interface. The hook mechanism can be understood as intercepting and monitoring the transmission of the event in the process of transmitting the event, and integrating the code of the hook mechanism with the system method. Specifically, in order to reinforce and upgrade the security of all windows on the basis of the installation package, the window management object is intercepted based on the HOOK mechanism HOOK, so that some target methods of the display interface are intercepted through global monitoring of the window management object windows manager, and further specific parameters carried by the target methods are modified to achieve screen capture prevention.
In one embodiment, as shown in fig. 5, intercepting a call to a window management object based on a hook mechanism in step S410 includes the following steps:
s510, in the process of adding the view, calling a view adding method through the window management object, and calling a view attribute setting method.
S520, based on a hook mechanism, the interception view attribute setting method calls a window communication object to intercept the original window attribute data sent to the window management service.
The management service WindowManagerservice of the window is communicated with the local service process. The windowManagerService, WMS for short, is initiated by the System service SystemServer and is used to manage the services associated with the window. Specifically, in the process of adding a View (View), the main operation is completed by windowManagerGlobal, which is a specific implementation of a window management object, the View adding work is completed mainly by an addView adding method inside the addView, and the View attribute setting method setView is continuously called inside the addView. In order to intercept the display of a target interface by using the original window attribute data, based on a HOOK mechanism HOOK, an interception view attribute setting method setView calls a window communication object, thereby intercepting the transmission of the original window attribute data to a window management service. For example, the intercept view method internally calls an iwindowsisssion (an example of WindowManagerGlobal) communication object mwindowsission, and then transmits the original window attribute data to the remote WindowManagerService through the intercept window display method addToDisplay.
In one embodiment, the method for adding the view and setting the view property is called through a window management object, and comprises the following steps: and calling a view adding method through the window management object, and calling a view attribute setting method through a view connection link so as to draw a view in the window.
The View connection link ViewRootImpl is connected with the Window Window and the View View, and the View drawing operation and other operations can be completed through the View connection link ViewRootImpl. Specifically, a view adding method addView is called by a window management object WindowManager, and a view attribute setting method is continuously called inside the addView through a window view connecting link ViewRootImpl, so that a window and a view are connected, and the view is drawn in the window.
In one embodiment, the intercepting view properties setting method calls a window communication object to intercept sending original window properties data to a window management service, comprising: the method for setting the attribute of the interception view calls a window communication object mWindowSession through an interface IWindowSession, and sends original window attribute data to a window management service by an interception window display method addToDisplay.
The type of the window communication object mWindowSession is interface type IWindowSession, and mWindowSession is a Binder object. Specifically, the anti-screenshot solution in this embodiment mainly completes interception of an interface iwindowssession, implements HOOK for Binder communication, and intercepts a plurality of target methods including functions such as a view adding method addview and a window display method addToDisplay. In the methods, a WindowManager parameter, which is a static internal class of a Window management object, is obtained, the WindowManager parameter is used for managing Window parameters, and a parameter list is correspondingly arranged, so that the parameter list is modified (FLag parameter is increased) and safety FLag data (FLag _ SECURE value) is increased. Finally, the global anti-screen capture function is realized.
In one embodiment, as shown in fig. 6a, the present application discloses an anti-screenshot method comprising the steps of:
s602, in the process of adding the view, calling a view adding method through the window management object, and calling a view attribute setting method;
specifically, a view addition method is called by a window management object, and a view attribute setting method is called by a view connection link ViewRootImpl to draw a view in a window.
S604, based on a hook mechanism, the interception view attribute setting method calls a window communication object to intercept the original window attribute data sent to the window management service.
Wherein, the type of mWindowSession is IWindowSession, that is, an interface class, and mWindowSession is a binder object. Specifically, as shown in fig. 6b, the interception view attribute setting method calls a window communication object mWindowSession through an interface IWindowSession, and sends original window attribute data to the window management service by an interception window display method addToDisplay.
S606, monitoring whether a target method of a target interface is called, wherein the target method is a method for setting window attributes to display the target interface;
s608, if the target method is monitored, acquiring original window attribute data in the target method;
s610, adding a mark parameter in a parameter list of the original window attribute data;
and S612, setting the safety mark data as a parameter value of the marking parameter to obtain target window attribute data.
S614, sending the attribute data of the target window to a window management service, wherein the attribute data of the target window comprises at least one view;
s616, displaying at least one view in the target interface according to the target window attribute data through the window management service.
It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the above-mentioned flowcharts may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or the stages is not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a part of the steps or the stages in other steps.
In one embodiment, as shown in fig. 7, there is provided an anti-screen capture device, including: a method monitoring module 710, a data obtaining module 720, a data modifying module 730 and an interface display module 740, wherein:
a method monitoring module 710, configured to monitor whether a target method of a target interface is called, where the target method is a method for setting a window attribute to display the target interface;
a data obtaining module 720, configured to obtain original window attribute data in the target method if the target method is monitored;
the data modification module 730 is configured to modify the original window attribute data according to target data to obtain target window attribute data, where the target data is used to set the target interface as an interface for prohibiting screen capture;
and an interface display module 740, configured to display the target interface according to the target window attribute data.
In one embodiment, the target data is security marker data; the data modification module 730 is further configured to add a flag parameter to the parameter list of the original window attribute data; and setting the safety mark data as the parameter value of the marking parameter to obtain the attribute data of the target window.
In one embodiment, the interface display module 740 is further configured to send the target window attribute data to a window management service, where the target window attribute data includes at least one view; displaying, by the window management service, the at least one view in the target interface according to the target window attribute data.
In one embodiment, the apparatus further comprises a window object calling module, configured to intercept a call to the window management object based on a hook mechanism; the window management object is used for adding each view required by the target interface into a window and generating the target interface.
In one embodiment, the window object calling module is further configured to call a view adding method through the window management object and call a view attribute setting method in the process of adding a view; based on the hook mechanism, intercepting the view attribute setting method to call a window communication object so as to intercept the original window attribute data sent to a window management service.
In one embodiment, the window object calling module is further configured to call a view adding method through the window management object, and call a view property setting method through a view connection link ViewRootImpl to draw a view in a window.
In an embodiment, the window object invoking module is further configured to invoke a window communication object mwindowstation through an interface iwindowstation by the interception window attribute setting method, and send the original window attribute data to the window management service by an interception window display method addToDisplay.
For specific limitations of the anti-screenshot device, reference may be made to the above limitations of the anti-screenshot method, which are not described herein again. The modules in the anti-screenshot device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 8. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement an anti-screenshot method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
monitoring whether a target method of a target interface is called, wherein the target method is a method for setting window attributes to display the target interface; if the target method is monitored, acquiring original window attribute data in the target method; modifying the original window attribute data according to target data to obtain target window attribute data, wherein the target data is used for setting the target interface as an interface for prohibiting screen capture; and displaying the target interface according to the target window attribute data.
In one embodiment, the target data is security marker data; the processor, when executing the computer program, further performs the steps of: adding a mark parameter in a parameter list of the original window attribute data; and setting the safety mark data as the parameter value of the marking parameter to obtain the attribute data of the target window.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
sending the target window attribute data to a window management service, the target window attribute data comprising at least one view; displaying, by the window management service, the at least one view in the target interface according to the target window attribute data.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
intercepting the call of a window management object based on a hook mechanism; the window management object is used for adding each view required by the target interface into a window and generating the target interface.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
in the process of adding the view, calling a view adding method through the window management object, and calling a view attribute setting method; based on the hook mechanism, intercepting the view attribute setting method to call a window communication object so as to intercept the original window attribute data sent to a window management service.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and calling a view adding method through the window management object, and calling a view attribute setting method through a view connection link so as to draw a view in the window.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and calling a window communication object mWindowSession through an interface IWindowSession by the view attribute interception setting method, and sending the original window attribute data to a window management service by an interception window display method addToDisplay.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, the computer program, when executed by a processor, further implementing the steps of:
monitoring whether a target method of a target interface is called, wherein the target method is a method for setting window attributes to display the target interface; if the target method is monitored, acquiring original window attribute data in the target method; modifying the original window attribute data according to target data to obtain target window attribute data, wherein the target data is used for setting the target interface as an interface for prohibiting screen capture; and displaying the target interface according to the target window attribute data.
In one embodiment, the target data is security marker data; the computer program when executed by the processor further realizes the steps of: adding a mark parameter in a parameter list of the original window attribute data; and setting the safety mark data as the parameter value of the marking parameter to obtain the attribute data of the target window.
In one embodiment, the computer program when executed by the processor further performs the steps of:
sending the target window attribute data to a window management service, the target window attribute data comprising at least one view; displaying, by the window management service, the at least one view in the target interface according to the target window attribute data.
In one embodiment, the computer program when executed by the processor further performs the steps of:
intercepting the call of a window management object based on a hook mechanism; the window management object is used for adding each view required by the target interface into a window and generating the target interface.
In one embodiment, the computer program when executed by the processor further performs the steps of:
in the process of adding the view, calling a view adding method through the window management object, and calling a view attribute setting method; based on the hook mechanism, intercepting the view attribute setting method to call a window communication object so as to intercept the original window attribute data sent to a window management service.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and calling a view adding method through the window management object, and calling a view attribute setting method through a view connection link so as to draw a view in the window.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and calling a window communication object mWindowSession through an interface IWindowSession by the view attribute interception setting method, and sending the original window attribute data to a window management service by an interception window display method addToDisplay.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. An anti-screen capture method, the method comprising:
monitoring whether a target method of a target interface is called or not; the target method is a method for setting a window property to display the target interface;
if the target method is monitored, acquiring original window attribute data in the target method;
modifying the original window attribute data according to target data to obtain target window attribute data, wherein the target data is used for setting the target interface as an interface for prohibiting screen capture;
and displaying the target interface according to the target window attribute data.
2. The method of claim 1, wherein the target data is security marker data; the modifying the original window attribute data through the target data to obtain the target window attribute data comprises:
adding a mark parameter in a parameter list of the original window attribute data;
and setting the safety mark data as the parameter value of the marking parameter to obtain the attribute data of the target window.
3. The method of claim 1, wherein said displaying the target interface according to the target window property data comprises:
sending the target window attribute data to a window management service; the target window attribute data comprises at least one view;
displaying, by the window management service, the at least one view in the target interface according to the target window attribute data.
4. The method of any of claims 1 to 3, wherein before the target method of the listening target interface is invoked, the method further comprises:
intercepting the call of a window management object based on a hook mechanism; the window management object is used for adding each view required by the target interface into a window and generating the target interface.
5. The method of claim 4, wherein intercepting calls to a window management object based on a hook mechanism comprises:
in the process of adding the view, calling a view adding method through the window management object, and calling a view attribute setting method;
based on the hook mechanism, intercepting the view attribute setting method to call a window communication object so as to intercept the original window attribute data sent to a window management service.
6. The method of claim 5, wherein the invoking a view add method and invoking a view property set method via the window management object comprises:
and calling a view adding method through the window management object, and calling a view attribute setting method through a view connection link so as to draw a view in the window.
7. The method of claim 5, wherein intercepting the view properties setting method calls a window communication object to intercept sending the raw window properties data to a window management service, comprising:
and calling a window communication object mWindowSession through an interface IWindowSession by the view attribute interception setting method, and sending the original window attribute data to a window management service by an interception window display method addToDisplay.
8. An anti-screen capture device, the device comprising:
the method monitoring module is used for monitoring whether a target method of a target interface is called or not, wherein the target method is a method for setting window attributes to display the target interface;
the data acquisition module is used for acquiring original window attribute data in the target method if the target method is monitored;
the data modification module is used for modifying the original window attribute data according to target data to obtain target window attribute data, and the target data is used for setting the target interface as an interface for prohibiting screen capture;
and the interface display module is used for displaying the target interface according to the target window attribute data.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011348616.XA CN112417533A (en) | 2020-11-26 | 2020-11-26 | Anti-screenshot method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011348616.XA CN112417533A (en) | 2020-11-26 | 2020-11-26 | Anti-screenshot method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112417533A true CN112417533A (en) | 2021-02-26 |
Family
ID=74843613
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011348616.XA Pending CN112417533A (en) | 2020-11-26 | 2020-11-26 | Anti-screenshot method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112417533A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112632644A (en) * | 2020-12-18 | 2021-04-09 | 深圳市安络科技有限公司 | Android system-based app screen capture prevention method, device and equipment |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8844059B1 (en) * | 2011-02-15 | 2014-09-23 | Symantec Corporation | Method and apparatus for preventing data loss through screen capture |
CN104077539A (en) * | 2014-07-09 | 2014-10-01 | 肖龙旭 | Screen capture prevention method based on program windows |
US20140359766A1 (en) * | 2013-05-30 | 2014-12-04 | Trusteer Ltd. | Method and system for prevention of windowless screen capture |
CN105678181A (en) * | 2015-12-28 | 2016-06-15 | 上海爱数信息技术股份有限公司 | Screen capture prevention apparatus and method based on browser event |
CN106201468A (en) * | 2016-06-28 | 2016-12-07 | 北京金山安全软件有限公司 | Screen capture processing method and device and electronic equipment |
CN108519899A (en) * | 2018-03-23 | 2018-09-11 | 深信服科技股份有限公司 | A kind of anti-screenshotss method of virtual desktop, system and relevant apparatus |
CN109040419A (en) * | 2018-06-11 | 2018-12-18 | Oppo(重庆)智能科技有限公司 | Record screen method, apparatus, mobile terminal and storage medium |
CN111796989A (en) * | 2020-09-09 | 2020-10-20 | 北京志翔科技股份有限公司 | Method for preventing screen capture in Linux system and computer readable storage medium |
-
2020
- 2020-11-26 CN CN202011348616.XA patent/CN112417533A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8844059B1 (en) * | 2011-02-15 | 2014-09-23 | Symantec Corporation | Method and apparatus for preventing data loss through screen capture |
US20140359766A1 (en) * | 2013-05-30 | 2014-12-04 | Trusteer Ltd. | Method and system for prevention of windowless screen capture |
CN104077539A (en) * | 2014-07-09 | 2014-10-01 | 肖龙旭 | Screen capture prevention method based on program windows |
CN105678181A (en) * | 2015-12-28 | 2016-06-15 | 上海爱数信息技术股份有限公司 | Screen capture prevention apparatus and method based on browser event |
CN106201468A (en) * | 2016-06-28 | 2016-12-07 | 北京金山安全软件有限公司 | Screen capture processing method and device and electronic equipment |
CN108519899A (en) * | 2018-03-23 | 2018-09-11 | 深信服科技股份有限公司 | A kind of anti-screenshotss method of virtual desktop, system and relevant apparatus |
CN109040419A (en) * | 2018-06-11 | 2018-12-18 | Oppo(重庆)智能科技有限公司 | Record screen method, apparatus, mobile terminal and storage medium |
CN111796989A (en) * | 2020-09-09 | 2020-10-20 | 北京志翔科技股份有限公司 | Method for preventing screen capture in Linux system and computer readable storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112632644A (en) * | 2020-12-18 | 2021-04-09 | 深圳市安络科技有限公司 | Android system-based app screen capture prevention method, device and equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20190354690A1 (en) | Systems, devices and methods for application and privacy compliance monitoring and security threat analysis processing | |
EP1512057B1 (en) | Trusted user interface for a secure mobile wireless device | |
US10176327B2 (en) | Method and device for preventing application in an operating system from being uninstalled | |
DE112012001389T5 (en) | Secure execution of an unsecured app on a device | |
EP3203406A1 (en) | Sensitive information security protection method and device | |
CN104462952A (en) | Method and device for preventing self-starting of application | |
CN112307528B (en) | Safe processing method and device for electronic document | |
CN106326735B (en) | Method and apparatus for preventing injection | |
CN112417484A (en) | Resource file protection method and device, computer equipment and storage medium | |
KR20200090784A (en) | How to start an application, startup device and computer readable storage medium | |
CN114650154A (en) | Webpage permission behavior control method and device, computer equipment and storage medium | |
CN110704131B (en) | Method and device for calling native application by HTML5 application | |
CN106293821B (en) | Method and device for acquiring and transmitting application program data and running application program | |
CN112417533A (en) | Anti-screenshot method and device, computer equipment and storage medium | |
US10761863B2 (en) | Mobile application management by run-time insertion of a replacement instrumentation object into a mobile application process | |
CN105447384B (en) | A kind of anti-method monitored, system and mobile terminal | |
CN107766068B (en) | Application system patch installation method and device, computer equipment and storage medium | |
CN106096396A (en) | The information concealing method of a kind of Android application and device | |
CN111090880B (en) | Method and system for intercepting and stealing user privacy behaviors by utilizing camera vulnerability | |
CN105512552A (en) | Method and device for parameter detection | |
CN112416622A (en) | Clipboard data protection method and device, computer equipment and storage medium | |
CN109815202B (en) | Log editing method and related device | |
US10698703B2 (en) | Mobile application management by run-time insertion of a substitute application class loader into a mobile application process | |
CN108628620B (en) | POS application development implementation method and device, computer equipment and storage medium | |
KR101266254B1 (en) | Security management system and method for mobile device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |