Fixed build scripts
Added permission checker for Samsung launcher.