Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
XenonTheInertG authored Feb 22, 2021
1 parent c6d56a8 commit b205b08
Show file tree
Hide file tree
Showing 3 changed files with 542 additions and 0 deletions.
41 changes: 41 additions & 0 deletions fbe_bypass.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/system/bin/sh

# Detects if we have a /data partition that is not actually using file encryption even though
# the device expects it. If so, try to patch the fstabs so we can actually boot.

KILLFBE=false
HARDWARE=$(getprop ro.boot.hardware)
if (! `mount 2>/dev/null | grep " /data " >/dev/null`); then
DATA=$(cat /odm/etc/fstab.$HARDWARE /vendor/etc/fstab.$HARDWARE /fstab.$HARDWARE 2>/dev/null | grep -m 1 " /data " | tr -s " ")
if (`echo "$DATA" 2>/dev/null | grep fileencryption >/dev/null`); then
DEV=$(echo $DATA | cut -f 1 -d " ")
echo $DEV
if (`mount -t ext4 -o ro $DEV /data >/dev/null 2>/dev/null`); then
if [ -f "/data/system/packages.xml" ]; then
KILLFBE=true
fi
umount /data
fi
fi
fi

# remove_fbe infstab outfstab
remove_fbe() {
umount $1
if (`cat $1 2>/dev/null | grep fileencryption >/dev/null`); then
cat $1 2>/dev/null | sed 's/,fileencryption=.*[, ]/,/' > $2
for i in `ls -lZ $1 2>/dev/null`; do
if (`echo $i | grep object_r >/dev/null`); then
chcon $i $2
fi
done
mount -o bind $2 $1
fi
}

if ($KILLFBE); then
mkdir /dev/block/supersu_fbe
remove_fbe /odm/etc/fstab.$HARDWARE /dev/block/supersu_fbe/fstab.odm
remove_fbe /vendor/etc/fstab.$HARDWARE /dev/block/supersu_fbe/fstab.vendor
remove_fbe /fstab.$HARDWARE /dev/block/supersu_fbe/fstab.rootfs
fi
17 changes: 17 additions & 0 deletions install-recovery.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/system/bin/sh

# If you're implementing this in a custom kernel/firmware,
# I suggest you use a different script name, and add a service
# to launch it from init.rc

# Launches SuperSU in daemon mode only on Android 4.3+.
# Nothing will happen on 4.2.x or older, unless SELinux+Enforcing.
# If you want to force loading the daemon, use "--daemon" instead

/system/xbin/daemonsu --auto-daemon &

# Some apps like to run stuff from this script as well, that will
# obviously break root - in your code, just search this file
# for "install-recovery-2.sh", and if present, write there instead.

/system/etc/install-recovery-2.sh
Loading

0 comments on commit b205b08

Please sign in to comment.