I have 2 build flavors, say, flavor1 and flavor2.
I would like my application to be named, say, \"AppFlavor1\" when I build for flavor1 an
First of all, answer this question: "Can the user install both flavors of your application on the same device?"
I use a Python script that patches the source. It contains some reusable functions and, of course, knowledge what needs be patched in this particular project. So the script is application-specific.
There is a lot of patching, the data for patching are kept in a Python dictionary (including application package names, they BTW are different from the Java package name), one dictionary per flavor.
As to l10n, strings may point to other strings, e.g. in my code I have:
@string/x_app_name_xyz
My Application
My App