MacBook Pro (16-inch, 2019)에서 사전.app(Dictionary.app)의 영어와 일본어 사전을 사용할 수 없게 된 이야기.

9485 단어 macos사전MacbookPro
표제대로의 현상을 만나서 어떻게든 해결했기 때문에 그 기록입니다.

사전 .app(Dictionary.app)의 환경설정에서 "위즈담영화사전/위즈덤화영사전(일본어-영어)"을 활성화했습니다만, 검색해도 아무것도 발견되지 않는 상태가 되었습니다.

조사하면 비슷한 현상이 발생하고 있는 모양.
The macOS 사전 app cannot add new build in dictionaries - Apple Community

이것에 의하면, /System/Library/AssetsV2/com_apple_MobileAsset_DictionaryServices_dictionaryOSX 폴더에 있는 com_apple_MobileAsset_DictionaryServices_dictionaryOSX.xml 파일에 사전 데이터의 다운로드 URL가 있으므로, 여기로부터 다운로드해 .dictionary 패키지를 ~/Library/Dictionaries 폴더에 카피하면 고쳤다, 라고.

이것을 참고해 com_apple_MobileAsset_DictionaryServices_dictionaryOSX.xml 파일로부터 위즈담 영어와 일본어 사전의 사전 데이터의 URL을 찾아 봅니다.
<dict>
    <!-- ... -->
    <key>DictionaryPackageDisplayName</key>
    <string>ウィズダム英和辞典 / ウィズダム和英辞典</string>
    <!-- ... -->
    <key>__BaseURL</key>
    <string>http://appldnld.apple.com/osxassets/058-55450-2016008023-8A4D782E-661F-11E6-B483-D75733D2D062/</string>
    <key>__CanUseLocalCacheServer</key>
    <true/>
    <key>__InstallWithOS</key>
    <true/>
    <key>__RelativePath</key>
    <string>com_apple_MobileAsset_DictionaryServices_dictionaryOSX/1a184f41ee27bbb203ba596a25c8ea104c13d98f.zip</string>
</dict>

파일내에는 이러한 구조가 있어, __BaseURL__RelativePath 를 연결하면 사전 데이터의 다운로드 URL이 될 것 같습니다. 그런데 같은 사전에 대해 비슷한 구조가 5개 있었다. __BaseURL__RelativePath 를 보면 미묘하게 다르고 아무래도 버전 차이인 것 같습니다.
<dict>
    <!-- ... -->
    <key>DictionaryPackageDisplayName</key>
    <string>ウィズダム英和辞典 / ウィズダム和英辞典</string>
    <!-- ... -->
    <key>__BaseURL</key>
    <string>http://appldnld.apple.com/osxassets/058-55450-2016008023-8A4D782E-661F-11E6-B483-D75733D2D062/</string>
    <!-- ... -->
    <key>__RelativePath</key>
    <string>com_apple_MobileAsset_DictionaryServices_dictionaryOSX/1a184f41ee27bbb203ba596a25c8ea104c13d98f.zip</string>
</dict>

<dict>
    <!-- ... -->
    <key>DictionaryPackageDisplayName</key>
    <string>ウィズダム英和辞典 / ウィズダム和英辞典</string>
    <!-- ... -->
    <key>__BaseURL</key>
    <string>http://appldnld.apple.com/ios11.0/048-04169-20171219-3E638938-E064-11E7-BED0-328EE988D09B/</string>
    <!-- ... -->
    <key>__RelativePath</key>
    <string>com_apple_MobileAsset_DictionaryServices_dictionaryOSX/69d9a5c927f04857f6abf7a0a9f144e194b5d0ce.zip</string>
</dict>

<dict>
    <!-- ... -->
    <key>DictionaryPackageDisplayName</key>
    <string>ウィズダム英和辞典 / ウィズダム和英辞典</string>
    <!-- ... -->
    <key>__BaseURL</key>
    <string>http://appldnld.apple.com/ios11.0/091-65654-20180306-F43DDB4C-1F01-11E8-B071-BA9988D28C9D/</string>
    <!-- ... -->
    <key>__RelativePath</key>
    <string>com_apple_MobileAsset_DictionaryServices_dictionaryOSX/3fb6544c58d7f04015ded27812a932cbbb3122ad.zip</string>
