first commit

This commit is contained in:
Victor Bodinaud
2025-03-03 13:59:05 +01:00
commit 954e43aa2f
166 changed files with 15834 additions and 0 deletions

11
Library/asuser Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
version=$(sw_vers -productVersion)
if [[ ${version} = 1.0* || ${version} = 1.1.[012] ]]; then
user=root
else
user=mobile
fi
su -c "${user}" "$@"

8
Library/finish.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
declare -a cydia
cydia=($CYDIA)
if [[ ${CYDIA+@} ]]; then
eval "echo 'finish:$1' >&${cydia[0]}"
fi

99
Library/firmware.sh Executable file
View File

@@ -0,0 +1,99 @@
#!/bin/bash
set -e
shopt -s extglob
version=$(sw_vers -productVersion)
cat /var/lib/dpkg/status | {
while IFS= read -r line; do
#echo "#${firmware+@}/${blank+@} ${line}" 1>&2
if [[ ${line} == '' && "${blank+@}" ]]; then
continue
else
unset blank
fi
if [[ ${line} == "Package: "@(firmware|gsc.*) ]]; then
firmware=
elif [[ ${line} == '' ]]; then
blank=
fi
if [[ "${firmware+@}" ]]; then
if [[ "${blank+@}" ]]; then
unset firmware
fi
continue
fi
#echo "${firmware+@}/${blank+@} ${line}" 1>&2
echo "${line}"
done
#echo "#${firmware+@}/${blank+@} EOF" 1>&2
if ! [[ "${blank+@}" || "${firmware+@}" ]]; then
echo
fi
cat <<EOF
Package: firmware
Essential: yes
Status: install ok installed
Priority: required
Section: System
Installed-Size: 0
Architecture: iphoneos-arm
Version: ${version}
Description: almost impressive Apple frameworks
Name: iPhone Firmware
Tag: role::cydia
EOF
echo "/." >/var/lib/dpkg/info/firmware.list
gssc 2>&1 | sed -re '
/^ [^ ]* = [0-9.]*;$/ ! d;
s/^ ([^ ]*) = ([0-9.]*);$/\1 \2/;
s/([A-Z])/-\L\1/g; s/^"([^ ]*)"/\1/;
s/^-//;
/ 0$/ d;
' | while read -r name value; do
cat <<EOF
Package: gsc.${name}
Essential: yes
Status: install ok installed
Priority: required
Section: System
Installed-Size: 0
Architecture: iphoneos-arm
Version: ${value}
Description: GraphicsService Capability Bit
Name: GSC: ${name}
Tag: role::cydia
EOF
echo "/." >/var/lib/dpkg/info/gsc."${name}".list
done
} >/var/lib/dpkg/status_
mv -f /var/lib/dpkg/status{_,}
if [[ ${version} = 1.0* || ${version} = 1.1.[012] ]]; then
user=root
else
user=mobile
fi
if [[ ! -h /User && -d /User ]]; then
cp -afT /User /var/"${user}"
fi && rm -rf /User && ln -s "/var/${user}" /User
echo 2 >/var/lib/cydia/firmware.ver

17
Library/free.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# /usr/bin \
for dir in \
/Applications \
/Library/Wallpaper \
/Library/Ringtones \
/usr/include \
/usr/lib/pam \
/usr/libexec \
/usr/share \
; do
. /usr/libexec/cydia/move.sh "$@" "${dir}"
done
sync

61
Library/move.sh Executable file
View File

@@ -0,0 +1,61 @@
#!/bin/bash
shopt -s extglob nullglob
if [[ ${1:0:1} == - ]]; then
v=$1
shift 1
else
v=
fi
function df_() {
free=$(df -B1 "$1")
free=${free% *%*}
free=${free%%*( )}
free=${free##* }
echo "${free}"
}
function mv_() {
src=$1
mkdir -p /var/stash
dst=$(mktemp -d /var/stash/"${src##*/}".XXXXXX)
if [[ -e ${src} ]]; then
chmod --reference="${src}" "${dst}"
chown --reference="${src}" "${dst}"
cp -aT $v "${src}" "${dst}" || {
rm -rf "${dst}"
exit 1
}
rm -rf $v "${src}"
else
chmod 775 "${dst}"
chown root.admin "${dst}"
fi
ln -s "${dst}" "${src}"
}
function shift_() {
dir=${1%/}
if [[ -d ${dir} && ! -h ${dir} ]]; then
used=$(/usr/libexec/cydia/du -bs "${dir}")
used=${used%%$'\t'*}
free=$(df_ /var)
if [[ $((used + 524288)) -lt ${free} ]]; then
mv_ "${dir}"
fi
elif [[ ! -e ${dir} ]]; then
rm -f "${dir}"
mv_ "${dir}"
fi
}
shift_ "$@"

12
Library/space.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
for dir in \
/Applications \
/Library/Ringtones \
/Library/Wallpaper \
/System/Library/Fonts \
/System/Library/TextInput \
/usr/share
do
. /usr/libexec/cydia/move.sh "$@" "${dir}"
done

21
Library/startup Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
export PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin
sbdidlaunch
if [[ ! -e /var/lib/cydia/firmware.ver ]]; then
cache=
fi
/usr/libexec/cydia/firmware.sh
debs=(/var/root/Media/Cydia/AutoInstall/*.deb)
if [[ ${#debs[@]} -ne 0 && -f ${debs[0]} ]]; then
dpkg -i "${debs[@]}"
rm -f "${debs[@]}"
cache=
fi
if [[ ${cache+@} ]]; then
su -c uicache mobile
fi