Supercharge Your Innovation With Domain-Expert AI Agents!

Java program protection method, apparatus, device, and readable storage medium

A technology for program protection and storage media, which is applied in program/content distribution protection, electronic digital data processing, instruments, etc., and can solve problems such as inability to load Class files, compatibility issues, and destruction of Java program compatibility.

Inactive Publication Date: 2019-03-12
HANGZHOU TUYA INFORMATION TECH CO LTD
View PDF7 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] Although this encryption of the entire Class file can prevent decompilation of the Class file, this scheme has serious compatibility issues
Specifically, because many frameworks and containers now scan the contents of Class files before they are loaded by ClassLoader to achieve some specific functions (such as security checks, etc.), when these frameworks or containers scan encrypted Class files, they will An error will be reported, and the Class file cannot be loaded, which destroys the compatibility of the Java program

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Java program protection method, apparatus, device, and readable storage medium
  • Java program protection method, apparatus, device, and readable storage medium
  • Java program protection method, apparatus, device, and readable storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0049] Please refer to figure 1 , figure 1 It is a flow chart of a Java program protection method in an embodiment of the present invention, and the method includes the following steps:

[0050] S101. Analyze the Class file to be encrypted, and determine the instruction part in the Code attribute.

[0051] In the design and development stage, or before publishing the application including the Class file, after compiling the Java program, that is, when the Class file is obtained, the Class file can be analyzed. That is to say, the Class file to be encrypted is a Java program to be protected, which is obtained after compiling. When parsing the Class file, it can refer to the standard of the Class file format, and the parsing process will not be repeated here. When parsing the Class file, the main purpose is to determine the instruction part in the Code attribute in the Class file. The instruction part represents the code logic of the Java source program, that is, the method ...

Embodiment 2

[0079] Corresponding to the above method embodiments, the embodiment of the present invention also provides a Java program protection device, and the Java program protection device described below and the Java program protection method described above can be referred to in correspondence.

[0080] see figure 2 As shown, the device includes the following modules:

[0081] File parsing module 101, is used for parsing the Class file to be encrypted, and determines the instruction part in the Code attribute;

[0082] The instruction encryption module 102 is used to encrypt the instruction part of the Class file to obtain the target Class file;

[0083] The meta file recording module 103 is used to create a meta file, and writes the corresponding position information of the instruction part in the target Class file to the meta file;

[0084] Correspondence establishment module 104, for establishing the correspondence of target Class file and meta file;

[0085] The loading decryp...

Embodiment 3

[0094] Corresponding to the above method embodiment, the embodiment of the present invention also provides a Java program protection device. The Java program protection device described below and the Java program protection method described above can be referred to in correspondence.

[0095] see image 3 As shown, the Java program protection device includes:

[0096] memory D1 for storing computer programs;

[0097] The processor D2 is configured to implement the steps of the Java program protection method in the above method embodiment when executing the computer program.

[0098] Specifically, please refer to Figure 4 , is a specific structural diagram of a Java program protection device provided in this embodiment. The Java program protection device may have relatively large differences due to different configurations or performances, and may include one or more than one processor (central processing units, CPU ) 322 (eg, one or more processors) and memory 332, one or ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a Java program protection method. The method comprises the following steps: analyzing a Class file to be encrypted, and determining an instruction part in a Code attribute; Theinstruction part of Class file is encrypted to obtain the target Class file. Creating a meta file, and writing corresponding position information of instruction part in the target Class file into themeta file; Establish the correspondence between the target Class file and the meta file; In the process of running the target Class file, when loading the target Class file, the instruction part of the target Class file is decrypted by using the location information recorded in the meta file to obtain the Class file. This allows you to protect your Java programs. The invention also discloses a Java program protection device, a device and a readable storage medium, which have corresponding technical effects.

Description

technical field [0001] The invention relates to the technical field of software, in particular to a Java program protection method, device, equipment and readable storage medium. Background technique [0002] Java is a cross-platform, interpreted language. The Java compilation tool compiles the Java source code into a JavaClass file, and the Java virtual machine is responsible for interpreting and executing the Java Class file. Unlike native object code, it is relatively easy to decompile Java Class files. There are many Java decompilation tools that can generate high-quality source code from JavaClass files. [0003] In order to prevent decompilation of Java Class files, currently the entire Class file compiled by Java is mainly encrypted, using jvmti (JVM tool interface) to write a native agent (a dynamic link library), and load the encrypted Class file in ClassLoader , perform real-time decryption. At the same time, the dynamic link library is reinforced. [0004] Al...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F21/14
CPCG06F21/14G06F2221/2107
Inventor 钱海锋
Owner HANGZHOU TUYA INFORMATION TECH CO LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More