WO2019062015A1 - Source code protection method, application server, and computer-readable storage medium - Google Patents

Source code protection method, application server, and computer-readable storage medium Download PDF

Info

Publication number
WO2019062015A1
WO2019062015A1 PCT/CN2018/077642 CN2018077642W WO2019062015A1 WO 2019062015 A1 WO2019062015 A1 WO 2019062015A1 CN 2018077642 W CN2018077642 W CN 2018077642W WO 2019062015 A1 WO2019062015 A1 WO 2019062015A1
Authority
WO
WIPO (PCT)
Prior art keywords
jdk
program
code
file
encrypted file
Prior art date
Application number
PCT/CN2018/077642
Other languages
French (fr)
Chinese (zh)
Inventor
熊星
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019062015A1 publication Critical patent/WO2019062015A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/14Protecting executable software against software analysis or reverse engineering, e.g. by obfuscation

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a source code protection method, an application server, and a computer readable storage medium.
  • the Java language is cross-platform because the Java source code is translated into a class file by the compiler, and the class file is stored as intermediate code in a platform-independent format.
  • One disadvantage of class files is that you can use the disassembler in the JDK to disassemble the class files, and then use the decompiler to decompile the disassembled results to get the source code for the class. This is very disadvantageous for programmers who need to prevent Java source code from being plagiarized or attacked.
  • the existing methods for class file protection mainly include the following: bytecode obfuscation technology, loader encryption technology, local compilation technology, and bytecode watermarking technology.
  • the bytecode obfuscation technique uses the obfuscator tool to prevent the compilation of the decompiler.
  • the purpose is to make it difficult for the decompiler to understand the class program, so that reverse engineering will take more time and effort to translate the class file, most of the obfuscators.
  • the tool scrambles the identifier in the bytecode file, and a meaningful name is replaced with a sequence or randomly generated meaningless name.
  • this technology only achieves the ambiguity on the surface, but its internal business logic remains unchanged. If the cracker has patience, it can still be broken.
  • the loader encryption technology first encrypts the class file with a certain encryption algorithm, then transfers the file to the destination host, and then loads and parses the encrypted class file with a specific custom class loader. But because the class loader itself is written in java, it can't be encrypted by itself, so others can easily get your decryption method by decompiling your class loader.
  • Local compilation technology refers to the process of compiling a Java application to a local application, converting the text code program to a local binary file, which not only improves the running speed of the program, occupies less memory, but also makes the security reach the local executable application. Degree. But this technique makes the application lose its cross-platform features and is not suitable for large applications due to the immature native compiler.
  • Bytecode watermarking technology like embedding watermarks in picture sounds, can also embed transparent, secure, and robust information in Java programs, providing valid evidence for confirming whether certain programs are plagiarized, but not Prevent class files from being reused or decompiled.
  • the present application proposes a source code protection method and an application server, which effectively prevents the source file from being decompiled, ensures the security of the source file, and maintains the cross-platform characteristics of the program, thereby improving the user experience.
  • the present application provides an application server including a memory, a processor, and a source code protection program stored on the memory and executable on the processor, the source code
  • the protection program implements the following steps when executed by the processor:
  • the encrypted file is retrieved and decrypted by the processed JDK.
  • the present application further provides a source code protection method, where the method is applied to an application server, and the method includes:
  • the encrypted file is retrieved and decrypted by the processed JDK.
  • the present application further provides a computer readable storage medium storing an active code protection program, the source code protection program being executable by at least one processor, such that The at least one processor performs the steps of the source code protection method as described above.
  • the application server, the source code protection method, and the computer readable storage medium proposed by the present application first receive a code encryption program input by a user, and encrypt the source code by using the code encryption program. Obtaining the encrypted file; secondly, obtaining the JDK, and processing the JDK by using a code decryption program corresponding to the code encryption program to obtain the processed JDK; then, running the processed JDK; finally, The encrypted file is retrieved and decrypted by the processed JDK.
  • the disadvantages of the prior art class files being reused or decompiled can be avoided, the source files are effectively prevented from being decompiled, the security of the source files is ensured, and the cross-platform characteristics of the programs are maintained, thereby improving the user experience.
  • 1 is a schematic diagram of an optional hardware architecture of an application server of the present application
  • FIG. 2 is a block diagram showing the program of the first embodiment of the source code protection program of the present application
  • FIG. 3 is a block diagram showing a program module of a second embodiment of the source code protection program of the present application.
  • FIG. 4 is a flowchart of a first embodiment of a source code protection method according to the present application.
  • FIG. 5 is a flowchart of a second embodiment of a source code protection method according to the present application.
  • FIG. 6 is a flowchart of a third embodiment of a source code protection method according to the present application.
  • FIG. 7 is a flowchart of a fourth embodiment of a source code protection method according to the present application.
  • first, second and the like in the present application are for the purpose of description only, and are not to be construed as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. .
  • features defining “first” and “second” may include at least one of the features, either explicitly or implicitly.
  • the technical solutions between the various embodiments may be combined with each other, but must be based on the realization of those skilled in the art, and when the combination of the technical solutions is contradictory or impossible to implement, it should be considered that the combination of the technical solutions does not exist. Nor is it within the scope of protection required by this application.
  • FIG. 1 it is a schematic diagram of an optional hardware architecture of the application server 1.
  • the application server 1 may be a computing device such as a rack server, a blade server, a tower server, or a rack server.
  • the application server 1 may be a stand-alone server or a server cluster composed of multiple servers.
  • the application server 1 may include, but is not limited to, the memory 11, the processor 12, and the network interface 13 being communicably connected to each other through a system bus.
  • the application server 1 connects to the network through the network interface 13 (not shown in FIG. 1) to obtain information.
  • the network 1 may be an intranet, an Internet, a Global System of Mobile communication (GSM), a Wideband Code Division Multiple Access (WCDMA), a 4G network, Wireless or wired networks such as 5G networks, Bluetooth, Wi-Fi, and call networks.
  • GSM Global System of Mobile communication
  • WCDMA Wideband Code Division Multiple Access
  • 4G network Wireless or wired networks such as 5G networks, Bluetooth, Wi-Fi, and call networks.
  • Figure 1 only shows the application server 1 with components 11-13, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (eg, SD or DX memory, etc.), and a random access memory (RAM). , static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, and the like.
  • the memory 11 may be an internal storage unit of the application server 1, such as a hard disk or memory of the application server 1.
  • the memory 11 may also be an external storage device of the application server 1, such as a plug-in hard disk equipped with the application server 1, a smart memory card (SMC), and a secure digital ( Secure Digital, SD) cards, flash cards, etc.
  • the memory 11 can also include both the internal storage unit of the application server 1 and its external storage device.
  • the memory 11 is generally used to store an operating system installed on the application server 1 and various types of application software, such as program code of the source code protection program 200. Further, the memory 11 can also be used to temporarily store various types of data that have been output or are to be output.
  • the processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments.
  • the processor 12 is typically used to control the overall operation of the application server 1, such as performing data interaction or communication related control and processing, and the like.
  • the processor 12 is configured to run program code or process data stored in the memory 11, such as running the source code protection program 200 and the like.
  • the network interface 13 may comprise a wireless network interface or a wired network interface, which is typically used to establish a communication connection between the application server 1 and other electronic devices.
  • the application code server 200 installs and runs an active code protection program 200.
  • the application server 1 receives a code encryption program input by a user, and utilizes the code.
  • the encryption program encrypts the source code to obtain an encrypted file; obtains a JDK, and processes the JDK by using a code decryption program corresponding to the code encryption program to obtain a processed JDK; JDK; the encrypted file is retrieved and decrypted by the processed JDK.
  • the disadvantages of the prior art class files being reused or decompiled can be avoided, the source files are effectively prevented from being decompiled, the security of the source files is ensured, and the cross-platform characteristics of the programs are maintained, thereby improving the user experience.
  • the present application proposes a source code protection program 200.
  • the source code protection program 200 includes a series of computer program instructions stored in the memory 11, and when the computer program instructions are executed by the processor 12, the source code protection of the embodiments of the present application can be implemented. Control operation.
  • the source code protection program 200 can be divided into one or more modules based on the particular operations implemented by the various portions of the computer program instructions. For example, in FIG. 2, the source code protection program 200 can be divided into a receiving module 201, an encryption module 202, an obtaining module 203, an executing module 204, and a decrypting module 205. among them:
  • the receiving module 201 is configured to receive a code encryption program input by a user.
  • the source code refers to source code of an application that needs to be deployed externally.
  • the code encryption program input by the user is described by taking a C language code (C code for short) encryption program as an example.
  • C code encryption program By adding a C code encryption program to the source code of the application, and then compiling, the source code is encrypted at the same time as the compilation is completed.
  • the C code encryption program and the following C code decryption program are some existing C code encryption and decryption programs, which will not be described in detail herein.
  • the encryption module 202 is configured to encrypt the source code by using the code encryption program to obtain an encrypted file.
  • the obtaining module 203 is configured to obtain a JDK, and process the JDK by using a code decryption program corresponding to the code encryption program to obtain a processed JDK.
  • JDK is a Java language software development kit for Java applications on mobile devices and embedded devices.
  • the obtaining module 203 is further configured to:
  • Parsing the JDK acquiring a file processing code program of the JDK; inserting an encryption determination program before the file processing code program and inserting a call function of the code decryption program after the encryption determination program.
  • the encryption judging program is configured to determine whether the file retrieved by the JDK is encrypted, and the calling function is configured to retrieve the code decryption program after determining that the file retrieved by the JDK is encrypted.
  • the file processing code program includes: a load file program, a definition class file program, and a decompression compression package program.
  • the obtained JDK is an existing open source JDK, such as JDK1.7, JDK1.8, etc.
  • the open source JDK can parse the code program of the implementation, and can be based on the existing code.
  • the program adds a developer-defined function program.
  • the load file program, the definition class file program, and the decompression compression package program may be added to the judgment program to determine whether the received file has been encrypted, and the specific judgment method.
  • the normal parsing function can be called to parse the received file. If it can be parsed normally, it is not encrypted. Otherwise, it is encrypted.
  • the calling function of the C code decryption program may also be added to implement the call of the C code decryption program.
  • the execution module 204 is configured to run the processed JDK.
  • the decryption module 205 retrieves the encrypted file and decrypts it by using the processed JDK.
  • the decrypting module 205 is further configured to:
  • the decrypting module 205 encrypts the The file is decrypted. Otherwise, if the application corresponding to the encrypted file does not satisfy the preset identifier, the decryption module 205 does not decrypt the encrypted file.
  • JVM Java Virtual Machine
  • the source code protection program 200 proposed by the present application first receives a code encryption program input by a user, and encrypts the source code by using the code encryption program to obtain an encrypted file; Next, the JDK is obtained, and the JDK is processed by a code decryption program corresponding to the code encryption program to obtain a processed JDK; then, the processed JDK is executed; finally, the processed JDK is passed.
  • the encrypted file is retrieved and decrypted.
  • the source code protection program 200 further includes a storage module 206, and the storage module 206 is configured to:
  • the encrypted file is stored on the hard disk before the execution module 204 runs the processed JDK.
  • the decryption module 205 is further configured to:
  • the calling function in the post JDK calls the code decryption program to decrypt the encrypted file.
  • the application is stored in the hard disk in the form of a source code class file before being executed by the JDK, so that the encrypted source code can be immediately called from the hard disk through the processed JDK.
  • Decoding does not involve the subsequent processing flow of the application source code, and achieves transparency to subsequent applications.
  • the source code protection program 200 proposed by the present application can immediately decode the encrypted source code from the hard disk through the processed JDK, and does not involve subsequent processing of the application source code.
  • the process implements transparency for subsequent applications.
  • the present application also proposes a source code protection method.
  • FIG. 4 it is a flowchart of the first embodiment of the source code protection method of the present application.
  • the order of execution of the steps in the flowchart shown in FIG. 4 may be changed according to different requirements, and some steps may be omitted.
  • Step S401 receiving a code encryption program input by a user.
  • the code encryption program that the user enters at the mobile terminal refers to source code of an application that needs to be deployed externally.
  • the code encryption program input by the user is described by taking a C language code (C code for short) encryption program as an example.
  • C code encryption program and the following C code decryption program are some existing C code encryption and decryption programs, which will not be described in detail herein.
  • Step S402 encrypting the source code by using the code encryption program to obtain an encrypted file.
  • Step S403 acquiring the JDK, and processing the JDK by using a code decryption program corresponding to the code encryption program to obtain the processed JDK.
  • JDK is a Java language software development kit for Java applications on mobile devices and embedded devices. Specifically, the specific steps of processing the JDK by using a code decryption program corresponding to the code encryption program will be described in detail in the second embodiment of the source code protection method of the present application (see FIG. 5).
  • Step S404 running the processed JDK.
  • Step S405 the encrypted file is retrieved and decrypted by the processed JDK.
  • the application server 1 before the step of retrieving and decrypting the encrypted file by the processed JDK, the application server 1 further obtains an encrypted operation in a Java Virtual Machine (JVM). Whether the application corresponding to the file satisfies the preset identifier; if the application corresponding to the encrypted file satisfies the preset identifier, the application server 1 decrypts the encrypted file; otherwise, if the application corresponding to the encrypted file is not satisfied If the identifier is preset, the application server 1 does not decrypt the encrypted file.
  • JVM Java Virtual Machine
  • the source code protection method proposed by the present application first receives a code encryption program input by a user, and encrypts the source code by using the code encryption program to obtain an encrypted file; secondly, Obtaining a JDK, and processing the JDK by using a code decryption program corresponding to the code encryption program to obtain a processed JDK; then, running the processed JDK; and finally, obtaining the processed JDK
  • the encrypted file is decrypted.
  • the step of processing the JDK by using a code decryption program corresponding to the code encryption program includes:
  • Step S501 parsing the JDK, and acquiring the file processing code program of the JDK.
  • the file processing code program includes: a load file program, a definition class file program, and a decompression compression package program.
  • Step S502 inserting an encryption determination program before the file processing code program and inserting a call function of the code decryption program after the encryption determination program.
  • Step S503 determining, by the encryption determination program, whether the file retrieved by the JDK is encrypted. After the file retrieved by the JDK is encrypted, step S504 is performed; otherwise, the process ends.
  • Step S504 the code decryption program is called by the calling function.
  • the obtained JDK is an existing open source JDK, such as JDK1.7, JDK1.8, etc.
  • the open source JDK can parse the code program of the implementation, and can be based on the existing code.
  • the program adds a developer-defined function program.
  • the load file program, the definition class file program, and the decompression compression package program may be added to the judgment program to determine whether the received file has been encrypted, and the specific judgment method.
  • the normal parsing function can be called to parse the received file. If it can be parsed normally, it is not encrypted. Otherwise, it is encrypted.
  • the calling function of the C code decryption program may also be added to implement the call of the C code decryption program.
  • the source code protection method proposed by the present application can process the JDK by using a code decryption program corresponding to the code encryption program.
  • FIG. 6 it is a flowchart of a third embodiment of the source code protection method of the present application.
  • the order of execution of the steps in the flowchart shown in Fig. 6 may be changed according to different needs, and some steps may be omitted.
  • Step S601 receiving a code encryption program input by the user.
  • Step S602 encrypting the source code by using the code encryption program to obtain an encrypted file.
  • Step S603 acquiring the JDK, and processing the JDK by using a code decryption program corresponding to the code encryption program to obtain the processed JDK.
  • Step S604 storing the encrypted file on a hard disk.
  • Step S605 running the processed JDK.
  • Step S606 the encrypted file is retrieved and decrypted by the processed JDK.
  • the source code protection method proposed by the present application can immediately decode the encrypted source code by calling the processed JDK from the hard disk, and does not involve the subsequent processing flow of the application source code. , to achieve transparency of subsequent applications.
  • the step of retrieving and decrypting the encrypted file by using the processed JDK includes:
  • Step S701 reading the encrypted file from the hard disk.
  • Step S702 determining whether the read encrypted file is encrypted by using the processed JDK. If the encrypted file is encrypted, step S703 is performed, otherwise, the process ends.
  • Step S703 using the calling function in the processed JDK to call the code decryption program to decrypt the encrypted file.
  • the application is stored in the hard disk in the form of a source code class file before being executed by the JDK, so that the encrypted source code can be immediately called from the hard disk through the processed JDK.
  • Decoding does not involve the subsequent processing flow of the application source code, and achieves transparency to subsequent applications.
  • the source code protection method proposed by the present application can retrieve the encrypted file and decrypt it through the processed JDK.
  • the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better.
  • Implementation Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

