[SuperSU] _alexndr:
Samsung Nougat - Camera/Torch/Sensors/Brightness/mtp FIX

[MENTION=631273]Chainfire[/MENTION], I can confirm that patched file_contexts.bin causes the problem in G935F running Nougat beta (some time ago [MENTION=4074799]ambasadii[/MENTION] mentioned it in BETA thread, it seemed ridiculous until I tested it).

I have no idea why some people experience this issue with camera/torch/sensors/mtp/brightness while other people does not (including you), but it is really serious issue for a lot of G930F/G935F owners (phone is almost unusable with SuperSU)...

I have modified slightly your updater-script and decided to share modified SuperSU-v2.79 zip installer (containing temporary fix based on original file_contexts.bin), until you introduce an official, permanent fix. I'm sure it will temporarily help many G930F & G935F users

Installer is noob-proof :D it keeps original file contexts_bin in the kernel's ramdisk only in case of Samsung devices running Nougat (API 24). New lines are marked in red:

[...]

check_zero_def "- Adding daemon launcher" "LD_LIBRARY_PATH=$SYSTEMLIB /su/bin/sukernel --cpio-add /sutmp/ramdisk /sutmp/ramdisk 700 ${CPIO_PREFIX}sbin/launch_daemonsu.sh $COM/launch_daemonsu.sh"
check_zero_def "- Adding init script" "LD_LIBRARY_PATH=$SYSTEMLIB /su/bin/sukernel --cpio-add /sutmp/ramdisk /sutmp/ramdisk 750 ${CPIO_PREFIX}init.supersu.rc $COM/init.supersu.rc"

check_zero_def "- Creating mount point" "LD_LIBRARY_PATH=$SYSTEMLIB /su/bin/sukernel --cpio-mkdir /sutmp/ramdisk /sutmp/ramdisk 755 ${CPIO_PREFIX}su"
[COLOR="Red"] if ($SAMSUNG) && [ $API -eq 24 ] ; then
LD_LIBRARY_PATH=$SYSTEMLIB /su/bin/sukernel --cpio-extract /sutmp/ramdisk file_contexts.bin /sutmp/file_contexts.bin
fi[/COLOR]
COMMAND="LD_LIBRARY_PATH=$SYSTEMLIB /su/bin/sukernel --patch /sutmp/ramdisk /sutmp/ramdisk $STOCKBOOTIMAGE --sdk=$API"
if ($KEEPVERITY); then
COMMAND="$COMMAND --keep-verity"
fi
if ($KEEPFORCEENCRYPT); then
COMMAND="$COMMAND --keep-forceencrypt"
fi
check_zero_def "- Patching init.*.rc, fstabs, file_contexts, dm-verity" "$COMMAND"
[COLOR="red"] if ($SAMSUNG) && [ $API -eq 24 ] ; then
LD_LIBRARY_PATH=$SYSTEMLIB /su/bin/sukernel --cpio-add /sutmp/ramdisk /sutmp/ramdisk 644 file_contexts.bin /sutmp/file_contexts.bin
fi[/COLOR]
if ($CONTINUE); then
if ($SLOT_USED); then
ui_print "- Patching init, system_root, system"

LD_LIBRARY_PATH=$RAMDISKLIB $BIN/sukernel --cpio-extract /sutmp/ramdisk sbin/twrp /sutmp/twrp
if [ -f "/sutmp/twrp" ]; then
# backup TWRP's version of init
check_zero_def "" "LD_LIBRARY_PATH=$RAMDISKLIB $BIN/sukernel --cpio-extract /sutmp/ramdisk init /sutmp/init_twrp"
check_zero_def "" "LD_LIBRARY_PATH=$RAMDISKLIB $BIN/sukernel --cpio-add /sutmp/ramdisk /sutmp/ramdisk 750 init_twrp /sutmp/init_twrp"
fi

check_zero_def "" "LD_LIBRARY_PATH=$SYSTEMLIB /su/bin/sukernel --cpio-add /sutmp/ramdisk /sutmp/ramdisk 750 init $BIN/suinit"
check_zero_def "" "LD_LIBRARY_PATH=$SYSTEMLIB /su/bin/sukernel --cpio-mkdir /sutmp/ramdisk /sutmp/ramdisk 755 boot/system_root"
check_zero_def "" "LD_LIBRARY_PATH=$SYSTEMLIB /su/bin/sukernel --cpio-mkdir /sutmp/ramdisk /sutmp/ramdisk 755 boot/system"

if (! $CONTINUE); then
ui_print_less "$UI_PRINT_LAST"
ui_print_always "--- Failure, aborting"
fi
fi
fi

[...]

[MENTION=6713660]Black_Focus_X[/MENTION], [MENTION=7792208]Xp3riaXpr3ss[/MENTION] and other people who experienced these issues with camera/torch/sensors/mtp/brightness @ Samsung G930F/G935F running Nougat - please try to flash attached ZIP and post here a feedback