|
#!/bin/bash |
|
RED='\033[0;31m' |
|
NC='\033[0m' # No Color |
|
OUTPUT=/tmp/libimobiledeviceinstall.log |
|
|
|
log() { |
|
printf "\r$1\n" ; # Stampo il messaggio di log |
|
printf "$2" ; # Stampo la percentuale di completamento |
|
} |
|
|
|
makeinstall() { |
|
curl --silent --location $1 -o "${2}.zip" |
|
unzip "${2}.zip" > ${OUTPUT} |
|
cd "${2}-master" |
|
(./autogen.sh --prefix=/usr/ --quiet >> ${OUTPUT}) & spinner |
|
(make >> ${OUTPUT}) & spinner |
|
(make install >> ${OUTPUT}) & spinner |
|
cd .. |
|
} |
|
|
|
spinner() { |
|
local pid=$! |
|
local delay=0.15 |
|
local spinstr='|/-\' |
|
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do |
|
local temp=${spinstr#?} |
|
printf " [%c] " "$spinstr" |
|
local spinstr=$temp${spinstr%"$temp"} |
|
sleep $delay |
|
printf "\b\b\b\b\b\b" |
|
done |
|
printf " \b\b\b\b" |
|
} |
|
|
|
#1: Scarico dipendenze |
|
log "${RED} Download Dipendenze & installazione ... ${NC}" "1/11" |
|
(apt-get install -y -qq --force-yes automake autoconf-archive libtool libssl-dev \ |
|
libgcrypt11-dev libp11-kit-dev libcurl4-gnutls-dev libusb-1.0 \ |
|
libzip-dev libfuse-dev clutter-1.0 clutter-gtk-1.0 python-dev \ |
|
libxml2-dev libssl-dev libreadline-dev > ${OUTPUT}) & spinner |
|
|
|
#2: Cython |
|
log "Compilazione e installazione ${RED} Cython ${NC}" "2/11" |
|
curl --silent --location http://cython.org/release/Cython-0.23.4.zip -o cython.zip |
|
unzip cython.zip > ${OUTPUT} |
|
cd Cython-0.23.4 |
|
(python setup.py install > ${OUTPUT}) & spinner |
|
cd .. |
|
|
|
log "${RED} Dipendenze completate ${NC}" "2/11" |
|
rm cython.zip # Rimuovo lo zip |
|
rm -r Cython* # Rimuovo la cartella |
|
|
|
#1: Creo cartella libimobiledevice |
|
mkdir libimobiledevice |
|
cd libimobiledevice |
|
|
|
#3: Libplist |
|
log "Scarico e installo ${RED} Libplist ${NC}" "3/11" |
|
curl --silent --location https://github.com/libimobiledevice/libplist/archive/master.zip -o libplist.zip |
|
makeinstall https://github.com/libimobiledevice/libplist/archive/master.zip libplist |
|
|
|
#4: Libusbmuxd |
|
log "Scarico e installo ${RED} Libusbmuxd ${NC}" "4/11" |
|
makeinstall https://github.com/libimobiledevice/libusbmuxd/archive/master.zip libusbmuxd |
|
|
|
#5: Libimobiledevice |
|
log "Scarico e installo ${RED} Libimobiledevice ${NC}" "5/11" |
|
makeinstall https://github.com/libimobiledevice/libimobiledevice/archive/master.zip libimobiledevice |
|
|
|
#6: libideviceactivation |
|
log "Scarico e installo ${RED} Libimobiledeviceactivation ${NC}" "6/11" |
|
makeinstall https://github.com/libimobiledevice/libideviceactivation/archive/master.zip libideviceactivation |
|
|
|
#7: Ideviceinstaller |
|
log "Scarico e installo ${RED} Ideviceinstaller ${NC}" "7/11" |
|
makeinstall https://github.com/libimobiledevice/ideviceinstaller/archive/master.zip ideviceinstaller |
|
|
|
#8: Ifuse |
|
log "Scarico e installo ${RED} Ifuse ${NC}" "8/11" |
|
makeinstall https://github.com/libimobiledevice/ifuse/archive/master.zip ifuse |
|
|
|
#9: Libirecovery |
|
log "Scarico e installo ${RED} Libirecovery ${NC}" "9/11" |
|
makeinstall https://github.com/libimobiledevice/libirecovery/archive/master.zip libirecovery |
|
|
|
#10: Idevicerestore |
|
log "Scarico e installo ${RED} Idevicerestore ${NC}" "10/11" |
|
makeinstall https://github.com/libimobiledevice/idevicerestore/archive/master.zip idevicerestore |
|
|
|
#11: clean |
|
log "${RED} Pulizia ${NC}" "11/11" |
|
cd .. |
|
rm -r libimobiledevice |
|
|
|
echo "${RED} Configurazione finita. ${NC} |
|
In caso di errore guarda il file di log: |
|
cat ${OUTPUT} |
|
${RED} Made By Genhack && Abeltramo #GsmIta {$OUT} ${NC}" |