#!/system/bin/sh

###  Copyright (C) 2020 - Perto

PACKAGE_NAME=com.postrilegal.app

if [ "$(pm list package $PACKAGE_NAME)" != "" ]; then
        pm grant $PACKAGE_NAME android.permission.ACCESS_FINE_LOCATION
        pm grant $PACKAGE_NAME android.permission.ACCESS_COARSE_LOCATION
        pm grant $PACKAGE_NAME android.permission.READ_PHONE_STATE
        pm grant $PACKAGE_NAME android.permission.WRITE_EXTERNAL_STORAGE

        am start $PACKAGE_NAME/.MainActivity
else
        echo "$PACKAGE_NAME not installed"
fi