Skip to content

Commit

Permalink
Extreme GT v3.0.7 (Unofficial)
Browse files Browse the repository at this point in the history
Fixes:
- Removed temperature limit bypass for charging.
- Fixed camera FPS to 60fps.
- Refactored and cleaned up code.
- Based on v3.0.5.
  • Loading branch information
AmirulAndalib committed Oct 1, 2024
1 parent a176aa0 commit 0fc415d
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 105 deletions.
Empty file added .gitignore
Empty file.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"files.eol": "\n",
"cSpell.words": [
"Magisk",
"Realme"
],
}
78 changes: 46 additions & 32 deletions customize.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
if [[ $(getprop sys.extreme_gt.uninstall) == 1 ]];then
echo '@string:dialog_addin_by_magisk' 1>&2
return
fi
#!/bin/sh
# Revert from 3.0.5 (3.0.7 installs the module from the Scene7 app directly, so it is not needed when flashing this module manually)
# Scene 7 v3.7.0 modified by andalib

set_perm_recursive $MODPATH 0 0 0755 0644

PAGE_WORK_DIR=$MODPATH
module=$MODPATH

setprop persist.sys.oplus.wifi.sla.game_high_temperature 50 # Set Wi-Fi modem high temperature limit to 50°C
setprop persist.sys.environment.temp 16
setprop ro.oplus.radio.hide_nr_switch 0
setprop debug.hwui.renderer skiavk
# setprop persist.sys.horae.enable 0
# setprop persist.oplus.display.vrr 0

# module='extreme_gt'
module='/data/adb/modules/extreme_gt'
# module='/data/adb/modules/extreme_gt' # Revert from 3.0.5 (3.0.7 installs the module from the Scene7 app directly, so it is not needed when flashing this module manually)

mkdir -p $module
cat $PAGE_WORK_DIR/extreme_gt/module.prop > $module/module.prop
cat $PAGE_WORK_DIR/extreme_gt/post-fs-data.sh > $module/post-fs-data.sh
Expand Down Expand Up @@ -250,9 +262,9 @@ do
*'"battery.temperate.range":'*)
echo '"battery.temperate.range": "[100,500]",' >> $module$file
;;
*'"high.capacity.battery.temperate.range":'*)
echo '"high.capacity.battery.temperate.range": "[100,500]",' >> $module$file
;;
# *'"high.capacity.battery.temperate.range":'*)
# echo '"high.capacity.battery.temperate.range": "[100,500]",' >> $module$file
# ;;
*'"high.capacity.threshold":'*)
echo '"high.capacity.threshold": 85' >> $module$file
;;
Expand All @@ -264,29 +276,30 @@ do
done


# Disabled thermal customizations to prevent charging overheating (not needed unless you are an ultra-fast charging freak!!)
# charging_thermal_config_default.txt charging_hyper_mode_config.txt
for file in $(find $dirs -name "charging_*txt")
do
mkdir -p $(dirname $module$file)
echo -n '' > $module$file
while read line; do
case "$line" in
*:=*)
echo "$line" >> $module$file
;;
*,*,*)
temp=$(echo "$line" | awk -F, '{print $1}')
current=$(echo "$line" | awk -F, '{print $2}')
t=$(echo "$line" | awk -F, '{print $3}')
temp=$((temp+50)) # + 5°C
echo "$temp,$current,$t" >> $module$file
;;
*)
echo "$line" >> $module$file
;;
esac
done < $file
done
#for file in $(find $dirs -name "charging_*txt")
#do
# mkdir -p $(dirname $module$file)
# echo -n '' > $module$file
# while read line; do
# case "$line" in
# *:=*)
# echo "$line" >> $module$file
# ;;
# *,*,*)
# temp=$(echo "$line" | awk -F, '{print $1}')
# current=$(echo "$line" | awk -F, '{print $2}')
# t=$(echo "$line" | awk -F, '{print $3}')
# temp=$((temp+50)) # + 5°C
# echo "$temp,$current,$t" >> $module$file
# ;;
# *)
# echo "$line" >> $module$file
# ;;
# esac
# done < $file
#done

