WO2016187806A1 - Method, device and terminal for preventing android device from being rooted - Google Patents

Method, device and terminal for preventing android device from being rooted Download PDF

Info

Publication number
WO2016187806A1
WO2016187806A1 PCT/CN2015/079812 CN2015079812W WO2016187806A1 WO 2016187806 A1 WO2016187806 A1 WO 2016187806A1 CN 2015079812 W CN2015079812 W CN 2015079812W WO 2016187806 A1 WO2016187806 A1 WO 2016187806A1
Authority
WO
WIPO (PCT)
Prior art keywords
read
command
mode
emmc
driver layer
Prior art date
Application number
PCT/CN2015/079812
Other languages
French (fr)
Chinese (zh)
Inventor
李志刚
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201580004158.9A priority Critical patent/CN106471464B/en
Priority to PCT/CN2015/079812 priority patent/WO2016187806A1/en
Publication of WO2016187806A1 publication Critical patent/WO2016187806A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the present invention relates to the field of data processing, and in particular, to a method, an apparatus, and a terminal for preventing an Android device from being rooted.
  • the mobile phone Root is the highest permission to obtain the operating system of the mobile phone, which is an unlocking process of the Android mobile phone.
  • the advantage of mobile phone Root is that users can cut down the mobile phone's program according to their own preferences and needs, and at the same time can carry out more operations. Now there are many Root tools on the Internet, so it is very simple to get Root. After the phone gains root privileges, it can access some restricted items, and the components of the system can be deleted and modified. Root privilege is the biggest temptation for those mobile phone players to be able to flash the machine. As long as the root permission is obtained, the user can delete some programs that are included in the system or brush into different operating systems. It is because of the root that the user can do anything at will. Because the user accidentally deletes the system file and causes various faults in the mobile phone, which occupies a large amount of maintenance resources, there is an urgent need for preventing the root of the mobile phone.
  • This scheme filters the write commands of the System partition at the block device layer to prevent illegal writing to the System partition and achieve the purpose of preventing Root.
  • System partition read-only protection scheme can effectively prevent the cracking of common one-click root tools. However, since it is implemented at the block device layer, it is impossible to completely prevent the root by replacing the image.
  • the embodiment of the invention provides a method, a device and a terminal for preventing an Android device from being rooted, and can prevent the Android device from being rooted.
  • the first aspect of the present invention provides a method for preventing an Android device from being rooted, which may include:
  • the pre-configured write filtering function is started
  • Determining, by the write filtering function, whether the non-read only command acts on the EMMC driver layer The data of the read-only partition in the case, if yes, the non-read-only command is filtered by the write filtering function, and if not, the non-read-only command is issued.
  • the method may include:
  • the operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode.
  • the second embodiment of the first aspect of the present invention may include:
  • the first embodiment of the first aspect of the present invention, the second embodiment of the first aspect of the present invention, the third embodiment of the first aspect of the present invention may include:
  • the write filtering function is configured in the structure function.
  • the first embodiment of the first aspect of the present invention, the second embodiment of the first aspect of the present invention, the fourth embodiment of the first aspect of the present invention may include:
  • the write filtering function is cancelled by restarting.
  • the first embodiment of the first aspect of the present invention, the second embodiment of the first aspect of the present invention, the fifth embodiment of the first aspect of the present invention may include:
  • the second aspect of the present invention provides an apparatus for preventing an Android device from being rooted, which may include:
  • a receiving unit configured to receive a non-read only command to the embedded multimedia card EMMC driver layer
  • a determining unit configured to determine that an operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovrey mode;
  • a startup unit for initiating a pre-configured write filtering function
  • a determining unit configured to determine, by the write filtering function, whether the non-read-only command acts on data of a read-only partition in the EMMC driver layer;
  • An execution unit configured to: when the determining unit determines that the non-read only command acts on the EMMC driver When the data of the read-only partition in the layer is filtered, the non-read-only command is filtered by the write filtering function, and when the determining unit determines that the non-read-only command does not act on the data of the read-only partition in the EMMC driver layer , the non-read only command is issued.
  • the method may include:
  • the determining subunit is configured to determine, according to the processing function triggered in the initialization init process corresponding to the non-read-only command, that the working mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode.
  • the method may include:
  • An obtaining unit configured to acquire, by using the write filtering function, an address that is not a read-only command
  • the determining unit includes:
  • a determining subunit configured to determine, according to the address, whether the non-read only command acts on data of a read-only partition in the EMMC.
  • the first embodiment of the second aspect of the present invention, the second embodiment of the second aspect of the present invention, the third embodiment of the second aspect of the present invention may include:
  • a configuration unit configured to configure the write filtering function in the structure function.
  • the first embodiment of the second aspect of the present invention, the second embodiment of the second aspect of the present invention, the fourth embodiment of the second aspect of the present invention may include:
  • the first processing unit is configured to cancel the write filtering function by restarting.
  • the first embodiment of the second aspect of the present invention, the second embodiment of the second aspect of the present invention, the fifth embodiment of the second aspect of the present invention may include:
  • the second processing unit is configured to deliver the non-read only command if the unlock code of the Android device is obtained.
  • the third aspect of the present invention provides a terminal, which may include:
  • One or more processors a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or Multiple programs include instructions for executing the following:
  • the operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or The normal engineering Recovery mode starts the pre-configured write filtering function
  • the method may include:
  • the operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode.
  • the second embodiment of the third aspect of the present invention may include:
  • the first embodiment of the third aspect of the present invention, the second embodiment of the third aspect of the present invention, the third embodiment of the third aspect of the present invention may include:
  • the write filtering function is configured in the structure function.
  • the first embodiment of the third aspect of the present invention, the second embodiment of the third aspect of the present invention, the fourth embodiment of the third aspect of the present invention may include:
  • the write filtering function is cancelled by restarting.
  • the first embodiment of the third aspect of the present invention, the second embodiment of the third aspect of the present invention, the fifth embodiment of the third aspect of the present invention may include:
  • the sixth embodiment of the third aspect of the present invention may include:
  • the memory is a readable storage medium, and the instructions, when executed by the terminal, cause the terminal to execute the following instructions:
  • the pre-configured write filtering function is started
  • Determining, by the write filtering function, whether the non-read only command acts on the EMMC driver layer The data of the read-only partition in the case, if yes, the non-read-only command is filtered by the write filtering function, and if not, the non-read-only command is issued.
  • the method may include:
  • the operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode.
  • the second embodiment of the third aspect of the present invention may include:
  • the first embodiment of the third aspect of the present invention, the second embodiment of the third aspect of the present invention, the third embodiment of the third aspect of the present invention may include:
  • the write filtering function is configured in the structure function.
  • the first embodiment of the third aspect of the present invention, the second embodiment of the third aspect of the present invention, the fourth embodiment of the third aspect of the present invention may include:
  • the write filtering function is cancelled by restarting.
  • the first embodiment of the third aspect of the present invention, the second embodiment of the third aspect of the present invention, the fifth embodiment of the third aspect of the present invention may include:
  • the embodiment of the present invention has the following advantages: determining whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer by using the pre-configured write filtering function, and when the determination is yes, filtering
  • the non-read-only command because the EMMC only abstracts an EMMC device in the EMMC driver layer, and limits the read-only partition pointed to by the EMMC device, thereby preventing the data of the read-only partition from being tampered with, thereby preventing The Android device is rooted.
  • FIG. 1 is a schematic diagram of an embodiment of a method for preventing an Android device from being rooted according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of another embodiment of a method for preventing an Android device from being rooted according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of an embodiment of a device for preventing an Android device from being rooted according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of another embodiment of an apparatus for preventing an Android device from being rooted according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of an embodiment of a terminal device according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of an embodiment in which a terminal is used as a mobile phone according to an embodiment of the present invention.
  • the embodiment of the invention provides a method, a device and a terminal for preventing an Android device from being rooted, and can prevent the Android device from being rooted.
  • System partition read-only protection scheme can effectively prevent the cracking of common one-click root tools.
  • the Embedded Multi Media Card (EMMC) abstracts a plurality of block devices at the block device layer, and these block devices respectively point to the respective partitions on the entire EMMC (there are blocks)
  • the device points to the System partition on the EMMC), in the block
  • the device layer can only restrict access to the System partition, but hackers can illegally write by accessing other partitions. Therefore, it is impossible to completely prevent the root by replacing the mirror.
  • EMMC only abstracts an EMMC device at the EMMC driver layer, it restricts the read-only partition pointed to by the EMMC device.
  • the present invention configures the write filtering function to filter the non-read-only data of the read-only partition through the write filtering function.
  • the command can prevent the data of the read-only partition from being tampered with, and can completely prevent the root by replacing the mirror. At the same time, it can effectively prevent the crack of the common one-click root tool.
  • an embodiment of a method for preventing an Android device from being rooted in an embodiment of the present invention includes:
  • the non-read-only command for the embedded multimedia card EMMC driver layer is received, wherein the non-read-only command includes a single block write (CMD24), a multi-block write (CMD25), and an erase command (CMD38), and includes Other types of non-read-only commands are not limited herein.
  • the pre-configured write filtering function is started.
  • the pre-configured write filtering function is started.
  • the Recovrey mode is a mode that can modify the data or system inside the Android machine.
  • the Recovrey mode is also called recovery mode and flash mode.
  • the write filtering function is used to block an illegal write operation
  • the write filtering function may be configured in the structure function by constructing a structure function
  • the write filtering function mainly includes three functions: determining Whether the received command is a non-read-only command, whether the non-read-only command acts on the data of the read-only partition, and the non-read-only command is filtered.
  • the normal startup mode herein can be understood as a mode with a complete interface.
  • the Recovery mode here can be understood as a mode with simple interface and used for mobile phone maintenance.
  • the operating system can be an operating system of the mobile phone, and can also be a tablet operating system.
  • the Root device of the Android device can be understood as Root for a device having an Android operating system.
  • the method of stopping the non-read-only command is a method for filtering the non-read-only command, and the non-read-only command may be filtered by other methods, and details are not described herein again.
  • the pre-configured write filtering function determines whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer. When the determination is yes, the non-read-only command is filtered, because the EMMC is driven by the EMMC.
  • the layer only abstracts an EMMC device. By restricting the read-only partition pointed to by the EMMC device, the purpose of preventing the data of the read-only partition from being tampered is achieved, so that the Android device can be prevented from being rooted.
  • another embodiment of the method for preventing an Android device from being rooted in the embodiment of the present invention includes:
  • the upper layer application receives a non-read-only command to the EMMC driver layer, where the non-read-only command includes a single block write (CMD24) and a multi-block write (CMD25) and an erase command (CMD38), and includes other types.
  • Non-read-only commands which are not limited here.
  • non-read-only command can be sent by the block device request (BIO), and the EMMC driver layer BIO is converted into a multimedia card (MMC, Multimedia Card) request structure, and queued for processing in the MMC queue.
  • BIO block device request
  • MMC multimedia card
  • Multimedia Card Multimedia Card
  • the pre-configured write filtering is started.
  • the initial corresponding to the non-read-only command After receiving a non-read-only command to the EMMC driver layer, the initial corresponding to the non-read-only command
  • the processing function triggered in the init process determines that the operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovrey mode, and then starts a pre-configured write filtering function, wherein the Recovrey mode is a type The internal data of the Android machine or the mode in which the system is modified.
  • the Recovrey mode is also called the recovery mode and the flash mode.
  • processing function may be a processing function in sys_wp_init_action, which is a standard action of the Android architecture, which can be understood as a function executed during the boot process, and can also be other types.
  • the processing function is not limited herein.
  • the write filtering function is configured in the structure function, and the write filtering function mainly includes three functions: determining whether the received command is a non-read-only command, and determining that the command is not only Whether the read command acts on the data of the read-only partition and filters the non-read-only commands.
  • the normal startup mode herein can be understood as a mode with a complete interface.
  • the Recovery mode here can be understood as a mode with simple interface and used for mobile phone maintenance.
  • the operating system can be an operating system of the mobile phone, and can also be a tablet operating system.
  • the Root device of the Android device can be understood as Root for a device having an Android operating system.
  • the method is cancelled by restarting.
  • Write filtering When it is determined that the operating mode of the operating system where the EMMC driver layer is located is not the normal startup mode or the normal engineering Recovrey mode according to the processing function triggered in the initialization init process corresponding to the non-read-only command, the method is cancelled by restarting. Write filtering.
  • the address of the non-read-only command mapping is obtained by the write filtering function, indicating that the write filtering function pre-configures the function of obtaining an address.
  • step 204 according to the address to determine whether the non-read-only command acts on the data of the read-only partition in the EMMC, and if so, step 205 is performed, and if not, step 206 is performed;
  • the partition corresponding to the address is read-only, and the partition corresponding to the address is not read-only. According to the address, it is determined whether the non-read-only command acts on the data of the read-only partition in the EMMC. If yes, step 205 is performed. If not, step 206 is performed.
  • the write-filter function stops the sending of the non-read-only command, returns to the end, and can be selected. Set the error flag.
  • the non-read-only command is issued after determining that the non-read-only command does not act on the data of the read-only partition in the EMMC driver layer according to the address.
  • the above-mentioned rooting by the unlocking code is one of a plurality of special cases, and the legal root can also be performed under the following conditions:
  • Root Before taking the root of the present invention, it can be judged whether it is under the above conditions, and if so, Root is allowed.
  • the pre-configured write filtering function determines whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer. When the determination is yes, the non-read-only command is filtered, because the EMMC is driven by the EMMC.
  • the layer only abstracts an EMMC device. By restricting the read-only partition pointed to by the EMMC device, the purpose of preventing the data of the read-only partition from being tampered is achieved, so that the Android device can be prevented from being rooted.
  • the mobile phone is pre-configured with the write filtering function.
  • the hacker A downloads the image
  • the hacker A starts to brush in the image.
  • the mobile phone receives a non-read-only command to the EMMC driver layer, according to the non-read-only command.
  • the processing function triggered in the initialization init process determines that the non-read-only command is a non-read-only command in the normal Recovery mode, the mobile phone starts the write filtering function, acquires the address of the non-read-only command, and determines the non-read-only command by the address.
  • the mobile phone stops the sending of the non-read-only command by the write filtering function, returns to the end, and sets an error flag.
  • an embodiment of an apparatus for preventing an Android device from being rooted in the embodiment of the present invention includes:
  • the receiving unit 301 is configured to receive a non-read only command for the embedded multimedia card EMMC driver layer;
  • the determining unit 302 is configured to determine that an operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovrey mode;
  • the startup unit 303 is configured to start a pre-configured write filtering function.
  • the determining unit 304 is configured to determine, by the write filtering function, whether the non-read-only command acts on data of the read-only partition in the EMMC driver layer;
  • the executing unit 305 is configured to: when the determining unit 304 determines, by the write filtering function, that the non-read-only command acts on the data of the read-only partition in the EMMC driver layer, filtering the non-read-only command by using the write filtering function, when determining The unit 304 sends the non-read-only command when the non-read-only command does not act on the data of the read-only partition in the EMMC driver layer.
  • the pre-configured write filtering function determines whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer. When the determination is yes, the non-read-only command is filtered, because the EMMC is driven by the EMMC.
  • the layer only abstracts an EMMC device. By restricting the read-only partition pointed to by the EMMC device, the purpose of preventing the data of the read-only partition from being tampered is achieved, so that the Android device can be prevented from being rooted.
  • another embodiment of the device for preventing the Android device from being rooted in the embodiment of the present invention includes:
  • the receiving unit 401 is configured to receive a non-read only command to the embedded multimedia card EMMC driver layer;
  • the determining unit 402 is configured to determine that an operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovrey mode;
  • a starting unit 403, configured to start a pre-configured write filtering function
  • the determining unit 404 is configured to determine, by using the write filtering function, whether the non-read-only command acts on data of the read-only partition in the EMMC driver layer;
  • the executing unit 405 is configured to determine, by the determining unit 404, the non-read-only command by using the write filtering function.
  • the non-read-only command is filtered by the write filtering function, and the determining unit 404 determines, by the write filtering function, that the non-read-only command does not act on the EMMC driver layer.
  • the non-read-only command is issued.
  • the obtaining unit 406 is configured to obtain, by using the write filtering function, an address that is not a read-only command;
  • a construction unit 407 configured to construct a structure function
  • the configuration unit 408 is configured to configure the write filtering function in the structure function
  • the first processing unit 409 is configured to cancel the write filtering function by means of an emergency restart.
  • the second processing unit 410 is configured to send the non-read-only command if the unlock code of the Android device is obtained.
  • the determining unit 402 in this embodiment includes:
  • the determining sub-unit 4021 is configured to determine, according to the processing function triggered in the initialization init process corresponding to the non-read-only command, that the working mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode;
  • the determining unit 404 in this embodiment includes:
  • the determining subunit 4041 is configured to determine, according to the address, whether the non-read only command acts on data of the read-only partition in the EMMC.
  • the pre-configured write filtering function determines whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer. When the determination is yes, the non-read-only command is filtered, because the EMMC is driven by the EMMC.
  • the layer only abstracts an EMMC device. By restricting the read-only partition pointed to by the EMMC device, the purpose of preventing the data of the read-only partition from being tampered is achieved, so that the Android device can be prevented from being rooted.
  • the receiving unit 401 receives a non-read-only command of the upper layer application to the EMMC driver layer, where the non-read-only command includes a single block write (CMD24) and a multi-block write (CMD25) and an erase command (CMD38).
  • CMD24 single block write
  • CMD25 multi-block write
  • CMD38 erase command
  • Other types of non-read-only commands are also included, which are not limited herein; it should be noted that the non-read-only command can be delivered by the block device request (BIO), and the BIO is converted into the MMC request structure at the EMMC driver layer.
  • the MMC queues for processing in the queue.
  • the determining sub-unit 4021 in the determining unit 402 determines the operation of the operating system in which the EMMC driver layer is located according to the processing function triggered in the initialization init process corresponding to the non-read-only command.
  • the mode is the normal startup mode or the normal engineering Recovrey mode, and the startup unit 403 starts a pre-configured write filtering function, wherein the Recovrey mode is a mode that can modify data or system inside the Android machine, and the recovery mode is also called Recovery mode, flash mode;
  • the processing function can be a processing function in sys_wp_init_action, which is a standard action of the Android architecture, which can be understood as a function executed during the boot process. . It can also be other types of processing functions, which are not limited herein.
  • the structure function is constructed by the constructing unit 407, and the write filtering function is configured in the structure function by the configuration unit 408.
  • the write filtering function mainly includes three functions: determining whether the received command is non- Read-only commands, determine whether non-read-only commands act on data in read-only partitions, and filter non-read-only commands.
  • the normal startup mode here can be understood as a mode with a complete interface.
  • the Recovery mode here can be understood as a mode with simple interface and used for mobile phone maintenance.
  • the operating system can be an operating system of the mobile phone, and can also be a tablet operating system.
  • the Root device of the Android device can be understood as Root for a device having an Android operating system.
  • the first processing unit 409 passes The restart mode cancels the write filtering function.
  • the obtaining unit 406 acquires the address of the non-read-only command map by the write filtering function. Since the partition corresponding to the address is read-only, the partition corresponding to the address is not read-only, and the determining sub-unit 4041 in the determining unit 404 determines, according to the address, whether the non-read-only command acts on the read-only partition in the EMMC. The data.
  • the execution unit 405 After determining that the non-read-only command is applied to the data of the read-only partition in the EMMC driver layer, the execution unit 405 stops the sending of the non-read-only command by the write filtering function, returns to the end, and can select the setting. Error flag. After determining that the non-read-only command does not act on the data of the read-only partition in the EMMC driver layer according to the address, the executing unit 405 issues the non-read-only command. The second processing unit 410 delivers the non-read-only command if the unlock code of the Android device is obtained.
  • the embodiment of the present invention further provides a terminal, as shown in FIG. 5, including: a receiver 501, a processor 502;
  • the processor 502 is configured to: perform a non-read-only command to receive an EMMC driver layer of the embedded multimedia card; and determine that the operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode. , the pre-configured write filtering function is started; the write filtering function is used to determine whether the non-read-only command acts on the read-only partition data in the EMMC driver layer, and if so, the non-read-only command is filtered by the write filtering function. If no, the non-read only command is issued.
  • the pre-configured write filtering function determines whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer. When the determination is yes, the non-read-only command is filtered, because the EMMC is driven by the EMMC.
  • the layer only abstracts an EMMC device. By restricting the read-only partition pointed to by the EMMC device, the purpose of preventing the data of the read-only partition from being tampered is achieved, so that the Android device can be prevented from being rooted.
  • the embodiment of the present invention further provides a specific implementation scheme for determining the working mode, as follows:
  • the processor 502 is specifically configured to control execution: if the EMMC is determined according to a processing function triggered in the initialization init process corresponding to the non-read-only command. If the working mode of the operating system where the driver layer is located is the normal startup mode or the normal engineering recovery mode, the pre-configured write filtering function is enabled. Otherwise, the write filtering function is cancelled by the restart mode.
  • the above Recovrey mode is a mode that can modify the data or system inside the Android machine.
  • the processing function can be a processing function in sys_wp_init_action, which is a standard action of the Android architecture. It can be understood as a function executed during the boot process, and can also be other types of processing functions. This is not a limitation.
  • the partition corresponding to the address is read-only, and the partition corresponding to the address is not read-only. Therefore, the processor 502 is further configured to perform control: obtaining the non-only by using the write filtering function.
  • the address of the read command is used to determine, according to the address, whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer, and if so, the non-read-only command is filtered by the write filtering function, and if not, the next Send this non-read-only command.
  • FIG. 6 another embodiment of the terminal in the embodiment of the present invention includes:
  • the terminal may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), an in-vehicle computer, and the terminal is a mobile phone as an example:
  • FIG. 6 is a block diagram showing a partial structure of a mobile phone related to a terminal provided by an embodiment of the present invention.
  • the mobile phone includes: a radio frequency (RF) circuit 610, a memory 620, an input unit 630, a display unit 640, a sensor 650, an audio circuit 660, a wireless fidelity (WiFi) module 670, and a processor 680. And power supply 690 and other components.
  • RF radio frequency
  • the RF circuit 610 can be used for transmitting and receiving information or during a call, and receiving and transmitting the signal. Specifically, after receiving the downlink information of the base station, the processor 680 processes the data. In addition, the uplink data is designed to be sent to the base station. Generally, RF circuit 610 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuitry 610 can also communicate with the network and other devices via wireless communication. The above wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division). Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), E-mail, Short Messaging Service (SMS), and the like.
  • GSM Global System of Mobile communication
  • GPRS General Packet Radio Service
  • the memory 620 can be used to store software programs and modules, and the processor 680 executes various functional applications and data processing of the mobile phone by running software programs and modules stored in the memory 620.
  • the memory 620 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to Data created by the use of the mobile phone (such as audio data, phone book, etc.).
  • memory 620 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the input unit 630 can be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function controls of the handset.
  • the input unit 630 may include a touch panel 631 and other input devices 632.
  • the touch panel 631 also referred to as a touch screen, can collect touch operations on or near the user (such as the user using a finger, a stylus, or the like on the touch panel 631 or near the touch panel 631. Operation), and drive the corresponding connecting device according to a preset program.
  • the touch panel 631 can include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
  • the processor 680 is provided and can receive commands from the processor 680 and execute them.
  • the touch panel 631 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 630 may also include other input devices 632.
  • other input devices 632 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
  • the display unit 640 can be used to display information input by the user or information provided to the user as well as various menus of the mobile phone.
  • the display unit 640 can include a display panel 641.
  • the display panel 641 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
  • the touch panel 631 can cover the display panel 641. When the touch panel 631 detects a touch operation on or near it, the touch panel 631 transmits to the processor 680 to determine the type of the touch event, and then the processor 680 according to the touch event. The type provides a corresponding visual output on display panel 641.
  • the touch panel 631 and the display panel 641 are two independent components to implement the input and input functions of the mobile phone, in some embodiments, the touch panel 631 may be integrated with the display panel 641. Realize the input and output functions of the phone.
  • the handset can also include at least one type of sensor 650, such as a light sensor, motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 641 according to the brightness of the ambient light, and the proximity sensor may close the display panel 641 and/or when the mobile phone moves to the ear. Or backlight.
  • the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes).
  • Detecting the magnitude and direction of gravity can be used to identify the gesture of the phone (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tap), etc.; as for the phone can also be configured Other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., will not be described here.
  • Audio circuit 660, speaker 661, and microphone 662 provide an audio interface between the user and the handset.
  • the audio circuit 660 can transmit the converted electrical data of the received audio data to the speaker 661 for conversion to the sound signal output by the speaker 661; on the other hand, the microphone 662 converts the collected sound signal into an electrical signal by the audio circuit 660. After receiving, it is converted into audio data, and then processed by the audio data output processor 680, sent to the other mobile phone via the RF circuit 610, or outputted to the memory 620 for further processing.
  • WiFi is a short-range wireless transmission technology
  • the mobile phone can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 670, which provides users with wireless broadband Internet access.
  • FIG. 6 shows the WiFi module 670, it can be understood that it does not belong to the essential configuration of the mobile phone, and can be omitted as needed within the scope of not changing the essence of the invention.
  • the processor 680 is the control center of the handset, and connects various portions of the entire handset using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 620, and invoking data stored in the memory 620, executing The phone's various functions and processing data, so that the overall monitoring of the phone.
  • the processor 680 may include one or more processing units; preferably, the processor 680 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
  • the modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 680.
  • the handset also includes a power source 690 (such as a battery) that supplies power to the various components.
  • a power source 690 such as a battery
  • the power source can be logically coupled to the processor 680 through a power management system to manage functions such as charging, discharging, and power management through the power management system.
  • the mobile phone may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
  • the disclosed system, apparatus and The method can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Abstract

