- 浏览: 108765 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
masuweng:
JAVA对数字证书的常用操作 -
beming:
org.springframework.beans.facto ...
利用Ant与Proguard混淆引用的子工程项目jar包及打war包 -
beming:
不错,挺清晰的
利用Ant与Proguard混淆引用的子工程项目jar包及打war包 -
sotired:
mark,看看
ExtJs2.0学习系列 - 索引贴
当前的web项目有引用到子工程项目,而且多个子工程项目也有引用到其它的工程项目,现要求利用Ant自动将web项目打包成war包,其中引用到的子工程项目需打成jar包,而且必须是混淆后的jar包。其中混淆代码的工具选择了开源的Proguard(http://proguard.sourceforge.net/),可以运行proguard自带的proguardgui.jar(图形化用户界面)生成proguard配置文件。
ProGuard是一个免费的java类文件压缩,优化,混淆器.它探测并删除没有使用的类,字段,方法和属性.它删除没有用的说明并使用字节码得到最大优化.它使用无意义的名字来重命名类,字段和方法.
ProGuard的使用是为了:
1.创建紧凑的代码文档是为了更快的网络传输,快速装载和更小的内存占用.
2.创建的程序和程序库很难使用反向工程.
3.所以它能删除来自源文件中的没有调用的代码
4.充分利用java6的快速加载的优点来提前检测和返回java6中存在的类文件.
参数:
-include {filename} 从给定的文件中读取配置参数
-basedirectory {directoryname} 指定基础目录为以后相对的档案名称
-injars {class_path} 指定要处理的应用程序jar,war,ear和目录
-outjars {class_path} 指定处理完后要输出的jar,war,ear和目录的名称
-libraryjars {classpath} 指定要处理的应用程序jar,war,ear和目录所需要的程序库文件
-dontskipnonpubliclibraryclasses 指定不去忽略非公共的库类。
-dontskipnonpubliclibraryclassmembers 指定不去忽略包可见的库类的成员。
保留选项
-keep {Modifier} {class_specification} 保护指定的类文件和类的成员
-keepclassmembers {modifier} {class_specification} 保护指定类的成员,如果此类受到保护他们会保护的更好
-keepclasseswithmembers {class_specification} 保护指定的类和类的成员,但条件是所有指定的类和类成员是要存在。
-keepnames {class_specification} 保护指定的类和类的成员的名称(如果他们不会压缩步骤中删除)
-keepclassmembernames {class_specification} 保护指定的类的成员的名称(如果他们不会压缩步骤中删除)
-keepclasseswithmembernames {class_specification} 保护指定的类和类的成员的名称,如果所有指定的类成员出席(在压缩步骤之后)
-printseeds {filename} 列出类和类的成员-keep选项的清单,标准输出到给定的文件
压缩
-dontshrink 不压缩输入的类文件
-printusage {filename}
-whyareyoukeeping {class_specification}
优化
-dontoptimize 不优化输入的类文件
-assumenosideeffects {class_specification} 优化时假设指定的方法,没有任何副作用
-allowaccessmodification 优化时允许访问并修改有修饰符的类和类的成员
混淆
-dontobfuscate 不混淆输入的类文件
-printmapping {filename}
-applymapping {filename} 重用映射增加混淆
-obfuscationdictionary {filename} 使用给定文件中的关键字作为要混淆方法的名称
-overloadaggressively 混淆时应用侵入式重载
-useuniqueclassmembernames 确定统一的混淆类的成员名称来增加混淆
-flattenpackagehierarchy {package_name} 重新包装所有重命名的包并放在给定的单一包中
-repackageclass {package_name} 重新包装所有重命名的类文件中放在给定的单一包中
-dontusemixedcaseclassnames 混淆时不会产生形形色色的类名
-keepattributes {attribute_name,...} 保护给定的可选属性,例如LineNumberTable, LocalVariableTable, SourceFile, Deprecated, Synthetic, Signature, and InnerClasses.
-renamesourcefileattribute {string} 设置源文件中给定的字符串常量
因为我们开发的是struts2+spring+openjpa的架构的项目,所有需要很详细的配置,其中proguard需要的injars,outjars还有其它的一些libraryjars在Ant的build.xml文件以参数形式加入。
proguard.pro文件具体内容:
-libraryjars <java.home>/lib/rt.jar
-libraryjars <java.home>/lib/jce.jar
-libraryjars <java.home>/lib/jsse.jar
-obfuscationdictionary dictionaries/compact.txt
-classobfuscationdictionary dictionaries/shakespeare.txt
# -printmapping proguard.map
-overloadaggressively
-defaultpackage ''
# -flattenpackagehierarchy ''
# -dontusemixedcaseclassnames
# -keeppackagenames
-allowaccessmodification
-dontoptimize
# 因为项目中使用到了jpa的Annotation注解,需要保留这个属性
-keepattributes *Annotation*
# Keep web listener-class,自己编写的web listener,不能混淆,不然启动服务的时候会报错
-keep public class com.test.mylistener {
public protected *;
}
# Keep jpa dao, 自身编写的一些dao接口不能混淆,而且如果是有被spring管理的dao, 也应该不进行混淆
-keep public class com.test.dao.* {
public protected *;
}
# 其中jpa dao中使用到的一些重要接口也能进行混淆
-keep public class com.test.persistence.core.QueryLiteral {
public protected *;
}
-keep public class com.test.persistence.JpaDao {
public protected *;
}
# Keep beans managed by spring framework,spring管理的bean不进行混淆
-keep public class com.test.provider.* {
public protected *;
}
# Keep Network interface
-keep public class com.test.loader.Network {
public protected *;
}
# Keep entity classes extends java.io.Serializable
# 保留jpa中使用到的所有实体类,不进行混淆
-keep public class * implements java.io.Serializable{
public protected private *;
}
-keep public class com.test.entity.* {
public protected private *;
}
# Keep - Applications. Keep all application classes, along with their 'main' methods.
-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}
# Keep names - Native method names. Keep all native class/method names.
-keepclasseswithmembers,allowshrinking class * {
native <methods>;
}
proguard和build.xml文件具体目录结构:
server工程
-src目录
-build目录
-proguard目录
-dictionaries 主要存放混淆时需要用到字典文件,可以使用官网下载到的proguard.zip包中dictionaries的两个文件(dictionaries/compact.txt,dictionaries/shakespeare.txt)
-lib 存放proguard.jar包,这是混淆中使用到的最主要的一个jar包(下载到的proguard.zip中)
-proguard.pro 主要的混淆配置文件
-build.xml
Ant的build.xml文件编写如下:
<?xml version="1.0" encoding="UTF-8"?>
<project name="com.ibm.crl.scm.crc.server" default="dist" basedir=".">
<target name="init" description="设置初始化打war包需要的路径变量">
<!-- 你的eclipse工作空间站目录路径,以备引用到子工程项目使用-->
<property name="workspace" value="${basedir}/../"/>
<!-- 需要被打包成war包的主工程项目-->
<property name="server.name" value="server"/>
<!-- 主工程项目引用到的其它子工程项目-->
<property name="childproject1.name" value="childproject1"/>
<property name="childproject2.name" value="childproject2"/>
<property name="src" value="${basedir}/src"/>
<property name="resources" value="${basedir}/resources"/>
<property name="lib" value="${basedir}/WebContent/WEB-INF/lib"/>
<property name="webapp" value="${basedir}/WebContent"/>
<property name="proguard" value="${basedir}/proguard"/>
<property name="proguard.lib" value="${proguard}/lib"/>
<property name="build.src" value="${basedir}/build/src"/>
<property name="build.dest" value="${basedir}/build/WEB-INF/classes"/>
<property name="buildwar.dest" value="${basedir}/build/server"/>
<property name="war.dest" value="${basedir}/build/war"/>
<!-- 该目录是存储引用到的子工程混淆后的jar包-->
<property name="referenced.lib" value="${basedir}/build/referenced"/>
<path id="classpath">
<fileset dir="${referenced.lib}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
</target>
<target name="prepare" depends="init" description="创建打包需要的路径,拷贝源文件到打包路径下">
<mkdir dir="${build.src}"/>
<mkdir dir="${build.dest}"/>
<mkdir dir="${buildwar.dest}"/>
<mkdir dir="${war.dest}"/>
<mkdir dir="${referenced.lib}"/>
<copy todir="${build.src}">
<fileset dir="${src}"/>
<fileset dir="${resources}"/>
</copy>
<copy todir="${buildwar.dest}">
<fileset dir="${webapp}"/>
</copy>
</target>
<!-- 因为当前我们项目中,各个子工程项目有互相引用的情况,打包成jar包就成问题了,所以直接将eclipse自动编译的.class文件打包成jar包,然后再进行混淆-->
<target name="references" depends="prepare" description="将引用到的子工程打包成jar文件">
<jar destfile="${referenced.lib}/${childproject1.name}.jar">
<fileset dir="${workspace}/${childproject1.name}/bin"/>
</jar>
<jar destfile="${referenced.lib}/${childproject2.name}.jar">
<fileset dir="${workspace}/${childproject2.name}/bin"/>
</jar>
</target>
<target name="proguard" depends="references" description="混淆引用到的子工程jar文件,并替换">
<taskdef resource="proguard/ant/task.properties" classpath="${proguard.lib}/proguard.jar" />
<proguard configuration="${proguard}/proguard.pro">
<injar file="${referenced.lib}/${childproject1.name}.jar"/>
<outjar file="${referenced.lib}/OB_${childproject1.name}.jar"/>
<injar file="${referenced.lib}/${childproject2.name}.jar"/>
<outjar file="${referenced.lib}/OB_${childproject2.name}.jar"/>
<libraryjar dir="${lib}"/>
</proguard>
<move file="${referenced.lib}/OB_${childproject1.name}.jar" tofile="${referenced.lib}/${childproject1.name}.jar"/>
<move file="${referenced.lib}/OB_${childproject2.name}.jar" tofile="${referenced.lib}/${childproject2.name}.jar"/>
</target>
<target name="build" depends="proguard" description="编译java文件,拷贝properties属性配置文件到编译后的路径下">
<javac srcdir="${build.src}" destdir="${build.dest}">
<classpath refid="classpath"/>
</javac>
<copy todir="${build.dest}">
<fileset dir="${build.src}">
<include name="**/*.properties"/>
<include name="**/server.keystore"/>
<include name="**/*.xml"/>
</fileset>
</copy>
</target>
<target name="dist" depends="build" description="打war包,不将java文件打入包内">
<delete dir="${build.src}"/>
<war warfile="${war.dest}/${server.name}.war" webxml="${buildwar.dest}/WEB-INF/web.xml">
<lib dir="${referenced.lib}/"/>
<classes dir="${build.dest}"/>
<fileset dir="${buildwar.dest}"/>
</war>
<antcall target="clean"></antcall>
</target>
<target name="clean" depends="init" description="清除打包用临时文件">
<delete dir="${build.src}"/>
<delete dir="${basedir}/build/WEB-INF"/>
<delete dir="${buildwar.dest}"/>
</target>
<target name="cleanAll" depends="clean" description="清除所有打包生成文件">
<delete dir="${war.dest}"/>
<delete dir="${referenced.lib}"/>
</target>
</project>
评论
2 楼
beming
2012-08-12
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initContext': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sendtend.service.CacheService com.sendtend.service.InitContext.cacheService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.sendtend.service.CacheService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sendtend.service.CacheService com.sendtend.service.InitContext.cacheService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.sendtend.service.CacheService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
... 34 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.sendtend.service.CacheService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:924)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:793)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
... 36 more
八月 12, 2012 5:58:24 下午 org.apache.catalina.core.ApplicationContext log
严重: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initContext': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sendtend.service.CacheService com.sendtend.service.InitContext.cacheService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.sendtend.service.CacheService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sendtend.service.CacheService com.sendtend.service.InitContext.cacheService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.sendtend.service.CacheService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
... 34 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.sendtend.service.CacheService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:924)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:793)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
... 36 more
八月 12, 2012 5:58:24 下午 org.apache.catalina.core.StandardContext loadOnStartup
严重: Servlet threw load() exception
org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.sendtend.service.CacheService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:924)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:793)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sendtend.service.CacheService com.sendtend.service.InitContext.cacheService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.sendtend.service.CacheService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
... 34 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.sendtend.service.CacheService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:924)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:793)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
... 36 more
八月 12, 2012 5:58:24 下午 org.apache.catalina.core.ApplicationContext log
严重: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initContext': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sendtend.service.CacheService com.sendtend.service.InitContext.cacheService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.sendtend.service.CacheService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sendtend.service.CacheService com.sendtend.service.InitContext.cacheService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.sendtend.service.CacheService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
... 34 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.sendtend.service.CacheService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:924)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:793)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
... 36 more
八月 12, 2012 5:58:24 下午 org.apache.catalina.core.StandardContext loadOnStartup
严重: Servlet threw load() exception
org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.sendtend.service.CacheService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:924)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:793)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
1 楼
beming
2012-08-12
不错,挺清晰的
发表评论
-
Ant发布war包时,任务卡住不动也不报错
2011-06-22 15:52 2003使用ant给项目发布环境时,任务卡住不动也不报错,在网 ... -
Maven集成 - Eclipse IDE
2009-12-09 12:05 1214Maven Book(en) - http://www.son ... -
JMeter测试使用指南
2009-12-09 12:12 828JMeter是Apache组织的开放源代码项目,它是功能和性能 ... -
初识Firebug 全文 — firebug的使用
2009-12-14 18:12 745什么是Firebug 从事了数 ... -
使用Maven管理项目-----创建Struts2,Spring,Hibernate项目
2010-05-25 11:08 970Maven应该都听说过吧!一个构建工具!与Ant相比 ... -
Eclipse插件集锦
2010-06-09 15:11 7151)编写properties文件的插件一个不错的编写prope ... -
Eclipse中Annotation@提示
2010-06-18 13:16 837<meta http-equiv="CONTE ... -
windows和Ubuntu下Ant的安装使用
2010-06-24 11:32 1113前提是Java安装并配置完成:一、安装JDK(Ubuntu)从 ... -
Ubuntu中安装Chrome小记[解决 错误:依赖关系没有满足:libnss3-1d (>= 3.12.3)]
2010-06-25 11:20 3459适用于: Ubuntu9.04 Chrome ... -
Ant中的classpath配置和使用
2010-07-07 15:03 1507Ant手册中配置classpath采用classpath标签, ...
相关推荐
proguard最新版jar包混淆工具,能使部署的jar包不让对方破解
proguard混淆打包工具proguard混淆打包工具proguard混淆打包工具
Java的Jar包混淆器ProGuard v3.8是一款强大的代码优化和保护工具,主要用于Java和Android应用程序。在软件开发过程中,源代码的安全性和保密性至关重要,而ProGuard提供了一种有效的解决方案,它能够对编译后的字节...
这通常包括`<proguard>`标签,其中包含`injars`(输入的jar或apk)、`outjars`(输出的混淆后的jar或apk)、`libraryjars`(引用的库)和`proguard.config`(配置文件路径)等属性。 4. 更新`build.properties`文件...
本实例使用的是把web项目中的源码(src)所有文件打包成jar文件,使用proguard混淆后再把jar文件以及jar解压后的混淆class类文件替换原war项目的相应位置即可。 混淆过程中需要使用keep参数来保持原有一些属性、注解...
WEB Maven 项目 ProGuard 混淆方案 POM文件,包含详细混淆注释 具体请参考博客: http://blog.csdn.net/wltj920/article/details/48970869#comments
ProGuard是一款强大的代码混淆、优化和压缩工具,它可以帮助开发者将Java字节码混淆为难以阅读的形式,从而增加逆向工程的难度。本篇文章将详细探讨如何在一个Spring Boot的Maven工程中集成并使用ProGuard进行代码...
"Proguard混淆Web项目(Spring+Struts2+Mybatis)"是一个针对这类需求的实践案例,它利用了Proguard这一强大的代码混淆、优化和压缩工具。下面我们将深入探讨Proguard的相关知识点及其在Web项目中的应用。 Proguard...
本文主要探讨如何在NetBeans环境下配置Ant构建系统来实现ProGuard的混淆编译过程。 首先,理解ProGuard是Android SDK自带的一个代码混淆工具,它可以将Java字节码转换为更难阅读的形式,防止反编译,同时还能去除未...
proguard混淆jar包提示错误:Unknown verification type [*] in stack map frame 解决方案:找到proguard源码中proguard\src\proguard\classfile\ClassConstants.java类,然后修改ATTR_StackMapTable的值,将原来的...
android proguard5.3.3混淆包 替换Jar包以后使 混淆的类名方法名变成空白 使用方法 直接 替换 5.3.3版本的 混淆jar包 Mac 路径为 Contents/gradle/m2repository/net/sf/proguard/proguard-base Win gradle/m2...
本文将深入探讨如何在Maven管理的Java Web项目中集成ProGuard工具来实现代码混淆功能,以及在过程中可能遇到的问题及解决方案。 首先,让我们了解什么是ProGuard。ProGuard是一个开源的Java字节码混淆器、优化器和...
为了保护应用程序不被恶意篡改或逆向工程,开发者通常会采用一系列技术手段,其中就包括使用`ProGuard`进行代码混淆以及利用`dex2jar`进行反编译。本文将详细讲解这两个工具的工作原理、使用方法及其在实际应用中的...
总结,Java jar包的混淆加密是提升代码安全的重要手段,通过ProGuard等混淆工具和加密技术,可以有效降低源代码被逆向工程分析的风险。然而,安全是一个持续的过程,开发者应始终保持警惕,及时更新和优化保护策略。
在Android应用开发中,为了保护代码安全和优化应用性能,我们常常会使用Proguard工具进行代码混淆、优化和压缩。本文将深入探讨如何修改Proguard混淆规则,以及如何自定义字符集,以满足特定需求。 Proguard是...
添加支持库,例如 MyEclipse 项目中的 Library jars,例如 ant.jar、aopalliance-1.0.jar 等,点击右边的“add”按钮添加这些 Jar 包。 6. 设置混淆选项 设置混淆选项,例如 Shrinking、Obfuscation、Optimization...
ProGuard的配置文件通常命名为`proguard.cfg`,在该文件中,我们可以定义混淆规则,比如保留特定包或类不被混淆,以及设置混淆策略等。 1. **ProGuard配置** 在`proguard.cfg`文件中,我们需要指定哪些类和包需要...
ProGuard是一款强大的Java字节码处理工具,常用于Android应用的代码混淆、优化、压缩和预校验。在开发过程中,为了保护代码安全,避免反编译,开发者通常会使用ProGuard进行混淆,使得源代码变得难以理解。下面将...
**ProGuard工具包详解——Java代码混淆** 在Java开发中,为了提高应用程序的安全性和保护知识产权,开发者常常会使用一种称为“代码混淆”的技术。ProGuard是Android和Java平台上的一个强大的开源工具,它能实现...