CN106293821B - Method and device for acquiring and transmitting application program data and running application program - Google Patents

Method and device for acquiring and transmitting application program data and running application program Download PDF

Info

Publication number
CN106293821B
CN106293821B CN201610629522.7A CN201610629522A CN106293821B CN 106293821 B CN106293821 B CN 106293821B CN 201610629522 A CN201610629522 A CN 201610629522A CN 106293821 B CN106293821 B CN 106293821B
Authority
CN
China
Prior art keywords
application program
data
terminal device
native
native application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610629522.7A
Other languages
Chinese (zh)
Other versions
CN106293821A (en
Inventor
刘刚
纪纲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Hongxiang Technical Service Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201610629522.7A priority Critical patent/CN106293821B/en
Publication of CN106293821A publication Critical patent/CN106293821A/en
Application granted granted Critical
Publication of CN106293821B publication Critical patent/CN106293821B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F9/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for loading
    • 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
    • G06F9/44568Immediately runnable code
    • G06F9/44584Portable applications, i.e. making applications self-contained, e.g. U3 standard

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a method and a device for acquiring and transmitting application program data, wherein the method comprises the following steps: acquiring related data of a native application program through a target application program installed in a host application program, wherein the host application program and the native application program are installed in first terminal equipment; and sending the related data of the native application program and the installation environment information of the first terminal equipment to the second terminal equipment in a preset sending mode. The invention also provides a method and a device for running the application program, wherein the method comprises the following steps: receiving related data of a native application program sent by first terminal equipment and installation environment information of the first terminal equipment; and installing and/or running the secondary application program in the second terminal equipment based on the received related data of the primary application program and the installation environment information of the first terminal equipment.

Description

Method and device for acquiring and transmitting application program data and running application program
Technical Field
The invention relates to the technical field of terminal equipment, in particular to a method for acquiring and transmitting application program data, a device for acquiring and transmitting application program data, a method for running an application program and a device for running the application program.
Background
With the continuous development of science and technology, the updating speed of smart phones is also accelerated. If a new mobile phone is replaced, a user needs to manually move contact information, telephone records, short message records, chat records and the like in the old mobile phone to the new mobile phone, and more troublesome is that the user also needs to log in an account number of an application program which is successfully verified on the old mobile phone one by one on the new mobile phone, but if the user needs to move data which can be read only by high-level authorities such as game archiving and the like in the old mobile phone to the new mobile phone, the user is more difficult.
Meanwhile, a sandbox is an execution environment that restricts program behavior according to security policies, and is widely used in various operating systems. Through the execution environment provided by the sandbox technology, the sandbox manages the resources and the authority of the system, the application program runs in the sandbox, and the access of the application program is firstly checked through the sandbox according to the security policy, so that an isolation running effect relative to the system is formed, and the security of the system can be effectively protected. The security policies used in the sandbox may be adapted to a variety of different operating systems with different details, and the basic knowledge of the technical implementation is well within the skill of those skilled in the art.
Disclosure of Invention
In order to overcome the above technical problems or at least partially solve the above technical problems, the following technical solutions are proposed:
one embodiment of the present invention provides a method for acquiring and transmitting application data, including:
acquiring related data of a native application program through a target application program installed in a host application program, wherein the host application program and the native application program are installed in first terminal equipment;
and sending the related data of the native application program and the installation environment information of the first terminal equipment to the second terminal equipment in a preset sending mode.
Optionally, the method further comprises:
the method comprises the steps of reflexively calling an installation package which has the same package name as a host application program and serves as a host application program attached resource so as to load a target application program realized by the installation package, wherein the required resource of the target application program corresponds to the required resource of a native application program one by one;
the method for acquiring the relevant data of the native application program through the target application program installed in the host application program comprises the following steps:
calling a data reading instruction of an active process of a target application program;
hooking a resource, which needs to read data, of a native application program corresponding to a resource, which needs to read data, of a target application program execution data reading instruction through a hook function;
and executing the hooked resources to acquire the data related to the native application program.
Preferably, loading the target application implemented by the installation package includes:
a one-to-one correspondence of the required resources of the target application and the required resources of the native application is established by the host application.
Preferably, establishing a one-to-one correspondence between the required resources of the target application and the required resources of the native application includes:
analyzing the installation package to determine a resource name of the required resource of the target application program;
and loading the resources corresponding to the required resources of the native application one by one according to the resource names of the required resources of the target application.
Preferably, the transmitting the data related to the native application and the installation environment information of the first terminal device to the second terminal device by a predetermined transmission method includes:
and sending the related data of the native application program and the installation environment information of the first terminal equipment to the second terminal equipment through a pre-established unidirectional data link.
Preferably, the data related to the native application includes at least one of user historical behavior data, application configuration information, and encrypted data, and the installation environment information of the first terminal device includes at least one of a CPU model number, a kernel version number, a system version number, and system configuration information.
Another embodiment of the present invention provides a method of running an application, including:
receiving related data of a native application program sent by first terminal equipment and installation environment information of the first terminal equipment;
and installing and/or running the secondary application program in the second terminal equipment based on the received related data of the primary application program and the installation environment information of the first terminal equipment.
Preferably, installing and/or running the secondary application in the second terminal device based on the received related data of the native application and the installation environment information of the first terminal device includes:
monitoring the installation and/or running activities of the secondary application through a hook function;
when the fact that the secondary application program reads the installation environment information of the second terminal device and/or the related data of the secondary application is monitored through the hook function, the received installation environment information of the first terminal device and/or the received related data of the primary application program, which are in one-to-one correspondence with the installation environment information of the second terminal device and/or the related data of the secondary application, are called.
Preferably, the running of the secondary application in the second terminal device based on the received data related to the native application and the installation environment information of the first terminal device includes:
when the fact that the secondary application program reads the relevant data corresponding to the secondary application program is monitored, whether the relevant data of the primary application program exists in a preset directory or not is detected;
if yes, reading the related data of the native application program.
Preferably, the data related to the native application includes at least one of user historical behavior data, application configuration information, and encrypted data, and the installation environment information of the first terminal device includes at least one of a CPU model number, a kernel version number, a system version number, and system configuration information.
Another embodiment of the present invention provides an apparatus for acquiring and transmitting application data, including:
the acquisition module is used for acquiring related data of the native application program through a target application program installed in the host application program, and the host application program and the native application program are installed in the first terminal equipment;
and the sending module is used for sending the related data of the native application program and the installation environment information of the first terminal equipment to the second terminal equipment in a preset sending mode.
Optionally, the apparatus further comprises:
the loading module is used for reflecting and calling an installation package which has the same package name as the host application program and is used as the attached resource of the host application program so as to load the target application program realized by the installation package, wherein the required resource of the target application program corresponds to the required resource of the native application program one by one;
wherein, the acquisition module includes:
the instruction calling unit is used for calling a data reading instruction of an active process of the target application program;
the resource hooking unit is used for hooking resources, which are required to read data, of a native application program corresponding to resources, which are required to read data, of a target application program execution data reading instruction through a hook function;
and the resource execution unit is used for executing the hooked resources so as to acquire the related data of the native application program.
Preferably, the loading module comprises:
and the relationship establishing unit is used for establishing the one-to-one correspondence relationship between the required resources of the target application program and the required resources of the native application program through the host application program.
Preferably, the relationship establishing unit includes:
the resource name determining subunit is used for analyzing the installation package to determine the resource name of the required resource of the target application program;
and the resource loading subunit is used for loading the resources corresponding to the required resources of the native application program one by one according to the resource names of the required resources of the target application program.
Preferably, the sending module is specifically configured to send the relevant data of the native application and the installation environment information of the first terminal device to the second terminal device through a pre-established unidirectional data link.
Preferably, the data related to the native application includes at least one of user historical behavior data, application configuration information, and encrypted data, and the installation environment information of the first terminal device includes at least one of a CPU model number, a kernel version number, a system version number, and system configuration information.
Another embodiment of the present invention provides an apparatus for running an application, including:
the receiving module is used for receiving the related data of the native application program sent by the first terminal equipment and the installation environment information of the first terminal equipment;
and the installation and running module is used for installing and/or running the secondary application program in the second terminal equipment based on the received related data of the primary application program and the installation environment information of the first terminal equipment.
Preferably, the installation and operation module comprises:
the activity monitoring unit is used for monitoring the installation and/or running activity of the secondary application program through a hook function;
and the data calling unit is used for calling the received installation environment information of the first terminal equipment and/or the received related data of the native application program which are in one-to-one correspondence with the installation environment information of the second terminal equipment and/or the related data of the secondary application when the fact that the secondary application program reads the installation environment information of the second terminal equipment and/or the related data of the secondary application is monitored through the hook function.
Preferably, the installation and operation module comprises:
the data detection unit is used for detecting whether the related data of the native application program exists in a preset directory when the fact that the related data corresponding to the secondary application program is read by the secondary application program is monitored;
and the data reading unit is used for reading the related data of the native application program when detecting that the related data of the native application program exists in the preset directory.
Preferably, the data related to the native application includes at least one of user historical behavior data, application configuration information, and encrypted data, and the installation environment information of the first terminal device includes at least one of a CPU model number, a kernel version number, a system version number, and system configuration information.
The technical scheme of the invention solves the problem of how to move the relevant data of the application program in the first terminal equipment to the second terminal equipment. And acquiring related data of the native application program through a target application program installed in the host application program, wherein the host application program and the native application program are installed in the first terminal device, and in the step, data reading operation is performed through the target application program with the same functions and services as those of the native application program so as to acquire all related data of the native application program, wherein the data which can be acquired only through high operation authority is included in the data.
Furthermore, the technical scheme of the invention also solves the problem of how to control the installation and operation process of the application program of the second terminal equipment based on the data received by the first terminal equipment. The method comprises the steps of installing and/or operating the secondary application program in the second terminal device based on received related data of the primary application program and installation environment information of the first terminal device, creating an installation environment similar to the first terminal device for the secondary application program based on the received installation environment information of the first terminal device to guarantee the subsequent installation and operation of the secondary application program to be smooth, and in addition, installing and/or operating the secondary application program in the second terminal device through the received related data of the primary application program, a user does not need to manually introduce historical data of the first terminal device or log in a verification account, so that a complex and redundant operation process is avoided, and user experience is improved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flowchart illustrating a method for acquiring and transmitting application data according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a method for running an application according to one embodiment of the present invention;
FIG. 3 is a block diagram of an apparatus for acquiring and transmitting application data according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus for running an application according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
As will be appreciated by those skilled in the art, a "terminal" as used herein includes both devices having a wireless signal receiver, which are devices having only a wireless signal receiver without transmit capability, and devices having receive and transmit hardware, which have devices having receive and transmit hardware capable of two-way communication over a two-way communication link. Such a device may include: a cellular or other communication device having a single line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (Personal Communications Service), which may combine voice, data processing, facsimile and/or data communication capabilities; a PDA (Personal Digital Assistant), which may include a radio frequency receiver, a pager, internet/intranet access, a web browser, a notepad, a calendar and/or a GPS (Global Positioning System) receiver; a conventional laptop and/or palmtop computer or other device having and/or including a radio frequency receiver. As used herein, a "terminal" or "terminal device" may be portable, transportable, installed in a vehicle (aeronautical, maritime, and/or land-based), or situated and/or configured to operate locally and/or in a distributed fashion at any other location(s) on earth and/or in space. As used herein, a "terminal Device" may also be a communication terminal, a web terminal, a music/video playing terminal, such as a PDA, an MID (Mobile Internet Device) and/or a Mobile phone with music/video playing function, or a smart tv, a set-top box, etc.
Fig. 1 is a flowchart illustrating a method for acquiring and transmitting application data according to an embodiment of the present invention.
The application scenario implemented by implementing the method for acquiring and transmitting application program data described below is an operating environment based on an Android operating system installed on a mobile terminal.
Those skilled in the art should know that the invention is proposed based on Root privilege escalation avoidance, however, the privilege escalation operation is only the privilege management control implemented by the Android system, and the invention is also applicable to the Android operating system which has Root privilege escalation.
The present invention is based on the sandbox principle and thus, one skilled in the art will understand the implementation of the present invention in conjunction with the well known sandbox implementation principle. The purpose of the sandbox is to provide a relatively closed operating environment for the target application, so that the target application accesses system resources under the security policy in the sandbox, and the activity of the target application is limited within a specified range.
It should be noted that, the present invention constructs the target application by a sandbox instance, and controls the target application to perform corresponding operation activities to obtain the relevant data of the native application. Specifically, the running activities of the target application are executed through the sandbox technology, so that the target application running in the sandbox can realize the service corresponding to the native application, and then the relevant data of the native application is acquired through the service corresponding to the native application, which can be realized by the target application execution. It is noted that the acquired data related to the native application includes data acquired only by having a high system operation authority.
Step S110: and acquiring related data of the native application program through the target application program installed in the host application program, wherein the host application program and the native application program are installed in the first terminal equipment.
The host application program is a shell application program for realizing the target application program, and the installation and the operation of the target application program can be completed through the host application program. Further, the target application needs to have the full functionality of the native application, being able to provide exactly the same services as the native application. The communication between the target application program and the sandbox running environment is established in the host application program, so that the active process of the target application program can be further monitored by the sandbox running environment, a security policy is applied to the active process, the required resources of the target application program are established in the host application program to be in one-to-one correspondence with the required resources of the native application program, the required corresponding resources of the target application program can be called in the host application program through a hook function, and the target application program can be normally loaded by the host application program and can be kept to run safely.
It should be noted that, since the data related to the native application that needs to be obtained includes data that can be obtained only by having high operating rights of the system, it is not feasible to directly obtain the data related to the native application without any processing. The scheme provided by the embodiment of the invention is that the target application program with the same functions and services as the native application program is used for executing data reading operation to obtain all relevant data of the native application program.
Optionally, the method provided in the embodiment of the present invention further includes step S130: and calling an installation package which has the same package name as the host application and is used as the attached resource of the host application in a reflection mode so as to load the target application realized by the installation package, wherein the required resource of the target application corresponds to the required resource of the native application one to one.
It should be noted that, the function of loading the target application program in the host application program may be realized through the above operation steps. However, the application can be installed and run only in a unique form in the system environment of the terminal device, that is, for an instant messaging application, only one instant messaging application can be installed and run in one terminal device, and therefore, if a target application having the same functions and services as those of the native application is installed in a system in which the native application is installed, it is not feasible to install the target application directly without any processing. According to the method provided by the embodiment of the invention, the shell adding operation is carried out on the target application program, so that the system cannot sense the existence of the target application program, and the aim of simultaneously installing the native application program and the target application program in the same system is fulfilled.
Specifically, the required resources of the target application include, but are not limited to, an Activities manager Service resource, a PackeManagerService resource, an Activity component, a Service component, a Broadcast Receiver component, a Content Provider component, and the like.
The reflection mechanism adopted by the embodiment can be a Java reflection mechanism, and all attributes and methods of any class can be known in the running state of the Java reflection mechanism; for any object, any method of the object can be called; the function of the method for dynamically acquiring information and dynamically calling the object is a reflection mechanism of JAVA language.
And calling an addAssessPath method in the AssetManager through a reflection mechanism, loading the resources in the host application program installation file into Resource, and calling the resources in the host application program installation file through a Resource object. Before obtaining the Resource of the installation file of the host application program, firstly, a DexClassLoader is newly built by the host program to load the installation package of the host application program, then, an AssetManager is newly built to load the Resource of the installation file of the host application program, and finally, the Resource of the installation file of the host application program is read through a Resource object.
Preferably, the step of loading the target application implemented by the installation package includes the step S131: a one-to-one correspondence of the required resources of the target application and the required resources of the native application is established by the host application.
For example, the operating system of the terminal device is an Android system, and the target application is App 1', which is to implement all functions and corresponding services of the native application App 1; in a host application program of the terminal equipment, an "App 1 '. apk" is an installation package with resources attached to the host application program, the installation package "App 1'. apk" is called through a Java reflection mechanism, then a target application program App1 'realized by the "App 1'. apk" is loaded, and in the process of loading the "App 1 '. apk" in the host application program, all resources required by the target application program App 1' such as an activityManagerService resource, a PackageManagerService resource, an Activity component, a Service component, a Broadcast Receiver component and a Content Provider component are created. All the required resources of the target application App 1' are in one-to-one correspondence and are the same as all the resources required by the native application to run App1 in the Android operating system of the terminal device.
More preferably, the step of establishing a one-to-one correspondence relationship between the required resources of the target application and the required resources of the native application includes steps S1311 and S1312: step S1311: analyzing the installation package to determine a resource name of the required resource of the target application program; step S1312: and loading the resources corresponding to the required resources of the native application one by one according to the resource names of the required resources of the target application.
Means for parsing the original installation package of the application program are well known to those skilled in the art. The installation package APK file is essentially a compressed package realized by combining a ZIP compression technology and a signature technology, so that on one hand, the internal file can be released through a decompression technology, and on the other hand, the internal file can be acquired through tool software such as Apktool.
Specifically, in the running process of the Android application program, a resource file packaged in an APK file is read by a resource manager called an AssetsManager. Each Activity component of an application is associated with a ContextImpl object that is used to describe the runtime context of the Activity component. The member function init of this ContextImpl object is called to perform the work of initializing the Activity component runtime context, including the work of creating resource objects and AssetsManager objects to access application Resources. Wherein, the context Impl. init function is defined in the file frames/base/core/java/android/app/context Impl. java. The parameter packageInfo in the contextimpr. init function points to a loadedApk object that describes the Apk to which the component currently being started belongs. The Resources object used to access application Resources is created by calling the parameter packageInfo to which is pointed the member function getResources of a loadedApk object. As such, application Resources may be extracted or accessed by creating resource objects.
Through the operation mode, the target application program can be loaded in the host application program for later obtaining all relevant data of the native application program through the target application program with the same functions and services as the native application program. The following will describe in detail how all relevant data of the native application is obtained by the target application.
Preferably, the step of acquiring the relevant data of the native application by the target application installed in the host application includes step S111, step S112 and step S113: step S111: calling a data reading instruction of an active process of a target application program; step S112: hooking a resource, which needs to read data, of a native application program corresponding to a resource, which needs to read data, of a target application program execution data reading instruction through a hook function; step S113: and executing the hooked resources to acquire the data related to the native application program.
First, a data read instruction of an active process of a target application is called.
Specifically, an invoking data reading instruction is actively sent through an active process of the target application.
And then, hooking the resource which needs to read the data by the native application program corresponding to the resource which needs to read the data by the data reading instruction executed by the target application program through the hook function.
It is noted that the term "hook" encompasses techniques for altering or augmenting the behavior of an operating system, application, or other software component by intercepting function calls, messages, or events passed between software components. And the code that handles such intercepted function calls, events or messages is called a hook function. Hooks are commonly used for a variety of purposes, including debugging and extending functionality. Examples of which may include intercepting keyboard or mouse events before they are passed to the application, or intercepting system calls, system function behavior, function execution results, etc., to monitor or modify the functionality of the application or other component, etc. In this embodiment, the hook function may be used to take over the installation self-checking operation required by the running of the application program.
As an example of a sandbox, a target application is operated in a sandbox operating environment, and monitoring an active process of the target application is a core implementation target of the sandbox operating environment and is responsible for implementing the following functions: by monitoring the access of the target application program to the resources, the target application program process can realize the normal calling of the corresponding resources. For example, the above-described call to the target application App 1' installation package resource can be implemented by monitoring a call instruction of a specific call resource and using a hook technology. The special service process can be registered in a mode of monitoring the active process of the target application program through the hook function, and the hook function is associated with a call instruction of the active process of the target application program App1 'to realize the activity monitoring of the target application program App 1'.
When the hook function monitors a data reading instruction of an active process calling a target application program, the hook function hooks a resource which is needed to read data of a native application program corresponding to a resource which is needed to read data of a data reading instruction executed by the target application program.
For example, the hook function is used to monitor the entry point of the data read instruction, intercept this call instruction, and obtain the name of the resource accessed by the target application App1 ', for example, the hook function obtains that the resource accessed by the target application App 1' is a Service component, and then turn to the hook function which performs the corresponding operation of hooking the resource, and the hook function hooks the Service component corresponding to the native application.
And finally, executing the hooked resources to acquire the data related to the native application program.
It should be noted that, by executing the relevant resource of the target application, the execution result identical to the execution result of the relevant resource of the native application can be achieved, and therefore, by executing the hooked resource, the target application can read the relevant data of the native application instead of the native application.
Step S120: and sending the related data of the native application program and the installation environment information of the first terminal equipment to the second terminal equipment in a preset sending mode.
Specifically, the relevant data of the native application may be acquired in the manner described above herein, and then, the installation environment information of the first terminal device is acquired; then, the data related to the native application and the installation environment information of the first terminal device are transmitted to the second terminal device by a predetermined transmission method.
Preferably, the data related to the native application includes, but is not limited to, at least one of user historical behavior data, application configuration information, and encrypted data, and the installation environment information of the first terminal device includes, but is not limited to, at least one of a CPU model number, a kernel version number, a system version number, and system configuration information. As shown in table 1, is the installation environment information of the first terminal device.
Figure BDA0001068871350000121
Figure BDA0001068871350000131
TABLE 1
It should be noted that there are various ways to send the relevant data of the native application and the installation environment information of the first terminal device to the second terminal device, for example, sending the data in a Wi-Fi hotspot, bluetooth, cloud server, and the like, and an embodiment of the present invention provides a preferred way to transmit the data, which is described as follows:
preferably, the step of sending the relevant data of the native application and the installation environment information of the first terminal device to the second terminal device in a predetermined sending manner specifically includes: and sending the related data of the native application program and the installation environment information of the first terminal equipment to the second terminal equipment through a pre-established unidirectional data link.
Specifically, by establishing a unidirectional data link between the first terminal device and the second terminal device, the problem of data leakage caused in the data transmission process by uploading data to the server can be avoided. After the data link is established, the encapsulated data is sent directly from the first terminal device to the second terminal device over the data link.
It should be noted that, data encapsulation may be performed according to characteristics of different types of data to generate different types of data packets. Each data packet carries the characteristics of the corresponding type of data, so that after the second terminal device receives the data packet, the type of the data can be known according to the characteristics of the corresponding type of data carried by each data packet.
Accordingly, after the first terminal device sends the data related to the native application and the installation environment information of the first terminal device to the second terminal device, the second terminal device locally installs and runs the secondary application based on the received data related to the native application and the installation environment information of the first terminal device.
Fig. 2 is a flowchart illustrating a method for running an application according to an embodiment of the present invention.
The application scenario implemented by the method for running the application program to be described later in the invention is a running environment based on an Android operating system installed on the mobile terminal.
The method of operation in the second terminal device is also based on the sandbox principle, so that a person skilled in the art will understand the implementation of the invention in connection with the well known sandbox implementation principle. The purpose of the sandbox is to provide a relatively closed operating environment for the target application, so that the target application accesses system resources under the security policy in the sandbox, and the activity of the target application is limited within a specified range.
Step S210: and receiving the related data of the native application program and the installation environment information of the first terminal equipment, which are sent by the first terminal equipment.
Specifically, the first terminal device sends the related data of the native application program and the installation environment information of the first terminal device to the second terminal device in a preset sending mode, and the second terminal device receives the related data of the native application program and the installation environment information of the first terminal device, which are sent by the first terminal device.
Step S220: and installing and/or running the secondary application program in the second terminal equipment based on the received related data of the primary application program and the installation environment information of the first terminal equipment.
The secondary application has all functions of the primary application, and can provide the same service as the primary application. In a specific application scenario, a user installs a native application in a first terminal device, when the user changes a new second terminal device, in the process of changing the terminal device, it is necessary to move relevant data of the native application in the first terminal device to an application corresponding to the second terminal device, where the corresponding application is a relay application, so that the relay application in the second terminal device has all functions of the native application, and under the condition that the service completely same as that of the native application can be provided, relevant data of the native application, such as a user chat record, user personal preference setting information, and the like, is also retained.
Preferably, the data related to the native application includes, but is not limited to, at least one of user historical behavior data, application configuration information, and encrypted data, and the installation environment information of the first terminal device includes, but is not limited to, at least one of a CPU model number, a kernel version number, a system version number, and system configuration information.
Preferably, the step of installing and/or running the secondary application in the second terminal device based on the received related data of the native application and the installation environment information of the first terminal device includes: step S221 and step S222: step S221: monitoring the installation and/or running activities of the secondary application through a hook function; step S222: when the fact that the secondary application program reads the installation environment information of the second terminal device and/or the related data of the secondary application is monitored through the hook function, the received installation environment information of the first terminal device and/or the received related data of the primary application program, which are in one-to-one correspondence with the installation environment information of the second terminal device and/or the related data of the secondary application, are called.
The main purpose of the above-mentioned operation steps is to create an installation and operation environment for the secondary application, in which the secondary application is not aware of being in the second terminal device, but is still considered to be in the first terminal device. In addition, through the above operation steps, the secondary application program can obtain the relevant data of the primary application program, such as the user chat record, the user operation record, the user personal preference setting information, the login verification information and the like, so that the primary application program is 'copied' from the first terminal device to the second terminal device as it is, the user can obtain the secondary application program as it is as the primary application program without performing a complicated chat record importing operation or setting the personal preference setting information for the application program again, and the user can directly log in the application program without the login verification operation.
Specifically, when it is monitored that the secondary application program reads the installation environment information of the second terminal device and/or the related data of the secondary application through the hook function, the received installation environment information of the first terminal device and/or the received related data of the primary application program, which are in one-to-one correspondence with the installation environment information of the second terminal device and/or the related data of the secondary application, are called. Setting a hook function to monitor a plurality of monitoring points related to installation and/or operation activities of the secondary application program, when it is monitored that the secondary application program reads the installation environment information of the second terminal device, hooking an instruction for acquiring the installation environment information of the second terminal device through the hook function, and replacing the installation environment information of the first terminal device and/or the related data of the primary application program which are in one-to-one correspondence with the installation environment information of the second terminal device and/or the related data of the secondary application program, so that the secondary application program is considered to be still in the first terminal device. Or when it is monitored that the secondary application program reads the related data of the secondary application, hooking the instruction for acquiring the installation environment information of the second terminal device through a hooking function, and replacing the installation environment information of the first terminal device and/or the related data of the primary application program which are in one-to-one correspondence with the installation environment information of the second terminal device and/or the related data of the secondary application program, so that the secondary application program directly reads the data received from the first terminal device.
It should be noted that, if, in the second terminal device, the received related data of the native application sent by the first terminal device is stored in a predetermined directory where the secondary application reads the related data corresponding to the received related data, the embodiment of the present invention further provides a preferable scheme, so that the secondary application can directly read the data received from the first terminal device.
Preferably, the step of executing the secondary application in the second terminal device based on the received related data of the native application and the installation environment information of the first terminal device includes steps S223 and S224: step S223: when the fact that the secondary application program reads the relevant data corresponding to the secondary application program is monitored, whether the relevant data of the primary application program exists in a preset directory or not is detected; step S224: if yes, reading the related data of the native application program.
Specifically, receiving related data of a native application program sent by a first terminal device, and storing the related data of the native application program in a corresponding predetermined directory in a second terminal device; then, when the fact that the secondary application program reads the relevant data corresponding to the secondary application program is monitored, whether the relevant data of the primary application program exists in a preset directory is detected; and finally, if the related data of the native application program exists in the preset directory, reading the related data of the native application program.
The technical scheme of the invention solves the problem of how to move the relevant data of the application program in the first terminal equipment to the second terminal equipment. And acquiring related data of the native application program through a target application program installed in the host application program, wherein the host application program and the native application program are installed in the first terminal device, and in the step, data reading operation is performed through the target application program with the same functions and services as those of the native application program so as to acquire all related data of the native application program, wherein the data which can be acquired only through high operation authority is included in the data.
Furthermore, the technical scheme of the invention also solves the problem of how to control the installation and operation process of the application program of the second terminal equipment based on the data received by the first terminal equipment. The method comprises the steps of installing and/or operating the secondary application program in the second terminal device based on received related data of the primary application program and installation environment information of the first terminal device, creating an installation environment similar to the first terminal device for the secondary application program based on the received installation environment information of the first terminal device to guarantee the subsequent installation and operation of the secondary application program to be smooth, and in addition, installing and/or operating the secondary application program in the second terminal device through the received related data of the primary application program, a user does not need to manually introduce historical data of the first terminal device or log in a verification account, so that a complex and redundant operation process is avoided, and user experience is improved.
Fig. 3 is a schematic structural diagram of an apparatus for acquiring and transmitting application data according to an embodiment of the present invention.
The following description is given of a scenario in which the apparatus for acquiring and transmitting application data is applied, which is an operating environment based on an Android operating system installed on a mobile terminal.
Those skilled in the art should know that the invention is proposed based on Root privilege escalation avoidance, however, the privilege escalation operation is only the privilege management control implemented by the Android system, and the invention is also applicable to the Android operating system which has Root privilege escalation.
The present invention is based on the sandbox principle and thus, one skilled in the art will understand the implementation of the present invention in conjunction with the well known sandbox implementation principle. The purpose of the sandbox is to provide a relatively closed operating environment for the target application, so that the target application accesses system resources under the security policy in the sandbox, and the activity of the target application is limited within a specified range.
It should be noted that, the present invention constructs the target application by a sandbox instance, and controls the target application to perform corresponding operation activities to obtain the relevant data of the native application. Specifically, the running activities of the target application are executed through the sandbox technology, so that the target application running in the sandbox can realize the service corresponding to the native application, and then the relevant data of the native application is acquired through the service corresponding to the native application, which can be realized by the target application execution. It is noted that the acquired data related to the native application includes data acquired only by having a high system operation authority.
The obtaining module 310 obtains the data related to the native application through the target application installed in the host application, where the host application and the native application are installed in the first terminal device.
The host application program is a shell application program for realizing the target application program, and the installation and the operation of the target application program can be completed through the host application program. Further, the target application needs to have the full functionality of the native application, being able to provide exactly the same services as the native application. The communication between the target application program of the original installation package and the sandbox running environment is established in the host application program, so that the activity process of the target application program can be further monitored by the sandbox running environment, a security policy is applied to the target application program, the required resources of the target application program are established in the host application program to be in one-to-one correspondence with the required resources of the original application program, the required corresponding resources of the target application program can be called in the host application program through a hook function, and the target application program can be normally loaded by the host application program and can be kept to run safely.
It should be noted that, since the data related to the native application that needs to be obtained includes data that can be obtained only by having high operating rights of the system, it is not feasible to directly obtain the data related to the native application without any processing. The scheme provided by the embodiment of the invention is that the target application program with the same functions and services as the native application program is used for executing data reading operation to obtain all relevant data of the native application program.
Optionally, the apparatus provided in the embodiment of the present invention further includes: and the loading module calls an installation package which has the same package name as the host application program and is used as the attached resource of the host application program in a reflection mode so as to load the target application program realized by the installation package, wherein the required resource of the target application program corresponds to the required resource of the native application program one by one.
It should be noted that, the above modules may implement the function of loading the target application program in the host application program. However, the application can be installed and run only in a unique form in the system environment of the terminal device, that is, for an instant messaging application, only one instant messaging application can be installed and run in one terminal device, and therefore, if a target application having the same functions and services as those of the native application is installed in a system in which the native application is installed, it is not feasible to install the target application directly without any processing. The device provided by the embodiment of the invention can ensure that the system can not sense the existence of the target application program by performing shell adding operation on the target application program, thereby realizing the purpose of simultaneously installing the native application program and the target application program in the same system.
Specifically, the required resources of the target application include, but are not limited to, an Activities manager Service resource, a PackeManagerService resource, an Activity component, a Service component, a Broadcast Receiver component, a Content Provider component, and the like.
The reflection mechanism adopted by the embodiment can be a Java reflection mechanism, and all attributes and methods of any class can be known in the running state of the Java reflection mechanism; for any object, any method of the object can be called; the function of the method for dynamically acquiring information and dynamically calling the object is a reflection mechanism of JAVA language.
And calling an addAssessPath method in the AssetManager through a reflection mechanism, loading the resources in the host application program installation file into Resource, and calling the resources in the host application program installation file through a Resource object. Before obtaining the Resource of the installation file of the host application program, firstly, a DexClassLoader is newly built by the host program to load the installation package of the host application program, then, an AssetManager is newly built to load the Resource of the installation file of the host application program, and finally, the Resource of the installation file of the host application program is read through a Resource object.
Preferably, the loading module comprises: the relationship establishing unit establishes a one-to-one correspondence relationship between the required resources of the target application and the required resources of the native application by the host application.
For example, the operating system of the terminal device is an Android system, and the target application is App 1', which is to implement all functions and corresponding services of the native application App 1; in a host application program of the terminal equipment, an "App 1 '. apk" is an installation package with resources attached to the host application program, the installation package "App 1'. apk" is called through a Java reflection mechanism, then a target application program App1 'realized by the "App 1'. apk" is loaded, and in the process of loading the "App 1 '. apk" in the host application program, all resources required by the target application program App 1' such as an activityManagerService resource, a PackageManagerService resource, an Activity component, a Service component, a Broadcast Receiver component and a Content Provider component are created. All the required resources of the target application App 1' are in one-to-one correspondence and are the same as all the resources required by the native application to run App1 in the Android operating system of the terminal device.
More preferably, the relationship establishing unit includes a resource name determining subunit and a resource loading subunit: the resource name determining subunit analyzes the installation package to determine a resource name of the required resource of the target application program; and the resource loading subunit loads the resources corresponding to the required resources of the native application one by one according to the resource names of the required resources of the target application.
Means for parsing the original installation package of the application program are well known to those skilled in the art. The installation package APK file is essentially a compressed package realized by combining a ZIP compression technology and a signature technology, so that on one hand, the internal file can be released through a decompression technology, and on the other hand, the internal file can be acquired through tool software such as Apktool.
Specifically, in the running process of the Android application program, a resource file packaged in an APK file is read by a resource manager called an AssetsManager. Each Activity component of an application is associated with a ContextImpl object that is used to describe the runtime context of the Activity component. The member function init of this ContextImpl object is called to perform the work of initializing the Activity component runtime context, including the work of creating resource objects and AssetsManager objects to access application Resources. Wherein, the context Impl. init function is defined in the file frames/base/core/java/android/app/context Impl. java. The parameter packageInfo in the contextimpr. init function points to a loadedApk object that describes the Apk to which the component currently being started belongs. The Resources object used to access application Resources is created by calling the parameter packageInfo to which is pointed the member function getResources of a loadedApk object. As such, application Resources may be extracted or accessed by creating resource objects.
The device module can load the target application program in the host application program for obtaining all relevant data of the native application program through the target application program with the same functions and services as the native application program. The following description will specifically describe how the device proposed by the embodiment of the present invention realizes that all relevant data of the native application program is obtained by the target application program.
Preferably, the obtaining module 310 includes an instruction calling unit, a resource hooking unit, and a resource executing unit: the instruction calling unit calls a data reading instruction of an active process of the target application program; the resource hooking unit hooks resources, which need to read data, of a native application program corresponding to resources, which need to read data, of a target application program execution data reading instruction through a hook function; and the resource execution unit executes the hooked resource to acquire the related data of the native application program.
First, the instruction calling unit calls a data reading instruction of an active process of the target application program.
Specifically, an invoking data reading instruction is actively sent through an active process of the target application.
And then, the resource hooking unit hooks the resource which needs to read the data of the native application program corresponding to the resource which needs to read the data of the data reading instruction and is executed by the target application program through the hook function.
It is noted that the term "hook" encompasses techniques for altering or augmenting the behavior of an operating system, application, or other software component by intercepting function calls, messages, or events passed between software components. And the code that handles such intercepted function calls, events or messages is called a hook function. Hooks are commonly used for a variety of purposes, including debugging and extending functionality. Examples of which may include intercepting keyboard or mouse events before they are passed to the application, or intercepting system calls, system function behavior, function execution results, etc., to monitor or modify the functionality of the application or other component, etc. In this embodiment, the hook function may be used to take over the installation self-checking operation required by the running of the application program.
As an example of a sandbox, a target application is operated in a sandbox operating environment, and monitoring an active process of the target application is a core implementation target of the sandbox operating environment and is responsible for implementing the following functions: by monitoring the access of the target application program to the resources, the target application program process can realize the normal calling of the corresponding resources. For example, the above-described call to the target application App 1' installation package resource can be implemented by monitoring a call instruction of a specific call resource and using a hook technology. The special service process can be registered in a mode of monitoring the active process of the target application program through the hook function, and the hook function is associated with a call instruction of the active process of the target application program App1 'to realize the activity monitoring of the target application program App 1'.
When the hook function monitors a data reading instruction of an active process calling a target application program, the hook function hooks a resource which is needed to read data of a native application program corresponding to a resource which is needed to read data of a data reading instruction executed by the target application program.
For example, the hook function is used to monitor the entry point of the data read instruction, intercept this call instruction, and obtain the name of the resource accessed by the target application App1 ', for example, the hook function obtains that the resource accessed by the target application App 1' is a Service component, and then turn to the hook function which performs the corresponding operation of hooking the resource, and the hook function hooks the Service component corresponding to the native application.
And finally, the resource execution unit executes the hooked resource to acquire the related data of the native application program.
It should be noted that, by executing the relevant resource of the target application, the execution result identical to the execution result of the relevant resource of the native application can be achieved, and therefore, by executing the hooked resource, the target application can read the relevant data of the native application instead of the native application.
The sending module 320 sends the data related to the native application and the installation environment information of the first terminal device to the second terminal device in a predetermined sending manner.
Specifically, the device described above herein may be used to obtain data related to a native application, and then obtain installation environment information of the first terminal device; then, the data related to the native application and the installation environment information of the first terminal device are transmitted to the second terminal device by a predetermined transmission method.
Preferably, the data related to the native application includes, but is not limited to, at least one of user historical behavior data, application configuration information, and encrypted data, and the installation environment information of the first terminal device includes, but is not limited to, at least one of a CPU model number, a kernel version number, a system version number, and system configuration information.
It should be noted that there are various devices that can send the relevant data of the native application and the installation environment information of the first terminal device to the second terminal device, for example, send data in a Wi-Fi hotspot, bluetooth, cloud server, and the like, and an embodiment of the present invention provides a preferred device for data transmission, which is described as follows:
preferably, the sending module 320 is specifically configured to send the data related to the native application and the installation environment information of the first terminal device to the second terminal device through a pre-established unidirectional data link.
Specifically, by establishing a unidirectional data link between the first terminal device and the second terminal device, the problem of data leakage caused in the data transmission process by uploading data to the server can be avoided. After the data link is established, the encapsulated data is sent directly from the first terminal device to the second terminal device over the data link.
It should be noted that, data encapsulation may be performed according to characteristics of different types of data to generate different types of data packets. Each data packet carries the characteristics of the corresponding type of data, so that after the second terminal device receives the data packet, the type of the data can be known according to the characteristics of the corresponding type of data carried by each data packet.
Accordingly, after the first terminal device sends the data related to the native application and the installation environment information of the first terminal device to the second terminal device, the second terminal device locally installs and runs the secondary application based on the received data related to the native application and the installation environment information of the first terminal device.
Fig. 4 is a schematic structural diagram of an apparatus for running an application according to an embodiment of the present invention.
The application scenario of the device for running the application program, which will be described below, is a running environment based on an Android operating system installed on the mobile terminal.
The device module in the second terminal equipment is also proposed based on the sandbox principle, so that the person skilled in the art will understand the implementation of the invention in connection with the well known sandbox implementation principle. The purpose of the sandbox is to provide a relatively closed operating environment for the target application, so that the target application accesses system resources under the security policy in the sandbox, and the activity of the target application is limited within a specified range.
The receiving module 410 receives the data related to the native application and the installation environment information of the first terminal device, which are transmitted by the first terminal device.
Specifically, the first terminal device sends the related data of the native application program and the installation environment information of the first terminal device to the second terminal device in a preset sending mode, and the second terminal device receives the related data of the native application program and the installation environment information of the first terminal device, which are sent by the first terminal device.
The installation and execution module 420 installs and/or executes the secondary application in the second terminal device based on the received related data of the native application and the installation environment information of the first terminal device.
The secondary application has all functions of the primary application, and can provide the same service as the primary application. In a specific application scenario, a user installs a native application in a first terminal device, when the user changes a new second terminal device, in the process of changing the terminal device, it is necessary to move relevant data of the native application in the first terminal device to an application corresponding to the second terminal device, where the corresponding application is a relay application, so that the relay application in the second terminal device has all functions of the native application, and under the condition that the service completely same as that of the native application can be provided, relevant data of the native application, such as a user chat record, user personal preference setting information, and the like, is also retained.
Preferably, the data related to the native application includes, but is not limited to, at least one of user historical behavior data, application configuration information, and encrypted data, and the installation environment information of the first terminal device includes, but is not limited to, at least one of a CPU model number, a kernel version number, a system version number, and system configuration information.
Preferably, the installation and execution module 420 includes an activity monitoring unit and a data invocation unit: the activity monitoring unit monitors the installation and/or running activity of the secondary application program through a hook function; when the fact that the installation environment information of the second terminal equipment and/or the related data of the secondary application are read by the secondary application program is monitored through the hook function, the data calling unit calls the received installation environment information of the first terminal equipment and/or the received related data of the primary application program, wherein the installation environment information of the first terminal equipment and/or the received related data of the secondary application are in one-to-one correspondence with the installation environment information of the second terminal equipment and/or the related data of the secondary application.
The main function of the device module is to create an installation and operation environment for the secondary application program, under which the secondary application program is not aware of being in the second terminal device but still considered to be in the first terminal device. In addition, through the above operation steps, the secondary application program can obtain the relevant data of the primary application program, such as the user chat record, the user operation record, the user personal preference setting information, the login verification information and the like, so that the primary application program is 'copied' from the first terminal device to the second terminal device as it is, the user can obtain the secondary application program as it is as the primary application program without performing a complicated chat record importing operation or setting the personal preference setting information for the application program again, and the user can directly log in the application program without the login verification operation.
Specifically, when it is monitored that the secondary application program reads the installation environment information of the second terminal device and/or the related data of the secondary application through the hook function, the received installation environment information of the first terminal device and/or the received related data of the primary application program, which are in one-to-one correspondence with the installation environment information of the second terminal device and/or the related data of the secondary application, are called. Setting a hook function to monitor a plurality of monitoring points related to installation and/or operation activities of the secondary application program, when it is monitored that the secondary application program reads the installation environment information of the second terminal device, hooking an instruction for acquiring the installation environment information of the second terminal device through the hook function, and replacing the installation environment information of the first terminal device and/or the related data of the primary application program which are in one-to-one correspondence with the installation environment information of the second terminal device and/or the related data of the secondary application program, so that the secondary application program is considered to be still in the first terminal device. Or when it is monitored that the secondary application program reads the related data of the secondary application, hooking the instruction for acquiring the installation environment information of the second terminal device through a hooking function, and replacing the installation environment information of the first terminal device and/or the related data of the primary application program which are in one-to-one correspondence with the installation environment information of the second terminal device and/or the related data of the secondary application program, so that the secondary application program directly reads the data received from the first terminal device.
It should be noted that, if, in the second terminal device, the received related data of the native application sent by the first terminal device is stored in a predetermined directory where the secondary application reads the related data corresponding to the received related data, the embodiment of the present invention further provides a preferable scheme, so that the secondary application can directly read the data received from the first terminal device.
Preferably, the installation and operation module 420 includes a data detection unit and a data reading unit: when monitoring that the secondary application program reads the relevant data corresponding to the secondary application program, the data detection unit detects whether the relevant data of the primary application program exists in a preset directory; the data reading unit reads the relevant data of the native application program when detecting that the relevant data of the native application program exists in the predetermined directory.
Specifically, receiving related data of a native application program sent by a first terminal device, and storing the related data of the native application program in a corresponding predetermined directory in a second terminal device; then, when the fact that the secondary application program reads the relevant data corresponding to the secondary application program is monitored, whether the relevant data of the primary application program exists in a preset directory is detected; and finally, if the related data of the native application program exists in the preset directory, reading the related data of the native application program.
The technical scheme of the invention solves the problem of how to move the relevant data of the application program in the first terminal equipment to the second terminal equipment. And acquiring related data of the native application program through a target application program installed in the host application program, wherein the host application program and the native application program are installed in the first terminal device, and in the step, data reading operation is performed through the target application program with the same functions and services as those of the native application program so as to acquire all related data of the native application program, wherein the data which can be acquired only through high operation authority is included in the data.
Furthermore, the technical scheme of the invention also solves the problem of how to control the installation and operation process of the application program of the second terminal equipment based on the data received by the first terminal equipment. The method comprises the steps of installing and/or operating the secondary application program in the second terminal device based on received related data of the primary application program and installation environment information of the first terminal device, creating an installation environment similar to the first terminal device for the secondary application program based on the received installation environment information of the first terminal device to guarantee the subsequent installation and operation of the secondary application program to be smooth, and in addition, installing and/or operating the secondary application program in the second terminal device through the received related data of the primary application program, a user does not need to manually introduce historical data of the first terminal device or log in a verification account, so that a complex and redundant operation process is avoided, and user experience is improved.
Those skilled in the art will appreciate that the present invention includes apparatus directed to performing one or more of the operations described in the present application. These devices may be specially designed and manufactured for the required purposes, or they may comprise known devices in general-purpose computers. These devices have stored therein computer programs that are selectively activated or reconfigured. Such a computer program may be stored in a device (e.g., computer) readable medium, including, but not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magnetic-optical disks, ROMs (Read-Only memories), RAMs (Random Access memories), EPROMs (Erasable programmable Read-Only memories), EEPROMs (Electrically Erasable programmable Read-Only memories), flash memories, magnetic cards, or optical cards, or any type of media suitable for storing electronic instructions, and each coupled to a bus. That is, a readable medium includes any medium that stores or transmits information in a form readable by a device (e.g., a computer).
It will be understood by those within the art that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. Those skilled in the art will appreciate that the computer program instructions may be implemented by a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, implement the features specified in the block or blocks of the block diagrams and/or flowchart illustrations of the present disclosure.
Those of skill in the art will appreciate that various operations, methods, steps in the processes, acts, or solutions discussed in the present application may be alternated, modified, combined, or deleted. Further, various operations, methods, steps in the flows, which have been discussed in the present application, may be interchanged, modified, rearranged, decomposed, combined, or eliminated. Further, steps, measures, schemes in the various operations, methods, procedures disclosed in the prior art and the present invention can also be alternated, changed, rearranged, decomposed, combined, or deleted.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (20)

1. A method for obtaining and transmitting application data, comprising:
acquiring related data of a native application program through a target application program installed in a host application program, wherein the host application program and the native application program are installed in a first terminal device, and required resources of the target application program correspond to required resources of the native application program one by one;
sending the related data of the native application program and the installation environment information of the first terminal equipment to second terminal equipment in a preset sending mode;
the acquiring, by a target application installed in a host application, data related to a native application includes:
calling a data reading instruction of an active process of the target application program;
hooking the resources, required to read the data, of the native application program corresponding to the resources, required to read the data, of the data reading instruction, of the target application program through a hook function;
and executing the hooked resources to acquire the data related to the native application program.
2. The method of claim 1, further comprising:
and calling the installation package which has the same package name as the host application program and is used as the attached resource of the host application program in a reflection mode so as to load the target application program realized by the installation package.
3. The method of claim 2, wherein loading the target application implemented by the installation package comprises:
establishing, by the host application, a one-to-one correspondence of the required resources of the target application to the required resources of a native application.
4. The method of claim 3, wherein establishing a one-to-one correspondence between the required resources of the target application and the required resources of a native application comprises:
analyzing the installation package to determine a resource name of a required resource of the target application program;
and loading the resources corresponding to the required resources of the native application one by one according to the resource names of the required resources of the target application.
5. The method according to claim 1, wherein transmitting the data related to the native application and the installation environment information of the first terminal device to the second terminal device by a predetermined transmission method comprises:
and sending the related data of the native application program and the installation environment information of the first terminal equipment to the second terminal equipment through a pre-established unidirectional data link.
6. The method according to any one of claims 1 to 5, wherein the data related to the native application comprises at least one of user historical behavior data, application configuration information and encrypted data, and the installation environment information of the first terminal device comprises at least one of a CPU model number, a kernel version number, a system version number and system configuration information.
7. A method of running an application, comprising:
receiving related data of a native application program sent by first terminal equipment and installation environment information of the first terminal equipment;
installing and/or running the secondary application in the second terminal device based on the received related data of the primary application and the installation environment information of the first terminal device;
wherein the relevant data of the native application is determined by:
calling a data reading instruction of an active process of a target application program, wherein the target application program is installed in a host application program, the host application program and the native application program are installed in the first terminal device, and the required resources of the target application program correspond to the required resources of the native application program one to one;
hooking the resources, required to read the data, of the native application program corresponding to the resources, required to read the data, of the data reading instruction, of the target application program through a hook function;
and executing the hooked resources to acquire the related data of the native application program.
8. The method of claim 7, wherein installing and/or running the secondary application in the second terminal device based on the received data related to the native application and the installation environment information of the first terminal device comprises:
monitoring installation and/or operation activities of the secondary application through a hook function;
and when it is monitored that the secondary application program reads the installation environment information of the second terminal equipment and/or the related data of the secondary application through the hook function, calling the received installation environment information of the first terminal equipment and/or the received related data of the primary application program, which are in one-to-one correspondence with the installation environment information of the second terminal equipment and/or the related data of the secondary application.
9. The method of claim 7, wherein executing the secondary application in the second terminal device based on the received data related to the native application and the installation environment information of the first terminal device comprises:
when the fact that the secondary application program reads the relevant data corresponding to the secondary application program is monitored, whether the relevant data of the primary application program exists in a preset directory or not is detected;
and if so, reading related data of the native application program.
10. The method according to any one of claims 7 to 9, wherein the data related to the native application comprises at least one of user historical behavior data, application configuration information and encrypted data, and the installation environment information of the first terminal device comprises at least one of a CPU model number, a kernel version number, a system version number and system configuration information.
11. An apparatus for acquiring and transmitting application data, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring related data of a native application program through a target application program installed in a host application program, the host application program and the native application program are installed in first terminal equipment, and required resources of the target application program correspond to required resources of the native application program one to one;
the sending module is used for sending the related data of the native application program and the installation environment information of the first terminal equipment to the second terminal equipment in a preset sending mode;
wherein the acquisition module comprises:
the instruction calling unit is used for calling a data reading instruction of an active process of the target application program;
the resource hooking unit is used for hooking the resource of the data to be read of the native application program corresponding to the resource of the data to be read of the data read instruction executed by the target application program through a hook function;
and the resource execution unit is used for executing the hooked resources so as to acquire the related data of the native application program.
12. The apparatus of claim 11, further comprising:
and the loading module is used for reflecting and calling the installation package which has the same package name as the host application program and is used as the attached resource of the host application program so as to load the target application program realized by the installation package, wherein the target application program is realized by the installation package.
13. The apparatus of claim 12, wherein the loading module comprises:
and the relationship establishing unit is used for establishing the one-to-one correspondence relationship between the required resources of the target application program and the required resources of the native application program through the host application program.
14. The apparatus of claim 13, wherein the relationship establishing unit comprises:
the resource name determining subunit is used for analyzing the installation package to determine the resource name of the required resource of the target application program;
and the resource loading subunit is used for loading the resources corresponding to the required resources of the native application program one by one according to the resource names of the required resources of the target application program.
15. The apparatus according to claim 11, wherein the sending module is specifically configured to send the data related to the native application and the installation environment information of the first terminal device to the second terminal device through a pre-established unidirectional data link.
16. The apparatus according to any one of claims 11-15, wherein the data related to the native application includes at least one of user historical behavior data, application configuration information, and encrypted data, and the installation environment information of the first terminal device includes at least one of a CPU model number, a kernel version number, a system version number, and system configuration information.
17. An apparatus for running an application, comprising:
the receiving module is used for receiving the related data of the native application program sent by the first terminal equipment and the installation environment information of the first terminal equipment;
the installation and running module is used for installing and/or running the secondary application program in the second terminal equipment based on the received related data of the primary application program and the installation environment information of the first terminal equipment;
wherein the relevant data of the native application is determined by:
calling a data reading instruction of an active process of a target application program, wherein the target application program is installed in a host application program, the host application program and the native application program are installed in the first terminal device, and the required resources of the target application program correspond to the required resources of the native application program one to one;
hooking the resources, required to read the data, of the native application program corresponding to the resources, required to read the data, of the data reading instruction, of the target application program through a hook function;
and executing the hooked resources to acquire the related data of the native application program.
18. The apparatus of claim 17, wherein the installation and operation module comprises:
the activity monitoring unit is used for monitoring the installation and/or running activity of the secondary application program through a hook function;
and the data calling unit is used for calling the received installation environment information of the first terminal equipment and/or the received related data of the native application program which are in one-to-one correspondence with the installation environment information of the second terminal equipment and/or the related data of the secondary application when the fact that the secondary application program reads the installation environment information of the second terminal equipment and/or the related data of the secondary application is monitored through the hook function.
19. The apparatus of claim 17, wherein the installation and operation module comprises:
the data detection unit is used for detecting whether the related data of the native application program exist in a preset directory or not when the fact that the related data corresponding to the secondary application program are read by the secondary application program is monitored;
and the data reading unit is used for reading the related data of the native application program when detecting that the related data of the native application program exists in a preset directory.
20. The apparatus according to any one of claims 17-19, wherein the data related to the native application comprises at least one of user historical behavior data, application configuration information, and encrypted data, and the installation environment information of the first terminal device comprises at least one of a CPU model number, a kernel version number, a system version number, and system configuration information.
CN201610629522.7A 2016-08-03 2016-08-03 Method and device for acquiring and transmitting application program data and running application program Active CN106293821B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610629522.7A CN106293821B (en) 2016-08-03 2016-08-03 Method and device for acquiring and transmitting application program data and running application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610629522.7A CN106293821B (en) 2016-08-03 2016-08-03 Method and device for acquiring and transmitting application program data and running application program

Publications (2)

Publication Number Publication Date
CN106293821A CN106293821A (en) 2017-01-04
CN106293821B true CN106293821B (en) 2020-01-17

Family

ID=57664754

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610629522.7A Active CN106293821B (en) 2016-08-03 2016-08-03 Method and device for acquiring and transmitting application program data and running application program

Country Status (1)

Country Link
CN (1) CN106293821B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107168783B (en) * 2017-05-10 2021-01-19 深信服科技股份有限公司 Data migration method and system
CN109558739B (en) * 2017-09-26 2022-04-15 腾讯科技(深圳)有限公司 Program running method and device, terminal and readable medium
CN108600164A (en) * 2018-03-14 2018-09-28 维沃移动通信有限公司 A kind of method and terminal of data processing
CN117956062A (en) * 2022-10-31 2024-04-30 Oppo广东移动通信有限公司 Service circulation method, device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462879A (en) * 2014-11-28 2015-03-25 北京奇虎科技有限公司 Root-free running control method and device of application program
CN105653311A (en) * 2015-09-23 2016-06-08 宇龙计算机通信科技(深圳)有限公司 Application installation method and apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462879A (en) * 2014-11-28 2015-03-25 北京奇虎科技有限公司 Root-free running control method and device of application program
CN105653311A (en) * 2015-09-23 2016-06-08 宇龙计算机通信科技(深圳)有限公司 Application installation method and apparatus

Also Published As

Publication number Publication date
CN106293821A (en) 2017-01-04

Similar Documents

Publication Publication Date Title
CN105955782B (en) Application program operation control method and device
US10552610B1 (en) Adaptive virtual machine snapshot update framework for malware behavioral analysis
CN106293821B (en) Method and device for acquiring and transmitting application program data and running application program
US8510805B2 (en) Safe and efficient access control mechanisms for computing environments
US8886179B2 (en) Fielded device failure tracking and response
CN108241500B (en) Method, device and system for repairing hardware component and storage medium
KR101281825B1 (en) Apparatus and method that enhance security using virtual interface in cloud system
US10176327B2 (en) Method and device for preventing application in an operating system from being uninstalled
CN112867988A (en) Implementing compliance settings by a mobile device to follow a configuration scenario
US10687216B2 (en) Antitheft method for mobile terminal and apparatus
US6973305B2 (en) Methods and apparatus for determining device integrity
WO2018133654A1 (en) Protected positioning method and device
CN111880987A (en) Dynamic monitoring method and device of application program, storage medium and electronic device
CN112596757A (en) Method and device for upgrading agent component of cloud desktop virtual machine and storage medium
CN108958785B (en) Application program upgrading method and device
CN105975333A (en) Method and device for running control of application programs
WO2016069039A1 (en) Monitoring a mobile device application
KR20130097563A (en) Appatus and method for processing a application of mobile terminal device
CN112417533A (en) Anti-screenshot method and device, computer equipment and storage medium
Nazar et al. Rooting Android–Extending the ADB by an auto-connecting WiFi-accessible service
WO2017049317A1 (en) Secure data link for subscriber identification module (sim)-based processor
CN108134683B (en) Terminal and bus architecture implementation method
US10171290B1 (en) Systems and methods for real-time correction of core applications
CN108595954A (en) A kind of malicious act monitoring method based on run time verification
US11531613B1 (en) Systems for remote determination of data from test devices

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20211206

Address after: 300450 No. 9-3-401, No. 39, Gaoxin 6th Road, Binhai Science Park, high tech Zone, Binhai New Area, Tianjin

Patentee after: 3600 Technology Group Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230713

Address after: 1765, floor 17, floor 15, building 3, No. 10 Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: Beijing Hongxiang Technical Service Co.,Ltd.

Address before: 300450 No. 9-3-401, No. 39, Gaoxin 6th Road, Binhai Science Park, high tech Zone, Binhai New Area, Tianjin

Patentee before: 3600 Technology Group Co.,Ltd.