Disclosure of Invention
Aiming at the problem that the application simulation can be carried out only when the existing simulation device is connected with real equipment and the application range is small, the application provides a method for dynamically restoring the real equipment by using the Android application simulation device.
In a first aspect, the present application provides a method for dynamically restoring a real device by an Android application simulation apparatus, including the following steps:
s1: performing application simulation on real equipment by using the Android application simulation device, and storing system parameter configuration and differential user data of the simulated real equipment in a data management module of the Android application simulation device; and
s2: according to real equipment needing dynamic restoration, the data management module is utilized to obtain corresponding system parameter configuration and differential user data, and the system parameter configuration and the differential user data are sent to the main virtual machine to carry out dynamic restoration on the real equipment;
the S1 specifically includes the following steps:
s11: acquiring basic system information and application data information of real equipment by using an acquisition module of the Android application simulation device, and storing the basic system information and the application data information into the data management module;
s12: sending the basic system information to a primary virtual machine in the Android application simulation device by using the data management module to load a simulator, and sending the application data information to the primary virtual machine to perform application simulation; and
s13: the Android application simulation device stores system parameter configuration and differential user data of real equipment which is currently simulated in a directory named by a unique name before the primary virtual machine is closed, the directory named by the unique name is established by a data management module, and the differential user data of the primary virtual machine is reset after the primary virtual machine is closed;
further, the S2 specifically includes the steps of:
s21: according to real equipment needing dynamic restoration, the data management module is utilized to obtain corresponding system parameter configuration in a directory named by a unique name, and the corresponding system parameter configuration is sent to a system parameter configuration interface in the main virtual machine to dynamically load a simulator; and
s22: and according to the real equipment needing dynamic restoration, acquiring corresponding differential user data in a directory named by a unique name by using the data management module, and moving the corresponding differential user data into a configuration path corresponding to the main virtual machine to perform dynamic restoration of the application data.
By adopting the technical scheme, the acquisition module of the Android application simulation device is firstly utilized to acquire the basic system information and the application data information of real equipment, then, the basic system information and the application data information are sent to a primary virtual machine in the Android application simulation device by using a data management module for application simulation, then, the system parameter configuration and the differential user data of the currently simulated real equipment are stored in a directory named by a unique name, then resetting the differential user data of the main virtual machine, then acquiring corresponding system parameter configuration and differential user data in a directory named by a unique name by using the data management module according to the real equipment needing dynamic restoration, and sending the system parameter configuration and the delta user data to the primary virtual machine for dynamic restoration of the real device. According to the method for dynamically restoring the real equipment by the Android application simulation device, online simulation can be conveniently carried out on the extraction equipment, the equipment application data is checked through the simulator, investigation and analysis are carried out, the integrity and the effectiveness of the original equipment data are kept, and secondary online simulation of separation of the simulated case data from the equipment is supported, so that the application range of the Android application simulation device is expanded, and the method has a good practical value for the electronic evidence obtaining industry.
Preferably, the basic system information in S11 includes basic hardware information and basic installation information, the basic hardware information is obtained by sending an ADB command to the real device through the acquisition module, and the basic installation information is obtained from the real device through an agent plug-in installed on the primary virtual machine.
By adopting the technical scheme, the ADB command can be used for conveniently acquiring the basic hardware information of the real equipment, and the agent plug-in installed on the main virtual machine can effectively acquire the basic installation information of the real equipment.
Preferably, in S11, the real device is ROOT-processed by the acquisition module to extract application data information of the real device.
By adopting the technical scheme, the acquisition module extracts the APK and the data which need to be simulated and applied, and particularly obtains schemes of any authority extraction, system backup software carried by equipment, official equipment assistant backup data through the ROOT equipment and then packaging and extracting the data. The extracted data is used to prepare virtual machine user data.
Preferably, in step S1, the Android application simulation apparatus is used to perform application simulation on a plurality of candidate real devices, and system parameter configuration and delta user data of the plurality of simulated real devices are stored in a data management module of the Android application simulation apparatus.
By adopting the technical scheme, part of effective information may be omitted when the application simulation is performed on real equipment, the Android application simulation device is used for performing application simulation on a plurality of alternative real equipment, then the system parameter configuration and the differential user data of the plurality of simulated real equipment are stored in the data management module of the Android application simulation device, and when the information of the simulated real equipment before is required to be searched subsequently, the corresponding system parameter configuration and the differential user data can be directly obtained from the data management module and sent to the main virtual machine for dynamic restoration of the real equipment, so that the application range of the Android application simulation device is expanded.
Preferably, the system parameter configuration includes a network-related configuration and a system service configuration, and the system parameter configuration interface includes a network-related configuration interface and a system service configuration interface.
By adopting the technical scheme, the system parameter configuration comprises network related configuration and system service configuration, and the system parameter configuration interface comprises a network related configuration interface and a system service configuration interface, so that the system parameter configuration can be obtained by dividing into two parts, and the dynamic configuration of the system parameter configuration is further facilitated.
Preferably, the network-related configuration interface utilizes a custom to modify the shell program of the official simulator to achieve dynamic reception of the network-related configuration, and the system service configuration interface utilizes a custom to modify and compile a system image and replace the system image of the official virtual machine to achieve dynamic reception of the system service configuration.
By adopting the technical scheme, the network related configuration can be effectively and dynamically received by customizing and modifying the shell program of the official simulator, and the system service configuration can be effectively and dynamically received by customizing and compiling the system image and replacing the system image of the official virtual machine.
Preferably, the unique name is a unique name combining an IMEI unique identifier and a date.
By adopting the technical scheme, each real device only has one IMEI, so that the uniqueness of the directory established by taking the IMEI unique identifier and date combination as the unique name is higher.
In a second aspect, the application further provides an Android application simulation device, which comprises a main device and a primary virtual machine, wherein the main device comprises an acquisition module and a data management module;
the acquisition module is used for acquiring basic system information and application data information of real equipment;
the data management module is used for sending the basic system information and the application data information acquired by the acquisition module to the primary virtual machine and dynamically managing the delta user data and the system parameter configuration of the real equipment;
the primary virtual machine is used for loading a simulator according to the acquired basic system information, installing application to be simulated and configuring application data according to the acquired application data information, and is further provided with a system parameter configuration interface for dynamically receiving system parameter configuration.
By adopting the technical scheme, the Android application simulation device can store the system parameter configuration and the differential user data of the simulated real equipment in the data management module of the Android application simulation device, and the real equipment can be dynamically restored as required, the data management module is used for acquiring the corresponding system parameter configuration and the differential user data, sending the system parameter configuration and the differential user data to the main virtual machine for dynamic restoration of the real equipment, supporting secondary online simulation of the simulated case data separated from the equipment, and having good practical value for the electronic evidence obtaining industry.
Preferably, the main virtual machine is further provided with an instruction conversion module, and the instruction conversion module is used for converting an ARM instruction into an X86 instruction.
By adopting the technical scheme, the Android official virtual machine has two types, one is based on ARM, the other is based on X86, and the main device is based on X86 architecture, so that the virtual machine based on ARM is very slow to run, and the ARM instruction needs to be converted into the X86 instruction during each step of execution of the virtual machine; however, by adopting the virtual machine based on X86, the APK of the device is mostly customized for the real device based on ARM, so that the problem that the APK cannot run on the X86 virtual machine arises. The instruction conversion is added in the operation of the X86 virtual machine aiming at the condition, the instruction conversion is added in the process of the virtual machine operating APK, and the performance problem is greatly solved.
In a third aspect, the present application also proposes a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the method according to any one of the first aspect.
The application provides a method for dynamically restoring real equipment by using an Android application simulation device, the method comprises the steps of utilizing the Android application simulation device to carry out application simulation on the real equipment, storing system parameter configuration and differential user data of the simulated real equipment in a data management module of the Android application simulation device, utilizing the data management module to obtain corresponding system parameter configuration and differential user data according to the real equipment which needs to be dynamically restored, sending the system parameter configuration and the differential user data to a main virtual machine to carry out dynamic restoration on the real equipment, simultaneously supporting secondary online simulation on the simulated case data separated from the equipment, and expanding the application range of the Android application simulation device by utilizing the method. Meanwhile, the Android application simulation device checks the equipment application data through the simulator, carries out investigation and analysis, retains the integrity and effectiveness of original equipment data, supports the separation of simulated case data from equipment to carry out secondary online simulation, and has good practical value for the electronic evidence obtaining industry.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, the method for dynamically restoring a real device by using an Android application simulation device disclosed in the embodiment of the present application includes the following steps:
s1: performing application simulation on real equipment by using the Android application simulation device, and storing system parameter configuration and differential user data of the simulated real equipment in a data management module of the Android application simulation device;
in a specific embodiment, the Android application simulation device is used for performing application simulation on a plurality of candidate real devices, and system parameter configuration and delta user data of the plurality of simulated real devices are stored in a data management module of the Android application simulation device. By storing the system parameter configuration and the differential user data of the simulated real devices in the data management module of the Android application simulation device, when information of the simulated real devices before is required to be searched subsequently, the corresponding system parameter configuration and the differential user data can be directly obtained from the data management module, and the system parameter configuration and the differential user data are sent to the main virtual machine to perform dynamic restoration of the real devices, so that the application range of the Android application simulation device is expanded.
In some optional implementations of this embodiment, as shown in fig. 2, the executing main body may complete the process of step S1 according to the following steps:
s11: acquiring basic system information and application data information of real equipment by using an acquisition module of the Android application simulation device, and storing the basic system information and the application data information into the data management module;
in a specific embodiment, the basic system information in step S11 includes basic hardware information and basic installation information, the basic hardware information is obtained by sending an ADB command to the real device through the acquisition module, and the basic installation information is obtained from the real device through an agent plug-in installed on the primary virtual machine. The basic hardware information includes a series of hardware related information such as system version, IMEI, brand model, etc., and the basic installation information includes other basic information such as address list, contact, etc. The master device and the primary virtual machine in this embodiment may be connected directly or through a network.
In a preferred embodiment, in step S11, the real device is ROOT-processed by the acquisition module to extract application data information of the real device. The acquisition module extracts APK and data needing simulation application, and concretely obtains schemes of any permission extraction, system backup software carried by equipment, official equipment assistant backup data, packaging extraction and the like through ROOT equipment. The extracted data is used to prepare the virtual machine user data, which may be specifically transferred via ADB commands or integrated directly into the user data image.
S12: sending the basic system information to a primary virtual machine in the Android application simulation device by using the data management module to load a simulator, and sending the application data information to the primary virtual machine to perform application simulation; and
s13: the Android application simulation device stores system parameter configuration and delta user data of real equipment which is currently simulated in a directory named by a unique name before the primary virtual machine is closed, the directory named by the unique name is established by a data management module, and the delta user data of the primary virtual machine is reset after the primary virtual machine is closed.
In a specific embodiment, the unique name is a unique name combining an IMEI unique identifier and a date. Imei (international Mobile Equipment identity) is an abbreviation for international Mobile Equipment identity. Commonly known as "mobile phone serial number", and "mobile phone serial number", is used to identify each independent mobile phone in the communication network, and is equivalent to the identification number of the mobile phone.
S2: according to real equipment needing dynamic restoration, the data management module is utilized to obtain corresponding system parameter configuration and differential user data, and the system parameter configuration and the differential user data are sent to the main virtual machine to carry out dynamic restoration on the real equipment;
the system parameter configuration comprises network related configuration and system service configuration, and the system parameter configuration interface comprises a network related configuration interface and a system service configuration interface. The network related configuration interface utilizes a custom to modify a shell program of the official simulator to realize dynamic receiving of the network related configuration, and the system service configuration interface utilizes a custom to modify and compile a system image system.
The shell program of the official simulator is modified in a self-defining mode, an official emulate source code modification program is mainly used for supporting a main device to transmit parameters such as imei, telephone numbers and mac addresses to the emulate program through commands, namely parameters on an emulate executable program, a parameter form-imei, when the main virtual machine is started, the main device analyzes the network related configuration stored before, then the network related configuration is used as a command parameter to start the main virtual machine, and the customized emulate program can read the related network related configuration after being started. The system image system img of the official virtual machine is customized, modified and compiled and replaced, and mainly is used for compiling source codes of the android system corresponding to the virtual machine and supporting the acquisition of basic system information of real equipment according to an acquisition device so as to load a simulator.
In some optional implementations of this embodiment, as shown in fig. 3, the executing main body may complete the process of step S2 according to the following steps:
s21: according to real equipment needing dynamic restoration, the data management module is utilized to obtain corresponding system parameter configuration in a directory named by a unique name, and the corresponding system parameter configuration is sent to a system parameter configuration interface in the main virtual machine to dynamically load a simulator;
in order to save each simulation example, the system parameter configuration and the differential user data of the simulated real equipment are uniformly managed by the data management module, so that the simulation environment can be restored by browsing the example data next time. And the data management module records system parameter configuration according to the name named by the unique IMEI identifier and the date combination, and is used for starting the dynamic recovery simulator each time so as to load example user data.
S22: and according to the real equipment needing dynamic restoration, acquiring corresponding differential user data in a directory named by a unique name by using the data management module, and moving the corresponding differential user data into a configuration path corresponding to the main virtual machine to perform dynamic restoration of the application data.
Each time an Android official virtual machine is created, system images and user data images such as system images, user data images and ramdisk images are established in a storage space of a host device by the application of the virtual machine, and the space occupation is large. The Android application simulation device encrypts and stores the differential user data image userdata.img.qcow in the user data image to a name instance directory named by an IMEI unique identifier and date combination before the main virtual machine is closed, and resets the userdata.img.qcow of the main virtual machine after the main virtual machine is closed. Correspondingly, when a saved instance is started, the delta user data image user data. Therefore, the method and the system establish a main virtual machine, dynamically manage the differential user data image user data.
With further reference to fig. 4, as an implementation of the method, the present application provides an embodiment of an Android application simulation apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 1, and the apparatus may be specifically applied to various electronic devices.
Referring to fig. 4, the Android application simulation device 100 includes a main device 101 and a primary virtual machine 102, where the main device 101 includes an acquisition module 103 and a data management module 104;
the acquisition module 103 is used for acquiring basic system information and application data information of real equipment;
the data management module 104 is configured to send the basic system information and the application data information acquired by the acquisition module 103 to the primary virtual machine 102, and is further configured to dynamically manage delta user data and system parameter configuration of the real device;
the primary virtual machine 102 is configured to load a simulator according to the acquired basic system information, and install an application to be simulated and configure application data according to the acquired application data information, and the primary virtual machine 102 is further provided with a system parameter configuration interface configured to dynamically receive system parameter configuration.
In a preferred embodiment, the main virtual machine 102 is further provided with an instruction conversion module 105, and the instruction conversion module 105 is configured to convert an ARM instruction into an X86 instruction.
The Android official virtual machine has two types, one is based on ARM, the other is based on X86, and since the main device is based on X86 architecture, the operation of the virtual machine based on ARM is very slow, because each step of execution of the virtual machine needs to transfer ARM instruction out to X86 instruction; however, by adopting the virtual machine based on X86, the APK of the device is mostly customized for the real device based on ARM, so that the problem that the APK cannot run on the X86 virtual machine arises. The instruction conversion is added in the operation of the X86 virtual machine aiming at the condition, the instruction conversion is added in the process of the virtual machine operating APK, and the performance problem is greatly solved.
According to the method, the Android application simulation device main device starts the Android virtual machine of the corresponding version according to the system version of the acquired system configuration information, transmits parameters needing dynamic configuration, installs simulation application APK and configuration application data extracted from real equipment, and achieves a basic real simulation application environment.
Referring now to FIG. 5, shown is a block diagram of a computer system 100 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 5, the computer system 200 includes a Central Processing Unit (CPU)201 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)202 or a program loaded from a storage section 208 into a Random Access Memory (RAM) 203. In the RAM 203, various programs and data necessary for the operation of the system 200 are also stored. The CPU 201, ROM 202, and RAM 203 are connected to each other via a bus 204. An input/output (I/O) interface 205 is also connected to bus 204.
The following components are connected to the I/O interface 205: an input portion 206 including a keyboard, a mouse, and the like; an output section 207 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage section 208 including a hard disk and the like; and a communication section 209 including a network interface card such as a LAN card, a modem, or the like. The communication section 209 performs communication processing via a network such as the internet. A drive 210 is also connected to the I/O interface 205 as needed. A removable medium 211 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 210 as necessary, so that a computer program read out therefrom is mounted into the storage section 208 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 209 and/or installed from the removable medium 211. The above-described functions defined in the method of the present application are performed when the computer program is executed by the Central Processing Unit (CPU) 201.
As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable storage medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the method shown in fig. 1.
It should be noted that the computer readable storage medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable storage medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a first acquisition module, a first training module, a second training module, and a first determination module. Where the names of these modules do not in some cases constitute a limitation of the unit itself, for example, the first acquisition module may also be described as a "module for acquiring a sequence of sample image frames".
While the principles of the invention have been described in detail in connection with the preferred embodiments thereof, it will be understood by those skilled in the art that the foregoing embodiments are merely illustrative of exemplary implementations of the invention and are not limiting of the scope of the invention. The details of the embodiments are not to be interpreted as limiting the scope of the invention, and any obvious changes, such as equivalent alterations, simple substitutions and the like, based on the technical solution of the invention, can be interpreted without departing from the spirit and scope of the invention.