Disclosed in embodiments of the present invention are a method, device and terminal for preventing an Android device from being rooted. The method in the embodiment of the present invention comprises: receiving a non-read-only command for an embedded multimedia card (EMMC) drive layer; if an operation mode of an operating system where the EMMC drive layer is located is determined to be a normal activation mode or a normal engineering recovery mode, activating a pre-configured write filter function; and determining, via the write filter function, whether the non-read-only command acts on data of a read-only partition in the EMMC drive layer; if so, filtering the non-read-only command via the write filter function, and if not, issuing the non-read-only command.

Description

一种防止安卓设备被超级用户(Root)的方法、装置以及终端Method, device and terminal for preventing Android device from being superuser 技术领域Technical field
本发明涉及数据处理领域,尤其涉及一种防止安卓设备被Root的方法、装置以及终端。The present invention relates to the field of data processing, and in particular, to a method, an apparatus, and a terminal for preventing an Android device from being rooted.
背景技术Background technique
手机Root就是获取手机的操作系统的最高权限的意思,就是安卓手机的一个解锁过程。手机Root的好处就是用户可以根据自己的喜好和需要来删减手机的程序,同时还能够进行更多的操作,现在网上有很多Root工具,所以手机获取Root是很简单的。手机获取Root权限之后就可以访问一些受限制的东西,可以对系统的部件进行删减和修改。Root权限对那些手机玩家最大的诱惑就是可以随便进行刷机,只要获取了Root权限,用户就可以删除系统自带的一些程序或刷入不同的操作系统等操作。正是由于Root了之后,用户可以随意做任何事情,由于用户不慎删除系统文件导致手机出现各种故障,占用了大量的维修资源,因此对防范手机Root有着迫切的需求。The mobile phone Root is the highest permission to obtain the operating system of the mobile phone, which is an unlocking process of the Android mobile phone. The advantage of mobile phone Root is that users can cut down the mobile phone's program according to their own preferences and needs, and at the same time can carry out more operations. Now there are many Root tools on the Internet, so it is very simple to get Root. After the phone gains root privileges, it can access some restricted items, and the components of the system can be deleted and modified. Root privilege is the biggest temptation for those mobile phone players to be able to flash the machine. As long as the root permission is obtained, the user can delete some programs that are included in the system or brush into different operating systems. It is because of the root that the user can do anything at will. Because the user accidentally deletes the system file and causes various faults in the mobile phone, which occupies a large amount of maintenance resources, there is an urgent need for preventing the root of the mobile phone.
现在一般采用系统(System)分区只读保护方案,该方案是在块设备层对System分区的写命令进行了过滤,防止对System分区的非法写入,达到防止Root的目的。Now, the system partition read-only protection scheme is generally adopted. This scheme filters the write commands of the System partition at the block device layer to prevent illegal writing to the System partition and achieve the purpose of preventing Root.
System分区只读保护方案,可以有效的防范常见的一键Root工具的破解。但是由于是在块设备层实现的,因此无法彻底的防范通过替换镜像的方式进行Root。System partition read-only protection scheme can effectively prevent the cracking of common one-click root tools. However, since it is implemented at the block device layer, it is impossible to completely prevent the root by replacing the image.
发明内容Summary of the invention
本发明实施例提供了一种防止安卓设备被Root的方法、装置以及终端,能够防止安卓设备被Root。The embodiment of the invention provides a method, a device and a terminal for preventing an Android device from being rooted, and can prevent the Android device from being rooted.
有鉴于此,本发明第一方面提供一种防止安卓设备被Root的方法,可包括:In view of this, the first aspect of the present invention provides a method for preventing an Android device from being rooted, which may include:
接收对嵌入式多媒体卡EMMC驱动层的非只读命令;Receiving a non-read only command to the embedded multimedia card EMMC driver layer;
若确定所述EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovery模式,则启动预配置的写过滤功能;If it is determined that the working mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering recovery mode, the pre-configured write filtering function is started;
通过所述写过滤功能判断所述非只读命令是否作用于所述EMMC驱动层 中的只读分区的数据,若是,则通过所述写过滤功能过滤所述非只读命令,若否,则下发所述非只读命令。Determining, by the write filtering function, whether the non-read only command acts on the EMMC driver layer The data of the read-only partition in the case, if yes, the non-read-only command is filtered by the write filtering function, and if not, the non-read-only command is issued.
结合本发明第一方面,本发明第一方面的第一实施方式中,可包括:With reference to the first aspect of the present invention, in the first embodiment of the first aspect of the present invention, the method may include:
根据所述非只读命令对应的初始化init进程中触发的处理函数来确定所述EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovery模式。Determining, according to the processing function triggered in the initialization init process corresponding to the non-read-only command, that the operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode.
结合本发明第一方面,本发明第一方面的第二实施方式中,可包括:With reference to the first aspect of the present invention, the second embodiment of the first aspect of the present invention may include:
通过所述写过滤功能获取所述非只读命令作用的地址;Obtaining, by the write filtering function, an address that is not a read-only command;
根据所述地址判断所述非只读命令是否作用于所述EMMC驱动层中的只读分区的数据。Determining, according to the address, whether the non-read-only command acts on data of a read-only partition in the EMMC driver layer.
结合本发明第一方面,本发明第一方面的第一实施方式,本发明第一方面的第二实施方式,本发明第一方面的第三实施方式中,可包括:With reference to the first aspect of the present invention, the first embodiment of the first aspect of the present invention, the second embodiment of the first aspect of the present invention, the third embodiment of the first aspect of the present invention may include:
构造结构体函数;Constructing a structure function;
在所述结构体函数中配置所述写过滤功能。The write filtering function is configured in the structure function.
结合本发明第一方面,本发明第一方面的第一实施方式,本发明第一方面的第二实施方式,本发明第一方面的第四实施方式中,可包括:With reference to the first aspect of the present invention, the first embodiment of the first aspect of the present invention, the second embodiment of the first aspect of the present invention, the fourth embodiment of the first aspect of the present invention may include:
通过重启的方式取消所述写过滤功能。The write filtering function is cancelled by restarting.
结合本发明第一方面,本发明第一方面的第一实施方式,本发明第一方面的第二实施方式,本发明第一方面的第五实施方式中,可包括:With reference to the first aspect of the present invention, the first embodiment of the first aspect of the present invention, the second embodiment of the first aspect of the present invention, the fifth embodiment of the first aspect of the present invention may include:
若获取到所述安卓设备的解锁码,则下发所述非只读命令。If the unlock code of the Android device is obtained, the non-read only command is issued.
有鉴于此,本发明第二方面提供一种防止安卓设备被Root的装置,可包括:In view of this, the second aspect of the present invention provides an apparatus for preventing an Android device from being rooted, which may include:
接收单元,用于接收对嵌入式多媒体卡EMMC驱动层的非只读命令;a receiving unit, configured to receive a non-read only command to the embedded multimedia card EMMC driver layer;
确定单元,用于确定所述EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovrey模式;a determining unit, configured to determine that an operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovrey mode;
启动单元,用于启动预配置的写过滤功能;a startup unit for initiating a pre-configured write filtering function;
判断单元,用于通过所述写过滤功能判断所述非只读命令是否作用于所述EMMC驱动层中的只读分区的数据;a determining unit, configured to determine, by the write filtering function, whether the non-read-only command acts on data of a read-only partition in the EMMC driver layer;
执行单元,用于当判断单元判断所述非只读命令作用于所述EMMC驱动 层中的只读分区的数据时,通过所述写过滤功能过滤所述非只读命令,当判断单元判断所述非只读命令不作用于所述EMMC驱动层中的只读分区的数据时,下发所述非只读命令。An execution unit, configured to: when the determining unit determines that the non-read only command acts on the EMMC driver When the data of the read-only partition in the layer is filtered, the non-read-only command is filtered by the write filtering function, and when the determining unit determines that the non-read-only command does not act on the data of the read-only partition in the EMMC driver layer , the non-read only command is issued.
结合本发明第二方面,本发明第二方面的第一实施方式中,可包括:With reference to the second aspect of the present invention, in the first embodiment of the second aspect of the present invention, the method may include:
确定子单元,用于根据所述非只读命令对应的初始化init进程中触发的处理函数来确定所述EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovery模式。The determining subunit is configured to determine, according to the processing function triggered in the initialization init process corresponding to the non-read-only command, that the working mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode.
结合本发明第二方面,本发明第二方面的第二实施方式中,可包括:With reference to the second aspect of the present invention, in the second embodiment of the second aspect of the present invention, the method may include:
获取单元,用于通过所述写过滤功能获取所述非只读命令作用的地址;An obtaining unit, configured to acquire, by using the write filtering function, an address that is not a read-only command;
所述判断单元包括:The determining unit includes:
判断子单元,用于根据所述地址判断所述非只读命令是否作用于所述EMMC中的只读分区的数据。a determining subunit, configured to determine, according to the address, whether the non-read only command acts on data of a read-only partition in the EMMC.
结合本发明第二方面,本发明第二方面的第一实施方式,本发明第二方面的第二实施方式,本发明第二方面的第三实施方式中,可包括:With reference to the second aspect of the present invention, the first embodiment of the second aspect of the present invention, the second embodiment of the second aspect of the present invention, the third embodiment of the second aspect of the present invention may include:
构造单元,用于构造结构体函数;A structural unit for constructing a structure function;
配置单元,用于在所述结构体函数中配置所述写过滤功能。a configuration unit, configured to configure the write filtering function in the structure function.
结合本发明第二方面,本发明第二方面的第一实施方式,本发明第二方面的第二实施方式,本发明第二方面的第四实施方式中,可包括:With reference to the second aspect of the present invention, the first embodiment of the second aspect of the present invention, the second embodiment of the second aspect of the present invention, the fourth embodiment of the second aspect of the present invention may include:
第一处理单元,用于通过重启的方式取消所述写过滤功能。The first processing unit is configured to cancel the write filtering function by restarting.
结合本发明第二方面,本发明第二方面的第一实施方式,本发明第二方面的第二实施方式,本发明第二方面的第五实施方式中,可包括:With reference to the second aspect of the present invention, the first embodiment of the second aspect of the present invention, the second embodiment of the second aspect of the present invention, the fifth embodiment of the second aspect of the present invention may include:
第二处理单元,用于若获取到所述安卓设备的解锁码,则下发所述非只读命令。The second processing unit is configured to deliver the non-read only command if the unlock code of the Android device is obtained.
有鉴于此,本发明第三方面提供一种终端,可包括:In view of this, the third aspect of the present invention provides a terminal, which may include:
一个或多个处理器;存储器;以及一个或多个程序,其中所述一个或多个程序被存储在所述存储器中并被配置为被所述一个或多个处理器执行,所述一个或多个程序包括用于执行如下指令:One or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or Multiple programs include instructions for executing the following:
接收对嵌入式多媒体卡EMMC驱动层的非只读命令;Receiving a non-read only command to the embedded multimedia card EMMC driver layer;
若确定所述EMMC驱动层所在的操作系统的工作模式为正常启动模式或 正常的工程Recovery模式,则启动预配置的写过滤功能;If it is determined that the operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or The normal engineering Recovery mode starts the pre-configured write filtering function;
通过所述写过滤功能判断所述非只读命令是否作用于所述EMMC驱动层中的只读分区的数据,若是,则通过所述写过滤功能过滤所述非只读命令,若否,则下发所述非只读命令。Determining, by the write filtering function, whether the non-read-only command acts on data of a read-only partition in the EMMC driver layer, and if yes, filtering the non-read-only command by the write filtering function, if not, The non-read only command is issued.
结合本发明第三方面,本发明第三方面的第一实施方式中,可包括:With reference to the third aspect of the present invention, in the first embodiment of the third aspect of the present invention, the method may include:
根据所述非只读命令对应的初始化init进程中触发的处理函数来确定所述EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovery模式。Determining, according to the processing function triggered in the initialization init process corresponding to the non-read-only command, that the operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode.
结合本发明第三方面,本发明第三方面的第二实施方式中,可包括:With reference to the third aspect of the present invention, the second embodiment of the third aspect of the present invention may include:
通过所述写过滤功能获取所述非只读命令作用的地址;Obtaining, by the write filtering function, an address that is not a read-only command;
根据所述地址判断所述非只读命令是否作用于所述EMMC驱动层中的只读分区的数据。Determining, according to the address, whether the non-read-only command acts on data of a read-only partition in the EMMC driver layer.
结合本发明第三方面,本发明第三方面的第一实施方式,本发明第三方面的第二实施方式,本发明第三方面的第三实施方式中,可包括:With reference to the third aspect of the present invention, the first embodiment of the third aspect of the present invention, the second embodiment of the third aspect of the present invention, the third embodiment of the third aspect of the present invention may include:
构造结构体函数;Constructing a structure function;
在所述结构体函数中配置所述写过滤功能。The write filtering function is configured in the structure function.
结合本发明第三方面,本发明第三方面的第一实施方式,本发明第三方面的第二实施方式,本发明第三方面的第四实施方式中,可包括:With reference to the third aspect of the present invention, the first embodiment of the third aspect of the present invention, the second embodiment of the third aspect of the present invention, the fourth embodiment of the third aspect of the present invention may include:
通过重启的方式取消所述写过滤功能。The write filtering function is cancelled by restarting.
结合本发明第三方面,本发明第三方面的第一实施方式,本发明第三方面的第二实施方式,本发明第三方面的第五实施方式中,可包括:With reference to the third aspect of the present invention, the first embodiment of the third aspect of the present invention, the second embodiment of the third aspect of the present invention, the fifth embodiment of the third aspect of the present invention may include:
若获取到所述安卓设备的解锁码,则下发所述非只读命令。If the unlock code of the Android device is obtained, the non-read only command is issued.
结合本发明第三方面,本发明第三方面的第六实施方式中,可包括:With reference to the third aspect of the present invention, the sixth embodiment of the third aspect of the present invention may include:
所述存储器为可读存储介质,所述指令当被所述终端执行时使得所述终端执行如下指令:The memory is a readable storage medium, and the instructions, when executed by the terminal, cause the terminal to execute the following instructions:
接收对嵌入式多媒体卡EMMC驱动层的非只读命令;Receiving a non-read only command to the embedded multimedia card EMMC driver layer;
若确定所述EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovery模式,则启动预配置的写过滤功能;If it is determined that the working mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering recovery mode, the pre-configured write filtering function is started;
通过所述写过滤功能判断所述非只读命令是否作用于所述EMMC驱动层 中的只读分区的数据,若是,则通过所述写过滤功能过滤所述非只读命令,若否,则下发所述非只读命令。Determining, by the write filtering function, whether the non-read only command acts on the EMMC driver layer The data of the read-only partition in the case, if yes, the non-read-only command is filtered by the write filtering function, and if not, the non-read-only command is issued.
结合本发明第三方面,本发明第三方面的第一实施方式中,可包括:With reference to the third aspect of the present invention, in the first embodiment of the third aspect of the present invention, the method may include:
根据所述非只读命令对应的初始化init进程中触发的处理函数来确定所述EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovery模式。Determining, according to the processing function triggered in the initialization init process corresponding to the non-read-only command, that the operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode.
结合本发明第三方面,本发明第三方面的第二实施方式中,可包括:With reference to the third aspect of the present invention, the second embodiment of the third aspect of the present invention may include:
通过所述写过滤功能获取所述非只读命令作用的地址;Obtaining, by the write filtering function, an address that is not a read-only command;
根据所述地址判断所述非只读命令是否作用于所述EMMC驱动层中的只读分区的数据。Determining, according to the address, whether the non-read-only command acts on data of a read-only partition in the EMMC driver layer.
结合本发明第三方面,本发明第三方面的第一实施方式,本发明第三方面的第二实施方式,本发明第三方面的第三实施方式中,可包括:With reference to the third aspect of the present invention, the first embodiment of the third aspect of the present invention, the second embodiment of the third aspect of the present invention, the third embodiment of the third aspect of the present invention may include:
构造结构体函数;Constructing a structure function;
在所述结构体函数中配置所述写过滤功能。The write filtering function is configured in the structure function.
结合本发明第三方面,本发明第三方面的第一实施方式,本发明第三方面的第二实施方式,本发明第三方面的第四实施方式中,可包括:With reference to the third aspect of the present invention, the first embodiment of the third aspect of the present invention, the second embodiment of the third aspect of the present invention, the fourth embodiment of the third aspect of the present invention may include:
通过重启的方式取消所述写过滤功能。The write filtering function is cancelled by restarting.
结合本发明第三方面,本发明第三方面的第一实施方式,本发明第三方面的第二实施方式,本发明第三方面的第五实施方式中,可包括:With reference to the third aspect of the present invention, the first embodiment of the third aspect of the present invention, the second embodiment of the third aspect of the present invention, the fifth embodiment of the third aspect of the present invention may include:
若获取到所述安卓设备的解锁码,则下发所述非只读命令。If the unlock code of the Android device is obtained, the non-read only command is issued.
从以上技术方案可以看出,本发明实施例具有以下优点:通过预配置的写过滤功能,判断非只读命令是否作用在EMMC驱动层中的只读分区的数据,当判断为是时,过滤该非只读命令,由于EMMC在EMMC驱动层只会抽象出一个EMMC设备,通过对EMMC设备指向的只读分区进行限制,也就达到了防止只读分区的数据被篡改的目的,所以能够防止安卓设备被Root。It can be seen from the above technical solution that the embodiment of the present invention has the following advantages: determining whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer by using the pre-configured write filtering function, and when the determination is yes, filtering The non-read-only command, because the EMMC only abstracts an EMMC device in the EMMC driver layer, and limits the read-only partition pointed to by the EMMC device, thereby preventing the data of the read-only partition from being tampered with, thereby preventing The Android device is rooted.
附图说明DRAWINGS
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的 前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention, Those of ordinary skill in the art, without paying for creative labor Further drawings can also be obtained from these drawings.
图1为本发明实施例中防止安卓设备被Root的方法一个实施例示意图;1 is a schematic diagram of an embodiment of a method for preventing an Android device from being rooted according to an embodiment of the present invention;
图2为本发明实施例中防止安卓设备被Root的方法另一实施例示意图;2 is a schematic diagram of another embodiment of a method for preventing an Android device from being rooted according to an embodiment of the present invention;
图3为本发明实施例中防止安卓设备被Root的装置一个实施例示意图;3 is a schematic diagram of an embodiment of a device for preventing an Android device from being rooted according to an embodiment of the present invention;
图4为本发明实施例中防止安卓设备被Root的装置另一实施例示意图;4 is a schematic diagram of another embodiment of an apparatus for preventing an Android device from being rooted according to an embodiment of the present invention;
图5为本发明实施例终端设备一个实施例示意图;FIG. 5 is a schematic diagram of an embodiment of a terminal device according to an embodiment of the present invention; FIG.
图6为本发明实施例中以终端为手机为例的一个实施例示意图。FIG. 6 is a schematic diagram of an embodiment in which a terminal is used as a mobile phone according to an embodiment of the present invention.
具体实施方式detailed description
本发明实施例提供了一种防止安卓设备被Root的方法、装置以及终端,能够防止安卓设备被Root。The embodiment of the invention provides a method, a device and a terminal for preventing an Android device from being rooted, and can prevent the Android device from being rooted.
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is an embodiment of the invention, but not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of the present invention.
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if present) in the specification and claims of the present invention and the above figures are used to distinguish similar objects without being used for Describe a specific order or order. It is to be understood that the data so used may be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than what is illustrated or described herein. In addition, the terms "comprises" and "comprises" and "the" and "the" are intended to cover a non-exclusive inclusion, for example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited to Those steps or units may include other steps or units not explicitly listed or inherent to such processes, methods, products or devices.
为了方便理解本发明实施例,下面介绍本发明实施例中一种防止安卓设备被Root的原理。In order to facilitate the understanding of the embodiments of the present invention, a principle for preventing an Android device from being rooted in the embodiment of the present invention is described below.
System分区只读保护方案,可以有效的防范常见的一键Root工具的破解。但是由于是在块设备层实现的,且嵌入式多媒体卡(EMMC,Embedded Multi Media Card)在块设备层会抽象出多个块设备,这些块设备分别指向整个EMMC上各个分区(其中有个块设备指向该EMMC上的System分区),在块 设备层只能限制对System分区的访问,但是黑客可以通过访问其他分区来非法写入,因此无法彻底的防范通过替换镜像的方式进行Root。由于EMMC在EMMC驱动层只会抽象出一个EMMC设备,通过对EMMC设备指向的只读分区进行限制(本发明通过配置写过滤功能,通过写过滤功能过滤作用在只读分区的数据的非只读命令),可以达到防止只读分区的数据被篡改的目的,也就能够彻底防范通过替换镜像的方式进行Root,同时,也能有效的防范常见的一键Root工具的破解。System partition read-only protection scheme can effectively prevent the cracking of common one-click root tools. However, since it is implemented at the block device layer, the Embedded Multi Media Card (EMMC) abstracts a plurality of block devices at the block device layer, and these block devices respectively point to the respective partitions on the entire EMMC (there are blocks) The device points to the System partition on the EMMC), in the block The device layer can only restrict access to the System partition, but hackers can illegally write by accessing other partitions. Therefore, it is impossible to completely prevent the root by replacing the mirror. Since EMMC only abstracts an EMMC device at the EMMC driver layer, it restricts the read-only partition pointed to by the EMMC device. (The present invention configures the write filtering function to filter the non-read-only data of the read-only partition through the write filtering function. The command can prevent the data of the read-only partition from being tampered with, and can completely prevent the root by replacing the mirror. At the same time, it can effectively prevent the crack of the common one-click root tool.
在上述原理的基础上,对手机、平板等设备进行Root通过以下实施例进行说明:On the basis of the above principles, the root of a mobile phone, a tablet, and the like is described by the following embodiments:
请参阅图1,本发明实施例中防止安卓设备被Root的方法一个实施例包括:Referring to FIG. 1, an embodiment of a method for preventing an Android device from being rooted in an embodiment of the present invention includes:
101、接收对嵌入式多媒体卡EMMC驱动层的非只读命令;101. Receive a non-read-only command to an embedded multimedia card EMMC driver layer.
本实施例中,接收对嵌入式多媒体卡EMMC驱动层的非只读命令,其中该非只读命令包括单块写(CMD24)、多块写(CMD25)以及擦除命令(CMD38),还包括其他类型的非只读命令,具体此处不作限定。In this embodiment, the non-read-only command for the embedded multimedia card EMMC driver layer is received, wherein the non-read-only command includes a single block write (CMD24), a multi-block write (CMD25), and an erase command (CMD38), and includes Other types of non-read-only commands are not limited herein.
102、若确定该EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovery模式,则启动预配置的写过滤功能;102. If it is determined that the working mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode, the pre-configured write filtering function is started.
当接收对嵌入式多媒体卡EMMC驱动层的非只读命令后,若确定该EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovrey模式,则启动预配置的写过滤功能,其中该Recovrey模式为一种可以对安卓机内部的数据或系统进行修改的模式,该Recovrey模式又叫恢复模式,刷机模式。After receiving the non-read-only command to the embedded multimedia card EMMC driver layer, if it is determined that the operating mode of the operating system where the EMMC driver layer is located is the normal startup mode or the normal engineering Recovrey mode, the pre-configured write filtering function is started. The Recovrey mode is a mode that can modify the data or system inside the Android machine. The Recovrey mode is also called recovery mode and flash mode.
需要说明的是,该写过滤功能用于阻挡非法的写入操作,可以通过构造结构体函数,在该结构体函数中配置该写过滤功能,该写过滤功能主要包括三个方面的功能:判断接收到的命令是否为非只读命令、判断非只读命令是否作用于只读分区的数据以及过滤非只读命令。It should be noted that the write filtering function is used to block an illegal write operation, and the write filtering function may be configured in the structure function by constructing a structure function, and the write filtering function mainly includes three functions: determining Whether the received command is a non-read-only command, whether the non-read-only command acts on the data of the read-only partition, and the non-read-only command is filtered.
需要说明的是,此处的正常启动模式可以理解为有完整界面的模式,此处的Recovery模式可以理解为界面简单,用于手机维护的模式。It should be noted that the normal startup mode herein can be understood as a mode with a complete interface. The Recovery mode here can be understood as a mode with simple interface and used for mobile phone maintenance.
进一步的,该操作系统可以为手机的操作系统,还可以为平板的操作系统。 本发明中对安卓设备进行Root,可以理解为对具有安卓操作系统的设备进行Root。Further, the operating system can be an operating system of the mobile phone, and can also be a tablet operating system. In the present invention, the Root device of the Android device can be understood as Root for a device having an Android operating system.
103、通过该写过滤功能判断该非只读命令是否作用于该EMMC驱动层中的只读分区的数据,若是,则通过该写过滤功能过滤该非只读命令,若否,则下发该非只读命令。And determining, by the write filtering function, whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer, and if yes, filtering the non-read-only command by using the write filtering function, and if not, sending the Non-read only command.
通过该写过滤功能判断该非只读命令是否作用于该EMMC驱动层中的只读分区的数据,若是,则停止该非只读命令的下发,返回结束,并可以选择设置错误标志,若否,则下发该非只读命令。Determining, by the write filtering function, whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer, and if so, stopping the sending of the non-read-only command, returning to the end, and optionally setting the error flag, if No, the non-read only command is issued.
其中,上述停止该非只读命令的下发为过滤该非只读命令的一种方法,还可以采取其他方法过滤该非只读命令,此处不再赘述。The method of stopping the non-read-only command is a method for filtering the non-read-only command, and the non-read-only command may be filtered by other methods, and details are not described herein again.
本实施例中,通过预配置的写过滤功能,判断非只读命令是否作用在EMMC驱动层中的只读分区的数据,当判断为是时,过滤该非只读命令,由于EMMC在EMMC驱动层只会抽象出一个EMMC设备,通过对EMMC设备指向的只读分区进行限制,也就达到了防止只读分区的数据被篡改的目的,所以能够防止安卓设备被Root。In this embodiment, the pre-configured write filtering function determines whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer. When the determination is yes, the non-read-only command is filtered, because the EMMC is driven by the EMMC. The layer only abstracts an EMMC device. By restricting the read-only partition pointed to by the EMMC device, the purpose of preventing the data of the read-only partition from being tampered is achieved, so that the Android device can be prevented from being rooted.
为了便于理解,下面对本发明实施例中的防止安卓设备被Root的方法进行详细描述,请参阅图2,本发明实施例中防止安卓设备被Root的方法的另一实施例包括:For the sake of understanding, the following is a detailed description of the method for preventing the Android device from being rooted in the embodiment of the present invention. Referring to FIG. 2, another embodiment of the method for preventing an Android device from being rooted in the embodiment of the present invention includes:
201、接收对EMMC驱动层的非只读命令;201. Receive a non-read only command to the EMMC driver layer.
本实施例中,接收上层应用对EMMC驱动层的非只读命令,其中该非只读命令包括单块写(CMD24)和多块写(CMD25)以及擦除命令(CMD38),还包括其他类型的非只读命令,具体此处不作限定。In this embodiment, the upper layer application receives a non-read-only command to the EMMC driver layer, where the non-read-only command includes a single block write (CMD24) and a multi-block write (CMD25) and an erase command (CMD38), and includes other types. Non-read-only commands, which are not limited here.
需要说明的是,该非只读命令可以由块设备请求(BIO)下发,在EMMC驱动层BIO被转换成多媒体卡(MMC,Multimedia Card)请求结构,在MMC的队列中排队进行处理。It should be noted that the non-read-only command can be sent by the block device request (BIO), and the EMMC driver layer BIO is converted into a multimedia card (MMC, Multimedia Card) request structure, and queued for processing in the MMC queue.
202、若根据该非只读命令对应的初始化init进程中触发的处理函数来确定该EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovery模式,则启动预配置的写过滤功能;202. If it is determined that the working mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode according to a processing function triggered in the initialization init process corresponding to the non-read-only command, the pre-configured write filtering is started. Features;
当接收对EMMC驱动层的非只读命令后,根据该非只读命令对应的初始 化init进程中触发的处理函数来确定该EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovrey模式,则启动预配置的写过滤功能,其中该Recovrey模式为一种可以对安卓机内部的数据或系统进行修改的模式,该Recovrey模式又叫恢复模式,刷机模式。After receiving a non-read-only command to the EMMC driver layer, the initial corresponding to the non-read-only command The processing function triggered in the init process determines that the operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovrey mode, and then starts a pre-configured write filtering function, wherein the Recovrey mode is a type The internal data of the Android machine or the mode in which the system is modified. The Recovrey mode is also called the recovery mode and the flash mode.
需要说明的是,该处理函数可以为sys_wp_init_action中的处理函数,该处理函数是安卓架构中的一个标准的动作(Action)的操作,可以理解为开机过程中执行的一个函数,还可以为其他类型的处理函数,具体此处不作限定。It should be noted that the processing function may be a processing function in sys_wp_init_action, which is a standard action of the Android architecture, which can be understood as a function executed during the boot process, and can also be other types. The processing function is not limited herein.
需要说明的是,通过构造结构体函数,在该结构体函数中配置该写过滤功能,该写过滤功能主要包括三个方面的功能:判断接收到的命令是否为非只读命令、判断非只读命令是否作用于只读分区的数据以及过滤非只读命令。It should be noted that, by constructing a structure function, the write filtering function is configured in the structure function, and the write filtering function mainly includes three functions: determining whether the received command is a non-read-only command, and determining that the command is not only Whether the read command acts on the data of the read-only partition and filters the non-read-only commands.
需要说明的是,此处的正常启动模式可以理解为有完整界面的模式,此处的Recovery模式可以理解为界面简单,用于手机维护的模式。It should be noted that the normal startup mode herein can be understood as a mode with a complete interface. The Recovery mode here can be understood as a mode with simple interface and used for mobile phone maintenance.
进一步的,该操作系统可以为手机的操作系统,还可以为平板的操作系统。本发明中对安卓设备进行Root,可以理解为对具有安卓操作系统的设备进行Root。Further, the operating system can be an operating system of the mobile phone, and can also be a tablet operating system. In the present invention, the Root device of the Android device can be understood as Root for a device having an Android operating system.
当根据该非只读命令对应的初始化init进程中触发的处理函数来确定该EMMC驱动层所在的操作系统的工作模式不是正常启动模式,也不是正常的工程Recovrey模式时,通过重启的方式取消该写过滤功能。When it is determined that the operating mode of the operating system where the EMMC driver layer is located is not the normal startup mode or the normal engineering Recovrey mode according to the processing function triggered in the initialization init process corresponding to the non-read-only command, the method is cancelled by restarting. Write filtering.
203、通过该写过滤功能获取该非只读命令作用的地址;203. Obtain an address that is not a read-only command by using the write filtering function.
通过该写过滤功能获取该非只读命令映射的地址,表明该写过滤功能预先配置了获取地址的功能。The address of the non-read-only command mapping is obtained by the write filtering function, indicating that the write filtering function pre-configures the function of obtaining an address.
204、根据该地址判断该非只读命令是否作用于该EMMC中的只读分区的数据,若是,则执行步骤205,若否,则执行步骤206;204, according to the address to determine whether the non-read-only command acts on the data of the read-only partition in the EMMC, and if so, step 205 is performed, and if not, step 206 is performed;
由于有的地址对应的分区为只读,有的地址对应的分区并不是只读,根据该地址判断该非只读命令是否作用于该EMMC中的只读分区的数据,若是,则执行步骤205,若否,则执行步骤206。The partition corresponding to the address is read-only, and the partition corresponding to the address is not read-only. According to the address, it is determined whether the non-read-only command acts on the data of the read-only partition in the EMMC. If yes, step 205 is performed. If not, step 206 is performed.
205、通过该写过滤功能过滤该非只读命令;205. Filter the non-read-only command by using the write filtering function.
当根据该地址判断该非只读命令作用于该EMMC驱动层中的只读分区的数据后,通过该写过滤功能停止该非只读命令的下发,返回结束,并可以选择 设置错误标志。After the non-read-only command is applied to the data of the read-only partition in the EMMC driver layer, the write-filter function stops the sending of the non-read-only command, returns to the end, and can be selected. Set the error flag.
206、下发该非只读命令。206. Issue the non-read only command.
当根据该地址判断该非只读命令不作用于该EMMC驱动层中的只读分区的数据后,下发该非只读命令。The non-read-only command is issued after determining that the non-read-only command does not act on the data of the read-only partition in the EMMC driver layer according to the address.
需要说明的是,若接收到解锁码,则下发该非只读命令。也就是说,只要具有解锁码,就可以进行合法Root。It should be noted that if the unlock code is received, the non-read only command is issued. In other words, as long as you have an unlock code, you can make a legal root.
进一步的,上述通过解锁码进行Root为多种特殊情况下的一种,在如下条件下,也可以进行合法Root:Further, the above-mentioned rooting by the unlocking code is one of a plurality of special cases, and the legal root can also be performed under the following conditions:
在产线加载镜像环节、用户升级镜像环节、在产品开发调试阶段以及操作系统第一次启动时候。In the production line loading mirroring, user upgrade mirroring, in the product development and debugging phase and the first startup of the operating system.
在采取本发明进行Root前,可以先判断是否处于上述条件下,若是,则允许Root。Before taking the root of the present invention, it can be judged whether it is under the above conditions, and if so, Root is allowed.
本实施例中,通过预配置的写过滤功能,判断非只读命令是否作用在EMMC驱动层中的只读分区的数据,当判断为是时,过滤该非只读命令,由于EMMC在EMMC驱动层只会抽象出一个EMMC设备,通过对EMMC设备指向的只读分区进行限制,也就达到了防止只读分区的数据被篡改的目的,所以能够防止安卓设备被Root。In this embodiment, the pre-configured write filtering function determines whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer. When the determination is yes, the non-read-only command is filtered, because the EMMC is driven by the EMMC. The layer only abstracts an EMMC device. By restricting the read-only partition pointed to by the EMMC device, the purpose of preventing the data of the read-only partition from being tampered is achieved, so that the Android device can be prevented from being rooted.
其次,细化了对正常启动模式和正常的Recovery模式的判断以及通过地址来判断非只读命令是否作用于EMMC中的只读分区的数据,使本实施例更具有公开性。Secondly, the determination of the normal startup mode and the normal Recovery mode and the determination of whether the non-read-only command acts on the read-only partition in the EMMC by the address makes the present embodiment more open.
为了便于理解,下面以一实际的应用场景对本发明实施例中的防止安卓设备被Root的方法进行描述:For the sake of understanding, the method for preventing the Android device from being rooted in the embodiment of the present invention is described in an actual application scenario:
手机预先配置了写过滤功能,当黑客A下载完镜像后,黑客A开始刷入镜像,在刷入的过程中,手机接收到对EMMC驱动层的非只读命令,根据该非只读命令对应的初始化init进程中触发的处理函数判断该非只读命令为正常的Recovery模式的非只读命令,手机启动写过滤功能,获取该非只读命令作用的地址,通过地址确定该非只读命令作用于该EMMC驱动层中的只读分区的数据,手机通过写过滤功能停止该非只读命令的下发,返回结束,并设置错误标志。 The mobile phone is pre-configured with the write filtering function. When the hacker A downloads the image, the hacker A starts to brush in the image. During the process of brushing in, the mobile phone receives a non-read-only command to the EMMC driver layer, according to the non-read-only command. The processing function triggered in the initialization init process determines that the non-read-only command is a non-read-only command in the normal Recovery mode, the mobile phone starts the write filtering function, acquires the address of the non-read-only command, and determines the non-read-only command by the address. Acting on the data of the read-only partition in the EMMC driver layer, the mobile phone stops the sending of the non-read-only command by the write filtering function, returns to the end, and sets an error flag.
下面介绍本发明实施例中的防止安卓设备被Root的装置,请参阅图3,本发明实施例中防止安卓设备被Root的装置的一个实施例包括:The following describes an apparatus for preventing an Android device from being rooted in the embodiment of the present invention. Referring to FIG. 3, an embodiment of an apparatus for preventing an Android device from being rooted in the embodiment of the present invention includes:
接收单元301,用于接收对嵌入式多媒体卡EMMC驱动层的非只读命令;The receiving unit 301 is configured to receive a non-read only command for the embedded multimedia card EMMC driver layer;
确定单元302,用于确定该EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovrey模式;The determining unit 302 is configured to determine that an operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovrey mode;
启动单元303,用于启动预配置的写过滤功能;The startup unit 303 is configured to start a pre-configured write filtering function.
判断单元304,用于通过该写过滤功能判断该非只读命令是否作用于该EMMC驱动层中的只读分区的数据;The determining unit 304 is configured to determine, by the write filtering function, whether the non-read-only command acts on data of the read-only partition in the EMMC driver layer;
执行单元305,用于当判断单元304通过该写过滤功能判断该非只读命令作用于该EMMC驱动层中的只读分区的数据时,通过该写过滤功能过滤该非只读命令,当判断单元304通过该写过滤功能判断该非只读命令不作用于该EMMC驱动层中的只读分区的数据时,下发该非只读命令。The executing unit 305 is configured to: when the determining unit 304 determines, by the write filtering function, that the non-read-only command acts on the data of the read-only partition in the EMMC driver layer, filtering the non-read-only command by using the write filtering function, when determining The unit 304 sends the non-read-only command when the non-read-only command does not act on the data of the read-only partition in the EMMC driver layer.
本实施例中,通过预配置的写过滤功能,判断非只读命令是否作用在EMMC驱动层中的只读分区的数据,当判断为是时,过滤该非只读命令,由于EMMC在EMMC驱动层只会抽象出一个EMMC设备,通过对EMMC设备指向的只读分区进行限制,也就达到了防止只读分区的数据被篡改的目的,所以能够防止安卓设备被Root。In this embodiment, the pre-configured write filtering function determines whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer. When the determination is yes, the non-read-only command is filtered, because the EMMC is driven by the EMMC. The layer only abstracts an EMMC device. By restricting the read-only partition pointed to by the EMMC device, the purpose of preventing the data of the read-only partition from being tampered is achieved, so that the Android device can be prevented from being rooted.
为了便于理解,下面对本发明实施例中的防止安卓设备被Root的装置进行详细描述,请参阅图4,本发明实施例中防止安卓设备被Root的装置的另一实施例包括:For the sake of understanding, the following is a detailed description of the device for preventing the Android device from being rooted in the embodiment of the present invention. Referring to FIG. 4, another embodiment of the device for preventing the Android device from being rooted in the embodiment of the present invention includes:
接收单元401,用于接收对嵌入式多媒体卡EMMC驱动层的非只读命令;The receiving unit 401 is configured to receive a non-read only command to the embedded multimedia card EMMC driver layer;
确定单元402,用于确定该EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovrey模式;The determining unit 402 is configured to determine that an operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovrey mode;
启动单元403,用于启动预配置的写过滤功能;a starting unit 403, configured to start a pre-configured write filtering function;
判断单元404,用于通过该写过滤功能判断该非只读命令是否作用于该EMMC驱动层中的只读分区的数据;The determining unit 404 is configured to determine, by using the write filtering function, whether the non-read-only command acts on data of the read-only partition in the EMMC driver layer;
执行单元405,用于当判断单元404通过该写过滤功能判断该非只读命令 作用于该EMMC驱动层中的只读分区的数据时,通过该写过滤功能过滤该非只读命令,当判断单元404通过该写过滤功能判断该非只读命令不作用于该EMMC驱动层中的只读分区的数据时,下发该非只读命令。The executing unit 405 is configured to determine, by the determining unit 404, the non-read-only command by using the write filtering function. When the data of the read-only partition in the EMMC driver layer is applied, the non-read-only command is filtered by the write filtering function, and the determining unit 404 determines, by the write filtering function, that the non-read-only command does not act on the EMMC driver layer. When the data of the read-only partition is issued, the non-read-only command is issued.
本实施例还包括:This embodiment further includes:
获取单元406,用于通过该写过滤功能获取该非只读命令作用的地址;The obtaining unit 406 is configured to obtain, by using the write filtering function, an address that is not a read-only command;
构造单元407,用于构造结构体函数;a construction unit 407, configured to construct a structure function;
配置单元408,用于在该结构体函数中配置该写过滤功能;The configuration unit 408 is configured to configure the write filtering function in the structure function;
第一处理单元409,用于通过紧急重启的方式取消该写过滤功能;The first processing unit 409 is configured to cancel the write filtering function by means of an emergency restart.
第二处理单元410,用于若获取到该安卓设备的解锁码,则下发该非只读命令。The second processing unit 410 is configured to send the non-read-only command if the unlock code of the Android device is obtained.
其中本实施例中的确定单元402包括:The determining unit 402 in this embodiment includes:
确定子单元4021,用于根据该非只读命令对应的初始化init进程中触发的处理函数来确定该EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovery模式;The determining sub-unit 4021 is configured to determine, according to the processing function triggered in the initialization init process corresponding to the non-read-only command, that the working mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode;
其中本实施例中的判断单元404包括:The determining unit 404 in this embodiment includes:
判断子单元4041,用于根据该地址判断该非只读命令是否作用于该EMMC中的只读分区的数据。The determining subunit 4041 is configured to determine, according to the address, whether the non-read only command acts on data of the read-only partition in the EMMC.
本实施例中,通过预配置的写过滤功能,判断非只读命令是否作用在EMMC驱动层中的只读分区的数据,当判断为是时,过滤该非只读命令,由于EMMC在EMMC驱动层只会抽象出一个EMMC设备,通过对EMMC设备指向的只读分区进行限制,也就达到了防止只读分区的数据被篡改的目的,所以能够防止安卓设备被Root。In this embodiment, the pre-configured write filtering function determines whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer. When the determination is yes, the non-read-only command is filtered, because the EMMC is driven by the EMMC. The layer only abstracts an EMMC device. By restricting the read-only partition pointed to by the EMMC device, the purpose of preventing the data of the read-only partition from being tampered is achieved, so that the Android device can be prevented from being rooted.
其次,细化了对正常启动模式和正常的Recovery模式的判断以及通过地址来判断非只读命令是否作用于EMMC中的只读分区的数据,使本实施例更具有公开性。Secondly, the determination of the normal startup mode and the normal Recovery mode and the determination of whether the non-read-only command acts on the read-only partition in the EMMC by the address makes the present embodiment more open.
为了便于理解,下面以一实际的应用场景对本实施例中防止安卓设备被Root的装置各单元间的交互进行描述:For ease of understanding, the interaction between the units of the device for preventing the Android device from being Rooted in this embodiment is described in an actual application scenario:
接收单元401接收上层应用对EMMC驱动层的非只读命令,其中该非只读命令包括单块写(CMD24)和多块写(CMD25)以及擦除命令(CMD38), 还包括其他类型的非只读命令,具体此处不作限定;需要说明的是,该非只读命令可以由块设备请求(BIO)下发,在EMMC驱动层BIO被转换成MMC请求结构,在MMC的队列中排队进行处理。当接收对EMMC驱动层的非只读命令后,确定单元402中的确定子单元4021根据该非只读命令对应的初始化init进程中触发的处理函数来确定该EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovrey模式,则启动单元403启动预配置的写过滤功能,其中该Recovrey模式为一种可以对安卓机内部的数据或系统进行修改的模式,该Recovery模式又叫恢复模式,刷机模式;需要说明的是,该处理函数可以为sys_wp_init_action中的处理函数,该处理函数是安卓架构中的一个标准的动作(Action)的操作,可以理解为开机过程中执行的一个函数。还可以为其他类型的处理函数,具体此处不作限定。需要说明的是,通过构造单元407构造结构体函数,在该结构体函数中通过配置单元408配置该写过滤功能,该写过滤功能主要包括三个方面的功能:判断接收到的命令是否为非只读命令、判断非只读命令是否作用于只读分区的数据以及过滤非只读命令。此处的正常启动模式可以理解为有完整界面的模式,此处的Recovery模式可以理解为界面简单,用于手机维护的模式。进一步的,该操作系统可以为手机的操作系统,还可以为平板的操作系统。本发明中对安卓设备进行Root,可以理解为对具有安卓操作系统的设备进行Root。当根据该非只读命令对应的初始化init进程中触发的处理函数来确定该EMMC驱动层所在的操作系统的工作模式不是正常启动模式,也不是正常的工程Recovrey模式时,第一处理单元409通过重启的方式取消该写过滤功能。获取单元406通过该写过滤功能获取该非只读命令映射的地址。由于有的地址对应的分区为只读,有的地址对应的分区并不是只读,判断单元404中的判断子单元4041根据该地址判断该非只读命令是否作用于该EMMC中的只读分区的数据。当根据该地址判断该非只读命令作用于该EMMC驱动层中的只读分区的数据后,执行单元405通过该写过滤功能停止该非只读命令的下发,返回结束,并可以选择设置错误标志。当根据该地址判断该非只读命令不作用于该EMMC驱动层中的只读分区的数据后,执行单元405下发该非只读命令。第二处理单元410若获取到所述安卓设备的解锁码,则下发该非只读命令。 The receiving unit 401 receives a non-read-only command of the upper layer application to the EMMC driver layer, where the non-read-only command includes a single block write (CMD24) and a multi-block write (CMD25) and an erase command (CMD38). Other types of non-read-only commands are also included, which are not limited herein; it should be noted that the non-read-only command can be delivered by the block device request (BIO), and the BIO is converted into the MMC request structure at the EMMC driver layer. The MMC queues for processing in the queue. After receiving the non-read-only command to the EMMC driver layer, the determining sub-unit 4021 in the determining unit 402 determines the operation of the operating system in which the EMMC driver layer is located according to the processing function triggered in the initialization init process corresponding to the non-read-only command. The mode is the normal startup mode or the normal engineering Recovrey mode, and the startup unit 403 starts a pre-configured write filtering function, wherein the Recovrey mode is a mode that can modify data or system inside the Android machine, and the recovery mode is also called Recovery mode, flash mode; it should be noted that the processing function can be a processing function in sys_wp_init_action, which is a standard action of the Android architecture, which can be understood as a function executed during the boot process. . It can also be other types of processing functions, which are not limited herein. It should be noted that the structure function is constructed by the constructing unit 407, and the write filtering function is configured in the structure function by the configuration unit 408. The write filtering function mainly includes three functions: determining whether the received command is non- Read-only commands, determine whether non-read-only commands act on data in read-only partitions, and filter non-read-only commands. The normal startup mode here can be understood as a mode with a complete interface. The Recovery mode here can be understood as a mode with simple interface and used for mobile phone maintenance. Further, the operating system can be an operating system of the mobile phone, and can also be a tablet operating system. In the present invention, the Root device of the Android device can be understood as Root for a device having an Android operating system. When it is determined that the operating mode of the operating system where the EMMC driver layer is located is not the normal startup mode or the normal engineering Recovrey mode according to the processing function triggered in the initialization init process corresponding to the non-read-only command, the first processing unit 409 passes The restart mode cancels the write filtering function. The obtaining unit 406 acquires the address of the non-read-only command map by the write filtering function. Since the partition corresponding to the address is read-only, the partition corresponding to the address is not read-only, and the determining sub-unit 4041 in the determining unit 404 determines, according to the address, whether the non-read-only command acts on the read-only partition in the EMMC. The data. After determining that the non-read-only command is applied to the data of the read-only partition in the EMMC driver layer, the execution unit 405 stops the sending of the non-read-only command by the write filtering function, returns to the end, and can select the setting. Error flag. After determining that the non-read-only command does not act on the data of the read-only partition in the EMMC driver layer according to the address, the executing unit 405 issues the non-read-only command. The second processing unit 410 delivers the non-read-only command if the unlock code of the Android device is obtained.
本发明实施例还提供一种终端,如图5所示,包括:接收器501、处理器502;The embodiment of the present invention further provides a terminal, as shown in FIG. 5, including: a receiver 501, a processor 502;
其中,上述处理器502,用于控制执行:接收对嵌入式多媒体卡EMMC驱动层的非只读命令;若确定该EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovery模式,则启动预配置的写过滤功能;通过该写过滤功能判断该非只读命令是否作用于该EMMC驱动层中的只读分区的数据,若是,则通过该写过滤功能过滤该非只读命令,若否,则下发该非只读命令。The processor 502 is configured to: perform a non-read-only command to receive an EMMC driver layer of the embedded multimedia card; and determine that the operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode. , the pre-configured write filtering function is started; the write filtering function is used to determine whether the non-read-only command acts on the read-only partition data in the EMMC driver layer, and if so, the non-read-only command is filtered by the write filtering function. If no, the non-read only command is issued.
本实施例中,通过预配置的写过滤功能,判断非只读命令是否作用在EMMC驱动层中的只读分区的数据,当判断为是时,过滤该非只读命令,由于EMMC在EMMC驱动层只会抽象出一个EMMC设备,通过对EMMC设备指向的只读分区进行限制,也就达到了防止只读分区的数据被篡改的目的,所以能够防止安卓设备被Root。In this embodiment, the pre-configured write filtering function determines whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer. When the determination is yes, the non-read-only command is filtered, because the EMMC is driven by the EMMC. The layer only abstracts an EMMC device. By restricting the read-only partition pointed to by the EMMC device, the purpose of preventing the data of the read-only partition from being tampered is achieved, so that the Android device can be prevented from being rooted.
本发明实施例还提供了如何确定工作模式的具体实现方案,如下:上述处理器502,具体用于控制执行:若根据该非只读命令对应的初始化init进程中触发的处理函数来确定该EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovery模式,则启动预配置的写过滤功能,否则通过重启的方式取消该写过滤功能。The embodiment of the present invention further provides a specific implementation scheme for determining the working mode, as follows: The processor 502 is specifically configured to control execution: if the EMMC is determined according to a processing function triggered in the initialization init process corresponding to the non-read-only command. If the working mode of the operating system where the driver layer is located is the normal startup mode or the normal engineering recovery mode, the pre-configured write filtering function is enabled. Otherwise, the write filtering function is cancelled by the restart mode.
上述Recovrey模式为一种可以对安卓机内部的数据或系统进行修改的模式。该处理函数可以为sys_wp_init_action中的处理函数,该处理函数是安卓架构中的一个标准的动作(Action)的操作,可以理解为开机过程中执行的一个函数,还可以为其他类型的处理函数,具体此处不作限定。The above Recovrey mode is a mode that can modify the data or system inside the Android machine. The processing function can be a processing function in sys_wp_init_action, which is a standard action of the Android architecture. It can be understood as a function executed during the boot process, and can also be other types of processing functions. This is not a limitation.
在本发明实施例中,由于有的地址对应的分区为只读,有的地址对应的分区并不是只读,因此,上述处理器502还用于控制执行:通过该写过滤功能获取该非只读命令作用的地址,根据该地址判断该非只读命令是否作用于该EMMC驱动层中的只读分区的数据,若是,则通过该写过滤功能过滤该非只读命令,若否,则下发该非只读命令。In the embodiment of the present invention, the partition corresponding to the address is read-only, and the partition corresponding to the address is not read-only. Therefore, the processor 502 is further configured to perform control: obtaining the non-only by using the write filtering function. The address of the read command is used to determine, according to the address, whether the non-read-only command acts on the data of the read-only partition in the EMMC driver layer, and if so, the non-read-only command is filtered by the write filtering function, and if not, the next Send this non-read-only command.
请参阅图6,本发明实施例中终端另一个实施例包括:Referring to FIG. 6, another embodiment of the terminal in the embodiment of the present invention includes:
为了便于说明,仅示出了与本发明实施例相关的部分,具体技术细节未 揭示的,请参照本发明实施例方法部分。该终端可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑等任意终端设备,以终端为手机为例:For the convenience of description, only parts related to the embodiment of the present invention are shown, and the specific technical details are not For disclosure, please refer to the method part of the embodiment of the present invention. The terminal may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), an in-vehicle computer, and the terminal is a mobile phone as an example:
图6示出的是与本发明实施例提供的终端相关的手机的部分结构的框图。参考图6,手机包括:射频(Radio Frequency,RF)电路610、存储器620、输入单元630、显示单元640、传感器650、音频电路660、无线保真(wireless fidelity,WiFi)模块670、处理器680、以及电源690等部件。本领域技术人员可以理解,图6中示出的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。FIG. 6 is a block diagram showing a partial structure of a mobile phone related to a terminal provided by an embodiment of the present invention. Referring to FIG. 6, the mobile phone includes: a radio frequency (RF) circuit 610, a memory 620, an input unit 630, a display unit 640, a sensor 650, an audio circuit 660, a wireless fidelity (WiFi) module 670, and a processor 680. And power supply 690 and other components. It will be understood by those skilled in the art that the structure of the handset shown in FIG. 6 does not constitute a limitation to the handset, and may include more or less components than those illustrated, or some components may be combined, or different components may be arranged.
下面结合图6对手机的各个构成部件进行具体的介绍:The following describes the components of the mobile phone in detail with reference to FIG. 6:
RF电路610可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器680处理;另外,将设计上行的数据发送给基站。通常,RF电路610包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路610还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE)、电子邮件、短消息服务(Short Messaging Service,SMS)等。The RF circuit 610 can be used for transmitting and receiving information or during a call, and receiving and transmitting the signal. Specifically, after receiving the downlink information of the base station, the processor 680 processes the data. In addition, the uplink data is designed to be sent to the base station. Generally, RF circuit 610 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuitry 610 can also communicate with the network and other devices via wireless communication. The above wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division). Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), E-mail, Short Messaging Service (SMS), and the like.
存储器620可用于存储软件程序以及模块,处理器680通过运行存储在存储器620的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器620可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器620可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。 The memory 620 can be used to store software programs and modules, and the processor 680 executes various functional applications and data processing of the mobile phone by running software programs and modules stored in the memory 620. The memory 620 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to Data created by the use of the mobile phone (such as audio data, phone book, etc.). Moreover, memory 620 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
输入单元630可用于接收输入的数字或字符信息,以及产生与手机的用户设置以及功能控制有关的键信号输入。具体地,输入单元630可包括触控面板631以及其他输入设备632。触控面板631,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板631上或在触控面板631附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板631可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器680,并能接收处理器680发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板631。除了触控面板631,输入单元630还可以包括其他输入设备632。具体地,其他输入设备632可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。The input unit 630 can be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function controls of the handset. Specifically, the input unit 630 may include a touch panel 631 and other input devices 632. The touch panel 631, also referred to as a touch screen, can collect touch operations on or near the user (such as the user using a finger, a stylus, or the like on the touch panel 631 or near the touch panel 631. Operation), and drive the corresponding connecting device according to a preset program. Optionally, the touch panel 631 can include two parts: a touch detection device and a touch controller. Wherein, the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information. The processor 680 is provided and can receive commands from the processor 680 and execute them. In addition, the touch panel 631 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 631, the input unit 630 may also include other input devices 632. In particular, other input devices 632 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
显示单元640可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元640可包括显示面板641,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板641。进一步的,触控面板631可覆盖显示面板641,当触控面板631检测到在其上或附近的触摸操作后,传送给处理器680以确定触摸事件的类型,随后处理器680根据触摸事件的类型在显示面板641上提供相应的视觉输出。虽然在图6中,触控面板631与显示面板641是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板631与显示面板641集成而实现手机的输入和输出功能。The display unit 640 can be used to display information input by the user or information provided to the user as well as various menus of the mobile phone. The display unit 640 can include a display panel 641. Alternatively, the display panel 641 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. Further, the touch panel 631 can cover the display panel 641. When the touch panel 631 detects a touch operation on or near it, the touch panel 631 transmits to the processor 680 to determine the type of the touch event, and then the processor 680 according to the touch event. The type provides a corresponding visual output on display panel 641. Although in FIG. 6, the touch panel 631 and the display panel 641 are two independent components to implement the input and input functions of the mobile phone, in some embodiments, the touch panel 631 may be integrated with the display panel 641. Realize the input and output functions of the phone.
手机还可包括至少一种传感器650,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板641的亮度,接近传感器可在手机移动到耳边时,关闭显示面板641和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可 检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于手机还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The handset can also include at least one type of sensor 650, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 641 according to the brightness of the ambient light, and the proximity sensor may close the display panel 641 and/or when the mobile phone moves to the ear. Or backlight. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes). Detecting the magnitude and direction of gravity, can be used to identify the gesture of the phone (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tap), etc.; as for the phone can also be configured Other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., will not be described here.
音频电路660、扬声器661,传声器662可提供用户与手机之间的音频接口。音频电路660可将接收到的音频数据转换后的电信号,传输到扬声器661,由扬声器661转换为声音信号输出;另一方面,传声器662将收集的声音信号转换为电信号,由音频电路660接收后转换为音频数据,再将音频数据输出处理器680处理后,经RF电路610以发送给比如另一手机,或者将音频数据输出至存储器620以便进一步处理。 Audio circuit 660, speaker 661, and microphone 662 provide an audio interface between the user and the handset. The audio circuit 660 can transmit the converted electrical data of the received audio data to the speaker 661 for conversion to the sound signal output by the speaker 661; on the other hand, the microphone 662 converts the collected sound signal into an electrical signal by the audio circuit 660. After receiving, it is converted into audio data, and then processed by the audio data output processor 680, sent to the other mobile phone via the RF circuit 610, or outputted to the memory 620 for further processing.
WiFi属于短距离无线传输技术,手机通过WiFi模块670可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图6示出了WiFi模块670,但是可以理解的是,其并不属于手机的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。WiFi is a short-range wireless transmission technology, and the mobile phone can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 670, which provides users with wireless broadband Internet access. Although FIG. 6 shows the WiFi module 670, it can be understood that it does not belong to the essential configuration of the mobile phone, and can be omitted as needed within the scope of not changing the essence of the invention.
处理器680是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器620内的软件程序和/或模块,以及调用存储在存储器620内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器680可包括一个或多个处理单元;优选的,处理器680可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器680中。The processor 680 is the control center of the handset, and connects various portions of the entire handset using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 620, and invoking data stored in the memory 620, executing The phone's various functions and processing data, so that the overall monitoring of the phone. Optionally, the processor 680 may include one or more processing units; preferably, the processor 680 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like. The modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 680.
手机还包括给各个部件供电的电源690(比如电池),优选的,电源可以通过电源管理系统与处理器680逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The handset also includes a power source 690 (such as a battery) that supplies power to the various components. Preferably, the power source can be logically coupled to the processor 680 through a power management system to manage functions such as charging, discharging, and power management through the power management system.
尽管未示出,手机还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown, the mobile phone may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和 方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus and The method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。 The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the embodiments are modified, or the equivalents of the technical features are replaced by the equivalents of the technical solutions of the embodiments of the present invention.

