Options -Indexes
DirectoryIndex index.php
RewriteEngine On
# The patched APK keeps the DEX string length unchanged by using extra trailing slashes.
# Apache normally collapses them; these rules also make API routing tolerant of repeated slashes.
RewriteCond %{THE_REQUEST} \s/+(.+?)//+ [NC]
RewriteRule ^ - [E=HAS_MULTI_SLASH:1]

# Protect storage and configuration from web access.
RewriteRule ^(?:storage|config\.php|lib\.php)(?:/|$) - [F,L,NC]
