Java application program tamper-proof judgment method, compilation method and device

By using signature information when loading a Java application, it determines whether it has been tampered with, and alerts or exits when tampering is detected, the problem that Java applications are prone to tampering in the existing technology is solved, and effective security protection for the application is achieved .

CN114357387BActive Publication Date: 2025-02-21HANGZHOU TUYA INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111638177.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2025-02-21
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively prevent Java applications from being tampered with, resulting in the running of Java applications after encryption protection that may still pose a threat to the program run side.

Method used

Determine whether the application has been modified by using signature information during Java application loading, and alert the user or exit when tampering is detected. The specific steps include loading the signature information of the application, comparing the consistency with the preset signature information, and if it is inconsistent, it is determined that the application has been tampered with.

Benefits of technology

It realizes that the Java application is pre-judged before it runs, thereby avoiding the threat to the program run side of the tampered Java application, and enhancing the security of the application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114357387B_ABST
    Figure CN114357387B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer security technology, and in particular to a tamper-proof judgment method, generation method and device for a Java application, the method comprising: judging whether the Java application has been modified by signature information during the loading of the Java application; and alerting the user and / or exiting the Java application when the Java application has been modified. The method realizes pre-judgment of whether the Java application has been tampered with before the Java application is run, that is, it can be judged whether the Java application has been tampered with before the Java application is run, and it can avoid the threat posed to the program running end by the tampered Java application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer security technology, and in particular to a java application program tamper-proof judgment method, compilation method and device. Background Art

[0002] The Java platform is an open source development environment. Therefore, Java applications developed based on the Java platform are easily modified by hackers. Running Java applications modified by hackers will pose a great threat to the program running end.

[0003] In order to protect the program running end, the existing technology is to encrypt and protect Java applications, that is, to protect the Java source code required for actual operation in the Java application. In order to protect the Java source code and prevent the Java source code from being modified by hackers, the existing technology usually encrypts the Java source code as a whole, so as to greatly increase the workload and difficulty of cracking the Java application, thereby preventing the Java source code from being modified by hackers to a certain extent. However, simple encryption protection cannot completely prevent the Java application from being cracked. Therefore, running the encrypted Java application may still pose a great threat to the program running end. Summary of the invention

[0004] The embodiments of the present application provide a java application anti-tampering judgment method, a compilation method and a device, which can pre-judge whether the java application has been tampered with before the java application is run, and further determine whether the java application has been tampered with before the java application is run, thereby avoiding the threat posed to the program running end by the running tampered Java application.

[0005] In a first aspect, an embodiment of the present application provides a method for determining whether a Java application is tamper-proof, the method comprising:

[0006] During the process of loading the Java application, judging whether the Java application has been modified by using the signature information;

[0007] When the Java application is modified, the user is warned and / or the application is exited.

[0008] Optionally, determining whether the Java application is modified by signature information during the process of loading the Java application includes:

[0009] Loading the signature information in the Java application;

[0010] Determine whether the signature information in the Java application is consistent with the preset signature information;

[0011] When the signature information in the Java application is consistent with the preset signature information, it is determined that the Java application has not been modified; when the signature information in the Java application is inconsistent with the preset signature information, it is determined that the Java application has been modified.

[0012] Optionally, the loading of the signature information in the Java application includes:

[0013] Load the signature information of the target class file in the Java application.

[0014] Optionally, the loaded Java application includes at least one class file, and the signature information of the target class file in the loaded Java application includes:

[0015] Load the class file in the Java application and determine whether the class file is in the target jar package path;

[0016] When the class file is in the target jar package path, the class file is determined to be a target class file, and the signature information of the target class file is loaded.

[0017] Optionally, after loading the class file in the Java application and determining whether the class file is in the target jar package path, the method further includes:

[0018] When the class file is not in the target jar package path, the class file is a third-party class file, and the third-party class file is sent to a program runner, which is used to run the third-party class file.

[0019] Optionally, the loading of signature information of a target class file in a Java application includes:

[0020] The target class file is loaded through a preset obfuscation algorithm and parsed into bytecode and signature information.

[0021] Optionally, the determining whether the signature information in the Java application is consistent with the preset signature information includes:

[0022] Decryption is used to determine whether the signature information in the target class file is consistent with the preset signature information.

[0023] In a second aspect, an embodiment of the present application provides a tamper-proof compilation method for a Java application, the method comprising:

[0024] Add signature information to the Java source program to generate a Java application. During the loading of the Java application, determine whether the Java application has been modified by using the signature information. When the Java application has been modified, warn the user and / or exit.

[0025] Optionally, adding signature information to the Java source program to generate a Java application program includes:

[0026] Parse the class files under the target jar package path in the java source program;

[0027] The signature information is confused with the bytecode of the class file under the target jar package path to generate a target class file;

[0028] The target class file is used to replace the class file under the target jar package path in the java source program to generate a java application.

[0029] In a third aspect, an embodiment of the present application provides a processing device, characterized in that it includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements the steps of a method for determining the anti-tampering of a Java application and a method for compiling the anti-tampering of a Java application as mentioned above.

[0030] Compared with the prior art, the beneficial effect of the present application is: by judging whether a Java application has been modified, when the Java application has not been modified, the Java application is sent to the program runner, and the program runner is used to run the Java application, and when the Java application has been modified, the user is warned. Before the Java application is run, the loader pre-judgments whether the Java application has been tampered with, that is, it can judge whether the Java application has been tampered with before the Java application is run, and it can avoid the threat posed to the program running end by running the tampered Java application. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The present application will illustrate the implementation methods in conjunction with the accompanying drawings. The accompanying drawings of the present application are only used to describe the embodiments for the purpose of demonstration. Without departing from the principles of the present application, those skilled in the art can easily make other embodiments according to the steps described below through the following description.

[0032] Figure 1 A schematic diagram of a processing device for determining anti-tampering of a Java application in one embodiment of the present application;

[0033] Figure 2 This is a flowchart of a method for determining anti-tampering of a Java application in one embodiment of the present application;

[0034] Figure 3 A flowchart of a method for determining anti-tampering of a Java application in one embodiment of the present application;

[0035] Figure 4 This is a flowchart of a tamper-proof compilation process of a Java source program in one embodiment of the present application;

[0036] Figure 5 The present invention provides an execution process of a method for determining whether a Java application is tamper-proof in an embodiment of the present invention;

[0037] Figure 6 A flowchart of a method for determining anti-tampering of a Java application in one embodiment of the present application;

[0038] Figure 7 This is a schematic diagram of the structure of a tamper-proof compilation device for a Java application in one embodiment of the present application;

[0039] Figure 8 This is a schematic diagram of the structure of a java application program anti-tampering judgment device in one embodiment of the present application;

[0040] Fig. 9 This is a schematic diagram of the structure of an embodiment of the computer storage medium of the present application. DETAILED DESCRIPTION

[0041] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It will be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only some but not all structures related to the present application are shown in the drawings. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0042] The terms "first", "second", etc. in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0043] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0044] In order to better understand the technical solutions provided by the embodiments of the present application, some embodiments of the present application are described in detail below.

[0045] The method for determining the tamper-proofing of a Java application provided in the embodiment of the present application can be applied as follows: Figure 1 The processing device for judging the anti-tampering of a Java application is shown. The processing device for judging the anti-tampering of a Java application includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the processing device of the Java application is used to provide computing and control capabilities. The memory of the processing device for judging the anti-tampering of a Java application includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the processing device for judging the anti-tampering of a Java application is used to store data used or generated during the execution of the judgment method for judging the anti-tampering of a Java application. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the Java application is executed by the processor, a judgment method for judging the anti-tampering of a Java application is implemented. In this example, the computer device can be a Java compilation device for executing Java program compilation, or a Java running device for implementing Java program running processing.

[0046] See also Figure 2 This is a flowchart of a method for determining whether a Java application is tampered with in an embodiment of the present application, which is applied to a loader, which is connected to a program runner. Before running a target Java application, a user can verify the Java application in advance through a custom loader to determine whether the Java application has been tampered with. The method includes the following steps:

[0047] Step 201, during the process of loading the Java application, judging whether the Java application has been modified by signature information;

[0048] Before a Java application is run, it is necessary to detect the Java application first, and then determine whether the Java application has been modified. Specifically, the detection process includes detecting the signature information of the Java application, and then determining whether the signature information of the Java application is consistent with the pre-stored signature information. The file size value of the Java application can also be detected, and then determine whether the file size value of the Java application is consistent with the pre-stored comparison value. The modification time of the Java application can also be detected, and then determine whether the modification time of the Java application is the pre-stored modification time corresponding to the Java application.

[0049] In an embodiment of the present application, step 201 includes the following sub-steps:

[0050] Sub-step S11, loading the signature information in the Java application;

[0051] In the tamper-proof compilation process of the Java source program, the compiler can generate signature information for the Java source program through the encrypt (private key, digest algorithm) algorithm, and confuse the signature information with the Java source program to generate a Java application.

[0052] After loading the Java application, the Java application can be decrypted using the decrypt (public key, digest algorithm) algorithm, and then the signature of the Java application can be loaded.

[0053] Sub-step S12, determining whether the signature information in the Java application is consistent with the preset signature information;

[0054] Sub-step S13, when the signature information in the Java application is consistent with the preset signature information, determining that the Java application has not been modified;

[0055] Sub-step S14, when the signature information in the Java application is inconsistent with the preset signature information, it is determined that the Java application is modified.

[0056] In the embodiment of the present application, the Java application is verified through signature information, which increases the difficulty of determining whether the Java application has been tampered with and enhances security.

[0057] When the Java application is not modified, sending the Java application to the program runner, the program runner is used to run the Java application;

[0058] When the Java application has not been modified, the class file of the Java application is sent to the program runner. When the program runner needs to use a certain class, the program runner will load the corresponding class file in the Java application, create the corresponding class object, load the class file into the memory of the program runner, and then complete the operation of the Java application.

[0059] Step 202: when the Java application is modified, alert the user and / or exit.

[0060] When a Java application is modified, the Java application cannot be run, and the user needs to be alerted to remind the user that there may be a problem with the source of the Java application. Specifically, the user can be alerted by directly playing an alarm sound that the user can recognize, or by sending an alarm message to the user's corresponding mobile terminal, thereby ensuring timely alerting of the user and / or exit.

[0061] The java application anti-tampering judgment method of the present application judges whether the java application has been modified by signature information during the loading process of the java application, and warns the user and / or exits when the java application has been modified. The loader pre-judges whether the java application has been tampered with before the java application runs, that is, it can judge whether the java application has been tampered with before the java application runs, and can avoid the threat posed to the program running end by the running of the tampered Java application.

[0062] See also Figure 3 The present invention is a flowchart of a method for determining whether a Java application is tamper-proof in accordance with an embodiment of the present invention. The method comprises the following steps:

[0063] Step 301, loading the signature information of the target class file in the Java application;

[0064] In the tamper-proof compilation process of the Java source program, the compiler can generate signature information for the Java source program through the encryption (private key, digest algorithm) algorithm, and confuse the signature information with the target class bytecode in the source program to generate a target class file, replace the target class bytecode with the target class file, and then obtain a Java application.

[0065] After loading the Java application, the target class file can be decrypted using the decrypt (public key, digest algorithm) algorithm, and then the signature of the Java application can be loaded.

[0066] In an embodiment of the present application, step 301 includes:

[0067] The target class file is parsed into bytecode and signature information through a preset obfuscation algorithm.

[0068] Obfuscation algorithm is a source code protection method. Through various transformation methods, the originally simple and easy-to-understand source code is transformed into complex and difficult-to-understand code. This can resist the static reverse analysis of the source code of the software product by reverse analysts, making it take a lot of time and energy for them to roughly understand the principles of the code. Ultimately, it can protect the core logic of the software product from being mastered by attackers and avoid irreparable losses. Obfuscation algorithm can be used for class bytecode, and can also be used for intermediate code compiled from class bytecode.

[0069] In an embodiment of the present application, the Java application includes at least one class file, and step 301 includes the following sub-steps:

[0070] Sub-step S21, loading the class file in the Java application, and determining whether the class file is in the target jar package path;

[0071] Among them, jar (Java ARchive) is a platform-independent file format. A jar package can combine multiple files into one file package. A java application can contain one or more jar packages.

[0072] like Figure 4 In the tamper-proof compilation process of the Java source program, the compiler can parse the Java source program and search for all jar packages in the Java source program, and then filter out the target class file under the target jar package path, read the target class bytecode from the target class file, confuse the signature information with the target class bytecode, generate the target class file, replace the target class bytecode with the target class file, and repeat the above steps until all the target class files under the target jar package path are processed, and then the Java application is obtained.

[0073] Therefore, this application is not for all class files in the Java application, but for a specific target class file, which is located under the target jar package path. After loading the class file, it is necessary to first determine whether the jar package path where the class file is located is the target jar package path, that is, to determine whether the class file is under the target jar package path.

[0074] Sub-step S22, when the class file is in the target jar package path, determine that the class file is a target class file, and load the signature information of the target class file.

[0075] When the class file is in the target jar package path, the loaded class file is the target class file. At this time, the target class file is parsed into bytecode and signature information through the preset obfuscation algorithm.

[0076] Furthermore, after the sub-step S22, the following steps are further included:

[0077] When the class file is not in the target jar package path, the class file is a third-party class file, and the third-party class file is sent to the program runner, and the program runner is used to run the third-party class file. In the embodiment of the present application, the third-party code that does not need to be protected can be run directly, which reduces the load of the loader judgment.

[0078] In an embodiment of the present application, if the loaded class file is not under the target jar package path, then the loaded class file is not the target class file that needs to be tamper-proof, but a third-party class file. Whether the third-party class file is tampered with will not pose a threat to the program running end. Therefore, the third-party class file can be sent to the program runner, and the program runner runs the third-party class file, thereby realizing the classification of class files through the class file judgment algorithm under the target jar package path, and isolating the target class files and third-party codes that need to be tamper-proof.

[0079] Step 302, determining whether the signature information in the Java application is consistent with the preset signature information;

[0080] In an embodiment of the present application, step 302 includes:

[0081] Decryption is used to determine whether the signature information in the target class file is consistent with the preset signature information.

[0082] Step 303, when the signature information in the Java application is consistent with the preset signature information, it is determined that the Java application has not been modified;

[0083] Step 304: When the signature information in the Java application is inconsistent with the preset signature information, it is determined that the Java application is modified.

[0084] Step 305, when the Java application is not modified, sending the target class file to the program runner, the program runner is used to run the target class file;

[0085] Step 306: When the Java application is modified, alert the user and / or exit.

[0086] In an embodiment of the present application, by loading the signature information of the target class file in the Java application, it is determined whether the signature information of the Java application is consistent with the pre-stored signature information; and then it is possible to determine whether the target class file has been modified, thereby realizing the function of monitoring or determining whether the program has been tampered with. Moreover, since it is not a general judgment on the entire Java application, but a judgment on each target class file, the specific class file that has been tampered with can be located, which can be better used for later maintenance.

[0087] In order to facilitate the understanding of the above embodiments, a specific example is given below for illustration. It should be noted that the specific example does not constitute a limitation on the embodiments of the present application. Figure 5 The figure shows the execution process of the java application anti-tampering judgment method. The specific execution steps are as follows:

[0088] 1) The program runner specifies a custom loader to load the class files in the Java application;

[0089] 2) Determine whether the class file is in the target jar package path;

[0090] 3) If the class file is in the target jar package path, the class file is the target class file, read the target class file, parse the bytecode data and signature information from the target class file through the preset obfuscation algorithm, and verify whether the bytecode data and signature information are consistent through decrypt (public key, digest algorithm). If they are inconsistent, the target class file has been tampered with, and an alarm is given to the user and the program is exited. If they are consistent, the program runner loads the target class file;

[0091] 4) If the class file is not in the specified package path, the program runner loads the class file.

[0092] See also Figure 6 , is a flowchart of a tamper-proof compilation method for a Java application provided by an embodiment of the present application, the method comprising the following steps:

[0093] Step 601, adding signature information to the Java application, and determining whether the Java application has been modified by the signature information during the loading of the Java application; when the Java application has been modified, alerting the user and / or exiting.

[0094] In an embodiment of the present application, step 601 includes the following sub-steps:

[0095] Sub-step S31, parsing the class file under the target jar package path in the java source program;

[0096] Sub-step S32, confusing the signature information with the bytecode of the class file under the target jar package path to generate a target class file;

[0097] Sub-step S33, using the target class file to replace the class file under the target jar package path in the Java source program to generate a Java application.

[0098] This method is a tamper-proof compilation method for a Java application before executing a tamper-proof judgment method for a Java application. Since it is explained in the embodiment of the tamper-proof compilation method for a Java application, no further explanation is given here.

[0099] See also Figure 7 , is a structural diagram of a java application anti-tampering judgment device provided by an embodiment of the present application, which is applied to a loader, the loader is connected to a program runner, and the device includes:

[0100] A modification judgment module 701 is used to judge whether the Java application has been modified according to the signature information during the loading of the Java application;

[0101] The warning module 702 is used to warn the user and / or exit when the Java application is modified.

[0102] In an embodiment of the present application, the modification determination module 701 includes the following submodules:

[0103] A signature information loading submodule, used to load the signature information in the Java application;

[0104] The signature information judgment submodule is used to judge whether the signature information in the Java application is consistent with the preset signature information. When the signature information in the Java application is consistent with the preset signature information, it is judged that the Java application has not been modified; when the signature information in the Java application is inconsistent with the preset signature information, it is judged that the Java application has been modified.

[0105] In one embodiment of the present application, the signature information loading submodule includes:

[0106] The signature information loading unit is used to load the signature information of the target class file in the Java application.

[0107] In one embodiment of the present application, the loaded Java application includes at least one class file, and the signature information loading unit includes:

[0108] The target jar package path judgment subunit is used to load the class file in the java application and judge whether the class file is under the target jar package path;

[0109] The target class file loading subunit is used to determine that the class file is a target class file when the class file is in the target jar package path, and load the signature information of the target class file.

[0110] In one embodiment of the present application, the device further includes:

[0111] A third-party running module is used to send the third-party class file to a program runner when the class file is not in the target jar package path and the class file is a third-party class file. The program runner is used to run the third-party class file.

[0112] In one embodiment of the present application, the signature information loading unit includes:

[0113] The obfuscation algorithm loading subunit is used to load the target class file through a preset obfuscation algorithm and parse it into bytecode and signature information.

[0114] In one embodiment of the present application, the signature information determination submodule includes:

[0115] The decrypt judgment unit is used to judge whether the signature information in the target class file is consistent with the preset signature information through decryption.

[0116] The java application anti-tampering judgment method of the present application judges whether the java application has been modified. If the java application has not been modified, the java application is sent to the program runner, and the program runner is used to run the java application. When the java application is modified, the user is warned. Before the java application is run, the loader pre-judges whether the java application has been tampered with, that is, it can judge whether the java application has been tampered with before the java application is run, which can avoid the threat of running the tampered Java application to the program running end.

[0117] See also Figure 8 , is a schematic diagram of the structure of a tamper-proof compilation device for a Java application provided in an embodiment of the present application, the device comprising:

[0118] The signature information adding module 801 is used to add signature information to the Java source program, generate a Java application, and determine whether the Java application has been modified based on the signature information during the loading of the Java application; when the Java application has been modified, alert the user and / or exit.

[0119] In an embodiment of the present application, the signature information adding module 801 includes:

[0120] The class file parsing submodule is used to parse the class file under the target jar package path in the java source program;

[0121] The obfuscation submodule is used to confuse the signature information with the bytecode of the class file under the target jar package path to generate a target class file;

[0122] The target class file replacement submodule is used to use the target class file to replace the class file under the target jar package path in the Java source program to generate a Java application.

[0123] The present application also provides a computer storage medium, such as Fig. 9 As shown, the computer storage medium 900 is used to store a computer program 91, and the computer program can be executed to implement the steps of the positioning method in the above embodiment.

[0124] The method involved in the positioning method embodiment of the present application, when implemented in the form of a software functional unit and sold or used as an independent product, can be stored in the device 700, such as a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0125] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for determining whether a Java application is tamper-proof, characterized in that: The method comprises: During the process of loading the Java application, judging whether the Java application has been modified by using the signature information; When the Java application is modified, alert the user and / or exit; The determining whether the Java application is modified by using the signature information during the loading of the Java application comprises: Loading the signature information in the Java application; Determine whether the signature information in the Java application is consistent with the preset signature information; When the signature information in the Java application is consistent with the preset signature information, it is determined that the Java application has not been modified; when the signature information in the Java application is inconsistent with the preset signature information, it is determined that the Java application has been modified; The loading of the signature information in the Java application comprises: Load the signature information of the target class file in the Java application; The loaded Java application includes at least one class file, and the signature information of the target class file in the loaded Java application includes: Load the class file in the Java application and determine whether the class file is in the target jar package path; When the class file is in the target jar package path, determine that the class file is a target class file, and load the signature information of the target class file; When the class file is not in the target jar package path, the class file is a third-party class file, and the third-party class file is sent to a program runner, which is used to run the third-party class file.

2. The method for determining the tamper-proofing of a Java application according to claim 1, characterized in that: The signature information of the target class file in the loaded Java application includes: The target class file is loaded through a preset obfuscation algorithm and parsed into bytecode and signature information.

3. The method for determining the tamper-proofing of a Java application according to claim 1, characterized in that: The determining whether the signature information in the Java application is consistent with the preset signature information includes: Decryption is used to determine whether the signature information in the target class file is consistent with the preset signature information.

4. A tamper-proof compilation method for a Java application, characterized in that: The method comprises: Add signature information to a Java source program to generate a Java application, and determine whether the Java application has been modified by using the signature information during the loading of the Java application; and when the Java application has been modified, alert the user and / or exit; The determining whether the Java application is modified by using the signature information during the loading of the Java application comprises: Loading the signature information in the Java application; Determine whether the signature information in the Java application is consistent with the preset signature information; When the signature information in the Java application is consistent with the preset signature information, it is determined that the Java application has not been modified; when the signature information in the Java application is inconsistent with the preset signature information, it is determined that the Java application has been modified; The loading of the signature information in the Java application comprises: Load the signature information of the target class file in the Java application; The loaded Java application includes at least one class file, and the signature information of the target class file in the loaded Java application includes: Load the class file in the Java application and determine whether the class file is in the target jar package path; When the class file is in the target jar package path, determine that the class file is a target class file, and load the signature information of the target class file; When the class file is not in the target jar package path, the class file is a third-party class file, and the third-party class file is sent to a program runner, which is used to run the third-party class file.

5. The tamper-proof compilation method of a Java application according to claim 4, characterized in that: The step of adding signature information to the Java source program and generating a Java application program includes: Parse the class files under the target jar package path in the java source program; The signature information is confused with the bytecode of the class file under the target jar package path to generate a target class file; The target class file is used to replace the class file under the target jar package path in the java source program to generate a java application.

6. A processing device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for determining whether the Java application is tamper-proof and a method for generating a Java application as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method for guaranteeing self-security of JAVA program

    CN104200137A

  • Java program security processing method and device, computer equipment and storage medium

    CN113656765A