Skip to content

Commit

Permalink
Fixed mount logic. Note: Clear the module environment before updating…
Browse files Browse the repository at this point in the history
… to releases with this commit included
  • Loading branch information
rmnscnce committed Aug 24, 2020
1 parent 36accd2 commit 6b9b47b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions common/hsu_functions
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,20 @@ initenv () {
tar -ch --exclude=*magisk* --exclude=*su* --exclude=resetprop /sbin/. | tar -x -C $HSUFSPATH/images/mirrors/
if [ "$SESTAT" = 0 ] ; then
mkdir -p $HSUFSPATH/images/mount_sbin
mount -t ext4 -o rw $HSUFSPATH/images/sbin.img $HSUFSPATH/images/sbin_mount
mount -w -t ext4 $HSUFSPATH/images/sbin.img $HSUFSPATH/images/mount_sbin
tar -ch -C $HSUFSPATH/images/mirrors/sbin/ . | tar -x -C $HSUFSPATH/images/mount_sbin/
umount $HSUFSPATH/images/mount_sbin
echo -e "\nSuccessfully initialized mirror image. Returning to main menu..."
oobecheck
elif [ "$SESTAT" = 1 ] ; then
echo -e "SELinux enforcing mode detected! Setting to permissive SELinux..."
setenforce 0
mkdir -p $HSUFSPATH/images/mount_sbin
mount -t ext4 -o rw $HSUFSPATH/images/sbin.img $HSUFSPATH/images/sbin_mount
mount -w -t ext4 $HSUFSPATH/images/sbin.img $HSUFSPATH/images/mount_sbin
tar -ch -C $HSUFSPATH/images/mirrors/sbin/ . | tar -x -C $HSUFSPATH/images/mount_sbin/
umount $HSUFSPATH/images/mount_sbin
setenforce 1
echo -e "Restoring SELinux enforcing..."
echo -e "\nSuccessfully initialized mirror image. Returning to main menu..."
oobecheck
else
Expand Down Expand Up @@ -152,7 +154,7 @@ hideroot () {
menuheader "Magisk and root hide\n\nThis does disable and hide Magisk and root until interrupted\n$LINEDIV\nWarning! If the shell session got abruptly terminated (which is really rare to happen), you will have to do a reboot to re-enable Magisk and root."
echo -e "\nInitializing Magisk and root hide..."
if [ "$SESTAT" = 0 ] ; then
mount -t ext4 -o r $HSUFSPATH/images/sbin.img /sbin
mount -r -t ext4 $HSUFSPATH/images/sbin.img /sbin
echo -e "\nMagisk and root hide started."
echo -e "\nInput any key to interrupt and stop"
read -rsn 1
Expand All @@ -162,8 +164,9 @@ hideroot () {
read -rsn 1
oobecheck
elif [ "$SESTAT" = 1 ] ; then
echo -e "SELinux enforcing mode detected! Setting to permissive SELinux..."
setenforce 0
mount -t ext4 -o r $HSUFSPATH/images/sbin.img /sbin
mount -r -t ext4 $HSUFSPATH/images/sbin.img /sbin
echo -e "\nMagisk and root hide started."
echo -e "\nInput any key to interrupt and stop"
read -rsn 1
Expand Down
2 changes: 1 addition & 1 deletion module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=hsu
name=hsu - Magisk and root hide
version=PRERELEASE
versionCode=18
versionCode=19
author=rmnscnce (xaedoplay@XDA)
description=Hide Magisk and root system-wide to prevent any kinds of detection
#TODO support=

0 comments on commit 6b9b47b

Please sign in to comment.