The response has been limited to 50k tokens of the smallest files in the repo. You can remove this limitation by removing the max tokens filter.
├── .gitignore
├── Changelog.md
├── Clover-Hacky-Color_rus-5120.pdf
├── CloverEFIBootLoader完全手册zh-TWV1.0(20200816).pdf
├── LinkList.md
├── README-Origin.md
├── README.md
└── Tools
    ├── BCM94360Z4
    ├── BT
    ├── CFGLOCK
        ├── CFGLock.efi
        └── VerifyMsrE2.efi
    ├── DW1820A
    ├── MacOS_Updater
    ├── PPTP
        ├── PPTP.zip
        └── pptp
    ├── PPTP_for_Catalina.sh
    ├── README.md
    ├── RunMe系统信息收集.app.zip
    ├── Screenshot
        ├── BCM94360Z4_Check.png
        ├── WebdriverDownload.png
        ├── archey.png
        └── webdriver.png
    ├── VDADecoderChecker
    ├── WebDD.command
    ├── Webdriver All Versions.app.zip
    ├── archey
    ├── archey_BG
    ├── bdmesg
    ├── build_own.sh
    ├── daliansky.css
    ├── dspci
    ├── gfxutil
    ├── hda-verb
    ├── iasl-RM
    ├── iasl63
    ├── icloud_cache_clean.sh
    ├── installScript_1014fullapp
    ├── installScript_allfullapp
    ├── macserial
    ├── mount_efi.sh
    ├── msss
    ├── remove_DS_Store
    ├── sn.sh
    └── usb_Ports


/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | Wechat.md
3 | 


