Skip to content

Instantly share code, notes, and snippets.

@kasnder
Last active May 6, 2022 23:04
Show Gist options
  • Save kasnder/c17752607486042fc4f8bd4f61bb2c43 to your computer and use it in GitHub Desktop.
Save kasnder/c17752607486042fc4f8bd4f61bb2c43 to your computer and use it in GitHub Desktop.
Grant the notification permission to an iOS app. More permissions here: https://gist.github.com/kasnder/3eb32449512a4dba4a92949c8d337a92 Raw
# This script runs on macOS
# One needs a working, passwordless SSH login with login 'ios' on a jailbroken iOS 14.+
# One also needs Activator and ActivatorCrashFix14: https://stackoverflow.com/questions/21706050/how-to-unlock-ios-screen-programmatically)
# Backup and preparation
ssh ios "cp -n /var/mobile/Library/BulletinBoard/VersionedSectionInfo.plist ~/VersionedSectionInfo.plist.bak"
scp ios:/var/mobile/Library/BulletinBoard/VersionedSectionInfo.plist ./VersionedSectionInfo2.plist
# Prepare notification settings
/usr/libexec/PlistBuddy -c "Set :\$objects:2 $appId" `pwd`/base2.plist
plutil -convert binary1 base2.plist # PlistBuddy unfortunately converts its output to XML plists, so need to convert back
# Add new notification setting to other settings
defaults write `pwd`/VersionedSectionInfo2.plist sectionInfo -dict-add $appId -data "`cat base2.plist | xxd -p -c 1000000`"
plutil -convert xml1 VersionedSectionInfo2.plist # defaults unfortunately converts its output to binary plists, so need to convert back
# Upload changed notification settings to device
scp ./VersionedSectionInfo2.plist ios:/var/mobile/Library/BulletinBoard/VersionedSectionInfo.plist
# Apply changed notification settings
ssh ios "killall SpringBoard" # we need to respring because notifications are managed by SpringBoard
sleep 2
# Unlock again (at least, on devices with home button)
ssh ios "activator send libactivator.system.homebutton"
sleep 1
ssh ios "activator send libactivator.system.homebutton"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>$archiver</key>
<string>NSKeyedArchiver</string>
<key>$objects</key>
<array>
<string>$null</string>
<dict>
<key>$class</key>
<dict>
<key>CF$UID</key>
<integer>7</integer>
</dict>
<key>appName</key>
<dict>
<key>CF$UID</key>
<integer>5</integer>
</dict>
<key>dataProviderIDs</key>
<dict>
<key>CF$UID</key>
<integer>0</integer>
</dict>
<key>displayName</key>
<dict>
<key>CF$UID</key>
<integer>0</integer>
</dict>
<key>factorySectionID</key>
<dict>
<key>CF$UID</key>
<integer>0</integer>
</dict>
<key>hideWeeApp</key>
<false/>
<key>icon</key>
<dict>
<key>CF$UID</key>
<integer>0</integer>
</dict>
<key>isAppClip</key>
<false/>
<key>isModificationAllowed</key>
<false/>
<key>isRestricted</key>
<false/>
<key>managedSectionInfoSettings</key>
<dict>
<key>CF$UID</key>
<integer>0</integer>
</dict>
<key>pathToWeeAppPluginBundle</key>
<dict>
<key>CF$UID</key>
<integer>0</integer>
</dict>
<key>sectionCategory</key>
<integer>0</integer>
<key>sectionID</key>
<dict>
<key>CF$UID</key>
<integer>2</integer>
</dict>
<key>sectionInfoSettings</key>
<dict>
<key>CF$UID</key>
<integer>3</integer>
</dict>
<key>sectionType</key>
<integer>0</integer>
<key>subsectionID</key>
<dict>
<key>CF$UID</key>
<integer>0</integer>
</dict>
<key>subsectionPriority</key>
<integer>0</integer>
<key>subsections</key>
<dict>
<key>CF$UID</key>
<integer>0</integer>
</dict>
<key>suppressFromSettings</key>
<false/>
<key>suppressedSettings</key>
<integer>0</integer>
<key>version</key>
<dict>
<key>CF$UID</key>
<integer>6</integer>
</dict>
</dict>
<string>com.bimiboo.birthday</string>
<dict>
<key>$class</key>
<dict>
<key>CF$UID</key>
<integer>4</integer>
</dict>
<key>alertType</key>
<integer>1</integer>
<key>authorizationExpirationDate</key>
<dict>
<key>CF$UID</key>
<integer>0</integer>
</dict>
<key>authorizationStatus</key>
<integer>2</integer>
<key>bulletinGroupingSetting</key>
<integer>0</integer>
<key>carPlaySetting</key>
<integer>0</integer>
<key>contentPreviewSetting</key>
<integer>0</integer>
<key>criticalAlertSetting</key>
<integer>0</integer>
<key>lastUserGrantedAuthorizationDate</key>
<dict>
<key>CF$UID</key>
<integer>0</integer>
</dict>
<key>lockScreenSetting</key>
<integer>2</integer>
<key>notificationCenterSetting</key>
<integer>2</integer>
<key>pushSettings</key>
<integer>63</integer>
<key>showsCustomSettingsLink</key>
<false/>
<key>showsInLockScreen</key>
<true/>
<key>showsInNotificationCenter</key>
<true/>
<key>showsOnExternalDevices</key>
<true/>
<key>spokenNotificationSetting</key>
<integer>0</integer>
</dict>
<dict>
<key>$classes</key>
<array>
<string>BBSectionInfoSettings</string>
<string>NSObject</string>
</array>
<key>$classname</key>
<string>BBSectionInfoSettings</string>
</dict>
<string>生日</string>
<integer>0</integer>
<dict>
<key>$classes</key>
<array>
<string>BBSectionInfo</string>
<string>NSObject</string>
</array>
<key>$classname</key>
<string>BBSectionInfo</string>
</dict>
</array>
<key>$top</key>
<dict>
<key>root</key>
<dict>
<key>CF$UID</key>
<integer>1</integer>
</dict>
</dict>
<key>$version</key>
<integer>100000</integer>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment