R
ralf89
Erfahrenes Mitglied
- 79
Im XDA-Forum gibt es eine interessante Neuigkeit. Es sieht so aus, dass es das erste TWRP gibt für das Mi 11 Ultra?
TWRP 3.5.1 for Mi 11 Ultra
TWRP 3.5.1 for Mi 11 Ultra
Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion erfordert derzeit den Zugriff auf die Seite über den integrierten Safari-Browser.
#!/sbin/sh
#Produziert von Remnants of the Core This Life
#2021.05.07
#
OUTFD=$2
if [ -n "$2" ];then
readlink /proc/$$/fd/$OUTFD 2>/dev/null | grep /tmp >/dev/null
if [ "$?" -eq "0" ]; then
# rerouted to log file, we don't want our ui_print commands going there
OUTFD=0
# we are probably running in embedded mode, see if we can find the right fd
# we know the fd is a pipe and that the parent updater may have been started as
# 'update-binary 3 fd zipfile'
for FD in `ls /proc/$$/fd`; do
readlink /proc/$$/fd/$FD 2>/dev/null | grep pipe >/dev/null
if [ "$?" -eq "0" ]; then
ps | grep " 3 $FD " | grep -v grep >/dev/null
if [ "$?" -eq "0" ]; then
OUTFD=$FD
break
fi
fi
done
fi
ui_print() {
echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD
}
else
ui_print() {
echo "$1"
}
fi
# find_block [partname...]
find_block() {
local BLOCK DEV DEVICE DEVNAME PARTNAME UEVENT
for BLOCK in "$@"; do
DEVICE=`find /dev/block \( -type b -o -type c -o -type l \) -iname $BLOCK | head -n 1` 2>/dev/null
if [ ! -z $DEVICE ]; then
readlink -f $DEVICE
return 0
fi
done
return 1
}
grep_cmdline() {
local REGEX="s/^$1=//p"
cat /proc/cmdline | tr '[:space' '\n' | sed -n "$REGEX" 2>/dev/null
}
find_boot_image() {
BOOTIMAGE=
# Check A/B slot
SLOT=`grep_cmdline androidboot.slot_suffix`
if [ -z $SLOT ]; then
SLOT=`grep_cmdline androidboot.slot`
[ -z $SLOT ] || SLOT=_${SLOT}
fi
[ -z $SLOT ] || ui_print "- Current boot slot: $SLOT"
BOOTIMAGE=`find_block ramdisk$SLOT recovery_ramdisk$SLOT boot$SLOT`
if [ $SLOT = "_a" ]; then
BOOTIMAGE2=`find_block ramdisk_b recovery_ramdisk_b boot_b`
elif [ $SLOT = "_b" ]; then
BOOTIMAGE2=`find_block ramdisk_a recovery_ramdisk_a boot_a`
fi
}
flash_image() {
case "$1" in
*.gz) CMD1="gzip -d < '$1' 2>/dev/null";;
*) CMD1="cat '$1'";;
esac
CMD2="cat -"
if [ -b "$2" ]; then
local img_sz=$(stat -c '%s' "$1")
local blk_sz=$(blockdev --getsize64 "$2")
[ "$img_sz" -gt "$blk_sz" ] && return 1
blockdev --setrw "$2"
local blk_ro=$(blockdev --getro "$2")
[ "$blk_ro" -eq 1 ] && return 2
eval "$CMD1" | eval "$CMD2" | cat - /dev/zero > "$2" 2>/dev/null
else
ui_print "- Not block or char device, storing image"
fi
return 0
}
xinkid_envsetup(){
if [ -d /tmp/xinkid_twrp_patch ];then
rm -rf /tmp/xinkid_twrp_patch
fi
mkdir -p /tmp/xinkid_twrp_patch/origboot
mkdir -p /tmp/xinkid_twrp_patch/origboot2
bootdir=/tmp/xinkid_twrp_patch/origboot
bootdir2=/tmp/xinkid_twrp_patch/origboot2
}
ui_print "-----------------------------------------------------------";
ui_print " TWRP auf der Boot-Partition installieren ";
ui_print "Produziert von Remnants of the Core This Life Never Changes";
ui_print "-----------------------------------------------------------";
xinkid_envsetup
find_boot_image
cd $bootdir
ui_print "Starte TWRP-Installation auf der ersten Boot-Partition, bitte warten";
magiskboot unpack "$BOOTIMAGE"
cp -rf /sbin/xinkid_twrp_ramdisk.cpio ramdisk.cpio
magiskboot cpio ramdisk.cpio "add 0644 sbin/xinkid_twrp_ramdisk.cpio /sbin/xinkid_twrp_ramdisk.cpio"
umount /vendor 2>/dev/null
mount -o ro /vendor
for i in $(ls "/vendor/lib/modules"); do
if [ -f "/vendor/lib/modules/$i" ]; then
magiskboot cpio ramdisk.cpio "add 0644 vendor/lib/modules/$i /vendor/lib/modules/$i"
fi
done
for j in $(ls "/vendor/lib/modules/5.4-gki"); do
if [ -f "/vendor/lib/modules/5.4-gki/$j" ]; then
magiskboot cpio ramdisk.cpio "add 0644 vendor/lib/modules/5.4-gki/$j /vendor/lib/modules/5.4-gki/$j"
fi
done
umount /vendor 2>/dev/null
magiskboot repack $BOOTIMAGE patch_twrp_boot.img
flash_image patch_twrp_boot.img $BOOTIMAGE
cd $bootdir2
ui_print "Starte TWRP-Installation auf der zweiten Boot-Partition, bitte warten";
magiskboot unpack "$BOOTIMAGE2"
cp -rf $bootdir/ramdisk.cpio ramdisk.cpio
magiskboot repack $BOOTIMAGE2 patch_twrp_boot2.img
flash_image patch_twrp_boot2.img $BOOTIMAGE2
ui_print "Installation abgeschlossen!";
rm -rf /tmp/xinkid_twrp_patch