-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6d56a8
commit b205b08
Showing
3 changed files
with
542 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.