From 8f3c67727d248085f300936f5b4f924d6c3a9457 Mon Sep 17 00:00:00 2001 From: Lavie Date: Sat, 16 Oct 2021 14:16:30 +0300 Subject: [PATCH] Disabled location features and scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Should fix the problem where Unc0ver users are unable to install Selenium v1.2.0. --- Tweak/Tweak.xm | 22 +++--- control | 5 +- layout/DEBIAN/postinst | 82 +++++++++++----------- layout/DEBIAN/postrm | 92 ++++++++++++------------- layout/DEBIAN/preinst | 106 ++++++++++++++--------------- seleniumprefs/Resources/Root.plist | 20 ++++++ 6 files changed, 173 insertions(+), 154 deletions(-) diff --git a/Tweak/Tweak.xm b/Tweak/Tweak.xm index 269f3ff..20ea603 100644 --- a/Tweak/Tweak.xm +++ b/Tweak/Tweak.xm @@ -50,7 +50,7 @@ BOOL snooozedDeliverProminently; static NSInteger segmentInterval; static NSInteger chosenButton; static BOOL deliverQuietlyWhilePlaying; -static BOOL snoozeByLocationEnabled; +static BOOL snoozeByLocationEnabled = NO; PCSimpleTimer *lastTimer; NSDictionary *prefs = nil; @@ -2764,17 +2764,17 @@ static void loadPrefs() { segmentInterval = [[prefs objectForKey:@"segmentInterval"] intValue]; chosenButton = [[prefs objectForKey:@"chosenButton"] intValue]; deliverQuietlyWhilePlaying = [[prefs objectForKey:@"deliverQuietlyWhilePlaying"] boolValue]; - snoozeByLocationEnabled = [[prefs objectForKey:@"snoozeByLocation"] boolValue]; + // snoozeByLocationEnabled = [[prefs objectForKey:@"snoozeByLocation"] boolValue]; if (deliverQuietlyWhilePlaying == YES) %init(deliverQuietly); - if (snoozeByLocationEnabled == YES) { - NSMutableArray *entries = [config[@"entries"] mutableCopy]; - for (NSMutableDictionary *entry in entries) { - if ([entry[@"timeStamp"] doubleValue] == -2) { - NCNotificationRequest *expiredReq = entry[@"id"]; - processEntry(expiredReq, 0, nil, nil, nil); - } - } - } + // if (snoozeByLocationEnabled != YES) { + // NSMutableArray *entries = [config[@"entries"] mutableCopy]; + // for (NSMutableDictionary *entry in entries) { + // if ([entry[@"timeStamp"] doubleValue] == -2) { + // NCNotificationRequest *expiredReq = entry[@"id"]; + // processEntry(expiredReq, 0, nil, nil, nil); + // } + // } + // } } } diff --git a/control b/control index 826cdca..465e06f 100755 --- a/control +++ b/control @@ -1,8 +1,7 @@ Package: com.miwix.selenium Name: Selenium -Depends: mobilesubstrate, ws.hbang.common, firmware (>= 13.0), com.bingner.plutil, sed -Pre-Depends: com.bingner.plutil, sed -Version: 1.2.0 +Depends: mobilesubstrate, ws.hbang.common, firmware (>= 13.0) +Version: 1.2.1 Architecture: iphoneos-arm Description: Snooze notifications. Focus on what matters⏱ Maintainer: Lavie Gariv diff --git a/layout/DEBIAN/postinst b/layout/DEBIAN/postinst index a40fff3..5871457 100755 --- a/layout/DEBIAN/postinst +++ b/layout/DEBIAN/postinst @@ -1,41 +1,41 @@ -#!/usr/bin/bash - -echo "[Selenium] Setting permissions..." - -FILE="/Library/Application Support/SeleniumExtra.bundle/Assets/icon.PNG" -if test -f "$FILE"; then - echo "[Selenium] Icon..." - chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/Assets/icon.PNG" -fi - -FILE="/Library/Application Support/SeleniumExtra.bundle/de.lproj/Localizable.strings" -if test -f "$FILE"; then - echo "[Selenium] German..." - chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/de.lproj/Localizable.strings" -fi - -FILE="/Library/Application Support/SeleniumExtra.bundle/en.lproj/Localizable.strings" -if test -f "$FILE"; then - echo "[Selenium] English..." - chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/en.lproj/Localizable.strings" -fi - -FILE="/Library/Application Support/SeleniumExtra.bundle/fr.lproj/Localizable.strings" -if test -f "$FILE"; then - echo "[Selenium] French..." - chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/fr.lproj/Localizable.strings" -fi - -FILE="/Library/Application Support/SeleniumExtra.bundle/he.lproj/Localizable.strings" -if test -f "$FILE"; then - echo "[Selenium] Hebrew..." - chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/he.lproj/Localizable.strings" -fi - -FILE="/System/Library/CoreServices/SpringBoard.app/Info.plist" -if test -f "$FILE"; then - echo "[Selenium] SpringBoard..." - chmod 0644 "/System/Library/CoreServices/SpringBoard.app/Info.plist" -fi - -echo "[Selenium] Permissions set!" +#!/bin/bash + +# echo "[Selenium] Setting permissions..." + +# FILE="/Library/Application Support/SeleniumExtra.bundle/Assets/icon.PNG" +# if test -f "$FILE"; then +# echo "[Selenium] Icon..." +# chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/Assets/icon.PNG" +# fi + +# FILE="/Library/Application Support/SeleniumExtra.bundle/de.lproj/Localizable.strings" +# if test -f "$FILE"; then +# echo "[Selenium] German..." +# chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/de.lproj/Localizable.strings" +# fi + +# FILE="/Library/Application Support/SeleniumExtra.bundle/en.lproj/Localizable.strings" +# if test -f "$FILE"; then +# echo "[Selenium] English..." +# chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/en.lproj/Localizable.strings" +# fi + +# FILE="/Library/Application Support/SeleniumExtra.bundle/fr.lproj/Localizable.strings" +# if test -f "$FILE"; then +# echo "[Selenium] French..." +# chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/fr.lproj/Localizable.strings" +# fi + +# FILE="/Library/Application Support/SeleniumExtra.bundle/he.lproj/Localizable.strings" +# if test -f "$FILE"; then +# echo "[Selenium] Hebrew..." +# chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/he.lproj/Localizable.strings" +# fi + +# FILE="/System/Library/CoreServices/SpringBoard.app/Info.plist" +# if test -f "$FILE"; then +# echo "[Selenium] SpringBoard..." +# chmod 0644 "/System/Library/CoreServices/SpringBoard.app/Info.plist" +# fi + +# echo "[Selenium] Permissions set!" diff --git a/layout/DEBIAN/postrm b/layout/DEBIAN/postrm index 1ea988b..462de01 100755 --- a/layout/DEBIAN/postrm +++ b/layout/DEBIAN/postrm @@ -1,49 +1,49 @@ -#!/usr/bin/bash +#!/bin/bash # Removing manager.plist -if [ "remove" == "$1" ]; then - echo "[Selenium] Removing files..." - FILE="/var/mobile/Library/Selenium/manager.plist" - if test -f "$FILE"; then - rm -r "/var/mobile/Library/Selenium/" - fi - - echo "[Selenium] Restoring backup..." - BACKUP="/System/Library/CoreServices/SpringBoard.app/Info.plist.backup" - if test -f "$BACKUP"; then - rm /System/Library/CoreServices/SpringBoard.app/Info.plist - mv /System/Library/CoreServices/SpringBoard.app/Info.plist.backup /System/Library/CoreServices/SpringBoard.app/Info.plist - echo "[Selenium] Backup restored!" - fi -fi - - -# Aborting install/upgrade if preinst extied with an error - -ABORT=0 - -case "$1" in -abort-install ) - ABORT=1 - #finish return - ;; -abort-upgrade ) - ABORT=1 - #finish return - ;; -failed-upgrade ) - ABORT=1 - #finish return - ;; -esac - -if [ $ABORT == 1 ]; then - echo "[Selenium] Aborting..." - BACKUP="/System/Library/CoreServices/SpringBoard.app/Info.plist.backup" - if test -f "$BACKUP"; then - rm /System/Library/CoreServices/SpringBoard.app/Info.plist - mv /System/Library/CoreServices/SpringBoard.app/Info.plist.backup /System/Library/CoreServices/SpringBoard.app/Info.plist - echo "[Selenium] An error occured during install. System modifications were reverted to original state." - fi -fi +# if [ "remove" == "$1" ]; then +# echo "[Selenium] Removing files..." +# FILE="/var/mobile/Library/Selenium/manager.plist" +# if test -f "$FILE"; then +# rm -r "/var/mobile/Library/Selenium/" +# fi + +# echo "[Selenium] Restoring backup..." +# BACKUP="/System/Library/CoreServices/SpringBoard.app/Info.plist.backup" +# if test -f "$BACKUP"; then +# rm /System/Library/CoreServices/SpringBoard.app/Info.plist +# mv /System/Library/CoreServices/SpringBoard.app/Info.plist.backup /System/Library/CoreServices/SpringBoard.app/Info.plist +# echo "[Selenium] Backup restored!" +# fi +# fi + + +# # Aborting install/upgrade if preinst extied with an error + +# ABORT=0 + +# case "$1" in +# abort-install ) +# ABORT=1 +# #finish return +# ;; +# abort-upgrade ) +# ABORT=1 +# #finish return +# ;; +# failed-upgrade ) +# ABORT=1 +# #finish return +# ;; +# esac + +# if [ $ABORT == 1 ]; then +# echo "[Selenium] Aborting..." +# BACKUP="/System/Library/CoreServices/SpringBoard.app/Info.plist.backup" +# if test -f "$BACKUP"; then +# rm /System/Library/CoreServices/SpringBoard.app/Info.plist +# mv /System/Library/CoreServices/SpringBoard.app/Info.plist.backup /System/Library/CoreServices/SpringBoard.app/Info.plist +# echo "[Selenium] An error occured during install. System modifications were reverted to original state." +# fi +# fi diff --git a/layout/DEBIAN/preinst b/layout/DEBIAN/preinst index f9a53f1..1905be1 100755 --- a/layout/DEBIAN/preinst +++ b/layout/DEBIAN/preinst @@ -1,54 +1,54 @@ -#!/usr/bin/bash +#!/bin/bash -set -e -x=1 -while [ $x -eq 1 ] -do -#ARG="install" -#if [ "$ARG" == "$1" ]; then - echo "[Selenium] Checking files..." - FILE="/Library/Application Support/SeleniumExtra.bundle/txt.txt" - if test -f "$FILE"; then - chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/txt.txt" - fi - INFO="/System/Library/CoreServices/SpringBoard.app/Info.plist" - if test -f "$INFO"; then - BACKUP="/System/Library/CoreServices/SpringBoard.app/Info.plist.backup" - if test -f "$BACKUP"; then - echo "[Selenium] Backup exists!" - echo "[Selenium] Files already modified!" - else - echo "[Selenium] Backing up files..." - cp /System/Library/CoreServices/SpringBoard.app/Info.plist /System/Library/CoreServices/SpringBoard.app/Info.plist.backup && : || break - echo "[Selenium] Modifying files..." - plutil -convert xml1 $INFO > /dev/null 2>&1 && : || break - echo "[Selenium] Modifying files..." - LINES="$(wc -l $INFO | sed -n 's/ $INFO//gp' | sed -n 's/ //gp')" - echo "[Selenium] Modifying files..." - NEWLINES="$(echo "$((LINES - 2))")" - echo "[Selenium] Modifying files..." - echo "$(cat $INFO | head -n$NEWLINES)" > newInfo.plist && : || break - echo "[Selenium] Modifying files..." - echo " UIBackgroundModes" >> newInfo.plist && : || break - echo " " >> newInfo.plist && : || break - echo " location" >> newInfo.plist && : || break - echo " " >> newInfo.plist && : || break - echo " NSLocationAlwaysAndWhenInUseUsageDescription" >> newInfo.plist && : || break - echo " Set location access to 'Always' to enable location-based features for Selenium." >> newInfo.plist && : || break - echo " NSLocationWhenInUseUsageDescription" >> newInfo.plist && : || break - echo " Set location access to 'Always' to enable location-based features for Selenium." >> newInfo.plist && : || break - echo "" >> newInfo.plist && : || break - echo "" >> newInfo.plist && : || break - rm -r $INFO - mv newInfo.plist $INFO && : || break - plutil -convert binary1 $INFO > /dev/null 2>&1 && : || break - echo "[Selenium] Files modified!" - fi - fi - set -t - exit 0 - set +t -#fi -x=$[$x-1] -done -exit 1 +# set -e +# x=1 +# while [ $x -eq 1 ] +# do +# #ARG="install" +# #if [ "$ARG" == "$1" ]; then +# echo "[Selenium] Checking files..." +# FILE="/Library/Application Support/SeleniumExtra.bundle/txt.txt" +# if test -f "$FILE"; then +# chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/txt.txt" +# fi +# INFO="/System/Library/CoreServices/SpringBoard.app/Info.plist" +# if test -f "$INFO"; then +# BACKUP="/System/Library/CoreServices/SpringBoard.app/Info.plist.backup" +# if test -f "$BACKUP"; then +# echo "[Selenium] Backup exists!" +# echo "[Selenium] Files already modified!" +# else +# echo "[Selenium] Backing up files..." +# cp /System/Library/CoreServices/SpringBoard.app/Info.plist /System/Library/CoreServices/SpringBoard.app/Info.plist.backup && : || break +# echo "[Selenium] Modifying files..." +# plutil -convert xml1 $INFO > /dev/null 2>&1 && : || break +# echo "[Selenium] Modifying files..." +# LINES="$(wc -l $INFO | sed -n 's/ $INFO//gp' | sed -n 's/ //gp')" +# echo "[Selenium] Modifying files..." +# NEWLINES="$(echo "$((LINES - 2))")" +# echo "[Selenium] Modifying files..." +# echo "$(cat $INFO | head -n$NEWLINES)" > newInfo.plist && : || break +# echo "[Selenium] Modifying files..." +# echo " UIBackgroundModes" >> newInfo.plist && : || break +# echo " " >> newInfo.plist && : || break +# echo " location" >> newInfo.plist && : || break +# echo " " >> newInfo.plist && : || break +# echo " NSLocationAlwaysAndWhenInUseUsageDescription" >> newInfo.plist && : || break +# echo " Set location access to 'Always' to enable location-based features for Selenium." >> newInfo.plist && : || break +# echo " NSLocationWhenInUseUsageDescription" >> newInfo.plist && : || break +# echo " Set location access to 'Always' to enable location-based features for Selenium." >> newInfo.plist && : || break +# echo "" >> newInfo.plist && : || break +# echo "" >> newInfo.plist && : || break +# rm -r $INFO +# mv newInfo.plist $INFO && : || break +# plutil -convert binary1 $INFO > /dev/null 2>&1 && : || break +# echo "[Selenium] Files modified!" +# fi +# fi +# set -t +# exit 0 +# set +t +# #fi +# x=$[$x-1] +# done +# exit 1 diff --git a/seleniumprefs/Resources/Root.plist b/seleniumprefs/Resources/Root.plist index e3accea..ccdd07f 100644 --- a/seleniumprefs/Resources/Root.plist +++ b/seleniumprefs/Resources/Root.plist @@ -124,6 +124,26 @@ label Deliver Quietly + cell PSGroupCell