Split the android.sh scripts into different sections

Also fixed some obvious issues and added some changes to
avoid unnecessary downloading when reprovisioning