iCloud bug修复

大类
iOS
技术标签
逆向-Windows
Powershell
优先级
Medium
开始日期
Dec 23, 2020
状态
Finalized
Public
Public
最后更新
Dec 29, 2021

方案

  • 通过调试器将LogLevel提高,并输出到OutputDebugString中

Bug1:iCloud无法同步一些老的视频或图片

无法修复,服务器直接异常,导致iCloud一直重试

Bug2:iCloud不更新

直接删除图片库然后重新更新即可,预估为图片库版本过低iCloud升级后支持不好出现数据紊乱。
 

Bug3:iCloud不自动下载

iCloud图片实际上是个Cloud Storage Provider,相应的可以通过Windows.Storage.StorageFile获取文件信息,使用Powershell可以得到文件信息,而各种Property在这里有完整列表https://docs.microsoft.com/en-us/windows/win32/properties/core-bumper
Add-Type -AssemblyName System.Runtime.WindowsRuntime $asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0] Function Await($WinRtTask, $ResultType) { $asTask = $asTaskGeneric.MakeGenericMethod($ResultType) $netTask = $asTask.Invoke($null, @($WinRtTask)) $netTask.Wait(-1) | Out-Null $netTask.Result } Function AwaitAction($WinRtAction) { $asTask = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and !$_.IsGenericMethod })[0] $netTask = $asTask.Invoke($null, @($WinRtAction)) $netTask.Wait(-1) | Out-Null }
PS C:\Users\Misty> $file = 'C:\Users\Misty\iCloudPhotos\Photos\IMG_9773.MOV' PS C:\Users\Misty> Write-Host $file C:\Users\Misty\iCloudPhotos\Photos\IMG_9773.MOV PS C:\Users\Misty> Await ([Windows.Storage.StorageFile]::GetFileFromPathAsync($file)) ([Windows.Storage.StorageFile]) ContentType : video/quicktime FileType : .MOV IsAvailable : True Attributes : Archive DateCreated : 2019/5/26 18:24:16 +08:00 Name : IMG_9773.MOV Path : C:\Users\Misty\iCloudPhotos\Photos\IMG_9773.MOV DisplayName : IMG_9773 DisplayType : MOV 文件 FolderRelativeId : 40E54828C9E726DE\IMG_9773.MOV Properties : Windows.Storage.FileProperties.StorageItemContentProperties Provider : Windows.Storage.StorageProvider PS C:\Users\Misty> $t = Await ([Windows.Storage.StorageFile]::GetFileFromPathAsync($file)) ([Windows.Storage.StorageFile]) PS C:\Users\Misty> $t.Provider DisplayName Id ----------- -- iCloud 照片 iCloudPhotos PS C:\Users\Misty> $t.Provider DisplayName Id ----------- -- iCloud 照片 iCloudPhotos PS C:\Users\Misty> $t.Properties Windows.Storage.FileProperties.StorageItemContentProperties PS C:\Users\Misty> $t.Properties | Get-Member TypeName:Windows.Storage.FileProperties.StorageItemContentProperties Name MemberType Definition ---- ---------- ---------- CreateObjRef Method System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType) Equals Method bool Equals(System.Object obj) GetDocumentPropertiesAsync Method Windows.Foundation.IAsyncOperation[Windows.Storage.FileProperties.DocumentProp... GetHashCode Method int GetHashCode() GetImagePropertiesAsync Method Windows.Foundation.IAsyncOperation[Windows.Storage.FileProperties.ImagePropert... GetLifetimeService Method System.Object GetLifetimeService() GetMusicPropertiesAsync Method Windows.Foundation.IAsyncOperation[Windows.Storage.FileProperties.MusicPropert... GetType Method type GetType() GetVideoPropertiesAsync Method Windows.Foundation.IAsyncOperation[Windows.Storage.FileProperties.VideoPropert... InitializeLifetimeService Method System.Object InitializeLifetimeService() RetrievePropertiesAsync Method Windows.Foundation.IAsyncOperation[System.Collections.Generic.IDictionary[stri... SavePropertiesAsync Method Windows.Foundation.IAsyncAction SavePropertiesAsync(System.Collections.Generic... ToString Method string ToString() PS C:\Users\Misty> $t.Properties | Get-Member TypeName:Windows.Storage.FileProperties.StorageItemContentProperties Name MemberType Definition ---- ---------- ---------- CreateObjRef Method System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType) Equals Method bool Equals(System.Object obj) GetDocumentPropertiesAsync Method Windows.Foundation.IAsyncOperation[Windows.Storage.FileProperties.DocumentProperties] GetDocumentPropertiesAsync() GetHashCode Method int GetHashCode() GetImagePropertiesAsync Method Windows.Foundation.IAsyncOperation[Windows.Storage.FileProperties.ImageProperties] GetImagePropertiesAsync() GetLifetimeService Method System.Object GetLifetimeService() GetMusicPropertiesAsync Method Windows.Foundation.IAsyncOperation[Windows.Storage.FileProperties.MusicProperties] GetMusicPropertiesAsync() GetType Method type GetType() GetVideoPropertiesAsync Method Windows.Foundation.IAsyncOperation[Windows.Storage.FileProperties.VideoProperties] GetVideoPropertiesAsync() InitializeLifetimeService Method System.Object InitializeLifetimeService() RetrievePropertiesAsync Method Windows.Foundation.IAsyncOperation[System.Collections.Generic.IDictionary[string,System.Object]] RetrievePropertiesAsync(System.Collections.Generic.IEnumerable[string] propertiesToRetrieve), Windows.Foundation.IAsyncOperation[Sys... SavePropertiesAsync Method Windows.Foundation.IAsyncAction SavePropertiesAsync(System.Collections.Generic.IEnumerable[System.Collections.Generic.KeyValuePair[string,System.Object]] propertiesToSave), Windows.Foundation.IAsyncAction SavePropertiesAsync(), W... ToString Method string ToString() PS C:\Users\Misty> $t.Properties.GetDocumentPropertiesAsync() System.__ComObject PS C:\Users\Misty> $p = Await $t.Properties.GetDocumentPropertiesAsync() ([Windows.Storage.FileProperties.DocumentProperties]) PS C:\Users\Misty> $p Title Comment Author Keywords ----- ------- ------ -------- System.__ComObject System.__ComObject
 
搜索后发现文件状态在微软文档中成为pinned
notion image
由此发现attrib可以直接控制是否为pinned
notion image
设置了个计划任务每10min设置:
attrib /S +P C:\Users\Misty\iCloudPhotos\Photos\*

Bug4: Passwords无法使用

  • 卸载所有Apple的东西(iTunes、Application Support、Bonjour等)
  • 删除ProgramData下面的Apple、Apple Inc、Apple Computer
  • 删除:
    • C:\Users\Misty\AppData\Roaming\Microsoft\Crypto\Keys\e84a0XXXX
    • C:\Users\Misty\AppData\Roaming\Microsoft\Crypto\RSA\S-1-5-21-1071035101-1108086695-2934149521-1001\43e3a4XXX
  • 删除C:\Users\Misty\AppData\Roaming\Microsoft\SystemCertificates\My\Certificates下带有unicode字符串:APNS 的文件
  • 删除registry
Windows Registry Editor Version 5.00 ; 由 Total Uninstall 产生 [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{90E52E21-F4FC-4AFA-9686-474F701E8388}] [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\ClassIndex\{19BB4B1F-6BEE-47C2-858E-64140AE114EE}] [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\ClassIndex\{23AD9193-EBAD-42BF-8D03-FEC6331270F2}] [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\ClassIndex\{6812639B-FD61-4329-9901-22CFDBD690FE}] [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\ClassIndex\{85527100-19D0-45AF-9F09-DAB4E711C35E}] [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\ClassIndex\{9E6E74C7-0E85-4D14-8851-7635E2C1C528}] [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\ClassIndex\{D3B0ACEA-46E8-41A7-A69E-0A46053EA2A1}] [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\ClassIndex\{E8784411-23CA-4783-AA3D-060EAB307FE5}] [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\ClassIndex\{F73FD223-6B08-4C7F-BF36-27ABAA8E70CC}] [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\ClassIndex\{FDD068C2-D51A-4175-8A20-5CBC704EA3BD}] ; [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\InterfaceIndex] [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\Package\AppleInc.iCloud_13.4.92.0_x86__nzyj5cx40ttqa] ; [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\TypeLibIndex] ; [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppModel\Lookaside] [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\PackageState\S-1-5-21-1071035101-1108086695-2934149521-1001\AppleInc.iCloud_nzyj5cx40ttqa] [-HKEY_CURRENT_USER\Software\Classes\.key] [-HKEY_CURRENT_USER\Software\Classes\.key-tef] [-HKEY_CURRENT_USER\Software\Classes\.numbers] [-HKEY_CURRENT_USER\Software\Classes\.numbers-tef] [-HKEY_CURRENT_USER\Software\Classes\.pages] [-HKEY_CURRENT_USER\Software\Classes\.pages-tef] [-HKEY_CURRENT_USER\Software\Classes\apple-icloudapp] [-HKEY_CURRENT_USER\Software\Classes\AppX2146dfv6wn2ebhzfrmfjgqkwjmjz7cf9] [-HKEY_CURRENT_USER\Software\Classes\AppXmbyj2feynwef7cer3gmy2tm15jc6h6e1] [-HKEY_CURRENT_USER\Software\Classes\AppXtr9mtd2csje416yr51xqnv4ygkzc58qk] [-HKEY_CURRENT_USER\Software\Classes\AppXwg6g3r9wmat4r6rycdae614xh3ce88m2] [-HKEY_CURRENT_USER\Software\Classes\Extensions\ContractId\windows.appExecutionAlias\PackageId\AppleInc.iCloud_13.4.92.0_x86__nzyj5cx40ttqa] [-HKEY_CURRENT_USER\Software\Classes\Extensions\ContractId\Windows.AppService\PackageId\AppleInc.iCloud_13.4.92.0_x86__nzyj5cx40ttqa] [-HKEY_CURRENT_USER\Software\Classes\Extensions\ContractId\Windows.BackgroundTasks\PackageId\AppleInc.iCloud_13.4.92.0_x86__nzyj5cx40ttqa] [-HKEY_CURRENT_USER\Software\Classes\Extensions\ContractId\Windows.CommandLineLaunch\PackageId\AppleInc.iCloud_13.4.92.0_x86__nzyj5cx40ttqa] [-HKEY_CURRENT_USER\Software\Classes\Extensions\ContractId\Windows.Launch\PackageId\AppleInc.iCloud_13.4.92.0_x86__nzyj5cx40ttqa] [-HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\PolicyCache\AppleInc.iCloud_nzyj5cx40ttqa] [-HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages\AppleInc.iCloud_13.4.92.0_x86__nzyj5cx40ttqa] [-HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\AppleInc.iCloud_nzyj5cx40ttqa] [-HKEY_CURRENT_USER\Software\Classes\PackagedCom\Package\AppleInc.iCloud_13.4.92.0_x86__nzyj5cx40ttqa] [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\iCloudChrome.exe] [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\iCloudFirefox.exe] [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\iCloudPasswordsExtensionHelper.exe] [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\AppHost\IndexedDB\AppleInc.iCloud_nzyj5cx40ttqa] [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Notifications\BackgroundCapability\S-1-15-2-577278596-3063659431-1612091346-1109771266-600305798-4280066548-3535389673] [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications\AppleInc.iCloud_nzyj5cx40ttqa] [HKEY_CURRENT_USER\Software\RegisteredApplications] "AppXbfs6jhdzeh4ptyjea1g3jp0hkb7hfbj4"=- "AppXnmt89mjds80hbafzsckbdsv8kptrp3v2"=-