CN108595965B - Method and device for preventing attribute information of interface control from being stolen - Google Patents

Method and device for preventing attribute information of interface control from being stolen Download PDF

Info

Publication number
CN108595965B
CN108595965B CN201810402888.XA CN201810402888A CN108595965B CN 108595965 B CN108595965 B CN 108595965B CN 201810402888 A CN201810402888 A CN 201810402888A CN 108595965 B CN108595965 B CN 108595965B
Authority
CN
China
Prior art keywords
attribute
interface control
target interface
control
identification
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
Application number
CN201810402888.XA
Other languages
Chinese (zh)
Other versions
CN108595965A (en
Inventor
高国威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Douyin Vision Co Ltd
Douyin Vision Beijing Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201810402888.XA priority Critical patent/CN108595965B/en
Publication of CN108595965A publication Critical patent/CN108595965A/en
Application granted granted Critical
Publication of CN108595965B publication Critical patent/CN108595965B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention provides a method and a device for preventing attribute information of an interface control from being stolen, wherein the method comprises the following steps: receiving a first instruction for performing attribute replacement on a target interface control, wherein the first instruction carries a label attribute of the target interface control, and the label attribute carries identification information corresponding to the target interface control and is used for replacing a native identification attribute of the target interface control; and replacing the identification attribute of the target interface control with the label attribute according to the first instruction. The method replaces the identification attribute of the target interface control with the label attribute, avoids illegal operation of a third party application by stealing the identification attribute of the target interface control, and improves the safety of the target interface control.

Description

Method and device for preventing attribute information of interface control from being stolen
Technical Field
The invention relates to the technical field of terminal equipment, in particular to a method and a device for preventing attribute information of an interface control from being stolen.
Background
At present, in order to help people who are inconvenient to contact and interact with a terminal device, such as disabled people, an operating system of the terminal device provides an auxiliary function Service to help a user to search interface elements on the terminal device and realize simulation operations, for example, an auxiliary function Service (access Service) provided by an android system can obtain an identification attribute of a control on a user interface through the access Service, and then can search and call corresponding interface controls in all interface controls according to the identification attribute, and then perform operations such as simulated clicking on the interface controls.
However, in practical applications, the third-party application may utilize the above-mentioned auxiliary function to steal the identification attribute of the interface control so as to perform an illegal operation on the interface control. For example, after the automatic red packet robbing software finds the identification attribute of the red packet control in the application, the red packet control can be called according to the identification attribute and click simulation operation is performed, so that automatic response of the red packet robbing event is realized. Therefore, by stealing the identification attribute of the interface control, the risk that the interface control is maliciously operated is increased, and the safety of the interface control is not facilitated.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, a first object of the present invention is to provide a method for preventing attribute information of an interface control from being stolen, the method replaces a native identification attribute of a target interface control with a newly set tag attribute according to a first instruction for replacing the target interface control, and disables the native identification attribute of the target interface control while implementing local application search and calling the target interface control through unique character information in the tag attribute, so that a third-party application cannot acquire the native identification attribute of the target interface control through access Service, and thus the third-party application can be prevented from searching the control through the identification attribute of the target interface control.
The second purpose of the present invention is to provide a device for preventing attribute information of an interface control from being stolen.
A third object of the invention is to propose an electronic device.
A fourth object of the invention is to propose a non-transitory computer-readable storage medium.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides a method for preventing attribute information of an interface control from being stolen, including:
receiving a first instruction for performing attribute replacement on a target interface control, wherein the first instruction carries a label attribute of the target interface control; the label attribute carries identification information corresponding to the target interface control and is used for replacing the native identification attribute of the target interface control;
replacing the identification attribute of the target interface control with the label attribute according to the first instruction.
The method for preventing attribute information of the interface control from being stolen includes the steps of firstly receiving a first instruction for carrying out attribute replacement on a target interface control, wherein the first instruction carries a label attribute of the target interface control, the label attribute carries identification information corresponding to the target interface control, and then replacing the identification attribute of the target interface control with the label attribute according to the first instruction. Therefore, according to the method, the native identification attribute of the target interface control is replaced by the newly set label attribute according to the first instruction for replacing the target interface control, the native identification attribute of the target interface control is forbidden while the target interface control is searched and called by the local application through the unique character information in the label attribute, so that the native identification attribute of the target interface control cannot be obtained by the third party application through the access availability Service, the control can be prevented from being searched by the third party application through the identification attribute of the target interface control, furthermore, the illegal simulation operation cannot be carried out on the control due to the fact that the identification attribute of the target interface control cannot be obtained, and the safety of the target interface control is improved.
In addition, the method for preventing attribute information of the interface control from being stolen according to the embodiment of the invention can also have the following additional technical characteristics:
in an embodiment of the present invention, replacing the identification attribute of the target interface control with the label attribute includes: acquiring an interface event associated with the target interface control and the identification attribute, and removing the binding relationship between the associated interface event and the identification attribute; binding the associated interface event with the tag property; and setting a forbidden state of the identification information corresponding to the identification attribute.
In an embodiment of the present invention, before receiving the first instruction for performing the property setting on the target interface control, the method further includes: traversing a layout file of an interface, identifying a parent control of the target interface control from the layout file, and inheriting the identification attribute of the target interface control and the interface event of the target interface control from the parent control.
In an embodiment of the present invention, after replacing the identification attribute of the target interface control with the tag attribute, the method further includes: monitoring each interface event of the interface; after an interface event related to the target interface control is monitored, reading identification information corresponding to the target interface control from the label attribute of the target interface control; acquiring response information matched with the monitored related interface event from the layout file according to the identification information; and responding to the monitored related interface events according to the response information.
In an embodiment of the present invention, reading identification information corresponding to the target interface control from the tag attribute of the target interface control includes: extracting parameter information for representing the target interface control from the related interface event according to the monitored related interface event; and inquiring a control matched with the parameter information in the layout file according to the parameter information to obtain the label attribute of the target interface control, and extracting the identification information from the label attribute.
In an embodiment of the present invention, extracting the identification information from the tag attribute includes: and calling a preset reading function, reading the label attribute of the target interface control, and extracting the identification information from the label attribute.
In an embodiment of the present invention, before receiving the first instruction for performing the property replacement on the target interface control, the method further includes: receiving an adding instruction for adding a function to the tag attribute; wherein, the adding instruction carries the function to be added; wherein the function comprises at least a set function and a read function; and adding the function for the label attribute according to the adding instruction.
In order to achieve the above object, a second embodiment of the present invention provides an apparatus for preventing attribute information of an interface control from being stolen, including:
the system comprises a receiving module, a judging module and a judging module, wherein the receiving module is used for receiving a first operation for carrying out attribute replacement on a target interface control, and the first operation carries the label attribute of the target interface control; the label attribute carries identification information corresponding to the target interface control and is used for replacing the native identification attribute of the target interface control;
and the replacing module is used for replacing the representation attribute of the target interface control with the label attribute according to the first operation.
The device for preventing attribute information of the interface control from being stolen, provided by the embodiment of the invention, comprises the steps of firstly receiving a first instruction for carrying out attribute replacement on the target interface control, wherein the first instruction carries the label attribute of the target interface control, the label attribute carries the identification information corresponding to the target interface control, and then replacing the original identification attribute of the target interface control with the label attribute according to the first instruction. Therefore, according to the device, the native identification attribute of the target interface control is replaced by the newly set label attribute according to the first instruction for replacing the target interface control, the native identification attribute of the target interface control is forbidden while the target interface control is searched and called by the local application through the unique character information in the label attribute, so that the native identification attribute of the target interface control cannot be obtained by the third party application through the access availability Service, the control can be prevented from being searched by the third party application through the identification attribute of the target interface control, furthermore, the illegal simulation operation cannot be carried out on the control due to the fact that the identification attribute of the target interface control cannot be obtained, and the safety of the target interface control is improved.
To achieve the above object, a third aspect of the present invention provides an electronic device, including: the system comprises a processor and a memory, wherein the processor runs a program corresponding to an executable program code by reading the executable program code stored in the memory, so as to realize the method for preventing attribute information of the interface control from being stolen according to the embodiment.
To achieve the above object, a fourth aspect of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the method for preventing attribute information of an interface control from being stolen according to the above embodiment.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart of a method for preventing attribute information of an interface control from being stolen according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a specific method for preventing attribute information of an interface control from being stolen according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating another specific method for preventing attribute information of an interface control from being stolen according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus for preventing attribute information of an interface control from being stolen according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of another apparatus for preventing attribute information of an interface control from being stolen according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention; and
fig. 7 is a schematic diagram of a non-transitory computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The following describes a method, an apparatus, a device, and a storage medium for preventing attribute information of an interface control from being stolen according to an embodiment of the present invention with reference to the accompanying drawings.
The execution main body of the method and the device for preventing attribute information of the interface control from being stolen can be terminal equipment, wherein the terminal equipment can be hardware equipment such as a mobile phone, a tablet personal computer and a personal digital assistant which can provide services for a user through the control on a user interface.
Fig. 1 is a flowchart illustrating a method for preventing attribute information of an interface control from being stolen according to an embodiment of the present invention. As shown in fig. 1, the method for preventing attribute information of an interface control from being stolen may include:
step 101, receiving a first instruction for performing attribute replacement on a target interface control, where the first instruction carries a tag attribute of the target interface control, and the tag attribute carries identification information corresponding to the target interface control and is used to replace a native identification attribute of the target interface control.
The target interface control may be any control in the terminal user interface, for example, a state switch control, a picture control, a button control, and the like, and the target interface control may respond to an event initiated by the user on the user interface so as to provide a service for the user, for example, when the user clicks the button control on the interface, the button control executes a function preset by the control. Furthermore, in order to access and call the target interface control in all the interface controls, various attribute information such as an identification attribute, a name attribute, a text attribute and the like is preset in the interface controls. Taking an identification attribute (id) as an example, in an auxiliary function service of a terminal device operating system, the target interface control can be searched and called through identification information contained in the identification attribute of the target interface control, and a corresponding function of the control is executed.
Furthermore, in order to prevent a third-party application from searching for a target interface control according to identification information of the target interface control and carrying out illegal operation, the terminal device receives a first instruction for replacing the identification attribute of the target interface control, the first instruction comprises a label attribute for replacing the native identification attribute of the target interface control, and after the terminal device executes the first instruction, the identification attribute of the target interface control can be replaced by the label attribute, wherein the label attribute carries preset identification information of the target interface control.
In an embodiment of the present invention, the tag attribute may be set as a new attribute carrying unique identification information of the target interface control, and the target interface control is distinguished from other interface controls by the unique identification information in all interface controls, where the identification information may be data of types such as a character string, and the local application may find the target interface control in each interface control by the unique identification information in the tag attribute. However, in practical application, after the tag attribute is newly set, the native identifier attribute of the target interface control is replaced, the third-party application still queries the native identifier attribute of the target interface control when querying through the auxiliary function service, but since the native identifier attribute is replaced by the tag attribute, the identifier attribute cannot provide the identifier information of the target interface control to the third-party application, and the third-party application cannot call the target interface control by searching the identifier attribute of the target interface control.
And 102, replacing the identification attribute of the target interface control with a label attribute according to the first instruction.
After the terminal equipment receives the first instruction, the processor runs the first instruction, and the original identification attribute of the target interface control is replaced by the newly set label attribute according to the first instruction.
In a specific implementation, in an embodiment of the present invention, after receiving a first instruction, a terminal device first obtains an interface event associated with an identifier attribute of a target interface control, where the interface event is a preset trigger event associated with the identifier attribute of the target interface control, for example, identification information included in an identifier attribute of a certain red packet control in a social application is "get red packet", and after a user clicks the red packet control on an interface, the red packet control executes a corresponding operation of sending and receiving a money amount, and then the click event is the interface event associated with the identifier attribute of the red packet control. Further, the terminal device removes the binding relationship between the associated interface event and the identifier attribute, that is, deletes the identifier information carried in the identifier attribute, sets the identifier attribute in an unavailable state, and binds the associated interface event with the tag attribute, so that the bound target interface control carries the identifier information through the tag attribute, and after the user initiates the interface event, the local application searches and calls the target interface control through the identifier information in the tag attribute, for example, in the above example, the interface event of the red packet control is bound with the tag attribute, and when the user clicks the red packet after receiving the red packet in the social application, the terminal device searches and calls the red packet control whose identifier information is "get the red packet" according to the click event on the user interface to receive the amount in the red packet.
Therefore, the local application can search and call the target interface control through the identification information carried by the label attribute of the target interface control to respond to the interface event initiated by the user, and the replaced identification attribute does not carry the identification information of the target interface control, so that the third-party application cannot automatically respond to the interface event by inquiring the identification information of the target interface control stealing control.
In summary, in the method for preventing attribute information of an interface control from being stolen according to the embodiment of the present invention, a first instruction for performing attribute replacement on a target interface control is received, where the first instruction carries a tag attribute of the target interface control, where the tag attribute carries identification information corresponding to the target interface control, and then the tag attribute of the target interface control is replaced with the tag attribute according to the first instruction. Therefore, according to the method, the native identification attribute of the target interface control is replaced by the newly set label attribute according to the first instruction for replacing the target interface control, the native identification attribute of the target interface control is forbidden while the target interface control is searched and called by the local application through the unique character information in the label attribute, so that the native identification attribute of the target interface control cannot be obtained by the third party application through the access availability Service, the control can be prevented from being searched by the third party application through the identification attribute of the target interface control, furthermore, the illegal simulation operation cannot be carried out on the control due to the fact that the identification attribute of the target interface control cannot be obtained, and the safety of the target interface control is improved.
Based on the above embodiment, before replacing the identification attribute of the target control with the label attribute, the identification information corresponding to the target interface control must be preset for the label attribute. In order to describe a specific process of setting identification information corresponding to a target interface control for a label attribute more clearly, the embodiment of the invention provides a specific method for preventing attribute information of the interface control from being stolen.
Specifically, fig. 2 is a flowchart illustrating a specific method for preventing attribute information of an interface control from being stolen according to an embodiment of the present invention. As shown in fig. 2, on the basis of the embodiment shown in fig. 1, step 101 may be preceded by the following steps:
step 201, traversing a layout file of the interface, identifying a parent control of the target interface control from the layout file, and inheriting the identification attribute of the target interface control and the interface event of the target interface control from the parent control.
The Layout file is a file for planning and setting various attributes of the user interface control, such as an Extensible Markup Language (XML) file and various View class (View) files, and the interface control is set by the Layout file to make the control on the interface structured, for example, adding a Layout (Layout) statement in the Layout file can set a corresponding wide and high display range of the interface control on the interface and a distance between the interface controls, and then after setting the interface controls by the Layout file, the interface controls can be displayed on the user interface in different Layout modes, such as linear Layout, relative Layout, grid Layout, absolute Layout, and the like. In addition, the layout file can also set other attribute information of the interface control, for example, the id attribute of the interface control can be customized in an XML file, or the text attribute of the interface control can be set in a textView control of a View file, so that the interface control can be conveniently searched and called by the local application.
Furthermore, traversing the layout file of the user interface, and searching a parent control for setting the identification attribute for the target interface control in the layout file, for example, when each child View control in the View class layout file of the interface control is linearly distributed, traversing each child View control to obtain the View control of the last node of the target interface control, and then the View control of the last node of the target interface control is the parent control of the target interface control, and the identification information of the target interface control can be set through the parent control.
Further, after the parent control of the target interface is identified, the identification attribute of the native target interface control and the interface event associated with the identification attribute may be obtained from the parent control, for example, in the red-envelope control of the above example, after the parent control of the red-envelope control is obtained, the identification information carried by the red-envelope control, such as "getting red envelope", etc., is obtained from the parent control, and then the interface event associated with the red-envelope control, such as a click event associated with getting red envelope ", etc., is searched according to the obtained identification attribute.
Step 202, setting an adding instruction according to the inherited identification attribute of the target interface control and the interface event of the target interface control, wherein the adding instruction is used for adding a function for the label attribute, and the function at least comprises a setting function and a reading function.
Specifically, after the parent control relays the identification attribute of the target interface control and the associated interface event, the adding instruction of the tag attribute is set according to the acquired native identification attribute of the target interface control and the interface event matched with the native identification attribute. The adding instruction carries a function and is used for adding identification information corresponding to the target interface control for the label attribute.
During specific implementation, a setting function (setter) and a reading function (getter) are added to a function carried by an adding instruction, wherein the setting function sets identification information carried by a tag attribute according to the inherited identification attribute and an interface event, for example, by setting a function statement in the function that the tag attribute is set (red packet is received), identification information corresponding to a target interface control is set for the tag attribute. Furthermore, a reading function is added in the function of the tag attribute and used for reading the identification information of the tag attribute, after the tag attribute replaces the original identification attribute of the target interface control, if a user initiates an interface event matched with the identification information in the tag attribute, the reading function reads the identification information in the tag attribute, the target interface control is searched and called according to the identification attribute, and then the target interface control responds to the interface event. As an example, after a user clicks a red packet control on a specific interface for social application to receive a red packet, the read function finds an interface control with a label attribute of "receive a red packet" according to a function statement of "obtain a control [ findViewById (r.id.xxxx) ]", and then calls the control to receive the amount of the red packet.
It should be noted that, in order to meet the language rule of the terminal device operating system, there may be more restrictions in the native identifier attribute of the target interface control, for example, the native identifier attribute only accepts the value of the resource type, or special symbols such as underlines cannot appear, but in the embodiment of the present invention, after the identifier attribute of the target interface control is replaced by the tag attribute, the tag attribute carries the unique character string information of the target interface control in all interface controls, the character string information inherits the text content of the native identifier information, so that the target interface control is conveniently searched and called after the replacement, and the character string information after the replacement is not limited by the rule of the identifier attribute, so that flexibility and convenience in setting the tag attribute are improved.
Step 203, receiving an adding instruction for adding a function to the first attribute, and adding the function to the first attribute according to the adding instruction.
Specifically, after the terminal device receives the adding instruction, the server on the terminal device runs the adding instruction, and sets identification information corresponding to the target interface control for the label attribute according to the function.
According to the method for preventing the attribute information of the interface control from being stolen, the parent control of the target interface control relays the identification of the target interface control and the interface event of the target interface control, the identification information corresponding to the target interface control is set for the label by adding the function in the instruction, the replaced label attribute carries the identification information contained in the original identification attribute, and the method ensures that the local application can accurately find the target interface control and call the target interface control through the identification information in the label attribute while avoiding the third-party software from stealing the identification information of the target interface control through the identification attribute to automatically respond.
Based on the above embodiment, in order to describe more clearly the working process of the target interface control after replacing the identification attribute with the tag attribute, the embodiment of the present invention provides another specific method for preventing the attribute information of the interface control from being stolen, and fig. 3 is a flowchart of another specific method for preventing the attribute information of the interface control from being stolen provided by the embodiment of the present invention.
As shown in fig. 3, the method for preventing attribute information of an interface control from being stolen includes the following steps:
step 301, monitoring each interface event of the interface.
Specifically, after replacing the identification attribute of the target interface control with the tag attribute, the terminal device identifies an interface event initiated by the user, for example, when the user controls the interface control on a touch screen of the mobile terminal, the terminal device may identify a gesture operation of the user on the touch screen, such as a click, a slide, a long press, and the like, by using a gesture recognition tool (geturedetector), then obtain a touch position of the user by using charge sensing sensors at four corners of the touch screen of the terminal device, and obtain an application currently running by the terminal device by using a task manager (activtymanager) in an operating system of the terminal device, so as to determine a specific interface event of an application opened by the user interface and an interface control currently running by the user, such as clicking a button control in a photographing application or sliding a text box control in a reading application.
Step 302, after monitoring the interface event related to the target interface control, reading the identification information corresponding to the target interface control from the label attribute of the target interface control.
Specifically, the terminal device monitors interface events initiated by the user on different controls, and when the interface event associated with the target interface control is monitored, for example, the user opens a red packet control in the social application to get a red packet, extracts parameter information used for representing the target interface control from the associated interface event, where the parameter information may be keyword information of the interface event, for example, "click to grab red packet" in the above example.
Furthermore, the terminal device traverses the layout file according to the parameter information, queries a control matched with the parameter information in the layout file, and specifically, matches the parameter information with a label attribute preset in the layout file, and screens the label attribute of the target interface control, for example, matches the label attribute of the red packet getting control according to the parameter information of 'clicking to grab the red packet', then calls a reading function preset in the label attribute, reads the label attribute of the target interface control, extracts identification information 'get the red packet' from the label attribute, and further calls the red packet control to get the money in the red packet according to the extracted identification information.
Step 303, obtaining the matching response information of the monitored related interface event from the layout file according to the identification information.
And step 304, responding to the monitored related interface events according to the response information.
The response information may be a program for calling the target interface control to execute a preset function, and since the program code for executing the corresponding function by the interface control is preset in the layout file, after the target interface control is found according to the identification information read by the read function, the running code of the target interface control in the layout file is executed, for example, after the red envelope control is called in the above example, the red envelope control takes the amount of money in the received red envelope and stores the amount of money in the wallet control of the social application.
The method for preventing the attribute information of the interface control from being stolen, provided by the embodiment of the invention, comprises the steps of monitoring each interface event of an interface after replacing the identification attribute with the label attribute, reading the identification information of the target interface control through the read function after monitoring the interface event related to the target interface control, and calling the target interface control to respond to the interface event according to the identification information, so that the interface event can be accurately and timely responded after replacing the identification attribute with the newly set label attribute.
In order to implement the above embodiment, the present invention further provides a device for preventing attribute information of an interface control from being stolen.
Fig. 4 is a schematic structural diagram of an apparatus for preventing attribute information of an interface control from being stolen according to an embodiment of the present invention. As shown in fig. 4, the apparatus for preventing attribute information of an interface control from being stolen includes: a receiving module 110 and a replacing module 120.
The receiving module 110 is configured to receive a first operation for performing attribute replacement on a target interface control, where the first operation carries a tag attribute of the target interface control, and the tag attribute carries identification information corresponding to the target interface control and is used to replace a native identification attribute of the target interface control.
And a replacing module 120, configured to replace the identifier attribute of the target interface control with the tag attribute according to the first operation.
The replacing module 120 is further configured to obtain an interface event associated with the target interface control and the identifier attribute, release a binding relationship between the associated interface event and the identifier attribute, then bind the associated interface event and the tag attribute, and finally set the identifier information corresponding to the identifier attribute to a disabled state.
Further, in a possible implementation manner of the embodiment of the present invention, as shown in fig. 5, on the basis of the embodiment shown in fig. 4, the method further includes: a listening module 130, a reading module 140, an acquisition module 150, and a response module 160.
The monitoring module 130 is configured to monitor each interface event of the interface.
The reading module 140 is configured to read the identification information from the tag attribute of the target interface control after the monitoring module 130 monitors the interface event related to the target interface control.
And the obtaining module 150 is configured to obtain, from the layout file, response information matching the monitored related interface event according to the identification information.
And the response module 160 is configured to respond to the monitored related interface event.
Further, the reading module 140 is further configured to extract parameter information for characterizing the target interface control from the monitored related interface event, then query a control matched with the parameter information in the layout file according to the parameter information, obtain a tag attribute of the target interface control, and extract identification information from the tag attribute.
Specifically, the reading module 140 is further configured to invoke a preset reading module, read the tag attribute of the target interface control, and extract the identification information from the tag attribute.
It should be noted that the foregoing explanation of the method for preventing attribute information of an interface control is also applicable to the apparatus of this embodiment, and is not repeated herein.
The device for preventing attribute information of the interface control from being stolen, provided by the embodiment of the invention, comprises the steps of firstly receiving a first instruction for carrying out attribute replacement on the target interface control, wherein the first instruction carries the label attribute of the target interface control, the label attribute carries the identification information corresponding to the target interface control, and then replacing the identification attribute of the target interface control with the label attribute according to the first instruction. Therefore, according to the device, the native identification attribute of the target interface control is replaced by the newly set label attribute according to the first instruction for replacing the target interface control, the native identification attribute of the target interface control is forbidden while the target interface control is searched and called by the local application through the unique character information in the label attribute, so that the native identification attribute of the target interface control cannot be obtained by the third party application through the access availability Service, the control can be prevented from being searched by the third party application through the identification attribute of the target interface control, furthermore, the illegal simulation operation cannot be carried out on the control due to the fact that the identification attribute of the target interface control cannot be obtained, and the safety of the target interface control is improved.
In order to implement the above embodiments, the present invention further provides an electronic device, including: the interface control system comprises a processor and a memory, wherein the processor runs a program corresponding to executable program codes by reading the executable program codes stored in the memory so as to realize the method for preventing the attribute information of the interface control from being stolen according to the embodiment.
Specifically, fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention. The electronic device may be implemented in various forms, and the electronic device in the present disclosure may include, but is not limited to, mobile terminal devices such as a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation apparatus, a vehicle-mounted terminal device, a vehicle-mounted display terminal, a vehicle-mounted electronic rear view mirror, and the like, and fixed electronic devices such as a digital TV, a desktop computer, and the like.
As shown in fig. 6, the electronic apparatus 1100 may include a wireless communication unit 1110, an a/V (audio/video) input unit 1120, a user input unit 1130, a sensing unit 1140, an output unit 1150, a memory 1160, an interface unit 1170, a controller 1180, a power supply unit 1190, and the like. Fig. 6 shows an electronic device having various components, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
The wireless communication unit 1110 allows radio communication between the electronic apparatus 1100 and a wireless communication system or a network, among others. The a/V input unit 1120 is for receiving an audio or video signal. The user input unit 1130 may generate key input data to control various operations of the electronic apparatus according to a command input by a user. The sensing unit 1140 detects a current state of the electronic device 1100, a position of the electronic device 1100, presence or absence of a touch input by a user to the electronic device 1100, an orientation of the electronic device 1100, acceleration or deceleration movement and direction of the electronic device 1100, and the like, and generates a command or signal for controlling an operation of the electronic device 1100. The interface unit 1170 serves as an interface through which at least one external device is connected to the terminal apparatus 1100. The output unit 1150 is configured to provide output signals in a visual, audio, and/or tactile manner. The memory 1160 may store software programs and the like for processing and controlling operations performed by the controller 1180, or may temporarily store data that has been output or is to be output. Memory 1160 may include at least one type of storage media. Also, the electronic apparatus 1100 may cooperate with network storage that performs storage functions of the memory 1160 via a network connection. The controller 1180 generally controls the overall operation of the electronic device. In addition, the controller 1180 may include a multimedia module for reproducing or playing back multimedia data. The controller 1180 may perform a pattern recognition process to recognize a handwriting input or a picture drawing input performed on the touch screen as a character or an image. The power supply unit 1190 receives external power or internal power and provides appropriate power required to operate the various elements and components under the control of the controller 1180.
Various embodiments of the media retrieval method presented in this disclosure may be implemented using a computer-readable medium, such as computer software, hardware, or any combination thereof. For a hardware implementation, various embodiments of the media retrieval method presented in the present disclosure may be implemented by using at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a processor, a controller, a microcontroller, a microprocessor, an electronic unit designed to perform the functions described herein, and in some cases, various embodiments of the media retrieval method presented in the present disclosure may be implemented in the controller 1180. For software implementation, various embodiments of the media retrieval method presented in the present disclosure may be implemented with a separate software module that allows for performing at least one function or operation. The software codes may be implemented by software applications (or programs) written in any suitable programming language, which may be stored in memory 1160 and executed by controller 1180.
In order to achieve the above embodiments, the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method for preventing attribute information of an interface control from being stolen as described in the above embodiments.
Specifically, fig. 7 is a schematic diagram of a non-transitory computer-readable storage medium according to an embodiment of the present invention. As shown in fig. 7, a non-transitory computer readable storage medium 300 having non-transitory computer readable instructions 301 stored thereon according to an embodiment of the present disclosure. When the non-transitory computer readable instructions 301 are executed by a processor, all or part of the steps of the method for preventing the property information of the interface control from being stolen according to the embodiments of the present invention are performed.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (8)

1. A method for preventing attribute information of an interface control from being stolen is characterized by comprising the following steps:
receiving a first instruction for performing attribute replacement on a target interface control, wherein the first instruction carries a label attribute of the target interface control; the label attribute carries identification information corresponding to the target interface control which cannot be inquired by a third party application, and is used for replacing the native identification attribute of the target interface control;
acquiring an interface event associated with the target interface control and the identification attribute, wherein the interface event comprises a preset trigger event associated with the identification attribute of the target interface control;
removing the binding relation between the associated interface event and the identification attribute, and setting the identification information corresponding to the identification attribute in a forbidden state;
binding the associated interface event with the label property so that a local application searches and calls the target interface control through the identification information in the label property; the bound target interface control carries the identification information through the label property;
monitoring each interface event of the interface;
after an interface event related to the target interface control is monitored, reading identification information corresponding to the target interface control from the label attribute of the target interface control;
acquiring response information matched with the monitored related interface event from a layout file according to the identification information;
and responding to the monitored related interface events according to the response information.
2. The method of claim 1, wherein prior to receiving the first instruction for property replacement of the target interface control, further comprising:
traversing a layout file of an interface, identifying a parent control of the target interface control from the layout file, and inheriting the identification attribute of the target interface control and the interface event of the target interface control from the parent control.
3. The method according to claim 1, wherein the reading the identification information corresponding to the target interface control from the tag property of the target interface control comprises:
extracting parameter information for representing the target interface control from the related interface event according to the monitored related interface event;
and inquiring a control matched with the parameter information in the layout file according to the parameter information to obtain the label attribute of the target interface control, and extracting the identification information from the label attribute.
4. The method of claim 3, wherein said extracting said identification information from said tag attribute comprises:
and calling a preset reading function, reading the label attribute of the target interface control, and extracting the identification information from the label attribute.
5. The method of claim 4, wherein prior to receiving the first instruction for property replacement of the target interface control, further comprising:
receiving an adding instruction for adding a function to the tag attribute; wherein, the adding instruction carries the function to be added; wherein the function comprises at least a set function and a read function;
and adding the function for the label attribute according to the adding instruction.
6. An apparatus for preventing attribute information of an interface control from being stolen, comprising:
the system comprises a receiving module, a judging module and a judging module, wherein the receiving module is used for receiving a first operation for carrying out attribute replacement on a target interface control, and the first operation carries the label attribute of the target interface control; the label attribute carries identification information corresponding to the target interface control which cannot be inquired by a third party application, and is used for replacing the native identification attribute of the target interface control;
the replacing module is used for acquiring an interface event associated with the target interface control and the identification attribute, wherein the interface event comprises a preset trigger event associated with the identification attribute of the target interface control; removing the binding relation between the associated interface event and the identification attribute, and setting the identification information corresponding to the identification attribute in a forbidden state; binding the associated interface event with the label property so that a local application searches and calls the target interface control through the identification information in the label property; the bound target interface control carries the identification information through the label property;
the monitoring module is used for monitoring each interface event of the interface;
the reading module is used for reading the identification information corresponding to the target interface control from the label attribute of the target interface control after monitoring the interface event related to the target interface control;
the acquisition module is used for acquiring response information matched with the monitored related interface events from a layout file according to the identification information;
and the response module is used for responding to the monitored related interface events according to the response information.
7. An electronic device, comprising: a processor and a memory;
wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the method for preventing attribute information of the interface control from being stolen according to any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having stored thereon a computer program, wherein the program, when executed by a processor, implements a method for preventing property information of an interface control from being stolen according to any one of claims 1 to 5.
CN201810402888.XA 2018-04-28 2018-04-28 Method and device for preventing attribute information of interface control from being stolen Active CN108595965B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810402888.XA CN108595965B (en) 2018-04-28 2018-04-28 Method and device for preventing attribute information of interface control from being stolen

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810402888.XA CN108595965B (en) 2018-04-28 2018-04-28 Method and device for preventing attribute information of interface control from being stolen

Publications (2)

Publication Number Publication Date
CN108595965A CN108595965A (en) 2018-09-28
CN108595965B true CN108595965B (en) 2019-12-20

Family

ID=63620121

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810402888.XA Active CN108595965B (en) 2018-04-28 2018-04-28 Method and device for preventing attribute information of interface control from being stolen

Country Status (1)

Country Link
CN (1) CN108595965B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857673B (en) * 2019-02-25 2022-02-15 北京云测信息技术有限公司 Control identification method and device
CN110442419B (en) * 2019-08-15 2022-11-29 北京字节跳动网络技术有限公司 Interface layout method and device for Android application
CN111258569A (en) * 2020-01-09 2020-06-09 卓望数码技术(深圳)有限公司 Webpage component editing method, device, equipment and computer readable storage medium
CN115859228A (en) * 2022-12-01 2023-03-28 湖南于一科技有限公司 Method, device, equipment and storage medium for preventing information leakage in application program

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739251A (en) * 2008-11-17 2010-06-16 康佳集团股份有限公司 Method and system for generating interface control
CN105511843A (en) * 2014-09-22 2016-04-20 普天信息技术有限公司 Application program interface generation method and device
CN105553681B (en) * 2015-12-15 2018-11-27 武汉斗鱼网络科技有限公司 A kind of anti-plug-in method and system
CN107102798B (en) * 2016-02-22 2021-05-18 阿里巴巴集团控股有限公司 Method, system and related module for dynamically modifying user interface
CN107292596B (en) * 2016-04-01 2020-05-01 广州爱九游信息技术有限公司 Device and method for preventing automatic red packet brushing and server

Also Published As

Publication number Publication date
CN108595965A (en) 2018-09-28

Similar Documents

Publication Publication Date Title
CN108595965B (en) Method and device for preventing attribute information of interface control from being stolen
CN107423070B (en) Page generation method and device
CN109995805B (en) Intelligent robot management method, terminal device and medium
CN109408181B (en) Equipment skill display method and device
CN107370772A (en) Account login method, device and computer-readable recording medium
CN111831176B (en) Application program management method and device
CN109361948B (en) Interface management method, intelligent terminal and readable storage medium
CN111488088B (en) Equipment state identification method and device and intelligent terminal
WO2017181528A1 (en) Search display method and device
CN107861750B (en) Label management method, label management device and intelligent terminal
CN113220290A (en) Method, device, equipment and storage medium for realizing business function of application
CN105389113A (en) Gesture-based application control method and apparatus and terminal
CN109684022A (en) Word input processing method, device and electronic equipment
CN115062046A (en) Database query method and device, electronic equipment and storage medium
CN113176954B (en) Application calling method and device, storage medium and electronic equipment
CN112163033B (en) Mobile terminal and travel list display method thereof
CN106557570A (en) File management method and device under a kind of Android system
CN105096162A (en) Content item display method and apparatus
CN104780153A (en) Method and device for filtering information
CN105094608A (en) Task display method and device
CN117130697A (en) Method and device for fixing application on taskbar
CN106657316B (en) Message withdrawing method and device
CN114764363B (en) Prompting method, prompting device and computer storage medium
CN112988810B (en) Information searching method, device and equipment
CN103714186A (en) System and method for managing file resource

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
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: Tiktok vision (Beijing) Co.,Ltd.

CP01 Change in the name or title of a patent holder
CP03 Change of name, title or address

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Tiktok vision (Beijing) Co.,Ltd.

Address before: Room B0035, 2nd floor, No. 3 Courtyard, 30 Shixing Street, Shijingshan District, Beijing, 100041

Patentee before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

CP03 Change of name, title or address