[core] BuildConfig files lost during exporting code as gradle project
jadx.core.export.ExportGradleProject class contains a method skipGeneratedClasses, which prevents exporting BuildConfig classes. From my point of view this is a bug. I tried removing that call from the init() method and found no problem. @skylot, is this a bug or a feature? =)
@Fi5t this is a feature :slightly_smiling_face:
If BuildConfig not removed, recompilation will fail with error: duplicate class, same for R class.
I understand that recompilation rarely needed, but all information in BuildConfig copied from AndroidManifest.xml so looks like it safe to remove this class.
Nodaways, mobile apps frequentely store important constants in BuildConfig. That constants comes from the buildConfigField options in the build.gradle files. They are not copied from AndroidManifest.xml and due to skipping BuldConfig classes this information is lost. Maybe it makes sense to add an option to exporting process to save BuildConfig classes?
That constants comes from the buildConfigField options in the build.gradle files.
Oh, I see, so it will be better just keep these classes as is. I will remove filtering code :+1:
What about skipping this class, but analyzing it during gradle export and generate all non-standard buildConfigFields in build.gradle? Wouldn't this be the best option? Is there a sample app to test with?
What about skipping this class, but analyzing it during gradle export and generate all non-standard buildConfigFields in build.gradle? Wouldn't this be the best option?
@nitram84 hm, I already commit a change to leave these classes as is :rofl:
Anyway, yes, it is always better to restore original code/data and made project compilable, so it worth implementing. On the other hand, keeping these classes is less confusing to users and will not raise missing class issues :smile: