Processing method and device of application program, electronic equipment and readable storage medium

CN116302086BActive Publication Date: 2026-09-04BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310159189.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-15
Publication Date
2026-09-04
Estimated Expiration
2043-02-15

AI Technical Summary

Benefits of technology

[0008]由以上技术方案可以看出,本公开通过执行与su命令具有相同功能的预设获取命令的方式来获取操作系统的root权限,能够提升应用程序的运行成功率,且实现了对应用程序进行逆向分析的目的,提升了应用程序的处理成功率与处理效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116302086B_ABST
    Figure CN116302086B_ABST
Patent Text Reader

Abstract

The present disclosure provides a kind of application processing method, device, electronic equipment and readable storage medium, it is related to mutual benefit net technical field.Processing method of application includes: using preset acquisition command replaces switching user su command, then executes the preset acquisition command to obtain the root root authority of operating system;Run target application, use the shell tool to the target application is shelled, obtain target dex file;According to the source code corresponding to the target dex file is modified according to the processing target, and target source code is obtained;According to the target source code, the processing result of the target application is obtained.The present disclosure can improve the running success rate of application, and realizes the purpose of reverse analysis to application, improves the processing success rate and processing efficiency of application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of Internet technology, and provides a method, apparatus, electronic device, and readable storage medium for processing applications. Background Technology

[0002] With the increasing popularity of mobile devices, the mobile application industry, especially Android applications, has developed rapidly. However, this has also brought about increasingly prominent mobile security issues. Reverse engineering techniques can be used to analyze the functional flow of an application and tamper with its data code without knowing its source code. Summary of the Invention

[0003] According to a first aspect of this disclosure, a method for processing an application is provided, comprising: replacing the user switching command (su) with a preset acquisition command, and then executing the preset acquisition command to obtain root privileges of the operating system; running a target application, and using an unpacking tool to unpack the target application to obtain a target dex file; modifying the source code corresponding to the target dex file according to the processing target to obtain target source code; and obtaining the processing result of the target application according to the target source code.

[0004] According to a second aspect of this disclosure, an application processing apparatus is provided, comprising: an execution unit, configured to execute the preset acquisition command to acquire root privileges of an operating system after replacing the user switching command (su) with a preset acquisition command; an unpacking unit, configured to run a target application and unpack the target application using an unpacking tool to obtain a target dex file; a modification unit, configured to modify the source code corresponding to the target dex file according to the processing target to obtain target source code; and a processing unit, configured to obtain the processing result of the target application based on the target source code.

[0005] According to a third aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method as described above.

[0006] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform the method described above.

[0007] According to a fifth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described above.

[0008] As can be seen from the above technical solutions, this disclosure obtains root privileges of the operating system by executing a preset acquisition command with the same function as the su command, which can improve the success rate of application execution and achieve the purpose of reverse analysis of the application, thereby improving the processing success rate and processing efficiency of the application.

[0009] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0010] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0011] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure;

[0012] Figure 2 This is a schematic diagram according to the second embodiment of the present disclosure;

[0013] Figure 3 This is a schematic diagram according to the third embodiment of the present disclosure;

[0014] Figure 4 This is a schematic diagram according to the fourth embodiment of the present disclosure;

[0015] Figure 5 This is a block diagram of an electronic device used to implement the application processing method of the embodiments of this disclosure. Detailed Implementation

[0016] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and mechanisms are omitted in the following description.

[0017] Figure 1 This is a schematic diagram based on the first embodiment of this disclosure. (See diagram below.) Figure 1 As shown, the application processing method in this embodiment specifically includes the following steps:

[0018] S101. After replacing the user switching command with the preset acquisition command, execute the preset acquisition command to obtain root privileges of the operating system.

[0019] S102. Run the target application and use a depackaging tool to depack the target application to obtain the target dex file;

[0020] S103. Modify the source code corresponding to the target dex file according to the processing target to obtain the target source code;

[0021] S104. Based on the target source code, obtain the processing result of the target application.

[0022] The application processing method in this embodiment obtains root privileges of the operating system by executing a preset acquisition command with the same function as the su (switchuser) command. This avoids the problem that the target application will not run when the su command is detected in the operating system, thus improving the success rate of application execution. Furthermore, the target application is unpacked using the obtained root privileges to obtain the target dex file. Finally, the processing result of the target application is obtained based on the target dex file and the processing target, thus achieving the purpose of reverse engineering the application and improving the success rate and efficiency of application processing.

[0023] The application processing method in this embodiment is executed by a terminal device, which can be a mobile terminal capable of running the Android operating system, such as an Android phone or an Android emulator; the ROM of the terminal device in this embodiment can be a custom ROM.

[0024] In this embodiment, when S101 is executed, the default acquisition command of the su command is replaced to obtain root privileges of the operating system. That is, the default acquisition command has the same function as the su command.

[0025] In this embodiment, when executing S101 to replace the su command with a preset acquisition command, the su command in the operating system can be deleted first, for example, by deleting the file corresponding to the su command in the operating system. Then, the file corresponding to the preset acquisition command can be placed in the operating system so that the operating system can execute the preset acquisition command based on these files, thereby completing the acquisition of root privileges.

[0026] In other words, this embodiment obtains root privileges by executing a preset command, which can hide the su command in the operating system and avoid the problem that the application will not run when the su command is detected. Thus, while ensuring that the application runs successfully, it can also obtain root privileges in the operating system, thereby achieving the purpose of unpacking the application.

[0027] In this embodiment, after executing S101 to execute a preset acquisition command to obtain root privileges of the operating system, S102 is executed to run the target application, and the target application is unpacked using an unpacking tool to obtain the target dex file.

[0028] In this embodiment, when executing S102, the unpacking tool used can perform static unpacking (without actively calling the target application) or dynamic unpacking (with actively calling the target application) on the target application to achieve the purpose of obtaining the target dex file corresponding to the target application; the target dex file stores the Java source code of the target application.

[0029] In this embodiment, when executing S102 to unpack the target application using an unpacking tool, the optional implementation method is as follows: the target application is detected to determine whether it is packed; if the detection result indicates that the target application is packed, the step of unpacking the target application using an unpacking tool is executed.

[0030] In this embodiment, when executing S102 to run the target application, the following may also be included: a target attribute file is added to the operating system in advance. The target attribute file contains preset system attributes, such as preset device manufacturers, preset device versions, preset system compilation times, etc. During the operation of the target application, if a system attribute retrieval request is detected from the target application, the preset system attributes are retrieved from the target attribute file and returned to the target application. In this embodiment, the preset system attributes can be returned to the target application through kernel emulation.

[0031] In other words, this embodiment achieves the purpose of tampering with system attributes by adding an additional target attribute file to the operating system (i.e., both the initial attribute file and the target attribute file exist in the operating system). This makes the system attributes returned to the target application the preset attributes, rather than the initial system attributes saved in the initial attribute file, thereby avoiding the problem that the target application will exit when it determines that the current terminal device is an illegal device based on the returned system attributes.

[0032] In this embodiment, after obtaining the target dex file by executing S102, S103 is executed to modify the source code corresponding to the target dex file according to the processing target to obtain the target source code; wherein, the processing target is the modification target when modifying the source code, thereby obtaining the target source code corresponding to the processing target.

[0033] In this embodiment, when executing S103, the source code of the target application can first be obtained from the target dex file. For example, static analysis tools such as decompilation tools (jadx-gui, etc.) and / or dynamic debugging tools such as IDA can be used to obtain the source code. Then, specific code in the source code is modified according to the processing target, so that the modified source code is used as the target source code.

[0034] For example, if the source code corresponding to the target dex file includes code 1, code 2 and code 3, and if code 2 has been modified in this embodiment, then code 1, the modified code 2 and code 3 can be used as the target source code.

[0035] In this embodiment, when executing S103 to determine the processing target, the optional implementation method is as follows: obtain the program type of the target application, which can be a shopping application, a game application, a video application, etc.; determine the processing target according to the obtained program type, and there can be one or more processing targets corresponding to the same program type.

[0036] In this embodiment, when executing S103, the target can be obtained according to the correspondence between the program type and the processing target. For example, the processing target corresponding to a shopping application can be to remove the application's advertisements, the processing target corresponding to a game application can be to modify the application's login process, and the processing target corresponding to a video application can be to increase the user's points in the application.

[0037] In other words, this embodiment determines the processing target based on the program type of the target application, making the target source code obtained based on the processing target more compatible with the target application and improving the accuracy of the obtained target source code.

[0038] In this embodiment, when determining the processing target in S103, the following method can also be used: select a target page from the target application, such as selecting the login page of the target application as the target page; obtain the target component clicked by the user on the selected target page, such as the input box in the login page; determine the processing target based on the obtained target component, and the processing target corresponding to the same target component can be one or multiple.

[0039] In this embodiment, when executing S103, the target component can be obtained based on the correspondence between the target component and the processing target. For example, the processing target corresponding to the input box component in the login page can be to modify login information, and the processing target corresponding to the recharge button component in the mall page can be to increase the user's points, etc.

[0040] In other words, this embodiment determines the processing target based on the user's actual operation on the target page, so that the target source code obtained by modification is more in line with the user's actual usage needs, thereby improving the processing effect of the application.

[0041] In this embodiment, when executing S103 to modify the source code corresponding to the target dex file according to the processing target, the code information such as code name, code type, and code location can be determined first according to the processing target (for example, the code information can be determined according to a preset correspondence). Then, the source code to be modified can be obtained from the source code according to the information such as code name, code type, and code location. Finally, the modification method corresponding to the processing target can be used to modify the source code to be modified.

[0042] For example, if the code name of the source code to be modified is first determined to be "getjifen" based on the processing goal (e.g., increasing the user's points), then the source code corresponding to "getjiefen" is found in the source code, and finally the modification method corresponding to the processing goal is used (e.g., setting the return value of the source code to 10000), then the user's points in the modified target application will become 10000.

[0043] For another example, if the code name of the source code to be modified is first determined to be "getface" based on the processing target (e.g., modifying the login process of an application), then the source code to be modified corresponding to "getface" is found in the source code, and finally the modification method corresponding to the processing target is used (e.g., replacing the real-time captured face image with a preset face image, that is, setting the return value of the source code to a preset face image, which in this embodiment can be obtained from the target attribute file), then the modified target application will use the preset face image instead of the real-time captured face image for login.

[0044] In this embodiment, when executing S103, the source code corresponding to the target dex file can also be displayed to the user, and the user can then modify the selected source code segment to obtain the target source code.

[0045] In this embodiment, after executing S103 to obtain the target source code, S104 is executed to obtain the processing result of the target application based on the target source code.

[0046] In this embodiment, when executing S104 to obtain the processing result of the target application based on the target source code, the Xposed module of the target application can be written according to the target source code. That is, the Xposed module is the processing result of the target application. The Xposed module is used to run in the Xposed framework to implement the functions of the corresponding application. For example, the Xposed module of application A uses a preset face image instead of the real-time captured face image when logging in.

[0047] In this embodiment, when executing S104 to obtain the processing result of the target application based on the target source code, the target source code can also be repackaged, and the repackaged result can be used as the processing result of the target application. The repackaged result implements the corresponding application function. For example, the repackaged result of application A uses a preset face image instead of the real-time captured face image when logging in.

[0048] In addition, when executing S104 to obtain the processing result of the target application based on the target source code, this embodiment can also obtain the APIs called by the target application during its operation, and then write and / or repackage the Xposed module based on the target source code and the called APIs.

[0049] After executing S104 to obtain the processing result of the target application, this embodiment can also run the obtained processing result to perform security verification on the obtained processing result and obtain the security level of the target application; for example, if the target application can be successfully logged in through a preset face image, the security level of the target application is determined to be high-risk level, otherwise the security level of the target application is determined to be low-risk level.

[0050] It is understood that the application processing method provided in this embodiment can be registered as a system service class in the operating system, and the SELinux in the system can be modified to make the system service class effective. Thus, when the operating system starts, the application processing method provided in this embodiment will be started, such as replacing the su command with a preset acquisition command, unpacking the running target application, and obtaining preset system attributes from the target attribute file.

[0051] Figure 2 This is a schematic diagram according to the second embodiment of this disclosure. (See diagram below.) Figure 2 As shown, the application processing device 200 of this embodiment includes:

[0052] Execution unit 201 is used to execute the preset acquisition command to obtain root privileges of the operating system after replacing the user switching command with the preset acquisition command;

[0053] The unpacking unit 202 is used to run the target application and use an unpacking tool to unpack the target application to obtain the target dex file;

[0054] Modification unit 203 is used to modify the source code corresponding to the target dex file according to the processing target, so as to obtain the target source code;

[0055] Processing unit 204 is used to obtain the processing result of the target application based on the target source code.

[0056] Execution unit 201 replaces the default acquisition command of the su command, which is used to acquire root privileges of the operating system. That is, the default acquisition command has the same function as the su command.

[0057] When the execution unit 201 replaces the su command with a preset acquisition command, it can first delete the su command in the operating system, and then place the file corresponding to the preset acquisition command into the operating system so that the operating system can execute the preset acquisition command based on these files, thereby completing the acquisition of root privileges.

[0058] In other words, the execution unit 201 obtains root privileges by executing a preset command, which can hide the su command in the operating system and avoid the problem that the application will not run when the su command is detected. Thus, while ensuring that the application runs successfully, it can also obtain root privileges of the operating system, thereby achieving the purpose of unpacking the application.

[0059] In this embodiment, after the execution unit 201 executes a preset acquisition command to obtain root privileges of the operating system, the unpacking unit 202 runs the target application and uses an unpacking tool to unpack the target application to obtain the target dex file.

[0060] The unpacking tool used by the unpacking unit 202 can perform static unpacking (without actively calling the target application) or dynamic unpacking (with actively calling the target application) on the target application to obtain the target dex file corresponding to the target application; the target dex file stores the Java source code of the target application.

[0061] When the unpacking unit 202 uses an unpacking tool to unpack the target application, the optional implementation method is as follows: detect the target application; if the detection result determines that the target application is packed, execute the step of using the unpacking tool to unpack the target application.

[0062] The application processing device 200 of this embodiment may further include a setting unit 205, which is used to perform the following: pre-add a target attribute file to the operating system, the target attribute file containing preset system attributes; during the operation of the target application, if a system attribute acquisition request is detected from the target application, the preset system attributes are acquired from the target attribute file and returned to the target application; the setting unit 205 may return the preset system attributes to the target application through kernel emulation.

[0063] In other words, the setting unit 205 achieves the purpose of tampering with system attributes by adding an additional target attribute file to the operating system (i.e., both the initial attribute file and the target attribute file exist in the operating system). This makes the system attributes returned to the target application the preset attributes, rather than the initial system attributes saved in the initial attribute file, thereby avoiding the problem that the target application will exit when it determines that the current terminal device is an illegal device based on the returned system attributes.

[0064] In this embodiment, after the unpacking unit 202 obtains the target dex file, the modification unit 203 modifies the source code corresponding to the target dex file according to the processing target to obtain the target source code.

[0065] Modification unit 203 can first obtain the source code of the target application from the target dex file, and then modify specific code in the source code according to the processing target, so as to use the modified source code as the target source code.

[0066] When determining the processing target, the modification unit 203 can adopt the following optional implementation methods: obtain the program type of the target application; determine the processing target based on the obtained program type. There can be one or more processing targets corresponding to the same program type.

[0067] The modification unit 203 can be obtained according to the correspondence between the program type and the processing target. For example, the processing target corresponding to a shopping application can be to remove the application's advertisements, the processing target corresponding to a game application can be to modify the application's login process, and the processing target corresponding to a video application can be to increase the user's points in the application.

[0068] In other words, the modification unit 203 determines the processing target based on the program type of the target application, so that the target source code obtained based on the processing target is more compatible with the target application, thereby improving the accuracy of the obtained target source code.

[0069] When determining the processing target, the modification unit 203 may also use the following methods: select a target page from the target application; obtain the target component clicked by the user on the selected target page; determine the processing target based on the obtained target component. There may be one or more processing targets corresponding to the same target component.

[0070] The modification unit 203 can obtain the target based on the correspondence between the target component and the processing target. For example, the processing target corresponding to the input box component on the login page can be to modify login information, and the processing target corresponding to the recharge button component on the mall page can be to increase the user's points.

[0071] In other words, the modification unit 203 determines the processing target based on the user's actual operation on the target page, so that the target source code obtained through modification is more in line with the user's actual usage needs, thereby improving the processing effect of the application.

[0072] When modifying the source code corresponding to the target dex file according to the processing target, the modification unit 203 can first determine the code information such as code name, code type, and code location according to the processing target (for example, determine the code information according to the preset correspondence). Then, it can obtain the source code to be modified from the source code according to the code name, code type, and code location. Finally, it can use the modification method corresponding to the processing target to modify the source code to be modified.

[0073] Modification unit 203 can also display the source code corresponding to the target dex file to the user, who can then modify the selected source code segment to obtain the target source code.

[0074] In this embodiment, after the modification unit 203 obtains the target source code, the processing unit 204 obtains the processing result of the target application based on the target source code.

[0075] When the processing unit 204 obtains the processing result of the target application based on the target source code, it can write a corresponding modified Xposed module of the target application based on the target source code. That is, the Xposed module is the processing result of the target application. The Xposed module is used to run in the Xposed framework to implement the functions of the corresponding application.

[0076] When the processing unit 204 obtains the processing result of the target application based on the target source code, it can also repackage the target source code and use the repackaged result as the processing result of the target application; the repackaged result implements the corresponding application function.

[0077] In addition, when the processing unit 204 obtains the processing result of the target application based on the target source code, it can also obtain the APIs called by the target application during its operation, and then write and / or repackage the Xposed module based on the target source code and the APIs called.

[0078] After obtaining the processing result of the target application, the processing unit 204 can also run the obtained processing result to perform security verification on the obtained processing result and obtain the security level of the target application; for example, if the target application can be successfully logged in through a preset face image, the security level of the target application is determined to be high-risk level, otherwise the security level of the target application is determined to be low-risk level.

[0079] Figure 3 This is a schematic diagram according to the third embodiment of the present disclosure. Figure 3 The flowchart shown in this embodiment illustrates the application processing process: S301, Execute a preset acquisition command to obtain root privileges of the operating system; S302, Run the target application and unpack the target application (e.g., using a preset unpacking tool) to obtain the target dex file; S303, Analyze the interface of the target application to select the target page; S304, Determine the processing target based on the target component clicked by the user on the target page; S305, Modify the source code obtained by parsing the target dex file (through static analysis and dynamic debugging) according to the processing target to obtain the target source code; S306, Repackage the target source code or generate an Xposed module based on the target source code to complete the processing of the target application.

[0080] Figure 4 This is a schematic diagram according to the fourth embodiment of the present disclosure. Figure 4 The flowchart of this embodiment for security verification based on the processing results of the target application is shown: S401, determine face hijacking (i.e., using a preset face image instead of a real-time captured face image for program login) as the processing target; S402, process the target application to obtain the repackaged result of the target application; S403, run the repackaged result of the target application; S404, determine the security level of the target application based on the running result. If the repackaged result allows login, the security level of the target application is determined to be high-risk; if the repackaged result fails to allow login, the security level of the target application is determined to be low-risk.

[0081] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0082] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0083] like Figure 5 The diagram shown is a block diagram of an electronic device for processing an application according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0084] like Figure 5 As shown, device 500 includes a computing unit 501, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 502 or a computer program loaded from storage unit 508 into random access memory (RAM) 503. RAM 503 may also store various programs and data required for the operation of device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.

[0085] Multiple components in device 500 are connected to I / O interface 505, including: input unit 506, such as keyboard, mouse, etc.; output unit 507, such as various types of displays, speakers, etc.; storage unit 508, such as disk, optical disk, etc.; and communication unit 509, such as network card, modem, wireless transceiver, etc. Communication unit 509 allows device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0086] The computing unit 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as application processing methods. For example, in some embodiments, the application processing methods may be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 508.

[0087] In some embodiments, part or all of the computer program may be loaded and / or installed onto the device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by computing unit 501, one or more steps of the application processing method described above may be performed. Alternatively, in other embodiments, computing unit 501 may be configured to execute the application processing method by any other suitable means (e.g., by means of firmware).

[0088] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.

[0089] Program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable application processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0090] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0091] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for showing information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0092] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0093] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service system that addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.

[0094] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0095] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for processing an application, comprising: After replacing the user switching command with the preset acquisition command, execute the preset acquisition command to obtain root privileges in the operating system; Run the target application, and use a depackaging tool to depack the target application to obtain the target dex file; Modify the source code corresponding to the target dex file according to the processing target to obtain the target source code; Based on the target source code, the processing result of the target application is obtained; The step of replacing the user switching command with a preset command includes: Delete the file in the operating system corresponding to the su command; The file corresponding to the preset acquisition command is placed in the operating system so that the operating system can execute the preset acquisition command according to the placed file; It also includes, A target attribute file is pre-added to the operating system, and the target attribute file contains preset system attributes; During the operation of the target application, if a system attribute retrieval request is detected from the target application, the preset system attributes obtained from the target attribute file are returned to the target application, instead of the initial system attributes obtained from the initial attribute file. Determining the processing objective includes: Select the target page from the target application; Retrieve the target component clicked by the user on the target page; Based on the correspondence between components and processing targets, the processing target corresponding to the target component is determined.

2. The method according to claim 1, wherein, The process of using a depackaging tool to unpack the target application includes: The target application is detected; If the detection result indicates that the target application is packed, then the step of using a depackaging tool to depack the target application is performed.

3. The method according to claim 1, wherein, Determining the processing objective includes: Obtain the application type of the target application; The processing target is determined based on the program type.

4. The method according to claim 1, wherein, The modification of the source code corresponding to the target dex file according to the processing target includes: Determine code information based on the processing objective; Based on the code information, obtain the source code to be modified from the source code; Modify the source code to be modified using the modification method corresponding to the processing target.

5. A processing device for an application, comprising: An execution unit is used to execute the preset acquisition command to obtain root privileges of the operating system after replacing the user switching command with a preset acquisition command; The unpacking unit is used to run the target application, use an unpacking tool to unpack the target application, and obtain the target dex file; The modification unit is used to modify the source code corresponding to the target dex file according to the processing target, so as to obtain the target source code; A processing unit is configured to obtain the processing result of the target application based on the target source code; Specifically, when the execution unit replaces the user switching command (su) with a preset acquisition command, it performs the following: Delete the file in the operating system corresponding to the su command; The file corresponding to the preset acquisition command is placed in the operating system so that the operating system can execute the preset acquisition command according to the placed file; It also includes a setup unit for execution: A target attribute file is pre-added to the operating system, and the target attribute file contains preset system attributes; During the operation of the target application, if a system attribute retrieval request is detected from the target application, the preset system attributes obtained from the target attribute file are returned to the target application, instead of the initial system attributes obtained from the initial attribute file. When determining the processing target, the modification unit specifically performs the following: Select the target page from the target application; Retrieve the target component clicked by the user on the target page; Based on the correspondence between components and processing targets, the processing target corresponding to the target component is determined.

6. The apparatus according to claim 5, wherein, When the unpacking unit uses an unpacking tool to unpack the target application, it specifically performs the following: The target application is detected; If the detection result indicates that the target application is packed, then the step of using a depackaging tool to depack the target application is performed.

7. The apparatus according to claim 5, wherein, When determining the processing target, the modification unit specifically performs the following: Obtain the application type of the target application; The processing target is determined based on the program type.

8. The apparatus according to claim 5, wherein, When the modification unit modifies the source code corresponding to the target dex file according to the processing target, it specifically performs the following: Determine code information based on the processing objective; Based on the code information, obtain the source code to be modified from the source code; Modify the source code to be modified using the modification method corresponding to the processing target.

9. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-4.

11. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-4.