Magisk installation method, device and system without guiding mapping, and storage medium

By building a virtualized environment of Magisk on Android devices and dynamically loading kernel modules, the compatibility problem caused by boot image patch processing in the existing Magisk installation method is solved, and Magisk installation without boot images is realized, improving the security and stability of the device.

CN120085968APending Publication Date: 2025-06-03SHARETRONIC DATA TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510163575.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-14
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

The existing Magisk installation method requires patching the boot image of the device, which may cause version incompatibility and module conflicts, resulting in abnormal device startup process.

Method used

Inject and build Magisk's virtualization environment through the system-based virtualization interface, dynamically load Magisk's kernel modules, create a virtual mount layer, redirect the modifications to the virtualized partition, and configure automated mount scripts to periodically check and remount the virtualized partition.

Benefits of technology

Implementing the functional integration of Magisk without modifying boot.img, simplifying the installation process, improving system security and stability, and avoiding direct modification of system partitions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120085968A_ABST
    Figure CN120085968A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of cloud Android system development, and provides a Magisk installation method, device, storage medium and system without guiding mapping, and the method comprises the steps: based on a virtualization interface of the system, injecting and constructing a virtualization environment of Magisk; after a command for starting the system is obtained, dynamically loading a kernel module of the Magisk; creating a virtual mounting layer in the dynamic loading to obtain a virtualized partition; the modification of the Magisk is redirected to the virtualization partition, so that the modification of the Magisk is all limited in the virtualization environment; and configuring an automatic mounting script to regularly and automatically check the mounting state of the virtualized partition, and immediately remounting the virtualized partition when the mounting fails. Through a virtualization technology and a dynamic loading mechanism, the function integration of Magisk is realized on the premise of not modifying boot.img, the installation process is simplified, and the system security and stability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of cloud Android system development, and particularly relates to a method, device, storage medium and system for installing Magisk without a boot image. Background Art

[0002] Magisk is an open-source tool widely used for root permission management of Android devices. It achieves root permission in a way that does not modify the system partition, maximally maintaining the system integrity, and provides modular support, allowing users to install various Magisk modules to enhance device functions. In addition, Magisk also provides the function of hiding root permission, so that some application programs (such as bank applications, payment applications, etc.) cannot detect the root permission of the device.

[0003] However, in the current Magisk installation process, it is necessary to patch the boot image (boot.img) of the device. This is because Magisk achieves root permission by modifying the boot partition in boot.img, rather than directly modifying the system partition. Magisk injects necessary code into boot.img so that the device can load the root function of Magisk during startup. However, the above method may cause abnormal device startup due to problems such as version incompatibility and Magisk module conflicts.

[0004] Therefore, it is necessary to improve the existing installation method. Summary of the Invention

[0005] The purpose of the embodiments of the present application is to provide a method for installing Magisk without a boot image, aiming to solve the problems.

[0006] The embodiments of the present application are implemented as follows. A method for installing Magisk without a boot image is provided, and the method includes:

[0007] Based on the virtualization interface of the system, inject and construct the virtualization environment of Magisk;

[0008] When the command to start the system is obtained, dynamically load the kernel module of Magisk;

[0009] Create a virtual mount layer during the dynamic loading to obtain a virtualized partition;

[0010] Redirect the modifications to Magisk to the virtualized partition, so as to limit all the modifications to Magisk within the virtualization environment;

[0011] Configure an automated mounting script to periodically and automatically check the mounting status of the virtualized partition. When the mounting fails, remount the virtualized partition immediately.

[0012] Preferably, based on the virtualization interface of the system, the method of injecting and constructing the virtualized environment of Magisk is as follows:

[0013] Configure the virtualization container of the system and mount the system file system and the data file system;

[0014] Compile the kernel module of Magisk in the source code tree of the system, copy the compiled Magisk kernel module to the virtual environment, and use the insmod command to load it.

[0015] Preferably, when the command to start the system is obtained, the method of dynamically loading the kernel module of Magisk is as follows:

[0016] Start monitoring the startup command of the system so that the kernel module of Magisk is dynamically loaded when the system starts;

[0017] When the monitoring startup command is confirmed, use the insmod command to load the Magisk module into the kernel space;

[0018] Use the lsmod command to verify whether the Magisk module is successfully loaded. When the loading fails, repeatedly use the insmod command to load the Magisk module until the number of repetitions reaches the preset maximum threshold.

[0019] Preferably, the method of creating a virtual mounting layer in the dynamic loading to obtain a virtualized partition is as follows:

[0020] Use the mount command to create a temporary mount point and bind the temporary mount point to the system path;

[0021] Use the memory file system to create a temporary file system and apply all modifications to Magisk to the temporary file system;

[0022] Verify the paths of the system file system and the data file system so that all modifications to the system are made through the virtual mounting layer.

[0023] Preferably, the method of redirecting the modifications to Magisk to the virtualized partition to limit all modifications to Magisk within the virtualized environment is as follows:

[0024] Based on the mount --bind command, redirect the directory of the main system to the virtual partition in the virtualized environment and disable the write operation to the main partition.

[0025] Preferably, the method of configuring an automated mounting script to periodically and automatically check the mounting status of the virtualized partition and, when the mounting fails, immediately remount the virtualized partition is as follows:

[0026] Configure a scheduled task and use the mount command to check the mounting status of the virtualized environment;

[0027] Verify whether the mounting status is effective. When the mounting fails, generate a command to remount;

[0028] Verify whether the scheduled task is effective and output the verification result of whether it is effective to the system directory.

[0029] Another object of the embodiments of the present application is to provide a Magisk installation device without a boot image. The Magisk installation device without a boot image includes:

[0030] A virtualized environment construction unit for injecting and constructing a virtualized environment of Magisk based on the virtualization interface of the system;

[0031] A kernel module loading unit for dynamically loading the kernel module of Magisk when a command to start the system is obtained;

[0032] A virtualized partition obtaining unit for creating a virtual mounting layer during the dynamic loading to obtain a virtualized partition;

[0033] A redirection unit for redirecting the modifications to Magisk to the virtualized partition to confine all the modifications to Magisk within the virtualized environment;

[0034] An automatic mounting unit for configuring an automated mounting script to periodically and automatically check the mounting status of the virtualized environment and, when the mounting fails, immediately remount the virtualized environment.

[0035] Preferably, the virtualized environment construction unit includes:

[0036] A virtualized container configuration unit for configuring the virtualized container of the system and mounting the system file system and the data file system;

[0037] A kernel module compilation unit for compiling the kernel module of Magisk in the source code tree of the system, copying the compiled Magisk kernel module to the virtual environment, and loading it using the insmod command.

[0038] Another object of the embodiments of the present application is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to execute the steps of the Magisk installation method without a boot image as described above.

[0039] Another object of the embodiments of the present application is to provide a cloud mobile phone system, which includes a memory and a processor. A computer program is stored in the memory, and when the computer program is executed by the processor, it causes the processor to execute the steps of the Magisk installation method without a boot image as described above.

[0040] An outstanding advantage of the Magisk installation method without a boot image provided by the embodiments of the present application is that through virtualization technology and dynamic loading mechanism, the function integration of Magisk is realized without modifying boot.img, which simplifies the installation process and improves the security and stability of the system. Description of the Drawings

[0041] Figure 1 It is an application environment diagram of the Magisk installation method without a boot image provided by the embodiments of the present application;

[0042] Figure 2 It is a flowchart of the Magisk installation method without a boot image provided by the embodiments of the present application;

[0043] Figure 3 It is a structural block diagram of the Magisk installation device without a boot image provided by the embodiments of the present application;

[0044] Figure 4 It is an internal structural block diagram of a computer device in one embodiment. Detailed Embodiments

[0045] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0046] It can be understood that the terms "first", "second", etc. used in the present application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish one unit or module from another. For example, without departing from the scope of the present application, the first script may be called the second script, and similarly, the second script may be called the first script.

[0047] Figure 1This is an application environment diagram of the Magisk installation method without a boot image provided by an embodiment of the present application. As Figure 1 shown, in this application environment, it includes a terminal 110 and a computer device 120.

[0048] The computer device 120 can be an independent physical server or terminal, or a server cluster composed of multiple physical servers. It can be a cloud server that provides basic cloud computing services such as cloud servers, cloud databases, cloud storage, and CDN.

[0049] The terminal 110 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., but is not limited thereto. The terminal 110 and the computer device 120 can be connected through a network, and the present application does not limit this here.

[0050] As Figure 2 shown, in one embodiment, a Magisk installation method without a boot image is proposed. In this embodiment, this method is mainly illustrated by applying it to the Figure 1 computer device 120 in the above. A Magisk installation method without a boot image may specifically include the following steps:

[0051] Step S10: Based on the virtualization interface of the system, inject and construct a virtualization environment for Magisk.

[0052] In this embodiment, virtualization technology provides an isolation environment through containers, etc. The purpose of this step is to create a controlled environment through these interfaces, in which Magisk runs. This environment can provide resource independence and isolation to ensure that the operation of Magisk does not directly interfere with the main partition of the system.

[0053] Step S20: When a command to start the system is obtained, dynamically load the kernel module of Magisk.

[0054] In this embodiment, Magisk can dynamically load the kernel module through methods such as the insmod command, rather than being statically integrated into the kernel, avoiding direct modification of the system kernel.

[0055] Step S30: Create a virtual mount layer during the dynamic loading to obtain a virtualized partition.

[0056] In this embodiment, after loading the Magisk kernel module, a virtual mount layer needs to be created in the system. This mount layer is used to store and isolate the modified content of Magisk. It can be implemented through methods such as the tmpfs temporary file system.

[0057] Step S40, redirect the modifications to Magisk to the virtualized partition, so as to confine all the modifications to Magisk within the virtualized environment.

[0058] In this embodiment, to isolate the original partition data, that is, all modifications to Magisk, such as mounting and configuration file modification, etc., should be carried out in the virtual mounting layer without affecting the original partition. This can avoid modifying the system partition.

[0059] Step S50, configure an automated mounting script to regularly and automatically check the mounting status of the virtualized partition, and when the mounting fails, remount the virtualized partition immediately.

[0060] In this embodiment, since the virtualized environment may be interrupted due to system reboot, refresh, etc., it is necessary to ensure that the virtual mounting layer always maintains the mounting status. If the mounting fails or disconnects in some cases, the automated script will remount to avoid system failures.

[0061] In the embodiment of the present application, through the above steps, the installation of Magisk without entering the image is realized. Compared with the traditional solution, the present application does not need to modify boot.img, avoids operating on the boot image, can also dynamically load kernel modules, uses a virtual environment to achieve mounting, does not modify the original system partition, further improves the security of the device, and realizes the stable operation and mounting of the virtual environment, which is especially suitable for multi-instance environments such as cloud phones.

[0062] In a preferred embodiment, the method for injecting and constructing the virtualized environment of Magisk based on the virtualization interface of the system is as follows:

[0063] Configure the virtualization container of the system, and mount the system file system and the data file system;

[0064] Compile the kernel module of Magisk in the source code tree of the system, copy the compiled Magisk kernel module to the virtual environment, and use the insmod command to load it.

[0065] In the embodiment of the present application, first, it is necessary to mount the system (system) file system and other file systems, such as the data (data) file system, in the virtual environment to operate on Magisk. Based on the containerization technology built on AOSP, in the virtualized environment, it is necessary to provide necessary system resources for Magisk, including file systems, kernel modules, and other dependent components. Therefore, create a clean virtualized environment, container, or virtual machine, and configure all necessary system files and libraries in this environment.

[0066] In a preferred embodiment, when a command to start the system is obtained, the method for dynamically loading the kernel module of Magisk is as follows:

[0067] Monitor the startup command of the system so that the kernel module of Magisk can be dynamically loaded when the system starts;

[0068] After the monitoring startup command is confirmed, use the insmod command to load the Magisk module into the kernel space;

[0069] Use the lsmod command to verify whether the Magisk module is successfully loaded. When the loading fails, repeatedly use the insmod command to load the Magisk module until the number of repetitions reaches a preset maximum threshold.

[0070] In the embodiment of the present application, in order to ensure that the Magisk kernel module can be dynamically loaded when the system starts, we need to monitor the commands during the startup process. If there is a specific startup command when the system starts, we can use dmesg or obtain the startup log through logcat. After obtaining the startup command, confirm that the Magisk kernel module has been compiled and stored in a suitable location. Once the startup command is confirmed, use the insmod command to dynamically load the Magisk kernel module to ensure that the kernel module of Magisk does not depend on modifying the original system kernel when the system starts. Use the lsmod command to verify whether the Magisk module is successfully loaded and repeatedly confirm it multiple times to improve the loading success rate.

[0071] In a preferred embodiment, the method for creating a virtual mount layer during the dynamic loading to obtain a virtualized partition is as follows:

[0072] Use the mount command to create a temporary mount point and bind the temporary mount point to the system path; use the memory file system to create a temporary file system and apply all modifications to Magisk to the temporary file system; verify the paths of the system file system and the data file system so that all modifications to the system are carried out through the virtual mount layer.

[0073] In the embodiment of the present application, a temporary mount can be created using the mount command. A temporary file system can be created using tmpfs (memory file system). The mount situation can be checked through the lsblk and mount commands, and the paths of the system file system and the data file system can be verified to ensure that all modifications to the system are carried out through the virtual mount layer. To further ensure that the modifications of Magisk do not directly affect the main system partition, a mount layer can be created in the virtualized environment based on the above method to isolate the modifications of Magisk from the system.

[0074] In a preferred embodiment, the method of redirecting the modifications to Magisk to the virtualized partition to confine all the modifications to Magisk within the virtualized environment is as follows:

[0075] Redirect the directories of the main system to the virtual partitions in the virtualized environment based on the mount --bind command and disable the write operation to the main partition.

[0076] In the embodiments of the present application, the modifications to Magisk can be effectively confined within the virtualized environment, ensuring the security and stability of the system. By setting the main system partition to read-only and using mount --bind, the isolation of the modifications to Magisk can be achieved, avoiding directly affecting the main system, which is particularly applicable to scenarios where advanced modifications need to be tested or applied but the risk to the main operating system is desired to be avoided.

[0077] In a preferred embodiment, the method of configuring an automated mounting script to periodically and automatically check the mounting status of the virtualized environment and remount the virtualized environment immediately when the mounting fails is as follows:

[0078] Configure a scheduled task and check the mounting status of the virtualized environment through the mount command;

[0079] Verify whether the mounting status is effective. When the mounting fails, generate a command for remounting and perform the mounting;

[0080] Verify whether the scheduled task is effective and output the verification result of whether it is effective to the system directory.

[0081] In the embodiments of the present application, the existence of the mount point can be checked through conditional statements in the script, and the mount or findmnt can be used to verify the mounting status. Through the above methods, the effectiveness and availability of the mounting can be fully ensured.

[0082] As Figure 3 shown, in one embodiment, a Magisk installation device without a boot image is provided. The Magisk installation device without a boot image can be integrated into the above computer device 120, and specifically may include a virtualized environment construction unit 510, a kernel module loading unit 520, a virtualized partition acquisition unit 530, a redirection unit 540, and an automatic mounting unit 550.

[0083] Among them, the Magisk installation device without a boot image includes:

[0084] The virtualized environment construction unit 510 is used to inject and construct the virtualized environment of Magisk based on the virtualization interface of the system;

[0085] The kernel module loading unit 520 is used to dynamically load the kernel module of Magisk after receiving the command to start the system;

[0086] The virtualized partition obtaining unit 530 is used to create a virtual mount layer during the dynamic loading to obtain a virtualized partition;

[0087] The redirection unit 540 is used to redirect the modifications to Magisk to the virtualized partition, so as to limit all the modifications to Magisk within the virtualized environment;

[0088] The automatic mounting unit 550 is used to configure an automated mounting script to periodically and automatically check the mounting status of the virtualized environment, and when the mounting fails, remount the virtualized environment immediately.

[0089] In the embodiments of the present application, the explanations and descriptions of the above Magisk installation device without a boot image can refer to the explanations and descriptions of the corresponding method above. For the description of the above Magisk installation method without a boot image, please refer to the above text, and will not be elaborated here.

[0090] In the embodiments of the present application, through the above steps, the installation of Magisk without a boot image is realized. Compared with the traditional solution, the present application does not need to modify boot.img, avoids operating on the boot image, can also dynamically load the kernel module, uses a virtual environment to achieve mounting, does not modify the original system partition, further improves the security of the device, and realizes the stable operation and mounting of the virtual environment, and is especially suitable for multi-instance environments such as cloud phones.

[0091] In one embodiment, the virtualized environment construction unit includes:

[0092] The virtualized container configuration unit is used to configure the virtualized container of the system and mount the system file system and the data file system;

[0093] The kernel module compilation unit is used to compile the kernel module of Magisk in the source code tree of the system, copy the compiled Magisk kernel module into the virtual environment, and load it using the insmod command.

[0094] In the embodiments of the present application, the explanations and descriptions of the above device can refer to the explanations and descriptions of the corresponding method above, and will not be elaborated here.

[0095] Figure 4 Shows the internal structure diagram of a computer device in one embodiment. The computer device may specifically be Figure 1 the computer device 120 in Figure 4As shown in the figure, the computer device includes a processor, a memory, a network interface, an input device, and a display screen connected by a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and can also store a computer program. When the computer program is executed by the processor, the processor can implement the Magisk installation method without a boot image. The internal memory can also store a computer program. When the computer program is executed by the processor, the processor can execute the Magisk installation method without a boot image. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the outer shell of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0096] Those skilled in the art can understand that Figure 4 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0097] In one embodiment, the Magisk installation device without a boot image provided by this application can be implemented in the form of a computer program, and the computer program can run on a computer device as Figure 4 shown. Each program module constituting the Magisk installation device without a boot image can be stored in the memory of the computer device. For example, Figure 3 the virtualization environment construction unit 510, the kernel module loading unit 520, the virtualization partition acquisition unit 530, the redirection unit 540, and the automatic mounting unit 550 shown in the figure. The computer program composed of each program unit enables the processor to execute the steps in the Magisk installation method without a boot image described in each embodiment of this application in this specification.

[0098] For example, Figure 4 the computer device shown in the figure can execute step S10 through the virtualization environment construction unit 510 in the Magisk installation device without a boot image as Figure 3 shown. The computer device can execute step S20 through the kernel module loading unit 520. And so on.

[0099] In one embodiment, a cloud phone system is proposed. The computer device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the processor executes the steps of the Magisk installation method without a boot image as described above.

[0100] In the embodiments of the present application, for the description of the above Magisk installation method without a boot image, please refer to the above text and will not be elaborated here.

[0101] In the embodiments of the present application, through the above steps, the installation of Magisk without a boot image is achieved. Compared with the traditional solution, the present application does not need to modify the boot.img, avoids operating on the boot image, can also dynamically load kernel modules, uses a virtual environment to achieve mounting, does not modify the original system partition, further improves the security of the device, and realizes the stable operation and mounting of the virtual environment, especially suitable for multi-instance environments such as cloud phones.

[0102] In one embodiment, a computer-readable storage medium is provided. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the processor is caused to execute the steps of the above-described Magisk installation method without a boot image.

[0103] In the embodiments of the present application, for the description of the above Magisk installation method without a boot image, please refer to the above text and will not be elaborated here.

[0104] In the embodiments of the present application, based on the program running according to the method stored in the storage medium of the embodiments of the present application, through the above steps, the installation of Magisk without a boot image is achieved. Compared with the traditional solution, the present application does not need to modify the boot.img, avoids operating on the boot image, can also dynamically load kernel modules, uses a virtual environment to achieve mounting, does not modify the original system partition, further improves the security of the device, and realizes the stable operation and mounting of the virtual environment, especially suitable for multi-instance environments such as cloud phones.

[0105] It should be understood that although the steps in the flowcharts of the embodiments of the present application are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in each embodiment may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.

[0106] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0107] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0108] The above embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.

Claims

1. A Magisk installation method without a boot image, characterized in that: The method comprises: Inject and build Magisk's virtualization environment based on the system's virtualization interface; After getting the command to start the system, dynamically load the kernel module of Magisk; Creating a virtual mount layer in the dynamic loading to obtain a virtualized partition; Redirecting modifications to Magisk to the virtualized partition to limit all modifications to Magisk to the virtualized environment; An automatic mounting script is configured to automatically check the mounting status of the virtualized partition regularly, and when the mounting fails, the virtualized partition is immediately remounted.

2. A Magisk installation method without boot image according to claim 1, characterized in that: Based on the system's virtualization interface, the method to inject and build Magisk's virtualization environment is: Configure the system's virtualized container and mount the system file system and data file system; Compile the Magisk kernel module in the system's source code tree, copy the compiled Magisk kernel module to the virtual environment, and load it using the insmod command.

3. A Magisk installation method without boot image according to claim 1, characterized in that: After getting the command to start the system, the method to dynamically load the kernel module of Magisk is: Start the system's monitoring startup command to dynamically load Magisk's kernel module when the system starts; When the monitoring start command is confirmed, use the insmod command to load the Magisk module into the kernel space; Use the lsmod command to verify whether the Magisk module is loaded successfully. If the loading fails, repeatedly use the insmod command to load the Magisk module until the number of repetitions reaches the preset maximum threshold.

4. A Magisk installation method without booting an image according to claim 2, characterized in that: The method of creating a virtual mount layer in the dynamic loading to obtain a virtualized partition is as follows: Use the mount command to create a temporary mount point and bind the temporary mount point to the system path; Use the memory file system to create a temporary file system and apply all modifications to Magisk to the temporary file system; The paths of the system file system and the data file system are verified so that all modifications to the system are performed through the virtual mount layer.

5. A Magisk installation method without boot image according to claim 1, characterized in that: The method of redirecting the modification of Magisk to the virtualized partition to limit all the modification of Magisk to the virtualized environment is: Redirect the directory of the main system to the virtual partition in the virtualization environment based on the mount--bind command, and disable the write operation to the main partition.

6. A Magisk installation method without boot image according to claim 1, characterized in that: The method of configuring an automatic mounting script to automatically check the mounting status of the virtualized partition regularly and remounting the virtualized partition immediately when the mounting fails is as follows: Configure scheduled tasks and check the mounting status of the virtualization environment through the mount command; Verify whether the mount status is effective, and if the mount fails, generate a re-mount command to mount the device; Verify whether the scheduled task is effective, and output the verification result of whether it is effective to the system directory.

7. A Magisk installation device without a boot image, characterized in that: The Magisk installation device without booting an image includes: A virtualization environment building unit, used to inject and build Magisk's virtualization environment based on the system's virtualization interface; The kernel module loading unit is used to dynamically load the kernel module of Magisk after obtaining the command to start the system; A virtualized partition acquisition unit, used to create a virtual mount layer in the dynamic loading to obtain a virtualized partition; A redirection unit, configured to redirect the modification to Magisk to the virtualized partition, so as to limit all the modification to Magisk to the virtualized environment; The automatic mounting unit is used to configure an automatic mounting script to automatically check the mounting status of the virtualization environment regularly, and when the mounting fails, the virtualization environment is immediately remounted.

8. A Magisk installation device without a boot image according to claim 7, characterized in that: The virtualization environment construction unit includes: The virtualization container configuration unit is used to configure the system's virtualization container and mount the system file system and the data file system; The kernel module compilation unit is used to compile the Magisk kernel module in the system's source code tree, copy the compiled Magisk kernel module to the virtual environment, and load it using the insmod command.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor performs the steps of the Magisk installation method without a boot image according to any one of claims 1 to 6.

10. A cloud phone system, characterized in that: The system includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor performs the steps of the Magisk installation method without a boot image as described in any one of claims 1 to 6.

Citation Information

Cited By

  • Software patch security execution method and system based on container isolation

    CN120654229A

  • A software patch security execution method and system based on container isolation

    CN120654229B