Skip to content

Commit

Permalink
encore-service: Introduce priority settings blacklist
Browse files Browse the repository at this point in the history
Signed-off-by: Rem01Gaming <Rem01_Gaming@proton.me>
  • Loading branch information
Rem01Gaming committed Oct 27, 2024
1 parent 76c2ca0 commit ef339a1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
cp -r ./src/libs ./module
cp -r ./src/scripts/* ./module/system/bin
cp LICENSE ./module
cp prio_blacklist.txt ./module
bash ./gamelist_compile.sh
version="$(cat ./version)"
version_code=$(git rev-list HEAD --count)
Expand Down
3 changes: 2 additions & 1 deletion module/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ unzip -o "$ZIPFILE" "webroot/*" -d "$MODPATH" >&2
ui_print "- Encore Tweaks configuration setup"
[ ! -d /data/encore ] && mkdir /data/encore
unzip -o "$ZIPFILE" 'gamelist.txt' -d "/data/encore" >&2
unzip -o "$ZIPFILE" 'prio_blacklist.txt' -d "/data/encore" >&2
unzip -o "$ZIPFILE" 'AppMonitoringUtil.sh' -d "/data/encore" >&2
[ ! -f /data/encore/kill_logd ] && echo 0 >/data/encore/kill_logd
[ ! -f /data/encore/perf_cpu_gov ] && echo performance >/data/encore/perf_cpu_gov
Expand Down Expand Up @@ -74,7 +75,7 @@ if [ -z "$chipset" ]; then
fi

case "$chipset" in
*mt* | *MT*) soc=1 && ui_print "- Implementing tailored tweaks for Mediatek" ;;
*mt* | *MT*) soc=1 && ui_print "- Implementing tailored tweaks for MediaTek" ;;
*sm* | *qcom* | *SM* | *QCOM* | *Qualcomm*) soc=2 && ui_print "- Implementing tailored tweaks for Snapdragon" ;;
*exynos*) soc=3 && ui_print "- Implementing tailored tweaks for Exynos" ;;
*Unisoc* | *unisoc*) soc=4 && ui_print "- Implementing tailored tweak for Unisoc" ;;
Expand Down
2 changes: 2 additions & 0 deletions prio_blacklist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
com.sega.ColorfulStage.en
jp.co.craftegg.band
7 changes: 6 additions & 1 deletion src/jni/encore-service.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,12 @@ int main(void) {
snprintf(command, sizeof(command), "pidof %s", trim_newline(gamestart));
pid = execute_command(command);
if (pid != NULL) {
setPriorities(trim_newline(pid));
snprintf(command, sizeof(command), "grep -s %s /data/encore/blacklist_prio.txt", trim_newline(gamestart));
if (system(command) != 0) {
setPriorities(trim_newline(pid));
} else {
printf("notice: skipping %s from priority settings", trim_newline(gamestart));
}
} else {
printf("error: Game PID is null!\n");
log_error("Game PID is null!");
Expand Down

0 comments on commit ef339a1

Please sign in to comment.