obfuscation


How to manage Spring Getters and Setters Obfuscation in yguard


Hi i use yguard ant task to obfuscate my project, it goes well with renaming my java classes, and corresponding bean in spring xml files, but since the getter and setter methods are also renamed in java, the property names in spring injection does not match.. So i am unable to proceed. can any one tell me how to exclude setters and getters alone from obfuscating?
YGuard is not very good in this part, but why don't you try ProGaurd?
You can refer to ProGaurd examples section (http://proguard.sourceforge.net/index.html#manual/examples.html) which say:
Processing bean classes
If your application, applet, servlet, library, etc., makes extensive use of introspection on bean classes to find bean editor classes, or getter and setter methods, then configuration may become painful. There's not much else you can do than making sure the bean class names, or the getter and setter names don't change. For instance:
-keep public class mypackage.MyBean {
public void setMyProperty(int);
public int getMyProperty();
}
-keep public class mypackage.MyBeanEditor
If there are too many elements to list explicitly, wildcards in class names and method signatures might be helpful. This example should encompasses all possible setters and getters in classes in the package mybeans:
-keep class mybeans.** {
void set*(***);
void set*(int, ***);
boolean is*();
boolean is*(int);
*** get*();
*** get*(int);
}
The '***' wildcard matches any type (primitive or non-primitive, array or non-array). The methods with the 'int' arguments matches properties that are lists.
and if you also use annotations in your application:
Processing resource injection
If your application is using Java EE-style resource injection, the application container will automatically assign instances of resource classes to fields and methods that are annotated with #Resource. The container applies introspection, even accessing private class members directly. It typically constructs a resource name based on the type name and the class member name. We then have to avoid that such class members are removed or renamed:
-keepclassmembers class * {
#javax.annotation.Resource *;
}
The Spring framework has another similar annotation #Autowired:
-keepclassmembers class * {
#org.springframework.beans.factory.annotation.Autowired *;
}

Related Links

Obfuscating SharpDX assemblies
Ignore method during Proguard Obfuscation
log4j2 doesnot print exception logs for obfuscated code
Obfuscation causes VerifyError: Expecting a stackmap frame
Obfuscated assembly detected by antivirus ( false positive)
Automatically log error and terminate application with SmartAssembly
Protect AdWords Scripts
JS obfuscation not working?
Obfuscate single package with all dependencies
Obfuscating names with human readable names
Linux based virus / malware source code in C [closed]
Keep class methods but obfuscate packages in proguard
Mono.Cecil - obfuscated malicious code
TypeScript Obfuscation
.NET Reactor and InnoSetup
Theory of obfuscation and symbolic computation

Categories

HOME
uml
asp.net-web-api
fpga
mjml
spring-data-mongodb
entity-framework-core
tail
nuget-package
android-json
teechart
openpyxl
github-enterprise
stellar.js
mathprog
easyphp
google-container-registry
jmp
selinux
sar
spring-async
href
monit
highstock
xcode-ui-testing
jackson-modules
corpus
fragment-backstack
android-maps
soot
sinch
sqlpackage
ntp
magento-1.8
cart
joomla2.5
installscript
slacktextviewcontroller
xajax
imagenet
amazon-ses
p4merge
ssrs-2014
photos
clang++
flask-login
linter
cnc
openblas
x-ray
azure-cli
semantic-logging
appdomain
modelsim
jqchart
django-1.10
microstation
async.js
dotnetnuke-7
greatest-n-per-group
windows-azure-queues
mapinfo
tooleap
lean
appscale
bizagi
boost-serialization
upx
fink
nullable
contentcontrol
pypiserver
intel-c++
iced-coffeescript
uncompress
vacuum
pyobjc
nutiteq
teamcity-9.1
mraid
zend-currency
at-job
psr-4
rmysql
grails-domain-class
malformedurlexception
mutual-authentication
android-framework
embedded-fonts
breakout
ui-select2
stacky
fb.ui
preload
web-notifications
robotlegs
web-farm
saleslogix
boost-signals
failing-tests
fitbounds
jquery-address
denied
screen-size
pylucene
appledoc
resharper-6.0
ie-compatibility-mode
object-database
hbm2java
feasibility
asynchronous-wcf-call
dojo-dnd
change-management

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App