Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .Jules/finisher.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Jules Finisher Learning Journal

Use this file to document critical learnings, recurring bugs, or architectural constraints for future agents.

Format:
YYYY-MM-DD - [Title]
Learning: ...
Action: ...
13 changes: 9 additions & 4 deletions Magisk Template/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ else
fi

ui_print " - Android Version Check..."
if [ $(getprop ro.system.build.version.sdk) -lt 31 ]; then
ui_print "! Unsupported Android version detected, please upgrade."
API=$(getprop ro.system.build.version.sdk)
: ${API:=0}
if [ "$API" -lt 31 ]; then
ui_print "! Unsupported Android version detected ($API), please upgrade."
abort
else
ui_print " - Success 🌍"
Expand Down Expand Up @@ -94,8 +96,11 @@ ui_print " - Please wait..."
gpu_cache_cleaner() {
if [ $# -gt 0 ]; then
# Remove shader cache directories and GPU cache files
find "$@" \( -type d -name '*shader_cache*' -prune -exec rm -rf {} \; \) -o \
\( -type f \( -name '*shader*' -o -name '*gpu_cache*' \) -exec rm -f {} \; \) 2>/dev/null || true
find "$@" \( \
-type d \( -name '*shader_cache*' -o -name '*gpu_cache*' \) -prune -exec rm -rf {} + \
\) -o \( \
-type f \( -name '*shader*' -o -name '*gpu_cache*' \) -exec rm -f {} + \
\) 2>/dev/null || true

for path in "$@"; do
if [ -d "$path" ]; then
Expand Down
4 changes: 2 additions & 2 deletions Magisk Template/module.prop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id=gpu_driver_free
name=Adreno Gpu Driver
version=v1.0.3
versionCode=103
version=v1.0.4
versionCode=104
author=tryigitx
description=Open-Source Adreno {Version} Driver | Dump By {@urname}
86 changes: 86 additions & 0 deletions tests/verify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/bin/bash

# Cleanup trap
cleanup() {
rm -rf "$MODPATH" "$MOCK_DATA"
}
trap cleanup EXIT

# Mock Magisk environment variables
export MODPATH="./mock_modpath"
mkdir -p "$MODPATH"
cp -r "Magisk Template"/* "$MODPATH/"

# Mock Android filesystem for cache cleaner test
MOCK_DATA="./mock_data"
rm -rf "$MOCK_DATA"
mkdir -p "$MOCK_DATA/user/0/com.example.app/cache/shader_cache"
mkdir -p "$MOCK_DATA/user/0/com.example.app/cache/gpu_cache"
touch "$MOCK_DATA/user/0/com.example.app/cache/shader_cache/some_file"
touch "$MOCK_DATA/user/0/com.example.app/cache/gpu_cache/some_file_named_gpu_cache"
mkdir -p "$MOCK_DATA/data/com.another.app/code_cache"

# Mock functions
ui_print() {
echo "[UI_PRINT] $@"
}

abort() {
echo "[ABORT] Script aborted!"
exit 1
}

set_perm_recursive() {
echo "[SET_PERM] $@"
}

getprop() {
case "$1" in
ro.soc.model) echo "SM8450" ;;
ro.build.host) echo "xiaomi.eu" ;;
pm.dexopt.first-use) echo "false" ;;
ro.system.build.version.sdk) echo "33" ;; # Android 13
*) echo "" ;;
esac
}

# Export functions so they are available in subshells if needed (not really needed for source)
export -f ui_print abort set_perm_recursive getprop

# Run the script
echo "Running customize.sh..."
# We source it because that's how Magisk runs it usually, but here we can just execute it if we handle the sourcing
# The script is designed to be sourced by update-binary usually, but standalone execution is fine for testing logic if we provide the environment.
# However, `customize.sh` uses `find` on paths passed to `gpu_cache_cleaner`.
# We need to modify the call to `gpu_cache_cleaner` in the script or mock the paths it uses.
# The script calls: `gpu_cache_cleaner "/data/data" "/data/user_de" "/data/user"`
# We can't easily change the arguments in the sourced script without editing it.
# So we will create a wrapper or use `sed` to replace the paths with our mock paths for testing.

# Replace paths in customize.sh for testing
sed -i "s|/data/data|\"$MOCK_DATA/data\"|g" "$MODPATH/customize.sh"
sed -i "s|/data/user_de|\"$MOCK_DATA/user_de\"|g" "$MODPATH/customize.sh"
sed -i "s|/data/user|\"$MOCK_DATA/user\"|g" "$MODPATH/customize.sh"

# Source the script
. "$MODPATH/customize.sh"

# Verify deletions
RET=0
if [ -d "$MOCK_DATA/user/0/com.example.app/cache/shader_cache" ]; then
echo "FAIL: shader_cache directory was not removed"
RET=1
else
echo "PASS: shader_cache directory removed"
fi

if [ -d "$MOCK_DATA/user/0/com.example.app/cache/gpu_cache" ]; then
echo "FAIL: gpu_cache directory was not removed"
RET=1
else
echo "PASS: gpu_cache directory removed"
fi

exit $RET

# Clean up handled by trap or earlier