macOS 11.2.3 Big Sur 安装 ALFA 网卡驱动

手头有两张 alfa 网卡想要在 mac 下直接使用,官网驱动AWUS036ACHAWUS051NH v2最新的都只到10.14、10.15的样子,下载了几个版本的驱动发现同型号的binary差异都不大,这里尝试手动把安装包解包进行安装。

下载并查看信息

以 AWUS036ACH 为例,下载针对10.15版本的系统安装包,使用如下命令解压,并查看安装文件信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
 test@mac:~/Downloads/alfa_036ach$ pkgutil --expand ALFA\ USB\ WiFi\ Driver\ \(Build\ 0919\).pkg 036install/
test@mac:~/Downloads/alfa_036ach$ cd 036install
test@mac:~/Downloads/alfa_036ach/036install$ for bom in `find ./ -name Bom`;do echo "\n$bom\n";lsbom $bom;done

.//Uninstall.pkg/Bom

. 40755 0/0

.//RealtekUtility1014.pkg/Bom

. 40755 0/0
./Library 40755 0/0
./Library/Application Support 40755 0/80
./Library/Application Support/ALFA_RTWIFI 40755 0/80
./Library/Application Support/ALFA_RTWIFI/RtWlanHelper 100777 0/80 164912 4191442806
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Info.plist 100777 0/80 6912 230658313
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/MacOS 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/MacOS/StatusBarApp 100777 0/80 2189968 3628228103
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/MacOS/UnPref 100777 0/80 19344 3878423580
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/MacOS/wpa_supplicant 100777 0/80 3701248 1599320216
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/PkgInfo 100777 0/80 8 742937289
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/BarConnecting_0.pdf 100777 0/80 36603 1484869705
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/BarConnecting_1.pdf 100777 0/80 37352 4181603319
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/BarConnecting_2.pdf 100777 0/80 37611 4109256582
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/BarConnecting_3.pdf 100777 0/80 37995 1459662728
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/BarSignal_0.icns 100777 0/80 26462 3234730549
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/BarSignal_1.icns 100777 0/80 26210 1286484566
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/BarSignal_2.icns 100777 0/80 25792 62513264
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/BarSignal_3.icns 100777 0/80 25052 387852725
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/BarSignal_4.icns 100777 0/80 24425 1078631272
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/BarSignal_5.icns 100777 0/80 23334 3487072564
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/BarSignal_disconnect.icns 100777 0/80 26823 1316734277
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Danish.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Danish.lproj/Localizable.strings 100777 0/80 14800 3311744630
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Dutch.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Dutch.lproj/Localizable.strings 100777 0/80 15790 4268595270
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/English.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/English.lproj/InfoPlist.strings 100777 0/80 216 2032630058
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/English.lproj/Localizable.strings 100777 0/80 14532 3333036018
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/English.lproj/MainMenu.nib 100777 0/80 116130 1180232894
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/French.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/French.lproj/Localizable.strings 100777 0/80 16772 3843437997
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/German.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/German.lproj/Localizable.strings 100777 0/80 16404 3871974471
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/InvalidCertStack.png 100777 0/80 4115 405799571
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Italian.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Italian.lproj/Localizable.strings 100777 0/80 16026 896400443
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Japanese.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Japanese.lproj/Localizable.strings 100777 0/80 11934 4027295540
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Korean.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Korean.lproj/Localizable.strings 100777 0/80 11876 2624905898
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Light_green.tif 100777 0/80 842 74228462
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Light_red.tif 100777 0/80 844 665447662
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Light_yellow.tif 100777 0/80 842 1768653772
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/ModelIcon.icns 100777 0/80 51594 129970855
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Polish.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Polish.lproj/Localizable.strings 100777 0/80 15676 3136865389
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Russian.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Russian.lproj/Localizable.strings 100777 0/80 15576 2073104601
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/ScanListSignal_0.pdf 100777 0/80 20591 945318973
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/ScanListSignal_1.pdf 100777 0/80 19276 2457190938
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/ScanListSignal_2.pdf 100777 0/80 18988 307059393
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/ScanListSignal_3.pdf 100777 0/80 20320 3211105751
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/ScanListSignal_4.pdf 100777 0/80 21377 2949361981
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Spanish.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Spanish.lproj/Localizable.strings 100777 0/80 15638 2882256134
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Swedish.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Swedish.lproj/Localizable.strings 100777 0/80 14980 2069709247
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/TrashCan_b.png 100777 0/80 3891 3343055356
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Turkish.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Turkish.lproj/Localizable.strings 100777 0/80 14634 1917276981
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/USBWiFi.ico 100777 0/80 2238 3372210440
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/USBWiFi_Unplug.ico 100777 0/80 4414 219813042
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/Uninstall.command 100777 0/80 5707 547532281
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/WPShorizstring.png 100777 0/80 6193 2473263293
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/WPSstring.png 100777 0/80 3223 3739536898
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/arrow2.icns 100777 0/80 8457 2504247864
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/blank.icns 100777 0/80 12 2036916336
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/check_b.icns 100777 0/80 44963 3482095838
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/check_g.icns 100777 0/80 45808 477943401
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/error_b.icns 100777 0/80 9248 1553716514
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/error_r.icns 100777 0/80 87439 3460119953
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/fr-CA.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/fr-CA.lproj/Localizable.strings 100777 0/80 16432 2886202537
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/info_b.icns 100777 0/80 7403 1160116236
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/locked_b.icns 100777 0/80 129058 989106223
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/locked_w.icns 100777 0/80 2998 2814166388
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/locked_w.png 100777 0/80 1206 3039885116
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/pt-PT.lproj 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/Resources/pt-PT.lproj/Localizable.strings 100777 0/80 15492 1861649393
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/_CodeSignature 40777 0/80
./Library/Application Support/ALFA_RTWIFI/StatusBarApp.app/Contents/_CodeSignature/CodeResources 100777 0/80 18298 1953610339

