Can we decompile the apk to archive offline builds?


Hi, before do something that i CAN’T do, i would like to know if i can decompile the apk to get the class that i need to do offline builds, i know that cocoon uses cordova so there shouldn’t be any problem right? (i see that there are other post that already talk about decompiling without any problem)
I don’t use any services like ads or multiplayer just need to convert my webgl game to apk (but i need to do it even when i’m offline)
I really don’t want to do anything illegal (even because it is not streectly needed, the online builds if there aren’t other ways are fine).
Thanks in advance!