Disclosed is a source code protection method. The method comprises: receiving a code encryption program input by a user, and using the code encryption program to encrypt a source code, to obtain an encrypted file; acquiring JDK, and using a code decryption program corresponding to the code encryption program to process the JDK, to obtain the processed JDK; running the processed JDK; and invoking the encrypted file through the processed JDK and decrypting same. Also provided is an application server. The source code protection method and the application server provided in the present application can effectively stop a source file from being decompiled, ensuring the security of the source file, also keeping the cross-platform property of a program, and improving the user experience.

Description

源代码保护方法、应用服务器及计算机可读存储介质Source code protection method, application server, and computer readable storage medium
本申请要求于2017年09月30日提交中国专利局、申请号为201710914956.6、发明名称为“源代码保护方法、应用服务器及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。This application claims the priority of the Chinese patent application filed on September 30, 2017, the Chinese Patent Office, the application number is 201710914956.6, and the invention name is "source code protection method, application server and computer readable storage medium". The citation is incorporated in the application.
技术领域Technical field
本申请涉及通信技术领域,尤其涉及一种源代码保护方法、应用服务器及计算机可读存储介质。The present application relates to the field of communications technologies, and in particular, to a source code protection method, an application server, and a computer readable storage medium.
背景技术Background technique
Java语言能够跨平台,是因为Java源代码被编译器翻译成了类文件,而类文件作为中间代码是以一种和平台无关的格式保存的。类文件有一个缺点,就是可以利用JDK中的反汇编器对类文件进行反汇编,然后再利用反编译工具对反汇编的结果进行反编译,得出该类的源代码。这对需要防止Java源代码被剽窃或攻击的程序员来说是非常不利的。The Java language is cross-platform because the Java source code is translated into a class file by the compiler, and the class file is stored as intermediate code in a platform-independent format. One disadvantage of class files is that you can use the disassembler in the JDK to disassemble the class files, and then use the decompiler to decompile the disassembled results to get the source code for the class. This is very disadvantageous for programmers who need to prevent Java source code from being plagiarized or attacked.
现有类文件保护的方法主要有如下几种:字节码混淆技术、加载器加密技术、本地编译技术、字节码水印技术。The existing methods for class file protection mainly include the following: bytecode obfuscation technology, loader encryption technology, local compilation technology, and bytecode watermarking technology.
字节码混淆技术是利用混淆器工具防范反编译器的编译,其目的是使反编译程序难以理解类程序,以至于逆向工程将花费更多的时间和精力来翻译类文件,大部分混淆器工具打乱在字节码文件中的标识符,一个有意义的名字用顺序或随机产生的毫无意义的名字代替。但这种技术只是做到了表面上的模糊,其内部业务逻辑却依然不变,如果破解者有耐心,仍是可以攻破的。The bytecode obfuscation technique uses the obfuscator tool to prevent the compilation of the decompiler. The purpose is to make it difficult for the decompiler to understand the class program, so that reverse engineering will take more time and effort to translate the class file, most of the obfuscators. The tool scrambles the identifier in the bytecode file, and a meaningful name is replaced with a sequence or randomly generated meaningless name. However, this technology only achieves the ambiguity on the surface, but its internal business logic remains unchanged. If the cracker has patience, it can still be broken.
加载器加密技术首先采用一定的加密算法加密类文件,再将此类文件传输到目的主机,然后用特定的自定义类加载器加载并解析加密的类文件。但因为class loader本身也是java写的,自身又不能加密,所以别人只要反编译你 的class loader就能轻易拿到你的解密方法。The loader encryption technology first encrypts the class file with a certain encryption algorithm, then transfers the file to the destination host, and then loads and parses the encrypted class file with a specific custom class loader. But because the class loader itself is written in java, it can't be encrypted by itself, so others can easily get your decryption method by decompiling your class loader.
本地编译技术是指将Java应用程序编译成本地应用程序,将文字码程序转换成本地二进制文件,不仅可提高程序运行速度、占用更少的内存,还可使其安全性达到本地可执行应用程序的程度。但这种技术使应用程序失去了跨平台的特征,并且由于本地编译器的不成熟,不适应于大型应用程序。Local compilation technology refers to the process of compiling a Java application to a local application, converting the text code program to a local binary file, which not only improves the running speed of the program, occupies less memory, but also makes the security reach the local executable application. Degree. But this technique makes the application lose its cross-platform features and is not suitable for large applications due to the immature native compiler.
字节码水印技术与在图片声音中嵌入水印一样,在Java程序中也能嵌入透明的、安全的和鲁棒性的信息,能够在确认某些程序是否属于剽窃时提供有效的证据,但不能阻止类文件被重用或者被反编译。Bytecode watermarking technology, like embedding watermarks in picture sounds, can also embed transparent, secure, and robust information in Java programs, providing valid evidence for confirming whether certain programs are plagiarized, but not Prevent class files from being reused or decompiled.
发明内容Summary of the invention
有鉴于此,本申请提出一种源代码保护方法及应用服务器,有效地阻止了源文件被反编译,保证了源文件的安全性,同时保持了程序的跨平台特性,提高用户的体验。In view of this, the present application proposes a source code protection method and an application server, which effectively prevents the source file from being decompiled, ensures the security of the source file, and maintains the cross-platform characteristics of the program, thereby improving the user experience.
首先,为实现上述目的,本申请提出一种应用服务器,所述应用服务器包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的源代码保护程序,所述源代码保护程序被所述处理器执行时实现如下步骤:First, in order to achieve the above object, the present application provides an application server including a memory, a processor, and a source code protection program stored on the memory and executable on the processor, the source code The protection program implements the following steps when executed by the processor:
接收用户输入的代码加密程序,并利用所述代码加密程序对所述源代码进行加密,得到加密后的文件;Receiving a code encryption program input by the user, and encrypting the source code by using the code encryption program to obtain an encrypted file;
获取JDK,并利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理,得到处理后的JDK;Obtaining a JDK, and processing the JDK by using a code decryption program corresponding to the code encryption program to obtain a processed JDK;
运行所述处理后的JDK;及Running the processed JDK; and
通过所述处理后的JDK调取所述加密后的文件并进行解密。The encrypted file is retrieved and decrypted by the processed JDK.
此外,为实现上述目的,本申请还提供一种源代码保护方法,该方法应用于应用服务器,所述方法包括:In addition, to achieve the above object, the present application further provides a source code protection method, where the method is applied to an application server, and the method includes:
接收用户输入的代码加密程序,并利用所述代码加密程序对所述源代码进行加密,得到加密后的文件;Receiving a code encryption program input by the user, and encrypting the source code by using the code encryption program to obtain an encrypted file;
获取JDK,并利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理,得到处理后的JDK;Obtaining a JDK, and processing the JDK by using a code decryption program corresponding to the code encryption program to obtain a processed JDK;
运行所述处理后的JDK;及Running the processed JDK; and
通过所述处理后的JDK调取所述加密后的文件并进行解密。The encrypted file is retrieved and decrypted by the processed JDK.
进一步地,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有源代码保护程序,所述源代码保护程序可被至少一个处理器执行,以使所述至少一个处理器执行如上述的源代码保护方法的步骤。Further, in order to achieve the above object, the present application further provides a computer readable storage medium storing an active code protection program, the source code protection program being executable by at least one processor, such that The at least one processor performs the steps of the source code protection method as described above.
相较于现有技术,本申请所提出的应用服务器、源代码保护方法及计算机可读存储介质,首先,接收用户输入的代码加密程序,并利用所述代码加密程序对所述源代码进行加密,得到加密后的文件;其次,获取JDK,并利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理,得到处理后的JDK;然后,运行所述处理后的JDK;最后,通过所述处理后的JDK调取所述加密后的文件并进行解密。这样,可以避免现有技术中类文件被重用或者被反编译的弊端,有效地阻止源文件被反编译,保证了源文件的安全性,同时保持了程序的跨平台特性,提高用户的体验。Compared with the prior art, the application server, the source code protection method, and the computer readable storage medium proposed by the present application first receive a code encryption program input by a user, and encrypt the source code by using the code encryption program. Obtaining the encrypted file; secondly, obtaining the JDK, and processing the JDK by using a code decryption program corresponding to the code encryption program to obtain the processed JDK; then, running the processed JDK; finally, The encrypted file is retrieved and decrypted by the processed JDK. In this way, the disadvantages of the prior art class files being reused or decompiled can be avoided, the source files are effectively prevented from being decompiled, the security of the source files is ensured, and the cross-platform characteristics of the programs are maintained, thereby improving the user experience.
附图说明DRAWINGS
图1是本申请应用服务器一可选的硬件架构的示意图;1 is a schematic diagram of an optional hardware architecture of an application server of the present application;
图2是本申请源代码保护程序第一实施例的程序模块图;2 is a block diagram showing the program of the first embodiment of the source code protection program of the present application;
图3是本申请源代码保护程序第二实施例的程序模块图;3 is a block diagram showing a program module of a second embodiment of the source code protection program of the present application;
图4为本申请源代码保护方法第一实施例的流程图;4 is a flowchart of a first embodiment of a source code protection method according to the present application;
图5为本申请源代码保护方法第二实施例的流程图;FIG. 5 is a flowchart of a second embodiment of a source code protection method according to the present application; FIG.
图6为本申请源代码保护方法第三实施例的流程图;6 is a flowchart of a third embodiment of a source code protection method according to the present application;
图7为本申请源代码保护方法第四实施例的流程图。FIG. 7 is a flowchart of a fourth embodiment of a source code protection method according to the present application.
附图标记:Reference mark:
应用服务器application server 11
存储器Memory 1111
处理器processor 1212
网络接口Network Interface 1313
源代码保护程序 Source code protector 200200
接收模块Receiving module 201201
加密模块Cryptographic module 202202
获取模块Acquisition module 203203
执行模块Execution module 204204
解密模块Decryption module 205205
存储模块Storage module 206206
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the objects, technical solutions, and advantages of the present application more comprehensible, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领 域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。It should be noted that the descriptions of "first", "second" and the like in the present application are for the purpose of description only, and are not to be construed as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. . Thus, features defining "first" and "second" may include at least one of the features, either explicitly or implicitly. In addition, the technical solutions between the various embodiments may be combined with each other, but must be based on the realization of those skilled in the art, and when the combination of the technical solutions is contradictory or impossible to implement, it should be considered that the combination of the technical solutions does not exist. Nor is it within the scope of protection required by this application.
参阅图1所示,是应用服务器1一可选的硬件架构的示意图。Referring to FIG. 1, it is a schematic diagram of an optional hardware architecture of the application server 1.
所述应用服务器1可以是机架式服务器、刀片式服务器、塔式服务器或机柜式服务器等计算设备,该应用服务器1可以是独立的服务器,也可以是多个服务器所组成的服务器集群。The application server 1 may be a computing device such as a rack server, a blade server, a tower server, or a rack server. The application server 1 may be a stand-alone server or a server cluster composed of multiple servers.
本实施例中,所述应用服务器1可包括,但不仅限于,可通过系统总线相互通信连接存储器11、处理器12、网络接口13。In this embodiment, the application server 1 may include, but is not limited to, the memory 11, the processor 12, and the network interface 13 being communicably connected to each other through a system bus.
所述应用服务器1通过网络接口13连接网络(图1未标出),获取资讯。所述网络1可以是企业内部网(Intranet)、互联网(Internet)、全球移动通讯系统(Global System of Mobile communication,GSM)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、4G网络、5G网络、蓝牙(Bluetooth)、Wi-Fi、通话网络等无线或有线网络。The application server 1 connects to the network through the network interface 13 (not shown in FIG. 1) to obtain information. The network 1 may be an intranet, an Internet, a Global System of Mobile communication (GSM), a Wideband Code Division Multiple Access (WCDMA), a 4G network, Wireless or wired networks such as 5G networks, Bluetooth, Wi-Fi, and call networks.
需要指出的是,图1仅示出了具有组件11-13的应用服务器1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。It is pointed out that Figure 1 only shows the application server 1 with components 11-13, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,所述存储器11可以是所述应用服务器1的内部存储单元,例如该应用服务器1的硬盘或内存。在另一些实施例中,所述存储器11也可以是所述应用服务器1的外部存储设备,例如该应用服务器1配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,所述存储器11还可以既包括所述应用服务器1的内部存储单元也包括其外部存储设备。本实施例 中,所述存储器11通常用于存储安装于所述应用服务器1的操作系统和各类应用软件,例如所述源代码保护程序200的程序代码等。此外,所述存储器11还可以用于暂时地存储已经输出或者将要输出的各类数据。The memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (eg, SD or DX memory, etc.), and a random access memory (RAM). , static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, and the like. In some embodiments, the memory 11 may be an internal storage unit of the application server 1, such as a hard disk or memory of the application server 1. In other embodiments, the memory 11 may also be an external storage device of the application server 1, such as a plug-in hard disk equipped with the application server 1, a smart memory card (SMC), and a secure digital ( Secure Digital, SD) cards, flash cards, etc. Of course, the memory 11 can also include both the internal storage unit of the application server 1 and its external storage device. In this embodiment, the memory 11 is generally used to store an operating system installed on the application server 1 and various types of application software, such as program code of the source code protection program 200. Further, the memory 11 can also be used to temporarily store various types of data that have been output or are to be output.
所述处理器12在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器12通常用于控制所述应用服务器1的总体操作,例如执行数据交互或者通信相关的控制和处理等。本实施例中,所述处理器12用于运行所述存储器11中存储的程序代码或者处理数据,例如运行所述的源代码保护程序200等。The processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 12 is typically used to control the overall operation of the application server 1, such as performing data interaction or communication related control and processing, and the like. In this embodiment, the processor 12 is configured to run program code or process data stored in the memory 11, such as running the source code protection program 200 and the like.
所述网络接口13可包括无线网络接口或有线网络接口,该网络接口13通常用于在所述应用服务器1与其他电子设备之间建立通信连接。The network interface 13 may comprise a wireless network interface or a wired network interface, which is typically used to establish a communication connection between the application server 1 and other electronic devices.
本实施例中,所述应用服务器2内安装并运行有源代码保护程序200,当所述源代码保护程序200运行时,所述应用服务器1接收用户输入的代码加密程序,并利用所述代码加密程序对所述源代码进行加密,得到加密后的文件;获取JDK,并利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理,得到处理后的JDK;运行所述处理后的JDK;通过所述处理后的JDK调取所述加密后的文件并进行解密。这样,可以避免现有技术中类文件被重用或者被反编译的弊端,有效地阻止源文件被反编译,保证了源文件的安全性,同时保持了程序的跨平台特性,提高用户的体验。In this embodiment, the application code server 200 installs and runs an active code protection program 200. When the source code protection program 200 is running, the application server 1 receives a code encryption program input by a user, and utilizes the code. The encryption program encrypts the source code to obtain an encrypted file; obtains a JDK, and processes the JDK by using a code decryption program corresponding to the code encryption program to obtain a processed JDK; JDK; the encrypted file is retrieved and decrypted by the processed JDK. In this way, the disadvantages of the prior art class files being reused or decompiled can be avoided, the source files are effectively prevented from being decompiled, the security of the source files is ensured, and the cross-platform characteristics of the programs are maintained, thereby improving the user experience.
至此,己经详细介绍了本申请各个实施例的相关设备的硬件结构和功能。下面,将基于上述应用环境和相关设备,提出本申请的各个实施例。So far, the hardware structure and functions of the related devices of the various embodiments of the present application have been described in detail. Hereinafter, various embodiments of the present application will be proposed based on the above-described application environment and related devices.
首先,本申请提出一种源代码保护程序200。First, the present application proposes a source code protection program 200.
本实施例中,所述的源代码保护程序200包括一系列的存储于存储器11上的计算机程序指令,当该计算机程序指令被处理器12执行时,可以实现本申请各实施例的源代码保护的控制操作。在一些实施例中,基于该计算机程序指令各部分所实现的特定的操作,所述源代码保护程序200可以被划分为一个或多个模块。例如,在图2中,所述源代码保护程序200可以被分割成接收模 块201、加密模块202、获取模块203、执行模块204以及解密模块205。其中:In this embodiment, the source code protection program 200 includes a series of computer program instructions stored in the memory 11, and when the computer program instructions are executed by the processor 12, the source code protection of the embodiments of the present application can be implemented. Control operation. In some embodiments, the source code protection program 200 can be divided into one or more modules based on the particular operations implemented by the various portions of the computer program instructions. For example, in FIG. 2, the source code protection program 200 can be divided into a receiving module 201, an encryption module 202, an obtaining module 203, an executing module 204, and a decrypting module 205. among them:
所述接收模块201,用于接收用户输入的代码加密程序。The receiving module 201 is configured to receive a code encryption program input by a user.
用户在移动终端输入代码加密程序。具体地,所述源代码指的是需要对外部署的应用的源代码。在本实施例中,用户输入的代码加密程序,以C语言代码(简称C代码)加密程序为例进行说明。通过在应用的源代码中加入C代码加密程序,再进行编译,在编译完成的同时也完成了源代码的加密。在本实施方式中,所述C代码加密程序和下文的C代码解密程序为一些现有的C代码加解密程序,本文不再详细说明。The user enters a code encryption program at the mobile terminal. Specifically, the source code refers to source code of an application that needs to be deployed externally. In this embodiment, the code encryption program input by the user is described by taking a C language code (C code for short) encryption program as an example. By adding a C code encryption program to the source code of the application, and then compiling, the source code is encrypted at the same time as the compilation is completed. In the present embodiment, the C code encryption program and the following C code decryption program are some existing C code encryption and decryption programs, which will not be described in detail herein.
所述加密模块202,用于利用所述代码加密程序对所述源代码进行加密,得到加密后的文件。The encryption module 202 is configured to encrypt the source code by using the code encryption program to obtain an encrypted file.
所述获取模块203,用于获取JDK,并利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理,得到处理后的JDK。The obtaining module 203 is configured to obtain a JDK, and process the JDK by using a code decryption program corresponding to the code encryption program to obtain a processed JDK.
JDK是Java语言的软件开发工具包,主要用于移动设备、嵌入式设备上的java应用程序。具体地,为实现利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理的步骤,所述获取模块203,还用于:JDK is a Java language software development kit for Java applications on mobile devices and embedded devices. Specifically, in order to implement the step of processing the JDK by using a code decryption program corresponding to the code encryption program, the obtaining module 203 is further configured to:
解析JDK,获取所述JDK的文件处理代码程序;在所述文件处理代码程序之前插入加密判断程序及在所述加密判断程序之后插入所述代码解密程序的调用函数。所述加密判断程序用于判断所述JDK调取的文件是否经过加密,所述调用函数用于在判断出所述JDK调取的文件经过加密后,调取所述代码解密程序。Parsing the JDK, acquiring a file processing code program of the JDK; inserting an encryption determination program before the file processing code program and inserting a call function of the code decryption program after the encryption determination program. The encryption judging program is configured to determine whether the file retrieved by the JDK is encrypted, and the calling function is configured to retrieve the code decryption program after determining that the file retrieved by the JDK is encrypted.
本实施例中,所述文件处理代码程序包括:加载文件程序、定义类文件程序及解压压缩包程序。In this embodiment, the file processing code program includes: a load file program, a definition class file program, and a decompression compression package program.
在本实施方式中,所述获取的JDK,为现有的开源的JDK,比如JDK1.7、JDK1.8等等,开源的JDK可以解析出其实现的代码程序,并可以根据现有的代码程序添加开发者自定义的功能程序,比如本实施方式中,在加载文件程序、定义类文件程序、解压压缩包程序可以加入判断程序,去判断接收的文 件是否经过了加密,而具体的判断方法可以调用正常的解析函数去解析接收的文件,如果能正常解析,则没有经过加密,反之,则经过了加密。在加入的判断程序之后和加载文件程序、定义类文件程序、解压压缩包程序之前,还可以加入C代码解密程序的调用函数,以实现C代码解密程序的调用。In this embodiment, the obtained JDK is an existing open source JDK, such as JDK1.7, JDK1.8, etc., and the open source JDK can parse the code program of the implementation, and can be based on the existing code. The program adds a developer-defined function program. For example, in the embodiment, the load file program, the definition class file program, and the decompression compression package program may be added to the judgment program to determine whether the received file has been encrypted, and the specific judgment method. The normal parsing function can be called to parse the received file. If it can be parsed normally, it is not encrypted. Otherwise, it is encrypted. After the added judgment program and before loading the file program, defining the class file program, and extracting the compressed package program, the calling function of the C code decryption program may also be added to implement the call of the C code decryption program.
所述执行模块204,用于运行所述处理后的JDK。The execution module 204 is configured to run the processed JDK.
所述解密模块205,通过所述处理后的JDK调取所述加密后的文件并进行解密。The decryption module 205 retrieves the encrypted file and decrypts it by using the processed JDK.
具体地,在所述通过所述处理后的JDK调取所述加密后的文件并进行解密的步骤之前,所述解密模块205还用于:Specifically, before the step of retrieving the encrypted file by the processed JDK and decrypting, the decrypting module 205 is further configured to:
获取JAVA虚拟机(Java Virtual Machine,JVM)中运行的加密后的文件对应的应用是否满足预设标识;若加密后的文件对应的应用满足预设标识,则所述解密模块205对加密后的文件进行解密,否则,若加密后的文件对应的应用不满足预设标识,则所述解密模块205不对加密后的文件进行解密。Obtaining whether the application corresponding to the encrypted file running in the Java Virtual Machine (JVM) satisfies the preset identifier; if the application corresponding to the encrypted file satisfies the preset identifier, the decrypting module 205 encrypts the The file is decrypted. Otherwise, if the application corresponding to the encrypted file does not satisfy the preset identifier, the decryption module 205 does not decrypt the encrypted file.
在本实施例中,一个服务器或智能计算设备上可能还存在其他应用,但在实际使用过程中,只需要针对目标应用去执行处理后JDK中的解密流程,如果不对需要解密的应用做出判断,那么对任何一个应用都会去执行解密过程,则影响了应用的安全性。In this embodiment, there may be other applications on a server or an intelligent computing device, but in actual use, only the decryption process in the processed JDK needs to be performed for the target application, if the application that needs to be decrypted is not judged. , then the decryption process will be performed for any application, which affects the security of the application.
通过上述程序模块201-205,本申请所提出的源代码保护程序200,首先,接收用户输入的代码加密程序,并利用所述代码加密程序对所述源代码进行加密,得到加密后的文件;其次,获取JDK,并利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理,得到处理后的JDK;然后,运行所述处理后的JDK;最后,通过所述处理后的JDK调取所述加密后的文件并进行解密。这样,可以避免现有技术中类文件被重用或者被反编译的弊端,有效地阻止源文件被反编译,保证了源文件的安全性,同时保持了程序的跨平台特性,提高用户的体验。Through the above program modules 201-205, the source code protection program 200 proposed by the present application first receives a code encryption program input by a user, and encrypts the source code by using the code encryption program to obtain an encrypted file; Next, the JDK is obtained, and the JDK is processed by a code decryption program corresponding to the code encryption program to obtain a processed JDK; then, the processed JDK is executed; finally, the processed JDK is passed. The encrypted file is retrieved and decrypted. In this way, the disadvantages of the prior art class files being reused or decompiled can be avoided, the source files are effectively prevented from being decompiled, the security of the source files is ensured, and the cross-platform characteristics of the programs are maintained, thereby improving the user experience.
进一步地,基于本申请源代码保护程序200的上述第一实施例,提出本申 请的第二实施例(如图3所示)。本实施例中,所述的源代码保护程序200还包括存储模块206,所述存储模块206,用于:Further, based on the above-described first embodiment of the source code protection program 200 of the present application, a second embodiment of the present application (shown in FIG. 3) is proposed. In this embodiment, the source code protection program 200 further includes a storage module 206, and the storage module 206 is configured to:
在所述执行模块204运行所述处理后的JDK的步骤之前,将所述加密后的文件存储于硬盘。The encrypted file is stored on the hard disk before the execution module 204 runs the processed JDK.
本实施例中,所述解密模块205,还用于:In this embodiment, the decryption module 205 is further configured to:
从所述硬盘读取所述加密后的文件;利用所述处理后的JDK判断读取的所述加密后的文件是否经过加密;若所述加密后的文件是经过加密,则利用所述处理后JDK中的调用函数调用所述代码解密程序对所述加密后的文件进行解密。Reading the encrypted file from the hard disk; determining, by the processed JDK, whether the read encrypted file is encrypted; if the encrypted file is encrypted, using the processing The calling function in the post JDK calls the code decryption program to decrypt the encrypted file.
在本实施例中,应用在通过JDK执行之前,以源代码的类文件的形式存放于硬盘中,如此,在通过处理后的JDK从硬盘里调用这些加密后的源代码的同时就能立即进行解码,不涉及应用源代码后续的处理流程,实现了对后续应用的透明化。In this embodiment, the application is stored in the hard disk in the form of a source code class file before being executed by the JDK, so that the encrypted source code can be immediately called from the hard disk through the processed JDK. Decoding, does not involve the subsequent processing flow of the application source code, and achieves transparency to subsequent applications.
通过上述程序模块201-206,本申请所提出的源代码保护程序200可以通过处理后的JDK从硬盘里调用这些加密后的源代码的同时就能立即进行解码,不涉及应用源代码后续的处理流程,实现了对后续应用的透明化。Through the above program modules 201-206, the source code protection program 200 proposed by the present application can immediately decode the encrypted source code from the hard disk through the processed JDK, and does not involve subsequent processing of the application source code. The process implements transparency for subsequent applications.
此外,本申请还提出一种源代码保护方法。In addition, the present application also proposes a source code protection method.
参阅图4所示,是本申请源代码保护方法第一实施例的流程图。在本实施例中,根据不同的需求,图4所示的流程图中的步骤的执行顺序可以改变,某些步骤可以省略。Referring to FIG. 4, it is a flowchart of the first embodiment of the source code protection method of the present application. In this embodiment, the order of execution of the steps in the flowchart shown in FIG. 4 may be changed according to different requirements, and some steps may be omitted.
步骤S401,接收用户输入的代码加密程序。Step S401, receiving a code encryption program input by a user.
用户在移动终端输入的代码加密程序。具体地,所述源代码指的是需要对外部署的应用的源代码。在本实施例中,用户输入的代码加密程序,以C语言代码(简称C代码)加密程序为例进行说明。通过在应用的源代码中加入C代码加密程序,再进行编译,在编译完成的同时也完成了源代码的加密。在本实施方式中,所述C代码加密程序和下文的C代码解密程序为一些现有的C 代码加解密程序,本文不再详细说明。The code encryption program that the user enters at the mobile terminal. Specifically, the source code refers to source code of an application that needs to be deployed externally. In this embodiment, the code encryption program input by the user is described by taking a C language code (C code for short) encryption program as an example. By adding a C code encryption program to the source code of the application, and then compiling, the source code is encrypted at the same time as the compilation is completed. In the present embodiment, the C code encryption program and the following C code decryption program are some existing C code encryption and decryption programs, which will not be described in detail herein.
步骤S402,利用所述代码加密程序对所述源代码进行加密,得到加密后的文件。Step S402, encrypting the source code by using the code encryption program to obtain an encrypted file.
步骤S403,获取JDK,并利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理,得到处理后的JDK。Step S403, acquiring the JDK, and processing the JDK by using a code decryption program corresponding to the code encryption program to obtain the processed JDK.
JDK是Java语言的软件开发工具包,主要用于移动设备、嵌入式设备上的java应用程序。具体地,所述利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理的具体步骤,将在本申请源代码保护方法的第二实施例(参阅图5)进行详述。JDK is a Java language software development kit for Java applications on mobile devices and embedded devices. Specifically, the specific steps of processing the JDK by using a code decryption program corresponding to the code encryption program will be described in detail in the second embodiment of the source code protection method of the present application (see FIG. 5).
步骤S404,运行所述处理后的JDK。Step S404, running the processed JDK.
步骤S405,通过所述处理后的JDK调取所述加密后的文件并进行解密。Step S405, the encrypted file is retrieved and decrypted by the processed JDK.
具体地,在所述通过所述处理后的JDK调取所述加密后的文件并进行解密的步骤之前,所述应用服务器1还获取JAVA虚拟机(Java Virtual Machine,JVM)中运行的加密后的文件对应的应用是否满足预设标识;若加密后的文件对应的应用满足预设标识,则所述应用服务器1对加密后的文件进行解密,否则,若加密后的文件对应的应用不满足预设标识,则所述应用服务器1不对加密后的文件进行解密。Specifically, before the step of retrieving and decrypting the encrypted file by the processed JDK, the application server 1 further obtains an encrypted operation in a Java Virtual Machine (JVM). Whether the application corresponding to the file satisfies the preset identifier; if the application corresponding to the encrypted file satisfies the preset identifier, the application server 1 decrypts the encrypted file; otherwise, if the application corresponding to the encrypted file is not satisfied If the identifier is preset, the application server 1 does not decrypt the encrypted file.
在本实施例中,一个服务器或智能计算设备上可能还存在其他应用,但在实际使用过程中,只需要针对目标应用去执行处理后JDK中的解密流程,如果不对需要解密的应用做出判断,那么对任何一个应用都会去执行解密过程,则影响了应用的安全性。In this embodiment, there may be other applications on a server or an intelligent computing device, but in actual use, only the decryption process in the processed JDK needs to be performed for the target application, if the application that needs to be decrypted is not judged. , then the decryption process will be performed for any application, which affects the security of the application.
通过上述步骤S401-405,本申请所提出的源代码保护方法,首先,接收用户输入的代码加密程序,并利用所述代码加密程序对所述源代码进行加密,得到加密后的文件;其次,获取JDK,并利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理,得到处理后的JDK;然后,运行所述处理后的JDK;最后,通过所述处理后的JDK调取所述加密后的文件并进行解密。这样, 可以避免现有技术中类文件被重用或者被反编译的弊端,有效地阻止源文件被反编译,保证了源文件的安全性,同时保持了程序的跨平台特性,提高用户的体验。Through the above steps S401-405, the source code protection method proposed by the present application first receives a code encryption program input by a user, and encrypts the source code by using the code encryption program to obtain an encrypted file; secondly, Obtaining a JDK, and processing the JDK by using a code decryption program corresponding to the code encryption program to obtain a processed JDK; then, running the processed JDK; and finally, obtaining the processed JDK The encrypted file is decrypted. In this way, the disadvantages of the prior art class files being reused or decompiled can be avoided, the source files are effectively prevented from being decompiled, the security of the source files is ensured, and the cross-platform characteristics of the programs are maintained, thereby improving the user experience.
如图5所示,是本申请源代码保护方法的第二实施例的流程图。本实施例中,所述通过相应于所述代码加密程序的代码解密程序对所述JDK进行处理的步骤,具体包括:As shown in FIG. 5, it is a flowchart of the second embodiment of the source code protection method of the present application. In this embodiment, the step of processing the JDK by using a code decryption program corresponding to the code encryption program includes:
步骤S501,解析JDK,获取所述JDK的文件处理代码程序。Step S501, parsing the JDK, and acquiring the file processing code program of the JDK.
本实施例中,所述文件处理代码程序包括:加载文件程序、定义类文件程序及解压压缩包程序。In this embodiment, the file processing code program includes: a load file program, a definition class file program, and a decompression compression package program.
步骤S502,在所述文件处理代码程序之前插入加密判断程序及在所述加密判断程序之后插入所述代码解密程序的调用函数。Step S502, inserting an encryption determination program before the file processing code program and inserting a call function of the code decryption program after the encryption determination program.
步骤S503,通过所述加密判断程序判断所述JDK调取的文件是否经过加密,当所述JDK调取的文件经过加密后,执行步骤S504,否则,结束流程。Step S503, determining, by the encryption determination program, whether the file retrieved by the JDK is encrypted. After the file retrieved by the JDK is encrypted, step S504 is performed; otherwise, the process ends.
步骤S504,通过所述调用函数调取所述代码解密程序。Step S504, the code decryption program is called by the calling function.
在本实施方式中,所述获取的JDK,为现有的开源的JDK,比如JDK1.7、JDK1.8等等,开源的JDK可以解析出其实现的代码程序,并可以根据现有的代码程序添加开发者自定义的功能程序,比如本实施方式中,在加载文件程序、定义类文件程序、解压压缩包程序可以加入判断程序,去判断接收的文件是否经过了加密,而具体的判断方法可以调用正常的解析函数去解析接收的文件,如果能正常解析,则没有经过加密,反之,则经过了加密。在加入的判断程序之后和加载文件程序、定义类文件程序、解压压缩包程序之前,还可以加入C代码解密程序的调用函数,以实现C代码解密程序的调用。In this embodiment, the obtained JDK is an existing open source JDK, such as JDK1.7, JDK1.8, etc., and the open source JDK can parse the code program of the implementation, and can be based on the existing code. The program adds a developer-defined function program. For example, in the embodiment, the load file program, the definition class file program, and the decompression compression package program may be added to the judgment program to determine whether the received file has been encrypted, and the specific judgment method. The normal parsing function can be called to parse the received file. If it can be parsed normally, it is not encrypted. Otherwise, it is encrypted. After the added judgment program and before loading the file program, defining the class file program, and extracting the compressed package program, the calling function of the C code decryption program may also be added to implement the call of the C code decryption program.
通过上述步骤S501-S504,本申请所提出的源代码保护方法,可以通过利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理。Through the above steps S501-S504, the source code protection method proposed by the present application can process the JDK by using a code decryption program corresponding to the code encryption program.
如图6所示,是本申请源代码保护方法的第三实施例的流程图。在本实施例中,根据不同的需求,图6所示的流程图中的步骤的执行顺序可以改变,某 些步骤可以省略。As shown in FIG. 6, it is a flowchart of a third embodiment of the source code protection method of the present application. In the present embodiment, the order of execution of the steps in the flowchart shown in Fig. 6 may be changed according to different needs, and some steps may be omitted.
步骤S601,接收用户输入的代码加密程序。Step S601, receiving a code encryption program input by the user.
步骤S602,利用所述代码加密程序对所述源代码进行加密,得到加密后的文件。Step S602, encrypting the source code by using the code encryption program to obtain an encrypted file.
步骤S603,获取JDK,并利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理,得到处理后的JDK。Step S603, acquiring the JDK, and processing the JDK by using a code decryption program corresponding to the code encryption program to obtain the processed JDK.
步骤S604,将所述加密后的文件存储于硬盘。Step S604, storing the encrypted file on a hard disk.
步骤S605,运行所述处理后的JDK。Step S605, running the processed JDK.
步骤S606,通过所述处理后的JDK调取所述加密后的文件并进行解密。Step S606, the encrypted file is retrieved and decrypted by the processed JDK.
通过上述步骤S601-S606,本申请所提出的源代码保护方法,可以通过处理后的JDK从硬盘里调用这些加密后的源代码的同时就能立即进行解码,不涉及应用源代码后续的处理流程,实现了对后续应用的透明化。Through the above steps S601-S606, the source code protection method proposed by the present application can immediately decode the encrypted source code by calling the processed JDK from the hard disk, and does not involve the subsequent processing flow of the application source code. , to achieve transparency of subsequent applications.
基于本申请源代码保护方法的第三实施例,提出本申请源代码保护方法的第四实施例。Based on the third embodiment of the source code protection method of the present application, a fourth embodiment of the source code protection method of the present application is proposed.
如图7所示,是本申请源代码保护方法的第四实施例的流程图。本实施例中,所述通过所述处理后的JDK调取所述加密后的文件并进行解密的步骤,具体包括:As shown in FIG. 7, it is a flowchart of the fourth embodiment of the source code protection method of the present application. In this embodiment, the step of retrieving and decrypting the encrypted file by using the processed JDK includes:
步骤S701,从所述硬盘读取所述加密后的文件。Step S701, reading the encrypted file from the hard disk.
步骤S702,利用所述处理后的JDK判断读取的所述加密后的文件是否经过加密。若所述加密后的文件是经过加密,执行步骤S703,否则,结束流程。Step S702, determining whether the read encrypted file is encrypted by using the processed JDK. If the encrypted file is encrypted, step S703 is performed, otherwise, the process ends.
步骤S703,利用所述处理后JDK中的调用函数调用所述代码解密程序对所述加密后的文件进行解密。Step S703, using the calling function in the processed JDK to call the code decryption program to decrypt the encrypted file.
在本实施例中,应用在通过JDK执行之前,以源代码的类文件的形式存放于硬盘中,如此,在通过处理后的JDK从硬盘里调用这些加密后的源代码的同时就能立即进行解码,不涉及应用源代码后续的处理流程,实现了对后续应用的透明化。In this embodiment, the application is stored in the hard disk in the form of a source code class file before being executed by the JDK, so that the encrypted source code can be immediately called from the hard disk through the processed JDK. Decoding, does not involve the subsequent processing flow of the application source code, and achieves transparency to subsequent applications.
通过上述步骤S701-S703,本申请所提出的源代码保护方法,可以通过处理后的JDK调取加密后的文件并进行解密。Through the above steps S701-S703, the source code protection method proposed by the present application can retrieve the encrypted file and decrypt it through the processed JDK.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present application are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above is only a preferred embodiment of the present application, and is not intended to limit the scope of the patent application, and the equivalent structure or equivalent process transformations made by the specification and the drawings of the present application, or directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of this application.

Claims (20)

  1. 一种源代码保护方法,应用于应用服务器,其特征在于,所述方法包括:A source code protection method is applied to an application server, where the method includes:
    接收用户输入的代码加密程序,并通过所述代码加密程序对所述源代码进行加密,得到加密后的文件;Receiving a code encryption program input by a user, and encrypting the source code by the code encryption program to obtain an encrypted file;
    获取JDK,并利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理,得到处理后的JDK;Obtaining a JDK, and processing the JDK by using a code decryption program corresponding to the code encryption program to obtain a processed JDK;
    运行所述处理后的JDK;及Running the processed JDK; and
    通过所述处理后的JDK调取所述加密后的文件并进行解密。The encrypted file is retrieved and decrypted by the processed JDK.
  2. 如权利要求1所述的源代码保护方法,其特征在于,所述利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理的步骤,具体包括:The source code protection method according to claim 1, wherein the step of processing the JDK by using a code decryption program corresponding to the code encryption program comprises:
    解析JDK,获取所述JDK的文件处理代码程序;Parsing the JDK to obtain the file processing code program of the JDK;
    在所述文件处理代码程序之前插入加密判断程序,所述加密判断程序用于判断所述JDK调取的文件是否经过加密;及Inserting an encryption judging program for determining whether the file retrieved by the JDK is encrypted before the file processing code program; and
    在所述加密判断程序之后插入所述代码解密程序的调用函数,所述调用函数用于在判断出所述JDK调取的文件经过加密后,调取所述代码解密程序。Inserting a call function of the code decryption program after the encryption determination program, the calling function is configured to retrieve the code decryption program after determining that the file retrieved by the JDK is encrypted.
  3. 如权利要求1所述的源代码保护方法,其特征在于,在所述运行所述处理后的JDK的步骤之前,所述方法还包括:The source code protection method according to claim 1, wherein before the step of running the processed JDK, the method further comprises:
    将所述加密后的文件存储于硬盘。The encrypted file is stored on the hard disk.
  4. 如权利要求3所述的源代码保护方法,其特征在于,所述通过所述处理后的JDK调取所述加密后的文件并进行解密的步骤,具体包括:The source code protection method according to claim 3, wherein the step of retrieving and decrypting the encrypted file by the processed JDK comprises:
    从所述硬盘读取所述加密后的文件;Reading the encrypted file from the hard disk;
    利用所述处理后的JDK判断读取的所述加密后的文件是否经过加密;及Determining, by the processed JDK, whether the read encrypted file is encrypted; and
    若所述加密后的文件是经过加密,则通过所述处理后JDK中的调用函数调用所述代码解密程序对所述加密后的文件进行解密。If the encrypted file is encrypted, the encrypted file is decrypted by calling the code decryption program by the calling function in the processed JDK.
  5. 如权利要求3所述的源代码保护方法,其特征在于,所述利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理的步骤,具体包括:The source code protection method according to claim 3, wherein the step of processing the JDK by using a code decryption program corresponding to the code encryption program comprises:
    解析JDK,获取所述JDK的文件处理代码程序;Parsing the JDK to obtain the file processing code program of the JDK;
    在所述文件处理代码程序之前插入加密判断程序,所述加密判断程序用于判断所述JDK调取的文件是否经过加密;及Inserting an encryption judging program for determining whether the file retrieved by the JDK is encrypted before the file processing code program; and
    在所述加密判断程序之后插入所述代码解密程序的调用函数,所述调用函数用于在判断出所述JDK调取的文件经过加密后,调取所述代码解密程序。Inserting a call function of the code decryption program after the encryption determination program, the calling function is configured to retrieve the code decryption program after determining that the file retrieved by the JDK is encrypted.
  6. 如权利要求1所述的源代码保护方法,其特征在于,在所述通过所述处理后的JDK调取所述加密后的文件并进行解密的步骤之前,所述方法还包括:The source code protection method according to claim 1, wherein before the step of decrypting and decrypting the encrypted file by the processed JDK, the method further comprises:
    获取JAVA虚拟机中运行的加密后的文件对应的应用是否满足预设标识;Obtaining whether the application corresponding to the encrypted file running in the JAVA virtual machine meets the preset identifier;
    若所述加密后的文件对应的应用满足预设标识,则对所述加密后的文件进行解密;及Decrypting the encrypted file if the application corresponding to the encrypted file satisfies a preset identifier; and
    若所述加密后的文件对应的应用不满足预设标识,则对所述加密后的文件不进行解密。If the application corresponding to the encrypted file does not satisfy the preset identifier, the encrypted file is not decrypted.
  7. 如权利要求3所述的源代码保护方法,其特征在于,在所述通过所述处理后的JDK调取所述加密后的文件并进行解密的步骤之前,所述方法还包括:The source code protection method according to claim 3, wherein before the step of retrieving and decrypting the encrypted file by the processed JDK, the method further comprises:
    获取JAVA虚拟机中运行的加密后的文件对应的应用是否满足预设标识;Obtaining whether the application corresponding to the encrypted file running in the JAVA virtual machine meets the preset identifier;
    若所述加密后的文件对应的应用满足预设标识,则对所述加密后的文件进行解密;及Decrypting the encrypted file if the application corresponding to the encrypted file satisfies a preset identifier; and
    若所述加密后的文件对应的应用不满足预设标识,则对所述加密后的文件不进行解密。If the application corresponding to the encrypted file does not satisfy the preset identifier, the encrypted file is not decrypted.
  8. 一种应用服务器,其特征在于,所述应用服务器包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的源代码保护程序,所述源代码保护程序被所述处理器执行时实现如下步骤:An application server, comprising: a memory, a processor, and a source code protection program stored on the memory and operable on the processor, the source code protection program being processed The following steps are implemented when the device is executed:
    接收用户输入的代码加密程序,并通过所述代码加密程序对所述源代码进行加密,得到加密后的文件;Receiving a code encryption program input by a user, and encrypting the source code by the code encryption program to obtain an encrypted file;
    获取JDK,并利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理,得到处理后的JDK;Obtaining a JDK, and processing the JDK by using a code decryption program corresponding to the code encryption program to obtain a processed JDK;
    运行所述处理后的JDK;及Running the processed JDK; and
    通过所述处理后的JDK调取所述加密后的文件并进行解密。The encrypted file is retrieved and decrypted by the processed JDK.
  9. 如权利要求8所述的应用服务器,其特征在于,所述利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理的步骤,具体包括:The application server according to claim 8, wherein the step of processing the JDK by using a code decryption program corresponding to the code encryption program comprises:
    解析JDK,获取所述JDK的文件处理代码程序;Parsing the JDK to obtain the file processing code program of the JDK;
    在所述文件处理代码程序之前插入加密判断程序,所述加密判断程序用于判断所述JDK调取的文件是否经过加密;及Inserting an encryption judging program for determining whether the file retrieved by the JDK is encrypted before the file processing code program; and
    在所述加密判断程序之后插入所述代码解密程序的调用函数,所述调用函数用于在判断出所述JDK调取的文件经过加密后,调取所述代码解密程序。Inserting a call function of the code decryption program after the encryption determination program, the calling function is configured to retrieve the code decryption program after determining that the file retrieved by the JDK is encrypted.
  10. 如权利要求8所述的应用服务器,其特征在于,在所述运行所述处理后的JDK的步骤之前,所述源代码保护程序被所述处理器执行时还实现步骤:The application server according to claim 8, wherein said source code protection program is further executed by said processor before said step of executing said processed JDK:
    将所述加密后的文件存储于硬盘。The encrypted file is stored on the hard disk.
  11. 如权利要求10所述的应用服务器,其特征在于,所述通过所述处理后的JDK调取所述加密后的文件并进行解密的步骤,具体包括:The application server according to claim 10, wherein the step of retrieving and decrypting the encrypted file by the processed JDK comprises:
    从所述硬盘读取所述加密后的文件;Reading the encrypted file from the hard disk;
    利用所述处理后的JDK判断读取的所述加密后的文件是否经过加密;及Determining, by the processed JDK, whether the read encrypted file is encrypted; and
    若所述加密后的文件是经过加密,则利用所述处理后JDK中的调用函数调用所述代码解密程序对所述加密后的文件进行解密。If the encrypted file is encrypted, the code decryption program is called by the call function in the processed JDK to decrypt the encrypted file.
  12. 如权利要求10所述的应用服务器,其特征在于,所述利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理的步骤,具体包括:The application server according to claim 10, wherein the step of processing the JDK by using a code decryption program corresponding to the code encryption program comprises:
    解析JDK,获取所述JDK的文件处理代码程序;Parsing the JDK to obtain the file processing code program of the JDK;
    在所述文件处理代码程序之前插入加密判断程序,所述加密判断程序用于判断所述JDK调取的文件是否经过加密;及Inserting an encryption judging program for determining whether the file retrieved by the JDK is encrypted before the file processing code program; and
    在所述加密判断程序之后插入所述代码解密程序的调用函数,所述调用 函数用于在判断出所述JDK调取的文件经过加密后,调取所述代码解密程序。Inserting a call function of the code decryption program after the encryption determination program, the call function is configured to retrieve the code decryption program after determining that the file retrieved by the JDK is encrypted.
  13. 如权利要求8所述的应用服务器,其特征在于,在所述通过所述处理后的JDK调取所述加密后的文件并进行解密的步骤之前,所述源代码保护程序被所述处理器执行时还实现步骤:The application server according to claim 8, wherein said source code protection program is used by said processor before said step of retrieving said encrypted file by said processed JDK and decrypting said file Implementation steps are also implemented:
    获取JAVA虚拟机中运行的加密后的文件对应的应用是否满足预设标识;Obtaining whether the application corresponding to the encrypted file running in the JAVA virtual machine meets the preset identifier;
    若所述加密后的文件对应的应用满足预设标识,则对所述加密后的文件进行解密;及Decrypting the encrypted file if the application corresponding to the encrypted file satisfies a preset identifier; and
    若所述加密后的文件对应的应用不满足预设标识,则对所述加密后的文件不进行解密。If the application corresponding to the encrypted file does not satisfy the preset identifier, the encrypted file is not decrypted.
  14. 如权利要求10所述的应用服务器,其特征在于,在所述通过所述处理后的JDK调取所述加密后的文件并进行解密的步骤之前,所述源代码保护程序被所述处理器执行时还实现步骤:The application server according to claim 10, wherein said source code protection program is used by said processor before said step of decrypting said encrypted file by said processed JDK and decrypting said file Implementation steps are also implemented:
    获取JAVA虚拟机中运行的加密后的文件对应的应用是否满足预设标识;Obtaining whether the application corresponding to the encrypted file running in the JAVA virtual machine meets the preset identifier;
    若所述加密后的文件对应的应用满足预设标识,则对所述加密后的文件进行解密;及Decrypting the encrypted file if the application corresponding to the encrypted file satisfies a preset identifier; and
    若所述加密后的文件对应的应用不满足预设标识,则对所述加密后的文件不进行解密。If the application corresponding to the encrypted file does not satisfy the preset identifier, the encrypted file is not decrypted.
  15. 一种计算机可读存储介质,所述计算机可读存储介质存储有源代码保护程序,所述源代码保护程序可被至少一个处理器执行,以使所述至少一个处理器执行如下步骤:A computer readable storage medium storing an active code protection program, the source code protection program being executable by at least one processor to cause the at least one processor to perform the following steps:
    接收用户输入的代码加密程序,并通过所述代码加密程序对所述源代码进行加密,得到加密后的文件;Receiving a code encryption program input by a user, and encrypting the source code by the code encryption program to obtain an encrypted file;
    获取JDK,并利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理,得到处理后的JDK;Obtaining a JDK, and processing the JDK by using a code decryption program corresponding to the code encryption program to obtain a processed JDK;
    运行所述处理后的JDK;及Running the processed JDK; and
    通过所述处理后的JDK调取所述加密后的文件并进行解密。The encrypted file is retrieved and decrypted by the processed JDK.
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述利用相应于所述代码加密程序的代码解密程序对所述JDK进行处理的步骤,具体包括:The computer readable storage medium according to claim 15, wherein the step of processing the JDK by using a code decryption program corresponding to the code encryption program comprises:
    解析JDK,获取所述JDK的文件处理代码程序;Parsing the JDK to obtain the file processing code program of the JDK;
    在所述文件处理代码程序之前插入加密判断程序,所述加密判断程序用于判断所述JDK调取的文件是否经过加密;及Inserting an encryption judging program for determining whether the file retrieved by the JDK is encrypted before the file processing code program; and
    在所述加密判断程序之后插入所述代码解密程序的调用函数,所述调用函数用于在判断出所述JDK调取的文件经过加密后,调取所述代码解密程序。Inserting a call function of the code decryption program after the encryption determination program, the calling function is configured to retrieve the code decryption program after determining that the file retrieved by the JDK is encrypted.
  17. 如权利要求15所述的计算机可读存储介质,其特征在于,在所述运行所述处理后的JDK的步骤之前,所述源代码保护程序被所述处理器执行时还实现步骤:A computer readable storage medium according to claim 15 wherein said source code protection program is further executed by said processor prior to said step of executing said processed JDK:
    将所述加密后的文件存储于硬盘。The encrypted file is stored on the hard disk.
  18. 如权利要求17所述的计算机可读存储介质,其特征在于,所述通过所述处理后的JDK调取所述加密后的文件并进行解密的步骤,具体包括:The computer readable storage medium according to claim 17, wherein the step of retrieving and decrypting the encrypted file by the processed JDK comprises:
    从所述硬盘读取所述加密后的文件;Reading the encrypted file from the hard disk;
    利用所述处理后的JDK判断读取的所述加密后的文件是否经过加密;及Determining, by the processed JDK, whether the read encrypted file is encrypted; and
    若所述加密后的文件是经过加密,则利用所述处理后JDK中的调用函数调用所述代码解密程序对所述加密后的文件进行解密。If the encrypted file is encrypted, the code decryption program is called by the call function in the processed JDK to decrypt the encrypted file.
  19. 如权利要求15所述的计算机可读存储介质,其特征在于,在所述通过所述处理后的JDK调取所述加密后的文件并进行解密的步骤之前,所述源代码保护程序被所述处理器执行时还实现步骤:A computer readable storage medium according to claim 15, wherein said source code protection program is used before said step of retrieving said encrypted file by said processed JDK and decrypting said file The steps are also implemented when the processor is executed:
    获取JAVA虚拟机中运行的加密后的文件对应的应用是否满足预设标识;Obtaining whether the application corresponding to the encrypted file running in the JAVA virtual machine meets the preset identifier;
    若所述加密后的文件对应的应用满足预设标识,则对所述加密后的文件进行解密;及Decrypting the encrypted file if the application corresponding to the encrypted file satisfies a preset identifier; and
    若所述加密后的文件对应的应用不满足预设标识,则对所述加密后的文件不进行解密。If the application corresponding to the encrypted file does not satisfy the preset identifier, the encrypted file is not decrypted.
  20. 如权利要求17所述的计算机可读存储介质,其特征在于,在所述通过所述处理后的JDK调取所述加密后的文件并进行解密的步骤之前,所述源代码保护程序被所述处理器执行时还实现步骤:A computer readable storage medium according to claim 17, wherein said source code protection program is used before said step of retrieving said encrypted file by said processed JDK and decrypting said file The steps are also implemented when the processor is executed:
    获取JAVA虚拟机中运行的加密后的文件对应的应用是否满足预设标识;Obtaining whether the application corresponding to the encrypted file running in the JAVA virtual machine meets the preset identifier;
    若所述加密后的文件对应的应用满足预设标识,则对所述加密后的文件进行解密;及Decrypting the encrypted file if the application corresponding to the encrypted file satisfies a preset identifier; and
    若所述加密后的文件对应的应用不满足预设标识,则对所述加密后的文件不进行解密。If the application corresponding to the encrypted file does not satisfy the preset identifier, the encrypted file is not decrypted.
