Java Protection
Java Class files contain lots of symbolic information stored in constant pool sector, including all variable names and method names. This symbolic information allows Java decompilers to reconstruct the source code easily. Without protection, anyone could use a Java decompiler to get the Java source code. According to its special characters and threats, there are the following available protection mechanisms in the market to prevent from tamper or piracy.
• Hardware-based protection
Use smart card or other chip types to embed the Java virtual machine engine in the hardware. The Java Class file will be downloaded into the hardware, and the protected application will call the token to retrieve the output parameters via sending the input parameters, and the Class file will be interpreted and executed internally. The performance and functions of this method will be restricted and impacted by the hardware configuration such as memory space, RAM, CPU, and so on.
• Class Isolation (HTTP, Web Service, and RPC)
Developer can place the Class files in the remote server machine to prevent the hacker to analyze the Class file. This method is ideal solution; however its cost and internet speed will impact developer’s decisions.
• Convert Java Class to Native Local Code
JNI allows developer to write sensitive native methods to enhance the difficulty of analysis by hackers because JNI file is machine code format. It needs developer to write the native local code by other languages.
• Java Class File Obfuscation
It allows developers to obfuscate (protect) their Java Class files. All symbolic information can be removed or modified. Traditionally it includes the following types: Lexical Obfuscation, Data Obfuscation, Control Obfuscation, and Prevent Transformation. Although there are many tools available in the market to adopting this method, the security of this method cann
Ïà¹ØÎĵµ£º
ʱ¼ä¶¯Ì¬ÏÔʾ
1.·½·¨Ò» ÓÃTimerTask
ÀûÓÃjava.util.TimerºÍjava.util.TimerTaskÀ´×ö¶¯Ì¬¸üУ¬±Ï¾¹Ã¿´Î¸üпÉÒÔ¿´×÷ÊǼÆÊ±1Ãë·¢ÉúÒ»´Î¡£
´úÂëÈçÏ£º
import java.awt.Dimension;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Timer;
import java.util ......
JCP SE/EE Ö´ÐÐίԱ»á
Õýʽ½ÓÊÜÁË
JSR 330
—— Dependency Injection for Java¡£¸Ã¹æ·¶ÓÚ ½ñÄê 5 Ô 9 ÈÕ
ÓÉ Google µÄ Bob Lee ÒÔ¼° SpringSource µÄ Rod Johnson ×÷Ϊ¹æ·¶Áìµ¼Ìá½»¸ø JCP£¬ÏÖÔÚÒѾÕýʽ·¢²¼£¬²»µÃ²»¸Ð̾¸Ã¹æ·¶±ê×¼»¯¹ý³ÌÖ®¿ì¡£ÔÚ ×îÖÕͶƱ½á¹ûÖÐ
£¬14 Ʊͨ¹ý£¬1 ƱδͶ£¬1 Ʊ·´¶Ô¡£
J ......
1.Listת»»³ÉΪÊý×é¡££¨ÕâÀïµÄListÊÇʵÌåÊÇArrayList)
µ÷ÓÃArrayListµÄtoArray·½·¨¡£
Àý£ºString[] arr = (String[])list.toArray(new String[size]);
2.Êý×éת»»³ÉΪList¡£
µ÷ÓÃArraysµÄasList·½·¨¡£
Àý£ºList stooges = Arrays.asList("Larry", "Moe", "Curly"); ......
ǰһÕóÔÚ¹«Ë¾ÀïʹÓà jconsle ʱһÇÐÕý³££¬È»¶øÔÚ¼ÒÖеĻúÆ÷ÉÏÈ´³öÏÖÁ˱êÌâËùʾµÄÎÊÌ⣺
jconsole ºÍ jps ÎÞ·¨ÏÔʾ±¾µØ Java ½ø³ÌÁÐ±í¡£
µ±Ê±Ö±½ÓÀûÓà -Dcom.sun.management.jmxremote.port=port Æô¶¯Ä¿±ê java ½ø³Ì£¬²¢ÔÚ jconsole ÖÐͨ¹ý localhost:port ·½Ê½³É¹¦Á¬½ÓÉÏÄ¿±ê java ½ø³Ì¡£ÓÐÁËÕâ¸ö work around Ö®ºó£¬¶ÔÕ ......
¼òµ¥µÄ˵µ¥Àý¾ÍÊÇ Ö»ÄÜÓÐÒ»¸öʵÀý£¬ËùÒԵط½Óõ½µÄʵÀý¶¼ÊÇͬһ¸ö¡£
¾ÍºÃÏñ¼ÒÈ˳Է¹£¬×À×ÓÊǵ¥ÀýµÄ£¬´ó¼ÒÓõÄÊÇͬһ¸ö¡£¶øÍëÊǶàÀýµÄ£¬Ã¿È˶¼ÓÐ×Ô¼¸µÄ¡£ ÏÂÃæÊǾßÌåµÄÀý×Ó£º
Javaģʽ֮µ¥Àýģʽ£º
µ¥Àýģʽȷ±£Ò»¸öÀàÖ»ÓÐÒ»¸öʵÀý£¬×ÔÐÐÌṩÕâ¸öʵÀý²¢ÏòÕû¸öÏµÍ ......