.//MediatekSerialsInstaller.pkg/Bom

. 40755 0/0

.//RealtekSerialsInstaller.pkg/Bom

. 40755 0/0

.//Realtek_Uninstall.pkg/Bom

. 40755 0/0

.//Realtek109110Driver.pkg/Bom

. 40755 0/0
./Library 40755 0/0
./Library/Extensions 40755 0/0
./Library/Extensions/RtWlanDisk.kext 40755 0/0
./Library/Extensions/RtWlanDisk.kext/Contents 40755 0/0
./Library/Extensions/RtWlanDisk.kext/Contents/Info.plist 100644 0/0 2919 2283574063
./Library/Extensions/RtWlanDisk.kext/Contents/MacOS 40755 0/0
./Library/Extensions/RtWlanDisk.kext/Contents/MacOS/RtWlanDisk 100755 0/0 59536 2524314782
./Library/Extensions/RtWlanDisk.kext/Contents/_CodeSignature 40755 0/0
./Library/Extensions/RtWlanDisk.kext/Contents/_CodeSignature/CodeResources 100644 0/0 2004 655202299
./Library/Extensions/RtWlanU.kext 40755 0/0
./Library/Extensions/RtWlanU.kext/Contents 40755 0/0
./Library/Extensions/RtWlanU.kext/Contents/Info.plist 100644 0/0 77753 2727324424
./Library/Extensions/RtWlanU.kext/Contents/MacOS 40755 0/0
./Library/Extensions/RtWlanU.kext/Contents/MacOS/RtWlanU 100755 0/0 14733120 1913417689
./Library/Extensions/RtWlanU.kext/Contents/_CodeSignature 40755 0/0
./Library/Extensions/RtWlanU.kext/Contents/_CodeSignature/CodeResources 100644 0/0 2004 655202299
./Library/Extensions/RtWlanU1827.kext 40755 0/0
./Library/Extensions/RtWlanU1827.kext/Contents 40755 0/0
./Library/Extensions/RtWlanU1827.kext/Contents/Info.plist 100644 0/0 45890 1963117974
./Library/Extensions/RtWlanU1827.kext/Contents/MacOS 40755 0/0
./Library/Extensions/RtWlanU1827.kext/Contents/MacOS/RtWlanU1827 100755 0/0 4521104 3396109984
./Library/Extensions/RtWlanU1827.kext/Contents/_CodeSignature 40755 0/0
./Library/Extensions/RtWlanU1827.kext/Contents/_CodeSignature/CodeResources 100644 0/0 2004 655202299

可以看到只有 RealtekUtility1014.pkg 和 Realtek109110Driver.pkg 两个包里面有东西,第一个是工具程序,第二个是驱动。

进入驱动目录,查看PackageInfo内容:

1
2
3
4
5
6
7
8
9
10
11
12
<pkg-info format-version="2" identifier="com.alfa-network-inc.Realtek109Driver" version="10.9" relocatable="false" overwrite-permissions="false" followSymLinks="false" install-location="/" auth="root" postinstall-action="restart">
<payload installKBytes="18992" numberOfFiles="24"/>
<scripts>
<preinstall file="./preinstall"/>
<postinstall file="./postinstall"/>
</scripts>
<bundle-version>
<bundle path="./Library/Extensions/RtWlanDisk.kext" CFBundleShortVersionString="1830.20.b31" CFBundleVersion="1830.20.b31" id="com.realtek.driver.RtWlanDisk" CFBundleIdentifier="com.realtek.driver.RtWlanDisk"/>
<bundle path="./Library/Extensions/RtWlanU1827.kext" CFBundleShortVersionString="1827.4.b32" CFBundleVersion="1827.4.b32" id="com.realtek.driver.RtWlanU1827" CFBundleIdentifier="com.realtek.driver.RtWlanU1827"/>
<bundle path="./Library/Extensions/RtWlanU.kext" CFBundleShortVersionString="1830.20.b31" CFBundleVersion="1830.20.b31" id="com.realtek.driver.RtWlanU" CFBundleIdentifier="com.realtek.driver.RtWlanU"/>
</bundle-version>
</pkg-info>

解压驱动包

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
test@mac:~/Downloads/alfa_036ach/036install/Realtek109110Driver.pkg$ mkdir payload.dir ; cd payload.dir
test@mac:~/Downloads/alfa_036ach/036install/Realtek109110Driver.pkg/payload.dir$ tar -xvf ../Payload ; cd ..
x .
x ./Library
x ./Library/Extensions
x ./Library/Extensions/RtWlanDisk.kext
x ./Library/Extensions/RtWlanDisk.kext/Contents
x ./Library/Extensions/RtWlanDisk.kext/Contents/_CodeSignature
x ./Library/Extensions/RtWlanDisk.kext/Contents/_CodeSignature/CodeResources
x ./Library/Extensions/RtWlanDisk.kext/Contents/MacOS
x ./Library/Extensions/RtWlanDisk.kext/Contents/MacOS/RtWlanDisk
x ./Library/Extensions/RtWlanDisk.kext/Contents/Info.plist
x ./Library/Extensions/RtWlanU1827.kext
x ./Library/Extensions/RtWlanU1827.kext/Contents
x ./Library/Extensions/RtWlanU1827.kext/Contents/_CodeSignature
x ./Library/Extensions/RtWlanU1827.kext/Contents/_CodeSignature/CodeResources
x ./Library/Extensions/RtWlanU1827.kext/Contents/MacOS
x ./Library/Extensions/RtWlanU1827.kext/Contents/MacOS/RtWlanU1827
x ./Library/Extensions/RtWlanU1827.kext/Contents/Info.plist
x ./Library/Extensions/RtWlanU.kext
x ./Library/Extensions/RtWlanU.kext/Contents
x ./Library/Extensions/RtWlanU.kext/Contents/_CodeSignature
x ./Library/Extensions/RtWlanU.kext/Contents/_CodeSignature/CodeResources
x ./Library/Extensions/RtWlanU.kext/Contents/MacOS
x ./Library/Extensions/RtWlanU.kext/Contents/MacOS/RtWlanU
x ./Library/Extensions/RtWlanU.kext/Contents/Info.plist

安装

参考 Scripts 下的 preinstall 和 postinstall,修改脚本中的相对路径,执行相关命令安装。

preinstall :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/sh
. /etc/rc.common

echo " "
echo "PreInstall_Driver.command"
FROM=`dirname "$0"`

echo "Unload Driver"
sudo kextunload /System/Library/Extensions/RtWlanU1827.kext
sudo kextunload /System/Library/Extensions/RtWlanU.kext
sudo kextunload /System/Library/Extensions/RtWlanDisk.kext


echo "Removing Driver..."
sudo rm -rf /System/Library/Extensions/RtWlanU1827.kext
sudo rm -rf /System/Library/Extensions/RtWlanU.kext
sudo rm -rf /System/Library/Extensions/RtWlanU_192.kext
sudo rm -rf /System/Library/Extensions/RtWlanDisk.kext
sudo rm -rf /System/Library/Extensions/RTL8192SU*.kext
sudo rm -rf /System/Library/Extensions/RTL8192CU*.kext
sudo rm -rf /System/Library/Extensions/RTL8188EU*.kext
sudo rm -rf /System/Library/Extensions/RTL8192EU*.kext
sudo rm -rf /System/Library/Extensions/RTL8192DU*.kext
sudo rm -rf /System/Library/Extensions/RtWlanU*.kext
sudo rm -rf /System/Library/Extensions/RTL8812AU*.kext
sudo rm -rf /Library/Extensions/RTL8812AU*.kext

echo "Removing Pkg"
sudo rm -rf /Library/Receipts/wlan.pkg
sudo rm -rf /Library/Receipts/wlanAc.pkg
sudo rm -rf /Library/Receipts/rtl8192SU4.pkg
sudo rm -rf /Library/Receipts/rtl8192CU4.pkg
sudo rm -rf /Library/Receipts/rtl8188EU4.pkg
sudo rm -rf /Library/Receipts/rtl8192EU4.pkg
sudo rm -rf /Library/Receipts/rtl8192DU4.pkg
sudo rm -rf /Library/Receipts/rtl8812AU4.pkg
sudo rm -rf /Library/Receipts/wireless-acNetworkUtility.pkg
sudo rm -rf /Library/Receipts/wirelessNetworkUtility.pkg



echo "Checking Preferences"

_PREFERENCE="/Library/Preferences/SystemConfiguration/preferences.plist"
_NETWORKINTERFACES="/Library/Preferences/SystemConfiguration/NetworkInterfaces.plist"

# Phase 1: Get CurrentSet UUID
autoUuid=`/usr/libexec/Plistbuddy -c "Print :Sets" $_PREFERENCE | grep -B1 -m1 Automatic | grep Dict | awk '{ print $1 }'`
echo autoUuid =$autoUuid

# Phase 2: Get All Services Array
NetServicesArray=`/usr/libexec/PlistBuddy -c "Print :NetworkServices" $_PREFERENCE | egrep '[0-9A-F]{8}-([0-9A-F]{4}-){3}[0-9A-F]{12}' -o`
echo NetServicesArray =$NetServicesArray

for eNetService in $NetServicesArray
do
echo eNetService =$eNetService
eIntf=`/usr/libexec/Plistbuddy -c "Print :NetworkServices:$eNetService" $_PREFERENCE | grep -a "DeviceName" | awk '{ print $3 }'`
echo eIntf =$eIntf
bHit=`/usr/libexec/Plistbuddy -c "Print :Interfaces" $_NETWORKINTERFACES | grep -a -A7 'RtWlanU\|RTL8812AU\|RTL8192CU\|RTL8188EU\|RTL8192EU' | grep -a "BSD Name"| awk '{ print $4 }'| grep -aw $eIntf`

# -z: string is null, that is, has zero length
# -n: string is not null
if [ -n "${bHit}" ]; then
echo bHit =$bHit

# Phase 3: Check interface down : Sets:$autoUuid:Network:Service:UUID
bIfconfigDown=`/usr/libexec/Plistbuddy -c "Print :Sets:$autoUuid:Network:Service:$eNetService" $_PREFERENCE`

if [ -z "${bIfconfigDown}" ]; then
echo bIfconfigDown=$bIfconfigDown

# Phase 4: Remove NetworksServices:UUID
sudo /usr/libexec/PlistBuddy -c "delete :NetworkServices:$eNetService dict" $_PREFERENCE
fi
fi
done


version=$( /usr/bin/sw_vers -productVersion )
major=$( awk -F'.' '{print $1}' <<< "${version}" )
minor=$( awk -F'.' '{print $2}' <<< "${version}" )
patch=$( awk -F'.' '{print $3}' <<< "${version}" )

