1

I have been researching the right approach for designing android library. My question is that how can I avoid putting all Source code( for all buildvariants) in a particular build. For example , My current approach is simple check something like

If(BuildConfig.buildtype=debug){
 //we are in debug mode
      New debugObject;
 } else{
 //we are in release mode
      New releaseObject;
 }

I can certainly use different sourceSets but still the .java classes save in the entire codebase.

I have a concern that when people reverse the code, and since all the combination of the code lie in the code base, they can play around the code and bypass the logic somehow.

What is the best practice when we need to change a certain behavior for sandbox and production? of course the biz logic is always the same, it just that sandbox might use different config than prod to do a certain behavior.

bj4947
  • 880
  • 11
  • 32

0 Answers0