Patent 9665730 was granted and assigned to FEITAN Technologies Co., Ltd. on May, 2017 by the United States Patent and Trademark Office.
A method for protecting java program is provided, which relates the field of software protection. The method includes: java virtual machine loading class file; transplanting java instruction corresponding java class method into preset buffer when java instruction corresponding to java class method in class file meets preset condition of portable instruction; obtaining the deepest stack level and the maximum number of local variable of java class method, java class method for obtaining stack and local variable, java method executing the virtual machine in encryption lock and java class method for modifying stack and local variable are filled into position of the transplanted java instruction in class file. By the technical solution, a part of java instructions are transplanted into the encryption lock, the java programs protected are modified, the logic of which is incomplete, and the original code cannot be restored, the security of the which are improved.