</dict>

<dict>
    <!-- ... -->
    <key>DictionaryPackageDisplayName</key>
    <string>ウィズダム英和辞典 / ウィズダム和英辞典</string>
    <!-- ... -->
    <key>__BaseURL</key>
    <string>http://updates-http.cdn-apple.com/2018/ios/091-97251-20180828-DB88F352-A4B7-11E8-A246-39142147FE1B/</string>
    <!-- ... -->
    <key>__RelativePath</key>
    <string>com_apple_MobileAsset_DictionaryServices_dictionaryOSX/c15aa908a684112f63017e47bb6b289e99977135.zip</string>
</dict>

<dict>
    <!-- ... -->
    <key>DictionaryPackageDisplayName</key>
    <string>ウィズダム英和辞典 / ウィズダム和英辞典</string>
    <!-- ... -->
    <key>__BaseURL</key>
    <string>http://updates-http.cdn-apple.com/2019/ios/041-71820-20190919-DB836C8E-DA9E-11E9-A9E0-C30E3E8547A6/</string>
    <!-- ... -->
    <key>__RelativePath</key>
    <string>com_apple_MobileAsset_DictionaryServices_dictionaryOSX/7725cba5b321a8308a603a40ac808699175c4aae.zip</string>
</dict>

어떤 URL인지 모르기 때문에 /System/Library/AssetsV2/com_apple_MobileAsset_DictionaryServices_dictionaryOSX 폴더에 있는 제대로 작동하는 다른 사전 데이터의 식별자가 없는지 찾으면, 파일 이름과 일치합니다.

이제 다운로드해야 할 파일이 __BaseURL임을 알 수 있습니다.

이 파일을 다운로드하고 확장하여 http://updates-http.cdn-apple.com/2019/ios/ 폴더에 있는 __RelativePath를 앞에서 설명한 대로 http://updates-http.cdn-apple.com/2019/ios/041-71820-20190919-DB836C8E-DA9E-11E9-A9E0-C30E3E8547A6/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/7725cba5b321a8308a603a40ac808699175c4aae.zip 폴더에 복사해 보았지만 개선되지 않았습니다.

(12/30 덧붙여 : 코멘트보다 앞의 기사에 쓰여진 대로, 복사 후.dictionary 파일을 다른 이름에 리네임 하면 잘 되는 것 같습니다)

그래서, 제대로 동작하고 있는 다른 사전 데이터와 같이 Assets 폴더에 넣어 보겠습니다. 하지만 Sanseido The WISDOM English-Japanese Japanese-English Dictionary.dictionary 폴더는 El Capitan 이후 도입된 SIP(System Integrity Protection)로 보호되므로 일반적으로 액세스할 수 없습니다. 그래서 일단 이것을 비활성화합니다.

방법은 이쪽.
Configuring System Integrity Protection

To enable or disable System Integrity Protection, you must boot to Recovery OS and run the csrutil(1) command from the Terminal.

Boot to Recovery OS by restarting your machine and holding down the Command and R keys at startup.
Launch Terminal from the Utilities menu.
Enter the following command:
$csrutil enable

요약하면 ⌘ + R을 누른 상태에서 복구 모드로 부팅 한 후 유틸리티 메뉴에서 터미널을 시작하고 ~/Library/Dictionaries 명령을 실행하여 다시 시작합니다.

이렇게 해서 방금 다운로드하고 펼친 /System/Library/AssetsV2/com_apple_MobileAsset_DictionaryServices_dictionaryOSX 폴더를 /System로 이름을 바꾸고 csrutil disable 사전 데이터와 함께 둡니다.
또한 복구 모드에서 다시 시작하고 7725cba5b321a8308a603a40ac808699175c4aae를 실행하고 다시 시작하여 비활성화한 SIP를 활성화합니다.

그리고, 사전.app를 기동해 보면….

Hooray!🎉🎉🎉

여기에서 이상입니다.

좋은 웹페이지 즐겨찾기