Read function interception method, device, electronic device and computer readable medium

By using hook functions to intercept the process of reading functions on smart devices, the problem of application software obtaining device identification without authorization is solved, the protection of user privacy information is achieved, and information security is improved.

CN112231699BActive Publication Date: 2025-01-03BEIJING XUEZHITU NETWORK TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011105774.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-15
Publication Date
2025-01-03
Estimated Expiration
2040-10-15

AI Technical Summary

Technical Problem

Application software on smart devices privately obtains device identification and user privacy information without user authorization, resulting in users being unable to know and block them, affecting information security.

Method used

By using hook functions in the software development toolkit to intercept the process of reading functions, it shows whether the read function is allowed, and the read function is intercepted when the prohibited read instruction is received, avoiding the device identity being read.

Benefits of technology

Effectively prevent application software from privately obtaining device identifiers, prevent user privacy information leakage, improve user information security, and provide user selection permissions to flexibly execute read functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112231699B_ABST
    Figure CN112231699B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, electronic device and computer-readable medium for intercepting a read function, and belongs to the field of information security technology. The method includes: when a read function for reading a device identifier is identified, calling a process of a target function through a preset hook function, wherein the target function is used to display whether the read function is allowed to be executed; when a prohibition read instruction is received, intercepting the read function to prevent the device identifier from being read. In the present application, the software development kit can intercept the read function before the application software reads the device identifier, and promptly prevent the application software from privately obtaining the device identifier, thereby avoiding the leakage of user privacy information and improving user information security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security technology, and in particular to a method, device, electronic device and computer-readable medium for intercepting a read function. Background Art

[0002] Currently, various application software are installed on smart devices. Most of the application software can obtain the device identification after the user's authorization, and then obtain the user's private information in the smart device, such as address book, photos, text messages, etc. However, there are still some application software that obtain the device identification and user privacy information without the user's authorization, and sell the user's privacy information, causing inconvenience to the user.

[0003] When an application software obtains device identification without permission, the user is unaware of the violation and cannot prohibit it in advance, which affects the security of user information. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and computer-readable medium for intercepting a read function to solve the problem of user privacy information being stolen. The specific technical solution is as follows:

[0005] In a first aspect, a method for intercepting a read function is provided, the method comprising:

[0006] In the case of identifying a read function for reading a device identification, calling a process of a target function through a preset hook function, wherein the target function is used to display whether the read function is allowed to be executed;

[0007] When a read prohibition instruction is received, the read function is intercepted to prevent the device identification from being read.

[0008] Optionally, the read function includes a first interface read function, and the process of calling the target function through a preset hook function includes:

[0009] Calling a target function address through a preset first hook function, wherein the target function address is a function address of a process of the target function;

[0010] The address of the first interface read function is replaced with the address of the target function through the first hook function.

[0011] Optionally, the read function includes a second interface read function, and when the read function for reading the device identification is identified, before calling the target function through the preset hook function, the method further includes: constructing the second hook function through the brushless target hook function framework;

[0012] The process of calling the target function through the preset hook function includes: calling the target function address through the second hook function, wherein the target function address is the function address of the process of the target function; replacing the address of the second interface read function with the address of the target function through the second hook function.

[0013] Optionally, before constructing the second hook function through the target hook function framework of the brushless machine, the method further includes:

[0014] Get the hook function framework to be compiled;

[0015] Modifying the name of the hook function framework to be compiled into a target name, and filtering out the stack of the hook function framework to be compiled to obtain a first hook function framework;

[0016] Integrate the first hook function framework into the preset source code to obtain the target source code;

[0017] The first hook function framework is compiled by the target source code to obtain a target hook function framework.

[0018] Optionally, before the process of calling the target function through the preset hook function, the method further includes:

[0019] Determine the target application software for reading the device identification;

[0020] In the case that the preset application list does not include the target application software, the process of calling the target function is performed through a preset hook function, wherein the preset application list includes a plurality of application software that are allowed to read the device identification.

[0021] Optionally, after the process of calling the target function through the preset hook function, the method further includes:

[0022] When the read permission instruction is received, the read function continues to be executed.

[0023] Optionally, before calling the target function address through the preset first hook function, the method further includes:

[0024] The first hook function is embedded in the bottom layer of the mobile terminal.

[0025] In a second aspect, a device for intercepting a read function is provided, the device comprising:

[0026] A calling module, used for calling the process of the target function through a preset hook function when a read function for reading a device identification is identified, wherein the target function is used to display whether the execution of the read function is allowed;

[0027] The interception module is used to intercept the read function when receiving a prohibition read instruction to prevent the device identification from being read.

[0028] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0029] Memory, used to store computer programs;

[0030] The processor is used to implement any of the method steps described above when executing a program stored in the memory.

[0031] In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any of the method steps described above is implemented.

[0032] Beneficial effects of the embodiments of the present application:

[0033] The embodiment of the present application provides a method for intercepting a read function. When a software development kit identifies a read function for reading a device identifier, the software development kit calls the process of a target function through a preset hook function, wherein the target function is used to display whether the read function is allowed to be executed. When a read prohibition instruction is received, the read function is intercepted to prevent the device identifier from being read. In the present application, the software development kit can intercept the read function before the application software reads the device identifier, and promptly prevent the application software from privately obtaining the device identifier, thereby avoiding leakage of user privacy information and improving user information security.

[0034] Of course, implementing any product or method of the present application does not necessarily require achieving all of the above advantages at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0036] Figure 1 A flow chart of a method for intercepting a read function provided in an embodiment of the present application;

[0037] Figure 2 A flowchart of a method for calling a target function through a preset hook function provided in an embodiment of the present application;

[0038] Figure 3Another method flow chart of a process of calling a target function through a preset hook function provided in an embodiment of the present application;

[0039] Figure 4 A flow chart of a method for constructing a target hook function framework provided in an embodiment of the present application;

[0040] Figure 5 A processing flow chart of a method for intercepting a read function provided in an embodiment of the present application;

[0041] Figure 6 A schematic diagram of the structure of a read function interception device provided in an embodiment of the present application;

[0042] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0044] The embodiment of the present application provides a method for intercepting a read function, which can be applied to an SDK (Software Development Kit) or a target application software, and is used to intercept a device's read function through a hook function to prevent the device identifier from being read without user permission.

[0045] In the following, in combination with a specific implementation method, a method for intercepting a read function provided by an embodiment of the present application is described in detail by taking a software development kit as an example. Figure 1 As shown, the specific steps are as follows:

[0046] Step 101: When a read function for reading a device identification is identified, a process of calling a target function is performed through a preset hook function.

[0047] The target function is used to indicate whether the read function is allowed to be executed.

[0048] In an embodiment of the present application, some application software in the smart device will privately obtain the device identification without the user's permission, specifically by obtaining the device identification through a read function. A hook function is pre-stored in the software development kit of the present application. When the software development kit recognizes the read function, it will call the process of the target function through the hook function, wherein the target function is used to display whether the read function is allowed to be executed. Among them, the device identification can be IMEI (International Mobile Equipment Identity) or MAC (Media Access Control).

[0049] For example, when some application software obtains the device ID privately, the hook function recognizes the acquisition behavior and pops up a dialog box to ask “Do you want to allow the software to obtain call records?” The user can choose “Allow” or “Forbid” according to their needs.

[0050] The hook function is also called Hook technology. Before the system calls the function, the hook program captures the message first, and the hook function gets control first. At this time, the hook function can process (change) the execution behavior of the function and can also force the end of the message transmission.

[0051] Step 102: When a read prohibition instruction is received, a read function is intercepted to prevent the device identification from being read.

[0052] In an embodiment of the present application, after the user selects whether to allow reading in the dialog box, if the option selected by the user is "prohibit", indicating that the device identifier is not allowed to be read by the application software, the software development kit intercepts the reading function after receiving the prohibition reading instruction, so that the device identifier will not be read by the application software.

[0053] If the option selected by the user is "Allow", indicating that the device identification is allowed to be read by the application software, the software development kit will exit the process of the target function after receiving the instruction to allow reading, and continue to execute the reading function.

[0054] In this application, the software development kit can intercept the read function according to the user's instructions before the application software reads the device identification, and promptly prevent the application software from privately obtaining the device identification, thereby avoiding the leakage of user privacy information and improving user information security. In addition, this application can also give users the right to choose, and intercept or execute the read function according to the user's choice, which is flexible and meets user needs.

[0055] As an optional implementation, Figure 2As shown, the reading function includes a first interface reading function, and the process of calling the target function through a preset hook function includes:

[0056] Step 201: calling the target function address through a preset first hook function.

[0057] The target function address is the function address of the target function's process.

[0058] In the embodiment of the present application, the application software can obtain the device identification through the native layer. For example, the application software can access the / sys / class / net / wlan0 file in the mobile phone system directory to obtain the MAC address. At this time, the read function is the first interface read function. Specifically, the first interface read function can be the GetProp function. The function of the GetProp function is to retrieve the data handle from the property list of a given window. The first interface read function can also be HookSystemProperties.set, Settings.System.put, Settings.Secure.put or Settings.Global.put. The present application does not limit the specific function of the first interface read function.

[0059] The hook function set in the native layer is the first hook function. The software development kit performs hook embedding in the native layer. The software development kit calls the target function address through the preset first hook function, wherein the target function address is the function address of the process of the target function.

[0060] Step 202: Replace the address of the first interface read function with the address of the target function through the first hook function.

[0061] In an embodiment of the present application, after the software development kit identifies the first interface read function, it obtains the address of the first interface read function and replaces the address of the first interface read function with the address of the target function, so that the hook function can call the process of the target function.

[0062] In the present application, the first hook function can be pre-embedded in the bottom layer of the mobile terminal, where the bottom layer of the mobile terminal is the native layer. When the application software obtains the device identification through the native layer, the first hook function can obtain the reading function in time and intercept it, thereby improving user information security.

[0063] As an optional implementation, Figure 3 As shown, the read function includes a second interface read function. When a read function for reading a device identifier is identified, before calling a process of a target function through a preset hook function, the method further includes:

[0064] Step 301: construct a second hook function through the target hook function framework of the flash-free machine.

[0065] In the embodiment of the present application, the application software can obtain the device identification through an API (Application Program Interface), and the reading function at this time is a second interface reading function.

[0066] Xposed is a framework for implementing Hook on the Android system. Xposed is a project developed and managed by XDA community user rovo89. It uses Xposed Bridge to inject third-party code into the method call of Android applications by modifying the Zygote process of the Android Dalvik runtime, and realizes the ability to dynamically modify the system and application behavior at runtime in a non-invasive manner. However, using the Xposed framework requires Root privileges. Without Root privileges, the Xposed framework cannot replace app_process, and it is impossible to inject the entire system-level application. However, this application cannot root all smart devices that intercept the read function. Therefore, this application sets up a target hook function framework, which does not require root privileges, and can also construct a second hook function, and implement the function of calling the target function process through the second hook function.

[0067] Step 302: Call the target function address through the second hook function.

[0068] The target function address is the function address of the target function's process.

[0069] In an embodiment of the present application, when the application software obtains the device identification through the API, the hook function of the API interface of the hook smart device is the second hook function, Xposed is a hook at the Java layer, and the software development kit performs hook (hook) embedding at the Java layer. The software development kit calls the target function address through the preset second hook function, wherein the target function address is the function address of the process of the target function.

[0070] Step 303: Replace the address of the second interface read function with the address of the target function through the second hook function.

[0071] In an embodiment of the present application, after the software development kit identifies the second interface read function, it obtains the address of the second interface read function and replaces the address of the second interface read function with the address of the target function, so that the hook function can call the process of the target function.

[0072] In the present application, the second hook function can be pre-embedded in the Java layer. When the application software obtains the device identification through the API interface, the second hook function can obtain the reading function in time and intercept it, thereby improving user information security.

[0073] As an optional implementation, Figure 4 As shown, before constructing the second hook function through the target hook function framework of the free-flash machine, the method also includes:

[0074] Step 401: Obtain the hook function framework to be compiled.

[0075] In an embodiment of the present application, the server obtains a hook function framework to be compiled. Specifically, the hook function framework to be compiled may be an xposed framework.

[0076] Step 402: modify the name of the hook function framework to be compiled into the target name, and filter out the stack of the hook function framework to be compiled to obtain the first hook function framework.

[0077] In the embodiment of the present application, the server compiles the xposed source code and modifies the feature code, modifies the name of the Xposed framework to the target name, and filters out the stack of the Xposed framework to obtain the first hook function framework.

[0078] The server modifies the name of the Xposed framework into a target name, which can prevent the device system from recognizing the Xposed framework. For example, the target name can be an application name in the system, such as camera, email, or phone.