# D1100/1200
soc=$(getprop ro.board.platform)
Expand All @@ -313,7 +326,7 @@ else
cat $PAGE_WORK_DIR/extreme_gt/service.sh > $module/service.sh
fi

manufacturer=$(getprop ro.product.odm.manufacturer)
# manufacturer=$(getprop ro.product.odm.manufacturer)
soc=$(getprop ro.soc.model | tr 'a-z' 'A-Z')


Expand Down Expand Up @@ -344,4 +357,5 @@ if [[ "$KSU" == "true" ]] || [[ $(which ksud) != "" ]]; then
handle_partition 'product'
fi

echo '@string:dialog_addin_by_magisk' 1>&2
echo 'OK ^_*' 1>&2
# Revert from 3.0.5 (3.0.7 installs the module from the Scene7 app directly, so it is not needed when flashing this module manually)
139 changes: 70 additions & 69 deletions extreme_gt/d1x00/service.sh
Original file line number Diff line number Diff line change
@@ -1,69 +1,70 @@
lock_value() {
if [[ -f $2 ]];then
chmod 644 $2
echo $1 > $2
chmod 444 $2
fi
}

if [[ "$soc" == 'mt6891' ]] || [[ "$soc" == 'mt6893' ]] || [[ "$soc" == 'mt6889' ]]; then
disable_core_ctl() {
c0=/sys/devices/system/cpu/cpu0/core_ctl
c1=/sys/devices/system/cpu/cpu4/core_ctl
c2=/sys/devices/system/cpu/cpu7/core_ctl

lock_value 4 $c0/max_cpus
lock_value 4 $c0/min_cpus
lock_value 0 $c0/enable

lock_value 3 $c1/max_cpus
lock_value 3 $c1/min_cpus
lock_value 0 $c1/enable

lock_value 1 $c2/max_cpus
lock_value 1 $c2/min_cpus
lock_value 0 $c2/enable

lock_value -1 /sys/kernel/fpsgo/fbt/thrm_limit_cpu
lock_value -1 /sys/kernel/fpsgo/fbt/thrm_sub_cpu
}
sched_isolation_disable() {
for i in 0 1 2 3 4 5 6 7; do
echo $i > /sys/devices/system/cpu/sched/set_sched_deisolation
done
chmod 000 /sys/devices/system/cpu/sched/set_sched_isolation
disable_core_ctl
}

for i in 3 4 5 6; do
echo $i 0 0 > /proc/gpufreq/gpufreq_limit_table
done
for i in 'hard_userlimit_cpu_freq' 'hard_userlimit_freq_limit_by_others'; do
echo 0 -1 > /proc/ppm/policy/$i
echo 1 -1 > /proc/ppm/policy/$i
chmod 444 /proc/ppm/policy/$i
# cat /proc/ppm/policy/$i
done
for i in 3 4 5 6; do
echo $i 0 0 > /proc/gpufreq/gpufreq_limit_table
done

# PPM
echo 1 > /proc/ppm/enabled
cat /proc/ppm/policy_status | grep -e '\[.*\]' | while read row
do
case "$row" in
*"PPM_POLICY_HARD_USER_LIMIT"*)
v=1
;;
*)
v=0
;;
esac
echo ${row:1:1} $v > /proc/ppm/policy_status
done
lock_value 100 /sys/kernel/fpsgo/fbt/thrm_temp_th
lock_value -1 /sys/kernel/fpsgo/fbt/thrm_limit_cpu
lock_value -1 /sys/kernel/fpsgo/fbt/thrm_sub_cpu
sched_isolation_disable
fi
#!/bin/sh
lock_value() {
if [[ -f $2 ]];then
chmod 644 $2
echo $1 > $2
chmod 444 $2
fi
}

if [[ "$soc" == 'mt6891' ]] || [[ "$soc" == 'mt6893' ]] || [[ "$soc" == 'mt6889' ]]; then
disable_core_ctl() {
c0=/sys/devices/system/cpu/cpu0/core_ctl
c1=/sys/devices/system/cpu/cpu4/core_ctl
c2=/sys/devices/system/cpu/cpu7/core_ctl

lock_value 4 $c0/max_cpus
lock_value 4 $c0/min_cpus
lock_value 0 $c0/enable

lock_value 3 $c1/max_cpus
lock_value 3 $c1/min_cpus
lock_value 0 $c1/enable

lock_value 1 $c2/max_cpus
lock_value 1 $c2/min_cpus
lock_value 0 $c2/enable

lock_value -1 /sys/kernel/fpsgo/fbt/thrm_limit_cpu
lock_value -1 /sys/kernel/fpsgo/fbt/thrm_sub_cpu
}
sched_isolation_disable() {
for i in 0 1 2 3 4 5 6 7; do
echo $i > /sys/devices/system/cpu/sched/set_sched_deisolation
done
chmod 000 /sys/devices/system/cpu/sched/set_sched_isolation
disable_core_ctl
}

for i in 3 4 5 6; do
echo $i 0 0 > /proc/gpufreq/gpufreq_limit_table
done
for i in 'hard_userlimit_cpu_freq' 'hard_userlimit_freq_limit_by_others'; do
echo 0 -1 > /proc/ppm/policy/$i
echo 1 -1 > /proc/ppm/policy/$i
chmod 444 /proc/ppm/policy/$i
# cat /proc/ppm/policy/$i
done
for i in 3 4 5 6; do
echo $i 0 0 > /proc/gpufreq/gpufreq_limit_table
done

# PPM
echo 1 > /proc/ppm/enabled
cat /proc/ppm/policy_status | grep -e '\[.*\]' | while read row
do
case "$row" in
*"PPM_POLICY_HARD_USER_LIMIT"*)
v=1
;;
*)
v=0
;;
esac
echo ${row:1:1} $v > /proc/ppm/policy_status
done
lock_value 100 /sys/kernel/fpsgo/fbt/thrm_temp_th
lock_value -1 /sys/kernel/fpsgo/fbt/thrm_limit_cpu
lock_value -1 /sys/kernel/fpsgo/fbt/thrm_sub_cpu
sched_isolation_disable
fi
4 changes: 2 additions & 2 deletions extreme_gt/module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=extreme_gt
name=Extreme GT
version=3.0.7
version=3.0.7 (fixed camera fps, base 3.0.5)
versionCode=3007
author=嘟嘟ski & SCENE
author=嘟嘟ski & SCENE (camera fps fix by amirulandalib)
description=本模块由SCENE生成,用于去除OPPO、Realme、OnePlus机型的锁帧和部分温控限制
minMagisk=17000
1 change: 1 addition & 0 deletions extreme_gt/post-fs-data.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
if [[ "$KSU" == "true" ]]; then
exit 0
fi
Expand Down
2 changes: 2 additions & 0 deletions extreme_gt/service.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# SCENE7'ExtremeGT 3.0

t=29500
Expand All @@ -12,6 +13,7 @@ do
# ;;
# rear-tof-therm
rear-tof-therm|cam-flash-therm)
# echo $(cat $tz/type) $(cat $tz/temp)
echo $t > $tz/emul_temp
;;
batt-therm|usb-therm)
Expand Down
4 changes: 2 additions & 2 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=extreme_gt
name=Extreme GT
version=3.0.7
version=3.0.7 (fixed camera fps, base 3.0.5)
versionCode=3007
author=嘟嘟ski & SCENE
author=嘟嘟ski & SCENE (camera fps fix by amirulandalib)
description=本模块由SCENE生成,用于去除OPPO、Realme、OnePlus机型的锁帧和部分温控限制
minMagisk=17000

0 comments on commit 0fc415d

Please sign in to comment.