-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more improvements, fixes and changes.
- Loading branch information
Showing
10 changed files
with
380 additions
and
226 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,16 @@ | ||
# Volume Key Selector - Addon that allows the use of the volume keys to select option in the installer | ||
|
||
## Instructions: | ||
* Use $VKSEL variable whenever you want to call the volume key selection function. The function returns true if user selected vol up and false if vol down | ||
Ex: if $VKSEL; then | ||
echo "true" | ||
else | ||
echo "false" | ||
fi | ||
* If you want to use the bixby button on samsung galaxy devices, [check out this post here](https://forum.xda-developers.com/showpost.php?p=77908805&postcount=16) and modify the install.sh functions accordingly | ||
|
||
## Notes: | ||
* Each volume key selector method will timeout after 3 seconds in the event of incompatibility or error | ||
|
||
## Included Binaries/Credits: | ||
* [keycheck binary](https://github.com/sonyxperiadev/device-sony-common-init/tree/master/keycheck) compiled by me [here](https://github.com/Zackptg5/Keycheck) |
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,75 @@ | ||
# External Tools | ||
|
||
chmod -R 0755 $MODPATH/common/addon/Volume-Key-Selector/tools | ||
alias keycheck="$MODPATH/common/addon/Volume-Key-Selector/tools/$ARCH32/keycheck" | ||
|
||
keytest() { | ||
ui_print "- Vol Key Test" | ||
ui_print " Press a Vol Key:" | ||
ui_print "" | ||
if (timeout 3 /system/bin/getevent -lc 1 2>&1 | /system/bin/grep VOLUME | /system/bin/grep " DOWN" > $TMPDIR/events); then | ||
return 0 | ||
else | ||
ui_print " Try again:" | ||
timeout 3 keycheck | ||
local SEL=$? | ||
[ $SEL -eq 143 ] && abort " Vol key not detected!" || return 1 | ||
fi | ||
} | ||
|
||
chooseport() { | ||
# Original idea by chainfire @xda-developers, improved on by ianmacd @xda-developers | ||
#note from chainfire @xda-developers: getevent behaves weird when piped, and busybox grep likes that even less than toolbox/toybox grep | ||
while true; do | ||
/system/bin/getevent -lc 1 2>&1 | /system/bin/grep VOLUME | /system/bin/grep " DOWN" > $TMPDIR/events | ||
if (`cat $TMPDIR/events 2>/dev/null | /system/bin/grep VOLUME >/dev/null`); then | ||
break | ||
fi | ||
done | ||
if (`cat $TMPDIR/events 2>/dev/null | /system/bin/grep VOLUMEUP >/dev/null`); then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
} | ||
|
||
chooseportold() { | ||
# Keycheck binary by someone755 @Github, idea for code below by Zappo @xda-developers | ||
# Calling it first time detects previous input. Calling it second time will do what we want | ||
while true; do | ||
keycheck | ||
keycheck | ||
local SEL=$? | ||
if [ "$1" == "UP" ]; then | ||
UP=$SEL | ||
break | ||
elif [ "$1" == "DOWN" ]; then | ||
DOWN=$SEL | ||
break | ||
elif [ $SEL -eq $UP ]; then | ||
return 0 | ||
elif [ $SEL -eq $DOWN ]; then | ||
return 1 | ||
fi | ||
done | ||
} | ||
|
||
# Have user option to skip vol keys | ||
OIFS=$IFS; IFS=\|; MID=false; NEW=false | ||
case $(echo $(basename $ZIPFILE) | tr '[:upper:]' '[:lower:]') in | ||
*novk*) ui_print "- Skipping Vol Keys -";; | ||
*) if keytest; then | ||
VKSEL=chooseport | ||
else | ||
VKSEL=chooseportold | ||
ui_print " ! Legacy device detected! Using old keycheck method" | ||
ui_print " " | ||
ui_print "- Vol Key Programming -" | ||
ui_print " Press Vol Up Again:" | ||
$VKSEL "UP" | ||
ui_print " Press Vol Down" | ||
ui_print "" | ||
$VKSEL "DOWN" | ||
fi;; | ||
esac | ||
IFS=$OIFS |
Binary file not shown.
Binary file not shown.
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
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,123 @@ | ||
sleep 1 | ||
ui_print "" | ||
ui_print "-------------------------------------------------------------------------------------------------------------------------------------------------" | ||
ui_print " King Unlocker " | ||
ui_print "-------------------------------------------------------------------------------------------------------------------------------------------------" | ||
ui_print "" | ||
ui_print " [!] Attention: This may cause problems with mi camera and other system apps " | ||
ui_print " And also will not work if you're using magiskhideprops or other like module. " | ||
sleep 1 | ||
ui_print "" | ||
ui_print " Volume + = Switch number " | ||
ui_print " Volume - = Select " | ||
sleep 1 | ||
ui_print "" | ||
ui_print " 1- Apply PUBGM 90 FPS Settings. " | ||
ui_print "" | ||
sleep 0.5 | ||
ui_print " 2- Apply CODM 120 FPS Settings. " | ||
ui_print "" | ||
sleep 0.5 | ||
ui_print " 3- Apply Black Desert Mobile Max Settings. " | ||
ui_print "" | ||
sleep 0.5 | ||
ui_print " 4- None. " | ||
ui_print "" | ||
sleep 0.5 | ||
ui_print "[*] Select which you wanna: " | ||
ui_print "" | ||
FU=1 | ||
while true; do | ||
ui_print " $FU" | ||
if $VKSEL; then | ||
FU=$((FU + 1)) | ||
else | ||
break | ||
fi | ||
if [ $FU -gt 4 ]; then | ||
FU=1 | ||
fi | ||
done | ||
|
||
case $FU in | ||
1 ) FCTEXTAD1="PUBGM 90 FPS";; | ||
2 ) FCTEXTAD1="CODM 120 FPS";; | ||
3 ) FCTEXTAD1="Black Desert Mobile Max Settings";; | ||
4 ) FCTEXTAD1="None";; | ||
esac | ||
|
||
ui_print "" | ||
ui_print "[*] Selected: $FCTEXTAD1 " | ||
ui_print "" | ||
|
||
if [[ "$FCTEXTAD1" == "PUBGM 90 FPS" ]] | ||
then | ||
sed -i '/ro.product.model=/s/.*/ro.product.model=IN2025/' $MODPATH/system.prop | ||
|
||
elif [[ "$FCTEXTAD1" == "CODM 120 FPS" ]] | ||
then | ||
sed -i '/ro.product.model=/s/.*/ro.product.model=SO-52A/' $MODPATH/system.prop | ||
|
||
elif [[ "$FCTEXTAD1" == "Black Desert Mobile Max Settings" ]] | ||
then | ||
sed -i '/ro.product.model=/s/.*/ro.product.model=SM-G975U/' $MODPATH/system.prop | ||
|
||
elif [[ "$FCTEXTAD1" == "None" ]] | ||
then | ||
busybox rm $MODPATH/system.prop | ||
fi | ||
|
||
ui_print "[*] Done!" | ||
|
||
ui_print "-------------------------------------------------------------------------------------------------------------------------------------------------" | ||
ui_print " DRM L1 Widevine Patch " | ||
ui_print "-------------------------------------------------------------------------------------------------------------------------------------------------" | ||
ui_print "" | ||
ui_print " [!] Attention: Don't apply if your rom already have DRM L1 Widevine. " | ||
sleep 1 | ||
ui_print "" | ||
ui_print " Volume + = Switch number " | ||
ui_print " Volume - = Select " | ||
sleep 1 | ||
ui_print "" | ||
ui_print " 1- Apply DRM L1 Widevine Patch. " | ||
ui_print "" | ||
sleep 0.5 | ||
ui_print " 2- Don't apply DRM L1 Widevine Patch. " | ||
ui_print "" | ||
sleep 0.5 | ||
ui_print "[*] Select which you wanna: " | ||
ui_print "" | ||
DL=1 | ||
while true; do | ||
ui_print " $DL" | ||
if $VKSEL; then | ||
DL=$((DL + 1)) | ||
else | ||
break | ||
fi | ||
if [ $DL -gt 2 ]; then | ||
DL=1 | ||
fi | ||
done | ||
|
||
case $DL in | ||
1 ) FCTEXTAD2="Apply";; | ||
2 ) FCTEXTAD2="Don't apply";; | ||
esac | ||
|
||
ui_print "" | ||
ui_print "[*] Selected: $FCTEXTAD2 " | ||
ui_print "" | ||
|
||
if [[ "$FCTEXTAD2" == "Apply" ]] | ||
then | ||
mv $MODPATH/vendor $MODPATH/system | ||
|
||
elif [[ "$FCTEXTAD2" == "Don't apply" ]] | ||
then | ||
busybox rm -rf $MODPATH/vendor | ||
fi | ||
|
||
ui_print "[*] Done!" | ||
ui_print "" |
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
id=KTKSR | ||
name=King Tweaks Reborn | ||
version=1.8 | ||
versionCode=180 | ||
version=1.8.1 | ||
versionCode=181 | ||
author=pedroginkgo | ||
description=A module which have the objective of maximize user experience. |
Oops, something went wrong.