PCT/CN2018/077642 2017-09-30 2018-02-28 Source code protection method, application server, and computer-readable storage medium WO2019062015A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710914956.6 2017-09-30
CN201710914956.6A CN108399319B (en) 2017-09-30 2017-09-30 Source code protection method, application server and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2019062015A1 true WO2019062015A1 (en) 2019-04-04

Family

ID=63094492

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/077642 WO2019062015A1 (en) 2017-09-30 2018-02-28 Source code protection method, application server, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN108399319B (en)
WO (1) WO2019062015A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109040133A (en) * 2018-09-27 2018-12-18 上海点融信息科技有限责任公司 The method, apparatus and storage medium of intelligent contract are installed in block chain network
CN109409038A (en) * 2018-09-30 2019-03-01 北京梆梆安全科技有限公司 A kind of dynamic link library file cracks risk checking method and device
CN109460640A (en) * 2018-11-13 2019-03-12 杭州涂鸦信息技术有限公司 A kind of java applet guard method, device, equipment and readable storage medium storing program for executing
CN110267253B (en) * 2019-05-13 2022-09-27 中国联合网络通信集团有限公司 eSIM management platform, eSIM installation method and device
CN111274551B (en) * 2019-12-30 2023-06-27 上海上讯信息技术股份有限公司 Compiler-based java code protection method and device and electronic equipment
CN111367505A (en) * 2020-03-02 2020-07-03 广州致远电子有限公司 JavaScript source code secrecy method, device, equipment and storage medium
CN112966227A (en) * 2021-02-04 2021-06-15 南方电网深圳数字电网研究院有限公司 Code encryption and decryption method and device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103745141A (en) * 2013-12-02 2014-04-23 上海斐讯数据通信技术有限公司 Method for preventing application program in intelligent terminal android system from being decompiled
CN104462995A (en) * 2014-11-28 2015-03-25 福建畅云安鼎信息科技有限公司 Digital processing safety protection system
CN104881284A (en) * 2015-05-22 2015-09-02 国云科技股份有限公司 Efficient log operating method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060106801A1 (en) * 2004-11-12 2006-05-18 International Business Machines Corporation Securing location of an installed middleware application and securing location of containers contained within installed middleware application
EP2569693B1 (en) * 2010-05-09 2015-08-12 Citrix Systems, Inc. Methods and systems for forcing an application to store data in a secure storage location
CN102708322B (en) * 2012-05-12 2016-02-24 北京深思数盾科技有限公司 The guard method of JAVA application program in Android system
CN103955423B (en) * 2013-12-25 2017-01-11 中软信息系统工程有限公司 Test evaluation method of domestic JVM (Java Virtual Machine)
CN106709286A (en) * 2016-11-30 2017-05-24 江苏神州信源系统工程有限公司 Method for performing security reinforcement on apk resource package

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103745141A (en) * 2013-12-02 2014-04-23 上海斐讯数据通信技术有限公司 Method for preventing application program in intelligent terminal android system from being decompiled
CN104462995A (en) * 2014-11-28 2015-03-25 福建畅云安鼎信息科技有限公司 Digital processing safety protection system
CN104881284A (en) * 2015-05-22 2015-09-02 国云科技股份有限公司 Efficient log operating method

