├── EnableFitnessApp-Bridging-Header.h ├── Resources ├── zh-Hans.lproj │ ├── InfoPlist.strings │ └── Localizable.strings ├── en.lproj │ ├── InfoPlist.strings │ └── Localizable.strings ├── AppIcon.png ├── AppIcon29x29.png ├── AppIcon40x40.png ├── AppIcon50x50.png ├── AppIcon57x57.png ├── AppIcon60x60.png ├── AppIcon72x72.png ├── AppIcon76x76.png ├── AppIcon29x29@2x.png ├── AppIcon29x29@3x.png ├── AppIcon40x40@2x.png ├── AppIcon40x40@3x.png ├── AppIcon50x50@2x.png ├── AppIcon57x57@2x.png ├── AppIcon57x57@3x.png ├── AppIcon60x60@2x.png ├── AppIcon60x60@3x.png ├── AppIcon72x72@2x.png ├── AppIcon76x76@2x.png ├── com.apple.Fitness.plist ├── Launch Screen.storyboardc │ ├── Info.plist │ ├── 01J-lp-oVM-view-Ze5-6b-2t3.nib │ └── UIViewController-01J-lp-oVM.nib ├── com.apple.Fitness.activity-widget.plist └── Info.plist ├── control ├── DeviceManager.h ├── entitlements.plist ├── AppDelegate.swift ├── Makefile ├── .gitignore ├── EnableHelper.swift ├── DeviceManager.m ├── README.md ├── RootViewController.swift └── LICENSE /EnableFitnessApp-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "DeviceManager.h" 2 | -------------------------------------------------------------------------------- /Resources/zh-Hans.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | "CFBundleDisplayName" = "开启健身圆环"; 2 | -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/control -------------------------------------------------------------------------------- /Resources/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | "CFBundleDisplayName" = "EnableFitnessApp"; 2 | -------------------------------------------------------------------------------- /Resources/AppIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon.png -------------------------------------------------------------------------------- /Resources/AppIcon29x29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon29x29.png -------------------------------------------------------------------------------- /Resources/AppIcon40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon40x40.png -------------------------------------------------------------------------------- /Resources/AppIcon50x50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon50x50.png -------------------------------------------------------------------------------- /Resources/AppIcon57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon57x57.png -------------------------------------------------------------------------------- /Resources/AppIcon60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon60x60.png -------------------------------------------------------------------------------- /Resources/AppIcon72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon72x72.png -------------------------------------------------------------------------------- /Resources/AppIcon76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon76x76.png -------------------------------------------------------------------------------- /Resources/AppIcon29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon29x29@2x.png -------------------------------------------------------------------------------- /Resources/AppIcon29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon29x29@3x.png -------------------------------------------------------------------------------- /Resources/AppIcon40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon40x40@2x.png -------------------------------------------------------------------------------- /Resources/AppIcon40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon40x40@3x.png -------------------------------------------------------------------------------- /Resources/AppIcon50x50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon50x50@2x.png -------------------------------------------------------------------------------- /Resources/AppIcon57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon57x57@2x.png -------------------------------------------------------------------------------- /Resources/AppIcon57x57@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon57x57@3x.png -------------------------------------------------------------------------------- /Resources/AppIcon60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon60x60@2x.png -------------------------------------------------------------------------------- /Resources/AppIcon60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon60x60@3x.png -------------------------------------------------------------------------------- /Resources/AppIcon72x72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon72x72@2x.png -------------------------------------------------------------------------------- /Resources/AppIcon76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/AppIcon76x76@2x.png -------------------------------------------------------------------------------- /Resources/com.apple.Fitness.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/com.apple.Fitness.plist -------------------------------------------------------------------------------- /DeviceManager.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface DeviceManager : NSObject 4 | 5 | - (void)respring; 6 | 7 | @end 8 | 9 | -------------------------------------------------------------------------------- /Resources/Launch Screen.storyboardc/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/Launch Screen.storyboardc/Info.plist -------------------------------------------------------------------------------- /Resources/com.apple.Fitness.activity-widget.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/com.apple.Fitness.activity-widget.plist -------------------------------------------------------------------------------- /Resources/Launch Screen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/Launch Screen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib -------------------------------------------------------------------------------- /Resources/Launch Screen.storyboardc/UIViewController-01J-lp-oVM.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopCubeLab/EnableFitnessApp/HEAD/Resources/Launch Screen.storyboardc/UIViewController-01J-lp-oVM.nib -------------------------------------------------------------------------------- /entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.no-sandbox 8 | 9 | com.apple.private.allow-unrestricted-code 10 | 11 | com.apple.system-task-ports 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | @UIApplicationMain 4 | class AppDelegate: UIResponder, UIApplicationDelegate { 5 | 6 | var window: UIWindow? 7 | 8 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { 9 | window = UIWindow(frame: UIScreen.main.bounds) 10 | window!.rootViewController = UINavigationController(rootViewController: RootViewController()) 11 | window!.makeKeyAndVisible() 12 | return true 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Resources/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "Install_With_TrollStore_text" = "已经通过TrollStore安装"; 2 | "Need_Install_With_TrollStore_text" = "需要使用TrollStore安装"; 3 | "iOS15_text" = "为低于iOS16.0系统开启'健身'App\n点击'安装配置文件'开始进行操作"; 4 | "iOS16_text" = "iOS 16或以上版本系统已经自带'健身'App,无需此工具"; 5 | "Install_Profile_text" = "安装配置文件"; 6 | "Respring_text" = "注销"; 7 | "Install_Fitness_Application_text" = "安装'健身'App"; 8 | "Install_Success_title" = "成功"; 9 | "Install_Success_text" = "安装配置文件成功,请点击'注销'按钮,注销后安装'健身'App\n安装后您可以安全的卸载此工具,它将没有任何作用"; 10 | "Install_Failed_title" = "失败"; 11 | "Install_Failed_text" = "安装配置文件失败,请再试一次"; 12 | "Close_text" = "关闭"; 13 | 14 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | TARGET = iphone:clang:latest:14.0 2 | INSTALL_TARGET_PROCESSES = EnableFitnessApp 3 | 4 | include $(THEOS)/makefiles/common.mk 5 | 6 | APPLICATION_NAME = EnableFitnessApp 7 | 8 | EnableFitnessApp_FILES = AppDelegate.swift EnableHelper.swift RootViewController.swift DeviceManager.m 9 | _BUNDLE_RESOURCES = Resources/en.lproj Resources/zh-Hans.lproj 10 | EnableFitnessApp_FRAMEWORKS = UIKit CoreGraphics 11 | EnableFitnessApp_SWIFT_BRIDGING_HEADER += EnableFitnessApp-Bridging-Header.h 12 | 13 | include $(THEOS_MAKE_PATH)/application.mk 14 | 15 | $(APPLICATION_NAME)_CODESIGN_FLAGS = -Sentitlements.plist 16 | 17 | after-package:: 18 | @echo "Renaming .ipa to .tipa..." 19 | @mv ./packages/com.developlab.enablefitnessapp_1.2.ipa ./packages/com.developlab.enablefitnessapp_1.2.tipa || echo "No .ipa file found." 20 | -------------------------------------------------------------------------------- /Resources/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "CFBundleDisplayName" = "EnableFitnessApp"; 2 | "Install_With_TrollStore_text" = "Already installed via TrollStore"; 3 | "Need_Install_With_TrollStore_text" = "Requires TrollStore installation"; 4 | "iOS15_text" = "Enable the 'Fitness' Application for iOS version lower than iOS 16.0\nClick 'Install profile file'button to start the install"; 5 | "iOS16_text" = "iOS 16 or above iOS version already include with the 'Fitness' App, no need for this tool"; 6 | "Install_Profile_text" = "Install profile file"; 7 | "Respring_text" = "Respring"; 8 | "Install_Fitness_Application_text" = "Install'Fitness'Applicaiton"; 9 | "Install_Success_title" = "Successful"; 10 | "Install_Success_text" = "The configuration file is installed successfully.\n Please click the 'Respring' button to respring and install the 'Fitness' Application.\nFinally, you can safely uninstall this tool, it will no longer have any effect."; 11 | "Install_Failed_title" = "Failed!"; 12 | "Install_Failed_text" = "Failed to install profile file, please try again"; 13 | "Close_text" = "Close"; 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## Obj-C/Swift specific 9 | *.hmap 10 | 11 | ## App packaging 12 | *.ipa 13 | *.dSYM.zip 14 | *.dSYM 15 | 16 | ## Playgrounds 17 | timeline.xctimeline 18 | playground.xcworkspace 19 | 20 | # Swift Package Manager 21 | # 22 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 23 | # Packages/ 24 | # Package.pins 25 | # Package.resolved 26 | # *.xcodeproj 27 | # 28 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 29 | # hence it is not needed unless you have added a package configuration file to your project 30 | # .swiftpm 31 | 32 | .build/ 33 | 34 | # CocoaPods 35 | # 36 | # We recommend against adding the Pods directory to your .gitignore. However 37 | # you should judge for yourself, the pros and cons are mentioned at: 38 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 39 | # 40 | # Pods/ 41 | # 42 | # Add this line if you want to avoid checking in source code from the Xcode workspace 43 | # *.xcworkspace 44 | 45 | # Carthage 46 | # 47 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 48 | # Carthage/Checkouts 49 | 50 | Carthage/Build/ 51 | 52 | # fastlane 53 | # 54 | # It is recommended to not store the screenshots in the git repo. 55 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 56 | # For more information about the recommended setup visit: 57 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 58 | 59 | fastlane/report.xml 60 | fastlane/Preview.html 61 | fastlane/screenshots/**/*.png 62 | fastlane/test_output 63 | 64 | .theos/ 65 | packages/ 66 | .DS_Store 67 | .idea 68 | 69 | -------------------------------------------------------------------------------- /Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleExecutable 6 | EnableFitnessApp 7 | CFBundleIcons 8 | 9 | CFBundlePrimaryIcon 10 | 11 | CFBundleIconFiles 12 | 13 | AppIcon29x29 14 | AppIcon40x40 15 | AppIcon57x57 16 | AppIcon60x60 17 | 18 | UIPrerenderedIcon 19 | 20 | 21 | 22 | CFBundleIcons~ipad 23 | 24 | CFBundlePrimaryIcon 25 | 26 | CFBundleIconFiles 27 | 28 | AppIcon29x29 29 | AppIcon40x40 30 | AppIcon57x57 31 | AppIcon60x60 32 | AppIcon50x50 33 | AppIcon72x72 34 | AppIcon76x76 35 | 36 | UIPrerenderedIcon 37 | 38 | 39 | 40 | CFBundleIdentifier 41 | com.developlab.enablefitnessapp 42 | CFBundleInfoDictionaryVersion 43 | 6.0 44 | CFBundlePackageType 45 | APPL 46 | CFBundleSignature 47 | ???? 48 | CFBundleSupportedPlatforms 49 | 50 | iPhoneOS 51 | 52 | CFBundleVersion 53 | 1.0 54 | LSRequiresIPhoneOS 55 | 56 | UIDeviceFamily 57 | 58 | 1 59 | 2 60 | 61 | UIRequiredDeviceCapabilities 62 | 63 | armv7 64 | 65 | UISupportedInterfaceOrientations 66 | 67 | UIInterfaceOrientationPortrait 68 | 69 | UISupportedInterfaceOrientations~ipad 70 | 71 | UIInterfaceOrientationPortrait 72 | UIInterfaceOrientationPortraitUpsideDown 73 | UIInterfaceOrientationLandscapeLeft 74 | UIInterfaceOrientationLandscapeRight 75 | 76 | UILaunchStoryboardName 77 | Launch Screen 78 | CFBundleDisplayName 79 | EnableFitnessApp 80 | 81 | 82 | -------------------------------------------------------------------------------- /EnableHelper.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | class EnableHelper { 5 | 6 | func checkInstallPermission() -> Bool { 7 | let path = "/var/mobile/Library/Preferences" 8 | let writeable = access(path, W_OK) == 0 9 | return writeable 10 | } 11 | 12 | func checkURLSchemeExists(urlScheme: String) -> Bool { 13 | if let url = URL(string: urlScheme) { 14 | return UIApplication.shared.canOpenURL(url) 15 | } 16 | return false 17 | } 18 | 19 | func copyFileToPreferences() -> Bool { 20 | let fileManager = FileManager.default 21 | 22 | // 获取 App 包内的 plist 文件路径 23 | let appBundlePath = Bundle.main.bundlePath 24 | 25 | // 文件路径 26 | let sourceFile1 = appBundlePath + "/com.apple.Fitness.plist" 27 | let sourceFile2 = appBundlePath + "/com.apple.Fitness.activity-widget.plist" 28 | 29 | // 目标目录 /var/mobile/Library/Preferences 30 | let destinationDirectory = "/var/mobile/Library/Preferences" 31 | 32 | // 确保目标目录存在 33 | if !fileManager.fileExists(atPath: destinationDirectory) { 34 | do { 35 | try fileManager.createDirectory(atPath: destinationDirectory, withIntermediateDirectories: true, attributes: nil) 36 | } catch { 37 | return false 38 | } 39 | } 40 | 41 | // 复制文件 42 | let destinationFile1 = destinationDirectory + "/com.apple.Fitness.plist" 43 | let destinationFile2 = destinationDirectory + "/com.apple.Fitness.activity-widget.plist" 44 | 45 | do { 46 | // 检查源文件是否存在 47 | if fileManager.fileExists(atPath: sourceFile1) { 48 | if fileManager.fileExists(atPath: destinationFile1) { 49 | try fileManager.removeItem(atPath: destinationFile1) // 文件存在,先删除 50 | } 51 | try fileManager.copyItem(atPath: sourceFile1, toPath: destinationFile1) // 复制文件 52 | } 53 | 54 | if fileManager.fileExists(atPath: sourceFile2) { 55 | if fileManager.fileExists(atPath: destinationFile2) { 56 | try fileManager.removeItem(atPath: destinationFile2) // 文件存在,先删除 57 | } 58 | try fileManager.copyItem(atPath: sourceFile2, toPath: destinationFile2) // 复制文件 59 | } 60 | 61 | return true // 成功复制文件 62 | } catch { 63 | return false 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /DeviceManager.m: -------------------------------------------------------------------------------- 1 | #import "DeviceManager.h" 2 | #include 3 | #import 4 | #import 5 | #import 6 | 7 | @implementation DeviceManager 8 | 9 | void killall(NSString* processName, BOOL softly) 10 | { 11 | enumerateProcessesUsingBlock(^(pid_t pid, NSString* executablePath, BOOL* stop) 12 | { 13 | if ([executablePath.lastPathComponent isEqualToString:processName]) 14 | { 15 | if (softly) 16 | { 17 | kill(pid, SIGTERM); // 软杀进程 18 | } 19 | else 20 | { 21 | kill(pid, SIGKILL); // 强制杀进程 22 | } 23 | } 24 | }); 25 | } 26 | 27 | - (void)respring { 28 | killall(@"SpringBoard", YES); // 重启 SpringBoard 29 | exit(0); // 退出应用 30 | } 31 | 32 | 33 | void enumerateProcessesUsingBlock(void (^enumerator)(pid_t pid, NSString* executablePath, BOOL* stop)) { 34 | static int maxArgumentSize = 0; 35 | if (maxArgumentSize == 0) { 36 | size_t size = sizeof(maxArgumentSize); 37 | if (sysctl((int[]){ CTL_KERN, KERN_ARGMAX }, 2, &maxArgumentSize, &size, NULL, 0) == -1) { 38 | perror("sysctl argument size"); 39 | maxArgumentSize = 4096; // 默认大小 40 | } 41 | } 42 | 43 | int mib[3] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL }; 44 | struct kinfo_proc *info; 45 | size_t length; 46 | int count; 47 | 48 | if (sysctl(mib, 3, NULL, &length, NULL, 0) < 0) 49 | return; 50 | 51 | if (!(info = malloc(length))) 52 | return; 53 | 54 | if (sysctl(mib, 3, info, &length, NULL, 0) < 0) { 55 | free(info); 56 | return; 57 | } 58 | 59 | count = length / sizeof(struct kinfo_proc); 60 | for (int i = 0; i < count; i++) { 61 | @autoreleasepool { 62 | pid_t pid = info[i].kp_proc.p_pid; 63 | if (pid == 0) { 64 | continue; 65 | } 66 | 67 | size_t size = maxArgumentSize; 68 | char* buffer = (char *)malloc(length); 69 | if (sysctl((int[]){ CTL_KERN, KERN_PROCARGS2, pid }, 3, buffer, &size, NULL, 0) == 0) { 70 | NSString* executablePath = [NSString stringWithCString:(buffer+sizeof(int)) encoding:NSUTF8StringEncoding]; 71 | 72 | BOOL stop = NO; 73 | enumerator(pid, executablePath, &stop); 74 | if(stop) { 75 | free(buffer); 76 | break; 77 | } 78 | } 79 | free(buffer); 80 | } 81 | } 82 | free(info); 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EnableFitnessApp 2 | ![80](https://github.com/user-attachments/assets/17f4a639-ef85-4eae-800d-b95d9325c119) 3 | iOS Utils Enable the 'Fitness' Application for iOS version lower than iOS 16.0 4 | ⚠️Need install via TrollStore. Applicable iOS version [14.0, 16.0) 5 | 6 | ⚠️需要通过TrollStore安装。适用系统版本iOS [14.0, 16.0) 7 | ⚠️超小众需求,您需要满足以下条件: 8 | 1. iOS设备版本低于iOS16.0 9 | 2. 需要你有Apple Watch 10 | 3. 你有超过1个iPhone 11 | 12 | ⚠️Super niche demand, you need to meet the following conditions: 13 | 1. The iOS device version is lower than iOS16.0 14 | 2. You need to have an Apple Watch 15 | 3. You have more than 1 iPhone 16 | 17 | 本项目只适用于有Apple ID下有多个iPhone,并且有Apple Watch的用户,iPhone系统版本又在iOS 16.0以下的用户。 18 | 因为iOS 16.0开始系统已经为所有iPhone默认开启了健身应用,所以无需本插件。 19 | 如果您没有Apple Watch那么开启了也没有什么用。 20 | **如果你觉得没有什么用,那就对了,这个工具本身就是超小众需求。** 21 | 22 | 23 | 24 | 25 | ## Usage 26 | 1. Download the `EnableFitnessApp.tipa` file from [Releases](https://github.com/DevelopCubeLab/EnableFitnessApp/releases) page. 27 | 2. Use `TrollStore` to install. 28 | 29 | Zh: 30 | 1. 从[Releases](https://github.com/DevelopCubeLab/EnableFitnessApp/releases)页面下载`EnableFitnessApp.tipa`文件。 31 | 2. 使用`TrollStore`安装。 32 | 33 | ## Working principle 34 | 1. When installing [Fitness](https://apps.apple.com/app/fitness/id1208224953), system versions below iOS16.0 will detect whether the current iPhone has been paired with the Apple Watch, or has been paired before. If This App cannot be installed without pairing. 35 | 2. So by checking whether the `com.apple.Fitness.plist` file in the `/var/mobile/Library/Preferences` directory exists, we can directly complete this file. 36 | 3. You can also do it manually through `Filza`, download [com.apple.Fitness.plist](https://github.com/DevelopCubeLab/EnableFitnessApp/blob/main/Resources/com.apple.Fitness.plist) and [ com.apple.Fitness.activity-w idget.plist](https://github.com/DevelopCubeLab/EnableFitnessApp/blob/main/Resources/com.apple.Fitness.activity-widget.plist) into the `/var/mobile/Library/Preferences` directory, Then log out of the device from the App Just install it from Store [Fitness](https://apps.apple.com/app/fitness/id1208224953). 37 | 38 | ## 工作原理 39 | 1. iOS16.0以下系统版本在安装[Fitness](https://apps.apple.com/app/fitness/id1208224953)的时候会检测当前的iPhone是否已经与Apple Watch配对,或者曾经配对过,如果没有配对则无法安装这个App。 40 | 2. 所以通过检查`/var/mobile/Library/Preferences`目录下的`com.apple.Fitness.plist`文件是否存在,所以我们直接补全这个文件即可。 41 | 3. 您也可以手动通过`Filza`进行操作,下载[com.apple.Fitness.plist](https://github.com/DevelopCubeLab/EnableFitnessApp/blob/main/Resources/com.apple.Fitness.plist)和[com.apple.Fitness.activity-widget.plist](https://github.com/DevelopCubeLab/EnableFitnessApp/blob/main/Resources/com.apple.Fitness.activity-widget.plist)放到`/var/mobile/Library/Preferences`目录下,然后注销设备,从App Store安装即可[Fitness](https://apps.apple.com/app/fitness/id1208224953)。 42 | 43 | 44 | ## Build 45 | 1. Download [Theos](https://theos.dev/) 46 | 2. run `make package FINALPACKAGE=1 PACKAGE_FORMAT=ipa` 47 | 48 | ## License 49 | Apache License 2.0 50 | 51 | ## Thanks 52 | [TrollStore](https://github.com/opa334/TrollStore) 53 | Powered by ChatGPT 4o 54 | icon by `SF Symbols` 55 | -------------------------------------------------------------------------------- /RootViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class RootViewController: UIViewController { 4 | 5 | private let helper = EnableHelper() 6 | 7 | override func viewDidLoad() { 8 | super.viewDidLoad() 9 | 10 | // 设置背景颜色以区分 11 | self.view.backgroundColor = UIColor.systemBackground 12 | 13 | // 添加一个简单的标签 14 | let checkPermissionLabel = UILabel() 15 | checkPermissionLabel.translatesAutoresizingMaskIntoConstraints = false 16 | checkPermissionLabel.textAlignment = .center // 设置文本居中 17 | 18 | var enable = helper.checkInstallPermission() 19 | 20 | if(enable) { 21 | checkPermissionLabel.text = NSLocalizedString("Install_With_TrollStore_text", comment: "") 22 | checkPermissionLabel.textColor = UIColor.green 23 | } else { 24 | checkPermissionLabel.text = NSLocalizedString("Need_Install_With_TrollStore_text", comment: "") 25 | checkPermissionLabel.textColor = UIColor.red 26 | } 27 | 28 | // checkPermissionLabel.textColor = UIColor.label 29 | 30 | let checkFitnessLabel = UILabel() 31 | checkFitnessLabel.translatesAutoresizingMaskIntoConstraints = false 32 | checkFitnessLabel.textAlignment = .center // 设置文本居中 33 | checkFitnessLabel.numberOfLines = 0 // 允许自动换行 34 | checkFitnessLabel.lineBreakMode = .byWordWrapping // 在单词边界换行 35 | 36 | if #available(iOS 16.0, *) { 37 | checkFitnessLabel.text = NSLocalizedString("iOS16_text", comment: "") 38 | checkFitnessLabel.textColor = UIColor.red 39 | enable = false 40 | } else { 41 | checkFitnessLabel.text = NSLocalizedString("iOS15_text", comment: "") 42 | checkFitnessLabel.textColor = UIColor.label 43 | } 44 | 45 | let installProfileButton = UIButton(type: .system) 46 | installProfileButton.translatesAutoresizingMaskIntoConstraints = false 47 | installProfileButton.setTitle(NSLocalizedString("Install_Profile_text", comment: ""), for: .normal) 48 | installProfileButton.addTarget(self, action: #selector(onClickInstallProfileButton), for: .touchUpInside) 49 | installProfileButton.isEnabled = enable //如果没有TrollStore安装app不允许点击安装按钮 50 | 51 | let respringButton = UIButton(type: .system) 52 | respringButton.translatesAutoresizingMaskIntoConstraints = false 53 | respringButton.setTitle(NSLocalizedString("Respring_text", comment: ""), for: .normal) 54 | respringButton.addTarget(self, action: #selector(onClickRespringButton), for: .touchUpInside) 55 | respringButton.isEnabled = enable //如果没有TrollStore安装app不允许点击安装按钮 56 | 57 | 58 | let installFitnessButton = UIButton(type: .system) 59 | installFitnessButton.translatesAutoresizingMaskIntoConstraints = false 60 | installFitnessButton.setTitle(NSLocalizedString("Install_Fitness_Application_text", comment: ""), for: .normal) 61 | installFitnessButton.addTarget(self, action: #selector(onClickInstallFitnessButton), for: .touchUpInside) 62 | 63 | // 获取应用图标 64 | let appIcon = UIImage(named: "AppIcon") 65 | 66 | // 创建一个 UIImageView,尺寸为 50x50 67 | let imageView = UIImageView(image: appIcon) 68 | imageView.translatesAutoresizingMaskIntoConstraints = false // 禁用自动调整大小 69 | imageView.contentMode = .scaleAspectFit // 设置图片适应方式 70 | // 无障碍标签 71 | imageView.isAccessibilityElement = true // 声明这是一个可访问性元素 72 | imageView.accessibilityLabel = NSLocalizedString("CFBundleDisplayName", comment: "") 73 | 74 | let openSourceLabel = UILabel() 75 | openSourceLabel.translatesAutoresizingMaskIntoConstraints = false 76 | openSourceLabel.text = "GitHub" 77 | openSourceLabel.textAlignment = .center 78 | openSourceLabel.textColor = UIColor.label 79 | openSourceLabel.isUserInteractionEnabled = true // 可点击 80 | // 添加手势识别器 81 | let tapGesture = UITapGestureRecognizer(target: self, action: #selector(onClickOpenSourceButton)) 82 | openSourceLabel.addGestureRecognizer(tapGesture) 83 | 84 | // 将View添加到视图中 85 | self.view.addSubview(imageView) 86 | self.view.addSubview(checkPermissionLabel) 87 | self.view.addSubview(checkFitnessLabel) 88 | self.view.addSubview(installProfileButton) 89 | self.view.addSubview(respringButton) 90 | self.view.addSubview(installFitnessButton) 91 | self.view.addSubview(openSourceLabel) 92 | 93 | NSLayoutConstraint.activate([ 94 | 95 | imageView.widthAnchor.constraint(equalToConstant: 100), // 设置宽度 96 | imageView.heightAnchor.constraint(equalToConstant: 100), // 设置高度 97 | imageView.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), // 水平居中 98 | imageView.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 100), // 距离顶部100点 99 | 100 | checkPermissionLabel.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), // 水平居中 101 | checkPermissionLabel.topAnchor.constraint(equalTo: imageView.bottomAnchor, constant: 30), // checkPermissionLabel 在 imageView 底部,间隔 20 点 102 | checkPermissionLabel.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: 20), // 左侧边距 103 | checkPermissionLabel.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: -20), // 右侧边距 104 | 105 | checkFitnessLabel.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), // 水平居中 106 | checkFitnessLabel.topAnchor.constraint(equalTo: checkPermissionLabel.bottomAnchor, constant: 30), 107 | checkFitnessLabel.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: 20), // 左侧边距 108 | checkFitnessLabel.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: -20), // 右侧边距 109 | 110 | installProfileButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), // 水平居中 111 | installProfileButton.topAnchor.constraint(equalTo: checkFitnessLabel.bottomAnchor, constant: 20), 112 | installProfileButton.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: 20), // 左侧边距 113 | installProfileButton.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: -20), // 右侧边距 114 | 115 | respringButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), // 水平居中 116 | respringButton.topAnchor.constraint(equalTo: installProfileButton.bottomAnchor, constant: 30), 117 | respringButton.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: 20), // 左侧边距 118 | respringButton.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: -20), // 右侧边距 119 | 120 | installFitnessButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), // 水平居中 121 | installFitnessButton.topAnchor.constraint(equalTo: respringButton.bottomAnchor, constant: 30), 122 | installFitnessButton.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: 20), // 左侧边距 123 | installFitnessButton.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: -20), // 右侧边距 124 | 125 | openSourceLabel.widthAnchor.constraint(equalToConstant: 100), // 设置宽度 126 | openSourceLabel.heightAnchor.constraint(equalToConstant: 20), // 设置高度 127 | openSourceLabel.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), // 水平居中 128 | openSourceLabel.bottomAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.bottomAnchor, constant: -30) 129 | ]) 130 | 131 | self.view.layoutIfNeeded() 132 | 133 | } 134 | 135 | @objc func onClickInstallProfileButton() { 136 | 137 | let alertController: UIAlertController 138 | if(helper.copyFileToPreferences()) { 139 | alertController = UIAlertController(title: NSLocalizedString("Install_Success_title", comment: ""), message: NSLocalizedString("Install_Success_text", comment: ""), preferredStyle: .alert) 140 | } else { 141 | alertController = UIAlertController(title: NSLocalizedString("Install_Failed_title", comment: ""), message: NSLocalizedString("Install_Failed_text", comment: ""), preferredStyle: .alert) 142 | } 143 | 144 | // 添加一个按钮来关闭弹窗 145 | alertController.addAction(UIAlertAction(title: NSLocalizedString("Close_text", comment: ""), style: .default, handler: nil)) 146 | 147 | // 显示弹窗 148 | self.present(alertController, animated: true, completion: nil) 149 | } 150 | 151 | @objc func onClickRespringButton() { 152 | let deviceManager = DeviceManager() 153 | deviceManager.respring(); 154 | } 155 | 156 | @objc func onClickInstallFitnessButton() { 157 | if let url = URL(string: "https://apps.apple.com/app/fitness/id1208224953") { 158 | // 使用 UIApplication.shared.open 来打开链接 159 | UIApplication.shared.open(url, options: [:], completionHandler: nil) 160 | } 161 | } 162 | 163 | @objc func onClickOpenSourceButton() { 164 | if let url = URL(string: "https://github.com/DevelopCubeLab/EnableFitnessApp") { 165 | if UIApplication.shared.canOpenURL(url) { 166 | UIApplication.shared.open(url, options: [:], completionHandler: nil) 167 | } 168 | } 169 | } 170 | 171 | 172 | 173 | } 174 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------