Most of B4A and B4J libraries are open source now: https://github.com/AnywhereSoftware
They are licensed with Apache 2.0 license which is quite permissive.
The purposes of open sourcing the frameworks are:
1. Provide developers full control over their projects.
2. Allow developers to better understand how the internal framework works.
3. Make it easier for developers to build libraries.
At this point we are not accepting code contributions.
While you can build modified versions of the core libraries in most cases it is not recommended. If you do choose to build a modified library then name it differently so it will be clear that it is a modified library.