[0079] Step 403: Integrate the first hook function framework into the preset source code to obtain the target source code.

[0080] In the embodiment of the present application, the preset source code may be LineageOs source code, and the server integrates the first hook function framework into the LineageOs source code to obtain the target source code.

[0081] Step 404: Compile the first hook function framework through the target source code to obtain the target hook function framework.

[0082] In an embodiment of the present application, XposedBridge exists in the hook function framework to be compiled, which includes art dependencies and jars provided to the program. After the hook function framework to be compiled is name modified, stack filtered and integrated, the XposedBridge in the hook function framework to be compiled will also change and become the target source code. The server compiles the first hook function framework through the target source code to obtain the target hook function framework.

[0083] In this application, after the name modification and stack filtering of the hook function framework to be compiled in XposedBridge, the device system can think that the first hook function framework is the function framework of the device itself, and will not delete the function framework, thus building a root-free system environment and realizing a root-free hook function framework.

[0084] As an optional implementation, calling the process of the target function through the preset hook function includes: determining the target application software for reading the device identification; and calling the process of the target function through the preset hook function when the preset application list does not include the target application software. The preset application list includes multiple application software that are allowed to read the device identification.

[0085] In the embodiment of the present application, a preset application list is stored in the smart device, and the preset application list includes multiple application softwares that are allowed to read the device identification. When the software development kit recognizes the read function for reading the device identification, it needs to determine the target application software for reading the device identification.

[0086] The server determines whether the preset application list includes the target application software. If the server determines that the preset application list includes the target application software, it indicates that the target application software is allowed to directly read the device identification. If the server determines that the preset application list does not include the target application software, it indicates that the target application software is not allowed to directly read the device identification. The software development kit calls the process of the target function through a preset hook function to allow the user to choose whether to allow the target application software to read the device identification.

[0087] The preset application list may be an application software whitelist. The application software in the preset application list is the user's frequently used software or the software that must obtain the device identification, such as WeChat, QQ, etc.

[0088] In the present application, the software development kit determines whether the preset application list includes the target application software, which can avoid using a hook function for the reading function of each application software and reduce the redundancy of operations.

[0089] Optionally, the embodiment of the present application also provides a processing flow chart of a method for intercepting a read function, such as Figure 5 As shown, the specific steps are as follows.

[0090] Step 501: modify the name of the hook function framework to be compiled into the target name, and filter out the stack of the hook function framework to be compiled to obtain the first hook function framework.

[0091] Step 502: Integrate the first hook function framework into the preset source code to obtain the target source code.

[0092] Step 503: Compile the first hook function framework through the target source code to obtain the target hook function framework.

[0093] Step 504: When the preset application list does not include the target application software, the process of calling the target function is called through the preset hook function.

[0094] Step 505: When a read prohibition instruction is received, the read function is intercepted to prevent the device identification from being read.

[0095] Step 506: When the read permission instruction is received, continue to execute the read function.

[0096] Among them, step 505 and step 506 are parallel steps.

[0097] Based on the same technical concept, the embodiment of the present application also provides an interception device for reading a function, such as Figure 6 As shown, the device comprises:

[0098] The first calling module 601 is used to call the process of the target function through a preset hook function when a read function for reading a device identification is identified, wherein the target function is used to display whether the read function is allowed to be executed;

[0099] The interception module 602 is used to intercept the read function when receiving the read prohibition instruction to prevent the device identification from being read.

[0100] Optionally, the read function includes a first interface read function, and the first calling module 601 includes:

[0101] A first calling unit, used to call a target function address through a preset first hook function, wherein the target function address is a function address of a process of the target function;

[0102] The first replacement unit is used to replace the address of the first interface read function with the address of the target function through the first hook function.

[0103] Optionally, the device further comprises:

[0104] A construction module, used to construct a second hook function through a target hook function framework of the free-flash machine;

[0105] The first calling module 601 includes:

[0106] A second calling unit, used to call a target function address through a second hook function, wherein the target function address is a function address of a process of the target function;

[0107] The second replacement unit is used to replace the address of the second interface read function with the address of the target function through the second hook function.

[0108] Optionally, the device further comprises:

[0109] Get module, used to get the hook function framework to be compiled;

[0110] A modification module, used for modifying the name of the hook function framework to be compiled into the target name, and filtering out the stack of the hook function framework to be compiled to obtain the first hook function framework;

