A method, device, equipment and storage medium for accessing application program supporting files
By encapsulating and releasing functions in the application, the supporting files are encapsulated at the end of the executable file and released at startup, which solves the problems of easy tampering and cumbersome management of supporting files, achieves file security and ease of management, and improves Application operating efficiency.
Patent Information
- Application Number
- CN202010485470.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-01
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-06-01
AI Technical Summary
The supporting files of existing applications are easily tampered with in the path, resulting in reduced security, and the management and modification process of configuration parameters is cumbersome and affects efficiency.
By adding encapsulation and release functions to the application, the encapsulation function is abstracted into a static library, and the supporting files are encapsulated at the end of the application's executable file and released at startup, thereby achieving file hiding and read-only effects, while simplifying management and distribution.
It improves the security and management simplicity of application supporting files, avoids file tampering and misoperation, and improves application operating efficiency and user experience.
Smart Images

Figure CN111813460B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of application technology, and in particular to a method, device, equipment and storage medium for accessing application supporting files. Background Art
[0002] An application is generally composed of a group of files, including application binaries, configuration files, and script files. Configuration files and script files are all in the path of the application, so they are easy to obtain and there is a risk of tampering. Specifically, the supporting scripts of the application are designed to achieve simple and flexible functions. If the code developed using interpreted languages such as shell and python is easily read and written, it will reduce the security of the application and even the system. Software manufacturers generally set them to hidden paths and files, but by setting path properties, hidden files can be displayed and read and write permissions can be obtained. Therefore, the method of hiding files in the current directory to protect the supporting files of the application is not reliable. The configuration file of the application is to extract some adjustable parameters to adapt to the differences in operating systems, or to set different levels of permissions based on user authorization. Usually, the configuration parameters are extracted into a key-value format that is easy to read and write, and saved as an independent configuration file. Non-professionals may make mistakes or delete them by mistake, causing the application to run abnormally or even fail to start. In addition, the internal parameters of the software company (such as user authorization, operation restrictions, etc.) should not be disclosed to users, but only to technical support engineers. If all configuration parameters are stored in the binary of the application, although important information can be hidden, technical support engineers cannot modify it. Every time the supporting files are modified, the version needs to be recompiled and released, which is a lengthy process and extremely inefficient. Summary of the invention
[0003] The purpose of the embodiments of this specification is to provide a method, device, equipment and storage medium for accessing application supporting files, which realizes the access of application supporting files by adding two operations, namely, encapsulation and release, to the basic functions of the application, abstracting the encapsulation and release functions into a static library, adding the encapsulation and release functions during application development, enhancing the structure and versatility, encapsulating the application and supporting files into one file, making distribution more convenient and management simpler. .
[0004] To achieve the above objectives, on the one hand, an embodiment of this specification provides a method for accessing application program supporting files, including:
[0005] Create a packaged static library;
[0006] Calling the encapsulated static library to encapsulate the first executable file of the application and the supporting file into a second executable file;
[0007] Create and release static library;
[0008] The release static library is called to release the supporting files, specifically, when the application is started, the second executable file is run to release the supporting files.
[0009] On the other hand, the embodiment of this specification also provides a device for accessing application program supporting files, including:
[0010] Encapsulated static library creation module, used to create encapsulated static libraries;
[0011] A packaging module, used for calling the packaging static library to package the first executable file of the application and the supporting file into a second executable file;
[0012] Release static library creation module, used to create and release static libraries;
[0013] The release module is used to call the release static library to release the supporting files, specifically, when the application is started, run the second executable file to release the supporting files.
[0014] On the other hand, an embodiment of the present specification further provides an electronic device, including:
[0015] Memory, used to store computer software programs
[0016] A processor is used to implement the steps of the method for accessing the application supporting files in the embodiment of the present invention when running the computer software program.
[0017] On the other hand, the embodiments of this specification also provide a computer-readable storage medium on which a computer software program is stored. When the computer software program is executed, the steps of the method for accessing the application supporting files in the embodiments of the present invention can be implemented.
[0018] It can be seen from the technical solution provided by the above embodiments of this specification that the embodiments of this specification realize the access of the supporting files of the application by adding two operations, namely, encapsulation and release, to the basic functions of the application, abstracting the encapsulation and release functions into a static library, and adding the encapsulation and release functions when developing the application, thereby enhancing the structure and versatility, and being simple and easy to use. Further, through the two steps of encapsulation and release, the supporting files of the application are encapsulated into the shell of an executable file through the transformation of the executable file of the application, so that the distribution is more convenient and the management is simpler. When the program is started, the supporting files are released and reset to the files provided by the original factory. The release path and name of the supporting files are kept confidential to the user. If they are not in the current path of the application, they cannot be easily obtained and tampered with. The supporting files are encapsulated at the end of the application, so that the user's operation method remains unchanged and the user is unaware. They are released only when the application is started, so that the encapsulated supporting files have a read-only effect and a certain hiding ability, and do not affect the execution efficiency of the application at runtime. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A flowchart of a method for accessing application supporting files according to some embodiments of this specification.
[0020] Figure 2 A structural block diagram of a device for accessing application supporting files in some embodiments of this specification.
[0021] Figure 3 A schematic diagram of the packaging of application supporting files for some embodiments of this specification.
[0022] Figure 4 A schematic diagram of releasing application supporting files for some embodiments of this specification. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0024] like Figure 1 As shown, in some embodiments of this specification, a method for accessing application supporting files is provided, and the method includes the following steps:
[0025] S102, creating a packaged static library;
[0026] S104, calling the first executable file and the supporting file of the encapsulated static library encapsulated application program as a second executable file;
[0027] S106, creating and releasing a static library;
[0028] S108, calling to release the static library to release the supporting files, specifically, running the second executable file to release the supporting files when the application is started.
[0029] In some embodiments of the present specification, step S104 of calling the encapsulated static library to encapsulate the first executable file and the supporting file of the application into the second executable file specifically includes compressing the supporting file and adding it to the end of the first executable file of the application, and adding the number of bytes matching the length of the compressed supporting file to the end of the compressed supporting file and then encapsulating it to form a second executable file. Static library means that in our application, there are some common codes that need to be used repeatedly, so these codes are compiled into "library" files; in the linking step, the connector will obtain the required code from the library file and copy it to the generated executable file. The supporting files are encapsulated at the end of the application, so that the user's operation method remains unchanged and the user is unaware.
[0030] In some embodiments of the present specification, when the application is started, the step S108 of running the second executable file to release the supporting file specifically includes obtaining the number of bytes, setting the application as the first temporary file, setting the compressed supporting file as the second temporary file, decompressing the second temporary file and releasing it to the release path of the supporting file. The supporting file is released only when the application is started, so that the encapsulated supporting file has a read-only effect and a certain hiding ability, and does not affect the execution efficiency of the application at runtime.
[0031] In some embodiments of the present specification, the release path of the supporting files is different from the path where the application is located. The supporting files include configuration files and script files of the application.
[0032] In the actual application environment, when encapsulating, for example, Figure 3As shown, before the application is released, the first executable file (for example, the original executable file of the application) is prepared, and the packaged attachments (for example, compressed packages of supporting files such as important configurations and scripts) are prepared, and then the packaged attachments are packaged under the shell of the executable file. The packaging process is to append the packaged attachments to the end of the first executable file, and add a number of bytes that matches the length of the packaged attachments (for example, 4 bytes) at the end, so that a second executable file is formed, that is, a modified executable file is formed based on the original executable file of the application. When releasing, for example, when the application is started, running the modified executable file can release the supporting files. The released supporting files generate a new path, and this new path is specified outside the path where the application is located. The supporting files include configuration files and script files, etc., thereby hiding the application supporting files to a certain extent. The specific method of release can be, for example Figure 4 As shown, the compressed package size of the supporting file is taken out from the last byte number of the file, the original executable file of the application is written as the first temporary file, the encapsulated attachment (supporting file compressed package) is written as the second temporary file, and the second temporary file is decompressed to the release path.
[0033] Furthermore, if the supporting files need to be modified, they can be modified directly in the release path and then packaged into a new file of the application. This function allows the application to hide the path of the supporting files and has a restrictive modification capability.
[0034] Involving specific development links, for example: When developing the release function, it is necessary to add a function interface for calling the release in the original startup process of the application. The main parameter of the release function is the release path. When the application calls the encapsulated script and configuration file, it is necessary to add the release path in front of the file name. When developing the encapsulation function, it is necessary to add an encapsulation parameter to the application, and call the encapsulation function when the encapsulation parameter is entered. The encapsulation function has two main parameters, namely the executable file and the encapsulation attachment.
[0035] Therefore, the method for accessing application supporting files based on the embodiment of the present invention implements the access to application supporting files by adding two operations, namely, encapsulation and release, to the basic functions of the application, abstracts the encapsulation and release functions into a static library, and adds the encapsulation and release functions during application development, thereby enhancing the structure and versatility.
[0036] like Figure 2 As shown, in some embodiments of this specification, a device for accessing application program supporting files is also provided, the device comprising:
[0037] The encapsulated static library creation module 201 is used to create an encapsulated static library;
[0038] The encapsulation module 202 is used to call the first executable file and the supporting file of the encapsulated static library encapsulated application program into a second executable file;
[0039] A release static library creation module 203 is used to create a release static library;
[0040] The release module 204 is used to call and release the static library to release the supporting files, specifically, when the application is started, run the second executable file to release the supporting files.
[0041] In some embodiments of the present specification, the encapsulation module 202 is specifically used to compress the supporting file and add it to the end of the first executable file of the application, and to add a number of bytes matching the length of the compressed supporting file to the end of the compressed supporting file and then encapsulate it to form a second executable file.
[0042] In some embodiments of the present specification, the release module 204 is specifically used to obtain the number of bytes, set the application as the first temporary file, set the compressed supporting file as the second temporary file, decompress the second temporary file and release it to the release path of the supporting file. The supporting file includes the configuration file and script file of the application, and the release path of the supporting file is different from the path where the application is located.
[0043] In some embodiments of the present specification, an electronic device is also provided, including: a memory for storing a computer software program; and a processor for implementing the steps of the method for accessing application supporting files in the embodiments of the present specification when running the computer software program.
[0044] In some embodiments of the present specification, a computer-readable storage medium is also provided, on which a computer software program is stored. When the computer software program is executed, the steps of the method for accessing the application supporting files in the embodiments of the present specification can be implemented.
[0045] Running the above computer program can implement the supporting file access method in the embodiment of the present invention and thereby improve the security of the supporting files of the application.
[0046] Although the process flows described above include multiple operations that occur in a particular order, it should be clearly understood that these processes may include more or fewer operations, which may be performed sequentially or in parallel (for example, using parallel processors or a multi-threaded environment). The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1The steps of the functions specified in the blocks or multiple blocks. In a typical configuration, the computing device includes one or more processors (CPU), input / output interfaces, network interfaces and memory. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium. Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. The information can be a computer-readable instruction, a data structure, a module of a program or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0047] It should also be noted that the terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, or device including the element.
[0048] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. This specification may be described in the general context of computer-executable instructions executed by a computer, such as a program module. Generally, a program module includes routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in a distributed computing environment, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, a program module may be located in local and remote computer storage media including storage devices. Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the method embodiment, since it is basically similar to the device embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the device embodiment. The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A method for accessing application supporting files, characterized in that: The method comprises: Create a packaged static library; Calling the encapsulation static library to encapsulate the first executable file of the application and the supporting file into a second executable file, compressing the supporting file and adding it to the end of the first executable file of the application, and adding the number of bytes matching the length of the compressed supporting file to the end of the compressed supporting file and then encapsulating it to form the second executable file; Create and release static library; Calling the release static library to release the supporting file, specifically, when the application is started, running the second executable file to release the supporting file, obtaining the number of bytes, taking out the compressed package size of the supporting file from the last number of bytes of the file, setting the application as the first temporary file, setting the compressed supporting file as the second temporary file, decompressing the second temporary file and releasing it to the release path of the supporting file, wherein the release path of the supporting file is different from the path where the application is located; When modifying the supporting files, directly modify them in the release path and then package them into a new file of the application; When developing the release function, it is necessary to add a function interface for calling the release in the original startup process of the application; the main parameter of the release function is the release path. When the application calls the encapsulated script and configuration file, it is necessary to add the release path in front of the file name; when developing the encapsulation function, it is necessary to add an encapsulation parameter to the application, and call the encapsulation function when the encapsulation parameter is entered; the encapsulation function has two main parameters, namely the executable file and the encapsulation attachment, and the encapsulation attachment is a compressed package of supporting files.
2. The method for accessing application supporting files according to claim 1, characterized in that: The supporting files include configuration files and script files of the application.
3. A device for accessing application program supporting files, characterized in that: The device comprises Encapsulated static library creation module, used to create encapsulated static libraries; an encapsulation module, used for calling the encapsulation static library to encapsulate the first executable file of the application and the supporting file into a second executable file, and specifically for compressing the supporting file and adding it to the end of the first executable file of the application, and encapsulating it after adding the number of bytes matching the length of the compressed supporting file to the end of the compressed supporting file to form the second executable file; Release static library creation module, used to create and release static libraries; a release module, used for calling the release static library to release the supporting file, specifically, when the application is started, running the second executable file to release the supporting file, specifically for obtaining the number of bytes, setting the application as the first temporary file, setting the compressed supporting file as the second temporary file, decompressing the second temporary file and releasing it to the release path of the supporting file, wherein the release path of the supporting file is different from the path where the application is located; When modifying the supporting files, directly modify them in the release path and then package them into a new file of the application; When developing the release function, you need to add a function interface to call the release in the original startup process of the application. The main parameter of the release function is the release path. When the application calls the encapsulated script and configuration file, it needs to add the release path in front of the file name. When developing the encapsulation function, you need to add an encapsulation parameter to the application. When the encapsulation parameter is input, the encapsulation function is called. The encapsulation function has two main parameters, namely the executable file and the encapsulation attachment, and the encapsulation attachment is a compressed package of supporting files.
4. The device for accessing application program supporting files according to claim 3, characterized in that: The supporting files include configuration files and script files of the application.
5. An electronic device, characterized in that: include Memory, used to store computer software programs A processor, used to implement the steps of the method for accessing the application supporting files according to any one of claims 1 to 2 when running the computer software program.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer software program, which, when executed, implements the steps of the method for accessing the application supporting files according to any one of claims 1 to 2.