Also Published As

Publication number Publication date
CN108399319A (en) 2018-08-14
CN108399319B (en) 2021-07-16

Similar Documents

Publication Publication Date Title
WO2019062015A1 (en) Source code protection method, application server, and computer-readable storage medium
US10853270B2 (en) Cryptographic pointer address encoding
US9292684B2 (en) Systems and methods for security in computer systems
US20170295013A1 (en) Method for fulfilling a cryptographic request requiring a value of a private key
CN103530535A (en) Shell adding and removing method for Android platform application program protection
CN104680039B (en) A kind of data guard method and device of application program installation kit
CN111143869B (en) Application package processing method and device, electronic equipment and storage medium
CN106203006A (en) Android application reinforcement means based on dex Yu so file Dynamic Execution
KR102433011B1 (en) Method of apk file protection, apk file protection system performing the same, and storage medium storing the same
WO2016078130A1 (en) Dynamic loading method for preventing reverse of apk file
CN104268444A (en) Cloud OS Java source code protection method
CN109787768B (en) Identity authentication configuration method and device and computer readable storage medium
EP3264265A1 (en) Application protection method, server and terminal
WO2016201853A1 (en) Method, device and server for realizing encryption/decryption function
US20140059341A1 (en) Creating and accessing encrypted web based content in hybrid applications
CN114547558A (en) Authorization method, authorization control method and device, equipment and medium
US8918653B2 (en) Protection of interpreted source code in virtual appliances
CN110535642B (en) Method for distributing storage keys, intelligent terminal and storage medium
CN114547653B (en) Encryption method, decryption method, device, equipment and medium for development environment
CN109995534B (en) Method and device for carrying out security authentication on application program
CN114978649B (en) Information security protection method, device, equipment and medium based on big data
CN108021790B (en) File protection method and device, computing equipment and computer storage medium
CN111949996A (en) Generation method, encryption method, system, device and medium of security private key
US20080301654A1 (en) Program processing apparatus, program processing method and computer readable information recording medium
CN114091041A (en) Data transmission method, device, equipment and medium based on embedded equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18863039

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 28.09.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18863039

Country of ref document: EP

Kind code of ref document: A1