From b4fe4f3d10cb6b6be8d567738bb176eda2ede02d Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 18 Mar 2017 17:00:04 +0800 Subject: [PATCH] Rename sepolicy-inject --- .gitmodules | 6 +++--- jni/Android.mk | 2 +- jni/magiskhide/magiskhide.h | 2 +- jni/magiskpolicy | 1 + jni/sepolicy-inject | 1 - scripts/flash_script.sh | 4 ++-- scripts/magic_mask.sh | 2 +- scripts/magisksu.sh | 2 +- scripts/ramdisk_patch.sh | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) create mode 160000 jni/magiskpolicy delete mode 160000 jni/sepolicy-inject diff --git a/.gitmodules b/.gitmodules index 527ea52ad..5e0ab335d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "jni/sepolicy-inject"] - path = jni/sepolicy-inject - url = https://github.com/topjohnwu/sepolicy-inject [submodule "jni/selinux"] path = jni/selinux url = https://github.com/topjohnwu/selinux.git @@ -10,3 +7,6 @@ [submodule "jni/ndk-compression"] path = jni/ndk-compression url = https://github.com/topjohnwu/ndk-compression.git +[submodule "jni/magiskpolicy"] + path = jni/magiskpolicy + url = https://github.com/topjohnwu/magiskpolicy.git diff --git a/jni/Android.mk b/jni/Android.mk index afd1549c7..5e0bd875c 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -3,5 +3,5 @@ LOCAL_PATH := $(call my-dir) include jni/magiskboot/Android.mk include jni/magiskhide/Android.mk include jni/resetprop/Android.mk -include jni/sepolicy-inject/Android.mk +include jni/magiskpolicy/Android.mk include jni/su/Android.mk diff --git a/jni/magiskhide/magiskhide.h b/jni/magiskhide/magiskhide.h index 70814f6d0..af3773f5c 100644 --- a/jni/magiskhide/magiskhide.h +++ b/jni/magiskhide/magiskhide.h @@ -22,7 +22,7 @@ #define HIDELIST "/magisk/.core/magiskhide/hidelist" #define DUMMYPATH "/dev/magisk/dummy" #define ENFORCE_FILE "/sys/fs/selinux/enforce" -#define SEPOLICY_INJECT "/data/magisk/sepolicy-inject" +#define SEPOLICY_INJECT "/data/magisk/magiskpolicy" // Main thread void monitor_proc(); diff --git a/jni/magiskpolicy b/jni/magiskpolicy new file mode 160000 index 000000000..ca75dd072 --- /dev/null +++ b/jni/magiskpolicy @@ -0,0 +1 @@ +Subproject commit ca75dd07283ff5fb9fec32f106ba8c58642742a0 diff --git a/jni/sepolicy-inject b/jni/sepolicy-inject deleted file mode 160000 index 9f35fa0fa..000000000 --- a/jni/sepolicy-inject +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9f35fa0fa3f9b52c2b6b31253bade848019d7ab2 diff --git a/scripts/flash_script.sh b/scripts/flash_script.sh index db54f2707..d47ded835 100644 --- a/scripts/flash_script.sh +++ b/scripts/flash_script.sh @@ -248,7 +248,7 @@ is_mounted /data && MAGISKBIN=/data/magisk || MAGISKBIN=/cache/data_bin # Copy required files rm -rf $MAGISKBIN 2>/dev/null mkdir -p $MAGISKBIN -cp -af $BINDIR/busybox $BINDIR/sepolicy-inject $BINDIR/resetprop $BINDIR/magiskboot \ +cp -af $BINDIR/busybox $BINDIR/magiskpolicy $BINDIR/resetprop $BINDIR/magiskboot \ $COMMONDIR/ramdisk_patch.sh $COMMONDIR/init.magisk.rc \ $COMMONDIR/magic_mask.sh $COMMONDIR/magisk.apk $MAGISKBIN chmod -R 755 $MAGISKBIN @@ -391,7 +391,7 @@ rm -f ramdisk.cpio.orig ########################################################################################## # Fix SuperSU..... -$BOOTMODE && $BINDIR/sepolicy-inject --live "allow fsck * * *" +$BOOTMODE && $BINDIR/magiskpolicy --live "allow fsck * * *" if (is_mounted /data); then IMG=/data/magisk.img diff --git a/scripts/magic_mask.sh b/scripts/magic_mask.sh index 556b0295a..1ea832571 100644 --- a/scripts/magic_mask.sh +++ b/scripts/magic_mask.sh @@ -305,7 +305,7 @@ case $1 in chown -R 0.0 $BINPATH # Live patch sepolicy - $BINPATH/sepolicy-inject --live + $BINPATH/magiskpolicy --live if [ -f $UNINSTALLER ]; then touch /dev/.magisk.unblock diff --git a/scripts/magisksu.sh b/scripts/magisksu.sh index 1daf23c09..09dd05e63 100644 --- a/scripts/magisksu.sh +++ b/scripts/magisksu.sh @@ -21,7 +21,7 @@ ln -s /sbin_orig/* $MODDIR/sbin_bind chcon -h u:object_r:rootfs:s0 $MODDIR/sbin_bind/* chmod 755 $MODDIR/sbin_bind ln -s $MODDIR/su $MODDIR/sbin_bind/su -ln -s /data/magisk/sepolicy-inject $MODDIR/sbin_bind/sepolicy-inject +ln -s /data/magisk/magiskpolicy $MODDIR/sbin_bind/magiskpolicy mount -o bind $MODDIR/sbin_bind /sbin log_print "Starting su daemon" diff --git a/scripts/ramdisk_patch.sh b/scripts/ramdisk_patch.sh index 8cdb4aa24..f90d059af 100644 --- a/scripts/ramdisk_patch.sh +++ b/scripts/ramdisk_patch.sh @@ -43,7 +43,7 @@ cpio_add 750 init.rc init.rc # sepolicy patches cpio_extract sepolicy sepolicy -LD_LIBRARY_PATH=$SYSTEMLIB $MAGISKBIN/sepolicy-inject --load sepolicy --save sepolicy --minimal +LD_LIBRARY_PATH=$SYSTEMLIB $MAGISKBIN/magiskpolicy --load sepolicy --save sepolicy --minimal cpio_add 644 sepolicy sepolicy # Add new items