wifi-init.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. export PATH=$PATH:/usr/local/bin
  3. #/usr/libexec/wifiFirmwareLoader -f | tail -1 | cut -d" " -f6
  4. launchctl unload /System/Library/LaunchDaemons/com.apple.wifid.plist
  5. launchctl unload /System/Library/LaunchDaemons/com.apple.BTServer.plist
  6. launchctl remove com.apple.SwitchBoard
  7. #launchctl unload /System/Library/LaunchDaemons/com.apple.CommCenter.plist
  8. wl ver
  9. /usr/libexec/wifiFirmwareLoader -f
  10. a=$(/usr/sbin/ioreg -w0 -l -rd1 -n AppleBCMWLANCore | grep ModuleDictionary | awk '{print $4}' | cut -d'=' -f2 | sed 's/\./\\./g')
  11. echo $a
  12. vendor=$(/usr/sbin/ioreg -w0 -l -rd1 -n AppleBCMWLANCore | grep ModuleDictionary | awk '{print $5}' | cut -d"\"" -f1)
  13. echo $vendor
  14. cat /AppleInternal/Diags/WiFiFirmware/J34/WifiFirmware.prm | grep $a | grep $vendor
  15. b=$(cat /AppleInternal/Diags/WiFiFirmware/J34/WifiFirmware.prm | grep "^$a" | grep "$vendor" | awk '{print $4}')
  16. echo $b
  17. c=$(cat /AppleInternal/Diags/WiFiFirmware/J34/WifiFirmware.prm | grep "^$a" | grep "$vendor" | awk '{print $5}')
  18. echo $c
  19. ~/CoEx/nvrm_mod.sh J34 $c
  20. /usr/libexec/wifiFirmwareLoader -N /AppleInternal/Diags/WiFiFirmware/J34/$c -F /AppleInternal/Diags/WiFiFirmware/J34/$b "mfg"
  21. sleep 1
  22. wl ver; wl revinfo;
  23. wl down; wl cur_etheraddr 00:00:00:C0:FF:EE; wl country ALL; wl mpc 0;
  24. wl mimo_preamble 0; wl mimo_bw_cap 1;
  25. wl stbc_tx 0; wl stbc_rx 0; wl up; wl isup;
  26. echo "init done"
  27. powerctrl Factor1=1
  28. /sbin/mount -uw /
  29. mkdir /etc/bluetool
  30. cp ~/CoEx/runme/*.txt /etc/bluetool