before editing 900i and 1000i to work on 120hz capped sony crt

This commit is contained in:
lucca
2026-09-07 20:02:27 -04:00
parent 65797379cc
commit cb576da8b5
18 changed files with 1114 additions and 1 deletions
+123
View File
@@ -0,0 +1,123 @@
#!/bin/sh
# Aggressive standalone local-only hotspot
# Tries to fully release Android's control of the radio
IFACE="wlan1"
SSID="vegeta black"
PSK="supermarioinreallife"
CHANNEL="6"
AP_IP="192.168.43.1"
NET="192.168.43.0/24"
DHCP_RANGE="192.168.43.10,192.168.43.50,12h"
[ "$(id -u)" -ne 0 ] && { echo "Need root"; exit 1; }
echo "[*] Aggressively stopping Android Wi-Fi stack..."
# Stop as many Android Wi-Fi related services as possible
svc wifi disable 2>/dev/null
stop wpa_supplicant 2>/dev/null
stop wifi 2>/dev/null
killall wpa_supplicant hostapd dnsmasq wificond 2>/dev/null
sleep 2
# Extra force
setprop ctl.stop wpa_supplicant 2>/dev/null
setprop ctl.stop wifi 2>/dev/null
sleep 1
echo "[*] Fully resetting $IFACE..."
ip link set "$IFACE" down 2>/dev/null
ip addr flush dev "$IFACE" 2>/dev/null
ip route flush dev "$IFACE" 2>/dev/null
# Delete and recreate the interface if possible
iw dev "$IFACE" del 2>/dev/null
sleep 1
# Try to create a clean AP interface
iw phy phy0 interface add "$IFACE" type __ap 2>/dev/null || \
iw phy phy0 interface add "$IFACE" type ap 2>/dev/null
sleep 1
ip link set "$IFACE" up 2>/dev/null
sleep 1
# Disable reverse path filter
echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
echo 0 > /proc/sys/net/ipv4/conf/"$IFACE"/rp_filter 2>/dev/null
# hostapd config
cat > /tmp/hostapd-$IFACE.conf <<EOF
interface=$IFACE
driver=nl80211
ssid=$SSID
hw_mode=g
channel=$CHANNEL
ieee80211n=1
wmm_enabled=1
auth_algs=1
wpa=2
wpa_passphrase=$PSK
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
ignore_broadcast_ssid=0
EOF
echo "[*] Starting hostapd..."
hostapd -B /tmp/hostapd-$IFACE.conf
if [ $? -ne 0 ]; then
echo
echo "Still failed. Trying one last method..."
# Last resort: bring interface down/up again
ip link set "$IFACE" down
sleep 2
iw dev "$IFACE" set type __ap 2>/dev/null
ip link set "$IFACE" up
sleep 2
hostapd -B /tmp/hostapd-$IFACE.conf || {
echo
echo "Standalone hostapd is not working reliably on this device."
echo "The internal Wi-Fi firmware is still holding management frames."
exit 1
}
fi
sleep 1
# Configure IP
ip addr add $AP_IP/24 broadcast 192.168.43.255 dev $IFACE
ip link set $IFACE up
ip route add $NET dev $IFACE src $AP_IP 2>/dev/null
# Firewall
iptables -I INPUT -i $IFACE -j ACCEPT
iptables -I OUTPUT -o $IFACE -j ACCEPT
iptables -I FORWARD -i $IFACE -j ACCEPT
iptables -I FORWARD -o $IFACE -j ACCEPT
# DHCP
echo "[*] Starting dnsmasq..."
dnsmasq \
--interface=$IFACE \
--bind-interfaces \
--dhcp-range=$DHCP_RANGE \
--dhcp-option=3,$AP_IP \
--dhcp-option=6,$AP_IP \
--port=0 \
--no-resolv \
--pid-file=/tmp/dnsmasq-$IFACE.pid &
sleep 2
echo
echo "=== Standalone Hotspot ==="
echo "SSID : $SSID"
echo "Password : $PSK"
echo "Gateway : $AP_IP"
echo
iw dev $IFACE info 2>/dev/null | head -12
echo
ip -4 addr show $IFACE