Skip to content

move sh script that grants the app WRITE_SECURE_SETTINGS to kotlin #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pixincreate opened this issue Apr 14, 2025 · 1 comment
Open
Assignees
Labels
enhancement New feature or request

Comments

@pixincreate
Copy link
Owner

if pm dump "$PACKAGE_NAME" | grep "$PERMISSION_NAME" | grep -q "granted=true"; then
    echo "Permission '$PERMISSION_NAME' is already granted to '$PACKAGE_NAME'."
else
    echo "Permission '$PERMISSION_NAME' not granted (or granted=false)."
    echo "Attempting to grant permission..."

    pm grant "$PACKAGE_NAME" "$PERMISSION_NAME"

    sleep 1
    echo "Verifying permission status after grant..."
    if pm dump package "$PACKAGE_NAME" | grep "$PERMISSION_NAME" | grep -q "granted=true"; then
        echo "Permission '$PERMISSION_NAME' successfully granted to '$PACKAGE_NAME'."
    else
        echo "Error: Failed to grant permission '$PERMISSION_NAME' to '$PACKAGE_NAME'."
        echo "Please check ADB output or device logs for errors."
    fi
fi

rewrite above shell script in kotlin just for the sake of convenience as it allows us to show a toast message and eventually log it stating the permission has been granted.

possibly, re-write the self service starter script just so that the functions can be re-used.

@pixincreate pixincreate added the enhancement New feature or request label Apr 14, 2025
@pixincreate pixincreate self-assigned this Apr 14, 2025
@pixincreate
Copy link
Owner Author

as a security measure, latest release has been removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant