core-lib / xjar Goto Github PK
View Code? Open in Web Editor NEWSpring Boot JAR 安全加密运行工具,支持的原生JAR。
License: Apache License 2.0
Spring Boot JAR 安全加密运行工具,支持的原生JAR。
License: Apache License 2.0
jdk 1.8
xjar 2.0.9
无法运行,提示:
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by io.xjar.boot.XBootClassLoader (file:/Users/jessica/Documents/Project%20Code/dwz/target/dwz-0.0.1-SNAPSHOT.xjar) to field java.net.URLClassLoader.ucp WARNING: Please consider reporting this to the maintainers of io.xjar.boot.XBootClassLoader WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/URLClassPath at io.xjar.boot.XBootClassLoader.<init>(XBootClassLoader.java:40) at io.xjar.boot.XJarLauncher.createClassLoader(XJarLauncher.java:31) at org.springframework.boot.loader.Launcher.createClassLoader(Launcher.java:65) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at io.xjar.boot.XJarLauncher.launch(XJarLauncher.java:26) at io.xjar.boot.XJarLauncher.main(XJarLauncher.java:22) Caused by: java.lang.ClassNotFoundException: sun.misc.URLClassPath at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 6 more
如果是springboot项目的一个子模块,里面全是工具类,没有入口函数,要怎么加密?不好意思因为我没看懂你这段代码是只能写在main函数那里吗?
a jar 包 引用了 多个三方包
a 加密 第三方包不加密
a 和 第三方包都在 lib 目录下
a jar 包中与第三方包有继承关系 必须要有第三方包才能运行
a jar 解密后 运行不要 继承的类 转换 不了 第三方父类 导致 运行错误
2019-09-16 09:53:29.771 INFO 1 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.3.11.Final}
2019-09-16 09:53:29.775 INFO 1 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2019-09-16 09:53:29.987 INFO 1 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2019-09-16 09:53:30.304 WARN 1 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
2019-09-16 09:53:30.306 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2019-09-16 09:53:30.327 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2019-09-16 09:53:30.336 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2019-09-16 09:53:30.357 INFO 1 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-09-16 09:53:30.363 ERROR 1 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204)
at com.fd.weretail.MerchantApplication.main(MerchantApplication.java:17)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
Caused by: java.lang.ExceptionInInitializerError: null
at org.hibernate.boot.archive.internal.StandardArchiveDescriptorFactory.buildArchiveDescriptor(StandardArchiveDescriptorFactory.java:55)
at org.hibernate.boot.archive.internal.StandardArchiveDescriptorFactory.buildArchiveDescriptor(StandardArchiveDescriptorFactory.java:37)
at org.hibernate.boot.archive.scan.spi.AbstractScannerImpl.buildArchiveDescriptor(AbstractScannerImpl.java:64)
at org.hibernate.boot.archive.scan.spi.AbstractScannerImpl.scan(AbstractScannerImpl.java:46)
at org.hibernate.boot.model.process.internal.ScanningCoordinator.coordinateScan(ScanningCoordinator.java:76)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.prepare(MetadataBuildingProcess.java:99)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:232)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:167)
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:51)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:390)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:377)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774)
... 24 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.hibernate.boot.archive.internal.JarFileBasedArchiveDescriptor.<clinit>(JarFileBasedArchiveDescriptor.java)
... 39 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at net.bytebuddy.dynamic.Nexus.initialize(Nexus.java:137)
... 44 common frames omitted
Caused by: java.lang.UnsupportedOperationException: Cannot get package using reflection: Cannot define nest member class java.lang.reflect.AccessibleObject$Cache + within different package then class net.bytebuddy.mirror.AccessibleObject
at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$Initializable$Unavailable.getPackage(ClassInjector.java:418)
at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.injectRaw(ClassInjector.java:220)
at net.bytebuddy.dynamic.loading.ClassInjector$AbstractBase.inject(ClassInjector.java:112)
at net.bytebuddy.agent.builder.AgentBuilder$InitializationStrategy$SelfInjection$Dispatcher$InjectingInitializer.onLoad(AgentBuilder.java:3141)
... 49 common frames omitted
[root@localhost project]# ll
-rw-r--r--. 1 root root 8 11月 20 13:57 a.key
-rw-------. 1 root root 598 11月 20 13:54 nohup.out
-rw-r--r--. 1 root root 214288661 11月 20 13:48 orange-encrypt.jar
[root@localhost project]# nohup java -jar ./orange-encrypt.jar --xjar.keyfile=./a.key | tailf -300 nohup.out
password:Exception in thread "main" java.util.NoSuchElementException: No line found
at java.util.Scanner.nextLine(Scanner.java:1540)
at io.xjar.XLauncher.(XLauncher.java:143)
at io.xjar.boot.XJarLauncher.(XJarLauncher.java:18)
at io.xjar.boot.XJarLauncher.main(XJarLauncher.java:22)
password:Exception in thread "main" java.util.NoSuchElementException: No line found
at java.util.Scanner.nextLine(Scanner.java:1540)
nohup: at io.xjar.XLauncher.(XLauncher.java:143)
at io.xjar.boot.XJarLauncher.(XJarLauncher.java:18)
at io.xjar.boot.XJarLauncher.main(XJarLauncher.java:22)
现在jar的加密和解密都是使用相同的密码输入。能否采用公钥和私钥的方式?
如果是springboot项目的一个子模块,里面全是工具类,没有入口函数,要怎么加密?不好意思因为我没看懂你这段代码是只能写在main函数那里吗?
前端用户密码等敏感信息会进行RSA加密传输到后台处理。
后台解密会用到如bcprov-jdk15on包,但此包是带签名的,加密时,这类jar包能不能不重新打包,重新打包签名会失效报错。
直接替换掉加密后的bcprov-jdk15on包,启动会报错
Exception in thread "main" java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/bcprov-jdk15on-1.60.jar at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:108) at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:87) at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:69)
能不能给个提示如何处理?
Exception in thread "main" java.lang.IllegalStateException: Failed to get nested archive for entry WEB-INF/lib/netty-codec-4.1.34.Final.jar
at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:108)
at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:86)
at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:70)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:49)
at io.xjar.boot.XWarLauncher.launch(XWarLauncher.java:25)
at io.xjar.boot.XWarLauncher.main(XWarLauncher.java:21)
Caused by: java.io.IOException: Unable to open nested jar file 'WEB-INF/lib/netty-codec-4.1.34.Final.jar'
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:256)
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:241)
at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:103)
... 5 more
Caused by: java.lang.IllegalStateException: Unable to open nested entry 'WEB-INF/lib/netty-codec-4.1.34.Final.jar'. It has been compressed and nested jar files must be stored without compression. Please check the mechanism used to create your executable jar file
at org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(JarFile.java:284)
at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:264)
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:252)
... 7 more
Springboot 打的war包
public class EncryptMyJar {
public static void main(String[] args) throws Exception {
String pwd = "123456";
System.out.println("start");
File plaintext = new File("a.war");
File encrypt = new File("b.war");
System.out.println("middle");
XBoot.encrypt(
plaintext,
encrypt,
pwd,
(entry) -> {
String name = entry.getName();
System.out.println("entry");
System.out.println(name);
String pkg = "WEB-INF/classes/com/a/b";
// String pkg = "WEB-INF/classes/com/a/b";
return name.startsWith(pkg);
}
);
System.out.println("end");
}
}
加密后要解密才能运行?
在java 参数后边 带上 -agentpath 就可以截取到源码了?
java.util.zip.ZipException: Unexpected record signature: 0X622F2123
at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.getNextZipEntry(ZipArchiveInputStream.java:260)
at org.apache.commons.compress.archivers.jar.JarArchiveInputStream.getNextJarEntry(JarArchiveInputStream.java:56)
at io.xjar.boot.XBootEncryptor.encrypt(XBootEncryptor.java:79)
at io.xjar.boot.XBoot.encrypt(XBoot.java:364)
at io.xjar.boot.XBoot.encrypt(XBoot.java:307)
at io.xjar.boot.XBoot.encrypt(XBoot.java:249)
at io.xjar.boot.XBoot.encrypt(XBoot.java:234)
at io.xjar.boot.XBoot.encrypt(XBoot.java:220)
at io.xjar.boot.XBoot.encrypt(XBoot.java:207)
at com.ftvalue.XjarEncrypt.main(XjarEncrypt.java:17)
加密之前是97M,加密之后是222M,这都翻倍了。有什么办法解决这个问题么,尽量小点。
可否提供一个加密算法,通过命令行对用户的密码做一次加密,加密串作为密钥文件的password值,运行时,在程序内部通过算法解密后得到解密口令,从而解密class文件,用户无法通过加密串直接解密class文件。
加密算法可不公开,或采用不易被反编译的语言编写。
正常运维中,很难保证不出现服务器重启的情况,删除密钥文件,会造成不i必要的运维成本。请酌情考虑。
感谢您喝您的团队卓越的贡献。
Originally posted by @lineezhang in #1 (comment)
请问这种加密方式,支持tomcat部署吗?
修改XLauncher(最直接、最笨的办法)
public class XLauncher implements XConstants { public final String[] args; public final XDecryptor xDecryptor; public final XEncryptor xEncryptor; public final XKey xKey; public XLauncher(String... args) throws Exception { this.args = args; String algorithm = DEFAULT_ALGORITHM; int keysize = DEFAULT_KEYSIZE; int ivsize = DEFAULT_IVSIZE; **String password = "xxxxxxxxxxxxxxxx";** String keypath = null; ... ...
使用命令运行jar的时候,不报错,但不会加载jar包,直接结束了。
`D:\workspace>java -agentlib:xjar -jar xxx-encrypted.jar
(命令行下无任何信息)
D:\workspace>
OK.
C++ 解密部分代码
//解密 mbedtls_aes_crypt_ecb( &aes_ctx, MBEDTLS_AES_DECRYPT, input, outout ); if (b == 381) { // 分块后剩余字节数 memcpy(&dest[6096], outout, **9**); } else { memcpy(&dest[b * 16], outout, 16); } b++;
分块数目和输出字节需要根据生成的数据大小重新计算。本人获取得大小为6672 .b=417
if (b == 417) { // 分块后剩余字节数 memcpy(&dest[6672], outout, 0); }
成功运行
Originally posted by @Ftrybe in #1 (comment)
我在我的springboot项目里使用了jpa,然后用xjar加密运行报错:
org.hibernate.boot.archive.spi.ArchiveException: Could not build ClassFile
如果只是单独运行jar不会报错
生成的xjar怎么运行
请问一下,在危险加密模式下,怎么才能把加密后包下的 META-INF/MANIFEST.MF 中的密钥去掉或者隐藏掉??
Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/URLClassPath
at io.xjar.boot.XBootClassLoader.(XBootClassLoader.java:40)
at io.xjar.boot.XJarLauncher.createClassLoader(XJarLauncher.java:31)
at org.springframework.boot.loader.Launcher.createClassLoader(Launcher.java:64)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:49)
at io.xjar.boot.XJarLauncher.launch(XJarLauncher.java:26)
at io.xjar.boot.XJarLauncher.main(XJarLauncher.java:22)
Caused by: java.lang.ClassNotFoundException: sun.misc.URLClassPath
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 6 more
难道是版本问题?
docker+xjar如何部署?
支持有kotlin开发的springBoot项目吗?
你好,我的spring boost 项目里面 只想排除 BOOT-INF/classes/vue这个文件夹里的东西不加密,要怎么弄呢?谢谢
class.getSource().getParentFile().getPath()
class.getProtectionDomain().getCodeSource().getLocation().getFile()
凡是加密的代码 用类似这样的代码 都报java.lang.NullPointerException
有什么解决办法吗 老大 是为什么啊
hello,是这样的。最近在用xjar加密了一个spring cloud项目,加密后的程序可以运行起来,但是某个接口请求处理过程中就出错了。这个接口会调用hutool的SecurityUtil.aes()去解密一个东西,这个方法内部会创建一个Cipher,Cipher内部会校验jar包,结果校验到bcpkix-jdk15on这个jar包(在BOOT-INF/lib中)时就出错了。因为这个jar包本身做了签名,xjar处理后的jar包计算出来的签名,与这个jar包里面的manifest的签名不匹配,所以报错了。不知道之前有没有人报过这个问题,如果需要更多的信息可以找我了解,谢谢
Eclipse能提示import加密后jar包中class,但import后还是编译不通过,Eclipse提示错误。帮忙看看如何解决?
如果对原始的jar直接签名,则没有问题。对xjar加密有的包进行签名,启动报错
我看了一下加密后的xjar,其中的XBootClassLoader很容易就反编译出来了。
请问对于ClassLoader的保密有没有什么方案?
大牛,启动时参数带了密码,如何防止被用密码解密。能否将危险模式里的密码再度加解密,使得即使有密码也不能反编译
目前发现 好像只能通过-Dxjar.password=io.xjar,这种jvm参数的形式。是否支持配置环境变量的方式呢?把密码配在本地环境变量里。
使用文档提到的java agent方式通过秘钥文件运行,因为使用默认加密,所以密钥文件里只填写了密码,结果运行时,只打印出来springBoot刚开始运行的banner图,后续没有日志了,访问端口也访问不了?请问是我配置问题吗?springBoot版本为2.1.7.RELEASE,采取的方式为使用maven打包出jar,再用户xjar加密得到加密包,通过clone下来的agent工程的jar和密钥文件去运行加密包
错误: 找不到或无法加载主类 io.xjar.boot.XBootLauncher
程序能加密后能正常启动成功,但是一旦访问首页或者接口就会报。
项目框架采用spring boot 2+spring data jpa,已经使用agent做了代理启动。
启动命令: java -javaagent:xjar-agent-hibernate-v1.0.0.jar -jar admin-1.0.0-SNAPSHOT.xjar
我们的业务场景是,我们对jar包加密是防止反编译,并不介意用户去使用jar包。所以对于运行时的密码并不是很在意。
现在是解密跟运行时的密码都是一个,那就增加了泄漏的风险
作者大大要不要考虑一下扩展这个功能呢?
通过在pom.xml文件中添加xjar-maven-plugin插件,抛出异常: java.lang.ClassNotFoundException: org.apache.commons.compress.archivers.jar.JarArchiveInputStream。
maven的本地仓库明明有org.apache.commons/commons-compress 1.18版本的jar
你好,我的SpringBoot工程src\main\resources\static下有html文件,加密时不设置任何过滤器,然后以
java -jar /path/to/encrypted.jar --xjar.password=PASSWORD 方式做解密运行,Log显示SpringBoot项目已成功启动,但是在浏览器上访问html文件,始终处于等待响应的状态。请问是什么原因呢?谢谢。
数据是否完整正常,今天测试看看效果,,是spring boot2.2的项目
感谢作者的项目
问题描述:
前言: xjar是后来引入到系统中的,因为部署方式已经确定了,早期 配置的build配置已经将resource目录给排除出去了 项目最终部署环境是 linux
部分代码(去掉了 拷贝等的plugin
`
<!--不打包资源文件-->
<excludes>
<exclude>*.**</exclude>
<exclude>*/*.xml</exclude>
</excludes>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<!--MANIFEST.MF 中 Class-Path 加入前缀-->
<classpathPrefix>lib/</classpathPrefix>
<!--jar包不包含唯一版本标识-->
<useUniqueVersions>false</useUniqueVersions>
<!--指定入口类-->
<mainClass>----</mainClass>
</manifest>
<manifestEntries>
<!--MANIFEST.MF 中 Class-Path 加入资源文件目录-->
<Class-Path>./resources/</Class-Path>
</manifestEntries>
</archive>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
`
然后引入的时候采用的是 在test中执行XBoot.encrypt 将 jar包加密 然后再解密运行(使用解密文件)
但出现一个问题, 代码中有这么一句话
ResourceUtils.getURL("classpath:").getPath() + "static/xxx文件路径";
在没有加密解密的情况下是能正常返回路径的
但是加密后 变成了:
原本正确的项目路径+ /lib/log4j-api-2.10.0.jar!/META-INF/version/9/static/xxx文件路径
然后File自然索引不到路径 抛出错误
以上 (不过有可能是因为没有配置排除静态文件加密的原因 , 请原谅我没有去对比验证,如果作者没有遇到相关问题,我会去进行对比验证的~)
吐槽:
因为各种环境&实力原因 最终项目没有用混淆,也没有用docker 进行部署, 然后还要配置 服务自启动, 所以用的是sh脚本启动的jar 所以用的是 密码文件 解密的方式 进行解密 hhh 感觉ps ef 也是能找到的 只是加大了解密的难度, 毕竟不认识这个项目就不知道怎么解 hhh
谢谢.~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.