Claims (14)

  1. 一种防止安卓设备被Root的方法,其特征在于,包括:A method for preventing an Android device from being rooted, characterized in that it comprises:
    接收对嵌入式多媒体卡EMMC驱动层的非只读命令;Receiving a non-read only command to the embedded multimedia card EMMC driver layer;
    若确定所述EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovery模式,则启动预配置的写过滤功能;If it is determined that the working mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering recovery mode, the pre-configured write filtering function is started;
    通过所述写过滤功能判断所述非只读命令是否作用于所述EMMC驱动层中的只读分区的数据,若是,则通过所述写过滤功能过滤所述非只读命令,若否,则下发所述非只读命令。Determining, by the write filtering function, whether the non-read-only command acts on data of a read-only partition in the EMMC driver layer, and if yes, filtering the non-read-only command by the write filtering function, if not, The non-read only command is issued.
  2. 根据权利要求1所述的方法,其特征在于,所述确定所述EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovery模式包括:The method according to claim 1, wherein the determining whether the operating mode of the operating system in which the EMMC driver layer is located is a normal startup mode or a normal engineering recovery mode includes:
    根据所述非只读命令对应的初始化init进程中触发的处理函数来确定所述EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Reco very模式。Determining, according to the processing function triggered in the initialization init process corresponding to the non-read-only command, that the operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Reco very mode.
  3. 根据权利要求1所述的方法,其特征在于,所述通过所述写过滤功能判断所述非只读命令是否作用于所述EMMC驱动层中的只读分区的数据之前,所述方法还包括:The method according to claim 1, wherein said method further comprises: before said determining, by said write filtering function, said non-read-only command acts on data of a read-only partition in said EMMC driver layer, said method further comprising :
    通过所述写过滤功能获取所述非只读命令作用的地址;Obtaining, by the write filtering function, an address that is not a read-only command;
    所述通过所述写过滤功能判断所述非只读命令是否作用于所述EMMC驱动层中的只读分区的数据包括:The determining, by the write filtering function, whether the non-read-only command acts on the read-only partition in the EMMC driver layer includes:
    根据所述地址判断所述非只读命令是否作用于所述EMMC驱动层中的只读分区的数据。Determining, according to the address, whether the non-read-only command acts on data of a read-only partition in the EMMC driver layer.
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 3, further comprising:
    构造结构体函数;Constructing a structure function;
    在所述结构体函数中配置所述写过滤功能。The write filtering function is configured in the structure function.
  5. 根据权利要求1至3中任一项所述的方法,其特征在于,若确定所述EMMC驱动层所在的操作系统的工作模式不是正常启动模式,也不是正常的工程Recovrey模式,所述方法还包括: The method according to any one of claims 1 to 3, wherein if it is determined that the operating mode of the operating system in which the EMMC driver layer is located is not the normal startup mode or the normal engineering Recovrey mode, the method further Includes:
    通过重启的方式取消所述写过滤功能。The write filtering function is cancelled by restarting.
  6. 根据权利要求1至3任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 3, wherein the method further comprises:
    若获取到所述安卓设备的解锁码,则下发所述非只读命令。If the unlock code of the Android device is obtained, the non-read only command is issued.
  7. 一种防止安卓设备被Root的装置,其特征在于,包括:A device for preventing an Android device from being rooted, characterized in that it comprises:
    接收单元,用于接收对嵌入式多媒体卡EMMC驱动层的非只读命令;a receiving unit, configured to receive a non-read only command to the embedded multimedia card EMMC driver layer;
    确定单元,用于确定所述EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovrey模式;a determining unit, configured to determine that an operating mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovrey mode;
    启动单元,用于启动预配置的写过滤功能;a startup unit for initiating a pre-configured write filtering function;
    判断单元,用于通过所述写过滤功能判断所述非只读命令是否作用于所述EMMC驱动层中的只读分区的数据;a determining unit, configured to determine, by the write filtering function, whether the non-read-only command acts on data of a read-only partition in the EMMC driver layer;
    执行单元,用于当判断单元判断所述非只读命令作用于所述EMMC驱动层中的只读分区的数据时,通过所述写过滤功能过滤所述非只读命令,当判断单元判断所述非只读命令不作用于所述EMMC驱动层中的只读分区的数据时,下发所述非只读命令。An execution unit, configured to: when the determining unit determines that the non-read-only command acts on data of the read-only partition in the EMMC driver layer, filtering the non-read-only command by using the write filtering function, when the determining unit determines When the non-read-only command does not act on the data of the read-only partition in the EMMC driver layer, the non-read-only command is issued.
  8. 根据权利要求7所述的装置,其特征在于,所述确定单元包括:The apparatus according to claim 7, wherein the determining unit comprises:
    确定子单元,用于根据所述非只读命令对应的初始化init进程中触发的处理函数来确定所述EMMC驱动层所在的操作系统的工作模式为正常启动模式或正常的工程Recovery模式。The determining subunit is configured to determine, according to the processing function triggered in the initialization init process corresponding to the non-read-only command, that the working mode of the operating system where the EMMC driver layer is located is a normal startup mode or a normal engineering Recovery mode.
  9. 根据权利要求7所述的装置,其特征在于,所述装置还包括:The device according to claim 7, wherein the device further comprises:
    获取单元,用于通过所述写过滤功能获取所述非只读命令作用的地址;An obtaining unit, configured to acquire, by using the write filtering function, an address that is not a read-only command;
    所述判断单元包括:The determining unit includes:
    判断子单元,用于根据所述地址判断所述非只读命令是否作用于所述EMMC中的只读分区的数据。a determining subunit, configured to determine, according to the address, whether the non-read only command acts on data of a read-only partition in the EMMC.
  10. 根据权利要求7至9中任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 7 to 9, wherein the device further comprises:
    构造单元,用于构造结构体函数;A structural unit for constructing a structure function;
    配置单元,用于在所述结构体函数中配置所述写过滤功能。a configuration unit, configured to configure the write filtering function in the structure function.
  11. 根据权利要求7至9中任一项所述的装置,其特征在于,若确定所述 EMMC驱动层所在的操作系统的工作模式不是正常启动模式,也不是正常的工程Recovrey模式,所述装置还包括:Apparatus according to any one of claims 7 to 9, wherein if said The operating mode of the operating system where the EMMC driver layer is located is not the normal startup mode, nor the normal engineering Recovrey mode. The device further includes:
    第一处理单元,用于通过重启的方式取消所述写过滤功能。The first processing unit is configured to cancel the write filtering function by restarting.
  12. 根据权利要求7至9中任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 7 to 9, wherein the device further comprises:
    第二处理单元,用于若获取到所述安卓设备的解锁码,则下发所述非只读命令。The second processing unit is configured to deliver the non-read only command if the unlock code of the Android device is obtained.
  13. 一种终端,其特征在于,包括:A terminal, comprising:
    一个或多个处理器;存储器;以及一个或多个程序,其中所述一个或多个程序被存储在所述存储器中并被配置为被所述一个或多个处理器执行,所述一个或多个程序包括用于执行根据权利要求1至6任一项所述的方法的指令。One or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or The plurality of programs include instructions for performing the method of any one of claims 1 to 6.
  14. 根据权利要求13所述的终端,其特征在于,所述存储器为可读存储介质,所述指令当被所述终端执行时使得所述终端执行根据权利要求1至6任一项所述的方法的指令。 The terminal according to claim 13, wherein the memory is a readable storage medium, and the instructions, when executed by the terminal, cause the terminal to perform the method according to any one of claims 1 to 6. Instructions.
PCT/CN2015/079812 2015-05-26 2015-05-26 Method, device and terminal for preventing android device from being rooted WO2016187806A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201580004158.9A CN106471464B (en) 2015-05-26 2015-05-26 Method and device for preventing android device from being super-user (Root) and terminal
PCT/CN2015/079812 WO2016187806A1 (en) 2015-05-26 2015-05-26 Method, device and terminal for preventing android device from being rooted

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/079812 WO2016187806A1 (en) 2015-05-26 2015-05-26 Method, device and terminal for preventing android device from being rooted

Publications (1)

Publication Number Publication Date
WO2016187806A1 true WO2016187806A1 (en) 2016-12-01

Family

ID=57393633

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/079812 WO2016187806A1 (en) 2015-05-26 2015-05-26 Method, device and terminal for preventing android device from being rooted

Country Status (2)

Country Link
CN (1) CN106471464B (en)
WO (1) WO2016187806A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651177A (en) * 2020-05-27 2020-09-11 上海龙旗科技股份有限公司 Android platform-based number writing method and device and computer readable medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464841A (en) * 2008-12-31 2009-06-24 杭州华三通信技术有限公司 Method and system for implementing write protection of block memory stack
CN103019775A (en) * 2012-11-28 2013-04-03 北京小米科技有限责任公司 Method, device and equipment for flashing for terminal equipment
CN104239096A (en) * 2014-09-02 2014-12-24 艾体威尔电子技术(北京)有限公司 Method and unit for realizing security data partitions in Android system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140259004A1 (en) * 2013-03-07 2014-09-11 Go Daddy Operating Company, LLC System for trusted application deployment
CN103473502A (en) * 2013-09-16 2013-12-25 惠州Tcl移动通信有限公司 Method and system for acquiring Root rights of android-based mobile terminal
CN103646208B (en) * 2013-12-04 2017-05-10 华为终端有限公司 Monitoring method and device of eMMC
CN104268462B (en) * 2014-09-25 2017-06-20 福建联迪商用设备有限公司 A kind of partition protecting method and apparatus of Android system
CN104517060A (en) * 2015-01-08 2015-04-15 南京创和信息技术有限公司 System and method for intercepting file access instruction based on Android platform

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464841A (en) * 2008-12-31 2009-06-24 杭州华三通信技术有限公司 Method and system for implementing write protection of block memory stack
CN103019775A (en) * 2012-11-28 2013-04-03 北京小米科技有限责任公司 Method, device and equipment for flashing for terminal equipment
CN104239096A (en) * 2014-09-02 2014-12-24 艾体威尔电子技术(北京)有限公司 Method and unit for realizing security data partitions in Android system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651177A (en) * 2020-05-27 2020-09-11 上海龙旗科技股份有限公司 Android platform-based number writing method and device and computer readable medium
CN111651177B (en) * 2020-05-27 2024-03-12 上海龙旗科技股份有限公司 Number writing method, device and computer readable medium based on android platform

Also Published As

Publication number Publication date
CN106471464B (en) 2020-01-10
CN106471464A (en) 2017-03-01

Similar Documents

Publication Publication Date Title
JP6874142B2 (en) Application display method and related products
EP3617869B1 (en) Display method and apparatus
EP3281141B1 (en) Cloud-based cross-device digital pen pairing
TWI663541B (en) Mobile terminal, fingerprint identification control method and device, computer-readable storage medium and computer program product
AU2018421189B2 (en) Method for quickly opening application or application function, and terminal
WO2017211205A1 (en) Method and device for updating whitelist
AU2016422505B2 (en) Data sharing method and terminal
WO2018049893A1 (en) Data transmission method and terminal device
WO2015062413A1 (en) Terminal account managing method and device cross-reference to related applications
WO2018049934A1 (en) Data migration method and terminals
WO2017193496A1 (en) Application data processing method and apparatus, and terminal device
WO2015027856A1 (en) Information feedback method, apparatus, and terminal
WO2017206853A1 (en) Swiping response acceleration method and related products
CN111459362A (en) Information display method, information display device, electronic apparatus, and storage medium
WO2019184631A1 (en) Information processing method and apparatus, computer-readable storage medium, and terminal
CN108153460B (en) Icon hiding method and terminal
JP2017528835A (en) Mapping account information to server authentication
US20200310771A1 (en) Application Processing Method for Terminal Device, and Terminal Device
JP6974620B2 (en) Notification message processing method and terminal
WO2018166169A1 (en) Fingerprint recognition method and related product
WO2017215663A1 (en) Sound effect processing method and terminal
CN109309659B (en) Mobile terminal and method and device for logging in application of mobile terminal
WO2016187806A1 (en) Method, device and terminal for preventing android device from being rooted
WO2019084783A1 (en) Service scheduling method and apparatus, computer device, and computer readable storage medium
WO2020093243A1 (en) Game loading method and related product

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15892887

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15892887

Country of ref document: EP

Kind code of ref document: A1