软加密
parent
0c00e7f29b
commit
7842d651f3
Binary file not shown.
@ -0,0 +1,29 @@
|
|||||||
|
package encryptor;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
public class Encryptor {
|
||||||
|
public native String encryptStr(String str);
|
||||||
|
static
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
String path = System.getProperty("user.dir")+"\\libs\\encrypt";
|
||||||
|
System.out.println(path);
|
||||||
|
System.setProperty("java.library.path", path);
|
||||||
|
Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths");
|
||||||
|
fieldSysPath.setAccessible(true);
|
||||||
|
fieldSysPath.set(null, null);
|
||||||
|
|
||||||
|
System.loadLibrary("Encryptor");
|
||||||
|
}catch(Exception e)
|
||||||
|
{
|
||||||
|
System.out.println(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static void main(String[] args)
|
||||||
|
{
|
||||||
|
Encryptor encryptor = new Encryptor();
|
||||||
|
String noEncrypt = "12345";
|
||||||
|
String encrypt = encryptor.encryptStr(noEncrypt);
|
||||||
|
System.out.println(encrypt);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue