upload scripts
This commit is contained in:
8 files changed
+90
No files matched your search
@@ -0,0 +1,3 @@
|
||||
# 1.0.0
|
||||
|
||||
* Initial release
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/sbin/sh
|
||||
|
||||
#################
|
||||
# Initialization
|
||||
#################
|
||||
|
||||
umask 022
|
||||
|
||||
# echo before loading util_functions
|
||||
ui_print() { echo "$1"; }
|
||||
|
||||
require_new_magisk() {
|
||||
ui_print "*******************************"
|
||||
ui_print " Please install Magisk v20.4+! "
|
||||
ui_print "*******************************"
|
||||
exit 1
|
||||
}
|
||||
|
||||
#########################
|
||||
# Load util_functions.sh
|
||||
#########################
|
||||
|
||||
OUTFD=$2
|
||||
ZIPFILE=$3
|
||||
|
||||
mount /data 2>/dev/null
|
||||
|
||||
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
|
||||
. /data/adb/magisk/util_functions.sh
|
||||
[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk
|
||||
|
||||
install_module
|
||||
exit 0
|
||||
@@ -0,0 +1 @@
|
||||
#MAGISK
|
||||
@@ -0,0 +1,6 @@
|
||||
# Minimum Brightness for OnePlus Turbo 6X
|
||||
|
||||
This module ensures the screen brightness of the phone does not go below 1,
|
||||
to prevent screen from failing to turn back on under LineageOS GSI.
|
||||
|
||||
thanks to https://github.com/agross/poco-x5-pro-5g-min-brightness
|
||||
@@ -0,0 +1,2 @@
|
||||
ui_print "Making $MODPATH/min-brightness.sh executable"
|
||||
set_perm "$MODPATH/min-brightness.sh" 0 0 0755
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/system/bin/sh
|
||||
|
||||
# This script checks the current brightness ensures a minimum brightness of 2.
|
||||
# This prevents the black screen if the brightness is 1(screen_brightness).
|
||||
|
||||
BRIGHTNESS_FILE=/sys/devices/platform/mtk-leds/leds/lcd-backlight/brightness
|
||||
BRIGHTNESS="$(cat "$BRIGHTNESS_FILE")"
|
||||
|
||||
if [ "$BRIGHTNESS" -lt 15 ]; then
|
||||
settings put system screen_brightness 2
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,7 @@
|
||||
id=oneplus-turbo-6x-min-brightness
|
||||
version=1.0.0
|
||||
versionCode=1
|
||||
name=OnePlus Turbo 6X Minimum Brightness
|
||||
author=pluvium27 @ GitHub
|
||||
description=Enforces minimum screen brightness on OnePlus Turbo 6X to prevent black screen
|
||||
support=https://github.com/pluvium27/oneplus-turbo-6x-min-brightness/issues
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
#!/system/bin/sh
|
||||
|
||||
# Do NOT assume where your module will be located. ALWAYS use $MODDIR if you
|
||||
# need to know where this script and module is placed. This will make sure your
|
||||
# module will work if Magisk changes it's mount point in the future.
|
||||
MODDIR="${0%/*}"
|
||||
|
||||
BRIGHTNESS_FILE=/sys/devices/platform/mtk-leds/leds/lcd-backlight/brightness
|
||||
BRIGHTNESS_SCRIPT="$MODDIR/min-brightness.sh"
|
||||
|
||||
until [ "$(getprop sys.boot_completed)" = 1 ] && \
|
||||
[ "$(getprop dev.bootcomplete)" = 1 ] && \
|
||||
[ "$(getprop service.bootanim.exit)" = 1 ] && \
|
||||
[ "$(getprop init.svc.bootanim)" = stopped ]; do
|
||||
sleep 5
|
||||
done
|
||||
|
||||
# Monitor writes to $BRIGHTNESS_FILE and call $BRIGHTNESS_SCRIPT.
|
||||
|
||||
while true; do
|
||||
/system/bin/sh "$BRIGHTNESS_SCRIPT"
|
||||
sleep 2
|
||||
done
|
||||
|
||||
exit 0
|
||||
Reference in new issue
Block a user