#!/system/bin/sh
MODULE_DIR="/data/adb/modules/RaiRin-AI"
RAIRIN="$MODULE_DIR/engine"
TMP_ICON="/data/local/tmp/rairin.webp"
TMP_ICON2="/data/local/tmp/spicy.webp"
TMP="/data/local/tmp/RaiRin-AI"
CORTEX_DIR="$MODULE_DIR/cortex"
ENGINE_DIR="$MODULE_DIR/engine"
mkdir -p "$TMP"
mv /data/adb/modules/RaiRin-AI/kernel_panic.sh /data/local/tmp/RaiRin-AI
find "$CORTEX_DIR" -type f ! -name "*.txt" -exec chmod 0755 {} \;
find "$ENGINE_DIR" -type f ! -name "*.txt" -exec chmod 0755 {} \;
chmod +x "$TMP/kernel_panic.sh"
if [ -f "$MODULE_DIR/rairin.webp" ]; then
    cp -f "$MODULE_DIR/rairin.webp" "$TMP_ICON"
    chmod 644 "$TMP_ICON"
fi
if [ -f "$MODULE_DIR/spicy.webp" ]; then
    cp -f "$MODULE_DIR/spicy.webp" "$TMP_ICON2"
    chmod 644 "$TMP_ICON2"
fi