The shell scripts do various things. Most do not have anything to do with app compiling: checking if fpc is installed, checking if Lazarus is installed, downloading data from webservers, compiling the fpc cross compiler..
The actual compilation for the .so is one call to lazbuild. That's one click in Lazarus.
But you have to compile for each platform separately, i.e. 4 times. 32-bit x86, 64-bit x86, 32-bit arm, 64-bit arm.
Might be easier to use the fpc jvm backend