Search code examples
javaproguardobfuscation

proguard not obfuscating bean creation in xml


Am trying to obfuscate my spring project, class files are obfuscated properly, but not bean definition in xml files.

package com.stack.request;
public class Employee(){ 
  String name;
  String age;
}

obfuscated to

package a.b.a;
public class a(){
  String a;
  String b;
}

but bean in xml is like this

<bean id="employee" class="com.stack.request.Employee"></bean>

will it obfuscate to

<bean id="employee" class="a.b.a.a"></bean>

Solution

  • I haven't tried it but i doubt proguard will do it, proguard analyses your byte code and obfuscate them.

    It is framework agnostic, every framework might have it's own requirement.

    I would suggest to use annotations instead of xml and use qualifier annotations with your beans.

    https://www.tutorialspoint.com/spring/spring_qualifier_annotation.htm