CN113407490A - Private directory file export method and device, electronic equipment and storage medium - Google Patents

Private directory file export method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113407490A
CN113407490A CN202110799220.5A CN202110799220A CN113407490A CN 113407490 A CN113407490 A CN 113407490A CN 202110799220 A CN202110799220 A CN 202110799220A CN 113407490 A CN113407490 A CN 113407490A
Authority
CN
China
Prior art keywords
private directory
target
file
directory
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.)
Pending
Application number
CN202110799220.5A
Other languages
Chinese (zh)
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.)
Tencent Cyber Shenzhen Co Ltd
Original Assignee
Tencent Cyber Shenzhen 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 Tencent Cyber Shenzhen Co Ltd filed Critical Tencent Cyber Shenzhen Co Ltd
Priority to CN202110799220.5A priority Critical patent/CN113407490A/en
Publication of CN113407490A publication Critical patent/CN113407490A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/113Details of archiving
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions

Abstract

The application discloses a private directory file export method and device, electronic equipment and a storage medium. The method is applied to the client, and comprises the following steps: creating a virtualized operating environment; running a target application in the virtualized execution environment; storing a target private directory file corresponding to the target application into an internal private directory corresponding to the client in the running process; exporting the target private directory file from the files in the internal private directory based on a preset function; wherein the preset function indicates export logic for files under the internal private directory. Therefore, the private directory file of the target application can be exported on a common machine, the export speed and the export universality of the private directory file are improved by means of the client, and the efficiency of development and testing is ensured.

Description

Private directory file export method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of internet communication technologies, and in particular, to a method and an apparatus for exporting a private directory file, an electronic device, and a storage medium.
Background
With the development of internet communication technology, various internet products are coming up endlessly. For application-type internet products, acquiring files in a private directory is a common requirement in a development and testing link, and even ordinary users have such a requirement to acquire chat records, cached picture files and the like.
In the related art, obtaining the private directory file of the application is often performed in the following manner: by means of the machine which obtains the high authority of the operating system, the read-write authority aiming at the private directory is provided, and therefore the private directory file of the installed and operated application can be exported. However, with the increasingly standardized market requirements, machines that acquire high authority of the operating system are not easy to acquire, and ordinary machines (machines that do not acquire high authority of the operating system) cannot export private directory files of applications that are installed and run. Therefore, there is a need to provide a solution for an application to export private directory files on a generic machine.
Disclosure of Invention
In order to solve the problem that when the prior art is applied to export a private directory file of an application, a common machine cannot export the private directory file of the application installed and running, and the like, the application provides an export method and device of the private directory file, an electronic device and a storage medium:
according to a first aspect of the present application, there is provided a method for exporting a private directory file, the method being applied to a client, the method including:
creating a virtualized operating environment;
running a target application in the virtualized execution environment; storing a target private directory file corresponding to the target application into an internal private directory corresponding to the client in the running process;
exporting the target private directory file from the files in the internal private directory based on a preset function; wherein the preset function indicates export logic for files under the internal private directory.
According to a second aspect of the present application, there is provided an apparatus for exporting a private directory file, the apparatus being configured at a client, the apparatus comprising:
a creation module: creating a virtualized execution environment;
an operation module: a means for running a target application in the virtualized execution environment; storing a target private directory file corresponding to the target application into an internal private directory corresponding to the client in the running process;
a derivation module: the system comprises a target private directory file, a storage unit and a control unit, wherein the target private directory file is used for exporting files under the internal private directory based on a preset function; wherein the preset function indicates export logic for files under the internal private directory.
According to a third aspect of the present application, there is provided an electronic device, which includes a processor and a memory, where at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the method for exporting the private directory file according to the first aspect.
According to a fourth aspect of the present application, there is provided a computer-readable storage medium having at least one instruction or at least one program stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the private directory file export method according to the first aspect.
According to a fifth aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method for exporting the private directory file as described in the first aspect.
The method, the device, the electronic equipment and the storage medium for exporting the private directory file have the following technical effects:
the method comprises the steps of establishing a virtualization operation environment through a client, then operating a target application in the virtualization operation environment, and then exporting a target private directory file corresponding to the target application from files under an internal private directory corresponding to the client based on a preset function. In the running process of the target application, the client stores the target private directory file into the internal private directory, and the preset function indicates the export logic of the file in the internal private directory. The target application is operated by utilizing the virtualized operation environment provided by the client, so that the private directory file of the target application is stored in the internal private directory. The export of the private directory files of the target application is realized through export logic set for the files under the internal private directory. Therefore, the private directory file of the target application can be exported on a common machine, the export speed and the export universality of the private directory file are improved by means of the client, and the efficiency of development and testing is ensured.
Drawings
In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram of an application environment provided by an embodiment of the present application;
fig. 2 is a flowchart illustrating a method for exporting a private directory file according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a process for running a target application by using a process according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a hijack storage path obtaining interface according to an embodiment of the present application;
fig. 5 is a flowchart illustrating a method for exporting a private directory file according to an embodiment of the present application;
fig. 6 is a flowchart illustrating a method for exporting a private directory file according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of a virtualized execution environment framework provided by embodiments of the application;
fig. 8 is a flowchart illustrating a method for exporting a private directory file according to an embodiment of the present application;
fig. 9 is a block diagram illustrating an export apparatus for private directory files according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "comprises" and "comprising," and any variations thereof, in the description and claims of this application and the above-described drawings, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.
root authority: is one of the system authorities, also called root authority. root is a super administrator account in a Linux system (an operating system), has the highest authority of the whole system, and can conveniently perform any actions of deleting, modifying, adding and the like on the system.
Data/data/directory: also known as private directory, data directory. In the android system, it is used to deposit files that are expected to be written to the local storage medium during the running of the app (application). And limited by the authority, the ordinary android system user cannot access the directory.
hook: the method is a technical means for hijacking by using a reflection method, a dynamic proxy method or a virtual machine method and the like to modify Java (a programming language) logic in the current process so as to change the execution result of a program and finally achieve the purpose of coding.
Context object: the method is characterized by referring to a context object in the running process of the android application, which carries a plurality of core works of the running of the application, wherein the base class is android.
The virtualization operation technology comprises the following steps: the method is a technology for realizing the operation of an apk (android application package) file by an android platform based on an idea of simulating an android system. This type of technique does not require the apk file to be installed on the android system, and the apk file can be run. The dual open operation of the app, which may be used for some functional classes, is also used for debug modify operations on the apk file.
Droid Plugin: an android platform open source framework can be used for building a set of virtual operating environment simulating an android system so as to operate an apk file in the virtual operating environment.
Java reflection (reflection) technique: refers to the ability of a computer program to access, detect and modify its own state or behavior at runtime (runtime). Java, as a programming language, itself provides a set of reflective interfaces that developers can easily implement reflective operations on code logic within a process using such interfaces as APIs (application program interfaces).
Referring to fig. 1, fig. 1 is a schematic diagram of an application environment according to an embodiment of the present application, where the application environment may include a terminal 10 and a server 20, and the terminal 10 and the server 20 may be directly or indirectly connected through wired or wireless communication. A client is operated on the terminal 10, a target application is operated in a virtualized operation environment provided by the client, and a private directory file of the target application is stored in an internal private directory corresponding to the client. The export of the private directory files of the target application is realized through export logic set for the files under the internal private directory. It should be noted that fig. 1 is only an example.
The terminal 10 may be a smartphone, a desktop computer, a tablet computer, a notebook computer, an Augmented Reality (AR)/Virtual Reality (VR) device, a digital assistant, a smart speaker, a smart wearable device, or other type of physical device. The operating system corresponding to the terminal may be an Android system (Android system), an IOS system (a mobile operating system developed by apple inc.), a Linux system (one operating system), a Microsoft Windows system (Microsoft Windows operating system), and the like. The client may be software, such as a computer program, running in the terminal 10.
The server 20 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform, and the like. Which may include a network communication unit, a processor, and memory, among others. The server can provide background services for the corresponding client.
In practical applications, the terminal may be a mobile terminal, such as a mobile phone. The operating system corresponding to the terminal may be an android system. The client may be an application capable of providing a virtualized execution environment. The target application may be a test application that needs to obtain files in its private directory in the development testing process. The test application may be a gaming application, and the type of game provided by the gaming application may be ACT, adventure, RPG (Role-playing game), narrative, strategy, FPS (First-person shooting), fighting, puzzles, street game, science fiction, open world, survival, etc.
Take the test application as a face-pinching game application as an example. If the function of storing the face-pinching images of the game virtual characters which are confirmed to be stored into the private directory is required to be tested, the client is operated on the ordinary machine on the basis of writing relevant codes for realizing the function of storing the face-pinching images of the game virtual characters which are confirmed to be stored into the private directory for the face-pinching game application, and the face-pinching game application is operated in the virtual operation environment provided by the client. Relevant (even all) player operations (such as 'confirming to save the pinching face image of the game virtual character') of the pinching face game application running in the virtualized running environment are carried out under the private directory of the client, so that partial files under the private directory of the client can be exported to realize export of the private directory file of the pinching face game application. Whether the pinching face game application has a function of "storing the pinching face image of the game virtual character whose storage is confirmed in the private directory" is determined by checking whether or not "confirming the pinching face image of the game virtual character whose storage is confirmed" is included in the exported private directory file.
A specific embodiment of a method for exporting a private directory file according to the present application is described below, and fig. 2 is a flowchart illustrating a method for exporting a private directory file according to an embodiment of the present application, where the method operation steps described in the embodiment or the flowchart are provided, but more or less operation steps may be included based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. In actual system or product execution, sequential execution or parallel execution (e.g., parallel processor or multi-threaded environment) may be possible according to the embodiments or methods shown in the figures. Specifically, as shown in fig. 2, the method may include:
s201: creating a virtualized operating environment;
in an embodiment of the application, a client creates a virtualized execution environment. The client can be an application, and the client can be based on a virtual running technology and combined with a technology of Java layer hook to create a virtual running environment. It should be noted that the client runs on a terminal, and the terminal may be a general machine that does not obtain a high permission of the operating system, for example, the terminal may be an android phone that does not obtain a root permission. The installation package file of the client can be installed on the terminal, so that the operation of the client is realized.
In an exemplary embodiment, the creating a virtualized execution environment may include: a process indicating a simulation run is created based on a preset framework.
The preset framework is used for building a set of virtual operating environment simulating an operating system. The preset frame can be an open-source mature frame or a self-developed high-adaptation frame. And the client establishes a process indicating simulated operation based on a preset frame, so that the establishment of a virtualized operation environment is realized. The process for indicating the simulation operation can be used for operating the application to be tested, and the operating environment of the application to be tested and the operating environment provided by the terminal are not affected and isolated from each other. By means of the preset framework, convenience and efficiency of the client side in completing the work of creating the virtual operating environment can be improved.
Further, the client can also create a first type of process based on the preset frame; wherein the first class of processes is used for showing interface controls exported for private directory files; creating a second type of process based on the preset framework; wherein the second type of process is used for recording and transmitting process information derived for the private directory file.
The aforementioned processes indicating the simulated operation can be regarded as a third type of process, and a virtualized operation environment is created based on the first type of process, the second type of process, and the third type of process. The virtualized operation environment created by the three processes focuses on the scene of exporting the private directory file, the operation convenience of development and testing personnel can be improved by displaying the related interface control, and the related information exported for the specific private directory file can be better maintained by recording and transmitting the related process information, so that the stability of exporting the private directory file is ensured.
Referring to fig. 7, the first type process may be a Host process (Host) of the client, which is responsible for the User Interface (UI) presentation work of the client. The user interface of the responsible client may include a user interface framework of the client as a whole, which may include displaying related interoperation controls and responding to trigger operations directed to the related interoperation controls. The related interoperation control may include a button to instruct installation and uninstallation of an installation package file of the application to be tested. The associated interoperation controls may also include a button to indicate that a private directory file of a test application is exported. The private directory file of a certain test application is a file which is output by the test application after the running of the virtualized running environment provided by the client and needs to be exported from the internal private directory corresponding to the client. The button may be associated with a preset directory for storing the exported file, and the preset directory may indicate an external storage directory, i.e. a directory on a common storage medium other than the terminal on which the client operates, such as a public directory (e.g. a cache directory) of an external sd card (secure digital card). Buttons indicating to install, uninstall installation package files of an application to be tested and buttons indicating to export private directory files of a certain test application may serve as interface controls for private directory file export.
The second class of processes can be regarded as unified management processes, can be understood as daemon processes of the whole client, and is responsible for installation management of installation package files, system component starting and stack management, third class process management and the like. The second class process is used for recording process information derived for the private directory file, and may be responsible for recording state information of the (to-be) tested application, such as recording a storage location of an installation package file of the to-be-tested application, a name of the installation package file, and whether the installation package file is installed; and recording the running sequence and operation (such as the operation of opening and exiting the test application) information of the page corresponding to the test application running in the virtual running environment. The second type of process is used for transferring process information derived for the private directory file, such as transferring the installation instruction, the uninstallation instruction and the derivation instruction obtained in response to the button trigger. The second class of processes may provide a call interface across processes. The method can maintain the interface capability needed by some main processes and third-class processes, provide a uniform capability output interface to facilitate process calling, and equivalently establish the communication between the first-class process and the third-class process. In practical applications, the installation package file management for which the second class of processes is responsible may be for the apk file. The system component launch and stack management for which the second type of process is responsible may be for Activity (an android system component), where Activity stack management may include an Activity page of a test application being emulated.
S202: running a target application in the virtualized execution environment; storing a target private directory file corresponding to the target application into an internal private directory corresponding to the client in the running process;
in an embodiment of the application, a client runs a target application in a virtualized running environment. The target application may be a test application that needs to obtain files in its private directory in the development testing process. The target application is run in a virtualized execution environment provided by the client. In the running process, the client stores the target private directory file corresponding to the target application into the internal private directory corresponding to the client, namely, the interface redirection operation aiming at the private directory file of the test application is completed by means of the virtualized running environment provided by the client, the directory allocation aiming at the test application is realized, and thus the file writing action aiming at the test application is redirected into the internal private directory. The target private directory file is a file under a private directory of the target application, and the internal private directory is a private directory of the client. The files written to the private directory of the target application may be determined based on pre-agreed content in the configuration information of the test application. The client can run the target application by using the process (hereinafter referred to as "third class process") which is created in combination with the above steps and indicates the simulated running process.
In an exemplary embodiment, the running the target application with the process includes performing, with the process, the steps of: firstly, determining a target installation package file corresponding to the target application from files in a specified directory; then, decompressing the target installation package file to obtain a library file; thirdly, constructing a class loader object based on the path information of the target installation package file and the path information of the library file; and finally, loading the target installation package file by using the class loader object so as to run the target application.
The specified directory indicates a storage path of an installation package file of the application to be simulated to run, and the path can be located on a local storage medium. The files under the specified directory may be stored by the second type of process copy as described above. And the third class process determines a target installation package file corresponding to the target application from the files in the specified directory. The third process can determine the identification information of the target application based on the requirement information of the development and test link, and further determine the matched target installation package file from the files in the designated directory according to the identification information. The identification information may be the name of the target installation package file. In practical applications, the target installation package file may be an apk file, the apk file includes code for reflecting the operation logic of the target application, and the apk file may include a dex file (dalvik executable format file, an executable file) and a so file (shared object file, a library file). The apk file can be installed in an android device to run.
And the third class of processes decompresses the target installation package file to obtain a library file, such as a so file. And the third class process constructs a class loader (ClassLoader) object based on the path information of the target installation package file and the path information of the library file, wherein the path information of the target installation package file indicates the storage position of the target installation package file, and the path information of the library file indicates the storage position of the library file. The third class of processes loads the target installation package file using the class loader object to run the target application.
The client side runs the target installation package file by utilizing the process of the client side, so that the running of the target application realized in the virtualized running environment is basically consistent with the running of the target application realized by installing the target installation package file in the terminal, and the running logic execution corresponding to the target installation package file is also basically consistent. For example, the virtualized execution environment provided by the client is created by simulating an android system, and then the effect of running the apk file of the test application in the virtualized execution environment is substantially consistent with the effect of installing the apk file on the android device for running.
In an exemplary embodiment, as shown in fig. 3, the running the target application by using the process includes:
s301: determining, with the process, response logic for the target application in response to the request information for the target application;
s302: when the response logic comprises a calling function aiming at an interface of a specified operating system, hijacking the calling function by utilizing the process, and modifying the calling function based on the relation between the response logic and the specified operating system;
s303: and executing the modified calling function by utilizing the process.
The client uses the process of the client to realize the running of the target application, and the running logic of the target application is required to be normally executed. Considering that the running logic of the target application is usually designed for the running environment provided by the terminal, and when the target application runs in the running environment provided by the client, an exception may occur when the original running logic is executed, so that the client can adaptively adjust the original running logic to ensure the realization of the original running effect.
In response to the request information for the target application, the client determines response logic of the target application using a third class of processes. The request message may be sent by a target object (e.g. user, simulator), such as request message 1 "jump to page 5". The client determines the response logic of the target application to the request information, such as the response logic to the request information 1, by using the third type of process. If the response logic includes a calling function for an interface of the specified operating system, the client hijacks the calling function using a third class of process (hook), and modifies the calling function based on a relationship between itself and the specified operating system, thereby executing the modified calling function. Of course, if the response logic does not include a calling function for the interface of the specified operating system, the calling function may be executed directly.
The specified operating system is the operating system to which the target application is adapted, i.e. the target application is developed for the specified operating system. For example, if the target application is an android application, then the operating system is designated as an android system. Execution of a calling function for an interface of a specified operating system may be abnormal due to the aforementioned execution environment. When the client uses the third class process to perform adaptive adjustment on the related call function, the relationship between the client and the designated operating system needs to be considered. For example, a client running on an android device can adjust a calling function to be associated with an operating system of the android device across a virtualized running environment that simulates an android system. Otherwise, calls to native APIs of the android system (also called android framework APIs, corresponding to interfaces of a designated operating system) may be shielded and error-reported by the android system, and these APIs cannot be correctly called, thereby affecting normal execution of the response logic.
Of course, the specified operating system may also be different from the operating system of the device run by the client, such as the client running on the IOS device creating a virtualized execution environment that simulates an android system to run the target application (corresponding to the android system). At this time, the client may convert an interface of the designated operating system (android system) into an interface corresponding to the IOS system, and adjust a relevant parameter of the call function so as to be associated with the operating system of the IOS device beyond the virtualized running environment simulating the android system. And the client executes the modified call function by utilizing the third class of processes, so that the running effect of the target application can be completely presented by utilizing the third class of processes.
S203: exporting the target private directory file from the files in the internal private directory based on a preset function; wherein the preset function indicates export logic for files under the internal private directory.
In the embodiment of the present application, the private directory file of the target application (target private directory file) running in the virtualized running environment is allocated under the private directory (internal private directory) of the client. When the target private directory file is exported, the export can be realized by means of a preset function. The preset function indicates export logic for files under the internal private directory, which may be pre-buried with the source code of the client. The client has read-write permission to the private directory, can acquire the source code of the client, and pre-embeds logic codes aiming at copying and copying the private directory by utilizing the permission to carry out source code engineering. Based on a preset function, the client can export files in the private directory of the client.
In an exemplary embodiment, as shown in fig. 4, before the deriving the target private directory file from the files under the internal private directory based on the preset function, the method further includes:
s401: determining a storage path acquisition interface of a running context object of the target application;
s402: modifying the return value of the storage path acquisition interface into a target private directory; the target private directory is an appointed subdirectory of the internal private directory, and the return value of the storage path acquisition interface indicates the storage path of the target private directory file.
In the running process, the client stores the target private directory file corresponding to the target application into the internal private directory corresponding to the client. When the private directory files of all the test applications are stored under the internal private directory, the problem that the target private directory file is difficult to accurately export occurs. Even if the storage path acquisition interface is required to be acquired through the corresponding running context object for writing the private directory file of the test application, and then the directory information is acquired based on the acquired storage path acquisition interface, so that the corresponding private directory file is written into the directory corresponding to the directory information, when the running context objects corresponding to the two tests are the same, the problem that the target private directory file is difficult to accurately export occurs.
The client determines a storage path acquisition interface of a running context object of the target application. The storage path retrieval interface may be at least one of: getDateDir (), getFilesDir (), and getDir (). In conjunction with the description in S202, if the target application is run by using the third class process, and if the test application a is run by the third class process a, the test application b is run by the third class process b, and the test application c is run by the third class process c, the run context object a corresponding to the test application a, the run context object b corresponding to the test application b, and the run context object c corresponding to the test application c are different, and the return values of the storage path acquisition interfaces of different run context objects are also different. In practical applications, as a private directory related to a target application of the android application, an associated interface is in the "android.
The client modifies the return value of the storage path acquisition interface into a target private directory. The target private directory is a designated subdirectory of the internal private directory, and the return value of the storage path acquisition interface indicates the storage path of the target private directory file. The designated subdirectory can be newly built by writing of private directory files of the target application, and can also be an existing subdirectory used based on the requirements of a development testing link. Of course, the directory corresponding to the directory information may be used as the designated sub-directory. When the return value of the storage path acquisition interface is modified from the original directory information to the target private directory, the private directory file of the target application is written into the target private directory. Wherein the modification of the return value can be done by hook techniques, see fig. 8. The target private directory is determined in the internal private directory as the storage path of the target private directory file, so that irrelevant storage paths of the internal private directory can be effectively filtered, and the accuracy and efficiency of exporting the target private directory file are improved.
Further, before the modifying the return value of the storage path obtaining interface to the target private directory, the method further includes: determining a corresponding directory name based on the characteristic information of the target application; naming the target private directory with the directory name. Correspondingly, the deriving the target private directory file from the files in the internal private directory based on the preset function includes: determining the target private directory from the internal private directory based on the directory name; exporting files under the target private directory based on the preset function; and the files under the target private directory are the target private directory files.
The client determines a corresponding directory name based on the characteristic information of the target application. The characteristic information of the target application may be service information (such as instant messaging service) of the target application, product information of the target application, and installation package file information of the target application. Accordingly, the determined directory name may be a business name, a product name, a name of a target installation package file. The client names a target private directory by a directory name, and the target private directory indicates a storage path of a target private directory file. On the basis, the target private directory can be accurately and efficiently located from the internal private directory through the directory name, and therefore files in the target private directory are exported based on a preset function so as to achieve export of the target private directory files.
Referring to fig. 5, 6 and 8, an application of the export scheme of private directory files provided in the present application will be described as an example, where a client can be used in a development tool.
1) An application to be tested is constructed, the core of the application realizes the function of storing a test picture in a private directory, and relevant codes are as follows:
Figure BDA0003164022740000131
2) the test application is run on a common machine, and the prompt of no permission to view is obtained when the private directory is viewed.
3) And running a client on the ordinary machine, and running the test application in a virtualized running environment provided by the client. The related (even all) file operations (such as "store a test picture to the private directory") of the test application running in the virtualized running environment are performed under the private directory of the client, so that part of files under the private directory of the client can be exported to realize export operations of the private directory files of the test application. Wherein the export code for the private directory of the client is as follows:
Figure BDA0003164022740000141
Figure BDA0003164022740000151
the export operation may be completed by copying the client's private directory to an external storage directory located on the sd card. After the test application runs in the virtualized running environment, file export operation can be triggered through an export button. The exported catalog, including the private catalog (of the test application) storing the "test pictures", can eventually be viewed on the external sd card. In addition, in combination with the description in step S202, when the test application is executed by using the third type of process (the process instructing the simulation execution), the operation of "storing one test picture in the private directory" may be triggered. The third class of process may then be exited, returning to the first class of process (the host process), triggering the operation of exporting the file.
According to the technical scheme provided by the embodiment of the application, the virtualized operation environment is created through the client, the target application is operated in the virtualized operation environment, and the target private directory file corresponding to the target application is derived from the files under the internal private directory corresponding to the client based on the preset function. In the running process of the target application, the client stores the target private directory file into the internal private directory, and the preset function indicates the export logic of the file in the internal private directory. The target application is operated by utilizing the virtualized operation environment provided by the client, so that the private directory file of the target application is stored in the internal private directory. The export of the private directory files of the target application is realized through export logic set for the files under the internal private directory. Therefore, the private directory file of the target application can be exported from the common machine, the threshold for obtaining the private directory file of the target application is reduced, and the dependence on a machine for obtaining the high authority of the operating system is not required. The speed and the universality of exporting the private directory file are improved by the client, so that the efficiency of development and test is ensured.
An embodiment of the present application further provides an apparatus for exporting private directory files, as shown in fig. 9, where the apparatus 900 for exporting private directory files is configured at a client, and the apparatus includes:
the creation module 901: creating a virtualized execution environment;
the operation module 902: a means for running a target application in the virtualized execution environment; storing a target private directory file corresponding to the target application into an internal private directory corresponding to the client in the running process;
the export module 903: the system comprises a target private directory file, a storage unit and a control unit, wherein the target private directory file is used for exporting files under the internal private directory based on a preset function; wherein the preset function indicates export logic for files under the internal private directory.
It should be noted that the device and method embodiments in the device embodiment are based on the same inventive concept.
The embodiment of the present application provides an electronic device, which includes a processor and a memory, where the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the method for exporting the private directory file provided in the above method embodiment.
Further, fig. 10 is a schematic diagram of a hardware structure of an electronic device for implementing the method for exporting the private directory file provided by the embodiment of the present application, where the electronic device may participate in or constitute the device for exporting the private directory file provided by the embodiment of the present application. As shown in fig. 10, the electronic device 100 may include one or more (shown as 1002a, 1002b, … …, 1002 n) processors 1002 (the processors 1002 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1004 for storing data, and a transmission device 1006 for communication functions. Besides, the method can also comprise the following steps: a display, an input/output interface (I/O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a power source, and/or a camera. It will be understood by those skilled in the art that the structure shown in fig. 10 is merely illustrative and is not intended to limit the structure of the electronic device. For example, electronic device 100 may also include more or fewer components than shown in FIG. 10, or have a different configuration than shown in FIG. 10.
It should be noted that the one or more processors 1002 and/or other data processing circuitry described above may be referred to generally herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part in software, hardware, firmware, or any combination thereof. Further, the data processing circuitry may be a single, stand-alone processing module, or incorporated in whole or in part into any of the other elements in the electronic device 100 (or mobile device). As referred to in the embodiments of the application, the data processing circuit acts as a processor control (e.g. selection of a variable resistance termination path connected to the interface).
The memory 1004 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the private directory file export method described in this embodiment, and the processor 1002 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, so as to implement the above private directory file export method. The memory 1004 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1004 may further include memory located remotely from the processor 1002, which may be connected to the electronic device 100 through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 1006 is used for receiving or sending data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the electronic device 100. In one example, the transmission device 1006 includes a network adapter (NIC) that can be connected to other network devices through a base station so as to communicate with the internet. In one embodiment, the transmission device 1006 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the electronic device 100 (or mobile device).
Embodiments of the present application further provide a computer-readable storage medium, which may be disposed in an electronic device to store at least one instruction or at least one program for implementing an export method of a private directory file in the method embodiments, where the at least one instruction or the at least one program is loaded and executed by the processor to implement the export method of the private directory file provided in the method embodiments.
Alternatively, in this embodiment, the storage medium may be located in at least one network server of a plurality of network servers of a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
It should be noted that: the sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present application are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the device and electronic apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method for exporting a private directory file, the method being applied to a client, the method comprising:
creating a virtualized operating environment;
running a target application in the virtualized execution environment; storing a target private directory file corresponding to the target application into an internal private directory corresponding to the client in the running process;
exporting the target private directory file from the files in the internal private directory based on a preset function; wherein the preset function indicates export logic for files under the internal private directory.
2. The method of claim 1, wherein prior to said deriving the target private directory file from files under the internal private directory based on a preset function, the method further comprises:
determining a storage path acquisition interface of a running context object of the target application;
modifying the return value of the storage path acquisition interface into a target private directory; the target private directory is an appointed subdirectory of the internal private directory, and the return value of the storage path acquisition interface indicates the storage path of the target private directory file.
3. The method of claim 2, wherein:
before the modifying the return value of the storage path acquisition interface to the target private directory, the method further includes:
determining a corresponding directory name based on the characteristic information of the target application;
naming the target private directory with the directory name;
the deriving the target private directory file from the files in the internal private directory based on the preset function includes:
determining the target private directory from the internal private directory based on the directory name;
exporting files under the target private directory based on the preset function; and the files under the target private directory are the target private directory files.
4. The method of claim 1, wherein:
the creating of the virtualized execution environment comprises:
establishing a process indicating simulation operation based on a preset frame;
the running of the target application in the virtualized execution environment comprises:
and running the target application by utilizing the process.
5. The method of claim 4, wherein the running the target application with the process comprises performing, with the process, the steps of:
determining a target installation package file corresponding to the target application from files in a specified directory; the specified directory indicates a storage path of an installation package file of an application to be simulated to run;
decompressing the target installation package file to obtain a library file;
constructing a class loader object based on the path information of the target installation package file and the path information of the library file;
and loading the target installation package file by utilizing the class loader object so as to run the target application.
6. The method of claim 4, wherein the running the target application with the process comprises:
determining, with the process, response logic for the target application in response to the request information for the target application;
when the response logic comprises a calling function aiming at an interface of a specified operating system, hijacking the calling function by utilizing the process, and modifying the calling function based on the relation between the response logic and the specified operating system;
and executing the modified calling function by utilizing the process.
7. The method of claim 4, wherein the creating a virtualized execution environment further comprises:
creating a first type of process based on the preset frame; wherein the first class of processes is used for showing interface controls exported for private directory files;
creating a second type of process based on the preset framework; wherein the second type of process is used for recording and transmitting process information derived for the private directory file.
8. An apparatus for exporting private directory files, the apparatus being configured at a client, the apparatus comprising:
a creation module: creating a virtualized execution environment;
an operation module: a means for running a target application in the virtualized execution environment; storing a target private directory file corresponding to the target application into an internal private directory corresponding to the client in the running process;
a derivation module: the system comprises a target private directory file, a storage unit and a control unit, wherein the target private directory file is used for exporting files under the internal private directory based on a preset function; wherein the preset function indicates export logic for files under the internal private directory.
9. An electronic device comprising a processor and a memory, wherein at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the private directory file export method according to any one of claims 1-7.
10. A computer-readable storage medium having stored therein at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by a processor to implement the private directory file export method of any one of claims 1-7.
CN202110799220.5A 2021-07-15 2021-07-15 Private directory file export method and device, electronic equipment and storage medium Pending CN113407490A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110799220.5A CN113407490A (en) 2021-07-15 2021-07-15 Private directory file export method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110799220.5A CN113407490A (en) 2021-07-15 2021-07-15 Private directory file export method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113407490A true CN113407490A (en) 2021-09-17

Family

ID=77686389

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110799220.5A Pending CN113407490A (en) 2021-07-15 2021-07-15 Private directory file export method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113407490A (en)

Similar Documents

Publication Publication Date Title
US9910765B2 (en) Providing testing environments for software applications using virtualization and a native hardware layer
CN104740872B (en) Simulate game program operation control method and device in Android environment
CN107368410B (en) Performance test method and device of game engine, storage medium and electronic device
US10678665B2 (en) Cloud platform experimentation system
JP7412594B2 (en) Data processing method, data processing device, computer equipment, and computer program
US20170168807A1 (en) Method and electronic device for updating application program
CN111722885B (en) Program running method and device and electronic equipment
US9996379B2 (en) Program execution without the use of bytecode modification or injection
EP3133490A1 (en) Virtual desktop processing method and device, and virtual desktop server
CN110764805B (en) Client non-inductive upgrading method, device, terminal and storage medium
CN108399331A (en) Application process trial method and system
US20200401425A1 (en) Previewing application user interface for multiple locales
US10901874B2 (en) Shadow testing
CN112650689A (en) Test method, test device, electronic equipment and storage medium
CN105550046B (en) Virtual control method, device and system
CN113407490A (en) Private directory file export method and device, electronic equipment and storage medium
CN115964124A (en) Serial port virtualization method, system, equipment and storage medium
US20220038444A1 (en) Cloud device, application processing method, electronic device and storage medium
CN110286956B (en) Plug-in operation method and device and electronic equipment
CN114422358A (en) API gateway configuration updating method and equipment
CN110324345B (en) Server login method and device, storage medium and terminal
KR101591076B1 (en) Method and apparatus for checking integrity of resource
CN111078209B (en) Development processing method, device and equipment for business page
CN113703878B (en) Component starting method and device, storage medium and electronic equipment
CN114327787A (en) Cloud mobile phone simulation system, method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination