Update: Still works for iOS 14.3 + watchOS 7.2
I can provide clean account to activate your Apple Watch's ECG feature, please contact @hiraku_dev on Twitter.
Few months ago, I posted a tutorial about how to enable ECG feature of Apple Watch (oversea model). The restriction is: you must have an Apple Watch which is bought from ECG feature enabled region. However, Apple made a mistake on iOS 13.4 beta 2 and watchOS 6.2 beta 2, ANY Apple Watch S4 or S5 can enable ECG feature now!
However, the method I provided (iTunes backup modification) can't work for this case, you MUST find someone who activated ECG in traditional way (not iMazing method or jailbreak method), and use his/her iCloud account to sync the health app data to your device. You can find some people provide this kind of service on eBay or other place, but I don't recommend you to use stranger's account because your device might be locked and the seller can ask you for more money.
Please don't ask me whether xxx version can use this trick to enable ECG feature or not! Because this is a BUG, Apple may fix this in the future. But, if you don't upgrade iOS / watchOS, you can enable ECG feature as long as you want! Also, you can't downgrade watchOS, and watchOS 6.2 requires iOS 11.4 or above, so you can't downgrade iOS back to 13.3.1 or below either. Please think twice if you want to use this method to activate ECG!
In the following part of this post, I would show how this bug happened:
Since iOS 13.4 and watchOS 6.2, to test the ECG region restriction feature, Apple added a "switch" inside iOS, if the switch is on, then the system would bypass region checking.
The code is in HealthKit, there's two classes: HKMPNDeviceRegionFeatureSupportedStateProvider
and HKNonMPNDeviceRegionFeatureSupportedStateProvider
.
If the system calls functions in HKMPNDeviceRegionFeatureSupportedStateProvider
class, then it would check device region as usual. However, if it calls functions in HKNonMPNDeviceRegionFeatureSupportedStateProvider
, it would ignore region checking!
The question is, how the iOS / watchOS decide which class / function it should call? I dissembled the functions:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
/* @class HKHeartRhythmAvailability */ +(id)deviceRegionFeatureSupportedStateProviderForCompanionDevice:(id)device { BOOL checkIgnored = [self isCompanionRegionCheckEnabledForDevice:device]; Class class = [HKMPNDeviceRegionFeatureSupportedStateProvider class]; if (checkIgnored != NO) { class = [HKNonMPNDeviceRegionFeatureSupportedStateProvider class]; } return [class isCompanionRegionCheckEnabledForDevice:device]; } +(bool)isCompanionRegionCheckEnabledForDevice:(void *)device { BOOL ignoresMPN = _os_feature_enabled_impl("HeartRhythm", "ecg_app_install_ignores_mpn"); NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"03C7A646-DB1E-404B-B393-033E5496A383"]; BOOL supportUUID = [device supportsCapability:uuid]; // Some code which is not important return ignoresMPN && supportUUID } |
As you can see, if ecg_app_install_ignores_mpn
is enabled, then it would call HKNonMPNDeviceRegionFeatureSupportedStateProvider
and ignore region checking.
Now, we only need to find where is ecg_app_install_ignores_mpn
, it's in /System/Library/FeatureFlags/Domain/HeartRhythm.plist
:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>ecg_app_install_ignores_mpn</key> <dict> <key>Enabled</key> <true/> <key>DisplayName</key> <string>Move Off of MPN</string> </dict> </dict> </plist> |
In line 8, the value is true! However, on iOS 13.4 beta 1, it was false! Because Apple accidentally set this value to true on beta 2, we can by pass ECG region checking! Good job, Apple!
So, let me say again: please don't ask me whether xxx version can use this trick to enable ECG feature or not! Because this is a BUG, Apple will fix this in the future. But, if you don't upgrade iOS / watchOS, you can enable ECG feature as long as you want!
Credit:Apple、吉米簡
發佈留言