Professional Documents
Culture Documents
/sbin/sh
#Modificated updater-binary by iicc to be installed without a recovery
#All thanks come for rovo89, the developer of Xposed
#XDA link: http://forum.xda-developers.com/showthread.php?t=3034811
clear
echo ""
echo ""
echo ""
echo ""
echo ""
echo -n "Seguro que quieres instalar Xposed?
Selecciona una opcion:
[ Si = 1 | No = 2 ]: "
read option
if [ $option -ne 2 ]; then
echo ""
echo ""
sleep 1.5
echo "Montando particiones y creando directorios..."
echo ""
echo ""
sleep 2
mount -o rw,remount /system
mount -o rw,remount /storage/emulated
mount -o rw,remount /system /system
mount -o rw,remount /
mount -o rw,remount / /
mkdir -p -v /tmp/xposed
unzip /sdcard/xposed-v75-sdk21-arm -d /tmp/xposed
sleep 1
echo ""
echo ""
echo "Ejecutando el script principal..."
echo ""
echo ""
else
echo "saliendo..."
sleep 1
clear
exit
fi
sleep 3
#######################################################################
#######################################################################
OUTFD=$2
ZIP=$3
SYSTEMLIB=/system/lib
ui_print() {
echo -n -e "ui_print $1\n" > /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" > /proc/self/fd/$OUTFD
}
ch_con() {
LD_LIBRARY_PATH=$SYSTEMLIB /system/toolbox chcon -h u:object_r:system_file:s0 $1
LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toolbox chcon -h u:object_r:system_file:s0
$1
chcon -h u:object_r:system_file:s0 $1
LD_LIBRARY_PATH=$SYSTEMLIB /system/toolbox chcon u:object_r:system_file:s0 $1
LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toolbox chcon u:object_r:system_file:s0 $1
chcon u:object_r:system_file:s0 $1
}
ch_con_ext() {
LD_LIBRARY_PATH=$SYSTEMLIB /system/toolbox chcon $2 $1
LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toolbox chcon $2 $1
chcon $2 $1
}
ln_ext() {
LD_LIBRARY_PATH=$SYSTEMLIB /system/toolbox ln -s $1 $2
LD_LIBRARY_PATH=$SYSTEMLIB /system/bin/toolbox ln -s $1 $2
ln -s $1 $2
}
set_perm() {
chown $1.$2 $4
chown $1:$2 $4
chmod $3 $4
ch_con $4
ch_con_ext $4 $5
}
cp_perm() {
rm $5
cat $4 > $5
set_perm $1 $2 $3 $5 $6
}
install_and_link() {
TARGET=$1
XPOSED="${1}_xposed"
BACKUP="${1}_original"
if [ ! -f "/tmp/xposed/$XPOSED" ]; then
return
fi
cp_perm $2 $3 $4 /tmp/xposed/$XPOSED $XPOSED $5
if [ ! -f $BACKUP ]; then
mv $TARGET $BACKUP
ln_ext $XPOSED $TARGET
fi
}
install_overwrite() {
TARGET=$1
if [ ! -f "/tmp/xposed/$TARGET" ]; then
return
fi
BACKUP="${1}.orig"
NO_ORIG="${1}.no_orig"
if [ ! -f $TARGET ]; then
echo -n > $NO_ORIG
elif [ ! -f $BACKUP -a ! -f $NO_ORIG ]; then
mv $TARGET $BACKUP
fi
cp_perm $2 $3 $4 /tmp/xposed/$TARGET $TARGET $5
}
cd /tmp/xposed
if [ ! -f "/tmp/xposed/system/xposed.prop" ]; then
ui_print "! Failed: /tmp/xposed/system/xposed not found!"
exit 1
fi
ARCH=arm
IS64BIT=false
RC=0
if [ "$ABI" = "x86" ]; then ARCH=x86; fi;
if [ "$ABI2" = "x86" ]; then ARCH=x86; fi;
if [ "$API" -eq "$API" ]; then
if [ "$API" -ge "21" ]; then
if [ "$ABILONG" = "arm64-v8a" ]; then ARCH=arm64; SYSTEMLIB=/system/lib64;
IS64BIT=true; fi;
if [ "$ABILONG" = "x86_64" ]; then ARCH=x64; SYSTEMLIB=/system/lib64;
IS64BIT=true; fi;
fi
fi
if ($XVALID); then
ui_print "- Placing files"
rm /system/toolbox
else
ui_print "! Please download the correct package"
ui_print "! for your platform/ROM!"
RC=1
fi
rm -r /tmp/xposed
ui_print "- Unmounting /system"
umount /system
ui_print "- Done !"
#########
echo""
echo""
echo "fin de la instalacion. Ahora ve a xposed y marca la opcion de reinicio suave"
exit $RC
#########