I need to delivery my code as a library. I've created it and now I need to obfuscate mainly all the code except the public classes that the final user of my library will need.
My library has 2 packages:
- package com.xxx.xxx where is locate all the public classes.
- package com.yyy.yyy where there are a lot classes that has to be obfuscate (nobody should see the content of it).
- Also, my library use one internal library com.zzz.zzz
The classes from the first packet mainly don't have code, only public interfaces and some listener classes, so the core is in the 2nd package which must be private.
In my proguard file I have these commands:
-keep public class com.xxx.xxx.*
-keepclasseswithmembernames class com.xxx.xxx.* {
native <methods>;
}
-keepclassmembers public class com.xxx.xxx.* {
*;
}
It is ok, everything compile and I can run one mock-app using the library but when I try to use whatever class from the com.yyy.yyy there is a NoClassDefFoundError in runtime.
Not sure if I should add something in the proguard file, or maybe the problem is about the internal library compiled in my library (com.zzz.zzz).
My code in the build gradle file is:
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
Any idea please about what could happen? Thanks in advance.