keep assets folder in proguard Android

Viewed 861

I'm using proguard to obfuscate my code, and I have one module called a library and in that module I have an assets folder and I'm keeping some jars that I'm using in runtime. I want to keep that assets folder in the proguard.

Here is how it's looking the structure:

enter image description here

How can I keep these? or How can we pass the path of the file in ProGuard?

1 Answers

To keep directory we can use this in dexguard rules:

-keepdirectories mydirectory/*

or just keep exactly the resource: (worked for assets in aar):

-keepresourcefiles */myFile.bar
Related