[0111] An integration module, used for integrating the first hook function framework into a preset source code to obtain a target source code;

[0112] The editing module is used to compile the first hook function framework through the target source code to obtain the target hook function framework.

[0113] Optionally, the device further comprises:

[0114] A determination module, used to determine the target application software for reading the device identification;

[0115] The second calling module is used to call the process of the target function through a preset hook function when the preset application list does not include the target application software, wherein the preset application list includes multiple application software that are allowed to read the device identification.

[0116] Optionally, the device further comprises:

[0117] The execution module is used to continue executing the read function when receiving the read permission instruction.

[0118] Optionally, the device further comprises:

[0119] The tracking module is used to track the first hook function at the bottom layer of the mobile terminal.

[0120] Based on the same technical concept, an embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.

[0121] Memory 703, used for storing computer programs;

[0122] The processor 701 is used to implement the above steps when executing the program stored in the memory 703.

[0123] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0124] The communication interface is used for communication between the above electronic device and other devices.

[0125] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0126] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0127] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0128] In another embodiment of the present invention, a computer program product including instructions is provided, which enables the computer to execute any one of the methods in the above embodiments when the computer program product is executed on the computer.

[0129] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0130] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0131] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A method for intercepting a read function, characterized in that: The method comprises: In the case of identifying a read function for reading a device identification, calling a process of a target function through a preset hook function, wherein the target function is used to display whether the read function is allowed to be executed; When receiving a read prohibition instruction, intercepting the read function to prevent the device identification from being read; Before calling the process of the target function through the preset hook function, the method further includes: Get the hook function framework to be compiled; Modify the name of the hook function framework to be compiled into a target name, and filter out the stack of the hook function framework to be compiled to obtain a first hook function framework, wherein the target name is an application name in the system, and the first hook function framework is considered by the device system to be a function framework of the device itself, and a root-free system environment is built; Integrate the first hook function framework into the preset source code to obtain the target source code; Compiling the first hook function framework through the target source code to obtain a target hook function framework; A second hook function is constructed through the target hook function framework of the brushless machine, wherein the second hook function is used to call the target function process.

2. The method according to claim 1, characterized in that The read function includes a first interface read function, and the process of calling the target function through a preset hook function includes: Calling a target function address through a preset first hook function, wherein the target function address is a function address of a process of the target function; The address of the first interface read function is replaced with the address of the target function through the first hook function.

3. The method according to claim 1, characterized in that The read function includes a second interface read function. When the read function for reading the device identification is identified, before calling the target function through the preset hook function, the method further includes: constructing a second hook function through the target hook function framework of the brushless machine; The process of calling the target function through the preset hook function includes: calling the target function address through the second hook function, wherein the target function address is the function address of the process of the target function; replacing the address of the second interface read function with the address of the target function through the second hook function.

4. The method according to claim 1, characterized in that: Before the process of calling the target function through the preset hook function, the method further includes: Determine the target application software for reading the device identification; In the case that the preset application list does not include the target application software, the process of calling the target function is performed through a preset hook function, wherein the preset application list includes a plurality of application software that are allowed to read the device identification.

5. The method according to claim 1, characterized in that After the process of calling the target function through the preset hook function, the method further includes: When the read permission instruction is received, the read function continues to be executed.

6. The method according to claim 2, characterized in that Before calling the target function address through the preset first hook function, the method further includes: The first hook function is embedded in the bottom layer of the mobile terminal.

7. A device for intercepting a read function, characterized in that: The device comprises: A calling module, used for calling the process of the target function through a preset hook function when a read function for reading a device identification is identified, wherein the target function is used to display whether the execution of the read function is allowed; An interception module, configured to intercept the read function when receiving a read prohibition instruction, so as to prevent the device identification from being read; Wherein, the device is also used for: Get the hook function framework to be compiled; Modify the name of the hook function framework to be compiled into a target name, and filter out the stack of the hook function framework to be compiled to obtain a first hook function framework, wherein the target name is an application name in the system, and the first hook function framework is considered by the device system to be a function framework of the device itself, and a root-free system environment is built; Integrate the first hook function framework into the preset source code to obtain the target source code; Compiling the first hook function framework through the target source code to obtain a target hook function framework; A second hook function is constructed through the target hook function framework of the brushless machine, wherein the second hook function is used to call the target function process.

8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.