--------------------------------------------------------------------------------
/Changelog.md:
--------------------------------------------------------------------------------
  1 | ## 更新日志:
  2 | 
  3 | - 2018 年 10 月 06 日
  4 | - 2018 年 12 月 25 日
  5 | - 2019 年 01 月 15 日
  6 | - 2019 年 3 月 1 日 by 黑果小兵
  7 | 
  8 |   - 按机型重新排版
  9 |   - 将该文档上传到仓库,方便其它人提交合并,共同维护
 10 | - 2019年4月2日
 11 | 
 12 |   - 添加部分新机型
 13 |   - 将多于2个机型的品牌独立出来,方便检索
 14 | - 2019年5月9日
 15 | 
 16 |   - 新增机型:`Mechrevo X9Ti R` / `Mechrevo Z2 G` 等
 17 | - 2019年5月10日 by [明城](https://github.com/mingcheng)
 18 | 
 19 |   - 新增机型:`Lenovo M93P` / `Dell 9020m` 等机型
 20 | - 2019年7月3日 by [Cruii](https://github.com/Cruii)
 21 | 
 22 |   - 新增机型:`暗影精灵2Pro`(HP OMEN 15-ax225TX)
 23 | - 2019年7月19日 by [lgs3137](https://github.com/lgs3137)
 24 | 
 25 |   - 新增机型:`暗影精灵I`(惠普PAVILION Gaming NB 15-ak039TX)
 26 | - 2019年8月15日
 27 | 
 28 |   - 新增机型:ASUS X299 PRIME DELUXE II + i9 7980XE + Radeon VII
 29 | - 2019年8月16日
 30 | 
 31 |   - 新增机型:MSI X370 KRAIT GAMING + 1700X + RADEON VEGA64
 32 |   - 新增机型:ASROCK X570 TAICHI + 3700X + RADEON VEGA64,兼容ASROCK X570 TAICHI(BIOS<=1.21) + 1700X + RADEON VEGA64
 33 | - 2019年9月1日 by [lgs3137](https://github.com/lgs3137)
 34 | 
 35 |   - 新增机型:`ASUS Y5000U`(X507UBR)
 36 | - 2019年9月7日 by [lgs3137](https://github.com/lgs3137)
 37 | 
 38 |   - 新增机型:`Acer P258-MG`
 39 | - 2019年9月17日 by [skyline75489](https://github.com/skyline75489)
 40 | 
 41 |   - 新增机型:`MSI GE63 Raider RGB 8RE`
 42 | - 2019年10月5日 by [sarkrui](https://github.com/sarkrui)
 43 | 
 44 |   - 新增机型:ASRock Z390M Pro4 + i7-9700K + Sapphire RX580 Nitro+ 8G
 45 | - 2019年10月5日 by [我意](https://github.com/y010204025)
 46 | 
 47 |   - 新增机型:lenovo miix4(700)、miix510、E470
 48 | - 2019年10月19日 by [kongbg](https://github.com/kongbg)
 49 | 
 50 |   - 新增机型:ASUS K555LD
 51 | - 2019年10月28日 by [W-MS](https://github.com/W-MS)
 52 | 
 53 |   - 新增机型:Dell OptiPlex 7060 and 7070
 54 |   - 增加新版本支持: Dell OptiPlex 9020
 55 | - 2019年11月4日 by [YGQ8988](https://github.com/YGQ8988)
 56 | 
 57 |   - 新增机型:HP ProBook 430 G6
 58 | - 2019年11月14日
 59 | 
 60 |   - 新增机型:Lenovo Y9000X
 61 | - 2019年11月21日
 62 | 
 63 |   - 新增机型:Dell XPS 15 7590
 64 | - 2020年1月18日
 65 | 
 66 |   - 新增机型:DELL系列/Lenovo系列等机型
 67 | - 2020年2月15日
 68 | 
 69 |   - 新增机型:ASUS VivoBook FL8000UQ
 70 | - 2020年3月8日
 71 | 
 72 |   - 新增机型:华为Matebook 14 2020款
 73 | - 2020年3月14日
 74 | 
 75 |   - 新增机型:Lenovo G400
 76 | - 2020年4月8日
 77 | 
 78 |   - 新增机型:联想Miix 720/YOGA 910等机型
 79 | - 2020年4月22日
 80 | 
 81 |   - 新增机型:光影精靈4代/MSI-MPG-Z390-Gaming-EDGE-AC
 82 | - 2020年5月5日
 83 | 
 84 |   - 新增机型:联想M710Q等
 85 |   - 将台式机品牌重新分类、整理,便于查看相关信息
 86 | - 2020年6月8日
 87 | 
 88 |   - 新增机型:新增Z490等部分台式机型
 89 | - 2020年6月10日
 90 | 
 91 |   - 新增机型:新增Lenovo Thinkcentre M910x等部分新机型
 92 | - 2020年6月12日
 93 | 
 94 |   - 新增机型:新增DELL 9020 MT/SFF/USFF/Micro机型,基于OpenCore
 95 | - 2020年6月19日
 96 | 
 97 |   - 新增机型:新增部分台式机型,基于OpenCore
 98 | - 2020年6月23日
 99 | 
100 |   - 新增机型:新增Dell Latitude E7390等部分新机型
101 | - 2020年6月30日
102 | 
103 |   - 新增机型:B460 / Z490 以及其它笔记本机型
104 | - 2020年7月5日
105 | 
106 |   - 新增机型:新增ThinkPad T470p、ASUS-Prime-Z390M-PLUS、神舟战神z7-kp7sc、ASRock-B365M-ITX-AC等部分新机型
107 | - 2020年7月31日
108 | 
109 |   - 新增机型:新增对`Big Sur`等机型的支持,新增部分新机型
110 | - 2020年8月6日
111 | 
112 |   - 新增机型:新增B460/Z490等新机型
113 | - 2020年8月17日
114 | 
115 |   - 新增机型:新增B450等部分机型
116 | - 2020年8月31日
117 | 
118 |   - 新增机型:新增战神Z7、G8系列部分机型,具体请看commit
119 | - 2020年9月15日
120 | 
121 |   - 新增机型:Lenovo 天逸 510S Mini
122 | - 2020年10月29日
123 | 
124 |   - 新增N多机型:包括 `AMD`  /  `INTEL`等部分台式机型
125 | - 2020年11月23日
126 | 
127 |   - 新增机型:Acer Aspire A514-52-37H1/ Gygabyte B550i Aorus Pro AX 等新机型
128 |   - 新增机型:HP EliteDesk 800 G1/G2/G3/G4/G5
129 | - 2020年11月24日
130 | 
131 |   - 新增机型:`Ice Lake`等部分机型
132 | - 2020年11月26日
133 | 
134 |   - 新增机型:
135 |     - `Acer Nitro 5 AN515-54`
136 |     - `Asus H370i`
137 |     - `Gigabyte Z390 I Aorus Pro WiFi`
138 | - 2020年12月2日
139 | 
140 |   - 新增机型:
141 |     - `Lenovo Yoga C740-14IML`
142 |     - `HP Notebook 15ac001tx`
143 |     - `Dell Optiplex 5040`
144 |     - `Acer TravelMate TX520-G2-MG`
145 |     - `HP ProDesk 600 G2 DM`
146 |     - …… 
147 | - 2020年12月14日
148 | 
149 |   - 新增机型:
150 |     - `NUC5I5RYH`
151 |     - `NUC6I5SYH`
152 |     - `Asus UX433FN`
153 |     - `Dell Inspiron 5680`
154 |     - `ThinkPad L430`
155 |     - `Lenovo Legion Y545`
156 |     - `Dell  Optiplex 7010`
157 |     - `ASRock deskmini H470`
158 |     - `Gigabyte H110M S2HP`
159 | - 2020年12月23日
160 | 
161 |   - 新增机型:
162 |     - Acer Swift 3 SF314-54
163 |     - Asus N551JK
164 |     - ASUS ZenBook UX305FA
165 |     - Lenovo Legion Y520
166 |     - Gigabyte X570 UD
167 |     - ASRock B460m HDV
168 |     - Gigabyte Z370 HD3
169 |     - MSI B360M Bazooka
170 |     - MSI H410M BOMBER
171 |     - 七彩虹CVN B460i
172 |     - ......
173 | - 2021年1月15日
174 | 
175 |   - 新增机型:
176 |     - Asus ROG Strix G15 G512LU
177 |     - Mi Notebook 14 2020
178 |     - Gigabyte H110M H
179 |     - Gigabyte Z390 DESIGNARE
180 | - 2021年1月19日
181 | 
182 |   - 新增机型:
183 |     - Acer Aspire V 15 V5-591G
184 |     - Dell Latitude 5411
185 |     - Dell Latitude 5511
186 |     - 暗影精灵5 dc1010nr
187 |     - Lenovo Ideapad S145-15IWL
188 |     - 拯救者R720
189 |     - MSI GE70 2OE
190 |     - MSI GE72 2QE
191 |     - ASUS B250M
192 |     - Asus Prime H410M
193 |     - ASRock Z390M-ITX/ac
194 |     - Gigabyte B365M Aorus Elite
195 |     - Gigabyte H87M-D3H
196 |     - Gigabyte GA-Z170XP-SLI
197 |     - MSI Z390-A PRO
198 | - 2021年1月20日
199 | 
200 |   - 新增机型:
201 |     - HP 15 BS661TX
202 |     - MSI GL62M 7RDX
203 |     - FUJITSU 富士通 S762
204 |     - ASUS ROG Strix X570-F Gaming
205 |     - ASUS-Z490M-PLUS
206 |     - Gigabyte Z490I AORUS ULTRA
207 |     - Lenovo 天逸510S
208 |     - Lenovo B360
209 | - 2021年1月25日
210 | 
211 |   - 新增机型:
212 |     - Asus ROG GL703ge
213 |     - 战神Z7-SP7S2
214 |     - HP Pavilion 15an051dx
215 |     - Lenovo G40-80
216 |     - Lenovo V110-15ISK
217 |     - Shinelon T50TI
218 |     - Asus P8P67 EVO
219 |     - ASRock B85 Pro4
220 |     - Gigabyte B150M-VP
221 |     - Gigabyte Z490 UD
222 | - 2021年2月15日
223 | 
224 |   - 新增机型:
225 | 
226 |     - Asus FL5900U
227 |     - Asus ROG Strix G15 - G512LV
228 |     - Asus TUF 505GE
229 |     - Asus VivoBook X509FB
230 |     - Dell Latitude E5280
231 |     - HP EliteBook 840 G4
232 |     - HP EliteBook 840 G6
233 |     - HP ZHAN99 zbook 15v g5
234 |     - HP ZHAN 99 Pro G1 MT
235 |     - Lenovo 昭阳 E49
236 |     - Lenovo V730-15IKB
237 |     - Lenovo XiaoXin V4000
238 |     - Thinkpad X1 Carbon Gen 8
239 |     - Lenovo Legion 5i
240 |     - LG Gram 14Z990
241 |     - LG Gram17 Z90n
242 |     - Redmibook14增强版
243 |     - Xiaomi Redmibook 16
244 |     - 未来人类T5
245 |     - CHUWI Minibook
246 |     - Asus X470 Pro
247 |     - ASRock H61M-S1 Plus
248 |     - Gigabyte H170 HD3
249 |     - HP Compaq Pro 4300
250 |     - MSI B460I GAMING EDGE WIFI
251 |     - MSI H270 GAMING M3
252 |     - MSI H410M-PRO-VH
253 |     - ONDA H410 SD4
254 | - 2021年2月24日
255 | 
256 |    - 删除已失效的repo
257 | - 2021年3月7日
258 | 
259 |   - 重新排版
260 | - 2021年3月8日
261 |   - 新增机型
262 |     - Acer Aspire E5-575G
263 |     - Acer Predator G3-571
264 |     - Asus N550JK
265 |     - Asus N550JV
266 |     - 战神 G8-CU7NA
267 |     - HP Elitebook 830 G7
268 |     - HP Elitebook 840 G7
269 |     - HP Elitebook 850 G7
270 |     - Thinkpad X1 Carbon Gen 7
271 |     - Lenovo Z410
272 |     - LG 14U530
273 |     - MSI GF63-10
274 |     - 火影金刚GTX
275 |     - MSI MAG B550M MORTAR WIFI
276 |     - Asus H110M-C2 MoBo
277 |     - Asus ROG STRIX H370-I GAMING
278 |     - Asus Z170-Pro
279 |     - ASUS ROG Z390-F Gaming
280 |     - Dell Optiplex 5070mff
281 |     - Gigabyte mdh11ki
282 |     - MSI B250M MORTAR
283 | - 2021年3月17日
284 |   - 新增机型:
285 |     - Asus X542u
286 |     - Asus ZenBook UX305UA
287 |     - Dell Inspriron 14 3467
288 |     - Dell Inspiron 7391
289 |     - Dell Inspiron 7560
290 |     - Dell Latitude E5270
291 |     - 战神K670C-g6a1
292 |     - HP Probook 450 G5
293 |     - HP Pavilion ce3034nl
294 |     - Lenovo IdeaPad 320S 14IKB
295 |     - 三星Samsung NP350U-2B
296 |     - 海尔Haier Y11C
297 |     - Asrock B365M Pro4
298 |     - ASRock Z170 Gaming K4
299 |     - Asus H170M-PLUS
300 |     - Asus Z170 Deluxe
301 |     - Asus TUF Z390-PLUS GAMING
302 |     - Dell Optiplex 5040
303 |     - Dell Optiplex 5060MFF
304 |     - Dell Optiplex 5070mff
305 |     - Dell Optiplex 7020 SFF/MT
306 |     - Dell XPS 8940 
307 |     - Gigabyte H370m D3h
308 |     - Lenovo v410z
309 |     - MSI B250 GAMING PRO CARBON
310 |     - MSI H61-P31/W8
311 |     - MSI Z490 Gaming Plus
312 |     - Onda P75U
313 | - 2021年3月22日
314 |   - 新增机型:
315 |     - Asus X540LJ
316 |     - HP 15 da0004tu
317 |     - HP 15G BR011TX
318 |     - Asus Z490 AORUS PRO AX
319 |     - Huananzhi x99 f8
320 | - 2021年4月2日
321 | 
322 |   - 新增机型:
323 |     - Asus VivoBook FL8000u
324 |     - Dell Inspiron 3568
325 |     - Dell Latitude E7370
326 |     - Dell Vostro 3468
327 |     - Dell Vostro 5581
328 |     - HP Pavilion 15 au624tx
329 |     - Lenovo Ideapad S540 14IWL
330 |     - Gigabyte H410M S2H
331 | - 2021年4月12日
332 | 
333 |   - 新增机型:
334 |     - Dell Inspirion 15 3576
335 |     - HP Elite X2 G4 平板
336 |     - Lenovo IdeaPad Gaming 3i
337 |     - minisforum U820
338 |     - ASUS PRIME B250M-K
339 |     - ASROCK B560 STEEL LEGEND
340 |     - 51nb T70 ThinkPad 副厂主板
341 | - 2021年5月12日
342 | 
343 |   - 新增机型:
344 | 
345 |     - Dell Latitude 5310
346 |     - Asrock deskmini H470m
347 |     - ONDA B460 SD4
348 | - 2021年5月28日
349 | 
350 |   - 新增机型:
351 |     - HP Probook 430 G3
352 |     - ThinkPad e490s
353 |     - Lenovo Yoga X390
354 |     - 三星 Samsung NP350XAA-KF3BR
355 |     - ASRock B560M-HDV
356 |     - ASRock B560M-ITX
357 |     - ASRock B560 Steel Legend
358 |     - Asus TUF Gaming B560M PLUS
359 |     - Asus Z590 ROG MAXIMUS XIII HERO
360 |     - HP Omen 30L
361 | - 2021年6月22日
362 | 
363 |   - 新增机型:
364 |     - Acer Aspire V3-371
365 |     - Asus X411UF
366 |     - Dell Latitude E6230
367 |     - HP Zbook G1
368 |     - HP Zbook 15 G2
369 |     - HP Pavilion 15-cs0093ca
370 |     - avita liver v-14
371 |     - Dell ChengMing 3991
372 |     - HP 288 Pro G5
373 |     - Lenovo Ideacenter A340
374 | - 2021年9月7日
375 | 
376 |   - 新增机型:
377 | 
378 |     - Acer Aspire A515-55
379 |   - Asus FX55VD DM001D
380 |     - Dell Latitude 3400
381 |   - MSI GF63 8RD
382 | - 2021年10月21日
383 | 
384 |   - 新增机型:
385 |     - Asus FX505GT
386 |     - Dell Inspiron 3647
387 |     - HP ProBook 440 G3
388 |     - MSI GF63 9SCSR 846VN
389 |     - Gigabytes B560M AORUS Pro AX
390 |     - morefine S500
391 | - 2021年11月8日
392 | 
393 |   - 新增机型:
394 |     - Dell Inspiron 5493/5593
395 |     - Lenovo Ideapad S540 14IWL
396 |     - Lenovo Ideapad Flex 5 14IIL05
397 |     - Lenovo Yoga Duet 2020
398 |     - Chuwi CoreBookX 14
399 | - 2021年11月11日
400 | 
401 |    - 新增机型:
402 | 
403 |       - Asus ROG Strix G17 G712LW
404 |       - HP Probook 440 G6
405 |       - Gigabyte X399 Aorus Extreme
406 |       - MSI B550 A-Pro
407 | - 2021年11月15日
408 | 
409 |    - 新增机型:
410 |       - ASUS Vivobook Pro 15 N580GD
411 |       - Dell XPS 15 9500
412 |       - Lenovo ThinkPad L14 Gen1
413 |       - Lenovo Thinkpad P1 Gen1
414 |       - Asus Prime Z690M Plus
415 | - 2021年11月23日
416 |    - 新增机型:
417 |       - Toshiba Satelite Pro L850-1UJ
418 |       - Lenovo ThinkCentre M920X
419 |       - Dell Vostro 5590
420 |       - Dell Inspiron 5593
421 |       - Dell OptiPlex 3080
422 |       - Asus ROG STRIX B560-I GAMING WIFI
423 |       - Acer Aspire A515-53G-5269
424 |       - HP Elitebook 9480m
425 |       - Asus ROG STRIX B550-A GAMING  
426 |       - Gigabyte Z490M
427 | - 2021年11月29日
428 |    - 新增机型:
429 |       - Acer Nitro 5 AN515-54-51NJ
430 |       - HP Pavilion 16 a000x
431 |       - HP Pavilion 550
432 |       - Dell OptiPlex 7080 MT
433 |       - Asus PN62
434 |       - HP ProDesk 680 G3 MT
435 | - 2021年12月3日
436 |    - 新增机型:
437 |       - Asus UX32VD
438 |       - ASRock H510M-HDV
439 |       - Asus ROG STRIX Z490-F GAMING
440 |       - Lenovo B50-80 80EW
441 | - 2021年12月16日
442 |    - 新增机型:
443 |       - Acer Aspire 3 A315-56
444 |       - Asus TP412FA
445 |       - LG Gram 14Z90N
446 |       - Samsung NT350XCR-AD5AS
447 | - 2022年1月12日
448 |    - 新增机型:
449 |       - Dell OptiPlex 7080 MT
450 |       - Gigabyte Z690 Aorus Elite AX 
451 |       - HP Pavilion 15 cb008nt
452 |       - Asus ROG STRIX B350-I GAMING
453 |       - Dell Latitude 5300
454 |       - MSI B450M MORTAR
455 |       - MSI B350M Gaming Pro
456 |       - MSI X370 Krait Gaming
457 |       - X99 K9 v2 Machinist
458 |       - Gigabyte Z690 Aorus Pro
459 |       - 华为 Matebook X Pro 2020
460 |       - Asus PRIME X570-P 
461 |       - Dell Inspiron 7501
462 | - 2022年4月22日
463 |    - 新增机型:
464 |      - Acer Nitro 5 an517-51-55NT 
465 |      - HP ENVY x360 - 15-bp103tx 
466 |      - HP Elitebook 820 G3 
467 |      - HP Pavilion Laptop 14-ce3xxx 
468 |      - MSI GT60 16F4
469 |      - Asus ROG Strix X570-E Gaming
470 |      - HP Prodesk 600 G3
471 | - 2022年11月21日
472 |    - 新增机型:
473 |      - Gigabyte B360M AORUS PRO 
474 |      - Lenovo IdeaPad 300-15ISK  
475 |      - MSI Z490-A PRO
476 |      - MSI H81M P33   
477 |      - Airbook 颜值版 i5 6200u(Ventura)
478 |      - Infinix INBook X1
479 |      - MSI X470 gaming PRO MAX 
480 |      - MAG B660M MORTAR WIFI DDR4
481 |      - DELL VOSTRO 14 3401
482 |      - Alienware M15R2
483 |      - Asus Vivobook X515JA
484 |      - Asus VivoBook A412F
485 |      - Acer Nitro 5 AN515-52-593F
486 |      - ThinkPad L470 
487 |      - Dell G5 5500 
488 |      - ASUS ROG Z590-A-Gaming-WIFI-II
489 |      - Gigabyte Z590 Vision G
490 | - 2023年1月19日
491 |    - 新增机型:
492 |       - ASUS PRIME Z790 P WIFI D4
493 |       - Gigabyte Z790 Aorus Elite
494 |       - Gigabyte Z790 Aorus Master
495 |       - MSI Z790i EDGE
496 |       - 铭瑄z790m
497 | - 2023年10月10日
498 |    - 新增机型:
499 |       - HP OMEN 15 2017 15-ax218TX
500 |       - 华南X99TF
501 |       - NUC8-BEH/BEK
502 |       - NUC9QNX
503 |       - morefine M600s
504 |    
505 | - 2024年3月4日
506 |    - 新增机型:
507 |      - FEVM FN60G
508 |      - minisforum UM480XT
509 |      - minisforum UM560XT
510 |      - minisforum UM580D/UM590
511 |      - minisforum NAG6
512 | 
513 | 


--------------------------------------------------------------------------------
/Clover-Hacky-Color_rus-5120.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Clover-Hacky-Color_rus-5120.pdf


--------------------------------------------------------------------------------
/CloverEFIBootLoader完全手册zh-TWV1.0(20200816).pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/CloverEFIBootLoader完全手册zh-TWV1.0(20200816).pdf


--------------------------------------------------------------------------------
/LinkList.md:
--------------------------------------------------------------------------------
 1 | **如果有比较实用的软件或者是 kext 驱动,都可以加到清单里面哟^^**
 2 | 
 3 | ## 1.软件类
 4 | 
 5 | | 软件名称             | 链接地址                                     | 主要用途                                     |
 6 | | ---------------- | ---------------------------------------- | ---------------------------------------- |
 7 | | Clover  | [链接](https://sourceforge.net/projects/cloverefiboot)  |  EFI引导工具,ACPI 代码加载和相关驱动的实现基础  |
 8 | | Clover Configurator  | [链接](https://mackie100projects.altervista.org/download-clover-configurator)  |  Clover配置工具,记得时常更新哦  |
 9 | | DarwinDumper  | [链接](https://bitbucket.org/blackosx/darwindumper/downloads)  | 类似于 AIDA64的工具,很实用,用的人不多,蛮可惜的  |
10 | | Hackintool  | [链接](https://www.insanelymac.com/forum/topic/335018-hackintool-v224)  | 修补Framebuffer、实现 USB 端口定制以及 AppleALC layout-id 节点选择  |
11 | | IORegistryExplorer  | [链接](https://www.tonymacx86.com/attachments/ioregistryexplorer-slrid_v10-6-3-zip.24086)  | 查看系统 I/O 信息以及驱动和设备的附属关系  |
12 | | MaciASL  | [链接](https://github.com/acidanthera/MaciASL/releases)  | AML的编译器和IDE,用于修改DSDT和制作热补丁  |
13 | | OSX-Debug  | [链接](https://github.com/black-dragon74/OSX-Debug)  | 收集原始ACPI表,驱动,崩溃日志等相关信息的脚本,用于给大神反馈问题  |
14 | | ProperTree | [链接](https://github.com/corpnewt/ProperTree)  | OpenCore 官方推荐的配置工具 | 
15 | 
16 | ## 2.驱动类
17 | 
18 | ### Lilu和它的插件
19 | 
20 | | 驱动名称             | 链接地址                                     | 主要用途                                     |
21 | | ---------------- | ---------------------------------------- | ---------------------------------------- |
22 | | Lilu  | [链接](https://github.com/acidanthera/Lilu)  | 驱动注入框架,AppleALC, WhateverGreen, VirtualSMC等驱动的依赖  |
23 | | AirportBrcmFixup  | [链接](https://github.com/acidanthera/AirportBrcmFixup)  | 博通无线网卡驱动  |
24 | | AppleALC  | [链接](https://github.com/acidanthera/AppleALC)  | 声卡注入框架  |
25 | | ATH9KFixup  | [链接](https://github.com/chunnann/ATH9KFixup)  | Atheros网卡驱动  |
26 | | BT4LEContiunityFixup  | [链接](https://github.com/acidanthera/BT4LEContiunityFixup)  | 开启接力,隔空投送等功能  |
27 | | CPUFriend  | [链接](https://github.com/acidanthera/CPUFriend)  | 注入CPU动态电源数据的驱动  |
28 | | DiskArbitrationFixup | [链接](https://github.com/Goldfish64/DiskArbitrationFixup)  | 禁止“此电脑不能读取您插入的磁盘”提示  |
29 | | HibernationFixup  | [链接](https://github.com/acidanthera/HibernationFixup)  | 修复休眠问题  |
30 | | NightShiftUnlocker | [链接](https://github.com/0xFireWolf/NightShiftUnlocker)  | 开启夜览功能  |
31 | | NoTouchID  | [链接](https://github.com/al3xtjames/NoTouchID)  | 禁用触控 ID支持  |
32 | | SystemProfilerMemoryFixup  | [链接](https://github.com/Goldfish64/SystemProfilerMemoryFixup)  | 显示关于本机的内存标签  |
33 | | VirtualSMC  | [链接](https://github.com/acidanthera/VirtualSMC)  | SMC仿冒驱动,和FakeSMC二选一 |
34 | | WhateverGreen  | [链接](https://github.com/acidanthera/WhateverGreen)  | 显卡注入框架,集成了很多补丁 |
35 | 
36 | ### 其它
37 | 
38 | | 驱动名称             | 链接地址                                     | 主要用途                                     |
39 | | ---------------- | ---------------------------------------- | ---------------------------------------- |
40 | | AppleBacklightFixup  | [链接](https://bitbucket.org/RehabMan/applebacklightfixup)  | 亮度调节驱动,已集成进WhateverGreen v1.2.5  |
41 | | EFICheckDisabler  | [链接](https://github.com/RehabMan/hack-tools/tree/master/kexts/EFICheckDisabler.kext)  | 禁止macOS EFI开机检查  |
42 | | OS-X-ACPI-Battery-Driver  | [链接](https://bitbucket.org/RehabMan/os-x-acpi-battery-driver) | 电池驱动  |
43 | | OS-X-BrcmPatchRAM  | [链接](https://bitbucket.org/RehabMan/os-x-brcmpatchram)  | 博通蓝牙驱动  |
44 | | OS-X-EAPD-Codec-Commander  | [链接](https://bitbucket.org/RehabMan/os-x-eapd-codec-commander)  | 修复声卡休眠无声的驱动  |
45 | | OS-X-Fake-PCI-ID  | [链接](https://bitbucket.org/RehabMan/os-x-fake-pci-id)  | 硬件 ID 仿冒驱动  |
46 | | OS-X-FakeSMC-kozlek  | [链接](https://bitbucket.org/RehabMan/os-x-fakesmc-kozlek)  | SMC仿冒驱动,和VirtualSMC二选一  |
47 | | OS-X-Intel-Network  | [链接](https://bitbucket.org/RehabMan/os-x-intel-network)  | Intel有线网卡驱动(部分)  |
48 | | OS-X-Null-Ethernet  | [链接](https://bitbucket.org/RehabMan/os-x-null-ethernet)  | 仿冒有线网卡到en0端口,帮助连接AppleStore等  |
49 | | OS-X-Realtek-Network  |  [链接](https://bitbucket.org/RehabMan/os-x-realtek-network) | Realtek有线网卡驱动  |
50 | | OS-X-USB-Inject-All  | [链接](https://bitbucket.org/RehabMan/os-x-usb-inject-all)  | USB端口注入框架  |
51 | | RTL8111_driver_for_OS_X  | [链接](https://github.com/Mieze/RTL8111_driver_for_OS_X)  | Realtek RTL8111/8168有线网卡驱动  |
52 | | SATA-unsupported  | [链接](https://github.com/RehabMan/hack-tools/tree/master/kexts/SATA-unsupported.kext)  | SATA硬盘驱动  |
53 | | VoodooI2C  | [链接](https://github.com/alexandred/VoodooI2C)  | I2C触控板驱动  |
54 | | VoodooPS2Controller  | [链接](https://github.com/acidanthera/VoodooPS2)  | PS2键盘和触控板驱动,ALPS 触控板请用 SmartTouchPad 驱动  |
55 | | XHCI-unsupported  | [链接](https://github.com/RehabMan/OS-X-USB-Inject-All/tree/master/XHCI-unsupported.kext)  |  USB驱动  |
56 | 
57 | ## 3.待续……
58 | 


--------------------------------------------------------------------------------
/Tools/BCM94360Z4:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | # 
 3 | # @desc [Get BCM94360Z4 device information script]
 4 | # @author [DalianSky]
 5 | # @email [daliansky2008@mail.com]
 6 | # @create date 2021-03-5 05:12:13
 7 | # @modify date 2021-03-5 12:57:02
 8 | # 
 9 | # @command call: [ sh -c "$(curl -fsSL https://raw.githubusercontent.com/daliansky/Hackintosh/master/Tools/BCM94360Z4)" ]
10 | # 国内调用加速:
11 | # @command call: [ sh -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/daliansky/Hackintosh/Tools/BCM94360Z4)"]
12 | # str="字符串"
13 | # echo -e "\033[30m ${str}\033[0m"      ## 黑色字体
14 | # echo -e "\033[31m ${str}\033[0m"      ## 红色
15 | # echo -e "\033[32m ${str}\033[0m"      ## 绿色
16 | # echo -e "\033[33m ${str}\033[0m"      ## ×××
17 | # echo -e "\033[34m ${str}\033[0m"      ## 蓝色
18 | # echo -e "\033[35m ${str}\033[0m"      ## 紫色
19 | # echo -e "\033[36m ${str}\033[0m"      ## 青色
20 | # echo -e "\033[37m ${str}\033[0m"      ## 白色
21 | DW1820A="BCM94360Z4驱动信息:"
22 | os_ver=$(sw_vers -productVersion  | /usr/bin/cut -d . -f 1)
23 | ver="macOS版本:"
24 | bootargs="引导参数:"
25 | MB="机型或主板:"
26 | WIFI="网卡信息:"
27 | BT="蓝牙信息:"
28 | # bdmesg download url
29 | curl -fsSL https://cdn.jsdelivr.net/gh/daliansky/Hackintosh/Tools/bdmesg -o /tmp/bdmesg && chmod +x /tmp/bdmesg
30 | 
31 | echo "  ######   #####  #     #  #####  #        #####   #####    ###   ####### #"
32 | echo "  #     # #     # ##   ## #     # #    #  #     # #     #  #   #       #  #    #"
33 | echo "  #     # #       # # # # #     # #    #        # #       # #   #     #   #    #"
34 | echo "  ######  #       #  #  #  ###### #######  #####  ######  #  #  #    #    #######"
35 | echo "  #     # #       #     #       #      #        # #     # #   # #   #          #"
36 | echo "  #     # #     # #     # #     #      #  #     # #     #  #   #   #           #"
37 | echo "  ######   #####  #     #  #####       #   #####   #####    ###   #######      #"
38 | 
39 | echo "\033[31m ${DW1820A} \033[0m"
40 | echo "\033[33m ${ver} \033[0m \c" && sw_vers -productVersion
41 | echo "\033[36m ${bootargs} \033[0m \c" && ioreg -l | grep -y boot-args | awk '{for(i=4;i<=NF;i++){to=to" " $i};print to}'
42 | echo "==========================================================="
43 | echo "\033[33m ${MB} \033[0m \c" && sh -c /tmp/bdmesg | grep Running | awk '{for(i=5;i<=NF;i++){to=to" "$i};print to}'
44 | # echo "=== [ GetDevices ] ========================================"
45 | # sh -c /tmp/bdmesg | grep PCI | grep -v IGPU | grep -v USBXHCI | grep -v PCI0
46 | echo "\033[32m ${WIFI} \033[0m"
47 | echo "==========================================================="
48 | # gfxutil download url
49 | curl -fsSL https://cdn.jsdelivr.net/gh/daliansky/Hackintosh/Tools/gfxutil -o /tmp/gfxutil && chmod +x /tmp/gfxutil && sh -c /tmp/gfxutil | grep ARPT | awk '{print $3}'
50 | sh -c /tmp/bdmesg  | grep -y aspm | awk '{for(i=3;i<=NF;i++){to=to" "$i};print to}'
51 | ioreg -l | grep "14e4,43" | grep "compatible" | sed "s/|//g" | sed "s/ //g" 
52 | system_profiler SPAirPortDataType | grep "Card Type"
53 | system_profiler SPAirPortDataType | grep "MAC Address"
54 | kextstat | grep Brcm43 | awk '{for(i=6;i<=7;i++){to=to" "$i};print to}' | sed "s/ //g" 
55 | ioreg -l | grep "IO80211CountryCode" | sed 's/|//g' | sed 's/ //g'
56 | echo "\033[34m ${BT} \033[0m"
57 | echo "==========================================================="
58 | #system_profiler SPUSBDataType | grep BCM2045A0 | grep -v SPUSBDevice | sed 's/ //g'
59 | #system_profiler SPUSBDataType | grep "0a5c" && system_profiler SPUSBDataType | grep 22be # 内测版
60 | system_profiler SPUSBDataType | grep "33ba" && system_profiler SPUSBDataType | grep 03e # 量产版
61 | ioreg -l | grep "FirmwareVersionString" | sed "s/|//g" | sed "s/ //g" 
62 | 
63 | if [[ "$os_ver" == 12 ]]; then
64 |     kextstat | grep -v com.apple | grep -y blue | awk '{print $6,$7}'
65 | else
66 |     kextstat | grep -v com.apple | grep -y brcm | awk '{print $6,$7}' | grep -v "No variant specified, falling back to release"
67 | fi
68 | 
69 | 
70 | 


--------------------------------------------------------------------------------
/Tools/BT:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | ioreg -l | grep "FirmwareVersionString" | sed "s/|//g" | sed "s/ //g" && kextstat | grep -v com.apple | grep -y brcm | awk '{print $6,$7}'
3 | 
4 | 


--------------------------------------------------------------------------------
/Tools/CFGLOCK/CFGLock.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/CFGLOCK/CFGLock.efi


--------------------------------------------------------------------------------
/Tools/CFGLOCK/VerifyMsrE2.efi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/CFGLOCK/VerifyMsrE2.efi


--------------------------------------------------------------------------------
/Tools/DW1820A:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | # 
 3 | # @desc [Get DW1820A device information script]
 4 | # @author [DalianSky]
 5 | # @email [daliansky2008@mail.com]
 6 | # @create date 2020-01-5 05:12:13
 7 | # @modify date 2020-01-30 12:57:02
 8 | # 
 9 | # @command call: [ sh -c "$(curl -fsSL https://raw.githubusercontent.com/daliansky/Hackintosh/master/Tools/DW1820A)" ]
10 | # str="字符串"
11 | # echo -e "\033[30m ${str}\033[0m"      ## 黑色字体
12 | # echo -e "\033[31m ${str}\033[0m"      ## 红色
13 | # echo -e "\033[32m ${str}\033[0m"      ## 绿色
14 | # echo -e "\033[33m ${str}\033[0m"      ## ×××
15 | # echo -e "\033[34m ${str}\033[0m"      ## 蓝色
16 | # echo -e "\033[35m ${str}\033[0m"      ## 紫色
17 | # echo -e "\033[36m ${str}\033[0m"      ## 青色
18 | # echo -e "\033[37m ${str}\033[0m"      ## 白色
19 | DW1820A="DW1820A驱动信息:"
20 | ver="macOS版本:"
21 | bootargs="引导参数:"
22 | MB="机型或主板:"
23 | WIFI="网卡信息:"
24 | BT="蓝牙信息:"
25 | curl -fsSL https://raw.githubusercontent.com/daliansky/Hackintosh/master/Tools/bdmesg -o /tmp/bdmesg && chmod +x /tmp/bdmesg
26 | 
27 | echo "      ######   #     #    #     ###    ###    ####      #"
28 | echo "      #     #  #  #  #   ##    #   #  #   #  #   ##    # #"
29 | echo "      #     #  #  #  #  # #    #   #  #   #  #  # #   #   #"
30 | echo "      #     #  #  #  #    #     ###      #   # #  #  #     #"
31 | echo "      #     #  #  #  #    #    #   #    #    ##   #  #######"
32 | echo "      #     #  #  #  #    #    #   #   #     #    #  #     #"
33 | echo "      ######    ## ##   #####   ###   #####   ####   #     #"
34 | 
35 | echo "\033[31m ${DW1820A} \033[0m"
36 | echo "\033[33m ${ver} \033[0m \c" && sw_vers -productVersion
37 | echo "\033[36m ${bootargs} \033[0m \c" && ioreg -l | grep -y boot-args | awk '{for(i=4;i<=NF;i++){to=to" " $i};print to}'
38 | echo "==========================================================="
39 | echo "\033[33m ${MB} \033[0m \c" && sh -c /tmp/bdmesg | grep Running | awk '{for(i=5;i<=NF;i++){to=to" "$i};print to}'
40 | # echo "=== [ GetDevices ] ========================================"
41 | # sh -c /tmp/bdmesg | grep PCI | grep -v IGPU | grep -v USBXHCI | grep -v PCI0
42 | echo "\033[32m ${WIFI} \033[0m"
43 | echo "==========================================================="
44 | curl -fsSL https://raw.githubusercontent.com/daliansky/Hackintosh/master/Tools/gfxutil -o /tmp/gfxutil && chmod +x /tmp/gfxutil && sh -c /tmp/gfxutil | grep ARPT | awk '{print $3}'
45 | sh -c /tmp/bdmesg  | grep -y aspm | awk '{for(i=3;i<=NF;i++){to=to" "$i};print to}'
46 | ioreg -l | grep "14e4,43" | grep "compatible" | sed "s/|//g" | sed "s/ //g" 
47 | system_profiler SPAirPortDataType | grep "Card Type"
48 | system_profiler SPAirPortDataType | grep "MAC Address"
49 | kextstat | grep Brcm43 | awk '{for(i=6;i<=7;i++){to=to" "$i};print to}' | sed "s/ //g" 
50 | ioreg -l | grep "IO80211CountryCode" | sed 's/|//g' | sed 's/ //g'
51 | echo "\033[34m ${BT} \033[0m"
52 | echo "==========================================================="
53 | system_profiler SPUSBDataType | grep BCM2045A0 | grep -v SPUSBDevice | sed 's/ //g'
54 | ioreg -l | grep "FirmwareVersionString" | sed "s/|//g" | sed "s/ //g" 
55 | kextstat | grep -v com.apple | grep -y brcm | awk '{print $6,$7}'
56 | 
57 | 
58 | 


--------------------------------------------------------------------------------
/Tools/MacOS_Updater:
--------------------------------------------------------------------------------
  1 | #!/bin/sh
  2 | 
  3 | #
  4 | # By Gengik84, rewritten by PMheart
  5 | #
  6 | # Based on Pike R. Alpha's script and crazybirdy's modifications.
  7 | #
  8 | # Many thanks to PikeRAlpha, crazybirdy and PMheart!
  9 | #
 10 | 
 11 | # uncomment to enable debug logging
 12 | # set -x
 13 | 
 14 | # Change additional shell optional behavior (expand unmatched names to a null string).
 15 | shopt -s nullglob
 16 | 
 17 | #
 18 | # VARIABLES
 19 | #
 20 | #----------------------------------------------------------------------------------------------------
 21 | 
 22 | #
 23 | # script version
 24 | #
 25 | gScriptVersion="1.0.20"
 26 | 
 27 | #
 28 | # Beta version (ONLY the latest Beta)
 29 | # could be empty when there is no Beta available. (consider 10.14.6)
 30 | #
 31 | gBetaVersion=""
 32 | 
 33 | #
 34 | # stable version (ONLY the latest stable)
 35 | #
 36 | gStableVersion="10.14.6"
 37 | 
 38 | #
 39 | # Current macOS version returned from sw_vers (e.g 10.14.5).
 40 | #
 41 | gProductVersion="$(sw_vers -productVersion)"
 42 | 
 43 | #
 44 | # Current macOS build returned from sw_vers (e.g 18F132).
 45 | #
 46 | gProductBuildVersion="$(sw_vers -buildVersion)"
 47 | 
 48 | #
 49 | # Current macOS major version.
 50 | # For example: given gProductVersion 10.14.3, gProductMajorVersion will be 14.
 51 | #
 52 | gProductMajorVersion="${gProductVersion:3:2}"
 53 | 
 54 | #
 55 | # Current macOS minor version.
 56 | # For example: given gProductVersion 10.14.3, gProductMinorVersion will be 3.
 57 | #
 58 | gProductMinorVersion="${gProductVersion:6:2}"
 59 | # NOTE: It will be null when no minor version available. Appending 0.
 60 | [[ -z "${gProductMinorVersion}" ]] && gProductMinorVersion=0
 61 | 
 62 | #
 63 | # Beta Major version
 64 | # For example: given gBetaVersion 10.14.4, gBetaMajorVersion will be 14.
 65 | #
 66 | gBetaMajorVersion="${gBetaVersion:3:2}"
 67 | 
 68 | #
 69 | # Beta Minor version
 70 | # For example: given gBetaVersion 10.14.4, gBetaMinorVersion will be 4.
 71 | #
 72 | gBetaMinorVersion="${gBetaVersion:6:2}"
 73 | # NOTE: It will be null when no minor version available. Appending 0.
 74 | [[ -z "${gBetaMinorVersion}" ]] && gBetaMinorVersion=0
 75 | 
 76 | #
 77 | # Stable Major version
 78 | # For example: given gStableVersion 10.14.4, gStableMajorVersion will be 14.
 79 | #
 80 | gStableMajorVersion="${gStableVersion:3:2}"
 81 | 
 82 | #
 83 | # Stable Minor version
 84 | # For example: given gStableVersion 10.14.3, gStableMinorVersion will be 3.
 85 | #
 86 | gStableMinorVersion="${gStableVersion:6:2}"
 87 | # NOTE: It will be null when no minor version available. Appending 0.
 88 | [[ -z "${gStableMinorVersion}" ]] && gStableMinorVersion=0
 89 | 
 90 | #
 91 | # Package Mode:
 92 | #  Delta - a more lightweight package, should only be used on the most recent macOS.
 93 | #  Combo - a reasonably full package, could be used on all major releases, used by default.
 94 | #
 95 | #  When to use Delta (pseudo code):
 96 | #    gProductMajorVersion == gBetaMajorVersion                                                    &&
 97 | #    gProductMinorVersion == gBetaMinorVersion         [e.g update from 10.14.4 b1 to 10.14.4 b3] ||
 98 | #    gProductMinorVersion == (gBetaMinorVersion - 1)   [e.g update from 10.14.3 to 10.14.4 b3]
 99 | #===============================================================================================================
100 | #    gProductMajorVersion == gStableMajorVersion                                                                &&
101 | #    gProductMinorVersion == gStableMinorVersion       [e.g update from 10.14.3 to 10.14.3 supplemental update] ||
102 | #    gProductMinorVersion == (gStableMinorVersion - 1) [e.g update from 10.14.2 to 10.14.3]
103 | #
104 | #  When to use Combo:
105 | #    Of course, scenarios other than ones using Delta...
106 | #
107 | gPackageMode="Combo"
108 | 
109 | #----------------------------------------------------------------------------------------------------
110 | 
111 | #
112 | # GLOBAL VARS
113 | # WILL BE UPDATED BY CERTAIN FUNCTIONS
114 | #
115 | #----------------------------------------------------------------------------------------------------
116 | 
117 | # selected channel for determining URL
118 | # will be updated by selectChannel()
119 | gChannel=""
120 | # selected catalog URL (see channels and catalogs above)
121 | # will be updated by selectChannel()
122 | gCatalog=""
123 | # selected system version
124 | gVersion=""
125 | # target destination
126 | gVolume=""
127 | 
128 | # package keys
129 | # will be updated by parseCatalog()
130 | gUrlIndex=""
131 | gKeyNum=""
132 | gKeyIndex=""
133 | gKeySalt=""
134 | # the exact url
135 | gUrl=""
136 | # distribution file
137 | gDist=""
138 | 
139 | # initialisation of a variable (our target folder).
140 | gTmpDirectory="/tmp"
141 | gWorkDir=""
142 | # name of target installer package
143 | gInstallerPackage="installer.pkg"
144 | # backup dir
145 | gUserPath="${HOME}/Desktop"
146 | 
147 | #----------------------------------------------------------------------------------------------------
148 | 
149 | #
150 | # CONSTANTS
151 | # NO CHANGE NEEDED HERE
152 | #
153 | #----------------------------------------------------------------------------------------------------
154 | 
155 | # possible channels
156 | gChannels=(
157 |   # dev beta (pub beta has been dropped)
158 |   "Beta"
159 |   # normal
160 |   "Normal Channel"
161 | )
162 | # possible catalog URLs (corresponding to channels above)
163 | gCatalogs=(
164 |   # beta
165 |   "https://swscan.apple.com/content/catalogs/others/index-10.14seed-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz"
166 |   # normal
167 |   "https://swscan.apple.com/content/catalogs/others/index-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz"
168 | )
169 | 
170 | # colors
171 | RED="\e[31m"
172 | GREEN="\e[32m"
173 | DARK_YELLOW="\e[33m"
174 | BLUE="\e[34m"
175 | PURPLE="\e[35m"
176 | CYAN="\e[36m"
177 | OFF="\e[0m"
178 | 
179 | #----------------------------------------------------------------------------------------------------
180 | 
181 | function STY_LINE() {
182 |   printf '%s\n\n' '-------------------------------------------------------------------------------'
183 | }
184 | 
185 | function isProductBeta() {
186 |   # if the last char of build version is a lowercased letter,
187 |   # then it is Beta, 1 will be returned.
188 |   local chBetaIndicator="${gProductBuildVersion:-1}"
189 |   if [[ "${chBetaIndicator}" =~ [a-z] ]]; then
190 |     echo 1
191 |     return
192 |   fi
193 | 
194 |   echo 0
195 | }
196 | 
197 | function setPackageMode() {
198 |   if [[ "${gChannel}" == 'Beta' ]]; then
199 |     let "gBetaMinorVersionMinusOne   = gBetaMinorVersion   - 1"
200 |     if [[ "${gProductMajorVersion}" -eq "${gBetaMajorVersion}" && \
201 |           "${gProductMinorVersion}" -eq "${gBetaMinorVersion}" || \
202 |           "${gProductMinorVersion}" -eq "${gBetaMinorVersionMinusOne}" ]]; then
203 |         printf "\nUsing ${GREEN}Delta${OFF} package (Beta).\n\n"
204 |         gPackageMode='Delta'
205 |     else
206 |       printf "\nUsing ${DARK_YELLOW}Combo${OFF} package (Beta).\n\n"
207 |     fi
208 |   else
209 |     let "gStableMinorVersionMinusOne = gStableMinorVersion - 1"
210 |     if [[ "${gProductMajorVersion}" -eq "${gStableMajorVersion}" && \
211 |           "${gProductMinorVersion}" -eq "${gStableMinorVersion}" ]]; then
212 |       	printf "\nUsing ${GREEN}Delta Supplemental${OFF} package (Stable).\n\n"
213 |       	gPackageMode='DeltaSup'
214 |     elif [[ "${gProductMajorVersion}" -eq "${gStableMajorVersion}" && \
215 |             "${gProductMinorVersion}" -eq "${gStableMinorVersionMinusOne}" ]]; then
216 |       	printf "\nUsing ${GREEN}Delta${OFF} package (Stable).\n\n"
217 |       	gPackageMode='Delta'
218 |     else
219 |       printf "\nUsing ${DARK_YELLOW}Combo${OFF} package (Stable).\n\n"
220 |     fi
221 |   fi
222 | }
223 | 
224 | function updateScript() {
225 |  local remoteAddr="https://raw.githubusercontent.com/Gengik84/MacOS_Updater/master/MacOS_Updater"
226 |  local tmpScriptPath="/tmp/MacOS_Updater"
227 |  # download remote script
228 |  rm -f "${tmpScriptPath}" && curl -s "${remoteAddr}" -o "${tmpScriptPath}" || exit 1
229 |  local remoteVer=$(cat ${tmpScriptPath} | grep '^gScriptVersion=' | tr -cd '.0-9')
230 | 
231 |   if [[ "${gScriptVersion}" != "${remoteVer}" ]]; then
232 |     clear
233 |     printf "\tLocal Script Version: ${RED}${gScriptVersion}${OFF}\t\tUpdate available: ${GREEN}v${remoteVer}${OFF}\n"
234 |     local confirmScptUpd
235 |     read -p "Do you want update to the latest version? (y/n) " confirmScptUpd
236 |     case "${confirmScptUpd}" in
237 |       y|Y )
238 |         cp "${tmpScriptPath}" "$0"
239 |         STY_LINE
240 | 
241 |         printf "${BLUE}Running the new script...${OFF}"
242 |         local args="$@"
243 |         "$0" "${args}"
244 |         # do not run the current (old) script again
245 |         exit 0
246 |      ;;
247 |     esac
248 |   fi
249 | }
250 | 
251 | function downloadFile() {
252 |   local link="$1"
253 |   local out="$2"
254 | 
255 |   local attempt=0
256 |   local maxTry=3
257 |   for ((; attempt < maxTry; attempt++ )); do
258 |     curl "${link}" -o "${out}"
259 |     if [[ $? -ne 0 ]]; then
260 |       # failed, remove the "corrupted" file and try again
261 |       rm -rf "${out}"
262 |     else
263 |       # success
264 |       return 0
265 |     fi
266 | 
267 |     sleep 0.5
268 |   done
269 | 
270 |   printf "Failed to download ${RED}${out}${OFF} after ${attempt} times trying!\n"
271 |   exit 1
272 | }
273 | 
274 | function registerScript() {
275 |   local prefDir="${HOME}/.MacOS_Updater"
276 |   local prefFile="${prefDir}/pref.conf"
277 | 
278 |   [[ ! -d "${prefDir}" ]] && mkdir "${prefDir}"
279 | 
280 |   if [[ -f "${prefFile}" ]]; then
281 |     source "${prefFile}"
282 |   else
283 |     clear
284 |     echo 'It seems to be the first time you are using this script,'
285 |     echo 'for convenience, you may want to register it,'
286 |     echo 'in this case you will no more be prompted to enter the password'
287 |     echo 'until having been moved to elsewhere.'
288 |     echo 'Note that it might also be a security risk when registering.'
289 |     echo
290 |     echo 'Well, it is totally up to you to register or not,'
291 |     echo 'and you will be no more asked you after this time.'
292 |     echo
293 | 
294 |     while true; do
295 |       local confirmRegScpt
296 |       read -p "Would you like to? (y/n) " confirmRegScpt
297 |       case "${confirmRegScpt}" in
298 |         y|Y )
299 |           echo 'wantRegScpt=1' > "${prefFile}"
300 |           break
301 |         ;;
302 | 
303 |         n|N )
304 |           echo 'wantRegScpt=0' > "${prefFile}"
305 |           break
306 |         ;;
307 | 
308 |         * )
309 |           echo 'Try again...'
310 |         ;;
311 |       esac
312 |     done
313 |   fi
314 | 
315 |   if [[ "${wantRegScpt}" -eq 1 ]]; then
316 |     local regFile="/etc/sudoers.d/MacOS_Updater"
317 |     local context="$(users) ALL=(ALL) NOPASSWD: ${0}"
318 |     if [[ ! -f "${regFile}" || \
319 |           "$(cat ${regFile})" != "${context}" ]]; then
320 |       rm -f "${regFile}"
321 |       echo "${context}" | sudo tee "${regFile}" &> /dev/null
322 |     fi
323 |   fi
324 | }
325 | 
326 | function selectChannel() {
327 |   local i=0
328 |   while true; do
329 |     # list all possible channels
330 |     printf "${CYAN}SELECT A CHANNEL${OFF}\n"
331 |     for c in "${gChannels[@]}"; do
332 |       printf "[ ${GREEN}${i}${OFF} ] ${PURPLE}${c}${OFF}\n"
333 |       let i++
334 |     done
335 | 
336 |     local channelNum
337 |     read -p ">> " channelNum
338 |     # insane choice?!
339 |     if [[ -z "${channelNum}" || ! "${channelNum}" =~ ^[0-9]+$ || "${channelNum}" -lt 0 || "${channelNum}" -ge $i ]]; then
340 |       printf "${RED}Wrong choice!${OFF}\n\n"
341 |       # restore i to 0 for another traversal
342 |       i=0
343 |       continue
344 |     fi
345 | 
346 |     # update vars
347 |     gChannel="${gChannels[channelNum]}"
348 |     gCatalog="${gCatalogs[channelNum]}"
349 |     # ask for confirmation
350 |     printf "Your choice: [ ${GREEN}${channelNum}${OFF} ] ${PURPLE}${gChannel}${OFF}\n"
351 |     while true; do
352 |       local confirmChannel
353 |       read -p ">> CONFIRM? (Y/N) " confirmChannel
354 |       case "${confirmChannel}" in
355 |         "" )
356 |           printf 'Please do type Y if you are sure.\n'
357 |           continue
358 |         ;;
359 | 
360 |         y|Y )
361 |           # done, terminate the function
362 |           return
363 |         ;;
364 | 
365 |         n|N )
366 |           printf 'goodbye\n'
367 |           exit 0
368 |         ;;
369 | 
370 |         * )
371 |           printf 'Try again...\n\n'
372 |           # restore i to 0 for another traversal
373 |           i=0
374 |           # go to the last loop
375 |           break
376 |         ;;
377 |       esac
378 |     done
379 |   done
380 | }
381 | 
382 | function getURLIndex() {
383 |   local str2Grep="${1}"
384 | 
385 |   echo "$(cat /tmp/update-catalogs | \
386 |           grep "${str2Grep}" | grep pkg | grep -v RecoveryHDUpdate | grep -v Patch | grep -v integrityData | \
387 |           sed 's/<string>//' | sed 's/<\/string>//' | \
388 |           awk '{print $1;}'  | sed 's/^.*downloads//')"
389 | }
390 | 
391 | function parseCatalog() {
392 |   selectChannel
393 | 
394 |   # show version
395 |   if [[ "${gChannel}" == "Beta" && ! -z "${gBetaVersion}" ]]; then
396 |     gVersion="${gBetaVersion}"
397 |   elif [[ "${gChannel}" == "Beta" && -z "${gBetaVersion}" ]]; then
398 |     printf "${RED}Warning:${OFF} using Beta channel but there is no release at the moment!\n"
399 |     printf "Redirecting to ${PURPLE}Normal Channel ${OFF}and using version ${GREEN}${gStableVersion}${OFF}.\n"
400 | 
401 |     # manually put normal channel and stable version here for redirection
402 |     gChannel="${gChannels[1]}"
403 |     gCatalog="${gCatalogs[1]}"
404 |     gVersion="${gStableVersion}"
405 | 
406 |     sleep 2
407 |   elif [[ "${gChannel}" != "Beta" ]]; then
408 |     gVersion="${gStableVersion}"
409 |   fi
410 | 
411 |   # check if it is fine to go with Delta
412 |   setPackageMode
413 | 
414 |   # download catalog
415 |   cd "${gTmpDirectory}"
416 |   [[ -f update-catalogs ]] && rm -f update-catalogs
417 |   downloadFile "${gCatalog}" "update-catalogs.gz" && gunzip update-catalogs.gz || exit 1
418 | 
419 |   # default value for Delta
420 |   local str2Grep="macOSUpd${gVersion}.pkg"
421 |   case "${gPackageMode}" in
422 |     'Combo' )
423 |       str2Grep="macOSUpdCombo${gVersion}"
424 |     ;;
425 | 
426 |     'DeltaSup' )
427 |       str2Grep="macOSUpd${gVersion}Supplemental"
428 |     ;;
429 |   esac
430 | 
431 |   # update vars
432 |   gUrlIndex="$(getURLIndex "${str2Grep}")"
433 | 
434 |   #
435 |   # When upgrading, for example,
436 |   # from 10.14.5 Beta  (18F131a)
437 |   # to   10.14.5 Final (18F132),
438 |   # gPackageMode would be set to DeltaSup, which is fine,
439 |   # yet supplemental update may not exist
440 |   # all the time, that is to say that gUrlIndex is null.
441 |   # We are going to be back to Delta in this case and check again.
442 |   #
443 |   local isBeta="$(isProductBeta)"
444 |   if [[ "${isBeta}" -eq 1               && \
445 |         "${gPackageMode}" == 'DeltaSup' && \
446 |         -z "${gUrlIndex}" ]]; then
447 |     printf 'You are on Beta and going to update to supplemental update,\nbut there is nothing at the moment!\nUpdating to the latest stable version via Delta.\n\n'
448 | 
449 |     gPackageMode='Delta'
450 | 
451 |     str2Grep="macOSUpd${gVersion}.pkg"
452 |     gUrlIndex="$(getURLIndex "${str2Grep}")"
453 |   fi
454 | 
455 |   if [[ "${gChannel}" == "Normal Channel" && \
456 |         -z "${gUrlIndex}"                 && \
457 |         "${gProductVersion}" == "${gStableVersion}" ]]; then
458 |     printf "You are already ${GREEN}up to date${OFF}!\n"
459 |     exit 0
460 |   fi
461 | 
462 |   [[ -z "${gUrlIndex}" ]] && printf "ERROR: ${RED}URL Index not found!${OFF}\n" && exit 1
463 |   gKeyNum="$(  echo ${gUrlIndex} | cut -d/ -f2,3)"
464 |   gKeyIndex="$(echo ${gUrlIndex} | cut -d/ -f4,4)"
465 |   gKeySalt="$( echo ${gUrlIndex} | cut -d/ -f5,5)"
466 |   gUrl="https://swdist.apple.com/content/downloads/${gKeyNum}/${gKeyIndex}/${gKeySalt}/"
467 |   gDist="${gKeyIndex}.English.dist"
468 | 
469 |   # create our working dir
470 |   gWorkDir="${gTmpDirectory}/${gKeyIndex}"
471 |   [[ ! -d "${gWorkDir}" ]] && mkdir "${gWorkDir}"
472 |   cd "${gWorkDir}"
473 |   # download dist
474 |   rm -f "${gDist}"
475 |   printf "Downloading: ${BLUE}${gDist}${OFF}...\n"
476 |   downloadFile "${gUrl}${gDist}" "${gDist}"
477 | 
478 |   # show build
479 |   local awkNR=0
480 |   [[ "${gChannel}" == "Beta" && ! -z "${gBetaVersion}" ]] && awkNR=13 || awkNR=12
481 |   build="$(cat ${gDist} | \
482 |            sed 's/<string>//' | sed 's/<\/string>//' | \
483 |            awk '{print $1;}'  | awk NR==${awkNR})"
484 | 
485 |   confirmDownload
486 | }
487 | 
488 | function confirmDownload() {
489 |   while true; do
490 |     printf "${RED}${gVersion} (${build})${OFF} will be downloaded, confirm? (y/n) "
491 |     local confirmVer
492 |     read -ea confirmVer
493 |     case "${confirmVer}" in
494 |       "" )
495 |         printf 'Please do type Y if you are sure.\n'
496 |         continue
497 |       ;;
498 | 
499 |       y|Y )
500 |         # done, terminate the function
501 |         return
502 |       ;;
503 | 
504 |       n|N )
505 |         rm -rf "${gWorkDir}"
506 |         printf 'goodbye\n'
507 |         exit 0
508 |       ;;
509 | 
510 |       * )
511 |         printf 'Try again...\n\n'
512 |         continue
513 |       ;;
514 |     esac
515 |   done
516 | }
517 | 
518 | function downloadPackage() {
519 |   # now we are inside "${gWorkDir}" thanks to the prior parseCatalog()
520 | 
521 |   # packages to be downloaded
522 |   if [[ "${gPackageMode}" == 'Combo' ]]; then
523 |     # Looks like only 10.14.4 has Auto suffixed and others do not.
524 |     # TODO: find when Auto exists and when not.
525 |     if [[ "${gVersion}" == '10.14.4' ]]; then
526 |       local targetFiles=(
527 |         "macOSUpdCombo${gVersion}Auto.pkg"
528 |         "macOSUpdCombo${gVersion}Auto.RecoveryHDUpdate.pkg"
529 |         "macOSBrain.pkg"
530 |         "SecureBoot.pkg"
531 |         "EmbeddedOSFirmware.pkg"
532 |         "FirmwareUpdate.pkg"
533 |         "FullBundleUpdate.pkg"
534 |       )
535 |     else
536 |       local targetFiles=(
537 |         "macOSUpdCombo${gVersion}.pkg"
538 |         "macOSUpdCombo${gVersion}.RecoveryHDUpdate.pkg"
539 |         "macOSBrain.pkg"
540 |         "SecureBoot.pkg"
541 |         "EmbeddedOSFirmware.pkg"
542 |         "FirmwareUpdate.pkg"
543 |         "FullBundleUpdate.pkg"
544 |       )
545 |     fi
546 |   elif [[ "${gPackageMode}" == 'DeltaSup' ]]; then
547 |     local targetFiles=(
548 |       "macOSUpd${gVersion}Supplemental.pkg"
549 |       "macOSUpd${gVersion}Supplemental.RecoveryHDUpdate.pkg"
550 |       "macOSBrain.pkg"
551 |       "SecureBoot.pkg"
552 |       "EmbeddedOSFirmware.pkg"
553 |       "FirmwareUpdate.pkg"
554 |       "FullBundleUpdate.pkg"
555 |     )
556 |   else
557 |     local targetFiles=(
558 |       "macOSUpd${gVersion}.pkg"
559 |       "macOSUpd${gVersion}.RecoveryHDUpdate.pkg"
560 |       "macOSBrain.pkg"
561 |       "SecureBoot.pkg"
562 |       "EmbeddedOSFirmware.pkg"
563 |       "FirmwareUpdate.pkg"
564 |       "FullBundleUpdate.pkg"
565 |     )
566 |   fi
567 | 
568 |   # download them
569 |   clear
570 |   for filename in "${targetFiles[@]}"; do
571 |     if [[ ! -e "${filename}" ]]; then
572 |       printf "Downloading: ${BLUE}${filename}${OFF}...\n"
573 |       downloadFile "${gUrl}${filename}" "${filename}"
574 |     elif [[ -z "$(pkgutil --check-signature ${filename} | grep -i 'signed Apple Software')" ]]; then
575 |       printf "File: ${filename} is ${RED}CORRUPTED${OFF}, redownloading...\n"
576 |       rm -rf "${filename}"
577 |       downloadFile "${gUrl}${filename}" "${filename}"
578 |     else
579 |       printf "File: ${GREEN}${filename}${OFF} is already there, ${DARK_YELLOW}skipping download.${OFF}\n"
580 |     fi
581 | 
582 |     STY_LINE
583 |   done
584 | }
585 | 
586 | function selectDestination() {
587 |   cd /Volumes
588 | 
589 |   local i=0
590 |   local targetVolumes=(*)
591 | 
592 |   while true; do
593 |     printf "${CYAN}SELECT A DESTINATION${OFF}\n"
594 |     for vol in "${targetVolumes[@]}"; do
595 |       printf "[ ${GREEN}${i}${OFF} ] ${CYAN}${vol}${OFF}\n"
596 |       let i++
597 |     done
598 | 
599 |     # ask to select a target volume
600 |     local volNum
601 |     read -p ">> " volNum
602 |     # insane choice?!
603 |     if [[ -z "${volNum}" || ! "${volNum}" =~ ^[0-9]+$ || "${volNum}" -lt 0 || "${volNum}" -ge $i ]]; then
604 |       printf "${RED}Wrong choice!${OFF}\n\n"
605 |       # restore i to 0 for another traversal
606 |       i=0
607 |       continue
608 |     fi
609 | 
610 |     local volume="${targetVolumes[volNum]}"
611 |     gVolume="/Volumes/${volume}"
612 |     printf "Your choice: [ ${GREEN}${volNum}${OFF} ] ${CYAN}${volume}${OFF}\n"
613 |     while true; do
614 |       local confirmVol
615 |       read -p ">> CONFIRM? (y/n) " confirmVol
616 |       case "${confirmVol}" in
617 |         "" )
618 |           printf 'Please do type Y if you are sure.\n'
619 |           continue
620 |         ;;
621 | 
622 |         y|Y )
623 |           # done, terminate the function
624 |           return
625 |         ;;
626 | 
627 |         * )
628 |           printf 'Try again...\n\n'
629 |           # restore i to 0 for another traversal
630 |           i=0
631 |           # go to the last loop
632 |           break
633 |         ;;
634 |       esac
635 |     done
636 |   done
637 | 
638 |   # create the enrollment plist
639 |   local seedEnrollmentPlist="${vol}/Users/Shared/.SeedEnrollment.plist"
640 |   # write enrollement plist when missing (seed program options: CustomerSeed, DeveloperSeed)
641 |   if [[ ! -f "${seedEnrollmentPlist}" ]]; then
642 |     echo '<?xml version="1.0" encoding="UTF-8"?>'                                                                  >  "${seedEnrollmentPlist}"
643 |     echo '<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >> "${seedEnrollmentPlist}"
644 |     echo '<plist version="1.0">'                                                                                   >> "${seedEnrollmentPlist}"
645 |     echo '  <dict>'                                                                                                >> "${seedEnrollmentPlist}"
646 |     echo '    <key>SeedProgram</key>'                                                                              >> "${seedEnrollmentPlist}"
647 |     if [[ "${gChannel}" == "Beta" ]]; then
648 |       echo '    <string>DeveloperSeed</string>'                                                                    >> "${seedEnrollmentPlist}"
649 |     else
650 |       echo '    <string>CustomerSeed</string>'                                                                     >> "${seedEnrollmentPlist}"
651 |     fi
652 |     echo '  </dict>'                                                                                               >> "${seedEnrollmentPlist}"
653 |     echo '</plist>'                                                                                                >> "${seedEnrollmentPlist}"
654 |   fi
655 | }
656 | 
657 | function updateRecovery() {
658 |   printf "${CYAN}UPDATING RECOVERY${OFF}\n"
659 | 
660 |   cd "${gTmpDirectory}"
661 |   rm -rf "updRec" && mkdir "updRec" && cd "updRec"
662 | 
663 |   # download dm for updating Recovery
664 |   curl -O "https://raw.githubusercontent.com/Gengik84/MacOS_Updater/master/dm" && chmod +x dm || exit 1
665 |   local dmBin="${gTmpDirectory}/updRec/dm"
666 | 
667 |   if [[ "${gPackageMode}" == 'Combo' ]]; then
668 |     # Looks like only 10.14.4 has Auto suffixed and others do not.
669 |     # TODO: find when Auto exists and when not.
670 |     if [[ "${gVersion}" == '10.14.4' ]]; then
671 |       local recPkg="${gWorkDir}/macOSUpdCombo${gVersion}Auto.RecoveryHDUpdate.pkg"
672 |     else
673 |       local recPkg="${gWorkDir}/macOSUpdCombo${gVersion}.RecoveryHDUpdate.pkg"
674 |     fi
675 |   elif [[ "${gPackageMode}" == 'DeltaSup' ]]; then
676 |     local recPkg="${gWorkDir}/macOSUpd${gVersion}Supplemental.RecoveryHDUpdate.pkg"
677 |   else
678 |     local recPkg="${gWorkDir}/macOSUpd${gVersion}.RecoveryHDUpdate.pkg"
679 |   fi
680 |   [[ ! -f "${recPkg}" ]] && printf "ERROR: ${RED}${recPkg} NOT found!${OFF}\n" && exit 1
681 | 
682 |   local tmpRecUpdDir="/tmp/RecoveryHDUpdate"
683 |   rm -rf "${tmpRecUpdDir}" && pkgutil --expand-full "${recPkg}" "${tmpRecUpdDir}"
684 |   local tmpDmg="${tmpRecUpdDir}/RecoveryHDMeta.dmg"
685 |   # attempt to create a temporary mount point
686 |   local tmpMountPoint="$(/usr/bin/mktemp -d)"
687 |   # mount tmpDmg there
688 |   /usr/bin/hdiutil attach -nobrowse "${tmpDmg}" -mountpoint "${tmpMountPoint}"
689 | 
690 |   # probe target volume
691 |   local fsType="$(diskutil info "${gVolume}" | awk '$1 == "Type" { print $NF }')"
692 |   # start updating
693 |   if [[ "${fsType}" == "apfs" ]]; then
694 |     "${dmBin}" ensureRecoveryBooter "${gVolume}" -base "${tmpMountPoint}/BaseSystem.dmg" "${tmpMountPoint}/BaseSystem.chunklist" -diag "${tmpMountPoint}/AppleDiagnostics.dmg" "${tmpMountPoint}/AppleDiagnostics.chunklist" -diagmachineblacklist 0 -installbootfromtarget 0 -slurpappleboot 0 -delappleboot 0 -addkernelcoredump 0
695 |   else
696 |     "${dmBin}" ensureRecoveryPartition "${gVolume}" "${tmpMountPoint}/BaseSystem.dmg" "${tmpMountPoint}/BaseSystem.chunklist" "${tmpMountPoint}/AppleDiagnostics.dmg" "${tmpMountPoint}/AppleDiagnostics.chunklist" 0 0 0
697 |   fi
698 | 
699 |   # done
700 |   /usr/bin/hdiutil eject "${tmpMountPoint}"
701 |   rm -rf "${tmpMountPoint}"
702 |   rm -rf "${tmpRecUpdDir}"
703 | }
704 | 
705 | function updatePrimarySystem() {
706 |   printf "${CYAN}UPDATING PRIMARY SYSTEM${OFF}\n"
707 | 
708 |   cd "${gWorkDir}"
709 | 
710 |   # remove these lines to avoid installer error
711 |   sed -e '/volume-check/d' "${gDist}"      > new1.txt
712 |   sed -e '/installation-check/d' new1.txt  > new2.txt
713 |   sed -e '/RecoveryHDUpdate/d'   new2.txt  > new3.txt
714 |   sed -e '/system-image/d'       new3.txt  > new4.txt
715 |   # remove macOS${gVersion}Patch.pkg since it will cause installation failure
716 |   sed -e '/Patch/d'              new4.txt  > new5.txt
717 |   cp new5.txt "${gDist}"
718 |   rm new?.txt
719 | 
720 |   # build pkg
721 |   productbuild --distribution "${gWorkDir}/${gDist}" --package-path "${gWorkDir}" "${gWorkDir}/${gInstallerPackage}"
722 | 
723 |   # perform the update by launching the installer
724 |   [[ -f "${gWorkDir}/${gInstallerPackage}" ]] && /usr/sbin/installer -pkg "${gWorkDir}/${gInstallerPackage}" -target "${gVolume}"
725 | }
726 | 
727 | function updateSystem() {
728 |   # update Recovery first
729 |   updateRecovery
730 |   # then primary system
731 |   updatePrimarySystem
732 | }
733 | 
734 | function ask4Backup() {
735 |   local confirmBackup
736 |   read -p "Do you want to backup installer.pkg? (y/N) " confirmBackup
737 |   case "${confirmBackup}" in
738 |     y|Y )
739 |       printf "${CYAN}BACKING UP${OFF}\n"
740 |       hdiutil create -format UDZO -srcfolder "${gWorkDir}/${gInstallerPackage}" "${gUserPath}/Installer_${gVersion}_${build}"
741 |     ;;
742 |   esac
743 | }
744 | 
745 | function endProgram() {
746 |   printf "${CYAN}CLEANING UP${OFF}\n"
747 | 
748 |   rm -rf "${gWorkDir}"
749 |   rm -rf "${gTmpDirectory}/update-catalogs"
750 |   rm -rf "${gTmpDirectory}/updRec"
751 | 
752 |   STY_LINE
753 |   printf "${GREEN}RESTART REQUIRED${OFF}\n"
754 |   local confirmReboot
755 |   read -p "Do you want to reboot now? (y/N) " confirmReboot
756 |   case "${confirmReboot}" in
757 |     y|Y )
758 |       reboot
759 |     ;;
760 |   esac
761 | 
762 |   printf "${RED}ALL DONE${OFF}\nPlease reboot manually.\n"
763 | }
764 | 
765 | function main() {
766 |   updateScript "$@"
767 | 
768 |   # try to register the script
769 |   registerScript
770 | 
771 |   # direct update from a pre-built pkg
772 |   case "$1" in
773 |     -i|--installer )
774 |       selectDestination
775 |       local installerPKG
776 |       read -p "Drag installer.pkg on terminal windows: " installerPKG
777 |       [[ ! -f "${installerPKG}" ]] && echo "${installerPKG} not found!" && exit 1
778 |       printf "${CYAN}UPDATING PRIMARY SYSTEM${OFF}\n"
779 |       /usr/sbin/installer -pkg "${installerPKG}" -target "${gVolume}"
780 | 
781 |       endProgram
782 |       # done
783 |       exit 0
784 |     ;;
785 |   esac
786 | 
787 |   parseCatalog
788 |   downloadPackage
789 | 
790 |   selectDestination
791 |   updateSystem
792 | 
793 |   ask4Backup
794 | 
795 |   endProgram
796 | }
797 | 
798 | clear
799 | 
800 | if [[ $EUID -ne 0 ]]; then
801 |   echo "$(basename "$0") must be run as ROOT!"
802 |   sudo "$0" "$@"
803 | else
804 |   main "$@"
805 | fi
806 | 


--------------------------------------------------------------------------------
/Tools/PPTP/PPTP.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/PPTP/PPTP.zip


--------------------------------------------------------------------------------
/Tools/PPTP/pptp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/PPTP/pptp


--------------------------------------------------------------------------------
/Tools/PPTP_for_Catalina.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | # 版本判断
 3 | base_ver=15
 4 | ver=$(sw_vers | grep ProductVersion | awk '{print $2}' | cut -d'.' -f2)
 5 | if [ $ver == "$base_ver" ]
 6 | then 
 7 |    echo "可以安装,请确保禁用System Intregrity Protection,请输入用户密码以挂载系统分区"
 8 |    say "可以安装,请确保禁用System Intregrity Protection,请输入用户密码以挂载系统分区"
 9 |    sudo mount -o rw /   # 挂载系统分区
10 |    sudo rm -rf /tmp/__MACOSX && sudo rm -rf /tmp/PPTP*
11 |    cd /System/Library/Extensions
12 |    sudo mv PPP.kext PPP.kext.orig   # 备份PPP.kext
13 |    echo "正在安装PPTP驱动及相关服务" && say "正在安装PPTP驱动及相关服务"
14 |    curl -fsSL https://raw.githubusercontent.com/daliansky/Hackintosh/master/Tools/PPTP/PPTP.zip -o /tmp/PPTP.zip && cd /tmp && unzip -oq PPTP.zip
15 |    sudo cp -R /tmp/PPTP/PPP.kext /System/Library/Extensions
16 |    sudo cp -R /tmp/PPTP/PPTP.ppp /System/Library/Extensions
17 |     [ -d /usr/local/bin ] && echo "/usr/local/bin目录已存在" && say "目录已存在" || sudo mkdir /usr/local/bin && sudo chown $(whoami) /usr/local/bin
18 |    sudo cp /tmp/PPTP/pptp /usr/local/bin
19 |    sudo chown -R $(whoami) /usr/local/bin/pptp
20 |    chmod 755 /usr/local/bin/pptp
21 |    echo "正在重建缓存..." && say "正在重建缓存"
22 |    sudo kextcache -i /
23 |    cd ~
24 |    echo "安装完成,请重启系统,并请安装Shimo Version 4.1.5.1 (8837)以启用PPTP客户端" && say "安装完成,请重启系统,并请安装Shimo Version 4.1.5.1 (8837)以启用PPTP客户端"
25 | 
26 | else 
27 |    echo "别闹,你的系统不满足安装条件" && say "别闹,你的系统不满足安装条件"
28 | fi
29 | 


--------------------------------------------------------------------------------
/Tools/README.md:
--------------------------------------------------------------------------------
  1 | # 常用工具
  2 | 
  3 | ## 一键提取 BCM94360Z4网卡信息
  4 | 
  5 | ```bash
  6 | sh -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/daliansky/Hackintosh/Tools/BCM94360Z4)"
  7 | ```
  8 | 
  9 | 输出结果如下:
 10 | 
 11 | 
 12 | 
 13 | ## 一键安装`Catalina`下缺失的`PPTP`驱动及相关文件,以使用`PPTP client for Catalina`
 14 | 
 15 | ```bash
 16 | sh -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/daliansky/Hackintosh/Tools/PPTP_for_Catalina.sh)"
 17 | ```
 18 | 
 19 | 
 20 | 
 21 | ## 一条命令显示机型和主板
 22 | 
 23 | 打开终端,输入命令:
 24 | 
 25 | ```bash
 26 | curl -fsSL https://cdn.jsdelivr.net/gh/daliansky/Hackintosh/Tools/bdmesg -o /tmp/bdmesg && chmod +x /tmp/bdmesg && sh -c /tmp/bdmesg | grep Running
 27 | ```
 28 | 
 29 | 输出如下:
 30 | 
 31 | ```bash
 32 | 0:100  0:000  Running on: 'Inspiron 7560' with board '07T996'
 33 | ```
 34 | 
 35 | 或者:显示更多的信息:
 36 | 
 37 | ```bash
 38 | sh -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/daliansky/Hackintosh/Tools/archey)"
 39 | ```
 40 | 
 41 | 输出效果见上图
 42 | 
 43 | ## 一条命令解决时间不同步问题:
 44 | 
 45 | > 两种方法,选项其中一个即可。
 46 | 
 47 | ### Windows下操作:
 48 | 
 49 | `Win+x`选择管理员模式进入`CMD`
 50 | 执行以下命令:
 51 | 
 52 | ```bash
 53 | Reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_DWORD /d 1
 54 | ```
 55 | 
 56 | ### macOS下操作:
 57 | 
 58 | 打开终端,输入命令:
 59 | 
 60 | ```bash
 61 | sudo sh -c "$(curl -kfsSL https://cdn.jsdelivr.net/gh/daliansky/LocalTime-Toggle/fix_time_osx.sh)"
 62 | ```
 63 | 
 64 | 备注:不适用于`Big Sur`系统
 65 | 
 66 | ## 微信小助手
 67 | 
 68 | 打开终端,输入命令:
 69 | 
 70 | ```bash
 71 | curl -o- -L https://cdn.jsdelivr.net/gh/lmk123/oh-my-wechat/install.sh | bash -s
 72 | ```
 73 | 
 74 | ## 微信助手
 75 | 
 76 | 打开终端,输入命令:
 77 | 
 78 | ```bash
 79 | cd ~/Downloads && rm -rf MacWeChatPlugin && git clone https://github.com/cuiyu8580/MacWeChatPlugin.git --depth=1 && ./MacWeChatPlugin/Other/Install.sh
 80 | ```
 81 | 
 82 | 
 83 | >>>>>>> Stashed changes
 84 | ## 一条命令显示USB数量
 85 | 
 86 | 打开终端,输入命令:
 87 | 
 88 | ```bash
 89 | sh -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/daliansky/Hackintosh/Tools/usb_Ports)"
 90 | ```
 91 | 
 92 | 输出如下:
 93 | 
 94 | ```bash
 95 | +--XHC@14IOPCIDevice
 96 | |+--XHC@14000000
 97 | |+--HS01@14100000
 98 | |+--HS02@14200000
 99 | |+--HS03@14300000
100 | |+--HS04@14400000
101 | |+--HS05@14500000
102 | ||+--Integrated_Webcam_HD@14500000
103 | |+--HS06@14600000
104 | ||+--USB2.0-CRW@14600000
105 | |+--HS07@14700000
106 | |+--HS08@14800000
107 | ||+--BCM20702A0@14800000
108 | |+--HS09@14900000
109 | |+--HS10@14a00000
110 | |+--USR1@14b00000
111 | |+--USR2@14c00000
112 | |+--SS01@14d00000
113 | |+--SS02@14e00000
114 | |+--SS03@14f00000
115 | +--pci80869d31@142IOPCIDevice
116 | +--AppleUSBXHCI@14000000AppleUSBController
117 | +--AppleUSBXHCIHub
118 | +--USB2.0-CRW@14600000AppleUSBDevice
119 | +--Integrated_Webcam_HD@14500000AppleUSBDevice
120 | +--BCM20702A0@14800000AppleUSBDevice
121 | ```
122 | 
123 | ## 一键截屏,方法来自[绿帽兄](https://github.com/lihaoyun6)
124 | 
125 | 打开终端,输入命令:
126 | 
127 | ```bash
128 | [[ ! -x "/tmp/msss" ]] && (curl -fsSL -o /tmp/msss https://cdn.jsdelivr.net/gh/daliansky/Hackintosh/Tools/msss && chmod a+x /tmp/msss && open $(/tmp/msss -v)) || open $(/tmp/msss -v)
129 | ```
130 | 
131 | 也可以下载到本地执行:
132 | 
133 | ```bash
134 | $ msss -h   帮助信息
135 | $ msss -v   回显存储的截屏文件名,配合使用`open`直接显:`open $(msss -v)`
136 | $ msss -d 0 就是截取所有显示器并自动拼接
137 | $ msss -d 1 就是截取1号主显示器
138 | $ msss -d 2 就是截取第二台显示器
139 | $ msss -f 手动指定截图文件名和保存路径,比如:`msss -f ~/Desktop/111.png` 将截屏保存到桌面上
140 | ```
141 | 
142 | ## 一键变频脚本自动生成`CPUFriend.kext`
143 | 
144 | - 使用前请先阅读[CPUFriend - WARNING](https://github.com/acidanthera/CPUFriend/blob/master/Instructions.md#warning)
145 | - 在终端输入以下命令并回车:
146 | 
147 | ```bash
148 | bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/stevezhengshiqi/one-key-cpufriend/one-key-cpufriend.sh)"
149 | ```
150 | 
151 | - 把桌面上的 `CPUFriend.kext` 和 `CPUFriendDataProvider.kext` 复制进 `/CLOVER/kexts/Other/` 并重启。
152 | 
153 | 详细说明请[移步](https://github.com/stevezhengshiqi/one-key-cpufriend/blob/master/README_CN.md)
154 | 
155 | ## 提高github/gitalk访问速度
156 | 
157 | 打开终端,输入命令:
158 | 
159 | ```bash
160 | cat /etc/hosts
161 | # github.com
162 | 192.30.253.113	github.com
163 | 192.30.253.112	github.com
164 | 192.30.255.117	api.github.com
165 | 192.30.255.116	api.github.com
166 | #151.101.184.133 raw.githubusercontent.com
167 | 
168 | 192.30.253.119 gist.github.com
169 | 151.101.184.133 assets-cdn.github.com
170 | 151.101.184.133 raw.githubusercontent.com
171 | 151.101.184.133 gist.githubusercontent.com
172 | 151.101.184.133 cloud.githubusercontent.com
173 | 151.101.184.133 camo.githubusercontent.com
174 | 151.101.184.133 avatars0.githubusercontent.com
175 | 151.101.184.133 avatars1.githubusercontent.com
176 | 151.101.184.133 avatars2.githubusercontent.com
177 | 151.101.184.133 avatars3.githubusercontent.com
178 | 151.101.184.133 avatars4.githubusercontent.com
179 | 151.101.184.133 avatars5.githubusercontent.com
180 | 151.101.184.133 avatars6.githubusercontent.com
181 | 151.101.184.133 avatars7.githubusercontent.com
182 | 151.101.184.133 avatars8.githubusercontent.com
183 | ```
184 | 
185 | ## 运用iasl编译dsl文件
186 | 
187 | ### 使用RehabMan的iasl62(ACPI标准6.2)
188 | 
189 | 打开终端,输入命令:
190 | 
191 | ```bash
192 | curl -fsSL https://cdn.jsdelivr.net/gh/daliansky/Hackintosh/Tools/iasl-RM -o /tmp/iasl-RM && chmod +x /tmp/iasl-RM && sh -c /tmp/iasl-RM -l <dsl文件路径>
193 | ```
194 | 
195 | ### 使用ACPICA的iasl63(ACPI标准6.3)
196 | 
197 | 打开终端,输入命令:
198 | 
199 | ```bash
200 | curl -fsSL https://cdn.jsdelivr.net/gh/daliansky/Hackintosh/Tools/iasl63 -o /tmp/iasl63 && chmod +x /tmp/iasl63 && sh -c /tmp/iasl63 -l <dsl文件路径>
201 | ```
202 | 
203 | ## 一键提取DW1820A所需的信息:
204 | 
205 | ```bash
206 | sh -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/daliansky/Hackintosh/Tools/DW1820A)"
207 | ```
208 | 
209 | 输出结果如下:
210 | 
211 | ![DW1820A驱动信息](http://7.daliansky.net/DW1820A/DW1820A_Bug_Report.png)
212 | 
213 | ## 一键提取`macOS 三码`
214 | 
215 | ```bash
216 | sh -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/daliansky/Hackintosh/Tools/sn.sh)"
217 | ```
218 | 
219 | 输出结果如下:
220 | 
221 | ```bash
222 | SystemProductName: MacPro7,1
223 | SystemUUID: AF9CB0AC-DE74-4BE8-A59C-8BA4639D0BDD
224 | SystemSerialNumber: F5KGD7Y5P7QM
225 | Valid: Unlikely
226 | ROM: FCFFFF28FCFF
227 | MLB: F5K137404J9K3F7CB
228 | ```
229 | 
230 | 
231 | 
232 | ## 一条命令提取`EDID`
233 | 
234 | ```bash
235 | ioreg -lw0 | grep -i "IODisplayEDID" | sed -e 's/.*<//' -e 's/>//'
236 | 
237 | ```
238 | 
239 | 显示结果:
240 | 
241 | ```xml
242 | 00ffffffffffff000e6f6d0700000000141d0104a51d1278e2ee95a3544c99260f505400000001010101010101010101010101010101ec6800a0a0402e60302036001eb31000001a000000000000000000000000000000000000000000fe0043534f542054330a2020202020000000fe004d4e443330374441312d320a200048
243 | ```
244 | 
245 | 将`EDID`值复制进`config.plist`里


--------------------------------------------------------------------------------
/Tools/RunMe系统信息收集.app.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/RunMe系统信息收集.app.zip


--------------------------------------------------------------------------------
/Tools/Screenshot/BCM94360Z4_Check.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/Screenshot/BCM94360Z4_Check.png


--------------------------------------------------------------------------------
/Tools/Screenshot/WebdriverDownload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/Screenshot/WebdriverDownload.png


--------------------------------------------------------------------------------
/Tools/Screenshot/archey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/Screenshot/archey.png


--------------------------------------------------------------------------------
/Tools/Screenshot/webdriver.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/Screenshot/webdriver.png


--------------------------------------------------------------------------------
/Tools/VDADecoderChecker:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/VDADecoderChecker


--------------------------------------------------------------------------------
/Tools/WebDD.command:
--------------------------------------------------------------------------------
  1 | #!/bin/bash
  2 | #WebDD v1.7
  3 | r="\\033[31;1m"
  4 | g="\\033[32;1m"
  5 | b="\033[36m"
  6 | k="\033[30m"
  7 | d="\\033[0m"
  8 | rm -rf /tmp/expanded.pkg 2>/dev/null
  9 | rm -rf /tmp/WebDriver-"$download_version".pkg 2>/dev/null
 10 | rm -rf /tmp/nvtmp 2>/dev/null
 11 | echo > /tmp/gputmp
 12 | echo > /tmp/gpuvid
 13 | mkdir -p /tmp/nvtmp
 14 | cd /tmp/nvtmp
 15 | webdd()
 16 | {
 17 | 	if [ ! -n "$1" ];then
 18 | 		bver=$(sw_vers -buildVersion)
 19 | 		pver=$(sw_vers -productVersion)
 20 | 		pname=$(sw_vers -productName)
 21 | 		text="当前"
 22 | 		else
 23 | 			bver=$1
 24 | 			pver=$(cat /tmp/sysver|grep "$1"|grep -Eo '[0-9]+\.[0-9]+\.[0-9+]')
 25 | 			pname="Mac OS X"
 26 | 			text="选择"
 27 | 			fi
 28 | index=0
 29 | echo -ne "正在查找合适的驱动版本...\r"
 30 | curl -s "https://gfe.nvidia.com/mac-update" > /tmp/mac-update.plist
 31 | 	if [[ $(test -f /tmp/mac-update.plist && echo 1) ]]
 32 | 	then
 33 | 		while [[ $(/usr/libexec/PlistBuddy -c "Print :updates:"$index":OS" /tmp/mac-update.plist 2>/dev/null && echo 1) ]];
 34 | 		do
 35 | 			if [[ $(/usr/libexec/PlistBuddy -c "Print :updates:"$index":OS" /tmp/mac-update.plist) == "$bver" ]]
 36 | 			then
 37 | 				download_url=$(/usr/libexec/PlistBuddy -c "Print :updates:"$index":downloadURL" /tmp/mac-update.plist)
 38 | 				download_version=$(/usr/libexec/PlistBuddy -c "Print :updates:"$index":version" /tmp/mac-update.plist)
 39 | 				break
 40 | 			else
 41 | 				let index++
 42 | 			fi
 43 | 		done
 44 | 	fi
 45 | if [[ "$download_version" == "" ]] || [[ "$download_url" == "" ]]
 46 | 	then
 47 | 		index=0
 48 | 		curl -s "https://raw.githubusercontent.com/lihaoyun6/web/master/mac-update.plist" > /tmp/mac-update.plist
 49 | 		if [[ $(test -f /tmp/mac-update.plist && echo 1) ]]
 50 | 		then
 51 | 			while [[ $(/usr/libexec/PlistBuddy -c "Print :updates:"$index":OS" /tmp/mac-update.plist 2>/dev/null && echo 1) ]];
 52 | 			do
 53 | 				if [[ $(/usr/libexec/PlistBuddy -c "Print :updates:"$index":OS" /tmp/mac-update.plist) == "$bver" ]]
 54 | 				then
 55 | 					download_url=$(/usr/libexec/PlistBuddy -c "Print :updates:"$index":downloadURL" /tmp/mac-update.plist)
 56 | 					download_version=$(/usr/libexec/PlistBuddy -c "Print :updates:"$index":version" /tmp/mac-update.plist)
 57 | 					break
 58 | 				else
 59 | 					let index++
 60 | 				fi
 61 | 			done
 62 | 		fi
 63 | 		if [[ "$download_version" == "" ]] || [[ "$download_url" == "" ]]
 64 | 		then
 65 | 		echo "未能从NVIDIA官方服务器中找到适用于 $(echo $pname|tr -d '\n') $(echo $pver|tr -d '\n') $(echo $bver|tr -d '\n') 系统的WebDriver."
 66 | 		echo -ne '是否手动选择版本 [y/n]'
 67 | 		read custom
 68 | 		case $custom in
 69 | 			[yY])
 70 | 			read -p "请输入系统版本(例如10.13.6):" ver
 71 | 			curl "https://raw.githubusercontent.com/lihaoyun6/macOS-Build-Numbers/master/bv2pv" 2>/dev/null|tee /tmp/sysver|grep -i "$ver" > /tmp/webddtmp
 72 | 			printlist /tmp/webddtmp 'sed s/\.0//g' "chosefromlist \$num \$filepath \"grep -Eo [0-9]{1,2}[A-Z].*\" \"webdd \\\$info\" \"webdd \\\$info\" \"\n请选择您要下载驱动的系统版本: \" \"${r}\a请选择正确的序号:$d\"" "根据您搜索的关键词,共找到 $g" "$d 个系统版本$r"
 73 | 			;;
 74 | 			[nN])  exit
 75 | 			;;
 76 | 			*)  echo '输入y继续,输入n退出,请输入正确的选项'
 77 | 			;;
 78 | 			esac
 79 | 		exit
 80 | 		fi
 81 | fi
 82 | echo -e "您"$text"的系统版本为: "$g"$(echo $pname|tr -d '\n') $(echo $pver|tr -d '\n') $(echo $bver|tr -d '\n')"$d
 83 | echo -e "已找到适用于当前系统版本的: "$g"NVIDIA WebDriver-$download_version"$d
 84 | echo -ne '是否立即下载此版本 WebDriver [y/n]'
 85 | read yn1
 86 | case $yn1 in
 87 | 	[yY])
 88 | 	echo "正在下载 WebDriver..."
 89 | 	curl -# -k -o /tmp/WebDriver-"$download_version".pkg $download_url
 90 | 	clear
 91 | 	echo -n "下载完成,是否需要去除安装限制 [y/n]"
 92 | 	read yn2
 93 | 	case $yn2 in
 94 | 		[yY])  clear
 95 | 		echo "正在移除安装限制..."
 96 | 		pkgutil --expand /tmp/WebDriver-"$download_version".pkg /tmp/expanded.pkg
 97 | 		sed -i '' -E "s/if \(\!validateHardware\(\)\) return false;/\/\/if \(\!validateHardware\(\)\) return false;/g" /tmp/expanded.pkg/Distribution
 98 | 		sed -i '' -E "s/if \(\!validateSoftware\(\)\) return false;/\/\/if \(\!validateSoftware\(\)\) return false;/g" /tmp/expanded.pkg/Distribution
 99 | 		sed -i "" '/installation-check/d' /tmp/expanded.pkg/Distribution
100 | 		echo -n "是否需要强制匹配当前系统版本 [y/n]"
101 | 		read yn3
102 | 		case $yn3 in
103 | 			[yY])  clear
104 | 			echo "正在修改匹配信息..."
105 | 			cat /tmp/expanded.pkg/*NVWebDrivers.pkg/Payload|gunzip -dc|cpio -i --quiet
106 | 			/usr/libexec/PlistBuddy -c "Set IOKitPersonalities:NVDAStartup:NVDARequiredOS $(sw_vers -buildVersion)" $(find /tmp/nvtmp -type d -name NVDAStartupWeb.kext)/Contents/Info.plist
107 | 			find .|cpio -o --quiet|gzip -c > /tmp/expanded.pkg/*NVWebDrivers.pkg/Payload
108 | 			mkbom . /tmp/expanded.pkg/*NVWebDrivers.pkg/Bom
109 | 			clear
110 | 			echo "已强制匹配此版 WebDriver 版本信息。"
111 | 			;;
112 | 			[nN])  :
113 | 			;;
114 | 			*)  echo '输入y继续,输入n退出,请输入正确的选项'
115 | 			;;
116 | 		esac
117 | 		pkgutil --flatten /tmp/expanded.pkg ~/Desktop/WebDriver-"$download_version"-Unoffical.pkg
118 | 		rm -rf /tmp/expanded.pkg
119 | 		rm -rf /tmp/WebDriver-"$download_version".pkg
120 | 		rm -rf /tmp/nvtmp
121 | 		clear
122 | 		echo "已将修改后的 WebDiver 复制到桌面。"
123 | 		;;
124 | 		[nN])  cp /tmp/WebDriver-"$download_version".pkg ~/Desktop/WebDriver-"$download_version"-Offical.pkg
125 | 		rm -rf /tmp/WebDriver-"$download_version".pkg
126 | 		clear
127 | 		echo "已将未修改的官方版 WebDriver 复制到桌面。"
128 | 		;;
129 | 		*)  echo '输入y继续,输入n退出,请输入正确的选项'
130 | 		;;
131 | 	esac
132 | 	;;
133 | 	[nN])  exit
134 | 	;;
135 | 	*)  echo '输入y继续,输入n退出,请输入正确的选项'
136 | 	;;
137 | esac
138 | }
139 | gpulist()
140 | {
141 | 	echo > /tmp/gputmp
142 | 	nngpu="$(ioreg -n GFX0@0|sed -E '/{/,/\| }$/!d'|grep \"device-id\"|sed 's/.*\<\(.*\)\>.*/\1/'|sed -E 's/^(.{2})(.{2}).*$/\2\1/'|wc -l|awk '{print $1}')"
143 | 	if [ "$nngpu" -lt 1 ]
144 | 	then
145 | 		n=0
146 | 	else
147 | 		n=0
148 | 	while [ x"$ngpu" != x0 ]
149 | 	do
150 | 		eval dgpu_device_id="$(ioreg -n GFX$n@0|sed -E '/{/,/\| }$/!d'|grep \"device-id\"|sed 's/.*\<\(.*\)\>.*/\1/'|sed -E 's/^(.{2})(.{2}).*$/\2\1/')"
151 | 		eval dgpu_vendor_id="$(ioreg -n GFX$n@0|sed -E '/{/,/\| }$/!d'|grep \"vendor-id\"|sed 's/.*\<\(.*\)\>.*/\1/'|sed -E 's/^(.{2})(.{2}).*$/\2\1/')"
152 | 		echo $dgpu_vendor_id >> /tmp/gpuvid
153 | 		dgpu_names=$(curl -s "http://pci-ids.ucw.cz/read/PC/"$dgpu_vendor_id
quot;/"$dgpu_device_id|grep itemname|sed -E "s/.*Name\: (.*)$/\1/")
154 | 		echo "$dgpu_names"|tail -1|sed 's/ /_/g' >> /tmp/gputmp
155 | 		let n++
156 | 		eval ngpu="$(ioreg -n GFX$n@0|sed -E '/{/,/\| }$/!d'|grep \"device-id\"|sed 's/.*\<\(.*\)\>.*/\1/'|sed -E 's/^(.{2})(.{2}).*$/\2\1/'|wc -l|awk '{print $1}')"
157 | 	done
158 | 	fi
159 | 	if [ $n = 0 ];then
160 | 		gpu2n="$(system_profiler SPDisplaysDataType|grep "0x10de" -A 1|grep -Eo "0x[^)]*"|sed 's/0x//g'|grep -v "10de"|wc -l|awk '{print $1}')"
161 | 		if [ $gpu2n = 0 ];then
162 | 			gpu2a="$(system_profiler SPDisplaysDataType|grep "0x1002" -A 1|grep -Eo "0x[^)]*"|sed 's/0x//g'|grep -v "1002"|wc -l|awk '{print $1}')"
163 | 			if [ $gpu2a = 0 ];then
164 | 				n2=0
165 | 				else
166 | 					n2=0
167 | 					for i in $(system_profiler SPDisplaysDataType|grep "0x1002" -A 1|grep -Eo "0x[^)]*"|sed 's/0x//g'|grep -v "1002")
168 | 					do
169 | 						gpu_names2a=$(curl -s "http://pci-ids.ucw.cz/read/PC/1002/"$i|grep itemname|sed -E "s/.*Name\: (.*)$/\1/")
170 | 						echo "$gpu_names2a"|tail -1|sed 's/ /_/g' >> /tmp/gputmp
171 | 						echo 1002 >> /tmp/gpuvid
172 | 						let n2++
173 | 						done
174 | 						fi
175 | 						else
176 | 							n2=0
177 | 							for i in $(system_profiler SPDisplaysDataType|grep "0x10de" -A 1|grep -Eo "0x[^)]*"|sed 's/0x//g'|grep -v "10de")
178 | 							do
179 | 								gpu_names2n=$(curl -s "http://pci-ids.ucw.cz/read/PC/10de/"$i|grep itemname|sed -E "s/.*Name\: (.*)$/\1/")
180 | 								echo "$gpu_names2n"|tail -1|sed 's/ /_/g' >> /tmp/gputmp
181 | 								echo 10de >> /tmp/gpuvid
182 | 								let n2++
183 | 								done
184 | 								n3=0
185 | 								for i in $(system_profiler SPDisplaysDataType|grep "0x1002" -A 1|grep -Eo "0x[^)]*"|sed 's/0x//g'|grep -v "1002")
186 | 								do
187 | 									gpu_names2a=$(curl -s "http://pci-ids.ucw.cz/read/PC/1002/"$i|grep itemname|sed -E "s/.*Name\: (.*)$/\1/")
188 | 									echo "$gpu_names2a"|tail -1|sed 's/ /_/g' >> /tmp/gputmp
189 | 									echo 1002 >> /tmp/gpuvid
190 | 									let n3++
191 | 									done
192 | 								fi
193 | 								fi
194 | 	negpu="$(ioreg -n display@0|sed -E '/{/,/\| }$/!d'|grep \"device-id\"|sed 's/.*\<\(.*\)\>.*/\1/'|sed -E 's/^(.{2})(.{2}).*$/\2\1/'|wc -l|awk '{print $1}')"
195 | 	if [ "$negpu" -lt 1 ]
196 | 	then
197 | 		ne=0
198 | 	else
199 | 		ne=0
200 | 	while [ x"$egpu" != x0 ]
201 | 	do
202 | 		eval egpu_vendor_id="$(ioreg -n display@$ne|sed -E '/{/,/\| }$/!d'|grep \"vendor-id\"|sed 's/.*\<\(.*\)\>.*/\1/'|sed -E 's/^(.{2})(.{2}).*$/\2\1/')"
203 | 		eval egpu_device_id="$(ioreg -n display@$ne|sed -E '/{/,/\| }$/!d'|grep \"device-id\"|sed 's/.*\<\(.*\)\>.*/\1/'|sed -E 's/^(.{2})(.{2}).*$/\2\1/')"
204 | 		echo $dgpu_vendor_id >> /tmp/gpuvid
205 | 		egpu_names=$(curl -s "http://pci-ids.ucw.cz/read/PC/"$egpu_vendor_id
quot;/"$egpu_device_id|grep itemname|sed -E "s/.*Name\: (.*)$/\1/")
206 | 		echo "$egpu_names"|tail -1|sed 's/ /_/g' >> /tmp/gputmp
207 | 		let ne++
208 | 		eval egpu="$(ioreg -n display@$ne|sed -E '/{/,/\| }$/!d'|grep \"device-id\"|sed 's/.*\<\(.*\)\>.*/\1/'|sed -E 's/^(.{2})(.{2}).*$/\2\1/'|wc -l|awk '{print $1}')"
209 | 	done
210 | 	fi
211 | 	let n=n+ne+n2+n3
212 | }
213 | printlist()
214 | {
215 | filepath=$1
216 | optionsetting=$2
217 | endcommand=$3
218 | text1=$4
219 | text2=$5
220 | num=1
221 | echo -ne "$text1$(cat $filepath|grep -v '^
#39;|wc -l|awk '{print $1}')$text2\n\n"
222 | 	for i in $(cat $filepath)
223 | 	do
224 | 		echo -ne "["$num"] ";echo -ne "$i\n"|$optionsetting
225 | 		let num++
226 | 		done
227 | 		echo -ne "\\033[0m"
228 | 		eval $endcommand
229 | }
230 | chosefromlist()
231 | {
232 | options=$1
233 | filepath=$2
234 | optionsetting=$3
235 | command1gt=$4
236 | command1eq=$5
237 | ntext=$6
238 | wtext=$7
239 | 
240 | 	if [ "$options" -lt 2 ];then
241 | 		:
242 | 		elif [ "$options" -gt 2 ];then
243 | 			if [ x"$8" != x"warn" ];then
244 | 				text=$ntext
245 | 				else
246 | 					text=$wtext
247 | 					fi
248 | 					echo -ne $text
249 | 	read chose
250 | 	if [ ! -n "$chose" ];then
251 | 		chosefromlist "$options" "$filepath" "$optionsetting" "$command1gt" "$command1eq" "$ntext" "$wtext" warn
252 | 		elif [ $(echo $chose|sed 's/[0-9]//g'|wc -c) -ne 1 ];then
253 | 			chosefromlist "$options" "$filepath" "$optionsetting" "$command1gt" "$command1eq" "$ntext" "$wtext" warn
254 | 			elif [ "$chose" -gt "$options" ];then
255 | 				chosefromlist "$options" "$filepath" "$optionsetting" "$command1gt" "$command1eq" "$ntext" "$wtext" warn
256 | 				elif [ "$chose" -lt 1 ];then
257 | 					chosefromlist "$options" "$filepath" "$optionsetting" "$command1gt" "$command1eq" "$ntext" "$wtext" warn
258 | 				else
259 | 	line=$(cat $filepath|sed -n "${chose}p")
260 | 	info=$(echo $line|$optionsetting)
261 | 	echo -ne "\n["$chose"] "$info"\n\n"
262 | 	eval $command1gt
263 | 	fi
264 | 	elif [ "$options" -eq 2 ];then
265 | 		line=$(cat $filepath|sed -n 1p)
266 | 		info=$(echo $line|$optionsetting)
267 | 		eval $command1eq
268 | 		else
269 | 			echo "未知错误! 可能发生了无法预计的错误."
270 | 			fi
271 | }
272 | if [ ! -n "$1" ];then
273 | 	clear
274 | 	echo -ne "正在进行信息检查...\r"
275 | 	gpulist
276 | 	printlist /tmp/gputmp 'cat' '' "在此计算机上共找到 $g" "$d 张独立显卡$r"
277 | 	echo
278 | 	if [ $n -lt 1 ]
279 | 	then
280 | 		echo "并未找到独立显卡,是否仍要下载WebDriver? [y/n]"
281 | 		read yn0
282 | 		case $yn0 in
283 | 		[yY]) webdd
284 | 		;;
285 | 		[nN]) exit
286 | 		;;
287 | 		*)  echo '输入y继续,输入n退出,请输入正确的选项'
288 | 		esac
289 | 	else
290 | 		nvidia=$(cat /tmp/gpuvid|grep 10de|wc -l|awk '{print $1}')
291 | 		if [ $nvidia = 0 ];then
292 | 			echo "并未找到 Nvidia 独立显卡,是否仍要下载WebDriver? [y/n]"
293 | 			read yn1
294 | 			case $yn1 in
295 | 			[yY]) webdd
296 | 			;;
297 | 			[nN]) exit
298 | 			;;
299 | 			*)  echo '输入y继续,输入n退出,请输入正确的选项'
300 | 			esac
301 | 			else
302 | 		webdd
303 | 		fi
304 | 	fi
305 | 	else
306 | 		curl "https://raw.githubusercontent.com/lihaoyun6/macOS-Build-Numbers/master/bv2pv" 2>/dev/null|tee /tmp/sysver|grep -i "$1" > /tmp/webddtmp
307 | 		printlist /tmp/webddtmp 'sed s/\.0//g' "chosefromlist \$num \$filepath \"grep -Eo [0-9]{1,2}[A-Z].*\" \"webdd \\\$info\" \"webdd \\\$info\" \"\n请选择您要下载驱动的系统版本: \" \"${r}\a请选择正确的序号:$d\"" "根据您搜索的关键词,共找到 $g" "$d 个系统版本$r"
308 | 	fi
309 | 


--------------------------------------------------------------------------------
/Tools/Webdriver All Versions.app.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/Webdriver All Versions.app.zip


--------------------------------------------------------------------------------
/Tools/archey:
--------------------------------------------------------------------------------
  1 | #!/bin/bash
  2 | #    ____        ___            _____ __            ____  __
  3 | #   / __ \____ _/ (_)___ _____ / ___// /____  __   / __ )/ /___  ____ _
  4 | #  / / / / __ `/ / / __ `/ __ \\__ \/ //_/ / / /  / __  / / __ \/ __ `/
  5 | # / /_/ / /_/ / / / /_/ / / / /__/ / ,< / /_/ /  / /_/ / / /_/ / /_/ /
  6 | #/_____/\__,_/_/_/\__,_/_/ /_/____/_/|_|\__, /  /_____/_/\____/\__, /
  7 | #                                      /____/                 /____/
  8 | # Modified: DalianSky(https://blog.daliansky.net)
  9 | # 脚本中调用了bdmesg获取主板型号,所以使用前请勾选安装CLOVER的RC Scripts
 10 | # updated: 2-11-2020
 11 | 
 12 | # archey-osx 1.6.0 (https://github.com/obihann/archey-osx/)
 13 | 
 14 | # test to see if bash supports arrays
 15 | arraytest[0]='test' || (echo 'Error: Arrays are not supported in this version of
 16 | bash.' && exit 2)
 17 | 
 18 | # Detect the packager.
 19 | if [ -x /usr/local/bin/brew ]; then
 20 |   detectedpackager=homebrew
 21 | elif command -v port >/dev/null; then
 22 |   detectedpackager=macports
 23 | else
 24 |   detectedpackager=none
 25 | fi
 26 | 
 27 | # Get the command line options
 28 | opt_nocolor=f
 29 | opt_force_color=f
 30 | opt_offline=f
 31 | for arg in "$@"
 32 | do
 33 |   case "${arg}" in
 34 |     -p|--packager)
 35 |       packager=$detectedpackager
 36 |       ;;
 37 |     -m|--macports)
 38 |       packager=macports
 39 |       ;;
 40 |     -b|--nocolor)
 41 |       opt_nocolor=t
 42 |       ;;
 43 |     -c|--color)
 44 |       opt_nocolor=f
 45 |       opt_force_color=t
 46 |       ;;
 47 |     -o|--offline)
 48 |         opt_offline=t
 49 |       ;;
 50 |     -h|--help)
 51 |       echo "Archey OS X 1.6.0"
 52 |       echo
 53 |       echo "Usage: $0 [options]"
 54 |       echo
 55 |       echo "  -p --packager  Use auto detected package system (default packager: ${detectedpackager})."
 56 |       echo "  -m --macports  Force use MacPorts as package system."
 57 |       echo "  -b --nocolor   Turn color off."
 58 |       echo "  -c --color     Force the color on (overrides --nocolor)."
 59 |       echo "  -o --offline   Disable the IP address check."
 60 |       exit 0
 61 |       ;;
 62 |     *)
 63 |       echo "Unknown argument: $1" 1>&2
 64 |       echo "For help, use: $0 --help" 1>&2
 65 |       exit 1
 66 |       ;;
 67 |   esac
 68 | done
 69 | 
 70 | osx_version="$(sw_vers -productVersion)"
 71 | osx_build="$(sw_vers -buildVersion)"
 72 | 
 73 | # define OS Short Version 
 74 | #case "$osx_version" in
 75 | #  "10.4"*)  codename="Mac OS X Tiger" ;;
 76 | #  "10.5"*)  codename="Mac OS X Leopard" ;;
 77 | #  "10.6"*)  codename="Mac OS X Snow Leopard" ;;
 78 | #  "10.7"*)  codename="Mac OS X Lion" ;;
 79 | #  "10.8"*)  codename="OS X Mountain Lion" ;;
 80 | #  "10.9"*)  codename="OS X Mavericks" ;;
 81 | #  "10.10"*) codename="OS X Yosemite" ;;
 82 | #  "10.11"*) codename="OS X El Capitan" ;;
 83 | #  "10.12"*) codename="macOS Sierra" ;;
 84 | #  "10.13"*) codename="macOS High Sierra" ;;
 85 | #  "10.14"*) codename="macOS Mojave" ;;
 86 | #  "10.15"*) codename="macOS Catalina" ;;
 87 | #  *)        codename="macOS" ;;
 88 | #esac
 89 | 
 90 | # define OS Short Version 
 91 | #codename=$(xxd -ps /Applications/Utilities/System\ Information.app/Contents/MacOS/System\ Information | tr -d '\n' | perl -nle "print 
amp; if m{00$(sw_vers -productVersion | awk -F '.' '{printf $1"."$2}' | xxd -ps)00\K.*?00}" | xxd -r -p)
 92 | 
 93 | mem_total="$(($(sysctl -n hw.memsize) / 1024 / 1024))"
 94 | mem_wired="$(vm_stat | awk '/wired/ { print $4 }')"
 95 | mem_active="$(vm_stat | awk '/active / { printf $3 }')"
 96 | mem_compressed="$(vm_stat | awk '/occupied/ { printf $5 }')"
 97 | mem_used="$(((${mem_wired//.} + ${mem_active//.} + ${mem_compressed//.}) * 4 / 1024))"
 98 | ssd="$(system_profiler SPNVMeDataType | grep Model | awk '{print $2}' | xargs -n2)"
 99 | ssd_size="$(system_profiler SPNVMeDataType | grep -E '(Model|Capacity)' | sed  -n '1p' | awk '{print $2 $3}')"
100 | 
101 | cores="$(sysctl -n hw.logicalcpu_max)"
102 | 
103 | # Uptime
104 | boot="$(sysctl -n kern.boottime)"
105 | boot="${boot/'{ sec = '}"
106 | boot="${boot/,*}"
107 | now="$(date +%s)"
108 | seconds="$((now - boot))"
109 | days="$((seconds / 60 / 60 / 24)) days"
110 | hours="$((seconds / 60 / 60 % 24)) hours"
111 | mins="$((seconds / 60 % 60)) minutes"
112 | 
113 | # Format the days, hours and minutes.
114 | strip_date() {
115 |   case "$1" in
116 |     "0 "*) unset "${1/* }" ;;
117 |     "1 "*) printf "%s" "${1/s}" ;;
118 |     *)     printf "%s" "$1" ;;
119 |   esac
120 | }
121 | 
122 | days="$(strip_date "$days")"
123 | hours="$(strip_date "$hours")"
124 | mins="$(strip_date "$mins")"
125 | 
126 | uptime="${days:+$days, }${hours:+$hours, }${mins}"
127 | uptime="${uptime%', '}"
128 | uptime="${uptime:-${seconds} seconds}"
129 | 
130 | # model
131 | if [[ "$(kextstat | grep "FakeSMC")" != "" ]]; then
132 |   #model="$(ioreg -c FakeSMCKeyStore | grep product-name | sed -e's/"//g' | sed -e 's/|//g' | sed -e 's/product-name = //g' | sed -e 's/  //g') (SMBIOS: $(sysctl -n hw.model))"
133 |   model="$(bdmesg | grep ProductName | grep ProductName | sed '{print $7}')"
134 | else
135 |   model="$(sysctl -n hw.model)"
136 | fi
137 | 
138 | # Mainboard
139 | # mb="$(bdmesg | grep Running | awk '{print $5,$6,$7,$8,$9,$10}' | sed "s/\'//g")"
140 | 
141 | # System Variables
142 | # User="$(osascript -e "computer name of (system info)")"
143 | # Hostname=$(osascript -e "computer name of (system info)")
144 | # Hostname=$(system_profiler SPSoftwareDataType | grep "Computer" | sed 's/      Computer Name: //g')
145 | User=$(echo $(osascript -e "computer name of (system info)") | sed "s/-/ /g") 
146 | Date=$(date | sed 's/CST//g')
147 | # IP=$(osascript -e "IPv4 address of (system info)")
148 | # IP=`echo $(ifconfig | grep 'inet.*netmask.*broadcast') | awk '{print $2}'`
149 | Intranet=$(osascript -e "IPv4 address of (system info)")
150 | Public=$(dig +short myip.opendns.com @resolver1.opendns.com)
151 | #System_version="$codename $osx_version $osx_build"
152 | System_version="macOS $osx_version $osx_build"
153 | Kernel_version="$(uname) $(uname -r)"
154 | Uptime=$(uptime | sed 's/.*up \([^,]*\), .*/\1/')
155 | Shell="$SHELL"
156 | Terminal="$TERM by ${TERM_PROGRAM//_/ }" 
157 | Cpu="$(sysctl -n machdep.cpu.brand_string | sed 's/(R)//g' | sed 's/(TM)//g' | sed 's/CPU @ //g') x (${cores})"
158 | memory="${mem_used}MB(Avai) / ${mem_total}MB(Total)"
159 | 
160 | # Battery
161 | Battery=$(ioreg -c AppleSmartBattery -r | awk '$1~/Capacity/{c[$1]=$3} END{OFMT="%.2f%"; max=c["\"MaxCapacity\""]; if (max>0) { print 100*c["\"CurrentCapacity\""]/max;} }')
162 | batterystatus=$(pmset -g batt | sed -n '2p' | awk '{print $4}' | sed 's/;//g')
163 | if [[ $batterystatus == discharging ]] ; then 
164 |   batterystatus="未充电"
165 | elif [[ $batterystatus == charging ]] ; then 
166 |   batterystatus="充电中"
167 | else 
168 |   batterystatus="充电完成"
169 | fi
170 | 
171 | # disk
172 | disk_total="$(df -h | head -2 | tail -1 | awk '{print $2}' | sed 's/i/B/g')(Total)"
173 | disk_used="$(df -h | head -2 | tail -1 | awk '{print $4}' | sed 's/i/B/g')(Avai)"
174 | Disk="$disk_used / $disk_total"
175 | 
176 | 
177 | # GPU
178 | # main resolution
179 | resolution="$(system_profiler SPDisplaysDataType  2>/dev/null| grep Resolution | awk 'NF+=1' | sed 's/Resolution://g' | cut -b 2- | sed -e 's/, /\n/g' | sed -n 1p)"
180 | gpu="$(system_profiler SPDisplaysDataType 2>/dev/null|awk -F': ' '/^\ *Chipset Model:/ {printf $2 " "}')"
181 | vram="$(system_profiler SPDisplaysDataType 2>/dev/null| grep VRAM | cut -b 7-)"
182 | # extension resolution
183 | displayext="$(system_profiler SPDisplaysDataType  2>/dev/null| grep Resolution | awk 'NF+=1' | sed 's/Resolution://g' | cut -b 2- | sed -e 's/, /\n/g' | sed -n 2p)"
184 | displayext2="$(system_profiler SPDisplaysDataType  2>/dev/null| grep Resolution | awk 'NF+=1' | sed 's/Resolution://g' | cut -b 2- | sed -e 's/, /\n/g' | sed -n 3p)"
185 | #if [[ -z $displayext ]] ; then 
186 | #  displayext=$resolution
187 | #fi
188 | #if type -p screenresolution >/dev/null; then
189 | #  resolution="$(screenresolution get 2>&1 | awk '/Display/ {printf $6 "Hz, "}')"
190 | #  resolution="${resolution//x??@/ @ }"
191 | #
192 | #else
193 | #  resolution="$(system_profiler SPDisplaysDataType |\
194 | #          awk '/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}')"
195 | #fi
196 | #
197 | ## If no refresh rate is empty.
198 | #[[ "$resolution" == *"@ Hz"* ]] && \
199 | #  resolution="${resolution//@ Hz}"
200 | #
201 | #[[ "${scale_factor%.*}" == 2 ]] && \
202 | #  resolution="${resolution// @/@2x @}"
203 | #
204 | #if [[ "$refresh_rate" == "off" ]]; then
205 | #  resolution="${resolution// @ [0-9][0-9]Hz}"
206 | #  resolution="${resolution// @ [0-9][0-9][0-9]Hz}"
207 | #fi
208 | #
209 | #[[ "$resolution" == *"0Hz"* ]] && \
210 | #  resolution="${resolution// @ 0Hz}"
211 | #resolution="${resolution%,*}"
212 | 
213 | case "$term" in
214 |     "Apple_Terminal")
215 |       term_font="$(osascript <<END
216 |              tell application "Terminal" to font name of window frontmost
217 | END
218 | )"
219 |     ;;
220 | 
221 |     "iTerm2")
222 |       # Unfortunately the profile name is not unique, but it seems to be the only thing
223 |       # that identifies an active profile. There is the "id of current session of current win-
224 |       # dow" though, but that does not match to a guid in the plist.
225 |       # So, be warned, collisions may occur!
226 |       # See: https://groups.google.com/forum/#!topic/iterm2-discuss/0tO3xZ4Zlwg
227 |       local current_profile_name profiles_count profile_name diff_font none_ascii
228 | 
229 |       current_profile_name="$(osascript <<END
230 |                   tell application "iTerm2" to profile name \
231 |                   of current session of current window
232 | END
233 | )"
234 | 
235 |       # Warning: Dynamic profiles are not taken into account here!
236 |       # https://www.iterm2.com/documentation-dynamic-profiles.html
237 |       font_file="${HOME}/Library/Preferences/com.googlecode.iterm2.plist"
238 | 
239 |       # Count Guids in "New Bookmarks"; they should be unique
240 |       profiles_count="$(PlistBuddy -c "Print :New\ Bookmarks:" "$font_file" | grep -c "Guid")"
241 | 
242 |       for ((i=0; i<=profiles_count; i++)); do
243 |         profile_name="$(PlistBuddy -c "Print :New\ Bookmarks:${i}:Name:" "$font_file")"
244 | 
245 |         if [[ "$profile_name" == "$current_profile_name" ]]; then
246 |           # "Normal Font"
247 |           term_font="$(PlistBuddy -c "Print :New\ Bookmarks:${i}:Normal\ Font:" \
248 |                  "$font_file")"
249 | 
250 |           # Font for non-ascii characters
251 |           # Only check for a different non-ascii font, if the user checked
252 |           # the "use a different font for non-ascii text" switch.
253 |           diff_font="$(PlistBuddy -c "Print :New\ Bookmarks:${i}:Use\ Non-ASCII\ Font:" \
254 |                  "$font_file")"
255 | 
256 |           if [[ "$diff_font" == "true" ]]; then
257 |             non_ascii="$(PlistBuddy -c "Print :New\ Bookmarks:${i}:Non\ Ascii\ Font:" \
258 |                    "$font_file")"
259 | 
260 |             [[ "$term_font" != "$non_ascii" ]] && \
261 |               term_font="$term_font (normal) / $non_ascii (non-ascii)"
262 |           fi
263 |         fi
264 |       done
265 |     ;;
266 | esac
267 | 
268 | # Set up colors if:
269 | # * stdout is a tty
270 | # * the user hasn't turned it off
271 | # * or if we're forcing color
272 | if [[ ( -t 1  && "${opt_nocolor}" = f) || "${opt_force_color}" = t ]]
273 | then
274 |   RED=$(tput       setaf 1 2>/dev/null)
275 |   GREEN=$(tput     setaf 2 2>/dev/null)
276 |   YELLOW=$(tput    setaf 3 2>/dev/null)
277 |   BLUE=$(tput      setaf 4 2>/dev/null)
278 |   PURPLE=$(tput    setaf 5 2>/dev/null)
279 |   textColor=$(tput setaf 6 2>/dev/null)
280 |   normal=$(tput    sgr0 2>/dev/null)
281 | fi
282 | 
283 | fieldlist[${#fieldlist[@]}]="${textColor}机    型 :${normal} ${model}${normal}"
284 | fieldlist[${#fieldlist[@]}]="${textColor}操作系统 :${normal} ${System_version}${normal}"
285 | fieldlist[${#fieldlist[@]}]="${textColor}内核版本 :${normal} ${Kernel_version}${normal}"
286 | fieldlist[${#fieldlist[@]}]="${textColor}开机时间 :${normal} ${uptime}${normal}"
287 | fieldlist[${#fieldlist[@]}]="${textColor}Shell    :${normal} ${Shell}${normal}"
288 | fieldlist[${#fieldlist[@]}]="${textColor}当前时间 :${normal} ${Date}${normal}"
289 | fieldlist[${#fieldlist[@]}]="${textColor}处 理 器 :${normal} ${Cpu}${normal}"
290 | fieldlist[${#fieldlist[@]}]="${textColor}内    存 :${normal} ${memory}${normal}"
291 | fieldlist[${#fieldlist[@]}]="${textColor}磁盘型号 :${normal} ${ssd} ${ssd_size}${normal}"
292 | fieldlist[${#fieldlist[@]}]="${textColor}磁盘空间 :${normal} ${Disk}${normal}"
293 | if [[ ! -z $Battery ]]; then
294 |     fieldlist[${#fieldlist[@]}]="${textColor}剩余电量 :${normal} ${Battery}%  /  ${batterystatus}${normal}"
295 | fi
296 | fieldlist[${#fieldlist[@]}]="${textColor}IP 地 址 :${normal} 公网 ${Public} / 内网 ${Intranet}${normal}"
297 | fieldlist[${#fieldlist[@]}]="${textColor}当前终端 :${normal} ${Terminal}${normal}"
298 | fieldlist[${#fieldlist[@]}]="${textColor}显卡设备 :${normal} ${gpu}/ $vram${normal}"
299 | fieldlist[${#fieldlist[@]}]="${textColor}主显示器 :${normal} ${resolution}${normal}"
300 | fieldlist[${#fieldlist[@]}]="${textColor}扩展显示 :${normal} ${displayext}${normal}"
301 | fieldlist[${#fieldlist[@]}]="${textColor}扩展显示 :${normal} ${displayext2}${normal}"
302 | logofile=${ARCHEY_LOGO_FILE:-"${HOME}/.config/archey-logo"}
303 | if [ -a "$logofile" ]
304 |   then
305 |   source "$logofile"
306 | else
307 | # The ${foo#  } is a cheat so that it lines up here as well
308 | # as when run.
309 |   echo -e "
310 | ${normal# }                                      ${User} ${model}
311 | ${normal# }                                      ==============================================================
312 | ${GREEN#  }                                      ${fieldlist[0]}
313 | ${GREEN#  }                 ###                  ${fieldlist[1]}
314 | ${GREEN#  }               ####                   ${fieldlist[2]}
315 | ${GREEN#  }               ###                    ${fieldlist[3]}
316 | ${GREEN#  }       #######    #######             ${fieldlist[4]}
317 | ${YELLOW# }     ######################           ${fieldlist[5]}
318 | ${YELLOW# }    #####################             ${fieldlist[6]}
319 | ${RED#    }    ####################              ${fieldlist[7]}
320 | ${RED#    }    ####################              ${fieldlist[8]}
321 | ${RED#    }    #####################             ${fieldlist[9]}
322 | ${PURPLE# }     ######################           ${fieldlist[10]}
323 | ${PURPLE# }      ####################            ${fieldlist[11]}
324 | ${BLUE#   }        ################              ${fieldlist[12]}
325 | ${BLUE#   }         ####     #####               ${fieldlist[13]}
326 | ${BLUE#   }                                      ${fieldlist[14]}
327 | ${BLUE#   }                                      ${fieldlist[15]}
328 | ${normal}                                      
329 | "
330 | fi
331 | 


--------------------------------------------------------------------------------
/Tools/archey_BG:
--------------------------------------------------------------------------------
  1 | #!/bin/bash
  2 | #    ____        ___            _____ __            ____  __
  3 | #   / __ \____ _/ (_)___ _____ / ___// /____  __   / __ )/ /___  ____ _
  4 | #  / / / / __ `/ / / __ `/ __ \\__ \/ //_/ / / /  / __  / / __ \/ __ `/
  5 | # / /_/ / /_/ / / / /_/ / / / /__/ / ,< / /_/ /  / /_/ / / /_/ / /_/ /
  6 | #/_____/\__,_/_/_/\__,_/_/ /_/____/_/|_|\__, /  /_____/_/\____/\__, /
  7 | #                                      /____/                 /____/
  8 | # Modified: DalianSky(https://blog.daliansky.net)
  9 | # 脚本中调用了bdmesg获取主板型号,所以使用前请勾选安装CLOVER的RC Scripts
 10 | # updated: 2-11-2020
 11 | 
 12 | # archey-osx 1.6.0 (https://github.com/obihann/archey-osx/)
 13 | 
 14 | # test to see if bash supports arrays
 15 | arraytest[0]='test' || (echo 'Error: Arrays are not supported in this version of
 16 | bash.' && exit 2)
 17 | 
 18 | # Detect the packager.
 19 | if [ -x /usr/local/bin/brew ]; then
 20 |   detectedpackager=homebrew
 21 | elif command -v port >/dev/null; then
 22 |   detectedpackager=macports
 23 | else
 24 |   detectedpackager=none
 25 | fi
 26 | 
 27 | # Get the command line options
 28 | opt_nocolor=f
 29 | opt_force_color=f
 30 | opt_offline=f
 31 | for arg in "$@"
 32 | do
 33 |   case "${arg}" in
 34 |     -p|--packager)
 35 |       packager=$detectedpackager
 36 |       ;;
 37 |     -m|--macports)
 38 |       packager=macports
 39 |       ;;
 40 |     -b|--nocolor)
 41 |       opt_nocolor=t
 42 |       ;;
 43 |     -c|--color)
 44 |       opt_nocolor=f
 45 |       opt_force_color=t
 46 |       ;;
 47 |     -o|--offline)
 48 |         opt_offline=t
 49 |       ;;
 50 |     -h|--help)
 51 |       echo "Archey OS X 1.6.0"
 52 |       echo
 53 |       echo "Usage: $0 [options]"
 54 |       echo
 55 |       echo "  -p --packager  Use auto detected package system (default packager: ${detectedpackager})."
 56 |       echo "  -m --macports  Force use MacPorts as package system."
 57 |       echo "  -b --nocolor   Turn color off."
 58 |       echo "  -c --color     Force the color on (overrides --nocolor)."
 59 |       echo "  -o --offline   Disable the IP address check."
 60 |       exit 0
 61 |       ;;
 62 |     *)
 63 |       echo "Unknown argument: $1" 1>&2
 64 |       echo "For help, use: $0 --help" 1>&2
 65 |       exit 1
 66 |       ;;
 67 |   esac
 68 | done
 69 | 
 70 | osx_version="$(sw_vers -productVersion)"
 71 | osx_build="$(sw_vers -buildVersion)"
 72 | 
 73 | # define OS Short Version 
 74 | #case "$osx_version" in
 75 | #  "10.4"*)  codename="Mac OS X Tiger" ;;
 76 | #  "10.5"*)  codename="Mac OS X Leopard" ;;
 77 | #  "10.6"*)  codename="Mac OS X Snow Leopard" ;;
 78 | #  "10.7"*)  codename="Mac OS X Lion" ;;
 79 | #  "10.8"*)  codename="OS X Mountain Lion" ;;
 80 | #  "10.9"*)  codename="OS X Mavericks" ;;
 81 | #  "10.10"*) codename="OS X Yosemite" ;;
 82 | #  "10.11"*) codename="OS X El Capitan" ;;
 83 | #  "10.12"*) codename="macOS Sierra" ;;
 84 | #  "10.13"*) codename="macOS High Sierra" ;;
 85 | #  "10.14"*) codename="macOS Mojave" ;;
 86 | #  "10.15"*) codename="macOS Catalina" ;;
 87 | #  *)        codename="macOS" ;;
 88 | #esac
 89 | 
 90 | # define OS Short Version 
 91 | #codename=$(xxd -ps /Applications/Utilities/System\ Information.app/Contents/MacOS/System\ Information | tr -d '\n' | perl -nle "print 
amp; if m{00$(sw_vers -productVersion | awk -F '.' '{printf $1"."$2}' | xxd -ps)00\K.*?00}" | xxd -r -p)
 92 | 
 93 | mem_total="$(($(sysctl -n hw.memsize) / 1024 / 1024))"
 94 | mem_wired="$(vm_stat | awk '/wired/ { print $4 }')"
 95 | mem_active="$(vm_stat | awk '/active / { printf $3 }')"
 96 | mem_compressed="$(vm_stat | awk '/occupied/ { printf $5 }')"
 97 | mem_used="$(((${mem_wired//.} + ${mem_active//.} + ${mem_compressed//.}) * 4 / 1024))"
 98 | ssd="$(system_profiler SPNVMeDataType | grep Model | awk '{print $2}')"
 99 | ssd_size="$(system_profiler SPNVMeDataType | grep -E '(Model|Capacity)' | sed  -n '1p' | awk '{print $2 $3}')"
100 | 
101 | cores="$(sysctl -n hw.logicalcpu_max)"
102 | 
103 | # Uptime
104 | boot="$(sysctl -n kern.boottime)"
105 | boot="${boot/'{ sec = '}"
106 | boot="${boot/,*}"
107 | now="$(date +%s)"
108 | seconds="$((now - boot))"
109 | days="$((seconds / 60 / 60 / 24)) days"
110 | hours="$((seconds / 60 / 60 % 24)) hours"
111 | mins="$((seconds / 60 % 60)) minutes"
112 | 
113 | # Format the days, hours and minutes.
114 | strip_date() {
115 |   case "$1" in
116 |     "0 "*) unset "${1/* }" ;;
117 |     "1 "*) printf "%s" "${1/s}" ;;
118 |     *)     printf "%s" "$1" ;;
119 |   esac
120 | }
121 | 
122 | days="$(strip_date "$days")"
123 | hours="$(strip_date "$hours")"
124 | mins="$(strip_date "$mins")"
125 | 
126 | uptime="${days:+$days, }${hours:+$hours, }${mins}"
127 | uptime="${uptime%', '}"
128 | uptime="${uptime:-${seconds} seconds}"
129 | 
130 | # model
131 | if [[ "$(kextstat | grep "FakeSMC")" != "" ]]; then
132 |   #model="$(ioreg -c FakeSMCKeyStore | grep product-name | sed -e's/"//g' | sed -e 's/|//g' | sed -e 's/product-name = //g' | sed -e 's/  //g') (SMBIOS: $(sysctl -n hw.model))"
133 |   model="$(bdmesg | grep ProductName | grep ProductName | sed '{print $7}')"
134 | else
135 |   model="$(sysctl -n hw.model)"
136 | fi
137 | 
138 | # Mainboard
139 | # mb="$(bdmesg | grep Running | awk '{print $5,$6,$7,$8,$9,$10}' | sed "s/\'//g")"
140 | 
141 | # System Variables
142 | # User="$(osascript -e "computer name of (system info)")"
143 | # Hostname=$(osascript -e "computer name of (system info)")
144 | # Hostname=$(system_profiler SPSoftwareDataType | grep "Computer" | sed 's/      Computer Name: //g')
145 | User=$(echo $(osascript -e "computer name of (system info)") | sed "s/-/ /g") 
146 | Date=$(date | sed 's/CST//g')
147 | # IP=$(osascript -e "IPv4 address of (system info)")
148 | # IP=`echo $(ifconfig | grep 'inet.*netmask.*broadcast') | awk '{print $2}'`
149 | Intranet=$(osascript -e "IPv4 address of (system info)")
150 | Public=$(dig +short myip.opendns.com @resolver1.opendns.com)
151 | #System_version="$codename $osx_version $osx_build"
152 | System_version="macOS $osx_version $osx_build"
153 | Kernel_version="$(uname) $(uname -r)"
154 | Uptime=$(uptime | sed 's/.*up \([^,]*\), .*/\1/')
155 | Shell="$SHELL"
156 | Terminal="$TERM by ${TERM_PROGRAM//_/ }" 
157 | Cpu="$(sysctl -n machdep.cpu.brand_string | sed 's/(R)//g' | sed 's/(TM)//g' | sed 's/CPU @ //g') x (${cores})"
158 | memory="${mem_used}MB(Avai) / ${mem_total}MB(Total)"
159 | 
160 | # Battery
161 | Battery=$(ioreg -c AppleSmartBattery -r | awk '$1~/Capacity/{c[$1]=$3} END{OFMT="%.2f%"; max=c["\"MaxCapacity\""]; if (max>0) { print 100*c["\"CurrentCapacity\""]/max;} }')
162 | batterystatus=$(pmset -g batt | sed -n '2p' | awk '{print $4}' | sed 's/;//g')
163 | if [[ $batterystatus == discharging ]] ; then 
164 |   batterystatus="未充电"
165 | elif [[ $batterystatus == charging ]] ; then 
166 |   batterystatus="充电中"
167 | else 
168 |   batterystatus="充电完成"
169 | fi
170 | 
171 | # disk
172 | disk_total="$(df -h | head -2 | tail -1 | awk '{print $2}' | sed 's/i/B/g')(Total)"
173 | disk_used="$(df -h | head -2 | tail -1 | awk '{print $4}' | sed 's/i/B/g')(Avai)"
174 | Disk="$disk_used / $disk_total"
175 | 
176 | 
177 | # GPU
178 | # main resolution
179 | resolution="$(system_profiler SPDisplaysDataType  2>/dev/null| grep Resolution | awk 'NF+=1' | sed 's/Resolution://g' | cut -b 2- | sed -e 's/, /\n/g' | sed -n 1p)"
180 | gpu="$(system_profiler SPDisplaysDataType 2>/dev/null|awk -F': ' '/^\ *Chipset Model:/ {printf $2 " "}')"
181 | vram="$(system_profiler SPDisplaysDataType 2>/dev/null| grep VRAM | cut -b 7-)"
182 | # extension resolution
183 | displayext="$(system_profiler SPDisplaysDataType  2>/dev/null| grep Resolution | awk 'NF+=1' | sed 's/Resolution://g' | cut -b 2- | sed -e 's/, /\n/g' | sed -n 2p)"
184 | #if [[ -z $displayext ]] ; then 
185 | #  displayext=$resolution
186 | #fi
187 | #if type -p screenresolution >/dev/null; then
188 | #  resolution="$(screenresolution get 2>&1 | awk '/Display/ {printf $6 "Hz, "}')"
189 | #  resolution="${resolution//x??@/ @ }"
190 | #
191 | #else
192 | #  resolution="$(system_profiler SPDisplaysDataType |\
193 | #          awk '/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}')"
194 | #fi
195 | #
196 | ## If no refresh rate is empty.
197 | #[[ "$resolution" == *"@ Hz"* ]] && \
198 | #  resolution="${resolution//@ Hz}"
199 | #
200 | #[[ "${scale_factor%.*}" == 2 ]] && \
201 | #  resolution="${resolution// @/@2x @}"
202 | #
203 | #if [[ "$refresh_rate" == "off" ]]; then
204 | #  resolution="${resolution// @ [0-9][0-9]Hz}"
205 | #  resolution="${resolution// @ [0-9][0-9][0-9]Hz}"
206 | #fi
207 | #
208 | #[[ "$resolution" == *"0Hz"* ]] && \
209 | #  resolution="${resolution// @ 0Hz}"
210 | #resolution="${resolution%,*}"
211 | 
212 | case "$term" in
213 |     "Apple_Terminal")
214 |       term_font="$(osascript <<END
215 |              tell application "Terminal" to font name of window frontmost
216 | END
217 | )"
218 |     ;;
219 | 
220 |     "iTerm2")
221 |       # Unfortunately the profile name is not unique, but it seems to be the only thing
222 |       # that identifies an active profile. There is the "id of current session of current win-
223 |       # dow" though, but that does not match to a guid in the plist.
224 |       # So, be warned, collisions may occur!
225 |       # See: https://groups.google.com/forum/#!topic/iterm2-discuss/0tO3xZ4Zlwg
226 |       local current_profile_name profiles_count profile_name diff_font none_ascii
227 | 
228 |       current_profile_name="$(osascript <<END
229 |                   tell application "iTerm2" to profile name \
230 |                   of current session of current window
231 | END
232 | )"
233 | 
234 |       # Warning: Dynamic profiles are not taken into account here!
235 |       # https://www.iterm2.com/documentation-dynamic-profiles.html
236 |       font_file="${HOME}/Library/Preferences/com.googlecode.iterm2.plist"
237 | 
238 |       # Count Guids in "New Bookmarks"; they should be unique
239 |       profiles_count="$(PlistBuddy -c "Print :New\ Bookmarks:" "$font_file" | grep -c "Guid")"
240 | 
241 |       for ((i=0; i<=profiles_count; i++)); do
242 |         profile_name="$(PlistBuddy -c "Print :New\ Bookmarks:${i}:Name:" "$font_file")"
243 | 
244 |         if [[ "$profile_name" == "$current_profile_name" ]]; then
245 |           # "Normal Font"
246 |           term_font="$(PlistBuddy -c "Print :New\ Bookmarks:${i}:Normal\ Font:" \
247 |                  "$font_file")"
248 | 
249 |           # Font for non-ascii characters
250 |           # Only check for a different non-ascii font, if the user checked
251 |           # the "use a different font for non-ascii text" switch.
252 |           diff_font="$(PlistBuddy -c "Print :New\ Bookmarks:${i}:Use\ Non-ASCII\ Font:" \
253 |                  "$font_file")"
254 | 
255 |           if [[ "$diff_font" == "true" ]]; then
256 |             non_ascii="$(PlistBuddy -c "Print :New\ Bookmarks:${i}:Non\ Ascii\ Font:" \
257 |                    "$font_file")"
258 | 
259 |             [[ "$term_font" != "$non_ascii" ]] && \
260 |               term_font="$term_font (normal) / $non_ascii (non-ascii)"
261 |           fi
262 |         fi
263 |       done
264 |     ;;
265 | esac
266 | 
267 | # Set up colors if:
268 | # * stdout is a tty
269 | # * the user hasn't turned it off
270 | # * or if we're forcing color
271 | if [[ ( -t 1  && "${opt_nocolor}" = f) || "${opt_force_color}" = t ]]
272 | then
273 |   RED=$(tput       setaf 1 2>/dev/null)
274 |   GREEN=$(tput     setaf 2 2>/dev/null)
275 |   YELLOW=$(tput    setaf 3 2>/dev/null)
276 |   BLUE=$(tput      setaf 4 2>/dev/null)
277 |   PURPLE=$(tput    setaf 5 2>/dev/null)
278 |   textColor=$(tput setaf 6 2>/dev/null)
279 |   normal=$(tput    sgr0 2>/dev/null)
280 | fi
281 | 
282 | fieldlist[${#fieldlist[@]}]="${textColor}机    型 :${normal} ${model}${normal}"
283 | fieldlist[${#fieldlist[@]}]="${textColor}操作系统 :${normal} ${System_version}${normal}"
284 | fieldlist[${#fieldlist[@]}]="${textColor}内核版本 :${normal} ${Kernel_version}${normal}"
285 | fieldlist[${#fieldlist[@]}]="${textColor}开机时间 :${normal} ${uptime}${normal}"
286 | fieldlist[${#fieldlist[@]}]="${textColor}Shell    :${normal} ${Shell}${normal}"
287 | fieldlist[${#fieldlist[@]}]="${textColor}当前时间 :${normal} ${Date}${normal}"
288 | fieldlist[${#fieldlist[@]}]="${textColor}处 理 器 :${normal} ${Cpu}${normal}"
289 | fieldlist[${#fieldlist[@]}]="${textColor}内    存 :${normal} ${memory}${normal}"
290 | fieldlist[${#fieldlist[@]}]="${textColor}磁盘型号 :${normal} ${ssd} ${ssd_size}${normal}"
291 | fieldlist[${#fieldlist[@]}]="${textColor}磁盘空间 :${normal} ${Disk}${normal}"
292 | if [[ ! -z $Battery ]]; then
293 |     fieldlist[${#fieldlist[@]}]="${textColor}剩余电量 :${normal} ${Battery}%  /  ${batterystatus}${normal}"
294 | fi
295 | fieldlist[${#fieldlist[@]}]="${textColor}IP 地 址 :${normal} 公网 ${Public} / 内网 ${Intranet}${normal}"
296 | fieldlist[${#fieldlist[@]}]="${textColor}当前终端 :${normal} ${Terminal}${normal}"
297 | fieldlist[${#fieldlist[@]}]="${textColor}显卡设备 :${normal} ${gpu}/ $vram${normal}"
298 | fieldlist[${#fieldlist[@]}]="${textColor}主显示器 :${normal} ${resolution}${normal}"
299 | fieldlist[${#fieldlist[@]}]="${textColor}扩展显示 :${normal} ${displayext}${normal}"
300 | 
301 | logofile=${ARCHEY_LOGO_FILE:-"${HOME}/.config/archey-logo"}
302 | if [ -a "$logofile" ]
303 |   then
304 |   source "$logofile"
305 | else
306 | # The ${foo#  } is a cheat so that it lines up here as well
307 | # as when run.
308 |   echo -e "
309 | ${normal# }                                      ${User} ${model}
310 | ${normal# }                                      ==============================================================
311 | ${GREEN#  }                                      ${fieldlist[0]}
312 | ${GREEN#  }                 ###                  ${fieldlist[1]}
313 | ${GREEN#  }               ####                   ${fieldlist[2]}
314 | ${GREEN#  }               ###                    ${fieldlist[3]}
315 | ${GREEN#  }       #######    #######             ${fieldlist[4]}
316 | ${YELLOW# }     ######################           ${fieldlist[5]}
317 | ${YELLOW# }    #####################             ${fieldlist[6]}
318 | ${RED#    }    ####################              ${fieldlist[7]}
319 | ${RED#    }    ####################              ${fieldlist[8]}
320 | ${RED#    }    #####################             ${fieldlist[9]}
321 | ${PURPLE# }     ######################           ${fieldlist[10]}
322 | ${PURPLE# }      ####################            ${fieldlist[11]}
323 | ${BLUE#   }        ################              ${fieldlist[12]}
324 | ${BLUE#   }         ####     #####               ${fieldlist[13]}
325 | ${BLUE#   }                                      ${fieldlist[14]}
326 | ${BLUE#   }                                      ${fieldlist[15]}
327 | ${normal}                                      
328 | "
329 | fi
330 | 


--------------------------------------------------------------------------------
/Tools/bdmesg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/bdmesg


--------------------------------------------------------------------------------
/Tools/build_own.sh:
--------------------------------------------------------------------------------
  1 | #!/bin/sh
  2 | #This shell script is modified by Mison base on the script of headkaze,Gengik84.
  3 | 
  4 | # function checkTools() {
  5 | #   checkNasm
  6 | #   checkMtoc
  7 | # }
  8 | 
  9 | # Check Nasm and Mtoc by vit9696 ( macbuild.tool )
 10 | # function checkNasm(){
 11 | #   local NASMVER="2.13.03"
 12 | # 
 13 | #   if [ "$(nasm -v)" = "" ] || [ "$(nasm -v | grep Apple)" != "" ]; then
 14 | #     echo "Missing or incompatible nasm!"
 15 | #     echo "Download the latest nasm from http://www.nasm.us/pub/nasm/releasebuilds/"
 16 | #     read -p "Last tested with nasm ${NASMVER}. Install it automatically? (Y/N) " confirmInstallNasm 
 17 | #     case "${confirmInstallNasm}" in
 18 | #       y | Y | "" ) 
 19 | #         pushd /tmp >/dev/null
 20 | #         rm -rf "nasm-${NASMVER}-macosx.zip" "nasm-${NASMVER}"
 21 | #         echo "Download nasm..."
 22 | #         curl -OL "http://www.nasm.us/pub/nasm/releasebuilds/${NASMVER}/macosx/nasm-${NASMVER}-macosx.zip" || exit 1
 23 | #         unzip -q "nasm-${NASMVER}-macosx.zip" "nasm-${NASMVER}/nasm" "nasm-${NASMVER}/ndisasm" || exit 1
 24 | #         sudo mkdir -p /usr/local/bin || exit 1
 25 | #         sudo mv "nasm-${NASMVER}/nasm" /usr/local/bin/ || exit 1
 26 | #         sudo mv "nasm-${NASMVER}/ndisasm" /usr/local/bin/ || exit 1
 27 | #         rm -rf "nasm-${NASMVER}-macosx.zip" "nasm-${NASMVER}"
 28 | #         popd >/dev/null
 29 | #       ;;
 30 | # 
 31 | #       * )
 32 | #         echo -e "\nnasm installation Aborted.\n"
 33 | #         exit
 34 | #       ;;
 35 | #     esac
 36 | #   fi    
 37 | # }
 38 | 
 39 | # function checkMtoc(){
 40 | #   if [ "$(which mtoc.NEW)" = "" ] || [ "$(which mtoc)" = "" ]; then
 41 | #     echo  "Missing mtoc or mtoc.NEW!"
 42 | #     echo "To build mtoc follow: https://github.com/tianocore/tianocore.github.io/wiki/Xcode#mac-os-x-xcode"
 43 | #     read -p "Install prebuilt mtoc and mtoc.NEW automatically? (Y/N) " confirmInstallMtoc
 44 | #     case "${confirmInstallMtoc}" in
 45 | #       y | Y | "" )
 46 | #         pushd /tmp >/dev/null
 47 | #         rm -f mtoc mtoc.NEW
 48 | #         echo "Download the latest Mtoc and install..."
 49 | #         curl -O "https://github.com/acidanthera/ocbuild/raw/master/external/mtoc-mac64.zip" || exit 1
 50 | #         unzip -q ./mtoc-mac64.zip mtoc.NEW || exit 1
 51 | #         sudo mkdir -p /usr/local/bin || exit 1
 52 | #         sudo cp mtoc.NEW /usr/local/bin/mtoc || exit 1
 53 | #         sudo mv mtoc.NEW /usr/local/bin/ || exit 1
 54 | #         popd >/dev/null
 55 | #       ;;
 56 | # 
 57 | #       * )
 58 | #         echo -e "\nmtoc installation Aborted.\n"
 59 | #         exit
 60 | #       ;;
 61 | #     esac
 62 | #   fi    
 63 | # }
 64 | # checkTools
 65 | echo "源码更新中..."
 66 | cd ~/git/buildlilu
 67 | cd Lilu && git pull && cd ..
 68 | cd WhateverGreen && git pull && cd ..
 69 | cd AppleALC && git pull && cd ..
 70 | cd VirtualSMC && git pull && cd ..
 71 | cd AirportBrcmFixup && git pull && cd ..
 72 | cd RTCMemoryFixup && git pull && cd ..
 73 | cd NVMeFix && git pull && cd ..
 74 | cd BrcmPatchRAM && git pull && cd ..
 75 | cd LucyRTL8125Ethernet && git pull && cd ..
 76 | cd IntelMausi && git pull && cd ..
 77 | cd SystemProfilerMemoryFixup && git pull && cd ..
 78 | cd VoodooPS2 && git pull && cd ..
 79 | cd HibernationFixup && git pull && cd ..
 80 | #cd OS-X-USB-Inject-All && git pull && cd ..
 81 | 
 82 | 
 83 | # git clone https://github.com/acidanthera/NVMeFix --depth=1
 84 | # git clone https://github.com/acidanthera/Lilu --depth=1
 85 | # git clone https://github.com/acidanthera/WhateverGreen --depth=1
 86 | # git clone https://github.com/acidanthera/AppleALC --depth=1
 87 | # git clone https://github.com/acidanthera/AirportBrcmFixup --depth=1
 88 | # git clone https://github.com/acidanthera/HibernationFixup --depth=1
 89 | # git clone https://github.com/acidanthera/RTCMemoryFixup --depth=1
 90 | # git clone https://github.com/athlonreg/ATH9KFixup --depth=1
 91 | # git clone https://github.com/acidanthera/BT4LEContiunityFixup --depth=1
 92 | # git clone https://github.com/acidanthera/CPUFriend --depth=1
 93 | # git clone https://github.com/al3xtjames/NoTouchID --depth=1
 94 | # git clone https://github.com/acidanthera/VirtualSMC --depth=1
 95 | # git clone https://github.com/vulgo/NoVPAJpeg --depth=1
 96 | # git clone https://github.com/Goldfish64/DiskArbitrationFixup --depth=1
 97 | # git clone https://github.com/Goldfish64/SystemProfilerMemoryFixup --depth=1
 98 | # git clone https://github.com/lvs1974/VoodooSDHCMod --depth=1
 99 | # git clone https://github.com/sinetek/Sinetek-rtsx --depth=1
100 | # git clone https://github.com/Mieze/AtherosE2200Ethernet --depth=1
101 | # git clone https://github.com/Mieze/RealtekRTL8100 --depth=1
102 | # git clone https://github.com/Mieze/RTL8111_driver_for_OS_X --depth=1
103 | # git clone https://github.com/acidanthera/IntelMausi --depth=1
104 | # git clone https://github.com/al3xtjames/AtherosL1cEthernet --depth=1
105 | # git clone https://github.com/acidanthera/VoodooPS2 --depth=1
106 | # git clone https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller --depth=1
107 | # git clone https://github.com/RehabMan/OS-X-USB-Inject-All --depth=1
108 | # git clone https://github.com/RehabMan/OS-X-ACPI-Battery-Driver --depth=1
109 | # git clone https://github.com/RehabMan/OS-X-Null-Ethernet --depth=1
110 | # git clone https://github.com/RehabMan/VoodooTSCSync --depth=1
111 | 
112 | # 编译Lilu Debug版本
113 | xcodebuild -project ./Lilu/Lilu.xcodeproj -configuration Debug clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Debug
114 | 
115 | # 软链接Lilu Debug
116 | ln -s ./Debug/Lilu.kext ./WhateverGreen
117 | ln -s ./Debug/Lilu.kext ./AppleALC
118 | ln -s ./Debug/Lilu.kext ./AirportBrcmFixup
119 | ln -s ./Debug/Lilu.kext ./HibernationFixup
120 | ln -s ./Debug/Lilu.kext ./RTCMemoryFixup
121 | ln -s ./Debug/Lilu.kext ./ATH9KFixup
122 | ln -s ./Debug/Lilu.kext ./BT4LEContiunityFixup
123 | ln -s ./Debug/Lilu.kext ./CPUFriend
124 | ln -s ./Debug/Lilu.kext ./NoTouchID
125 | ln -s ./Debug/Lilu.kext ./VirtualSMC
126 | ln -s ./Debug/Lilu.kext ./NoVPAJpeg
127 | ln -s ./Debug/Lilu.kext ./DiskArbitrationFixup
128 | ln -s ./Debug/Lilu.kext ./SystemProfilerMemoryFixup
129 | 
130 | echo "开始编译常用驱动..."
131 | xcodebuild -project ./Lilu/Lilu.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
132 | xcodebuild -project ./WhateverGreen/WhateverGreen.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
133 | xcodebuild -project ./AppleALC/AppleALC.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
134 | xcodebuild -project ./AirportBrcmFixup/AirportBrcmFixup.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
135 | xcodebuild -project ./HibernationFixup/HibernationFixup.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
136 | xcodebuild -project ./RTCMemoryFixup/RTCMemoryFixup.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
137 | # xcodebuild -project ./ATH9KFixup/ATH9KFixup.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release/ATH9KFixup
138 | # xcodebuild -project ./BT4LEContiunityFixup/BT4LEContiunityFixup.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
139 | # xcodebuild -project ./CPUFriend/CPUFriend.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
140 | # xcodebuild -project ./NoTouchID/NoTouchID.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
141 | xcodebuild -project ./VirtualSMC/VirtualSMC.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
142 | # xcodebuild -project ./NoVPAJpeg/NoVPAJpeg.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
143 | # xcodebuild -project ./DiskArbitrationFixup/DiskArbitrationFixup.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
144 | xcodebuild -project ./SystemProfilerMemoryFixup/SystemProfilerMemoryFixup.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
145 | # xcodebuild -project ./VoodooSDHCMod/VoodooSDHC.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
146 | # xcodebuild -project ./Sinetek-rtsx/Sinetek-rtsx.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
147 | # xcodebuild -project ./AtherosE2200Ethernet/AtherosE2200Ethernet.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
148 | # xcodebuild -project ./RealtekRTL8100/RealtekRTL8100.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
149 | # xcodebuild -project ./RTL8111_driver_for_OS_X/RealtekRTL8111.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
150 | xcodebuild -project ./IntelMausi/IntelMausiEthernet.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
151 | # xcodebuild -project ./AtherosL1cEthernet/AtherosL1cEthernet.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
152 | xcodebuild -project ./NVMeFix/NVMeFix.xcodeproj  -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
153 | xcodebuild -project ./VoodooPS2/VoodooPS2Controller.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
154 | xcodebuild -project ./OS-X-USB-Inject-All/USBInjectAll.xcodeproj -scheme USBInjectAll -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
155 | xcodebuild -project ./LucyRTL8125Ethernet/LucyRTL8125Ethernet.xcodeproj -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=../Release
156 | echo  "编译完成!"
157 | find ./ -name "*.dSYM" -depth -exec rm -rf {} \;  # 删除无用的.dSYM文件
158 | find ./ -name "dSYM" -depth -exec rm -rf {} \;  # 删除无用的.dSYM文件
159 | echo "合并VoodooPS2Controller驱动..."
160 | cd Release
161 | cp -r VoodooPS2Trackpad.kext VoodooPS2Controller.kext/Contents/PlugIns/
162 | cp -r VoodooPS2Mouse.kext VoodooPS2Controller.kext/Contents/PlugIns/
163 | cp -r VoodooPS2Keyboard.kext VoodooPS2Controller.kext/Contents/PlugIns/
164 | cd ../
165 | echo "合并VoodooPS2Controller驱动完成!"
166 | open Release
167 | 


--------------------------------------------------------------------------------
/Tools/daliansky.css:
--------------------------------------------------------------------------------
  1 | :root {
  2 |     --side-bar-bg-color: #fafafa;
  3 |     --control-text-color: #777;
  4 | }
  5 | 
  6 | @include-when-export url(https://fonts.loli.net/css?family=Noto Serif SC:400,600,700&display=swap&subset=chinese-simplified");
  7 | 
  8 | html {
  9 |     font-size: 16px;
 10 | }
 11 | 
 12 | body {
 13 |     font-family: 'Noto Serif', 'Noto Serif CJK SC', 'Noto Serif CJK', 'Source Han Serif SC', 'Source Han Serif', source-han-serif-sc, serif;
 14 |     color: rgb(51, 51, 51);
 15 |     line-height: 1.6;
 16 | }
 17 | 
 18 | #write {
 19 |     max-width: 860px;
 20 |   	margin: 0 auto;
 21 |   	padding: 30px;
 22 |     padding-bottom: 100px;
 23 | }
 24 | #write > ul:first-child,
 25 | #write > ol:first-child{
 26 |     margin-top: 30px;
 27 | }
 28 | 
 29 | a {
 30 |     color: rgb(80, 115, 184);
 31 |     border-bottom-color: rgb(80, 115, 184);
 32 | }
 33 | a:hover {
 34 |     color: rgb(161, 102, 171);
 35 |     border-bottom-color: rgb(161, 102, 171);
 36 | }
 37 | 
 38 | h1 {
 39 |     position: relative;
 40 |     margin-top: 1rem;
 41 |     margin-bottom: 1rem;
 42 |     font-weight: bold;
 43 |     line-height: 1.4;
 44 |     cursor: text;
 45 | }
 46 | 
 47 | h2,
 48 | h3,
 49 | h4,
 50 | h5,
 51 | h6 {
 52 |     position: relative;
 53 |     margin-top: 1rem;
 54 |     margin-bottom: 1rem;
 55 |     font-weight: bold;
 56 |     line-height: 1.4;
 57 |     cursor: text;
 58 |     border-left: 4px solid #a166ab;
 59 |     margin-left: -36px;
 60 |     padding-left: 32px;
 61 | }
 62 | h1:hover a.anchor,
 63 | h2:hover a.anchor,
 64 | h3:hover a.anchor,
 65 | h4:hover a.anchor,
 66 | h5:hover a.anchor,
 67 | h6:hover a.anchor {
 68 |     text-decoration: none;
 69 | }
 70 | h1 tt,
 71 | h1 code {
 72 |     font-size: inherit;
 73 | }
 74 | h2 tt,
 75 | h2 code {
 76 |     font-size: inherit;
 77 | }
 78 | h3 tt,
 79 | h3 code {
 80 |     font-size: inherit;
 81 | }
 82 | h4 tt,
 83 | h4 code {
 84 |     font-size: inherit;
 85 | }
 86 | h5 tt,
 87 | h5 code {
 88 |     font-size: inherit;
 89 | }
 90 | h6 tt,
 91 | h6 code {
 92 |     font-size: inherit;
 93 | }
 94 | h1 {
 95 |     padding-bottom: .3em;
 96 |     font-size: 2.25em;
 97 |     line-height: 1.2;
 98 |     border-bottom: 1px solid #eee;
 99 | }
100 | h2 {
101 |    padding-bottom: .3em;
102 |     font-size: 1.75em;
103 |     line-height: 1.225;
104 |     border-bottom: 1px solid #eee;
105 | }
106 | h3 {
107 |     font-size: 1.5em;
108 |     line-height: 1.43;
109 | }
110 | h4 {
111 |     font-size: 1.25em;
112 | }
113 | h5 {
114 |     font-size: 1em;
115 | }
116 | h6 {
117 |    font-size: 1em;
118 |     color: #777;
119 | }
120 | p,
121 | blockquote,
122 | ul,
123 | ol,
124 | dl,
125 | table{
126 |     margin: 0.8em 0;
127 | }
128 | li>ol,
129 | li>ul {
130 |     margin: 0 0;
131 | }
132 | hr {
133 |     height: 2px;
134 |     padding: 0;
135 |     margin: 16px 0;
136 |     background-color: #e7e7e7;
137 |     border: 0 none;
138 |     overflow: hidden;
139 |     box-sizing: content-box;
140 | }
141 | 
142 | li p.first {
143 |     display: inline-block;
144 | }
145 | ul,
146 | ol {
147 |     padding-left: 30px;
148 | }
149 | ul:first-child,
150 | ol:first-child {
151 |     margin-top: 0;
152 | }
153 | ul:last-child,
154 | ol:last-child {
155 |     margin-bottom: 0;
156 | }
157 | blockquote {
158 |     border-left: 4px solid #dfe2e5;
159 |     padding: 0 15px;
160 |     color: rgb(90, 4, 37);
161 | }
162 | blockquote blockquote {
163 |     padding-right: 0;
164 |     color: rgb(90, 4, 37);
165 | }
166 | table {
167 |     padding: 0;
168 |     word-break: initial;
169 | }
170 | table tr {
171 |     border-top: 1px solid #dfe2e5;
172 |     margin: 0;
173 |     padding: 0;
174 | }
175 | table tr:nth-child(2n),
176 | thead {
177 |     background-color: #f8f8f8;
178 | }
179 | table tr th {
180 |     font-weight: bold;
181 |     border: 1px solid #dfe2e5;
182 |     border-bottom: 0;
183 |     text-align: left;
184 |     margin: 0;
185 |     padding: 6px 13px;
186 | }
187 | table tr td {
188 |     border: 1px solid #dfe2e5;
189 |     text-align: left;
190 |     margin: 0;
191 |     padding: 6px 13px;
192 | }
193 | table tr th:first-child,
194 | table tr td:first-child {
195 |     margin-top: 0;
196 | }
197 | table tr th:last-child,
198 | table tr td:last-child {
199 |     margin-bottom: 0;
200 | }
201 | 
202 | .CodeMirror-lines {
203 |     padding-left: 4px;
204 | }
205 | 
206 | .code-tooltip {
207 |     box-shadow: 0 1px 1px 0 rgba(0,28,36,.3);
208 |     border-top: 1px solid #eef2f2;
209 | }
210 | 
211 | .md-fences,
212 | code,
213 | tt {
214 |     border: 1px solid #e7eaed;
215 |     background-color: #f8f8f8;
216 |     border-radius: 3px;
217 |     padding: 0;
218 |     padding: 2px 4px 0px 4px;
219 |     font-size: 0.9em;
220 |     color: #d05
221 | }
222 | 
223 | code {
224 |     background-color: #f3f4f4;
225 |     padding: 0 2px 0 2px;
226 | }
227 | 
228 | .md-fences {
229 |     margin-bottom: 15px;
230 |     margin-top: 15px;
231 |     padding-top: 8px;
232 |     padding-bottom: 6px;
233 | }
234 | 
235 | 
236 | .md-task-list-item > input {
237 |   margin-left: -1.3em;
238 | }
239 | 
240 | @media print {
241 |     html {
242 |         font-size: 16px;
243 |     }
244 |     table,
245 |     pre {
246 |         page-break-inside: avoid;
247 |     }
248 |     pre {
249 |         word-wrap: break-word;
250 |     }
251 | }
252 | 
253 | .md-fences {
254 | 	background-color: #f8f8f8;
255 | }
256 | #write pre.md-meta-block {
257 | 	padding: 1rem;
258 |     font-size: 85%;
259 |     line-height: 1.45;
260 |     background-color: #f7f7f7;
261 |     border: 0;
262 |     border-radius: 3px;
263 |     color: rgb(224, 113, 156);
264 |     margin-top: 0 !important;
265 | }
266 | 
267 | .mathjax-block>.code-tooltip {
268 | 	bottom: .375rem;
269 | }
270 | 
271 | .md-mathjax-midline {
272 |     background: #fafafa;
273 | }
274 | 
275 | #write>h3.md-focus:before{
276 | 	left: -1.5625rem;
277 | 	top: .375rem;
278 | }
279 | #write>h4.md-focus:before{
280 | 	left: -1.5625rem;
281 | 	top: .285714286rem;
282 | }
283 | #write>h5.md-focus:before{
284 | 	left: -1.5625rem;
285 | 	top: .285714286rem;
286 | }
287 | #write>h6.md-focus:before{
288 | 	left: -1.5625rem;
289 | 	top: .285714286rem;
290 | }
291 | .md-image>.md-meta {
292 |     /*border: 1px solid #ddd;*/
293 |     border-radius: 3px;
294 |     padding: 2px 0px 0px 4px;
295 |     font-size: 0.9em;
296 |     color: inherit;
297 | }
298 | 
299 | .md-tag {
300 |     color: #a7a7a7;
301 |     opacity: 1;
302 | }
303 | 
304 | .md-toc { 
305 |     margin-top:20px;
306 |     padding-bottom:20px;
307 | }
308 | 
309 | .sidebar-tabs {
310 |     border-bottom: none;
311 | }
312 | 
313 | #typora-quick-open {
314 |     border: 1px solid #ddd;
315 |     background-color: #f8f8f8;
316 | }
317 | 
318 | #typora-quick-open-item {
319 |     background-color: #FAFAFA;
320 |     border-color: #FEFEFE #e5e5e5 #e5e5e5 #eee;
321 |     border-style: solid;
322 |     border-width: 1px;
323 | }
324 | 
325 | /** focus mode */
326 | .on-focus-mode blockquote {
327 |     border-left-color: rgba(85, 85, 85, 0.12);
328 | }
329 | 
330 | header, .context-menu, .megamenu-content, footer{
331 |     font-family: "Segoe UI", "Arial", sans-serif;
332 | }
333 | 
334 | .file-node-content:hover .file-node-icon,
335 | .file-node-content:hover .file-node-open-state{
336 |     visibility: visible;
337 | }
338 | 
339 | .mac-seamless-mode #typora-sidebar {
340 |     background-color: #fafafa;
341 |     background-color: var(--side-bar-bg-color);
342 | }
343 | 
344 | .md-lang {
345 |     color: #b4654d;
346 | }
347 | 
348 | .html-for-mac .context-menu {
349 |     --item-hover-bg-color: #E6F0FE;
350 | }
351 | 
352 | #md-notification .btn {
353 |     border: 0;
354 | }
355 | 
356 | .dropdown-menu .divider {
357 |     border-color: #e5e5e5;
358 | }


--------------------------------------------------------------------------------
/Tools/dspci:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/dspci


--------------------------------------------------------------------------------
/Tools/gfxutil:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/gfxutil


--------------------------------------------------------------------------------
/Tools/hda-verb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/hda-verb


--------------------------------------------------------------------------------
/Tools/iasl-RM:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/iasl-RM


--------------------------------------------------------------------------------
/Tools/iasl63:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/iasl63


--------------------------------------------------------------------------------
/Tools/icloud_cache_clean.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | sudo rm -rf ~/Library/Caches/com.apple.iCloudHelper*
 3 | sudo rm -rf ~/Library/Caches/com.apple.Messages*
 4 | sudo rm -rf ~/Library/Caches/com.apple.imfoundation.IMRemoteURLConnectionAgent*
 5 | sudo rm -rf ~/Library/Preferences/com.apple.iChat*
 6 | sudo rm -rf ~/Library/Preferences/com.apple.icloud*
 7 | sudo rm -rf ~/Library/Preferences/com.apple.imagent*
 8 | sudo rm -rf ~/Library/Preferences/com.apple.imessage*
 9 | sudo rm -rf ~/Library/Preferences/com.apple.imservice*
10 | sudo rm -rf ~/Library/Preferences/com.apple.ids.service*
11 | sudo rm -rf ~/Library/Preferences/com.apple.madrid.plist*
12 | sudo rm -rf ~/Library/Preferences/com.apple.imessage.bag.plist*
13 | sudo rm -rf ~/Library/Preferences/com.apple.identityserviced*
14 | sudo rm -rf ~/Library/Preferences/com.apple.ids.service*
15 | sudo rm -rf ~/Library/Preferences/com.apple.security*
16 | sudo rm -rf ~/Library/Messages
17 | 
18 | 


--------------------------------------------------------------------------------
/Tools/installScript_1014fullapp:
--------------------------------------------------------------------------------
  1 | #!/bin/sh
  2 | printf '\033[8;60;165t'
  3 | clear
  4 | 
  5 | #
  6 | # This script is refer to Pike R. Alpha's work as follow, also thanks to Pike R. Alpha.       by crazybirdy. v5.20180605
  7 | #
  8 | 
  9 | ########################################################################################################################
 10 | # https://github.com/Piker-Alpha/HandyScripts/blob/master/installScriptTemplate.sh                                     #
 11 | # Bash script to download macOS High Sierra installation packages from sucatalog.gz and build the installer.pkg for it.#
 12 | # version 2.1 - Copyright (c) 2017 by Pike R. Alpha (PikeRAlpha@yahoo.com)                                             #
 13 | ########################################################################################################################
 14 | 
 15 | #
 16 | # Bash script to download macOS High Sierra installation packages from sucatalog.gz and build the installer.pkg for it.
 17 | #
 18 | # version 2.1 - Copyright (c) 2017 by Pike R. Alpha (PikeRAlpha@yahoo.com)
 19 | #
 20 | # Updates:
 21 | #
 22 | #       - Creates a seedEnrollement.plist when missing.
 23 | #       - Volume picker for seedEnrollement.plist added.
 24 | #       - Added sudo to 'open installer.pkg' to remedy authorisation problems.
 25 | #       - Fix for volume names with a space in it. Thanks to:
 26 | #       - https://pikeralpha.wordpress.com/2017/06/22/script-to-upgrade-macos-high-sierra-dp1-to-dp2/#comment-10216)
 27 | #       - Add file checks so that we only download the missing files.
 28 | #       - Polished up comments.
 29 | #       - Changed key, salt, target files and version (now v1.5).
 30 | #       - Now calling the installer.app with -pkg -target instead of open to prevent failures.
 31 | #       - Fixed path to distribution file.
 32 | #       - Checks for missing files added.
 33 | #       - Updated version number (now v1.6).
 34 | #       - Removing unused (initialisation of a) variable.
 35 | #       - Improved verbose output.
 36 | #       - Updated version number (now v1.7).
 37 | #       - Fix installer breakage.
 38 | #       - Updated version number (now v1.8).
 39 | #       - Opt out for firmware added.
 40 | #       - Changed version number (now v1.9).
 41 | #       - Opt in/out for APFS conversion added.
 42 | #       - Changed version number (now v2.0).
 43 | #       - Variables 'version' and 'salt' added.
 44 | #       - Checks for newly added variables added.
 45 | #       - Changed version number (now v2.1).
 46 | #
 47 | 
 48 | # CatalogURL for Developer Program Members
 49 | # https://swscan.apple.com/content/catalogs/others/index-10.13seed-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
 50 | #
 51 | # CatalogURL for Beta Program Members
 52 | # https://swscan.apple.com/content/catalogs/others/index-10.13beta-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
 53 | #
 54 | # CatalogURL for Regular Software Updates
 55 | # https://swscan.apple.com/content/catalogs/others/index-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
 56 | #
 57 | # CatalogURL for Customer Seed Updates
 58 | # https://swscan.apple.com/content/catalogs/others/index-10.13customerseed-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
 59 | 
 60 | #
 61 | # Tip: In case you run into the ERROR_7E7AEE96CA error then you need to change the ProductVersion and 
 62 | # in /System/Library/CoreServices/SystemVersion.plist to 10.13
 63 | #
 64 | 
 65 | #
 66 | # http://telegra.ph/Download-macOS-Mojave-Beta-2-wo-Accessing-Mac-App-Store-06-24
 67 | #
 68 | 
 69 | printred() {
 70 |   printf "\e[1;31m${1}\e[0m"
 71 | }
 72 | printgreen() {
 73 |   printf "\e[1;32m${1}\e[0m"
 74 | }
 75 | printyellow() {
 76 |   printf "\e[1;33m${1}\e[0m"
 77 | }
 78 | printblue() {
 79 |   printf "\e[1;34m${1}\e[0m"
 80 | }
 81 | printpurple() {
 82 |   printf "\e[1;35m${1}\e[0m"
 83 | }
 84 | printLatest() {
 85 |   printf "\e[1;31m${1}\e[0m"
 86 | }
 87 | 
 88 | echo 
 89 | printf "从 swscan.apple.com 下载完整安装app.    Download the full installer app from swscan.apple.com.\n"
 90 | echo 
 91 | 
 92 | # CatalogURL for Regular Software Updates
 93 | CatalogURLRegular="https://swscan.apple.com/content/catalogs/others/index-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz"
 94 | # CatalogURL for Public Beta Program Members
 95 | CatalogURLPublic="https://swscan.apple.com/content/catalogs/others/index-10.14beta-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz"
 96 | # CatalogURL for Developer Beta Program Members
 97 | CatalogURLDeveloper="https://swscan.apple.com/content/catalogs/others/index-10.14seed-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz"
 98 | 
 99 | echo
100 | printred "1.选用 正式版 下载渠道。\n"
101 | printred "1.Use CatalogURL for Regular Software Updates\n"
102 | echo "  ${CatalogURLRegular}"
103 | echo
104 | printred "2.选用 公開测试版 下载渠道。\n"
105 | printred "2.Use CatalogURL for Public Beta Program Members\n"
106 | echo "  ${CatalogURLPublic}"
107 | echo
108 | printred "3.选用 开发者测试版 下载渠道。\n"
109 | printred "3.Use CatalogURL for Developer Beta Program Members\n"
110 | echo "  ${CatalogURLDeveloper}"
111 | echo
112 | read -p "请选择 要下载的 版本  Select the CatalogURL ( 1 / 2 / 3 ) : " macOSver
113 | 
114 | case $macOSver in
115 |   1)
116 |     # CatalogURL for Regular Software Updates
117 |     CatalogURL="${CatalogURLRegular}"
118 |     CatalogURLver="正式版 下载渠道 Regular Software Updates"
119 |   ;;
120 |   2)
121 |     # CatalogURL for Developer Beta Program Members
122 |     CatalogURL="${CatalogURLPublic}"
123 |     CatalogURLver="公開测试版 下载渠道 Public Beta Updates"
124 |   ;;
125 |   3)
126 |     # CatalogURL for Developer Beta Program Members
127 |     CatalogURL="${CatalogURLDeveloper}"
128 |     CatalogURLver="开发者测试版 下载渠道 Developer Beta Updates"
129 |   ;;
130 |   *)
131 |     # CatalogURL for Regular Software Updates
132 |     CatalogURL="${CatalogURLRegular}"
133 |     CatalogURLver="正式版 下载渠道 Regular Software Updates"
134 |   ;;
135 | esac
136 | 
137 | echo
138 | printf "选用版本  The selected CatalogURL:  \e[1;32m$CatalogURLver\e[0m\n"
139 | echo "  ${CatalogURL}"
140 | echo
141 | echo
142 | echo "正在搜寻更新,请耐心等候! Searching for updates from catalogs of swscan.apple.com. Be patient!"
143 | echo 
144 | 
145 | cd /tmp
146 | rm -f fullapp-catalogs
147 | rm -f fullapp-catalogs.gz
148 | axel -a -n 10 ${CatalogURL} -o fullapp-catalogs.gz 2>/dev/null
149 | 
150 | found404=`cat fullapp-catalogs.gz | grep Not | grep Found `
151 | if [[ ! $found404 == "" ]]; then
152 |     printf "  未找到  Not found the CatalogURL: \e[1;32m$CatalogURLver\e[0m\n"
153 |     echo
154 |     exit
155 | fi
156 | 
157 | gunzip fullapp-catalogs.gz
158 | 
159 | macOSdmgAll[0]=`cat /tmp/fullapp-catalogs | grep BaseSystem.dmg | grep -v integrityData | sed 's/<string>//' | sed 's/<\/string>//' | awk '{print $1;}' | awk NR==1 `
160 | macOSdmgAll[1]=`cat /tmp/fullapp-catalogs | grep BaseSystem.dmg | grep -v integrityData | sed 's/<string>//' | sed 's/<\/string>//' | awk '{print $1;}' | awk NR==2 `
161 | macOSdmgAll[2]=`cat /tmp/fullapp-catalogs | grep BaseSystem.dmg | grep -v integrityData | sed 's/<string>//' | sed 's/<\/string>//' | awk '{print $1;}' | awk NR==3 `
162 | macOSdmgAll[3]=`cat /tmp/fullapp-catalogs | grep BaseSystem.dmg | grep -v integrityData | sed 's/<string>//' | sed 's/<\/string>//' | awk '{print $1;}' | awk NR==4 `
163 | macOSdmgAll[4]=`cat /tmp/fullapp-catalogs | grep BaseSystem.dmg | grep -v integrityData | sed 's/<string>//' | sed 's/<\/string>//' | awk '{print $1;}' | awk NR==5 `
164 | macOSdmgAll[5]=`cat /tmp/fullapp-catalogs | grep BaseSystem.dmg | grep -v integrityData | sed 's/<string>//' | sed 's/<\/string>//' | awk '{print $1;}' | awk NR==6 `
165 | macOSdmgAll[6]=`cat /tmp/fullapp-catalogs | grep BaseSystem.dmg | grep -v integrityData | sed 's/<string>//' | sed 's/<\/string>//' | awk '{print $1;}' | awk NR==7 `
166 | macOSdmgAll[7]=`cat /tmp/fullapp-catalogs | grep BaseSystem.dmg | grep -v integrityData | sed 's/<string>//' | sed 's/<\/string>//' | awk '{print $1;}' | awk NR==8 `
167 | macOSdmgAll[8]=`cat /tmp/fullapp-catalogs | grep BaseSystem.dmg | grep -v integrityData | sed 's/<string>//' | sed 's/<\/string>//' | awk '{print $1;}' | awk NR==9 `
168 | macOSdmgAll[9]=`cat /tmp/fullapp-catalogs | grep BaseSystem.dmg | grep -v integrityData | sed 's/<string>//' | sed 's/<\/string>//' | awk '{print $1;}' | awk NR==10 `
169 | 
170 | macOSdmg=($(echo "${macOSdmgAll[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' '))
171 | 
172 | index=0
173 | for macOSdmglist in "${macOSdmg[@]}"
174 | do
175 |   if [ ! $macOSdmglist == "" ]; then
176 | 
177 |     macOSUpdver[$index]=`echo $macOSdmglist | sed 's/\// /g' | awk '{print $9;}' | sed 's/macOSUpd//' | sed 's/.pkg//' `
178 | 
179 |     macOSUpdversion1[$index]=`echo $macOSdmglist | sed 's/\// /g' | awk '{print $5;}' `
180 |     macOSUpdversion2[$index]=`echo $macOSdmglist | sed 's/\// /g' | awk '{print $6;}' `
181 |     macOSUpdversion[$index]="${macOSUpdversion1[$index]}/${macOSUpdversion2[$index]}"
182 |     macOSUpdkey[$index]=`echo $macOSdmglist | sed 's/\// /g' | awk '{print $7;}' `
183 |     macOSUpdsalt[$index]=`echo $macOSdmglist | sed 's/\// /g' | awk '{print $8;}' `
184 | 
185 |     url="https://swdist.apple.com/content/downloads/${macOSUpdversion[$index]}/${macOSUpdkey[$index]}/${macOSUpdsalt[$index]}/"
186 |     distribution="${macOSUpdkey[$index]}.English.dist"
187 |     rm -f *dist
188 |     axel -a -n 10 $url$distribution -o ${macOSUpdkey[$index]}.English.dist 2>/dev/null
189 |     macOSupdateosver[$index]=`cat ${macOSUpdkey[$index]}.English.dist | grep InstallAssistantAuto | grep version | awk '{print $4;}' | sed 's/version="//' | sed 's/.\{7\}/& /g' | awk '{print $1;}' `
190 |     macOSupdatebeta[$index]=`cat ${macOSUpdkey[$index]}.English.dist | grep SU_TITLE | grep strings | grep macOS | sed 's/<strings language="English">"SU_TITLE" = "//' | sed 's/";//' | sed 's/Install //' | sed 's/    //' | sed 's/    //' | sed 's/  //' `
191 |     macOSupdatebuildver[$index]=`cat ${macOSUpdkey[$index]}.English.dist | grep -A1 BUILD | grep -A1 key | grep string | sed 's/<string>//' | sed 's/<\/string>//' | awk '{print $1;}' `
192 | 
193 |     rm -f *dist
194 | 
195 |     macOSupdatebuildver[$index]="${macOSupdateosver[$index]}.${macOSupdatebuildver[$index]}"
196 | 
197 |     BaseSystem[$index]=`cat /tmp/fullapp-catalogs | grep "${macOSUpdversion[$index]}" | grep "${macOSUpdkey[$index]}" | grep "${macOSUpdsalt[$index]}" | grep BaseSystem.dmg | grep -v integrityData | sed 's/.dmg//' | sed 's/<string>//' | sed 's/<\/string>//' | sed 's/\// /g' | awk '{print $9;}' `
198 |     macOSuptime[$index]=`cat /tmp/fullapp-catalogs | grep -A 5 PostDate | grep -B 7 $url${macOSUpdkey[$index]} | grep \<date\>  | sed 's/<date>//' | sed 's/<\/date>//' | awk '{print $1;}' | sed 's/T/ /' | sed 's/Z//' | awk NR==1 `
199 |     macOSupdate[$index]="${macOSuptime[$index]} .. ${macOSUpdkey[$index]} .. ${macOSupdatebuildver[$index]} ${macOSupdatebeta[$index]}"
200 | 
201 |     macOSlist[$index]=`echo ${macOSdmglist} `
202 | 
203 |     let index++
204 |   fi
205 | done
206 | 
207 | index=0
208 | for list in "${macOSupdate[@]}"
209 | do
210 |   echo "${macOSlist[$index]}"
211 |   let index++
212 | done
213 | 
214 | indexupdatever=0
215 | Latestupdatever=0
216 | for updatever in "${macOSupdatebuildver[@]}"
217 | do
218 |   if [ $updatever \> $Latestupdatever ]; then
219 |     Latestupdatever=${macOSupdatebuildver[$indexupdatever]}
220 |     Latestupdatebeta=${macOSupdatebeta[$indexupdatever]}
221 |   fi
222 |   let indexupdatever++
223 | done
224 | 
225 | echo
226 | printf "最新版本 The latest version: \e[1;32m$Latestupdatever $Latestupdatebeta\e[0m\n"
227 | 
228 | echo
229 | echo "可选择下载的版本 Available version to downlaod:"
230 | echo
231 | 
232 | indexmenu=0
233 | for updateselect in "${macOSupdate[@]}"
234 | do
235 |   if [ ${macOSupdatebuildver[$indexmenu]} == $Latestupdatever ]; then
236 |     printLatest "[ $indexmenu ] ${updateselect}"
237 |     echo
238 |   else
239 |     echo "[ $indexmenu ] ${updateselect}"
240 |   fi
241 |   checkdownloadver[$indexmenu]=$indexmenu
242 |   let indexmenu++
243 | done
244 | 
245 | echo
246 | read -p "选择要下载的版本 Select one version to downlaod: " downloadver
247 | if [ ! $downloadver ]; then
248 |   echo
249 |   echo "发生错误!!!                          Error!!!"
250 |   echo
251 |   echo "请选择正确下载的版本。                  Please select right version to downlaod."
252 |   echo
253 |   rm -f fullapp-catalogs
254 |   exit 0
255 | fi
256 | 
257 | checkfine=no
258 | checkindex=0
259 | for checkindex in "${checkdownloadver[@]}"
260 | do
261 |   if [ $downloadver == $checkindex ]; then
262 |     checkfine=yes
263 |   fi
264 |   let checkindex++
265 | done
266 | if [ $checkfine == no ]; then
267 |   echo
268 |   echo "发生错误!!!                          Error!!!"
269 |   echo
270 |   echo "请选择正确下载的版本。                  Please select right version to downlaod."
271 |   echo
272 |   rm -f fullapp-catalogs
273 |   exit 0
274 | fi
275 | 
276 | updatever="${macOSUpdver[$downloadver]}"
277 | version="${macOSUpdversion[$downloadver]}"
278 | key="${macOSUpdkey[$downloadver]}"
279 | salt="${macOSUpdsalt[$downloadver]}"
280 | echo "                                               [ $downloadver ] ${macOSupdate[$downloadver]}"
281 | 
282 | distribution=`cat /tmp/fullapp-catalogs | grep "${version}" | grep "${key}" | grep "${salt}" | grep English | sed 's/<string>//' | sed 's/<\/string>//' | sed 's/\// /g' | awk '{print $9;}' `
283 | 
284 |   targetFiles[0]=`cat /tmp/fullapp-catalogs | grep "${version}" | grep "${key}" | grep "${salt}" | grep -v integrityData | grep InstallAssistantAuto.pkg | sed 's/<string>//' | sed 's/<\/string>//' | sed 's/\// /g' | awk '{print $9;}' | awk NR==1 `
285 |   targetFiles[1]=`cat /tmp/fullapp-catalogs | grep "${version}" | grep "${key}" | grep "${salt}" | grep -v integrityData | grep AppleDiagnostics.chunklist | sed 's/<string>//' | sed 's/<\/string>//' | sed 's/\// /g' | awk '{print $9;}' | awk NR==1 `
286 |   targetFiles[2]=`cat /tmp/fullapp-catalogs | grep "${version}" | grep "${key}" | grep "${salt}" | grep -v integrityData | grep AppleDiagnostics.dmg | sed 's/<string>//' | sed 's/<\/string>//' | sed 's/\// /g' | awk '{print $9;}' | awk NR==1 `
287 |   targetFiles[3]=`cat /tmp/fullapp-catalogs | grep "${version}" | grep "${key}" | grep "${salt}" | grep -v integrityData | grep BaseSystem.chunklist | sed 's/<string>//' | sed 's/<\/string>//' | sed 's/\// /g' | awk '{print $9;}' | awk NR==1 `
288 |   targetFiles[4]=`cat /tmp/fullapp-catalogs | grep "${version}" | grep "${key}" | grep "${salt}" | grep -v integrityData | grep BaseSystem.dmg | sed 's/<string>//' | sed 's/<\/string>//' | sed 's/\// /g' | awk '{print $9;}' | awk NR==1 `
289 |   targetFiles[5]=`cat /tmp/fullapp-catalogs | grep "${version}" | grep "${key}" | grep "${salt}" | grep -v integrityData | grep InstallESDDmg.pkg | sed 's/<string>//' | sed 's/<\/string>//' | sed 's/\// /g' | awk '{print $9;}' | awk NR==1 `
290 | 
291 | rm -f fullapp-catalogs
292 | cd
293 | 
294 | #
295 | # Initialisation of a variable (our target folder).
296 | #
297 | tmpDirectory="/tmp"
298 | 
299 | #
300 | # URL copied from sucatalog.gz (think CatalogURL).
301 | #
302 | url="https://swdist.apple.com/content/downloads/${version}/${key}/${salt}/"
303 | 
304 | #
305 | # Target distribution language.
306 | #
307 | distribution="${key}.English.dist"
308 | 
309 | #
310 | # Check target directory.
311 | #
312 | if [ -d "${tmpDirectory}/${key}" ]; then
313 |   rm -rf "${tmpDirectory}/${key}"
314 |   mkdir "${tmpDirectory}/${key}"
315 | fi
316 | if [ ! -d "${tmpDirectory}/${key}" ]; then
317 |   mkdir "${tmpDirectory}/${key}"
318 | fi
319 | open "${tmpDirectory}/${key}"
320 | 
321 | echo 
322 | echo "准备进行下载。Prepare to download the files. [ $downloadver ] ${macOSupdate[$downloadver]}."
323 | echo 
324 | echo "${url}${distribution}"
325 | for filename in "${targetFiles[@]}"
326 | do
327 |   if [ ! $filename == "" ]; then
328 |     echo "${url}$filename"
329 |   fi
330 | done
331 | echo
332 | 
333 | printred "如果你已经发生下载错误,可以 预先手动下载 上列网址文件,并将文件放入 以下 正确的文件夹 即可继续进行。\n"
334 | printred "If get errors of downloading before, you can download files as above URL manually and put into correct folder as below before continuing.\n"
335 | echo
336 | 
337 | echo "${tmpDirectory}/${key}/${distribution}"
338 | for filename in "${targetFiles[@]}"
339 | do
340 |   if [ ! $filename == "" ]; then
341 |     echo "${tmpDirectory}/${key}/$filename"
342 |   fi
343 | done
344 | if [ ! $partitiontype == "FDisk_partition_scheme" ]; then
345 |   echo "${tmpDirectory}/${key}/${RecoverHDPackage}"
346 | fi
347 | echo
348 | 
349 | read -p "手动下载放入上列文件,或由脚本自动下载文件,继续进行?   Put files as above manually or download files automatically, continue? (y/n) " downloadyesno
350 | case "$downloadyesno" in
351 |   y|Y)
352 |     echo
353 |   ;;
354 |   *)
355 |     echo
356 |     echo "停止进行下载!!!               Stop downloading!!!"
357 |     echo
358 |     exit 0
359 |   ;;
360 | esac
361 | 
362 | #
363 | # Download distribution file.
364 | #
365 | if [ ! -e "${tmpDirectory}/${key}/${distribution}" ]; then
366 |   echo "Downloading: ${distribution} ..."
367 |   axel -a -n 64 "${url}${distribution}" -o "${tmpDirectory}/${key}/${distribution}"
368 |   #
369 |   # Remove root only restriction/allow us to install on any target volume.
370 |   #
371 |   cat "${tmpDirectory}/${key}/${distribution}" | sed -e 's|rootVolumeOnly="true"|allow-external-scripts="true"|' > "${tmpDirectory}/${key}/new.dist"
372 | 
373 |   if [ -e "${tmpDirectory}/${key}/new.dist" ]; then
374 |     mv "${tmpDirectory}/${key}/new.dist" "${tmpDirectory}/${key}/${distribution}"
375 |   fi
376 | else
377 |   echo "File: ${distribution} already there, skipping this download."
378 | fi
379 | 
380 | #
381 | # Change to working directory (otherwise it will fail to locate the packages).
382 | #
383 | cd "${tmpDirectory}/${key}"
384 | 
385 | #
386 | # Download target files.
387 | #
388 | for filename in "${targetFiles[@]}"
389 | do
390 |   if [ ! $filename == "" ]; then
391 |     if [ ! -e "${tmpDirectory}/${key}/${filename}" ]; then
392 |       echo "Downloading: ${filename} ..."
393 |       axel -a -n 64 "${url}${filename}" -o "${tmpDirectory}/${key}/${filename}"
394 |     else
395 |       echo "File: ${filename} already there, skipping this download."
396 |     fi
397 |   fi
398 | done
399 | 
400 | username=`whoami`
401 | pkgutil --expand-full InstallAssistantAuto.pkg Installapp
402 | 
403 | cd "${tmpDirectory}/${key}/Installapp/Payload/"
404 | fullappnames=(*)
405 | 
406 | echo
407 | echo "找到 Found ...... ${fullappnames}"
408 | echo
409 | 
410 | for appname in "${fullappnames[@]}"
411 | do
412 |       if [ -e "${tmpDirectory}/${key}/Installapp/Payload/${appname}/Contents/SharedSupport/" ]; then
413 |         mv "${tmpDirectory}/${key}/AppleDiagnostics.chunklist" "${tmpDirectory}/${key}/Installapp/Payload/${appname}/Contents/SharedSupport/"
414 |         mv "${tmpDirectory}/${key}/AppleDiagnostics.dmg" "${tmpDirectory}/${key}/Installapp/Payload/${appname}/Contents/SharedSupport/"
415 |         mv "${tmpDirectory}/${key}/BaseSystem.chunklist" "${tmpDirectory}/${key}/Installapp/Payload/${appname}/Contents/SharedSupport/"
416 |         mv "${tmpDirectory}/${key}/BaseSystem.dmg" "${tmpDirectory}/${key}/Installapp/Payload/${appname}/Contents/SharedSupport/"
417 |         mv "${tmpDirectory}/${key}/InstallESDDmg.pkg" "${tmpDirectory}/${key}/Installapp/Payload/${appname}/Contents/SharedSupport/InstallESD.dmg"
418 |         rm -rf "/Users/${username}/Desktop/App-${macOSupdatebuildver[$downloadver]}"
419 |         mkdir -p "/Users/${username}/Desktop/App-${macOSupdatebuildver[$downloadver]}"
420 |         mv "${tmpDirectory}/${key}/Installapp/Payload/${appname}" "/Users/${username}/Desktop/App-${macOSupdatebuildver[$downloadver]}/"
421 |         newappname="${appname}"
422 |       fi
423 | done
424 | 
425 | echo "/Users/${username}/Desktop/App-${macOSupdatebuildver[$downloadver]}/"
426 | ls -la "/Users/${username}/Desktop/App-${macOSupdatebuildver[$downloadver]}/"
427 | echo
428 | echo "/Users/${username}/Desktop/App-${macOSupdatebuildver[$downloadver]}/${newappname}/Contents/SharedSupport/"
429 | ls -la "/Users/${username}/Desktop/App-${macOSupdatebuildver[$downloadver]}/${newappname}/Contents/SharedSupport/"
430 | open "/Users/${username}/Desktop/App-${macOSupdatebuildver[$downloadver]}/"
431 | 
432 | echo
433 | echo "完整安装app 存放在 /Users/${username}/Desktop/App-${macOSupdatebuildver[$downloadver]}/"
434 | echo "The full installer app is located on /Users/${username}/Desktop/App-${macOSupdatebuildver[$downloadver]}/"
435 | echo
436 | printf "\e[1;34mMake sure you get the full installer without any errors during the downloading process.\e[0m\n"
437 | printf "\e[1;34m1.check the received sizes of each file, make sure they’re all 100 downloaded.\e[0m\n"
438 | printf "\e[1;34m2.if any one of the files \e[0m\e[1;31mgets error\e[0m\e[1;34m during the downloading process,\e[0m\n"
439 | printf "\e[1;34m  and\e[0m \e[1;31mdidn’t get 100 downloaded,\e[0m\e[1;34m you\e[0m \e[1;31mneed to re-download the full installer app again.\e[0m\n"
440 | echo
441 | exit 0
442 | 


--------------------------------------------------------------------------------
/Tools/installScript_allfullapp:
--------------------------------------------------------------------------------
  1 | #!/bin/sh
  2 | printf '\033[8;60;165t'
  3 | clear
  4 | 
  5 | #
  6 | # This script is refer to Pike R. Alpha's work as follow, also thanks to Pike R. Alpha.       by crazybirdy. v8.20190911
  7 | #
  8 | 
  9 | ########################################################################################################################
 10 | # https://github.com/Piker-Alpha/HandyScripts/blob/master/installScriptTemplate.sh                                     #
 11 | # Bash script to download macOS High Sierra installation packages from sucatalog.gz and build the installer.pkg for it.#
 12 | # version 2.1 - Copyright (c) 2017 by Pike R. Alpha (PikeRAlpha@yahoo.com)                                             #
 13 | ########################################################################################################################
 14 | 
 15 | printred() {
 16 |   printf "\e[1;31m${1}\e[0m"
 17 | }
 18 | printgreen() {
 19 |   printf "\e[1;32m${1}\e[0m"
 20 | }
 21 | printyellow() {
 22 |   printf "\e[1;33m${1}\e[0m"
 23 | }
 24 | printblue() {
 25 |   printf "\e[1;34m${1}\e[0m"
 26 | }
 27 | printpurple() {
 28 |   printf "\e[1;35m${1}\e[0m"
 29 | }
 30 | printLatest() {
 31 |   printf "\e[1;31m${1}\e[0m"
 32 | }
 33 | function headline()
 34 | {
 35 |   echo 
 36 |   printf "從 swscan.apple.com 下載完整安裝app.    Download the full installer app from swscan.apple.com.\n"
 37 |   echo 
 38 | }
 39 | function catalogselect()
 40 | {
 41 |   CatalogURLarray=(
 42 |   # CatalogURL for Regular Software Updates 10.13 10.14 10.16
 43 |   https://swscan.apple.com/content/catalogs/others/index-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
 44 |   https://swscan.apple.com/content/catalogs/others/index-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
 45 |   https://swscan.apple.com/content/catalogs/others/index-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
 46 |   https://swscan.apple.com/content/catalogs/others/index-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog
 47 |   # CatalogURL for Public Beta Program Members 10.16
 48 |   https://swscan.apple.com/content/catalogs/others/index-10.16beta-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog
 49 |   #https://swscan.apple.com/content/catalogs/others/index-10.15beta-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
 50 |   # CatalogURL for Developer Beta Program Members 10.16
 51 |   https://swscan.apple.com/content/catalogs/others/index-10.16seed-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog
 52 |   #https://swscan.apple.com/content/catalogs/others/index-10.15seed-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
 53 |   # CatalogURL for Customer Seed Updates 10.16
 54 |   https://swscan.apple.com/content/catalogs/others/index-10.16customerseed-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog
 55 |   #https://swscan.apple.com/content/catalogs/others/index-10.15customerseed-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz
 56 |   )
 57 | 
 58 |   echo "正在搜尋完整安裝app,請耐心等候! Searching for full installer app from catalogs of swscan.apple.com. Be patient!"
 59 |   echo 
 60 | 
 61 |   cd /private/tmp
 62 |   rm -f fullapp-*
 63 |   echo "new"> /private/tmp/fullapp-catalogs
 64 | 
 65 |   let index=0
 66 |   for element in "${CatalogURLarray[@]}"; do
 67 |     curl ${element} -o fullapp-catalogs-$index.gz 2>/dev/null
 68 |     found404=`cat fullapp-catalogs-$index.gz | grep Not | grep Found `
 69 |     if [[  $found404 == "" ]]; then
 70 |       gunzip fullapp-catalogs-$index.gz
 71 |     fi
 72 |     cat /private/tmp/fullapp-catalogs-$index >> /private/tmp/fullapp-catalogs
 73 |     let index++
 74 |   done
 75 |   rm -f /private/tmp/fullapp-catalogs-*
 76 |   catalogfile="/private/tmp/fullapp-catalogs"
 77 | }
 78 | function fullapparray()
 79 | {
 80 | 	macOSdmgAllArray=`cat ${catalogfile} | grep BaseSystem.dmg | grep -v integrityData | sed 's/<string>//g' | sed 's/<\/string>//g' | awk '{print $1;}'`
 81 | 	let index=0
 82 | 	for element in "${macOSdmgAllArray[@]}"; do
 83 | 		macOSdmgAAll[$index]="${element}"
 84 | 		let index++
 85 | 	done
 86 | 
 87 | 	macOSdmgA=($(echo "${macOSdmgAAll[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' '))
 88 | 
 89 | 	index=0
 90 | 	for macOSdmglist in "${macOSdmgA[@]}"
 91 | 	do
 92 | 		if [[ ! $macOSdmglist == "" ]]; then
 93 | 			macOSdmgpath=${macOSdmglist%%'BaseSystem.dmg'*}
 94 | 
 95 | 			macOSUpdkey[$index]=`echo $macOSdmglist | sed 's/\// /g' | awk '{print $7;}' `
 96 | 			macOSUpdkeydistribution[$index]=`echo ${macOSUpdkey[$index]} | sed 's/.\{9\}/& /g' | awk '{print $1;}' `
 97 | 
 98 | 			url="${macOSdmgpath}"
 99 | 			distribution="${macOSUpdkeydistribution[$index]}.English.dist"
100 | 			rm -f *dist
101 | 
102 | 			curl $url$distribution -o ${macOSUpdkeydistribution[$index]}.English.dist 2>/dev/null
103 | 			macOSupdateosver[$index]=`cat ${macOSUpdkeydistribution[$index]}.English.dist | grep InstallAssistantAuto | grep version | awk '{print $4;}' | sed 's/version="//g' | sed 's/.\{7\}/& /g' | awk '{print $1;}' `
104 | 			macOSupdatebuildver[$index]=`cat ${macOSUpdkeydistribution[$index]}.English.dist | grep -A1 BUILD | grep -A1 key | grep string | sed 's/<string>//g' | sed 's/<\/string>//g' | awk '{print $1;}' `
105 | 			macOSupdatebeta[$index]=`cat ${macOSUpdkeydistribution[$index]}.English.dist | grep SU_TITLE | grep strings | grep macOS | grep Beta | sed 's/<strings language="English">"SU_TITLE" = "//g' | sed 's/";//g' | sed 's/Install //g' | sed 's/    //g' | sed 's/    //g' | sed 's/  //g' `
106 | 			rm -f *dist
107 | 
108 | 			macOSupdatebuildver[$index]="${macOSupdateosver[$index]}.${macOSupdatebuildver[$index]}"
109 | 
110 | 			macOSver=`echo ${macOSupdateosver[$index]} | sed 's/.\{5\}/& /g' | awk '{print $1;}' `
111 | 			if [[ ${macOSver} < 10.15 ]]; then
112 | 				if [[ ${macOSupdatebeta[$index]} == "" ]]; then
113 | 					macOSdmgBAll[$index]="${macOSupdatebuildver[$index]}=${macOSdmglist}"
114 | 					let index++
115 | 				fi 
116 | 			elif [[ ${macOSver} > 10.14 ]]; then
117 | 				macOSdmgBAll[$index]="${macOSupdatebuildver[$index]}=${macOSdmglist}"
118 | 				let index++
119 | 			fi
120 | 		fi
121 | 	done
122 | 	
123 | 	macOSdmgB=($(echo "${macOSdmgBAll[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' '))
124 | 
125 | 	index=0
126 | 	for macOSdmglist in "${macOSdmgB[@]}"
127 | 	do
128 | 		if [[ ! $macOSdmglist == "" ]]; then
129 | 			macOSdmg[$index]=`echo $macOSdmglist | sed 's/=/ /g' | awk '{print $2;}' `
130 | 			let index++
131 | 		fi
132 | 	done
133 | }
134 | function fullapplist()
135 | {
136 |   index=0
137 |   for macOSdmglist in "${macOSdmg[@]}"
138 |   do
139 |     if [[ ! $macOSdmglist == "" ]]; then
140 |       macOSUpdver[$index]=`echo $macOSdmglist | sed 's/\// /g' | awk '{print $9;}' | sed 's/macOSUpd//g' | sed 's/.pkg//g' `
141 |       macOSUpdversion1[$index]=`echo $macOSdmglist | sed 's/\// /g' | awk '{print $5;}' `
142 |       macOSUpdversion2[$index]=`echo $macOSdmglist | sed 's/\// /g' | awk '{print $6;}' `
143 |       macOSUpdversion[$index]="${macOSUpdversion1[$index]}/${macOSUpdversion2[$index]}"
144 |       macOSUpdkey[$index]=`echo $macOSdmglist | sed 's/\// /g' | awk '{print $7;}' `
145 |       macOSUpdkeydistribution[$index]=`echo ${macOSUpdkey[$index]} | sed 's/.\{9\}/& /g' | awk '{print $1;}' `
146 |       macOSUpdsalt[$index]=`echo $macOSdmglist | sed 's/\// /g' | awk '{print $8;}' `
147 | 
148 |       url="https://swdist.apple.com/content/downloads/${macOSUpdversion[$index]}/${macOSUpdkey[$index]}/${macOSUpdsalt[$index]}/"
149 |       distribution="${macOSUpdkeydistribution[$index]}.English.dist"
150 |       rm -f *dist
151 | 
152 |       curl $url$distribution -o ${macOSUpdkeydistribution[$index]}.English.dist 2>/dev/null
153 |       macOSupdateosver[$index]=`cat ${macOSUpdkeydistribution[$index]}.English.dist | grep InstallAssistantAuto | grep version | awk '{print $4;}' | sed 's/version="//g' | sed 's/.\{7\}/& /g' | awk '{print $1;}' `
154 |       macOSupdatebeta[$index]=`cat ${macOSUpdkeydistribution[$index]}.English.dist | grep SU_TITLE | grep strings | grep macOS | sed 's/<strings language="English">"SU_TITLE" = "//g' | sed 's/";//g' | sed 's/Install //g' | sed 's/    //g' | sed 's/    //g' | sed 's/  //g' `
155 |       macOSupdatebuildver[$index]=`cat ${macOSUpdkeydistribution[$index]}.English.dist | grep -A1 BUILD | grep -A1 key | grep string | sed 's/<string>//g' | sed 's/<\/string>//g' | awk '{print $1;}' `
156 |       rm -f *dist
157 | 
158 |       macOSupdatebuildver[$index]="${macOSupdateosver[$index]}.${macOSupdatebuildver[$index]}"
159 |       macOSuptime[$index]=`cat ${catalogfile} | grep -A 5 PostDate | grep -B 7 $url${macOSUpdkeydistribution[$index]} | grep \<date\> | sed 's/<date>//g' | sed 's/<\/date>//g' | awk '{print $1;}' | sed 's/T/ /g' | sed 's/Z//g' | awk NR==1 `
160 |       macOSupdate[$index]="${macOSuptime[$index]} .. ${macOSUpdkeydistribution[$index]} .. ${macOSupdatebuildver[$index]} ${macOSupdatebeta[$index]}"
161 |       macOSlist[$index]=`echo ${macOSdmglist} `
162 |       let index++
163 |     fi
164 |   done
165 | 
166 |   index=0
167 |   for list in "${macOSupdate[@]}"
168 |   do
169 |     echo "${macOSlist[$index]}"
170 |     let index++
171 |   done
172 | }
173 | function selectfullappversion()
174 | {
175 |   indexupdatever=0
176 |   Latestupdatever=0
177 |   for updatever in "${macOSupdatebuildver[@]}"
178 |   do
179 |     if [[ $updatever > $Latestupdatever ]]; then
180 |       Latestupdatever=${macOSupdatebuildver[$indexupdatever]}
181 |       Latestupdatebeta=${macOSupdatebeta[$indexupdatever]}
182 |     fi
183 |     let indexupdatever++
184 |   done
185 | 
186 |   echo
187 |   printf "最新版本 The latest version: \e[1;32m$Latestupdatever $Latestupdatebeta\e[0m\n"
188 | 
189 |   echo
190 |   echo "可選擇下載的版本 Available version to downlaod:"
191 |   echo
192 | 
193 |   indexmenu=0
194 |   for updateselect in "${macOSupdate[@]}"
195 |   do
196 |     if [[ ${macOSupdatebuildver[$indexmenu]} == $Latestupdatever ]]; then
197 |       printLatest "[ $indexmenu ] ${updateselect}"
198 |       echo
199 |     else
200 |       echo "[ $indexmenu ] ${updateselect}"
201 |     fi
202 |     checkdownloadver[$indexmenu]=$indexmenu
203 |     let indexmenu++
204 |   done
205 | 
206 |   echo
207 |   read -p "選擇要下載的版本 Select one version to downlaod: " downloadver
208 |   if [[ ! $downloadver ]]; then
209 |     echo
210 |     echo "發生錯誤!!!                          Error!!!"
211 |     echo
212 |     echo "請選擇正確下載的版本。                  Please select right version to downlaod."
213 |     echo
214 |     rm -f ${catalogfile}
215 |     exit 0
216 |   fi
217 | 
218 |   checkfine=no
219 |   checkindex=0
220 |   for checkindex in "${checkdownloadver[@]}"
221 |   do
222 |     if [[ $downloadver == $checkindex ]]; then
223 |       checkfine=yes
224 |     fi
225 |     let checkindex++
226 |   done
227 |   if [[ $checkfine == no ]]; then
228 |     echo
229 |     echo "發生錯誤!!!                          Error!!!"
230 |     echo
231 |     echo "請選擇正確下載的版本。                  Please select right version to downlaod."
232 |     echo
233 |     rm -f ${catalogfile}
234 |     exit 0
235 |   fi
236 | }
237 | function downloadfullapp()
238 | {
239 |   updatever="${macOSUpdver[$downloadver]}"
240 |   version="${macOSUpdversion[$downloadver]}"
241 |   key="${macOSUpdkey[$downloadver]}"
242 |   salt="${macOSUpdsalt[$downloadver]}"
243 |   echo "                                               [ $downloadver ] ${macOSupdate[$downloadver]}"
244 | 
245 |   distribution=`cat ${catalogfile} | grep "${version}" | grep "${key}" | grep "${salt}" | grep English | sed 's/<string>//g' | sed 's/<\/string>//g' | sed 's/\// /g' | awk '{print $9;}' `
246 | 
247 |     targetFiles[0]=`cat ${catalogfile} | grep "${version}" | grep "${key}" | grep "${salt}" | grep -v integrityData | grep InstallAssistantAuto.pkg | sed 's/<string>//g' | sed 's/<\/string>//g' | sed 's/\// /g' | awk '{print $9;}' | awk NR==1 `
248 |     targetFiles[1]=`cat ${catalogfile} | grep "${version}" | grep "${key}" | grep "${salt}" | grep -v integrityData | grep AppleDiagnostics.chunklist | sed 's/<string>//g' | sed 's/<\/string>//g' | sed 's/\// /g' | awk '{print $9;}' | awk NR==1 `
249 |     targetFiles[2]=`cat ${catalogfile} | grep "${version}" | grep "${key}" | grep "${salt}" | grep -v integrityData | grep AppleDiagnostics.dmg | sed 's/<string>//g' | sed 's/<\/string>//g' | sed 's/\// /g' | awk '{print $9;}' | awk NR==1 `
250 |     targetFiles[3]=`cat ${catalogfile} | grep "${version}" | grep "${key}" | grep "${salt}" | grep -v integrityData | grep BaseSystem.chunklist | sed 's/<string>//g' | sed 's/<\/string>//g' | sed 's/\// /g' | awk '{print $9;}' | awk NR==1 `
251 |     targetFiles[4]=`cat ${catalogfile} | grep "${version}" | grep "${key}" | grep "${salt}" | grep -v integrityData | grep BaseSystem.dmg | sed 's/<string>//g' | sed 's/<\/string>//g' | sed 's/\// /g' | awk '{print $9;}' | awk NR==1 `
252 |     targetFiles[5]=`cat ${catalogfile} | grep "${version}" | grep "${key}" | grep "${salt}" | grep -v integrityData | grep InstallESDDmg.pkg | sed 's/<string>//g' | sed 's/<\/string>//g' | sed 's/\// /g' | awk '{print $9;}' | awk NR==1 `
253 | 
254 |   rm -f ${catalogfile}
255 |   cd
256 | 
257 |   #
258 |   # Initialisation of a variable (our target folder).
259 |   #
260 |   tmpDirectory="/private/tmp"
261 | 
262 |   #
263 |   # URL copied from sucatalog.gz (think CatalogURL).
264 |   #
265 |   url="https://swdist.apple.com/content/downloads/${version}/${key}/${salt}/"
266 | 
267 |   #
268 |   # Target distribution language.
269 |   #
270 |   keydistribution=`echo ${key} | sed 's/.\{9\}/& /g' | awk '{print $1;}' `
271 |   distribution="${keydistribution}.English.dist"
272 | 
273 |   #
274 |   # Check target directory.
275 |   #
276 |   if [[ -d "${tmpDirectory}/${key}" ]]; then
277 |     rm -rf "${tmpDirectory}/${key}"
278 |     mkdir "${tmpDirectory}/${key}"
279 |   fi
280 |   if [[ ! -d "${tmpDirectory}/${key}" ]]; then
281 |     mkdir "${tmpDirectory}/${key}"
282 |   fi
283 |   open "${tmpDirectory}/${key}"
284 | 
285 |   echo 
286 |   echo "準備進行下載。Prepare to download the files.   [ $downloadver ] ${macOSupdate[$downloadver]}."
287 |   echo 
288 |   echo "${url}${distribution}"
289 |   for filename in "${targetFiles[@]}"
290 |   do
291 |     if [[ ! $filename == "" ]]; then
292 |       echo "${url}$filename"
293 |     fi
294 |   done
295 |   echo
296 | 
297 |   printred "如果你已經發生下載錯誤,可以 預先手動下載 上列網址文件,並將文件放入 以下 正確的文件夾 即可繼續進行。\n"
298 |   printred "If get errors of downloading before, you can download files as above URL manually and put into correct folder as below before continuing.\n"
299 |   echo
300 | 
301 |   echo "${tmpDirectory}/${key}/${distribution}"
302 |   for filename in "${targetFiles[@]}"
303 |   do
304 |     if [[ ! $filename == "" ]]; then
305 |       echo "${tmpDirectory}/${key}/$filename"
306 |     fi
307 |   done
308 |   echo
309 | 
310 |   read -p "手動下載放入上列文件,或由腳本自動下載文件,繼續進行?   Put files as above manually or download files automatically, continue? (y/n) " downloadyesno
311 |   case "$downloadyesno" in
312 |     y|Y)
313 |       echo
314 |     ;;
315 |     *)
316 |       echo
317 |       echo "停止進行下載!!!               Stop downloading!!!"
318 |       echo
319 |       exit 0
320 |     ;;
321 |   esac
322 | 
323 |   #
324 |   # Download distribution file.
325 |   #
326 |   if [[ ! -e "${tmpDirectory}/${key}/${distribution}" ]]; then
327 |     echo "Downloading: ${distribution} ..."
328 |     axel -n 16 -q "${url}${distribution}" -o "${tmpDirectory}/${key}/${distribution}"
329 |     #
330 |     # Remove root only restriction/allow us to install on any target volume.
331 |     #
332 |     cat "${tmpDirectory}/${key}/${distribution}" | sed -e 's|rootVolumeOnly="true"|allow-external-scripts="true"|' > "${tmpDirectory}/${key}/new.dist"
333 | 
334 |     if [[ -e "${tmpDirectory}/${key}/new.dist" ]]; then
335 |       mv "${tmpDirectory}/${key}/new.dist" "${tmpDirectory}/${key}/${distribution}"
336 |     fi
337 |   else
338 |     echo "File: ${distribution} already there, skipping this download."
339 |   fi
340 | 
341 |   #
342 |   # Change to working directory (otherwise it will fail to locate the packages).
343 |   #
344 |   cd "${tmpDirectory}/${key}"
345 | 
346 |   #
347 |   # Download target files.
348 |   #
349 |   for filename in "${targetFiles[@]}"
350 |   do
351 |     if [[ ! $filename == "" ]]; then
352 |       if [[ ! -e "${tmpDirectory}/${key}/${filename}" ]]; then
353 |         echo "Downloading: ${filename} ..."
354 |         axel -n 16 -a "${url}${filename}" -o "${tmpDirectory}/${key}/${filename}"
355 |       else
356 |         echo "File: ${filename} already there, skipping this download."
357 |       fi
358 |     fi
359 |   done
360 | 
361 |   pkgutil --expand-full InstallAssistantAuto.pkg Installapp
362 | 
363 |   cd "${tmpDirectory}/${key}/Installapp/Payload/"
364 |   fullappnames=(*)
365 | 
366 |   echo
367 |   echo "找到 Found ...... ${fullappnames}"
368 |   echo
369 | 
370 |   for appname in "${fullappnames[@]}"
371 |   do
372 |         if [[ -e "${tmpDirectory}/${key}/Installapp/Payload/${appname}/Contents/SharedSupport/" ]]; then
373 |           mv "${tmpDirectory}/${key}/AppleDiagnostics.chunklist" "${tmpDirectory}/${key}/Installapp/Payload/${appname}/Contents/SharedSupport/"
374 |           mv "${tmpDirectory}/${key}/AppleDiagnostics.dmg" "${tmpDirectory}/${key}/Installapp/Payload/${appname}/Contents/SharedSupport/"
375 |           mv "${tmpDirectory}/${key}/BaseSystem.chunklist" "${tmpDirectory}/${key}/Installapp/Payload/${appname}/Contents/SharedSupport/"
376 |           mv "${tmpDirectory}/${key}/BaseSystem.dmg" "${tmpDirectory}/${key}/Installapp/Payload/${appname}/Contents/SharedSupport/"
377 |           mv "${tmpDirectory}/${key}/InstallESDDmg.pkg" "${tmpDirectory}/${key}/Installapp/Payload/${appname}/Contents/SharedSupport/InstallESD.dmg"
378 |           rm -rf "$HOME/Desktop/App-${macOSupdatebuildver[$downloadver]}"
379 |           mkdir -p "$HOME/Desktop/App-${macOSupdatebuildver[$downloadver]}"
380 |           mv "${tmpDirectory}/${key}/Installapp/Payload/${appname}" "$HOME/Desktop/App-${macOSupdatebuildver[$downloadver]}/"
381 |           newappname="${appname}"
382 |         fi
383 |   done
384 | 
385 |   echo "$HOME/Desktop/App-${macOSupdatebuildver[$downloadver]}/"
386 |   ls -la "$HOME/Desktop/App-${macOSupdatebuildver[$downloadver]}/"
387 |   echo
388 |   echo "$HOME/Desktop/App-${macOSupdatebuildver[$downloadver]}/${newappname}/Contents/SharedSupport/"
389 |   ls -la "$HOME/Desktop/App-${macOSupdatebuildver[$downloadver]}/${newappname}/Contents/SharedSupport/"
390 |   open "$HOME/Desktop/App-${macOSupdatebuildver[$downloadver]}/"
391 | 
392 |   echo
393 |   echo "完整安裝app 存放在 $HOME/Desktop/App-${macOSupdatebuildver[$downloadver]}/"
394 |   echo "The full installer app is located on $HOME/Desktop/App-${macOSupdatebuildver[$downloadver]}/"
395 |   echo
396 |   printf "\e[1;34mMake sure you get the full installer without any errors during the downloading process.\e[0m\n"
397 |   printf "\e[1;34m1.check the received sizes of each file, make sure they’re all 100 downloaded.\e[0m\n"
398 |   printf "\e[1;34m2.if any one of the files \e[0m\e[1;31mgets error\e[0m\e[1;34m during the downloading process,\e[0m\n"
399 |   printf "\e[1;34m  and\e[0m \e[1;31mdidn’t get 100 downloaded,\e[0m\e[1;34m you\e[0m \e[1;31mneed to re-download the full installer app again.\e[0m\n"
400 |   echo
401 |   if [[ -d "${tmpDirectory}/${key}" ]]; then
402 |     rm -rf "${tmpDirectory}/${key}"
403 |   fi
404 | }
405 | function main()
406 | {
407 |   headline
408 |   catalogselect
409 |   fullapparray
410 |   fullapplist
411 |   selectfullappversion
412 |   downloadfullapp
413 | }
414 | 
415 | main
416 | 
417 | exit 0


--------------------------------------------------------------------------------
/Tools/macserial:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/macserial


--------------------------------------------------------------------------------
/Tools/mount_efi.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/bash
 2 | 
 3 | #set -x
 4 | 
 5 | # Note: Based on CloverPackage MountESP script.
 6 | 
 7 | if [ "$(id -u)" != "0" ]; then
 8 |     echo "Error: This script requires superuser access, use: 'sudo $0 $@'"
 9 |     exit 1
10 | fi
11 | 
12 | if [ "$1" == "" ]; then
13 |     DestVolume=/
14 | else
15 |     DestVolume="$1"
16 | fi
17 | 
18 | # find whole disk for the destination volume
19 | DiskDevice=$(LC_ALL=C diskutil info "$DestVolume" 2>/dev/null | sed -n 's/.*Part [oO]f Whole: *//p')
20 | if [ -z "$DiskDevice" ]; then
21 |     echo "Error: Not able to find volume with the name \"$DestVolume\""
22 |     exit 1
23 | fi
24 | 
25 | # check if target volume is a logical Volume instead of physical
26 | if [[ "$(echo $(LC_ALL=C diskutil list | grep -i 'Logical Volume' | awk '{print tolower($0)}'))" == *"logical volume"* ]]; then
27 |     # ok, we have a logical volume somewhere.. so that can assume that we can use "diskutil cs"
28 |     LC_ALL=C diskutil cs info $DiskDevice > /dev/null 2>&1
29 |     if [[ $? -eq 0 ]] ; then
30 |         # logical volumes does not have an EFI partition (or not suitable for us?)
31 |         # find the partition uuid
32 |         UUID=$(LC_ALL=C diskutil info "${DiskDevice}" 2>/dev/null | sed -n 's/.*artition UUID: *//p')
33 |         # with the partition uuid we can find the real disk in in diskutil list output
34 |         if [[ -n "$UUID" ]]; then
35 |             realDisk=$(LC_ALL=C diskutil list | grep -B 1 "$UUID" | grep -i 'logical volume' | awk '{print $4}' | sed -e 's/,//g' | sed -e 's/ //g')
36 |             if [[ -n "$realDisk" ]]; then
37 |                 DiskDevice=$(LC_ALL=C diskutil info "${realDisk}" 2>/dev/null | sed -n 's/.*Part [oO]f Whole: *//p')
38 |             fi
39 |         fi
40 |     fi
41 | fi
42 | 
43 | # check if target volume is APFS, and therefore part of an APFS container
44 | if [[ "$(echo $(LC_ALL=C diskutil list "$DiskDevice" | grep -i 'APFS Container Scheme' | awk '{print tolower($0)}'))" == *"apfs container scheme"* ]]; then
45 |     # ok, this disk is an APFS partition, extract physical store device
46 |     realDisk=$(LC_ALL=C diskutil list "$DiskDevice" 2>/dev/null | sed -n 's/.*Physical Store *//p')
47 |     DiskDevice=$(LC_ALL=C diskutil info "$realDisk" 2>/dev/null | sed -n 's/.*Part [oO]f Whole: *//p')
48 | fi
49 | 
50 | PartitionScheme=$(LC_ALL=C diskutil info "$DiskDevice" 2>/dev/null | sed -nE 's/.*(Partition Type|Content \(IOContent\)): *//p')
51 | # Check if the disk is an MBR disk
52 | if [ "$PartitionScheme" == "FDisk_partition_scheme" ]; then
53 |     echo "Error: Volume \"$DestVolume\" is part of an MBR disk"
54 |     exit 1
55 | fi
56 | # Check if not GPT
57 | if [ "$PartitionScheme" != "GUID_partition_scheme" ]; then
58 |     echo "Error: Volume \"$DestVolume\" is not on GPT disk or APFS container"
59 |     exit 1
60 | fi
61 | 
62 | # Get the index of the EFI partition
63 | EFIIndex=$(LC_ALL=C /usr/sbin/gpt -r show "/dev/$DiskDevice" 2>/dev/null | awk 'toupper($7) == "C12A7328-F81F-11D2-BA4B-00A0C93EC93B" {print $3; exit}')
64 | [ -z "$EFIIndex" ] && EFIIndex=$(LC_ALL=C diskutil list "$DiskDevice" 2>/dev/null | awk '$2 == "EFI" {print $1; exit}' | cut -d : -f 1)
65 | [ -z "$EFIIndex" ] && EFIIndex=$(LC_ALL=C diskutil list "$DiskDevice" 2>/dev/null | grep "EFI"|awk '{print $1}'|cut -d : -f 1)
66 | [ -z "$EFIIndex" ] && EFIIndex=1 # if not found use the index 1
67 | 
68 | # Define the EFIDevice
69 | EFIDevice="${DiskDevice}s$EFIIndex"
70 | 
71 | # Get the EFI mount point if the partition is currently mounted
72 | EFIMountPoint=$(LC_ALL=C diskutil info "$EFIDevice" 2>/dev/null | sed -n 's/.*Mount Point: *//p')
73 | 
74 | code=0
75 | if [ ! "$EFIMountPoint" ]; then
76 |     # try to mount the EFI partition
77 |     EFIMountPoint="/Volumes/EFI"
78 |     [ ! -d "$EFIMountPoint" ] && mkdir -p "$EFIMountPoint"
79 |     diskutil mount -mountPoint "$EFIMountPoint" /dev/$EFIDevice >/dev/null 2>&1
80 |     code=$?
81 | fi
82 | echo $EFIMountPoint
83 | exit $code
84 | 


--------------------------------------------------------------------------------
/Tools/msss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daliansky/Hackintosh/6f2b54323a0468e288f71fc838490ff81247b2fe/Tools/msss


--------------------------------------------------------------------------------
/Tools/remove_DS_Store:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | find ./ -name ".DS_Store" -depth -exec rm {} \;
3 | 


--------------------------------------------------------------------------------
/Tools/sn.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | curl -fsSL https://cdn.jsdelivr.net/gh/daliansky/Hackintosh/Tools/macserial -o /tmp/macserial && chmod +x /tmp/macserial && sh -c /tmp/macserial | grep -w 'Model:\|Valid:\|Hardware UUID:\|ROM:\|MLB:\|Serial Number:' | sed '/ \- /d' | tr -d ' ' | sed 
#39;s/Model:/SystemProductName:/g' | sed 
#39;s/HardwareUUID:/SystemUUID:/g' | sed 
#39;s/SerialNumber:/SystemSerialNumber:/g' | sed 
#39;s/\:/\: /g'  ## 一键提取三码,自己试试就行了,别帖出来哈
3 | 
4 | 


--------------------------------------------------------------------------------
/Tools/usb_Ports:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | ioreg | grep @14 | awk '{print $3 $4 $5 $6}' | sed 's/<class//g' | sed 's/Root//g' | sed 's/-o/--/g' | sed 's/,//g' | sed 's/|||+--//g' | sed 's/||||//g' | sed '/^$/d'
3 | ioreg | grep @15 | awk '{print $3 $4 $5 $6}' | sed 's/<class//g' | sed 's/Root//g' | sed 's/-o/--/g' | sed 's/,//g' | sed 's/|||+--//g' | sed 's/||||//g' | sed '/^$/d'
4 | 


--------------------------------------------------------------------------------