Information acquisition method, device, computer equipment and computer readable storage medium
By decompressing the application package and building a calling interface, directly calling the signature algorithm of the target code base to generate signature information, solving the problem of low efficiency in the existing technology and achieving efficient signature information acquisition.
Patent Information
- Application Number
- CN202110943054.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-17
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2041-08-17
AI Technical Summary
The efficiency of obtaining signature information in the prior art is low, the disassembly process is complicated and the requirements for developers are high, which makes it difficult to obtain signature information.
By obtaining the application package of the target application, decompressing and building a calling interface, calling the interface to call the signature algorithm of the target code base, generating signature information, and the interface path is the same as the target application, avoiding the disassembly process.
It improves the efficiency of obtaining signature information, simplifies the development process, and reduces the technical requirements for developers.
Smart Images

Figure CN113742668B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an information acquisition method, apparatus, computer equipment, and computer-readable storage medium. Background Art
[0002] When a user sends a request to the corresponding server through an application (application, app) (also referred to as an application), it is usually necessary to carry signature information. The server authenticates the user through the signature information, and only after the identity authentication is passed can the user be provided with the corresponding service. If the signature information can be obtained, the request can be sent to the server through the machine to improve the access efficiency. Usually, the target code library containing the signature algorithm (the signature information can be obtained through the signature algorithm) in the application software is disassembled into an assembly file to obtain the signature algorithm, and then the signature information is obtained through the signature algorithm, and a request is sent to the server based on the signature information. Disassembly requires converting machine language into assembly language, which is difficult to analyze and has high requirements for developers who perform disassembly work, resulting in low efficiency in obtaining signature information. Summary of the invention
[0003] The embodiments of the present application provide an information acquisition method, apparatus, computer device, and computer-readable storage medium, which can improve the efficiency of acquiring signature information.
[0004] An information acquisition method provided in an embodiment of the present application includes:
[0005] Get the application package of the target application;
[0006] Decompressing the application package to obtain the object code library in the application package;
[0007] For the target code library, a corresponding calling interface is constructed, wherein the calling path of the calling interface calling the target code library is the same as the calling path of the target application calling the target target code library;
[0008] The signature information is generated by calling the signature algorithm in the target code library through the calling interface.
[0009] Accordingly, an embodiment of the present application further provides an information acquisition device, including:
[0010] An acquisition unit, used for acquiring an application package of a target application;
[0011] A decompression unit, used for decompressing the application package to obtain a target code library in the application package;
[0012] A construction unit, configured to construct a corresponding calling interface for the target code library, wherein a calling path for the calling interface to call the target code library is the same as a calling path for the target application to call the target target code library;
[0013] The calling unit is used to call the signature algorithm in the target code library through the calling interface to generate signature information.
[0014] Correspondingly, an embodiment of the present application also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any information acquisition method provided in the embodiment of the present application.
[0015] Correspondingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store a computer program, and the computer program is loaded by a processor to execute any information acquisition method provided in the embodiment of the present application.
[0016] The embodiment of the present application obtains the application package of the target application; decompresses the application package to obtain the target code library in the application package; then, for the target code library, a corresponding calling interface is constructed, and the calling path of the calling interface to call the target code library is the same as the calling path of the target application calling the target code library; finally, the signature information is generated by calling the signature algorithm in the target code library through the calling interface. This solution constructs a calling interface that calls the signature algorithm with the same calling path as the target application, and the signature algorithm can be called through the calling interface to obtain the signature information. The signature information can be obtained without disassembling the target code library, thereby improving the efficiency of obtaining the signature information. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 is a flow chart of the information acquisition method provided in an embodiment of the present application;
[0019] Figure 2 is an interactive schematic diagram of the information acquisition method provided in an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of an information acquisition device provided in an embodiment of the present application;
[0021] Figure 4It is a schematic diagram of the structure of the terminal provided in the embodiment of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0023] The embodiments of the present application provide an information acquisition method, device, computer equipment and computer readable storage medium. The information acquisition device can be integrated in a computer equipment, which can be a server or a terminal.
[0024] The terminal may include a mobile phone, a wearable smart device, a tablet computer, a laptop computer, a personal computer (PC), and a vehicle-mounted computer.
[0025] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.
[0026] Terminals may include mobile phones, wearable smart devices, tablet computers, laptop computers, and personal computers (PCs), etc.
[0027] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0028] This embodiment will be described from the perspective of an information acquisition device, which may be integrated into a computer device, which may be a server or a terminal. Figure 1 As shown, the specific process of the information acquisition method is as follows:
[0029] 101. Obtain an application package of a target application.
[0030] Among them, the target application can be an application software (application, app) that needs to obtain signature information, the application package can be an installation package of the target application, and the installation package can include files required for the target application to run. For example, the target application is an application software running on an Android device, and the application package of the target application is an Android application package (Android application package, APK), which includes compiled code files, file resources, native resource file certificates, and manifest files, etc.
[0031] For example, the application package of the target application may be downloaded through a browser or other means.
[0032] 102. Decompress the application package to obtain the object code library in the application package.
[0033] The target code library may be a file containing a signature algorithm, for example, a dynamic library.
[0034] For example, the application package may be decompressed to obtain a plurality of program files contained in the application package, and the target code library may be obtained from the plurality of program files.
[0035] The target code library usually has a fixed suffix name. For example, the suffix name of the dynamic library is .so. In one embodiment, the step of "decompressing the application package to obtain the target code library in the application package" may specifically include:
[0036] Decompress the application package to obtain multiple program files contained in the application package;
[0037] Traverse the suffix names of multiple program files;
[0038] The program files whose suffix names meet the requirements are determined as the object code library.
[0039] For example, take the target code library as a dynamic library as an example: the dynamic library usually uses .so as the file suffix name. After decompressing the application package, you can get multiple program files in the application package. Traverse the suffix names of all program files in the application package and determine the program file with the suffix name .so as the target code library.
[0040] 103. For the target code library, a corresponding calling interface is constructed, and the calling path of the calling interface calling the target code library is the same as the calling path of the target application calling the target code library.
[0041] The calling interface may be an interface for calling a signature algorithm in a target code library to obtain signature information.
[0042] For example, the method of calling the signature algorithm of the target code library can be determined by querying the logic code in the program file obtained by decompressing the application package, and a corresponding interface can be constructed according to the determined method. The logic code in the application package can be called through the constructed interface to obtain the signature information.
[0043] In one embodiment, the calling path of the signature algorithm may be determined, and a corresponding interface may be constructed according to the calling path, that is, the step of "constructing a corresponding calling interface for a target code library", which may specifically include:
[0044] Get the program name of the application package, get the class name of the encryption class that calls the signature algorithm to generate the signature in the application package, and the name of the method contained in the encryption class;
[0045] Determine the calling path of the signature algorithm based on the name of the encryption class and the names of the methods contained in the encryption class;
[0046] Build a calling interface based on the calling path.
[0047] Among them, the encryption class is the class that calls the signature algorithm through methods in the logic code. The class is the basis for implementing information encapsulation in object-oriented programming.
[0048] For example, the logic code of the target application calls the signature algorithm of the dynamic library through method B in class A to obtain signature information. Correspondingly, the calling path is the path formed by the application package, class A and method B. A JNI layer interface class (i.e., calling interface) with the same program name, the same class name and the same method name as the application package is constructed. The JNI layer interface is a Java Native Interface (JNI). The API provided by the application package can be called through JNI. The method B in class A of the application package can be called through the constructed JNI layer interface, thereby realizing the calling of the signature algorithm to generate signature information.
[0049] In one embodiment, the method may be implemented in a local development environment built by a software development tool based on a native program interface, that is, the step of "determining the calling path of the signature algorithm according to the name of the encryption class and the name of the method included in the encryption class" may specifically include:
[0050] Install software development tools;
[0051] Configure the local development environment based on software development tools;
[0052] Based on the local development environment, build a calling interface according to the name of the encryption class and the names of the methods contained in the encryption class.
[0053] The software development tool may be a software development tool based on a native program interface, such as a native development kit, referred to as NDK. Programs developed using this tool run directly in a native language rather than a virtual machine.
[0054] For example, it can be as follows Figure 2 As shown, download and install NDK, configure the corresponding local development environment, and create a project in the local development environment. Place the dynamic library in the application package of the target application in the call directory of the project, build a JNI layer call interface with the same program name, class name, and method name as the application package in the project, compile it, and call the code in the application package through the call interface to generate signature information.
[0055] 104. Generate signature information by calling the signature algorithm in the target code library through the calling interface.
[0056] The signature algorithm may be an MD5 algorithm or a SHA1 algorithm.
[0057] Among them, the signature information can be the information required by the server to authenticate the client. The client generates the signature information through the signature algorithm and transmits the signature information to the server as a request parameter. The server receives the request and verifies the signature information at the same time. It generates signature information for the request parameters through symmetric encryption and compares it with the signature information transmitted by the client. If the signatures are inconsistent, the server needs to intercept the request; if the signature information is verified successfully, the interface can be accessed.
[0058] For example, the signature information may be generated by calling a signature algorithm in a target code library through a calling interface.
[0059] In one embodiment, the required parameter information can be determined through the code field in the logic code, and the corresponding parameters can be passed in to generate the signature information, that is, the step of "generating the signature information by calling the signature algorithm in the target code library through the calling interface" can specifically include:
[0060] Traverse the encryption class and the logic code in the methods contained in the encryption class;
[0061] Determine the parameter information required by the signature algorithm;
[0062] According to the parameter information, corresponding parameters are passed to the calling interface to generate signature information based on the parameters through the calling interface.
[0063] The parameter information may be information required by the signature algorithm, such as a timestamp and a random number, etc. The specific parameter information depends on the signature algorithm.
[0064] For example, the logic code in the encryption class and the methods contained in the encryption class can be traversed to determine the parameter information passed into the signature algorithm. The required parameter information can be determined by keyword matching. For example, if the logic code contains timestamp, it can be determined that the passed-in parameter information has a timestamp.
[0065] By determining the parameter information required by the signature algorithm, the corresponding parameters can be generated and passed into the calling interface. The calling interface calls the signature algorithm through the calling path and generates signature information based on the parameters.
[0066] Optionally, the application package can also be decompiled, which reverses the machine language into high-level programming language. During the programming process, developers usually define fields based on functions. The corresponding information of the fields can be determined through the code fields in the high-level programming language, such as user ID or timestamp, and then the parameter information can be determined.
[0067] In one embodiment, the step of “introducing corresponding parameters into the calling interface according to the parameter information, so as to generate signature information based on the parameters by calling the interface” may specifically include:
[0068] According to the parameter information, the corresponding parameters are passed to the calling interface;
[0069] The parameters are encrypted by calling the interface to generate signature information.
[0070] For example, the parameters may be passed into the calling interface, and the calling interface may encrypt the parameters by calling the signature algorithm through the calling path to generate signature information.
[0071] Optionally, after obtaining the signature information, the signature information and the parameters passed into the calling interface can be added to a uniform resource locator (URL), and the server can be accessed through the URL to obtain data, and the server can be authenticated.
[0072] Generate a data acquisition request based on the signature information;
[0073] Send a data acquisition request to the server corresponding to the target application to obtain data from the server.
[0074] For example, the signature information may be added to the data acquisition request, and a data acquisition request may be sent to a server corresponding to the target application. If the signature information is verified by the server, the corresponding data may be acquired from the server.
[0075] As can be seen from the above, the embodiment of the present application obtains the application package of the target application; decompresses the application package to obtain the target code library in the application package; then, for the target code library, a corresponding calling interface is constructed, and the calling path of the calling interface to call the target code library is the same as the calling path of the target application calling the target code library; finally, the signature information is generated by calling the signature algorithm in the target code library through the calling interface. This solution constructs a calling interface that calls the signature algorithm with the same calling path as the target application, and the signature algorithm can be called through the calling interface to obtain the signature information. The signature information can be obtained without disassembling the target code library, thereby improving the efficiency of obtaining the signature information.
[0076] In order to better implement the information acquisition method provided in the embodiment of the present application, an information acquisition device is also provided in one embodiment. The meanings of the terms are the same as those in the above-mentioned information acquisition method, and the specific implementation details can refer to the description in the method embodiment.
[0077] The information acquisition device can be integrated into a computer device, such as Figure 3 As shown, the information acquisition device may include: an acquisition unit 301, a decompression unit 302, a construction unit 303 and a calling unit 304, which are specifically as follows:
[0078] Acquisition unit 301: used to acquire the application package of the target application.
[0079] For example, the application package of the target application may be downloaded through a browser.
[0080] Decompression unit 302: used for decompressing the application package to obtain the target code library in the application package.
[0081] For example, the application package may be decompressed to obtain a plurality of program files contained in the application package, and the target code library may be obtained from the plurality of program files.
[0082] In one embodiment, the decompression unit 302 may include a decompression subunit, a traversal subunit, and a determination subunit, specifically:
[0083] Decompression subunit: used to decompress the application package to obtain multiple program files contained in the application package;
[0084] Traversal subunit: used to traverse the suffix names of multiple program files;
[0085] Determine subunit: used to determine program files whose suffix names meet the requirements as target code libraries.
[0086] For example, take the target code library as a dynamic library as an example: the dynamic library usually uses .so as the file suffix name. After decompressing the application package, multiple program files in the application package can be obtained. The suffix names of all program files in the application package are conveniently determined, and the program files with the suffix name .so are determined as the target code library.
[0087] The construction unit 303 is used to construct a corresponding calling interface for the target code library. The calling path of the calling interface calling the target code library is the same as the calling path of the target application calling the target code library.
[0088] For example, the method of calling the signature algorithm of the target code library can be determined by querying the logic code in the program file obtained by decompressing the application package, and a corresponding interface can be constructed according to the determined method. The logic code in the application package can be called through the constructed interface to obtain the signature information.
[0089] In one embodiment, the construction unit 303 may include an acquisition subunit, a determination subunit, and a construction subunit, specifically:
[0090] Get subunit: used to get the name of the application, the name of the encryption class that calls the signature algorithm to generate the signature in the application, and the name of the method contained in the encryption class;
[0091] Determine subunit: used to determine the calling path of the signature algorithm according to the name of the encryption class and the names of the methods contained in the encryption class;
[0092] Construction subunit: used to build a call interface according to the call path.
[0093] For example, the logic code of the target application calls the signature algorithm of the dynamic library through method B in class A to obtain signature information. Correspondingly, the calling path is the path formed by the application package, class A and method B. A JNI layer interface class (i.e., calling interface) with the same file name, class name and method name as the application package is constructed. The JNI layer interface is a Java Native Interface (JNI). The API provided by the application package can be called through JNI. Method B in class A of the application package can be called through the constructed JNI layer interface, thereby realizing the calling of the signature algorithm to generate signature information.
[0094] In one embodiment, the determination subunit may include an installation module, a configuration module, and a construction module, specifically:
[0095] Installation module: used to install software development tools;
[0096] Configuration module: used to configure the local development environment based on software development tools;
[0097] Building module: used to build a calling interface based on the local development environment, according to the name of the encryption class and the names of the methods contained in the encryption class.
[0098] For example, it can be as follows Figure 2 As shown, download and install NDK, configure the corresponding local development environment, and create a project in the local development environment. Place the dynamic library in the application package of the target application in the call directory of the project, build a JNI layer call interface with the same package name, type, and method name as the application package in the project, compile it, and call the code in the application package through the call interface to generate signature information.
[0099] The calling unit 304 is used to call the signature algorithm in the target code library through the calling interface to generate signature information.
[0100] For example, the signature information may be generated by calling a signature algorithm in a target code library through a calling interface.
[0101] Optionally, the calling unit 304 may include a traversal subunit, a determination subunit, and an input subunit, specifically:
[0102] Traversal subunit: used to traverse the encryption class and the logic code in the methods contained in the encryption class;
[0103] Determine subunit: used to determine the parameter information required by the signature algorithm;
[0104] The input subunit is used to input corresponding parameters to the calling interface according to the parameter information, so as to generate signature information based on the parameters through the calling interface.
[0105] For example, the logic code in the encryption class and the methods contained in the encryption class can be traversed to determine the parameter information passed into the signature algorithm. The required parameter information can be determined by keyword matching. For example, if the logic code contains timestamp, it can be determined that the passed-in parameter information has a timestamp.
[0106] By determining the parameter information required by the signature algorithm, the corresponding parameters can be generated and passed into the calling interface. The calling interface calls the signature algorithm through the calling path and generates signature information based on the parameters.
[0107] In one embodiment, the incoming subunit may include an incoming module and an encryption module, specifically:
[0108] Incoming module: used to pass corresponding parameters to the calling interface according to parameter information;
[0109] Encryption module: used to encrypt parameters and generate signature information by calling the interface.
[0110] For example, the parameters may be passed into the calling interface, and the calling interface may encrypt the parameters by calling the signature algorithm through the calling path to generate signature information.
[0111] Optionally, the information acquisition device may further include a generating unit and a sending unit, specifically:
[0112] Generating unit: used to generate a data acquisition request according to the signature information;
[0113] Sending unit: used to send a data acquisition request to the server corresponding to the target application to obtain data from the server.
[0114] For example, the signature information may be added to the data acquisition request, and a data acquisition request may be sent to a server corresponding to the target application. If the signature information is verified by the server, the corresponding data may be acquired from the server.
[0115] As can be seen from the above, the embodiment of the present application obtains the application package of the target application through the acquisition unit 301; the decompression unit 302 decompresses the application package to obtain the target code library in the application package; then, for the target code library, the corresponding calling interface is constructed through the construction unit 303, and the calling path of the calling interface to call the target code library is the same as the calling path of the target application calling the target code library; finally, the calling unit 304 calls the interface to call the signature algorithm in the target code library to generate signature information. This solution constructs a calling interface with the same calling path as the target application to call the signature algorithm, and the signature algorithm can be called through the calling interface to obtain the signature information. The signature information can be obtained without disassembling the target code library, thereby improving the efficiency of obtaining the signature information.
[0116] The present application also provides a computer device, which may be a terminal or a server. Figure 4 As shown, it shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:
[0117] The computer device may include one or more processors 1001 of processing cores, one or more computer-readable storage media (also referred to as storage media) memories 1002, power supplies 1003, and input units 1004. Those skilled in the art will appreciate that Figure 4 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0118] The processor 1001 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 1002 and calling data stored in the memory 1002, it executes various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, the processor 1001 may include one or more processing cores; preferably, the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and computer programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1001.
[0119] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.
[0120] The computer device also includes a power supply 1003 for supplying power to various components. Preferably, the power supply 1003 can be logically connected to the processor 1001 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 1003 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0121] The computer device may further include an input unit 1004, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0122] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically, in this embodiment, the processor 1001 in the computer device will load the executable files corresponding to the processes of one or more computer programs into the memory 1002 according to the following instructions, and the processor 1001 will run the computer programs stored in the memory 1002, thereby realizing various functions, as follows:
[0123] Get the application package of the target application;
[0124] Decompress the application package to obtain the object code library in the application package;
[0125] For the target code library, a corresponding calling interface is constructed, and the calling path of the calling interface to call the target code library is the same as the calling path of the target application to call the target target code library;
[0126] The signature information is generated by calling the signature algorithm in the target code library through the calling interface.
[0127] The specific implementation of the above operations can be found in the previous embodiments and will not be described in detail here.
[0128] As can be seen from the above, the computer device of the embodiment of the present application can obtain the application package of the target application; decompress the application package to obtain the target code library in the application package; then, for the target code library, build a corresponding calling interface, and the calling path of the calling interface to call the target code library is the same as the calling path of the target application calling the target code library; finally, the signature information is generated by calling the signature algorithm in the target code library through the calling interface. This solution builds a calling interface that calls the signature algorithm with the same calling path as the target application, and the signature algorithm can be called through the calling interface to obtain the signature information. The signature information can be obtained without disassembling the target code library, thereby improving the efficiency of obtaining the signature information.
[0129] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable and computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable and computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various optional implementations in the above-mentioned embodiments.
[0130] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above-described embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0131] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program can be loaded by a processor to execute any information acquisition method provided in the embodiment of the present application.
[0132] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0133] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0134] Since the computer program stored in the computer-readable storage medium can execute any one of the information acquisition methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the information acquisition methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0135] The above is a detailed introduction to an information acquisition method, device, computer equipment and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for obtaining information, characterized in that: include: Get the application package of the target application; Decompressing the application package to obtain a target code library in the application package, wherein the target application generates signature information through a signature algorithm in the target code library in the application package; The target code library is placed in a project, and a corresponding calling interface is constructed in the project for the target code library, wherein the calling path of the calling interface calling the target code library is the same as the calling path of the target application calling the target code library; Starting the engineering project, and calling the signature algorithm in the target code library in the engineering project through the calling interface in the engineering project to generate signature information; Wherein, the engineering project generates signature information through a signature algorithm in a target code library in the engineering project, and the signature information is consistent with the signature information generated by the target application; The step of constructing a corresponding calling interface in the engineering project for the target code library includes: Obtain the program name of the application package, and obtain the class name of the encryption class in the application package that calls the signature algorithm to generate a signature, and the name of the method included in the encryption class; Determine the calling path of the signature algorithm according to the class name of the encryption class and the names of the methods included in the encryption class; Constructing the calling interface in the engineering project according to the calling path; The step of calling the signature algorithm in the target code library in the engineering project through the calling interface in the engineering project to generate signature information includes: Traversing the encryption class and the logic codes in the methods contained in the encryption class; Determine parameter information required by the signature algorithm; According to the parameter information, corresponding parameters are passed to the calling interface in the engineering project, so as to generate signature information based on the parameters through the calling interface; The step of transferring corresponding parameters to the calling interface in the engineering project according to the parameter information, so as to generate signature information based on the parameters through the calling interface, includes: According to the parameter information, corresponding parameters are passed to the calling interface in the engineering project; The parameters are encrypted through the calling interface to generate signature information.
2. The method according to claim 1, characterized in that The decompressing the application package to obtain the target code library in the application package includes: Decompressing the application package to obtain multiple program files contained in the application package; Traversing the suffix names of the multiple program files; The program files whose suffix names meet the conditions are determined as the target code library.
3. The method according to claim 1, characterized in that The step of constructing a corresponding calling interface in the engineering project for the target code library includes: Install software development tools; Configuring a local development environment based on the software development tool; Obtain the class name of the encryption class that calls the signature algorithm to generate a signature in the application package, and the name of the method included in the encryption class; Based on the local development environment, the calling interface is constructed according to the class name of the encryption class and the names of the methods included in the encryption class.
4. The method according to any one of claims 1 to 3, characterized in that: After the signature algorithm in the target code library in the engineering project is called through the calling interface in the engineering project to generate signature information, the method further includes: Generate a data acquisition request according to the signature information; The data acquisition request is sent to a server corresponding to the target application to acquire data from the server.
5. An information acquisition device, characterized in that: include: An acquisition unit, used for acquiring an application package of a target application; a decompression unit, configured to decompress the application package to obtain a target code library in the application package, wherein the target application generates signature information through a signature algorithm in the target code library in the application package; A construction unit, used to place the target code library in a project, and to construct a corresponding calling interface in the project for the target code library, wherein a calling path for the calling interface to call the target code library is the same as a calling path for the target application to call the target code library; A calling unit, used to start the engineering project, and call the signature algorithm in the target code library in the engineering project through the calling interface in the engineering project to generate signature information; Wherein, the engineering project generates signature information through a signature algorithm in a target code library in the engineering project, and the signature information is consistent with the signature information generated by the target application; The step of constructing a corresponding calling interface in the engineering project for the target code library includes: Obtain the program name of the application package, and obtain the class name of the encryption class in the application package that calls the signature algorithm to generate a signature, and the name of the method included in the encryption class; Determine the calling path of the signature algorithm according to the class name of the encryption class and the names of the methods included in the encryption class; Constructing the calling interface in the engineering project according to the calling path; The step of calling the signature algorithm in the target code library in the engineering project through the calling interface in the engineering project to generate signature information includes: Traversing the encryption class and the logic codes in the methods contained in the encryption class; Determine parameter information required by the signature algorithm; According to the parameter information, corresponding parameters are passed to the calling interface in the engineering project, so as to generate signature information based on the parameters through the calling interface; The step of transferring corresponding parameters to the calling interface in the engineering project according to the parameter information, so as to generate signature information based on the parameters through the calling interface, includes: According to the parameter information, corresponding parameters are passed to the calling interface in the engineering project; The parameters are encrypted through the calling interface to generate signature information.
6. A computer device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the information acquisition method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the information acquisition method according to any one of claims 1 to 4.
