Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Accept all permissions on iOS 14.8 (except local network permission). Location permission here: https://gist.github.com/kasnder/91a64a555e962d08cd05b52f7114b897 Notification permission here: https://gist.github.com/kasnder/c17752607486042fc4f8bd4f61bb2c43
#!/bin/bash
# Usage:./grant_ios_permissions.sh [bundleId]
# Example: ./grant_ios_permissions.sh com.spotify.client
echo "This does not grant location, notification or local network permission. You can grant location permission with this script https://gist.github.com/kasnder/91a64a555e962d08cd05b52f7114b897 and the notifications permission with this script https://gist.github.com/kasnder/c17752607486042fc4f8bd4f61bb2c43"
# Requirements:
# - iOS 14.8 device with checkra1n jailbreak
# - Installed `sqlite3` on iOS device from Cydia
# - iOS device plugged into computed and forwarded SSH port with `iproxy 2222 44`
# - Installed public ssh key on your device: `ssh-copy-id -p 2222 root@localhost`
# Some more information for the iOS simulator can be found here: https://github.com/wix/AppleSimulatorUtils/blob/master/applesimutils/applesimutils/SetNotificationsPermission.m
if [ -z "$1" ]; then
echo "Please pass bundleId"
exit -1
fi
ssh -T -p 2222 root@localhost << EOF
# List taken on iOS 14.8 device from /System/Library/PrivateFrameworks/TCC.framework/en.lproj/Localizable.strings
for permission in kTCCServiceExposureNotification kTCCServiceFallDetection kTCCServiceGameCenterFriends kTCCServiceSensorKitBedSensingWriting kTCCServiceUserTracking kTCCServiceSiri kTCCServiceSpeechRecognition kTCCServiceAddressBook kTCCServiceBluetoothAlways kTCCServiceBluetoothPeripheral kTCCServiceBluetoothWhileInUse kTCCServiceCalendar kTCCServiceCalls kTCCServiceCamera kTCCServiceContactsFull kTCCServiceContactsLimited kTCCServiceMediaLibrary kTCCServiceMicrophone kTCCServiceMotion kTCCServicePhotosAdd kTCCServiceReminders kTCCServiceWillow; do
echo "INSERT INTO access VALUES('\$permission','$1',0,2,2,1,NULL,NULL,NULL,'UNUSED',NULL,0,"\`date +%s\`");" >> ./grant_permissions.sql
done
echo "INSERT INTO access VALUES('kTCCServicePhotos','$1',0,2,2,2,NULL,NULL,NULL,'UNUSED',NULL,0,"\`date +%s\`");" >> ./grant_permissions.sql
# Make sure to install sqlite3 on your device
sqlite3 /private/var/mobile/Library/TCC/TCC.db < ./grant_permissions.sql
# Cleanup
rm ./grant_permissions.sql
EOF
echo "Granted permissions!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment