user@linuxtrack:~ $ python -c 'print("Soyez les bienvenus !")'

Vous n'êtes pas identifié(e).

#1 22-09-2014 23:04:51

IceF0x
#! Gourou Linux

Rooter son Samsung Galaxy S4 depuis Linux

Voici un script que j'ai découvert grâce à Checkfx sur IRC pour votre Samsung Galaxy S4 i9505 !!!

Information

    Script entièrement automatiser pour ROOTer votre mobile
    Téléchargement léger
    Simple code
    Pas besoin de Windows ni ODIN
    Assuré de fonctionner sous Linux
    Installe busybox
    Couvre plein de distributions Linux


Prérequis

    Un Samsung Galaxy S4 GT-i9505
    Un PC sous Linux
    Versions de Linux supportées :
        Ubuntu 12.10
        Ubuntu 13.04
        Fedora 18
        Archlinux
        OpenSuse 12.2
        OpenSuse 12.3
        Debian 7
        CentOS 6
        Red Hat Enterprise Linux (RHEL) 6


Installation

    Téléchargez le fichier ci-dessous
    Copiez dans votre répertoire 'home'
    Reliez votre smartphone à votre PC via le câble USB
    Ouvrez un terminal
    Tapez les commandes suivantes

chmod 755 S4.sh && ./S4.sh

Lien:

http://forum.xda-developers.com/showthr … ?t=2378289

#!/bin/bash

#Creating an error function#
#For if anything goes wrong#

function error {
echo "$1"
exit 1
}

#Creating NotListed function
#In case the user has a Linux distro which isn't supported yet

function NotListed {
echo "Sorry, but it looks like your Linux distro/version is not supported by Heimdall"
echo "You can try compiling your own using this tutorial"
echo "http://wiki.cyanogenmod.org/w/Install_and_compile_Heimdall"
echo -n "Press [Enter] key to exit..."
read var
clear
exit
}

#Creating Heimdall install function#
#In case the user does not have it installed#

function heimdall-i {
echo "Which Linux Distro are you using?"
echo "[ 1 ] Ubuntu"
echo "[ 2 ] Fedora"
echo "[ 3 ] Archlinux"
echo "[ 4 ] OpenSuse"
echo "[ 5 ] Debian"
echo "[ 6 ] CentOS"
echo "[ 7 ] Red Hat Enterprise Linux (RHEL)"
echo "[ 99 ] Not listed above"

read os
	if [[ "$os" == "1" ]]
		then
		echo "Which Ubuntu version are you running?"
		echo "[ 1 ] Ubuntu 12.10 - 32 bits"
		echo "[ 2 ] Ubuntu 12.10 - 64 bits"
		echo "[ 3 ] Ubuntu 13.04 - 32 bits"
		echo "[ 4 ] Ubuntu 13.04 - 64 bits"
		echo "[ 99 ] Not listed above"
		read version
			if [[ "$version" == "1" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/ubuntu12.10-heimdall_1.4.0-0_i386.deb
				echo "Done!"
				echo "Installing it..." 
				sudo dpkg -i ubuntu12.10-heimdall_1.4.0-0_i386.deb && sudo apt-get install -f
			elif [[ "$version" == "2" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/ubuntu12.10-heimdall_1.4.0-0_amd64.deb
				echo "Done!"
				echo "Installing it..." 
				sudo dpkg -i ubuntu12.10-heimdall_1.4.0-0_amd64.deb && sudo apt-get install -f
			elif [[ "$version" == "3" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/ubuntu13.04-heimdall_1.4.0-0_i386.deb
				echo "Done!"
				echo "Installing it..."
				sudo dpkg -i ubuntu13.04-heimdall_1.4.0-0_i386.deb && sudo apt-get install -f
			elif [[ "$version" == "4" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/ubuntu13.04-heimdall_1.4.0-0_amd64.deb
				echo "Done!"
				echo "Installing it..."
				sudo dpkg -i ubuntu13.04-heimdall_1.4.0-0_amd64.deb && sudo apt-get install -f
			elif [[ "$version" == "99" ]]; then
				NotListed
		fi		

	elif [[ "$os" == "2" ]]
		then
		echo "Which Fedora version are you using?"
		echo "[ 1 ] Fedora 18 - 32 bits"
		echo "[ 2 ] Fedora 18 - 64 bits"
		echo "[ 99 ] Not listed above"
		read version
			if [[ "$version" == "1" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/fedora18-heimdall-1.4.0-44.1.i686.rpm
				echo "Done!"
				echo "Installing it..."
				sudo yum localinstall fedora18-heimdall-1.4.0-44.1.i686.rpm
			elif [[ "$version" == "2" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/fedora18-heimdall-1.4.0-44.1.x86_64.rpm
				echo "Done!"
				echo "Installing it..."
				sudo yum localinstall fedora18-heimdall-1.4.0-44.1.x86_64.rpm
			elif [[ "$version" == "99" ]]; then
				NotListed
		fi		

	elif [[ "$os" == "3" ]]
		then
		echo "Which ArchLinux version are you using?"
		echo "[ 1 ] ArchLinux - 32 bits"
		echo "[ 2 ] ArchLinux - 64 bits"
		echo "[ 99 ] Not listed above"
		read version
			if [[ "$version" == "1" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/arch-heimdall-1.4.0-1-i686.pkg.tar.xz
				echo "Done!"
				echo "Installing it..."
				sudo pacman -U arch-heimdall-1.4.0-1-i686.pkg.tar.xz
			elif [[ "$version" == "2" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/arch-heimdall-1.4.0-1-x86_64.pkg.tar.xz
				echo "Done!"
				echo "Installing it..."
				sudo pacman -U arch-heimdall-1.4.0-1-x86_64.pkg.tar.x
			elif [[ "$version" == "99" ]]; then
				NotListed
		fi

	elif [[ "$os" == "4" ]]
		then
		echo "Which OpenSuse version are you running?"
		echo "[ 1 ] OpenSuse 12.2 - 32 bits"
		echo "[ 2 ] OpenSuse 12.2 - 64 bits"
		echo "[ 3 ] OpenSuse 12.3 - 32 bits"
		echo "[ 4 ] OpenSuse 12.3 - 64 bits"
		echo "[ 99 ] Not listed above"
		read version
			if [[ "$version" == "1" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/opensuse12.2-heimdall-1.4.0-44.1.i586.rpm
				echo "Done!"
				echo "Installing it..." 
				sudo zypper in ../S4Root/opensuse12.2-heimdall-1.4.0-44.1.i586.rpm
			elif [[ "$version" == "2" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/opensuse12.2-heimdall-1.4.0-44.1.x86_64.rpm
				echo "Done!"
				echo "Installing it..." 
				sudo zypper in ../S4Root/opensuse12.2-heimdall-1.4.0-44.1.x86_64.rpm
			elif [[ "$version" == "3" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/opensuse12.3-heimdall-1.4.0-44.1.i586.rpm
				echo "Done!"
				echo "Installing it..." 
				sudo zypper in ../S4Root/opensuse12.3-heimdall-1.4.0-44.1.i586.rpm
			elif [[ "$version" == "4" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/opensuse12.3-heimdall-1.4.0-44.1.x86_64.rpm
				echo "Done!"
				echo "Installing it..." 
				sudo zypper in ../S4Root/opensuse12.3-heimdall-1.4.0-44.1.x86_64.rpm
			elif [[ "$version" == "99" ]]; then
				NotListed
		fi		

	elif [[ "$os" == "5" ]]
		then
		echo "Which Debian version are you using?"
		echo "[ 1 ] Debian 7 - 32 bits"
		echo "[ 2 ] Debian 7 - 64 bits"
		echo "[ 99 ] Not listed above"
		read version
			if [[ "$version" == "1" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/debian7-heimdall_1.4.0-0_i386.deb
				echo "Done!"
				echo "Installing it..."
				sudo dpkg -i debian7-heimdall_1.4.0-0_i386.deb && sudo apt-get install -f
			elif [[ "$version" == "2" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/debian7-heimdall_1.4.0-0_amd64.deb
				echo "Done!"
				echo "Installing it..."
				sudo dpkg -i debian7-heimdall_1.4.0-0_amd64.deb && sudo apt-get install -f
			elif [[ "$version" == "99" ]]; then
				NotListed
		fi		

	elif [[ "$os" == "6" ]]
		then
		echo "Which CentOS version are you using?"
		echo "[ 1 ] CentOS 6 - 32 bits"
		echo "[ 2 ] CentOS 6 - 64 bits"
		echo "[ 99 ] Not listed above"
		read version
			if [[ "$version" == "1" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/centos6-heimdall-1.4.0-44.1.i686.rpm
				echo "Done!"
				echo "Installing it..."
				sudo yum --nogpgcheck localinstall centos6-heimdall-1.4.0-44.1.i686.rpm
			elif [[ "$version" == "2" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/centos6-heimdall-1.4.0-44.1.x86_64.rpm
				echo "Done!"
				echo "Installing it..."
				sudo yum --nogpgcheck localinstall centos6-heimdall-1.4.0-44.1.x86_64.rpm
			elif [[ "$version" == "99" ]]; then
				NotListed
		fi		

	elif [[ "$os" == "7" ]]
		then
		echo "Which RHEL version are you using?"
		echo "[ 1 ] RHEL - 32 bits"
		echo "[ 2 ] RHEL - 64 bits"
		echo "[ 99 ] Not listed above"
		read version
			if [[ "$version" == "1" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/RHEL6-heimdall-1.4.0-44.1.i686.rpm
				echo "Done!"
				echo "Installing it..."
				sudo yum localinstall RHEL6-heimdall-1.4.0-44.1.i686.rpm
			elif [[ "$version" == "2" ]]; then
				echo "Downloading Heimdall"
				wget https://bitbucket.org/benjamin_dobell/heimdall/downloads/RHEL6-heimdall-1.4.0-44.1.x86_64.rpm
				echo "Done!"
				echo "Installing it..."
				sudo yum localinstall RHEL6-heimdall-1.4.0-44.1.x86_64.rpm
			elif [[ "$version" == "99" ]]; then
				NotListed
		fi		

	elif [[ "$os" == "99" ]]
		then
		NotListed
fi
}

#Creating unzip function
#In case user does not have it installed
function unzip-i {
which apt-get && manager=1
which yum && manager=2
which zypper && manager=3
which pacman && manager=4

case $manager in
	1)
	echo "apt-get found..."
	sudo apt-get install unzip
	;;

	2)
	echo "yum found..."
	sudo yum install unzip
	;;

	3)
	echo "zypper found..."
	sudo zypper install unzip
	;;

	4)
	echo "pacman found..."
	sudo pacman -S unzip
	;;

	*)
	error "No package manager was found... Try installing unzip manually..."
	;;
esac
}

#Initial Screen

clear
echo "This utility will root your Galaxy S4 (GT-I9505)"
echo "Script written by XxLordxX"
echo -n "Press [Enter] key to continue..."
read var
mkdir S4Root/	#creating folder to organize better
cd S4Root/

clear

#Checking depencies

echo "First we must be sure adb is installed!"
which adb && adbbinary=1 || adbbinary=2

case $adbbinary in
	2)
	echo "adb not found..."
	echo "Downloading and installing..."
	wget http://www.undergroundandroid.com/developers/xLordAIOx/bin/adb
	sudo cp adb /usr/bin/adb
	sudo chmod 755 /usr/bin/adb
	;;

	*)
	echo ""
	;;
esac

echo -n "Press [Enter] key to continue..."
read var

clear

echo "Now we must be sure the programm Heimdall is installed"
which heimdall || heimdall-i

echo -n "Press [Enter] key to continue..."
read var

clear

echo "Making sure unzip is installed"
which unzip || unzip-i

echo -n "Press [Enter] key to continue..."
read var

clear

echo "Downloading busybox and su binaries and Superuser apk..."
wget http://undergroundandroid.com/developers/xLordAIOx/S4/bin/su
wget http://undergroundandroid.com/developers/xLordAIOx/S4/bin/busybox
wget http://undergroundandroid.com/developers/xLordAIOx/S4/bin/Superuser.apk
mkdir s4bin
mv su s4bin/su
mv busybox s4bin/busybox
mv Superuser.apk s4bin/Superuser.apk

echo -n "Press [Enter] key to continue..."
read var

clear

echo "Downloading recovery..."
wget http://fs1.d-h.st/download/00056/cLG/philz_touch_5.08.0-i9505.zip
unzip philz_touch_5.08.0-i9505.zip
rm -r META-INF

echo "Dependecies download/setup complete!"
echo ""
echo -n "Press [Enter] key to proceed with root..."
read var

clear

echo "Plug your device now"
echo "Remember to check USB Debugging on!"
echo "Also a toast screen will appear, select 'always allow' and click allow"
adb wait-for-device
echo "Device Found!"

echo -n "Press [Enter] key to reboot your device in download mode..."
read var

clear

echo "Rebooting..."
adb reboot download
echo "You may need to read something..."
echo "Make sure you do it and press Vol+"

echo -n "Press [Enter] key when device is on download mode..."
read var

echo "Checking if device is found..."
sudo heimdall detect
echo "If it doesn't show, press Crt-C in.."
for ((i = 5; i >= 0; i--)); do
    echo "$i"
    sleep 1
done
echo "Flashing recovery..."
sudo heimdall flash --RECOVERY recovery.img
echo "Your device must be restarting now..."
adb wait-for-device
echo "Rebooting in recovery..."
adb reboot recovery
echo -n "Press [Enter] key when device booted on recovery..."
read var
clear
echo "Please click 'Mounts and Storage Menu'"
echo "Please select 'Mount /system/'"
echo -n "Press [Enter] key when done..."
read var
echo "Rooting your device now!"
adb push s4bin/su /system/xbin/su
adb push s4bin/Superuser.apk /system/app/Superuser.apk
adb push s4bin/busybox /system/bin/busybox
echo "Done..."
echo "Press the 'Back' button and click 'Reboot System Now'"
echo "Select 'Yes' to fix permissions"
echo "After that your device may be rebooting"

echo -n "Press [Enter] key to clean up folder..."
read var

clear

echo "Cleaning up..."
cd ..
rm -rf S4Root/
echo "Done!"

echo -n "Press [Enter] key to finish..."
read var

clear

echo "Do you want to flash back stock recovery?"
echo "[ 1 ] Yes"
echo "[ 2 ] No"

read recovery

	if [[ "$recovery" == "1" ]]
		then
		wget http://undergroundandroid.com/developers/xLordAIOx/S4/stockrecovery.img
		echo "Rebooting in download mode"
		adb reboot download
			echo -n "Press [Enter] key when on download mode..."
			read var
			sudo heimdall flash stockrecovery.img
		echo "Done!"
		echo "Cleaning up..."
		rm stockrecovery.img
		echo ""

	elif [[ "$recovery" == "2" ]]
		echo ""

	fi

echo "Cheers!"
echo ""
echo "If you liked this work, please donate me!"
echo "Congrats for rooting your cellphone!"
echo "Hope you enjoy!"
echo -n "Press [Enter] key to exit..."
read var
exit

Utiliser des logiciels propriétaires, c'est comme les plats préparés, on est incapable de dire les conservateurs qu'ils contiennent, on dira toujours que c'est bon, mais ça ne remplacera jamais le repas fait maison par sa maman.
]:D #! Crunchbang & Archlinux GNU/Linux User ]:D

Hors ligne

Pied de page des forums