if [ "$major" -eq 10 ]; then
echo major =$major

if [ "$minor" -ge 11 ]; then
#echo 10.11~ =$minor
sudo touch /System/Library/Extensions
fi

#if [ "$minor" -ge 13 ]; then
#echo 10.13~ =$minor
#sudo spctl --master -disable
#fi
fi


echo "PreInstall_Driver Complete."%

postinstall :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
. /etc/rc.common

echo "PostInstall_Driver.command"

version=$( /usr/bin/sw_vers -productVersion )
major=$( awk -F'.' '{print $1}' <<< "${version}" )
minor=$( awk -F'.' '{print $2}' <<< "${version}" )
patch=$( awk -F'.' '{print $3}' <<< "${version}" )

sudo chmod -R 755 /System/Library/Extensions/RtWlanU.kext
sudo chmod -R 755 /System/Library/Extensions/RtWlanU1827.kext
sudo chmod -R 755 /System/Library/Extensions/RtWlanDisk.kext

sleep 1

sudo chown -R root:wheel /System/Library/Extensions/RtWlanU.kext
sudo chown -R root:wheel /System/Library/Extensions/RtWlanU1827.kext
sudo chown -R root:wheel /System/Library/Extensions/RtWlanDisk.kext


sudo chmod 644 /System/Library/Extensions/RtWlanU.kext/Contents/Info.plist
sudo chmod 644 /System/Library/Extensions/RtWlanU1827.kext/Contents/Info.plist
sudo chmod 644 /System/Library/Extensions/RtWlanDisk.kext/Contents/Info.plist

if [ "$minor" -ge 9 ]; then
#echo 10.9~ =$minor

sudo chmod 644 /System/Library/Extensions/RtWlanU.kext/Contents/_CodeSignature/CodeResources
sudo chmod 644 /System/Library/Extensions/RtWlanU1827.kext/Contents/_CodeSignature/CodeResources
sudo chmod 644 /System/Library/Extensions/RtWlanDisk.kext/Contents/_CodeSignature/CodeResources

elif [ "$minor" -ge 6 ] && [ "$minor" -le 8 ]; then
sudo chmod 644 /System/Library/Extensions/RtWlanU.kext/Contents/MacOS/RtWlanU
sudo chmod 644 /System/Library/Extensions/RtWlanU1827.kext/Contents/MacOS/RtWlanU1827
sudo chmod 644 /System/Library/Extensions/RtWlanDisk.kext/Contents/MacOS/RtWlanDisk

fi


if [ "$minor" -eq 6 ]; then
sudo kextcache -v 1 -a i386 -a x86_64 -m /System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mkext /System/Library/Extensions

elif [ "$minor" -ge 7 ] && [ "$minor" -le 10 ]; then

sudo kextcache -system-prelinked-kernel
sudo kextcache -system-caches

fi


sudo touch /System/Library/Extensions

sudo kextload /System/Library/Extensions/RtWlanDisk.kext
sudo kextload /System/Library/Extensions/RtWlanU.kext
sudo kextload /System/Library/Extensions/RtWlanU1827.kext

echo "PostInstall_Driver Complete."

解压工具程序包

切换到 RealtekUtility1014.pkg 目录,同理对其进行安装,可以修改配置相关plist文件(如关闭自启动之类的)。

重启以后经过测试,虽然Utility程序会报一些错,但是WiFi网卡可以连接其他WiFi。

AWUS051NHv2 网卡和 AWUS036ACH 原理差不多

其他问题

  1. AWUS036ACH 网卡对于 wpa-tls 的热点无法读取 keychains 里的密钥,不知道为什么。
  2. AWUS051NHv2 网卡的驱动程序没问题,Utility 程序是32位的,新 macOS 没法用,可以通过 ifconfig en12 up 等方法把网卡启动起来,默认up后会自动连接已保存的 wpa-tls 企业热点

本文标题:macOS 11.2.3 Big Sur 安装 ALFA 网卡驱动

文章作者:

发布时间:2021年03月20日 - 13:03

最后更新:2021年03月20日 - 13:03

原始链接:https://badb100d.com/2021/03/20/2021-03-20/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。

谢谢老板打赏 Or2